bmlt-query-client 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.js CHANGED
@@ -1,1959 +1,1400 @@
1
- var De = Object.defineProperty;
2
- var be = (r) => {
3
- throw TypeError(r);
4
- };
5
- var $e = (r, e, t) => e in r ? De(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
6
- var R = (r, e, t) => $e(r, typeof e != "symbol" ? e + "" : e, t), me = (r, e, t) => e.has(r) || be("Cannot " + t);
7
- var n = (r, e, t) => (me(r, e, "read from private field"), t ? t.call(r) : e.get(r)), p = (r, e, t) => e.has(r) ? be("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), w = (r, e, t, i) => (me(r, e, "write to private field"), i ? i.call(r, t) : e.set(r, t), t), m = (r, e, t) => (me(r, e, "access private method"), t);
8
- var H = (r, e, t, i) => ({
9
- set _(s) {
10
- w(r, e, s, t);
11
- },
12
- get _() {
13
- return n(r, e, i);
14
- }
15
- });
16
- const Me = Object.prototype.toString, qe = (r) => Me.call(r) === "[object Error]", Ve = /* @__PURE__ */ new Set([
17
- "network error",
18
- // Chrome
19
- "NetworkError when attempting to fetch resource.",
20
- // Firefox
21
- "The Internet connection appears to be offline.",
22
- // Safari 16
23
- "Network request failed",
24
- // `cross-fetch`
25
- "fetch failed",
26
- // Undici (Node.js)
27
- "terminated",
28
- // Undici (Node.js)
29
- " A network error occurred.",
30
- // Bun (WebKit)
31
- "Network connection lost"
32
- // Cloudflare Workers (fetch)
1
+ //#region \0rolldown/runtime.js
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), s = (e, i, o, s) => {
3
+ if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
4
+ get: ((e) => i[e]).bind(null, d),
5
+ enumerable: !(s = n(i, d)) || s.enumerable
6
+ });
7
+ return e;
8
+ }, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
9
+ value: n,
10
+ enumerable: !0
11
+ }) : a, n)), l = Object.prototype.toString, u = (e) => l.call(e) === "[object Error]", d = new Set([
12
+ "network error",
13
+ "NetworkError when attempting to fetch resource.",
14
+ "The Internet connection appears to be offline.",
15
+ "Network request failed",
16
+ "fetch failed",
17
+ "terminated",
18
+ " A network error occurred.",
19
+ "Network connection lost"
33
20
  ]);
34
- function Ye(r) {
35
- if (!(r && qe(r) && r.name === "TypeError" && typeof r.message == "string"))
36
- return !1;
37
- const { message: t, stack: i } = r;
38
- return t === "Load failed" ? i === void 0 || "__sentry_captured__" in r : t.startsWith("error sending request for url") || t === "Failed to fetch" || t.startsWith("Failed to fetch (") && t.endsWith(")") ? !0 : Ve.has(t);
21
+ function f(e) {
22
+ if (!(e && u(e) && e.name === "TypeError" && typeof e.message == "string")) return !1;
23
+ let { message: t, stack: n } = e;
24
+ return t === "Load failed" ? n === void 0 || "__sentry_captured__" in e : t.startsWith("error sending request for url") || t === "Failed to fetch" || t.startsWith("Failed to fetch (") && t.endsWith(")") ? !0 : d.has(t);
25
+ }
26
+ //#endregion
27
+ //#region node_modules/p-retry/index.js
28
+ function p(e) {
29
+ if (typeof e == "number") {
30
+ if (e < 0) throw TypeError("Expected `retries` to be a non-negative number.");
31
+ if (Number.isNaN(e)) throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.");
32
+ } else if (e !== void 0) throw TypeError("Expected `retries` to be a number or Infinity.");
33
+ }
34
+ function m(e, t, { min: n = 0, allowInfinity: r = !1 } = {}) {
35
+ if (t !== void 0) {
36
+ if (typeof t != "number" || Number.isNaN(t)) throw TypeError(`Expected \`${e}\` to be a number${r ? " or Infinity" : ""}.`);
37
+ if (!r && !Number.isFinite(t)) throw TypeError(`Expected \`${e}\` to be a finite number.`);
38
+ if (t < n) throw TypeError(`Expected \`${e}\` to be \u2265 ${n}.`);
39
+ }
40
+ }
41
+ function h(e, t) {
42
+ if (t !== void 0 && typeof t != "function") throw TypeError(`Expected \`${e}\` to be a function.`);
43
+ }
44
+ var ee = class extends Error {
45
+ constructor(e) {
46
+ super(), e instanceof Error ? (this.originalError = e, {message: e} = e) : (this.originalError = Error(e), this.originalError.stack = this.stack), this.name = "AbortError", this.message = e;
47
+ }
48
+ };
49
+ function te(e, t) {
50
+ let n = Math.max(1, e + 1), r = t.randomize ? Math.random() + 1 : 1, i = Math.round(r * t.minTimeout * t.factor ** (n - 1));
51
+ return i = Math.min(i, t.maxTimeout), i;
39
52
  }
40
- function ze(r) {
41
- if (typeof r == "number") {
42
- if (r < 0)
43
- throw new TypeError("Expected `retries` to be a non-negative number.");
44
- if (Number.isNaN(r))
45
- throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.");
46
- } else if (r !== void 0)
47
- throw new TypeError("Expected `retries` to be a number or Infinity.");
53
+ function g(e, t) {
54
+ return Number.isFinite(t) ? t - (performance.now() - e) : t;
48
55
  }
49
- function ne(r, e, { min: t = 0, allowInfinity: i = !1 } = {}) {
50
- if (e !== void 0) {
51
- if (typeof e != "number" || Number.isNaN(e))
52
- throw new TypeError(`Expected \`${r}\` to be a number${i ? " or Infinity" : ""}.`);
53
- if (!i && !Number.isFinite(e))
54
- throw new TypeError(`Expected \`${r}\` to be a finite number.`);
55
- if (e < t)
56
- throw new TypeError(`Expected \`${r}\` to be ≥ ${t}.`);
57
- }
56
+ async function ne(e, t) {
57
+ e <= 0 || await new Promise((n, r) => {
58
+ let i = () => {
59
+ clearTimeout(a), t.signal?.removeEventListener("abort", i), r(t.signal.reason);
60
+ }, a = setTimeout(() => {
61
+ t.signal?.removeEventListener("abort", i), n();
62
+ }, e);
63
+ t.unref && a.unref?.(), t.signal?.addEventListener("abort", i, { once: !0 });
64
+ });
58
65
  }
59
- class He extends Error {
60
- constructor(e) {
61
- super(), e instanceof Error ? (this.originalError = e, { message: e } = e) : (this.originalError = new Error(e), this.originalError.stack = this.stack), this.name = "AbortError", this.message = e;
62
- }
66
+ async function re({ error: e, attemptNumber: t, retriesConsumed: n, startTime: r, options: i }) {
67
+ let a = e instanceof Error ? e : /* @__PURE__ */ TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);
68
+ if (a instanceof ee) throw a.originalError;
69
+ let o = Number.isFinite(i.retries) ? Math.max(0, i.retries - n) : i.retries, s = i.maxRetryTime ?? Infinity, c = te(n, i);
70
+ if (g(r, s) <= 0) {
71
+ let e = Object.freeze({
72
+ error: a,
73
+ attemptNumber: t,
74
+ retriesLeft: o,
75
+ retriesConsumed: n,
76
+ retryDelay: 0
77
+ });
78
+ throw await i.onFailedAttempt(e), a;
79
+ }
80
+ let l = Object.freeze({
81
+ error: a,
82
+ attemptNumber: t,
83
+ retriesLeft: o,
84
+ retriesConsumed: n,
85
+ retryDelay: o > 0 ? c : 0
86
+ }), u = await i.shouldConsumeRetry(l), d = u && o > 0 ? c : 0, p = Object.freeze({
87
+ error: a,
88
+ attemptNumber: t,
89
+ retriesLeft: o,
90
+ retriesConsumed: n,
91
+ retryDelay: d
92
+ });
93
+ if (await i.onFailedAttempt(p), g(r, s) <= 0 || g(r, s) <= 0 || o <= 0 || a instanceof TypeError && !f(a) || !await i.shouldRetry(p)) throw a;
94
+ let m = g(r, s);
95
+ if (m <= 0) throw a;
96
+ if (!u) return i.signal?.throwIfAborted(), !1;
97
+ let h = Math.min(d, m);
98
+ return i.signal?.throwIfAborted(), await ne(h, i), i.signal?.throwIfAborted(), !0;
63
99
  }
64
- function Je(r, e) {
65
- const t = Math.max(1, r + 1), i = e.randomize ? Math.random() + 1 : 1;
66
- let s = Math.round(i * e.minTimeout * e.factor ** (t - 1));
67
- return s = Math.min(s, e.maxTimeout), s;
100
+ async function ie(e, t = {}) {
101
+ var n, r, i, a, o, s, c, l, u;
102
+ if (t = { ...t }, p(t.retries), Object.hasOwn(t, "forever")) throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");
103
+ (n = t).retries ?? (n.retries = 10), (r = t).factor ?? (r.factor = 2), (i = t).minTimeout ?? (i.minTimeout = 1e3), (a = t).maxTimeout ?? (a.maxTimeout = Infinity), (o = t).maxRetryTime ?? (o.maxRetryTime = Infinity), (s = t).randomize ?? (s.randomize = !1), (c = t).onFailedAttempt ?? (c.onFailedAttempt = () => {}), (l = t).shouldRetry ?? (l.shouldRetry = () => !0), (u = t).shouldConsumeRetry ?? (u.shouldConsumeRetry = () => !0), h("onFailedAttempt", t.onFailedAttempt), h("shouldRetry", t.shouldRetry), h("shouldConsumeRetry", t.shouldConsumeRetry), m("factor", t.factor, {
104
+ min: 0,
105
+ allowInfinity: !1
106
+ }), m("minTimeout", t.minTimeout, {
107
+ min: 0,
108
+ allowInfinity: !1
109
+ }), m("maxTimeout", t.maxTimeout, {
110
+ min: 0,
111
+ allowInfinity: !0
112
+ }), m("maxRetryTime", t.maxRetryTime, {
113
+ min: 0,
114
+ allowInfinity: !0
115
+ }), t.factor > 0 || (t.factor = 1), t.signal?.throwIfAborted();
116
+ let d = 0, f = 0, ee = performance.now();
117
+ for (; !Number.isFinite(t.retries) || f <= t.retries;) {
118
+ d++;
119
+ try {
120
+ t.signal?.throwIfAborted();
121
+ let n = await e(d);
122
+ return t.signal?.throwIfAborted(), n;
123
+ } catch (e) {
124
+ await re({
125
+ error: e,
126
+ attemptNumber: d,
127
+ retriesConsumed: f,
128
+ startTime: ee,
129
+ options: t
130
+ }) && f++;
131
+ }
132
+ }
133
+ throw Error("Retry attempts exhausted without throwing an error.");
68
134
  }
69
- function Te(r, e) {
70
- return Number.isFinite(e) ? e - (performance.now() - r) : e;
135
+ //#endregion
136
+ //#region node_modules/eventemitter3/index.mjs
137
+ var ae = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
138
+ var n = Object.prototype.hasOwnProperty, r = "~";
139
+ function i() {}
140
+ Object.create && (i.prototype = Object.create(null), new i().__proto__ || (r = !1));
141
+ function a(e, t, n) {
142
+ this.fn = e, this.context = t, this.once = n || !1;
143
+ }
144
+ function o(e, t, n, i, o) {
145
+ if (typeof n != "function") throw TypeError("The listener must be a function");
146
+ var s = new a(n, i || e, o), c = r ? r + t : t;
147
+ return e._events[c] ? e._events[c].fn ? e._events[c] = [e._events[c], s] : e._events[c].push(s) : (e._events[c] = s, e._eventsCount++), e;
148
+ }
149
+ function s(e, t) {
150
+ --e._eventsCount === 0 ? e._events = new i() : delete e._events[t];
151
+ }
152
+ function c() {
153
+ this._events = new i(), this._eventsCount = 0;
154
+ }
155
+ c.prototype.eventNames = function() {
156
+ var e = [], t, i;
157
+ if (this._eventsCount === 0) return e;
158
+ for (i in t = this._events) n.call(t, i) && e.push(r ? i.slice(1) : i);
159
+ return Object.getOwnPropertySymbols ? e.concat(Object.getOwnPropertySymbols(t)) : e;
160
+ }, c.prototype.listeners = function(e) {
161
+ var t = r ? r + e : e, n = this._events[t];
162
+ if (!n) return [];
163
+ if (n.fn) return [n.fn];
164
+ for (var i = 0, a = n.length, o = Array(a); i < a; i++) o[i] = n[i].fn;
165
+ return o;
166
+ }, c.prototype.listenerCount = function(e) {
167
+ var t = r ? r + e : e, n = this._events[t];
168
+ return n ? n.fn ? 1 : n.length : 0;
169
+ }, c.prototype.emit = function(e, t, n, i, a, o) {
170
+ var s = r ? r + e : e;
171
+ if (!this._events[s]) return !1;
172
+ var c = this._events[s], l = arguments.length, u, d;
173
+ if (c.fn) {
174
+ switch (c.once && this.removeListener(e, c.fn, void 0, !0), l) {
175
+ case 1: return c.fn.call(c.context), !0;
176
+ case 2: return c.fn.call(c.context, t), !0;
177
+ case 3: return c.fn.call(c.context, t, n), !0;
178
+ case 4: return c.fn.call(c.context, t, n, i), !0;
179
+ case 5: return c.fn.call(c.context, t, n, i, a), !0;
180
+ case 6: return c.fn.call(c.context, t, n, i, a, o), !0;
181
+ }
182
+ for (d = 1, u = Array(l - 1); d < l; d++) u[d - 1] = arguments[d];
183
+ c.fn.apply(c.context, u);
184
+ } else {
185
+ var f = c.length, p;
186
+ for (d = 0; d < f; d++) switch (c[d].once && this.removeListener(e, c[d].fn, void 0, !0), l) {
187
+ case 1:
188
+ c[d].fn.call(c[d].context);
189
+ break;
190
+ case 2:
191
+ c[d].fn.call(c[d].context, t);
192
+ break;
193
+ case 3:
194
+ c[d].fn.call(c[d].context, t, n);
195
+ break;
196
+ case 4:
197
+ c[d].fn.call(c[d].context, t, n, i);
198
+ break;
199
+ default:
200
+ if (!u) for (p = 1, u = Array(l - 1); p < l; p++) u[p - 1] = arguments[p];
201
+ c[d].fn.apply(c[d].context, u);
202
+ }
203
+ }
204
+ return !0;
205
+ }, c.prototype.on = function(e, t, n) {
206
+ return o(this, e, t, n, !1);
207
+ }, c.prototype.once = function(e, t, n) {
208
+ return o(this, e, t, n, !0);
209
+ }, c.prototype.removeListener = function(e, t, n, i) {
210
+ var a = r ? r + e : e;
211
+ if (!this._events[a]) return this;
212
+ if (!t) return s(this, a), this;
213
+ var o = this._events[a];
214
+ if (o.fn) o.fn === t && (!i || o.once) && (!n || o.context === n) && s(this, a);
215
+ else {
216
+ for (var c = 0, l = [], u = o.length; c < u; c++) (o[c].fn !== t || i && !o[c].once || n && o[c].context !== n) && l.push(o[c]);
217
+ l.length ? this._events[a] = l.length === 1 ? l[0] : l : s(this, a);
218
+ }
219
+ return this;
220
+ }, c.prototype.removeAllListeners = function(e) {
221
+ var t;
222
+ return e ? (t = r ? r + e : e, this._events[t] && s(this, t)) : (this._events = new i(), this._eventsCount = 0), this;
223
+ }, c.prototype.off = c.prototype.removeListener, c.prototype.addListener = c.prototype.on, c.prefixed = r, c.EventEmitter = c, t !== void 0 && (t.exports = c);
224
+ })))(), 1);
225
+ //#endregion
226
+ //#region \0@oxc-project+runtime@0.122.0/helpers/typeof.js
227
+ function _(e) {
228
+ "@babel/helpers - typeof";
229
+ return _ = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
230
+ return typeof e;
231
+ } : function(e) {
232
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
233
+ }, _(e);
71
234
  }
