@opencx/widget 3.0.79 → 3.0.80

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.
@@ -2,7 +2,7 @@ import z, { createContext as Fe, useRef as W, useState as Me, useMemo as Ne, use
2
2
  import { v4 as Qt } from "uuid";
3
3
  import { jsx as it } from "react/jsx-runtime";
4
4
  import { W as Zt } from "./widget.ctx-DRC-z8Ql.js";
5
- const en = "3.0.79";
5
+ const en = "3.0.80";
6
6
  class tn {
7
7
  constructor(t) {
8
8
  this.components = [];
@@ -33,30 +33,31 @@ function Qn({
33
33
  options: e,
34
34
  children: t,
35
35
  components: n,
36
- storage: r
36
+ storage: r,
37
+ loadingComponent: o
37
38
  }) {
38
- const o = W(null), s = W(!1), [i, d] = Me(null), h = Ne(
39
+ const s = W(null), i = W(!1), [d, h] = Me(null), c = Ne(
39
40
  () => new tn({
40
41
  components: n
41
42
  }),
42
43
  [n]
43
44
  );
44
45
  return he(() => {
45
- s.current || (s.current = !0, Zt.initialize({ config: e, storage: r }).then(d));
46
- }, []), i ? /* @__PURE__ */ it(
46
+ i.current || (i.current = !0, Zt.initialize({ config: e, storage: r }).then(h));
47
+ }, []), d ? /* @__PURE__ */ it(
47
48
  at.Provider,
48
49
  {
49
50
  value: {
50
- widgetCtx: i,
51
+ widgetCtx: d,
51
52
  config: e,
52
53
  components: n,
53
- componentStore: h,
54
+ componentStore: c,
54
55
  version: en,
55
- contentIframeRef: o
56
+ contentIframeRef: s
56
57
  },
57
58
  children: t
58
59
  }
59
- ) : null;
60
+ ) : o || null;
60
61
  }
61
62
  function Y() {
62
63
  const e = Ue(at);
@@ -138,29 +139,29 @@ function an() {
138
139
  }
139
140
  var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, o = e.useEffect, s = e.useLayoutEffect, i = e.useDebugValue;
140
141
  function d(u, l) {
141
- var c = l(), y = r({ inst: { value: c, getSnapshot: l } }), _ = y[0].inst, T = y[1];
142
+ var f = l(), y = r({ inst: { value: f, getSnapshot: l } }), _ = y[0].inst, T = y[1];
142
143
  return s(function() {
143
- _.value = c, _.getSnapshot = l, h(_) && T({ inst: _ });
144
- }, [u, c, l]), o(function() {
144
+ _.value = f, _.getSnapshot = l, h(_) && T({ inst: _ });
145
+ }, [u, f, l]), o(function() {
145
146
  return h(_) && T({ inst: _ }), u(function() {
146
147
  h(_) && T({ inst: _ });
147
148
  });
148
- }, [u]), i(c), c;
149
+ }, [u]), i(f), f;
149
150
  }
150
151
  function h(u) {
151
152
  var l = u.getSnapshot;
152
153
  u = u.value;
153
154
  try {
154
- var c = l();
155
- return !n(u, c);
155
+ var f = l();
156
+ return !n(u, f);
156
157
  } catch {
157
158
  return !0;
158
159
  }
159
160
  }
160
- function f(u, l) {
161
+ function c(u, l) {
161
162
  return l();
162
163
  }
163
- var a = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : d;
164
+ var a = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? c : d;
164
165
  return Se.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : a, Se;
165
166
  }
166
167
  var we = {};
@@ -198,7 +199,7 @@ function un() {
198
199
  function o(O, E) {
199
200
  return O === E && (O !== 0 || 1 / O === 1 / E) || O !== O && E !== E;
200
201
  }
201
- var s = typeof Object.is == "function" ? Object.is : o, i = e.useState, d = e.useEffect, h = e.useLayoutEffect, f = e.useDebugValue, a = !1, u = !1;
202
+ var s = typeof Object.is == "function" ? Object.is : o, i = e.useState, d = e.useEffect, h = e.useLayoutEffect, c = e.useDebugValue, a = !1, u = !1;
202
203
  function l(O, E, S) {
203
204
  a || e.startTransition !== void 0 && (a = !0, n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
204
205
  var v = E();
@@ -213,22 +214,22 @@ function un() {
213
214
  }
214
215
  }), C = w[0].inst, j = w[1];
215
216
  return h(function() {
216
- C.value = v, C.getSnapshot = E, c(C) && j({
217
+ C.value = v, C.getSnapshot = E, f(C) && j({
217
218
  inst: C
218
219
  });
219
220
  }, [O, v, E]), d(function() {
220
- c(C) && j({
221
+ f(C) && j({
221
222
  inst: C
222
223
  });
223
224
  var B = function() {
224
- c(C) && j({
225
+ f(C) && j({
225
226
  inst: C
226
227
  });
227
228
  };
228
229
  return O(B);
229
- }, [O]), f(v), v;
230
+ }, [O]), c(v), v;
230
231
  }
231
- function c(O) {
232
+ function f(O) {
232
233
  var E = O.getSnapshot, S = O.value;
233
234
  try {
234
235
  var v = E();
@@ -355,27 +356,27 @@ async function dt(...e) {
355
356
  let i = s.populateCache;
356
357
  const d = s.rollbackOnError;
357
358
  let h = s.optimisticData;
358
- const f = (l) => typeof d == "function" ? d(l) : d !== !1, a = s.throwOnError;
359
+ const c = (l) => typeof d == "function" ? d(l) : d !== !1, a = s.throwOnError;
359
360
  if (M(n)) {
360
- const l = n, c = [], y = t.keys();
361
+ const l = n, f = [], y = t.keys();
361
362
  for (const _ of y)
362
363
  // Skip the special useSWRInfinite and useSWRSubscription keys.
363
- !/^\$(inf|sub)\$/.test(_) && l(t.get(_)._k) && c.push(_);
364
- return Promise.all(c.map(u));
364
+ !/^\$(inf|sub)\$/.test(_) && l(t.get(_)._k) && f.push(_);
365
+ return Promise.all(f.map(u));
365
366
  }
366
367
  return u(n);
367
368
  async function u(l) {
368
- const [c] = qe(l);
369
- if (!c) return;
370
- const [y, _] = ut(t, c), [T, p, k, O] = q.get(t), E = () => {
371
- const V = T[c];
372
- return (M(s.revalidate) ? s.revalidate(y().data, l) : s.revalidate !== !1) && (delete k[c], delete O[c], V && V[0]) ? V[0](lt).then(() => y().data) : y().data;
369
+ const [f] = qe(l);
370
+ if (!f) return;
371
+ const [y, _] = ut(t, f), [T, p, k, O] = q.get(t), E = () => {
372
+ const V = T[f];
373
+ return (M(s.revalidate) ? s.revalidate(y().data, l) : s.revalidate !== !1) && (delete k[f], delete O[f], V && V[0]) ? V[0](lt).then(() => y().data) : y().data;
373
374
  };
374
375
  if (e.length < 3)
375
376
  return E();
376
377
  let S = r, v;
377
378
  const L = Le();
378
- p[c] = [
379
+ p[f] = [
379
380
  L,
380
381
  0
381
382
  ];
@@ -392,10 +393,10 @@ async function dt(...e) {
392
393
  if (S && fn(S))
393
394
  if (S = await S.catch((V) => {
394
395
  v = V;
395
- }), L !== p[c][0]) {
396
+ }), L !== p[f][0]) {
396
397
  if (v) throw v;
397
398
  return S;
398
- } else v && w && f(v) && (i = !0, _({
399
+ } else v && w && c(v) && (i = !0, _({
399
400
  data: K,
400
401
  _c: P
401
402
  }));
@@ -413,7 +414,7 @@ async function dt(...e) {
413
414
  error: P,
414
415
  _c: P
415
416
  });
416
- if (p[c][1] = Le(), Promise.resolve(E()).then(() => {
417
+ if (p[f][1] = Le(), Promise.resolve(E()).then(() => {
417
418
  _({
418
419
  _c: P
419
420
  });
@@ -436,11 +437,11 @@ const rt = (e, t) => {
436
437
  return i[a] = l, l.push(u), () => l.splice(l.indexOf(u), 1);
437
438
  }, h = (a, u, l) => {
438
439
  e.set(a, u);
439
- const c = i[a];
440
- if (c)
441
- for (const y of c)
440
+ const f = i[a];
441
+ if (f)
442
+ for (const y of f)
442
443
  y(u, l);
443
- }, f = () => {
444
+ }, c = () => {
444
445
  if (!q.has(e) && (q.set(e, [
445
446
  r,
446
447
  {},
@@ -456,10 +457,10 @@ const rt = (e, t) => {
456
457
  };
457
458
  }
458
459
  };
459
- return f(), [
460
+ return c(), [
460
461
  e,
461
462
  o,
462
- f,
463
+ c,
463
464
  s
464
465
  ];
465
466
  }
@@ -523,7 +524,7 @@ const rt = (e, t) => {
523
524
  }), r), Vn = xn.concat(In), Fn = (e) => function(...n) {
524
525
  const r = Ln(), [o, s, i] = Pn(n), d = Cn(r, i);
525
526
  let h = e;
526
- const { use: f } = d, a = (f || []).concat(Vn);
527
+ const { use: c } = d, a = (c || []).concat(Vn);
527
528
  for (let u = a.length; u--; )
528
529
  h = a[u](h);
529
530
  return h(o, s || d.fetcher || null, d);
@@ -548,7 +549,7 @@ const ot = z.use || ((e) => {
548
549
  }), Te = {
549
550
  dedupe: !0
550
551
  }, Nn = (e, t, n) => {
551
- const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: d, revalidateIfStale: h, refreshInterval: f, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: l } = n, [c, y, _, T] = q.get(r), [p, k] = qe(e), O = W(!1), E = W(!1), S = W(p), v = W(t), L = W(n), w = () => L.current, C = () => w().isVisible() && w().isOnline(), [j, B, K, V] = ut(r, p), J = W({}).current, $t = g(i) ? n.fallback[p] : i, He = (m, b) => {
552
+ const { cache: r, compare: o, suspense: s, fallbackData: i, revalidateOnMount: d, revalidateIfStale: h, refreshInterval: c, refreshWhenHidden: a, refreshWhenOffline: u, keepPreviousData: l } = n, [f, y, _, T] = q.get(r), [p, k] = qe(e), O = W(!1), E = W(!1), S = W(p), v = W(t), L = W(n), w = () => L.current, C = () => w().isVisible() && w().isOnline(), [j, B, K, V] = ut(r, p), J = W({}).current, $t = g(i) ? n.fallback[p] : i, He = (m, b) => {
552
553
  for (const A in J) {
553
554
  const R = A;
554
555
  if (R === "data") {
@@ -587,7 +588,7 @@ const ot = z.use || ((e) => {
587
588
  r,
588
589
  p
589
590
  ]
590
- ), $e[0], $e[1]), Ge = !O.current, Gt = c[p] && c[p].length > 0, Q = X.data, Z = g(Q) ? $t : Q, ae = X.error, Ke = W(Z), ue = l ? g(Q) ? Ke.current : Q : Z, ze = Gt && !g(ae) ? !1 : Ge && !g(d) ? d : w().isPaused() ? !1 : s ? g(Z) ? !1 : h : g(Z) || h, Ye = !!(p && t && Ge && ze), Kt = g(X.isValidating) ? Ye : X.isValidating, zt = g(X.isLoading) ? Ye : X.isLoading, ne = ve(
591
+ ), $e[0], $e[1]), Ge = !O.current, Gt = f[p] && f[p].length > 0, Q = X.data, Z = g(Q) ? $t : Q, ae = X.error, Ke = W(Z), ue = l ? g(Q) ? Ke.current : Q : Z, ze = Gt && !g(ae) ? !1 : Ge && !g(d) ? d : w().isPaused() ? !1 : s ? g(Z) ? !1 : h : g(Z) || h, Ye = !!(p && t && Ge && ze), Kt = g(X.isValidating) ? Ye : X.isValidating, zt = g(X.isLoading) ? Ye : X.isLoading, ne = ve(
591
592
  async (m) => {
592
593
  const b = v.current;
593
594
  if (!p || !b || E.current || w().isPaused())
@@ -626,7 +627,7 @@ const ot = z.use || ((e) => {
626
627
  Xe();
627
628
  const U = w(), { shouldRetryOnError: ge } = U;
628
629
  U.isPaused() || (N.error = I, D && x() && (U.onError(I, p, U), (ge === !0 || M(ge) && ge(I)) && (!w().revalidateOnFocus || !w().revalidateOnReconnect || C()) && U.onErrorRetry(I, p, U, (Yt) => {
629
- const Ee = c[p];
630
+ const Ee = f[p];
630
631
  Ee && Ee[0] && Ee[0](re.ERROR_REVALIDATE_EVENT, Yt);
631
632
  }, {
632
633
  retryCount: (ee.retryCount || 0) + 1,
@@ -662,7 +663,7 @@ const ot = z.use || ((e) => {
662
663
  if (!p) return;
663
664
  const m = ne.bind(P, Te);
664
665
  let b = 0;
665
- const R = Mn(p, c, (F, ee = {}) => {
666
+ const R = Mn(p, f, (F, ee = {}) => {
666
667
  if (F == re.FOCUS_EVENT) {
667
668
  const D = Date.now();
668
669
  w().revalidateOnFocus && D > b && C() && (b = D + w().focusThrottleInterval, m());
@@ -685,7 +686,7 @@ const ot = z.use || ((e) => {
685
686
  ]), Oe(() => {
686
687
  let m;
687
688
  function b() {
688
- const R = M(f) ? f(j().data) : f;
689
+ const R = M(c) ? c(j().data) : c;
689
690
  R && m !== -1 && (m = setTimeout(A, R));
690
691
  }
691
692
  function A() {
@@ -695,7 +696,7 @@ const ot = z.use || ((e) => {
695
696
  m && (clearTimeout(m), m = -1);
696
697
  };
697
698
  }, [
698
- f,
699
+ c,
699
700
  a,
700
701
  u,
701
702
  p
@@ -793,7 +794,7 @@ function St(e, t, n, r, o, s) {
793
794
  if (p !== void 0 && typeof p != "function") throw new TypeError("Function expected");
794
795
  return p;
795
796
  }
796
- for (var d = r.kind, h = d === "getter" ? "get" : d === "setter" ? "set" : "value", f = !t && e ? r.static ? e : e.prototype : null, a = t || (f ? Object.getOwnPropertyDescriptor(f, r.name) : {}), u, l = !1, c = n.length - 1; c >= 0; c--) {
797
+ for (var d = r.kind, h = d === "getter" ? "get" : d === "setter" ? "set" : "value", c = !t && e ? r.static ? e : e.prototype : null, a = t || (c ? Object.getOwnPropertyDescriptor(c, r.name) : {}), u, l = !1, f = n.length - 1; f >= 0; f--) {
797
798
  var y = {};
798
799
  for (var _ in r) y[_] = _ === "access" ? {} : r[_];
799
800
  for (var _ in r.access) y.access[_] = r.access[_];
@@ -801,14 +802,14 @@ function St(e, t, n, r, o, s) {
801
802
  if (l) throw new TypeError("Cannot add initializers after decoration has completed");
802
803
  s.push(i(p || null));
803
804
  };
804
- var T = (0, n[c])(d === "accessor" ? { get: a.get, set: a.set } : a[h], y);
805
+ var T = (0, n[f])(d === "accessor" ? { get: a.get, set: a.set } : a[h], y);
805
806
  if (d === "accessor") {
806
807
  if (T === void 0) continue;
807
808
  if (T === null || typeof T != "object") throw new TypeError("Object expected");
808
809
  (u = i(T.get)) && (a.get = u), (u = i(T.set)) && (a.set = u), (u = i(T.init)) && o.unshift(u);
809
810
  } else (u = i(T)) && (d === "field" ? o.unshift(u) : a[h] = u);
810
811
  }
811
- f && Object.defineProperty(f, r.name, a), l = !0;
812
+ c && Object.defineProperty(c, r.name, a), l = !0;
812
813
  }
813
814
  function wt(e, t, n) {
814
815
  for (var r = arguments.length > 2, o = 0; o < t.length; o++)
@@ -833,22 +834,22 @@ function Rt(e, t, n, r) {
833
834
  return new (n || (n = Promise))(function(s, i) {
834
835
  function d(a) {
835
836
  try {
836
- f(r.next(a));
837
+ c(r.next(a));
837
838
  } catch (u) {
838
839
  i(u);
839
840
  }
840
841
  }
841
842
  function h(a) {
842
843
  try {
843
- f(r.throw(a));
844
+ c(r.throw(a));
844
845
  } catch (u) {
845
846
  i(u);
846
847
  }
847
848
  }
848
- function f(a) {
849
+ function c(a) {
849
850
  a.done ? s(a.value) : o(a.value).then(d, h);
850
851
  }
851
- f((r = r.apply(e, t || [])).next());
852
+ c((r = r.apply(e, t || [])).next());
852
853
  });
853
854
  }
854
855
  function Tt(e, t) {
@@ -859,56 +860,56 @@ function Tt(e, t) {
859
860
  return i.next = d(0), i.throw = d(1), i.return = d(2), typeof Symbol == "function" && (i[Symbol.iterator] = function() {
860
861
  return this;
861
862
  }), i;
862
- function d(f) {
863
+ function d(c) {
863
864
  return function(a) {
864
- return h([f, a]);
865
+ return h([c, a]);
865
866
  };
866
867
  }
867
- function h(f) {
868
+ function h(c) {
868
869
  if (r) throw new TypeError("Generator is already executing.");
869
- for (; i && (i = 0, f[0] && (n = 0)), n; ) try {
870
- if (r = 1, o && (s = f[0] & 2 ? o.return : f[0] ? o.throw || ((s = o.return) && s.call(o), 0) : o.next) && !(s = s.call(o, f[1])).done) return s;
871
- switch (o = 0, s && (f = [f[0] & 2, s.value]), f[0]) {
870
+ for (; i && (i = 0, c[0] && (n = 0)), n; ) try {
871
+ if (r = 1, o && (s = c[0] & 2 ? o.return : c[0] ? o.throw || ((s = o.return) && s.call(o), 0) : o.next) && !(s = s.call(o, c[1])).done) return s;
872
+ switch (o = 0, s && (c = [c[0] & 2, s.value]), c[0]) {
872
873
  case 0:
873
874
  case 1:
874
- s = f;
875
+ s = c;
875
876
  break;
876
877
  case 4:
877
- return n.label++, { value: f[1], done: !1 };
878
+ return n.label++, { value: c[1], done: !1 };
878
879
  case 5:
879
- n.label++, o = f[1], f = [0];
880
+ n.label++, o = c[1], c = [0];
880
881
  continue;
881
882
  case 7:
882
- f = n.ops.pop(), n.trys.pop();
883
+ c = n.ops.pop(), n.trys.pop();
883
884
  continue;
884
885
  default:
885
- if (s = n.trys, !(s = s.length > 0 && s[s.length - 1]) && (f[0] === 6 || f[0] === 2)) {
886
+ if (s = n.trys, !(s = s.length > 0 && s[s.length - 1]) && (c[0] === 6 || c[0] === 2)) {
886
887
  n = 0;
887
888
  continue;
888
889
  }
889
- if (f[0] === 3 && (!s || f[1] > s[0] && f[1] < s[3])) {
890
- n.label = f[1];
890
+ if (c[0] === 3 && (!s || c[1] > s[0] && c[1] < s[3])) {
891
+ n.label = c[1];
891
892
  break;
892
893
  }
893
- if (f[0] === 6 && n.label < s[1]) {
894
- n.label = s[1], s = f;
894
+ if (c[0] === 6 && n.label < s[1]) {
895
+ n.label = s[1], s = c;
895
896
  break;
896
897
  }
897
898
  if (s && n.label < s[2]) {
898
- n.label = s[2], n.ops.push(f);
899
+ n.label = s[2], n.ops.push(c);
899
900
  break;
900
901
  }
901
902
  s[2] && n.ops.pop(), n.trys.pop();
902
903
  continue;
903
904
  }
904
- f = t.call(e, n);
905
+ c = t.call(e, n);
905
906
  } catch (a) {
906
- f = [6, a], o = 0;
907
+ c = [6, a], o = 0;
907
908
  } finally {
908
909
  r = s = 0;
909
910
  }
910
- if (f[0] & 5) throw f[1];
911
- return { value: f[0] ? f[1] : void 0, done: !0 };
911
+ if (c[0] & 5) throw c[1];
912
+ return { value: c[0] ? c[1] : void 0, done: !0 };
912
913
  }
913
914
  }
914
915
  var ye = Object.create ? function(e, t, n, r) {
@@ -976,36 +977,36 @@ function jt(e, t, n) {
976
977
  return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), d("next"), d("throw"), d("return", i), o[Symbol.asyncIterator] = function() {
977
978
  return this;
978
979
  }, o;
979
- function i(c) {
980
+ function i(f) {
980
981
  return function(y) {
981
- return Promise.resolve(y).then(c, u);
982
+ return Promise.resolve(y).then(f, u);
982
983
  };
983
984
  }
984
- function d(c, y) {
985
- r[c] && (o[c] = function(_) {
985
+ function d(f, y) {
986
+ r[f] && (o[f] = function(_) {
986
987
  return new Promise(function(T, p) {
987
- s.push([c, _, T, p]) > 1 || h(c, _);
988
+ s.push([f, _, T, p]) > 1 || h(f, _);
988
989
  });
989
- }, y && (o[c] = y(o[c])));
990
+ }, y && (o[f] = y(o[f])));
990
991
  }
991
- function h(c, y) {
992
+ function h(f, y) {
992
993
  try {
993
- f(r[c](y));
994
+ c(r[f](y));
994
995
  } catch (_) {
995
996
  l(s[0][3], _);
996
997
  }
997
998
  }
998
- function f(c) {
999
- c.value instanceof te ? Promise.resolve(c.value.v).then(a, u) : l(s[0][2], c);
999
+ function c(f) {
1000
+ f.value instanceof te ? Promise.resolve(f.value.v).then(a, u) : l(s[0][2], f);
1000
1001
  }
1001
- function a(c) {
1002
- h("next", c);
1002
+ function a(f) {
1003
+ h("next", f);
1003
1004
  }
1004
- function u(c) {
1005
- h("throw", c);
1005
+ function u(f) {
1006
+ h("throw", f);
1006
1007
  }
1007
- function l(c, y) {
1008
- c(y), s.shift(), s.length && h(s[0][0], s[0][1]);
1008
+ function l(f, y) {
1009
+ f(y), s.shift(), s.length && h(s[0][0], s[0][1]);
1009
1010
  }
1010
1011
  }
1011
1012
  function Pt(e) {
@@ -1035,8 +1036,8 @@ function Lt(e) {
1035
1036
  };
1036
1037
  }
1037
1038
  function o(s, i, d, h) {
1038
- Promise.resolve(h).then(function(f) {
1039
- s({ value: f, done: d });
1039
+ Promise.resolve(h).then(function(c) {
1040
+ s({ value: c, done: d });
1040
1041
  }, i);
1041
1042
  }
1042
1043
  }
@@ -1220,12 +1221,12 @@ var Ve = $n, Ce = z, Kn = Ve.__importDefault(Gn());
1220
1221
  function zn(e, t, n) {
1221
1222
  t === void 0 && (t = []), n === void 0 && (n = { loading: !1 });
1222
1223
  var r = Ce.useRef(0), o = Kn.default(), s = Ce.useState(n), i = s[0], d = s[1], h = Ce.useCallback(function() {
1223
- for (var f = [], a = 0; a < arguments.length; a++)
1224
- f[a] = arguments[a];
1224
+ for (var c = [], a = 0; a < arguments.length; a++)
1225
+ c[a] = arguments[a];
1225
1226
  var u = ++r.current;
1226
1227
  return i.loading || d(function(l) {
1227
1228
  return Ve.__assign(Ve.__assign({}, l), { loading: !0 });
1228
- }), e.apply(void 0, f).then(function(l) {
1229
+ }), e.apply(void 0, c).then(function(l) {
1229
1230
  return o() && u === r.current && d({ value: l, loading: !1 }), l;
1230
1231
  }, function(l) {
1231
1232
  return o() && u === r.current && d({ error: l, loading: !1 }), l;
@@ -1250,7 +1251,7 @@ function ir() {
1250
1251
  }
1251
1252
  function o(a, u) {
1252
1253
  t(
1253
- (l) => l.map((c) => c.id === a ? { ...c, ...u } : c)
1254
+ (l) => l.map((f) => f.id === a ? { ...f, ...u } : f)
1254
1255
  );
1255
1256
  }
1256
1257
  function s(a) {
@@ -1261,15 +1262,15 @@ function ir() {
1261
1262
  H.set(a.id, u);
1262
1263
  try {
1263
1264
  t(
1264
- (c) => c.map(
1265
+ (f) => f.map(
1265
1266
  (y) => y.id === a.id ? { ...y, status: "uploading", progress: 0 } : y
1266
1267
  )
1267
1268
  );
1268
1269
  const l = await n.uploadFile({
1269
1270
  file: a.file,
1270
1271
  abortSignal: u.signal,
1271
- onProgress: (c) => {
1272
- o(a.id, { progress: c });
1272
+ onProgress: (f) => {
1273
+ o(a.id, { progress: f });
1273
1274
  }
1274
1275
  });
1275
1276
  o(a.id, {
@@ -1290,7 +1291,7 @@ function ir() {
1290
1291
  const u = H.get(a);
1291
1292
  u && (u.abort(), H.delete(a)), s(a);
1292
1293
  }, h = Ne(() => e.filter((a) => a.status === "success" && a.fileUrl), [e]);
1293
- function f() {
1294
+ function c() {
1294
1295
  H.forEach((a) => a.abort()), H.clear(), t([]);
1295
1296
  }
1296
1297
  return he(() => () => {
@@ -1300,7 +1301,7 @@ function ir() {
1300
1301
  appendFiles: r,
1301
1302
  handleCancelUpload: d,
1302
1303
  successFiles: h,
1303
- emptyTheFiles: f,
1304
+ emptyTheFiles: c,
1304
1305
  getFileById: (a) => e.find((u) => u.id === a),
1305
1306
  getUploadProgress: (a) => {
1306
1307
  var u;
@@ -1347,4 +1348,4 @@ export {
1347
1348
  nr as m,
1348
1349
  Y as u
1349
1350
  };
1350
- //# sourceMappingURL=useWidgetTrigger-BNZHwm7w.js.map
1351
+ //# sourceMappingURL=useWidgetTrigger-CY_10B--.js.map