@sylwellsoftware/glue 0.3.0 → 0.4.0

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/index.js CHANGED
@@ -1,9 +1,9 @@
1
- var U = Object.defineProperty;
2
- var V = (r, t, e) => t in r ? U(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var n = (r, t, e) => V(r, typeof t != "symbol" ? t + "" : t, e);
4
- let I = 1;
1
+ var H = Object.defineProperty;
2
+ var F = (t, r, e) => r in t ? H(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
+ var n = (t, r, e) => F(t, typeof r != "symbol" ? r + "" : r, e);
4
+ let x = 1;
5
5
  class b {
6
- constructor(t = {}) {
6
+ constructor(r = {}) {
7
7
  n(this, "id");
8
8
  n(this, "timestamp");
9
9
  n(this, "purpose");
@@ -16,53 +16,53 @@ class b {
16
16
  n(this, "ownerRef");
17
17
  n(this, "strongOwner");
18
18
  var s;
19
- if (t == null || typeof t != "object" || Array.isArray(t))
19
+ if (r == null || typeof r != "object" || Array.isArray(r))
20
20
  throw new TypeError("EventBubble options must be an object");
21
- this.id = `event-${I++}`, this.timestamp = t.timestamp ?? Date.now(), this.purpose = t.purpose ?? "unspecified", this.cause = t.cause ?? null, this.value = t.value, this.parent = t.parent ?? null, this.parentBubble = this.parent;
22
- const e = t.owner;
23
- this.ownerType = e == null ? null : z(e) ?? typeof e, D(e) && typeof WeakRef == "function" ? (this.ownerRef = new WeakRef(e), this.strongOwner = void 0) : (this.ownerRef = null, this.strongOwner = e), (s = this.parent) == null || s.registerChild(this);
21
+ this.id = `event-${x++}`, this.timestamp = r.timestamp ?? Date.now(), this.purpose = r.purpose ?? "unspecified", this.cause = r.cause ?? null, this.value = r.value, this.parent = r.parent ?? null, this.parentBubble = this.parent;
22
+ const e = r.owner;
23
+ this.ownerType = e == null ? null : $(e) ?? typeof e, B(e) && typeof WeakRef == "function" ? (this.ownerRef = new WeakRef(e), this.strongOwner = void 0) : (this.ownerRef = null, this.strongOwner = e), (s = this.parent) == null || s.registerChild(this);
24
24
  }
25
25
  get owner() {
26
- var t;
27
- return ((t = this.ownerRef) == null ? void 0 : t.deref()) ?? this.strongOwner;
26
+ var r;
27
+ return ((r = this.ownerRef) == null ? void 0 : r.deref()) ?? this.strongOwner;
28
28
  }
29
- registerChild(t) {
30
- if (!(t instanceof b))
29
+ registerChild(r) {
30
+ if (!(r instanceof b))
31
31
  throw new TypeError("EventBubble children must be EventBubble instances");
32
- this.children.includes(t) || this.children.push(t);
32
+ this.children.includes(r) || this.children.push(r);
33
33
  }
34
34
  }
35
- function D(r) {
36
- return typeof r == "object" && r !== null || typeof r == "function";
35
+ function B(t) {
36
+ return typeof t == "object" && t !== null || typeof t == "function";
37
37
  }
38
- function z(r) {
39
- const t = Reflect.get(r, "constructor");
40
- if (t == null || typeof t != "object" && typeof t != "function")
38
+ function $(t) {
39
+ const r = Reflect.get(t, "constructor");
40
+ if (r == null || typeof r != "object" && typeof r != "function")
41
41
  return;
42
- const e = Reflect.get(t, "name");
42
+ const e = Reflect.get(r, "name");
43
43
  return typeof e == "string" ? e : void 0;
44
44
  }
45
45
  const m = /* @__PURE__ */ new Set();
46
- function v(r) {
47
- if (typeof r != "function")
46
+ function C(t) {
47
+ if (typeof t != "function")
48
48
  throw new TypeError("EventBus.subscribe requires a function");
49
- m.add(r);
50
- let t = !0;
49
+ m.add(t);
50
+ let r = !0;
51
51
  return () => {
52
- t && (t = !1, m.delete(r));
52
+ r && (r = !1, m.delete(t));
53
53
  };
54
54
  }
55
- function S(r) {
56
- for (const t of [...m]) t(r);
55
+ function V(t) {
56
+ for (const r of [...m]) r(t);
57
57
  }
58
- const y = Object.freeze({
59
- subscribe: v,
60
- emit: S,
61
- emitBubble: S,
62
- registerBubbleGraph(r) {
63
- if (r == null || typeof r.addBubble != "function")
58
+ const w = Object.freeze({
59
+ subscribe: C,
60
+ emit: V,
61
+ emitBubble: V,
62
+ registerBubbleGraph(t) {
63
+ if (t == null || typeof t.addBubble != "function")
64
64
  throw new TypeError("registerBubbleGraph requires an addBubble() method");
65
- return v((t) => r.addBubble(t));
65
+ return C((r) => t.addBubble(r));
66
66
  },
67
67
  get hasSubscribers() {
68
68
  return m.size > 0;
@@ -70,28 +70,28 @@ const y = Object.freeze({
70
70
  get subscriberCount() {
71
71
  return m.size;
72
72
  }
73
- }), a = Object.freeze({
73
+ }), h = Object.freeze({
74
74
  Error: "error",
75
75
  Loading: "loading",
76
76
  Initial: "initial",
77
77
  Ready: "ready"
78
- }), g = /* @__PURE__ */ new Map([
79
- [a.Ready, 1],
80
- [a.Initial, 2],
81
- [a.Loading, 3],
82
- [a.Error, 4]
78
+ }), S = /* @__PURE__ */ new Map([
79
+ [h.Ready, 1],
80
+ [h.Initial, 2],
81
+ [h.Loading, 3],
82
+ [h.Error, 4]
83
83
  ]);
84
- function q(r) {
85
- let t = a.Ready;
86
- for (const e of r) {
87
- if (!g.has(e))
84
+ function j(t) {
85
+ let r = h.Ready;
86
+ for (const e of t) {
87
+ if (!S.has(e))
88
88
  throw new TypeError(`Unknown fetch state: ${String(e)}`);
89
- if ((g.get(e) ?? 0) > (g.get(t) ?? 0) && (t = e), t === a.Error) break;
89
+ if ((S.get(e) ?? 0) > (S.get(r) ?? 0) && (r = e), r === h.Error) break;
90
90
  }
91
- return t;
91
+ return r;
92
92
  }
93
- class w {
94
- constructor(t, e = {}) {
93
+ class g {
94
+ constructor(r, e = {}) {
95
95
  n(this, "subscribers", /* @__PURE__ */ new Set());
96
96
  n(this, "value");
97
97
  n(this, "fetchState");
@@ -103,28 +103,28 @@ class w {
103
103
  n(this, "trace");
104
104
  if (e == null || typeof e != "object" || Array.isArray(e))
105
105
  throw new TypeError("Emitter options must be an object");
106
- if (this.value = t, this.fetchState = e.fetchState ?? a.Ready, this.error = e.error ?? null, this.equals = e.equals ?? Object.is, this.owner = e.owner, this.purpose = e.purpose ?? this.constructor.name, this.trace = e.trace ?? !1, typeof this.equals != "function")
106
+ if (this.value = r, this.fetchState = e.fetchState ?? h.Ready, this.error = e.error ?? null, this.equals = e.equals ?? Object.is, this.owner = e.owner, this.purpose = e.purpose ?? this.constructor.name, this.trace = e.trace ?? !1, typeof this.equals != "function")
107
107
  throw new TypeError("Emitter equals option must be a function");
108
- E(this.fetchState);
108
+ R(this.fetchState);
109
109
  }
110
- subscribe(t, e = {}) {
110
+ subscribe(r, e = {}) {
111
111
  if (this.isDisposed) throw new Error("Cannot subscribe to a disposed emitter");
112
- if (typeof t != "function")
112
+ if (typeof r != "function")
113
113
  throw new TypeError("subscribe requires a function");
114
114
  if (e == null || typeof e != "object" || Array.isArray(e))
115
115
  throw new TypeError("subscribe options must be an object");
116
116
  const { emitCurrent: s = !0, parentEvent: i = null } = e;
117
- if (this.subscribers.add(t), s) {
117
+ if (this.subscribers.add(r), s) {
118
118
  const u = this.createEvent("subscribed", i, this.value);
119
- t(this.notification(u));
119
+ r(this.notification(u));
120
120
  }
121
121
  let o = !0;
122
122
  return () => {
123
- o && (o = !1, this.subscribers.delete(t));
123
+ o && (o = !1, this.subscribers.delete(r));
124
124
  };
125
125
  }
126
- subscribeFutureValues(t) {
127
- return this.subscribe(t, { emitCurrent: !1 });
126
+ subscribeFutureValues(r) {
127
+ return this.subscribe(r, { emitCurrent: !1 });
128
128
  }
129
129
  get() {
130
130
  return this.value;
@@ -141,11 +141,11 @@ class w {
141
141
  get subscriberCount() {
142
142
  return this.subscribers.size;
143
143
  }
144
- map(t, e = {}) {
145
- if (typeof t != "function") throw new TypeError("map requires a function");
146
- return new R(
144
+ map(r, e = {}) {
145
+ if (typeof r != "function") throw new TypeError("map requires a function");
146
+ return new D(
147
147
  [this],
148
- ([s]) => t(s),
148
+ ([s]) => r(s),
149
149
  {
150
150
  ...e,
151
151
  owner: e.owner ?? this.owner,
@@ -154,13 +154,13 @@ class w {
154
154
  }
155
155
  );
156
156
  }
157
- mapEach(t, e = {}) {
158
- if (typeof t != "function") throw new TypeError("mapEach requires a function");
159
- return new R([this], ([s]) => {
157
+ mapEach(r, e = {}) {
158
+ if (typeof r != "function") throw new TypeError("mapEach requires a function");
159
+ return new D([this], ([s]) => {
160
160
  if (s == null) return s;
161
161
  if (!Array.isArray(s))
162
162
  throw new TypeError("mapEach source value must be an array");
163
- return s.map((o, u) => o == null ? o : t(o, u));
163
+ return s.map((o, u) => o == null ? o : r(o, u));
164
164
  }, {
165
165
  ...e,
166
166
  purpose: e.purpose ?? `${this.purpose}:mapEach`
@@ -169,45 +169,45 @@ class w {
169
169
  dispose() {
170
170
  this.isDisposed || (this.isDisposed = !0, this.subscribers.clear());
171
171
  }
172
- notification(t = null) {
172
+ notification(r = null) {
173
173
  return Object.freeze({
174
174
  value: this.value,
175
175
  fetchState: this.fetchState,
176
176
  error: this.error,
177
- event: t
177
+ event: r
178
178
  });
179
179
  }
180
- notify(t = null) {
180
+ notify(r = null) {
181
181
  if (this.isDisposed) return;
182
- const e = this.notification(t);
182
+ const e = this.notification(r);
183
183
  for (const s of [...this.subscribers]) s(e);
184
184
  }
185
- setSnapshot(t = {}) {
185
+ setSnapshot(r = {}) {
186
186
  if (this.isDisposed) return !1;
187
- const e = Object.hasOwn(t, "value") ? t.value : this.value, s = t.fetchState ?? this.fetchState, i = Object.hasOwn(t, "error") ? t.error : this.error, o = t.cause ?? "state changed", u = t.parentEvent ?? null;
188
- if (E(s), !(!this.equals(this.value, e) || this.fetchState !== s || !Object.is(this.error, i))) return !1;
187
+ const e = Object.hasOwn(r, "value") ? r.value : this.value, s = r.fetchState ?? this.fetchState, i = Object.hasOwn(r, "error") ? r.error : this.error, o = r.cause ?? "state changed", u = r.parentEvent ?? null;
188
+ if (R(s), !(!this.equals(this.value, e) || this.fetchState !== s || !Object.is(this.error, i))) return !1;
189
189
  this.value = e, this.fetchState = s, this.error = i;
190
190
  const c = this.createEvent(o, u, e);
191
191
  return this.notify(c), !0;
192
192
  }
193
- createEvent(t, e = null, s = this.value) {
194
- if (!this.trace && !e && !y.hasSubscribers) return null;
193
+ createEvent(r, e = null, s = this.value) {
194
+ if (!this.trace && !e && !w.hasSubscribers) return null;
195
195
  const i = new b({
196
196
  owner: this.owner ?? this,
197
197
  purpose: this.purpose,
198
198
  value: s,
199
- cause: t,
199
+ cause: r,
200
200
  parent: e
201
201
  });
202
- return e || y.emit(i), i;
202
+ return e || w.emit(i), i;
203
203
  }
204
204
  }
205
- class R extends w {
205
+ class D extends g {
206
206
  constructor(e, s, i = {}) {
207
- const { computeFetchState: o = q, ...u } = i;
207
+ const { computeFetchState: o = j, ...u } = i;
208
208
  super(void 0, {
209
209
  ...u,
210
- fetchState: a.Initial,
210
+ fetchState: h.Initial,
211
211
  error: null
212
212
  });
213
213
  n(this, "sources");
@@ -218,7 +218,7 @@ class R extends w {
218
218
  }
219
219
  setSourcesAndCompute(e, s = this.compute, i = {}) {
220
220
  if (this.isDisposed) throw new Error("Cannot update a disposed derived emitter");
221
- if (!Array.isArray(e) || e.some((o) => !Q(o)))
221
+ if (!Array.isArray(e) || e.some((o) => !k(o)))
222
222
  throw new TypeError("DerivedEmitter sources must be an array of emitters");
223
223
  if (typeof s != "function")
224
224
  throw new TypeError("DerivedEmitter compute must be a function");
@@ -234,75 +234,75 @@ class R extends w {
234
234
  this.sourceUnsubscribers = [];
235
235
  }
236
236
  recompute(e = null, s = !0) {
237
- const i = this.sources.map((d) => d.get()), o = this.sources.map((d) => d.getFetchState()), u = this.sources.map((d, j) => ({ sourceIndex: j, error: d.getError() })).filter((d) => d.error != null);
238
- let h, c = null;
237
+ const i = this.sources.map((d) => d.get()), o = this.sources.map((d) => d.getFetchState()), u = this.sources.map((d, v) => ({ sourceIndex: v, error: d.getError() })).filter((d) => d.error != null);
238
+ let a, c = null;
239
239
  try {
240
- h = this.compute(i);
240
+ a = this.compute(i);
241
241
  } catch (d) {
242
- c = d, h = void 0;
242
+ c = d, a = void 0;
243
243
  }
244
- const l = c == null ? u : [...u, { sourceIndex: null, error: c }], p = L(this.error, l);
245
- let f = this.computeFetchState(o);
246
- if (E(f), (c != null || u.length > 0) && (f = a.Error), !s) {
247
- this.value = h, this.fetchState = f, this.error = p;
244
+ const f = c == null ? u : [...u, { sourceIndex: null, error: c }], p = _(this.error, f);
245
+ let l = this.computeFetchState(o);
246
+ if (R(l), (c != null || u.length > 0) && (l = h.Error), !s) {
247
+ this.value = a, this.fetchState = l, this.error = p;
248
248
  return;
249
249
  }
250
250
  this.setSnapshot({
251
- value: h,
252
- fetchState: f,
251
+ value: a,
252
+ fetchState: l,
253
253
  error: p,
254
254
  cause: "derived source changed",
255
255
  parentEvent: e
256
256
  });
257
257
  }
258
258
  }
259
- function L(r, t) {
260
- return t.length === 0 ? null : r != null && r.length === t.length && r.every((e, s) => {
259
+ function _(t, r) {
260
+ return r.length === 0 ? null : t != null && t.length === r.length && t.every((e, s) => {
261
261
  var i, o;
262
- return e.sourceIndex === ((i = t[s]) == null ? void 0 : i.sourceIndex) && Object.is(e.error, (o = t[s]) == null ? void 0 : o.error);
263
- }) ? r : Object.freeze(t.map((e) => Object.freeze(e)));
262
+ return e.sourceIndex === ((i = r[s]) == null ? void 0 : i.sourceIndex) && Object.is(e.error, (o = r[s]) == null ? void 0 : o.error);
263
+ }) ? t : Object.freeze(r.map((e) => Object.freeze(e)));
264
264
  }
265
- function Q(r) {
266
- return (typeof r != "object" || r === null) && typeof r != "function" ? !1 : typeof Reflect.get(r, "get") == "function" && typeof Reflect.get(r, "getFetchState") == "function" && typeof Reflect.get(r, "getError") == "function" && typeof Reflect.get(r, "subscribe") == "function";
265
+ function k(t) {
266
+ return (typeof t != "object" || t === null) && typeof t != "function" ? !1 : typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "getFetchState") == "function" && typeof Reflect.get(t, "getError") == "function" && typeof Reflect.get(t, "subscribe") == "function";
267
267
  }
268
- function E(r) {
269
- q([r]);
268
+ function R(t) {
269
+ j([t]);
270
270
  }
271
- class C extends w {
272
- constructor(t, e = {}) {
273
- super(t, e);
271
+ class U extends g {
272
+ constructor(r, e = {}) {
273
+ super(r, e);
274
274
  }
275
- setWithState(t, e = a.Ready, s = null, i = null) {
275
+ setWithState(r, e = h.Ready, s = null, i = null) {
276
276
  const o = i instanceof b ? i : null, u = o ? "set called" : i ?? "set called";
277
- return this.setSnapshot({ value: t, fetchState: e, error: s, cause: u, parentEvent: o });
277
+ return this.setSnapshot({ value: r, fetchState: e, error: s, cause: u, parentEvent: o });
278
278
  }
279
- set(t, e = null) {
280
- return this.setWithState(t, a.Ready, null, e);
279
+ set(r, e = null) {
280
+ return this.setWithState(r, h.Ready, null, e);
281
281
  }
282
282
  }
283
- class B extends Error {
283
+ class M extends Error {
284
284
  constructor() {
285
285
  super("AsyncCommand is already running"), this.name = "AsyncCommandConcurrencyError";
286
286
  }
287
287
  }
288
- class K extends w {
288
+ class fe extends g {
289
289
  constructor(e) {
290
- O(e);
290
+ N(e);
291
291
  const {
292
292
  execute: s,
293
293
  concurrency: i = "ignore",
294
- mapError: o = (l) => l,
294
+ mapError: o = (f) => f,
295
295
  owner: u,
296
- purpose: h = "async command",
296
+ purpose: a = "async command",
297
297
  trace: c
298
298
  } = e;
299
- if (F(i), typeof o != "function")
299
+ if (W(i), typeof o != "function")
300
300
  throw new TypeError("AsyncCommand mapError must be a function");
301
301
  super(void 0, {
302
- fetchState: a.Initial,
302
+ fetchState: h.Initial,
303
303
  error: null,
304
304
  owner: u,
305
- purpose: h,
305
+ purpose: a,
306
306
  ...c === void 0 ? {} : { trace: c }
307
307
  });
308
308
  n(this, "execute");
@@ -316,9 +316,9 @@ class K extends w {
316
316
  n(this, "hasSuccessfulValue", !1);
317
317
  /** Exposed for deterministic tests; consumers should use run()/abort(). */
318
318
  n(this, "_activeRequest", null);
319
- this.execute = s, this.concurrency = i, this.mapError = o, this.runningEmitter = new C(!1, {
319
+ this.execute = s, this.concurrency = i, this.mapError = o, this.runningEmitter = new U(!1, {
320
320
  owner: u ?? this,
321
- purpose: `${h}:running`,
321
+ purpose: `${a}:running`,
322
322
  ...c === void 0 ? {} : { trace: c }
323
323
  }), this.isRunning = this.runningEmitter;
324
324
  }
@@ -328,52 +328,52 @@ class K extends w {
328
328
  if (this._activeRequest != null) {
329
329
  if (this.concurrency === "ignore") return this._activeRequest;
330
330
  if (this.concurrency === "reject")
331
- return Promise.reject(new B());
331
+ return Promise.reject(new M());
332
332
  (p = this.abortController) == null || p.abort();
333
333
  }
334
- const i = ++this.requestId, o = k();
334
+ const i = ++this.requestId, o = G();
335
335
  this.abortController = o;
336
- const u = s instanceof b ? s : null, h = u ? "parent command requested" : s;
336
+ const u = s instanceof b ? s : null, a = u ? "parent command requested" : s;
337
337
  this.setSnapshot({
338
338
  value: this.lastSuccessfulValue,
339
- fetchState: a.Loading,
339
+ fetchState: h.Loading,
340
340
  error: null,
341
- cause: h,
341
+ cause: a,
342
342
  parentEvent: u
343
343
  });
344
344
  const c = this.createEvent("command execute", u, e);
345
- this.runningEmitter.set(!0, c ?? h);
346
- const l = Promise.resolve().then(() => this.execute(e, {
345
+ this.runningEmitter.set(!0, c ?? a);
346
+ const f = Promise.resolve().then(() => this.execute(e, {
347
347
  signal: o.signal,
348
348
  event: c
349
- })).then((f) => {
349
+ })).then((l) => {
350
350
  if (this.isCurrentRequest(i, o))
351
- return this.lastSuccessfulValue = f, this.hasSuccessfulValue = !0, this.setSnapshot({
352
- value: f,
353
- fetchState: a.Ready,
351
+ return this.lastSuccessfulValue = l, this.hasSuccessfulValue = !0, this.setSnapshot({
352
+ value: l,
353
+ fetchState: h.Ready,
354
354
  error: null,
355
355
  cause: "command succeeded",
356
356
  parentEvent: c
357
- }), f;
358
- }).catch((f) => {
357
+ }), l;
358
+ }).catch((l) => {
359
359
  this.isCurrentRequest(i, o) && this.setSnapshot({
360
360
  value: this.lastSuccessfulValue,
361
- fetchState: a.Error,
362
- error: this.mapCommandError(f),
361
+ fetchState: h.Error,
362
+ error: this.mapCommandError(l),
363
363
  cause: "command failed",
364
364
  parentEvent: c
365
365
  });
366
366
  }).finally(() => {
367
367
  this.isCurrentRequest(i, o) && (this.abortController = null, this._activeRequest = null, this.runningEmitter.set(!1, c ?? "command settled"));
368
368
  });
369
- return this._activeRequest = l, l;
369
+ return this._activeRequest = f, f;
370
370
  }
371
371
  abort(e = "command aborted") {
372
372
  if (this.isDisposed || this.abortController == null) return !1;
373
373
  const s = e instanceof b ? e : null, i = s ? "parent command aborted" : e;
374
374
  return this.requestId += 1, this.abortController.abort(), this.abortController = null, this._activeRequest = null, this.runningEmitter.set(!1, s ?? i), this.setSnapshot({
375
375
  value: this.lastSuccessfulValue,
376
- fetchState: this.hasSuccessfulValue ? a.Ready : a.Initial,
376
+ fetchState: this.hasSuccessfulValue ? h.Ready : h.Initial,
377
377
  error: null,
378
378
  cause: i,
379
379
  parentEvent: s
@@ -385,7 +385,7 @@ class K extends w {
385
385
  const s = e instanceof b ? e : null;
386
386
  this.setSnapshot({
387
387
  value: void 0,
388
- fetchState: a.Initial,
388
+ fetchState: h.Initial,
389
389
  error: null,
390
390
  cause: s ? "parent command reset" : e,
391
391
  parentEvent: s
@@ -406,23 +406,23 @@ class K extends w {
406
406
  }
407
407
  }
408
408
  }
409
- function O(r) {
410
- if (r == null || typeof r != "object" || Array.isArray(r))
409
+ function N(t) {
410
+ if (t == null || typeof t != "object" || Array.isArray(t))
411
411
  throw new TypeError("AsyncCommand options must be an object");
412
- if (typeof r.execute != "function")
412
+ if (typeof t.execute != "function")
413
413
  throw new TypeError("AsyncCommand execute must be a function");
414
414
  }
415
- function F(r) {
416
- if (r !== "ignore" && r !== "replace" && r !== "reject")
417
- throw new TypeError(`Unknown AsyncCommand concurrency policy: ${r}`);
415
+ function W(t) {
416
+ if (t !== "ignore" && t !== "replace" && t !== "reject")
417
+ throw new TypeError(`Unknown AsyncCommand concurrency policy: ${t}`);
418
418
  }
419
- function k() {
420
- const r = Reflect.get(globalThis, "AbortController");
421
- if (typeof r != "function")
419
+ function G() {
420
+ const t = Reflect.get(globalThis, "AbortController");
421
+ if (typeof t != "function")
422
422
  throw new Error("AsyncCommand requires AbortController in this runtime");
423
- return new r();
423
+ return new t();
424
424
  }
425
- class X extends w {
425
+ class I extends g {
426
426
  constructor(e) {
427
427
  if (e == null || typeof e != "object" || Array.isArray(e))
428
428
  throw new TypeError("LiveQuery options must be an object");
@@ -431,34 +431,40 @@ class X extends w {
431
431
  args: i = {},
432
432
  autoFetch: o = !0,
433
433
  keepPreviousValue: u = !0,
434
- owner: h,
435
- purpose: c = "live query",
436
- trace: l
434
+ polling: a,
435
+ owner: c,
436
+ purpose: f = "live query",
437
+ trace: p
437
438
  } = e;
438
439
  if (s == null || typeof s.fetch != "function")
439
440
  throw new TypeError("LiveQuery handler must implement fetch()");
440
- P(i);
441
+ X(i), a != null && K(a);
441
442
  super(void 0, {
442
- fetchState: a.Initial,
443
+ fetchState: h.Initial,
443
444
  error: null,
444
- owner: h,
445
- purpose: c,
446
- ...l === void 0 ? {} : { trace: l }
445
+ owner: c,
446
+ purpose: f,
447
+ ...p === void 0 ? {} : { trace: p }
447
448
  });
448
449
  n(this, "handler");
449
450
  n(this, "args");
450
451
  n(this, "keepPreviousValue");
451
452
  n(this, "lastSuccessfulValue");
453
+ n(this, "hasSuccessfulValue", !1);
452
454
  n(this, "argumentUnsubscribers");
455
+ n(this, "pollingUnsubscribers", []);
456
+ n(this, "polling");
457
+ n(this, "pollingScheduler");
458
+ n(this, "pollingHandle", null);
453
459
  n(this, "requestId", 0);
454
460
  n(this, "abortController", null);
455
461
  /** Exposed for deterministic tests; consumers should use refresh()/retry(). */
456
462
  n(this, "_activeRequest", null);
457
- this.handler = s, this.args = { ...i }, this.keepPreviousValue = u, this.lastSuccessfulValue = void 0, this.argumentUnsubscribers = Object.values(this.args).map(
458
- (p) => p.subscribe(({ event: f }) => {
459
- this.refresh(f);
463
+ this.handler = s, this.args = { ...i }, this.keepPreviousValue = u, this.polling = a, this.pollingScheduler = (a == null ? void 0 : a.scheduler) ?? J, this.lastSuccessfulValue = void 0, this.argumentUnsubscribers = Object.values(this.args).map(
464
+ (l) => l.subscribe(({ event: d }) => {
465
+ this.refresh(d);
460
466
  }, { emitCurrent: !1 })
461
- ), o && (this._activeRequest = this.refresh("initial fetch"));
467
+ ), a != null && this.initializePolling(a), o && (this._activeRequest = this.refresh("initial fetch")), this.scheduleNextPoll();
462
468
  }
463
469
  get argumentValues() {
464
470
  return Object.fromEntries(
@@ -470,73 +476,139 @@ class X extends w {
470
476
  if (this.isDisposed) return Promise.resolve(void 0);
471
477
  const s = ++this.requestId;
472
478
  (p = this.abortController) == null || p.abort();
473
- const i = _();
479
+ const i = Y();
474
480
  this.abortController = i;
475
- const o = e instanceof b ? e : null, u = o ? "query arguments changed" : e, h = this.keepPreviousValue ? this.lastSuccessfulValue : void 0;
481
+ const o = e instanceof b ? e : null, u = o ? "query arguments changed" : e, a = this.keepPreviousValue ? this.lastSuccessfulValue : void 0;
476
482
  this.setSnapshot({
477
- value: h,
478
- fetchState: a.Loading,
483
+ value: a,
484
+ fetchState: h.Loading,
479
485
  error: null,
480
486
  cause: u,
481
487
  parentEvent: o
482
488
  });
483
- const c = this.createEvent("query fetch", o, this.argumentValues), l = Promise.resolve().then(() => this.handler.fetch(this.argumentValues, {
489
+ const c = this.createEvent("query fetch", o, this.argumentValues), f = Promise.resolve().then(() => this.handler.fetch(this.argumentValues, {
484
490
  signal: i.signal,
485
491
  event: c
486
- })).then((f) => {
492
+ })).then((l) => {
487
493
  if (this.isCurrentRequest(s, i))
488
- return this.lastSuccessfulValue = f, this.setSnapshot({
489
- value: f,
490
- fetchState: a.Ready,
494
+ return this.lastSuccessfulValue = l, this.hasSuccessfulValue = !0, this.setSnapshot({
495
+ value: l,
496
+ fetchState: h.Ready,
491
497
  error: null,
492
498
  cause: "query succeeded",
493
499
  parentEvent: c
494
- }), f;
495
- }).catch((f) => {
496
- !this.isCurrentRequest(s, i) || H(f) || this.setSnapshot({
500
+ }), l;
501
+ }).catch((l) => {
502
+ !this.isCurrentRequest(s, i) || Z(l) || this.setSnapshot({
497
503
  value: this.keepPreviousValue ? this.lastSuccessfulValue : void 0,
498
- fetchState: a.Error,
499
- error: f,
504
+ fetchState: h.Error,
505
+ error: l,
500
506
  cause: "query failed",
501
507
  parentEvent: c
502
508
  });
503
509
  }).finally(() => {
504
510
  this.isCurrentRequest(s, i) && (this.abortController = null, this._activeRequest = null);
505
511
  });
506
- return this._activeRequest = l, l;
512
+ return this._activeRequest = f, f;
507
513
  }
508
514
  retry(e = "retry") {
509
515
  return this.refresh(e);
510
516
  }
517
+ abort(e = "query aborted") {
518
+ if (this.isDisposed || this.abortController == null) return;
519
+ this.requestId += 1, this.abortController.abort(), this.abortController = null, this._activeRequest = null;
520
+ const s = e instanceof b ? e : null;
521
+ this.setSnapshot({
522
+ value: this.hasSuccessfulValue ? this.lastSuccessfulValue : void 0,
523
+ fetchState: this.hasSuccessfulValue ? h.Ready : h.Initial,
524
+ error: null,
525
+ cause: s == null ? e : "query aborted",
526
+ parentEvent: s
527
+ });
528
+ }
511
529
  dispose() {
512
530
  var e;
513
531
  if (!this.isDisposed) {
514
- this.requestId += 1, (e = this.abortController) == null || e.abort(), this.abortController = null, this._activeRequest = null;
532
+ this.requestId += 1, (e = this.abortController) == null || e.abort(), this.abortController = null, this._activeRequest = null, this.cancelScheduledPoll();
515
533
  for (const s of this.argumentUnsubscribers) s();
516
- this.argumentUnsubscribers = [], super.dispose();
534
+ this.argumentUnsubscribers = [];
535
+ for (const s of this.pollingUnsubscribers) s();
536
+ this.pollingUnsubscribers = [], super.dispose();
517
537
  }
518
538
  }
539
+ initializePolling(e) {
540
+ for (const s of [e.intervalMs, e.enabled])
541
+ T(s) && this.pollingUnsubscribers.push(s.subscribe(() => {
542
+ q(y(e.intervalMs)), Q(y(e.enabled, !0)), this.cancelScheduledPoll(), this.scheduleNextPoll();
543
+ }, { emitCurrent: !1 }));
544
+ }
545
+ scheduleNextPoll() {
546
+ if (this.isDisposed || this.polling == null || this.pollingHandle != null || !y(this.polling.enabled, !0)) return;
547
+ const e = y(this.polling.intervalMs);
548
+ q(e), this.pollingHandle = this.pollingScheduler.schedule(() => {
549
+ this.pollingHandle = null, this.scheduleNextPoll(), this._activeRequest == null && this.refresh("poll");
550
+ }, e);
551
+ }
552
+ cancelScheduledPoll() {
553
+ this.pollingHandle != null && (this.pollingScheduler.cancel(this.pollingHandle), this.pollingHandle = null);
554
+ }
519
555
  isCurrentRequest(e, s) {
520
556
  return !this.isDisposed && e === this.requestId && s === this.abortController && !s.signal.aborted;
521
557
  }
522
558
  }
523
- function P(r) {
524
- if (r == null || typeof r != "object" || Array.isArray(r))
559
+ const J = {
560
+ schedule(t, r) {
561
+ const e = Reflect.get(globalThis, "setTimeout");
562
+ if (typeof e != "function")
563
+ throw new Error("LiveQuery polling requires an injected scheduler in this runtime");
564
+ return Reflect.apply(e, globalThis, [t, r]);
565
+ },
566
+ cancel(t) {
567
+ const r = Reflect.get(globalThis, "clearTimeout");
568
+ typeof r == "function" && Reflect.apply(r, globalThis, [t]);
569
+ }
570
+ };
571
+ function T(t) {
572
+ return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "subscribe") == "function";
573
+ }
574
+ function O(t, r) {
575
+ if (typeof t != "number" && typeof t != "boolean" && !T(t))
576
+ throw new TypeError(`LiveQuery polling ${r} must be a value or emitter`);
577
+ }
578
+ function K(t) {
579
+ if (t == null || typeof t != "object" || Array.isArray(t))
580
+ throw new TypeError("LiveQuery polling options must be an object");
581
+ if (O(t.intervalMs, "intervalMs"), t.enabled !== void 0 && O(t.enabled, "enabled"), q(y(t.intervalMs)), Q(y(t.enabled, !0)), t.scheduler != null && (typeof t.scheduler.schedule != "function" || typeof t.scheduler.cancel != "function"))
582
+ throw new TypeError("LiveQuery polling scheduler must implement schedule() and cancel()");
583
+ }
584
+ function y(t, r) {
585
+ return t === void 0 ? r : T(t) ? t.get() : t;
586
+ }
587
+ function q(t) {
588
+ if (!Number.isFinite(t) || t <= 0)
589
+ throw new RangeError("LiveQuery polling intervalMs must be a finite positive number");
590
+ }
591
+ function Q(t) {
592
+ if (typeof t != "boolean")
593
+ throw new TypeError("LiveQuery polling enabled must be a boolean");
594
+ }
595
+ function X(t) {
596
+ if (t == null || typeof t != "object" || Array.isArray(t))
525
597
  throw new TypeError("LiveQuery args must be a named record of emitters");
526
- for (const [t, e] of Object.entries(r))
598
+ for (const [r, e] of Object.entries(t))
527
599
  if (e == null || typeof Reflect.get(e, "get") != "function" || typeof Reflect.get(e, "subscribe") != "function")
528
- throw new TypeError(`LiveQuery argument ${t} must be an emitter`);
600
+ throw new TypeError(`LiveQuery argument ${r} must be an emitter`);
529
601
  }
530
- function _() {
531
- const r = Reflect.get(globalThis, "AbortController");
532
- if (typeof r != "function")
602
+ function Y() {
603
+ const t = Reflect.get(globalThis, "AbortController");
604
+ if (typeof t != "function")
533
605
  throw new Error("LiveQuery requires AbortController in this runtime");
534
- return new r();
606
+ return new t();
535
607
  }
536
- function H(r) {
537
- return r instanceof Error && r.name === "AbortError";
608
+ function Z(t) {
609
+ return t instanceof Error && t.name === "AbortError";
538
610
  }
539
- class Y extends C {
611
+ class pe extends U {
540
612
  constructor(e, s, i = {}) {
541
613
  if (typeof e != "string" || e.length === 0)
542
614
  throw new TypeError("QueryArg name must be a non-empty string");
@@ -564,120 +636,277 @@ class Y extends C {
564
636
  this.isDisposed || ((e = this.sourceUnsubscribe) == null || e.call(this), this.sourceUnsubscribe = null, super.dispose());
565
637
  }
566
638
  }
567
- class $ {
568
- fetch(t, e = {}) {
639
+ class ee {
640
+ fetch(r, e = {}) {
569
641
  throw new Error("fetch() must be implemented");
570
642
  }
571
643
  }
572
- class x extends Error {
644
+ class te extends Error {
573
645
  constructor(e) {
574
646
  super(`HTTP ${e ?? "unknown"}`);
575
647
  n(this, "status");
576
648
  this.name = "HttpError", this.status = e;
577
649
  }
578
650
  }
579
- class Z extends $ {
651
+ class re extends ee {
580
652
  constructor(e) {
581
653
  super();
582
654
  n(this, "url");
583
655
  n(this, "baseUrl");
584
656
  n(this, "fetchImplementation");
585
657
  n(this, "serialize");
658
+ n(this, "parseResult");
586
659
  n(this, "trace");
587
660
  const s = typeof e == "string" ? { url: e } : e;
588
661
  if (s == null || typeof s != "object")
589
662
  throw new TypeError("RestQueryHandler requires a URL or options object");
590
663
  if (typeof s.url != "string" || s.url.length === 0)
591
664
  throw new TypeError("RestQueryHandler url must be a non-empty string");
592
- if (this.url = s.url, this.baseUrl = s.baseUrl ?? N(), this.fetchImplementation = s.fetch ?? J(), this.serialize = s.serialize ?? W, this.trace = s.trace ?? !1, typeof this.fetchImplementation != "function")
665
+ if (this.url = s.url, this.baseUrl = s.baseUrl ?? ie(), this.fetchImplementation = s.fetch ?? oe(), this.serialize = s.serialize ?? se, this.parseResult = s.parseResult, this.trace = s.trace ?? !1, typeof this.fetchImplementation != "function")
593
666
  throw new TypeError("RestQueryHandler requires an injected fetch implementation");
594
667
  if (typeof this.serialize != "function")
595
668
  throw new TypeError("RestQueryHandler serialize must be a function");
669
+ if (this.parseResult !== void 0 && typeof this.parseResult != "function")
670
+ throw new TypeError("RestQueryHandler parseResult must be a function");
596
671
  }
597
672
  async fetch(e, s = {}) {
598
673
  if (e == null || typeof e != "object" || Array.isArray(e))
599
674
  throw new TypeError("REST query args must be a named record");
600
- const i = G(this.url, this.baseUrl), o = this.serialize(i, e) ?? i, u = A();
675
+ const i = ne(this.url, this.baseUrl), o = this.serialize(i, e) ?? i, u = P();
601
676
  if (!(o instanceof u))
602
677
  throw new TypeError("REST serializer must mutate or return a URL");
603
- const h = s.event ?? null;
604
- if (this.trace || h || y.hasSubscribers) {
605
- const p = new b({
678
+ const a = s.event ?? null;
679
+ if (this.trace || a || w.hasSubscribers) {
680
+ const l = new b({
606
681
  owner: this,
607
682
  purpose: "REST fetch",
608
683
  value: o.toString(),
609
684
  cause: "fetch called",
610
- parent: h
685
+ parent: a
611
686
  });
612
- h || y.emit(p);
687
+ a || w.emit(l);
613
688
  }
614
- const c = s.signal === void 0 ? {} : { signal: s.signal }, l = await this.fetchImplementation(o.toString(), c);
615
- if (!(l != null && l.ok)) throw new x(l == null ? void 0 : l.status);
616
- return await l.json();
689
+ const c = s.signal === void 0 ? {} : { signal: s.signal }, f = await this.fetchImplementation(o.toString(), c);
690
+ if (!(f != null && f.ok)) throw new te(f == null ? void 0 : f.status);
691
+ const p = await f.json();
692
+ return this.parseResult == null ? p : this.parseResult(p);
617
693
  }
618
694
  }
619
- function W(r, t) {
620
- for (const [e, s] of Object.entries(t))
621
- T(r.searchParams, e, s);
622
- return r;
695
+ function se(t, r) {
696
+ for (const [e, s] of Object.entries(r))
697
+ L(t.searchParams, e, s);
698
+ return t;
623
699
  }
624
- function T(r, t, e) {
700
+ function L(t, r, e) {
625
701
  if (e !== void 0) {
626
702
  if (e === null) {
627
- r.append(t, "");
703
+ t.append(r, "");
628
704
  return;
629
705
  }
630
706
  if (Array.isArray(e)) {
631
- for (const s of e) T(r, t, s);
707
+ for (const s of e) L(t, r, s);
632
708
  return;
633
709
  }
634
710
  if (typeof e == "object") {
635
- r.append(t, JSON.stringify(e));
711
+ t.append(r, JSON.stringify(e));
636
712
  return;
637
713
  }
638
- r.append(t, String(e));
714
+ t.append(r, String(e));
639
715
  }
640
716
  }
641
- function G(r, t) {
642
- const e = A();
717
+ function ne(t, r) {
718
+ const e = P();
643
719
  try {
644
- return new e(r);
720
+ return new e(t);
645
721
  } catch (s) {
646
- if (t == null)
647
- throw new TypeError(`Relative REST URL requires baseUrl: ${r}`, { cause: s });
648
- return new e(r, t);
722
+ if (r == null)
723
+ throw new TypeError(`Relative REST URL requires baseUrl: ${t}`, { cause: s });
724
+ return new e(t, r);
649
725
  }
650
726
  }
651
- function A() {
652
- const r = Reflect.get(globalThis, "URL");
653
- if (typeof r != "function")
727
+ function P() {
728
+ const t = Reflect.get(globalThis, "URL");
729
+ if (typeof t != "function")
654
730
  throw new Error("RestQueryHandler requires URL in this runtime");
655
- return r;
731
+ return t;
656
732
  }
657
- function N() {
658
- const r = Reflect.get(globalThis, "location");
659
- if (r == null || typeof r != "object" && typeof r != "function")
733
+ function ie() {
734
+ const t = Reflect.get(globalThis, "location");
735
+ if (t == null || typeof t != "object" && typeof t != "function")
660
736
  return;
661
- const t = Reflect.get(r, "href");
662
- return typeof t == "string" ? t : void 0;
737
+ const r = Reflect.get(t, "href");
738
+ return typeof r == "string" ? r : void 0;
663
739
  }
664
- function J() {
740
+ function oe() {
665
741
  return Reflect.get(globalThis, "fetch");
666
742
  }
743
+ class ue {
744
+ constructor(r) {
745
+ n(this, "handler");
746
+ n(this, "queryOptions");
747
+ if (r == null || typeof r != "object" || Array.isArray(r))
748
+ throw new TypeError("QueryEndpoint options must be an object");
749
+ if (r.handler == null || typeof r.handler.fetch != "function")
750
+ throw new TypeError("QueryEndpoint handler must implement fetch()");
751
+ const e = r.query ?? {};
752
+ E(e), this.handler = r.handler, this.queryOptions = Object.freeze({ ...e }), Object.freeze(this);
753
+ }
754
+ open(r, e = {}) {
755
+ return A(r), E(e), new I({
756
+ handler: this.handler,
757
+ args: r,
758
+ ...this.queryOptions,
759
+ ...e
760
+ });
761
+ }
762
+ }
763
+ function de(t) {
764
+ return new ue(t);
765
+ }
766
+ class ce {
767
+ constructor(r) {
768
+ n(this, "handler");
769
+ n(this, "queryOptions");
770
+ if (r == null || typeof r != "object" || Array.isArray(r))
771
+ throw new TypeError("RestEndpoint options must be an object");
772
+ const { query: e = {}, ...s } = r;
773
+ E(e, "RestEndpoint query options"), this.handler = new re(s), this.queryOptions = Object.freeze({ ...e }), Object.freeze(this);
774
+ }
775
+ open(r, e = {}) {
776
+ return A(r), E(e), new I({
777
+ handler: this.handler,
778
+ args: r,
779
+ ...this.queryOptions,
780
+ ...e
781
+ });
782
+ }
783
+ }
784
+ function be(t) {
785
+ return new ce(t);
786
+ }
787
+ class le {
788
+ constructor(r) {
789
+ n(this, "apply");
790
+ n(this, "purpose");
791
+ if (r == null || typeof r != "object" || Array.isArray(r))
792
+ throw new TypeError("DerivedEndpoint options must be an object");
793
+ if (typeof r.apply != "function")
794
+ throw new TypeError("DerivedEndpoint apply must be a function");
795
+ this.apply = r.apply, this.purpose = r.purpose ?? "derived endpoint", Object.freeze(this);
796
+ }
797
+ open(r) {
798
+ return new ae({
799
+ ...r,
800
+ apply: this.apply,
801
+ purpose: r.purpose ?? this.purpose
802
+ });
803
+ }
804
+ }
805
+ function ye(t) {
806
+ return new le(t);
807
+ }
808
+ class ae extends g {
809
+ constructor(e) {
810
+ if (e == null || typeof e != "object" || Array.isArray(e))
811
+ throw new TypeError("DerivedLiveResult options must be an object");
812
+ if (A(e.args), !z(e.source))
813
+ throw new TypeError("DerivedLiveResult source must be an emitter");
814
+ if (typeof e.apply != "function")
815
+ throw new TypeError("DerivedLiveResult apply must be a function");
816
+ super(void 0, {
817
+ fetchState: h.Initial,
818
+ error: null,
819
+ owner: e.owner,
820
+ ...e.purpose === void 0 ? {} : { purpose: e.purpose },
821
+ ...e.trace === void 0 ? {} : { trace: e.trace }
822
+ });
823
+ n(this, "source");
824
+ n(this, "args");
825
+ n(this, "apply");
826
+ n(this, "unsubscribers", []);
827
+ n(this, "lastSuccessfulValue");
828
+ this.source = e.source, this.args = { ...e.args }, this.apply = e.apply, this.lastSuccessfulValue = void 0;
829
+ const s = [
830
+ this.source,
831
+ ...Object.values(this.args)
832
+ ];
833
+ this.unsubscribers = s.map((i) => i.subscribe(({ event: o }) => {
834
+ this.recompute(o);
835
+ }, { emitCurrent: !1 })), this.recompute(null, !1);
836
+ }
837
+ dispose() {
838
+ if (!this.isDisposed) {
839
+ for (const e of this.unsubscribers) e();
840
+ this.unsubscribers = [], super.dispose();
841
+ }
842
+ }
843
+ recompute(e, s = !0) {
844
+ var p;
845
+ const i = [
846
+ this.source,
847
+ ...Object.values(this.args)
848
+ ], o = ((p = i.find((l) => l.getError() != null)) == null ? void 0 : p.getError()) ?? null;
849
+ let u = j(
850
+ i.map((l) => l.getFetchState())
851
+ );
852
+ const a = this.source.get();
853
+ let c = this.lastSuccessfulValue, f = o;
854
+ try {
855
+ const l = Object.fromEntries(
856
+ Object.entries(this.args).map(([d, v]) => [d, v.get()])
857
+ );
858
+ c = this.apply(a, l), this.lastSuccessfulValue = c;
859
+ } catch (l) {
860
+ f = l, u = h.Error;
861
+ }
862
+ if (o != null && (f = o, u = h.Error), !s) {
863
+ this.value = c, this.fetchState = u, this.error = f;
864
+ return;
865
+ }
866
+ this.setSnapshot({
867
+ value: c,
868
+ fetchState: u,
869
+ error: f,
870
+ cause: "derived endpoint source changed",
871
+ parentEvent: e
872
+ });
873
+ }
874
+ }
875
+ function E(t, r = "Endpoint query options") {
876
+ if (t == null || typeof t != "object" || Array.isArray(t))
877
+ throw new TypeError(`${r} must be an object`);
878
+ }
879
+ function A(t) {
880
+ if (t == null || typeof t != "object" || Array.isArray(t))
881
+ throw new TypeError("Endpoint args must be a named record of emitters");
882
+ for (const [r, e] of Object.entries(t))
883
+ if (!z(e))
884
+ throw new TypeError(`Endpoint argument ${r} must be an emitter`);
885
+ }
886
+ function z(t) {
887
+ return t != null && (typeof t == "object" || typeof t == "function") && typeof Reflect.get(t, "get") == "function" && typeof Reflect.get(t, "getFetchState") == "function" && typeof Reflect.get(t, "getError") == "function" && typeof Reflect.get(t, "subscribe") == "function";
888
+ }
667
889
  export {
668
- K as AsyncCommand,
669
- B as AsyncCommandConcurrencyError,
670
- w as BaseEmitter,
671
- R as DerivedEmitter,
672
- C as Emitter,
890
+ fe as AsyncCommand,
891
+ M as AsyncCommandConcurrencyError,
892
+ g as BaseEmitter,
893
+ D as DerivedEmitter,
894
+ le as DerivedEndpoint,
895
+ ae as DerivedLiveResult,
896
+ U as Emitter,
673
897
  b as EventBubble,
674
- y as EventBus,
675
- a as FetchState,
676
- g as FetchStateValues,
677
- X as LiveQuery,
678
- Y as QueryArg,
679
- $ as QueryHandler,
680
- Z as RestQueryHandler,
681
- q as combineFetchStates
898
+ w as EventBus,
899
+ h as FetchState,
900
+ S as FetchStateValues,
901
+ I as LiveQuery,
902
+ pe as QueryArg,
903
+ ue as QueryEndpoint,
904
+ ee as QueryHandler,
905
+ ce as RestEndpoint,
906
+ re as RestQueryHandler,
907
+ j as combineFetchStates,
908
+ ye as derivedEndpoint,
909
+ de as queryEndpoint,
910
+ be as restEndpoint
682
911
  };
683
912
  //# sourceMappingURL=index.js.map