72
- async function je({ error: r, attemptNumber: e, retriesConsumed: t, startTime: i, options: s }) {
73
- const a = r instanceof Error ? r : new TypeError(`Non-error was thrown: "${r}". You should only throw errors.`);
74
- if (a instanceof He)
75
- throw a.originalError;
76
- const c = Number.isFinite(s.retries) ? Math.max(0, s.retries - t) : s.retries, u = s.maxRetryTime ?? Number.POSITIVE_INFINITY, o = Object.freeze({
77
- error: a,
78
- attemptNumber: e,
79
- retriesLeft: c,
80
- retriesConsumed: t
81
- });
82
- if (await s.onFailedAttempt(o), Te(i, u) <= 0)
83
- throw a;
84
- const l = await s.shouldConsumeRetry(o), d = Te(i, u);
85
- if (d <= 0 || c <= 0)
86
- throw a;
87
- if (a instanceof TypeError && !Ye(a)) {
88
- if (l)
89
- throw a;
90
- return s.signal?.throwIfAborted(), !1;
91
- }
92
- if (!await s.shouldRetry(o))
93
- throw a;
94
- if (!l)
95
- return s.signal?.throwIfAborted(), !1;
96
- const f = Je(t, s), g = Math.min(f, d);
97
- return s.signal?.throwIfAborted(), g > 0 && await new Promise((b, y) => {
98
- const O = () => {
99
- clearTimeout(E), s.signal?.removeEventListener("abort", O), y(s.signal.reason);
100
- }, E = setTimeout(() => {
101
- s.signal?.removeEventListener("abort", O), b();
102
- }, g);
103
- s.unref && E.unref?.(), s.signal?.addEventListener("abort", O, { once: !0 });
104
- }), s.signal?.throwIfAborted(), !0;
235
+ //#endregion
236
+ //#region \0@oxc-project+runtime@0.122.0/helpers/toPrimitive.js
237
+ function oe(e, t) {
238
+ if (_(e) != "object" || !e) return e;
239
+ var n = e[Symbol.toPrimitive];
240
+ if (n !== void 0) {
241
+ var r = n.call(e, t || "default");
242
+ if (_(r) != "object") return r;
243
+ throw TypeError("@@toPrimitive must return a primitive value.");
244
+ }
245
+ return (t === "string" ? String : Number)(e);
105
246
  }
106
- async function Se(r, e = {}) {
107
- if (e = { ...e }, ze(e.retries), Object.hasOwn(e, "forever"))
108
- throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");
109
- e.retries ?? (e.retries = 10), e.factor ?? (e.factor = 2), e.minTimeout ?? (e.minTimeout = 1e3), e.maxTimeout ?? (e.maxTimeout = Number.POSITIVE_INFINITY), e.maxRetryTime ?? (e.maxRetryTime = Number.POSITIVE_INFINITY), e.randomize ?? (e.randomize = !1), e.onFailedAttempt ?? (e.onFailedAttempt = () => {
110
- }), e.shouldRetry ?? (e.shouldRetry = () => !0), e.shouldConsumeRetry ?? (e.shouldConsumeRetry = () => !0), ne("factor", e.factor, { min: 0, allowInfinity: !1 }), ne("minTimeout", e.minTimeout, { min: 0, allowInfinity: !1 }), ne("maxTimeout", e.maxTimeout, { min: 0, allowInfinity: !0 }), ne("maxRetryTime", e.maxRetryTime, { min: 0, allowInfinity: !0 }), e.factor > 0 || (e.factor = 1), e.signal?.throwIfAborted();
111
- let t = 0, i = 0;
112
- const s = performance.now();
113
- for (; !Number.isFinite(e.retries) || i <= e.retries; ) {
114
- t++;
115
- try {
116
- e.signal?.throwIfAborted();
117
- const a = await r(t);
118
- return e.signal?.throwIfAborted(), a;
119
- } catch (a) {
120
- await je({
121
- error: a,
122
- attemptNumber: t,
123
- retriesConsumed: i,
124
- startTime: s,
125
- options: e
126
- }) && i++;
127
- }
128
- }
129
- throw new Error("Retry attempts exhausted without throwing an error.");
247
+ //#endregion
248
+ //#region \0@oxc-project+runtime@0.122.0/helpers/toPropertyKey.js
249
+ function se(e) {
250
+ var t = oe(e, "string");
251
+ return _(t) == "symbol" ? t : t + "";
130
252
  }
131
- function We(r) {
132
- return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
253
+ //#endregion
254
+ //#region \0@oxc-project+runtime@0.122.0/helpers/defineProperty.js
255
+ function v(e, t, n) {
256
+ return (t = se(t)) in e ? Object.defineProperty(e, t, {
257
+ value: n,
258
+ enumerable: !0,
259
+ configurable: !0,
260
+ writable: !0
261
+ }) : e[t] = n, e;
133
262
  }
134
- var Ee = { exports: {} }, Re;
135
- function Be() {
136
- return Re || (Re = 1, (function(r) {
137
- var e = Object.prototype.hasOwnProperty, t = "~";
138
- function i() {
139
- }
140
- Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (t = !1));
141
- function s(o, l, d) {
142
- this.fn = o, this.context = l, this.once = d || !1;
143
- }
144
- function a(o, l, d, f, g) {
145
- if (typeof d != "function")
146
- throw new TypeError("The listener must be a function");
147
- var b = new s(d, f || o, g), y = t ? t + l : l;
148
- return o._events[y] ? o._events[y].fn ? o._events[y] = [o._events[y], b] : o._events[y].push(b) : (o._events[y] = b, o._eventsCount++), o;
149
- }
150
- function c(o, l) {
151
- --o._eventsCount === 0 ? o._events = new i() : delete o._events[l];
152
- }
153
- function u() {
154
- this._events = new i(), this._eventsCount = 0;
155
- }
156
- u.prototype.eventNames = function() {
157
- var l = [], d, f;
158
- if (this._eventsCount === 0) return l;
159
- for (f in d = this._events)
160
- e.call(d, f) && l.push(t ? f.slice(1) : f);
161
- return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(d)) : l;
162
- }, u.prototype.listeners = function(l) {
163
- var d = t ? t + l : l, f = this._events[d];
164
- if (!f) return [];
165
- if (f.fn) return [f.fn];
166
- for (var g = 0, b = f.length, y = new Array(b); g < b; g++)
167
- y[g] = f[g].fn;
168
- return y;
169
- }, u.prototype.listenerCount = function(l) {
170
- var d = t ? t + l : l, f = this._events[d];
171
- return f ? f.fn ? 1 : f.length : 0;
172
- }, u.prototype.emit = function(l, d, f, g, b, y) {
173
- var O = t ? t + l : l;
174
- if (!this._events[O]) return !1;
175
- var E = this._events[O], V = arguments.length, z, T;
176
- if (E.fn) {
177
- switch (E.once && this.removeListener(l, E.fn, void 0, !0), V) {
178
- case 1:
179
- return E.fn.call(E.context), !0;
180
- case 2:
181
- return E.fn.call(E.context, d), !0;
182
- case 3:
183
- return E.fn.call(E.context, d, f), !0;
184
- case 4:
185
- return E.fn.call(E.context, d, f, g), !0;
186
- case 5:
187
- return E.fn.call(E.context, d, f, g, b), !0;
188
- case 6:
189
- return E.fn.call(E.context, d, f, g, b, y), !0;
190
- }
191
- for (T = 1, z = new Array(V - 1); T < V; T++)
192
- z[T - 1] = arguments[T];
193
- E.fn.apply(E.context, z);
194
- } else {
195
- var Ue = E.length, te;
196
- for (T = 0; T < Ue; T++)
197
- switch (E[T].once && this.removeListener(l, E[T].fn, void 0, !0), V) {
198
- case 1:
199
- E[T].fn.call(E[T].context);
200
- break;
201
- case 2:
202
- E[T].fn.call(E[T].context, d);
203
- break;
204
- case 3:
205
- E[T].fn.call(E[T].context, d, f);
206
- break;
207
- case 4:
208
- E[T].fn.call(E[T].context, d, f, g);
209
- break;
210
- default:
211
- if (!z) for (te = 1, z = new Array(V - 1); te < V; te++)
212
- z[te - 1] = arguments[te];
213
- E[T].fn.apply(E[T].context, z);
214
- }
215
- }
216
- return !0;
217
- }, u.prototype.on = function(l, d, f) {
218
- return a(this, l, d, f, !1);
219
- }, u.prototype.once = function(l, d, f) {
220
- return a(this, l, d, f, !0);
221
- }, u.prototype.removeListener = function(l, d, f, g) {
222
- var b = t ? t + l : l;
223
- if (!this._events[b]) return this;
224
- if (!d)
225
- return c(this, b), this;
226
- var y = this._events[b];
227
- if (y.fn)
228
- y.fn === d && (!g || y.once) && (!f || y.context === f) && c(this, b);
229
- else {
230
- for (var O = 0, E = [], V = y.length; O < V; O++)
231
- (y[O].fn !== d || g && !y[O].once || f && y[O].context !== f) && E.push(y[O]);
232
- E.length ? this._events[b] = E.length === 1 ? E[0] : E : c(this, b);
233
- }
234
- return this;
235
- }, u.prototype.removeAllListeners = function(l) {
236
- var d;
237
- return l ? (d = t ? t + l : l, this._events[d] && c(this, d)) : (this._events = new i(), this._eventsCount = 0), this;
238
- }, u.prototype.off = u.prototype.removeListener, u.prototype.addListener = u.prototype.on, u.prefixed = t, u.EventEmitter = u, r.exports = u;
239
- })(Ee)), Ee.exports;
263
+ //#endregion
264
+ //#region node_modules/p-timeout/index.js
265
+ var ce = class e extends Error {
266
+ constructor(t, n) {
267
+ super(t, n), v(this, "name", "TimeoutError"), Error.captureStackTrace?.(this, e);
268
+ }
269
+ }, le = (e) => e.reason ?? new DOMException("This operation was aborted.", "AbortError");
270
+ function ue(e, t) {
271
+ let { milliseconds: n, fallback: r, message: i, customTimers: a = {
272
+ setTimeout,
273
+ clearTimeout
274
+ }, signal: o } = t, s, c, l = new Promise((t, l) => {
275
+ if (typeof n != "number" || Math.sign(n) !== 1) throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);
276
+ if (o?.aborted) {
277
+ l(le(o));
278
+ return;
279
+ }
280
+ if (o && (c = () => {
281
+ l(le(o));
282
+ }, o.addEventListener("abort", c, { once: !0 })), e.then(t, l), n === Infinity) return;
283
+ let u = new ce();
284
+ s = a.setTimeout.call(void 0, () => {
285
+ if (r) {
286
+ try {
287
+ t(r());
288
+ } catch (e) {
289
+ l(e);
290
+ }
291
+ return;
292
+ }
293
+ typeof e.cancel == "function" && e.cancel(), i === !1 ? t() : i instanceof Error ? l(i) : (u.message = i ?? `Promise timed out after ${n} milliseconds`, l(u));
294
+ }, n);
295
+ }).finally(() => {
296
+ l.clear(), c && o && o.removeEventListener("abort", c);
297
+ });
298
+ return l.clear = () => {
299
+ a.clearTimeout.call(void 0, s), s = void 0;
300
+ }, l;
240
301
  }
241
- var Qe = Be();
242
- const Ke = /* @__PURE__ */ We(Qe);
243
- class pe extends Error {
244
- constructor(t, i) {
245
- super(t, i);
246
- R(this, "name", "TimeoutError");
247
- Error.captureStackTrace?.(this, pe);
248
- }
302
+ //#endregion
303
+ //#region node_modules/p-queue/dist/lower-bound.js
304
+ function de(e, t, n) {
305
+ let r = 0, i = e.length;
306
+ for (; i > 0;) {
307
+ let a = Math.trunc(i / 2), o = r + a;
308
+ n(e[o], t) <= 0 ? (r = ++o, i -= a + 1) : i = a;
309
+ }
310
+ return r;
249
311
  }
250
- const _e = (r) => r.reason ?? new DOMException("This operation was aborted.", "AbortError");
251
- function Ze(r, e) {
252
- const {
253
- milliseconds: t,
254
- fallback: i,
255
- message: s,
256
- customTimers: a = { setTimeout, clearTimeout },
257
- signal: c
258
- } = e;
259
- let u, o;
260
- const d = new Promise((f, g) => {
261
- if (typeof t != "number" || Math.sign(t) !== 1)
262
- throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
263
- if (c?.aborted) {
264
- g(_e(c));
265
- return;
266
- }
267
- if (c && (o = () => {
268
- g(_e(c));
269
- }, c.addEventListener("abort", o, { once: !0 })), r.then(f, g), t === Number.POSITIVE_INFINITY)
270
- return;
271
- const b = new pe();
272
- u = a.setTimeout.call(void 0, () => {
273
- if (i) {
274
- try {
275
- f(i());
276
- } catch (y) {
277
- g(y);
278
- }
279
- return;
280
- }
281
- typeof r.cancel == "function" && r.cancel(), s === !1 ? f() : s instanceof Error ? g(s) : (b.message = s ?? `Promise timed out after ${t} milliseconds`, g(b));
282
- }, t);
283
- }).finally(() => {
284
- d.clear(), o && c && c.removeEventListener("abort", o);
285
- });
286
- return d.clear = () => {
287
- a.clearTimeout.call(void 0, u), u = void 0;
288
- }, d;
312
+ //#endregion
313
+ //#region \0@oxc-project+runtime@0.122.0/helpers/checkPrivateRedeclaration.js
314
+ function fe(e, t) {
315
+ if (t.has(e)) throw TypeError("Cannot initialize the same private elements twice on an object");
289
316
  }
290
- function Xe(r, e, t) {
291
- let i = 0, s = r.length;
292
- for (; s > 0; ) {
293
- const a = Math.trunc(s / 2);
294
- let c = i + a;
295
- t(r[c], e) <= 0 ? (i = ++c, s -= a + 1) : s = a;
296
- }
297
- return i;
317
+ //#endregion
318
+ //#region \0@oxc-project+runtime@0.122.0/helpers/classPrivateFieldInitSpec.js
319
+ function y(e, t, n) {
320
+ fe(e, t), t.set(e, n);
298
321
  }
299
- var L;
300
- class et {
301
- constructor() {
302
- p(this, L, []);
303
- }
304
- enqueue(e, t) {
305
- const { priority: i = 0, id: s } = t ?? {}, a = {
306
- priority: i,
307
- id: s,
308
- run: e
309
- };
310
- if (this.size === 0 || n(this, L)[this.size - 1].priority >= i) {
311
- n(this, L).push(a);
312
- return;
313
- }
314
- const c = Xe(n(this, L), a, (u, o) => o.priority - u.priority);
315
- n(this, L).splice(c, 0, a);
316
- }
317
- setPriority(e, t) {
318
- const i = n(this, L).findIndex((a) => a.id === e);
319
- if (i === -1)
320
- throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
321
- const [s] = n(this, L).splice(i, 1);
322
- this.enqueue(s.run, { priority: t, id: e });
323
- }
324
- dequeue() {
325
- return n(this, L).shift()?.run;
326
- }
327
- filter(e) {
328
- return n(this, L).filter((t) => t.priority === e.priority).map((t) => t.run);
329
- }
330
- get size() {
331
- return n(this, L).length;
332
- }
322
+ //#endregion
323
+ //#region \0@oxc-project+runtime@0.122.0/helpers/assertClassBrand.js
324
+ function b(e, t, n) {
325
+ if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
326
+ throw TypeError("Private element is not present on this object");
333
327
  }
334
- L = new WeakMap();
335
- var Z, x, k, Y, j, X, U, ie, ee, D, M, P, I, N, S, se, A, W, q, fe, B, h, oe, Ne, Ie, ue, Oe, Ce, Le, Pe, xe, ce, he, ge, le, we, ye, de, J, ke, Q, Ge, ve;
336
- class tt extends Ke {
337
- constructor(t) {
338
- super();
339
- p(this, h);
340
- p(this, Z);
341
- p(this, x);
342
- p(this, k, 0);
343
- p(this, Y);
344
- p(this, j, !1);
345
- p(this, X, !1);
346
- p(this, U);
347
- p(this, ie, 0);
348
- p(this, ee, 0);
349
- p(this, D);
350
- p(this, M);
351
- p(this, P);
352
- // Circular buffer implementation for better performance
353
- p(this, I, []);
354
- p(this, N, 0);
355
- p(this, S);
356
- p(this, se);
357
- p(this, A, 0);
358
- // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
359
- p(this, W);
360
- p(this, q);
361
- // Use to assign a unique identifier to a promise function, if not explicitly specified
362
- p(this, fe, 1n);
363
- // Track currently running tasks for debugging
364
- p(this, B, /* @__PURE__ */ new Map());
365
- /**
366
- Get or set the default timeout for all tasks. Can be changed at runtime.
367
-
368
- Operations will throw a `TimeoutError` if they don't complete within the specified time.
369
-
370
- The timeout begins when the operation is dequeued and starts execution, not while it's waiting in the queue.
371
-
372
- @example
373
- ```
374
- const queue = new PQueue({timeout: 5000});
375
-
376
- // Change timeout for all future tasks
377
- queue.timeout = 10000;
378
- ```
379
- */
380
- R(this, "timeout");
381
- if (t = {
382
- carryoverIntervalCount: !1,
383
- intervalCap: Number.POSITIVE_INFINITY,
384
- interval: 0,
385
- concurrency: Number.POSITIVE_INFINITY,
386
- autoStart: !0,
387
- queueClass: et,
388
- strict: !1,
389
- ...t
390
- }, !(typeof t.intervalCap == "number" && t.intervalCap >= 1))
391
- throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString() ?? ""}\` (${typeof t.intervalCap})`);
392
- if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
393
- throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString() ?? ""}\` (${typeof t.interval})`);
394
- if (t.strict && t.interval === 0)
395
- throw new TypeError("The `strict` option requires a non-zero `interval`");
396
- if (t.strict && t.intervalCap === Number.POSITIVE_INFINITY)
397
- throw new TypeError("The `strict` option requires a finite `intervalCap`");
398
- if (w(this, Z, t.carryoverIntervalCount ?? t.carryoverConcurrencyCount ?? !1), w(this, x, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), w(this, Y, t.intervalCap), w(this, U, t.interval), w(this, P, t.strict), w(this, S, new t.queueClass()), w(this, se, t.queueClass), this.concurrency = t.concurrency, t.timeout !== void 0 && !(Number.isFinite(t.timeout) && t.timeout > 0))
399
- throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${t.timeout}\` (${typeof t.timeout})`);
400
- this.timeout = t.timeout, w(this, q, t.autoStart === !1), m(this, h, ke).call(this);
401
- }
402
- get concurrency() {
403
- return n(this, W);
404
- }
405
- set concurrency(t) {
406
- if (!(typeof t == "number" && t >= 1))
407
- throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);
408
- w(this, W, t), m(this, h, de).call(this);
409
- }
410
- /**
411
- Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
412
-
413
- For example, this can be used to prioritize a promise function to run earlier.
414
-
415
- ```js
416
- import PQueue from 'p-queue';
417
-
418
- const queue = new PQueue({concurrency: 1});
419
-
420
- queue.add(async () => '🦄', {priority: 1});
421
- queue.add(async () => '🦀', {priority: 0, id: '🦀'});
422
- queue.add(async () => '🦄', {priority: 1});
423
- queue.add(async () => '🦄', {priority: 1});
424
-
425
- queue.setPriority('🦀', 2);
426
- ```
427
-
428
- In this case, the promise function with `id: '🦀'` runs second.
429
-
430
- You can also deprioritize a promise function to delay its execution:
431
-
432
- ```js
433
- import PQueue from 'p-queue';
434
-
435
- const queue = new PQueue({concurrency: 1});
436
-
437
- queue.add(async () => '🦄', {priority: 1});
438
- queue.add(async () => '🦀', {priority: 1, id: '🦀'});
439
- queue.add(async () => '🦄');
440
- queue.add(async () => '🦄', {priority: 0});
441
-
442
- queue.setPriority('🦀', -1);
443
- ```
444
- Here, the promise function with `id: '🦀'` executes last.
445
- */
446
- setPriority(t, i) {
447
- if (typeof i != "number" || !Number.isFinite(i))
448
- throw new TypeError(`Expected \`priority\` to be a finite number, got \`${i}\` (${typeof i})`);
449
- n(this, S).setPriority(t, i);
450
- }
451
- async add(t, i = {}) {
452
- return i = {
453
- timeout: this.timeout,
454
- ...i,
455
- // Assign unique ID if not provided
456
- id: i.id ?? (H(this, fe)._++).toString()
457
- }, new Promise((s, a) => {
458
- const c = /* @__PURE__ */ Symbol(`task-${i.id}`);
459
- n(this, S).enqueue(async () => {
460
- H(this, A)._++, n(this, B).set(c, {
461
- id: i.id,
462
- priority: i.priority ?? 0,
463
- // Match priority-queue default
464
- startTime: Date.now(),
465
- timeout: i.timeout
466
- });
467
- let u;
468
- try {
469
- try {
470
- i.signal?.throwIfAborted();
471
- } catch (d) {
472
- throw m(this, h, Ge).call(this), n(this, B).delete(c), d;
473
- }
474
- w(this, ee, Date.now());
475
- let o = t({ signal: i.signal });
476
- if (i.timeout && (o = Ze(Promise.resolve(o), {
477
- milliseconds: i.timeout,
478
- message: `Task timed out after ${i.timeout}ms (queue has ${n(this, A)} running, ${n(this, S).size} waiting)`
479
- })), i.signal) {
480
- const { signal: d } = i;
481
- o = Promise.race([o, new Promise((f, g) => {
482
- u = () => {
483
- g(d.reason);
484
- }, d.addEventListener("abort", u, { once: !0 });
485
- })]);
486
- }
487
- const l = await o;
488
- s(l), this.emit("completed", l);
489
- } catch (o) {
490
- a(o), this.emit("error", o);
491
- } finally {
492
- u && i.signal?.removeEventListener("abort", u), n(this, B).delete(c), queueMicrotask(() => {
493
- m(this, h, Le).call(this);
494
- });
495
- }
496
- }, i), this.emit("add"), m(this, h, le).call(this);
497
- });
498
- }
499
- async addAll(t, i) {
500
- return Promise.all(t.map(async (s) => this.add(s, i)));
501
- }
502
- /**
503
- Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
504
- */
505
- start() {
506
- return n(this, q) ? (w(this, q, !1), m(this, h, de).call(this), this) : this;
507
- }
508
- /**
509
- Put queue execution on hold.
510
- */
511
- pause() {
512
- w(this, q, !0);
513
- }
514
- /**
515
- Clear the queue.
516
- */
517
- clear() {
518
- w(this, S, new (n(this, se))()), m(this, h, he).call(this), m(this, h, ve).call(this), this.emit("empty"), n(this, A) === 0 && (m(this, h, ge).call(this), this.emit("idle")), this.emit("next");
519
- }
520
- /**
521
- Can be called multiple times. Useful if you for example add additional items at a later time.
522
-
523
- @returns A promise that settles when the queue becomes empty.
524
- */
525
- async onEmpty() {
526
- n(this, S).size !== 0 && await m(this, h, J).call(this, "empty");
527
- }
528
- /**
529
- @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
530
-
531
- If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.
532
-
533
- Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
534
- */
535
- async onSizeLessThan(t) {
536
- n(this, S).size < t || await m(this, h, J).call(this, "next", () => n(this, S).size < t);
537
- }
538
- /**
539
- The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
540
-
541
- @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
542
- */
543
- async onIdle() {
544
- n(this, A) === 0 && n(this, S).size === 0 || await m(this, h, J).call(this, "idle");
545
- }
546
- /**
547
- The difference with `.onIdle` is that `.onPendingZero` only waits for currently running tasks to finish, ignoring queued tasks.
548
-
549
- @returns A promise that settles when all currently running tasks have completed; `queue.pending === 0`.
550
- */
551
- async onPendingZero() {
552
- n(this, A) !== 0 && await m(this, h, J).call(this, "pendingZero");
553
- }
554
- /**
555
- @returns A promise that settles when the queue becomes rate-limited due to intervalCap.
556
- */
557
- async onRateLimit() {
558
- this.isRateLimited || await m(this, h, J).call(this, "rateLimit");
559
- }
560
- /**
561
- @returns A promise that settles when the queue is no longer rate-limited.
562
- */
563
- async onRateLimitCleared() {
564
- this.isRateLimited && await m(this, h, J).call(this, "rateLimitCleared");
565
- }
566
- /**
567
- @returns A promise that rejects when any task in the queue errors.
568
-
569
- Use with `Promise.race([queue.onError(), queue.onIdle()])` to fail fast on the first error while still resolving normally when the queue goes idle.
570
-
571
- Important: The promise returned by `add()` still rejects. You must handle each `add()` promise (for example, `.catch(() => {})`) to avoid unhandled rejections.
572
-
573
- @example
574
- ```
575
- import PQueue from 'p-queue';
576
-
577
- const queue = new PQueue({concurrency: 2});
578
-
579
- queue.add(() => fetchData(1)).catch(() => {});
580
- queue.add(() => fetchData(2)).catch(() => {});
581
- queue.add(() => fetchData(3)).catch(() => {});
582
-
583
- // Stop processing on first error
584
- try {
585
- await Promise.race([
586
- queue.onError(),
587
- queue.onIdle()
588
- ]);
589
- } catch (error) {
590
- queue.pause(); // Stop processing remaining tasks
591
- console.error('Queue failed:', error);
592
- }
593
- ```
594
- */
595
- // eslint-disable-next-line @typescript-eslint/promise-function-async
596
- onError() {
597
- return new Promise((t, i) => {
598
- const s = (a) => {
599
- this.off("error", s), i(a);
600
- };
601
- this.on("error", s);
602
- });
603
- }
604
- /**
605
- Size of the queue, the number of queued items waiting to run.
606
- */
607
- get size() {
608
- return n(this, S).size;
609
- }
610
- /**
611
- Size of the queue, filtered by the given options.
612
-
613
- For example, this can be used to find the number of items remaining in the queue with a specific priority level.
614
- */
615
- sizeBy(t) {
616
- return n(this, S).filter(t).length;
617
- }
618
- /**
619
- Number of running items (no longer in the queue).
620
- */
621
- get pending() {
622
- return n(this, A);
623
- }
624
- /**
625
- Whether the queue is currently paused.
626
- */
627
- get isPaused() {
628
- return n(this, q);
629
- }
630
- /**
631
- Whether the queue is currently rate-limited due to intervalCap.
632
- */
633
- get isRateLimited() {
634
- return n(this, j);
635
- }
636
- /**
637
- Whether the queue is saturated. Returns `true` when:
638
- - All concurrency slots are occupied and tasks are waiting, OR
639
- - The queue is rate-limited and tasks are waiting
640
-
641
- Useful for detecting backpressure and potential hanging tasks.
642
-
643
- ```js
644
- import PQueue from 'p-queue';
645
-
646
- const queue = new PQueue({concurrency: 2});
647
-
648
- // Backpressure handling
649
- if (queue.isSaturated) {
650
- console.log('Queue is saturated, waiting for capacity...');
651
- await queue.onSizeLessThan(queue.concurrency);
652
- }
653
-
654
- // Monitoring for stuck tasks
655
- setInterval(() => {
656
- if (queue.isSaturated) {
657
- console.warn(`Queue saturated: ${queue.pending} running, ${queue.size} waiting`);
658
- }
659
- }, 60000);
660
- ```
661
- */
662
- get isSaturated() {
663
- return n(this, A) === n(this, W) && n(this, S).size > 0 || this.isRateLimited && n(this, S).size > 0;
664
- }
665
- /**
666
- The tasks currently being executed. Each task includes its `id`, `priority`, `startTime`, and `timeout` (if set).
667
-
668
- Returns an array of task info objects.
669
-
670
- ```js
671
- import PQueue from 'p-queue';
672
-
673
- const queue = new PQueue({concurrency: 2});
674
-
675
- // Add tasks with IDs for better debugging
676
- queue.add(() => fetchUser(123), {id: 'user-123'});
677
- queue.add(() => fetchPosts(456), {id: 'posts-456', priority: 1});
678
-
679
- // Check what's running
680
- console.log(queue.runningTasks);
681
- // => [{
682
- // id: 'user-123',
683
- // priority: 0,
684
- // startTime: 1759253001716,
685
- // timeout: undefined
686
- // }, {
687
- // id: 'posts-456',
688
- // priority: 1,
689
- // startTime: 1759253001916,
690
- // timeout: undefined
691
- // }]
692
- ```
693
- */
694
- get runningTasks() {
695
- return [...n(this, B).values()].map((t) => ({ ...t }));
696
- }
328
+ //#endregion
329
+ //#region \0@oxc-project+runtime@0.122.0/helpers/classPrivateFieldGet2.js
330
+ function x(e, t) {
331
+ return e.get(b(e, t));
697
332
  }
698
- Z = new WeakMap(), x = new WeakMap(), k = new WeakMap(), Y = new WeakMap(), j = new WeakMap(), X = new WeakMap(), U = new WeakMap(), ie = new WeakMap(), ee = new WeakMap(), D = new WeakMap(), M = new WeakMap(), P = new WeakMap(), I = new WeakMap(), N = new WeakMap(), S = new WeakMap(), se = new WeakMap(), A = new WeakMap(), W = new WeakMap(), q = new WeakMap(), fe = new WeakMap(), B = new WeakMap(), h = new WeakSet(), oe = function(t) {
699
- for (; n(this, N) < n(this, I).length; ) {
700
- const s = n(this, I)[n(this, N)];
701
- if (s !== void 0 && t - s >= n(this, U))
702
- H(this, N)._++;
703
- else
704
- break;
705
- }
706
- (n(this, N) > 100 && n(this, N) > n(this, I).length / 2 || n(this, N) === n(this, I).length) && (w(this, I, n(this, I).slice(n(this, N))), w(this, N, 0));
707
- }, // Helper methods for interval consumption
708
- Ne = function(t) {
709
- n(this, P) ? n(this, I).push(t) : H(this, k)._++;
710
- }, Ie = function() {
711
- n(this, P) ? n(this, I).length > n(this, N) && n(this, I).pop() : n(this, k) > 0 && H(this, k)._--;
712
- }, ue = function() {
713
- return n(this, I).length - n(this, N);
714
- }, Oe = function() {
715
- return n(this, x) ? !0 : n(this, P) ? m(this, h, ue).call(this) < n(this, Y) : n(this, k) < n(this, Y);
716
- }, Ce = function() {
717
- return n(this, A) < n(this, W);
718
- }, Le = function() {
719
- H(this, A)._--, n(this, A) === 0 && this.emit("pendingZero"), m(this, h, le).call(this), this.emit("next");
720
- }, Pe = function() {
721
- w(this, M, void 0), m(this, h, ye).call(this), m(this, h, we).call(this);
722
- }, xe = function(t) {
723
- if (n(this, P)) {
724
- if (m(this, h, oe).call(this, t), m(this, h, ue).call(this) >= n(this, Y)) {
725
- const s = n(this, I)[n(this, N)], a = n(this, U) - (t - s);
726
- return m(this, h, ce).call(this, a), !0;
727
- }
728
- return !1;
729
- }
730
- if (n(this, D) === void 0) {
731
- const i = n(this, ie) - t;
732
- if (i < 0) {
733
- if (n(this, ee) > 0) {
734
- const s = t - n(this, ee);
735
- if (s < n(this, U))
736
- return m(this, h, ce).call(this, n(this, U) - s), !0;
737
- }
738
- w(this, k, n(this, Z) ? n(this, A) : 0);
739
- } else
740
- return m(this, h, ce).call(this, i), !0;
741
- }
742
- return !1;
743
- }, ce = function(t) {
744
- n(this, M) === void 0 && w(this, M, setTimeout(() => {
745
- m(this, h, Pe).call(this);
746
- }, t));
747
- }, he = function() {
748
- n(this, D) && (clearInterval(n(this, D)), w(this, D, void 0));
749
- }, ge = function() {
750
- n(this, M) && (clearTimeout(n(this, M)), w(this, M, void 0));
751
- }, le = function() {
752
- if (n(this, S).size === 0) {
753
- if (m(this, h, he).call(this), this.emit("empty"), n(this, A) === 0) {
754
- if (m(this, h, ge).call(this), n(this, P) && n(this, N) > 0) {
755
- const i = Date.now();
756
- m(this, h, oe).call(this, i);
757
- }
758
- this.emit("idle");
759
- }
760
- return !1;
761
- }
762
- let t = !1;
763
- if (!n(this, q)) {
764
- const i = Date.now(), s = !m(this, h, xe).call(this, i);
765
- if (n(this, h, Oe) && n(this, h, Ce)) {
766
- const a = n(this, S).dequeue();
767
- n(this, x) || (m(this, h, Ne).call(this, i), m(this, h, Q).call(this)), this.emit("active"), a(), s && m(this, h, we).call(this), t = !0;
768
- }
769
- }
770
- return t;
771
- }, we = function() {
772
- n(this, x) || n(this, D) !== void 0 || n(this, P) || (w(this, D, setInterval(() => {
773
- m(this, h, ye).call(this);
774
- }, n(this, U))), w(this, ie, Date.now() + n(this, U)));
775
- }, ye = function() {
776
- n(this, P) || (n(this, k) === 0 && n(this, A) === 0 && n(this, D) && m(this, h, he).call(this), w(this, k, n(this, Z) ? n(this, A) : 0)), m(this, h, de).call(this), m(this, h, Q).call(this);
777
- }, /**
778
- Executes all queued functions until it reaches the limit.
779
- */
780
- de = function() {
781
- for (; m(this, h, le).call(this); )
782
- ;
783
- }, J = async function(t, i) {
784
- return new Promise((s) => {
785
- const a = () => {
786
- i && !i() || (this.off(t, a), s());
787
- };
788
- this.on(t, a);
789
- });
790
- }, ke = function() {
791
- n(this, x) || (this.on("add", () => {
792
- n(this, S).size > 0 && m(this, h, Q).call(this);
793
- }), this.on("next", () => {
794
- m(this, h, Q).call(this);
795
- }));
796
- }, Q = function() {
797
- n(this, x) || n(this, X) || (w(this, X, !0), queueMicrotask(() => {
798
- w(this, X, !1), m(this, h, ve).call(this);
799
- }));
800
- }, Ge = function() {
801
- n(this, x) || (m(this, h, Ie).call(this), m(this, h, Q).call(this));
802
- }, ve = function() {
803
- const t = n(this, j);
804
- if (n(this, x) || n(this, S).size === 0) {
805
- t && (w(this, j, !1), this.emit("rateLimitCleared"));
806
- return;
807
- }
808
- let i;
809
- if (n(this, P)) {
810
- const a = Date.now();
811
- m(this, h, oe).call(this, a), i = m(this, h, ue).call(this);
812
- } else
813
- i = n(this, k);
814
- const s = i >= n(this, Y);
815
- s !== t && (w(this, j, s), this.emit(s ? "rateLimit" : "rateLimitCleared"));
333
+ //#endregion
334
+ //#region node_modules/p-queue/dist/priority-queue.js
335
+ var S = /* @__PURE__ */ new WeakMap(), pe = class {
336
+ constructor() {
337
+ y(this, S, []);
338
+ }
339
+ enqueue(e, t) {
340
+ let { priority: n = 0, id: r } = t ?? {}, i = {
341
+ priority: n,
342
+ id: r,
343
+ run: e
344
+ };
345
+ if (this.size === 0 || x(S, this)[this.size - 1].priority >= n) {
346
+ x(S, this).push(i);
347
+ return;
348
+ }
349
+ let a = de(x(S, this), i, (e, t) => t.priority - e.priority);
350
+ x(S, this).splice(a, 0, i);
351
+ }
352
+ setPriority(e, t) {
353
+ let n = x(S, this).findIndex((t) => t.id === e);
354
+ if (n === -1) throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
355
+ let [r] = x(S, this).splice(n, 1);
356
+ this.enqueue(r.run, {
357
+ priority: t,
358
+ id: e
359
+ });
360
+ }
361
+ dequeue() {
362
+ return x(S, this).shift()?.run;
363
+ }
364
+ filter(e) {
365
+ return x(S, this).filter((t) => t.priority === e.priority).map((e) => e.run);
366
+ }
367
+ get size() {
368
+ return x(S, this).length;
369
+ }
816
370
  };
817
- var Fe = /* @__PURE__ */ ((r) => (r.API_ERROR = "ApiError", r.NETWORK_ERROR = "NetworkError", r.VALIDATION_ERROR = "ValidationError", r.GEOCODING_ERROR = "GeocodingError", r.RATE_LIMIT_ERROR = "RateLimitError", r.TIMEOUT_ERROR = "TimeoutError", r.AUTHENTICATION_ERROR = "AuthenticationError", r.SERVER_ERROR = "ServerError", r.CLIENT_ERROR = "ClientError", r.CONFIGURATION_ERROR = "ConfigurationError", r))(Fe || {});
818
- class C extends Error {
819
- constructor(t, i, s = {}) {
820
- super(i);
821
- R(this, "type");
822
- R(this, "statusCode");
823
- R(this, "response");
824
- R(this, "originalError");
825
- R(this, "context");
826
- this.name = "BmltQueryError", this.type = t, this.statusCode = s.statusCode, this.response = s.response, this.originalError = s.originalError, this.context = s.context, Object.setPrototypeOf(this, C.prototype);
827
- }
828
- /**
829
- * Check if error is of a specific type
830
- */
831
- isType(t) {
832
- return this.type === t;
833
- }
834
- /**
835
- * Check if error is retryable
836
- */
837
- isRetryable() {
838
- return [
839
- "NetworkError",
840
- "TimeoutError",
841
- "RateLimitError",
842
- "ServerError"
843
- /* SERVER_ERROR */
844
- ].includes(this.type);
845
- }
846
- /**
847
- * Check if error is a client-side error (4xx)
848
- */
849
- isClientError() {
850
- return this.statusCode !== void 0 && this.statusCode >= 400 && this.statusCode < 500;
851
- }
852
- /**
853
- * Check if error is a server-side error (5xx)
854
- */
855
- isServerError() {
856
- return this.statusCode !== void 0 && this.statusCode >= 500;
857
- }
858
- /**
859
- * Get a user-friendly error message
860
- */
861
- getUserMessage() {
862
- switch (this.type) {
863
- case "NetworkError":
864
- return "Unable to connect to the BMLT server. Please check your internet connection and try again.";
865
- case "TimeoutError":
866
- return "The request timed out. Please try again later.";
867
- case "RateLimitError":
868
- return "Too many requests. Please wait a moment and try again.";
869
- case "GeocodingError":
870
- return "Unable to find the specified address. Please check the address and try again.";
871
- case "ValidationError":
872
- return "Invalid input provided. Please check your parameters and try again.";
873
- case "AuthenticationError":
874
- return "Authentication failed. Please check your credentials.";
875
- case "ServerError":
876
- return "The BMLT server encountered an error. Please try again later.";
877
- case "ApiError":
878
- return this.statusCode === 404 ? "The requested resource was not found." : "An error occurred while communicating with the BMLT server.";
879
- case "ConfigurationError":
880
- return "Invalid configuration. Please check your settings.";
881
- default:
882
- return this.message || "An unexpected error occurred.";
883
- }
884
- }
885
- /**
886
- * Convert error to JSON for logging
887
- */
888
- toJSON() {
889
- return {
890
- name: this.name,
891
- type: this.type,
892
- message: this.message,
893
- statusCode: this.statusCode,
894
- response: this.response,
895
- context: this.context,
896
- stack: this.stack,
897
- originalError: this.originalError ? {
898
- name: this.originalError.name,
899
- message: this.originalError.message,
900
- stack: this.originalError.stack
901
- } : void 0
902
- };
903
- }
371
+ //#endregion
372
+ //#region \0@oxc-project+runtime@0.122.0/helpers/classPrivateMethodInitSpec.js
373
+ function me(e, t) {
374
+ fe(e, t), t.add(e);
375
+ }
376
+ //#endregion
377
+ //#region \0@oxc-project+runtime@0.122.0/helpers/classPrivateFieldSet2.js
378
+ function C(e, t, n) {
379
+ return e.set(b(e, t), n), n;
380
+ }
381
+ //#endregion
382
+ //#region node_modules/p-queue/dist/index.js
383
+ var he = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), N = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakSet(), ye = class extends ae.default {
384
+ constructor(e) {
385
+ if (super(), me(this, V), y(this, he, void 0), y(this, w, void 0), y(this, T, 0), y(this, E, void 0), y(this, D, !1), y(this, O, !1), y(this, k, void 0), y(this, ge, 0), y(this, A, 0), y(this, j, void 0), y(this, M, void 0), y(this, N, void 0), y(this, P, []), y(this, F, 0), y(this, I, void 0), y(this, _e, void 0), y(this, L, 0), y(this, R, void 0), y(this, z, void 0), y(this, ve, 1n), y(this, B, /* @__PURE__ */ new Map()), v(this, "timeout", void 0), e = {
386
+ carryoverIntervalCount: !1,
387
+ intervalCap: Infinity,
388
+ interval: 0,
389
+ concurrency: Infinity,
390
+ autoStart: !0,
391
+ queueClass: pe,
392
+ strict: !1,
393
+ ...e
394
+ }, !(typeof e.intervalCap == "number" && e.intervalCap >= 1)) throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString() ?? ""}\` (${typeof e.intervalCap})`);
395
+ if (e.interval === void 0 || !(Number.isFinite(e.interval) && e.interval >= 0)) throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString() ?? ""}\` (${typeof e.interval})`);
396
+ if (e.strict && e.interval === 0) throw TypeError("The `strict` option requires a non-zero `interval`");
397
+ if (e.strict && e.intervalCap === Infinity) throw TypeError("The `strict` option requires a finite `intervalCap`");
398
+ if (C(he, this, e.carryoverIntervalCount ?? e.carryoverConcurrencyCount ?? !1), C(w, this, e.intervalCap === Infinity || e.interval === 0), C(E, this, e.intervalCap), C(k, this, e.interval), C(N, this, e.strict), C(I, this, new e.queueClass()), C(_e, this, e.queueClass), this.concurrency = e.concurrency, e.timeout !== void 0 && !(Number.isFinite(e.timeout) && e.timeout > 0)) throw TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);
399
+ this.timeout = e.timeout, C(z, this, e.autoStart === !1), b(V, this, Ie).call(this);
400
+ }
401
+ get concurrency() {
402
+ return x(R, this);
403
+ }
404
+ set concurrency(e) {
405
+ if (!(typeof e == "number" && e >= 1)) throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);
406
+ C(R, this, e), b(V, this, Fe).call(this);
407
+ }
408
+ setPriority(e, t) {
409
+ if (typeof t != "number" || !Number.isFinite(t)) throw TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);
410
+ x(I, this).setPriority(e, t);
411
+ }
412
+ async add(e, t = {}) {
413
+ var n, r;
414
+ return t = {
415
+ timeout: this.timeout,
416
+ ...t,
417
+ id: t.id ?? (C(ve, this, (n = x(ve, this), r = n++, n)), r).toString()
418
+ }, new Promise((n, r) => {
419
+ let i = Symbol(`task-${t.id}`);
420
+ x(I, this).enqueue(async () => {
421
+ var a;
422
+ C(L, this, (a = x(L, this), a++, a)), x(B, this).set(i, {
423
+ id: t.id,
424
+ priority: t.priority ?? 0,
425
+ startTime: Date.now(),
426
+ timeout: t.timeout
427
+ });
428
+ let o;
429
+ try {
430
+ try {
431
+ t.signal?.throwIfAborted();
432
+ } catch (e) {
433
+ throw b(V, this, Le).call(this), x(B, this).delete(i), e;
434
+ }
435
+ C(A, this, Date.now());
436
+ let r = e({ signal: t.signal });
437
+ if (t.timeout && (r = ue(Promise.resolve(r), {
438
+ milliseconds: t.timeout,
439
+ message: `Task timed out after ${t.timeout}ms (queue has ${x(L, this)} running, ${x(I, this).size} waiting)`
440
+ })), t.signal) {
441
+ let { signal: e } = t;
442
+ r = Promise.race([r, new Promise((t, n) => {
443
+ o = () => {
444
+ n(e.reason);
445
+ }, e.addEventListener("abort", o, { once: !0 });
446
+ })]);
447
+ }
448
+ let a = await r;
449
+ n(a), this.emit("completed", a);
450
+ } catch (e) {
451
+ r(e), this.emit("error", e);
452
+ } finally {
453
+ o && t.signal?.removeEventListener("abort", o), x(B, this).delete(i), queueMicrotask(() => {
454
+ b(V, this, Ee).call(this);
455
+ });
456
+ }
457
+ }, t), this.emit("add"), b(V, this, Me).call(this);
458
+ });
459
+ }
460
+ async addAll(e, t) {
461
+ return Promise.all(e.map(async (e) => this.add(e, t)));
462
+ }
463
+ start() {
464
+ return x(z, this) ? (C(z, this, !1), b(V, this, Fe).call(this), this) : this;
465
+ }
466
+ pause() {
467
+ C(z, this, !0);
468
+ }
469
+ clear() {
470
+ C(I, this, new (x(_e, this))()), b(V, this, Ae).call(this), b(V, this, Re).call(this), this.emit("empty"), x(L, this) === 0 && (b(V, this, je).call(this), this.emit("idle")), this.emit("next");
471
+ }
472
+ async onEmpty() {
473
+ x(I, this).size !== 0 && await b(V, this, H).call(this, "empty");
474
+ }
475
+ async onSizeLessThan(e) {
476
+ x(I, this).size < e || await b(V, this, H).call(this, "next", () => x(I, this).size < e);
477
+ }
478
+ async onIdle() {
479
+ x(L, this) === 0 && x(I, this).size === 0 || await b(V, this, H).call(this, "idle");
480
+ }
481
+ async onPendingZero() {
482
+ x(L, this) !== 0 && await b(V, this, H).call(this, "pendingZero");
483
+ }
484
+ async onRateLimit() {
485
+ this.isRateLimited || await b(V, this, H).call(this, "rateLimit");
486
+ }
487
+ async onRateLimitCleared() {
488
+ this.isRateLimited && await b(V, this, H).call(this, "rateLimitCleared");
489
+ }
490
+ onError() {
491
+ return new Promise((e, t) => {
492
+ let n = (e) => {
493
+ this.off("error", n), t(e);
494
+ };
495
+ this.on("error", n);
496
+ });
497
+ }
498
+ get size() {
499
+ return x(I, this).size;
500
+ }
501
+ sizeBy(e) {
502
+ return x(I, this).filter(e).length;
503
+ }
504
+ get pending() {
505
+ return x(L, this);
506
+ }
507
+ get isPaused() {
508
+ return x(z, this);
509
+ }
510
+ get isRateLimited() {
511
+ return x(D, this);
512
+ }
513
+ get isSaturated() {
514
+ return x(L, this) === x(R, this) && x(I, this).size > 0 || this.isRateLimited && x(I, this).size > 0;
515
+ }
516
+ get runningTasks() {
517
+ return [...x(B, this).values()].map((e) => ({ ...e }));
518
+ }
519
+ };
520
+ function be(e) {
521
+ for (; x(F, this) < x(P, this).length;) {
522
+ let n = x(P, this)[x(F, this)];
523
+ if (n !== void 0 && e - n >= x(k, this)) {
524
+ var t;
525
+ C(F, this, (t = x(F, this), t++, t));
526
+ } else break;
527
+ }
528
+ (x(F, this) > 100 && x(F, this) > x(P, this).length / 2 || x(F, this) === x(P, this).length) && (C(P, this, x(P, this).slice(x(F, this))), C(F, this, 0));
529
+ }
530
+ function xe(e) {
531
+ if (x(N, this)) x(P, this).push(e);
532
+ else {
533
+ var t;
534
+ C(T, this, (t = x(T, this), t++, t));
535
+ }
536
+ }
537
+ function Se() {
538
+ if (x(N, this)) x(P, this).length > x(F, this) && x(P, this).pop();
539
+ else if (x(T, this) > 0) {
540
+ var e;
541
+ C(T, this, (e = x(T, this), e--, e));
542
+ }
543
+ }
544
+ function Ce() {
545
+ return x(P, this).length - x(F, this);
546
+ }
547
+ function we() {
548
+ return x(w, this) ? !0 : x(N, this) ? b(V, this, Ce).call(this) < x(E, this) : x(T, this) < x(E, this);
549
+ }
550
+ function Te() {
551
+ return x(L, this) < x(R, this);
552
+ }
553
+ function Ee() {
554
+ var e;
555
+ C(L, this, (e = x(L, this), e--, e)), x(L, this) === 0 && this.emit("pendingZero"), b(V, this, Me).call(this), this.emit("next");
556
+ }
557
+ function De() {
558
+ C(M, this, void 0), b(V, this, Pe).call(this), b(V, this, Ne).call(this);
559
+ }
560
+ function Oe(e) {
561
+ if (x(N, this)) {
562
+ if (b(V, this, be).call(this, e), b(V, this, Ce).call(this) >= x(E, this)) {
563
+ let t = x(P, this)[x(F, this)], n = x(k, this) - (e - t);
564
+ return b(V, this, ke).call(this, n), !0;
565
+ }
566
+ return !1;
567
+ }
568
+ if (x(j, this) === void 0) {
569
+ let t = x(ge, this) - e;
570
+ if (t < 0) {
571
+ if (x(A, this) > 0) {
572
+ let t = e - x(A, this);
573
+ if (t < x(k, this)) return b(V, this, ke).call(this, x(k, this) - t), !0;
574
+ }
575
+ C(T, this, x(he, this) ? x(L, this) : 0);
576
+ } else return b(V, this, ke).call(this, t), !0;
577
+ }
578
+ return !1;
579
+ }
580
+ function ke(e) {
581
+ x(M, this) === void 0 && C(M, this, setTimeout(() => {
582
+ b(V, this, De).call(this);
583
+ }, e));
584
+ }
585
+ function Ae() {
586
+ x(j, this) && (clearInterval(x(j, this)), C(j, this, void 0));
587
+ }
588
+ function je() {
589
+ x(M, this) && (clearTimeout(x(M, this)), C(M, this, void 0));
590
+ }
591
+ function Me() {
592
+ if (x(I, this).size === 0) {
593
+ if (b(V, this, Ae).call(this), this.emit("empty"), x(L, this) === 0) {
594
+ if (b(V, this, je).call(this), x(N, this) && x(F, this) > 0) {
595
+ let e = Date.now();
596
+ b(V, this, be).call(this, e);
597
+ }
598
+ this.emit("idle");
599
+ }
600
+ return !1;
601
+ }
602
+ let e = !1;
603
+ if (!x(z, this)) {
604
+ let t = Date.now(), n = !b(V, this, Oe).call(this, t);
605
+ if (we.call(b(V, this)) && Te.call(b(V, this))) {
606
+ let r = x(I, this).dequeue();
607
+ x(w, this) || (b(V, this, xe).call(this, t), b(V, this, U).call(this)), this.emit("active"), r(), n && b(V, this, Ne).call(this), e = !0;
608
+ }
609
+ }
610
+ return e;
611
+ }
612
+ function Ne() {
613
+ x(w, this) || x(j, this) !== void 0 || x(N, this) || (C(j, this, setInterval(() => {
614
+ b(V, this, Pe).call(this);
615
+ }, x(k, this))), C(ge, this, Date.now() + x(k, this)));
904
616
  }
