dara-core 1.19.1__py3-none-any.whl → 1.20.0a1__py3-none-any.whl

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.
Files changed (51) hide show
  1. dara/core/__init__.py +1 -0
  2. dara/core/auth/basic.py +13 -7
  3. dara/core/auth/definitions.py +2 -2
  4. dara/core/auth/utils.py +1 -1
  5. dara/core/base_definitions.py +7 -42
  6. dara/core/data_utils.py +16 -17
  7. dara/core/definitions.py +8 -8
  8. dara/core/interactivity/__init__.py +4 -0
  9. dara/core/interactivity/actions.py +20 -22
  10. dara/core/interactivity/any_data_variable.py +7 -135
  11. dara/core/interactivity/any_variable.py +1 -1
  12. dara/core/interactivity/client_variable.py +71 -0
  13. dara/core/interactivity/data_variable.py +8 -266
  14. dara/core/interactivity/derived_data_variable.py +6 -290
  15. dara/core/interactivity/derived_variable.py +333 -199
  16. dara/core/interactivity/filtering.py +29 -2
  17. dara/core/interactivity/loop_variable.py +2 -2
  18. dara/core/interactivity/non_data_variable.py +5 -68
  19. dara/core/interactivity/plain_variable.py +87 -14
  20. dara/core/interactivity/server_variable.py +325 -0
  21. dara/core/interactivity/state_variable.py +2 -2
  22. dara/core/interactivity/switch_variable.py +15 -15
  23. dara/core/interactivity/tabular_variable.py +94 -0
  24. dara/core/interactivity/url_variable.py +10 -90
  25. dara/core/internal/cache_store/cache_store.py +5 -20
  26. dara/core/internal/dependency_resolution.py +27 -69
  27. dara/core/internal/devtools.py +10 -3
  28. dara/core/internal/execute_action.py +9 -3
  29. dara/core/internal/multi_resource_lock.py +70 -0
  30. dara/core/internal/normalization.py +0 -5
  31. dara/core/internal/pandas_utils.py +105 -3
  32. dara/core/internal/pool/definitions.py +1 -1
  33. dara/core/internal/pool/task_pool.py +1 -1
  34. dara/core/internal/registries.py +3 -2
  35. dara/core/internal/registry.py +1 -1
  36. dara/core/internal/registry_lookup.py +5 -3
  37. dara/core/internal/routing.py +52 -121
  38. dara/core/internal/store.py +2 -29
  39. dara/core/internal/tasks.py +372 -182
  40. dara/core/internal/utils.py +25 -3
  41. dara/core/internal/websocket.py +1 -1
  42. dara/core/js_tooling/js_utils.py +2 -0
  43. dara/core/logging.py +10 -6
  44. dara/core/persistence.py +26 -4
  45. dara/core/umd/dara.core.umd.js +742 -1381
  46. dara/core/visual/dynamic_component.py +10 -13
  47. {dara_core-1.19.1.dist-info → dara_core-1.20.0a1.dist-info}/METADATA +10 -10
  48. {dara_core-1.19.1.dist-info → dara_core-1.20.0a1.dist-info}/RECORD +51 -47
  49. {dara_core-1.19.1.dist-info → dara_core-1.20.0a1.dist-info}/LICENSE +0 -0
  50. {dara_core-1.19.1.dist-info → dara_core-1.20.0a1.dist-info}/WHEEL +0 -0
  51. {dara_core-1.19.1.dist-info → dara_core-1.20.0a1.dist-info}/entry_points.txt +0 -0
@@ -2761,7 +2761,7 @@
2761
2761
  };
2762
2762
  var LEAF = 1;
2763
2763
  var COLLISION = 2;
2764
- var INDEX = 3;
2764
+ var INDEX2 = 3;
2765
2765
  var ARRAY = 4;
2766
2766
  var empty = {
2767
2767
  __hamt_isEmpty: true
@@ -2790,7 +2790,7 @@
2790
2790
  };
2791
2791
  var IndexedNode = function IndexedNode2(edit, mask, children) {
2792
2792
  return {
2793
- type: INDEX,
2793
+ type: INDEX2,
2794
2794
  edit,
2795
2795
  mask,
2796
2796
  children,
@@ -2993,7 +2993,7 @@
2993
2993
  }
2994
2994
  return alt;
2995
2995
  }
2996
- case INDEX: {
2996
+ case INDEX2: {
2997
2997
  var frag = hashFragment(shift2, hash22);
2998
2998
  var bit = toBitmap(frag);
2999
2999
  if (node.mask & bit) {
@@ -3146,7 +3146,7 @@
3146
3146
  };
3147
3147
  case COLLISION:
3148
3148
  case ARRAY:
3149
- case INDEX:
3149
+ case INDEX2:
3150
3150
  var children = node.children;
3151
3151
  return lazyVisitChildren(children.length, children, 0, f, k);
3152
3152
  default:
@@ -37933,7 +37933,7 @@
37933
37933
  effect,
37934
37934
  data: {}
37935
37935
  };
37936
- var hash$2 = {
37936
+ var hash$1 = {
37937
37937
  left: "right",
37938
37938
  right: "left",
37939
37939
  bottom: "top",
@@ -37941,16 +37941,16 @@
37941
37941
  };
37942
37942
  function getOppositePlacement(placement) {
37943
37943
  return placement.replace(/left|right|bottom|top/g, function(matched) {
37944
- return hash$2[matched];
37944
+ return hash$1[matched];
37945
37945
  });
37946
37946
  }
37947
- var hash$1 = {
37947
+ var hash = {
37948
37948
  start: "end",
37949
37949
  end: "start"
37950
37950
  };
37951
37951
  function getOppositeVariationPlacement(placement) {
37952
37952
  return placement.replace(/start|end/g, function(matched) {
37953
- return hash$1[matched];
37953
+ return hash[matched];
37954
37954
  });
37955
37955
  }
37956
37956
  function getWindowScroll(node) {
@@ -56482,14 +56482,26 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56482
56482
  const maxDisconnectedTime = 1e4;
56483
56483
  const interPingInterval = 5e3;
56484
56484
  const maxAttempts = Math.round(maxDisconnectedTime / interAttemptTimeout);
56485
+ class TaskCancelledError extends Error {
56486
+ constructor(message, task_id) {
56487
+ super(message);
56488
+ this.task_id = task_id;
56489
+ }
56490
+ }
56491
+ class TaskError extends Error {
56492
+ constructor(message, task_id) {
56493
+ super(message);
56494
+ this.task_id = task_id;
56495
+ }
56496
+ }
56485
56497
  function isInitMessage(message) {
56486
56498
  return message.type === "init";
56487
56499
  }
56488
56500
  function isTaskNotification(message) {
56489
56501
  return message.type === "message" && "status" in message.message && "task_id" in message.message;
56490
56502
  }
56491
- function isServerTriggerMessage(message) {
56492
- return message.type === "message" && "data_id" in message.message;
56503
+ function isServerVariableMessage(message) {
56504
+ return message.type === "message" && "__type" in message.message && message.message.__type === "ServerVariable";
56493
56505
  }
56494
56506
  function isServerErrorMessage(message) {
56495
56507
  return message.type === "message" && "error" in message.message;
@@ -56615,6 +56627,12 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56615
56627
  map$2((msg) => msg.message)
56616
56628
  );
56617
56629
  }
56630
+ serverVariableMessages$() {
56631
+ return this.messages$.pipe(
56632
+ filter(isServerVariableMessage),
56633
+ map$2((msg) => msg.message)
56634
+ );
56635
+ }
56618
56636
  /**
56619
56637
  * Get the observable to receive the new channel when the socket reconnects
56620
56638
  */
@@ -56649,17 +56667,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56649
56667
  )
56650
56668
  );
56651
56669
  }
56652
- /**
56653
- * Get the observable to receive server trigger messages for a given data variable
56654
- *
56655
- * @param dataId id of the data variable triggered
56656
- */
56657
- serverTriggers$(dataId) {
56658
- return this.messages$.pipe(
56659
- filter(isServerTriggerMessage),
56660
- filter((msg) => msg.message?.data_id === dataId)
56661
- );
56662
- }
56663
56670
  /**
56664
56671
  * Get the observable to receive server error messages
56665
56672
  */
@@ -56690,21 +56697,21 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56690
56697
  return this.messages$.pipe(filter(isCustomMessage));
56691
56698
  }
56692
56699
  /**
56693
- * Returns a promise that will resolve when the task is completed. If the task is cancelled then this will throw an
56700
+ * Returns a promise that will resolve when the task is completed. If the task is cancelled or errored then this will throw an
56694
56701
  * error to signify that.
56695
56702
  *
56696
56703
  * @param task_id the id of the task to wait for
56697
56704
  */
