denotify-client 1.1.31 → 1.1.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- var Yi = Object.defineProperty;
2
- var Qi = (n, e, t) => e in n ? Yi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var d = (n, e, t) => (Qi(n, typeof e != "symbol" ? e + "" : e, t), t), zr = (n, e, t) => {
1
+ var Qi = Object.defineProperty;
2
+ var eo = (n, e, t) => e in n ? Qi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var d = (n, e, t) => (eo(n, typeof e != "symbol" ? e + "" : e, t), t), zr = (n, e, t) => {
4
4
  if (!e.has(n))
5
5
  throw TypeError("Cannot " + t);
6
6
  };
@@ -8,7 +8,7 @@ var m = (n, e, t) => (zr(n, e, "read from private field"), t ? t.call(n) : e.get
8
8
  if (e.has(n))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  e instanceof WeakSet ? e.add(n) : e.set(n, t);
11
- }, P = (n, e, t, r) => (zr(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), Xn = (n, e, t, r) => ({
11
+ }, P = (n, e, t, r) => (zr(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), Zn = (n, e, t, r) => ({
12
12
  set _(s) {
13
13
  P(n, e, s, t);
14
14
  },
@@ -16,7 +16,7 @@ var m = (n, e, t) => (zr(n, e, "read from private field"), t ? t.call(n) : e.get
16
16
  return m(n, e, r);
17
17
  }
18
18
  }), B = (n, e, t) => (zr(n, e, "access private method"), t);
19
- function eo(n, e) {
19
+ function to(n, e) {
20
20
  for (var t = 0; t < e.length; t++) {
21
21
  const r = e[t];
22
22
  if (typeof r != "string" && !Array.isArray(r)) {
@@ -32,7 +32,7 @@ function eo(n, e) {
32
32
  }
33
33
  return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
34
34
  }
35
- var to = globalThis && globalThis.__awaiter || function(n, e, t, r) {
35
+ var ro = globalThis && globalThis.__awaiter || function(n, e, t, r) {
36
36
  function s(i) {
37
37
  return i instanceof t ? i : new t(function(o) {
38
38
  o(i);
@@ -59,9 +59,9 @@ var to = globalThis && globalThis.__awaiter || function(n, e, t, r) {
59
59
  u((r = r.apply(n, e || [])).next());
60
60
  });
61
61
  };
62
- const ro = (n) => {
62
+ const no = (n) => {
63
63
  let e;
64
- return n ? e = n : typeof fetch > "u" ? e = (...t) => to(void 0, void 0, void 0, function* () {
64
+ return n ? e = n : typeof fetch > "u" ? e = (...t) => ro(void 0, void 0, void 0, function* () {
65
65
  return yield (yield Promise.resolve().then(() => Sr)).fetch(...t);
66
66
  }) : e = fetch, (...t) => e(...t);
67
67
  };
@@ -70,22 +70,22 @@ class An extends Error {
70
70
  super(e), super.name = t, this.context = r;
71
71
  }
72
72
  }
73
- class no extends An {
73
+ class so extends An {
74
74
  constructor(e) {
75
75
  super("Failed to send a request to the Edge Function", "FunctionsFetchError", e);
76
76
  }
77
77
  }
78
- class so extends An {
78
+ class io extends An {
79
79
  constructor(e) {
80
80
  super("Relay Error invoking the Edge Function", "FunctionsRelayError", e);
81
81
  }
82
82
  }
83
- class io extends An {
83
+ class oo extends An {
84
84
  constructor(e) {
85
85
  super("Edge Function returned a non-2xx status code", "FunctionsHttpError", e);
86
86
  }
87
87
  }
88
- var oo = globalThis && globalThis.__awaiter || function(n, e, t, r) {
88
+ var ao = globalThis && globalThis.__awaiter || function(n, e, t, r) {
89
89
  function s(i) {
90
90
  return i instanceof t ? i : new t(function(o) {
91
91
  o(i);
@@ -112,9 +112,9 @@ var oo = globalThis && globalThis.__awaiter || function(n, e, t, r) {
112
112
  u((r = r.apply(n, e || [])).next());
113
113
  });
114
114
  };
115
- class ao {
115
+ class co {
116
116
  constructor(e, { headers: t = {}, customFetch: r } = {}) {
117
- this.url = e, this.headers = t, this.fetch = ro(r);
117
+ this.url = e, this.headers = t, this.fetch = no(r);
118
118
  }
119
119
  /**
120
120
  * Updates the authorization header
@@ -130,7 +130,7 @@ class ao {
130
130
  */
131
131
  invoke(e, t = {}) {
132
132
  var r;
133
- return oo(this, void 0, void 0, function* () {
133
+ return ao(this, void 0, void 0, function* () {
134
134
  try {
135
135
  const { headers: s, method: i, body: o } = t;
136
136
  let a = {}, c;
@@ -144,12 +144,12 @@ class ao {
144
144
  headers: Object.assign(Object.assign(Object.assign({}, a), this.headers), s),
145
145
  body: c
146
146
  }).catch((p) => {
147
- throw new no(p);
147
+ throw new so(p);
148
148
  }), l = u.headers.get("x-relay-error");
149
149
  if (l && l === "true")
150
- throw new so(u);
151
- if (!u.ok)
152
150
  throw new io(u);
151
+ if (!u.ok)
152
+ throw new oo(u);
153
153
  let h = ((r = u.headers.get("Content-Type")) !== null && r !== void 0 ? r : "text/plain").split(";")[0].trim(), y;
154
154
  return h === "application/json" ? y = yield u.json() : h === "application/octet-stream" ? y = yield u.blob() : h === "multipart/form-data" ? y = yield u.formData() : y = yield u.text(), { data: y, error: null };
155
155
  } catch (s) {
@@ -158,11 +158,11 @@ class ao {
158
158
  });
159
159
  }
160
160
  }
161
- var co = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
162
- function uo(n) {
161
+ var uo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
162
+ function lo(n) {
163
163
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
164
164
  }
165
- var It = {}, lo = {
165
+ var It = {}, ho = {
166
166
  get exports() {
167
167
  return It;
168
168
  },
@@ -171,7 +171,7 @@ var It = {}, lo = {
171
171
  }
172
172
  };
173
173
  (function(n, e) {
174
- var t = typeof self < "u" ? self : co, r = function() {
174
+ var t = typeof self < "u" ? self : uo, r = function() {
175
175
  function i() {
176
176
  this.fetch = !1, this.DOMException = t.DOMException;
177
177
  }
@@ -220,8 +220,8 @@ var It = {}, lo = {
220
220
  function p(f) {
221
221
  var b = {
222
222
  next: function() {
223
- var T = f.shift();
224
- return { done: T === void 0, value: T };
223
+ var O = f.shift();
224
+ return { done: O === void 0, value: O };
225
225
  }
226
226
  };
227
227
  return a.iterable && (b[Symbol.iterator] = function() {
@@ -229,8 +229,8 @@ var It = {}, lo = {
229
229
  }), b;
230
230
  }
231
231
  function w(f) {
232
- this.map = {}, f instanceof w ? f.forEach(function(b, T) {
233
- this.append(T, b);
232
+ this.map = {}, f instanceof w ? f.forEach(function(b, O) {
233
+ this.append(O, b);
234
234
  }, this) : Array.isArray(f) ? f.forEach(function(b) {
235
235
  this.append(b[0], b[1]);
236
236
  }, this) : f && Object.getOwnPropertyNames(f).forEach(function(b) {
@@ -239,8 +239,8 @@ var It = {}, lo = {
239
239
  }
240
240
  w.prototype.append = function(f, b) {
241
241
  f = h(f), b = y(b);
242
- var T = this.map[f];
243
- this.map[f] = T ? T + ", " + b : b;
242
+ var O = this.map[f];
243
+ this.map[f] = O ? O + ", " + b : b;
244
244
  }, w.prototype.delete = function(f) {
245
245
  delete this.map[h(f)];
246
246
  }, w.prototype.get = function(f) {
@@ -250,12 +250,12 @@ var It = {}, lo = {
250
250
  }, w.prototype.set = function(f, b) {
251
251
  this.map[h(f)] = y(b);
252
252
  }, w.prototype.forEach = function(f, b) {
253
- for (var T in this.map)
254
- this.map.hasOwnProperty(T) && f.call(b, this.map[T], T, this);
253
+ for (var O in this.map)
254
+ this.map.hasOwnProperty(O) && f.call(b, this.map[O], O, this);
255
255
  }, w.prototype.keys = function() {
256
256
  var f = [];
257
- return this.forEach(function(b, T) {
258
- f.push(T);
257
+ return this.forEach(function(b, O) {
258
+ f.push(O);
259
259
  }), p(f);
260
260
  }, w.prototype.values = function() {
261
261
  var f = [];
@@ -264,8 +264,8 @@ var It = {}, lo = {
264
264
  }), p(f);
265
265
  }, w.prototype.entries = function() {
266
266
  var f = [];
267
- return this.forEach(function(b, T) {
268
- f.push([T, b]);
267
+ return this.forEach(function(b, O) {
268
+ f.push([O, b]);
269
269
  }), p(f);
270
270
  }, a.iterable && (w.prototype[Symbol.iterator] = w.prototype.entries);
271
271
  function v(f) {
@@ -274,26 +274,26 @@ var It = {}, lo = {
274
274
  f.bodyUsed = !0;
275
275
  }
276
276
  function g(f) {
277
- return new Promise(function(b, T) {
277
+ return new Promise(function(b, O) {
278
278
  f.onload = function() {
279
279
  b(f.result);
280
280
  }, f.onerror = function() {
281
- T(f.error);
281
+ O(f.error);
282
282
  };
283
283
  });
284
284
  }
285
285
  function A(f) {
286
- var b = new FileReader(), T = g(b);
287
- return b.readAsArrayBuffer(f), T;
286
+ var b = new FileReader(), O = g(b);
287
+ return b.readAsArrayBuffer(f), O;
288
288
  }
289
289
  function C(f) {
290
- var b = new FileReader(), T = g(b);
291
- return b.readAsText(f), T;
290
+ var b = new FileReader(), O = g(b);
291
+ return b.readAsText(f), O;
292
292
  }
293
- function X(f) {
294
- for (var b = new Uint8Array(f), T = new Array(b.length), J = 0; J < b.length; J++)
295
- T[J] = String.fromCharCode(b[J]);
296
- return T.join("");
293
+ function Z(f) {
294
+ for (var b = new Uint8Array(f), O = new Array(b.length), J = 0; J < b.length; J++)
295
+ O[J] = String.fromCharCode(b[J]);
296
+ return O.join("");
297
297
  }
298
298
  function U(f) {
299
299
  if (f.slice)
@@ -324,7 +324,7 @@ var It = {}, lo = {
324
324
  if (this._bodyBlob)
325
325
  return C(this._bodyBlob);
326
326
  if (this._bodyArrayBuffer)
327
- return Promise.resolve(X(this._bodyArrayBuffer));
327
+ return Promise.resolve(Z(this._bodyArrayBuffer));
328
328
  if (this._bodyFormData)
329
329
  throw new Error("could not read FormData body as text");
330
330
  return Promise.resolve(this._bodyText);
@@ -341,32 +341,32 @@ var It = {}, lo = {
341
341
  }
342
342
  function fe(f, b) {
343
343
  b = b || {};
344
- var T = b.body;
344
+ var O = b.body;
345
345
  if (f instanceof fe) {
346
346
  if (f.bodyUsed)
347
347
  throw new TypeError("Already read");
348
- this.url = f.url, this.credentials = f.credentials, b.headers || (this.headers = new w(f.headers)), this.method = f.method, this.mode = f.mode, this.signal = f.signal, !T && f._bodyInit != null && (T = f._bodyInit, f.bodyUsed = !0);
348
+ this.url = f.url, this.credentials = f.credentials, b.headers || (this.headers = new w(f.headers)), this.method = f.method, this.mode = f.mode, this.signal = f.signal, !O && f._bodyInit != null && (O = f._bodyInit, f.bodyUsed = !0);
349
349
  } else
350
350
  this.url = String(f);
351
- if (this.credentials = b.credentials || this.credentials || "same-origin", (b.headers || !this.headers) && (this.headers = new w(b.headers)), this.method = rr(b.method || this.method || "GET"), this.mode = b.mode || this.mode || null, this.signal = b.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && T)
351
+ if (this.credentials = b.credentials || this.credentials || "same-origin", (b.headers || !this.headers) && (this.headers = new w(b.headers)), this.method = rr(b.method || this.method || "GET"), this.mode = b.mode || this.mode || null, this.signal = b.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && O)
352
352
  throw new TypeError("Body not allowed for GET or HEAD requests");
353
- this._initBody(T);
353
+ this._initBody(O);
354
354
  }
355
355
  fe.prototype.clone = function() {
356
356
  return new fe(this, { body: this._bodyInit });
357
357
  };
358
358
  function nr(f) {
359
359
  var b = new FormData();
360
- return f.trim().split("&").forEach(function(T) {
361
- if (T) {
362
- var J = T.split("="), V = J.shift().replace(/\+/g, " "), N = J.join("=").replace(/\+/g, " ");
360
+ return f.trim().split("&").forEach(function(O) {
361
+ if (O) {
362
+ var J = O.split("="), V = J.shift().replace(/\+/g, " "), N = J.join("=").replace(/\+/g, " ");
363
363
  b.append(decodeURIComponent(V), decodeURIComponent(N));
364
364
  }
365
365
  }), b;
366
366
  }
367
367
  function L(f) {
368
- var b = new w(), T = f.replace(/\r?\n[\t ]+/g, " ");
369
- return T.split(/\r?\n/).forEach(function(J) {
368
+ var b = new w(), O = f.replace(/\r?\n[\t ]+/g, " ");
369
+ return O.split(/\r?\n/).forEach(function(J) {
370
370
  var V = J.split(":"), N = V.shift().trim();
371
371
  if (N) {
372
372
  var ir = V.join(":").trim();
@@ -398,14 +398,14 @@ var It = {}, lo = {
398
398
  try {
399
399
  new o.DOMException();
400
400
  } catch {
401
- o.DOMException = function(b, T) {
402
- this.message = b, this.name = T;
401
+ o.DOMException = function(b, O) {
402
+ this.message = b, this.name = O;
403
403
  var J = Error(b);
404
404
  this.stack = J.stack;
405
405
  }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
406
406
  }
407
407
  function gt(f, b) {
408
- return new Promise(function(T, J) {
408
+ return new Promise(function(O, J) {
409
409
  var V = new fe(f, b);
410
410
  if (V.signal && V.signal.aborted)
411
411
  return J(new o.DOMException("Aborted", "AbortError"));
@@ -421,7 +421,7 @@ var It = {}, lo = {
421
421
  };
422
422
  Ut.url = "responseURL" in N ? N.responseURL : Ut.headers.get("X-Request-URL");
423
423
  var Vr = "response" in N ? N.response : N.responseText;
424
- T(new M(Vr, Ut));
424
+ O(new M(Vr, Ut));
425
425
  }, N.onerror = function() {
426
426
  J(new TypeError("Network request failed"));
427
427
  }, N.ontimeout = function() {
@@ -440,12 +440,12 @@ var It = {}, lo = {
440
440
  })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
441
441
  var s = r;
442
442
  e = s.fetch, e.default = s.fetch, e.fetch = s.fetch, e.Headers = s.Headers, e.Request = s.Request, e.Response = s.Response, n.exports = e;
443
- })(lo, It);
444
- const Sn = /* @__PURE__ */ uo(It), Sr = /* @__PURE__ */ eo({
443
+ })(ho, It);
444
+ const Sn = /* @__PURE__ */ lo(It), Sr = /* @__PURE__ */ to({
445
445
  __proto__: null,
446
446
  default: Sn
447
447
  }, [It]);
448
- class ho {
448
+ class fo {
449
449
  constructor(e) {
450
450
  this.shouldThrowOnError = !1, this.method = e.method, this.url = e.url, this.headers = e.headers, this.schema = e.schema, this.body = e.body, this.shouldThrowOnError = e.shouldThrowOnError, this.signal = e.signal, this.allowEmpty = e.allowEmpty, e.fetch ? this.fetch = e.fetch : typeof fetch > "u" ? this.fetch = Sn : this.fetch = fetch;
451
451
  }
@@ -510,7 +510,7 @@ class ho {
510
510
  }))), s.then(e, t);
511
511
  }
512
512
  }
513
- class fo extends ho {
513
+ class po extends fo {
514
514
  /**
515
515
  * Perform a SELECT on the query result.
516
516
  *
@@ -657,7 +657,7 @@ class fo extends ho {
657
657
  return this;
658
658
  }
659
659
  }
660
- class Et extends fo {
660
+ class Et extends po {
661
661
  /**
662
662
  * Match only rows where `column` is equal to `value`.
663
663
  *
@@ -918,7 +918,7 @@ class Et extends fo {
918
918
  return this.url.searchParams.append(e, `${t}.${r}`), this;
919
919
  }
920
920
  }
921
- class po {
921
+ class yo {
922
922
  constructor(e, { headers: t = {}, schema: r, fetch: s }) {
923
923
  this.url = e, this.headers = t, this.schema = r, this.fetch = s;
924
924
  }
@@ -1108,8 +1108,8 @@ class po {
1108
1108
  });
1109
1109
  }
1110
1110
  }
1111
- const yo = "1.4.1", mo = { "X-Client-Info": `postgrest-js/${yo}` };
1112
- class go {
1111
+ const mo = "1.4.1", go = { "X-Client-Info": `postgrest-js/${mo}` };
1112
+ class wo {
1113
1113
  // TODO: Add back shouldThrowOnError once we figure out the typings
1114
1114
  /**
1115
1115
  * Creates a PostgREST client.
@@ -1121,7 +1121,7 @@ class go {
1121
1121
  * @param options.fetch - Custom fetch
1122
1122
  */
1123
1123
  constructor(e, { headers: t = {}, schema: r, fetch: s } = {}) {
1124
- this.url = e, this.headers = Object.assign(Object.assign({}, mo), t), this.schema = r, this.fetch = s;
1124
+ this.url = e, this.headers = Object.assign(Object.assign({}, go), t), this.schema = r, this.fetch = s;
1125
1125
  }
1126
1126
  /**
1127
1127
  * Perform a query on a table or a view.
@@ -1130,7 +1130,7 @@ class go {
1130
1130
  */
1131
1131
  from(e) {
1132
1132
  const t = new URL(`${this.url}/${e}`);
1133
- return new po(t, {
1133
+ return new yo(t, {
1134
1134
  headers: Object.assign({}, this.headers),
1135
1135
  schema: this.schema,
1136
1136
  fetch: this.fetch
@@ -1176,11 +1176,11 @@ class go {
1176
1176
  });
1177
1177
  }
1178
1178
  }
1179
- var qr, Zn;
1180
- function wo() {
1181
- if (Zn)
1179
+ var qr, Yn;
1180
+ function bo() {
1181
+ if (Yn)
1182
1182
  return qr;
1183
- Zn = 1;
1183
+ Yn = 1;
1184
1184
  var n = function() {
1185
1185
  if (typeof self == "object" && self)
1186
1186
  return self;
@@ -1210,7 +1210,7 @@ function wo() {
1210
1210
  }
1211
1211
  }(), qr;
1212
1212
  }
1213
- const bo = "websocket", vo = "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.", _o = [
1213
+ const vo = "websocket", _o = "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.", Eo = [
1214
1214
  "websocket",
1215
1215
  "websockets",
1216
1216
  "socket",
@@ -1221,89 +1221,89 @@ const bo = "websocket", vo = "Websocket Client & Server Library implementing the
1221
1221
  "realtime",
1222
1222
  "server",
1223
1223
  "client"
1224
- ], Eo = "Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)", xo = [
1224
+ ], xo = "Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)", To = [
1225
1225
  "Iñaki Baz Castillo <ibc@aliax.net> (http://dev.sipdoc.net)"
1226
- ], To = "1.0.34", Oo = {
1226
+ ], Oo = "1.0.34", ko = {
1227
1227
  type: "git",
1228
1228
  url: "https://github.com/theturtle32/WebSocket-Node.git"
1229
- }, ko = "https://github.com/theturtle32/WebSocket-Node", Ao = {
1229
+ }, Ao = "https://github.com/theturtle32/WebSocket-Node", So = {
1230
1230
  node: ">=4.0.0"
1231
- }, So = {
1231
+ }, Ro = {
1232
1232
  bufferutil: "^4.0.1",
1233
1233
  debug: "^2.2.0",
1234
1234
  "es5-ext": "^0.10.50",
1235
1235
  "typedarray-to-buffer": "^3.1.5",
1236
1236
  "utf-8-validate": "^5.0.2",
1237
1237
  yaeti: "^0.0.6"
1238
- }, Ro = {
1238
+ }, $o = {
1239
1239
  "buffer-equal": "^1.0.0",
1240
1240
  gulp: "^4.0.2",
1241
1241
  "gulp-jshint": "^2.0.4",
1242
1242
  "jshint-stylish": "^2.2.1",
1243
1243
  jshint: "^2.0.0",
1244
1244
  tape: "^4.9.1"
1245
- }, $o = {
1246
- verbose: !1
1247
1245
  }, Po = {
1246
+ verbose: !1
1247
+ }, No = {
1248
1248
  test: "tape test/unit/*.js",
1249
1249
  gulp: "gulp"
1250
- }, No = "index", Io = {
1250
+ }, Io = "index", Co = {
1251
1251
  lib: "./lib"
1252
- }, Co = "lib/browser.js", Fo = "Apache-2.0", Do = {
1253
- name: bo,
1254
- description: vo,
1255
- keywords: _o,
1256
- author: Eo,
1257
- contributors: xo,
1258
- version: To,
1259
- repository: Oo,
1260
- homepage: ko,
1261
- engines: Ao,
1262
- dependencies: So,
1263
- devDependencies: Ro,
1264
- config: $o,
1265
- scripts: Po,
1266
- main: No,
1267
- directories: Io,
1268
- browser: Co,
1269
- license: Fo
1252
+ }, Fo = "lib/browser.js", Do = "Apache-2.0", Uo = {
1253
+ name: vo,
1254
+ description: _o,
1255
+ keywords: Eo,
1256
+ author: xo,
1257
+ contributors: To,
1258
+ version: Oo,
1259
+ repository: ko,
1260
+ homepage: Ao,
1261
+ engines: So,
1262
+ dependencies: Ro,
1263
+ devDependencies: $o,
1264
+ config: Po,
1265
+ scripts: No,
1266
+ main: Io,
1267
+ directories: Co,
1268
+ browser: Fo,
1269
+ license: Do
1270
1270
  };
1271
- var Uo = Do.version, Qe;
1271
+ var jo = Uo.version, Qe;
1272
1272
  if (typeof globalThis == "object")
1273
1273
  Qe = globalThis;
1274
1274
  else
1275
1275
  try {
1276
- Qe = wo();
1276
+ Qe = bo();
1277
1277
  } catch {
1278
1278
  } finally {
1279
1279
  if (!Qe && typeof window < "u" && (Qe = window), !Qe)
1280
1280
  throw new Error("Could not determine global this");
1281
1281
  }
1282
- var qt = Qe.WebSocket || Qe.MozWebSocket, jo = Uo;
1283
- function Vs(n, e) {
1282
+ var qt = Qe.WebSocket || Qe.MozWebSocket, Lo = jo;
1283
+ function zs(n, e) {
1284
1284
  var t;
1285
1285
  return e ? t = new qt(n, e) : t = new qt(n), t;
1286
1286
  }
1287
1287
  qt && ["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function(n) {
1288
- Object.defineProperty(Vs, n, {
1288
+ Object.defineProperty(zs, n, {
1289
1289
  get: function() {
1290
1290
  return qt[n];
1291
1291
  }
1292
1292
  });
1293
1293
  });
1294
- var Lo = {
1295
- w3cwebsocket: qt ? Vs : null,
1296
- version: jo
1294
+ var Bo = {
1295
+ w3cwebsocket: qt ? zs : null,
1296
+ version: Lo
1297
1297
  };
1298
- const Bo = "2.6.0", Ho = { "X-Client-Info": `realtime-js/${Bo}` }, Mo = "1.0.0", zs = 1e4, Vo = 1e3;
1298
+ const Ho = "2.6.0", Mo = { "X-Client-Info": `realtime-js/${Ho}` }, Vo = "1.0.0", qs = 1e4, zo = 1e3;
1299
1299
  var Mt;
1300
1300
  (function(n) {
1301
1301
  n[n.connecting = 0] = "connecting", n[n.open = 1] = "open", n[n.closing = 2] = "closing", n[n.closed = 3] = "closed";
1302
1302
  })(Mt || (Mt = {}));
1303
- var ne;
1303
+ var se;
1304
1304
  (function(n) {
1305
1305
  n.closed = "closed", n.errored = "errored", n.joined = "joined", n.joining = "joining", n.leaving = "leaving";
1306
- })(ne || (ne = {}));
1306
+ })(se || (se = {}));
1307
1307
  var ye;
1308
1308
  (function(n) {
1309
1309
  n.close = "phx_close", n.error = "phx_error", n.join = "phx_join", n.reply = "phx_reply", n.leave = "phx_leave", n.access_token = "access_token";
@@ -1316,7 +1316,7 @@ var et;
1316
1316
  (function(n) {
1317
1317
  n.Connecting = "connecting", n.Open = "open", n.Closing = "closing", n.Closed = "closed";
1318
1318
  })(et || (et = {}));
1319
- class qs {
1319
+ class Gs {
1320
1320
  constructor(e, t) {
1321
1321
  this.callback = e, this.timerCalc = t, this.timer = void 0, this.tries = 0, this.callback = e, this.timerCalc = t;
1322
1322
  }
@@ -1330,7 +1330,7 @@ class qs {
1330
1330
  }, this.timerCalc(this.tries + 1));
1331
1331
  }
1332
1332
  }
1333
- class zo {
1333
+ class qo {
1334
1334
  constructor() {
1335
1335
  this.HEADER_LENGTH = 1;
1336
1336
  }
@@ -1361,7 +1361,7 @@ class Gr {
1361
1361
  * @param payload The payload, for example `{user_id: 123}`
1362
1362
  * @param timeout The push timeout in milliseconds
1363
1363
  */
1364
- constructor(e, t, r = {}, s = zs) {
1364
+ constructor(e, t, r = {}, s = qs) {
1365
1365
  this.channel = e, this.event = t, this.payload = r, this.timeout = s, this.sent = !1, this.timeoutTimer = void 0, this.ref = "", this.receivedResp = null, this.recHooks = [], this.refEvent = null, this.rateLimited = !1;
1366
1366
  }
1367
1367
  resend(e) {
@@ -1415,10 +1415,10 @@ class Gr {
1415
1415
  return this.receivedResp && this.receivedResp.status === e;
1416
1416
  }
1417
1417
  }
1418
- var Yn;
1418
+ var Qn;
1419
1419
  (function(n) {
1420
1420
  n.SYNC = "sync", n.JOIN = "join", n.LEAVE = "leave";
1421
- })(Yn || (Yn = {}));
1421
+ })(Qn || (Qn = {}));
1422
1422
  class Vt {
1423
1423
  /**
1424
1424
  * Initializes the Presence.
@@ -1580,21 +1580,21 @@ var D;
1580
1580
  (function(n) {
1581
1581
  n.abstime = "abstime", n.bool = "bool", n.date = "date", n.daterange = "daterange", n.float4 = "float4", n.float8 = "float8", n.int2 = "int2", n.int4 = "int4", n.int4range = "int4range", n.int8 = "int8", n.int8range = "int8range", n.json = "json", n.jsonb = "jsonb", n.money = "money", n.numeric = "numeric", n.oid = "oid", n.reltime = "reltime", n.text = "text", n.time = "time", n.timestamp = "timestamp", n.timestamptz = "timestamptz", n.timetz = "timetz", n.tsrange = "tsrange", n.tstzrange = "tstzrange";
1582
1582
  })(D || (D = {}));
1583
- const Qn = (n, e, t = {}) => {
1583
+ const es = (n, e, t = {}) => {
1584
1584
  var r;
1585
1585
  const s = (r = t.skipTypes) !== null && r !== void 0 ? r : [];
1586
- return Object.keys(e).reduce((i, o) => (i[o] = qo(o, n, e, s), i), {});
1587
- }, qo = (n, e, t, r) => {
1586
+ return Object.keys(e).reduce((i, o) => (i[o] = Go(o, n, e, s), i), {});
1587
+ }, Go = (n, e, t, r) => {
1588
1588
  const s = e.find((a) => a.name === n), i = s == null ? void 0 : s.type, o = t[n];
1589
- return i && !r.includes(i) ? Gs(i, o) : an(o);
1590
- }, Gs = (n, e) => {
1589
+ return i && !r.includes(i) ? Js(i, o) : an(o);
1590
+ }, Js = (n, e) => {
1591
1591
  if (n.charAt(0) === "_") {
1592
1592
  const t = n.slice(1, n.length);
1593
- return Ko(e, t);
1593
+ return Xo(e, t);
1594
1594
  }
1595
1595
  switch (n) {
1596
1596
  case D.bool:
1597
- return Go(e);
1597
+ return Jo(e);
1598
1598
  case D.float4:
1599
1599
  case D.float8:
1600
1600
  case D.int2:
@@ -1602,12 +1602,12 @@ const Qn = (n, e, t = {}) => {
1602
1602
  case D.int8:
1603
1603
  case D.numeric:
1604
1604
  case D.oid:
1605
- return Jo(e);
1605
+ return Wo(e);
1606
1606
  case D.json:
1607
1607
  case D.jsonb:
1608
- return Wo(e);
1608
+ return Ko(e);
1609
1609
  case D.timestamp:
1610
- return Xo(e);
1610
+ return Zo(e);
1611
1611
  case D.abstime:
1612
1612
  case D.date:
1613
1613
  case D.daterange:
@@ -1625,7 +1625,7 @@ const Qn = (n, e, t = {}) => {
1625
1625
  default:
1626
1626
  return an(e);
1627
1627
  }
1628
- }, an = (n) => n, Go = (n) => {
1628
+ }, an = (n) => n, Jo = (n) => {
1629
1629
  switch (n) {
1630
1630
  case "t":
1631
1631
  return !0;
@@ -1634,14 +1634,14 @@ const Qn = (n, e, t = {}) => {
1634
1634
  default:
1635
1635
  return n;
1636
1636
  }
1637
- }, Jo = (n) => {
1637
+ }, Wo = (n) => {
1638
1638
  if (typeof n == "string") {
1639
1639
  const e = parseFloat(n);
1640
1640
  if (!Number.isNaN(e))
1641
1641
  return e;
1642
1642
  }
1643
1643
  return n;
1644
- }, Wo = (n) => {
1644
+ }, Ko = (n) => {
1645
1645
  if (typeof n == "string")
1646
1646
  try {
1647
1647
  return JSON.parse(n);
@@ -1649,7 +1649,7 @@ const Qn = (n, e, t = {}) => {
1649
1649
  return console.log(`JSON parse error: ${e}`), n;
1650
1650
  }
1651
1651
  return n;
1652
- }, Ko = (n, e) => {
1652
+ }, Xo = (n, e) => {
1653
1653
  if (typeof n != "string")
1654
1654
  return n;
1655
1655
  const t = n.length - 1, r = n[t];
@@ -1661,11 +1661,11 @@ const Qn = (n, e, t = {}) => {
1661
1661
  } catch {
1662
1662
  i = o ? o.split(",") : [];
1663
1663
  }
1664
- return i.map((a) => Gs(e, a));
1664
+ return i.map((a) => Js(e, a));
1665
1665
  }
1666
1666
  return n;
1667
- }, Xo = (n) => typeof n == "string" ? n.replace(" ", "T") : n;
1668
- var es = globalThis && globalThis.__awaiter || function(n, e, t, r) {
1667
+ }, Zo = (n) => typeof n == "string" ? n.replace(" ", "T") : n;
1668
+ var ts = globalThis && globalThis.__awaiter || function(n, e, t, r) {
1669
1669
  function s(i) {
1670
1670
  return i instanceof t ? i : new t(function(o) {
1671
1671
  o(i);
@@ -1691,31 +1691,31 @@ var es = globalThis && globalThis.__awaiter || function(n, e, t, r) {
1691
1691
  }
1692
1692
  u((r = r.apply(n, e || [])).next());
1693
1693
  });
1694
- }, ts;
1694
+ }, rs;
1695
1695
  (function(n) {
1696
1696
  n.ALL = "*", n.INSERT = "INSERT", n.UPDATE = "UPDATE", n.DELETE = "DELETE";
1697
- })(ts || (ts = {}));
1698
- var rs;
1699
- (function(n) {
1700
- n.BROADCAST = "broadcast", n.PRESENCE = "presence", n.POSTGRES_CHANGES = "postgres_changes";
1701
1697
  })(rs || (rs = {}));
1702
1698
  var ns;
1703
1699
  (function(n) {
1704
- n.SUBSCRIBED = "SUBSCRIBED", n.TIMED_OUT = "TIMED_OUT", n.CLOSED = "CLOSED", n.CHANNEL_ERROR = "CHANNEL_ERROR";
1700
+ n.BROADCAST = "broadcast", n.PRESENCE = "presence", n.POSTGRES_CHANGES = "postgres_changes";
1705
1701
  })(ns || (ns = {}));
1702
+ var ss;
1703
+ (function(n) {
1704
+ n.SUBSCRIBED = "SUBSCRIBED", n.TIMED_OUT = "TIMED_OUT", n.CLOSED = "CLOSED", n.CHANNEL_ERROR = "CHANNEL_ERROR";
1705
+ })(ss || (ss = {}));
1706
1706
  class Rn {
1707
1707
  constructor(e, t = { config: {} }, r) {
1708
- this.topic = e, this.params = t, this.socket = r, this.bindings = {}, this.state = ne.closed, this.joinedOnce = !1, this.pushBuffer = [], this.params.config = Object.assign({
1708
+ this.topic = e, this.params = t, this.socket = r, this.bindings = {}, this.state = se.closed, this.joinedOnce = !1, this.pushBuffer = [], this.params.config = Object.assign({
1709
1709
  broadcast: { ack: !1, self: !1 },
1710
1710
  presence: { key: "" }
1711
- }, t.config), this.timeout = this.socket.timeout, this.joinPush = new Gr(this, ye.join, this.params, this.timeout), this.rejoinTimer = new qs(() => this._rejoinUntilConnected(), this.socket.reconnectAfterMs), this.joinPush.receive("ok", () => {
1712
- this.state = ne.joined, this.rejoinTimer.reset(), this.pushBuffer.forEach((s) => s.send()), this.pushBuffer = [];
1711
+ }, t.config), this.timeout = this.socket.timeout, this.joinPush = new Gr(this, ye.join, this.params, this.timeout), this.rejoinTimer = new Gs(() => this._rejoinUntilConnected(), this.socket.reconnectAfterMs), this.joinPush.receive("ok", () => {
1712
+ this.state = se.joined, this.rejoinTimer.reset(), this.pushBuffer.forEach((s) => s.send()), this.pushBuffer = [];
1713
1713
  }), this._onClose(() => {
1714
- this.rejoinTimer.reset(), this.socket.log("channel", `close ${this.topic} ${this._joinRef()}`), this.state = ne.closed, this.socket._remove(this);
1714
+ this.rejoinTimer.reset(), this.socket.log("channel", `close ${this.topic} ${this._joinRef()}`), this.state = se.closed, this.socket._remove(this);
1715
1715
  }), this._onError((s) => {
1716
- this._isLeaving() || this._isClosed() || (this.socket.log("channel", `error ${this.topic}`, s), this.state = ne.errored, this.rejoinTimer.scheduleTimeout());
1716
+ this._isLeaving() || this._isClosed() || (this.socket.log("channel", `error ${this.topic}`, s), this.state = se.errored, this.rejoinTimer.scheduleTimeout());
1717
1717
  }), this.joinPush.receive("timeout", () => {
1718
- this._isJoining() && (this.socket.log("channel", `timeout ${this.topic}`, this.joinPush.timeout), this.state = ne.errored, this.rejoinTimer.scheduleTimeout());
1718
+ this._isJoining() && (this.socket.log("channel", `timeout ${this.topic}`, this.joinPush.timeout), this.state = se.errored, this.rejoinTimer.scheduleTimeout());
1719
1719
  }), this._on(ye.reply, {}, (s, i) => {
1720
1720
  this._trigger(this._replyEventName(i), s);
1721
1721
  }), this.presence = new Vt(this);
@@ -1741,8 +1741,8 @@ class Rn {
1741
1741
  } else {
1742
1742
  const h = this.bindings.postgres_changes, y = (l = h == null ? void 0 : h.length) !== null && l !== void 0 ? l : 0, p = [];
1743
1743
  for (let w = 0; w < y; w++) {
1744
- const v = h[w], { filter: { event: g, schema: A, table: C, filter: X } } = v, U = u && u[w];
1745
- if (U && U.event === g && U.schema === A && U.table === C && U.filter === X)
1744
+ const v = h[w], { filter: { event: g, schema: A, table: C, filter: Z } } = v, U = u && u[w];
1745
+ if (U && U.event === g && U.schema === A && U.table === C && U.filter === Z)
1746
1746
  p.push(Object.assign(Object.assign({}, v), { id: U.id }));
1747
1747
  else {
1748
1748
  this.unsubscribe(), e && e("CHANNEL_ERROR", new Error("mismatch between server and client bindings for postgres changes"));
@@ -1764,7 +1764,7 @@ class Rn {
1764
1764
  return this.presence.state;
1765
1765
  }
1766
1766
  track(e, t = {}) {
1767
- return es(this, void 0, void 0, function* () {
1767
+ return ts(this, void 0, void 0, function* () {
1768
1768
  return yield this.send({
1769
1769
  type: "presence",
1770
1770
  event: "track",
@@ -1773,7 +1773,7 @@ class Rn {
1773
1773
  });
1774
1774
  }
1775
1775
  untrack(e = {}) {
1776
- return es(this, void 0, void 0, function* () {
1776
+ return ts(this, void 0, void 0, function* () {
1777
1777
  return yield this.send({
1778
1778
  type: "presence",
1779
1779
  event: "untrack"
@@ -1803,7 +1803,7 @@ class Rn {
1803
1803
  * channel.unsubscribe().receive("ok", () => alert("left!") )
1804
1804
  */
1805
1805
  unsubscribe(e = this.timeout) {
1806
- this.state = ne.leaving;
1806
+ this.state = se.leaving;
1807
1807
  const t = () => {
1808
1808
  this.socket.log("channel", `leave ${this.topic}`), this._trigger(ye.close, "leave", this._joinRef());
1809
1809
  };
@@ -1857,20 +1857,20 @@ class Rn {
1857
1857
  var w, v, g;
1858
1858
  return ((w = p.filter) === null || w === void 0 ? void 0 : w.event) === "*" || ((g = (v = p.filter) === null || v === void 0 ? void 0 : v.event) === null || g === void 0 ? void 0 : g.toLocaleLowerCase()) === o;
1859
1859
  }).map((p) => p.callback(y, r)) : (i = this.bindings[o]) === null || i === void 0 || i.filter((p) => {
1860
- var w, v, g, A, C, X;
1860
+ var w, v, g, A, C, Z;
1861
1861
  if (["broadcast", "presence", "postgres_changes"].includes(o))
1862
1862
  if ("id" in p) {
1863
1863
  const U = p.id, be = (w = p.filter) === null || w === void 0 ? void 0 : w.event;
1864
1864
  return U && ((v = t.ids) === null || v === void 0 ? void 0 : v.includes(U)) && (be === "*" || (be == null ? void 0 : be.toLocaleLowerCase()) === ((g = t.data) === null || g === void 0 ? void 0 : g.type.toLocaleLowerCase()));
1865
1865
  } else {
1866
1866
  const U = (C = (A = p == null ? void 0 : p.filter) === null || A === void 0 ? void 0 : A.event) === null || C === void 0 ? void 0 : C.toLocaleLowerCase();
1867
- return U === "*" || U === ((X = t == null ? void 0 : t.event) === null || X === void 0 ? void 0 : X.toLocaleLowerCase());
1867
+ return U === "*" || U === ((Z = t == null ? void 0 : t.event) === null || Z === void 0 ? void 0 : Z.toLocaleLowerCase());
1868
1868
  }
1869
1869
  else
1870
1870
  return p.type.toLocaleLowerCase() === o;
1871
1871
  }).map((p) => {
1872
1872
  if (typeof y == "object" && "ids" in y) {
1873
- const w = y.data, { schema: v, table: g, commit_timestamp: A, type: C, errors: X } = w;
1873
+ const w = y.data, { schema: v, table: g, commit_timestamp: A, type: C, errors: Z } = w;
1874
1874
  y = Object.assign(Object.assign({}, {
1875
1875
  schema: v,
1876
1876
  table: g,
@@ -1878,7 +1878,7 @@ class Rn {
1878
1878
  eventType: C,
1879
1879
  new: {},
1880
1880
  old: {},
1881
- errors: X
1881
+ errors: Z
1882
1882
  }), this._getPayloadRecords(w));
1883
1883
  }
1884
1884
  p.callback(y, r);
@@ -1886,19 +1886,19 @@ class Rn {
1886
1886
  }
1887
1887
  /** @internal */
1888
1888
  _isClosed() {
1889
- return this.state === ne.closed;
1889
+ return this.state === se.closed;
1890
1890
  }
1891
1891
  /** @internal */
1892
1892
  _isJoined() {
1893
- return this.state === ne.joined;
1893
+ return this.state === se.joined;
1894
1894
  }
1895
1895
  /** @internal */
1896
1896
  _isJoining() {
1897
- return this.state === ne.joining;
1897
+ return this.state === se.joining;
1898
1898
  }
1899
1899
  /** @internal */
1900
1900
  _isLeaving() {
1901
- return this.state === ne.leaving;
1901
+ return this.state === se.leaving;
1902
1902
  }
1903
1903
  /** @internal */
1904
1904
  _replyEventName(e) {
@@ -1960,7 +1960,7 @@ class Rn {
1960
1960
  }
1961
1961
  /** @internal */
1962
1962
  _rejoin(e = this.timeout) {
1963
- this._isLeaving() || (this.socket._leaveOpenTopic(this.topic), this.state = ne.joining, this.joinPush.resend(e));
1963
+ this._isLeaving() || (this.socket._leaveOpenTopic(this.topic), this.state = se.joining, this.joinPush.resend(e));
1964
1964
  }
1965
1965
  /** @internal */
1966
1966
  _getPayloadRecords(e) {
@@ -1968,10 +1968,10 @@ class Rn {
1968
1968
  new: {},
1969
1969
  old: {}
1970
1970
  };
1971
- return (e.type === "INSERT" || e.type === "UPDATE") && (t.new = Qn(e.columns, e.record)), (e.type === "UPDATE" || e.type === "DELETE") && (t.old = Qn(e.columns, e.old_record)), t;
1971
+ return (e.type === "INSERT" || e.type === "UPDATE") && (t.new = es(e.columns, e.record)), (e.type === "UPDATE" || e.type === "DELETE") && (t.old = es(e.columns, e.old_record)), t;
1972
1972
  }
1973
1973
  }
1974
- var Zo = globalThis && globalThis.__awaiter || function(n, e, t, r) {
1974
+ var Yo = globalThis && globalThis.__awaiter || function(n, e, t, r) {
1975
1975
  function s(i) {
1976
1976
  return i instanceof t ? i : new t(function(o) {
1977
1977
  o(i);
@@ -1998,9 +1998,9 @@ var Zo = globalThis && globalThis.__awaiter || function(n, e, t, r) {
1998
1998
  u((r = r.apply(n, e || [])).next());
1999
1999
  });
2000
2000
  };
2001
- const Yo = () => {
2001
+ const Qo = () => {
2002
2002
  };
2003
- class Qo {
2003
+ class ea {
2004
2004
  /**
2005
2005
  * Initializes the Socket.
2006
2006
  *
@@ -2017,14 +2017,14 @@ class Qo {
2017
2017
  */
2018
2018
  constructor(e, t) {
2019
2019
  var r;
2020
- this.accessToken = null, this.channels = [], this.endPoint = "", this.headers = Ho, this.params = {}, this.timeout = zs, this.transport = Lo.w3cwebsocket, this.heartbeatIntervalMs = 3e4, this.heartbeatTimer = void 0, this.pendingHeartbeatRef = null, this.ref = 0, this.logger = Yo, this.conn = null, this.sendBuffer = [], this.serializer = new zo(), this.stateChangeCallbacks = {
2020
+ this.accessToken = null, this.channels = [], this.endPoint = "", this.headers = Mo, this.params = {}, this.timeout = qs, this.transport = Bo.w3cwebsocket, this.heartbeatIntervalMs = 3e4, this.heartbeatTimer = void 0, this.pendingHeartbeatRef = null, this.ref = 0, this.logger = Qo, this.conn = null, this.sendBuffer = [], this.serializer = new qo(), this.stateChangeCallbacks = {
2021
2021
  open: [],
2022
2022
  close: [],
2023
2023
  error: [],
2024
2024
  message: []
2025
2025
  }, this.eventsPerSecondLimitMs = 100, this.inThrottle = !1, this.endPoint = `${e}/${on.websocket}`, t != null && t.params && (this.params = t.params), t != null && t.headers && (this.headers = Object.assign(Object.assign({}, this.headers), t.headers)), t != null && t.timeout && (this.timeout = t.timeout), t != null && t.logger && (this.logger = t.logger), t != null && t.transport && (this.transport = t.transport), t != null && t.heartbeatIntervalMs && (this.heartbeatIntervalMs = t.heartbeatIntervalMs);
2026
2026
  const s = (r = t == null ? void 0 : t.params) === null || r === void 0 ? void 0 : r.eventsPerSecond;
2027
- s && (this.eventsPerSecondLimitMs = Math.floor(1e3 / s)), this.reconnectAfterMs = t != null && t.reconnectAfterMs ? t.reconnectAfterMs : (i) => [1e3, 2e3, 5e3, 1e4][i - 1] || 1e4, this.encode = t != null && t.encode ? t.encode : (i, o) => o(JSON.stringify(i)), this.decode = t != null && t.decode ? t.decode : this.serializer.decode.bind(this.serializer), this.reconnectTimer = new qs(() => Zo(this, void 0, void 0, function* () {
2027
+ s && (this.eventsPerSecondLimitMs = Math.floor(1e3 / s)), this.reconnectAfterMs = t != null && t.reconnectAfterMs ? t.reconnectAfterMs : (i) => [1e3, 2e3, 5e3, 1e4][i - 1] || 1e4, this.encode = t != null && t.encode ? t.encode : (i, o) => o(JSON.stringify(i)), this.decode = t != null && t.decode ? t.decode : this.serializer.decode.bind(this.serializer), this.reconnectTimer = new Gs(() => Yo(this, void 0, void 0, function* () {
2028
2028
  this.disconnect(), this.connect();
2029
2029
  }), this.reconnectAfterMs);
2030
2030
  }
@@ -2163,7 +2163,7 @@ class Qo {
2163
2163
  * @internal
2164
2164
  */
2165
2165
  _endPointURL() {
2166
- return this._appendParams(this.endPoint, Object.assign({}, this.params, { vsn: Mo }));
2166
+ return this._appendParams(this.endPoint, Object.assign({}, this.params, { vsn: Vo }));
2167
2167
  }
2168
2168
  /** @internal */
2169
2169
  _onConnMessage(e) {
@@ -2204,7 +2204,7 @@ class Qo {
2204
2204
  var e;
2205
2205
  if (this.isConnected()) {
2206
2206
  if (this.pendingHeartbeatRef) {
2207
- this.pendingHeartbeatRef = null, this.log("transport", "heartbeat timeout. Attempting to re-establish connection"), (e = this.conn) === null || e === void 0 || e.close(Vo, "hearbeat timeout");
2207
+ this.pendingHeartbeatRef = null, this.log("transport", "heartbeat timeout. Attempting to re-establish connection"), (e = this.conn) === null || e === void 0 || e.close(zo, "hearbeat timeout");
2208
2208
  return;
2209
2209
  }
2210
2210
  this.pendingHeartbeatRef = this._makeRef(), this.push({
@@ -2222,15 +2222,15 @@ class Qo {
2222
2222
  }, t)), !1);
2223
2223
  }
2224
2224
  }
2225
- class Js extends Error {
2225
+ class Ws extends Error {
2226
2226
  constructor(e) {
2227
2227
  super(e), this.__isStorageError = !0, this.name = "StorageError";
2228
2228
  }
2229
2229
  }
2230
- function Q(n) {
2230
+ function ee(n) {
2231
2231
  return typeof n == "object" && n !== null && "__isStorageError" in n;
2232
2232
  }
2233
- class ea extends Js {
2233
+ class ta extends Ws {
2234
2234
  constructor(e, t) {
2235
2235
  super(e), this.name = "StorageApiError", this.status = t;
2236
2236
  }
@@ -2242,12 +2242,12 @@ class ea extends Js {
2242
2242
  };
2243
2243
  }
2244
2244
  }
2245
- class ss extends Js {
2245
+ class is extends Ws {
2246
2246
  constructor(e, t) {
2247
2247
  super(e), this.name = "StorageUnknownError", this.originalError = t;
2248
2248
  }
2249
2249
  }
2250
- var Ws = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2250
+ var Ks = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2251
2251
  function s(i) {
2252
2252
  return i instanceof t ? i : new t(function(o) {
2253
2253
  o(i);
@@ -2274,12 +2274,12 @@ var Ws = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2274
2274
  u((r = r.apply(n, e || [])).next());
2275
2275
  });
2276
2276
  };
2277
- const Ks = (n) => {
2277
+ const Xs = (n) => {
2278
2278
  let e;
2279
- return n ? e = n : typeof fetch > "u" ? e = (...t) => Ws(void 0, void 0, void 0, function* () {
2279
+ return n ? e = n : typeof fetch > "u" ? e = (...t) => Ks(void 0, void 0, void 0, function* () {
2280
2280
  return yield (yield Promise.resolve().then(() => Sr)).fetch(...t);
2281
2281
  }) : e = fetch, (...t) => e(...t);
2282
- }, ta = () => Ws(void 0, void 0, void 0, function* () {
2282
+ }, ra = () => Ks(void 0, void 0, void 0, function* () {
2283
2283
  return typeof Response > "u" ? (yield Promise.resolve().then(() => Sr)).Response : Response;
2284
2284
  });
2285
2285
  var Ct = globalThis && globalThis.__awaiter || function(n, e, t, r) {
@@ -2309,25 +2309,25 @@ var Ct = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2309
2309
  u((r = r.apply(n, e || [])).next());
2310
2310
  });
2311
2311
  };
2312
- const Jr = (n) => n.msg || n.message || n.error_description || n.error || JSON.stringify(n), ra = (n, e) => Ct(void 0, void 0, void 0, function* () {
2313
- const t = yield ta();
2312
+ const Jr = (n) => n.msg || n.message || n.error_description || n.error || JSON.stringify(n), na = (n, e) => Ct(void 0, void 0, void 0, function* () {
2313
+ const t = yield ra();
2314
2314
  n instanceof t ? n.json().then((r) => {
2315
- e(new ea(Jr(r), n.status || 500));
2315
+ e(new ta(Jr(r), n.status || 500));
2316
2316
  }).catch((r) => {
2317
- e(new ss(Jr(r), r));
2318
- }) : e(new ss(Jr(n), n));
2319
- }), na = (n, e, t, r) => {
2317
+ e(new is(Jr(r), r));
2318
+ }) : e(new is(Jr(n), n));
2319
+ }), sa = (n, e, t, r) => {
2320
2320
  const s = { method: n, headers: (e == null ? void 0 : e.headers) || {} };
2321
2321
  return n === "GET" ? s : (s.headers = Object.assign({ "Content-Type": "application/json" }, e == null ? void 0 : e.headers), s.body = JSON.stringify(r), Object.assign(Object.assign({}, s), t));
2322
2322
  };
2323
2323
  function Rr(n, e, t, r, s, i) {
2324
2324
  return Ct(this, void 0, void 0, function* () {
2325
2325
  return new Promise((o, a) => {
2326
- n(t, na(e, r, s, i)).then((c) => {
2326
+ n(t, sa(e, r, s, i)).then((c) => {
2327
2327
  if (!c.ok)
2328
2328
  throw c;
2329
2329
  return r != null && r.noResolveJson ? c : c.json();
2330
- }).then((c) => o(c)).catch((c) => ra(c, a));
2330
+ }).then((c) => o(c)).catch((c) => na(c, a));
2331
2331
  });
2332
2332
  });
2333
2333
  }
@@ -2341,12 +2341,12 @@ function tt(n, e, t, r, s) {
2341
2341
  return Rr(n, "POST", e, r, s, t);
2342
2342
  });
2343
2343
  }
2344
- function sa(n, e, t, r, s) {
2344
+ function ia(n, e, t, r, s) {
2345
2345
  return Ct(this, void 0, void 0, function* () {
2346
2346
  return Rr(n, "PUT", e, r, s, t);
2347
2347
  });
2348
2348
  }
2349
- function Xs(n, e, t, r, s) {
2349
+ function Zs(n, e, t, r, s) {
2350
2350
  return Ct(this, void 0, void 0, function* () {
2351
2351
  return Rr(n, "DELETE", e, r, s, t);
2352
2352
  });
@@ -2378,21 +2378,21 @@ var ve = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2378
2378
  u((r = r.apply(n, e || [])).next());
2379
2379
  });
2380
2380
  };
2381
- const ia = {
2381
+ const oa = {
2382
2382
  limit: 100,
2383
2383
  offset: 0,
2384
2384
  sortBy: {
2385
2385
  column: "name",
2386
2386
  order: "asc"
2387
2387
  }
2388
- }, oa = {
2388
+ }, aa = {
2389
2389
  cacheControl: "3600",
2390
2390
  contentType: "text/plain;charset=UTF-8",
2391
2391
  upsert: !1
2392
2392
  };
2393
- class aa {
2393
+ class ca {
2394
2394
  constructor(e, t = {}, r, s) {
2395
- this.url = e, this.headers = t, this.bucketId = r, this.fetch = Ks(s);
2395
+ this.url = e, this.headers = t, this.bucketId = r, this.fetch = Xs(s);
2396
2396
  }
2397
2397
  /**
2398
2398
  * Uploads a file to an existing bucket or replaces an existing file at the specified path with a new one.
@@ -2405,7 +2405,7 @@ class aa {
2405
2405
  return ve(this, void 0, void 0, function* () {
2406
2406
  try {
2407
2407
  let i;
2408
- const o = Object.assign(Object.assign({}, oa), s), a = Object.assign(Object.assign({}, this.headers), e === "POST" && { "x-upsert": String(o.upsert) });
2408
+ const o = Object.assign(Object.assign({}, aa), s), a = Object.assign(Object.assign({}, this.headers), e === "POST" && { "x-upsert": String(o.upsert) });
2409
2409
  typeof Blob < "u" && r instanceof Blob ? (i = new FormData(), i.append("cacheControl", o.cacheControl), i.append("", r)) : typeof FormData < "u" && r instanceof FormData ? (i = r, i.append("cacheControl", o.cacheControl)) : (i = r, a["cache-control"] = `max-age=${o.cacheControl}`, a["content-type"] = o.contentType);
2410
2410
  const c = this._removeEmptyFolders(t), u = this._getFinalPath(c), l = yield this.fetch(`${this.url}/object/${u}`, {
2411
2411
  method: e,
@@ -2417,7 +2417,7 @@ class aa {
2417
2417
  error: null
2418
2418
  } : { data: null, error: yield l.json() };
2419
2419
  } catch (i) {
2420
- if (Q(i))
2420
+ if (ee(i))
2421
2421
  return { data: null, error: i };
2422
2422
  throw i;
2423
2423
  }
@@ -2456,7 +2456,7 @@ class aa {
2456
2456
  try {
2457
2457
  return { data: yield tt(this.fetch, `${this.url}/object/move`, { bucketId: this.bucketId, sourceKey: e, destinationKey: t }, { headers: this.headers }), error: null };
2458
2458
  } catch (r) {
2459
- if (Q(r))
2459
+ if (ee(r))
2460
2460
  return { data: null, error: r };
2461
2461
  throw r;
2462
2462
  }
@@ -2473,7 +2473,7 @@ class aa {
2473
2473
  try {
2474
2474
  return { data: { path: (yield tt(this.fetch, `${this.url}/object/copy`, { bucketId: this.bucketId, sourceKey: e, destinationKey: t }, { headers: this.headers })).Key }, error: null };
2475
2475
  } catch (r) {
2476
- if (Q(r))
2476
+ if (ee(r))
2477
2477
  return { data: null, error: r };
2478
2478
  throw r;
2479
2479
  }
@@ -2494,7 +2494,7 @@ class aa {
2494
2494
  const o = r != null && r.download ? `&download=${r.download === !0 ? "" : r.download}` : "";
2495
2495
  return i = { signedUrl: encodeURI(`${this.url}${i.signedURL}${o}`) }, { data: i, error: null };
2496
2496
  } catch (s) {
2497
- if (Q(s))
2497
+ if (ee(s))
2498
2498
  return { data: null, error: s };
2499
2499
  throw s;
2500
2500
  }
@@ -2516,7 +2516,7 @@ class aa {
2516
2516
  error: null
2517
2517
  };
2518
2518
  } catch (s) {
2519
- if (Q(s))
2519
+ if (ee(s))
2520
2520
  return { data: null, error: s };
2521
2521
  throw s;
2522
2522
  }
@@ -2538,7 +2538,7 @@ class aa {
2538
2538
  noResolveJson: !0
2539
2539
  })).blob(), error: null };
2540
2540
  } catch (a) {
2541
- if (Q(a))
2541
+ if (ee(a))
2542
2542
  return { data: null, error: a };
2543
2543
  throw a;
2544
2544
  }
@@ -2570,9 +2570,9 @@ class aa {
2570
2570
  remove(e) {
2571
2571
  return ve(this, void 0, void 0, function* () {
2572
2572
  try {
2573
- return { data: yield Xs(this.fetch, `${this.url}/object/${this.bucketId}`, { prefixes: e }, { headers: this.headers }), error: null };
2573
+ return { data: yield Zs(this.fetch, `${this.url}/object/${this.bucketId}`, { prefixes: e }, { headers: this.headers }), error: null };
2574
2574
  } catch (t) {
2575
- if (Q(t))
2575
+ if (ee(t))
2576
2576
  return { data: null, error: t };
2577
2577
  throw t;
2578
2578
  }
@@ -2644,10 +2644,10 @@ class aa {
2644
2644
  list(e, t, r) {
2645
2645
  return ve(this, void 0, void 0, function* () {
2646
2646
  try {
2647
- const s = Object.assign(Object.assign(Object.assign({}, ia), t), { prefix: e || "" });
2647
+ const s = Object.assign(Object.assign(Object.assign({}, oa), t), { prefix: e || "" });
2648
2648
  return { data: yield tt(this.fetch, `${this.url}/object/list/${this.bucketId}`, s, { headers: this.headers }, r), error: null };
2649
2649
  } catch (s) {
2650
- if (Q(s))
2650
+ if (ee(s))
2651
2651
  return { data: null, error: s };
2652
2652
  throw s;
2653
2653
  }
@@ -2664,7 +2664,7 @@ class aa {
2664
2664
  return e.width && t.push(`width=${e.width}`), e.height && t.push(`height=${e.height}`), e.resize && t.push(`resize=${e.resize}`), e.format && t.push(`format=${e.format}`), e.quality && t.push(`quality=${e.quality}`), t.join("&");
2665
2665
  }
2666
2666
  }
2667
- const ca = "2.3.1", ua = { "X-Client-Info": `storage-js/${ca}` };
2667
+ const ua = "2.3.1", la = { "X-Client-Info": `storage-js/${ua}` };
2668
2668
  var wt = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2669
2669
  function s(i) {
2670
2670
  return i instanceof t ? i : new t(function(o) {
@@ -2692,9 +2692,9 @@ var wt = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2692
2692
  u((r = r.apply(n, e || [])).next());
2693
2693
  });
2694
2694
  };
2695
- class la {
2695
+ class ha {
2696
2696
  constructor(e, t = {}, r) {
2697
- this.url = e, this.headers = Object.assign(Object.assign({}, ua), t), this.fetch = Ks(r);
2697
+ this.url = e, this.headers = Object.assign(Object.assign({}, la), t), this.fetch = Xs(r);
2698
2698
  }
2699
2699
  /**
2700
2700
  * Retrieves the details of all Storage buckets within an existing project.
@@ -2704,7 +2704,7 @@ class la {
2704
2704
  try {
2705
2705
  return { data: yield cn(this.fetch, `${this.url}/bucket`, { headers: this.headers }), error: null };
2706
2706
  } catch (e) {
2707
- if (Q(e))
2707
+ if (ee(e))
2708
2708
  return { data: null, error: e };
2709
2709
  throw e;
2710
2710
  }
@@ -2720,7 +2720,7 @@ class la {
2720
2720
  try {
2721
2721
  return { data: yield cn(this.fetch, `${this.url}/bucket/${e}`, { headers: this.headers }), error: null };
2722
2722
  } catch (t) {
2723
- if (Q(t))
2723
+ if (ee(t))
2724
2724
  return { data: null, error: t };
2725
2725
  throw t;
2726
2726
  }
@@ -2738,7 +2738,7 @@ class la {
2738
2738
  try {
2739
2739
  return { data: yield tt(this.fetch, `${this.url}/bucket`, { id: e, name: e, public: t.public }, { headers: this.headers }), error: null };
2740
2740
  } catch (r) {
2741
- if (Q(r))
2741
+ if (ee(r))
2742
2742
  return { data: null, error: r };
2743
2743
  throw r;
2744
2744
  }
@@ -2753,9 +2753,9 @@ class la {
2753
2753
  updateBucket(e, t) {
2754
2754
  return wt(this, void 0, void 0, function* () {
2755
2755
  try {
2756
- return { data: yield sa(this.fetch, `${this.url}/bucket/${e}`, { id: e, name: e, public: t.public }, { headers: this.headers }), error: null };
2756
+ return { data: yield ia(this.fetch, `${this.url}/bucket/${e}`, { id: e, name: e, public: t.public }, { headers: this.headers }), error: null };
2757
2757
  } catch (r) {
2758
- if (Q(r))
2758
+ if (ee(r))
2759
2759
  return { data: null, error: r };
2760
2760
  throw r;
2761
2761
  }
@@ -2771,7 +2771,7 @@ class la {
2771
2771
  try {
2772
2772
  return { data: yield tt(this.fetch, `${this.url}/bucket/${e}/empty`, {}, { headers: this.headers }), error: null };
2773
2773
  } catch (t) {
2774
- if (Q(t))
2774
+ if (ee(t))
2775
2775
  return { data: null, error: t };
2776
2776
  throw t;
2777
2777
  }
@@ -2786,16 +2786,16 @@ class la {
2786
2786
  deleteBucket(e) {
2787
2787
  return wt(this, void 0, void 0, function* () {
2788
2788
  try {
2789
- return { data: yield Xs(this.fetch, `${this.url}/bucket/${e}`, {}, { headers: this.headers }), error: null };
2789
+ return { data: yield Zs(this.fetch, `${this.url}/bucket/${e}`, {}, { headers: this.headers }), error: null };
2790
2790
  } catch (t) {
2791
- if (Q(t))
2791
+ if (ee(t))
2792
2792
  return { data: null, error: t };
2793
2793
  throw t;
2794
2794
  }
2795
2795
  });
2796
2796
  }
2797
2797
  }
2798
- class ha extends la {
2798
+ class fa extends ha {
2799
2799
  constructor(e, t = {}, r) {
2800
2800
  super(e, t, r);
2801
2801
  }
@@ -2805,11 +2805,11 @@ class ha extends la {
2805
2805
  * @param id The bucket id to operate on.
2806
2806
  */
2807
2807
  from(e) {
2808
- return new aa(this.url, this.headers, e, this.fetch);
2808
+ return new ca(this.url, this.headers, e, this.fetch);
2809
2809
  }
2810
2810
  }
2811
- const fa = "2.10.0", da = { "X-Client-Info": `supabase-js/${fa}` };
2812
- var pa = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2811
+ const da = "2.10.0", pa = { "X-Client-Info": `supabase-js/${da}` };
2812
+ var ya = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2813
2813
  function s(i) {
2814
2814
  return i instanceof t ? i : new t(function(o) {
2815
2815
  o(i);
@@ -2836,22 +2836,22 @@ var pa = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2836
2836
  u((r = r.apply(n, e || [])).next());
2837
2837
  });
2838
2838
  };
2839
- const ya = (n) => {
2839
+ const ma = (n) => {
2840
2840
  let e;
2841
2841
  return n ? e = n : typeof fetch > "u" ? e = Sn : e = fetch, (...t) => e(...t);
2842
- }, ma = () => typeof Headers > "u" ? It.Headers : Headers, ga = (n, e, t) => {
2843
- const r = ya(t), s = ma();
2844
- return (i, o) => pa(void 0, void 0, void 0, function* () {
2842
+ }, ga = () => typeof Headers > "u" ? It.Headers : Headers, wa = (n, e, t) => {
2843
+ const r = ma(t), s = ga();
2844
+ return (i, o) => ya(void 0, void 0, void 0, function* () {
2845
2845
  var a;
2846
2846
  const c = (a = yield e()) !== null && a !== void 0 ? a : n;
2847
2847
  let u = new s(o == null ? void 0 : o.headers);
2848
2848
  return u.has("apikey") || u.set("apikey", n), u.has("Authorization") || u.set("Authorization", `Bearer ${c}`), r(i, Object.assign(Object.assign({}, o), { headers: u }));
2849
2849
  });
2850
2850
  };
2851
- function wa(n) {
2851
+ function ba(n) {
2852
2852
  return n.replace(/\/$/, "");
2853
2853
  }
2854
- function ba(n, e) {
2854
+ function va(n, e) {
2855
2855
  const { db: t, auth: r, realtime: s, global: i } = n, { db: o, auth: a, realtime: c, global: u } = e;
2856
2856
  return {
2857
2857
  db: Object.assign(Object.assign({}, o), t),
@@ -2887,10 +2887,10 @@ var tr = globalThis && globalThis.__awaiter || function(n, e, t, r) {
2887
2887
  u((r = r.apply(n, e || [])).next());
2888
2888
  });
2889
2889
  };
2890
- function va(n) {
2890
+ function _a(n) {
2891
2891
  return Math.round(Date.now() / 1e3) + n;
2892
2892
  }
2893
- function _a() {
2893
+ function Ea() {
2894
2894
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(n) {
2895
2895
  const e = Math.random() * 16 | 0;
2896
2896
  return (n == "x" ? e : e & 3 | 8).toString(16);
@@ -2924,14 +2924,14 @@ function ae(n, e) {
2924
2924
  const r = new RegExp("[?&#]" + n + "(=([^&#]*)|&|#|$)"), s = r.exec(e);
2925
2925
  return s ? s[2] ? decodeURIComponent(s[2].replace(/\+/g, " ")) : "" : null;
2926
2926
  }
2927
- const Zs = (n) => {
2927
+ const Ys = (n) => {
2928
2928
  let e;
2929
2929
  return n ? e = n : typeof fetch > "u" ? e = (...t) => tr(void 0, void 0, void 0, function* () {
2930
2930
  return yield (yield Promise.resolve().then(() => Sr)).fetch(...t);
2931
2931
  }) : e = fetch, (...t) => e(...t);
2932
- }, Ea = (n) => typeof n == "object" && n !== null && "status" in n && "ok" in n && "json" in n && typeof n.json == "function", xa = (n, e, t) => tr(void 0, void 0, void 0, function* () {
2932
+ }, xa = (n) => typeof n == "object" && n !== null && "status" in n && "ok" in n && "json" in n && typeof n.json == "function", Ta = (n, e, t) => tr(void 0, void 0, void 0, function* () {
2933
2933
  yield n.setItem(e, JSON.stringify(t));
2934
- }), is = (n, e) => tr(void 0, void 0, void 0, function* () {
2934
+ }), os = (n, e) => tr(void 0, void 0, void 0, function* () {
2935
2935
  const t = yield n.getItem(e);
2936
2936
  if (!t)
2937
2937
  return null;
@@ -2940,10 +2940,10 @@ const Zs = (n) => {
2940
2940
  } catch {
2941
2941
  return t;
2942
2942
  }
2943
- }), Ta = (n, e) => tr(void 0, void 0, void 0, function* () {
2943
+ }), Oa = (n, e) => tr(void 0, void 0, void 0, function* () {
2944
2944
  yield n.removeItem(e);
2945
2945
  });
2946
- function Oa(n) {
2946
+ function ka(n) {
2947
2947
  const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
2948
2948
  let t = "", r, s, i, o, a, c, u, l = 0;
2949
2949
  for (n = n.replace("-", "+").replace("_", "/"); l < n.length; )
@@ -2958,21 +2958,21 @@ class $r {
2958
2958
  }
2959
2959
  }
2960
2960
  $r.promiseConstructor = Promise;
2961
- function os(n) {
2961
+ function as(n) {
2962
2962
  const e = /^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i, t = n.split(".");
2963
2963
  if (t.length !== 3)
2964
2964
  throw new Error("JWT is not valid: not a JWT structure");
2965
2965
  if (!e.test(t[1]))
2966
2966
  throw new Error("JWT is not valid: payload is not in base64url format");
2967
2967
  const r = t[1];
2968
- return JSON.parse(Oa(r));
2968
+ return JSON.parse(ka(r));
2969
2969
  }
2970
- function ka(n) {
2970
+ function Aa(n) {
2971
2971
  return new Promise((e) => {
2972
2972
  setTimeout(() => e(null), n);
2973
2973
  });
2974
2974
  }
2975
- function Aa(n, e) {
2975
+ function Sa(n, e) {
2976
2976
  return new Promise((r, s) => {
2977
2977
  tr(this, void 0, void 0, function* () {
2978
2978
  for (let i = 0; i < 1 / 0; i++)
@@ -2999,7 +2999,7 @@ class $n extends Error {
2999
2999
  function $(n) {
3000
3000
  return typeof n == "object" && n !== null && "__isAuthError" in n;
3001
3001
  }
3002
- class Sa extends $n {
3002
+ class Ra extends $n {
3003
3003
  constructor(e, t) {
3004
3004
  super(e, t), this.name = "AuthApiError", this.status = t;
3005
3005
  }
@@ -3011,10 +3011,10 @@ class Sa extends $n {
3011
3011
  };
3012
3012
  }
3013
3013
  }
3014
- function Ra(n) {
3014
+ function $a(n) {
3015
3015
  return $(n) && n.name === "AuthApiError";
3016
3016
  }
3017
- class Ys extends $n {
3017
+ class Qs extends $n {
3018
3018
  constructor(e, t) {
3019
3019
  super(e), this.name = "AuthUnknownError", this.originalError = t;
3020
3020
  }
@@ -3085,7 +3085,7 @@ var Pn = globalThis && globalThis.__awaiter || function(n, e, t, r) {
3085
3085
  }
3086
3086
  u((r = r.apply(n, e || [])).next());
3087
3087
  });
3088
- }, $a = globalThis && globalThis.__rest || function(n, e) {
3088
+ }, Pa = globalThis && globalThis.__rest || function(n, e) {
3089
3089
  var t = {};
3090
3090
  for (var r in n)
3091
3091
  Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
@@ -3094,14 +3094,14 @@ var Pn = globalThis && globalThis.__awaiter || function(n, e, t, r) {
3094
3094
  e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (t[r[s]] = n[r[s]]);
3095
3095
  return t;
3096
3096
  };
3097
- const or = (n) => n.msg || n.message || n.error_description || n.error || JSON.stringify(n), Pa = (n, e) => Pn(void 0, void 0, void 0, function* () {
3097
+ const or = (n) => n.msg || n.message || n.error_description || n.error || JSON.stringify(n), Na = (n, e) => Pn(void 0, void 0, void 0, function* () {
3098
3098
  const t = [502, 503, 504];
3099
- Ea(n) ? t.includes(n.status) ? e(new un(or(n), n.status)) : n.json().then((r) => {
3100
- e(new Sa(or(r), n.status || 500));
3099
+ xa(n) ? t.includes(n.status) ? e(new un(or(n), n.status)) : n.json().then((r) => {
3100
+ e(new Ra(or(r), n.status || 500));
3101
3101
  }).catch((r) => {
3102
- e(new Ys(or(r), r));
3102
+ e(new Qs(or(r), r));
3103
3103
  }) : e(new un(or(n), 0));
3104
- }), Na = (n, e, t, r) => {
3104
+ }), Ia = (n, e, t, r) => {
3105
3105
  const s = { method: n, headers: (e == null ? void 0 : e.headers) || {} };
3106
3106
  return n === "GET" ? s : (s.headers = Object.assign({ "Content-Type": "application/json;charset=UTF-8" }, e == null ? void 0 : e.headers), s.body = JSON.stringify(r), Object.assign(Object.assign({}, s), t));
3107
3107
  };
@@ -3112,25 +3112,25 @@ function I(n, e, t, r) {
3112
3112
  r != null && r.jwt && (i.Authorization = `Bearer ${r.jwt}`);
3113
3113
  const o = (s = r == null ? void 0 : r.query) !== null && s !== void 0 ? s : {};
3114
3114
  r != null && r.redirectTo && (o.redirect_to = r.redirectTo);
3115
- const a = Object.keys(o).length ? "?" + new URLSearchParams(o).toString() : "", c = yield Ia(n, e, t + a, { headers: i, noResolveJson: r == null ? void 0 : r.noResolveJson }, {}, r == null ? void 0 : r.body);
3115
+ const a = Object.keys(o).length ? "?" + new URLSearchParams(o).toString() : "", c = yield Ca(n, e, t + a, { headers: i, noResolveJson: r == null ? void 0 : r.noResolveJson }, {}, r == null ? void 0 : r.body);
3116
3116
  return r != null && r.xform ? r == null ? void 0 : r.xform(c) : { data: Object.assign({}, c), error: null };
3117
3117
  });
3118
3118
  }
3119
- function Ia(n, e, t, r, s, i) {
3119
+ function Ca(n, e, t, r, s, i) {
3120
3120
  return Pn(this, void 0, void 0, function* () {
3121
3121
  return new Promise((o, a) => {
3122
- n(t, Na(e, r, s, i)).then((c) => {
3122
+ n(t, Ia(e, r, s, i)).then((c) => {
3123
3123
  if (!c.ok)
3124
3124
  throw c;
3125
3125
  return r != null && r.noResolveJson ? c : c.json();
3126
- }).then((c) => o(c)).catch((c) => Pa(c, a));
3126
+ }).then((c) => o(c)).catch((c) => Na(c, a));
3127
3127
  });
3128
3128
  });
3129
3129
  }
3130
3130
  function Ze(n) {
3131
3131
  var e;
3132
3132
  let t = null;
3133
- Ua(n) && (t = Object.assign({}, n), t.expires_at = va(n.expires_in));
3133
+ ja(n) && (t = Object.assign({}, n), t.expires_at = _a(n.expires_in));
3134
3134
  const r = (e = n.user) !== null && e !== void 0 ? e : n;
3135
3135
  return { data: { session: t, user: r }, error: null };
3136
3136
  }
@@ -3138,11 +3138,11 @@ function rt(n) {
3138
3138
  var e;
3139
3139
  return { data: { user: (e = n.user) !== null && e !== void 0 ? e : n }, error: null };
3140
3140
  }
3141
- function Ca(n) {
3141
+ function Fa(n) {
3142
3142
  return { data: n, error: null };
3143
3143
  }
3144
- function Fa(n) {
3145
- const { action_link: e, email_otp: t, hashed_token: r, redirect_to: s, verification_type: i } = n, o = $a(n, ["action_link", "email_otp", "hashed_token", "redirect_to", "verification_type"]), a = {
3144
+ function Da(n) {
3145
+ const { action_link: e, email_otp: t, hashed_token: r, redirect_to: s, verification_type: i } = n, o = Pa(n, ["action_link", "email_otp", "hashed_token", "redirect_to", "verification_type"]), a = {
3146
3146
  action_link: e,
3147
3147
  email_otp: t,
3148
3148
  hashed_token: r,
@@ -3157,10 +3157,10 @@ function Fa(n) {
3157
3157
  error: null
3158
3158
  };
3159
3159
  }
3160
- function Da(n) {
3160
+ function Ua(n) {
3161
3161
  return n;
3162
3162
  }
3163
- function Ua(n) {
3163
+ function ja(n) {
3164
3164
  return n.access_token && n.refresh_token && n.expires_in;
3165
3165
  }
3166
3166
  var _e = globalThis && globalThis.__awaiter || function(n, e, t, r) {
@@ -3189,7 +3189,7 @@ var _e = globalThis && globalThis.__awaiter || function(n, e, t, r) {
3189
3189
  }
3190
3190
  u((r = r.apply(n, e || [])).next());
3191
3191
  });
3192
- }, ja = globalThis && globalThis.__rest || function(n, e) {
3192
+ }, La = globalThis && globalThis.__rest || function(n, e) {
3193
3193
  var t = {};
3194
3194
  for (var r in n)
3195
3195
  Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
@@ -3198,9 +3198,9 @@ var _e = globalThis && globalThis.__awaiter || function(n, e, t, r) {
3198
3198
  e.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (t[r[s]] = n[r[s]]);
3199
3199
  return t;
3200
3200
  };
3201
- class La {
3201
+ class Ba {
3202
3202
  constructor({ url: e = "", headers: t = {}, fetch: r }) {
3203
- this.url = e, this.headers = t, this.fetch = Zs(r), this.mfa = {
3203
+ this.url = e, this.headers = t, this.fetch = Ys(r), this.mfa = {
3204
3204
  listFactors: this._listFactors.bind(this),
3205
3205
  deleteFactor: this._deleteFactor.bind(this)
3206
3206
  };
@@ -3256,11 +3256,11 @@ class La {
3256
3256
  generateLink(e) {
3257
3257
  return _e(this, void 0, void 0, function* () {
3258
3258
  try {
3259
- const { options: t } = e, r = ja(e, ["options"]), s = Object.assign(Object.assign({}, r), t);
3259
+ const { options: t } = e, r = La(e, ["options"]), s = Object.assign(Object.assign({}, r), t);
3260
3260
  return "newEmail" in r && (s.new_email = r == null ? void 0 : r.newEmail, delete s.newEmail), yield I(this.fetch, "POST", `${this.url}/admin/generate_link`, {
3261
3261
  body: s,
3262
3262
  headers: this.headers,
3263
- xform: Fa,
3263
+ xform: Da,
3264
3264
  redirectTo: t == null ? void 0 : t.redirectTo
3265
3265
  });
3266
3266
  } catch (t) {
@@ -3313,7 +3313,7 @@ class La {
3313
3313
  page: (r = (t = e == null ? void 0 : e.page) === null || t === void 0 ? void 0 : t.toString()) !== null && r !== void 0 ? r : "",
3314
3314
  per_page: (i = (s = e == null ? void 0 : e.perPage) === null || s === void 0 ? void 0 : s.toString()) !== null && i !== void 0 ? i : ""
3315
3315
  },
3316
- xform: Da
3316
+ xform: Ua
3317
3317
  });
3318
3318
  if (l.error)
3319
3319
  throw l.error;
@@ -3427,7 +3427,7 @@ class La {
3427
3427
  });
3428
3428
  }
3429
3429
  }
3430
- const Ba = "2.13.0", Ha = "http://localhost:9999", Ma = "supabase.auth.token", Va = { "X-Client-Info": `gotrue-js/${Ba}` }, za = 10, qa = {
3430
+ const Ha = "2.13.0", Ma = "http://localhost:9999", Va = "supabase.auth.token", za = { "X-Client-Info": `gotrue-js/${Ha}` }, qa = 10, Ga = {
3431
3431
  getItem: (n) => Wr() ? globalThis.localStorage.getItem(n) : null,
3432
3432
  setItem: (n, e) => {
3433
3433
  Wr() && globalThis.localStorage.setItem(n, e);
@@ -3436,7 +3436,7 @@ const Ba = "2.13.0", Ha = "http://localhost:9999", Ma = "supabase.auth.token", V
3436
3436
  Wr() && globalThis.localStorage.removeItem(n);
3437
3437
  }
3438
3438
  };
3439
- function Ga() {
3439
+ function Ja() {
3440
3440
  if (typeof globalThis != "object")
3441
3441
  try {
3442
3442
  Object.defineProperty(Object.prototype, "__magic__", {
@@ -3476,27 +3476,27 @@ var k = globalThis && globalThis.__awaiter || function(n, e, t, r) {
3476
3476
  u((r = r.apply(n, e || [])).next());
3477
3477
  });
3478
3478
  };
3479
- Ga();
3480
- const Ja = {
3481
- url: Ha,
3482
- storageKey: Ma,
3479
+ Ja();
3480
+ const Wa = {
3481
+ url: Ma,
3482
+ storageKey: Va,
3483
3483
  autoRefreshToken: !0,
3484
3484
  persistSession: !0,
3485
3485
  detectSessionInUrl: !0,
3486
- headers: Va
3487
- }, Xr = 10 * 1e3, Wa = 3;
3488
- class Ka {
3486
+ headers: za
3487
+ }, Xr = 10 * 1e3, Ka = 3;
3488
+ class Xa {
3489
3489
  /**
3490
3490
  * Create a new client for use in the browser.
3491
3491
  */
3492
3492
  constructor(e) {
3493
3493
  this.stateChangeEmitters = /* @__PURE__ */ new Map(), this.autoRefreshTicker = null, this.visibilityChangedCallback = null, this.refreshingDeferred = null, this.initializePromise = null, this.detectSessionInUrl = !0, this.broadcastChannel = null;
3494
- const t = Object.assign(Object.assign({}, Ja), e);
3495
- this.inMemorySession = null, this.storageKey = t.storageKey, this.autoRefreshToken = t.autoRefreshToken, this.persistSession = t.persistSession, this.storage = t.storage || qa, this.admin = new La({
3494
+ const t = Object.assign(Object.assign({}, Wa), e);
3495
+ this.inMemorySession = null, this.storageKey = t.storageKey, this.autoRefreshToken = t.autoRefreshToken, this.persistSession = t.persistSession, this.storage = t.storage || Ga, this.admin = new Ba({
3496
3496
  url: t.url,
3497
3497
  headers: t.headers,
3498
3498
  fetch: t.fetch
3499
- }), this.url = t.url, this.headers = t.headers, this.fetch = Zs(t.fetch), this.detectSessionInUrl = t.detectSessionInUrl, this.mfa = {
3499
+ }), this.url = t.url, this.headers = t.headers, this.fetch = Ys(t.fetch), this.detectSessionInUrl = t.detectSessionInUrl, this.mfa = {
3500
3500
  verify: this._verify.bind(this),
3501
3501
  enroll: this._enroll.bind(this),
3502
3502
  unenroll: this._unenroll.bind(this),
@@ -3539,7 +3539,7 @@ class Ka {
3539
3539
  return yield this._recoverAndRefresh(), { error: null };
3540
3540
  } catch (e) {
3541
3541
  return $(e) ? { error: e } : {
3542
- error: new Ys("Unexpected error during initialization", e)
3542
+ error: new Qs("Unexpected error during initialization", e)
3543
3543
  };
3544
3544
  } finally {
3545
3545
  yield this._handleVisibilityChange();
@@ -3800,7 +3800,7 @@ class Ka {
3800
3800
  return yield this._removeSession(), yield I(this.fetch, "POST", `${this.url}/sso`, {
3801
3801
  body: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, "providerId" in e ? { provider_id: e.providerId } : null), "domain" in e ? { domain: e.domain } : null), { redirect_to: (r = (t = e.options) === null || t === void 0 ? void 0 : t.redirectTo) !== null && r !== void 0 ? r : void 0 }), !((s = e == null ? void 0 : e.options) === null || s === void 0) && s.captchaToken ? { gotrue_meta_security: { captcha_token: e.options.captchaToken } } : null), { skip_http_redirect: !0 }),
3802
3802
  headers: this.headers,
3803
- xform: Ca
3803
+ xform: Fa
3804
3804
  });
3805
3805
  } catch (i) {
3806
3806
  if ($(i))
@@ -3818,7 +3818,7 @@ class Ka {
3818
3818
  yield this.initializePromise;
3819
3819
  let e = null;
3820
3820
  if (this.persistSession) {
3821
- const i = yield is(this.storage, this.storageKey);
3821
+ const i = yield os(this.storage, this.storageKey);
3822
3822
  i !== null && (this._isValidSession(i) ? e = i : yield this._removeSession());
3823
3823
  } else
3824
3824
  e = this.inMemorySession;
@@ -3888,7 +3888,7 @@ class Ka {
3888
3888
  * Decodes a JWT (without performing any validation).
3889
3889
  */
3890
3890
  _decodeJWT(e) {
3891
- return os(e);
3891
+ return as(e);
3892
3892
  }
3893
3893
  /**
3894
3894
  * Sets the session data from the current session. If the current session is expired, setSession will take care of refreshing it to obtain a new session.
@@ -3902,7 +3902,7 @@ class Ka {
3902
3902
  throw new jt();
3903
3903
  const t = Date.now() / 1e3;
3904
3904
  let r = t, s = !0, i = null;
3905
- const o = os(e.access_token);
3905
+ const o = as(e.access_token);
3906
3906
  if (o.exp && (r = o.exp, s = r <= t), s) {
3907
3907
  const { session: a, error: c } = yield this._callRefreshToken(e.refresh_token);
3908
3908
  if (c)
@@ -4031,7 +4031,7 @@ class Ka {
4031
4031
  const s = (e = t.session) === null || e === void 0 ? void 0 : e.access_token;
4032
4032
  if (s) {
4033
4033
  const { error: i } = yield this.admin.signOut(s);
4034
- if (i && !(Ra(i) && (i.status === 404 || i.status === 401)))
4034
+ if (i && !($a(i) && (i.status === 404 || i.status === 401)))
4035
4035
  return { error: i };
4036
4036
  }
4037
4037
  return yield this._removeSession(), this._notifyAllSubscribers("SIGNED_OUT", null), { error: null };
@@ -4042,7 +4042,7 @@ class Ka {
4042
4042
  * @param callback A callback function to be invoked when an auth event happens.
4043
4043
  */
4044
4044
  onAuthStateChange(e) {
4045
- const t = _a(), r = {
4045
+ const t = Ea(), r = {
4046
4046
  id: t,
4047
4047
  callback: e,
4048
4048
  unsubscribe: () => {
@@ -4080,8 +4080,8 @@ class Ka {
4080
4080
  return k(this, void 0, void 0, function* () {
4081
4081
  try {
4082
4082
  const t = Date.now();
4083
- return yield Aa((r) => k(this, void 0, void 0, function* () {
4084
- return yield ka(r * 200), yield I(this.fetch, "POST", `${this.url}/token?grant_type=refresh_token`, {
4083
+ return yield Sa((r) => k(this, void 0, void 0, function* () {
4084
+ return yield Aa(r * 200), yield I(this.fetch, "POST", `${this.url}/token?grant_type=refresh_token`, {
4085
4085
  body: { refresh_token: e },
4086
4086
  headers: this.headers,
4087
4087
  xform: Ze
@@ -4114,13 +4114,13 @@ class Ka {
4114
4114
  var e;
4115
4115
  return k(this, void 0, void 0, function* () {
4116
4116
  try {
4117
- const t = yield is(this.storage, this.storageKey);
4117
+ const t = yield os(this.storage, this.storageKey);
4118
4118
  if (!this._isValidSession(t)) {
4119
4119
  t !== null && (yield this._removeSession());
4120
4120
  return;
4121
4121
  }
4122
4122
  const r = Math.round(Date.now() / 1e3);
4123
- if (((e = t.expires_at) !== null && e !== void 0 ? e : 1 / 0) < r + za)
4123
+ if (((e = t.expires_at) !== null && e !== void 0 ? e : 1 / 0) < r + qa)
4124
4124
  if (this.autoRefreshToken && t.refresh_token) {
4125
4125
  const { error: s } = yield this._callRefreshToken(t.refresh_token);
4126
4126
  s && (console.log(s.message), yield this._removeSession());
@@ -4174,11 +4174,11 @@ class Ka {
4174
4174
  });
4175
4175
  }
4176
4176
  _persistSession(e) {
4177
- return xa(this.storage, this.storageKey, e);
4177
+ return Ta(this.storage, this.storageKey, e);
4178
4178
  }
4179
4179
  _removeSession() {
4180
4180
  return k(this, void 0, void 0, function* () {
4181
- this.persistSession ? yield Ta(this.storage, this.storageKey) : this.inMemorySession = null;
4181
+ this.persistSession ? yield Oa(this.storage, this.storageKey) : this.inMemorySession = null;
4182
4182
  });
4183
4183
  }
4184
4184
  /**
@@ -4267,7 +4267,7 @@ class Ka {
4267
4267
  const { data: { session: t } } = yield this.getSession();
4268
4268
  if (!t || !t.refresh_token || !t.expires_at)
4269
4269
  return;
4270
- Math.floor((t.expires_at * 1e3 - e) / Xr) < Wa && (yield this._callRefreshToken(t.refresh_token));
4270
+ Math.floor((t.expires_at * 1e3 - e) / Xr) < Ka && (yield this._callRefreshToken(t.refresh_token));
4271
4271
  } catch (t) {
4272
4272
  console.error("Auto refresh tick failed with error. This is likely a transient error.", t);
4273
4273
  }
@@ -4455,12 +4455,12 @@ class Ka {
4455
4455
  });
4456
4456
  }
4457
4457
  }
4458
- class Xa extends Ka {
4458
+ class Za extends Xa {
4459
4459
  constructor(e) {
4460
4460
  super(e);
4461
4461
  }
4462
4462
  }
4463
- var Za = globalThis && globalThis.__awaiter || function(n, e, t, r) {
4463
+ var Ya = globalThis && globalThis.__awaiter || function(n, e, t, r) {
4464
4464
  function s(i) {
4465
4465
  return i instanceof t ? i : new t(function(o) {
4466
4466
  o(i);
@@ -4487,16 +4487,16 @@ var Za = globalThis && globalThis.__awaiter || function(n, e, t, r) {
4487
4487
  u((r = r.apply(n, e || [])).next());
4488
4488
  });
4489
4489
  };
4490
- const Ya = {
4491
- headers: da
4492
- }, Qa = {
4493
- schema: "public"
4490
+ const Qa = {
4491
+ headers: pa
4494
4492
  }, ec = {
4493
+ schema: "public"
4494
+ }, tc = {
4495
4495
  autoRefreshToken: !0,
4496
4496
  persistSession: !0,
4497
4497
  detectSessionInUrl: !0
4498
- }, tc = {};
4499
- class rc {
4498
+ }, rc = {};
4499
+ class nc {
4500
4500
  /**
4501
4501
  * Create a new client for use in the browser.
4502
4502
  * @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.
@@ -4515,19 +4515,19 @@ class rc {
4515
4515
  throw new Error("supabaseUrl is required.");
4516
4516
  if (!t)
4517
4517
  throw new Error("supabaseKey is required.");
4518
- const y = wa(e);
4518
+ const y = ba(e);
4519
4519
  if (this.realtimeUrl = `${y}/realtime/v1`.replace(/^http/i, "ws"), this.authUrl = `${y}/auth/v1`, this.storageUrl = `${y}/storage/v1`, y.match(/(supabase\.co)|(supabase\.in)/)) {
4520
4520
  const A = y.split(".");
4521
4521
  this.functionsUrl = `${A[0]}.functions.${A[1]}.${A[2]}`;
4522
4522
  } else
4523
4523
  this.functionsUrl = `${y}/functions/v1`;
4524
4524
  const w = `sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`, v = {
4525
- db: Qa,
4526
- realtime: tc,
4527
- auth: Object.assign(Object.assign({}, ec), { storageKey: w }),
4528
- global: Ya
4529
- }, g = ba(r ?? {}, v);
4530
- this.storageKey = (i = (s = g.auth) === null || s === void 0 ? void 0 : s.storageKey) !== null && i !== void 0 ? i : "", this.headers = (a = (o = g.global) === null || o === void 0 ? void 0 : o.headers) !== null && a !== void 0 ? a : {}, this.auth = this._initSupabaseAuthClient((c = g.auth) !== null && c !== void 0 ? c : {}, this.headers, (u = g.global) === null || u === void 0 ? void 0 : u.fetch), this.fetch = ga(t, this._getAccessToken.bind(this), (l = g.global) === null || l === void 0 ? void 0 : l.fetch), this.realtime = this._initRealtimeClient(Object.assign({ headers: this.headers }, g.realtime)), this.rest = new go(`${y}/rest/v1`, {
4525
+ db: ec,
4526
+ realtime: rc,
4527
+ auth: Object.assign(Object.assign({}, tc), { storageKey: w }),
4528
+ global: Qa
4529
+ }, g = va(r ?? {}, v);
4530
+ this.storageKey = (i = (s = g.auth) === null || s === void 0 ? void 0 : s.storageKey) !== null && i !== void 0 ? i : "", this.headers = (a = (o = g.global) === null || o === void 0 ? void 0 : o.headers) !== null && a !== void 0 ? a : {}, this.auth = this._initSupabaseAuthClient((c = g.auth) !== null && c !== void 0 ? c : {}, this.headers, (u = g.global) === null || u === void 0 ? void 0 : u.fetch), this.fetch = wa(t, this._getAccessToken.bind(this), (l = g.global) === null || l === void 0 ? void 0 : l.fetch), this.realtime = this._initRealtimeClient(Object.assign({ headers: this.headers }, g.realtime)), this.rest = new wo(`${y}/rest/v1`, {
4531
4531
  headers: this.headers,
4532
4532
  schema: (h = g.db) === null || h === void 0 ? void 0 : h.schema,
4533
4533
  fetch: this.fetch
@@ -4537,7 +4537,7 @@ class rc {
4537
4537
  * Supabase Functions allows you to deploy and invoke edge functions.
4538
4538
  */
4539
4539
  get functions() {
4540
- return new ao(this.functionsUrl, {
4540
+ return new co(this.functionsUrl, {
4541
4541
  headers: this.headers,
4542
4542
  customFetch: this.fetch
4543
4543
  });
@@ -4546,7 +4546,7 @@ class rc {
4546
4546
  * Supabase Storage allows you to manage user-generated content, such as photos or videos.
4547
4547
  */
4548
4548
  get storage() {
4549
- return new ha(this.storageUrl, this.headers, this.fetch);
4549
+ return new fa(this.storageUrl, this.headers, this.fetch);
4550
4550
  }
4551
4551
  from(e) {
4552
4552
  return this.rest.from(e);
@@ -4596,7 +4596,7 @@ class rc {
4596
4596
  }
4597
4597
  _getAccessToken() {
4598
4598
  var e, t;
4599
- return Za(this, void 0, void 0, function* () {
4599
+ return Ya(this, void 0, void 0, function* () {
4600
4600
  const { data: r } = yield this.auth.getSession();
4601
4601
  return (t = (e = r.session) === null || e === void 0 ? void 0 : e.access_token) !== null && t !== void 0 ? t : null;
4602
4602
  });
@@ -4606,7 +4606,7 @@ class rc {
4606
4606
  Authorization: `Bearer ${this.supabaseKey}`,
4607
4607
  apikey: `${this.supabaseKey}`
4608
4608
  };
4609
- return new Xa({
4609
+ return new Za({
4610
4610
  url: this.authUrl,
4611
4611
  headers: Object.assign(Object.assign({}, c), o),
4612
4612
  storageKey: i,
@@ -4618,7 +4618,7 @@ class rc {
4618
4618
  });
4619
4619
  }
4620
4620
  _initRealtimeClient(e) {
4621
- return new Qo(this.realtimeUrl, Object.assign(Object.assign({}, e), { params: Object.assign({ apikey: this.supabaseKey }, e == null ? void 0 : e.params) }));
4621
+ return new ea(this.realtimeUrl, Object.assign(Object.assign({}, e), { params: Object.assign({ apikey: this.supabaseKey }, e == null ? void 0 : e.params) }));
4622
4622
  }
4623
4623
  _listenForAuthEvents() {
4624
4624
  return this.auth.onAuthStateChange((t, r) => {
@@ -4629,7 +4629,7 @@ class rc {
4629
4629
  (e === "TOKEN_REFRESHED" || e === "SIGNED_IN") && this.changedAccessToken !== t ? (this.realtime.setAuth(t ?? null), this.changedAccessToken = t) : (e === "SIGNED_OUT" || e === "USER_DELETED") && (this.realtime.setAuth(this.supabaseKey), r == "STORAGE" && this.auth.signOut(), this.changedAccessToken = void 0);
4630
4630
  }
4631
4631
  }
4632
- const nc = (n, e, t) => new rc(n, e, t);
4632
+ const sc = (n, e, t) => new nc(n, e, t);
4633
4633
  function pt(n) {
4634
4634
  this._maxSize = n, this.clear();
4635
4635
  }
@@ -4642,13 +4642,13 @@ pt.prototype.get = function(n) {
4642
4642
  pt.prototype.set = function(n, e) {
4643
4643
  return this._size >= this._maxSize && this.clear(), n in this._values || this._size++, this._values[n] = e;
4644
4644
  };
4645
- var sc = /[^.^\]^[]+|(?=\[\]|\.\.)/g, Qs = /^\d+$/, ic = /^\d/, oc = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, ac = /^\s*(['"]?)(.*?)(\1)\s*$/, Nn = 512, as = new pt(Nn), cs = new pt(Nn), us = new pt(Nn), ot = {
4645
+ var ic = /[^.^\]^[]+|(?=\[\]|\.\.)/g, ei = /^\d+$/, oc = /^\d/, ac = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, cc = /^\s*(['"]?)(.*?)(\1)\s*$/, Nn = 512, cs = new pt(Nn), us = new pt(Nn), ls = new pt(Nn), ot = {
4646
4646
  Cache: pt,
4647
4647
  split: ln,
4648
4648
  normalizePath: Zr,
4649
4649
  setter: function(n) {
4650
4650
  var e = Zr(n);
4651
- return cs.get(n) || cs.set(n, function(r, s) {
4651
+ return us.get(n) || us.set(n, function(r, s) {
4652
4652
  for (var i = 0, o = e.length, a = r; i < o - 1; ) {
4653
4653
  var c = e[i];
4654
4654
  if (c === "__proto__" || c === "constructor" || c === "prototype")
@@ -4660,7 +4660,7 @@ var sc = /[^.^\]^[]+|(?=\[\]|\.\.)/g, Qs = /^\d+$/, ic = /^\d/, oc = /[~`!#$%\^&
4660
4660
  },
4661
4661
  getter: function(n, e) {
4662
4662
  var t = Zr(n);
4663
- return us.get(n) || us.set(n, function(s) {
4663
+ return ls.get(n) || ls.set(n, function(s) {
4664
4664
  for (var i = 0, o = t.length; i < o; )
4665
4665
  if (s != null || !e)
4666
4666
  s = s[t[i++]];
@@ -4671,55 +4671,55 @@ var sc = /[^.^\]^[]+|(?=\[\]|\.\.)/g, Qs = /^\d+$/, ic = /^\d/, oc = /[~`!#$%\^&
4671
4671
  },
4672
4672
  join: function(n) {
4673
4673
  return n.reduce(function(e, t) {
4674
- return e + (In(t) || Qs.test(t) ? "[" + t + "]" : (e ? "." : "") + t);
4674
+ return e + (In(t) || ei.test(t) ? "[" + t + "]" : (e ? "." : "") + t);
4675
4675
  }, "");
4676
4676
  },
4677
4677
  forEach: function(n, e, t) {
4678
- cc(Array.isArray(n) ? n : ln(n), e, t);
4678
+ uc(Array.isArray(n) ? n : ln(n), e, t);
4679
4679
  }
4680
4680
  };
4681
4681
  function Zr(n) {
4682
- return as.get(n) || as.set(
4682
+ return cs.get(n) || cs.set(
4683
4683
  n,
4684
4684
  ln(n).map(function(e) {
4685
- return e.replace(ac, "$2");
4685
+ return e.replace(cc, "$2");
4686
4686
  })
4687
4687
  );
4688
4688
  }
4689
4689
  function ln(n) {
4690
- return n.match(sc) || [""];
4690
+ return n.match(ic) || [""];
4691
4691
  }
4692
- function cc(n, e, t) {
4692
+ function uc(n, e, t) {
4693
4693
  var r = n.length, s, i, o, a;
4694
4694
  for (i = 0; i < r; i++)
4695
- s = n[i], s && (hc(s) && (s = '"' + s + '"'), a = In(s), o = !a && /^\d+$/.test(s), e.call(t, s, a, o, i, n));
4695
+ s = n[i], s && (fc(s) && (s = '"' + s + '"'), a = In(s), o = !a && /^\d+$/.test(s), e.call(t, s, a, o, i, n));
4696
4696
  }
4697
4697
  function In(n) {
4698
4698
  return typeof n == "string" && n && ["'", '"'].indexOf(n.charAt(0)) !== -1;
4699
4699
  }
4700
- function uc(n) {
4701
- return n.match(ic) && !n.match(Qs);
4702
- }
4703
4700
  function lc(n) {
4704
- return oc.test(n);
4701
+ return n.match(oc) && !n.match(ei);
4705
4702
  }
4706
4703
  function hc(n) {
4707
- return !In(n) && (uc(n) || lc(n));
4704
+ return ac.test(n);
4708
4705
  }
4709
- const fc = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g, Nr = (n) => n.match(fc) || [], Ir = (n) => n[0].toUpperCase() + n.slice(1), Cn = (n, e) => Nr(n).join(e).toLowerCase(), ei = (n) => Nr(n).reduce(
4706
+ function fc(n) {
4707
+ return !In(n) && (lc(n) || hc(n));
4708
+ }
4709
+ const dc = /[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g, Nr = (n) => n.match(dc) || [], Ir = (n) => n[0].toUpperCase() + n.slice(1), Cn = (n, e) => Nr(n).join(e).toLowerCase(), ti = (n) => Nr(n).reduce(
4710
4710
  (e, t) => `${e}${e ? t[0].toUpperCase() + t.slice(1).toLowerCase() : t.toLowerCase()}`,
4711
4711
  ""
4712
- ), dc = (n) => Ir(ei(n)), pc = (n) => Cn(n, "_"), yc = (n) => Cn(n, "-"), mc = (n) => Ir(Cn(n, " ")), gc = (n) => Nr(n).map(Ir).join(" ");
4712
+ ), pc = (n) => Ir(ti(n)), yc = (n) => Cn(n, "_"), mc = (n) => Cn(n, "-"), gc = (n) => Ir(Cn(n, " ")), wc = (n) => Nr(n).map(Ir).join(" ");
4713
4713
  var Yr = {
4714
4714
  words: Nr,
4715
4715
  upperFirst: Ir,
4716
- camelCase: ei,
4717
- pascalCase: dc,
4718
- snakeCase: pc,
4719
- kebabCase: yc,
4720
- sentenceCase: mc,
4721
- titleCase: gc
4722
- }, gr = {}, wc = {
4716
+ camelCase: ti,
4717
+ pascalCase: pc,
4718
+ snakeCase: yc,
4719
+ kebabCase: mc,
4720
+ sentenceCase: gc,
4721
+ titleCase: wc
4722
+ }, gr = {}, bc = {
4723
4723
  get exports() {
4724
4724
  return gr;
4725
4725
  },
@@ -4727,12 +4727,12 @@ var Yr = {
4727
4727
  gr = n;
4728
4728
  }
4729
4729
  };
4730
- wc.exports = function(n) {
4731
- return ti(bc(n), n);
4730
+ bc.exports = function(n) {
4731
+ return ri(vc(n), n);
4732
4732
  };
4733
- gr.array = ti;
4734
- function ti(n, e) {
4735
- var t = n.length, r = new Array(t), s = {}, i = t, o = vc(e), a = _c(n);
4733
+ gr.array = ri;
4734
+ function ri(n, e) {
4735
+ var t = n.length, r = new Array(t), s = {}, i = t, o = _c(e), a = Ec(n);
4736
4736
  for (e.forEach(function(u) {
4737
4737
  if (!a.has(u[0]) || !a.has(u[1]))
4738
4738
  throw new Error("Unknown node. There is an unknown node in the supplied edges.");
@@ -4766,69 +4766,69 @@ function ti(n, e) {
4766
4766
  }
4767
4767
  }
4768
4768
  }
4769
- function bc(n) {
4769
+ function vc(n) {
4770
4770
  for (var e = /* @__PURE__ */ new Set(), t = 0, r = n.length; t < r; t++) {
4771
4771
  var s = n[t];
4772
4772
  e.add(s[0]), e.add(s[1]);
4773
4773
  }
4774
4774
  return Array.from(e);
4775
4775
  }
4776
- function vc(n) {
4776
+ function _c(n) {
4777
4777
  for (var e = /* @__PURE__ */ new Map(), t = 0, r = n.length; t < r; t++) {
4778
4778
  var s = n[t];
4779
4779
  e.has(s[0]) || e.set(s[0], /* @__PURE__ */ new Set()), e.has(s[1]) || e.set(s[1], /* @__PURE__ */ new Set()), e.get(s[0]).add(s[1]);
4780
4780
  }
4781
4781
  return e;
4782
4782
  }
4783
- function _c(n) {
4783
+ function Ec(n) {
4784
4784
  for (var e = /* @__PURE__ */ new Map(), t = 0, r = n.length; t < r; t++)
4785
4785
  e.set(n[t], t);
4786
4786
  return e;
4787
4787
  }
4788
- const Ec = Object.prototype.toString, xc = Error.prototype.toString, Tc = RegExp.prototype.toString, Oc = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", kc = /^Symbol\((.*)\)(.*)$/;
4789
- function Ac(n) {
4788
+ const xc = Object.prototype.toString, Tc = Error.prototype.toString, Oc = RegExp.prototype.toString, kc = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", Ac = /^Symbol\((.*)\)(.*)$/;
4789
+ function Sc(n) {
4790
4790
  return n != +n ? "NaN" : n === 0 && 1 / n < 0 ? "-0" : "" + n;
4791
4791
  }
4792
- function ls(n, e = !1) {
4792
+ function hs(n, e = !1) {
4793
4793
  if (n == null || n === !0 || n === !1)
4794
4794
  return "" + n;
4795
4795
  const t = typeof n;
4796
4796
  if (t === "number")
4797
- return Ac(n);
4797
+ return Sc(n);
4798
4798
  if (t === "string")
4799
4799
  return e ? `"${n}"` : n;
4800
4800
  if (t === "function")
4801
4801
  return "[Function " + (n.name || "anonymous") + "]";
4802
4802
  if (t === "symbol")
4803
- return Oc.call(n).replace(kc, "Symbol($1)");
4804
- const r = Ec.call(n).slice(8, -1);
4805
- return r === "Date" ? isNaN(n.getTime()) ? "" + n : n.toISOString(n) : r === "Error" || n instanceof Error ? "[" + xc.call(n) + "]" : r === "RegExp" ? Tc.call(n) : null;
4803
+ return kc.call(n).replace(Ac, "Symbol($1)");
4804
+ const r = xc.call(n).slice(8, -1);
4805
+ return r === "Date" ? isNaN(n.getTime()) ? "" + n : n.toISOString(n) : r === "Error" || n instanceof Error ? "[" + Tc.call(n) + "]" : r === "RegExp" ? Oc.call(n) : null;
4806
4806
  }
4807
4807
  function at(n, e) {
4808
- let t = ls(n, e);
4808
+ let t = hs(n, e);
4809
4809
  return t !== null ? t : JSON.stringify(n, function(r, s) {
4810
- let i = ls(this[r], e);
4810
+ let i = hs(this[r], e);
4811
4811
  return i !== null ? i : s;
4812
4812
  }, 2);
4813
4813
  }
4814
- function ri(n) {
4814
+ function ni(n) {
4815
4815
  return n == null ? [] : [].concat(n);
4816
4816
  }
4817
- let Sc = /\$\{\s*(\w+)\s*\}/g;
4818
- class ie extends Error {
4817
+ let Rc = /\$\{\s*(\w+)\s*\}/g;
4818
+ class oe extends Error {
4819
4819
  static formatError(e, t) {
4820
4820
  const r = t.label || t.path || "this";
4821
4821
  return r !== t.path && (t = Object.assign({}, t, {
4822
4822
  path: r
4823
- })), typeof e == "string" ? e.replace(Sc, (s, i) => at(t[i])) : typeof e == "function" ? e(t) : e;
4823
+ })), typeof e == "string" ? e.replace(Rc, (s, i) => at(t[i])) : typeof e == "function" ? e(t) : e;
4824
4824
  }
4825
4825
  static isError(e) {
4826
4826
  return e && e.name === "ValidationError";
4827
4827
  }
4828
4828
  constructor(e, t, r, s) {
4829
- super(), this.value = void 0, this.path = void 0, this.type = void 0, this.errors = void 0, this.params = void 0, this.inner = void 0, this.name = "ValidationError", this.value = t, this.path = r, this.type = s, this.errors = [], this.inner = [], ri(e).forEach((i) => {
4830
- ie.isError(i) ? (this.errors.push(...i.errors), this.inner = this.inner.concat(i.inner.length ? i.inner : i)) : this.errors.push(i);
4831
- }), this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0], Error.captureStackTrace && Error.captureStackTrace(this, ie);
4829
+ super(), this.value = void 0, this.path = void 0, this.type = void 0, this.errors = void 0, this.params = void 0, this.inner = void 0, this.name = "ValidationError", this.value = t, this.path = r, this.type = s, this.errors = [], this.inner = [], ni(e).forEach((i) => {
4830
+ oe.isError(i) ? (this.errors.push(...i.errors), this.inner = this.inner.concat(i.inner.length ? i.inner : i)) : this.errors.push(i);
4831
+ }), this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0], Error.captureStackTrace && Error.captureStackTrace(this, oe);
4832
4832
  }
4833
4833
  }
4834
4834
  let Se = {
@@ -4998,10 +4998,10 @@ function bt(n) {
4998
4998
  }, h, L.params);
4999
4999
  for (const gt of Object.keys(M))
5000
5000
  M[gt] = A(M[gt]);
5001
- const sr = new ie(ie.formatError(L.message || y, M), t, M.path, L.type || u);
5001
+ const sr = new oe(oe.formatError(L.message || y, M), t, M.path, L.type || u);
5002
5002
  return sr.params = M, sr;
5003
5003
  }
5004
- const X = g ? a : c;
5004
+ const Z = g ? a : c;
5005
5005
  let U = {
5006
5006
  path: r,
5007
5007
  parent: w,
@@ -5014,9 +5014,9 @@ function bt(n) {
5014
5014
  schema: o
5015
5015
  };
5016
5016
  const be = (L) => {
5017
- ie.isError(L) ? X(L) : L ? c(null) : X(C());
5017
+ oe.isError(L) ? Z(L) : L ? c(null) : Z(C());
5018
5018
  }, Dt = (L) => {
5019
- ie.isError(L) ? X(L) : a(L);
5019
+ oe.isError(L) ? Z(L) : a(L);
5020
5020
  }, rr = p && he(t);
5021
5021
  if (!s.sync) {
5022
5022
  try {
@@ -5039,7 +5039,7 @@ function bt(n) {
5039
5039
  }
5040
5040
  return e.OPTIONS = n, e;
5041
5041
  }
5042
- function Rc(n, e, t, r = t) {
5042
+ function $c(n, e, t, r = t) {
5043
5043
  let s, i, o;
5044
5044
  return e ? (ot.forEach(e, (a, c, u) => {
5045
5045
  let l = c ? a.slice(1, a.length - 1) : a;
@@ -5123,7 +5123,7 @@ function Tt(n, e = /* @__PURE__ */ new Map()) {
5123
5123
  throw Error(`Unable to clone ${n}`);
5124
5124
  return t;
5125
5125
  }
5126
- class te {
5126
+ class re {
5127
5127
  constructor(e) {
5128
5128
  this.type = void 0, this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this.internalTests = {}, this._whitelist = new br(), this._blacklist = new br(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this._typeCheck = void 0, this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
5129
5129
  this.typeError(Se.notType);
@@ -5317,9 +5317,9 @@ attempted value: ${o}
5317
5317
  value: e
5318
5318
  }));
5319
5319
  return new Promise((s, i) => r._validate(e, t, (o, a) => {
5320
- ie.isError(o) && (o.value = a), i(o);
5320
+ oe.isError(o) && (o.value = a), i(o);
5321
5321
  }, (o, a) => {
5322
- o.length ? i(new ie(o, a)) : s(a);
5322
+ o.length ? i(new oe(o, a)) : s(a);
5323
5323
  }));
5324
5324
  }
5325
5325
  validateSync(e, t) {
@@ -5329,16 +5329,16 @@ attempted value: ${o}
5329
5329
  return r._validate(e, Object.assign({}, t, {
5330
5330
  sync: !0
5331
5331
  }), (i, o) => {
5332
- throw ie.isError(i) && (i.value = o), i;
5332
+ throw oe.isError(i) && (i.value = o), i;
5333
5333
  }, (i, o) => {
5334
5334
  if (i.length)
5335
- throw new ie(i, e);
5335
+ throw new oe(i, e);
5336
5336
  s = o;
5337
5337
  }), s;
5338
5338
  }
5339
5339
  isValid(e, t) {
5340
5340
  return this.validate(e, t).then(() => !0, (r) => {
5341
- if (ie.isError(r))
5341
+ if (oe.isError(r))
5342
5342
  return !1;
5343
5343
  throw r;
5344
5344
  });
@@ -5347,7 +5347,7 @@ attempted value: ${o}
5347
5347
  try {
5348
5348
  return this.validateSync(e, t), !0;
5349
5349
  } catch (r) {
5350
- if (ie.isError(r))
5350
+ if (oe.isError(r))
5351
5351
  return !1;
5352
5352
  throw r;
5353
5353
  }
@@ -5448,7 +5448,7 @@ attempted value: ${o}
5448
5448
  }
5449
5449
  when(e, t) {
5450
5450
  !Array.isArray(e) && typeof e != "string" && (t = e, e = ".");
5451
- let r = this.clone(), s = ri(e).map((i) => new yt(i));
5451
+ let r = this.clone(), s = ni(e).map((i) => new yt(i));
5452
5452
  return s.forEach((i) => {
5453
5453
  i.isSibling && r.deps.push(i.key);
5454
5454
  }), r.conditions.push(typeof t == "function" ? new wr(s, t) : wr.fromOptions(s, t)), r;
@@ -5536,43 +5536,43 @@ attempted value: ${o}
5536
5536
  };
5537
5537
  }
5538
5538
  }
5539
- te.prototype.__isYupSchema__ = !0;
5539
+ re.prototype.__isYupSchema__ = !0;
5540
5540
  for (const n of ["validate", "validateSync"])
5541
- te.prototype[`${n}At`] = function(e, t, r = {}) {
5541
+ re.prototype[`${n}At`] = function(e, t, r = {}) {
5542
5542
  const {
5543
5543
  parent: s,
5544
5544
  parentPath: i,
5545
5545
  schema: o
5546
- } = Rc(this, e, t, r.context);
5546
+ } = $c(this, e, t, r.context);
5547
5547
  return o[n](s && s[i], Object.assign({}, r, {
5548
5548
  parent: s,
5549
5549
  path: e
5550
5550
  }));
5551
5551
  };
5552
5552
  for (const n of ["equals", "is"])
5553
- te.prototype[n] = te.prototype.oneOf;
5553
+ re.prototype[n] = re.prototype.oneOf;
5554
5554
  for (const n of ["not", "nope"])
5555
- te.prototype[n] = te.prototype.notOneOf;
5556
- const $c = () => !0;
5557
- function ni(n) {
5558
- return new si(n);
5555
+ re.prototype[n] = re.prototype.notOneOf;
5556
+ const Pc = () => !0;
5557
+ function si(n) {
5558
+ return new ii(n);
5559
5559
  }
5560
- class si extends te {
5560
+ class ii extends re {
5561
5561
  constructor(e) {
5562
5562
  super(typeof e == "function" ? {
5563
5563
  type: "mixed",
5564
5564
  check: e
5565
5565
  } : Object.assign({
5566
5566
  type: "mixed",
5567
- check: $c
5567
+ check: Pc
5568
5568
  }, e));
5569
5569
  }
5570
5570
  }
5571
- ni.prototype = si.prototype;
5571
+ si.prototype = ii.prototype;
5572
5572
  function Fn() {
5573
- return new ii();
5573
+ return new oi();
5574
5574
  }
5575
- class ii extends te {
5575
+ class oi extends re {
5576
5576
  constructor() {
5577
5577
  super({
5578
5578
  type: "boolean",
@@ -5642,18 +5642,18 @@ class ii extends te {
5642
5642
  return super.strip(e);
5643
5643
  }
5644
5644
  }
5645
- Fn.prototype = ii.prototype;
5646
- let Pc = (
5645
+ Fn.prototype = oi.prototype;
5646
+ let Nc = (
5647
5647
  // eslint-disable-next-line
5648
5648
  /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
5649
- ), Nc = (
5649
+ ), Ic = (
5650
5650
  // eslint-disable-next-line
5651
5651
  /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
5652
- ), Ic = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, Cc = (n) => he(n) || n === n.trim(), Fc = {}.toString();
5653
- function O() {
5654
- return new oi();
5652
+ ), Cc = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, Fc = (n) => he(n) || n === n.trim(), Dc = {}.toString();
5653
+ function T() {
5654
+ return new ai();
5655
5655
  }
5656
- class oi extends te {
5656
+ class ai extends re {
5657
5657
  constructor() {
5658
5658
  super({
5659
5659
  type: "string",
@@ -5665,7 +5665,7 @@ class oi extends te {
5665
5665
  if (!r.spec.coerce || r.isType(e) || Array.isArray(e))
5666
5666
  return e;
5667
5667
  const s = e != null && e.toString ? e.toString() : e;
5668
- return s === Fc ? e : s;
5668
+ return s === Dc ? e : s;
5669
5669
  });
5670
5670
  });
5671
5671
  }
@@ -5739,21 +5739,21 @@ class oi extends te {
5739
5739
  });
5740
5740
  }
5741
5741
  email(e = de.email) {
5742
- return this.matches(Pc, {
5742
+ return this.matches(Nc, {
5743
5743
  name: "email",
5744
5744
  message: e,
5745
5745
  excludeEmptyString: !0
5746
5746
  });
5747
5747
  }
5748
5748
  url(e = de.url) {
5749
- return this.matches(Nc, {
5749
+ return this.matches(Ic, {
5750
5750
  name: "url",
5751
5751
  message: e,
5752
5752
  excludeEmptyString: !0
5753
5753
  });
5754
5754
  }
5755
5755
  uuid(e = de.uuid) {
5756
- return this.matches(Ic, {
5756
+ return this.matches(Cc, {
5757
5757
  name: "uuid",
5758
5758
  message: e,
5759
5759
  excludeEmptyString: !1
@@ -5767,7 +5767,7 @@ class oi extends te {
5767
5767
  return this.transform((t) => t != null ? t.trim() : t).test({
5768
5768
  message: e,
5769
5769
  name: "trim",
5770
- test: Cc
5770
+ test: Fc
5771
5771
  });
5772
5772
  }
5773
5773
  lowercase(e = de.lowercase) {
@@ -5789,17 +5789,17 @@ class oi extends te {
5789
5789
  });
5790
5790
  }
5791
5791
  }
5792
- O.prototype = oi.prototype;
5793
- let Dc = (n) => n != +n;
5792
+ T.prototype = ai.prototype;
5793
+ let Uc = (n) => n != +n;
5794
5794
  function q() {
5795
- return new ai();
5795
+ return new ci();
5796
5796
  }
5797
- class ai extends te {
5797
+ class ci extends re {
5798
5798
  constructor() {
5799
5799
  super({
5800
5800
  type: "number",
5801
5801
  check(e) {
5802
- return e instanceof Number && (e = e.valueOf()), typeof e == "number" && !Dc(e);
5802
+ return e instanceof Number && (e = e.valueOf()), typeof e == "number" && !Uc(e);
5803
5803
  }
5804
5804
  }), this.withMutation(() => {
5805
5805
  this.transform((e, t, r) => {
@@ -5898,11 +5898,11 @@ class ai extends te {
5898
5898
  return this.transform((s) => he(s) ? s : Math[e](s));
5899
5899
  }
5900
5900
  }
5901
- q.prototype = ai.prototype;
5902
- var Uc = /^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;
5903
- function jc(n) {
5901
+ q.prototype = ci.prototype;
5902
+ var jc = /^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;
5903
+ function Lc(n) {
5904
5904
  var e = [1, 4, 5, 6, 7, 10, 11], t = 0, r, s;
5905
- if (s = Uc.exec(n)) {
5905
+ if (s = jc.exec(n)) {
5906
5906
  for (var i = 0, o; o = e[i]; ++i)
5907
5907
  s[o] = +s[o] || 0;
5908
5908
  s[2] = (+s[2] || 1) - 1, s[3] = +s[3] || 1, s[7] = s[7] ? String(s[7]).substr(0, 3) : 0, (s[8] === void 0 || s[8] === "") && (s[9] === void 0 || s[9] === "") ? r = +new Date(s[1], s[2], s[3], s[4], s[5], s[6], s[7]) : (s[8] !== "Z" && s[9] !== void 0 && (t = s[10] * 60 + s[11], s[9] === "+" && (t = 0 - t)), r = Date.UTC(s[1], s[2], s[3], s[4], s[5] + t, s[6], s[7]));
@@ -5910,16 +5910,16 @@ function jc(n) {
5910
5910
  r = Date.parse ? Date.parse(n) : NaN;
5911
5911
  return r;
5912
5912
  }
5913
- let Lc = new Date(""), Bc = (n) => Object.prototype.toString.call(n) === "[object Date]";
5914
- class Fr extends te {
5913
+ let Bc = new Date(""), Hc = (n) => Object.prototype.toString.call(n) === "[object Date]";
5914
+ class Fr extends re {
5915
5915
  constructor() {
5916
5916
  super({
5917
5917
  type: "date",
5918
5918
  check(e) {
5919
- return Bc(e) && !isNaN(e.getTime());
5919
+ return Hc(e) && !isNaN(e.getTime());
5920
5920
  }
5921
5921
  }), this.withMutation(() => {
5922
- this.transform((e, t, r) => !r.spec.coerce || r.isType(e) ? e : (e = jc(e), isNaN(e) ? Fr.INVALID_DATE : new Date(e)));
5922
+ this.transform((e, t, r) => !r.spec.coerce || r.isType(e) ? e : (e = Lc(e), isNaN(e) ? Fr.INVALID_DATE : new Date(e)));
5923
5923
  });
5924
5924
  }
5925
5925
  prepareParam(e, t) {
@@ -5965,9 +5965,9 @@ class Fr extends te {
5965
5965
  });
5966
5966
  }
5967
5967
  }
5968
- Fr.INVALID_DATE = Lc;
5968
+ Fr.INVALID_DATE = Bc;
5969
5969
  Fr.prototype;
5970
- function Hc(n, e = []) {
5970
+ function Mc(n, e = []) {
5971
5971
  let t = [], r = /* @__PURE__ */ new Set(), s = new Set(e.map(([o, a]) => `${o}-${a}`));
5972
5972
  function i(o, a) {
5973
5973
  let c = ot.split(o)[0];
@@ -5979,7 +5979,7 @@ function Hc(n, e = []) {
5979
5979
  }
5980
5980
  return gr.array(Array.from(r), t).reverse();
5981
5981
  }
5982
- function hs(n, e) {
5982
+ function fs(n, e) {
5983
5983
  let t = 1 / 0;
5984
5984
  return n.some((r, s) => {
5985
5985
  var i;
@@ -5987,10 +5987,10 @@ function hs(n, e) {
5987
5987
  return t = s, !0;
5988
5988
  }), t;
5989
5989
  }
5990
- function ci(n) {
5991
- return (e, t) => hs(n, e) - hs(n, t);
5990
+ function ui(n) {
5991
+ return (e, t) => fs(n, e) - fs(n, t);
5992
5992
  }
5993
- const ui = (n, e, t) => {
5993
+ const li = (n, e, t) => {
5994
5994
  if (typeof n != "string")
5995
5995
  return n;
5996
5996
  let r = n;
@@ -6015,30 +6015,30 @@ function pr(n) {
6015
6015
  types: n.spec.types.map(pr)
6016
6016
  }) : "optional" in n ? n.optional() : n;
6017
6017
  }
6018
- const Mc = (n, e) => {
6018
+ const Vc = (n, e) => {
6019
6019
  const t = [...ot.normalizePath(e)];
6020
6020
  if (t.length === 1)
6021
6021
  return t[0] in n;
6022
6022
  let r = t.pop(), s = ot.getter(ot.join(t), !0)(n);
6023
6023
  return !!(s && r in s);
6024
6024
  };
6025
- let fs = (n) => Object.prototype.toString.call(n) === "[object Object]";
6026
- function Vc(n, e) {
6025
+ let ds = (n) => Object.prototype.toString.call(n) === "[object Object]";
6026
+ function zc(n, e) {
6027
6027
  let t = Object.keys(n.fields);
6028
6028
  return Object.keys(e).filter((r) => t.indexOf(r) === -1);
6029
6029
  }
6030
- const zc = ci([]);
6031
- function oe(n) {
6032
- return new li(n);
6030
+ const qc = ui([]);
6031
+ function K(n) {
6032
+ return new hi(n);
6033
6033
  }
6034
- class li extends te {
6034
+ class hi extends re {
6035
6035
  constructor(e) {
6036
6036
  super({
6037
6037
  type: "object",
6038
6038
  check(t) {
6039
- return fs(t) || typeof t == "function";
6039
+ return ds(t) || typeof t == "function";
6040
6040
  }
6041
- }), this.fields = /* @__PURE__ */ Object.create(null), this._sortErrors = zc, this._nodes = [], this._excludedEdges = [], this.withMutation(() => {
6041
+ }), this.fields = /* @__PURE__ */ Object.create(null), this._sortErrors = qc, this._nodes = [], this._excludedEdges = [], this.withMutation(() => {
6042
6042
  e && this.shape(e);
6043
6043
  });
6044
6044
  }
@@ -6062,7 +6062,7 @@ class li extends te {
6062
6062
  context: t.context,
6063
6063
  parent: c
6064
6064
  });
6065
- let g = y instanceof te ? y.spec : void 0, A = g == null ? void 0 : g.strict;
6065
+ let g = y instanceof re ? y.spec : void 0, A = g == null ? void 0 : g.strict;
6066
6066
  if (g != null && g.strip) {
6067
6067
  l = l || h in s;
6068
6068
  continue;
@@ -6087,7 +6087,7 @@ class li extends te {
6087
6087
  schema: this,
6088
6088
  value: o
6089
6089
  }, ...i], t.__validating = !0, t.originalValue = o, super._validate(e, t, r, (c, u) => {
6090
- if (!a || !fs(u)) {
6090
+ if (!a || !ds(u)) {
6091
6091
  s(c, u);
6092
6092
  return;
6093
6093
  }
@@ -6138,7 +6138,7 @@ class li extends te {
6138
6138
  }
6139
6139
  setFields(e, t) {
6140
6140
  let r = this.clone();
6141
- return r.fields = e, r._nodes = Hc(e, t), r._sortErrors = ci(Object.keys(e)), t && (r._excludedEdges = t), r;
6141
+ return r.fields = e, r._nodes = Mc(e, t), r._sortErrors = ui(Object.keys(e)), t && (r._excludedEdges = t), r;
6142
6142
  }
6143
6143
  shape(e, t = []) {
6144
6144
  return this.clone().withMutation((r) => {
@@ -6173,12 +6173,12 @@ class li extends te {
6173
6173
  if (!i)
6174
6174
  return i;
6175
6175
  let o = i;
6176
- return Mc(i, e) && (o = Object.assign({}, i), r || delete o[e], o[t] = s(i)), o;
6176
+ return Vc(i, e) && (o = Object.assign({}, i), r || delete o[e], o[t] = s(i)), o;
6177
6177
  });
6178
6178
  }
6179
6179
  /** Parse an input JSON string to an object */
6180
6180
  json() {
6181
- return this.transform(ui);
6181
+ return this.transform(li);
6182
6182
  }
6183
6183
  noUnknown(e = !0, t = dn.noUnknown) {
6184
6184
  typeof e != "boolean" && (t = e, e = !0);
@@ -6189,7 +6189,7 @@ class li extends te {
6189
6189
  test(s) {
6190
6190
  if (s == null)
6191
6191
  return !0;
6192
- const i = Vc(this.schema, s);
6192
+ const i = zc(this.schema, s);
6193
6193
  return !e || i.length === 0 || this.createError({
6194
6194
  params: {
6195
6195
  unknown: i.join(", ")
@@ -6235,11 +6235,11 @@ class li extends te {
6235
6235
  return t;
6236
6236
  }
6237
6237
  }
6238
- oe.prototype = li.prototype;
6238
+ K.prototype = hi.prototype;
6239
6239
  function ut(n) {
6240
- return new hi(n);
6240
+ return new fi(n);
6241
6241
  }
6242
- class hi extends te {
6242
+ class fi extends re {
6243
6243
  constructor(e) {
6244
6244
  super({
6245
6245
  type: "array",
@@ -6295,7 +6295,7 @@ class hi extends te {
6295
6295
  }
6296
6296
  /** Parse an input JSON string to an object */
6297
6297
  json() {
6298
- return this.transform(ui);
6298
+ return this.transform(li);
6299
6299
  }
6300
6300
  concat(e) {
6301
6301
  let t = super.concat(e);
@@ -6373,71 +6373,92 @@ class hi extends te {
6373
6373
  return t;
6374
6374
  }
6375
6375
  }
6376
- ut.prototype = hi.prototype;
6377
- const ds = oe({
6378
- url: O(),
6376
+ ut.prototype = fi.prototype;
6377
+ const ps = K({
6378
+ url: T(),
6379
6379
  height: q(),
6380
6380
  width: q()
6381
- }), qc = oe({
6382
- type: O().default("rich"),
6383
- title: O(),
6381
+ }), Gc = K({
6382
+ type: T().default("rich"),
6383
+ title: T(),
6384
6384
  color: q(),
6385
- thumbnail: ds,
6386
- image: ds,
6387
- url: O()
6388
- }), Gc = oe({
6389
- url: O().url().required(),
6390
- username: O(),
6391
- avatar_url: O().url(),
6392
- message: O().required(),
6393
- embed: qc
6394
- }), Jc = "notify_discord_webhook";
6385
+ thumbnail: ps,
6386
+ image: ps,
6387
+ url: T()
6388
+ }), Jc = K({
6389
+ url: T().url().required(),
6390
+ username: T(),
6391
+ avatar_url: T().url(),
6392
+ message: T().required(),
6393
+ embed: Gc
6394
+ }), Wc = "notify_discord_webhook";
6395
6395
  class Dn {
6396
6396
  static async SimpleToRaw(e) {
6397
6397
  return {
6398
6398
  name: "",
6399
6399
  // deprecated
6400
- notify_type: Jc,
6400
+ notify_type: Wc,
6401
6401
  notify: await Dn.validateCreate(e)
6402
6402
  };
6403
6403
  }
6404
6404
  static validateCreate(e) {
6405
- return Gc.validate(e);
6405
+ return Jc.validate(e);
6406
6406
  }
6407
6407
  }
6408
- const Wc = oe({
6409
- email: O().required(),
6410
- subject: O(),
6411
- html: O().required()
6412
- }), Kc = "notify_email";
6408
+ const Kc = K({
6409
+ email: T().required(),
6410
+ subject: T(),
6411
+ html: T().required()
6412
+ }), Xc = "notify_email";
6413
6413
  class Un {
6414
6414
  static async SimpleToRaw(e) {
6415
6415
  return {
6416
6416
  name: "",
6417
6417
  // deprecated
6418
- notify_type: Kc,
6418
+ notify_type: Xc,
6419
6419
  notify: await Un.validateCreate(e)
6420
6420
  };
6421
6421
  }
6422
6422
  static async validateCreate(e) {
6423
- return Wc.validate(e);
6423
+ return Kc.validate(e);
6424
6424
  }
6425
6425
  }
6426
- const Xc = oe({
6426
+ const Zc = K({
6427
6427
  clientId: q().required(),
6428
- content: O().required()
6429
- }), Zc = "notify_telegram";
6428
+ content: T().required()
6429
+ }), Yc = "notify_telegram";
6430
6430
  class jn {
6431
6431
  static async SimpleToRaw(e) {
6432
6432
  return {
6433
6433
  name: "",
6434
6434
  // deprecated
6435
- notify_type: Zc,
6435
+ notify_type: Yc,
6436
6436
  notify: await jn.validateCreate(e)
6437
6437
  };
6438
6438
  }
6439
6439
  static validateCreate(e) {
6440
- return Xc.validate(e);
6440
+ return Zc.validate(e);
6441
+ }
6442
+ }
6443
+ const Qc = K({
6444
+ url: T().required(),
6445
+ params: K().nullable().default(null),
6446
+ pathname: T().nullable().default(null),
6447
+ access_token: T().nullable().default(null),
6448
+ headers: K().nullable().default(null),
6449
+ method: T().oneOf(["get", "post", "put", "delete", "patch"]).default("post")
6450
+ }), eu = "notify_webhook";
6451
+ class Ln {
6452
+ static async SimpleToRaw(e) {
6453
+ return {
6454
+ name: "",
6455
+ // deprecated
6456
+ notify_type: eu,
6457
+ notify: await Ln.validateCreate(e)
6458
+ };
6459
+ }
6460
+ static async validateCreate(e) {
6461
+ return Qc.validate(e);
6441
6462
  }
6442
6463
  }
6443
6464
  class Qr {
@@ -6449,6 +6470,8 @@ class Qr {
6449
6470
  return jn.SimpleToRaw(t);
6450
6471
  case "Email":
6451
6472
  return Un.SimpleToRaw(t);
6473
+ case "Webhook":
6474
+ return Ln.SimpleToRaw(t);
6452
6475
  }
6453
6476
  }
6454
6477
  static RawToSimple(e) {
@@ -6467,6 +6490,8 @@ class Qr {
6467
6490
  return "Telegram";
6468
6491
  case "notify_email":
6469
6492
  return "Email";
6493
+ case "notify_webhook":
6494
+ return "Webhook";
6470
6495
  }
6471
6496
  }
6472
6497
  static SimpleTypeToRawType(e) {
@@ -6477,55 +6502,57 @@ class Qr {
6477
6502
  return "notify_telegram";
6478
6503
  case "Email":
6479
6504
  return "notify_email";
6505
+ case "Webhook":
6506
+ return "notify_webhook";
6480
6507
  }
6481
6508
  }
6482
6509
  }
6483
- const Yc = "handler_function_call";
6484
- class ps {
6510
+ const tu = "handler_function_call";
6511
+ class ys {
6485
6512
  static async SimpleToRaw(e, t, r) {
6486
6513
  return {
6487
6514
  alertType: "event",
6488
6515
  // doesn't matter, deprecated
6489
6516
  network: t,
6490
6517
  nickname: e,
6491
- type: Yc,
6518
+ type: tu,
6492
6519
  handler: await this.validate(r)
6493
6520
  };
6494
6521
  }
6495
6522
  static validate(e) {
6496
6523
  const t = ([s], i) => s === "true" ? i.notRequired() : i.required();
6497
- return oe({
6498
- address: O().required(),
6524
+ return K({
6525
+ address: T().required(),
6499
6526
  abi: ut().required(),
6500
6527
  nBlocks: q().default(100).min(10).required(),
6501
- function: O().required(),
6502
- condition: O().default("true").oneOf([">", ">=", "<", "<=", "=", "true"]).required(),
6528
+ function: T().required(),
6529
+ condition: T().default("true").oneOf([">", ">=", "<", "<=", "=", "true"]).required(),
6503
6530
  constant: q().min(0).when("condition", t),
6504
6531
  responseArgIndex: q().min(0).when("condition", t),
6505
6532
  responseArgDecimals: q().min(0).when("condition", t)
6506
6533
  }).validateSync(e);
6507
6534
  }
6508
6535
  }
6509
- const Qc = "handler_onchain_event";
6510
- class ys {
6536
+ const ru = "handler_onchain_event";
6537
+ class ms {
6511
6538
  static async SimpleToRaw(e, t, r) {
6512
6539
  return {
6513
6540
  alertType: "event",
6514
6541
  // doesn't matter, deprecated
6515
6542
  network: t,
6516
6543
  nickname: e,
6517
- type: Qc,
6544
+ type: ru,
6518
6545
  handler: await this.validate(r)
6519
6546
  };
6520
6547
  }
6521
6548
  static validate(e) {
6522
6549
  const t = ([s], i) => s === "true" ? i.notRequired() : i.required();
6523
- return oe({
6524
- address: O().required(),
6525
- event: O().required(),
6550
+ return K({
6551
+ address: T().required(),
6552
+ event: T().required(),
6526
6553
  // TODO check event is in abi
6527
6554
  abi: ut().required(),
6528
- condition: O().default("true").oneOf([">", ">=", "<", "<=", "=", "true"]).required(),
6555
+ condition: T().default("true").oneOf([">", ">=", "<", "<=", "=", "true"]).required(),
6529
6556
  constant: q().min(0).when("condition", t),
6530
6557
  paramsIndex: q().min(0).when("condition", t),
6531
6558
  // TODO check paramsIndex exists in ABI
@@ -6533,8 +6560,8 @@ class ys {
6533
6560
  }).validateSync(e);
6534
6561
  }
6535
6562
  }
6536
- const eu = "6.1.0";
6537
- function tu(n, e, t) {
6563
+ const nu = "6.1.0";
6564
+ function su(n, e, t) {
6538
6565
  const r = e.split("|").map((i) => i.trim());
6539
6566
  for (let i = 0; i < r.length; i++)
6540
6567
  switch (e) {
@@ -6550,7 +6577,7 @@ function tu(n, e, t) {
6550
6577
  const s = new Error(`invalid value for type ${e}`);
6551
6578
  throw s.code = "INVALID_ARGUMENT", s.argument = `value.${t}`, s.value = n, s;
6552
6579
  }
6553
- async function fi(n) {
6580
+ async function di(n) {
6554
6581
  const e = Object.keys(n);
6555
6582
  return (await Promise.all(e.map((r) => Promise.resolve(n[r])))).reduce((r, s, i) => (r[e[i]] = s, r), {});
6556
6583
  }
@@ -6558,7 +6585,7 @@ function S(n, e, t) {
6558
6585
  for (let r in e) {
6559
6586
  let s = e[r];
6560
6587
  const i = t ? t[r] : null;
6561
- i && tu(s, i, r), Object.defineProperty(n, r, { enumerable: !0, value: s, writable: !1 });
6588
+ i && su(s, i, r), Object.defineProperty(n, r, { enumerable: !0, value: s, writable: !1 });
6562
6589
  }
6563
6590
  }
6564
6591
  function Ot(n) {
@@ -6595,7 +6622,7 @@ function Ot(n) {
6595
6622
  function vr(n, e) {
6596
6623
  return n && n.code === e;
6597
6624
  }
6598
- function di(n) {
6625
+ function pi(n) {
6599
6626
  return vr(n, "CALL_EXCEPTION");
6600
6627
  }
6601
6628
  function Dr(n, e, t) {
@@ -6609,7 +6636,7 @@ function Dr(n, e, t) {
6609
6636
  s.push(i + "=" + Ot(o));
6610
6637
  }
6611
6638
  }
6612
- s.push(`code=${e}`), s.push(`version=${eu}`), s.length && (n += " (" + s.join(", ") + ")");
6639
+ s.push(`code=${e}`), s.push(`version=${nu}`), s.length && (n += " (" + s.join(", ") + ")");
6613
6640
  }
6614
6641
  let r;
6615
6642
  switch (e) {
@@ -6632,7 +6659,7 @@ function x(n, e, t, r) {
6632
6659
  function _(n, e, t, r) {
6633
6660
  x(n, e, "INVALID_ARGUMENT", { argument: t, value: r });
6634
6661
  }
6635
- function pi(n, e, t) {
6662
+ function yi(n, e, t) {
6636
6663
  t == null && (t = ""), t && (t = ": " + t), x(n >= e, "missing arguemnt" + t, "MISSING_ARGUMENT", {
6637
6664
  count: n,
6638
6665
  expectedCount: e
@@ -6641,7 +6668,7 @@ function pi(n, e, t) {
6641
6668
  expectedCount: e
6642
6669
  });
6643
6670
  }
6644
- const ru = ["NFD", "NFC", "NFKD", "NFKC"].reduce((n, e) => {
6671
+ const iu = ["NFD", "NFC", "NFKD", "NFKC"].reduce((n, e) => {
6645
6672
  try {
6646
6673
  if ("test".normalize(e) !== "test")
6647
6674
  throw new Error("bad");
@@ -6655,13 +6682,13 @@ const ru = ["NFD", "NFC", "NFKD", "NFKC"].reduce((n, e) => {
6655
6682
  }
6656
6683
  return n;
6657
6684
  }, []);
6658
- function nu(n) {
6659
- x(ru.indexOf(n) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", {
6685
+ function ou(n) {
6686
+ x(iu.indexOf(n) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", {
6660
6687
  operation: "String.prototype.normalize",
6661
6688
  info: { form: n }
6662
6689
  });
6663
6690
  }
6664
- function Ln(n, e, t) {
6691
+ function Bn(n, e, t) {
6665
6692
  if (t == null && (t = ""), n !== e) {
6666
6693
  let r = t, s = "new";
6667
6694
  t && (r += ".", s += " " + t), x(!1, `private constructor; use ${r}from* methods`, "UNSUPPORTED_OPERATION", {
@@ -6669,7 +6696,7 @@ function Ln(n, e, t) {
6669
6696
  });
6670
6697
  }
6671
6698
  }
6672
- function yi(n, e, t) {
6699
+ function mi(n, e, t) {
6673
6700
  if (n instanceof Uint8Array)
6674
6701
  return t ? new Uint8Array(n) : n;
6675
6702
  if (typeof n == "string" && n.match(/^0x([0-9a-f][0-9a-f])*$/i)) {
@@ -6682,21 +6709,21 @@ function yi(n, e, t) {
6682
6709
  _(!1, "invalid BytesLike value", e || "value", n);
6683
6710
  }
6684
6711
  function Ue(n, e) {
6685
- return yi(n, e, !1);
6712
+ return mi(n, e, !1);
6686
6713
  }
6687
6714
  function Fe(n, e) {
6688
- return yi(n, e, !0);
6715
+ return mi(n, e, !0);
6689
6716
  }
6690
6717
  function Ge(n, e) {
6691
6718
  return !(typeof n != "string" || !n.match(/^0x[0-9A-Fa-f]*$/) || typeof e == "number" && n.length !== 2 + 2 * e || e === !0 && n.length % 2 !== 0);
6692
6719
  }
6693
- const ms = "0123456789abcdef";
6720
+ const gs = "0123456789abcdef";
6694
6721
  function H(n) {
6695
6722
  const e = Ue(n);
6696
6723
  let t = "0x";
6697
6724
  for (let r = 0; r < e.length; r++) {
6698
6725
  const s = e[r];
6699
- t += ms[(s & 240) >> 4] + ms[s & 15];
6726
+ t += gs[(s & 240) >> 4] + gs[s & 15];
6700
6727
  }
6701
6728
  return t;
6702
6729
  }
@@ -6711,7 +6738,7 @@ function vt(n, e, t) {
6711
6738
  offset: t
6712
6739
  }), H(r.slice(e ?? 0, t ?? r.length));
6713
6740
  }
6714
- function su(n, e, t) {
6741
+ function au(n, e, t) {
6715
6742
  const r = Ue(n);
6716
6743
  x(e >= r.length, "padding exceeds data length", "BUFFER_OVERRUN", {
6717
6744
  buffer: new Uint8Array(r),
@@ -6721,11 +6748,11 @@ function su(n, e, t) {
6721
6748
  const s = new Uint8Array(e);
6722
6749
  return s.fill(0), t ? s.set(r, e - r.length) : s.set(r, 0), H(s);
6723
6750
  }
6724
- function iu(n, e) {
6725
- return su(n, e, !0);
6751
+ function cu(n, e) {
6752
+ return au(n, e, !0);
6726
6753
  }
6727
6754
  const Ur = BigInt(0), me = BigInt(1), kt = 9007199254740991;
6728
- function ou(n, e) {
6755
+ function uu(n, e) {
6729
6756
  const t = jr(n, "value"), r = BigInt(Le(e, "width"));
6730
6757
  if (x(t >> r === Ur, "overflow", "NUMERIC_FAULT", {
6731
6758
  operation: "fromTwos",
@@ -6737,7 +6764,7 @@ function ou(n, e) {
6737
6764
  }
6738
6765
  return t;
6739
6766
  }
6740
- function au(n, e) {
6767
+ function lu(n, e) {
6741
6768
  let t = mt(n, "value");
6742
6769
  const r = BigInt(Le(e, "width")), s = me << r - me;
6743
6770
  if (t < Ur) {
@@ -6785,12 +6812,12 @@ function jr(n, e) {
6785
6812
  value: n
6786
6813
  }), t;
6787
6814
  }
6788
- const gs = "0123456789abcdef";
6789
- function mi(n) {
6815
+ const ws = "0123456789abcdef";
6816
+ function gi(n) {
6790
6817
  if (n instanceof Uint8Array) {
6791
6818
  let e = "0x0";
6792
6819
  for (const t of n)
6793
- e += gs[t >> 4], e += gs[t & 15];
6820
+ e += ws[t >> 4], e += ws[t & 15];
6794
6821
  return BigInt(e);
6795
6822
  }
6796
6823
  return mt(n);
@@ -6812,10 +6839,10 @@ function Le(n, e) {
6812
6839
  }
6813
6840
  _(!1, "invalid numeric value", e || "value", n);
6814
6841
  }
6815
- function cu(n) {
6816
- return Le(mi(n));
6842
+ function hu(n) {
6843
+ return Le(gi(n));
6817
6844
  }
6818
- function gi(n, e) {
6845
+ function wi(n, e) {
6819
6846
  let r = jr(n, "value").toString(16);
6820
6847
  if (e == null)
6821
6848
  r.length % 2 && (r = "0" + r);
@@ -6830,7 +6857,7 @@ function gi(n, e) {
6830
6857
  }
6831
6858
  return "0x" + r;
6832
6859
  }
6833
- function uu(n) {
6860
+ function fu(n) {
6834
6861
  const e = jr(n, "value");
6835
6862
  if (e === Ur)
6836
6863
  return new Uint8Array([]);
@@ -6844,7 +6871,7 @@ function uu(n) {
6844
6871
  return r;
6845
6872
  }
6846
6873
  var Rt;
6847
- class lu {
6874
+ class du {
6848
6875
  /**
6849
6876
  * Create a new **EventPayload** for %%emitter%% with
6850
6877
  * the %%listener%% and for %%filter%%.
@@ -6869,10 +6896,10 @@ class lu {
6869
6896
  }
6870
6897
  }
6871
6898
  Rt = new WeakMap();
6872
- function hu(n, e, t, r, s) {
6899
+ function pu(n, e, t, r, s) {
6873
6900
  _(!1, `invalid codepoint at offset ${e}; ${n}`, "bytes", t);
6874
6901
  }
6875
- function wi(n, e, t, r, s) {
6902
+ function bi(n, e, t, r, s) {
6876
6903
  if (n === "BAD_PREFIX" || n === "UNEXPECTED_CONTINUE") {
6877
6904
  let i = 0;
6878
6905
  for (let o = e + 1; o < t.length && t[o] >> 6 === 2; o++)
@@ -6881,16 +6908,16 @@ function wi(n, e, t, r, s) {
6881
6908
  }
6882
6909
  return n === "OVERRUN" ? t.length - e - 1 : 0;
6883
6910
  }
6884
- function fu(n, e, t, r, s) {
6885
- return n === "OVERLONG" ? (_(typeof s == "number", "invalid bad code point for replacement", "badCodepoint", s), r.push(s), 0) : (r.push(65533), wi(n, e, t));
6911
+ function yu(n, e, t, r, s) {
6912
+ return n === "OVERLONG" ? (_(typeof s == "number", "invalid bad code point for replacement", "badCodepoint", s), r.push(s), 0) : (r.push(65533), bi(n, e, t));
6886
6913
  }
6887
- const du = Object.freeze({
6888
- error: hu,
6889
- ignore: wi,
6890
- replace: fu
6914
+ const mu = Object.freeze({
6915
+ error: pu,
6916
+ ignore: bi,
6917
+ replace: yu
6891
6918
  });
6892
- function pu(n, e) {
6893
- e == null && (e = du.error);
6919
+ function gu(n, e) {
6920
+ e == null && (e = mu.error);
6894
6921
  const t = Ue(n, "bytes"), r = [];
6895
6922
  let s = 0;
6896
6923
  for (; s < t.length; ) {
@@ -6941,8 +6968,8 @@ function pu(n, e) {
6941
6968
  }
6942
6969
  return r;
6943
6970
  }
6944
- function bi(n, e) {
6945
- e != null && (nu(e), n = n.normalize(e));
6971
+ function vi(n, e) {
6972
+ e != null && (ou(e), n = n.normalize(e));
6946
6973
  let t = [];
6947
6974
  for (let r = 0; r < n.length; r++) {
6948
6975
  const s = n.charCodeAt(r);
@@ -6961,13 +6988,13 @@ function bi(n, e) {
6961
6988
  }
6962
6989
  return new Uint8Array(t);
6963
6990
  }
6964
- function yu(n) {
6991
+ function wu(n) {
6965
6992
  return n.map((e) => e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10 & 1023) + 55296, (e & 1023) + 56320))).join("");
6966
6993
  }
6967
- function mu(n, e) {
6968
- return yu(pu(n, e));
6994
+ function bu(n, e) {
6995
+ return wu(gu(n, e));
6969
6996
  }
6970
- const Z = 32, pn = new Uint8Array(Z), gu = ["then"], ur = {};
6997
+ const Y = 32, pn = new Uint8Array(Y), vu = ["then"], ur = {};
6971
6998
  function lr(n, e) {
6972
6999
  const t = new Error(`deferred error during ABI decoding triggered accessing ${n}`);
6973
7000
  throw t.error = e, t;
@@ -7001,7 +7028,7 @@ const zt = class extends Array {
7001
7028
  const p = c[y];
7002
7029
  return p instanceof Error && lr(`index ${y}`, p), p;
7003
7030
  }
7004
- if (gu.indexOf(u) >= 0)
7031
+ if (vu.indexOf(u) >= 0)
7005
7032
  return Reflect.get(c, u, l);
7006
7033
  const h = c[u];
7007
7034
  if (h instanceof Function)
@@ -7084,9 +7111,9 @@ const zt = class extends Array {
7084
7111
  };
7085
7112
  let _r = zt;
7086
7113
  Ve = new WeakMap();
7087
- function ws(n) {
7088
- let e = uu(n);
7089
- return x(e.length <= Z, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: e, length: Z, offset: e.length }), e.length !== Z && (e = Fe(St([pn.slice(e.length % Z), e]))), e;
7114
+ function bs(n) {
7115
+ let e = fu(n);
7116
+ return x(e.length <= Y, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: e, length: Y, offset: e.length }), e.length !== Y && (e = Fe(St([pn.slice(e.length % Y), e]))), e;
7090
7117
  }
7091
7118
  class Be {
7092
7119
  constructor(e, t, r, s) {
@@ -7135,27 +7162,27 @@ class yn {
7135
7162
  // Arrayish item; pad on the right to *nearest* WordSize
7136
7163
  writeBytes(e) {
7137
7164
  let t = Fe(e);
7138
- const r = t.length % Z;
7165
+ const r = t.length % Y;
7139
7166
  return r && (t = Fe(St([t, pn.slice(r)]))), B(this, $t, yr).call(this, t);
7140
7167
  }
7141
7168
  // Numeric item; pad on the left *to* WordSize
7142
7169
  writeValue(e) {
7143
- return B(this, $t, yr).call(this, ws(e));
7170
+ return B(this, $t, yr).call(this, bs(e));
7144
7171
  }
7145
7172
  // Inserts a numeric place-holder, returning a callback that can
7146
7173
  // be used to asjust the value later
7147
7174
  writeUpdatableValue() {
7148
7175
  const e = m(this, Ie).length;
7149
- return m(this, Ie).push(pn), P(this, st, m(this, st) + Z), (t) => {
7150
- m(this, Ie)[e] = ws(t);
7176
+ return m(this, Ie).push(pn), P(this, st, m(this, st) + Y), (t) => {
7177
+ m(this, Ie)[e] = bs(t);
7151
7178
  };
7152
7179
  }
7153
7180
  }
7154
7181
  Ie = new WeakMap(), st = new WeakMap(), $t = new WeakSet(), yr = function(e) {
7155
7182
  return m(this, Ie).push(e), P(this, st, m(this, st) + e.length), e.length;
7156
7183
  };
7157
- var se, le, Tr, vi;
7158
- const Wn = class {
7184
+ var ie, le, Tr, _i;
7185
+ const Kn = class {
7159
7186
  constructor(e, t) {
7160
7187
  F(this, Tr);
7161
7188
  // Allows incomplete unpadded data to be read; otherwise an error
@@ -7163,178 +7190,178 @@ const Wn = class {
7163
7190
  // to deal with an old Solidity bug, in which event data for
7164
7191
  // external (not public thoguh) was tightly packed.
7165
7192
  d(this, "allowLoose");
7166
- F(this, se, void 0);
7193
+ F(this, ie, void 0);
7167
7194
  F(this, le, void 0);
7168
- S(this, { allowLoose: !!t }), P(this, se, Fe(e)), P(this, le, 0);
7195
+ S(this, { allowLoose: !!t }), P(this, ie, Fe(e)), P(this, le, 0);
7169
7196
  }
7170
7197
  get data() {
7171
- return H(m(this, se));
7198
+ return H(m(this, ie));
7172
7199
  }
7173
7200
  get dataLength() {
7174
- return m(this, se).length;
7201
+ return m(this, ie).length;
7175
7202
  }
7176
7203
  get consumed() {
7177
7204
  return m(this, le);
7178
7205
  }
7179
7206
  get bytes() {
7180
- return new Uint8Array(m(this, se));
7207
+ return new Uint8Array(m(this, ie));
7181
7208
  }
7182
7209
  // Create a sub-reader with the same underlying data, but offset
7183
7210
  subReader(e) {
7184
- return new Wn(m(this, se).slice(m(this, le) + e), this.allowLoose);
7211
+ return new Kn(m(this, ie).slice(m(this, le) + e), this.allowLoose);
7185
7212
  }
7186
7213
  // Read bytes
7187
7214
  readBytes(e, t) {
7188
- let r = B(this, Tr, vi).call(this, 0, e, !!t);
7215
+ let r = B(this, Tr, _i).call(this, 0, e, !!t);
7189
7216
  return P(this, le, m(this, le) + r.length), r.slice(0, e);
7190
7217
  }
7191
7218
  // Read a numeric values
7192
7219
  readValue() {
7193
- return mi(this.readBytes(Z));
7220
+ return gi(this.readBytes(Y));
7194
7221
  }
7195
7222
  readIndex() {
7196
- return cu(this.readBytes(Z));
7223
+ return hu(this.readBytes(Y));
7197
7224
  }
7198
7225
  };
7199
- let mn = Wn;
7200
- se = new WeakMap(), le = new WeakMap(), Tr = new WeakSet(), vi = function(e, t, r) {
7201
- let s = Math.ceil(t / Z) * Z;
7202
- return m(this, le) + s > m(this, se).length && (this.allowLoose && r && m(this, le) + t <= m(this, se).length ? s = t : x(!1, "data out-of-bounds", "BUFFER_OVERRUN", {
7203
- buffer: Fe(m(this, se)),
7204
- length: m(this, se).length,
7226
+ let mn = Kn;
7227
+ ie = new WeakMap(), le = new WeakMap(), Tr = new WeakSet(), _i = function(e, t, r) {
7228
+ let s = Math.ceil(t / Y) * Y;
7229
+ return m(this, le) + s > m(this, ie).length && (this.allowLoose && r && m(this, le) + t <= m(this, ie).length ? s = t : x(!1, "data out-of-bounds", "BUFFER_OVERRUN", {
7230
+ buffer: Fe(m(this, ie)),
7231
+ length: m(this, ie).length,
7205
7232
  offset: m(this, le) + s
7206
- })), m(this, se).slice(m(this, le), m(this, le) + s);
7233
+ })), m(this, ie).slice(m(this, le), m(this, le) + s);
7207
7234
  };
7208
7235
  function gn(n) {
7209
7236
  if (!Number.isSafeInteger(n) || n < 0)
7210
7237
  throw new Error(`Wrong positive integer: ${n}`);
7211
7238
  }
7212
- function wu(n) {
7239
+ function _u(n) {
7213
7240
  if (typeof n != "boolean")
7214
7241
  throw new Error(`Expected boolean, not ${n}`);
7215
7242
  }
7216
- function _i(n, ...e) {
7243
+ function Ei(n, ...e) {
7217
7244
  if (!(n instanceof Uint8Array))
7218
7245
  throw new TypeError("Expected Uint8Array");
7219
7246
  if (e.length > 0 && !e.includes(n.length))
7220
7247
  throw new TypeError(`Expected Uint8Array of length ${e}, not of length=${n.length}`);
7221
7248
  }
7222
- function bu(n) {
7249
+ function Eu(n) {
7223
7250
  if (typeof n != "function" || typeof n.create != "function")
7224
7251
  throw new Error("Hash should be wrapped by utils.wrapConstructor");
7225
7252
  gn(n.outputLen), gn(n.blockLen);
7226
7253
  }
7227
- function vu(n, e = !0) {
7254
+ function xu(n, e = !0) {
7228
7255
  if (n.destroyed)
7229
7256
  throw new Error("Hash instance has been destroyed");
7230
7257
  if (e && n.finished)
7231
7258
  throw new Error("Hash#digest() has already been called");
7232
7259
  }
7233
- function _u(n, e) {
7234
- _i(n);
7260
+ function Tu(n, e) {
7261
+ Ei(n);
7235
7262
  const t = e.outputLen;
7236
7263
  if (n.length < t)
7237
7264
  throw new Error(`digestInto() expects output buffer of length at least ${t}`);
7238
7265
  }
7239
7266
  const _t = {
7240
7267
  number: gn,
7241
- bool: wu,
7242
- bytes: _i,
7243
- hash: bu,
7244
- exists: vu,
7245
- output: _u
7268
+ bool: _u,
7269
+ bytes: Ei,
7270
+ hash: Eu,
7271
+ exists: xu,
7272
+ output: Tu
7246
7273
  };
7247
7274
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
7248
- const Eu = (n) => new Uint32Array(n.buffer, n.byteOffset, Math.floor(n.byteLength / 4)), xu = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
7249
- if (!xu)
7275
+ const Ou = (n) => new Uint32Array(n.buffer, n.byteOffset, Math.floor(n.byteLength / 4)), ku = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
7276
+ if (!ku)
7250
7277
  throw new Error("Non little-endian hardware is not supported");
7251
7278
  Array.from({ length: 256 }, (n, e) => e.toString(16).padStart(2, "0"));
7252
- function Tu(n) {
7279
+ function Au(n) {
7253
7280
  if (typeof n != "string")
7254
7281
  throw new TypeError(`utf8ToBytes expected string, got ${typeof n}`);
7255
7282
  return new TextEncoder().encode(n);
7256
7283
  }
7257
- function Bn(n) {
7258
- if (typeof n == "string" && (n = Tu(n)), !(n instanceof Uint8Array))
7284
+ function Hn(n) {
7285
+ if (typeof n == "string" && (n = Au(n)), !(n instanceof Uint8Array))
7259
7286
  throw new TypeError(`Expected input type is Uint8Array (got ${typeof n})`);
7260
7287
  return n;
7261
7288
  }
7262
- class Ou {
7289
+ class Su {
7263
7290
  // Safe version that clones internal state
7264
7291
  clone() {
7265
7292
  return this._cloneInto();
7266
7293
  }
7267
7294
  }
7268
- function ku(n) {
7269
- const e = (r) => n().update(Bn(r)).digest(), t = n();
7295
+ function Ru(n) {
7296
+ const e = (r) => n().update(Hn(r)).digest(), t = n();
7270
7297
  return e.outputLen = t.outputLen, e.blockLen = t.blockLen, e.create = () => n(), e;
7271
7298
  }
7272
- function Au(n) {
7273
- const e = (r, s) => n(s).update(Bn(r)).digest(), t = n({});
7299
+ function $u(n) {
7300
+ const e = (r, s) => n(s).update(Hn(r)).digest(), t = n({});
7274
7301
  return e.outputLen = t.outputLen, e.blockLen = t.blockLen, e.create = (r) => n(r), e;
7275
7302
  }
7276
7303
  const hr = BigInt(2 ** 32 - 1), wn = BigInt(32);
7277
- function Ei(n, e = !1) {
7304
+ function xi(n, e = !1) {
7278
7305
  return e ? { h: Number(n & hr), l: Number(n >> wn & hr) } : { h: Number(n >> wn & hr) | 0, l: Number(n & hr) | 0 };
7279
7306
  }
7280
- function Su(n, e = !1) {
7307
+ function Pu(n, e = !1) {
7281
7308
  let t = new Uint32Array(n.length), r = new Uint32Array(n.length);
7282
7309
  for (let s = 0; s < n.length; s++) {
7283
- const { h: i, l: o } = Ei(n[s], e);
7310
+ const { h: i, l: o } = xi(n[s], e);
7284
7311
  [t[s], r[s]] = [i, o];
7285
7312
  }
7286
7313
  return [t, r];
7287
7314
  }
7288
- const Ru = (n, e) => BigInt(n >>> 0) << wn | BigInt(e >>> 0), $u = (n, e, t) => n >>> t, Pu = (n, e, t) => n << 32 - t | e >>> t, Nu = (n, e, t) => n >>> t | e << 32 - t, Iu = (n, e, t) => n << 32 - t | e >>> t, Cu = (n, e, t) => n << 64 - t | e >>> t - 32, Fu = (n, e, t) => n >>> t - 32 | e << 64 - t, Du = (n, e) => e, Uu = (n, e) => n, ju = (n, e, t) => n << t | e >>> 32 - t, Lu = (n, e, t) => e << t | n >>> 32 - t, Bu = (n, e, t) => e << t - 32 | n >>> 64 - t, Hu = (n, e, t) => n << t - 32 | e >>> 64 - t;
7289
- function Mu(n, e, t, r) {
7315
+ const Nu = (n, e) => BigInt(n >>> 0) << wn | BigInt(e >>> 0), Iu = (n, e, t) => n >>> t, Cu = (n, e, t) => n << 32 - t | e >>> t, Fu = (n, e, t) => n >>> t | e << 32 - t, Du = (n, e, t) => n << 32 - t | e >>> t, Uu = (n, e, t) => n << 64 - t | e >>> t - 32, ju = (n, e, t) => n >>> t - 32 | e << 64 - t, Lu = (n, e) => e, Bu = (n, e) => n, Hu = (n, e, t) => n << t | e >>> 32 - t, Mu = (n, e, t) => e << t | n >>> 32 - t, Vu = (n, e, t) => e << t - 32 | n >>> 64 - t, zu = (n, e, t) => n << t - 32 | e >>> 64 - t;
7316
+ function qu(n, e, t, r) {
7290
7317
  const s = (e >>> 0) + (r >>> 0);
7291
7318
  return { h: n + t + (s / 2 ** 32 | 0) | 0, l: s | 0 };
7292
7319
  }
7293
- const Vu = (n, e, t) => (n >>> 0) + (e >>> 0) + (t >>> 0), zu = (n, e, t, r) => e + t + r + (n / 2 ** 32 | 0) | 0, qu = (n, e, t, r) => (n >>> 0) + (e >>> 0) + (t >>> 0) + (r >>> 0), Gu = (n, e, t, r, s) => e + t + r + s + (n / 2 ** 32 | 0) | 0, Ju = (n, e, t, r, s) => (n >>> 0) + (e >>> 0) + (t >>> 0) + (r >>> 0) + (s >>> 0), Wu = (n, e, t, r, s, i) => e + t + r + s + i + (n / 2 ** 32 | 0) | 0, Gt = {
7294
- fromBig: Ei,
7295
- split: Su,
7296
- toBig: Ru,
7297
- shrSH: $u,
7298
- shrSL: Pu,
7299
- rotrSH: Nu,
7300
- rotrSL: Iu,
7301
- rotrBH: Cu,
7302
- rotrBL: Fu,
7303
- rotr32H: Du,
7304
- rotr32L: Uu,
7305
- rotlSH: ju,
7306
- rotlSL: Lu,
7307
- rotlBH: Bu,
7308
- rotlBL: Hu,
7309
- add: Mu,
7310
- add3L: Vu,
7311
- add3H: zu,
7312
- add4L: qu,
7313
- add4H: Gu,
7314
- add5H: Wu,
7315
- add5L: Ju
7316
- }, [xi, Ti, Oi] = [[], [], []], Ku = BigInt(0), Lt = BigInt(1), Xu = BigInt(2), Zu = BigInt(7), Yu = BigInt(256), Qu = BigInt(113);
7320
+ const Gu = (n, e, t) => (n >>> 0) + (e >>> 0) + (t >>> 0), Ju = (n, e, t, r) => e + t + r + (n / 2 ** 32 | 0) | 0, Wu = (n, e, t, r) => (n >>> 0) + (e >>> 0) + (t >>> 0) + (r >>> 0), Ku = (n, e, t, r, s) => e + t + r + s + (n / 2 ** 32 | 0) | 0, Xu = (n, e, t, r, s) => (n >>> 0) + (e >>> 0) + (t >>> 0) + (r >>> 0) + (s >>> 0), Zu = (n, e, t, r, s, i) => e + t + r + s + i + (n / 2 ** 32 | 0) | 0, Gt = {
7321
+ fromBig: xi,
7322
+ split: Pu,
7323
+ toBig: Nu,
7324
+ shrSH: Iu,
7325
+ shrSL: Cu,
7326
+ rotrSH: Fu,
7327
+ rotrSL: Du,
7328
+ rotrBH: Uu,
7329
+ rotrBL: ju,
7330
+ rotr32H: Lu,
7331
+ rotr32L: Bu,
7332
+ rotlSH: Hu,
7333
+ rotlSL: Mu,
7334
+ rotlBH: Vu,
7335
+ rotlBL: zu,
7336
+ add: qu,
7337
+ add3L: Gu,
7338
+ add3H: Ju,
7339
+ add4L: Wu,
7340
+ add4H: Ku,
7341
+ add5H: Zu,
7342
+ add5L: Xu
7343
+ }, [Ti, Oi, ki] = [[], [], []], Yu = BigInt(0), Lt = BigInt(1), Qu = BigInt(2), el = BigInt(7), tl = BigInt(256), rl = BigInt(113);
7317
7344
  for (let n = 0, e = Lt, t = 1, r = 0; n < 24; n++) {
7318
- [t, r] = [r, (2 * t + 3 * r) % 5], xi.push(2 * (5 * r + t)), Ti.push((n + 1) * (n + 2) / 2 % 64);
7319
- let s = Ku;
7345
+ [t, r] = [r, (2 * t + 3 * r) % 5], Ti.push(2 * (5 * r + t)), Oi.push((n + 1) * (n + 2) / 2 % 64);
7346
+ let s = Yu;
7320
7347
  for (let i = 0; i < 7; i++)
7321
- e = (e << Lt ^ (e >> Zu) * Qu) % Yu, e & Xu && (s ^= Lt << (Lt << BigInt(i)) - Lt);
7322
- Oi.push(s);
7348
+ e = (e << Lt ^ (e >> el) * rl) % tl, e & Qu && (s ^= Lt << (Lt << BigInt(i)) - Lt);
7349
+ ki.push(s);
7323
7350
  }
7324
- const [el, tl] = Gt.split(Oi, !0), bs = (n, e, t) => t > 32 ? Gt.rotlBH(n, e, t) : Gt.rotlSH(n, e, t), vs = (n, e, t) => t > 32 ? Gt.rotlBL(n, e, t) : Gt.rotlSL(n, e, t);
7325
- function rl(n, e = 24) {
7351
+ const [nl, sl] = Gt.split(ki, !0), vs = (n, e, t) => t > 32 ? Gt.rotlBH(n, e, t) : Gt.rotlSH(n, e, t), _s = (n, e, t) => t > 32 ? Gt.rotlBL(n, e, t) : Gt.rotlSL(n, e, t);
7352
+ function il(n, e = 24) {
7326
7353
  const t = new Uint32Array(10);
7327
7354
  for (let r = 24 - e; r < 24; r++) {
7328
7355
  for (let o = 0; o < 10; o++)
7329
7356
  t[o] = n[o] ^ n[o + 10] ^ n[o + 20] ^ n[o + 30] ^ n[o + 40];
7330
7357
  for (let o = 0; o < 10; o += 2) {
7331
- const a = (o + 8) % 10, c = (o + 2) % 10, u = t[c], l = t[c + 1], h = bs(u, l, 1) ^ t[a], y = vs(u, l, 1) ^ t[a + 1];
7358
+ const a = (o + 8) % 10, c = (o + 2) % 10, u = t[c], l = t[c + 1], h = vs(u, l, 1) ^ t[a], y = _s(u, l, 1) ^ t[a + 1];
7332
7359
  for (let p = 0; p < 50; p += 10)
7333
7360
  n[o + p] ^= h, n[o + p + 1] ^= y;
7334
7361
  }
7335
7362
  let s = n[2], i = n[3];
7336
7363
  for (let o = 0; o < 24; o++) {
7337
- const a = Ti[o], c = bs(s, i, a), u = vs(s, i, a), l = xi[o];
7364
+ const a = Oi[o], c = vs(s, i, a), u = _s(s, i, a), l = Ti[o];
7338
7365
  s = n[l], i = n[l + 1], n[l] = c, n[l + 1] = u;
7339
7366
  }
7340
7367
  for (let o = 0; o < 50; o += 10) {
@@ -7343,24 +7370,24 @@ function rl(n, e = 24) {
7343
7370
  for (let a = 0; a < 10; a++)
7344
7371
  n[o + a] ^= ~t[(a + 2) % 10] & t[(a + 4) % 10];
7345
7372
  }
7346
- n[0] ^= el[r], n[1] ^= tl[r];
7373
+ n[0] ^= nl[r], n[1] ^= sl[r];
7347
7374
  }
7348
7375
  t.fill(0);
7349
7376
  }
7350
- class Lr extends Ou {
7377
+ class Lr extends Su {
7351
7378
  // NOTE: we accept arguments in bytes instead of bits here.
7352
7379
  constructor(e, t, r, s = !1, i = 24) {
7353
7380
  if (super(), this.blockLen = e, this.suffix = t, this.outputLen = r, this.enableXOF = s, this.rounds = i, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, _t.number(r), 0 >= this.blockLen || this.blockLen >= 200)
7354
7381
  throw new Error("Sha3 supports only keccak-f1600 function");
7355
- this.state = new Uint8Array(200), this.state32 = Eu(this.state);
7382
+ this.state = new Uint8Array(200), this.state32 = Ou(this.state);
7356
7383
  }
7357
7384
  keccak() {
7358
- rl(this.state32, this.rounds), this.posOut = 0, this.pos = 0;
7385
+ il(this.state32, this.rounds), this.posOut = 0, this.pos = 0;
7359
7386
  }
7360
7387
  update(e) {
7361
7388
  _t.exists(this);
7362
7389
  const { blockLen: t, state: r } = this;
7363
- e = Bn(e);
7390
+ e = Hn(e);
7364
7391
  const s = e.length;
7365
7392
  for (let i = 0; i < s; ) {
7366
7393
  const o = Math.min(t - this.pos, s - i);
@@ -7411,39 +7438,39 @@ class Lr extends Ou {
7411
7438
  return e || (e = new Lr(t, r, s, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = r, e.outputLen = s, e.enableXOF = o, e.destroyed = this.destroyed, e;
7412
7439
  }
7413
7440
  }
7414
- const We = (n, e, t) => ku(() => new Lr(e, n, t));
7441
+ const We = (n, e, t) => Ru(() => new Lr(e, n, t));
7415
7442
  We(6, 144, 224 / 8);
7416
7443
  We(6, 136, 256 / 8);
7417
7444
  We(6, 104, 384 / 8);
7418
7445
  We(6, 72, 512 / 8);
7419
7446
  We(1, 144, 224 / 8);
7420
- const nl = We(1, 136, 256 / 8);
7447
+ const ol = We(1, 136, 256 / 8);
7421
7448
  We(1, 104, 384 / 8);
7422
7449
  We(1, 72, 512 / 8);
7423
- const ki = (n, e, t) => Au((r = {}) => new Lr(e, n, r.dkLen === void 0 ? t : r.dkLen, !0));
7424
- ki(31, 168, 128 / 8);
7425
- ki(31, 136, 256 / 8);
7426
- let Ai = !1;
7427
- const Si = function(n) {
7428
- return nl(n);
7450
+ const Ai = (n, e, t) => $u((r = {}) => new Lr(e, n, r.dkLen === void 0 ? t : r.dkLen, !0));
7451
+ Ai(31, 168, 128 / 8);
7452
+ Ai(31, 136, 256 / 8);
7453
+ let Si = !1;
7454
+ const Ri = function(n) {
7455
+ return ol(n);
7429
7456
  };
7430
- let Ri = Si;
7457
+ let $i = Ri;
7431
7458
  function Je(n) {
7432
7459
  const e = Ue(n, "data");
7433
- return H(Ri(e));
7460
+ return H($i(e));
7434
7461
  }
7435
- Je._ = Si;
7462
+ Je._ = Ri;
7436
7463
  Je.lock = function() {
7437
- Ai = !0;
7464
+ Si = !0;
7438
7465
  };
7439
7466
  Je.register = function(n) {
7440
- if (Ai)
7467
+ if (Si)
7441
7468
  throw new TypeError("keccak256 is locked");
7442
- Ri = n;
7469
+ $i = n;
7443
7470
  };
7444
7471
  Object.freeze(Je);
7445
- const sl = BigInt(0), il = BigInt(36);
7446
- function _s(n) {
7472
+ const al = BigInt(0), cl = BigInt(36);
7473
+ function Es(n) {
7447
7474
  n = n.toLowerCase();
7448
7475
  const e = n.substring(2).split(""), t = new Uint8Array(40);
7449
7476
  for (let s = 0; s < 40; s++)
@@ -7453,17 +7480,17 @@ function _s(n) {
7453
7480
  r[s >> 1] >> 4 >= 8 && (e[s] = e[s].toUpperCase()), (r[s >> 1] & 15) >= 8 && (e[s + 1] = e[s + 1].toUpperCase());
7454
7481
  return "0x" + e.join("");
7455
7482
  }
7456
- const Hn = {};
7483
+ const Mn = {};
7457
7484
  for (let n = 0; n < 10; n++)
7458
- Hn[String(n)] = String(n);
7485
+ Mn[String(n)] = String(n);
7459
7486
  for (let n = 0; n < 26; n++)
7460
- Hn[String.fromCharCode(65 + n)] = String(10 + n);
7461
- const Es = 15;
7462
- function ol(n) {
7487
+ Mn[String.fromCharCode(65 + n)] = String(10 + n);
7488
+ const xs = 15;
7489
+ function ul(n) {
7463
7490
  n = n.toUpperCase(), n = n.substring(4) + n.substring(0, 2) + "00";
7464
- let e = n.split("").map((r) => Hn[r]).join("");
7465
- for (; e.length >= Es; ) {
7466
- let r = e.substring(0, Es);
7491
+ let e = n.split("").map((r) => Mn[r]).join("");
7492
+ for (; e.length >= xs; ) {
7493
+ let r = e.substring(0, xs);
7467
7494
  e = parseInt(r, 10) % 97 + e.substring(r.length);
7468
7495
  }
7469
7496
  let t = String(98 - parseInt(e, 10) % 97);
@@ -7471,7 +7498,7 @@ function ol(n) {
7471
7498
  t = "0" + t;
7472
7499
  return t;
7473
7500
  }
7474
- const al = function() {
7501
+ const ll = function() {
7475
7502
  const n = {};
7476
7503
  for (let e = 0; e < 36; e++) {
7477
7504
  const t = "0123456789abcdefghijklmnopqrstuvwxyz"[e];
@@ -7479,39 +7506,39 @@ const al = function() {
7479
7506
  }
7480
7507
  return n;
7481
7508
  }();
7482
- function cl(n) {
7509
+ function hl(n) {
7483
7510
  n = n.toLowerCase();
7484
- let e = sl;
7511
+ let e = al;
7485
7512
  for (let t = 0; t < n.length; t++)
7486
- e = e * il + al[n[t]];
7513
+ e = e * cl + ll[n[t]];
7487
7514
  return e;
7488
7515
  }
7489
7516
  function lt(n) {
7490
7517
  if (_(typeof n == "string", "invalid address", "address", n), n.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
7491
7518
  n.startsWith("0x") || (n = "0x" + n);
7492
- const e = _s(n);
7519
+ const e = Es(n);
7493
7520
  return _(!n.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || e === n, "bad address checksum", "address", n), e;
7494
7521
  }
7495
7522
  if (n.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
7496
- _(n.substring(2, 4) === ol(n), "bad icap checksum", "address", n);
7497
- let e = cl(n.substring(4)).toString(16);
7523
+ _(n.substring(2, 4) === ul(n), "bad icap checksum", "address", n);
7524
+ let e = hl(n.substring(4)).toString(16);
7498
7525
  for (; e.length < 40; )
7499
7526
  e = "0" + e;
7500
- return _s("0x" + e);
7527
+ return Es("0x" + e);
7501
7528
  }
7502
7529
  _(!1, "invalid address", "address", n);
7503
7530
  }
7504
- function ul(n) {
7531
+ function fl(n) {
7505
7532
  return n && typeof n.getAddress == "function";
7506
7533
  }
7507
7534
  async function en(n, e) {
7508
7535
  const t = await e;
7509
7536
  return (t == null || t === "0x0000000000000000000000000000000000000000") && (x(typeof n != "string", "unconfigured name", "UNCONFIGURED_NAME", { value: n }), _(!1, "invalid AddressLike value; did not resolve to a value address", "target", n)), lt(t);
7510
7537
  }
7511
- function Mn(n, e) {
7538
+ function Vn(n, e) {
7512
7539
  if (typeof n == "string")
7513
7540
  return n.match(/^0x[0-9a-f]{40}$/i) ? lt(n) : (x(e != null, "ENS resolution requires a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName" }), en(n, e.resolveName(n)));
7514
- if (ul(n))
7541
+ if (fl(n))
7515
7542
  return en(n, n.getAddress());
7516
7543
  if (n && typeof n.then == "function")
7517
7544
  return en(n, n);
@@ -7520,12 +7547,12 @@ function Mn(n, e) {
7520
7547
  const Re = {};
7521
7548
  function E(n, e) {
7522
7549
  let t = !1;
7523
- return e < 0 && (t = !0, e *= -1), new K(Re, `${t ? "" : "u"}int${e}`, n, { signed: t, width: e });
7550
+ return e < 0 && (t = !0, e *= -1), new X(Re, `${t ? "" : "u"}int${e}`, n, { signed: t, width: e });
7524
7551
  }
7525
7552
  function R(n, e) {
7526
- return new K(Re, `bytes${e || ""}`, n, { size: e });
7553
+ return new X(Re, `bytes${e || ""}`, n, { size: e });
7527
7554
  }
7528
- const xs = Symbol.for("_ethers_typed");
7555
+ const Ts = Symbol.for("_ethers_typed");
7529
7556
  var it;
7530
7557
  const $e = class {
7531
7558
  constructor(e, t, r, s) {
@@ -7533,7 +7560,7 @@ const $e = class {
7533
7560
  d(this, "value");
7534
7561
  F(this, it, void 0);
7535
7562
  d(this, "_typedSymbol");
7536
- s == null && (s = null), Ln(Re, e, "Typed"), S(this, { _typedSymbol: xs, type: t, value: r }), P(this, it, s), this.format();
7563
+ s == null && (s = null), Bn(Re, e, "Typed"), S(this, { _typedSymbol: Ts, type: t, value: r }), P(this, it, s), this.format();
7537
7564
  }
7538
7565
  format() {
7539
7566
  if (this.type === "array")
@@ -7896,7 +7923,7 @@ const $e = class {
7896
7923
  * Returns true only if %%value%% is a [[Typed]] instance.
7897
7924
  */
7898
7925
  static isTyped(e) {
7899
- return e && e._typedSymbol === xs;
7926
+ return e && e._typedSymbol === Ts;
7900
7927
  }
7901
7928
  /**
7902
7929
  * If the value is a [[Typed]] instance, validates the underlying value
@@ -7914,9 +7941,9 @@ const $e = class {
7914
7941
  return e;
7915
7942
  }
7916
7943
  };
7917
- let K = $e;
7944
+ let X = $e;
7918
7945
  it = new WeakMap();
7919
- class ll extends Be {
7946
+ class dl extends Be {
7920
7947
  constructor(e) {
7921
7948
  super("address", "address", e, !1);
7922
7949
  }
@@ -7924,7 +7951,7 @@ class ll extends Be {
7924
7951
  return "0x0000000000000000000000000000000000000000";
7925
7952
  }
7926
7953
  encode(e, t) {
7927
- let r = K.dereference(t, "string");
7954
+ let r = X.dereference(t, "string");
7928
7955
  try {
7929
7956
  r = lt(r);
7930
7957
  } catch (s) {
@@ -7933,10 +7960,10 @@ class ll extends Be {
7933
7960
  return e.writeValue(r);
7934
7961
  }
7935
7962
  decode(e) {
7936
- return lt(gi(e.readValue(), 20));
7963
+ return lt(wi(e.readValue(), 20));
7937
7964
  }
7938
7965
  }
7939
- class hl extends Be {
7966
+ class pl extends Be {
7940
7967
  constructor(t) {
7941
7968
  super(t.name, t.type, "_", t.dynamic);
7942
7969
  d(this, "coder");
@@ -7952,7 +7979,7 @@ class hl extends Be {
7952
7979
  return this.coder.decode(t);
7953
7980
  }
7954
7981
  }
7955
- function $i(n, e, t) {
7982
+ function Pi(n, e, t) {
7956
7983
  let r = [];
7957
7984
  if (Array.isArray(t))
7958
7985
  r = t;
@@ -7983,7 +8010,7 @@ function $i(n, e, t) {
7983
8010
  let a = n.appendWriter(s);
7984
8011
  return a += n.appendWriter(i), a;
7985
8012
  }
7986
- function Pi(n, e) {
8013
+ function Ni(n, e) {
7987
8014
  let t = [], r = [], s = n.subReader(0);
7988
8015
  return e.forEach((i) => {
7989
8016
  let o = null;
@@ -8009,7 +8036,7 @@ function Pi(n, e) {
8009
8036
  t.push(o), r.push(i.localName || null);
8010
8037
  }), _r.fromItems(t, r);
8011
8038
  }
8012
- class fl extends Be {
8039
+ class yl extends Be {
8013
8040
  constructor(t, r, s) {
8014
8041
  const i = t.type + "[" + (r >= 0 ? r : "") + "]", o = r === -1 || t.dynamic;
8015
8042
  super("array", i, s, o);
@@ -8024,25 +8051,25 @@ class fl extends Be {
8024
8051
  return r;
8025
8052
  }
8026
8053
  encode(t, r) {
8027
- const s = K.dereference(r, "array");
8054
+ const s = X.dereference(r, "array");
8028
8055
  Array.isArray(s) || this._throwError("expected array value", s);
8029
8056
  let i = this.length;
8030
- i === -1 && (i = s.length, t.writeValue(s.length)), pi(s.length, i, "coder array" + (this.localName ? " " + this.localName : ""));
8057
+ i === -1 && (i = s.length, t.writeValue(s.length)), yi(s.length, i, "coder array" + (this.localName ? " " + this.localName : ""));
8031
8058
  let o = [];
8032
8059
  for (let a = 0; a < s.length; a++)
8033
8060
  o.push(this.coder);
8034
- return $i(t, o, s);
8061
+ return Pi(t, o, s);
8035
8062
  }
8036
8063
  decode(t) {
8037
8064
  let r = this.length;
8038
- r === -1 && (r = t.readIndex(), x(r * Z <= t.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: t.bytes, offset: r * Z, length: t.dataLength }));
8065
+ r === -1 && (r = t.readIndex(), x(r * Y <= t.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: t.bytes, offset: r * Y, length: t.dataLength }));
8039
8066
  let s = [];
8040
8067
  for (let i = 0; i < r; i++)
8041
- s.push(new hl(this.coder));
8042
- return Pi(t, s);
8068
+ s.push(new pl(this.coder));
8069
+ return Ni(t, s);
8043
8070
  }
8044
8071
  }
8045
- class dl extends Be {
8072
+ class ml extends Be {
8046
8073
  constructor(e) {
8047
8074
  super("bool", "bool", e, !1);
8048
8075
  }
@@ -8050,14 +8077,14 @@ class dl extends Be {
8050
8077
  return !1;
8051
8078
  }
8052
8079
  encode(e, t) {
8053
- const r = K.dereference(t, "bool");
8080
+ const r = X.dereference(t, "bool");
8054
8081
  return e.writeValue(r ? 1 : 0);
8055
8082
  }
8056
8083
  decode(e) {
8057
8084
  return !!e.readValue();
8058
8085
  }
8059
8086
  }
8060
- class Ni extends Be {
8087
+ class Ii extends Be {
8061
8088
  constructor(e, t) {
8062
8089
  super(e, e, t, !0);
8063
8090
  }
@@ -8073,7 +8100,7 @@ class Ni extends Be {
8073
8100
  return e.readBytes(e.readIndex(), !0);
8074
8101
  }
8075
8102
  }
8076
- class pl extends Ni {
8103
+ class gl extends Ii {
8077
8104
  constructor(e) {
8078
8105
  super("bytes", e);
8079
8106
  }
@@ -8081,7 +8108,7 @@ class pl extends Ni {
8081
8108
  return H(super.decode(e));
8082
8109
  }
8083
8110
  }
8084
- class yl extends Be {
8111
+ class wl extends Be {
8085
8112
  constructor(t, r) {
8086
8113
  let s = "bytes" + String(t);
8087
8114
  super(s, s, r, !1);
@@ -8092,15 +8119,15 @@ class yl extends Be {
8092
8119
  return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2);
8093
8120
  }
8094
8121
  encode(t, r) {
8095
- let s = Fe(K.dereference(r, this.type));
8122
+ let s = Fe(X.dereference(r, this.type));
8096
8123
  return s.length !== this.size && this._throwError("incorrect data length", r), t.writeBytes(s);
8097
8124
  }
8098
8125
  decode(t) {
8099
8126
  return H(t.readBytes(this.size));
8100
8127
  }
8101
8128
  }
8102
- const ml = new Uint8Array([]);
8103
- class gl extends Be {
8129
+ const bl = new Uint8Array([]);
8130
+ class vl extends Be {
8104
8131
  constructor(e) {
8105
8132
  super("null", "", e, !1);
8106
8133
  }
@@ -8108,14 +8135,14 @@ class gl extends Be {
8108
8135
  return null;
8109
8136
  }
8110
8137
  encode(e, t) {
8111
- return t != null && this._throwError("not null", t), e.writeBytes(ml);
8138
+ return t != null && this._throwError("not null", t), e.writeBytes(bl);
8112
8139
  }
8113
8140
  decode(e) {
8114
8141
  return e.readBytes(0), null;
8115
8142
  }
8116
8143
  }
8117
- const wl = BigInt(0), bl = BigInt(1), vl = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
8118
- class _l extends Be {
8144
+ const _l = BigInt(0), El = BigInt(1), xl = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
8145
+ class Tl extends Be {
8119
8146
  constructor(t, r, s) {
8120
8147
  const i = (r ? "int" : "uint") + t * 8;
8121
8148
  super(i, i, s, !1);
@@ -8127,20 +8154,20 @@ class _l extends Be {
8127
8154
  return 0;
8128
8155
  }
8129
8156
  encode(t, r) {
8130
- let s = mt(K.dereference(r, this.type)), i = cr(vl, Z * 8);
8157
+ let s = mt(X.dereference(r, this.type)), i = cr(xl, Y * 8);
8131
8158
  if (this.signed) {
8132
8159
  let o = cr(i, this.size * 8 - 1);
8133
- (s > o || s < -(o + bl)) && this._throwError("value out-of-bounds", r), s = au(s, 8 * Z);
8160
+ (s > o || s < -(o + El)) && this._throwError("value out-of-bounds", r), s = lu(s, 8 * Y);
8134
8161
  } else
8135
- (s < wl || s > cr(i, this.size * 8)) && this._throwError("value out-of-bounds", r);
8162
+ (s < _l || s > cr(i, this.size * 8)) && this._throwError("value out-of-bounds", r);
8136
8163
  return t.writeValue(s);
8137
8164
  }
8138
8165
  decode(t) {
8139
8166
  let r = cr(t.readValue(), this.size * 8);
8140
- return this.signed && (r = ou(r, this.size * 8)), r;
8167
+ return this.signed && (r = uu(r, this.size * 8)), r;
8141
8168
  }
8142
8169
  }
8143
- class El extends Ni {
8170
+ class Ol extends Ii {
8144
8171
  constructor(e) {
8145
8172
  super("string", e);
8146
8173
  }
@@ -8148,10 +8175,10 @@ class El extends Ni {
8148
8175
  return "";
8149
8176
  }
8150
8177
  encode(e, t) {
8151
- return super.encode(e, bi(K.dereference(t, "string")));
8178
+ return super.encode(e, vi(X.dereference(t, "string")));
8152
8179
  }
8153
8180
  decode(e) {
8154
- return mu(super.decode(e));
8181
+ return bu(super.decode(e));
8155
8182
  }
8156
8183
  }
8157
8184
  class fr extends Be {
@@ -8181,15 +8208,15 @@ class fr extends Be {
8181
8208
  }), Object.freeze(t);
8182
8209
  }
8183
8210
  encode(t, r) {
8184
- const s = K.dereference(r, "tuple");
8185
- return $i(t, this.coders, s);
8211
+ const s = X.dereference(r, "tuple");
8212
+ return Pi(t, this.coders, s);
8186
8213
  }
8187
8214
  decode(t) {
8188
- return Pi(t, this.coders);
8215
+ return Ni(t, this.coders);
8189
8216
  }
8190
8217
  }
8191
8218
  function Jt(n) {
8192
- return Je(bi(n));
8219
+ return Je(vi(n));
8193
8220
  }
8194
8221
  function tn(n, e) {
8195
8222
  return {
@@ -8197,7 +8224,7 @@ function tn(n, e) {
8197
8224
  storageKeys: e.map((t, r) => (_(Ge(t, 32), "invalid slot", `storageKeys[${r}]`, t), t.toLowerCase()))
8198
8225
  };
8199
8226
  }
8200
- function xl(n) {
8227
+ function kl(n) {
8201
8228
  if (Array.isArray(n))
8202
8229
  return n.map((t, r) => Array.isArray(t) ? (_(t.length === 2, "invalid slot set", `value[${r}]`, t), tn(t[0], t[1])) : (_(t != null && typeof t == "object", "invalid address-slot set", "value", n), tn(t.address, t.storageKeys)));
8203
8230
  _(n != null && typeof n == "object", "invalid access list", "value", n);
@@ -8207,18 +8234,18 @@ function xl(n) {
8207
8234
  });
8208
8235
  return e.sort((t, r) => t.address.localeCompare(r.address)), e;
8209
8236
  }
8210
- function Y(n) {
8237
+ function Q(n) {
8211
8238
  const e = /* @__PURE__ */ new Set();
8212
8239
  return n.forEach((t) => e.add(t)), Object.freeze(e);
8213
8240
  }
8214
- const Ii = "constant external internal payable private public pure view", Tl = Y(Ii.split(" ")), Ci = "constructor error event fallback function receive struct", Fi = Y(Ci.split(" ")), Di = "calldata memory storage payable indexed", Ol = Y(Di.split(" ")), kl = "tuple returns", Al = [Ci, Di, kl, Ii].join(" "), Sl = Y(Al.split(" ")), Rl = {
8241
+ const Ci = "constant external internal payable private public pure view", Al = Q(Ci.split(" ")), Fi = "constructor error event fallback function receive struct", Di = Q(Fi.split(" ")), Ui = "calldata memory storage payable indexed", Sl = Q(Ui.split(" ")), Rl = "tuple returns", $l = [Fi, Ui, Rl, Ci].join(" "), Pl = Q($l.split(" ")), Nl = {
8215
8242
  "(": "OPEN_PAREN",
8216
8243
  ")": "CLOSE_PAREN",
8217
8244
  "[": "OPEN_BRACKET",
8218
8245
  "]": "CLOSE_BRACKET",
8219
8246
  ",": "COMMA",
8220
8247
  "@": "AT"
8221
- }, $l = new RegExp("^(\\s*)"), Pl = new RegExp("^([0-9]+)"), Nl = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"), Ui = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"), ji = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");
8248
+ }, Il = new RegExp("^(\\s*)"), Cl = new RegExp("^([0-9]+)"), Fl = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"), ji = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"), Li = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");
8222
8249
  var z, pe, Kt, bn;
8223
8250
  const Or = class {
8224
8251
  constructor(e) {
@@ -8293,7 +8320,7 @@ const Or = class {
8293
8320
  // Returns the next token; throws if out of tokens
8294
8321
  pop() {
8295
8322
  const e = this.peek();
8296
- return Xn(this, z)._++, e;
8323
+ return Zn(this, z)._++, e;
8297
8324
  }
8298
8325
  toString() {
8299
8326
  const e = [];
@@ -8319,11 +8346,11 @@ function Ke(n) {
8319
8346
  };
8320
8347
  let r = [], s = [], i = 0;
8321
8348
  for (; i < n.length; ) {
8322
- let o = n.substring(i), a = o.match($l);
8349
+ let o = n.substring(i), a = o.match(Il);
8323
8350
  a && (i += a[1].length, o = n.substring(i));
8324
8351
  const c = { depth: r.length, linkBack: -1, linkNext: -1, match: -1, type: "", text: "", offset: i, value: -1 };
8325
8352
  e.push(c);
8326
- let u = Rl[o[0]] || "";
8353
+ let u = Nl[o[0]] || "";
8327
8354
  if (u) {
8328
8355
  if (c.type = u, c.text = o[0], i++, u === "OPEN_PAREN")
8329
8356
  r.push(e.length - 1), s.push(e.length - 1);
@@ -8345,19 +8372,19 @@ function Ke(n) {
8345
8372
  }
8346
8373
  continue;
8347
8374
  }
8348
- if (a = o.match(Nl), a) {
8349
- if (c.text = a[1], i += c.text.length, Sl.has(c.text)) {
8375
+ if (a = o.match(Fl), a) {
8376
+ if (c.text = a[1], i += c.text.length, Pl.has(c.text)) {
8350
8377
  c.type = "KEYWORD";
8351
8378
  continue;
8352
8379
  }
8353
- if (c.text.match(ji)) {
8380
+ if (c.text.match(Li)) {
8354
8381
  c.type = "TYPE";
8355
8382
  continue;
8356
8383
  }
8357
8384
  c.type = "ID";
8358
8385
  continue;
8359
8386
  }
8360
- if (a = o.match(Pl), a) {
8387
+ if (a = o.match(Cl), a) {
8361
8388
  c.text = a[1], c.type = "NUMBER", i += c.text.length;
8362
8389
  continue;
8363
8390
  }
@@ -8365,7 +8392,7 @@ function Ke(n) {
8365
8392
  }
8366
8393
  return new ge(e.map((o) => Object.freeze(o)));
8367
8394
  }
8368
- function Ts(n, e) {
8395
+ function Os(n, e) {
8369
8396
  let t = [];
8370
8397
  for (const r in e.keys())
8371
8398
  n.has(r) && t.push(r);
@@ -8373,7 +8400,7 @@ function Ts(n, e) {
8373
8400
  throw new Error(`conflicting types: ${t.join(", ")}`);
8374
8401
  }
8375
8402
  function Br(n, e) {
8376
- if (e.peekKeyword(Fi)) {
8403
+ if (e.peekKeyword(Di)) {
8377
8404
  const t = e.pop().text;
8378
8405
  if (t !== n)
8379
8406
  throw new Error(`expected ${n}, got ${t}`);
@@ -8392,14 +8419,14 @@ function je(n, e) {
8392
8419
  }
8393
8420
  return Object.freeze(t);
8394
8421
  }
8395
- function Li(n) {
8396
- let e = je(n, Tl);
8397
- return Ts(e, Y("constant payable nonpayable".split(" "))), Ts(e, Y("pure view payable nonpayable".split(" "))), e.has("view") ? "view" : e.has("pure") ? "pure" : e.has("payable") ? "payable" : e.has("nonpayable") ? "nonpayable" : e.has("constant") ? "view" : "nonpayable";
8422
+ function Bi(n) {
8423
+ let e = je(n, Al);
8424
+ return Os(e, Q("constant payable nonpayable".split(" "))), Os(e, Q("pure view payable nonpayable".split(" "))), e.has("view") ? "view" : e.has("pure") ? "pure" : e.has("payable") ? "payable" : e.has("nonpayable") ? "nonpayable" : e.has("constant") ? "view" : "nonpayable";
8398
8425
  }
8399
8426
  function De(n, e) {
8400
8427
  return n.popParams().map((t) => G.from(t, e));
8401
8428
  }
8402
- function Bi(n) {
8429
+ function Hi(n) {
8403
8430
  if (n.peekType("AT")) {
8404
8431
  if (n.pop(), n.peekType("NUMBER"))
8405
8432
  return mt(n.pop().text);
@@ -8411,9 +8438,9 @@ function ht(n) {
8411
8438
  if (n.length)
8412
8439
  throw new Error(`unexpected tokens: ${n.toString()}`);
8413
8440
  }
8414
- const Il = new RegExp(/^(.*)\[([0-9]*)\]$/);
8415
- function Os(n) {
8416
- const e = n.match(ji);
8441
+ const Dl = new RegExp(/^(.*)\[([0-9]*)\]$/);
8442
+ function ks(n) {
8443
+ const e = n.match(Li);
8417
8444
  if (_(e, "invalid type", "type", n), n === "uint")
8418
8445
  return "uint256";
8419
8446
  if (n === "int")
@@ -8427,7 +8454,7 @@ function Os(n) {
8427
8454
  }
8428
8455
  return n;
8429
8456
  }
8430
- const j = {}, re = Symbol.for("_ethers_internal"), ks = "_ParamTypeInternal", As = "_ErrorInternal", Ss = "_EventInternal", Rs = "_ConstructorInternal", $s = "_FallbackInternal", Ps = "_FunctionInternal", Ns = "_StructInternal";
8457
+ const j = {}, ne = Symbol.for("_ethers_internal"), As = "_ParamTypeInternal", Ss = "_ErrorInternal", Rs = "_EventInternal", $s = "_ConstructorInternal", Ps = "_FallbackInternal", Ns = "_FunctionInternal", Is = "_StructInternal";
8431
8458
  var Pt, mr;
8432
8459
  const ue = class {
8433
8460
  /**
@@ -8472,7 +8499,7 @@ const ue = class {
8472
8499
  * For non-array types this is ``null``.
8473
8500
  */
8474
8501
  d(this, "arrayChildren");
8475
- if (Ln(e, j, "ParamType"), Object.defineProperty(this, re, { value: ks }), o && (o = Object.freeze(o.slice())), s === "array") {
8502
+ if (Bn(e, j, "ParamType"), Object.defineProperty(this, ne, { value: As }), o && (o = Object.freeze(o.slice())), s === "array") {
8476
8503
  if (a == null || c == null)
8477
8504
  throw new Error("");
8478
8505
  } else if (a != null || c != null)
@@ -8599,14 +8626,14 @@ const ue = class {
8599
8626
  return ue.from(Ke(e), t);
8600
8627
  if (e instanceof ge) {
8601
8628
  let a = "", c = "", u = null;
8602
- je(e, Y(["tuple"])).has("tuple") || e.peekType("OPEN_PAREN") ? (c = "tuple", u = e.popParams().map((v) => ue.from(v)), a = `tuple(${u.map((v) => v.format()).join(",")})`) : (a = Os(e.popType("TYPE")), c = a);
8629
+ je(e, Q(["tuple"])).has("tuple") || e.peekType("OPEN_PAREN") ? (c = "tuple", u = e.popParams().map((v) => ue.from(v)), a = `tuple(${u.map((v) => v.format()).join(",")})`) : (a = ks(e.popType("TYPE")), c = a);
8603
8630
  let l = null, h = null;
8604
8631
  for (; e.length && e.peekType("BRACKET"); ) {
8605
8632
  const v = e.pop();
8606
8633
  l = new ue(j, "", a, c, null, u, h, l), h = v.value, a += v.text, c = "array", u = null;
8607
8634
  }
8608
8635
  let y = null;
8609
- if (je(e, Ol).has("indexed")) {
8636
+ if (je(e, Sl).has("indexed")) {
8610
8637
  if (!t)
8611
8638
  throw new Error("");
8612
8639
  y = !0;
@@ -8617,10 +8644,10 @@ const ue = class {
8617
8644
  return new ue(j, w, a, c, y, u, h, l);
8618
8645
  }
8619
8646
  const r = e.name;
8620
- _(!r || typeof r == "string" && r.match(Ui), "invalid name", "obj.name", r);
8647
+ _(!r || typeof r == "string" && r.match(ji), "invalid name", "obj.name", r);
8621
8648
  let s = e.indexed;
8622
8649
  s != null && (_(t, "parameter cannot be indexed", "obj.indexed", e.indexed), s = !!s);
8623
- let i = e.type, o = i.match(Il);
8650
+ let i = e.type, o = i.match(Dl);
8624
8651
  if (o) {
8625
8652
  const a = parseInt(o[2] || "-1"), c = ue.from({
8626
8653
  type: o[1],
@@ -8638,13 +8665,13 @@ const ue = class {
8638
8665
  const a = e.components != null ? e.components.map((u) => ue.from(u)) : null;
8639
8666
  return new ue(j, r || "", i, "tuple", s, a, null, null);
8640
8667
  }
8641
- return i = Os(e.type), new ue(j, r || "", i, i, s, null, null, null);
8668
+ return i = ks(e.type), new ue(j, r || "", i, i, s, null, null, null);
8642
8669
  }
8643
8670
  /**
8644
8671
  * Returns true if %%value%% is a **ParamType**.
8645
8672
  */
8646
8673
  static isParamType(e) {
8647
- return e && e[re] === ks;
8674
+ return e && e[ne] === As;
8648
8675
  }
8649
8676
  };
8650
8677
  let G = ue;
@@ -8707,7 +8734,7 @@ class ft {
8707
8734
  * The inputs for the fragment.
8708
8735
  */
8709
8736
  d(this, "inputs");
8710
- Ln(e, j, "Fragment"), r = Object.freeze(r.slice()), S(this, { type: t, inputs: r });
8737
+ Bn(e, j, "Fragment"), r = Object.freeze(r.slice()), S(this, { type: t, inputs: r });
8711
8738
  }
8712
8739
  /**
8713
8740
  * Creates a new **Fragment** for %%obj%%, wich can be any supported
@@ -8722,11 +8749,11 @@ class ft {
8722
8749
  return ft.from(Ke(e));
8723
8750
  }
8724
8751
  if (e instanceof ge)
8725
- switch (e.peekKeyword(Fi)) {
8752
+ switch (e.peekKeyword(Di)) {
8726
8753
  case "constructor":
8727
8754
  return Ce.from(e);
8728
8755
  case "error":
8729
- return ee.from(e);
8756
+ return te.from(e);
8730
8757
  case "event":
8731
8758
  return Oe.from(e);
8732
8759
  case "fallback":
@@ -8742,7 +8769,7 @@ class ft {
8742
8769
  case "constructor":
8743
8770
  return Ce.from(e);
8744
8771
  case "error":
8745
- return ee.from(e);
8772
+ return te.from(e);
8746
8773
  case "event":
8747
8774
  return Oe.from(e);
8748
8775
  case "fallback":
@@ -8769,7 +8796,7 @@ class ft {
8769
8796
  * Returns true if %%value%% is an [[ErrorFragment]].
8770
8797
  */
8771
8798
  static isError(e) {
8772
- return ee.isFragment(e);
8799
+ return te.isFragment(e);
8773
8800
  }
8774
8801
  /**
8775
8802
  * Returns true if %%value%% is an [[EventFragment]].
@@ -8800,18 +8827,18 @@ class Hr extends ft {
8800
8827
  * The name of the fragment.
8801
8828
  */
8802
8829
  d(this, "name");
8803
- _(typeof s == "string" && s.match(Ui), "invalid identifier", "name", s), i = Object.freeze(i.slice()), S(this, { name: s });
8830
+ _(typeof s == "string" && s.match(ji), "invalid identifier", "name", s), i = Object.freeze(i.slice()), S(this, { name: s });
8804
8831
  }
8805
8832
  }
8806
8833
  function Wt(n, e) {
8807
8834
  return "(" + e.map((t) => t.format(n)).join(n === "full" ? ", " : ",") + ")";
8808
8835
  }
8809
- class ee extends Hr {
8836
+ class te extends Hr {
8810
8837
  /**
8811
8838
  * @private
8812
8839
  */
8813
8840
  constructor(e, t, r) {
8814
- super(e, "error", t, r), Object.defineProperty(this, re, { value: As });
8841
+ super(e, "error", t, r), Object.defineProperty(this, ne, { value: Ss });
8815
8842
  }
8816
8843
  /**
8817
8844
  * The Custom Error selector.
@@ -8830,18 +8857,18 @@ class ee extends Hr {
8830
8857
  return e !== "sighash" && t.push("error"), t.push(this.name + Wt(e, this.inputs)), t.join(" ");
8831
8858
  }
8832
8859
  static from(e) {
8833
- if (ee.isFragment(e))
8860
+ if (te.isFragment(e))
8834
8861
  return e;
8835
8862
  if (typeof e == "string")
8836
- return ee.from(Ke(e));
8863
+ return te.from(Ke(e));
8837
8864
  if (e instanceof ge) {
8838
8865
  const t = Br("error", e), r = De(e);
8839
- return ht(e), new ee(j, t, r);
8866
+ return ht(e), new te(j, t, r);
8840
8867
  }
8841
- return new ee(j, e.name, e.inputs ? e.inputs.map(G.from) : []);
8868
+ return new te(j, e.name, e.inputs ? e.inputs.map(G.from) : []);
8842
8869
  }
8843
8870
  static isFragment(e) {
8844
- return e && e[re] === As;
8871
+ return e && e[ne] === Ss;
8845
8872
  }
8846
8873
  }
8847
8874
  class Oe extends Hr {
@@ -8851,7 +8878,7 @@ class Oe extends Hr {
8851
8878
  constructor(t, r, s, i) {
8852
8879
  super(t, "event", r, s);
8853
8880
  d(this, "anonymous");
8854
- Object.defineProperty(this, re, { value: Ss }), S(this, { anonymous: i });
8881
+ Object.defineProperty(this, ne, { value: Rs }), S(this, { anonymous: i });
8855
8882
  }
8856
8883
  /**
8857
8884
  * The Event topic hash.
@@ -8879,13 +8906,13 @@ class Oe extends Hr {
8879
8906
  if (typeof t == "string")
8880
8907
  return Oe.from(Ke(t));
8881
8908
  if (t instanceof ge) {
8882
- const r = Br("event", t), s = De(t, !0), i = !!je(t, Y(["anonymous"])).has("anonymous");
8909
+ const r = Br("event", t), s = De(t, !0), i = !!je(t, Q(["anonymous"])).has("anonymous");
8883
8910
  return ht(t), new Oe(j, r, s, i);
8884
8911
  }
8885
8912
  return new Oe(j, t.name, t.inputs ? t.inputs.map((r) => G.from(r, !0)) : [], !!t.anonymous);
8886
8913
  }
8887
8914
  static isFragment(t) {
8888
- return t && t[re] === Ss;
8915
+ return t && t[ne] === Rs;
8889
8916
  }
8890
8917
  }
8891
8918
  class Ce extends ft {
@@ -8896,7 +8923,7 @@ class Ce extends ft {
8896
8923
  super(t, r, s);
8897
8924
  d(this, "payable");
8898
8925
  d(this, "gas");
8899
- Object.defineProperty(this, re, { value: Rs }), S(this, { payable: i, gas: o });
8926
+ Object.defineProperty(this, ne, { value: $s }), S(this, { payable: i, gas: o });
8900
8927
  }
8901
8928
  format(t) {
8902
8929
  if (x(t != null && t !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }), t === "json")
@@ -8916,14 +8943,14 @@ class Ce extends ft {
8916
8943
  if (typeof t == "string")
8917
8944
  return Ce.from(Ke(t));
8918
8945
  if (t instanceof ge) {
8919
- je(t, Y(["constructor"]));
8920
- const r = De(t), s = !!je(t, Y(["payable"])).has("payable"), i = Bi(t);
8946
+ je(t, Q(["constructor"]));
8947
+ const r = De(t), s = !!je(t, Q(["payable"])).has("payable"), i = Hi(t);
8921
8948
  return ht(t), new Ce(j, "constructor", r, s, i);
8922
8949
  }
8923
8950
  return new Ce(j, "constructor", t.inputs ? t.inputs.map(G.from) : [], !!t.payable, t.gas != null ? t.gas : null);
8924
8951
  }
8925
8952
  static isFragment(t) {
8926
- return t && t[re] === Rs;
8953
+ return t && t[ne] === $s;
8927
8954
  }
8928
8955
  }
8929
8956
  class Pe extends ft {
@@ -8933,7 +8960,7 @@ class Pe extends ft {
8933
8960
  * If the function can be sent value during invocation.
8934
8961
  */
8935
8962
  d(this, "payable");
8936
- Object.defineProperty(this, re, { value: $s }), S(this, { payable: s });
8963
+ Object.defineProperty(this, ne, { value: Ps }), S(this, { payable: s });
8937
8964
  }
8938
8965
  format(t) {
8939
8966
  const r = this.inputs.length === 0 ? "receive" : "fallback";
@@ -8949,15 +8976,15 @@ class Pe extends ft {
8949
8976
  if (typeof t == "string")
8950
8977
  return Pe.from(Ke(t));
8951
8978
  if (t instanceof ge) {
8952
- const r = t.toString(), s = t.peekKeyword(Y(["fallback", "receive"]));
8953
- if (_(s, "type must be fallback or receive", "obj", r), t.popKeyword(Y(["fallback", "receive"])) === "receive") {
8979
+ const r = t.toString(), s = t.peekKeyword(Q(["fallback", "receive"]));
8980
+ if (_(s, "type must be fallback or receive", "obj", r), t.popKeyword(Q(["fallback", "receive"])) === "receive") {
8954
8981
  const c = De(t);
8955
- return _(c.length === 0, "receive cannot have arguments", "obj.inputs", c), je(t, Y(["payable"])), ht(t), new Pe(j, [], !0);
8982
+ return _(c.length === 0, "receive cannot have arguments", "obj.inputs", c), je(t, Q(["payable"])), ht(t), new Pe(j, [], !0);
8956
8983
  }
8957
8984
  let o = De(t);
8958
8985
  o.length ? _(o.length === 1 && o[0].type === "bytes", "invalid fallback inputs", "obj.inputs", o.map((c) => c.format("minimal")).join(", ")) : o = [G.from("bytes")];
8959
- const a = Li(t);
8960
- if (_(a === "nonpayable" || a === "payable", "fallback cannot be constants", "obj.stateMutability", a), je(t, Y(["returns"])).has("returns")) {
8986
+ const a = Bi(t);
8987
+ if (_(a === "nonpayable" || a === "payable", "fallback cannot be constants", "obj.stateMutability", a), je(t, Q(["returns"])).has("returns")) {
8961
8988
  const c = De(t);
8962
8989
  _(c.length === 1 && c[0].type === "bytes", "invalid fallback outputs", "obj.outputs", c.map((u) => u.format("minimal")).join(", "));
8963
8990
  }
@@ -8972,7 +8999,7 @@ class Pe extends ft {
8972
8999
  _(!1, "invalid fallback description", "obj", t);
8973
9000
  }
8974
9001
  static isFragment(t) {
8975
- return t && t[re] === $s;
9002
+ return t && t[ne] === Ps;
8976
9003
  }
8977
9004
  }
8978
9005
  class ke extends Hr {
@@ -9002,7 +9029,7 @@ class ke extends Hr {
9002
9029
  * The amount of gas to send when calling this function
9003
9030
  */
9004
9031
  d(this, "gas");
9005
- Object.defineProperty(this, re, { value: Ps }), o = Object.freeze(o.slice()), S(this, { constant: s === "view" || s === "pure", gas: a, outputs: o, payable: s === "payable", stateMutability: s });
9032
+ Object.defineProperty(this, ne, { value: Ns }), o = Object.freeze(o.slice()), S(this, { constant: s === "view" || s === "pure", gas: a, outputs: o, payable: s === "payable", stateMutability: s });
9006
9033
  }
9007
9034
  /**
9008
9035
  * The Function selector.
@@ -9034,16 +9061,16 @@ class ke extends Hr {
9034
9061
  if (typeof t == "string")
9035
9062
  return ke.from(Ke(t));
9036
9063
  if (t instanceof ge) {
9037
- const r = Br("function", t), s = De(t), i = Li(t);
9064
+ const r = Br("function", t), s = De(t), i = Bi(t);
9038
9065
  let o = [];
9039
- je(t, Y(["returns"])).has("returns") && (o = De(t));
9040
- const a = Bi(t);
9066
+ je(t, Q(["returns"])).has("returns") && (o = De(t));
9067
+ const a = Hi(t);
9041
9068
  return ht(t), new ke(j, r, i, s, o, a);
9042
9069
  }
9043
9070
  return new ke(j, t.name, t.stateMutability, t.inputs ? t.inputs.map(G.from) : [], t.outputs ? t.outputs.map(G.from) : [], t.gas != null ? t.gas : null);
9044
9071
  }
9045
9072
  static isFragment(t) {
9046
- return t && t[re] === Ps;
9073
+ return t && t[ne] === Ns;
9047
9074
  }
9048
9075
  }
9049
9076
  class ct extends Hr {
@@ -9051,7 +9078,7 @@ class ct extends Hr {
9051
9078
  * @private
9052
9079
  */
9053
9080
  constructor(e, t, r) {
9054
- super(e, "struct", t, r), Object.defineProperty(this, re, { value: Ns });
9081
+ super(e, "struct", t, r), Object.defineProperty(this, ne, { value: Is });
9055
9082
  }
9056
9083
  format() {
9057
9084
  throw new Error("@TODO");
@@ -9066,7 +9093,7 @@ class ct extends Hr {
9066
9093
  return new ct(j, e.name, e.inputs ? e.inputs.map(G.from) : []);
9067
9094
  }
9068
9095
  static isFragment(e) {
9069
- return e && e[re] === Ns;
9096
+ return e && e[ne] === Is;
9070
9097
  }
9071
9098
  }
9072
9099
  const we = /* @__PURE__ */ new Map();
@@ -9080,9 +9107,9 @@ we.set(49, "STACK_UNDERFLOW");
9080
9107
  we.set(50, "ARRAY_RANGE_ERROR");
9081
9108
  we.set(65, "OUT_OF_MEMORY");
9082
9109
  we.set(81, "UNINITIALIZED_FUNCTION_CALL");
9083
- const Cl = new RegExp(/^bytes([0-9]*)$/), Fl = new RegExp(/^(u?int)([0-9]*)$/);
9110
+ const Ul = new RegExp(/^bytes([0-9]*)$/), jl = new RegExp(/^(u?int)([0-9]*)$/);
9084
9111
  let rn = null;
9085
- function Dl(n, e, t, r) {
9112
+ function Ll(n, e, t, r) {
9086
9113
  let s = "missing revert data", i = null;
9087
9114
  const o = null;
9088
9115
  let a = null;
@@ -9151,7 +9178,7 @@ const kr = class {
9151
9178
  * @returns DataHexstring
9152
9179
  */
9153
9180
  encode(e, t) {
9154
- pi(t.length, e.length, "types/values length mismatch");
9181
+ yi(t.length, e.length, "types/values length mismatch");
9155
9182
  const r = e.map((o) => B(this, ze, xt).call(this, G.from(o))), s = new fr(r, "_"), i = new yn();
9156
9183
  return s.encode(i, t), i.data;
9157
9184
  }
@@ -9180,39 +9207,39 @@ const kr = class {
9180
9207
  * the Transaction %%tx%%.
9181
9208
  */
9182
9209
  static getBuiltinCallException(e, t, r) {
9183
- return Dl(e, t, r, kr.defaultAbiCoder());
9210
+ return Ll(e, t, r, kr.defaultAbiCoder());
9184
9211
  }
9185
9212
  };
9186
9213
  let Er = kr;
9187
9214
  ze = new WeakSet(), xt = function(e) {
9188
9215
  if (e.isArray())
9189
- return new fl(B(this, ze, xt).call(this, e.arrayChildren), e.arrayLength, e.name);
9216
+ return new yl(B(this, ze, xt).call(this, e.arrayChildren), e.arrayLength, e.name);
9190
9217
  if (e.isTuple())
9191
9218
  return new fr(e.components.map((r) => B(this, ze, xt).call(this, r)), e.name);
9192
9219
  switch (e.baseType) {
9193
9220
  case "address":
9194
- return new ll(e.name);
9195
- case "bool":
9196
9221
  return new dl(e.name);
9222
+ case "bool":
9223
+ return new ml(e.name);
9197
9224
  case "string":
9198
- return new El(e.name);
9225
+ return new Ol(e.name);
9199
9226
  case "bytes":
9200
- return new pl(e.name);
9201
- case "":
9202
9227
  return new gl(e.name);
9228
+ case "":
9229
+ return new vl(e.name);
9203
9230
  }
9204
- let t = e.type.match(Fl);
9231
+ let t = e.type.match(jl);
9205
9232
  if (t) {
9206
9233
  let r = parseInt(t[2] || "256");
9207
- return _(r !== 0 && r <= 256 && r % 8 === 0, "invalid " + t[1] + " bit length", "param", e), new _l(r / 8, t[1] === "int", e.name);
9234
+ return _(r !== 0 && r <= 256 && r % 8 === 0, "invalid " + t[1] + " bit length", "param", e), new Tl(r / 8, t[1] === "int", e.name);
9208
9235
  }
9209
- if (t = e.type.match(Cl), t) {
9236
+ if (t = e.type.match(Ul), t) {
9210
9237
  let r = parseInt(t[1]);
9211
- return _(r !== 0 && r <= 32, "invalid bytes length", "param", e), new yl(r, e.name);
9238
+ return _(r !== 0 && r <= 32, "invalid bytes length", "param", e), new wl(r, e.name);
9212
9239
  }
9213
9240
  _(!1, "invalid type", "type", e.type);
9214
9241
  };
9215
- class Ul {
9242
+ class Bl {
9216
9243
  constructor(e, t, r) {
9217
9244
  d(this, "fragment");
9218
9245
  d(this, "name");
@@ -9229,7 +9256,7 @@ class Ul {
9229
9256
  });
9230
9257
  }
9231
9258
  }
9232
- class jl {
9259
+ class Hl {
9233
9260
  constructor(e, t, r, s) {
9234
9261
  d(this, "fragment");
9235
9262
  d(this, "name");
@@ -9248,7 +9275,7 @@ class jl {
9248
9275
  });
9249
9276
  }
9250
9277
  }
9251
- class Ll {
9278
+ class Ml {
9252
9279
  constructor(e, t, r) {
9253
9280
  d(this, "fragment");
9254
9281
  d(this, "name");
@@ -9265,7 +9292,7 @@ class Ll {
9265
9292
  });
9266
9293
  }
9267
9294
  }
9268
- class Is {
9295
+ class Cs {
9269
9296
  constructor(e) {
9270
9297
  d(this, "hash");
9271
9298
  d(this, "_isIndexed");
@@ -9275,7 +9302,7 @@ class Is {
9275
9302
  return !!(e && e._isIndexed);
9276
9303
  }
9277
9304
  }
9278
- const Cs = {
9305
+ const Fs = {
9279
9306
  0: "generic panic",
9280
9307
  1: "assert(false)",
9281
9308
  17: "arithmetic overflow",
@@ -9286,7 +9313,7 @@ const Cs = {
9286
9313
  50: "out-of-bounds access of an array or bytesN",
9287
9314
  65: "out of memory",
9288
9315
  81: "uninitialized function"
9289
- }, Fs = {
9316
+ }, Ds = {
9290
9317
  "0x08c379a0": {
9291
9318
  signature: "Error(string)",
9292
9319
  name: "Error",
@@ -9299,7 +9326,7 @@ const Cs = {
9299
9326
  inputs: ["uint256"],
9300
9327
  reason: (n) => {
9301
9328
  let e = "unknown panic code";
9302
- return n >= 0 && n <= 255 && Cs[n.toString()] && (e = Cs[n.toString()]), `reverted with panic code 0x${n.toString(16)} (${e})`;
9329
+ return n >= 0 && n <= 255 && Fs[n.toString()] && (e = Fs[n.toString()]), `reverted with panic code 0x${n.toString(16)} (${e})`;
9303
9330
  }
9304
9331
  }
9305
9332
  };
@@ -9479,8 +9506,8 @@ const At = class {
9479
9506
  getError(e, t) {
9480
9507
  if (Ge(e)) {
9481
9508
  const s = e.toLowerCase();
9482
- if (Fs[s])
9483
- return ee.from(Fs[s].signature);
9509
+ if (Ds[s])
9510
+ return te.from(Ds[s].signature);
9484
9511
  for (const i of m(this, Ee).values())
9485
9512
  if (s === i.selector)
9486
9513
  return i;
@@ -9494,17 +9521,17 @@ const At = class {
9494
9521
  /* fix:) */
9495
9522
  )[0] === e && s.push(o);
9496
9523
  if (s.length === 0)
9497
- return e === "Error" ? ee.from("error Error(string)") : e === "Panic" ? ee.from("error Panic(uint256)") : null;
9524
+ return e === "Error" ? te.from("error Error(string)") : e === "Panic" ? te.from("error Panic(uint256)") : null;
9498
9525
  if (s.length > 1) {
9499
9526
  const i = s.map((o) => JSON.stringify(o.format())).join(", ");
9500
9527
  _(!1, `ambiguous error description (i.e. ${i})`, "name", e);
9501
9528
  }
9502
9529
  return s[0];
9503
9530
  }
9504
- if (e = ee.from(e).format(), e === "Error(string)")
9505
- return ee.from("error Error(string)");
9531
+ if (e = te.from(e).format(), e === "Error(string)")
9532
+ return te.from("error Error(string)");
9506
9533
  if (e === "Panic(uint256)")
9507
- return ee.from("error Panic(uint256)");
9534
+ return te.from("error Panic(uint256)");
9508
9535
  const r = m(this, Ee).get(e);
9509
9536
  return r || null;
9510
9537
  }
@@ -9728,7 +9755,7 @@ const At = class {
9728
9755
  x(t.length <= e.inputs.length, `too many arguments for ${e.format()}`, "UNEXPECTED_ARGUMENT", { count: t.length, expectedCount: e.inputs.length });
9729
9756
  const r = [];
9730
9757
  e.anonymous || r.push(e.topicHash);
9731
- const s = (i, o) => i.type === "string" ? Jt(o) : i.type === "bytes" ? Je(H(o)) : (i.type === "bool" && typeof o == "boolean" && (o = o ? "0x01" : "0x00"), i.type.match(/^u?int/) && (o = gi(o)), i.type === "address" && m(this, W).encode(["address"], [o]), iu(H(o), 32));
9758
+ const s = (i, o) => i.type === "string" ? Jt(o) : i.type === "bytes" ? Je(H(o)) : (i.type === "bool" && typeof o == "boolean" && (o = o ? "0x01" : "0x00"), i.type.match(/^u?int/) && (o = wi(o)), i.type === "address" && m(this, W).encode(["address"], [o]), cu(H(o), 32));
9732
9759
  for (t.forEach((i, o) => {
9733
9760
  const a = e.inputs[o];
9734
9761
  if (!a.indexed) {
@@ -9785,9 +9812,9 @@ const At = class {
9785
9812
  let v = null;
9786
9813
  if (p.indexed)
9787
9814
  if (a == null)
9788
- v = new Is(null);
9815
+ v = new Cs(null);
9789
9816
  else if (o[w])
9790
- v = new Is(a[y++]);
9817
+ v = new Cs(a[y++]);
9791
9818
  else
9792
9819
  try {
9793
9820
  v = a[y++];
@@ -9814,7 +9841,7 @@ const At = class {
9814
9841
  if (!s)
9815
9842
  return null;
9816
9843
  const i = m(this, W).decode(s.inputs, t.slice(4));
9817
- return new jl(s, s.selector, i, r);
9844
+ return new Hl(s, s.selector, i, r);
9818
9845
  }
9819
9846
  parseCallResult(e) {
9820
9847
  throw new Error("@TODO");
@@ -9827,7 +9854,7 @@ const At = class {
9827
9854
  */
9828
9855
  parseLog(e) {
9829
9856
  const t = this.getEvent(e.topics[0]);
9830
- return !t || t.anonymous ? null : new Ul(t, t.topicHash, this.decodeEventLog(t, e.data, e.topics));
9857
+ return !t || t.anonymous ? null : new Bl(t, t.topicHash, this.decodeEventLog(t, e.data, e.topics));
9831
9858
  }
9832
9859
  /**
9833
9860
  * Parses a revert data, finding the matching error and extracts
@@ -9840,7 +9867,7 @@ const At = class {
9840
9867
  if (!r)
9841
9868
  return null;
9842
9869
  const s = m(this, W).decode(r.inputs, vt(t, 4));
9843
- return new Ll(r, r.selector, s);
9870
+ return new Ml(r, r.selector, s);
9844
9871
  }
9845
9872
  /**
9846
9873
  * Creates a new [[Interface]] from the ABI %%value%%.
@@ -9871,7 +9898,7 @@ Ee = new WeakMap(), xe = new WeakMap(), Te = new WeakMap(), W = new WeakMap(), X
9871
9898
  if (t) {
9872
9899
  const o = t.length > 0 ? t[t.length - 1] : null;
9873
9900
  let a = t.length, c = !0;
9874
- K.isTyped(o) && o.type === "overrides" && (c = !1, a--);
9901
+ X.isTyped(o) && o.type === "overrides" && (c = !1, a--);
9875
9902
  for (let u = i.length - 1; u >= 0; u--) {
9876
9903
  const l = i[u].inputs.length;
9877
9904
  l !== a && (!c || l !== a - 1) && i.splice(u, 1);
@@ -9879,7 +9906,7 @@ Ee = new WeakMap(), xe = new WeakMap(), Te = new WeakMap(), W = new WeakMap(), X
9879
9906
  for (let u = i.length - 1; u >= 0; u--) {
9880
9907
  const l = i[u].inputs;
9881
9908
  for (let h = 0; h < t.length; h++)
9882
- if (K.isTyped(t[h])) {
9909
+ if (X.isTyped(t[h])) {
9883
9910
  if (h >= l.length) {
9884
9911
  if (t[h].type === "overrides")
9885
9912
  continue;
@@ -9928,7 +9955,7 @@ Ee = new WeakMap(), xe = new WeakMap(), Te = new WeakMap(), W = new WeakMap(), X
9928
9955
  for (let o = i.length - 1; o >= 0; o--) {
9929
9956
  const a = i[o].inputs;
9930
9957
  for (let c = 0; c < t.length; c++)
9931
- if (K.isTyped(t[c]) && t[c].type !== a[c].baseType) {
9958
+ if (X.isTyped(t[c]) && t[c].type !== a[c].baseType) {
9932
9959
  i.splice(o, 1);
9933
9960
  break;
9934
9961
  }
@@ -9945,11 +9972,11 @@ Ee = new WeakMap(), xe = new WeakMap(), Te = new WeakMap(), W = new WeakMap(), X
9945
9972
  const s = m(this, xe).get(Oe.from(e).format());
9946
9973
  return s || null;
9947
9974
  };
9948
- const Bl = BigInt(0);
9975
+ const Vl = BigInt(0);
9949
9976
  function Ne(n) {
9950
9977
  return n == null ? null : n.toString();
9951
9978
  }
9952
- function Hl(n) {
9979
+ function zl(n) {
9953
9980
  const e = {};
9954
9981
  n.to && (e.to = n.to), n.from && (e.from = n.from), n.data && (e.data = H(n.data));
9955
9982
  const t = "chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);
@@ -9958,9 +9985,9 @@ function Hl(n) {
9958
9985
  const r = "type,nonce".split(/,/);
9959
9986
  for (const s of r)
9960
9987
  !(s in n) || n[s] == null || (e[s] = Le(n[s], `request.${s}`));
9961
- return n.accessList && (e.accessList = xl(n.accessList)), "blockTag" in n && (e.blockTag = n.blockTag), "enableCcipRead" in n && (e.enableCcipReadEnabled = !!n.enableCcipRead), "customData" in n && (e.customData = n.customData), e;
9988
+ return n.accessList && (e.accessList = kl(n.accessList)), "blockTag" in n && (e.blockTag = n.blockTag), "enableCcipRead" in n && (e.enableCcipReadEnabled = !!n.enableCcipRead), "customData" in n && (e.customData = n.customData), e;
9962
9989
  }
9963
- class Vn {
9990
+ class zn {
9964
9991
  constructor(e, t) {
9965
9992
  d(this, "provider");
9966
9993
  d(this, "transactionHash");
@@ -10014,11 +10041,11 @@ class Vn {
10014
10041
  return x(!!e, "failed to find transaction receipt", "UNKNOWN_ERROR", {}), e;
10015
10042
  }
10016
10043
  removedEvent() {
10017
- return Vl(this);
10044
+ return Gl(this);
10018
10045
  }
10019
10046
  }
10020
10047
  var Yt;
10021
- class Ml {
10048
+ class ql {
10022
10049
  constructor(e, t) {
10023
10050
  d(this, "provider");
10024
10051
  d(this, "to");
@@ -10037,7 +10064,7 @@ class Ml {
10037
10064
  d(this, "status");
10038
10065
  d(this, "root");
10039
10066
  F(this, Yt, void 0);
10040
- P(this, Yt, Object.freeze(e.logs.map((r) => new Vn(r, t)))), S(this, {
10067
+ P(this, Yt, Object.freeze(e.logs.map((r) => new zn(r, t)))), S(this, {
10041
10068
  provider: t,
10042
10069
  to: e.to,
10043
10070
  from: e.from,
@@ -10124,15 +10151,15 @@ class Ml {
10124
10151
  return await this.provider.getBlockNumber() - this.blockNumber + 1;
10125
10152
  }
10126
10153
  removedEvent() {
10127
- return Mi(this);
10154
+ return Vi(this);
10128
10155
  }
10129
10156
  reorderedEvent(e) {
10130
- return x(!e || e.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }), Hi(this, e);
10157
+ return x(!e || e.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }), Mi(this, e);
10131
10158
  }
10132
10159
  }
10133
10160
  Yt = new WeakMap();
10134
10161
  var qe;
10135
- const Kn = class {
10162
+ const Xn = class {
10136
10163
  constructor(e, t) {
10137
10164
  d(this, "provider");
10138
10165
  d(this, "blockNumber");
@@ -10200,7 +10227,7 @@ const Kn = class {
10200
10227
  const c = async () => {
10201
10228
  if (a)
10202
10229
  return null;
10203
- const { blockNumber: h, nonce: y } = await fi({
10230
+ const { blockNumber: h, nonce: y } = await di({
10204
10231
  blockNumber: this.provider.getBlockNumber(),
10205
10232
  nonce: this.provider.getTransactionCount(this.from)
10206
10233
  });
@@ -10230,7 +10257,7 @@ const Kn = class {
10230
10257
  if (A == null || h - A.blockNumber + 1 < r)
10231
10258
  return;
10232
10259
  let C = "replaced";
10233
- g.data === this.data && g.to === this.to && g.value === this.value ? C = "repriced" : g.data === "0x" && g.from === g.to && g.value === Bl && (C = "cancelled"), x(!1, "transaction was replaced", "TRANSACTION_REPLACED", {
10260
+ g.data === this.data && g.to === this.to && g.value === this.value ? C = "repriced" : g.data === "0x" && g.from === g.to && g.value === Vl && (C = "cancelled"), x(!1, "transaction was replaced", "TRANSACTION_REPLACED", {
10234
10261
  cancelled: C === "replaced" || C === "cancelled",
10235
10262
  reason: C,
10236
10263
  replacement: g.replaceableTransaction(i),
@@ -10297,10 +10324,10 @@ const Kn = class {
10297
10324
  return this.type === 2;
10298
10325
  }
10299
10326
  removedEvent() {
10300
- return x(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), Mi(this);
10327
+ return x(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), Vi(this);
10301
10328
  }
10302
10329
  reorderedEvent(e) {
10303
- return x(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), x(!e || e.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), Hi(this, e);
10330
+ return x(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), x(!e || e.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }), Mi(this, e);
10304
10331
  }
10305
10332
  /**
10306
10333
  * Returns a new TransactionResponse instance which has the ability to
@@ -10313,19 +10340,19 @@ const Kn = class {
10313
10340
  */
10314
10341
  replaceableTransaction(e) {
10315
10342
  _(Number.isInteger(e) && e >= 0, "invalid startBlock", "startBlock", e);
10316
- const t = new Kn(this, this.provider);
10343
+ const t = new Xn(this, this.provider);
10317
10344
  return P(t, qe, e), t;
10318
10345
  }
10319
10346
  };
10320
- let xn = Kn;
10347
+ let xn = Xn;
10321
10348
  qe = new WeakMap();
10322
- function Hi(n, e) {
10349
+ function Mi(n, e) {
10323
10350
  return { orphan: "reorder-transaction", tx: n, other: e };
10324
10351
  }
10325
- function Mi(n) {
10352
+ function Vi(n) {
10326
10353
  return { orphan: "drop-transaction", tx: n };
10327
10354
  }
10328
- function Vl(n) {
10355
+ function Gl(n) {
10329
10356
  return { orphan: "drop-log", log: {
10330
10357
  transactionHash: n.transactionHash,
10331
10358
  blockHash: n.blockHash,
@@ -10336,7 +10363,7 @@ function Vl(n) {
10336
10363
  index: n.index
10337
10364
  } };
10338
10365
  }
10339
- class zn extends Vn {
10366
+ class qn extends zn {
10340
10367
  constructor(t, r, s) {
10341
10368
  super(t, t.provider);
10342
10369
  d(this, "interface");
@@ -10353,7 +10380,7 @@ class zn extends Vn {
10353
10380
  }
10354
10381
  }
10355
10382
  var Nt;
10356
- class zl extends Ml {
10383
+ class Jl extends ql {
10357
10384
  constructor(t, r, s) {
10358
10385
  super(s, r);
10359
10386
  F(this, Nt, void 0);
@@ -10362,13 +10389,13 @@ class zl extends Ml {
10362
10389
  get logs() {
10363
10390
  return super.logs.map((t) => {
10364
10391
  const r = t.topics.length ? m(this, Nt).getEvent(t.topics[0]) : null;
10365
- return r ? new zn(t, m(this, Nt), r) : t;
10392
+ return r ? new qn(t, m(this, Nt), r) : t;
10366
10393
  });
10367
10394
  }
10368
10395
  }
10369
10396
  Nt = new WeakMap();
10370
10397
  var Qt;
10371
- class qn extends xn {
10398
+ class Gn extends xn {
10372
10399
  constructor(t, r, s) {
10373
10400
  super(s, r);
10374
10401
  F(this, Qt, void 0);
@@ -10376,11 +10403,11 @@ class qn extends xn {
10376
10403
  }
10377
10404
  async wait(t) {
10378
10405
  const r = await super.wait();
10379
- return r == null ? null : new zl(m(this, Qt), this.provider, r);
10406
+ return r == null ? null : new Jl(m(this, Qt), this.provider, r);
10380
10407
  }
10381
10408
  }
10382
10409
  Qt = new WeakMap();
10383
- class Vi extends lu {
10410
+ class zi extends du {
10384
10411
  constructor(t, r, s, i) {
10385
10412
  super(t, r, s);
10386
10413
  d(this, "log");
@@ -10396,9 +10423,9 @@ class Vi extends lu {
10396
10423
  return await this.log.getTransactionReceipt();
10397
10424
  }
10398
10425
  }
10399
- class ql extends Vi {
10426
+ class Wl extends zi {
10400
10427
  constructor(e, t, r, s, i) {
10401
- super(e, t, r, new zn(i, e.interface, s));
10428
+ super(e, t, r, new qn(i, e.interface, s));
10402
10429
  const o = e.interface.decodeEventLog(s, this.log.data, this.log.topics);
10403
10430
  S(this, { args: o, fragment: s });
10404
10431
  }
@@ -10409,29 +10436,29 @@ class ql extends Vi {
10409
10436
  return this.fragment.format();
10410
10437
  }
10411
10438
  }
10412
- const Ds = BigInt(0);
10413
- function zi(n) {
10439
+ const Us = BigInt(0);
10440
+ function qi(n) {
10414
10441
  return n && typeof n.call == "function";
10415
10442
  }
10416
- function qi(n) {
10443
+ function Gi(n) {
10417
10444
  return n && typeof n.estimateGas == "function";
10418
10445
  }
10419
- function Gn(n) {
10446
+ function Jn(n) {
10420
10447
  return n && typeof n.resolveName == "function";
10421
10448
  }
10422
- function Gi(n) {
10449
+ function Ji(n) {
10423
10450
  return n && typeof n.sendTransaction == "function";
10424
10451
  }
10425
10452
  var er;
10426
- class Gl {
10453
+ class Kl {
10427
10454
  constructor(e, t, r) {
10428
10455
  F(this, er, void 0);
10429
10456
  d(this, "fragment");
10430
10457
  if (S(this, { fragment: t }), t.inputs.length < r.length)
10431
10458
  throw new Error("too many arguments");
10432
- const s = dt(e.runner, "resolveName"), i = Gn(s) ? s : null;
10459
+ const s = dt(e.runner, "resolveName"), i = Jn(s) ? s : null;
10433
10460
  P(this, er, async function() {
10434
- const o = await Promise.all(t.inputs.map((a, c) => r[c] == null ? null : a.walkAsync(r[c], (l, h) => l === "address" ? Mn(h, i) : h)));
10461
+ const o = await Promise.all(t.inputs.map((a, c) => r[c] == null ? null : a.walkAsync(r[c], (l, h) => l === "address" ? Vn(h, i) : h)));
10435
10462
  return e.interface.encodeFilterTopics(t, o);
10436
10463
  }());
10437
10464
  }
@@ -10440,7 +10467,7 @@ class Gl {
10440
10467
  }
10441
10468
  }
10442
10469
  er = new WeakMap();
10443
- function Jl() {
10470
+ function Xl() {
10444
10471
  return Function;
10445
10472
  }
10446
10473
  function dt(n, e) {
@@ -10449,15 +10476,15 @@ function dt(n, e) {
10449
10476
  function nt(n) {
10450
10477
  return n == null ? null : n.provider || null;
10451
10478
  }
10452
- async function Ji(n, e) {
10453
- const t = Hl(K.dereference(n, "overrides"));
10454
- return _(t.to == null || (e || []).indexOf("to") >= 0, "cannot override to", "overrides.to", t.to), _(t.data == null || (e || []).indexOf("data") >= 0, "cannot override data", "overrides.data", t.data), t.from && (t.from = await Mn(t.from)), t;
10479
+ async function Wi(n, e) {
10480
+ const t = zl(X.dereference(n, "overrides"));
10481
+ return _(t.to == null || (e || []).indexOf("to") >= 0, "cannot override to", "overrides.to", t.to), _(t.data == null || (e || []).indexOf("data") >= 0, "cannot override data", "overrides.data", t.data), t.from && (t.from = await Vn(t.from)), t;
10455
10482
  }
10456
- async function Wl(n, e, t) {
10457
- const r = dt(n, "resolveName"), s = Gn(r) ? r : null;
10458
- return await Promise.all(e.map((i, o) => i.walkAsync(t[o], (a, c) => (c = K.dereference(c, a), a === "address" ? Mn(c, s) : c))));
10483
+ async function Zl(n, e, t) {
10484
+ const r = dt(n, "resolveName"), s = Jn(r) ? r : null;
10485
+ return await Promise.all(e.map((i, o) => i.walkAsync(t[o], (a, c) => (c = X.dereference(c, a), a === "address" ? Vn(c, s) : c))));
10459
10486
  }
10460
- class Kl {
10487
+ class Yl {
10461
10488
  constructor(e) {
10462
10489
  d(this, "_contract");
10463
10490
  return S(this, { _contract: e }), new Proxy(this, {
@@ -10466,33 +10493,33 @@ class Kl {
10466
10493
  });
10467
10494
  }
10468
10495
  async populateTransaction(e) {
10469
- const t = await Ji(e, ["data"]);
10496
+ const t = await Wi(e, ["data"]);
10470
10497
  t.to = await this._contract.getAddress();
10471
10498
  const r = this._contract.interface, s = r.receive || r.fallback && r.fallback.payable;
10472
- return _(s || (t.value || Ds) === Ds, "cannot send value to non-payable contract", "overrides.value", t.value), _(r.fallback || (t.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", t.data), t;
10499
+ return _(s || (t.value || Us) === Us, "cannot send value to non-payable contract", "overrides.value", t.value), _(r.fallback || (t.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", t.data), t;
10473
10500
  }
10474
10501
  async staticCall(e) {
10475
10502
  const t = dt(this._contract.runner, "call");
10476
- x(zi(t), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
10503
+ x(qi(t), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
10477
10504
  const r = await this.populateTransaction(e);
10478
10505
  try {
10479
10506
  return await t.call(r);
10480
10507
  } catch (s) {
10481
- throw di(s) && s.data ? this._contract.interface.makeError(s.data, r) : s;
10508
+ throw pi(s) && s.data ? this._contract.interface.makeError(s.data, r) : s;
10482
10509
  }
10483
10510
  }
10484
10511
  async send(e) {
10485
10512
  const t = this._contract.runner;
10486
- x(Gi(t), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
10513
+ x(Ji(t), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
10487
10514
  const r = await t.sendTransaction(await this.populateTransaction(e)), s = nt(this._contract.runner);
10488
- return new qn(this._contract.interface, s, r);
10515
+ return new Gn(this._contract.interface, s, r);
10489
10516
  }
10490
10517
  async estimateGas(e) {
10491
10518
  const t = dt(this._contract.runner, "estimateGas");
10492
- return x(qi(t), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await t.estimateGas(await this.populateTransaction(e));
10519
+ return x(Gi(t), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await t.estimateGas(await this.populateTransaction(e));
10493
10520
  }
10494
10521
  }
10495
- class Xl extends Jl() {
10522
+ class Ql extends Xl() {
10496
10523
  constructor(t, r) {
10497
10524
  super();
10498
10525
  d(this, "name", "");
@@ -10524,10 +10551,10 @@ class Xl extends Jl() {
10524
10551
  async populateTransaction(...t) {
10525
10552
  const r = this.getFragment(...t);
10526
10553
  let s = {};
10527
- if (r.inputs.length + 1 === t.length && (s = await Ji(t.pop())), r.inputs.length !== t.length)
10554
+ if (r.inputs.length + 1 === t.length && (s = await Wi(t.pop())), r.inputs.length !== t.length)
10528
10555
  throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");
10529
- const i = await Wl(this._contract.runner, r.inputs, t);
10530
- return Object.assign({}, s, await fi({
10556
+ const i = await Zl(this._contract.runner, r.inputs, t);
10557
+ return Object.assign({}, s, await di({
10531
10558
  to: this._contract.getAddress(),
10532
10559
  data: this._contract.interface.encodeFunctionData(r, i)
10533
10560
  }));
@@ -10538,32 +10565,32 @@ class Xl extends Jl() {
10538
10565
  }
10539
10566
  async send(...t) {
10540
10567
  const r = this._contract.runner;
10541
- x(Gi(r), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
10568
+ x(Ji(r), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" });
10542
10569
  const s = await r.sendTransaction(await this.populateTransaction(...t)), i = nt(this._contract.runner);
10543
- return new qn(this._contract.interface, i, s);
10570
+ return new Gn(this._contract.interface, i, s);
10544
10571
  }
10545
10572
  async estimateGas(...t) {
10546
10573
  const r = dt(this._contract.runner, "estimateGas");
10547
- return x(qi(r), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await r.estimateGas(await this.populateTransaction(...t));
10574
+ return x(Gi(r), "contract runner does not support gas estimation", "UNSUPPORTED_OPERATION", { operation: "estimateGas" }), await r.estimateGas(await this.populateTransaction(...t));
10548
10575
  }
10549
10576
  async staticCallResult(...t) {
10550
10577
  const r = dt(this._contract.runner, "call");
10551
- x(zi(r), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
10578
+ x(qi(r), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" });
10552
10579
  const s = await this.populateTransaction(...t);
10553
10580
  let i = "0x";
10554
10581
  try {
10555
10582
  i = await r.call(s);
10556
10583
  } catch (a) {
10557
- throw di(a) && a.data ? this._contract.interface.makeError(a.data, s) : a;
10584
+ throw pi(a) && a.data ? this._contract.interface.makeError(a.data, s) : a;
10558
10585
  }
10559
10586
  const o = this.getFragment(...t);
10560
10587
  return this._contract.interface.decodeFunctionResult(o, i);
10561
10588
  }
10562
10589
  }
10563
- function Zl() {
10590
+ function eh() {
10564
10591
  return Function;
10565
10592
  }
10566
- class Yl extends Zl() {
10593
+ class th extends eh() {
10567
10594
  constructor(t, r) {
10568
10595
  super();
10569
10596
  d(this, "name", "");
@@ -10576,7 +10603,7 @@ class Yl extends Zl() {
10576
10603
  _key: r
10577
10604
  }), new Proxy(this, {
10578
10605
  // Perform the default operation for this fragment type
10579
- apply: (s, i, o) => new Gl(t, s.getFragment(...o), o)
10606
+ apply: (s, i, o) => new Kl(t, s.getFragment(...o), o)
10580
10607
  });
10581
10608
  }
10582
10609
  // Only works on non-ambiguous keys
@@ -10593,17 +10620,17 @@ class Yl extends Zl() {
10593
10620
  }), r;
10594
10621
  }
10595
10622
  }
10596
- const xr = Symbol.for("_ethersInternal_contract"), Wi = /* @__PURE__ */ new WeakMap();
10597
- function Ql(n, e) {
10598
- Wi.set(n[xr], e);
10623
+ const xr = Symbol.for("_ethersInternal_contract"), Ki = /* @__PURE__ */ new WeakMap();
10624
+ function rh(n, e) {
10625
+ Ki.set(n[xr], e);
10599
10626
  }
10600
10627
  function ce(n) {
10601
- return Wi.get(n[xr]);
10628
+ return Ki.get(n[xr]);
10602
10629
  }
10603
- function eh(n) {
10630
+ function nh(n) {
10604
10631
  return n && typeof n == "object" && "getTopicFilter" in n && typeof n.getTopicFilter == "function" && n.fragment;
10605
10632
  }
10606
- async function Jn(n, e) {
10633
+ async function Wn(n, e) {
10607
10634
  let t, r = null;
10608
10635
  if (Array.isArray(e)) {
10609
10636
  const i = function(o) {
@@ -10614,7 +10641,7 @@ async function Jn(n, e) {
10614
10641
  };
10615
10642
  t = e.map((o) => o == null ? null : Array.isArray(o) ? o.map(i) : i(o));
10616
10643
  } else
10617
- e === "*" ? t = [null] : typeof e == "string" ? Ge(e, 32) ? t = [e] : (r = n.interface.getEvent(e), _(r, "unknown fragment", "event", e), t = [r.topicHash]) : eh(e) ? t = await e.getTopicFilter() : "fragment" in e ? (r = e.fragment, t = [r.topicHash]) : _(!1, "unknown event name", "event", e);
10644
+ e === "*" ? t = [null] : typeof e == "string" ? Ge(e, 32) ? t = [e] : (r = n.interface.getEvent(e), _(r, "unknown fragment", "event", e), t = [r.topicHash]) : nh(e) ? t = await e.getTopicFilter() : "fragment" in e ? (r = e.fragment, t = [r.topicHash]) : _(!1, "unknown event name", "event", e);
10618
10645
  t = t.map((i) => {
10619
10646
  if (i == null)
10620
10647
  return null;
@@ -10629,12 +10656,12 @@ async function Jn(n, e) {
10629
10656
  }
10630
10657
  async function Bt(n, e) {
10631
10658
  const { subs: t } = ce(n);
10632
- return t.get((await Jn(n, e)).tag) || null;
10659
+ return t.get((await Wn(n, e)).tag) || null;
10633
10660
  }
10634
- async function Us(n, e, t) {
10661
+ async function js(n, e, t) {
10635
10662
  const r = nt(n.runner);
10636
10663
  x(r, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation: e });
10637
- const { fragment: s, tag: i, topics: o } = await Jn(n, t), { addr: a, subs: c } = ce(n);
10664
+ const { fragment: s, tag: i, topics: o } = await Wn(n, t), { addr: a, subs: c } = ce(n);
10638
10665
  let u = c.get(i);
10639
10666
  if (!u) {
10640
10667
  const h = { address: a || n, topics: o }, y = (g) => {
@@ -10645,10 +10672,10 @@ async function Us(n, e, t) {
10645
10672
  } catch {
10646
10673
  }
10647
10674
  if (A) {
10648
- const C = A, X = s ? n.interface.decodeEventLog(s, g.data, g.topics) : [];
10649
- On(n, t, X, (U) => new ql(n, U, t, C, g));
10675
+ const C = A, Z = s ? n.interface.decodeEventLog(s, g.data, g.topics) : [];
10676
+ On(n, t, Z, (U) => new Wl(n, U, t, C, g));
10650
10677
  } else
10651
- On(n, t, [], (C) => new Vi(n, C, t, g));
10678
+ On(n, t, [], (C) => new zi(n, C, t, g));
10652
10679
  };
10653
10680
  let p = [];
10654
10681
  u = { tag: i, listeners: [], start: () => {
@@ -10663,7 +10690,7 @@ async function Us(n, e, t) {
10663
10690
  return u;
10664
10691
  }
10665
10692
  let Tn = Promise.resolve();
10666
- async function th(n, e, t, r) {
10693
+ async function sh(n, e, t, r) {
10667
10694
  await Tn;
10668
10695
  const s = await Bt(n, e);
10669
10696
  if (!s)
@@ -10684,18 +10711,18 @@ async function On(n, e, t, r) {
10684
10711
  await Tn;
10685
10712
  } catch {
10686
10713
  }
10687
- const s = th(n, e, t, r);
10714
+ const s = sh(n, e, t, r);
10688
10715
  return Tn = s, await s;
10689
10716
  }
10690
- const js = ["then"];
10691
- var lh;
10717
+ const Ls = ["then"];
10718
+ var dh;
10692
10719
  const Ar = class {
10693
10720
  constructor(e, t, r, s) {
10694
10721
  d(this, "target");
10695
10722
  d(this, "interface");
10696
10723
  d(this, "runner");
10697
10724
  d(this, "filters");
10698
- d(this, lh);
10725
+ d(this, dh);
10699
10726
  d(this, "fallback");
10700
10727
  r == null && (r = null);
10701
10728
  const i = vn.from(t);
@@ -10703,7 +10730,7 @@ const Ar = class {
10703
10730
  let o, a = null, c = null;
10704
10731
  if (s) {
10705
10732
  const h = nt(r);
10706
- c = new qn(this.interface, h, s);
10733
+ c = new Gn(this.interface, h, s);
10707
10734
  }
10708
10735
  let u = /* @__PURE__ */ new Map();
10709
10736
  if (typeof e == "string")
@@ -10711,7 +10738,7 @@ const Ar = class {
10711
10738
  a = e, o = Promise.resolve(e);
10712
10739
  else {
10713
10740
  const h = dt(r, "resolveName");
10714
- if (!Gn(h))
10741
+ if (!Jn(h))
10715
10742
  throw Dr("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", {
10716
10743
  operation: "resolveName"
10717
10744
  });
@@ -10727,10 +10754,10 @@ const Ar = class {
10727
10754
  throw new Error("TODO");
10728
10755
  return ce(this).addr = h, h;
10729
10756
  });
10730
- Ql(this, { addrPromise: o, addr: a, deployTx: c, subs: u });
10757
+ rh(this, { addrPromise: o, addr: a, deployTx: c, subs: u });
10731
10758
  const l = new Proxy({}, {
10732
10759
  get: (h, y, p) => {
10733
- if (js.indexOf(y) >= 0)
10760
+ if (Ls.indexOf(y) >= 0)
10734
10761
  return Reflect.get(h, y, p);
10735
10762
  const w = String(y), v = this.getEvent(w);
10736
10763
  if (v)
@@ -10739,10 +10766,10 @@ const Ar = class {
10739
10766
  }
10740
10767
  });
10741
10768
  return S(this, { filters: l }), S(this, {
10742
- fallback: i.receive || i.fallback ? new Kl(this) : null
10769
+ fallback: i.receive || i.fallback ? new Yl(this) : null
10743
10770
  }), new Proxy(this, {
10744
10771
  get: (h, y, p) => {
10745
- if (y in h || js.indexOf(y) >= 0)
10772
+ if (y in h || Ls.indexOf(y) >= 0)
10746
10773
  return Reflect.get(h, y, p);
10747
10774
  const w = String(y), v = h.getFunction(w);
10748
10775
  if (v)
@@ -10787,17 +10814,17 @@ const Ar = class {
10787
10814
  return ce(this).deployTx;
10788
10815
  }
10789
10816
  getFunction(e) {
10790
- return typeof e != "string" && (e = e.format()), new Xl(this, e);
10817
+ return typeof e != "string" && (e = e.format()), new Ql(this, e);
10791
10818
  }
10792
10819
  getEvent(e) {
10793
- return typeof e != "string" && (e = e.format()), new Yl(this, e);
10820
+ return typeof e != "string" && (e = e.format()), new th(this, e);
10794
10821
  }
10795
10822
  async queryTransaction(e) {
10796
10823
  throw new Error("@TODO");
10797
10824
  }
10798
10825
  async queryFilter(e, t, r) {
10799
10826
  t == null && (t = 0), r == null && (r = "latest");
10800
- const { addr: s, addrPromise: i } = ce(this), o = s || await i, { fragment: a, topics: c } = await Jn(this, e), u = { address: o, topics: c, fromBlock: t, toBlock: r }, l = nt(this.runner);
10827
+ const { addr: s, addrPromise: i } = ce(this), o = s || await i, { fragment: a, topics: c } = await Wn(this, e), u = { address: o, topics: c, fromBlock: t, toBlock: r }, l = nt(this.runner);
10801
10828
  return x(l, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }), (await l.getLogs(u)).map((h) => {
10802
10829
  let y = a;
10803
10830
  if (y == null)
@@ -10805,15 +10832,15 @@ const Ar = class {
10805
10832
  y = this.interface.getEvent(h.topics[0]);
10806
10833
  } catch {
10807
10834
  }
10808
- return y ? new zn(h, this.interface, y) : new Vn(h, l);
10835
+ return y ? new qn(h, this.interface, y) : new zn(h, l);
10809
10836
  });
10810
10837
  }
10811
10838
  async on(e, t) {
10812
- const r = await Us(this, "on", e);
10839
+ const r = await js(this, "on", e);
10813
10840
  return r.listeners.push({ listener: t, once: !1 }), r.start(), this;
10814
10841
  }
10815
10842
  async once(e, t) {
10816
- const r = await Us(this, "once", e);
10843
+ const r = await js(this, "once", e);
10817
10844
  return r.listeners.push({ listener: t, once: !0 }), r.start(), this;
10818
10845
  }
10819
10846
  async emit(e, ...t) {
@@ -10885,11 +10912,11 @@ const Ar = class {
10885
10912
  }
10886
10913
  };
10887
10914
  let kn = Ar;
10888
- lh = xr;
10889
- function rh() {
10915
+ dh = xr;
10916
+ function ih() {
10890
10917
  return kn;
10891
10918
  }
10892
- class nh extends rh() {
10919
+ class oh extends ih() {
10893
10920
  }
10894
10921
  class Ft {
10895
10922
  constructor(e) {
@@ -10913,7 +10940,7 @@ class Ft {
10913
10940
  if (!o)
10914
10941
  throw new Error("function not in ABI");
10915
10942
  return o.outputs.map((a, c) => ({
10916
- source: `function:${s.function}:${i}`,
10943
+ source: `function:${s.function}:${c}`,
10917
10944
  name: a.name,
10918
10945
  type: a.type,
10919
10946
  key: `func_${i}_ret_${c}`,
@@ -10925,11 +10952,15 @@ class Ft {
10925
10952
  );
10926
10953
  }
10927
10954
  async addFunction(e, t, r, s, i) {
10928
- console.log(i);
10929
- const o = new nh(e, s);
10930
- return o.interface.encodeFunctionData(t, r), i = i || await this.getAbiHash(s), console.log(i), this.data.push({
10955
+ const o = s.find((c) => c.name === t);
10956
+ if (!o)
10957
+ throw new Error("function not in ABI");
10958
+ if (o.type !== "function")
10959
+ throw new Error(`${o.name} is not a function, it has type ${o.type}`);
10960
+ const a = new oh(e, s);
10961
+ return a.interface.encodeFunctionData(t, r), i = i || await this.getAbiHash(s), this.data.push({
10931
10962
  address: e,
10932
- bytecode: o.interface.encodeFunctionData(t, r),
10963
+ bytecode: a.interface.encodeFunctionData(t, r),
10933
10964
  abiHash: i,
10934
10965
  function: t
10935
10966
  }), this;
@@ -10939,11 +10970,11 @@ class Ft {
10939
10970
  }
10940
10971
  static schema() {
10941
10972
  return ut().of(
10942
- oe({
10943
- address: O().required(),
10944
- bytecode: O().matches(/^(0x)?([0-9a-fA-F]{2})*$/).required(),
10945
- abiHash: O().matches(/^[A-Fa-f0-9]{64}/).required(),
10946
- function: O().required()
10973
+ K({
10974
+ address: T().required(),
10975
+ bytecode: T().matches(/^(0x)?([0-9a-fA-F]{2})*$/).required(),
10976
+ abiHash: T().matches(/^[A-Fa-f0-9]{64}/).required(),
10977
+ function: T().required()
10947
10978
  })
10948
10979
  );
10949
10980
  }
@@ -11106,11 +11137,11 @@ class Mr {
11106
11137
  return this.groups;
11107
11138
  }
11108
11139
  static schema() {
11109
- const e = O().oneOf(["AND", "OR", "XOR", "NAND", "NOR", "WHERE"]).required(), t = oe({
11140
+ const e = T().oneOf(["AND", "OR", "XOR", "NAND", "NOR", "WHERE"]).required(), t = K({
11110
11141
  logic: e,
11111
- key: O().required(),
11112
- type: O().oneOf(["String", "Address", "Number"]).required(),
11113
- operation: O().when("type", ([r], s) => {
11142
+ key: T().required(),
11143
+ type: T().oneOf(["String", "Address", "Number"]).required(),
11144
+ operation: T().when("type", ([r], s) => {
11114
11145
  switch (r) {
11115
11146
  case "String":
11116
11147
  return s.oneOf([
@@ -11129,12 +11160,12 @@ class Mr {
11129
11160
  throw new Error("Invalid Filter Data Type");
11130
11161
  }
11131
11162
  }).required(),
11132
- constant: ni().when("type", ([r]) => {
11163
+ constant: si().when("type", ([r]) => {
11133
11164
  switch (r) {
11134
11165
  case "String":
11135
- return O();
11166
+ return T();
11136
11167
  case "Address":
11137
- return O();
11168
+ return T();
11138
11169
  case "Number":
11139
11170
  return q();
11140
11171
  default:
@@ -11143,21 +11174,21 @@ class Mr {
11143
11174
  }).required()
11144
11175
  });
11145
11176
  return ut().of(
11146
- oe({
11177
+ K({
11147
11178
  logic: e,
11148
11179
  conditions: ut().of(t).required()
11149
11180
  })
11150
11181
  );
11151
11182
  }
11152
11183
  }
11153
- const sh = "handler_function_call_v2", ih = /^(\d+)([SMHD])$/i, Ls = oe({
11154
- timeBase: O().oneOf(["blocks", "time"]).required(),
11184
+ const ah = "handler_function_call_v2", ch = /^(\d+)([SMHD])$/i, Bs = K({
11185
+ timeBase: T().oneOf(["blocks", "time"]).required(),
11155
11186
  nBlocks: q().min(10).when(
11156
11187
  "timeBase",
11157
11188
  ([n], e) => n === "blocks" ? e.required() : e
11158
11189
  ),
11159
- timePeriod: O().matches(
11160
- ih,
11190
+ timePeriod: T().matches(
11191
+ ch,
11161
11192
  "timePeriod must be of the format n[s|m|h|d], eg 10s for 10 seconds"
11162
11193
  ).when(
11163
11194
  "timeBase",
@@ -11166,9 +11197,9 @@ const sh = "handler_function_call_v2", ih = /^(\d+)([SMHD])$/i, Ls = oe({
11166
11197
  startTime: q().default(0),
11167
11198
  debounceCount: q().default(0),
11168
11199
  functions: Ft.schema().required(),
11169
- triggerOn: O().oneOf(["always", "filter"]).default("always"),
11200
+ triggerOn: T().oneOf(["always", "filter"]).default("always"),
11170
11201
  latch: Fn().default(!1),
11171
- filterVersion: O().when(
11202
+ filterVersion: T().when(
11172
11203
  "triggerOn",
11173
11204
  ([n], e) => n === "filter" ? e.default("0") : e.nullable().default(null)
11174
11205
  ).required(),
@@ -11184,15 +11215,15 @@ class nn {
11184
11215
  // doesn't matter, deprecated
11185
11216
  network: t,
11186
11217
  nickname: e,
11187
- type: sh,
11218
+ type: ah,
11188
11219
  handler: await this.validate(r)
11189
11220
  };
11190
11221
  }
11191
11222
  static validate(e) {
11192
- return Ls.validateSync(e);
11223
+ return Bs.validateSync(e);
11193
11224
  }
11194
11225
  static async convertFromPartial(e) {
11195
- return Ls.validate(e);
11226
+ return Bs.validate(e);
11196
11227
  }
11197
11228
  static readFields(e, t) {
11198
11229
  const r = [
@@ -11229,24 +11260,24 @@ class nn {
11229
11260
  ];
11230
11261
  }
11231
11262
  }
11232
- const oh = "handler_onchain_event_v2", ah = oe({
11233
- addresses: ut().of(O().required()).required(),
11234
- abiHash: O().required(),
11235
- event: O().required(),
11263
+ const uh = "handler_onchain_event_v2", lh = K({
11264
+ addresses: ut().of(T().required()).required(),
11265
+ abiHash: T().required(),
11266
+ event: T().required(),
11236
11267
  debounceCount: q().default(0),
11237
11268
  functions: Ft.schema().nullable().default(null),
11238
- triggerOn: O().oneOf(["always", "filter"]).default("always"),
11269
+ triggerOn: T().oneOf(["always", "filter"]).default("always"),
11239
11270
  latch: Fn().default(!1),
11240
- filterVersion: O().nullable().default(null),
11271
+ filterVersion: T().nullable().default(null),
11241
11272
  filter: Mr.schema().when(
11242
11273
  "triggerOn",
11243
11274
  ([n], e) => n === "filter" ? e : e.nullable().default(null)
11244
11275
  ).required()
11245
- }), ch = (n) => n, Ki = (n, e, t = [], r = "", s = "") => (n.forEach((i, o) => {
11276
+ }), hh = (n) => n, Xi = (n, e, t = [], r = "", s = "") => (n.forEach((i, o) => {
11246
11277
  const a = i.type.includes("["), c = a ? "_[]" : "";
11247
11278
  if (i.components) {
11248
11279
  const u = i.name === "" ? `${o}` : i.name;
11249
- Ki(
11280
+ Xi(
11250
11281
  i.components,
11251
11282
  e,
11252
11283
  t,
@@ -11257,7 +11288,7 @@ const oh = "handler_onchain_event_v2", ah = oe({
11257
11288
  t.push({
11258
11289
  source: e,
11259
11290
  label: `${s}${i.name}`,
11260
- type: ch(i.type),
11291
+ type: hh(i.type),
11261
11292
  key: `${r}${o}${c}`,
11262
11293
  index: o
11263
11294
  });
@@ -11269,12 +11300,12 @@ class sn {
11269
11300
  // doesn't matter, deprecated
11270
11301
  network: t,
11271
11302
  nickname: e,
11272
- type: oh,
11303
+ type: uh,
11273
11304
  handler: await this.validate(r)
11274
11305
  };
11275
11306
  }
11276
11307
  static validate(e) {
11277
- return ah.validateSync(e);
11308
+ return lh.validateSync(e);
11278
11309
  }
11279
11310
  static readFields(e, t) {
11280
11311
  let r = [
@@ -11321,7 +11352,7 @@ class sn {
11321
11352
  const s = t[e.abiHash].find(
11322
11353
  (o) => o.name === e.event
11323
11354
  );
11324
- if (r = Ki(
11355
+ if (r = Xi(
11325
11356
  s.inputs,
11326
11357
  `${e.event} Event`,
11327
11358
  r,
@@ -11345,13 +11376,13 @@ class Ht {
11345
11376
  s
11346
11377
  );
11347
11378
  case "PollFunctionV1":
11348
- return ps.SimpleToRaw(
11379
+ return ys.SimpleToRaw(
11349
11380
  e,
11350
11381
  r,
11351
11382
  s
11352
11383
  );
11353
11384
  case "OnchainEventV1":
11354
- return ys.SimpleToRaw(
11385
+ return ms.SimpleToRaw(
11355
11386
  e,
11356
11387
  r,
11357
11388
  s
@@ -11371,9 +11402,9 @@ class Ht {
11371
11402
  case "PollFunctionV2":
11372
11403
  return nn.validate(t);
11373
11404
  case "PollFunctionV1":
11374
- return ps.validate(t);
11375
- case "OnchainEventV1":
11376
11405
  return ys.validate(t);
11406
+ case "OnchainEventV1":
11407
+ return ms.validate(t);
11377
11408
  case "OnchainEventV2":
11378
11409
  return sn.validate(t);
11379
11410
  default:
@@ -11432,8 +11463,8 @@ class Ht {
11432
11463
  }
11433
11464
  }
11434
11465
  }
11435
- const Bs = (n) => `https://${n}.functions.supabase.co/`, Hs = (n) => `https://${n}.supabase.co/`, Ms = "fdgtrxmmrtlokhgkvcjz", uh = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZkZ3RyeG1tcnRsb2toZ2t2Y2p6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzMwODcwNzYsImV4cCI6MTk4ODY2MzA3Nn0.sAMxjlcJSSozBGr-LNcsudyxzUEM9e-UspMHHQLqLr4";
11436
- class Xi {
11466
+ const Hs = (n) => `https://${n}.functions.supabase.co/`, Ms = (n) => `https://${n}.supabase.co/`, Vs = "fdgtrxmmrtlokhgkvcjz", fh = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZkZ3RyeG1tcnRsb2toZ2t2Y2p6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzMwODcwNzYsImV4cCI6MTk4ODY2MzA3Nn0.sAMxjlcJSSozBGr-LNcsudyxzUEM9e-UspMHHQLqLr4";
11467
+ class Zi {
11437
11468
  constructor(e, t) {
11438
11469
  d(this, "headers", {});
11439
11470
  this.url = e, this.headers = {
@@ -11446,7 +11477,7 @@ class Xi {
11446
11477
  if (e.key)
11447
11478
  throw new Error("Auth by key not yet supported");
11448
11479
  if (e.email && e.password) {
11449
- const s = e.projectId ? Hs(e.projectId) : Hs(Ms), i = e.projectId ? Bs(e.projectId) : Bs(Ms), o = e.anonKey ? e.anonKey : uh, a = nc(s, o), { data: c, error: u } = await a.auth.signInWithPassword({
11480
+ const s = e.projectId ? Ms(e.projectId) : Ms(Vs), i = e.projectId ? Hs(e.projectId) : Hs(Vs), o = e.anonKey ? e.anonKey : fh, a = sc(s, o), { data: c, error: u } = await a.auth.signInWithPassword({
11450
11481
  email: e.email,
11451
11482
  password: e.password
11452
11483
  });
@@ -11454,7 +11485,7 @@ class Xi {
11454
11485
  throw u;
11455
11486
  if (((t = c.session) == null ? void 0 : t.access_token) === void 0)
11456
11487
  throw new Error("Access token not found");
11457
- return new Xi(i, (r = c.session) == null ? void 0 : r.access_token);
11488
+ return new Zi(i, (r = c.session) == null ? void 0 : r.access_token);
11458
11489
  } else
11459
11490
  throw new Error(
11460
11491
  "Authentication Required. DeNotify supports either username/password or API key authentication"
@@ -11555,7 +11586,7 @@ class Xi {
11555
11586
  );
11556
11587
  }
11557
11588
  }
11558
- class Zi {
11589
+ class Yi {
11559
11590
  constructor(e) {
11560
11591
  d(this, "network");
11561
11592
  d(this, "triggerId");
@@ -11565,7 +11596,7 @@ class Zi {
11565
11596
  this.name = e;
11566
11597
  }
11567
11598
  static create(e) {
11568
- return new Zi(e);
11599
+ return new Yi(e);
11569
11600
  }
11570
11601
  onNetwork(e) {
11571
11602
  return this.network = e, this;
@@ -11600,16 +11631,16 @@ class Zi {
11600
11631
  };
11601
11632
  }
11602
11633
  }
11603
- const fh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11634
+ const yh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11604
11635
  __proto__: null
11605
- }, Symbol.toStringTag, { value: "Module" })), dh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11636
+ }, Symbol.toStringTag, { value: "Module" })), mh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11606
11637
  __proto__: null
11607
11638
  }, Symbol.toStringTag, { value: "Module" }));
11608
11639
  export {
11609
- Zi as AlertBuilder,
11610
- Xi as DeNotifyClient,
11640
+ Yi as AlertBuilder,
11641
+ Zi as DeNotifyClient,
11611
11642
  Mr as FilterBuilder,
11612
11643
  Ft as FunctionBuilder,
11613
- dh as Notification,
11614
- fh as Trigger
11644
+ mh as Notification,
11645
+ yh as Trigger
11615
11646
  };