905
- class G {
906
- static createApiError(e, t, i, s) {
907
- let a;
908
- return t ? t >= 500 ? a = "ServerError" : t === 401 || t === 403 ? a = "AuthenticationError" : t === 429 ? a = "RateLimitError" : t >= 400 ? a = "ClientError" : a = "ApiError" : a = "ApiError", new C(a, e, {
909
- statusCode: t,
910
- response: i,
911
- originalError: s
912
- });
913
- }
914
- static createNetworkError(e, t) {
915
- return new C("NetworkError", e, {
916
- originalError: t
917
- });
918
- }
919
- static createTimeoutError(e, t) {
920
- return new C("TimeoutError", e, {
921
- originalError: t
922
- });
923
- }
924
- static createValidationError(e, t) {
925
- return new C("ValidationError", e, {
926
- context: t
927
- });
928
- }
929
- static createGeocodingError(e, t, i) {
930
- return new C("GeocodingError", e, {
931
- originalError: t,
932
- context: i
933
- });
934
- }
935
- static createRateLimitError(e, t, i) {
936
- return new C("RateLimitError", e, {
937
- statusCode: t,
938
- response: i
939
- });
940
- }
941
- static createConfigurationError(e, t) {
942
- return new C("ConfigurationError", e, {
943
- context: t
944
- });
945
- }
617
+ function Pe() {
618
+ x(N, this) || (x(T, this) === 0 && x(L, this) === 0 && x(j, this) && b(V, this, Ae).call(this), C(T, this, x(he, this) ? x(L, this) : 0)), b(V, this, Fe).call(this), b(V, this, U).call(this);
946
619
  }
947
- class re {
948
- /**
949
- * Handle and transform fetch errors
950
- */
951
- static handleFetchError(e, t) {
952
- if (e instanceof Error && e.name === "AbortError")
953
- return G.createTimeoutError("Request timeout", e);
954
- if (e instanceof TypeError)
955
- return G.createNetworkError("Network connection failed", e);
956
- if (t && !t.ok) {
957
- const i = `HTTP ${t.status}: ${t.statusText}`;
958
- return G.createApiError(i, t.status, void 0, e);
959
- }
960
- return e instanceof Error ? G.createApiError(e.message, void 0, void 0, e) : G.createApiError(
961
- "Unknown error occurred",
962
- void 0,
963
- void 0,
964
- new Error(String(e))
965
- );
966
- }
967
- /**
968
- * @deprecated Use handleFetchError instead
969
- */
970
- static handleAxiosError(e) {
971
- return re.handleFetchError(e);
972
- }
973
- /**
974
- * Handle validation errors with detailed context
975
- */
976
- static handleValidationError(e, t, i, s) {
977
- let a = `Invalid ${e}: expected ${i}`;
978
- return s && s.length > 0 && (a += ` (${s.join(", ")})`), G.createValidationError(a, {
979
- field: e,
980
- value: t,
981
- expectedType: i,
982
- constraints: s
983
- });
984
- }
985
- /**
986
- * Handle endpoint validation errors
987
- */
988
- static handleEndpointError(e, t) {
989
- const i = `Invalid endpoint/format combination: ${e} with ${t}`;
990
- return G.createValidationError(i, {
991
- endpoint: e,
992
- format: t
993
- });
994
- }
995
- /**
996
- * Handle URL validation errors
997
- */
998
- static handleUrlError(e, t) {
999
- const i = `Invalid URL: ${t}`;
1000
- return G.createValidationError(i, {
1001
- url: e,
1002
- reason: t
1003
- });
1004
- }
1005
- /**
1006
- * Handle coordinate validation errors
1007
- */
1008
- static handleCoordinateError(e, t, i) {
1009
- const s = i || "Invalid coordinates provided";
1010
- return G.createValidationError(s, {
1011
- latitude: e,
1012
- longitude: t,
1013
- reason: i
1014
- });
1015
- }
1016
- /**
1017
- * Wrap and enhance existing errors
1018
- */
1019
- static wrapError(e, t, i) {
1020
- const s = `${t}: ${e.message}`;
1021
- return e instanceof C ? new C(e.type, s, {
1022
- statusCode: e.statusCode,
1023
- response: e.response,
1024
- originalError: e.originalError || e,
1025
- context: {
1026
- ...e.context,
1027
- ...i
1028
- }
1029
- }) : G.createApiError(s, void 0, void 0, e);
1030
- }
620
+ function Fe() {
621
+ for (; b(V, this, Me).call(this););
1031
622
  }
1032
- class ct {
1033
- static async withRetry(e, t) {
1034
- const { maxRetries: i, baseDelay: s, maxDelay: a, factor: c, onRetry: u } = t;
1035
- let o;
1036
- for (let l = 0; l <= i; l++)
1037
- try {
1038
- return await e();
1039
- } catch (d) {
1040
- const f = d instanceof C ? d : re.wrapError(d, "Operation failed");
1041
- if (o = f, l === i || !f.isRetryable())
1042
- throw f;
1043
- const g = Math.min(s * Math.pow(c, l), a);
1044
- u && u(f, l + 1), await new Promise((b) => setTimeout(b, g));
1045
- }
1046
- throw o;
1047
- }
623
+ async function H(e, t) {
624
+ return new Promise((n) => {
625
+ let r = () => {
626
+ t && !t() || (this.off(e, r), n());
627
+ };
628
+ this.on(e, r);
629
+ });
1048
630
  }
1049
- class rt {
1050
- constructor(e = {}) {
1051
- R(this, "baseURL");
1052
- R(this, "queue");
1053
- R(this, "defaultOptions");
1054
- const {
1055
- retryCount: t = 3,
1056
- timeout: i = 1e4,
1057
- userAgent: s = "bmlt-query-client/1.0.0",
1058
- countryCode: a = "us",
1059
- viewbox: c,
1060
- bounded: u = !1,
1061
- intervalCap: o = 1,
1062
- interval: l = 1e3,
1063
- // 1 second between requests
1064
- concurrency: d = 1,
1065
- carryoverConcurrencyCount: f = !1,
1066
- ...g
1067
- } = e;
1068
- this.defaultOptions = {
1069
- retryCount: t,
1070
- timeout: i,
1071
- userAgent: s,
1072
- countryCode: a,
1073
- viewbox: c,
1074
- bounded: u
1075
- }, this.baseURL = "https://nominatim.openstreetmap.org", this.queue = new tt({
1076
- intervalCap: o,
1077
- interval: l,
1078
- concurrency: d,
1079
- carryoverConcurrencyCount: f,
1080
- ...g
1081
- });
1082
- }
1083
- /**
1084
- * Make a fetch request with timeout and error handling
1085
- */
1086
- async fetchWithTimeout(e, t, i) {
1087
- const s = new AbortController(), a = setTimeout(() => s.abort(), t);
1088
- try {
1089
- const c = await fetch(e, {
1090
- method: "GET",
1091
- headers: {
1092
- "User-Agent": i
1093
- },
1094
- signal: s.signal
1095
- });
1096
- if (!c.ok) {
1097
- if (c.status === 429) {
1098
- const o = new Error("Rate limit exceeded for geocoding service");
1099
- throw o.name = "RateLimitError", o.statusCode = 429, o;
1100
- }
1101
- if (c.status >= 400) {
1102
- const o = new Error(
1103
- `Geocoding service error: ${c.status} ${c.statusText}`
1104
- );
1105
- throw o.name = "GeocodingError", o.statusCode = c.status, o;
1106
- }
1107
- }
1108
- return await c.json();
1109
- } catch (c) {
1110
- if (c instanceof Error && c.name === "AbortError") {
1111
- const u = new Error("Request timeout during geocoding");
1112
- throw u.name = "TimeoutError", u;
1113
- }
1114
- if (c instanceof TypeError) {
1115
- const u = new Error("Network error occurred during geocoding");
1116
- throw u.name = "NetworkError", u;
1117
- }
1118
- throw c;
1119
- } finally {
1120
- clearTimeout(a);
1121
- }
1122
- }
1123
- /**
1124
- * Geocode an address using Nominatim
1125
- */
1126
- async geocode(e, t = {}) {
1127
- const i = { ...this.defaultOptions, ...t };
1128
- return this.queue.add(async () => Se(
1129
- async () => {
1130
- try {
1131
- const s = {
1132
- q: e,
1133
- format: "json",
1134
- addressdetails: 1,
1135
- limit: 1,
1136
- dedupe: 1
1137
- };
1138
- i.countryCode && (s.countrycodes = i.countryCode), i.viewbox && (s.viewbox = i.viewbox.join(","), i.bounded && (s.bounded = 1));
1139
- const a = new URL(`${this.baseURL}/search`);
1140
- Object.entries(s).forEach(([l, d]) => {
1141
- a.searchParams.append(l, String(d));
1142
- });
1143
- const c = await this.fetchWithTimeout(
1144
- a.toString(),
1145
- i.timeout,
1146
- i.userAgent
1147
- );
1148
- if (!c || c.length === 0)
1149
- throw new C(
1150
- Fe.GEOCODING_ERROR,
1151
- `No results found for address: ${e}`
1152
- );
1153
- const u = c[0], o = {
1154
- latitude: parseFloat(u.lat),
1155
- longitude: parseFloat(u.lon)
1156
- };
1157
- if (isNaN(o.latitude) || isNaN(o.longitude)) {
1158
- const l = new Error(
1159
- "Invalid coordinates received from geocoding service"
1160
- );
1161
- throw l.name = "GeocodingError", l;
1162
- }
1163
- if (o.latitude < -90 || o.latitude > 90 || o.longitude < -180 || o.longitude > 180) {
1164
- const l = new Error("Coordinates out of valid range");
1165
- throw l.name = "GeocodingError", l;
1166
- }
1167
- return {
1168
- coordinates: o,
1169
- display_name: u.display_name,
1170
- confidence: u.importance,
1171
- address: u.address ? {
1172
- house_number: u.address.house_number,
1173
- road: u.address.road,
1174
- neighbourhood: u.address.neighbourhood,
1175
- suburb: u.address.suburb,
1176
- city: u.address.city || u.address.town || u.address.village,
1177
- county: u.address.county,
1178
- state: u.address.state,
1179
- postcode: u.address.postcode,
1180
- country: u.address.country
1181
- } : void 0
1182
- };
1183
- } catch (s) {
1184
- throw s;
1185
- }
1186
- },
1187
- {
1188
- retries: i.retryCount,
1189
- factor: 2,
1190
- minTimeout: 1e3,
1191
- maxTimeout: 1e4,
1192
- onFailedAttempt: (s) => {
1193
- console.warn(
1194
- `Geocoding attempt ${s.attemptNumber} failed. ${s.retriesLeft} retries left. Error: ${s.error.message}`
1195
- );
1196
- }
1197
- }
1198
- ));
1199
- }
1200
- /**
1201
- * Batch geocode multiple addresses
1202
- */
1203
- async batchGeocode(e, t = {}) {
1204
- const i = e.map(
1205
- (a) => this.geocode(a, t).catch((c) => (console.warn(`Failed to geocode address "${a}":`, c.message), null))
1206
- );
1207
- return (await Promise.all(i)).filter((a) => a !== null);
1208
- }
1209
- /**
1210
- * Reverse geocode coordinates to an address
1211
- */
1212
- async reverseGeocode(e, t = {}) {
1213
- const i = { ...this.defaultOptions, ...t };
1214
- return this.queue.add(async () => Se(
1215
- async () => {
1216
- try {
1217
- const s = new URL(`${this.baseURL}/reverse`);
1218
- s.searchParams.append("lat", String(e.latitude)), s.searchParams.append("lon", String(e.longitude)), s.searchParams.append("format", "json"), s.searchParams.append("addressdetails", "1");
1219
- const a = await this.fetchWithTimeout(
1220
- s.toString(),
1221
- i.timeout,
1222
- i.userAgent
1223
- );
1224
- if (!a) {
1225
- const u = new Error(
1226
- `No results found for coordinates: ${e.latitude}, ${e.longitude}`
1227
- );
1228
- throw u.name = "GeocodingError", u;
1229
- }
1230
- const c = a;
1231
- return {
1232
- coordinates: {
1233
- latitude: parseFloat(c.lat),
1234
- longitude: parseFloat(c.lon)
1235
- },
1236
- display_name: c.display_name,
1237
- confidence: c.importance,
1238
- address: c.address ? {
1239
- house_number: c.address.house_number,
1240
- road: c.address.road,
1241
- neighbourhood: c.address.neighbourhood,
1242
- suburb: c.address.suburb,
1243
- city: c.address.city || c.address.town || c.address.village,
1244
- county: c.address.county,
1245
- state: c.address.state,
1246
- postcode: c.address.postcode,
1247
- country: c.address.country
1248
- } : void 0
1249
- };
1250
- } catch (s) {
1251
- throw s;
1252
- }
1253
- },
1254
- {
1255
- retries: i.retryCount,
1256
- factor: 2,
1257
- minTimeout: 1e3,
1258
- maxTimeout: 1e4
1259
- }
1260
- ));
1261
- }
1262
- /**
1263
- * Get the current queue size
1264
- */
1265
- getQueueSize() {
1266
- return this.queue.size;
1267
- }
1268
- /**
1269
- * Get the number of pending operations
1270
- */
1271
- getPendingCount() {
1272
- return this.queue.pending;
1273
- }
1274
- /**
1275
- * Clear the queue
1276
- */
1277
- clearQueue() {
1278
- this.queue.clear();
1279
- }
1280
- /**
1281
- * Set concurrency limit
1282
- */
1283
- setConcurrency(e) {
1284
- this.queue.concurrency = e;
1285
- }
1286
- /**
1287
- * Get the current user agent string
1288
- */
1289
- getUserAgent() {
1290
- return this.defaultOptions.userAgent;
1291
- }
1292
- /**
1293
- * Set the user agent string for geocoding requests
1294
- */
1295
- setUserAgent(e) {
1296
- if (!e || e.trim().length === 0)
1297
- throw new Error("User agent must be a non-empty string");
1298
- this.defaultOptions.userAgent = e.trim();
1299
- }
631
+ function Ie() {
632
+ x(w, this) || (this.on("add", () => {
633
+ x(I, this).size > 0 && b(V, this, U).call(this);
634
+ }), this.on("next", () => {
635
+ b(V, this, U).call(this);
636
+ }));
1300
637
  }
1301
- var v = /* @__PURE__ */ ((r) => (r.JSON = "json", r.JSONP = "jsonp", r.TSML = "tsml", r.CSV = "csv", r))(v || {}), _ = /* @__PURE__ */ ((r) => (r.GET_SEARCH_RESULTS = "GetSearchResults", r.GET_FORMATS = "GetFormats", r.GET_SERVICE_BODIES = "GetServiceBodies", r.GET_CHANGES = "GetChanges", r.GET_FIELD_KEYS = "GetFieldKeys", r.GET_FIELD_VALUES = "GetFieldValues", r.GET_NAWS_DUMP = "GetNAWSDump", r.GET_SERVER_INFO = "GetServerInfo", r.GET_COVERAGE_AREA = "GetCoverageArea", r))(_ || {}), $ = /* @__PURE__ */ ((r) => (r[r.SUNDAY = 1] = "SUNDAY", r[r.MONDAY = 2] = "MONDAY", r[r.TUESDAY = 3] = "TUESDAY", r[r.WEDNESDAY = 4] = "WEDNESDAY", r[r.THURSDAY = 5] = "THURSDAY", r[r.FRIDAY = 6] = "FRIDAY", r[r.SATURDAY = 7] = "SATURDAY", r))($ || {}), K = /* @__PURE__ */ ((r) => (r[r.IN_PERSON = 1] = "IN_PERSON", r[r.VIRTUAL = 2] = "VIRTUAL", r[r.HYBRID = 3] = "HYBRID", r))(K || {}), it = /* @__PURE__ */ ((r) => (r.WEEKDAY = "weekday", r.TIME = "time", r.TOWN = "town", r.STATE = "state", r.WEEKDAY_STATE = "weekday_state", r))(it || {}), st = /* @__PURE__ */ ((r) => (r.ENGLISH = "en", r.GERMAN = "de", r.DANISH = "dk", r.SPANISH = "es", r.PERSIAN = "fa", r.FRENCH = "fr", r.ITALIAN = "it", r.POLISH = "pl", r.PORTUGUESE = "pt", r.SWEDISH = "sv", r))(st || {});
1302
- function nt(r) {
1303
- const { rootServerURL: e, format: t, endpoint: i, parameters: s = {} } = r, c = `${e.endsWith("/") ? e : `${e}/`}client_interface/${t}/`, u = new URLSearchParams();
1304
- return u.set("switcher", i), Object.entries(s).forEach(([o, l]) => {
1305
- l != null && (Array.isArray(l) ? l.forEach((d, f) => {
1306
- (typeof d == "number" || typeof d == "string") && u.append(`${o}[]`, d.toString());
1307
- }) : typeof l == "boolean" ? u.set(o, l ? "1" : "0") : u.set(o, l.toString()));
1308
- }), `${c}?${u.toString()}`;
638
+ function U() {
639
+ x(w, this) || x(O, this) || (C(O, this, !0), queueMicrotask(() => {
640
+ C(O, this, !1), b(V, this, Re).call(this);
641
+ }));
1309
642
  }
1310
- function ht(r) {
1311
- const e = {};
1312
- return Object.entries(r).forEach(([t, i]) => {
1313
- if (i != null)
1314
- if (Array.isArray(i))
1315
- e[t] = i.map((s) => {
1316
- if (typeof s == "number")
1317
- return s;
1318
- if (typeof s == "string") {
1319
- const a = parseFloat(s);
1320
- return isNaN(a) ? s : a;
1321
- }
1322
- return s;
1323
- });
1324
- else if (typeof i == "boolean")
1325
- e[t] = i;
1326
- else if (typeof i == "string") {
1327
- const s = parseFloat(i);
1328
- !isNaN(s) && isFinite(s) ? e[t] = s : e[t] = i;
1329
- } else
1330
- e[t] = i;
1331
- }), e;
643
+ function Le() {
644
+ x(w, this) || (b(V, this, Se).call(this), b(V, this, U).call(this));
1332
645
  }
1333
- function at(r, e) {
1334
- const i = {
1335
- [_.GET_SEARCH_RESULTS]: [
1336
- v.JSON,
1337
- v.JSONP,
1338
- v.TSML
1339
- ],
1340
- [_.GET_FORMATS]: [v.JSON, v.JSONP],
1341
- [_.GET_SERVICE_BODIES]: [v.JSON, v.JSONP],
1342
- [_.GET_CHANGES]: [v.JSON, v.JSONP],
1343
- [_.GET_FIELD_KEYS]: [v.JSON, v.JSONP],
1344
- [_.GET_FIELD_VALUES]: [v.JSON, v.JSONP],
1345
- [_.GET_NAWS_DUMP]: [v.CSV],
1346
- [_.GET_SERVER_INFO]: [v.JSON, v.JSONP],
1347
- [_.GET_COVERAGE_AREA]: [v.JSON, v.JSONP]
1348
- }[r];
1349
- if (!i.includes(e))
1350
- throw new Error(
1351
- `Invalid format '${e}' for endpoint '${r}'. Valid formats: ${i.join(", ")}`
1352
- );
646
+ function Re() {
647
+ let e = x(D, this);
648
+ if (x(w, this) || x(I, this).size === 0) {
649
+ e && (C(D, this, !1), this.emit("rateLimitCleared"));
650
+ return;
651
+ }
652
+ let t;
653
+ if (x(N, this)) {
654
+ let e = Date.now();
655
+ b(V, this, be).call(this, e), t = b(V, this, Ce).call(this);
656
+ } else t = x(T, this);
657
+ let n = t >= x(E, this);
658
+ n !== e && (C(D, this, n), this.emit(n ? "rateLimit" : "rateLimitCleared"));
1353
659
  }
1354
- function Ae(r) {
1355
- try {
1356
- const e = new URL(r);
1357
- if (!["http:", "https:"].includes(e.protocol))
1358
- throw new Error("Root server URL must use http or https protocol");
1359
- return e.href.replace(/\/$/, "");
1360
- } catch (e) {
1361
- const t = new Error(`Invalid root server URL: ${r}`);
1362
- throw t.cause = e, t;
1363
- }
660
+ //#endregion
661
+ //#region src/utils/errors.ts
662
+ var W = /* @__PURE__ */ function(e) {
663
+ return e.API_ERROR = "ApiError", e.NETWORK_ERROR = "NetworkError", e.VALIDATION_ERROR = "ValidationError", e.GEOCODING_ERROR = "GeocodingError", e.RATE_LIMIT_ERROR = "RateLimitError", e.TIMEOUT_ERROR = "TimeoutError", e.AUTHENTICATION_ERROR = "AuthenticationError", e.SERVER_ERROR = "ServerError", e.CLIENT_ERROR = "ClientError", e.CONFIGURATION_ERROR = "ConfigurationError", e;
664
+ }({}), G = class e extends Error {
665
+ constructor(t, n, r = {}) {
666
+ super(n), v(this, "type", void 0), v(this, "statusCode", void 0), v(this, "response", void 0), v(this, "originalError", void 0), v(this, "context", void 0), this.name = "BmltQueryError", this.type = t, this.statusCode = r.statusCode, this.response = r.response, this.originalError = r.originalError, this.context = r.context, Object.setPrototypeOf(this, e.prototype);
667
+ }
668
+ isType(e) {
669
+ return this.type === e;
670
+ }
671
+ isRetryable() {
672
+ return [
673
+ W.NETWORK_ERROR,
674
+ W.TIMEOUT_ERROR,
675
+ W.RATE_LIMIT_ERROR,
676
+ W.SERVER_ERROR
677
+ ].includes(this.type);
678
+ }
679
+ isClientError() {
680
+ return this.statusCode !== void 0 && this.statusCode >= 400 && this.statusCode < 500;
681
+ }
682
+ isServerError() {
683
+ return this.statusCode !== void 0 && this.statusCode >= 500;
684
+ }
685
+ getUserMessage() {
686
+ switch (this.type) {
687
+ case W.NETWORK_ERROR: return "Unable to connect to the BMLT server. Please check your internet connection and try again.";
688
+ case W.TIMEOUT_ERROR: return "The request timed out. Please try again later.";
689
+ case W.RATE_LIMIT_ERROR: return "Too many requests. Please wait a moment and try again.";
690
+ case W.GEOCODING_ERROR: return "Unable to find the specified address. Please check the address and try again.";
691
+ case W.VALIDATION_ERROR: return "Invalid input provided. Please check your parameters and try again.";
692
+ case W.AUTHENTICATION_ERROR: return "Authentication failed. Please check your credentials.";
693
+ case W.SERVER_ERROR: return "The BMLT server encountered an error. Please try again later.";
694
+ case W.API_ERROR: return this.statusCode === 404 ? "The requested resource was not found." : "An error occurred while communicating with the BMLT server.";
695
+ case W.CONFIGURATION_ERROR: return "Invalid configuration. Please check your settings.";
696
+ default: return this.message || "An unexpected error occurred.";
697
+ }
698
+ }
699
+ toJSON() {
700
+ return {
701
+ name: this.name,
702
+ type: this.type,
703
+ message: this.message,
704
+ statusCode: this.statusCode,
705
+ response: this.response,
706
+ context: this.context,
707
+ stack: this.stack,
708
+ originalError: this.originalError ? {
709
+ name: this.originalError.name,
710
+ message: this.originalError.message,
711
+ stack: this.originalError.stack
712
+ } : void 0
713
+ };
714
+ }
715
+ }, K = class {
716
+ static createApiError(e, t, n, r) {
717
+ let i;
718
+ return i = t ? t >= 500 ? W.SERVER_ERROR : t === 401 || t === 403 ? W.AUTHENTICATION_ERROR : t === 429 ? W.RATE_LIMIT_ERROR : t >= 400 ? W.CLIENT_ERROR : W.API_ERROR : W.API_ERROR, new G(i, e, {
719
+ statusCode: t,
720
+ response: n,
721
+ originalError: r
722
+ });
723
+ }
724
+ static createNetworkError(e, t) {
725
+ return new G(W.NETWORK_ERROR, e, { originalError: t });
726
+ }
727
+ static createTimeoutError(e, t) {
728
+ return new G(W.TIMEOUT_ERROR, e, { originalError: t });
729
+ }
730
+ static createValidationError(e, t) {
731
+ return new G(W.VALIDATION_ERROR, e, { context: t });
732
+ }
733
+ static createGeocodingError(e, t, n) {
734
+ return new G(W.GEOCODING_ERROR, e, {
735
+ originalError: t,
736
+ context: n
737
+ });
738
+ }
739
+ static createRateLimitError(e, t, n) {
740
+ return new G(W.RATE_LIMIT_ERROR, e, {
741
+ statusCode: t,
742
+ response: n
743
+ });
744
+ }
745
+ static createConfigurationError(e, t) {
746
+ return new G(W.CONFIGURATION_ERROR, e, { context: t });
747
+ }
748
+ }, q = class e {
749
+ static handleFetchError(e, t) {
750
+ if (e instanceof Error && e.name === "AbortError") return K.createTimeoutError("Request timeout", e);
751
+ if (e instanceof TypeError) return K.createNetworkError("Network connection failed", e);
752
+ if (t && !t.ok) {
753
+ let n = `HTTP ${t.status}: ${t.statusText}`;
754
+ return K.createApiError(n, t.status, void 0, e);
755
+ }
756
+ return e instanceof Error ? K.createApiError(e.message, void 0, void 0, e) : K.createApiError("Unknown error occurred", void 0, void 0, Error(String(e)));
757
+ }
758
+ static handleAxiosError(t) {
759
+ return e.handleFetchError(t);
760
+ }
761
+ static handleValidationError(e, t, n, r) {
762
+ let i = `Invalid ${e}: expected ${n}`;
763
+ return r && r.length > 0 && (i += ` (${r.join(", ")})`), K.createValidationError(i, {
764
+ field: e,
765
+ value: t,
766
+ expectedType: n,
767
+ constraints: r
768
+ });
769
+ }
770
+ static handleEndpointError(e, t) {
771
+ let n = `Invalid endpoint/format combination: ${e} with ${t}`;
772
+ return K.createValidationError(n, {
773
+ endpoint: e,
774
+ format: t
775
+ });
776
+ }
777
+ static handleUrlError(e, t) {
778
+ let n = `Invalid URL: ${t}`;
779
+ return K.createValidationError(n, {
780
+ url: e,
781
+ reason: t
782
+ });
783
+ }
784
+ static handleCoordinateError(e, t, n) {
785
+ let r = n || "Invalid coordinates provided";
786
+ return K.createValidationError(r, {
787
+ latitude: e,
788
+ longitude: t,
789
+ reason: n
790
+ });
791
+ }
792
+ static wrapError(e, t, n) {
793
+ let r = `${t}: ${e.message}`;
794
+ return e instanceof G ? new G(e.type, r, {
795
+ statusCode: e.statusCode,
796
+ response: e.response,
797
+ originalError: e.originalError || e,
798
+ context: {
799
+ ...e.context,
800
+ ...n
801
+ }
802
+ }) : K.createApiError(r, void 0, void 0, e);
803
+ }
804
+ }, ze = class {
805
+ static async withRetry(e, t) {
806
+ let { maxRetries: n, baseDelay: r, maxDelay: i, factor: a, onRetry: o } = t, s;
807
+ for (let t = 0; t <= n; t++) try {
808
+ return await e();
809
+ } catch (e) {
810
+ let c = e instanceof G ? e : q.wrapError(e, "Operation failed");
811
+ if (s = c, t === n || !c.isRetryable()) throw c;
812
+ let l = Math.min(r * a ** +t, i);
813
+ o && o(c, t + 1), await new Promise((e) => setTimeout(e, l));
814
+ }
815
+ throw s;
816
+ }
817
+ }, Be = class {
818
+ constructor(e = {}) {
819
+ v(this, "baseURL", void 0), v(this, "queue", void 0), v(this, "defaultOptions", void 0);
820
+ let { retryCount: t = 3, timeout: n = 1e4, userAgent: r = "bmlt-query-client/1.0.0", countryCode: i = "us", viewbox: a, bounded: o = !1, intervalCap: s = 1, interval: c = 1e3, concurrency: l = 1, carryoverConcurrencyCount: u = !1, ...d } = e;
821
+ this.defaultOptions = {
822
+ retryCount: t,
823
+ timeout: n,
824
+ userAgent: r,
825
+ countryCode: i,
826
+ viewbox: a,
827
+ bounded: o
828
+ }, this.baseURL = "https://nominatim.openstreetmap.org", this.queue = new ye({
829
+ intervalCap: s,
830
+ interval: c,
831
+ concurrency: l,
832
+ carryoverConcurrencyCount: u,
833
+ ...d
834
+ });
835
+ }
836
+ async fetchWithTimeout(e, t, n) {
837
+ let r = new AbortController(), i = setTimeout(() => r.abort(), t);
838
+ try {
839
+ let t = await fetch(e, {
840
+ method: "GET",
841
+ headers: { "User-Agent": n },
842
+ signal: r.signal
843
+ });
844
+ if (!t.ok) {
845
+ if (t.status === 429) {
846
+ let e = /* @__PURE__ */ Error("Rate limit exceeded for geocoding service");
847
+ throw e.name = "RateLimitError", e.statusCode = 429, e;
848
+ }
849
+ if (t.status >= 400) {
850
+ let e = /* @__PURE__ */ Error(`Geocoding service error: ${t.status} ${t.statusText}`);
851
+ throw e.name = "GeocodingError", e.statusCode = t.status, e;
852
+ }
853
+ }
854
+ return await t.json();
855
+ } catch (e) {
856
+ if (e instanceof Error && e.name === "AbortError") {
857
+ let e = /* @__PURE__ */ Error("Request timeout during geocoding");
858
+ throw e.name = "TimeoutError", e;
859
+ }
860
+ if (e instanceof TypeError) {
861
+ let e = /* @__PURE__ */ Error("Network error occurred during geocoding");
862
+ throw e.name = "NetworkError", e;
863
+ }
864
+ throw e;
865
+ } finally {
866
+ clearTimeout(i);
867
+ }
868
+ }
869
+ async geocode(e, t = {}) {
870
+ let n = {
871
+ ...this.defaultOptions,
872
+ ...t
873
+ };
874
+ return this.queue.add(async () => ie(async () => {
875
+ try {
876
+ let t = {
877
+ q: e,
878
+ format: "json",
879
+ addressdetails: 1,
880
+ limit: 1,
881
+ dedupe: 1
882
+ };
883
+ n.countryCode && (t.countrycodes = n.countryCode), n.viewbox && (t.viewbox = n.viewbox.join(","), n.bounded && (t.bounded = 1));
884
+ let r = new URL(`${this.baseURL}/search`);
885
+ Object.entries(t).forEach(([e, t]) => {
886
+ r.searchParams.append(e, String(t));
887
+ });
888
+ let i = await this.fetchWithTimeout(r.toString(), n.timeout, n.userAgent);
889
+ if (!i || i.length === 0) throw new G(W.GEOCODING_ERROR, `No results found for address: ${e}`);
890
+ let a = i[0], o = {
891
+ latitude: parseFloat(a.lat),
892
+ longitude: parseFloat(a.lon)
893
+ };
894
+ if (isNaN(o.latitude) || isNaN(o.longitude)) {
895
+ let e = /* @__PURE__ */ Error("Invalid coordinates received from geocoding service");
896
+ throw e.name = "GeocodingError", e;
897
+ }
898
+ if (o.latitude < -90 || o.latitude > 90 || o.longitude < -180 || o.longitude > 180) {
899
+ let e = /* @__PURE__ */ Error("Coordinates out of valid range");
900
+ throw e.name = "GeocodingError", e;
901
+ }
902
+ return {
903
+ coordinates: o,
904
+ display_name: a.display_name,
905
+ confidence: a.importance,
906
+ address: a.address ? {
907
+ house_number: a.address.house_number,
908
+ road: a.address.road,
909
+ neighbourhood: a.address.neighbourhood,
910
+ suburb: a.address.suburb,
911
+ city: a.address.city || a.address.town || a.address.village,
912
+ county: a.address.county,
913
+ state: a.address.state,
914
+ postcode: a.address.postcode,
915
+ country: a.address.country
916
+ } : void 0
917
+ };
918
+ } catch (e) {
919
+ throw e;
920
+ }
921
+ }, {
922
+ retries: n.retryCount,
923
+ factor: 2,
924
+ minTimeout: 1e3,
925
+ maxTimeout: 1e4,
926
+ onFailedAttempt: (e) => {
927
+ console.warn(`Geocoding attempt ${e.attemptNumber} failed. ${e.retriesLeft} retries left. Error: ${e.error.message}`);
928
+ }
929
+ }));
930
+ }
931
+ async batchGeocode(e, t = {}) {
932
+ let n = e.map((e) => this.geocode(e, t).catch((t) => (console.warn(`Failed to geocode address "${e}":`, t.message), null)));
933
+ return (await Promise.all(n)).filter((e) => e !== null);
934
+ }
935
+ async reverseGeocode(e, t = {}) {
936
+ let n = {
937
+ ...this.defaultOptions,
938
+ ...t
939
+ };
940
+ return this.queue.add(async () => ie(async () => {
941
+ try {
942
+ let t = new URL(`${this.baseURL}/reverse`);
943
+ t.searchParams.append("lat", String(e.latitude)), t.searchParams.append("lon", String(e.longitude)), t.searchParams.append("format", "json"), t.searchParams.append("addressdetails", "1");
944
+ let r = await this.fetchWithTimeout(t.toString(), n.timeout, n.userAgent);
945
+ if (!r) {
946
+ let t = /* @__PURE__ */ Error(`No results found for coordinates: ${e.latitude}, ${e.longitude}`);
947
+ throw t.name = "GeocodingError", t;
948
+ }
949
+ let i = r;
950
+ return {
951
+ coordinates: {
952
+ latitude: parseFloat(i.lat),
953
+ longitude: parseFloat(i.lon)
954
+ },
955
+ display_name: i.display_name,
956
+ confidence: i.importance,
957
+ address: i.address ? {
958
+ house_number: i.address.house_number,
959
+ road: i.address.road,
960
+ neighbourhood: i.address.neighbourhood,
961
+ suburb: i.address.suburb,
962
+ city: i.address.city || i.address.town || i.address.village,
963
+ county: i.address.county,
964
+ state: i.address.state,
965
+ postcode: i.address.postcode,
966
+ country: i.address.country
967
+ } : void 0
968
+ };
969
+ } catch (e) {
970
+ throw e;
971
+ }
972
+ }, {
973
+ retries: n.retryCount,
974
+ factor: 2,
975
+ minTimeout: 1e3,
976
+ maxTimeout: 1e4
977
+ }));
978
+ }
979
+ getQueueSize() {
980
+ return this.queue.size;
981
+ }
982
+ getPendingCount() {
983
+ return this.queue.pending;
984
+ }
985
+ clearQueue() {
986
+ this.queue.clear();
987
+ }
988
+ setConcurrency(e) {
989
+ this.queue.concurrency = e;
990
+ }
991
+ getUserAgent() {
992
+ return this.defaultOptions.userAgent;
993
+ }
994
+ setUserAgent(e) {
995
+ if (!e || e.trim().length === 0) throw Error("User agent must be a non-empty string");
996
+ this.defaultOptions.userAgent = e.trim();
997
+ }
998
+ }, J = /* @__PURE__ */ function(e) {
999
+ return e.JSON = "json", e.JSONP = "jsonp", e.TSML = "tsml", e.CSV = "csv", e;
1000
+ }({}), Y = /* @__PURE__ */ function(e) {
1001
+ return e.GET_SEARCH_RESULTS = "GetSearchResults", e.GET_FORMATS = "GetFormats", e.GET_SERVICE_BODIES = "GetServiceBodies", e.GET_CHANGES = "GetChanges", e.GET_FIELD_KEYS = "GetFieldKeys", e.GET_FIELD_VALUES = "GetFieldValues", e.GET_NAWS_DUMP = "GetNAWSDump", e.GET_SERVER_INFO = "GetServerInfo", e.GET_COVERAGE_AREA = "GetCoverageArea", e;
1002
+ }({}), X = /* @__PURE__ */ function(e) {
1003
+ return e[e.SUNDAY = 1] = "SUNDAY", e[e.MONDAY = 2] = "MONDAY", e[e.TUESDAY = 3] = "TUESDAY", e[e.WEDNESDAY = 4] = "WEDNESDAY", e[e.THURSDAY = 5] = "THURSDAY", e[e.FRIDAY = 6] = "FRIDAY", e[e.SATURDAY = 7] = "SATURDAY", e;
1004
+ }({}), Z = /* @__PURE__ */ function(e) {
1005
+ return e[e.IN_PERSON = 1] = "IN_PERSON", e[e.VIRTUAL = 2] = "VIRTUAL", e[e.HYBRID = 3] = "HYBRID", e;
1006
+ }({}), Ve = /* @__PURE__ */ function(e) {
1007
+ return e.WEEKDAY = "weekday", e.TIME = "time", e.TOWN = "town", e.STATE = "state", e.WEEKDAY_STATE = "weekday_state", e;
1008
+ }({}), He = /* @__PURE__ */ function(e) {
1009
+ return e.ENGLISH = "en", e.GERMAN = "de", e.DANISH = "dk", e.SPANISH = "es", e.PERSIAN = "fa", e.FRENCH = "fr", e.ITALIAN = "it", e.POLISH = "pl", e.PORTUGUESE = "pt", e.SWEDISH = "sv", e;
1010
+ }({});
1011
+ //#endregion
1012
+ //#region src/utils/url-builder.ts
1013
+ function Ue(e) {
1014
+ let { rootServerURL: t, format: n, endpoint: r, parameters: i = {} } = e, a = `${t.endsWith("/") ? t : `${t}/`}client_interface/${n}/`, o = new URLSearchParams();
1015
+ return o.set("switcher", r), Object.entries(i).forEach(([e, t]) => {
1016
+ t != null && (Array.isArray(t) ? t.forEach((t, n) => {
1017
+ (typeof t == "number" || typeof t == "string") && o.append(`${e}[]`, t.toString());
1018
+ }) : typeof t == "boolean" ? o.set(e, t ? "1" : "0") : o.set(e, t.toString()));
1019
+ }), `${a}?${o.toString()}`;
1364
1020
  }
1365
- function lt(r) {
1366
- return typeof r == "number" ? [r] : typeof r == "string" ? r.split(",").map((e) => parseInt(e.trim(), 10)).filter((e) => !isNaN(e)) : Array.isArray(r) ? r.map((e) => typeof e == "number" ? e : parseInt(String(e), 10)).filter((e) => !isNaN(e)) : [];
1021
+ function We(e) {
1022
+ let t = {};
1023
+ return Object.entries(e).forEach(([e, n]) => {
1024
+ if (n != null) if (Array.isArray(n)) t[e] = n.map((e) => {
1025
+ if (typeof e == "number") return e;
1026
+ if (typeof e == "string") {
1027
+ let t = parseFloat(e);
1028
+ return isNaN(t) ? e : t;
1029
+ }
1030
+ return e;
1031
+ });
1032
+ else if (typeof n == "boolean") t[e] = n;
1033
+ else if (typeof n == "string") {
1034
+ let r = parseFloat(n);
1035
+ !isNaN(r) && isFinite(r) ? t[e] = r : t[e] = n;
1036
+ } else t[e] = n;
1037
+ }), t;
1367
1038
  }
1368
- function dt(r, e) {
1369
- const t = {};
1370
- if (typeof r == "number") {
1371
- if (r < 0 || r > 23)
1372
- throw new Error("Hours must be between 0 and 23");
1373
- t.hours = r;
1374
- }
1375
- if (typeof e == "number") {
1376
- if (e < 0 || e > 59)
1377
- throw new Error("Minutes must be between 0 and 59");
1378
- t.minutes = e;
1379
- }
1380
- return t;
1039
+ function Ge(e, t) {
1040
+ let n = {
1041
+ [Y.GET_SEARCH_RESULTS]: [
1042
+ J.JSON,
1043
+ J.JSONP,
1044
+ J.TSML
1045
+ ],
1046
+ [Y.GET_FORMATS]: [J.JSON, J.JSONP],
1047
+ [Y.GET_SERVICE_BODIES]: [J.JSON, J.JSONP],
1048
+ [Y.GET_CHANGES]: [J.JSON, J.JSONP],
1049
+ [Y.GET_FIELD_KEYS]: [J.JSON, J.JSONP],
1050
+ [Y.GET_FIELD_VALUES]: [J.JSON, J.JSONP],
1051
+ [Y.GET_NAWS_DUMP]: [J.CSV],
1052
+ [Y.GET_SERVER_INFO]: [J.JSON, J.JSONP],
1053
+ [Y.GET_COVERAGE_AREA]: [J.JSON, J.JSONP]
1054
+ }[e];
1055
+ if (!n.includes(t)) throw Error(`Invalid format '${t}' for endpoint '${e}'. Valid formats: ${n.join(", ")}`);
1381
1056
  }
1382
- function ot(r, e) {
1383
- if (typeof r != "number" || isNaN(r))
1384
- throw new Error("Latitude must be a valid number");
1385
- if (typeof e != "number" || isNaN(e))
1386
- throw new Error("Longitude must be a valid number");
1387
- if (r < -90 || r > 90)
1388
- throw new Error("Latitude must be between -90 and 90 degrees");
1389
- if (e < -180 || e > 180)
1390
- throw new Error("Longitude must be between -180 and 180 degrees");
1057
+ function Ke(e) {
1058
+ try {
1059
+ let t = new URL(e);
1060
+ if (!["http:", "https:"].includes(t.protocol)) throw Error("Root server URL must use http or https protocol");
1061
+ return t.href.replace(/\/$/, "");
1062
+ } catch (t) {
1063
+ let n = /* @__PURE__ */ Error(`Invalid root server URL: ${e}`);
1064
+ throw n.cause = t, n;
1065
+ }
1391
1066
  }
1392
- function ae(r) {
1393
- if (typeof r != "number" || isNaN(r))
1394
- throw new Error("Radius must be a valid number");
1395
- if (r <= 0)
1396
- throw new Error("Radius must be greater than 0");
1067
+ function qe(e) {
1068
+ return typeof e == "number" ? [e] : typeof e == "string" ? e.split(",").map((e) => parseInt(e.trim(), 10)).filter((e) => !isNaN(e)) : Array.isArray(e) ? e.map((e) => typeof e == "number" ? e : parseInt(String(e), 10)).filter((e) => !isNaN(e)) : [];
1397
1069
  }
1398
- function ft(r) {
1399
- return r * 1.60934;
1070
+ function Je(e, t) {
1071
+ let n = {};
1072
+ if (typeof e == "number") {
1073
+ if (e < 0 || e > 23) throw Error("Hours must be between 0 and 23");
1074
+ n.hours = e;
1075
+ }
1076
+ if (typeof t == "number") {
1077
+ if (t < 0 || t > 59) throw Error("Minutes must be between 0 and 59");
1078
+ n.minutes = t;
1079
+ }
1080
+ return n;
1400
1081
  }
1401
- function mt(r) {
1402
- return r / 1.60934;
1082
+ function Ye(e, t) {
1083
+ if (typeof e != "number" || isNaN(e)) throw Error("Latitude must be a valid number");
1084
+ if (typeof t != "number" || isNaN(t)) throw Error("Longitude must be a valid number");
1085
+ if (e < -90 || e > 90) throw Error("Latitude must be between -90 and 90 degrees");
1086
+ if (t < -180 || t > 180) throw Error("Longitude must be between -180 and 180 degrees");
1403
1087
  }
1404
- class Et {
1405
- constructor(e) {
1406
- R(this, "timeout");
1407
- R(this, "userAgent");
1408
- R(this, "geocodingService");
1409
- R(this, "rootServerURL");
1410
- R(this, "defaultFormat");
1411
- const {
1412
- rootServerURL: t,
1413
- defaultFormat: i = v.JSON,
1414
- timeout: s = 3e4,
1415
- userAgent: a = "bmlt-query-client/1.0.0",
1416
- geocodingOptions: c = {},
1417
- enableGeocoding: u = !0
1418
- } = e;
1419
- this.rootServerURL = Ae(t), this.defaultFormat = i, this.timeout = s, this.userAgent = a, u && (this.geocodingService = new rt(c));
1420
- }
1421
- /**
1422
- * Make a request to the BMLT API
1423
- */
1424
- async makeRequest(e, t = {}, i = this.defaultFormat) {
1425
- let s;
1426
- try {
1427
- at(e, i);
1428
- const a = nt({
1429
- rootServerURL: this.rootServerURL,
1430
- format: i,
1431
- endpoint: e,
1432
- parameters: t
1433
- }), c = new AbortController(), u = setTimeout(() => c.abort(), this.timeout);
1434
- try {
1435
- s = await fetch(a, {
1436
- method: "GET",
1437
- headers: {
1438
- "User-Agent": this.userAgent
1439
- },
1440
- signal: c.signal
1441
- });
1442
- } finally {
1443
- clearTimeout(u);
1444
- }
1445
- if (!s.ok)
1446
- throw re.handleFetchError(
1447
- new Error(`HTTP ${s.status}: ${s.statusText}`),
1448
- s
1449
- );
1450
- const o = await s.text();
1451
- if (i === v.CSV)
1452
- return o;
1453
- if (i === v.JSONP) {
1454
- const l = t.callback || "callback", d = o.match(new RegExp(`${l}\\((.+)\\);?$`));
1455
- if (!d)
1456
- throw new Error("Invalid JSONP response format");
1457
- return JSON.parse(d[1]);
1458
- }
1459
- return i === v.JSON || i === v.TSML ? JSON.parse(o) : o;
1460
- } catch (a) {
1461
- throw re.handleFetchError(a, s);
1462
- }
1463
- }
1464
- /**
1465
- * Search for meetings
1466
- */
1467
- async searchMeetings(e = {}) {
1468
- const { format: t = this.defaultFormat, ...i } = e;
1469
- return this.makeRequest(_.GET_SEARCH_RESULTS, i, t);
1470
- }
1471
- /**
1472
- * Search for meetings by geographic location using geocoding
1473
- */
1474
- async searchMeetingsByAddress(e) {
1475
- if (!this.geocodingService)
1476
- throw new Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
1477
- const { address: t, radiusMiles: i, radiusKm: s, sortByDistance: a = !0, searchParams: c = {} } = e, u = await this.geocodingService.geocode(t), o = {
1478
- ...c,
1479
- lat_val: u.coordinates.latitude,
1480
- long_val: u.coordinates.longitude,
1481
- sort_results_by_distance: a
1482
- };
1483
- return i !== void 0 ? (ae(i), o.geo_width = i) : s !== void 0 && (ae(s), o.geo_width_km = s), this.searchMeetings(o);
1484
- }
1485
- /**
1486
- * Search for meetings by coordinates
1487
- */
1488
- async searchMeetingsByCoordinates(e, t, i, s = {}) {
1489
- ot(e.latitude, e.longitude);
1490
- const a = {
1491
- ...s,
1492
- lat_val: e.latitude,
1493
- long_val: e.longitude,
1494
- sort_results_by_distance: !0
1495
- };
1496
- return t !== void 0 ? (ae(t), a.geo_width = t) : i !== void 0 && (ae(i), a.geo_width_km = i), this.searchMeetings(a);
1497
- }
1498
- /**
1499
- * Get available meeting formats
1500
- */
1501
- async getFormats(e = {}) {
1502
- const { format: t = this.defaultFormat, ...i } = e;
1503
- return this.makeRequest(_.GET_FORMATS, i, t);
1504
- }
1505
- /**
1506
- * Get service bodies
1507
- */
1508
- async getServiceBodies(e = {}) {
1509
- const { format: t = this.defaultFormat, ...i } = e;
1510
- return this.makeRequest(_.GET_SERVICE_BODIES, i, t);
1511
- }
1512
- /**
1513
- * Get meeting changes within a date range
1514
- */
1515
- async getChanges(e = {}) {
1516
- const { format: t = this.defaultFormat, ...i } = e;
1517
- return this.makeRequest(_.GET_CHANGES, i, t);
1518
- }
1519
- /**
1520
- * Get available field keys
1521
- */
1522
- async getFieldKeys() {
1523
- return this.makeRequest(_.GET_FIELD_KEYS);
1524
- }
1525
- /**
1526
- * Get field values for a specific field key
1527
- */
1528
- async getFieldValues(e) {
1529
- const { format: t = this.defaultFormat, ...i } = e;
1530
- return this.makeRequest(_.GET_FIELD_VALUES, i, t);
1531
- }
1532
- /**
1533
- * Get NAWS dump for a service body (CSV format only)
1534
- */
1535
- async getNAWSDump(e) {
1536
- return this.makeRequest(_.GET_NAWS_DUMP, e, v.CSV);
1537
- }
1538
- /**
1539
- * Get server information
1540
- */
1541
- async getServerInfo() {
1542
- return this.makeRequest(_.GET_SERVER_INFO);
1543
- }
1544
- /**
1545
- * Get server coverage area
1546
- */
1547
- async getCoverageArea() {
1548
- return this.makeRequest(_.GET_COVERAGE_AREA);
1549
- }
1550
- /**
1551
- * Geocode an address using the built-in geocoding service
1552
- */
1553
- async geocodeAddress(e, t) {
1554
- if (!this.geocodingService)
1555
- throw new Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
1556
- return this.geocodingService.geocode(e, t);
1557
- }
1558
- /**
1559
- * Reverse geocode coordinates to an address
1560
- */
1561
- async reverseGeocode(e, t) {
1562
- if (!this.geocodingService)
1563
- throw new Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
1564
- return this.geocodingService.reverseGeocode(e, t);
1565
- }
1566
- /**
1567
- * Get the root server URL
1568
- */
1569
- getRootServerURL() {
1570
- return this.rootServerURL;
1571
- }
1572
- /**
1573
- * Update the root server URL
1574
- */
1575
- setRootServerURL(e) {
1576
- this.rootServerURL = Ae(e);
1577
- }
1578
- /**
1579
- * Get the default data format
1580
- */
1581
- getDefaultFormat() {
1582
- return this.defaultFormat;
1583
- }
1584
- /**
1585
- * Set the default data format
1586
- */
1587
- setDefaultFormat(e) {
1588
- this.defaultFormat = e;
1589
- }
1590
- /**
1591
- * Get geocoding service statistics
1592
- */
1593
- getGeocodingStats() {
1594
- return this.geocodingService ? {
1595
- queueSize: this.geocodingService.getQueueSize(),
1596
- pendingCount: this.geocodingService.getPendingCount()
1597
- } : null;
1598
- }
1599
- /**
1600
- * Clear the geocoding queue
1601
- */
1602
- clearGeocodingQueue() {
1603
- this.geocodingService && this.geocodingService.clearQueue();
1604
- }
1605
- /**
1606
- * Get the current user agent string
1607
- */
1608
- getUserAgent() {
1609
- return this.userAgent;
1610
- }
1611
- /**
1612
- * Set the user agent string for HTTP requests
1613
- */
1614
- setUserAgent(e) {
1615
- if (!e || e.trim().length === 0)
1616
- throw new Error("User agent must be a non-empty string");
1617
- this.userAgent = e.trim(), this.geocodingService && this.geocodingService.setUserAgent(this.userAgent);
1618
- }
1619
- /**
1620
- * Get the current timeout setting
1621
- */
1622
- getTimeout() {
1623
- return this.timeout;
1624
- }
1625
- /**
1626
- * Set the timeout for HTTP requests
1627
- */
1628
- setTimeout(e) {
1629
- if (!Number.isInteger(e) || e <= 0)
1630
- throw new Error("Timeout must be a positive integer");
1631
- this.timeout = e;
1632
- }
1088
+ function Q(e) {
1089
+ if (typeof e != "number" || isNaN(e)) throw Error("Radius must be a valid number");
1090
+ if (e <= 0) throw Error("Radius must be greater than 0");
1633
1091
  }
1634
- class F {
1635
- constructor(e) {
1636
- R(this, "params", {});
1637
- R(this, "client");
1638
- this.client = e;
1639
- }
1640
- /**
1641
- * Include or exclude specific meeting IDs
1642
- */
1643
- meetingIds(e, t = !1) {
1644
- return Array.isArray(e) ? this.params.meeting_ids = t ? e.map((i) => -i) : e : this.params.meeting_ids = t ? -e : e, this;
1645
- }
1646
- /**
1647
- * Include meetings on specific weekdays
1648
- */
1649
- onWeekdays(...e) {
1650
- return this.params.weekdays = e.length === 1 ? e[0] : e, this;
1651
- }
1652
- /**
1653
- * Exclude meetings on specific weekdays
1654
- */
1655
- notOnWeekdays(...e) {
1656
- const t = e.map((i) => -i);
1657
- return this.params.weekdays = t.length === 1 ? t[0] : t, this;
1658
- }
1659
- /**
1660
- * Filter by venue types
1661
- */
1662
- venueTypes(...e) {
1663
- return this.params.venue_types = e.length === 1 ? e[0] : e, this;
1664
- }
1665
- /**
1666
- * Include only in-person meetings
1667
- */
1668
- inPersonOnly() {
1669
- return this.venueTypes(K.IN_PERSON);
1670
- }
1671
- /**
1672
- * Include only virtual meetings
1673
- */
1674
- virtualOnly() {
1675
- return this.venueTypes(K.VIRTUAL);
1676
- }
1677
- /**
1678
- * Include only hybrid meetings
1679
- */
1680
- hybridOnly() {
1681
- return this.venueTypes(K.HYBRID);
1682
- }
1683
- /**
1684
- * Include virtual and hybrid meetings
1685
- */
1686
- virtualOrHybrid() {
1687
- return this.venueTypes(K.VIRTUAL, K.HYBRID);
1688
- }
1689
- /**
1690
- * Filter by meeting formats
1691
- */
1692
- formats(e, t = !1) {
1693
- return Array.isArray(e) ? this.params.formats = t ? e.map((i) => -i) : e : this.params.formats = t ? -e : e, this;
1694
- }
1695
- /**
1696
- * Use OR logic for format matching instead of AND
1697
- */
1698
- anyFormat() {
1699
- return this.params.formats_comparison_operator = "OR", this;
1700
- }
1701
- /**
1702
- * Filter by service bodies
1703
- */
1704
- serviceBodies(e, t = !1) {
1705
- return Array.isArray(e) ? this.params.services = t ? e.map((i) => -i) : e : this.params.services = t ? -e : e, this;
1706
- }
1707
- /**
1708
- * Include child service bodies
1709
- */
1710
- includeChildServiceBodies() {
1711
- return this.params.recursive = !0, this;
1712
- }
1713
- /**
1714
- * Search for specific text
1715
- */
1716
- searchText(e) {
1717
- return this.params.SearchString = e, this;
1718
- }
1719
- /**
1720
- * Meetings starting after specific time
1721
- */
1722
- startingAfter(e, t = 0) {
1723
- return this.params.StartsAfterH = e, this.params.StartsAfterM = t, this;
1724
- }
1725
- /**
1726
- * Meetings starting before specific time
1727
- */
1728
- startingBefore(e, t = 0) {
1729
- return this.params.StartsBeforeH = e, this.params.StartsBeforeM = t, this;
1730
- }
1731
- /**
1732
- * Meetings ending before specific time
1733
- */
1734
- endingBefore(e, t = 0) {
1735
- return this.params.EndsBeforeH = e, this.params.EndsBeforeM = t, this;
1736
- }
1737
- /**
1738
- * Minimum meeting duration
1739
- */
1740
- minimumDuration(e = 0, t = 0) {
1741
- return e > 0 && (this.params.MinDurationH = e), t > 0 && (this.params.MinDurationM = t), this;
1742
- }
1743
- /**
1744
- * Maximum meeting duration
1745
- */
1746
- maximumDuration(e = 0, t = 0) {
1747
- return e > 0 && (this.params.MaxDurationH = e), t > 0 && (this.params.MaxDurationM = t), this;
1748
- }
1749
- /**
1750
- * Search within geographic area by coordinates
1751
- */
1752
- nearCoordinates(e, t, i) {
1753
- return this.params.lat_val = e.latitude, this.params.long_val = e.longitude, t !== void 0 ? this.params.geo_width = t : i !== void 0 && (this.params.geo_width_km = i), this;
1754
- }
1755
- /**
1756
- * Search for specific field value
1757
- */
1758
- fieldValue(e, t) {
1759
- return this.params.meeting_key = e, this.params.meeting_key_value = t, this;
1760
- }
1761
- /**
1762
- * Return only specific fields
1763
- */
1764
- selectFields(...e) {
1765
- return this.params.data_field_key = e.join(","), this;
1766
- }
1767
- /**
1768
- * Sort results by specific fields
1769
- */
1770
- sortBy(...e) {
1771
- return this.params.sort_keys = e.join(","), this;
1772
- }
1773
- /**
1774
- * Sort by predefined aliases
1775
- */
1776
- sortByAlias(e) {
1777
- return this.params.sort_key = e, this;
1778
- }
1779
- /**
1780
- * Sort by distance (requires geographic search)
1781
- */
1782
- sortByDistance() {
1783
- return this.params.sort_results_by_distance = !0, this;
1784
- }
1785
- /**
1786
- * Set pagination
1787
- */
1788
- paginate(e, t = 1) {
1789
- return this.params.page_size = e, this.params.page_num = t, this;
1790
- }
1791
- /**
1792
- * Include unpublished meetings
1793
- */
1794
- includeUnpublished() {
1795
- return this.params.advanced_published = 0, this;
1796
- }
1797
- /**
1798
- * Include only unpublished meetings
1799
- */
1800
- unpublishedOnly() {
1801
- return this.params.advanced_published = -1, this;
1802
- }
1803
- /**
1804
- * Set language for format names
1805
- */
1806
- language(e) {
1807
- return this.params.lang_enum = e, this;
1808
- }
1809
- /**
1810
- * Set response format
1811
- */
1812
- format(e) {
1813
- return this.params.format = e, this;
1814
- }
1815
- /**
1816
- * Include formats used in search results
1817
- */
1818
- includeFormats() {
1819
- return this.params.get_used_formats = !0, this;
1820
- }
1821
- /**
1822
- * Return only formats (requires includeFormats)
1823
- */
1824
- formatsOnly() {
1825
- return this.params.get_used_formats = !0, this.params.get_formats_only = !0, this;
1826
- }
1827
- /**
1828
- * Filter by root server IDs (aggregator mode)
1829
- */
1830
- rootServerIds(e, t = !1) {
1831
- return Array.isArray(e) ? this.params.root_server_ids = t ? e.map((i) => -i) : e : this.params.root_server_ids = t ? -e : e, this;
1832
- }
1833
- /**
1834
- * Get the current query parameters
1835
- */
1836
- getParams() {
1837
- return { ...this.params };
1838
- }
1839
- /**
1840
- * Reset the query builder
1841
- */
1842
- reset() {
1843
- return this.params = {}, this;
1844
- }
1845
- /**
1846
- * Clone the current query builder
1847
- */
1848
- clone() {
1849
- const e = new F(this.client);
1850
- return e.params = { ...this.params }, e;
1851
- }
1852
- /**
1853
- * Execute the search and return results
1854
- */
1855
- async execute() {
1856
- return this.client.searchMeetings(this.params);
1857
- }
1858
- /**
1859
- * Execute the search by geocoding an address first
1860
- */
1861
- async executeNearAddress(e, t, i, s = !0) {
1862
- return this.client.searchMeetingsByAddress({
1863
- address: e,
1864
- radiusMiles: t,
1865
- radiusKm: i,
1866
- sortByDistance: s,
1867
- searchParams: this.params
1868
- });
1869
- }
1092
+ function Xe(e) {
1093
+ return e * 1.60934;
1870
1094
  }
1871
- class gt {
1872
- constructor(e) {
1873
- R(this, "client");
1874
- this.client = e;
1875
- }
1876
- /**
1877
- * Search for today's meetings
1878
- */
1879
- today() {
1880
- const e = (/* @__PURE__ */ new Date()).getDay(), t = e === 0 ? $.SUNDAY : e;
1881
- return new F(this.client).onWeekdays(t);
1882
- }
1883
- /**
1884
- * Search for weekend meetings
1885
- */
1886
- weekend() {
1887
- return new F(this.client).onWeekdays($.SATURDAY, $.SUNDAY);
1888
- }
1889
- /**
1890
- * Search for weekday meetings
1891
- */
1892
- weekdays() {
1893
- return new F(this.client).onWeekdays(
1894
- $.MONDAY,
1895
- $.TUESDAY,
1896
- $.WEDNESDAY,
1897
- $.THURSDAY,
1898
- $.FRIDAY
1899
- );
1900
- }
1901
- /**
1902
- * Search for evening meetings (after 5 PM)
1903
- */
1904
- evening() {
1905
- return new F(this.client).startingAfter(17);
1906
- }
1907
- /**
1908
- * Search for morning meetings (before 12 PM)
1909
- */
1910
- morning() {
1911
- return new F(this.client).startingBefore(12);
1912
- }
1913
- /**
1914
- * Search for virtual meetings only
1915
- */
1916
- virtual() {
1917
- return new F(this.client).virtualOnly();
1918
- }
1919
- /**
1920
- * Search for in-person meetings only
1921
- */
1922
- inPerson() {
1923
- return new F(this.client).inPersonOnly();
1924
- }
1925
- /**
1926
- * Search by meeting name or location
1927
- */
1928
- byText(e) {
1929
- return new F(this.client).searchText(e);
1930
- }
1095
+ function Ze(e) {
1096
+ return e / 1.60934;
1931
1097
  }
1932
- export {
1933
- Et as BmltClient,
1934
- v as BmltDataFormat,
1935
- _ as BmltEndpoint,
1936
- Fe as BmltErrorType,
1937
- C as BmltQueryError,
1938
- G as ErrorFactory,
1939
- re as ErrorHandler,
1940
- rt as GeocodingService,
1941
- st as Language,
1942
- F as MeetingQueryBuilder,
1943
- gt as QuickSearch,
1944
- ct as RetryHandler,
1945
- it as SortKey,
1946
- K as VenueType,
1947
- $ as Weekday,
1948
- nt as buildBmltURL,
1949
- lt as extractIds,
1950
- dt as formatTimeValue,
1951
- mt as kilometersToMiles,
1952
- ft as milesToKilometers,
1953
- ht as normalizeParameters,
1954
- ot as validateCoordinates,
1955
- at as validateEndpointFormat,
1956
- ae as validateRadius,
1957
- Ae as validateRootServerURL
1098
+ //#endregion
1099
+ //#region src/client/bmlt-client.ts
1100
+ var Qe = class {
1101
+ constructor(e) {
1102
+ v(this, "timeout", void 0), v(this, "userAgent", void 0), v(this, "geocodingService", void 0), v(this, "rootServerURL", void 0), v(this, "defaultFormat", void 0);
1103
+ let { rootServerURL: t, defaultFormat: n = J.JSON, timeout: r = 3e4, userAgent: i = "bmlt-query-client/1.0.0", geocodingOptions: a = {}, enableGeocoding: o = !0 } = e;
1104
+ this.rootServerURL = Ke(t), this.defaultFormat = n, this.timeout = r, this.userAgent = i, o && (this.geocodingService = new Be(a));
1105
+ }
1106
+ async makeRequest(e, t = {}, n = this.defaultFormat) {
1107
+ let r;
1108
+ try {
1109
+ Ge(e, n);
1110
+ let i = Ue({
1111
+ rootServerURL: this.rootServerURL,
1112
+ format: n,
1113
+ endpoint: e,
1114
+ parameters: t
1115
+ }), a = new AbortController(), o = setTimeout(() => a.abort(), this.timeout);
1116
+ try {
1117
+ r = await fetch(i, {
1118
+ method: "GET",
1119
+ headers: { "User-Agent": this.userAgent },
1120
+ signal: a.signal
1121
+ });
1122
+ } finally {
1123
+ clearTimeout(o);
1124
+ }
1125
+ if (!r.ok) throw q.handleFetchError(/* @__PURE__ */ Error(`HTTP ${r.status}: ${r.statusText}`), r);
1126
+ let s = await r.text();
1127
+ if (n === J.CSV) return s;
1128
+ if (n === J.JSONP) {
1129
+ let e = t.callback || "callback", n = s.match(RegExp(`${e}\\((.+)\\);?$`));
1130
+ if (!n) throw Error("Invalid JSONP response format");
1131
+ return JSON.parse(n[1]);
1132
+ }
1133
+ return n === J.JSON || n === J.TSML ? JSON.parse(s) : s;
1134
+ } catch (e) {
1135
+ throw q.handleFetchError(e, r);
1136
+ }
1137
+ }
1138
+ async searchMeetings(e = {}) {
1139
+ let { format: t = this.defaultFormat, ...n } = e;
1140
+ return this.makeRequest(Y.GET_SEARCH_RESULTS, n, t);
1141
+ }
1142
+ async searchMeetingsWithFormats(e = {}) {
1143
+ let { format: t = this.defaultFormat, ...n } = e;
1144
+ return this.makeRequest(Y.GET_SEARCH_RESULTS, {
1145
+ ...n,
1146
+ get_used_formats: !0
1147
+ }, t);
1148
+ }
1149
+ async searchMeetingsByAddress(e) {
1150
+ if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
1151
+ let { address: t, radiusMiles: n, radiusKm: r, sortByDistance: i = !0, searchParams: a = {} } = e, o = await this.geocodingService.geocode(t), s = {
1152
+ ...a,
1153
+ lat_val: o.coordinates.latitude,
1154
+ long_val: o.coordinates.longitude,
1155
+ sort_results_by_distance: i
1156
+ };
1157
+ return n === void 0 ? r !== void 0 && (Q(r), s.geo_width_km = r) : (Q(n), s.geo_width = n), this.searchMeetings(s);
1158
+ }
1159
+ async searchMeetingsByCoordinates(e, t, n, r = {}) {
1160
+ Ye(e.latitude, e.longitude);
1161
+ let i = {
1162
+ ...r,
1163
+ lat_val: e.latitude,
1164
+ long_val: e.longitude,
1165
+ sort_results_by_distance: !0
1166
+ };
1167
+ return t === void 0 ? n !== void 0 && (Q(n), i.geo_width_km = n) : (Q(t), i.geo_width = t), this.searchMeetings(i);
1168
+ }
1169
+ async getFormats(e = {}) {
1170
+ let { format: t = this.defaultFormat, ...n } = e;
1171
+ return this.makeRequest(Y.GET_FORMATS, n, t);
1172
+ }
1173
+ async getServiceBodies(e = {}) {
1174
+ let { format: t = this.defaultFormat, ...n } = e;
1175
+ return this.makeRequest(Y.GET_SERVICE_BODIES, n, t);
1176
+ }
1177
+ async getChanges(e = {}) {
1178
+ let { format: t = this.defaultFormat, ...n } = e;
1179
+ return this.makeRequest(Y.GET_CHANGES, n, t);
1180
+ }
1181
+ async getFieldKeys() {
1182
+ return this.makeRequest(Y.GET_FIELD_KEYS);
1183
+ }
1184
+ async getFieldValues(e) {
1185
+ let { format: t = this.defaultFormat, ...n } = e;
1186
+ return this.makeRequest(Y.GET_FIELD_VALUES, n, t);
1187
+ }
1188
+ async getNAWSDump(e) {
1189
+ return this.makeRequest(Y.GET_NAWS_DUMP, e, J.CSV);
1190
+ }
1191
+ async getServerInfo() {
1192
+ return this.makeRequest(Y.GET_SERVER_INFO);
1193
+ }
1194
+ async getCoverageArea() {
1195
+ return this.makeRequest(Y.GET_COVERAGE_AREA);
1196
+ }
1197
+ async geocodeAddress(e, t) {
1198
+ if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
1199
+ return this.geocodingService.geocode(e, t);
1200
+ }
1201
+ async reverseGeocode(e, t) {
1202
+ if (!this.geocodingService) throw Error("Geocoding is not enabled. Initialize client with enableGeocoding: true");
1203
+ return this.geocodingService.reverseGeocode(e, t);
1204
+ }
1205
+ getRootServerURL() {
1206
+ return this.rootServerURL;
1207
+ }
1208
+ setRootServerURL(e) {
1209
+ this.rootServerURL = Ke(e);
1210
+ }
1211
+ getDefaultFormat() {
1212
+ return this.defaultFormat;
1213
+ }
1214
+ setDefaultFormat(e) {
1215
+ this.defaultFormat = e;
1216
+ }
1217
+ getGeocodingStats() {
1218
+ return this.geocodingService ? {
1219
+ queueSize: this.geocodingService.getQueueSize(),
1220
+ pendingCount: this.geocodingService.getPendingCount()
1221
+ } : null;
1222
+ }
1223
+ clearGeocodingQueue() {
1224
+ this.geocodingService && this.geocodingService.clearQueue();
1225
+ }
1226
+ getUserAgent() {
1227
+ return this.userAgent;
1228
+ }
1229
+ setUserAgent(e) {
1230
+ if (!e || e.trim().length === 0) throw Error("User agent must be a non-empty string");
1231
+ this.userAgent = e.trim(), this.geocodingService && this.geocodingService.setUserAgent(this.userAgent);
1232
+ }
1233
+ getTimeout() {
1234
+ return this.timeout;
1235
+ }
1236
+ setTimeout(e) {
1237
+ if (!Number.isInteger(e) || e <= 0) throw Error("Timeout must be a positive integer");
1238
+ this.timeout = e;
1239
+ }
1240
+ }, $ = class e {
1241
+ constructor(e) {
1242
+ v(this, "params", {}), v(this, "client", void 0), this.client = e;
1243
+ }
1244
+ meetingIds(e, t = !1) {
1245
+ return Array.isArray(e) ? this.params.meeting_ids = t ? e.map((e) => -e) : e : this.params.meeting_ids = t ? -e : e, this;
1246
+ }
1247
+ onWeekdays(...e) {
1248
+ return this.params.weekdays = e.length === 1 ? e[0] : e, this;
1249
+ }
1250
+ notOnWeekdays(...e) {
1251
+ let t = e.map((e) => -e);
1252
+ return this.params.weekdays = t.length === 1 ? t[0] : t, this;
1253
+ }
1254
+ venueTypes(...e) {
1255
+ return this.params.venue_types = e.length === 1 ? e[0] : e, this;
1256
+ }
1257
+ inPersonOnly() {
1258
+ return this.venueTypes(Z.IN_PERSON);
1259
+ }
1260
+ virtualOnly() {
1261
+ return this.venueTypes(Z.VIRTUAL);
1262
+ }
1263
+ hybridOnly() {
1264
+ return this.venueTypes(Z.HYBRID);
1265
+ }
1266
+ virtualOrHybrid() {
1267
+ return this.venueTypes(Z.VIRTUAL, Z.HYBRID);
1268
+ }
1269
+ formats(e, t = !1) {
1270
+ return Array.isArray(e) ? this.params.formats = t ? e.map((e) => -e) : e : this.params.formats = t ? -e : e, this;
1271
+ }
1272
+ anyFormat() {
1273
+ return this.params.formats_comparison_operator = "OR", this;
1274
+ }
1275
+ serviceBodies(e, t = !1) {
1276
+ return Array.isArray(e) ? this.params.services = t ? e.map((e) => -e) : e : this.params.services = t ? -e : e, this;
1277
+ }
1278
+ includeChildServiceBodies() {
1279
+ return this.params.recursive = !0, this;
1280
+ }
1281
+ searchText(e) {
1282
+ return this.params.SearchString = e, this;
1283
+ }
1284
+ startingAfter(e, t = 0) {
1285
+ return this.params.StartsAfterH = e, this.params.StartsAfterM = t, this;
1286
+ }
1287
+ startingBefore(e, t = 0) {
1288
+ return this.params.StartsBeforeH = e, this.params.StartsBeforeM = t, this;
1289
+ }
1290
+ endingBefore(e, t = 0) {
1291
+ return this.params.EndsBeforeH = e, this.params.EndsBeforeM = t, this;
1292
+ }
1293
+ minimumDuration(e = 0, t = 0) {
1294
+ return e > 0 && (this.params.MinDurationH = e), t > 0 && (this.params.MinDurationM = t), this;
1295
+ }
1296
+ maximumDuration(e = 0, t = 0) {
1297
+ return e > 0 && (this.params.MaxDurationH = e), t > 0 && (this.params.MaxDurationM = t), this;
1298
+ }
1299
+ nearCoordinates(e, t, n) {
1300
+ return this.params.lat_val = e.latitude, this.params.long_val = e.longitude, t === void 0 ? n !== void 0 && (this.params.geo_width_km = n) : this.params.geo_width = t, this;
1301
+ }
1302
+ fieldValue(e, t) {
1303
+ return this.params.meeting_key = e, this.params.meeting_key_value = t, this;
1304
+ }
1305
+ selectFields(...e) {
1306
+ return this.params.data_field_key = e.join(","), this;
1307
+ }
1308
+ sortBy(...e) {
1309
+ return this.params.sort_keys = e.join(","), this;
1310
+ }
1311
+ sortByAlias(e) {
1312
+ return this.params.sort_key = e, this;
1313
+ }
1314
+ sortByDistance() {
1315
+ return this.params.sort_results_by_distance = !0, this;
1316
+ }
1317
+ paginate(e, t = 1) {
1318
+ return this.params.page_size = e, this.params.page_num = t, this;
1319
+ }
1320
+ includeUnpublished() {
1321
+ return this.params.advanced_published = 0, this;
1322
+ }
1323
+ unpublishedOnly() {
1324
+ return this.params.advanced_published = -1, this;
1325
+ }
1326
+ language(e) {
1327
+ return this.params.lang_enum = e, this;
1328
+ }
1329
+ format(e) {
1330
+ return this.params.format = e, this;
1331
+ }
1332
+ includeFormats() {
1333
+ return this.params.get_used_formats = !0, this;
1334
+ }
1335
+ formatsOnly() {
1336
+ return this.params.get_used_formats = !0, this.params.get_formats_only = !0, this;
1337
+ }
1338
+ rootServerIds(e, t = !1) {
1339
+ return Array.isArray(e) ? this.params.root_server_ids = t ? e.map((e) => -e) : e : this.params.root_server_ids = t ? -e : e, this;
1340
+ }
1341
+ getParams() {
1342
+ return { ...this.params };
1343
+ }
1344
+ reset() {
1345
+ return this.params = {}, this;
1346
+ }
1347
+ clone() {
1348
+ let t = new e(this.client);
1349
+ return t.params = { ...this.params }, t;
1350
+ }
1351
+ async execute() {
1352
+ return this.client.searchMeetings(this.params);
1353
+ }
1354
+ async executeWithFormats() {
1355
+ let { get_used_formats: e, get_formats_only: t, ...n } = this.params;
1356
+ return this.client.searchMeetingsWithFormats(n);
1357
+ }
1358
+ async executeNearAddress(e, t, n, r = !0) {
1359
+ return this.client.searchMeetingsByAddress({
1360
+ address: e,
1361
+ radiusMiles: t,
1362
+ radiusKm: n,
1363
+ sortByDistance: r,
1364
+ searchParams: this.params
1365
+ });
1366
+ }
1367
+ }, $e = class {
1368
+ constructor(e) {
1369
+ v(this, "client", void 0), this.client = e;
1370
+ }
1371
+ today() {
1372
+ let e = (/* @__PURE__ */ new Date()).getDay(), t = e === 0 ? X.SUNDAY : e;
1373
+ return new $(this.client).onWeekdays(t);
1374
+ }
1375
+ weekend() {
1376
+ return new $(this.client).onWeekdays(X.SATURDAY, X.SUNDAY);
1377
+ }
1378
+ weekdays() {
1379
+ return new $(this.client).onWeekdays(X.MONDAY, X.TUESDAY, X.WEDNESDAY, X.THURSDAY, X.FRIDAY);
1380
+ }
1381
+ evening() {
1382
+ return new $(this.client).startingAfter(17);
1383
+ }
1384
+ morning() {
1385
+ return new $(this.client).startingBefore(12);
1386
+ }
1387
+ virtual() {
1388
+ return new $(this.client).virtualOnly();
1389
+ }
1390
+ inPerson() {
1391
+ return new $(this.client).inPersonOnly();
1392
+ }
1393
+ byText(e) {
1394
+ return new $(this.client).searchText(e);
1395
+ }
1958
1396
  };
1959
- //# sourceMappingURL=app.js.map
1397
+ //#endregion
1398
+ export { Qe as BmltClient, J as BmltDataFormat, Y as BmltEndpoint, W as BmltErrorType, G as BmltQueryError, K as ErrorFactory, q as ErrorHandler, Be as GeocodingService, He as Language, $ as MeetingQueryBuilder, $e as QuickSearch, ze as RetryHandler, Ve as SortKey, Z as VenueType, X as Weekday, Ue as buildBmltURL, qe as extractIds, Je as formatTimeValue, Ze as kilometersToMiles, Xe as milesToKilometers, We as normalizeParameters, Ye as validateCoordinates, Ge as validateEndpointFormat, Q as validateRadius, Ke as validateRootServerURL };
1399
+
1400
+ //# sourceMappingURL=app.js.map