@kakadu/components 6.10.0 → 6.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/build/components/aria-text.js +1 -1
  2. package/build/components/aria-text.mjs +1 -1
  3. package/build/components/box.js +1 -1
  4. package/build/components/box.mjs +1 -1
  5. package/build/components/button-tooltip.js +1 -1
  6. package/build/components/button-tooltip.mjs +1 -1
  7. package/build/components/button.js +1 -1
  8. package/build/components/button.mjs +1 -1
  9. package/build/components/card.js +1 -1
  10. package/build/components/card.mjs +1 -1
  11. package/build/components/checkbox.js +1 -1
  12. package/build/components/checkbox.mjs +1 -1
  13. package/build/components/click-ripples.js +1 -1
  14. package/build/components/click-ripples.mjs +1 -1
  15. package/build/components/collapsible.js +1 -1
  16. package/build/components/collapsible.mjs +1 -1
  17. package/build/components/combobox.js +1 -1
  18. package/build/components/combobox.mjs +1 -1
  19. package/build/components/copy-icon-button.js +1 -1
  20. package/build/components/copy-icon-button.mjs +1 -1
  21. package/build/components/datum.js +1 -1
  22. package/build/components/datum.mjs +1 -1
  23. package/build/components/decorators.js +1 -1
  24. package/build/components/decorators.mjs +1 -1
  25. package/build/components/dot.js +1 -1
  26. package/build/components/dot.mjs +1 -1
  27. package/build/components/flags.js +1 -1
  28. package/build/components/flags.mjs +1 -1
  29. package/build/components/flex.js +1 -1
  30. package/build/components/flex.mjs +1 -1
  31. package/build/components/footer.js +1 -1
  32. package/build/components/footer.mjs +1 -1
  33. package/build/components/gauge.js +1 -1
  34. package/build/components/gauge.mjs +1 -1
  35. package/build/components/header.js +1 -1
  36. package/build/components/header.mjs +1 -1
  37. package/build/components/hover-gradient.js +1 -1
  38. package/build/components/hover-gradient.mjs +1 -1
  39. package/build/components/icon-button.js +1 -1
  40. package/build/components/icon-button.mjs +1 -1
  41. package/build/components/input.js +1 -1
  42. package/build/components/input.mjs +1 -1
  43. package/build/components/logos/akt-logo.js +1 -1
  44. package/build/components/logos/akt-logo.mjs +1 -1
  45. package/build/components/logos/amedia-logo.js +1 -1
  46. package/build/components/logos/amedia-logo.mjs +1 -1
  47. package/build/components/logos/bankaxept-logo.js +1 -1
  48. package/build/components/logos/bankaxept-logo.mjs +1 -1
  49. package/build/components/logos/bankid-logo.js +1 -1
  50. package/build/components/logos/bankid-logo.mjs +1 -1
  51. package/build/components/logos/dnb-logo.js +1 -1
  52. package/build/components/logos/dnb-logo.mjs +1 -1
  53. package/build/components/logos/entur-logo.js +1 -1
  54. package/build/components/logos/entur-logo.mjs +1 -1
  55. package/build/components/logos/gjensidige-logo.js +1 -1
  56. package/build/components/logos/gjensidige-logo.mjs +1 -1
  57. package/build/components/logos/kakadu-academy-logo.js +1 -1
  58. package/build/components/logos/kakadu-academy-logo.mjs +1 -1
  59. package/build/components/logos/kakadu-guide-icon.js +1 -1
  60. package/build/components/logos/kakadu-guide-icon.mjs +1 -1
  61. package/build/components/logos/kakadu-guide-logo.js +1 -1
  62. package/build/components/logos/kakadu-guide-logo.mjs +1 -1
  63. package/build/components/logos/kakadu-index-logo.js +1 -1
  64. package/build/components/logos/kakadu-index-logo.mjs +1 -1
  65. package/build/components/logos/kakadu-logo.js +1 -1
  66. package/build/components/logos/kakadu-logo.mjs +1 -1
  67. package/build/components/logos/kakadu-play-logo.js +1 -1
  68. package/build/components/logos/kakadu-play-logo.mjs +1 -1
  69. package/build/components/logos/kolumbus-logo.js +1 -1
  70. package/build/components/logos/kolumbus-logo.mjs +1 -1
  71. package/build/components/logos/nordea-logo.js +1 -1
  72. package/build/components/logos/nordea-logo.mjs +1 -1
  73. package/build/components/logos/norsk-tipping-logo.js +1 -1
  74. package/build/components/logos/norsk-tipping-logo.mjs +1 -1
  75. package/build/components/logos/ruter-logo.js +1 -1
  76. package/build/components/logos/ruter-logo.mjs +1 -1
  77. package/build/components/logos/senteret-for-et-aldersvennlig-norge-logo.js +1 -1
  78. package/build/components/logos/senteret-for-et-aldersvennlig-norge-logo.mjs +1 -1
  79. package/build/components/logos/sparebank1-logo.js +1 -1
  80. package/build/components/logos/sparebank1-logo.mjs +1 -1
  81. package/build/components/logos/sparebanken-norge-logo.js +1 -1
  82. package/build/components/logos/sparebanken-norge-logo.mjs +1 -1
  83. package/build/components/logos/sto-logo.js +1 -1
  84. package/build/components/logos/sto-logo.mjs +1 -1
  85. package/build/components/logos/storebrand-logo.js +1 -1
  86. package/build/components/logos/storebrand-logo.mjs +1 -1
  87. package/build/components/modal.js +1 -1
  88. package/build/components/modal.mjs +2 -2
  89. package/build/components/moving-gradients.js +1 -1
  90. package/build/components/moving-gradients.mjs +1 -1
  91. package/build/components/moving-stars.js +1 -1
  92. package/build/components/moving-stars.mjs +1 -1
  93. package/build/components/notice.js +1 -1
  94. package/build/components/notice.mjs +1 -1
  95. package/build/components/notification.js +1 -1
  96. package/build/components/notification.mjs +1 -1
  97. package/build/components/popover-menu.js +1 -1
  98. package/build/components/popover-menu.mjs +1 -1
  99. package/build/components/popover.js +1 -1
  100. package/build/components/popover.mjs +2 -2
  101. package/build/components/revealer.js +1 -1
  102. package/build/components/revealer.mjs +1 -1
  103. package/build/components/select.js +1 -1
  104. package/build/components/select.mjs +1 -1
  105. package/build/components/separator.js +1 -1
  106. package/build/components/separator.mjs +1 -1
  107. package/build/components/skeleton.js +1 -1
  108. package/build/components/skeleton.mjs +1 -1
  109. package/build/components/spinner.js +1 -1
  110. package/build/components/spinner.mjs +1 -1
  111. package/build/components/text-button.js +1 -1
  112. package/build/components/text-button.mjs +1 -1
  113. package/build/components/text.js +1 -1
  114. package/build/components/text.mjs +1 -1
  115. package/build/components/theme-setter.js +1 -1
  116. package/build/components/theme-setter.mjs +1 -1
  117. package/build/components/veil.js +1 -1
  118. package/build/components/veil.mjs +1 -1
  119. package/build/components/wrapper.js +1 -1
  120. package/build/components/wrapper.mjs +1 -1
  121. package/build/{focus-trap-react-B7f3iC5h.js → focus-trap-react-D0ZxGVUk.js} +3 -3
  122. package/build/{focus-trap-react-Dr3BYLw6.mjs → focus-trap-react-D4ushEjf.mjs} +86 -85
  123. package/build/hooks/use-fetch.d.ts +3 -3
  124. package/build/hooks/use-fetch.js +1 -1
  125. package/build/hooks/use-fetch.mjs +77 -75
  126. package/build/icons/anchor-down.js +1 -1
  127. package/build/icons/anchor-down.mjs +1 -1
  128. package/build/icons/anchor-up.js +1 -1
  129. package/build/icons/anchor-up.mjs +1 -1
  130. package/build/icons/arrow-down.js +1 -1
  131. package/build/icons/arrow-down.mjs +1 -1
  132. package/build/icons/arrow-left.js +1 -1
  133. package/build/icons/arrow-left.mjs +1 -1
  134. package/build/icons/arrow-right.js +1 -1
  135. package/build/icons/arrow-right.mjs +1 -1
  136. package/build/icons/arrow-up.js +1 -1
  137. package/build/icons/arrow-up.mjs +1 -1
  138. package/build/icons/caret-down.js +1 -1
  139. package/build/icons/caret-down.mjs +1 -1
  140. package/build/icons/caret-left.js +1 -1
  141. package/build/icons/caret-left.mjs +1 -1
  142. package/build/icons/caret-right.js +1 -1
  143. package/build/icons/caret-right.mjs +1 -1
  144. package/build/icons/caret-up.js +1 -1
  145. package/build/icons/caret-up.mjs +1 -1
  146. package/build/icons/check.js +1 -1
  147. package/build/icons/check.mjs +1 -1
  148. package/build/icons/chevron-down.js +1 -1
  149. package/build/icons/chevron-down.mjs +1 -1
  150. package/build/icons/chevron-left.js +1 -1
  151. package/build/icons/chevron-left.mjs +1 -1
  152. package/build/icons/chevron-right.js +1 -1
  153. package/build/icons/chevron-right.mjs +1 -1
  154. package/build/icons/chevron-up.js +1 -1
  155. package/build/icons/chevron-up.mjs +1 -1
  156. package/build/icons/chrome-browser-logo.js +1 -1
  157. package/build/icons/chrome-browser-logo.mjs +1 -1
  158. package/build/icons/cog.js +1 -1
  159. package/build/icons/cog.mjs +1 -1
  160. package/build/icons/copy.js +1 -1
  161. package/build/icons/copy.mjs +1 -1
  162. package/build/icons/document.js +1 -1
  163. package/build/icons/document.mjs +1 -1
  164. package/build/icons/dots.js +1 -1
  165. package/build/icons/dots.mjs +1 -1
  166. package/build/icons/drag.js +1 -1
  167. package/build/icons/drag.mjs +1 -1
  168. package/build/icons/edge-browser-logo.js +1 -1
  169. package/build/icons/edge-browser-logo.mjs +1 -1
  170. package/build/icons/edit.js +1 -1
  171. package/build/icons/edit.mjs +1 -1
  172. package/build/icons/exclamation-triangle.js +1 -1
  173. package/build/icons/exclamation-triangle.mjs +1 -1
  174. package/build/icons/external.js +1 -1
  175. package/build/icons/external.mjs +1 -1
  176. package/build/icons/eye.js +1 -1
  177. package/build/icons/eye.mjs +1 -1
  178. package/build/icons/icon.js +1 -1
  179. package/build/icons/icon.mjs +1 -1
  180. package/build/icons/information.js +1 -1
  181. package/build/icons/information.mjs +1 -1
  182. package/build/icons/kakadu-guide-glyph.js +1 -1
  183. package/build/icons/kakadu-guide-glyph.mjs +1 -1
  184. package/build/icons/kakadu-guide-icon.js +1 -1
  185. package/build/icons/kakadu-guide-icon.mjs +1 -1
  186. package/build/icons/menu.js +1 -1
  187. package/build/icons/menu.mjs +1 -1
  188. package/build/icons/package.js +1 -1
  189. package/build/icons/package.mjs +1 -1
  190. package/build/icons/plus.js +1 -1
  191. package/build/icons/plus.mjs +1 -1
  192. package/build/icons/reload.js +1 -1
  193. package/build/icons/reload.mjs +1 -1
  194. package/build/icons/select.js +1 -1
  195. package/build/icons/select.mjs +1 -1
  196. package/build/icons/share.js +1 -1
  197. package/build/icons/share.mjs +1 -1
  198. package/build/icons/sparkle.js +1 -1
  199. package/build/icons/sparkle.mjs +1 -1
  200. package/build/icons/test.js +1 -1
  201. package/build/icons/test.mjs +1 -1
  202. package/build/icons/thumbs-down.js +1 -1
  203. package/build/icons/thumbs-down.mjs +1 -1
  204. package/build/icons/thumbs-up.js +1 -1
  205. package/build/icons/thumbs-up.mjs +1 -1
  206. package/build/icons/times.js +1 -1
  207. package/build/icons/times.mjs +1 -1
  208. package/build/icons/trash.js +1 -1
  209. package/build/icons/trash.mjs +1 -1
  210. package/build/icons/trend-up.js +1 -1
  211. package/build/icons/trend-up.mjs +1 -1
  212. package/build/jsx-runtime-CZa898vN.js +22 -0
  213. package/build/{jsx-runtime-B4hRZ52C.mjs → jsx-runtime-z6PQ6F3d.mjs} +111 -97
  214. package/build/theme.js +1 -1
  215. package/build/theme.mjs +1 -1
  216. package/package.json +22 -22
  217. package/build/jsx-runtime-BB_1_6y_.js +0 -22
@@ -2,10 +2,10 @@ import Ee from "react";
2
2
  import { g as be } from "./_commonjsHelpers-MdHo5S7N.mjs";
3
3
  var H = { exports: {} };
4
4
  /*!
5
- * tabbable 6.4.0
5
+ * tabbable 6.5.0
6
6
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
7
7
  */
8
- var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], J = /* @__PURE__ */ pe.join(","), he = typeof Element > "u", M = he ? function() {
8
+ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "area[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], J = /* @__PURE__ */ pe.join(","), he = typeof Element > "u", M = he ? function() {
9
9
  } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Q = !he && Element.prototype.getRootNode ? function(n) {
10
10
  var e;
11
11
  return n == null || (e = n.getRootNode) === null || e === void 0 ? void 0 : e.call(n);
@@ -31,18 +31,18 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
31
31
  var a = l.shift();
32
32
  if (!ee(a, !1))
33
33
  if (a.tagName === "SLOT") {
34
- var y = a.assignedElements(), w = y.length ? y : a.children, E = te(w, !0, o);
35
- o.flatten ? s.push.apply(s, E) : s.push({
34
+ var y = a.assignedElements(), w = y.length ? y : a.children, O = te(w, !0, o);
35
+ o.flatten ? s.push.apply(s, O) : s.push({
36
36
  scopeParent: a,
37
- candidates: E
37
+ candidates: O
38
38
  });
39
39
  } else {
40
- var k = M.call(a, J);
41
- k && o.filter(a) && (t || !e.includes(a)) && s.push(a);
42
- var D = a.shadowRoot || // check for an undisclosed shadow
43
- typeof o.getShadowRoot == "function" && o.getShadowRoot(a), R = !ee(D, !1) && (!o.shadowRootFilter || o.shadowRootFilter(a));
44
- if (D && R) {
45
- var j = te(D === !0 ? a.children : D.children, !0, o);
40
+ var D = M.call(a, J);
41
+ D && o.filter(a) && (t || !e.includes(a)) && s.push(a);
42
+ var E = a.shadowRoot || // check for an undisclosed shadow
43
+ typeof o.getShadowRoot == "function" && o.getShadowRoot(a), N = !ee(E, !1) && (!o.shadowRootFilter || o.shadowRootFilter(a));
44
+ if (E && N) {
45
+ var j = te(E === !0 ? a.children : E.children, !0, o);
46
46
  o.flatten ? s.push.apply(s, j) : s.push({
47
47
  scopeParent: a,
48
48
  candidates: j
@@ -101,8 +101,8 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
101
101
  if (o && o !== e) {
102
102
  var a, y, w;
103
103
  for (l = !!((a = s) !== null && a !== void 0 && (y = a.ownerDocument) !== null && y !== void 0 && y.contains(s) || e != null && (w = e.ownerDocument) !== null && w !== void 0 && w.contains(e)); !l && s; ) {
104
- var E, k, D;
105
- o = Q(s), s = (E = o) === null || E === void 0 ? void 0 : E.host, l = !!((k = s) !== null && k !== void 0 && (D = k.ownerDocument) !== null && D !== void 0 && D.contains(s));
104
+ var O, D, E;
105
+ o = Q(s), s = (O = o) === null || O === void 0 ? void 0 : O.host, l = !!((D = s) !== null && D !== void 0 && (E = D.ownerDocument) !== null && E !== void 0 && E.contains(s));
106
106
  }
107
107
  }
108
108
  return l;
@@ -127,22 +127,23 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
127
127
  });
128
128
  return !l;
129
129
  }
130
- if (getComputedStyle(e).visibility === "hidden")
130
+ var a = getComputedStyle(e), y = a.visibility;
131
+ if (y === "hidden" || y === "collapse")
131
132
  return !0;
132
- var a = M.call(e, "details>summary:first-of-type"), y = a ? e.parentElement : e;
133
- if (M.call(y, "details:not([open]) *"))
133
+ var w = M.call(e, "details>summary:first-of-type"), O = w ? e.parentElement : e;
134
+ if (M.call(O, "details:not([open]) *"))
134
135
  return !0;
135
136
  if (!o || o === "full" || // full-native can run this branch when it falls through in case
136
137
  // Element#checkVisibility is unsupported
137
138
  o === "full-native" || o === "legacy-full") {
138
139
  if (typeof s == "function") {
139
- for (var w = e; e; ) {
140
- var E = e.parentElement, k = Q(e);
140
+ for (var D = e; e; ) {
141
+ var E = e.parentElement, N = Q(e);
141
142
  if (E && !E.shadowRoot && s(E) === !0)
142
143
  return se(e);
143
- e.assignedSlot ? e = e.assignedSlot : !E && k !== e.ownerDocument ? e = k.host : e = E;
144
+ e.assignedSlot ? e = e.assignedSlot : !E && N !== e.ownerDocument ? e = N.host : e = E;
144
145
  }
145
- e = w;
146
+ e = D;
146
147
  }
147
148
  if (je(e))
148
149
  return !e.getClientRects().length;
@@ -176,13 +177,13 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
176
177
  }, Te = function(e) {
177
178
  var t = [], o = [];
178
179
  return e.forEach(function(s, l) {
179
- var a = !!s.scopeParent, y = a ? s.scopeParent : s, w = ke(y, a), E = a ? Te(s.candidates) : y;
180
- w === 0 ? a ? t.push.apply(t, E) : t.push(y) : o.push({
180
+ var a = !!s.scopeParent, y = a ? s.scopeParent : s, w = ke(y, a), O = a ? Te(s.candidates) : y;
181
+ w === 0 ? a ? t.push.apply(t, O) : t.push(y) : o.push({
181
182
  documentOrder: l,
182
183
  tabIndex: w,
183
184
  item: s,
184
185
  isScope: a,
185
- content: E
186
+ content: O
186
187
  });
187
188
  }), o.sort(De).reduce(function(s, l) {
188
189
  return l.isScope ? s.push.apply(s, l.content) : s.push(l.content), s;
@@ -439,7 +440,7 @@ var I = {
439
440
  recentNavEvent: void 0
440
441
  }, y, w = function(i, r, c) {
441
442
  return i && i[r] !== void 0 ? i[r] : l[c || r];
442
- }, E = function(i, r) {
443
+ }, O = function(i, r) {
443
444
  var c = typeof (r == null ? void 0 : r.composedPath) == "function" ? r.composedPath() : void 0;
444
445
  return a.containerGroups.findIndex(function(h) {
445
446
  var p = h.container, g = h.tabbableNodes;
@@ -451,7 +452,7 @@ var I = {
451
452
  return v === i;
452
453
  });
453
454
  });
454
- }, k = function(i) {
455
+ }, D = function(i) {
455
456
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = r.hasFallback, h = c === void 0 ? !1 : c, p = r.params, g = p === void 0 ? [] : p, v = l[i];
456
457
  if (typeof v == "function" && (v = v.apply(void 0, $e(g))), v === !0 && (v = void 0), !v) {
457
458
  if (v === void 0 || v === !1)
@@ -469,24 +470,24 @@ var I = {
469
470
  throw new Error("`".concat(i, "` as selector refers to no known node"));
470
471
  }
471
472
  return S;
472
- }, D = function() {
473
- var i = k("initialFocus", {
473
+ }, E = function() {
474
+ var i = D("initialFocus", {
474
475
  hasFallback: !0
475
476
  });
476
477
  if (i === !1)
477
478
  return !1;
478
479
  if (i === void 0 || i && !X(i, l.tabbableOptions))
479
- if (E(o.activeElement) >= 0)
480
+ if (O(o.activeElement) >= 0)
480
481
  i = o.activeElement;
481
482
  else {
482
483
  var r = a.tabbableGroups[0], c = r && r.firstTabbableNode;
483
- i = c || k("fallbackFocus");
484
+ i = c || D("fallbackFocus");
484
485
  }
485
- else i === null && (i = k("fallbackFocus"));
486
+ else i === null && (i = D("fallbackFocus"));
486
487
  if (!i)
487
488
  throw new Error("Your focus-trap needs to have at least one focusable element");
488
489
  return i;
489
- }, R = function() {
490
+ }, N = function() {
490
491
  if (a.containerGroups = a.containers.map(function(i) {
491
492
  var r = we(i, l.tabbableOptions), c = Se(i, l.tabbableOptions), h = r.length > 0 ? r[0] : void 0, p = r.length > 0 ? r[r.length - 1] : void 0, g = c.find(function(F) {
492
493
  return K(F);
@@ -524,18 +525,18 @@ var I = {
524
525
  * in reverse.
525
526
  * @returns {HTMLElement|undefined} The next tabbable node, if any.
526
527
  */
527
- nextTabbableNode: function(N) {
528
- var A = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, C = r.indexOf(N);
529
- return C < 0 ? A ? c.slice(c.indexOf(N) + 1).find(function(B) {
528
+ nextTabbableNode: function(R) {
529
+ var A = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, C = r.indexOf(R);
530
+ return C < 0 ? A ? c.slice(c.indexOf(R) + 1).find(function(B) {
530
531
  return K(B);
531
- }) : c.slice(0, c.indexOf(N)).reverse().find(function(B) {
532
+ }) : c.slice(0, c.indexOf(R)).reverse().find(function(B) {
532
533
  return K(B);
533
534
  }) : r[C + (A ? 1 : -1)];
534
535
  }
535
536
  };
536
537
  }), a.tabbableGroups = a.containerGroups.filter(function(i) {
537
538
  return i.tabbableNodes.length > 0;
538
- }), a.tabbableGroups.length <= 0 && !k("fallbackFocus"))
539
+ }), a.tabbableGroups.length <= 0 && !D("fallbackFocus"))
539
540
  throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
540
541
  if (a.containerGroups.find(function(i) {
541
542
  return i.posTabIndexesFound;
@@ -548,7 +549,7 @@ var I = {
548
549
  }, P = function(i) {
549
550
  if (i !== !1 && i !== j(document)) {
550
551
  if (!i || !i.focus) {
551
- P(D());
552
+ P(E());
552
553
  return;
553
554
  }
554
555
  i.focus({
@@ -556,16 +557,16 @@ var I = {
556
557
  }), a.mostRecentlyFocusedNode = i, ze(i) && i.select();
557
558
  }
558
559
  }, U = function(i) {
559
- var r = k("setReturnFocus", {
560
+ var r = D("setReturnFocus", {
560
561
  params: [i]
561
562
  });
562
563
  return r || (r === !1 ? !1 : i);
563
564
  }, _ = function(i) {
564
565
  var r = i.target, c = i.event, h = i.isBackward, p = h === void 0 ? !1 : h;
565
- r = r || Z(c), R();
566
+ r = r || Z(c), N();
566
567
  var g = null;
567
568
  if (a.tabbableGroups.length > 0) {
568
- var v = E(r, c), S = v >= 0 ? a.containerGroups[v] : void 0;
569
+ var v = O(r, c), S = v >= 0 ? a.containerGroups[v] : void 0;
569
570
  if (v < 0)
570
571
  p ? g = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : g = a.tabbableGroups[0].firstTabbableNode;
571
572
  else if (p) {
@@ -574,7 +575,7 @@ var I = {
574
575
  return r === ie;
575
576
  });
576
577
  if (F < 0 && (S.container === r || X(r, l.tabbableOptions) && !K(r, l.tabbableOptions) && !S.nextTabbableNode(r, !1)) && (F = v), F >= 0) {
577
- var N = F === 0 ? a.tabbableGroups.length - 1 : F - 1, A = a.tabbableGroups[N];
578
+ var R = F === 0 ? a.tabbableGroups.length - 1 : F - 1, A = a.tabbableGroups[R];
578
579
  g = L(r) >= 0 ? A.lastTabbableNode : A.lastDomTabbableNode;
579
580
  } else $(c) || (g = S.nextTabbableNode(r, !1));
580
581
  } else {
@@ -588,11 +589,11 @@ var I = {
588
589
  } else $(c) || (g = S.nextTabbableNode(r));
589
590
  }
590
591
  } else
591
- g = k("fallbackFocus");
592
+ g = D("fallbackFocus");
592
593
  return g;
593
594
  }, q = function(i) {
594
595
  var r = Z(i);
595
- if (!(E(r, i) >= 0)) {
596
+ if (!(O(r, i) >= 0)) {
596
597
  if (G(l.clickOutsideDeactivates, i)) {
597
598
  y.deactivate({
598
599
  // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
@@ -608,7 +609,7 @@ var I = {
608
609
  G(l.allowOutsideClick, i) || i.preventDefault();
609
610
  }
610
611
  }, W = function(i) {
611
- var r = Z(i), c = E(r, i) >= 0;
612
+ var r = Z(i), c = O(r, i) >= 0;
612
613
  if (c || r instanceof Document)
613
614
  c && (a.mostRecentlyFocusedNode = r);
614
615
  else {
@@ -616,7 +617,7 @@ var I = {
616
617
  var h, p = !0;
617
618
  if (a.mostRecentlyFocusedNode)
618
619
  if (L(a.mostRecentlyFocusedNode) > 0) {
619
- var g = E(a.mostRecentlyFocusedNode), v = a.containerGroups[g].tabbableNodes;
620
+ var g = O(a.mostRecentlyFocusedNode), v = a.containerGroups[g].tabbableNodes;
620
621
  if (v.length > 0) {
621
622
  var S = v.findIndex(function(F) {
622
623
  return F === a.mostRecentlyFocusedNode;
@@ -625,8 +626,8 @@ var I = {
625
626
  }
626
627
  } else
627
628
  a.containerGroups.some(function(F) {
628
- return F.tabbableNodes.some(function(N) {
629
- return L(N) > 0;
629
+ return F.tabbableNodes.some(function(R) {
630
+ return L(R) > 0;
630
631
  });
631
632
  }) || (p = !1);
632
633
  else
@@ -636,7 +637,7 @@ var I = {
636
637
  // outside the trap causing the focus escape we're trying to fix)
637
638
  target: a.mostRecentlyFocusedNode,
638
639
  isBackward: l.isKeyBackward(a.recentNavEvent)
639
- })), P(h || a.mostRecentlyFocusedNode || D());
640
+ })), P(h || a.mostRecentlyFocusedNode || E());
640
641
  }
641
642
  a.recentNavEvent = void 0;
642
643
  }, ae = function(i) {
@@ -653,12 +654,12 @@ var I = {
653
654
  Ye(i) && G(l.escapeDeactivates, i) !== !1 && (i.preventDefault(), y.deactivate());
654
655
  }, V = function(i) {
655
656
  var r = Z(i);
656
- E(r, i) >= 0 || G(l.clickOutsideDeactivates, i) || G(l.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
657
+ O(r, i) >= 0 || G(l.clickOutsideDeactivates, i) || G(l.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
657
658
  }, d = function() {
658
659
  if (a.active)
659
660
  return I.activateTrap(s, y), a.delayInitialFocusTimer = l.delayInitialFocus ? de(function() {
660
- P(D());
661
- }) : P(D()), o.addEventListener("focusin", W, !0), o.addEventListener("mousedown", q, {
661
+ P(E());
662
+ }) : P(E()), o.addEventListener("focusin", W, !0), o.addEventListener("mousedown", q, {
662
663
  capture: !0,
663
664
  passive: !1
664
665
  }), o.addEventListener("touchstart", q, {
@@ -680,9 +681,9 @@ var I = {
680
681
  r.add(g);
681
682
  for (var v = typeof ShadowRoot < "u" && g.getRootNode() instanceof ShadowRoot, S = g; S; ) {
682
683
  r.add(S);
683
- var F = S.parentElement, N = [];
684
- F ? N = F.children : !F && v && (N = S.getRootNode().children, F = S.getRootNode().host, v = typeof ShadowRoot < "u" && F.getRootNode() instanceof ShadowRoot);
685
- var A = ce(N), C;
684
+ var F = S.parentElement, R = [];
685
+ F ? R = F.children : !F && v && (R = S.getRootNode().children, F = S.getRootNode().host, v = typeof ShadowRoot < "u" && F.getRootNode() instanceof ShadowRoot);
686
+ var A = ce(R), C;
686
687
  try {
687
688
  for (A.s(); !(C = A.n()).done; ) {
688
689
  var B = C.value;
@@ -714,8 +715,8 @@ var I = {
714
715
  return p === a.mostRecentlyFocusedNode;
715
716
  });
716
717
  });
717
- r && P(D());
718
- }, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(u) : void 0, O = function() {
718
+ r && P(E());
719
+ }, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(u) : void 0, k = function() {
719
720
  T && (T.disconnect(), a.active && !a.paused && a.containers.map(function(i) {
720
721
  T.observe(i, {
721
722
  subtree: !0,
@@ -739,19 +740,19 @@ var I = {
739
740
  (v = p._setSubtreeIsolation) === null || v === void 0 || v.call(p, !1), g = !0;
740
741
  }
741
742
  try {
742
- h || R(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = j(o), r == null || r();
743
+ h || N(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = j(o), r == null || r();
743
744
  var S = function() {
744
- h && R(), d(), O(), l.isolateSubtrees && y._setSubtreeIsolation(!0), c == null || c();
745
+ h && N(), d(), k(), l.isolateSubtrees && y._setSubtreeIsolation(!0), c == null || c();
745
746
  };
746
747
  if (h)
747
748
  return h(a.containers.concat()).then(S, S), this;
748
749
  S();
749
- } catch (N) {
750
+ } catch (R) {
750
751
  if (p === I.getActiveTrap(s) && g) {
751
752
  var F;
752
753
  (F = p._setSubtreeIsolation) === null || F === void 0 || F.call(p, !0);
753
754
  }
754
- throw N;
755
+ throw R;
755
756
  }
756
757
  return this;
757
758
  },
@@ -763,7 +764,7 @@ var I = {
763
764
  onPostDeactivate: l.onPostDeactivate,
764
765
  checkCanReturnFocus: l.checkCanReturnFocus
765
766
  }, i);
766
- clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, a.paused || y._setSubtreeIsolation(!1), a.alreadySilent.clear(), m(), a.active = !1, a.paused = !1, O(), I.deactivateTrap(s, y);
767
+ clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, a.paused || y._setSubtreeIsolation(!1), a.alreadySilent.clear(), m(), a.active = !1, a.paused = !1, k(), I.deactivateTrap(s, y);
767
768
  var c = w(r, "onDeactivate"), h = w(r, "onPostDeactivate"), p = w(r, "checkCanReturnFocus"), g = w(r, "returnFocus", "returnFocusOnDeactivate");
768
769
  c == null || c();
769
770
  var v = function() {
@@ -783,7 +784,7 @@ var I = {
783
784
  var r = [].concat(i).filter(Boolean);
784
785
  return a.containers = r.map(function(c) {
785
786
  return typeof c == "string" ? o.querySelector(c) : c;
786
- }), l.isolateSubtrees && f(a.containers), a.active && (R(), l.isolateSubtrees && !a.paused && y._setSubtreeIsolation(!0)), O(), this;
787
+ }), l.isolateSubtrees && f(a.containers), a.active && (N(), l.isolateSubtrees && !a.paused && y._setSubtreeIsolation(!0)), k(), this;
787
788
  }
788
789
  }, Object.defineProperties(y, {
789
790
  _isManuallyPaused: {
@@ -797,10 +798,10 @@ var I = {
797
798
  return this;
798
799
  if (a.paused = i, i) {
799
800
  var c = w(r, "onPause"), h = w(r, "onPostPause");
800
- c == null || c(), m(), O(), y._setSubtreeIsolation(!1), h == null || h();
801
+ c == null || c(), m(), k(), y._setSubtreeIsolation(!1), h == null || h();
801
802
  } else {
802
803
  var p = w(r, "onUnpause"), g = w(r, "onPostUnpause");
803
- p == null || p(), y._setSubtreeIsolation(!0), R(), d(), O(), g == null || g();
804
+ p == null || p(), y._setSubtreeIsolation(!0), N(), d(), k(), g == null || g();
804
805
  }
805
806
  return this;
806
807
  }
@@ -861,7 +862,7 @@ function rt() {
861
862
  return f && s(d.prototype, f), Object.defineProperty(d, "prototype", { writable: !1 }), d;
862
863
  }
863
864
  function a(d, f, m) {
864
- return f = k(f), y(d, E() ? Reflect.construct(f, m || [], k(d).constructor) : f.apply(d, m));
865
+ return f = D(f), y(d, O() ? Reflect.construct(f, m || [], D(d).constructor) : f.apply(d, m));
865
866
  }
866
867
  function y(d, f) {
867
868
  if (f && (n(f) == "object" || typeof f == "function")) return f;
@@ -872,29 +873,29 @@ function rt() {
872
873
  if (d === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
873
874
  return d;
874
875
  }
875
- function E() {
876
+ function O() {
876
877
  try {
877
878
  var d = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
878
879
  }));
879
880
  } catch {
880
881
  }
881
- return (E = function() {
882
+ return (O = function() {
882
883
  return !!d;
883
884
  })();
884
885
  }
885
- function k(d) {
886
- return k = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(f) {
886
+ function D(d) {
887
+ return D = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(f) {
887
888
  return f.__proto__ || Object.getPrototypeOf(f);
888
- }, k(d);
889
+ }, D(d);
889
890
  }
890
- function D(d, f) {
891
+ function E(d, f) {
891
892
  if (typeof f != "function" && f !== null) throw new TypeError("Super expression must either be null or a function");
892
- d.prototype = Object.create(f && f.prototype, { constructor: { value: d, writable: !0, configurable: !0 } }), Object.defineProperty(d, "prototype", { writable: !1 }), f && R(d, f);
893
+ d.prototype = Object.create(f && f.prototype, { constructor: { value: d, writable: !0, configurable: !0 } }), Object.defineProperty(d, "prototype", { writable: !1 }), f && N(d, f);
893
894
  }
894
- function R(d, f) {
895
- return R = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, u) {
895
+ function N(d, f) {
896
+ return N = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, u) {
896
897
  return m.__proto__ = u, m;
897
- }, R(d, f);
898
+ }, N(d, f);
898
899
  }
899
900
  function j(d, f, m) {
900
901
  return (f = P(f)) in d ? Object.defineProperty(d, f, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : d[f] = m, d;
@@ -966,17 +967,17 @@ function rt() {
966
967
  clickOutsideDeactivates: !1
967
968
  };
968
969
  var T = m.focusTrapOptions;
969
- for (var O in T)
970
- if (Object.prototype.hasOwnProperty.call(T, O)) {
971
- if (O === "returnFocusOnDeactivate" || O === "onDeactivate" || O === "onPostDeactivate" || O === "checkCanReturnFocus" || O === "clickOutsideDeactivates") {
972
- u.originalOptions[O] = T[O];
970
+ for (var k in T)
971
+ if (Object.prototype.hasOwnProperty.call(T, k)) {
972
+ if (k === "returnFocusOnDeactivate" || k === "onDeactivate" || k === "onPostDeactivate" || k === "checkCanReturnFocus" || k === "clickOutsideDeactivates") {
973
+ u.originalOptions[k] = T[k];
973
974
  continue;
974
975
  }
975
- u.internalOptions[O] = T[O];
976
+ u.internalOptions[k] = T[k];
976
977
  }
977
978
  return u.outsideClick = null, u.focusTrapElements = m.containerElements || [], u.updatePreviousElement(), u;
978
979
  }
979
- return D(f, d), l(f, [{
980
+ return E(f, d), l(f, [{
980
981
  key: "getDocument",
981
982
  value: function() {
982
983
  return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
@@ -1066,8 +1067,8 @@ function rt() {
1066
1067
  value: function(u) {
1067
1068
  if (this.focusTrap) {
1068
1069
  u.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
1069
- var T = !u.active && this.props.active, O = u.active && !this.props.active, b = !u.paused && this.props.paused, i = u.paused && !this.props.paused;
1070
- if (T && (this.updatePreviousElement(), this.focusTrap.activate()), O) {
1070
+ var T = !u.active && this.props.active, k = u.active && !this.props.active, b = !u.paused && this.props.paused, i = u.paused && !this.props.paused;
1071
+ if (T && (this.updatePreviousElement(), this.focusTrap.activate()), k) {
1071
1072
  this.deactivateTrap();
1072
1073
  return;
1073
1074
  }
@@ -1087,11 +1088,11 @@ function rt() {
1087
1088
  if (T) {
1088
1089
  if (T.type && T.type === _.Fragment)
1089
1090
  throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
1090
- var O = function(r) {
1091
+ var k = function(r) {
1091
1092
  var c = u.props.containerElements;
1092
1093
  T && (Y >= 19 ? typeof T.props.ref == "function" ? T.props.ref(r) : T.props.ref && (T.props.ref.current = r) : typeof T.ref == "function" ? T.ref(r) : T.ref && (T.ref.current = r)), u.focusTrapElements = c || [r];
1093
1094
  }, b = _.cloneElement(T, {
1094
- ref: O
1095
+ ref: k
1095
1096
  });
1096
1097
  return b;
1097
1098
  }
@@ -8,8 +8,8 @@ export declare function useFetcher<Type = Response>(handler?: (response: Respons
8
8
  };
9
9
  export declare function useJsonFetcher<Type = unknown>(handler?: (json: unknown) => PromiseOrValue<Type | undefined>): {
10
10
  isLoading: boolean;
11
- fetch: (url: string, options?: RequestInit) => Promise<Type | undefined>;
12
- response: Type | undefined;
11
+ fetch: (url: string, options?: RequestInit) => Promise<Type | null | undefined>;
12
+ response: Type | null | undefined;
13
13
  error: Error | undefined;
14
14
  };
15
15
  export type FetchParameters = {
@@ -28,7 +28,7 @@ export default function useFetch<Type>(url?: string, options?: RequestInit, hand
28
28
  export declare function useJsonFetch<Type = unknown>(url?: string, options?: RequestInit, handler?: (json: unknown) => PromiseOrValue<Type | undefined>, parameters?: FetchParameters): {
29
29
  isReady: boolean;
30
30
  isLoading: boolean;
31
- response: Type | undefined;
31
+ response: Type | null | undefined;
32
32
  error: Error | undefined;
33
33
  purge: () => void;
34
34
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),U=require("./use-is-document-focused.js"),h=new Map,M=new Map,D=new Map,y=new Map,E=new Map;function L(e){return D.get(e)??0}function _(e,s){let t=y.get(e);return t||(t=new Set,y.set(e,t)),t.add(s),()=>{t==null||t.delete(s),t&&t.size===0&&y.delete(e)}}function z(e,s){M.set(e,{timestamp:Date.now(),response:s});const t=y.get(e);if(t)for(const r of t)r(s)}function B(e,s){let t=E.get(e);return t||(t=new Set,E.set(e,t)),t.add(s),()=>{t==null||t.delete(s),t&&t.size===0&&E.delete(e)}}function G(e){D.set(e,L(e)+1),M.delete(e),h.delete(e),queueMicrotask(()=>{const s=E.get(e);if(s)for(const t of s)t()})}function H(...e){for(const s of new Set([...M.keys(),...E.keys(),...h.keys()])){const{url:t}=JSON.parse(s);e.some(r=>typeof r=="function"?r(t):r===t)&&G(s)}}function O(e){const[s,t]=o.useState(!1),[r,g]=o.useState(),[f,d]=o.useState(),p=o.useCallback(async(b,F)=>{try{d(void 0),t(!0);const l=await fetch(b,F),a=e?await e(l):l;return g(a),a}catch(l){const a=l instanceof Error?l:new Error("Unknown error");throw d(a),a}finally{t(!1)}},[e]);return o.useMemo(()=>({isLoading:s,fetch:p,response:r,error:f}),[s,p,r,f])}function N(e){const s=o.useCallback(async t=>{const r=await t.json();return e?e(r):r},[e]);return O(s)}function T(e,s,t,r){const{cacheLifetime:g=1e3*30,shouldFetch:f=!0}=r??{},[d,p]=o.useState(0),[b,F]=o.useState(()=>!!e),[l,a]=o.useState(()=>!!e&&f),n=o.useMemo(()=>e?JSON.stringify({url:e,options:s}):"",[e,s]),v=o.useCallback(()=>{if(!n)return;const c=M.get(n);if(c){if(Date.now()-c.timestamp>g){M.delete(n);return}return c.response}},[n,g]),[J,m]=o.useState(()=>v()),[j,w]=o.useState(),u=o.useMemo(()=>{var c;return((c=s==null?void 0:s.method)==null?void 0:c.toUpperCase())??"GET"},[s])==="GET",k=U.default(u);o.useEffect(()=>{u&&k&&p(c=>c+1)},[u,k]),o.useEffect(()=>{if(!e||!n){F(!1),m(void 0);return}const c=v();F(!0),c===void 0?(m(void 0),w(void 0)):(m(c),w(void 0));const C=_(n,S=>{m(S),w(void 0)});return()=>{C()}},[e,n,v]),o.useEffect(()=>{if(!e||!n||!u)return;const c=B(n,()=>{p(C=>C+1)});return()=>{c()}},[e,n,u]),o.useEffect(()=>{if(!e||!n||d<0||!f){a(!1);return}if(u&&v()!==void 0){a(!1);return}let c=!0;const C=L(n),S=()=>L(n)===C;w(void 0),a(!0);let q=u&&h.has(n)?h.get(n):void 0;if(!q){const i=fetch(e,s);u&&(h.set(n,i),i.finally(()=>{h.get(n)===i&&h.delete(n)})),q=i}return q.then(async i=>{if(c){const R=t?await t(i):i;if(!S())return;u&&z(n,R),m(R),w(void 0)}}).catch(i=>{c&&S()&&w(i)}).finally(()=>{c&&S()&&a(!1)}),()=>{c=!1}},[e,n,d,f,u,v,s,t]);const I=o.useCallback(()=>{u&&n&&G(n)},[u,n]);return o.useMemo(()=>({isReady:b,isLoading:l,response:J,error:j,purge:I}),[b,l,J,j,I])}function P(e,s,t,r){const g=o.useCallback(async f=>{const d=await f.clone().json();return t?t(d):d},[t]);return T(e,s,g,r)}exports.default=T;exports.purgeCache=H;exports.useFetcher=O;exports.useJsonFetch=P;exports.useJsonFetcher=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),P=require("./use-is-document-focused.js"),h=new Map,M=new Map,j=new Map,F=new Map,E=new Map;function J(e){return j.get(e)??0}function U(e,s){let t=F.get(e);return t||(t=new Set,F.set(e,t)),t.add(s),()=>{t==null||t.delete(s),t&&t.size===0&&F.delete(e)}}function _(e,s){M.set(e,{timestamp:Date.now(),response:s});const t=F.get(e);if(t)for(const r of t)r(s)}function $(e,s){let t=E.get(e);return t||(t=new Set,E.set(e,t)),t.add(s),()=>{t==null||t.delete(s),t&&t.size===0&&E.delete(e)}}function D(e){j.set(e,J(e)+1),M.delete(e),h.delete(e),queueMicrotask(()=>{const s=E.get(e);if(s)for(const t of s)t()})}function z(...e){for(const s of new Set([...M.keys(),...E.keys(),...h.keys()])){const{url:t}=JSON.parse(s);e.some(r=>typeof r=="function"?r(t):r===t)&&D(s)}}async function G(e,s){if(!e.ok)throw new Error(`HTTP ${e.status}`);if(e.status===204)return null;const t=await e.clone().json();return s?s(t):t}function H(e){const[s,t]=o.useState(!1),[r,l]=o.useState(),[f,w]=o.useState(),p=o.useCallback(async(b,y)=>{try{w(void 0),t(!0);const d=await fetch(b,y),a=e?await e(d):d;return l(a),a}catch(d){const a=d instanceof Error?d:new Error("Unknown error");throw w(a),l(void 0),a}finally{t(!1)}},[e]);return o.useMemo(()=>({isLoading:s,fetch:p,response:r,error:f}),[s,p,r,f])}function B(e){const s=o.useCallback(async t=>G(t,e),[e]);return H(s)}function O(e,s,t,r){const{cacheLifetime:l=1e3*30,shouldFetch:f=!0}=r??{},[w,p]=o.useState(0),[b,y]=o.useState(()=>!!e),[d,a]=o.useState(()=>!!e&&f),n=o.useMemo(()=>e?JSON.stringify({url:e,options:s}):"",[e,s]),m=o.useCallback(()=>{if(!n)return;const c=M.get(n);if(c){if(Date.now()-c.timestamp>l){M.delete(n);return}return c.response}},[n,l]),[L,g]=o.useState(()=>m()),[k,v]=o.useState(),u=o.useMemo(()=>{var c;return((c=s==null?void 0:s.method)==null?void 0:c.toUpperCase())??"GET"},[s])==="GET",R=P.default(u);o.useEffect(()=>{u&&R&&p(c=>c+1)},[u,R]),o.useEffect(()=>{if(!e||!n){y(!1),g(void 0);return}const c=m();y(!0),c===void 0?(g(void 0),v(void 0)):(g(c),v(void 0));const C=U(n,S=>{g(S),v(void 0)});return()=>{C()}},[e,n,m]),o.useEffect(()=>{if(!e||!n||!u)return;const c=$(n,()=>{p(C=>C+1)});return()=>{c()}},[e,n,u]),o.useEffect(()=>{if(!e||!n||w<0||!f){a(!1);return}if(u&&m()!==void 0){a(!1);return}let c=!0;const C=J(n),S=()=>J(n)===C;v(void 0),a(!0);let q=u&&h.has(n)?h.get(n):void 0;if(!q){const i=fetch(e,s);u&&(h.set(n,i),i.finally(()=>{h.get(n)===i&&h.delete(n)})),q=i}return q.then(async i=>{if(c){const T=t?await t(i):i;if(!S())return;u&&_(n,T),g(T),v(void 0)}}).catch(i=>{c&&S()&&(v(i),g(void 0))}).finally(()=>{c&&S()&&a(!1)}),()=>{c=!1}},[e,n,w,f,u,m,s,t]);const I=o.useCallback(()=>{u&&n&&D(n)},[u,n]);return o.useMemo(()=>({isReady:b,isLoading:d,response:L,error:k,purge:I}),[b,d,L,k,I])}function N(e,s,t,r){const l=o.useCallback(async f=>G(f,t),[t]);return O(e,s,l,r)}exports.default=O;exports.purgeCache=z;exports.useFetcher=H;exports.useJsonFetch=N;exports.useJsonFetcher=B;