56698
56705
  waitForTask(task_id) {
56699
56706
  return this.messages$.pipe(
56700
- filter(
56701
- (msg) => isTaskNotification(msg) && msg.message?.task_id === task_id && msg.message.status !== "PROGRESS"
56702
- /* PROGRESS */
56703
- // don't take progress updates
56704
- ),
56707
+ filter((msg) => {
56708
+ return isTaskNotification(msg) && msg.message?.task_id === task_id && msg.message.status !== "PROGRESS";
56709
+ }),
56705
56710
  map$2((msg) => {
56706
- if (isTaskNotification(msg) && msg.message.status === "CANCELED") {
56707
- throw new Error("CANCELED");
56711
+ if (msg.message.status === "CANCELED") {
56712
+ throw new TaskCancelledError("Task was cancelled", msg.message.task_id);
56713
+ } else if (msg.message.status === "ERROR") {
56714
+ throw new TaskError(msg.message.error, msg.message.task_id);
56708
56715
  }
56709
56716
  return msg;
56710
56717
  }),
@@ -56845,17 +56852,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56845
56852
  function isVariable(variable) {
56846
56853
  return variable && typeof variable == "object" && variable.hasOwnProperty("uid") && variable.hasOwnProperty("__typename") && variable.__typename.includes("Variable");
56847
56854
  }
56848
- function isUrlVariable(variable) {
56849
- return isVariable(variable) && variable.__typename === "UrlVariable";
56855
+ function isSingleVariable(variable) {
56856
+ return isVariable(variable) && variable.__typename === "Variable";
56850
56857
  }
56851
56858
  function isDerivedVariable(variable) {
56852
56859
  return isVariable(variable) && variable.__typename === "DerivedVariable";
56853
56860
  }
56854
- function isDataVariable(variable) {
56855
- return isVariable(variable) && variable.__typename === "DataVariable";
56856
- }
56857
- function isDerivedDataVariable(variable) {
56858
- return isVariable(variable) && variable.__typename === "DerivedDataVariable";
56861
+ function isServerVariable(variable) {
56862
+ return isVariable(variable) && variable.__typename === "ServerVariable";
56859
56863
  }
56860
56864
  function isLoopVariable(variable) {
56861
56865
  return variable && typeof variable == "object" && variable.hasOwnProperty("uid") && variable.hasOwnProperty("__typename") && variable.__typename === "LoopVariable";
@@ -56869,11 +56873,8 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56869
56873
  function isResolvedDerivedVariable(value) {
56870
56874
  return value && typeof value === "object" && "values" in value && "type" in value && value.type === "derived" && "uid" in value;
56871
56875
  }
56872
- function isResolvedDataVariable(value) {
56873
- return value && typeof value === "object" && "filters" in value && "type" in value && value.type === "data" && "uid" in value;
56874
- }
56875
- function isResolvedDerivedDataVariable(value) {
56876
- return value && typeof value === "object" && "filters" in value && "values" in value && "type" in value && value.type === "derived-data" && "uid" in value;
56876
+ function isResolvedServerVariable(value) {
56877
+ return value && typeof value === "object" && "type" in value && value.type === "server" && "uid" in value && "sequence_number" in value;
56877
56878
  }
56878
56879
  function isResolvedSwitchVariable(value) {
56879
56880
  return value && typeof value === "object" && "type" in value && value.type === "switch" && "uid" in value && "value_map" in value;
@@ -57011,813 +57012,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57011
57012
  });
57012
57013
  return res.ok;
57013
57014
  }
57014
- function commonjsRequire(path) {
57015
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
57016
- }
57017
- var object_hash = { exports: {} };
57018
- var hasRequiredObject_hash;
57019
- function requireObject_hash() {
57020
- if (hasRequiredObject_hash) return object_hash.exports;
57021
- hasRequiredObject_hash = 1;
57022
- (function(module2, exports2) {
57023
- !function(e2) {
57024
- module2.exports = e2();
57025
- }(function() {
57026
- return function r2(o2, i2, u) {
57027
- function s(n2, e3) {
57028
- if (!i2[n2]) {
57029
- if (!o2[n2]) {
57030
- var t2 = "function" == typeof commonjsRequire && commonjsRequire;
57031
- if (!e3 && t2) return t2(n2, true);
57032
- if (a2) return a2(n2, true);
57033
- throw new Error("Cannot find module '" + n2 + "'");
57034
- }
57035
- e3 = i2[n2] = { exports: {} };
57036
- o2[n2][0].call(e3.exports, function(e4) {
57037
- var t3 = o2[n2][1][e4];
57038
- return s(t3 || e4);
57039
- }, e3, e3.exports, r2, o2, i2, u);
57040
- }
57041
- return i2[n2].exports;
57042
- }
57043
- for (var a2 = "function" == typeof commonjsRequire && commonjsRequire, e2 = 0; e2 < u.length; e2++) s(u[e2]);
57044
- return s;
57045
- }({ 1: [function(w2, b2, m) {
57046
- !(function(e2, n2, s, c, d2, h, p2, g, y) {
57047
- var r2 = w2("crypto");
57048
- function t2(e3, t3) {
57049
- t3 = u(e3, t3);
57050
- var n3;
57051
- return void 0 === (n3 = "passthrough" !== t3.algorithm ? r2.createHash(t3.algorithm) : new l2()).write && (n3.write = n3.update, n3.end = n3.update), f(t3, n3).dispatch(e3), n3.update || n3.end(""), n3.digest ? n3.digest("buffer" === t3.encoding ? void 0 : t3.encoding) : (e3 = n3.read(), "buffer" !== t3.encoding ? e3.toString(t3.encoding) : e3);
57052
- }
57053
- (m = b2.exports = t2).sha1 = function(e3) {
57054
- return t2(e3);
57055
- }, m.keys = function(e3) {
57056
- return t2(e3, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
57057
- }, m.MD5 = function(e3) {
57058
- return t2(e3, { algorithm: "md5", encoding: "hex" });
57059
- }, m.keysMD5 = function(e3) {
57060
- return t2(e3, { algorithm: "md5", encoding: "hex", excludeValues: true });
57061
- };
57062
- var o2 = r2.getHashes ? r2.getHashes().slice() : ["sha1", "md5"], i2 = (o2.push("passthrough"), ["buffer", "hex", "binary", "base64"]);
57063
- function u(e3, t3) {
57064
- var n3 = {};
57065
- if (n3.algorithm = (t3 = t3 || {}).algorithm || "sha1", n3.encoding = t3.encoding || "hex", n3.excludeValues = !!t3.excludeValues, n3.algorithm = n3.algorithm.toLowerCase(), n3.encoding = n3.encoding.toLowerCase(), n3.ignoreUnknown = true === t3.ignoreUnknown, n3.respectType = false !== t3.respectType, n3.respectFunctionNames = false !== t3.respectFunctionNames, n3.respectFunctionProperties = false !== t3.respectFunctionProperties, n3.unorderedArrays = true === t3.unorderedArrays, n3.unorderedSets = false !== t3.unorderedSets, n3.unorderedObjects = false !== t3.unorderedObjects, n3.replacer = t3.replacer || void 0, n3.excludeKeys = t3.excludeKeys || void 0, void 0 === e3) throw new Error("Object argument required.");
57066
- for (var r3 = 0; r3 < o2.length; ++r3) o2[r3].toLowerCase() === n3.algorithm.toLowerCase() && (n3.algorithm = o2[r3]);
57067
- if (-1 === o2.indexOf(n3.algorithm)) throw new Error('Algorithm "' + n3.algorithm + '" not supported. supported values: ' + o2.join(", "));
57068
- if (-1 === i2.indexOf(n3.encoding) && "passthrough" !== n3.algorithm) throw new Error('Encoding "' + n3.encoding + '" not supported. supported values: ' + i2.join(", "));
57069
- return n3;
57070
- }
57071
- function a2(e3) {
57072
- if ("function" == typeof e3) return null != /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e3));
57073
- }
57074
- function f(o3, t3, i3) {
57075
- i3 = i3 || [];
57076
- function u2(e3) {
57077
- return t3.update ? t3.update(e3, "utf8") : t3.write(e3, "utf8");
57078
- }
57079
- return { dispatch: function(e3) {
57080
- return this["_" + (null === (e3 = o3.replacer ? o3.replacer(e3) : e3) ? "null" : typeof e3)](e3);
57081
- }, _object: function(t4) {
57082
- var n3, e3 = Object.prototype.toString.call(t4), r3 = /\[object (.*)\]/i.exec(e3);
57083
- r3 = (r3 = r3 ? r3[1] : "unknown:[" + e3 + "]").toLowerCase();
57084
- if (0 <= (e3 = i3.indexOf(t4))) return this.dispatch("[CIRCULAR:" + e3 + "]");
57085
- if (i3.push(t4), void 0 !== s && s.isBuffer && s.isBuffer(t4)) return u2("buffer:"), u2(t4);
57086
- if ("object" === r3 || "function" === r3 || "asyncfunction" === r3) return e3 = Object.keys(t4), o3.unorderedObjects && (e3 = e3.sort()), false === o3.respectType || a2(t4) || e3.splice(0, 0, "prototype", "__proto__", "constructor"), o3.excludeKeys && (e3 = e3.filter(function(e4) {
57087
- return !o3.excludeKeys(e4);
57088
- })), u2("object:" + e3.length + ":"), n3 = this, e3.forEach(function(e4) {
57089
- n3.dispatch(e4), u2(":"), o3.excludeValues || n3.dispatch(t4[e4]), u2(",");
57090
- });
57091
- if (!this["_" + r3]) {
57092
- if (o3.ignoreUnknown) return u2("[" + r3 + "]");
57093
- throw new Error('Unknown object type "' + r3 + '"');
57094
- }
57095
- this["_" + r3](t4);
57096
- }, _array: function(e3, t4) {
57097
- t4 = void 0 !== t4 ? t4 : false !== o3.unorderedArrays;
57098
- var n3 = this;
57099
- if (u2("array:" + e3.length + ":"), !t4 || e3.length <= 1) return e3.forEach(function(e4) {
57100
- return n3.dispatch(e4);
57101
- });
57102
- var r3 = [], t4 = e3.map(function(e4) {
57103
- var t5 = new l2(), n4 = i3.slice();
57104
- return f(o3, t5, n4).dispatch(e4), r3 = r3.concat(n4.slice(i3.length)), t5.read().toString();
57105
- });
57106
- return i3 = i3.concat(r3), t4.sort(), this._array(t4, false);
57107
- }, _date: function(e3) {
57108
- return u2("date:" + e3.toJSON());
57109
- }, _symbol: function(e3) {
57110
- return u2("symbol:" + e3.toString());
57111
- }, _error: function(e3) {
57112
- return u2("error:" + e3.toString());
57113
- }, _boolean: function(e3) {
57114
- return u2("bool:" + e3.toString());
57115
- }, _string: function(e3) {
57116
- u2("string:" + e3.length + ":"), u2(e3.toString());
57117
- }, _function: function(e3) {
57118
- u2("fn:"), a2(e3) ? this.dispatch("[native]") : this.dispatch(e3.toString()), false !== o3.respectFunctionNames && this.dispatch("function-name:" + String(e3.name)), o3.respectFunctionProperties && this._object(e3);
57119
- }, _number: function(e3) {
57120
- return u2("number:" + e3.toString());
57121
- }, _xml: function(e3) {
57122
- return u2("xml:" + e3.toString());
57123
- }, _null: function() {
57124
- return u2("Null");
57125
- }, _undefined: function() {
57126
- return u2("Undefined");
57127
- }, _regexp: function(e3) {
57128
- return u2("regex:" + e3.toString());
57129
- }, _uint8array: function(e3) {
57130
- return u2("uint8array:"), this.dispatch(Array.prototype.slice.call(e3));
57131
- }, _uint8clampedarray: function(e3) {
57132
- return u2("uint8clampedarray:"), this.dispatch(Array.prototype.slice.call(e3));
57133
- }, _int8array: function(e3) {
57134
- return u2("int8array:"), this.dispatch(Array.prototype.slice.call(e3));
57135
- }, _uint16array: function(e3) {
57136
- return u2("uint16array:"), this.dispatch(Array.prototype.slice.call(e3));
57137
- }, _int16array: function(e3) {
57138
- return u2("int16array:"), this.dispatch(Array.prototype.slice.call(e3));
57139
- }, _uint32array: function(e3) {
57140
- return u2("uint32array:"), this.dispatch(Array.prototype.slice.call(e3));
57141
- }, _int32array: function(e3) {
57142
- return u2("int32array:"), this.dispatch(Array.prototype.slice.call(e3));
57143
- }, _float32array: function(e3) {
57144
- return u2("float32array:"), this.dispatch(Array.prototype.slice.call(e3));
57145
- }, _float64array: function(e3) {
57146
- return u2("float64array:"), this.dispatch(Array.prototype.slice.call(e3));
57147
- }, _arraybuffer: function(e3) {
57148
- return u2("arraybuffer:"), this.dispatch(new Uint8Array(e3));
57149
- }, _url: function(e3) {
57150
- return u2("url:" + e3.toString());
57151
- }, _map: function(e3) {
57152
- u2("map:");
57153
- e3 = Array.from(e3);
57154
- return this._array(e3, false !== o3.unorderedSets);
57155
- }, _set: function(e3) {
57156
- u2("set:");
57157
- e3 = Array.from(e3);
57158
- return this._array(e3, false !== o3.unorderedSets);
57159
- }, _file: function(e3) {
57160
- return u2("file:"), this.dispatch([e3.name, e3.size, e3.type, e3.lastModfied]);
57161
- }, _blob: function() {
57162
- if (o3.ignoreUnknown) return u2("[blob]");
57163
- throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n');
57164
- }, _domwindow: function() {
57165
- return u2("domwindow");
57166
- }, _bigint: function(e3) {
57167
- return u2("bigint:" + e3.toString());
57168
- }, _process: function() {
57169
- return u2("process");
57170
- }, _timer: function() {
57171
- return u2("timer");
57172
- }, _pipe: function() {
57173
- return u2("pipe");
57174
- }, _tcp: function() {
57175
- return u2("tcp");
57176
- }, _udp: function() {
57177
- return u2("udp");
57178
- }, _tty: function() {
57179
- return u2("tty");
57180
- }, _statwatcher: function() {
57181
- return u2("statwatcher");
57182
- }, _securecontext: function() {
57183
- return u2("securecontext");
57184
- }, _connection: function() {
57185
- return u2("connection");
57186
- }, _zlib: function() {
57187
- return u2("zlib");
57188
- }, _context: function() {
57189
- return u2("context");
57190
- }, _nodescript: function() {
57191
- return u2("nodescript");
57192
- }, _httpparser: function() {
57193
- return u2("httpparser");
57194
- }, _dataview: function() {
57195
- return u2("dataview");
57196
- }, _signal: function() {
57197
- return u2("signal");
57198
- }, _fsevent: function() {
57199
- return u2("fsevent");
57200
- }, _tlswrap: function() {
57201
- return u2("tlswrap");
57202
- } };
57203
- }
57204
- function l2() {
57205
- return { buf: "", write: function(e3) {
57206
- this.buf += e3;
57207
- }, end: function(e3) {
57208
- this.buf += e3;
57209
- }, read: function() {
57210
- return this.buf;
57211
- } };
57212
- }
57213
- m.writeToStream = function(e3, t3, n3) {
57214
- return void 0 === n3 && (n3 = t3, t3 = {}), f(t3 = u(e3, t3), n3).dispatch(e3);
57215
- };
57216
- }).call(this, w2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, w2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/fake_9a5aa49d.js", "/");
57217
- }, { buffer: 3, crypto: 5, lYpoI2: 11 }], 2: [function(e2, t2, f) {
57218
- !(function(e3, t3, n2, r2, o2, i2, u, s, a2) {
57219
- !function(e4) {
57220
- var a3 = "undefined" != typeof Uint8Array ? Uint8Array : Array, t4 = "+".charCodeAt(0), n3 = "/".charCodeAt(0), r3 = "0".charCodeAt(0), o3 = "a".charCodeAt(0), i3 = "A".charCodeAt(0), u2 = "-".charCodeAt(0), s2 = "_".charCodeAt(0);
57221
- function f2(e5) {
57222
- e5 = e5.charCodeAt(0);
57223
- return e5 === t4 || e5 === u2 ? 62 : e5 === n3 || e5 === s2 ? 63 : e5 < r3 ? -1 : e5 < r3 + 10 ? e5 - r3 + 26 + 26 : e5 < i3 + 26 ? e5 - i3 : e5 < o3 + 26 ? e5 - o3 + 26 : void 0;
57224
- }
57225
- e4.toByteArray = function(e5) {
57226
- var t5, n4;
57227
- if (0 < e5.length % 4) throw new Error("Invalid string. Length must be a multiple of 4");
57228
- var r4 = e5.length, r4 = "=" === e5.charAt(r4 - 2) ? 2 : "=" === e5.charAt(r4 - 1) ? 1 : 0, o4 = new a3(3 * e5.length / 4 - r4), i4 = 0 < r4 ? e5.length - 4 : e5.length, u3 = 0;
57229
- function s3(e6) {
57230
- o4[u3++] = e6;
57231
- }
57232
- for (t5 = 0; t5 < i4; t5 += 4, 0) s3((16711680 & (n4 = f2(e5.charAt(t5)) << 18 | f2(e5.charAt(t5 + 1)) << 12 | f2(e5.charAt(t5 + 2)) << 6 | f2(e5.charAt(t5 + 3)))) >> 16), s3((65280 & n4) >> 8), s3(255 & n4);
57233
- return 2 == r4 ? s3(255 & (n4 = f2(e5.charAt(t5)) << 2 | f2(e5.charAt(t5 + 1)) >> 4)) : 1 == r4 && (s3((n4 = f2(e5.charAt(t5)) << 10 | f2(e5.charAt(t5 + 1)) << 4 | f2(e5.charAt(t5 + 2)) >> 2) >> 8 & 255), s3(255 & n4)), o4;
57234
- }, e4.fromByteArray = function(e5) {
57235
- var t5, n4, r4, o4, i4 = e5.length % 3, u3 = "";
57236
- function s3(e6) {
57237
- return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e6);
57238
- }
57239
- for (t5 = 0, r4 = e5.length - i4; t5 < r4; t5 += 3) n4 = (e5[t5] << 16) + (e5[t5 + 1] << 8) + e5[t5 + 2], u3 += s3((o4 = n4) >> 18 & 63) + s3(o4 >> 12 & 63) + s3(o4 >> 6 & 63) + s3(63 & o4);
57240
- switch (i4) {
57241
- case 1:
57242
- u3 = (u3 += s3((n4 = e5[e5.length - 1]) >> 2)) + s3(n4 << 4 & 63) + "==";
57243
- break;
57244
- case 2:
57245
- u3 = (u3 = (u3 += s3((n4 = (e5[e5.length - 2] << 8) + e5[e5.length - 1]) >> 10)) + s3(n4 >> 4 & 63)) + s3(n4 << 2 & 63) + "=";
57246
- }
57247
- return u3;
57248
- };
57249
- }(void 0 === f ? this.base64js = {} : f);
57250
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js", "/node_modules/gulp-browserify/node_modules/base64-js/lib");
57251
- }, { buffer: 3, lYpoI2: 11 }], 3: [function(O, e2, H) {
57252
- !(function(e3, n2, f, r2, h, p2, g, y, w2) {
57253
- var a2 = O("base64-js"), i2 = O("ieee754");
57254
- function f(e4, t3, n3) {
57255
- if (!(this instanceof f)) return new f(e4, t3, n3);
57256
- var r3, o3, i3, u2, s2 = typeof e4;
57257
- if ("base64" === t3 && "string" == s2) for (e4 = (u2 = e4).trim ? u2.trim() : u2.replace(/^\s+|\s+$/g, ""); e4.length % 4 != 0; ) e4 += "=";
57258
- if ("number" == s2) r3 = j(e4);
57259
- else if ("string" == s2) r3 = f.byteLength(e4, t3);
57260
- else {
57261
- if ("object" != s2) throw new Error("First argument needs to be a number, array or string.");
57262
- r3 = j(e4.length);
57263
- }
57264
- if (f._useTypedArrays ? o3 = f._augment(new Uint8Array(r3)) : ((o3 = this).length = r3, o3._isBuffer = true), f._useTypedArrays && "number" == typeof e4.byteLength) o3._set(e4);
57265
- else if (C(u2 = e4) || f.isBuffer(u2) || u2 && "object" == typeof u2 && "number" == typeof u2.length) for (i3 = 0; i3 < r3; i3++) f.isBuffer(e4) ? o3[i3] = e4.readUInt8(i3) : o3[i3] = e4[i3];
57266
- else if ("string" == s2) o3.write(e4, 0, t3);
57267
- else if ("number" == s2 && !f._useTypedArrays && !n3) for (i3 = 0; i3 < r3; i3++) o3[i3] = 0;
57268
- return o3;
57269
- }
57270
- function b2(e4, t3, n3, r3) {
57271
- return f._charsWritten = c(function(e5) {
57272
- for (var t4 = [], n4 = 0; n4 < e5.length; n4++) t4.push(255 & e5.charCodeAt(n4));
57273
- return t4;
57274
- }(t3), e4, n3, r3);
57275
- }
57276
- function m(e4, t3, n3, r3) {
57277
- return f._charsWritten = c(function(e5) {
57278
- for (var t4, n4, r4 = [], o3 = 0; o3 < e5.length; o3++) n4 = e5.charCodeAt(o3), t4 = n4 >> 8, n4 = n4 % 256, r4.push(n4), r4.push(t4);
57279
- return r4;
57280
- }(t3), e4, n3, r3);
57281
- }
57282
- function v(e4, t3, n3) {
57283
- var r3 = "";
57284
- n3 = Math.min(e4.length, n3);
57285
- for (var o3 = t3; o3 < n3; o3++) r3 += String.fromCharCode(e4[o3]);
57286
- return r3;
57287
- }
57288
- function o2(e4, t3, n3, r3) {
57289
- r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 1 < e4.length, "Trying to read beyond buffer length"));
57290
- var o3, r3 = e4.length;
57291
- if (!(r3 <= t3)) return n3 ? (o3 = e4[t3], t3 + 1 < r3 && (o3 |= e4[t3 + 1] << 8)) : (o3 = e4[t3] << 8, t3 + 1 < r3 && (o3 |= e4[t3 + 1])), o3;
57292
- }
57293
- function u(e4, t3, n3, r3) {
57294
- r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 3 < e4.length, "Trying to read beyond buffer length"));
57295
- var o3, r3 = e4.length;
57296
- if (!(r3 <= t3)) return n3 ? (t3 + 2 < r3 && (o3 = e4[t3 + 2] << 16), t3 + 1 < r3 && (o3 |= e4[t3 + 1] << 8), o3 |= e4[t3], t3 + 3 < r3 && (o3 += e4[t3 + 3] << 24 >>> 0)) : (t3 + 1 < r3 && (o3 = e4[t3 + 1] << 16), t3 + 2 < r3 && (o3 |= e4[t3 + 2] << 8), t3 + 3 < r3 && (o3 |= e4[t3 + 3]), o3 += e4[t3] << 24 >>> 0), o3;
57297
- }
57298
- function _(e4, t3, n3, r3) {
57299
- if (r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 1 < e4.length, "Trying to read beyond buffer length")), !(e4.length <= t3)) return r3 = o2(e4, t3, n3, true), 32768 & r3 ? -1 * (65535 - r3 + 1) : r3;
57300
- }
57301
- function E(e4, t3, n3, r3) {
57302
- if (r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 3 < e4.length, "Trying to read beyond buffer length")), !(e4.length <= t3)) return r3 = u(e4, t3, n3, true), 2147483648 & r3 ? -1 * (4294967295 - r3 + 1) : r3;
57303
- }
57304
- function I(e4, t3, n3, r3) {
57305
- return r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(t3 + 3 < e4.length, "Trying to read beyond buffer length")), i2.read(e4, t3, n3, 23, 4);
57306
- }
57307
- function A(e4, t3, n3, r3) {
57308
- return r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(t3 + 7 < e4.length, "Trying to read beyond buffer length")), i2.read(e4, t3, n3, 52, 8);
57309
- }
57310
- function s(e4, t3, n3, r3, o3) {
57311
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 1 < e4.length, "trying to write beyond buffer length"), Y(t3, 65535));
57312
- o3 = e4.length;
57313
- if (!(o3 <= n3)) for (var i3 = 0, u2 = Math.min(o3 - n3, 2); i3 < u2; i3++) e4[n3 + i3] = (t3 & 255 << 8 * (r3 ? i3 : 1 - i3)) >>> 8 * (r3 ? i3 : 1 - i3);
57314
- }
57315
- function l2(e4, t3, n3, r3, o3) {
57316
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 3 < e4.length, "trying to write beyond buffer length"), Y(t3, 4294967295));
57317
- o3 = e4.length;
57318
- if (!(o3 <= n3)) for (var i3 = 0, u2 = Math.min(o3 - n3, 4); i3 < u2; i3++) e4[n3 + i3] = t3 >>> 8 * (r3 ? i3 : 3 - i3) & 255;
57319
- }
57320
- function B(e4, t3, n3, r3, o3) {
57321
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 1 < e4.length, "Trying to write beyond buffer length"), F(t3, 32767, -32768)), e4.length <= n3 || s(e4, 0 <= t3 ? t3 : 65535 + t3 + 1, n3, r3, o3);
57322
- }
57323
- function L(e4, t3, n3, r3, o3) {
57324
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 3 < e4.length, "Trying to write beyond buffer length"), F(t3, 2147483647, -2147483648)), e4.length <= n3 || l2(e4, 0 <= t3 ? t3 : 4294967295 + t3 + 1, n3, r3, o3);
57325
- }
57326
- function U(e4, t3, n3, r3, o3) {
57327
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 3 < e4.length, "Trying to write beyond buffer length"), D(t3, 34028234663852886e22, -34028234663852886e22)), e4.length <= n3 || i2.write(e4, t3, n3, r3, 23, 4);
57328
- }
57329
- function x(e4, t3, n3, r3, o3) {
57330
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 7 < e4.length, "Trying to write beyond buffer length"), D(t3, 17976931348623157e292, -17976931348623157e292)), e4.length <= n3 || i2.write(e4, t3, n3, r3, 52, 8);
57331
- }
57332
- H.Buffer = f, H.SlowBuffer = f, H.INSPECT_MAX_BYTES = 50, f.poolSize = 8192, f._useTypedArrays = function() {
57333
- try {
57334
- var e4 = new ArrayBuffer(0), t3 = new Uint8Array(e4);
57335
- return t3.foo = function() {
57336
- return 42;
57337
- }, 42 === t3.foo() && "function" == typeof t3.subarray;
57338
- } catch (e5) {
57339
- return false;
57340
- }
57341
- }(), f.isEncoding = function(e4) {
57342
- switch (String(e4).toLowerCase()) {
57343
- case "hex":
57344
- case "utf8":
57345
- case "utf-8":
57346
- case "ascii":
57347
- case "binary":
57348
- case "base64":
57349
- case "raw":
57350
- case "ucs2":
57351
- case "ucs-2":
57352
- case "utf16le":
57353
- case "utf-16le":
57354
- return true;
57355
- default:
57356
- return false;
57357
- }
57358
- }, f.isBuffer = function(e4) {
57359
- return !(null == e4 || !e4._isBuffer);
57360
- }, f.byteLength = function(e4, t3) {
57361
- var n3;
57362
- switch (e4 += "", t3 || "utf8") {
57363
- case "hex":
57364
- n3 = e4.length / 2;
57365
- break;
57366
- case "utf8":
57367
- case "utf-8":
57368
- n3 = T(e4).length;
57369
- break;
57370
- case "ascii":
57371
- case "binary":
57372
- case "raw":
57373
- n3 = e4.length;
57374
- break;
57375
- case "base64":
57376
- n3 = M(e4).length;
57377
- break;
57378
- case "ucs2":
57379
- case "ucs-2":
57380
- case "utf16le":
57381
- case "utf-16le":
57382
- n3 = 2 * e4.length;
57383
- break;
57384
- default:
57385
- throw new Error("Unknown encoding");
57386
- }
57387
- return n3;
57388
- }, f.concat = function(e4, t3) {
57389
- if (d2(C(e4), "Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."), 0 === e4.length) return new f(0);
57390
- if (1 === e4.length) return e4[0];
57391
- if ("number" != typeof t3) for (o3 = t3 = 0; o3 < e4.length; o3++) t3 += e4[o3].length;
57392
- for (var n3 = new f(t3), r3 = 0, o3 = 0; o3 < e4.length; o3++) {
57393
- var i3 = e4[o3];
57394
- i3.copy(n3, r3), r3 += i3.length;
57395
- }
57396
- return n3;
57397
- }, f.prototype.write = function(e4, t3, n3, r3) {
57398
- isFinite(t3) ? isFinite(n3) || (r3 = n3, n3 = void 0) : (a3 = r3, r3 = t3, t3 = n3, n3 = a3), t3 = Number(t3) || 0;
57399
- var o3, i3, u2, s2, a3 = this.length - t3;
57400
- switch ((!n3 || a3 < (n3 = Number(n3))) && (n3 = a3), r3 = String(r3 || "utf8").toLowerCase()) {
57401
- case "hex":
57402
- o3 = function(e5, t4, n4, r4) {
57403
- n4 = Number(n4) || 0;
57404
- var o4 = e5.length - n4;
57405
- (!r4 || o4 < (r4 = Number(r4))) && (r4 = o4), d2((o4 = t4.length) % 2 == 0, "Invalid hex string"), o4 / 2 < r4 && (r4 = o4 / 2);
57406
- for (var i4 = 0; i4 < r4; i4++) {
57407
- var u3 = parseInt(t4.substr(2 * i4, 2), 16);
57408
- d2(!isNaN(u3), "Invalid hex string"), e5[n4 + i4] = u3;
57409
- }
57410
- return f._charsWritten = 2 * i4, i4;
57411
- }(this, e4, t3, n3);
57412
- break;
57413
- case "utf8":
57414
- case "utf-8":
57415
- i3 = this, u2 = t3, s2 = n3, o3 = f._charsWritten = c(T(e4), i3, u2, s2);
57416
- break;
57417
- case "ascii":
57418
- case "binary":
57419
- o3 = b2(this, e4, t3, n3);
57420
- break;
57421
- case "base64":
57422
- i3 = this, u2 = t3, s2 = n3, o3 = f._charsWritten = c(M(e4), i3, u2, s2);
57423
- break;
57424
- case "ucs2":
57425
- case "ucs-2":
57426
- case "utf16le":
57427
- case "utf-16le":
57428
- o3 = m(this, e4, t3, n3);
57429
- break;
57430
- default:
57431
- throw new Error("Unknown encoding");
57432
- }
57433
- return o3;
57434
- }, f.prototype.toString = function(e4, t3, n3) {
57435
- var r3, o3, i3, u2, s2 = this;
57436
- if (e4 = String(e4 || "utf8").toLowerCase(), t3 = Number(t3) || 0, (n3 = void 0 !== n3 ? Number(n3) : s2.length) === t3) return "";
57437
- switch (e4) {
57438
- case "hex":
57439
- r3 = function(e5, t4, n4) {
57440
- var r4 = e5.length;
57441
- (!t4 || t4 < 0) && (t4 = 0);
57442
- (!n4 || n4 < 0 || r4 < n4) && (n4 = r4);
57443
- for (var o4 = "", i4 = t4; i4 < n4; i4++) o4 += k(e5[i4]);
57444
- return o4;
57445
- }(s2, t3, n3);
57446
- break;
57447
- case "utf8":
57448
- case "utf-8":
57449
- r3 = function(e5, t4, n4) {
57450
- var r4 = "", o4 = "";
57451
- n4 = Math.min(e5.length, n4);
57452
- for (var i4 = t4; i4 < n4; i4++) e5[i4] <= 127 ? (r4 += N(o4) + String.fromCharCode(e5[i4]), o4 = "") : o4 += "%" + e5[i4].toString(16);
57453
- return r4 + N(o4);
57454
- }(s2, t3, n3);
57455
- break;
57456
- case "ascii":
57457
- case "binary":
57458
- r3 = v(s2, t3, n3);
57459
- break;
57460
- case "base64":
57461
- o3 = s2, u2 = n3, r3 = 0 === (i3 = t3) && u2 === o3.length ? a2.fromByteArray(o3) : a2.fromByteArray(o3.slice(i3, u2));
57462
- break;
57463
- case "ucs2":
57464
- case "ucs-2":
57465
- case "utf16le":
57466
- case "utf-16le":
57467
- r3 = function(e5, t4, n4) {
57468
- for (var r4 = e5.slice(t4, n4), o4 = "", i4 = 0; i4 < r4.length; i4 += 2) o4 += String.fromCharCode(r4[i4] + 256 * r4[i4 + 1]);
57469
- return o4;
57470
- }(s2, t3, n3);
57471
- break;
57472
- default:
57473
- throw new Error("Unknown encoding");
57474
- }
57475
- return r3;
57476
- }, f.prototype.toJSON = function() {
57477
- return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
57478
- }, f.prototype.copy = function(e4, t3, n3, r3) {
57479
- if (t3 = t3 || 0, (r3 = r3 || 0 === r3 ? r3 : this.length) !== (n3 = n3 || 0) && 0 !== e4.length && 0 !== this.length) {
57480
- d2(n3 <= r3, "sourceEnd < sourceStart"), d2(0 <= t3 && t3 < e4.length, "targetStart out of bounds"), d2(0 <= n3 && n3 < this.length, "sourceStart out of bounds"), d2(0 <= r3 && r3 <= this.length, "sourceEnd out of bounds"), r3 > this.length && (r3 = this.length);
57481
- var o3 = (r3 = e4.length - t3 < r3 - n3 ? e4.length - t3 + n3 : r3) - n3;
57482
- if (o3 < 100 || !f._useTypedArrays) for (var i3 = 0; i3 < o3; i3++) e4[i3 + t3] = this[i3 + n3];
57483
- else e4._set(this.subarray(n3, n3 + o3), t3);
57484
- }
57485
- }, f.prototype.slice = function(e4, t3) {
57486
- var n3 = this.length;
57487
- if (e4 = S(e4, n3, 0), t3 = S(t3, n3, n3), f._useTypedArrays) return f._augment(this.subarray(e4, t3));
57488
- for (var r3 = t3 - e4, o3 = new f(r3, void 0, true), i3 = 0; i3 < r3; i3++) o3[i3] = this[i3 + e4];
57489
- return o3;
57490
- }, f.prototype.get = function(e4) {
57491
- return console.log(".get() is deprecated. Access using array indexes instead."), this.readUInt8(e4);
57492
- }, f.prototype.set = function(e4, t3) {
57493
- return console.log(".set() is deprecated. Access using array indexes instead."), this.writeUInt8(e4, t3);
57494
- }, f.prototype.readUInt8 = function(e4, t3) {
57495
- if (t3 || (d2(null != e4, "missing offset"), d2(e4 < this.length, "Trying to read beyond buffer length")), !(e4 >= this.length)) return this[e4];
57496
- }, f.prototype.readUInt16LE = function(e4, t3) {
57497
- return o2(this, e4, true, t3);
57498
- }, f.prototype.readUInt16BE = function(e4, t3) {
57499
- return o2(this, e4, false, t3);
57500
- }, f.prototype.readUInt32LE = function(e4, t3) {
57501
- return u(this, e4, true, t3);
57502
- }, f.prototype.readUInt32BE = function(e4, t3) {
57503
- return u(this, e4, false, t3);
57504
- }, f.prototype.readInt8 = function(e4, t3) {
57505
- if (t3 || (d2(null != e4, "missing offset"), d2(e4 < this.length, "Trying to read beyond buffer length")), !(e4 >= this.length)) return 128 & this[e4] ? -1 * (255 - this[e4] + 1) : this[e4];
57506
- }, f.prototype.readInt16LE = function(e4, t3) {
57507
- return _(this, e4, true, t3);
57508
- }, f.prototype.readInt16BE = function(e4, t3) {
57509
- return _(this, e4, false, t3);
57510
- }, f.prototype.readInt32LE = function(e4, t3) {
57511
- return E(this, e4, true, t3);
57512
- }, f.prototype.readInt32BE = function(e4, t3) {
57513
- return E(this, e4, false, t3);
57514
- }, f.prototype.readFloatLE = function(e4, t3) {
57515
- return I(this, e4, true, t3);
57516
- }, f.prototype.readFloatBE = function(e4, t3) {
57517
- return I(this, e4, false, t3);
57518
- }, f.prototype.readDoubleLE = function(e4, t3) {
57519
- return A(this, e4, true, t3);
57520
- }, f.prototype.readDoubleBE = function(e4, t3) {
57521
- return A(this, e4, false, t3);
57522
- }, f.prototype.writeUInt8 = function(e4, t3, n3) {
57523
- n3 || (d2(null != e4, "missing value"), d2(null != t3, "missing offset"), d2(t3 < this.length, "trying to write beyond buffer length"), Y(e4, 255)), t3 >= this.length || (this[t3] = e4);
57524
- }, f.prototype.writeUInt16LE = function(e4, t3, n3) {
57525
- s(this, e4, t3, true, n3);
57526
- }, f.prototype.writeUInt16BE = function(e4, t3, n3) {
57527
- s(this, e4, t3, false, n3);
57528
- }, f.prototype.writeUInt32LE = function(e4, t3, n3) {
57529
- l2(this, e4, t3, true, n3);
57530
- }, f.prototype.writeUInt32BE = function(e4, t3, n3) {
57531
- l2(this, e4, t3, false, n3);
57532
- }, f.prototype.writeInt8 = function(e4, t3, n3) {
57533
- n3 || (d2(null != e4, "missing value"), d2(null != t3, "missing offset"), d2(t3 < this.length, "Trying to write beyond buffer length"), F(e4, 127, -128)), t3 >= this.length || (0 <= e4 ? this.writeUInt8(e4, t3, n3) : this.writeUInt8(255 + e4 + 1, t3, n3));
57534
- }, f.prototype.writeInt16LE = function(e4, t3, n3) {
57535
- B(this, e4, t3, true, n3);
57536
- }, f.prototype.writeInt16BE = function(e4, t3, n3) {
57537
- B(this, e4, t3, false, n3);
57538
- }, f.prototype.writeInt32LE = function(e4, t3, n3) {
57539
- L(this, e4, t3, true, n3);
57540
- }, f.prototype.writeInt32BE = function(e4, t3, n3) {
57541
- L(this, e4, t3, false, n3);
57542
- }, f.prototype.writeFloatLE = function(e4, t3, n3) {
57543
- U(this, e4, t3, true, n3);
57544
- }, f.prototype.writeFloatBE = function(e4, t3, n3) {
57545
- U(this, e4, t3, false, n3);
57546
- }, f.prototype.writeDoubleLE = function(e4, t3, n3) {
57547
- x(this, e4, t3, true, n3);
57548
- }, f.prototype.writeDoubleBE = function(e4, t3, n3) {
57549
- x(this, e4, t3, false, n3);
57550
- }, f.prototype.fill = function(e4, t3, n3) {
57551
- if (t3 = t3 || 0, n3 = n3 || this.length, d2("number" == typeof (e4 = "string" == typeof (e4 = e4 || 0) ? e4.charCodeAt(0) : e4) && !isNaN(e4), "value is not a number"), d2(t3 <= n3, "end < start"), n3 !== t3 && 0 !== this.length) {
57552
- d2(0 <= t3 && t3 < this.length, "start out of bounds"), d2(0 <= n3 && n3 <= this.length, "end out of bounds");
57553
- for (var r3 = t3; r3 < n3; r3++) this[r3] = e4;
57554
- }
57555
- }, f.prototype.inspect = function() {
57556
- for (var e4 = [], t3 = this.length, n3 = 0; n3 < t3; n3++) if (e4[n3] = k(this[n3]), n3 === H.INSPECT_MAX_BYTES) {
57557
- e4[n3 + 1] = "...";
57558
- break;
57559
- }
57560
- return "<Buffer " + e4.join(" ") + ">";
57561
- }, f.prototype.toArrayBuffer = function() {
57562
- if ("undefined" == typeof Uint8Array) throw new Error("Buffer.toArrayBuffer not supported in this browser");
57563
- if (f._useTypedArrays) return new f(this).buffer;
57564
- for (var e4 = new Uint8Array(this.length), t3 = 0, n3 = e4.length; t3 < n3; t3 += 1) e4[t3] = this[t3];
57565
- return e4.buffer;
57566
- };
57567
- var t2 = f.prototype;
57568
- function S(e4, t3, n3) {
57569
- return "number" != typeof e4 ? n3 : t3 <= (e4 = ~~e4) ? t3 : 0 <= e4 || 0 <= (e4 += t3) ? e4 : 0;
57570
- }
57571
- function j(e4) {
57572
- return (e4 = ~~Math.ceil(+e4)) < 0 ? 0 : e4;
57573
- }
57574
- function C(e4) {
57575
- return (Array.isArray || function(e5) {
57576
- return "[object Array]" === Object.prototype.toString.call(e5);
57577
- })(e4);
57578
- }
57579
- function k(e4) {
57580
- return e4 < 16 ? "0" + e4.toString(16) : e4.toString(16);
57581
- }
57582
- function T(e4) {
57583
- for (var t3 = [], n3 = 0; n3 < e4.length; n3++) {
57584
- var r3 = e4.charCodeAt(n3);
57585
- if (r3 <= 127) t3.push(e4.charCodeAt(n3));
57586
- else for (var o3 = n3, i3 = (55296 <= r3 && r3 <= 57343 && n3++, encodeURIComponent(e4.slice(o3, n3 + 1)).substr(1).split("%")), u2 = 0; u2 < i3.length; u2++) t3.push(parseInt(i3[u2], 16));
57587
- }
57588
- return t3;
57589
- }
57590
- function M(e4) {
57591
- return a2.toByteArray(e4);
57592
- }
57593
- function c(e4, t3, n3, r3) {
57594
- for (var o3 = 0; o3 < r3 && !(o3 + n3 >= t3.length || o3 >= e4.length); o3++) t3[o3 + n3] = e4[o3];
57595
- return o3;
57596
- }
57597
- function N(e4) {
57598
- try {
57599
- return decodeURIComponent(e4);
57600
- } catch (e5) {
57601
- return String.fromCharCode(65533);
57602
- }
57603
- }
57604
- function Y(e4, t3) {
57605
- d2("number" == typeof e4, "cannot write a non-number as a number"), d2(0 <= e4, "specified a negative value for writing an unsigned value"), d2(e4 <= t3, "value is larger than maximum value for type"), d2(Math.floor(e4) === e4, "value has a fractional component");
57606
- }
57607
- function F(e4, t3, n3) {
57608
- d2("number" == typeof e4, "cannot write a non-number as a number"), d2(e4 <= t3, "value larger than maximum allowed value"), d2(n3 <= e4, "value smaller than minimum allowed value"), d2(Math.floor(e4) === e4, "value has a fractional component");
57609
- }
57610
- function D(e4, t3, n3) {
57611
- d2("number" == typeof e4, "cannot write a non-number as a number"), d2(e4 <= t3, "value larger than maximum allowed value"), d2(n3 <= e4, "value smaller than minimum allowed value");
57612
- }
57613
- function d2(e4, t3) {
57614
- if (!e4) throw new Error(t3 || "Failed assertion");
57615
- }
57616
- f._augment = function(e4) {
57617
- return e4._isBuffer = true, e4._get = e4.get, e4._set = e4.set, e4.get = t2.get, e4.set = t2.set, e4.write = t2.write, e4.toString = t2.toString, e4.toLocaleString = t2.toString, e4.toJSON = t2.toJSON, e4.copy = t2.copy, e4.slice = t2.slice, e4.readUInt8 = t2.readUInt8, e4.readUInt16LE = t2.readUInt16LE, e4.readUInt16BE = t2.readUInt16BE, e4.readUInt32LE = t2.readUInt32LE, e4.readUInt32BE = t2.readUInt32BE, e4.readInt8 = t2.readInt8, e4.readInt16LE = t2.readInt16LE, e4.readInt16BE = t2.readInt16BE, e4.readInt32LE = t2.readInt32LE, e4.readInt32BE = t2.readInt32BE, e4.readFloatLE = t2.readFloatLE, e4.readFloatBE = t2.readFloatBE, e4.readDoubleLE = t2.readDoubleLE, e4.readDoubleBE = t2.readDoubleBE, e4.writeUInt8 = t2.writeUInt8, e4.writeUInt16LE = t2.writeUInt16LE, e4.writeUInt16BE = t2.writeUInt16BE, e4.writeUInt32LE = t2.writeUInt32LE, e4.writeUInt32BE = t2.writeUInt32BE, e4.writeInt8 = t2.writeInt8, e4.writeInt16LE = t2.writeInt16LE, e4.writeInt16BE = t2.writeInt16BE, e4.writeInt32LE = t2.writeInt32LE, e4.writeInt32BE = t2.writeInt32BE, e4.writeFloatLE = t2.writeFloatLE, e4.writeFloatBE = t2.writeFloatBE, e4.writeDoubleLE = t2.writeDoubleLE, e4.writeDoubleBE = t2.writeDoubleBE, e4.fill = t2.fill, e4.inspect = t2.inspect, e4.toArrayBuffer = t2.toArrayBuffer, e4;
57618
- };
57619
- }).call(this, O("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, O("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/buffer/index.js", "/node_modules/gulp-browserify/node_modules/buffer");
57620
- }, { "base64-js": 2, buffer: 3, ieee754: 10, lYpoI2: 11 }], 4: [function(c, d2, e2) {
57621
- !(function(e3, t2, a2, n2, r2, o2, i2, u, s) {
57622
- var a2 = c("buffer").Buffer, f = 4, l2 = new a2(f);
57623
- l2.fill(0);
57624
- d2.exports = { hash: function(e4, t3, n3, r3) {
57625
- for (var o3 = t3(function(e5, t4) {
57626
- e5.length % f != 0 && (n4 = e5.length + (f - e5.length % f), e5 = a2.concat([e5, l2], n4));
57627
- for (var n4, r4 = [], o4 = t4 ? e5.readInt32BE : e5.readInt32LE, i4 = 0; i4 < e5.length; i4 += f) r4.push(o4.call(e5, i4));
57628
- return r4;
57629
- }(e4 = a2.isBuffer(e4) ? e4 : new a2(e4), r3), 8 * e4.length), t3 = r3, i3 = new a2(n3), u2 = t3 ? i3.writeInt32BE : i3.writeInt32LE, s2 = 0; s2 < o3.length; s2++) u2.call(i3, o3[s2], 4 * s2, true);
57630
- return i3;
57631
- } };
57632
- }).call(this, c("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, c("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57633
- }, { buffer: 3, lYpoI2: 11 }], 5: [function(v, e2, _) {
57634
- !(function(l2, c, u, d2, h, p2, g, y, w2) {
57635
- var u = v("buffer").Buffer, e3 = v("./sha"), t2 = v("./sha256"), n2 = v("./rng"), b2 = { sha1: e3, sha256: t2, md5: v("./md5") }, s = 64, a2 = new u(s);
57636
- function r2(e4, n3) {
57637
- var r3 = b2[e4 = e4 || "sha1"], o3 = [];
57638
- return r3 || i2("algorithm:", e4, "is not yet supported"), { update: function(e5) {
57639
- return u.isBuffer(e5) || (e5 = new u(e5)), o3.push(e5), e5.length, this;
57640
- }, digest: function(e5) {
57641
- var t3 = u.concat(o3), t3 = n3 ? function(e6, t4, n4) {
57642
- u.isBuffer(t4) || (t4 = new u(t4)), u.isBuffer(n4) || (n4 = new u(n4)), t4.length > s ? t4 = e6(t4) : t4.length < s && (t4 = u.concat([t4, a2], s));
57643
- for (var r4 = new u(s), o4 = new u(s), i3 = 0; i3 < s; i3++) r4[i3] = 54 ^ t4[i3], o4[i3] = 92 ^ t4[i3];
57644
- return n4 = e6(u.concat([r4, n4])), e6(u.concat([o4, n4]));
57645
- }(r3, n3, t3) : r3(t3);
57646
- return o3 = null, e5 ? t3.toString(e5) : t3;
57647
- } };
57648
- }
57649
- function i2() {
57650
- var e4 = [].slice.call(arguments).join(" ");
57651
- throw new Error([e4, "we accept pull requests", "http://github.com/dominictarr/crypto-browserify"].join("\n"));
57652
- }
57653
- a2.fill(0), _.createHash = function(e4) {
57654
- return r2(e4);
57655
- }, _.createHmac = r2, _.randomBytes = function(e4, t3) {
57656
- if (!t3 || !t3.call) return new u(n2(e4));
57657
- try {
57658
- t3.call(this, void 0, new u(n2(e4)));
57659
- } catch (e5) {
57660
- t3(e5);
57661
- }
57662
- };
57663
- var o2, f = ["createCredentials", "createCipher", "createCipheriv", "createDecipher", "createDecipheriv", "createSign", "createVerify", "createDiffieHellman", "pbkdf2"], m = function(e4) {
57664
- _[e4] = function() {
57665
- i2("sorry,", e4, "is not implemented yet");
57666
- };
57667
- };
57668
- for (o2 in f) m(f[o2]);
57669
- }).call(this, v("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, v("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57670
- }, { "./md5": 6, "./rng": 7, "./sha": 8, "./sha256": 9, buffer: 3, lYpoI2: 11 }], 6: [function(w2, b2, e2) {
57671
- !(function(e3, r2, o2, i2, u, a2, f, l2, y) {
57672
- var t2 = w2("./helpers");
57673
- function n2(e4, t3) {
57674
- e4[t3 >> 5] |= 128 << t3 % 32, e4[14 + (t3 + 64 >>> 9 << 4)] = t3;
57675
- for (var n3 = 1732584193, r3 = -271733879, o3 = -1732584194, i3 = 271733878, u2 = 0; u2 < e4.length; u2 += 16) {
57676
- var s2 = n3, a3 = r3, f2 = o3, l3 = i3, n3 = c(n3, r3, o3, i3, e4[u2 + 0], 7, -680876936), i3 = c(i3, n3, r3, o3, e4[u2 + 1], 12, -389564586), o3 = c(o3, i3, n3, r3, e4[u2 + 2], 17, 606105819), r3 = c(r3, o3, i3, n3, e4[u2 + 3], 22, -1044525330);
57677
- n3 = c(n3, r3, o3, i3, e4[u2 + 4], 7, -176418897), i3 = c(i3, n3, r3, o3, e4[u2 + 5], 12, 1200080426), o3 = c(o3, i3, n3, r3, e4[u2 + 6], 17, -1473231341), r3 = c(r3, o3, i3, n3, e4[u2 + 7], 22, -45705983), n3 = c(n3, r3, o3, i3, e4[u2 + 8], 7, 1770035416), i3 = c(i3, n3, r3, o3, e4[u2 + 9], 12, -1958414417), o3 = c(o3, i3, n3, r3, e4[u2 + 10], 17, -42063), r3 = c(r3, o3, i3, n3, e4[u2 + 11], 22, -1990404162), n3 = c(n3, r3, o3, i3, e4[u2 + 12], 7, 1804603682), i3 = c(i3, n3, r3, o3, e4[u2 + 13], 12, -40341101), o3 = c(o3, i3, n3, r3, e4[u2 + 14], 17, -1502002290), n3 = d2(n3, r3 = c(r3, o3, i3, n3, e4[u2 + 15], 22, 1236535329), o3, i3, e4[u2 + 1], 5, -165796510), i3 = d2(i3, n3, r3, o3, e4[u2 + 6], 9, -1069501632), o3 = d2(o3, i3, n3, r3, e4[u2 + 11], 14, 643717713), r3 = d2(r3, o3, i3, n3, e4[u2 + 0], 20, -373897302), n3 = d2(n3, r3, o3, i3, e4[u2 + 5], 5, -701558691), i3 = d2(i3, n3, r3, o3, e4[u2 + 10], 9, 38016083), o3 = d2(o3, i3, n3, r3, e4[u2 + 15], 14, -660478335), r3 = d2(r3, o3, i3, n3, e4[u2 + 4], 20, -405537848), n3 = d2(n3, r3, o3, i3, e4[u2 + 9], 5, 568446438), i3 = d2(i3, n3, r3, o3, e4[u2 + 14], 9, -1019803690), o3 = d2(o3, i3, n3, r3, e4[u2 + 3], 14, -187363961), r3 = d2(r3, o3, i3, n3, e4[u2 + 8], 20, 1163531501), n3 = d2(n3, r3, o3, i3, e4[u2 + 13], 5, -1444681467), i3 = d2(i3, n3, r3, o3, e4[u2 + 2], 9, -51403784), o3 = d2(o3, i3, n3, r3, e4[u2 + 7], 14, 1735328473), n3 = h(n3, r3 = d2(r3, o3, i3, n3, e4[u2 + 12], 20, -1926607734), o3, i3, e4[u2 + 5], 4, -378558), i3 = h(i3, n3, r3, o3, e4[u2 + 8], 11, -2022574463), o3 = h(o3, i3, n3, r3, e4[u2 + 11], 16, 1839030562), r3 = h(r3, o3, i3, n3, e4[u2 + 14], 23, -35309556), n3 = h(n3, r3, o3, i3, e4[u2 + 1], 4, -1530992060), i3 = h(i3, n3, r3, o3, e4[u2 + 4], 11, 1272893353), o3 = h(o3, i3, n3, r3, e4[u2 + 7], 16, -155497632), r3 = h(r3, o3, i3, n3, e4[u2 + 10], 23, -1094730640), n3 = h(n3, r3, o3, i3, e4[u2 + 13], 4, 681279174), i3 = h(i3, n3, r3, o3, e4[u2 + 0], 11, -358537222), o3 = h(o3, i3, n3, r3, e4[u2 + 3], 16, -722521979), r3 = h(r3, o3, i3, n3, e4[u2 + 6], 23, 76029189), n3 = h(n3, r3, o3, i3, e4[u2 + 9], 4, -640364487), i3 = h(i3, n3, r3, o3, e4[u2 + 12], 11, -421815835), o3 = h(o3, i3, n3, r3, e4[u2 + 15], 16, 530742520), n3 = p2(n3, r3 = h(r3, o3, i3, n3, e4[u2 + 2], 23, -995338651), o3, i3, e4[u2 + 0], 6, -198630844), i3 = p2(i3, n3, r3, o3, e4[u2 + 7], 10, 1126891415), o3 = p2(o3, i3, n3, r3, e4[u2 + 14], 15, -1416354905), r3 = p2(r3, o3, i3, n3, e4[u2 + 5], 21, -57434055), n3 = p2(n3, r3, o3, i3, e4[u2 + 12], 6, 1700485571), i3 = p2(i3, n3, r3, o3, e4[u2 + 3], 10, -1894986606), o3 = p2(o3, i3, n3, r3, e4[u2 + 10], 15, -1051523), r3 = p2(r3, o3, i3, n3, e4[u2 + 1], 21, -2054922799), n3 = p2(n3, r3, o3, i3, e4[u2 + 8], 6, 1873313359), i3 = p2(i3, n3, r3, o3, e4[u2 + 15], 10, -30611744), o3 = p2(o3, i3, n3, r3, e4[u2 + 6], 15, -1560198380), r3 = p2(r3, o3, i3, n3, e4[u2 + 13], 21, 1309151649), n3 = p2(n3, r3, o3, i3, e4[u2 + 4], 6, -145523070), i3 = p2(i3, n3, r3, o3, e4[u2 + 11], 10, -1120210379), o3 = p2(o3, i3, n3, r3, e4[u2 + 2], 15, 718787259), r3 = p2(r3, o3, i3, n3, e4[u2 + 9], 21, -343485551), n3 = g(n3, s2), r3 = g(r3, a3), o3 = g(o3, f2), i3 = g(i3, l3);
57678
- }
57679
- return Array(n3, r3, o3, i3);
57680
- }
57681
- function s(e4, t3, n3, r3, o3, i3) {
57682
- return g((t3 = g(g(t3, e4), g(r3, i3))) << o3 | t3 >>> 32 - o3, n3);
57683
- }
57684
- function c(e4, t3, n3, r3, o3, i3, u2) {
57685
- return s(t3 & n3 | ~t3 & r3, e4, t3, o3, i3, u2);
57686
- }
57687
- function d2(e4, t3, n3, r3, o3, i3, u2) {
57688
- return s(t3 & r3 | n3 & ~r3, e4, t3, o3, i3, u2);
57689
- }
57690
- function h(e4, t3, n3, r3, o3, i3, u2) {
57691
- return s(t3 ^ n3 ^ r3, e4, t3, o3, i3, u2);
57692
- }
57693
- function p2(e4, t3, n3, r3, o3, i3, u2) {
57694
- return s(n3 ^ (t3 | ~r3), e4, t3, o3, i3, u2);
57695
- }
57696
- function g(e4, t3) {
57697
- var n3 = (65535 & e4) + (65535 & t3);
57698
- return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
57699
- }
57700
- b2.exports = function(e4) {
57701
- return t2.hash(e4, n2, 16);
57702
- };
57703
- }).call(this, w2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, w2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57704
- }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 7: [function(e2, l2, t2) {
57705
- !(function(e3, t3, n2, r2, o2, i2, u, s, f) {
57706
- l2.exports = function(e4) {
57707
- for (var t4, n3 = new Array(e4), r3 = 0; r3 < e4; r3++) 0 == (3 & r3) && (t4 = 4294967296 * Math.random()), n3[r3] = t4 >>> ((3 & r3) << 3) & 255;
57708
- return n3;
57709
- };
57710
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57711
- }, { buffer: 3, lYpoI2: 11 }], 8: [function(c, d2, e2) {
57712
- !(function(e3, t2, n2, r2, o2, s, a2, f, l2) {
57713
- var i2 = c("./helpers");
57714
- function u(l3, c2) {
57715
- l3[c2 >> 5] |= 128 << 24 - c2 % 32, l3[15 + (c2 + 64 >> 9 << 4)] = c2;
57716
- for (var e4, t3, n3, r3 = Array(80), o3 = 1732584193, i3 = -271733879, u2 = -1732584194, s2 = 271733878, d3 = -1009589776, h = 0; h < l3.length; h += 16) {
57717
- for (var p2 = o3, g = i3, y = u2, w2 = s2, b2 = d3, a3 = 0; a3 < 80; a3++) {
57718
- r3[a3] = a3 < 16 ? l3[h + a3] : v(r3[a3 - 3] ^ r3[a3 - 8] ^ r3[a3 - 14] ^ r3[a3 - 16], 1);
57719
- var f2 = m(m(v(o3, 5), (f2 = i3, t3 = u2, n3 = s2, (e4 = a3) < 20 ? f2 & t3 | ~f2 & n3 : !(e4 < 40) && e4 < 60 ? f2 & t3 | f2 & n3 | t3 & n3 : f2 ^ t3 ^ n3)), m(m(d3, r3[a3]), (e4 = a3) < 20 ? 1518500249 : e4 < 40 ? 1859775393 : e4 < 60 ? -1894007588 : -899497514)), d3 = s2, s2 = u2, u2 = v(i3, 30), i3 = o3, o3 = f2;
57720
- }
57721
- o3 = m(o3, p2), i3 = m(i3, g), u2 = m(u2, y), s2 = m(s2, w2), d3 = m(d3, b2);
57722
- }
57723
- return Array(o3, i3, u2, s2, d3);
57724
- }
57725
- function m(e4, t3) {
57726
- var n3 = (65535 & e4) + (65535 & t3);
57727
- return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
57728
- }
57729
- function v(e4, t3) {
57730
- return e4 << t3 | e4 >>> 32 - t3;
57731
- }
57732
- d2.exports = function(e4) {
57733
- return i2.hash(e4, u, 20, true);
57734
- };
57735
- }).call(this, c("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, c("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57736
- }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 9: [function(c, d2, e2) {
57737
- !(function(e3, t2, n2, r2, u, s, a2, f, l2) {
57738
- function b2(e4, t3) {
57739
- var n3 = (65535 & e4) + (65535 & t3);
57740
- return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
57741
- }
57742
- function o2(e4, l3) {
57743
- var c2, d3 = new Array(1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298), t3 = new Array(1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225), n3 = new Array(64);
57744
- e4[l3 >> 5] |= 128 << 24 - l3 % 32, e4[15 + (l3 + 64 >> 9 << 4)] = l3;
57745
- for (var r3, o3, h = 0; h < e4.length; h += 16) {
57746
- for (var i3 = t3[0], u2 = t3[1], s2 = t3[2], p2 = t3[3], a3 = t3[4], g = t3[5], y = t3[6], w2 = t3[7], f2 = 0; f2 < 64; f2++) n3[f2] = f2 < 16 ? e4[f2 + h] : b2(b2(b2((o3 = n3[f2 - 2], m(o3, 17) ^ m(o3, 19) ^ v(o3, 10)), n3[f2 - 7]), (o3 = n3[f2 - 15], m(o3, 7) ^ m(o3, 18) ^ v(o3, 3))), n3[f2 - 16]), c2 = b2(b2(b2(b2(w2, m(o3 = a3, 6) ^ m(o3, 11) ^ m(o3, 25)), a3 & g ^ ~a3 & y), d3[f2]), n3[f2]), r3 = b2(m(r3 = i3, 2) ^ m(r3, 13) ^ m(r3, 22), i3 & u2 ^ i3 & s2 ^ u2 & s2), w2 = y, y = g, g = a3, a3 = b2(p2, c2), p2 = s2, s2 = u2, u2 = i3, i3 = b2(c2, r3);
57747
- t3[0] = b2(i3, t3[0]), t3[1] = b2(u2, t3[1]), t3[2] = b2(s2, t3[2]), t3[3] = b2(p2, t3[3]), t3[4] = b2(a3, t3[4]), t3[5] = b2(g, t3[5]), t3[6] = b2(y, t3[6]), t3[7] = b2(w2, t3[7]);
57748
- }
57749
- return t3;
57750
- }
57751
- var i2 = c("./helpers"), m = function(e4, t3) {
57752
- return e4 >>> t3 | e4 << 32 - t3;
57753
- }, v = function(e4, t3) {
57754
- return e4 >>> t3;
57755
- };
57756
- d2.exports = function(e4) {
57757
- return i2.hash(e4, o2, 32, true);
57758
- };
57759
- }).call(this, c("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, c("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57760
- }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 10: [function(e2, t2, f) {
57761
- !(function(e3, t3, n2, r2, o2, i2, u, s, a2) {
57762
- f.read = function(e4, t4, n3, r3, o3) {
57763
- var i3, u2, l2 = 8 * o3 - r3 - 1, c = (1 << l2) - 1, d2 = c >> 1, s2 = -7, a3 = n3 ? o3 - 1 : 0, f2 = n3 ? -1 : 1, o3 = e4[t4 + a3];
57764
- for (a3 += f2, i3 = o3 & (1 << -s2) - 1, o3 >>= -s2, s2 += l2; 0 < s2; i3 = 256 * i3 + e4[t4 + a3], a3 += f2, s2 -= 8) ;
57765
- for (u2 = i3 & (1 << -s2) - 1, i3 >>= -s2, s2 += r3; 0 < s2; u2 = 256 * u2 + e4[t4 + a3], a3 += f2, s2 -= 8) ;
57766
- if (0 === i3) i3 = 1 - d2;
57767
- else {
57768
- if (i3 === c) return u2 ? NaN : 1 / 0 * (o3 ? -1 : 1);
57769
- u2 += Math.pow(2, r3), i3 -= d2;
57770
- }
57771
- return (o3 ? -1 : 1) * u2 * Math.pow(2, i3 - r3);
57772
- }, f.write = function(e4, t4, l2, n3, r3, c) {
57773
- var o3, i3, u2 = 8 * c - r3 - 1, s2 = (1 << u2) - 1, a3 = s2 >> 1, d2 = 23 === r3 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f2 = n3 ? 0 : c - 1, h = n3 ? 1 : -1, c = t4 < 0 || 0 === t4 && 1 / t4 < 0 ? 1 : 0;
57774
- for (t4 = Math.abs(t4), isNaN(t4) || t4 === 1 / 0 ? (i3 = isNaN(t4) ? 1 : 0, o3 = s2) : (o3 = Math.floor(Math.log(t4) / Math.LN2), t4 * (n3 = Math.pow(2, -o3)) < 1 && (o3--, n3 *= 2), 2 <= (t4 += 1 <= o3 + a3 ? d2 / n3 : d2 * Math.pow(2, 1 - a3)) * n3 && (o3++, n3 /= 2), s2 <= o3 + a3 ? (i3 = 0, o3 = s2) : 1 <= o3 + a3 ? (i3 = (t4 * n3 - 1) * Math.pow(2, r3), o3 += a3) : (i3 = t4 * Math.pow(2, a3 - 1) * Math.pow(2, r3), o3 = 0)); 8 <= r3; e4[l2 + f2] = 255 & i3, f2 += h, i3 /= 256, r3 -= 8) ;
57775
- for (o3 = o3 << r3 | i3, u2 += r3; 0 < u2; e4[l2 + f2] = 255 & o3, f2 += h, o3 /= 256, u2 -= 8) ;
57776
- e4[l2 + f2 - h] |= 128 * c;
57777
- };
57778
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/ieee754/index.js", "/node_modules/gulp-browserify/node_modules/ieee754");
57779
- }, { buffer: 3, lYpoI2: 11 }], 11: [function(e2, h, t2) {
57780
- !(function(e3, t3, n2, r2, o2, f, l2, c, d2) {
57781
- var i2, u, s;
57782
- function a2() {
57783
- }
57784
- (e3 = h.exports = {}).nextTick = (u = "undefined" != typeof window && window.setImmediate, s = "undefined" != typeof window && window.postMessage && window.addEventListener, u ? function(e4) {
57785
- return window.setImmediate(e4);
57786
- } : s ? (i2 = [], window.addEventListener("message", function(e4) {
57787
- var t4 = e4.source;
57788
- t4 !== window && null !== t4 || "process-tick" !== e4.data || (e4.stopPropagation(), 0 < i2.length && i2.shift()());
57789
- }, true), function(e4) {
57790
- i2.push(e4), window.postMessage("process-tick", "*");
57791
- }) : function(e4) {
57792
- setTimeout(e4, 0);
57793
- }), e3.title = "browser", e3.browser = true, e3.env = {}, e3.argv = [], e3.on = a2, e3.addListener = a2, e3.once = a2, e3.off = a2, e3.removeListener = a2, e3.removeAllListeners = a2, e3.emit = a2, e3.binding = function(e4) {
57794
- throw new Error("process.binding is not supported");
57795
- }, e3.cwd = function() {
57796
- return "/";
57797
- }, e3.chdir = function(e4) {
57798
- throw new Error("process.chdir is not supported");
57799
- };
57800
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/process/browser.js", "/node_modules/gulp-browserify/node_modules/process");
57801
- }, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
57802
- });
57803
- })(object_hash);
57804
- return object_hash.exports;
57805
- }
57806
- var object_hashExports = requireObject_hash();
57807
- const hash = /* @__PURE__ */ getDefaultExportFromCjs(object_hashExports);
57808
- function hashObject(obj) {
57809
- return hash(obj, { unorderedArrays: true, unorderedObjects: true, unorderedSets: true });
57810
- }
57811
- function getUniqueIdentifier(variable) {
57812
- let identifier = variable.uid;
57813
- if ("nested" in variable) {
57814
- identifier += variable.nested.join(",");
57815
- }
57816
- if ("filters" in variable && variable.filters) {
57817
- identifier += hashObject(variable.filters);
57818
- }
57819
- return identifier;
57820
- }
57821
57015
  function isPlaceholder(value) {
57822
57016
  return typeof value === "object" && "__ref" in value;
57823
57017
  }
@@ -57826,9 +57020,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57826
57020
  if ("nested" in variable && variable.nested.length > 0) {
57827
57021
  id += `:${variable.nested.join(",")}`;
57828
57022
  }
57829
- if ("filters" in variable) {
57830
- id += `:${hashObject(variable.filters)}`;
57831
- }
57832
57023
  return id;
57833
57024
  }
57834
57025
  function getEntries(obj) {
@@ -57859,7 +57050,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57859
57050
  const normalizedValues = [];
57860
57051
  let lookup = {};
57861
57052
  for (const [key, val] of resolved.values.entries()) {
57862
- if (isResolvedDerivedVariable(val) || isResolvedDerivedDataVariable(val)) {
57053
+ if (isResolvedDerivedVariable(val)) {
57863
57054
  const { data: nestedNormalized, lookup: nestedLookup } = normalizeResolvedDerivedVariable(
57864
57055
  val,
57865
57056
  def.variables[key]
@@ -57896,7 +57087,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57896
57087
  const kwargDef = kwargsDefinition[key];
57897
57088
  if (!kwargDef) {
57898
57089
  data[key] = val;
57899
- } else if (isDerivedVariable(kwargDef) || isDerivedDataVariable(kwargDef)) {
57090
+ } else if (isDerivedVariable(kwargDef)) {
57900
57091
  const { data: nestedData, lookup: nestedLookup } = normalizeResolvedDerivedVariable(val, kwargDef);
57901
57092
  data[key] = nestedData;
57902
57093
  lookup = {
@@ -57988,7 +57179,13 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57988
57179
  await validateResponse(res, `Failed to cancel task with id: ${taskId}`);
57989
57180
  return true;
57990
57181
  }
57991
- const dataRegistry = /* @__PURE__ */ new Map();
57182
+ function getUniqueIdentifier(variable) {
57183
+ let identifier = variable.uid;
57184
+ if ("nested" in variable) {
57185
+ identifier += variable.nested.join(",");
57186
+ }
57187
+ return identifier;
57188
+ }
57992
57189
  const atomRegistry = /* @__PURE__ */ new Map();
57993
57190
  const atomFamilyRegistry = /* @__PURE__ */ new Map();
57994
57191
  const atomFamilyMembersRegistry = /* @__PURE__ */ new Map();
@@ -58005,7 +57202,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
58005
57202
  }
58006
57203
  function clearRegistries_TEST() {
58007
57204
  for (const registry of [
58008
- dataRegistry,
58009
57205
  atomRegistry,
58010
57206
  atomFamilyRegistry,
58011
57207
  atomFamilyMembersRegistry,
@@ -58022,6 +57218,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
58022
57218
  return false;
58023
57219
  }
58024
57220
  switch (variable.__typename) {
57221
+ case "ServerVariable":
58025
57222
  case "Variable": {
58026
57223
  if (atomRegistry.has(variable.uid)) {
58027
57224
  return true;
@@ -58032,17 +57229,10 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
58032
57229
  }
58033
57230
  return atomFamilyMembersRegistry.get(family).size > 0;
58034
57231
  }
58035
- case "UrlVariable":
58036
- case "DataVariable":
58037
- return atomRegistry.has(variable.uid);
58038
57232
  case "DerivedVariable": {
58039
57233
  const key = getRegistryKey(variable, "selector");
58040
57234
  return selectorFamilyRegistry.has(key);
58041
57235
  }
58042
- case "DerivedDataVariable": {
58043
- const key = getRegistryKey(variable, "selector");
58044
- return selectorFamilyRegistry.has(key);
58045
- }
58046
57236
  default:
58047
57237
  return false;
58048
57238
  }
@@ -58469,16 +57659,9 @@ Inferred class string: "${iconClasses}."`
58469
57659
  return /* @__PURE__ */ React__namespace.createElement(EventBusContext.Provider, { value: bus }, children);
58470
57660
  }
58471
57661
  class StateSynchronizer {
58472
- static #instance;
58473
- #observers = /* @__PURE__ */ new Map();
58474
- // eslint-disable-next-line no-useless-constructor, no-empty-function
57662
+ #observers;
58475
57663
  constructor() {
58476
- }
58477
- static getInstance() {
58478
- if (!StateSynchronizer.#instance) {
58479
- StateSynchronizer.#instance = new StateSynchronizer();
58480
- }
58481
- return StateSynchronizer.#instance;
57664
+ this.#observers = /* @__PURE__ */ new Map();
58482
57665
  }
58483
57666
  /**
58484
57667
  * Register a key in the state synchronizer
@@ -58540,6 +57723,7 @@ Inferred class string: "${iconClasses}."`
58540
57723
  this.#observers.get(key).next(update);
58541
57724
  }
58542
57725
  }
57726
+ const STATE_SYNCHRONIZER$1 = new StateSynchronizer();
58543
57727
  function getOrRegisterPlainVariable(variable, wsClient, taskContext, extras) {
58544
57728
  const isNested = variable.nested && variable.nested.length > 0;
58545
57729
  const isDefaultDerived = isDerivedVariable(variable.default);
@@ -58563,15 +57747,15 @@ Inferred class string: "${iconClasses}."`
58563
57747
  ) : variable.default,
58564
57748
  effects: (extrasSerializable2) => {
58565
57749
  const familySync = ({ onSet, setSelf, resetSelf, node }) => {
58566
- if (!StateSynchronizer.getInstance().isRegistered(variable.uid)) {
58567
- StateSynchronizer.getInstance().register(variable.uid, variable.default);
57750
+ if (!STATE_SYNCHRONIZER$1.isRegistered(variable.uid)) {
57751
+ STATE_SYNCHRONIZER$1.register(variable.uid, variable.default);
58568
57752
  } else {
58569
- const currentState = StateSynchronizer.getInstance().getCurrentState(variable.uid);
57753
+ const currentState = STATE_SYNCHRONIZER$1.getCurrentState(variable.uid);
58570
57754
  if (!isDefaultDerived || currentState?.type !== "initial") {
58571
57755
  setSelf(currentState?.value);
58572
57756
  }
58573
57757
  }
58574
- const unsub = StateSynchronizer.getInstance().subscribe(variable.uid, (update) => {
57758
+ const unsub = STATE_SYNCHRONIZER$1.subscribe(variable.uid, (update) => {
58575
57759
  if (update.type === "initial") {
58576
57760
  return;
58577
57761
  }
@@ -58585,7 +57769,7 @@ Inferred class string: "${iconClasses}."`
58585
57769
  }
58586
57770
  });
58587
57771
  onSet((newValue, oldValue, isReset) => {
58588
- StateSynchronizer.getInstance().notify(variable.uid, {
57772
+ STATE_SYNCHRONIZER$1.notify(variable.uid, {
58589
57773
  isReset,
58590
57774
  nodeKey: node.key,
58591
57775
  oldValue,
@@ -58599,12 +57783,15 @@ Inferred class string: "${iconClasses}."`
58599
57783
  const storeEffect = getEffect(variable);
58600
57784
  if (storeEffect) {
58601
57785
  effects.push(storeEffect(variable, extrasSerializable2, wsClient, taskContext));
58602
- } else {
58603
- if (variable.persist_value || isEmbedded()) {
58604
- effects.push(
58605
- STORES.BrowserStore.effect(variable, extrasSerializable2, wsClient, taskContext)
58606
- );
58607
- }
57786
+ } else if (isEmbedded()) {
57787
+ effects.push(
57788
+ STORES.BrowserStore.effect(
57789
+ variable,
57790
+ extrasSerializable2,
57791
+ wsClient,
57792
+ taskContext
57793
+ )
57794
+ );
58608
57795
  }
58609
57796
  return effects;
58610
57797
  },
@@ -58651,6 +57838,108 @@ Inferred class string: "${iconClasses}."`
58651
57838
  }
58652
57839
  return atomInstance;
58653
57840
  }
57841
+ function createDataUrl(path, pagination) {
57842
+ const url = new URL(path, window.location.origin);
57843
+ if (pagination?.limit) {
57844
+ url.searchParams.set("limit", String(pagination.limit));
57845
+ }
57846
+ if (pagination?.offset) {
57847
+ url.searchParams.set("offset", String(pagination.offset));
57848
+ }
57849
+ if (pagination?.sort) {
57850
+ url.searchParams.set("order_by", (pagination.sort.desc ? "-" : "") + pagination.sort.id);
57851
+ }
57852
+ if (pagination?.index) {
57853
+ url.searchParams.set("index", String(pagination.index));
57854
+ }
57855
+ return url;
57856
+ }
57857
+ async function validateTabularResponse(uid2, response) {
57858
+ if (response.status === 415) {
57859
+ let msg = `The requested variable ${uid2} data is not tabular`;
57860
+ try {
57861
+ const data = await response.json();
57862
+ if ("detail" in data) {
57863
+ msg += `. ${data.detail}`;
57864
+ }
57865
+ } catch {
57866
+ }
57867
+ throw new UserError(msg);
57868
+ }
57869
+ }
57870
+ function isDataResponse(response) {
57871
+ return response && typeof response === "object" && "data" in response && "count" in response;
57872
+ }
57873
+ async function fetchTabularServerVariable({
57874
+ variable,
57875
+ // Explicitly unused, required for the callback dependency to ensure its identity changes
57876
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
57877
+ seqNumber,
57878
+ wsClient,
57879
+ extras,
57880
+ filters = null,
57881
+ pagination = null
57882
+ }) {
57883
+ const url = createDataUrl(`/api/core/tabular-variable/${variable.uid}`, pagination);
57884
+ const body = {
57885
+ filters: filters ?? null,
57886
+ ws_channel: await wsClient.getChannel()
57887
+ };
57888
+ const response = await request(url, { body: JSON.stringify(body), method: HTTP_METHOD.POST }, extras);
57889
+ await handleAuthErrors(response, true);
57890
+ await validateTabularResponse(variable.uid, response);
57891
+ await validateResponse(response, "Failed to fetch tabular data");
57892
+ return response.json();
57893
+ }
57894
+ function useFetchTabularServerVariable(variable, seqNumber, wsClient, extras) {
57895
+ return React$1.useCallback(
57896
+ async (filters, pagination) => {
57897
+ return fetchTabularServerVariable({ variable, seqNumber, wsClient, extras, filters, pagination });
57898
+ },
57899
+ [wsClient, variable, seqNumber, extras]
57900
+ );
57901
+ }
57902
+ function useFetchTabularDerivedVariable(variable, dvResult, wsClient, taskContext, extras) {
57903
+ const previousResult = React$1.useRef({
57904
+ data: null,
57905
+ count: 0,
57906
+ schema: { fields: [], primaryKey: [] }
57907
+ });
57908
+ return React$1.useCallback(
57909
+ async (filters, pagination) => {
57910
+ const url = createDataUrl(`/api/core/tabular-variable/${variable.uid}`, pagination);
57911
+ const body = {
57912
+ filters: filters ?? null,
57913
+ ws_channel: await wsClient.getChannel(),
57914
+ dv_values: normalizeRequest(cleanArgs(dvResult.values), variable.variables)
57915
+ };
57916
+ const response = await request(url, { body: JSON.stringify(body), method: HTTP_METHOD.POST }, extras);
57917
+ await handleAuthErrors(response, true);
57918
+ await validateTabularResponse(variable.uid, response);
57919
+ await validateResponse(response, "Failed to fetch tabular data");
57920
+ const responseJson = await response.json();
57921
+ const variableTaskId = `${variable.uid}-filter`;
57922
+ taskContext.cleanupRunningTasks(variableTaskId);
57923
+ if (!("task_id" in responseJson)) {
57924
+ previousResult.current = responseJson;
57925
+ return responseJson;
57926
+ }
57927
+ const taskId = responseJson.task_id;
57928
+ taskContext.startTask(taskId, variableTaskId);
57929
+ try {
57930
+ await wsClient.waitForTask(taskId);
57931
+ } catch {
57932
+ return previousResult.current;
57933
+ } finally {
57934
+ taskContext.endTask(taskId);
57935
+ }
57936
+ const taskResult = await fetchTaskResult(taskId, extras);
57937
+ previousResult.current = taskResult;
57938
+ return taskResult;
57939
+ },
57940
+ [variable.uid, variable.variables, dvResult, wsClient, taskContext, extras]
57941
+ );
57942
+ }
58654
57943
  function _defineProperty(obj, key, value) {
58655
57944
  if (key in obj) {
58656
57945
  Object.defineProperty(obj, key, {
@@ -58995,183 +58284,109 @@ Inferred class string: "${iconClasses}."`
58995
58284
  mixed: mixed$1
58996
58285
  };
58997
58286
  var Refine_index_6 = Refine_index.mixed;
58998
- function getOrRegisterUrlVariable(variable) {
58999
- if (!atomRegistry.has(variable.uid)) {
59000
- atomRegistry.set(
58287
+ const STORE_EXTRAS_MAP$1 = /* @__PURE__ */ new Map();
58288
+ function serverSyncEffect(variable, requestExtras) {
58289
+ STORE_EXTRAS_MAP$1.set(variable.uid, requestExtras);
58290
+ return RecoilSync_index_2({
58291
+ /** Use store uid as the unique identifier */
58292
+ itemKey: variable.uid,
58293
+ refine: Refine_index_6(),
58294
+ storeKey: "ServerVariable"
58295
+ });
58296
+ }
58297
+ const STATE_SYNCHRONIZER = new StateSynchronizer();
58298
+ function getOrRegisterServerVariable(variable, extras) {
58299
+ if (!atomFamilyRegistry.has(variable.uid)) {
58300
+ atomFamilyRegistry.set(
59001
58301
  variable.uid,
59002
- Recoil_index_8({
59003
- default: variable.default,
59004
- effects: [
59005
- RecoilSync_index_6({
59006
- history: "push",
59007
- itemKey: variable.query,
59008
- refine: Refine_index_6()
59009
- })
59010
- ],
58302
+ Recoil_index_10({
58303
+ // NOTE: No default provided, atom starts in a pending state
58304
+ effects: (extrasSerializable2) => {
58305
+ const familySync = ({ onSet, setSelf, resetSelf, node }) => {
58306
+ if (!STATE_SYNCHRONIZER.isRegistered(variable.uid)) {
58307
+ STATE_SYNCHRONIZER.register(variable.uid, null);
58308
+ } else {
58309
+ const currentState = STATE_SYNCHRONIZER.getCurrentState(variable.uid);
58310
+ if (currentState?.type !== "initial") {
58311
+ setSelf(currentState?.value);
58312
+ }
58313
+ }
58314
+ const unsub = STATE_SYNCHRONIZER.subscribe(variable.uid, (update) => {
58315
+ if (update.type === "initial") {
58316
+ return;
58317
+ }
58318
+ if (update.nodeKey === node.key) {
58319
+ return;
58320
+ }
58321
+ if (update.isReset) {
58322
+ resetSelf();
58323
+ } else {
58324
+ setSelf(update.value);
58325
+ }
58326
+ });
58327
+ onSet((newValue, oldValue, isReset) => {
58328
+ STATE_SYNCHRONIZER.notify(variable.uid, {
58329
+ isReset,
58330
+ nodeKey: node.key,
58331
+ oldValue,
58332
+ type: "update",
58333
+ value: newValue
58334
+ });
58335
+ });
58336
+ return unsub;
58337
+ };
58338
+ return [familySync, serverSyncEffect(variable, extrasSerializable2)];
58339
+ },
59011
58340
  key: variable.uid
59012
58341
  })
59013
58342
  );
59014
58343
  }
59015
- return atomRegistry.get(variable.uid);
59016
- }
59017
- function useUrlVariable(variable) {
59018
- return Recoil_index_22(getOrRegisterUrlVariable(variable));
59019
- }
59020
- function combineFilters(combinator, queries) {
59021
- const validQueries = queries.filter(Boolean);
59022
- if (validQueries.length === 0) {
59023
- return null;
59024
- }
59025
- if (validQueries.length === 1) {
59026
- return validQueries[0];
58344
+ const family = atomFamilyRegistry.get(variable.uid);
58345
+ const extrasSerializable = new RequestExtrasSerializable(extras);
58346
+ const atomInstance = family(extrasSerializable);
58347
+ if (!atomFamilyMembersRegistry.has(family)) {
58348
+ atomFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
59027
58349
  }
59028
- return {
59029
- clauses: validQueries,
59030
- combinator
59031
- };
58350
+ atomFamilyMembersRegistry.get(family).set(extrasSerializable.toJSON(), atomInstance);
58351
+ return atomInstance;
59032
58352
  }
59033
- function resolveDataVariable(variable) {
58353
+ async function resolveServerVariable(variable, extras, resolver) {
58354
+ const atom2 = getOrRegisterServerVariable(variable, extras);
58355
+ const seqNumber = await resolver(atom2);
59034
58356
  return {
59035
- filters: variable.filters,
59036
- type: "data",
59037
- uid: variable.uid
58357
+ type: "server",
58358
+ uid: variable.uid,
58359
+ sequence_number: seqNumber
59038
58360
  };
59039
58361
  }
59040
- function createDataUrl(path, pagination) {
59041
- const url = new URL(path, window.location.origin);
59042
- if (pagination?.limit) {
59043
- url.searchParams.set("limit", String(pagination.limit));
59044
- }
59045
- if (pagination?.offset) {
59046
- url.searchParams.set("offset", String(pagination.offset));
59047
- }
59048
- if (pagination?.sort) {
59049
- url.searchParams.set("order_by", (pagination.sort.desc ? "-" : "") + pagination.sort.id);
59050
- }
59051
- if (pagination?.index) {
59052
- url.searchParams.set("index", String(pagination.index));
59053
- }
59054
- return url;
59055
- }
59056
- async function fetchDataVariable(uid2, extras, filters, pagination) {
59057
- const url = createDataUrl(`/api/core/data-variable/${uid2}`, pagination);
59058
- const response = await request(url, { body: JSON.stringify({ filters }), method: HTTP_METHOD.POST }, extras);
59059
- await handleAuthErrors(response, true);
59060
- await validateResponse(response, "Failed to fetch data variable");
59061
- return response.json();
59062
- }
59063
- async function fetchDerivedDataVariable(uid2, extras, cacheKey, wsChannel, filters, pagination) {
59064
- const url = createDataUrl(`/api/core/data-variable/${uid2}`, pagination);
59065
- const response = await request(
59066
- url,
59067
- { body: JSON.stringify({ cache_key: cacheKey, filters, ws_channel: wsChannel }), method: HTTP_METHOD.POST },
59068
- extras
59069
- );
59070
- await handleAuthErrors(response, true);
59071
- await validateResponse(response, "Failed to fetch data variable");
59072
- return response.json();
59073
- }
59074
- async function fetchDataVariableCount(uid2, extras, filters, cacheKey) {
59075
- const response = await request(
59076
- `/api/core/data-variable/${uid2}/count`,
59077
- { body: JSON.stringify({ cache_key: cacheKey, filters }), method: HTTP_METHOD.POST },
59078
- extras
59079
- );
59080
- await handleAuthErrors(response, true);
59081
- await validateResponse(response, "Failed to fetch data variable total count");
59082
- return response.json();
59083
- }
59084
- async function fetchDataVariableSchema(uid2, extras, cacheKey) {
59085
- const queryString = cacheKey ? new URLSearchParams({ cache_key: cacheKey }).toString() : "";
59086
- const response = await request(
59087
- `/api/core/data-variable/${uid2}/schema?${queryString}`,
59088
- { method: HTTP_METHOD.GET },
59089
- extras
59090
- );
59091
- await handleAuthErrors(response, true);
59092
- await validateResponse(response, "Failed to fetch data variable schema");
59093
- return response.json();
59094
- }
59095
- function useFetchDataVariable(variable, serverTriggerCounter) {
59096
- const eventBus = useEventBus();
59097
- const extras = useRequestExtras();
59098
- const dataCallback = React$1.useCallback(
59099
- async (filters, pagination, options) => {
59100
- const mergedFilters = combineFilters("AND", [variable.filters, filters]);
59101
- const data = await fetchDataVariable(variable.uid, extras, mergedFilters, pagination);
59102
- const [totalCount, schema = null] = await Promise.all([
59103
- fetchDataVariableCount(variable.uid, extras, mergedFilters),
59104
- ...options?.schema ? [fetchDataVariableSchema(variable.uid, extras)] : []
59105
- ]);
59106
- eventBus.publish("DATA_VARIABLE_LOADED", { variable, value: { data, totalCount } });
59107
- return {
59108
- data,
59109
- totalCount,
59110
- ...schema !== null && { schema }
59111
- };
59112
- },
59113
- [variable, extras, serverTriggerCounter, eventBus]
59114
- );
59115
- return dataCallback;
59116
- }
59117
- function useFetchDerivedDataVariable(variable, taskContext, wsClient, dvValuePromise) {
59118
- const eventBus = useEventBus();
59119
- const extras = useRequestExtras();
59120
- const previousResult = React$1.useRef({ data: null, totalCount: 0, schema: { fields: [], primaryKey: [] } });
59121
- const dataCallback = React$1.useCallback(
59122
- async (filters, pagination, options) => {
59123
- const mergedFilters = combineFilters("AND", [variable.filters, filters]);
59124
- const dvValue = await dvValuePromise;
59125
- const response = await fetchDerivedDataVariable(
59126
- variable.uid,
59127
- extras,
59128
- dvValue.cache_key,
59129
- await wsClient.getChannel(),
59130
- mergedFilters,
59131
- pagination
59132
- );
59133
- let data = null;
59134
- const variableTaskId = `${variable.uid}-filter`;
59135
- taskContext.cleanupRunningTasks(variableTaskId);
59136
- if (response && "task_id" in response) {
59137
- const taskId = response.task_id;
59138
- taskContext.startTask(taskId, variableTaskId);
59139
- try {
59140
- await wsClient.waitForTask(taskId);
59141
- } catch {
59142
- eventBus.publish("DERIVED_DATA_VARIABLE_LOADED", { variable, value: null });
59143
- return previousResult.current;
59144
- } finally {
59145
- taskContext.endTask(taskId);
59146
- }
59147
- data = await fetchTaskResult(taskId, extras);
59148
- } else {
59149
- data = response;
59150
- }
59151
- const [totalCount, schema = null] = await Promise.all([
59152
- fetchDataVariableCount(variable.uid, extras, mergedFilters, dvValue.cache_key),
59153
- ...options?.schema ? [fetchDataVariableSchema(variable.uid, extras, dvValue.cache_key)] : []
59154
- ]);
59155
- previousResult.current = {
59156
- data,
59157
- totalCount,
59158
- ...schema !== null && { schema }
59159
- };
59160
- eventBus.publish("DERIVED_DATA_VARIABLE_LOADED", { variable, value: { data, totalCount } });
59161
- return {
59162
- data,
59163
- totalCount,
59164
- ...schema !== null && { schema }
58362
+ function ServerVariableSyncProvider({ children }) {
58363
+ const { client: client2 } = React$1.useContext(websocketCtx);
58364
+ const getStoreValue = React$1.useCallback(async (itemKey) => {
58365
+ const serializableExtras = STORE_EXTRAS_MAP$1.get(itemKey);
58366
+ const response = await request(
58367
+ `/api/core/server-variable/${itemKey}/sequence`,
58368
+ serializableExtras?.extras ?? {}
58369
+ );
58370
+ await handleAuthErrors(response, true);
58371
+ await validateResponse(response, `Failed to fetch the sequence number for key: ${itemKey}`);
58372
+ const { sequence_number } = await response.json();
58373
+ return sequence_number;
58374
+ }, []);
58375
+ const listenToStoreChanges = React$1.useCallback(
58376
+ ({ updateItem }) => {
58377
+ if (!client2) {
58378
+ return;
58379
+ }
58380
+ const valueSub = client2.serverVariableMessages$().subscribe((message) => {
58381
+ updateItem(message.uid, message.sequence_number);
58382
+ });
58383
+ return () => {
58384
+ valueSub.unsubscribe();
59165
58385
  };
59166
58386
  },
59167
- [variable, extras, dvValuePromise, eventBus]
58387
+ [client2]
59168
58388
  );
59169
- return dataCallback;
59170
- }
59171
- function registerDataVariable(variable) {
59172
- if (!atomRegistry.has(variable.uid)) {
59173
- atomRegistry.set(variable.uid, Recoil_index_8({ default: true, key: variable.uid }));
59174
- }
58389
+ return /* @__PURE__ */ React$1.createElement(RecoilSync_index_1, { listen: listenToStoreChanges, read: getStoreValue, storeKey: "ServerVariable" }, children);
59175
58390
  }
59176
58391
  var set_1;
59177
58392
  var hasRequiredSet;
@@ -59203,50 +58418,11 @@ Inferred class string: "${iconClasses}."`
59203
58418
  }
59204
58419
  return atomRegistry.get(triggerKey);
59205
58420
  }
59206
- function getOrRegisterDataVariableTrigger(variable, wsClient) {
59207
- const key = `${variable.uid}-data`;
59208
- if (!dataRegistry.has(key)) {
59209
- dataRegistry.set(
59210
- key,
59211
- Recoil_index_8({
59212
- default: {
59213
- force_key: null,
59214
- inc: 0
59215
- },
59216
- effects: [
59217
- // synchronize with server triggers - increment when the variable is triggered on the server side
59218
- // In the DataVariable case we always force so new key is generated
59219
- ({ setSelf }) => {
59220
- const subscription = wsClient.serverTriggers$(variable.uid).subscribe(() => {
59221
- setSelf((v) => {
59222
- if (typeof v === "object" && "inc" in v) {
59223
- return {
59224
- force_key: nanoid(),
59225
- inc: v.inc + 1
59226
- };
59227
- }
59228
- return {
59229
- force_key: nanoid(),
59230
- inc: 1
59231
- };
59232
- });
59233
- });
59234
- return () => {
59235
- subscription?.unsubscribe();
59236
- };
59237
- }
59238
- ],
59239
- key
59240
- })
59241
- );
59242
- }
59243
- return dataRegistry.get(key);
59244
- }
59245
58421
  function buildTriggerList(variables) {
59246
58422
  const triggers = [];
59247
58423
  function walk(vars, path) {
59248
58424
  for (const [idx, variable] of vars.entries()) {
59249
- if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
58425
+ if (isDerivedVariable(variable)) {
59250
58426
  const varPath = [...path, String(idx)];
59251
58427
  triggers.push({
59252
58428
  path: varPath,
@@ -59254,27 +58430,17 @@ Inferred class string: "${iconClasses}."`
59254
58430
  });
59255
58431
  walk(variable.variables, [...varPath, "values"]);
59256
58432
  }
59257
- if (isDataVariable(variable)) {
59258
- triggers.push({
59259
- path: path.length > 0 ? path.slice(0, -1) : [],
59260
- variable
59261
- });
59262
- }
59263
58433
  }
59264
58434
  }
59265
58435
  walk(variables, []);
59266
58436
  return triggers;
59267
58437
  }
59268
- function registerChildTriggers(triggerList, wsClient, registerFunc = Recoil_index_20) {
58438
+ function registerChildTriggers(triggerList, registerFunc = Recoil_index_20) {
59269
58439
  return triggerList.map((triggerInfo) => {
59270
- if (isDerivedVariable(triggerInfo.variable) || isDerivedDataVariable(triggerInfo.variable)) {
58440
+ if (isDerivedVariable(triggerInfo.variable)) {
59271
58441
  const triggerIndex = getOrRegisterTrigger(triggerInfo.variable);
59272
58442
  return registerFunc(triggerIndex);
59273
58443
  }
59274
- if (isDataVariable(triggerInfo.variable)) {
59275
- const serverTrigger = getOrRegisterDataVariableTrigger(triggerInfo.variable, wsClient);
59276
- return registerFunc(serverTrigger);
59277
- }
59278
58444
  throw new Error("Invalid trigger variable type");
59279
58445
  });
59280
58446
  }
@@ -59287,8 +58453,7 @@ Inferred class string: "${iconClasses}."`
59287
58453
  force_key,
59288
58454
  variableUid,
59289
58455
  values,
59290
- wsClient,
59291
- is_data_variable = false
58456
+ wsClient
59292
58457
  }) {
59293
58458
  const cacheControl = cache2 === null ? {
59294
58459
  "cache-control": "none"
@@ -59297,7 +58462,7 @@ Inferred class string: "${iconClasses}."`
59297
58462
  const res = await request(
59298
58463
  `/api/core/derived-variable/${variableUid}`,
59299
58464
  {
59300
- body: JSON.stringify({ is_data_variable, values, ws_channel, force_key: force_key ?? null }),
58465
+ body: JSON.stringify({ values, ws_channel, force_key: force_key ?? null }),
59301
58466
  headers: { ...cacheControl },
59302
58467
  method: HTTP_METHOD.POST
59303
58468
  },
@@ -59316,8 +58481,7 @@ Inferred class string: "${iconClasses}."`
59316
58481
  wsClient,
59317
58482
  extras,
59318
58483
  cache: cache2,
59319
- force_key,
59320
- is_data_variable = false
58484
+ force_key
59321
58485
  }) {
59322
58486
  if (!debouncedFetchSubjects[selectorKey]) {
59323
58487
  debouncedFetchSubjects[selectorKey] = new BehaviorSubject(null);
@@ -59332,7 +58496,6 @@ Inferred class string: "${iconClasses}."`
59332
58496
  cache: cache2,
59333
58497
  extras,
59334
58498
  force_key,
59335
- is_data_variable,
59336
58499
  selectorKey,
59337
58500
  values,
59338
58501
  variableUid,
@@ -59343,7 +58506,7 @@ Inferred class string: "${iconClasses}."`
59343
58506
  });
59344
58507
  }
59345
58508
  function resolveValue(value, getter) {
59346
- if (isResolvedDerivedVariable(value) || isResolvedDerivedDataVariable(value)) {
58509
+ if (isResolvedDerivedVariable(value)) {
59347
58510
  const resolvedValues = value.values.map((v) => resolveValue(v, getter));
59348
58511
  return {
59349
58512
  ...value,
@@ -59358,8 +58521,11 @@ Inferred class string: "${iconClasses}."`
59358
58521
  default: resolveValue(value.default, getter)
59359
58522
  };
59360
58523
  }
59361
- if (isResolvedDataVariable(value)) {
59362
- return value;
58524
+ if (isResolvedServerVariable(value)) {
58525
+ return {
58526
+ ...value,
58527
+ sequence_number: Recoil_index_2(value.sequence_number) ? getter(value.sequence_number) : value.sequence_number
58528
+ };
59363
58529
  }
59364
58530
  if (isCondition(value)) {
59365
58531
  return {
@@ -59378,9 +58544,12 @@ Inferred class string: "${iconClasses}."`
59378
58544
  if (deps && !deps.includes(idx)) {
59379
58545
  return [];
59380
58546
  }
59381
- if (isResolvedDerivedVariable(val) || isResolvedDerivedDataVariable(val)) {
58547
+ if (isResolvedDerivedVariable(val)) {
59382
58548
  return getDeps(val.values, val.deps).flat();
59383
58549
  }
58550
+ if (isResolvedServerVariable(val)) {
58551
+ return val.sequence_number;
58552
+ }
59384
58553
  if (isResolvedSwitchVariable(val)) {
59385
58554
  return getDeps([val.value, val.value_map, val.default], [0, 1, 2]).flat();
59386
58555
  }
@@ -59390,9 +58559,9 @@ Inferred class string: "${iconClasses}."`
59390
58559
  function useTriggerIndex(variable) {
59391
58560
  return Recoil_index_20(getOrRegisterTrigger(variable));
59392
58561
  }
59393
- function resolveDerivedValue(key, variables, deps, resolvedVariables, wsClient, get, selfTrigger) {
58562
+ function resolveDerivedValue(key, variables, deps, resolvedVariables, get, selfTrigger) {
59394
58563
  const triggerList = buildTriggerList(variables);
59395
- const triggers = registerChildTriggers(triggerList, wsClient, get);
58564
+ const triggers = registerChildTriggers(triggerList, get);
59396
58565
  if (selfTrigger) {
59397
58566
  triggers.unshift(selfTrigger);
59398
58567
  }
@@ -59411,7 +58580,9 @@ Inferred class string: "${iconClasses}."`
59411
58580
  if (areArgsTheSame) {
59412
58581
  return {
59413
58582
  entry: previousEntry,
59414
- type: "previous"
58583
+ type: "previous",
58584
+ values,
58585
+ depsKey: key
59415
58586
  };
59416
58587
  }
59417
58588
  const previousTriggerCounters = previousEntry.args.slice(
@@ -59438,18 +58609,20 @@ Inferred class string: "${iconClasses}."`
59438
58609
  relevantValues,
59439
58610
  selfTriggerForceKey,
59440
58611
  type: "current",
59441
- values
58612
+ values,
58613
+ depsKey: key
59442
58614
  };
59443
58615
  }
59444
58616
  return {
59445
58617
  relevantValues,
59446
58618
  selfTriggerForceKey: null,
59447
58619
  type: "current",
59448
- values
58620
+ values,
58621
+ depsKey: key
59449
58622
  };
59450
58623
  }
59451
- function getOrRegisterDerivedVariable(variable, wsClient, taskContext, currentExtras) {
59452
- const key = getRegistryKey(variable, "selector");
58624
+ function getOrRegisterDerivedVariableResult(variable, wsClient, taskContext, currentExtras) {
58625
+ const key = getRegistryKey(variable, "result-selector");
59453
58626
  if (!selectorFamilyRegistry.has(key)) {
59454
58627
  getOrRegisterTrigger(variable);
59455
58628
  selectorFamilyRegistry.set(
@@ -59459,34 +58632,68 @@ Inferred class string: "${iconClasses}."`
59459
58632
  eviction: "most-recent"
59460
58633
  },
59461
58634
  get: (extrasSerializable) => async ({ get }) => {
59462
- const resolvedVariables = variable.variables.map((v) => {
59463
- if (!isVariable(v)) {
59464
- return v;
59465
- }
59466
- return resolveVariable(v, wsClient, taskContext, currentExtras);
59467
- });
58635
+ const resolvedVariables = await Promise.all(
58636
+ variable.variables.map(async (v) => {
58637
+ if (!isVariable(v)) {
58638
+ return Promise.resolve(v);
58639
+ }
58640
+ return resolveVariable(v, wsClient, taskContext, currentExtras);
58641
+ })
58642
+ );
59468
58643
  const selfTrigger = get(getOrRegisterTrigger(variable));
59469
- const { extras } = extrasSerializable;
59470
58644
  const selectorKey = key + extrasSerializable.toJSON();
59471
58645
  const derivedResult = resolveDerivedValue(
59472
58646
  selectorKey,
59473
58647
  variable.variables,
59474
58648
  variable.deps,
59475
58649
  resolvedVariables,
59476
- wsClient,
59477
58650
  get,
59478
58651
  selfTrigger
59479
58652
  );
58653
+ return derivedResult;
58654
+ },
58655
+ key: nanoid()
58656
+ })
58657
+ );
58658
+ }
58659
+ const family = selectorFamilyRegistry.get(key);
58660
+ const serializableExtras = new RequestExtrasSerializable(currentExtras);
58661
+ const selectorInstance = family(serializableExtras);
58662
+ if (!selectorFamilyMembersRegistry.has(family)) {
58663
+ selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
58664
+ }
58665
+ selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
58666
+ return selectorInstance;
58667
+ }
58668
+ function getOrRegisterDerivedVariable(variable, wsClient, taskContext, currentExtras) {
58669
+ const key = getRegistryKey(variable, "selector");
58670
+ if (!selectorFamilyRegistry.has(key)) {
58671
+ getOrRegisterTrigger(variable);
58672
+ selectorFamilyRegistry.set(
58673
+ key,
58674
+ Recoil_index_11({
58675
+ cachePolicy_UNSTABLE: {
58676
+ eviction: "most-recent"
58677
+ },
58678
+ get: (extrasSerializable) => async ({ get }) => {
58679
+ const selectorKey = key + extrasSerializable.toJSON();
58680
+ const dvResultSelector = getOrRegisterDerivedVariableResult(
58681
+ variable,
58682
+ wsClient,
58683
+ taskContext,
58684
+ extrasSerializable.extras
58685
+ );
58686
+ const derivedResult = get(dvResultSelector);
59480
58687
  if (derivedResult.type === "previous") {
59481
58688
  return { cache_key: derivedResult.entry.cacheKey, value: derivedResult.entry.result };
59482
58689
  }
58690
+ const { extras } = extrasSerializable;
59483
58691
  let variableResponse = null;
59484
58692
  try {
59485
58693
  variableResponse = await debouncedFetchDerivedVariable({
59486
58694
  cache: variable.cache,
59487
58695
  extras,
59488
58696
  force_key: derivedResult.selfTriggerForceKey,
59489
- is_data_variable: isDerivedDataVariable(variable),
59490
58697
  selectorKey,
59491
58698
  values: normalizeRequest(cleanArgs(derivedResult.values), variable.variables),
59492
58699
  variableUid: variable.uid,
@@ -59499,34 +58706,37 @@ Inferred class string: "${iconClasses}."`
59499
58706
  }
59500
58707
  const cacheKey = variableResponse.cache_key;
59501
58708
  let variableValue = null;
59502
- if (isDerivedVariable(variable)) {
59503
- taskContext.cleanupRunningTasks(variable.uid);
59504
- if (isTaskResponse$1(variableResponse)) {
59505
- const taskId = variableResponse.task_id;
59506
- taskContext.startTask(taskId, variable.uid, getRegistryKey(variable, "trigger"));
59507
- try {
59508
- await wsClient.waitForTask(taskId);
59509
- } catch {
59510
- return {
59511
- cache_key: cacheKey,
59512
- value: null
59513
- };
59514
- } finally {
59515
- taskContext.endTask(taskId);
59516
- }
59517
- try {
59518
- variableValue = await fetchTaskResult(taskId, extras);
59519
- } catch (e2) {
58709
+ taskContext.cleanupRunningTasks(variable.uid);
58710
+ if (isTaskResponse$1(variableResponse)) {
58711
+ const taskId = variableResponse.task_id;
58712
+ taskContext.startTask(taskId, variable.uid, getRegistryKey(variable, "trigger"));
58713
+ try {
58714
+ await wsClient.waitForTask(taskId);
58715
+ } catch (e2) {
58716
+ if (e2 instanceof TaskError) {
59520
58717
  e2.selectorId = key;
59521
58718
  e2.selectorExtras = extrasSerializable.toJSON();
59522
58719
  throw e2;
59523
58720
  }
59524
- } else {
59525
- variableValue = variableResponse.value;
58721
+ return {
58722
+ cache_key: cacheKey,
58723
+ value: null
58724
+ };
58725
+ } finally {
58726
+ taskContext.endTask(taskId);
59526
58727
  }
58728
+ try {
58729
+ variableValue = await fetchTaskResult(taskId, extras);
58730
+ } catch (e2) {
58731
+ e2.selectorId = key;
58732
+ e2.selectorExtras = extrasSerializable.toJSON();
58733
+ throw e2;
58734
+ }
58735
+ } else {
58736
+ variableValue = variableResponse.value;
59527
58737
  }
59528
58738
  variableValue = "nested" in variable ? resolveNested(variableValue, variable.nested) : variableValue;
59529
- depsRegistry.set(selectorKey, {
58739
+ depsRegistry.set(derivedResult.depsKey, {
59530
58740
  args: derivedResult.relevantValues,
59531
58741
  cacheKey,
59532
58742
  result: variableValue
@@ -59638,20 +58848,13 @@ Inferred class string: "${iconClasses}."`
59638
58848
  cloned[key] = nested.length === 1 ? newValue : setNested(cloned[key], nested.slice(1), newValue);
59639
58849
  return cloned;
59640
58850
  }
59641
- function resolveVariable(variable, client2, taskContext, extras, resolver = (val) => val) {
59642
- if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
58851
+ async function resolveVariable(variable, client2, taskContext, extras, resolver = (state) => Promise.resolve(state)) {
58852
+ if (isDerivedVariable(variable)) {
59643
58853
  getOrRegisterDerivedVariable(variable, client2, taskContext, extras);
59644
- const values = variable.variables.map((v) => resolveVariable(v, client2, taskContext, extras, resolver));
58854
+ const values = await Promise.all(
58855
+ variable.variables.map((v) => resolveVariable(v, client2, taskContext, extras, resolver))
58856
+ );
59645
58857
  const deps = variable.deps.map((dep) => variable.variables.findIndex((v) => v.uid === dep.uid));
59646
- if (isDerivedDataVariable(variable)) {
59647
- return {
59648
- deps,
59649
- filters: variable.filters,
59650
- type: "derived-data",
59651
- uid: variable.uid,
59652
- values
59653
- };
59654
- }
59655
58858
  return {
59656
58859
  deps,
59657
58860
  type: "derived",
@@ -59659,22 +58862,20 @@ Inferred class string: "${iconClasses}."`
59659
58862
  values
59660
58863
  };
59661
58864
  }
59662
- if (isDataVariable(variable)) {
59663
- return resolveDataVariable(variable);
59664
- }
59665
- if (isUrlVariable(variable)) {
59666
- return resolver(getOrRegisterUrlVariable(variable));
58865
+ if (isServerVariable(variable)) {
58866
+ getOrRegisterServerVariable(variable, extras);
58867
+ return resolveServerVariable(variable, extras, resolver);
59667
58868
  }
59668
58869
  if (isSwitchVariable(variable)) {
59669
- let resolvedValue = isVariable(variable.value) ? resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
58870
+ let resolvedValue = isVariable(variable.value) ? await resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
59670
58871
  if (isCondition(resolvedValue)) {
59671
58872
  resolvedValue = {
59672
58873
  ...resolvedValue,
59673
- variable: resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
58874
+ variable: await resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
59674
58875
  };
59675
58876
  }
59676
- const resolvedValueMap = isVariable(variable.value_map) ? resolveVariable(variable.value_map, client2, taskContext, extras, resolver) : variable.value_map;
59677
- const resolvedDefault = isVariable(variable.default) ? resolveVariable(variable.default, client2, taskContext, extras, resolver) : variable.default;
58877
+ const resolvedValueMap = isVariable(variable.value_map) ? await resolveVariable(variable.value_map, client2, taskContext, extras, resolver) : variable.value_map;
58878
+ const resolvedDefault = isVariable(variable.default) ? await resolveVariable(variable.default, client2, taskContext, extras, resolver) : variable.default;
59678
58879
  return {
59679
58880
  type: "switch",
59680
58881
  uid: variable.uid,
@@ -59689,7 +58890,7 @@ Inferred class string: "${iconClasses}."`
59689
58890
  return resolver(getOrRegisterPlainVariable(variable, client2, taskContext, extras));
59690
58891
  }
59691
58892
  function cleanValue(value, forceKeyOverride) {
59692
- if (isResolvedDerivedVariable(value) || isResolvedDerivedDataVariable(value)) {
58893
+ if (isResolvedDerivedVariable(value)) {
59693
58894
  const { deps, ...rest } = value;
59694
58895
  const cleanedValues = value.values.map((v) => cleanValue(v));
59695
58896
  return {
@@ -60597,19 +59798,27 @@ Inferred class string: "${iconClasses}."`
60597
59798
  storeKey: "BrowserStore"
60598
59799
  });
60599
59800
  }
59801
+ function urlEffect(variable) {
59802
+ return RecoilSync_index_6({
59803
+ history: "push",
59804
+ itemKey: variable.store.query,
59805
+ refine: Refine_index_6()
59806
+ });
59807
+ }
60600
59808
  const STORES = {
60601
59809
  BackendStore: {
60602
- effect: backendStoreEffect,
60603
- sync: BackendStoreSync
59810
+ effect: backendStoreEffect
60604
59811
  },
60605
59812
  BrowserStore: {
60606
- effect: localStorageEffect,
60607
- sync: BrowserStoreSync
59813
+ effect: localStorageEffect
59814
+ },
59815
+ QueryParamStore: {
59816
+ effect: urlEffect
60608
59817
  }
60609
59818
  };
60610
59819
  function getEffect(variable) {
60611
59820
  const storeName = variable.store?.__typename;
60612
- if (!storeName) {
59821
+ if (!storeName || !(storeName in STORES)) {
60613
59822
  return null;
60614
59823
  }
60615
59824
  return STORES[storeName]?.effect ?? null;
@@ -60656,10 +59865,275 @@ Inferred class string: "${iconClasses}."`
60656
59865
  const lookupKey = String(value);
60657
59866
  return valueMap[lookupKey] ?? defaultValue;
60658
59867
  }
59868
+ const COLUMN_PREFIX_REGEX = /__(?:col|index)__\d+__/;
59869
+ function combineFilters(combinator, queries) {
59870
+ const validQueries = queries.filter((x) => x !== null && x !== void 0);
59871
+ if (validQueries.length === 0) {
59872
+ return null;
59873
+ }
59874
+ if (validQueries.length === 1) {
59875
+ return validQueries[0];
59876
+ }
59877
+ return {
59878
+ clauses: validQueries,
59879
+ combinator
59880
+ };
59881
+ }
59882
+ function inferColumnType(value, hint) {
59883
+ if (typeof value === "number") {
59884
+ return "numerical";
59885
+ }
59886
+ if (typeof value === "string") {
59887
+ return "categorical";
59888
+ }
59889
+ if (value instanceof Date) {
59890
+ return "datetime";
59891
+ }
59892
+ return "categorical";
59893
+ }
59894
+ function filterRow(row, column, operator, value, columnHints) {
59895
+ const cellValue = row[column];
59896
+ if (operator === "CONTAINS") {
59897
+ return String(cellValue).toLowerCase().includes(String(value).toLowerCase());
59898
+ }
59899
+ const colType = inferColumnType(cellValue);
59900
+ try {
59901
+ let processedValue = value;
59902
+ let processedCellValue = cellValue;
59903
+ if (Array.isArray(value)) {
59904
+ return value.includes(cellValue);
59905
+ }
59906
+ if (colType === "datetime") {
59907
+ if (Array.isArray(value)) {
59908
+ processedValue = value.map((v) => new Date(v).getTime());
59909
+ } else {
59910
+ processedValue = new Date(value).getTime();
59911
+ }
59912
+ if (typeof cellValue === "number") {
59913
+ processedCellValue = cellValue;
59914
+ } else if (cellValue instanceof Date) {
59915
+ processedCellValue = cellValue.getTime();
59916
+ } else if (typeof cellValue === "string") {
59917
+ processedCellValue = parseISO$1(cellValue).getTime();
59918
+ } else {
59919
+ processedCellValue = 0;
59920
+ }
59921
+ } else if (colType === "categorical") {
59922
+ processedValue = String(value);
59923
+ processedCellValue = String(cellValue);
59924
+ } else if (colType === "numerical") {
59925
+ if (Array.isArray(value)) {
59926
+ processedValue = value.map((v) => {
59927
+ const num = Number(v);
59928
+ return Number.isNaN(num) ? 0 : num;
59929
+ });
59930
+ } else {
59931
+ const num = Number(value);
59932
+ processedValue = Number.isNaN(num) ? 0 : num;
59933
+ }
59934
+ const cellNum = Number(cellValue);
59935
+ processedCellValue = Number.isNaN(cellNum) ? 0 : cellNum;
59936
+ }
59937
+ switch (operator) {
59938
+ case "GT":
59939
+ return processedCellValue > processedValue;
59940
+ case "LT":
59941
+ return processedCellValue < processedValue;
59942
+ case "NE":
59943
+ return processedCellValue !== processedValue;
59944
+ case "BT":
59945
+ if (Array.isArray(processedValue) && processedValue.length === 2) {
59946
+ return processedCellValue >= processedValue[0] && processedCellValue <= processedValue[1];
59947
+ }
59948
+ return false;
59949
+ case "EQ":
59950
+ default:
59951
+ return processedCellValue === processedValue;
59952
+ }
59953
+ } catch (error) {
59954
+ console.warn("Filter error:", error, { column, value, operator });
59955
+ return true;
59956
+ }
59957
+ }
59958
+ function resolveFilterQuery(row, query, columnHints) {
59959
+ if ("column" in query) {
59960
+ const cleanColumn = query.column.replace(COLUMN_PREFIX_REGEX, "");
59961
+ return filterRow(row, cleanColumn, query.operator, query.value);
59962
+ }
59963
+ const results = query.clauses.map((clause) => resolveFilterQuery(row, clause));
59964
+ if (query.combinator === "AND") {
59965
+ return results.every((result) => result);
59966
+ }
59967
+ if (query.combinator === "OR") {
59968
+ return results.some((result) => result);
59969
+ }
59970
+ return true;
59971
+ }
59972
+ function applyFilters(data, filters, pagination, columnHints) {
59973
+ if (!data || data.length === 0) {
59974
+ return { data: [], count: 0, schema: null };
59975
+ }
59976
+ let filteredData = data;
59977
+ if (filters) {
59978
+ filteredData = data.filter((row) => resolveFilterQuery(row, filters));
59979
+ }
59980
+ const totalCount = filteredData.length;
59981
+ if (pagination) {
59982
+ if (pagination.index !== void 0) {
59983
+ const targetRow = data[pagination.index];
59984
+ return {
59985
+ data: targetRow ? [targetRow] : [],
59986
+ count: totalCount,
59987
+ schema: null
59988
+ };
59989
+ }
59990
+ if (pagination.sort) {
59991
+ const { id, desc } = pagination.sort;
59992
+ filteredData = [...filteredData].sort((a2, b2) => {
59993
+ const aVal = a2[id];
59994
+ const bVal = b2[id];
59995
+ if (aVal == null && bVal == null) {
59996
+ return 0;
59997
+ }
59998
+ if (aVal == null) {
59999
+ return desc ? 1 : -1;
60000
+ }
60001
+ if (bVal == null) {
60002
+ return desc ? -1 : 1;
60003
+ }
60004
+ const colType = inferColumnType(aVal);
60005
+ let comparison = 0;
60006
+ if (colType === "numerical") {
60007
+ comparison = Number(aVal) - Number(bVal);
60008
+ } else if (colType === "datetime") {
60009
+ let aTime = 0;
60010
+ if (typeof aVal === "number") {
60011
+ aTime = aVal;
60012
+ } else if (aVal instanceof Date) {
60013
+ aTime = aVal.getTime();
60014
+ } else if (typeof aVal === "string") {
60015
+ aTime = parseISO$1(aVal).getTime();
60016
+ }
60017
+ let bTime = 0;
60018
+ if (typeof bVal === "number") {
60019
+ bTime = bVal;
60020
+ } else if (bVal instanceof Date) {
60021
+ bTime = bVal.getTime();
60022
+ } else if (typeof bVal === "string") {
60023
+ bTime = parseISO$1(bVal).getTime();
60024
+ }
60025
+ comparison = aTime - bTime;
60026
+ } else {
60027
+ comparison = String(aVal).localeCompare(String(bVal));
60028
+ }
60029
+ return desc ? -comparison : comparison;
60030
+ });
60031
+ }
60032
+ const startIndex = pagination.offset || 0;
60033
+ const endIndex = pagination.limit ? startIndex + pagination.limit : filteredData.length;
60034
+ filteredData = filteredData.slice(startIndex, endIndex);
60035
+ }
60036
+ return {
60037
+ data: filteredData,
60038
+ count: totalCount,
60039
+ schema: null
60040
+ };
60041
+ }
60042
+ const INDEX = "__index__";
60043
+ function appendIndex(df) {
60044
+ if (df.length > 0 && !(INDEX in df[0])) {
60045
+ return df.map((row, i2) => ({ ...row, [INDEX]: i2 }));
60046
+ }
60047
+ return df;
60048
+ }
60049
+ function createFetcher(df) {
60050
+ const data = appendIndex(df);
60051
+ return async (filters, pagination) => {
60052
+ return applyFilters(data, filters, pagination);
60053
+ };
60054
+ }
60055
+ function useTabularVariable(variable) {
60056
+ const extras = useRequestExtras();
60057
+ const { client: wsClient } = React$1.useContext(websocketCtx);
60058
+ if (!isVariable(variable) || isSingleVariable(variable)) {
60059
+ const [data] = useVariable(variable);
60060
+ return React$1.useMemo(() => createFetcher(data), [data]);
60061
+ }
60062
+ const variablesContext = React$1.useContext(variablesCtx);
60063
+ variablesContext?.variables.current.add(variable.uid);
60064
+ React$1.useEffect(() => {
60065
+ return () => {
60066
+ variablesContext?.variables.current.delete(variable.uid);
60067
+ };
60068
+ }, []);
60069
+ if (isServerVariable(variable)) {
60070
+ const serverAtom = getOrRegisterServerVariable(variable, extras);
60071
+ const atomCount = Recoil_index_20(serverAtom);
60072
+ return useFetchTabularServerVariable(variable, atomCount, wsClient, extras);
60073
+ }
60074
+ const taskContext = useTaskContext();
60075
+ const dvResultSelector = getOrRegisterDerivedVariableResult(variable, wsClient, taskContext, extras);
60076
+ const dvResultLoadable = Recoil_index_21(dvResultSelector);
60077
+ const [dvResult, setDvResult] = React$1.useState(() => dvResultLoadable.getValue());
60078
+ React$1.useEffect(() => {
60079
+ if (dvResultLoadable.state === "hasValue") {
60080
+ setDvResult(dvResultLoadable.getValue());
60081
+ }
60082
+ }, [dvResultLoadable]);
60083
+ return useFetchTabularDerivedVariable(variable, dvResult, wsClient, taskContext, extras);
60084
+ }
60085
+ async function getTabularVariableValue(variable, ctx) {
60086
+ if (!isVariable(variable)) {
60087
+ return variable;
60088
+ }
60089
+ if (isSingleVariable(variable)) {
60090
+ return resolveVariable(
60091
+ variable,
60092
+ ctx.client,
60093
+ ctx.taskContext,
60094
+ ctx.extras,
60095
+ (v) => ctx.snapshot.getLoadable(v).toPromise()
60096
+ );
60097
+ }
60098
+ if (isServerVariable(variable)) {
60099
+ const response2 = await fetchTabularServerVariable({
60100
+ variable,
60101
+ // doesn't matter for fetching, will get up to date anyway
60102
+ seqNumber: 0,
60103
+ wsClient: ctx.client,
60104
+ extras: ctx.extras
60105
+ });
60106
+ return response2.data;
60107
+ }
60108
+ const resolved = await resolveVariable(
60109
+ variable,
60110
+ ctx.client,
60111
+ ctx.taskContext,
60112
+ ctx.extras,
60113
+ (v) => ctx.snapshot.getLoadable(v).toPromise()
60114
+ );
60115
+ const result = await fetchDerivedVariable({
60116
+ cache: variable.cache,
60117
+ extras: ctx.extras,
60118
+ force_key: null,
60119
+ /**
60120
+ * In this case we're not concerned about different selectors fetching the value so just use the uid
60121
+ */
60122
+ selectorKey: resolved.uid,
60123
+ values: normalizeRequest(cleanArgs(resolved.values), variable.variables),
60124
+ variableUid: resolved.uid,
60125
+ wsClient: ctx.client
60126
+ });
60127
+ if (isTaskResponse$1(result)) {
60128
+ throw new UserError("Task DerivedVariables are not supported in this context");
60129
+ }
60130
+ const response = result.value;
60131
+ return response.data;
60132
+ }
60659
60133
  function warnUpdateOnDerivedState() {
60660
60134
  console.warn("You tried to call update on variable with derived state, this is a noop and will be ignored.");
60661
60135
  }
60662
- function useVariable(variable, opts = {}) {
60136
+ function useVariable(variable, opts = { serverVariable: "disallow" }) {
60663
60137
  const extras = useRequestExtras();
60664
60138
  const { client: wsClient } = React$1.useContext(websocketCtx);
60665
60139
  const taskContext = useTaskContext();
@@ -60680,9 +60154,6 @@ Inferred class string: "${iconClasses}."`
60680
60154
  variablesContext?.variables.current.delete(variable.uid);
60681
60155
  };
60682
60156
  }, []);
60683
- if (isDataVariable(variable) || isDerivedDataVariable(variable)) {
60684
- throw new Error(`Non-data variable expected, got ${variable.__typename}`);
60685
- }
60686
60157
  if (isDerivedVariable(variable)) {
60687
60158
  const selector2 = useDerivedVariable(variable, wsClient, taskContext, extras);
60688
60159
  const selectorLoadable = Recoil_index_28(selector2);
@@ -60694,13 +60165,6 @@ Inferred class string: "${iconClasses}."`
60694
60165
  const deferred2 = useDeferLoadable(selectorLoadable, opts.suspend);
60695
60166
  return [deferred2.value, warnUpdateOnDerivedState];
60696
60167
  }
60697
- if (isUrlVariable(variable)) {
60698
- const [urlValue, setUrlValue] = useUrlVariable(variable);
60699
- React$1.useEffect(() => {
60700
- bus.publish("URL_VARIABLE_LOADED", { variable, value: urlValue });
60701
- }, [urlValue]);
60702
- return [urlValue, setUrlValue];
60703
- }
60704
60168
  if (isSwitchVariable(variable)) {
60705
60169
  return [useSwitchVariable(variable), warnUpdateOnDerivedState];
60706
60170
  }
@@ -60723,6 +60187,27 @@ Inferred class string: "${iconClasses}."`
60723
60187
  }
60724
60188
  return [stateValue, warnUpdateOnDerivedState];
60725
60189
  }
60190
+ if (isServerVariable(variable)) {
60191
+ if (opts.serverVariable === "disallow") {
60192
+ throw new UserError("ServerVariable cannot be directly consumed by this component");
60193
+ }
60194
+ const atom2 = React$1.useMemo(() => getOrRegisterServerVariable(variable, extras), [variable, extras]);
60195
+ const [seqNumber] = Recoil_index_22(atom2);
60196
+ const fetcher = useTabularVariable(variable);
60197
+ const { data } = reactQuery.useSuspenseQuery({
60198
+ // use the seq number as a dependency to refetch on changes
60199
+ queryKey: ["use-variable-server-variable", variable.uid, seqNumber],
60200
+ queryFn: async () => {
60201
+ const result = await fetcher(null, {
60202
+ limit: 1,
60203
+ offset: 0
60204
+ });
60205
+ return result.data;
60206
+ },
60207
+ refetchOnWindowFocus: false
60208
+ });
60209
+ return [data?.[0] ?? null, warnUpdateOnDerivedState];
60210
+ }
60726
60211
  const recoilState = getOrRegisterPlainVariable(variable, wsClient, taskContext, extras);
60727
60212
  if (!isDerivedVariable(variable.default)) {
60728
60213
  const [value, setValue] = Recoil_index_22(recoilState);
@@ -60980,24 +60465,18 @@ Inferred class string: "${iconClasses}."`
60980
60465
  return React$1.useMemo(() => ({ get }), [get]);
60981
60466
  }
60982
60467
  async function invokeAction(input, executionId, annotatedAction, actionCtx) {
60983
- const resolvedKwargs = Object.keys(annotatedAction.dynamic_kwargs).reduce(
60984
- (acc, k) => {
60985
- const value = annotatedAction.dynamic_kwargs[k];
60986
- acc[k] = isVariable(value) ? resolveVariable(
60468
+ const resolvedKwargs = await Promise.all(
60469
+ Object.entries(annotatedAction.dynamic_kwargs).map(async ([k, value]) => {
60470
+ const resolvedValue = isVariable(value) ? await resolveVariable(
60987
60471
  value,
60988
60472
  actionCtx.wsClient,
60989
60473
  actionCtx.taskCtx,
60990
60474
  actionCtx.extras,
60991
- (v) => (
60992
- // This is only called for primitive variables so it should always resolve successfully
60993
- // hence not using a promise
60994
- actionCtx.snapshot.getLoadable(v).getValue()
60995
- )
60475
+ (v) => actionCtx.snapshot.getLoadable(v).toPromise()
60996
60476
  ) : value;
60997
- return acc;
60998
- },
60999
- {}
61000
- );
60477
+ return [k, resolvedValue];
60478
+ })
60479
+ ).then((entries) => Object.fromEntries(entries));
61001
60480
  const ws_channel = await actionCtx.wsClient.getChannel();
61002
60481
  const res = await request(
61003
60482
  `/api/core/action/${annotatedAction.definition_uid}`,
@@ -61271,130 +60750,6 @@ Inferred class string: "${iconClasses}."`
61271
60750
  const { login, logout, ...extraRoutes } = authConfig.auth_components;
61272
60751
  return /* @__PURE__ */ React.createElement(Switch$1, null, /* @__PURE__ */ React.createElement(Route, { path: "/login" }, /* @__PURE__ */ React.createElement(DynamicAuthComponent, { component: login })), /* @__PURE__ */ React.createElement(Route, { path: "/logout" }, /* @__PURE__ */ React.createElement(DynamicAuthComponent, { component: logout })), Object.entries(extraRoutes).map(([path, component]) => /* @__PURE__ */ React.createElement(Route, { key: path, path: `/${path}` }, /* @__PURE__ */ React.createElement(DynamicAuthComponent, { component }))), /* @__PURE__ */ React.createElement(Route, { component: ErrorPage, path: "/error" }), /* @__PURE__ */ React.createElement(Route, { path: "/", render: () => /* @__PURE__ */ React.createElement(PrivateRoute, null, props.children) }));
61273
60752
  }
61274
- function useDataVariable(variable) {
61275
- const extras = useRequestExtras();
61276
- const { client: wsClient } = React$1.useContext(websocketCtx);
61277
- if (isDataVariable(variable)) {
61278
- registerDataVariable(variable);
61279
- const serverTriggers$ = React$1.useMemo(() => wsClient.serverTriggers$(variable.uid), []);
61280
- const [serverTriggerCounter, setServerTriggerCounter] = React$1.useState(0);
61281
- React$1.useEffect(() => {
61282
- const sub = serverTriggers$.subscribe(() => setServerTriggerCounter((c) => c + 1));
61283
- return () => sub.unsubscribe();
61284
- }, [serverTriggers$]);
61285
- const fetchDataVariable2 = useFetchDataVariable(variable, serverTriggerCounter);
61286
- return fetchDataVariable2;
61287
- }
61288
- const variablesContext = React$1.useContext(variablesCtx);
61289
- variablesContext?.variables.current.add(variable.uid);
61290
- React$1.useEffect(() => {
61291
- return () => {
61292
- variablesContext?.variables.current.delete(variable.uid);
61293
- };
61294
- }, []);
61295
- const taskContext = useTaskContext();
61296
- const dvSelector = useDerivedVariable(variable, wsClient, taskContext, extras);
61297
- const dvLoadable = Recoil_index_21(dvSelector);
61298
- const [dvValue, setDvValue] = React$1.useState(dvLoadable.toPromise());
61299
- React$1.useEffect(() => {
61300
- if (dvLoadable.state === "loading") {
61301
- setDvValue(dvLoadable.toPromise());
61302
- }
61303
- }, [dvLoadable]);
61304
- const fetchDerivedDataVariable2 = useFetchDerivedDataVariable(variable, taskContext, wsClient, dvValue);
61305
- return fetchDerivedDataVariable2;
61306
- }
61307
- function useAnyVariable(variable) {
61308
- if (isDataVariable(variable) || isDerivedDataVariable(variable)) {
61309
- const getData = useDataVariable(variable);
61310
- const { data, refetch } = reactQuery.useQuery({
61311
- // ideally would be 0 but that causes infinite loops, see https://github.com/TanStack/query/issues/2367
61312
- cacheTime: 1,
61313
- queryFn: async () => {
61314
- const dataResponse = await getData();
61315
- return dataResponse.data;
61316
- },
61317
- queryKey: ["any-variable-data", variable.uid],
61318
- refetchOnWindowFocus: false,
61319
- suspense: true
61320
- });
61321
- React$1.useEffect(() => {
61322
- refetch();
61323
- }, [getData]);
61324
- return data ?? void 0;
61325
- }
61326
- return useVariable(variable, {
61327
- suspend: false
61328
- })[0];
61329
- }
61330
- function getVariableValue(variable, shouldFetchVariable = false, ctx) {
61331
- const resolved = resolveVariable(
61332
- variable,
61333
- ctx.client,
61334
- ctx.taskContext,
61335
- ctx.extras,
61336
- (v) => ctx.snapshot.getLoadable(v).getValue()
61337
- );
61338
- if (isResolvedSwitchVariable(resolved)) {
61339
- throw new UserError("Switch variables are not supported in this context");
61340
- }
61341
- if (!shouldFetchVariable || !isDerivedVariable(variable) && !isDataVariable(variable) && !isDerivedDataVariable(variable)) {
61342
- return resolved;
61343
- }
61344
- if (!isResolvedDerivedVariable(resolved) && !isResolvedDataVariable(resolved) && !isResolvedDerivedDataVariable(resolved)) {
61345
- return resolved;
61346
- }
61347
- if (isResolvedDataVariable(resolved)) {
61348
- return fetchDataVariable(resolved.uid, ctx.extras, resolved.filters);
61349
- }
61350
- return fetchDerivedVariable({
61351
- cache: variable.cache,
61352
- extras: ctx.extras,
61353
- force_key: null,
61354
- /**
61355
- * In this case we're not concerned about different selectors fetching the value so just use the uid
61356
- */
61357
- selectorKey: resolved.uid,
61358
- values: normalizeRequest(
61359
- cleanArgs(resolved.values),
61360
- variable.variables
61361
- ),
61362
- variableUid: resolved.uid,
61363
- wsClient: ctx.client
61364
- }).then((resp) => {
61365
- if (isTaskResponse$1(resp)) {
61366
- throw new Error("Task DerivedVariables are not supported in this context");
61367
- }
61368
- if (isDerivedDataVariable(variable)) {
61369
- return ctx.client.getChannel().then(
61370
- (chan) => fetchDerivedDataVariable(variable.uid, ctx.extras, resp.cache_key, chan, variable.filters)
61371
- );
61372
- }
61373
- return resp.value;
61374
- });
61375
- }
61376
- function useVariableValue(variable, shouldFetchVariable = false) {
61377
- const taskContext = useTaskContext();
61378
- const { client: client2 } = React$1.useContext(websocketCtx);
61379
- const { search } = useLocation();
61380
- const extras = useRequestExtras();
61381
- if (!isVariable(variable)) {
61382
- return () => variable;
61383
- }
61384
- return Recoil_index_31(
61385
- ({ snapshot }) => {
61386
- return () => {
61387
- return getVariableValue(variable, shouldFetchVariable, {
61388
- client: client2,
61389
- extras,
61390
- snapshot,
61391
- taskContext
61392
- });
61393
- };
61394
- },
61395
- [variable.uid, useDeepCompare(taskContext), client2, search, extras]
61396
- );
61397
- }
61398
60753
  function useRefreshSelector() {
61399
60754
  return Recoil_index_31(({ refresh }) => {
61400
60755
  return (key, extras) => {
@@ -61413,16 +60768,16 @@ Inferred class string: "${iconClasses}."`
61413
60768
  const { client: client2 } = React$1.useContext(websocketCtx);
61414
60769
  const taskCtx = useTaskContext();
61415
60770
  return Recoil_index_31(({ snapshot }) => {
61416
- return (variable) => {
60771
+ return async (variable) => {
61417
60772
  if (!isRegistered(variable)) {
61418
60773
  return "__NOT_REGISTERED__";
61419
60774
  }
61420
- const resolvedVariable = resolveVariable(
60775
+ const resolvedVariable = await resolveVariable(
61421
60776
  variable,
61422
60777
  client2,
61423
60778
  taskCtx,
61424
60779
  extras,
61425
- (v) => snapshot.getLoadable(v).getValue()
60780
+ (v) => snapshot.getLoadable(v).toPromise()
61426
60781
  );
61427
60782
  return resolvedVariable;
61428
60783
  };
@@ -61711,14 +61066,12 @@ Inferred class string: "${iconClasses}."`
61711
61066
  eviction: "most-recent"
61712
61067
  },
61713
61068
  get: (extrasSerializable) => async ({ get }) => {
61714
- const resolvedKwargs = Object.keys(dynamicKwargs).reduce(
61715
- (acc, k) => {
61716
- const value = dynamicKwargs[k];
61717
- acc[k] = isVariable(value) ? resolveVariable(value, wsClient, taskContext, currentExtras) : value;
61718
- return acc;
61719
- },
61720
- {}
61721
- );
61069
+ const resolvedKwargs = await Promise.all(
61070
+ Object.entries(dynamicKwargs).map(async ([k, value]) => {
61071
+ const resolvedValue = isVariable(value) ? await resolveVariable(value, wsClient, taskContext, currentExtras) : value;
61072
+ return [k, resolvedValue];
61073
+ })
61074
+ ).then((entries) => Object.fromEntries(entries));
61722
61075
  const resolvedKwargsList = Object.values(resolvedKwargs);
61723
61076
  const kwargsList = Object.values(dynamicKwargs);
61724
61077
  const triggerAtom = getOrRegisterComponentTrigger(uid2);
@@ -61730,7 +61083,6 @@ Inferred class string: "${iconClasses}."`
61730
61083
  kwargsList,
61731
61084
  // pass deps=kwargs
61732
61085
  resolvedKwargsList,
61733
- wsClient,
61734
61086
  get,
61735
61087
  selfTrigger
61736
61088
  );
@@ -61766,8 +61118,10 @@ Inferred class string: "${iconClasses}."`
61766
61118
  taskContext.startTask(taskId, key, getComponentRegistryKey(uid2, true));
61767
61119
  try {
61768
61120
  await wsClient.waitForTask(taskId);
61769
- } catch {
61770
- return null;
61121
+ } catch (e2) {
61122
+ e2.selectorId = key;
61123
+ e2.selectorExtras = extrasSerializable.toJSON();
61124
+ throw e2;
61771
61125
  } finally {
61772
61126
  taskContext.endTask(taskId);
61773
61127
  }
@@ -62126,7 +61480,9 @@ Inferred class string: "${iconClasses}."`
62126
61480
  const taskIds = findRunningTasks(taskContext, props.variablesRef);
62127
61481
  if (taskIds.length > 0) {
62128
61482
  setSubscribedTaskIds(taskIds);
62129
- progressSubscription = wsClient.progressUpdates$(...taskIds).subscribe((notif) => setLatestProgressUpdate(notif.message));
61483
+ progressSubscription = wsClient.progressUpdates$(...taskIds).subscribe((notif) => {
61484
+ setLatestProgressUpdate(notif.message);
61485
+ });
62130
61486
  clearInterval(timer2);
62131
61487
  }
62132
61488
  }, POLLING_INTERVAL);
@@ -62304,7 +61660,7 @@ Inferred class string: "${iconClasses}."`
62304
61660
  pollingInterval = variable.polling_interval;
62305
61661
  }
62306
61662
  variable.variables.forEach((value) => {
62307
- if (isDerivedVariable(value) || isDerivedDataVariable(value)) {
61663
+ if (isDerivedVariable(value)) {
62308
61664
  const innerPollingInterval = getDerivedVariablePollingInterval(value);
62309
61665
  if (innerPollingInterval && (!pollingInterval || pollingInterval > innerPollingInterval)) {
62310
61666
  pollingInterval = innerPollingInterval;
@@ -62316,7 +61672,7 @@ Inferred class string: "${iconClasses}."`
62316
61672
  function computePollingInterval(kwargs, componentInterval) {
62317
61673
  let pollingInterval;
62318
61674
  Object.values(kwargs).forEach((value) => {
62319
- if (isDerivedVariable(value) || isDerivedDataVariable(value)) {
61675
+ if (isDerivedVariable(value)) {
62320
61676
  const innerPollingInterval = getDerivedVariablePollingInterval(value);
62321
61677
  if (innerPollingInterval && (!pollingInterval || pollingInterval > innerPollingInterval)) {
62322
61678
  pollingInterval = innerPollingInterval;
@@ -63017,9 +62373,9 @@ Inferred class string: "${iconClasses}."`
63017
62373
  function VariableStateProvider(props) {
63018
62374
  const getVariableState = useVariableState();
63019
62375
  React$1.useEffect(() => {
63020
- const sub = props.wsClient?.variableRequests$().subscribe((req) => {
62376
+ const sub = props.wsClient?.variableRequests$().subscribe(async (req) => {
63021
62377
  try {
63022
- const variableValue = getVariableState(req.message.variable);
62378
+ const variableValue = await getVariableState(req.message.variable);
63023
62379
  props.wsClient.sendVariable(variableValue, req.message.__rchan);
63024
62380
  } catch (err2) {
63025
62381
  console.warn(`Error when processing a getVariableValue request: ${String(err2)}`);
@@ -63129,7 +62485,7 @@ Inferred class string: "${iconClasses}."`
63129
62485
  {
63130
62486
  value: { actionRegistry: actions, componentRegistry: components, refetchComponents }
63131
62487
  },
63132
- /* @__PURE__ */ React.createElement(DynamicContext, { contextComponents: config2?.context_components ?? [] }, /* @__PURE__ */ React.createElement(StoreProviders, null, /* @__PURE__ */ React.createElement(RootWrapper, null, /* @__PURE__ */ React.createElement(DynamicComponent$1, { component: template.layout }), /* @__PURE__ */ React.createElement(VariableStateProvider, { wsClient }), config2?.enable_devtools && /* @__PURE__ */ React.createElement(DevTools, null))))
62488
+ /* @__PURE__ */ React.createElement(DynamicContext, { contextComponents: config2?.context_components ?? [] }, /* @__PURE__ */ React.createElement(StoreProviders, null, /* @__PURE__ */ React.createElement(ServerVariableSyncProvider, null, /* @__PURE__ */ React.createElement(RootWrapper, null, /* @__PURE__ */ React.createElement(DynamicComponent$1, { component: template.layout }), /* @__PURE__ */ React.createElement(VariableStateProvider, { wsClient }), config2?.enable_devtools && /* @__PURE__ */ React.createElement(DevTools, null)))))
63133
62489
  )));
63134
62490
  }
63135
62491
  const Wrapper = styled.div`
@@ -63183,22 +62539,22 @@ Inferred class string: "${iconClasses}."`
63183
62539
  };
63184
62540
  const ResetVariables = (ctx, actionImpl) => {
63185
62541
  actionImpl.variables.filter(isVariable).forEach((variable) => {
63186
- if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
62542
+ if (isDerivedVariable(variable)) {
63187
62543
  const triggerAtom = getOrRegisterTrigger(variable);
63188
62544
  ctx.set(triggerAtom, (triggerIndexValue) => ({
63189
62545
  force_key: nanoid(),
63190
62546
  inc: triggerIndexValue.inc + 1
63191
62547
  }));
63192
- } else if (isUrlVariable(variable)) {
63193
- const urlAtom = getOrRegisterUrlVariable(variable);
63194
- ctx.set(urlAtom, variable.default);
63195
- ctx.eventBus.publish("URL_VARIABLE_LOADED", { variable, value: variable.default });
63196
- } else if (isDataVariable(variable)) ;
63197
- else if (isSwitchVariable(variable)) ;
62548
+ } else if (isSwitchVariable(variable)) ;
63198
62549
  else if (isStateVariable(variable)) ;
62550
+ else if (isServerVariable(variable)) ;
63199
62551
  else {
63200
62552
  const plainAtom = getOrRegisterPlainVariable(variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
63201
- ctx.reset(plainAtom);
62553
+ if (variable.store?.__typename === "QueryParamStore") {
62554
+ ctx.set(plainAtom, variable.default);
62555
+ } else {
62556
+ ctx.reset(plainAtom);
62557
+ }
63202
62558
  ctx.eventBus.publish("PLAIN_VARIABLE_LOADED", { variable, value: variable.default });
63203
62559
  }
63204
62560
  });
@@ -63213,20 +62569,10 @@ Inferred class string: "${iconClasses}."`
63213
62569
  const INPUT = "__dara_input__";
63214
62570
  const TOGGLE = "__dara_toggle__";
63215
62571
  const UpdateVariable = async (ctx, actionImpl) => {
63216
- let varAtom;
63217
- let eventName;
63218
- switch (actionImpl.variable.__typename) {
63219
- case "Variable":
63220
- varAtom = getOrRegisterPlainVariable(actionImpl.variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
63221
- eventName = "PLAIN_VARIABLE_LOADED";
63222
- break;
63223
- case "UrlVariable":
63224
- varAtom = getOrRegisterUrlVariable(actionImpl.variable);
63225
- eventName = "URL_VARIABLE_LOADED";
63226
- break;
63227
- case "DataVariable":
63228
- throw new Error("DataVariable is not supported in UpdateVariable action");
62572
+ if (actionImpl.variable.__typename !== "Variable") {
62573
+ throw new UserError("UpdateVariable action only supports Variables");
63229
62574
  }
62575
+ const varAtom = getOrRegisterPlainVariable(actionImpl.variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
63230
62576
  let newValue;
63231
62577
  if (actionImpl.value === INPUT) {
63232
62578
  newValue = ctx.input;
@@ -63237,8 +62583,11 @@ Inferred class string: "${iconClasses}."`
63237
62583
  newValue = actionImpl.value;
63238
62584
  }
63239
62585
  ctx.set(varAtom, newValue);
63240
- ctx.eventBus.publish(eventName, { variable: actionImpl.variable, value: newValue });
62586
+ ctx.eventBus.publish("PLAIN_VARIABLE_LOADED", { variable: actionImpl.variable, value: newValue });
63241
62587
  };
62588
+ function commonjsRequire(path) {
62589
+ throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
62590
+ }
63242
62591
  var exceljs_min = { exports: {} };
63243
62592
  /*! ExcelJS 19-10-2023 */
63244
62593
  var hasRequiredExceljs_min;
@@ -86441,13 +85790,16 @@ Inferred class string: "${iconClasses}."`
86441
85790
  return FileSaver_min$1.exports;
86442
85791
  }
86443
85792
  var FileSaver_minExports = requireFileSaver_min();
85793
+ const COL_PATTERN = /^__col__\d+__(.+)$/;
85794
+ const INDEX_PATTERN = /^__index__\d+__(.+)$/;
86444
85795
  const restoreColumnName = (colName) => {
86445
- const colMatch = colName.match(/^__col__\d+__(.+)$/);
85796
+ const colMatch = colName.match(COL_PATTERN);
86446
85797
  if (colMatch) {
86447
85798
  return colMatch[1];
86448
85799
  }
86449
- if (colName.startsWith("__index__")) {
86450
- return colName;
85800
+ const indexMatch = colName.match(INDEX_PATTERN);
85801
+ if (indexMatch) {
85802
+ return indexMatch[1];
86451
85803
  }
86452
85804
  return colName;
86453
85805
  };
@@ -86455,7 +85807,7 @@ Inferred class string: "${iconClasses}."`
86455
85807
  return content.map((row) => {
86456
85808
  const processedRow = {};
86457
85809
  Object.entries(row).forEach(([key, value]) => {
86458
- if (key === "__index__" || key.startsWith("__index__")) {
85810
+ if (key === "__index__") {
86459
85811
  return;
86460
85812
  }
86461
85813
  const restoredKey = restoreColumnName(key);
@@ -86550,17 +85902,23 @@ Inferred class string: "${iconClasses}."`
86550
85902
  return null;
86551
85903
  };
86552
85904
  const DownloadVariable = async (ctx, actionImpl) => {
86553
- let value = getVariableValue(actionImpl.variable, true, {
85905
+ let value = await getTabularVariableValue(actionImpl.variable, {
86554
85906
  client: ctx.wsClient,
86555
85907
  extras: ctx.extras,
86556
85908
  search: ctx.location.search,
86557
85909
  snapshot: ctx.snapshot,
86558
85910
  taskContext: ctx.taskCtx
86559
85911
  });
86560
- if (value instanceof Promise) {
86561
- value = await value;
85912
+ if (value === null) {
85913
+ ctx.notificationCtx.pushNotification({
85914
+ key: "_downloadVariable",
85915
+ message: "Failed to fetch the variable value",
85916
+ status: Status.ERROR,
85917
+ title: "Error fetching variable value"
85918
+ });
85919
+ return;
86562
85920
  }
86563
- if (actionImpl.variable.__typename === "DataVariable" || actionImpl.variable.__typename === "DerivedDataVariable") {
85921
+ if (Array.isArray(value)) {
86564
85922
  value = processDataForDownload(value);
86565
85923
  }
86566
85924
  const fileName = actionImpl.file_name || "Data";
@@ -86867,7 +86225,7 @@ Inferred class string: "${iconClasses}."`
86867
86225
  return /* @__PURE__ */ React__namespace.createElement(DynamicComponent$1, { component: transformedRenderer });
86868
86226
  }, isEqual$5);
86869
86227
  function ForImpl(props) {
86870
- const items = useAnyVariable(props.items);
86228
+ const [items] = useVariable(props.items, { suspend: false });
86871
86229
  const markers = React__namespace.useMemo(() => getInjectionMarkers(props.renderer), [props.renderer]);
86872
86230
  const key = React__namespace.useMemo(() => props.key_accessor?.split(".") ?? null, [props.key_accessor]);
86873
86231
  const getItemKey = React__namespace.useCallback(
@@ -86950,6 +86308,7 @@ Inferred class string: "${iconClasses}."`
86950
86308
  exports.ResetVariables = ResetVariables;
86951
86309
  exports.RouterContent = RouterContent;
86952
86310
  exports.RowFallback = RowFallback;
86311
+ exports.ServerVariableSyncProvider = ServerVariableSyncProvider;
86953
86312
  exports.SideBarFrame = SideBarFrame;
86954
86313
  exports.TemplateRoot = TemplateRoot;
86955
86314
  exports.TopBarFrame = TopBarFrame;
@@ -86969,29 +86328,30 @@ Inferred class string: "${iconClasses}."`
86969
86328
  exports.clearCaches_TEST = clearCaches_TEST;
86970
86329
  exports.clearRegistries_TEST = clearRegistries_TEST;
86971
86330
  exports.combineFilters = combineFilters;
86972
- exports.dataRegistry = dataRegistry;
86973
86331
  exports.default = run;
86974
86332
  exports.depsRegistry = depsRegistry;
86975
86333
  exports.fetchDerivedVariable = fetchDerivedVariable;
86334
+ exports.fetchTabularServerVariable = fetchTabularServerVariable;
86976
86335
  exports.fetchTaskResult = fetchTaskResult;
86977
86336
  exports.getComponentRegistryKey = getComponentRegistryKey;
86978
86337
  exports.getDeps = getDeps;
86979
86338
  exports.getIcon = getIcon;
86980
86339
  exports.getOrRegisterDerivedVariable = getOrRegisterDerivedVariable;
86340
+ exports.getOrRegisterDerivedVariableResult = getOrRegisterDerivedVariableResult;
86981
86341
  exports.getOrRegisterDerivedVariableValue = getOrRegisterDerivedVariableValue;
86342
+ exports.getOrRegisterServerVariable = getOrRegisterServerVariable;
86982
86343
  exports.getRegistryKey = getRegistryKey;
86983
86344
  exports.getSessionToken = getSessionToken;
86345
+ exports.getTabularVariableValue = getTabularVariableValue;
86984
86346
  exports.getToken = getToken;
86985
86347
  exports.getTokenKey = getTokenKey;
86986
- exports.getVariableValue = getVariableValue;
86987
86348
  exports.handleAuthErrors = handleAuthErrors;
86988
86349
  exports.injectCss = injectCss;
86989
86350
  exports.isActionImpl = isActionImpl;
86990
86351
  exports.isAnnotatedAction = isAnnotatedAction;
86991
86352
  exports.isCondition = isCondition;
86992
86353
  exports.isConditionTrue = isConditionTrue;
86993
- exports.isDataVariable = isDataVariable;
86994
- exports.isDerivedDataVariable = isDerivedDataVariable;
86354
+ exports.isDataResponse = isDataResponse;
86995
86355
  exports.isDerivedVariable = isDerivedVariable;
86996
86356
  exports.isInvalidComponent = isInvalidComponent;
86997
86357
  exports.isJsComponent = isJsComponent;
@@ -86999,14 +86359,14 @@ Inferred class string: "${iconClasses}."`
86999
86359
  exports.isPyComponent = isPyComponent;
87000
86360
  exports.isRawString = isRawString;
87001
86361
  exports.isRegistered = isRegistered;
87002
- exports.isResolvedDataVariable = isResolvedDataVariable;
87003
- exports.isResolvedDerivedDataVariable = isResolvedDerivedDataVariable;
87004
86362
  exports.isResolvedDerivedVariable = isResolvedDerivedVariable;
86363
+ exports.isResolvedServerVariable = isResolvedServerVariable;
87005
86364
  exports.isResolvedSwitchVariable = isResolvedSwitchVariable;
86365
+ exports.isServerVariable = isServerVariable;
86366
+ exports.isSingleVariable = isSingleVariable;
87006
86367
  exports.isStateVariable = isStateVariable;
87007
86368
  exports.isSwitchVariable = isSwitchVariable;
87008
86369
  exports.isTaskResponse = isTaskResponse$1;
87009
- exports.isUrlVariable = isUrlVariable;
87010
86370
  exports.isVariable = isVariable;
87011
86371
  exports.normalizeRequest = normalizeRequest;
87012
86372
  exports.onTokenChange = onTokenChange;
@@ -87017,6 +86377,7 @@ Inferred class string: "${iconClasses}."`
87017
86377
  exports.resolveDerivedValue = resolveDerivedValue;
87018
86378
  exports.resolveNested = resolveNested;
87019
86379
  exports.resolveReferrer = resolveReferrer;
86380
+ exports.resolveServerVariable = resolveServerVariable;
87020
86381
  exports.resolveTheme = resolveTheme;
87021
86382
  exports.revokeSession = revokeSession;
87022
86383
  exports.selectorFamilyMembersRegistry = selectorFamilyMembersRegistry;
@@ -87028,17 +86389,17 @@ Inferred class string: "${iconClasses}."`
87028
86389
  exports.useAction = useAction;
87029
86390
  exports.useActionIsLoading = useActionIsLoading;
87030
86391
  exports.useActions = useActions;
87031
- exports.useAnyVariable = useAnyVariable;
87032
86392
  exports.useAuthConfig = useAuthConfig;
87033
86393
  exports.useComponentRegistry = useComponentRegistry;
87034
86394
  exports.useComponentStyles = useComponentStyles;
87035
86395
  exports.useComponents = useComponents;
87036
86396
  exports.useConditionOrVariable = useConditionOrVariable;
87037
86397
  exports.useConfig = useConfig;
87038
- exports.useDataVariable = useDataVariable;
87039
86398
  exports.useDeferLoadable = useDeferLoadable;
87040
86399
  exports.useDerivedVariable = useDerivedVariable;
87041
86400
  exports.useEventBus = useEventBus;
86401
+ exports.useFetchTabularDerivedVariable = useFetchTabularDerivedVariable;
86402
+ exports.useFetchTabularServerVariable = useFetchTabularServerVariable;
87042
86403
  exports.useInterval = useInterval;
87043
86404
  exports.usePrevious = usePrevious;
87044
86405
  exports.useRefreshSelector = useRefreshSelector;
@@ -87047,6 +86408,7 @@ Inferred class string: "${iconClasses}."`
87047
86408
  exports.useSession = useSession;
87048
86409
  exports.useSessionToken = useSessionToken;
87049
86410
  exports.useSwitchVariable = useSwitchVariable;
86411
+ exports.useTabularVariable = useTabularVariable;
87050
86412
  exports.useTaskContext = useTaskContext;
87051
86413
  exports.useTemplate = useTemplate;
87052
86414
  exports.useTriggerIndex = useTriggerIndex;
@@ -87054,7 +86416,6 @@ Inferred class string: "${iconClasses}."`
87054
86416
  exports.useUser = useUser;
87055
86417
  exports.useVariable = useVariable;
87056
86418
  exports.useVariableState = useVariableState;
87057
- exports.useVariableValue = useVariableValue;
87058
86419
  exports.useWindowTitle = useWindowTitle;
87059
86420
  exports.verifySessionToken = verifySessionToken;
87060
86421
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });