@okam/stack-ui 1.32.2 → 1.32.3

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 (176) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +1 -1
  3. package/index.mjs +145 -144
  4. package/index101.js +1 -1
  5. package/index101.mjs +1 -1
  6. package/index102.js +1 -1
  7. package/index102.mjs +3 -3
  8. package/index103.js +1 -1
  9. package/index103.mjs +1 -1
  10. package/index110.js +1 -1
  11. package/index110.mjs +5 -5
  12. package/index111.js +1 -1
  13. package/index111.mjs +2 -2
  14. package/index112.js +1 -1
  15. package/index112.mjs +1 -1
  16. package/index113.js +1 -1
  17. package/index113.mjs +2 -2
  18. package/index115.js +1 -1
  19. package/index115.mjs +4 -4
  20. package/index116.js +1 -1
  21. package/index116.mjs +2 -2
  22. package/index120.js +1 -1
  23. package/index120.mjs +4 -4
  24. package/index121.js +1 -1
  25. package/index121.mjs +2 -2
  26. package/index125.js +1 -1
  27. package/index125.mjs +2 -2
  28. package/index126.js +1 -1
  29. package/index126.mjs +3 -3
  30. package/index130.js +1 -1
  31. package/index130.mjs +2 -2
  32. package/index133.js +1 -1
  33. package/index133.mjs +1 -1
  34. package/index139.js +1 -1
  35. package/index139.mjs +52 -46
  36. package/index140.js +1 -1
  37. package/index140.mjs +46 -241
  38. package/index141.js +1 -2
  39. package/index141.mjs +241 -13
  40. package/index142.js +2 -1
  41. package/index142.mjs +12 -29
  42. package/index143.js +1 -1
  43. package/index143.mjs +30 -52
  44. package/index144.js +1 -1
  45. package/index144.mjs +1 -1
  46. package/index145.js +1 -1
  47. package/index145.mjs +5 -5
  48. package/index146.js +1 -1
  49. package/index146.mjs +3 -3
  50. package/index147.js +1 -1
  51. package/index147.mjs +2 -2
  52. package/index148.js +1 -1
  53. package/index148.mjs +3 -3
  54. package/index149.js +1 -1
  55. package/index149.mjs +3 -3
  56. package/index151.js +1 -1
  57. package/index151.mjs +2 -2
  58. package/index152.js +1 -1
  59. package/index152.mjs +106 -20
  60. package/index153.js +1 -1
  61. package/index153.mjs +83 -107
  62. package/index154.js +1 -1
  63. package/index154.mjs +26 -83
  64. package/index155.js +1 -1
  65. package/index155.mjs +20 -25
  66. package/index156.js +1 -1
  67. package/index156.mjs +17 -123
  68. package/index157.js +1 -1
  69. package/index157.mjs +122 -24
  70. package/index158.js +1 -1
  71. package/index158.mjs +71 -17
  72. package/index159.js +1 -1
  73. package/index159.mjs +338 -62
  74. package/index160.js +1 -1
  75. package/index160.mjs +42 -346
  76. package/index161.js +1 -1
  77. package/index161.mjs +29 -43
  78. package/index162.js +1 -1
  79. package/index162.mjs +24 -28
  80. package/index164.js +1 -1
  81. package/index164.mjs +2 -2
  82. package/index167.js +1 -1
  83. package/index167.mjs +3 -3
  84. package/index169.js +1 -1
  85. package/index169.mjs +1 -1
  86. package/index170.js +1 -1
  87. package/index170.mjs +1 -1
  88. package/index171.js +1 -1
  89. package/index171.mjs +1 -1
  90. package/index173.js +1 -1
  91. package/index173.mjs +1 -1
  92. package/index175.js +1 -1
  93. package/index175.mjs +1 -1
  94. package/index176.js +1 -1
  95. package/index176.mjs +1 -1
  96. package/index178.js +1 -1
  97. package/index178.mjs +2 -2
  98. package/index179.js +1 -1
  99. package/index179.mjs +1 -1
  100. package/index180.js +1 -1
  101. package/index180.mjs +2 -2
  102. package/index182.js +1 -1
  103. package/index182.mjs +1 -1
  104. package/index198.js +1 -1
  105. package/index198.mjs +2 -2
  106. package/index199.js +1 -1
  107. package/index199.mjs +1 -1
  108. package/index200.js +1 -1
  109. package/index200.mjs +3 -3
  110. package/index204.js +1 -1
  111. package/index204.mjs +2 -2
  112. package/index205.js +1 -1
  113. package/index205.mjs +1 -1
  114. package/index314.js +1 -1
  115. package/index314.mjs +20 -136
  116. package/index315.js +1 -1
  117. package/index315.mjs +39 -189
  118. package/index316.js +1 -1
  119. package/index316.mjs +5 -22
  120. package/index317.js +1 -1
  121. package/index317.mjs +6 -29
  122. package/index318.js +1 -1
  123. package/index318.mjs +14 -46
  124. package/index319.js +1 -1
  125. package/index319.mjs +23 -47
  126. package/index320.js +1 -1
  127. package/index320.mjs +25 -97
  128. package/index321.js +1 -1
  129. package/index321.mjs +30 -4
  130. package/index322.js +1 -1
  131. package/index322.mjs +29 -72
  132. package/index323.js +1 -1
  133. package/index323.mjs +8 -57
  134. package/index324.js +1 -1
  135. package/index324.mjs +5 -7
  136. package/index325.js +1 -1
  137. package/index325.mjs +7 -11
  138. package/index326.js +1 -1
  139. package/index326.mjs +13 -47
  140. package/index327.js +1 -1
  141. package/index327.mjs +8 -24
  142. package/index328.js +1 -1
  143. package/index328.mjs +141 -6
  144. package/index329.js +1 -1
  145. package/index329.mjs +197 -14
  146. package/index330.js +1 -1
  147. package/index330.mjs +22 -24
  148. package/index331.js +1 -1
  149. package/index331.mjs +44 -26
  150. package/index332.js +1 -1
  151. package/index332.mjs +46 -29
  152. package/index333.js +1 -1
  153. package/index333.mjs +99 -8
  154. package/index334.js +1 -1
  155. package/index334.mjs +72 -6
  156. package/index335.js +1 -1
  157. package/index335.mjs +58 -7
  158. package/index336.js +1 -1
  159. package/index336.mjs +7 -13
  160. package/index337.js +1 -1
  161. package/index337.mjs +11 -8
  162. package/index338.js +1 -1
  163. package/index338.mjs +7 -4
  164. package/index339.js +1 -1
  165. package/index339.mjs +68 -6
  166. package/index340.js +1 -1
  167. package/index340.mjs +27 -65
  168. package/index341.js +1 -1
  169. package/index341.mjs +6 -30
  170. package/index342.js +1 -1
  171. package/index342.mjs +6 -6
  172. package/index343.js +1 -1
  173. package/index343.mjs +20 -6
  174. package/index344.js +1 -1
  175. package/index344.mjs +3 -20
  176. package/package.json +1 -1
package/index321.mjs CHANGED
@@ -1,8 +1,34 @@
1
- function o(...f) {
2
- return (...c) => {
3
- for (let e of f) typeof e == "function" && e(...c);
1
+ import { useRef as c, useCallback as f, useEffect as b } from "react";
2
+ function L() {
3
+ let n = c(/* @__PURE__ */ new Map()), u = f((r, l, e, t) => {
4
+ let o = t != null && t.once ? (...s) => {
5
+ n.current.delete(e), e(...s);
6
+ } : e;
7
+ n.current.set(e, {
8
+ type: l,
9
+ eventTarget: r,
10
+ fn: o,
11
+ options: t
12
+ }), r.addEventListener(l, e, t);
13
+ }, []), a = f((r, l, e, t) => {
14
+ var o;
15
+ let s = ((o = n.current.get(e)) === null || o === void 0 ? void 0 : o.fn) || e;
16
+ r.removeEventListener(l, s, t), n.current.delete(e);
17
+ }, []), d = f(() => {
18
+ n.current.forEach((r, l) => {
19
+ a(r.eventTarget, r.type, l, r.options);
20
+ });
21
+ }, [
22
+ a
23
+ ]);
24
+ return b(() => d, [
25
+ d
26
+ ]), {
27
+ addGlobalListener: u,
28
+ removeGlobalListener: a,
29
+ removeAllGlobalListeners: d
4
30
  };
5
31
  }
6
32
  export {
7
- o as chain
33
+ L as useGlobalListeners
8
34
  };
package/index322.js CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index382.js"),r=require("./index383.js"),t=require("./index384.js"),s=require("./index385.js"),u=require("./index386.js"),n=require("./index387.js"),i=require("./index388.js"),o=require("./index389.js"),c=require("./index390.js"),q=require("./index391.js"),R=require("./index392.js"),l=require("./index393.js"),E=require("./index394.js"),S=require("./index395.js"),h=require("./index396.js"),L=require("./index397.js"),T=require("./index398.js"),a=require("./index399.js"),I=require("./index400.js"),P=require("./index401.js"),U=require("./index402.js"),d=require("./index403.js"),f=require("./index404.js"),p=require("./index405.js"),k=require("./index406.js"),K=require("./index407.js"),N=require("./index408.js"),b=require("./index409.js"),v=require("./index410.js"),z=require("./index411.js"),A=require("./index412.js"),B=require("./index413.js"),C=require("./index414.js"),D=require("./index415.js");exports.default={};exports.default={"ar-AE":e,"bg-BG":r,"cs-CZ":t,"da-DK":s,"de-DE":u,"el-GR":n,"en-US":i,"es-ES":o,"et-EE":c,"fi-FI":q,"fr-FR":R,"he-IL":l,"hr-HR":E,"hu-HU":S,"it-IT":h,"ja-JP":L,"ko-KR":T,"lt-LT":a,"lv-LV":I,"nb-NO":P,"nl-NL":U,"pl-PL":d,"pt-BR":f,"pt-PT":p,"ro-RO":k,"ru-RU":K,"sk-SK":N,"sl-SI":b,"sr-SP":v,"sv-SE":z,"tr-TR":A,"uk-UA":B,"zh-CN":C,"zh-TW":D};module.exports=exports.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function u(){return typeof window.ResizeObserver<"u"}function b(i){const{ref:e,box:s,onResize:r}=i;d.useEffect(()=>{let n=e==null?void 0:e.current;if(n)if(u()){const t=new window.ResizeObserver(o=>{o.length&&r()});return t.observe(n,{box:s}),()=>{n&&t.unobserve(n)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[r,e,s])}exports.useResizeObserver=b;
package/index322.mjs CHANGED
@@ -1,74 +1,31 @@
1
- import r from "./index382.mjs";
2
- import o from "./index383.mjs";
3
- import f from "./index384.mjs";
4
- import t from "./index385.mjs";
5
- import p from "./index386.mjs";
6
- import $ from "./index387.mjs";
7
- import e from "./index388.mjs";
8
- import m from "./index389.mjs";
9
- import s from "./index390.mjs";
10
- import d from "./index391.mjs";
11
- import c from "./index392.mjs";
12
- import i from "./index393.mjs";
13
- import x from "./index394.mjs";
14
- import a from "./index395.mjs";
15
- import b from "./index396.mjs";
16
- import R from "./index397.mjs";
17
- import l from "./index398.mjs";
18
- import E from "./index399.mjs";
19
- import S from "./index400.mjs";
20
- import h from "./index401.mjs";
21
- import L from "./index402.mjs";
22
- import T from "./index403.mjs";
23
- import u from "./index404.mjs";
24
- import I from "./index405.mjs";
25
- import P from "./index406.mjs";
26
- import U from "./index407.mjs";
27
- import k from "./index408.mjs";
28
- import n from "./index409.mjs";
29
- import v from "./index410.mjs";
30
- import K from "./index411.mjs";
31
- import N from "./index412.mjs";
32
- import z from "./index413.mjs";
33
- import A from "./index414.mjs";
34
- import B from "./index415.mjs";
35
- var C = {};
36
- C = {
37
- "ar-AE": r,
38
- "bg-BG": o,
39
- "cs-CZ": f,
40
- "da-DK": t,
41
- "de-DE": p,
42
- "el-GR": $,
43
- "en-US": e,
44
- "es-ES": m,
45
- "et-EE": s,
46
- "fi-FI": d,
47
- "fr-FR": c,
48
- "he-IL": i,
49
- "hr-HR": x,
50
- "hu-HU": a,
51
- "it-IT": b,
52
- "ja-JP": R,
53
- "ko-KR": l,
54
- "lt-LT": E,
55
- "lv-LV": S,
56
- "nb-NO": h,
57
- "nl-NL": L,
58
- "pl-PL": T,
59
- "pt-BR": u,
60
- "pt-PT": I,
61
- "ro-RO": P,
62
- "ru-RU": U,
63
- "sk-SK": k,
64
- "sl-SI": n,
65
- "sr-SP": v,
66
- "sv-SE": K,
67
- "tr-TR": N,
68
- "uk-UA": z,
69
- "zh-CN": A,
70
- "zh-TW": B
71
- };
1
+ import { useEffect as d } from "react";
2
+ function f() {
3
+ return typeof window.ResizeObserver < "u";
4
+ }
5
+ function u(o) {
6
+ const { ref: e, box: s, onResize: r } = o;
7
+ d(() => {
8
+ let n = e == null ? void 0 : e.current;
9
+ if (n)
10
+ if (f()) {
11
+ const i = new window.ResizeObserver((t) => {
12
+ t.length && r();
13
+ });
14
+ return i.observe(n, {
15
+ box: s
16
+ }), () => {
17
+ n && i.unobserve(n);
18
+ };
19
+ } else
20
+ return window.addEventListener("resize", r, !1), () => {
21
+ window.removeEventListener("resize", r, !1);
22
+ };
23
+ }, [
24
+ r,
25
+ e,
26
+ s
27
+ ]);
28
+ }
72
29
  export {
73
- C as default
30
+ u as useResizeObserver
74
31
  };
package/index323.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let o=new WeakMap,n=[];function h(b,c=document.body){let i=new Set(b),a=new Set,u=t=>{for(let l of t.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))i.add(l);let r=l=>{if(i.has(l)||l.parentElement&&a.has(l.parentElement)&&l.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let p of i)if(l.contains(p))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},e=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r}),E=r(t);if(E===NodeFilter.FILTER_ACCEPT&&f(t),E!==NodeFilter.FILTER_REJECT){let l=e.nextNode();for(;l!=null;)f(l),l=e.nextNode()}},f=t=>{var r;let e=(r=o.get(t))!==null&&r!==void 0?r:0;t.getAttribute("aria-hidden")==="true"&&e===0||(e===0&&t.setAttribute("aria-hidden","true"),a.add(t),o.set(t,e+1))};n.length&&n[n.length-1].disconnect(),u(c);let d=new MutationObserver(t=>{for(let r of t)if(!(r.type!=="childList"||r.addedNodes.length===0)&&![...i,...a].some(e=>e.contains(r.target))){for(let e of r.removedNodes)e instanceof Element&&(i.delete(e),a.delete(e));for(let e of r.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&(e.dataset.liveAnnouncer==="true"||e.dataset.reactAriaTopLayer==="true")?i.add(e):e instanceof Element&&u(e)}});d.observe(c,{childList:!0,subtree:!0});let s={observe(){d.observe(c,{childList:!0,subtree:!0})},disconnect(){d.disconnect()}};return n.push(s),()=>{d.disconnect();for(let t of a){let r=o.get(t);r!=null&&(r===1?(t.removeAttribute("aria-hidden"),o.delete(t)):o.set(t,r-1))}s===n[n.length-1]?(n.pop(),n.length&&n[n.length-1].observe()):n.splice(n.indexOf(s),1)}}exports.ariaHideOutside=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index172.js");function f(e,r){u.useLayoutEffect(()=>{if(e&&e.ref&&r)return e.ref.current=r.current,()=>{e.ref&&(e.ref.current=null)}})}exports.useSyncRef=f;
package/index323.mjs CHANGED
@@ -1,61 +1,12 @@
1
- let o = /* @__PURE__ */ new WeakMap(), n = [];
2
- function b(p, c = document.body) {
3
- let i = new Set(p), a = /* @__PURE__ */ new Set(), f = (t) => {
4
- for (let l of t.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]")) i.add(l);
5
- let r = (l) => {
6
- if (i.has(l) || l.parentElement && a.has(l.parentElement) && l.parentElement.getAttribute("role") !== "row") return NodeFilter.FILTER_REJECT;
7
- for (let h of i)
8
- if (l.contains(h)) return NodeFilter.FILTER_SKIP;
9
- return NodeFilter.FILTER_ACCEPT;
10
- }, e = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
11
- acceptNode: r
12
- }), E = r(t);
13
- if (E === NodeFilter.FILTER_ACCEPT && u(t), E !== NodeFilter.FILTER_REJECT) {
14
- let l = e.nextNode();
15
- for (; l != null; )
16
- u(l), l = e.nextNode();
17
- }
18
- }, u = (t) => {
19
- var r;
20
- let e = (r = o.get(t)) !== null && r !== void 0 ? r : 0;
21
- t.getAttribute("aria-hidden") === "true" && e === 0 || (e === 0 && t.setAttribute("aria-hidden", "true"), a.add(t), o.set(t, e + 1));
22
- };
23
- n.length && n[n.length - 1].disconnect(), f(c);
24
- let d = new MutationObserver((t) => {
25
- for (let r of t)
26
- if (!(r.type !== "childList" || r.addedNodes.length === 0) && ![
27
- ...i,
28
- ...a
29
- ].some((e) => e.contains(r.target))) {
30
- for (let e of r.removedNodes) e instanceof Element && (i.delete(e), a.delete(e));
31
- for (let e of r.addedNodes)
32
- (e instanceof HTMLElement || e instanceof SVGElement) && (e.dataset.liveAnnouncer === "true" || e.dataset.reactAriaTopLayer === "true") ? i.add(e) : e instanceof Element && f(e);
33
- }
1
+ import { useLayoutEffect as f } from "./index172.mjs";
2
+ function u(r, e) {
3
+ f(() => {
4
+ if (r && r.ref && e)
5
+ return r.ref.current = e.current, () => {
6
+ r.ref && (r.ref.current = null);
7
+ };
34
8
  });
35
- d.observe(c, {
36
- childList: !0,
37
- subtree: !0
38
- });
39
- let s = {
40
- observe() {
41
- d.observe(c, {
42
- childList: !0,
43
- subtree: !0
44
- });
45
- },
46
- disconnect() {
47
- d.disconnect();
48
- }
49
- };
50
- return n.push(s), () => {
51
- d.disconnect();
52
- for (let t of a) {
53
- let r = o.get(t);
54
- r != null && (r === 1 ? (t.removeAttribute("aria-hidden"), o.delete(t)) : o.set(t, r - 1));
55
- }
56
- s === n[n.length - 1] ? (n.pop(), n.length && n[n.length - 1].observe()) : n.splice(n.indexOf(s), 1);
57
- };
58
9
  }
59
10
  export {
60
- b as ariaHideOutside
11
+ u as useSyncRef
61
12
  };
package/index324.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),o=t.createContext({});function r(){var e;return(e=t.useContext(o))!==null&&e!==void 0?e:{}}exports.PortalContext=o;exports.useUNSTABLE_PortalContext=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e,r){if(!e)return!1;let l=window.getComputedStyle(e),t=/(auto|scroll)/.test(l.overflow+l.overflowX+l.overflowY);return t&&r&&(t=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),t}exports.isScrollable=i;
package/index324.mjs CHANGED
@@ -1,10 +1,8 @@
1
- import { useContext as e, createContext as o } from "react";
2
- const r = /* @__PURE__ */ o({});
3
- function a() {
4
- var t;
5
- return (t = e(r)) !== null && t !== void 0 ? t : {};
1
+ function c(l, r) {
2
+ if (!l) return !1;
3
+ let t = window.getComputedStyle(l), e = /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
4
+ return e && r && (e = l.scrollHeight !== l.clientHeight || l.scrollWidth !== l.clientWidth), e;
6
5
  }
7
6
  export {
8
- r as PortalContext,
9
- a as useUNSTABLE_PortalContext
7
+ c as isScrollable
10
8
  };
package/index325.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index339.js"),e=require("react");function n({children:r}){let t=e.useMemo(()=>({register:()=>{}}),[]);return e.createElement(o.PressResponderContext.Provider,{value:t},r)}exports.ClearPressResponder=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index324.js");function r(e,c){const t=[];for(;e&&e!==document.documentElement;)l.isScrollable(e,c)&&t.push(e),e=e.parentElement;return t}exports.getScrollParents=r;
package/index325.mjs CHANGED
@@ -1,14 +1,10 @@
1
- import { PressResponderContext as t } from "./index339.mjs";
2
- import a, { useMemo as o } from "react";
3
- function n({ children: e }) {
4
- let r = o(() => ({
5
- register: () => {
6
- }
7
- }), []);
8
- return /* @__PURE__ */ a.createElement(t.Provider, {
9
- value: r
10
- }, e);
1
+ import { isScrollable as r } from "./index324.mjs";
2
+ function s(e, t) {
3
+ const c = [];
4
+ for (; e && e !== document.documentElement; )
5
+ r(e, t) && c.push(e), e = e.parentElement;
6
+ return c;
11
7
  }
12
8
  export {
13
- n as ClearPressResponder
9
+ s as getScrollParents
14
10
  };
package/index326.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),u={prefix:String(Math.round(Math.random()*1e10)),current:0},d=e.createContext(u),l=e.createContext(!1);let f=!!(typeof window<"u"&&window.document&&window.document.createElement),s=new WeakMap;function v(r=!1){let t=e.useContext(d),n=e.useRef(null);if(n.current===null&&!r){var a,c;let o=(c=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||c===void 0||(a=c.ReactCurrentOwner)===null||a===void 0?void 0:a.current;if(o){let i=s.get(o);i==null?s.set(o,{id:t.current,state:o.memoizedState}):o.memoizedState!==i.state&&(t.current=i.id,s.delete(o))}n.current=++t.current}return n.current}function S(r){let t=e.useContext(d);t===u&&!f&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=v(!!r),a=t===u&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return r||`${a}-${n}`}function p(r){let t=e.useId(),[n]=e.useState($()),a=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${u.prefix}`;return r||`${a}-${t}`}const b=typeof e.useId=="function"?p:S;function x(){return!1}function m(){return!0}function g(r){return()=>{}}function $(){return typeof e.useSyncExternalStore=="function"?e.useSyncExternalStore(g,x,m):e.useContext(l)}exports.useIsSSR=$;exports.useSSRSafeId=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index172.js"),r=require("react");function o(t){const u=r.useRef(null);return n.useLayoutEffect(()=>{u.current=t},[t]),r.useCallback((...c)=>{const e=u.current;return e==null?void 0:e(...c)},[])}exports.useEffectEvent=o;
package/index326.mjs CHANGED
@@ -1,50 +1,16 @@
1
- import a, { useContext as s, useState as f, useRef as l } from "react";
2
- const c = {
3
- prefix: String(Math.round(Math.random() * 1e10)),
4
- current: 0
5
- }, $ = /* @__PURE__ */ a.createContext(c), p = /* @__PURE__ */ a.createContext(!1);
6
- let v = !!(typeof window < "u" && window.document && window.document.createElement), d = /* @__PURE__ */ new WeakMap();
7
- function S(t = !1) {
8
- let e = s($), r = l(null);
9
- if (r.current === null && !t) {
10
- var n, u;
11
- let o = (u = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || u === void 0 || (n = u.ReactCurrentOwner) === null || n === void 0 ? void 0 : n.current;
12
- if (o) {
13
- let i = d.get(o);
14
- i == null ? d.set(o, {
15
- id: e.current,
16
- state: o.memoizedState
17
- }) : o.memoizedState !== i.state && (e.current = i.id, d.delete(o));
18
- }
19
- r.current = ++e.current;
20
- }
21
- return r.current;
22
- }
23
- function b(t) {
24
- let e = s($);
25
- e === c && !v && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
26
- let r = S(!!t), n = e === c && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${e.prefix}`;
27
- return t || `${n}-${r}`;
28
- }
29
- function x(t) {
30
- let e = a.useId(), [r] = f(y()), n = r || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${c.prefix}`;
31
- return t || `${n}-${e}`;
32
- }
33
- const C = typeof a.useId == "function" ? x : b;
34
- function m() {
35
- return !1;
36
- }
37
- function w() {
38
- return !0;
39
- }
40
- function g(t) {
41
- return () => {
42
- };
43
- }
44
- function y() {
45
- return typeof a.useSyncExternalStore == "function" ? a.useSyncExternalStore(g, m, w) : s(p);
1
+ import { useLayoutEffect as f } from "./index172.mjs";
2
+ import { useRef as o, useCallback as a } from "react";
3
+ function s(r) {
4
+ const t = o(null);
5
+ return f(() => {
6
+ t.current = r;
7
+ }, [
8
+ r
9
+ ]), a((...c) => {
10
+ const e = t.current;
11
+ return e == null ? void 0 : e(...c);
12
+ }, []);
46
13
  }
47
14
  export {
48
- y as useIsSSR,
49
- C as useSSRSafeId
15
+ s as useEffectEvent
50
16
  };
package/index327.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index336.js"),a=require("./index172.js"),n=require("react");function o(c){let[u,l]=n.useState(c),e=n.useRef(null),r=f.useEffectEvent(()=>{if(!e.current)return;let t=e.current.next();if(t.done){e.current=null;return}u===t.value?r():l(t.value)});a.useLayoutEffect(()=>{e.current&&r()});let s=f.useEffectEvent(t=>{e.current=t(u),r()});return[u,s]}exports.useValueEffect=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index174.js");function t(r){return r.mozInputSource===0&&r.isTrusted?!0:i.isAndroid()&&r.pointerType?r.type==="click"&&r.buttons===1:r.detail===0&&!r.pointerType}function o(r){return!i.isAndroid()&&r.width===0&&r.height===0||r.width===1&&r.height===1&&r.pressure===0&&r.detail===0&&r.pointerType==="mouse"}exports.isVirtualClick=t;exports.isVirtualPointerEvent=o;
package/index327.mjs CHANGED
@@ -1,27 +1,11 @@
1
- import { useEffectEvent as u } from "./index336.mjs";
2
- import { useLayoutEffect as l } from "./index172.mjs";
3
- import { useState as o, useRef as s } from "react";
4
- function p(a) {
5
- let [f, c] = o(a), e = s(null), r = u(() => {
6
- if (!e.current) return;
7
- let t = e.current.next();
8
- if (t.done) {
9
- e.current = null;
10
- return;
11
- }
12
- f === t.value ? r() : c(t.value);
13
- });
14
- l(() => {
15
- e.current && r();
16
- });
17
- let n = u((t) => {
18
- e.current = t(f), r();
19
- });
20
- return [
21
- f,
22
- n
23
- ];
1
+ import { isAndroid as i } from "./index174.mjs";
2
+ function o(r) {
3
+ return r.mozInputSource === 0 && r.isTrusted ? !0 : i() && r.pointerType ? r.type === "click" && r.buttons === 1 : r.detail === 0 && !r.pointerType;
4
+ }
5
+ function u(r) {
6
+ return !i() && r.width === 0 && r.height === 0 || r.width === 1 && r.height === 1 && r.pressure === 0 && r.detail === 0 && r.pointerType === "mouse";
24
7
  }
25
8
  export {
26
- p as useValueEffect
9
+ o as isVirtualClick,
10
+ u as isVirtualPointerEvent
27
11
  };
package/index328.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=o=>{var n;return(n=o==null?void 0:o.ownerDocument)!==null&&n!==void 0?n:document},e=o=>o&&"window"in o&&o.window===o?o:t(o).defaultView||window;exports.getOwnerDocument=t;exports.getOwnerWindow=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index329.js"),A=require("./index330.js"),f=require("react"),P=require("./index172.js"),j=require("./index322.js"),D=require("@react-aria/i18n");let e=typeof document<"u"?window.visualViewport:null;function G(n){let{direction:h}=D.useLocale(),{arrowSize:$=0,targetRef:v,overlayRef:i,scrollRef:s=i,placement:w="bottom",containerPadding:C=12,shouldFlip:H=!0,boundaryElement:R=typeof document<"u"?document.body:null,offset:S=0,crossOffset:B=0,shouldUpdatePosition:q=!0,isOpen:p=!0,onClose:m,maxHeight:O,arrowBoundaryOffset:T=0}=n,[t,k]=f.useState(null),F=[q,w,i.current,v.current,s.current,C,H,R,S,B,p,h,O,T,$],N=f.useRef(e==null?void 0:e.scale);f.useEffect(()=>{p&&(N.current=e==null?void 0:e.scale)},[p]);let u=f.useCallback(()=>{if(q===!1||!p||!i.current||!v.current||!R||(e==null?void 0:e.scale)!==N.current)return;let o=null;if(s.current&&s.current.contains(document.activeElement)){var a;let r=(a=document.activeElement)===null||a===void 0?void 0:a.getBoundingClientRect(),g=s.current.getBoundingClientRect();var d;if(o={type:"top",offset:((d=r==null?void 0:r.top)!==null&&d!==void 0?d:0)-g.top},o.offset>g.height/2){o.type="bottom";var x;o.offset=((x=r==null?void 0:r.bottom)!==null&&x!==void 0?x:0)-g.bottom}}let l=i.current;if(!O&&i.current){var z;l.style.top="0px",l.style.bottom="";var L;l.style.maxHeight=((L=(z=window.visualViewport)===null||z===void 0?void 0:z.height)!==null&&L!==void 0?L:window.innerHeight)+"px"}let c=M.calculatePosition({placement:K(w,h),overlayNode:i.current,targetNode:v.current,scrollNode:s.current||i.current,padding:C,shouldFlip:H,boundaryElement:R,offset:S,crossOffset:B,maxHeight:O,arrowSize:$,arrowBoundaryOffset:T});if(c.position){if(l.style.top="",l.style.bottom="",l.style.left="",l.style.right="",Object.keys(c.position).forEach(r=>l.style[r]=c.position[r]+"px"),l.style.maxHeight=c.maxHeight!=null?c.maxHeight+"px":"",o&&document.activeElement&&s.current){let r=document.activeElement.getBoundingClientRect(),g=s.current.getBoundingClientRect(),I=r[o.type]-g[o.type];s.current.scrollTop+=I-o.offset}k(c)}},F);P.useLayoutEffect(u,F),J(u),j.useResizeObserver({ref:i,onResize:u}),j.useResizeObserver({ref:v,onResize:u});let y=f.useRef(!1);P.useLayoutEffect(()=>{let o,a=()=>{y.current=!0,clearTimeout(o),o=setTimeout(()=>{y.current=!1},500),u()},d=()=>{y.current&&a()};return e==null||e.addEventListener("resize",a),e==null||e.addEventListener("scroll",d),()=>{e==null||e.removeEventListener("resize",a),e==null||e.removeEventListener("scroll",d)}},[u]);let U=f.useCallback(()=>{y.current||m==null||m()},[m,y]);A.useCloseOnScroll({triggerRef:v,isOpen:p,onClose:m&&U});var b,E;return{overlayProps:{style:{position:"absolute",zIndex:1e5,...t==null?void 0:t.position,maxHeight:(b=t==null?void 0:t.maxHeight)!==null&&b!==void 0?b:"100vh"}},placement:(E=t==null?void 0:t.placement)!==null&&E!==void 0?E:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:t==null?void 0:t.arrowOffsetLeft,top:t==null?void 0:t.arrowOffsetTop}},updatePosition:u}}function J(n){P.useLayoutEffect(()=>(window.addEventListener("resize",n,!1),()=>{window.removeEventListener("resize",n,!1)}),[n])}function K(n,h){return h==="rtl"?n.replace("start","right").replace("end","left"):n.replace("start","left").replace("end","right")}exports.useOverlayPosition=G;
package/index328.mjs CHANGED
@@ -1,8 +1,143 @@
1
- const t = (n) => {
2
- var o;
3
- return (o = n == null ? void 0 : n.ownerDocument) !== null && o !== void 0 ? o : document;
4
- }, d = (n) => n && "window" in n && n.window === n ? n : t(n).defaultView || window;
1
+ import { calculatePosition as D } from "./index329.mjs";
2
+ import { useCloseOnScroll as G } from "./index330.mjs";
3
+ import { useState as J, useRef as U, useEffect as K, useCallback as j } from "react";
4
+ import { useLayoutEffect as z } from "./index172.mjs";
5
+ import { useResizeObserver as k } from "./index322.mjs";
6
+ import { useLocale as M } from "@react-aria/i18n";
7
+ let e = typeof document < "u" ? window.visualViewport : null;
8
+ function te(n) {
9
+ let { direction: y } = M(), { arrowSize: w = 0, targetRef: c, overlayRef: i, scrollRef: s = i, placement: H = "bottom", containerPadding: P = 12, shouldFlip: L = !0, boundaryElement: $ = typeof document < "u" ? document.body : null, offset: C = 0, crossOffset: B = 0, shouldUpdatePosition: S = !0, isOpen: v = !0, onClose: p, maxHeight: b, arrowBoundaryOffset: T = 0 } = n, [t, I] = J(null), F = [
10
+ S,
11
+ H,
12
+ i.current,
13
+ c.current,
14
+ s.current,
15
+ P,
16
+ L,
17
+ $,
18
+ C,
19
+ B,
20
+ v,
21
+ y,
22
+ b,
23
+ T,
24
+ w
25
+ ], N = U(e == null ? void 0 : e.scale);
26
+ K(() => {
27
+ v && (N.current = e == null ? void 0 : e.scale);
28
+ }, [
29
+ v
30
+ ]);
31
+ let a = j(() => {
32
+ if (S === !1 || !v || !i.current || !c.current || !$ || (e == null ? void 0 : e.scale) !== N.current) return;
33
+ let o = null;
34
+ if (s.current && s.current.contains(document.activeElement)) {
35
+ var d;
36
+ let r = (d = document.activeElement) === null || d === void 0 ? void 0 : d.getBoundingClientRect(), g = s.current.getBoundingClientRect();
37
+ var u;
38
+ if (o = {
39
+ type: "top",
40
+ offset: ((u = r == null ? void 0 : r.top) !== null && u !== void 0 ? u : 0) - g.top
41
+ }, o.offset > g.height / 2) {
42
+ o.type = "bottom";
43
+ var R;
44
+ o.offset = ((R = r == null ? void 0 : r.bottom) !== null && R !== void 0 ? R : 0) - g.bottom;
45
+ }
46
+ }
47
+ let l = i.current;
48
+ if (!b && i.current) {
49
+ var O;
50
+ l.style.top = "0px", l.style.bottom = "";
51
+ var E;
52
+ l.style.maxHeight = ((E = (O = window.visualViewport) === null || O === void 0 ? void 0 : O.height) !== null && E !== void 0 ? E : window.innerHeight) + "px";
53
+ }
54
+ let f = D({
55
+ placement: W(H, y),
56
+ overlayNode: i.current,
57
+ targetNode: c.current,
58
+ scrollNode: s.current || i.current,
59
+ padding: P,
60
+ shouldFlip: L,
61
+ boundaryElement: $,
62
+ offset: C,
63
+ crossOffset: B,
64
+ maxHeight: b,
65
+ arrowSize: w,
66
+ arrowBoundaryOffset: T
67
+ });
68
+ if (f.position) {
69
+ if (l.style.top = "", l.style.bottom = "", l.style.left = "", l.style.right = "", Object.keys(f.position).forEach((r) => l.style[r] = f.position[r] + "px"), l.style.maxHeight = f.maxHeight != null ? f.maxHeight + "px" : "", o && document.activeElement && s.current) {
70
+ let r = document.activeElement.getBoundingClientRect(), g = s.current.getBoundingClientRect(), A = r[o.type] - g[o.type];
71
+ s.current.scrollTop += A - o.offset;
72
+ }
73
+ I(f);
74
+ }
75
+ }, F);
76
+ z(a, F), Q(a), k({
77
+ ref: i,
78
+ onResize: a
79
+ }), k({
80
+ ref: c,
81
+ onResize: a
82
+ });
83
+ let m = U(!1);
84
+ z(() => {
85
+ let o, d = () => {
86
+ m.current = !0, clearTimeout(o), o = setTimeout(() => {
87
+ m.current = !1;
88
+ }, 500), a();
89
+ }, u = () => {
90
+ m.current && d();
91
+ };
92
+ return e == null || e.addEventListener("resize", d), e == null || e.addEventListener("scroll", u), () => {
93
+ e == null || e.removeEventListener("resize", d), e == null || e.removeEventListener("scroll", u);
94
+ };
95
+ }, [
96
+ a
97
+ ]);
98
+ let q = j(() => {
99
+ m.current || p == null || p();
100
+ }, [
101
+ p,
102
+ m
103
+ ]);
104
+ G({
105
+ triggerRef: c,
106
+ isOpen: v,
107
+ onClose: p && q
108
+ });
109
+ var h, x;
110
+ return {
111
+ overlayProps: {
112
+ style: {
113
+ position: "absolute",
114
+ zIndex: 1e5,
115
+ ...t == null ? void 0 : t.position,
116
+ maxHeight: (h = t == null ? void 0 : t.maxHeight) !== null && h !== void 0 ? h : "100vh"
117
+ }
118
+ },
119
+ placement: (x = t == null ? void 0 : t.placement) !== null && x !== void 0 ? x : null,
120
+ arrowProps: {
121
+ "aria-hidden": "true",
122
+ role: "presentation",
123
+ style: {
124
+ left: t == null ? void 0 : t.arrowOffsetLeft,
125
+ top: t == null ? void 0 : t.arrowOffsetTop
126
+ }
127
+ },
128
+ updatePosition: a
129
+ };
130
+ }
131
+ function Q(n) {
132
+ z(() => (window.addEventListener("resize", n, !1), () => {
133
+ window.removeEventListener("resize", n, !1);
134
+ }), [
135
+ n
136
+ ]);
137
+ }
138
+ function W(n, y) {
139
+ return y === "rtl" ? n.replace("start", "right").replace("end", "left") : n.replace("start", "left").replace("end", "right");
140
+ }
5
141
  export {
6
- t as getOwnerDocument,
7
- d as getOwnerWindow
142
+ te as useOverlayPosition
8
143
  };
package/index329.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(r){var o,e,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(o=0;o<u;o++)r[o]&&(e=n(r[o]))&&(t&&(t+=" "),t+=e)}else for(e in r)r[e]&&(t&&(t+=" "),t+=e);return t}function f(){for(var r,o,e=0,t="",u=arguments.length;e<u;e++)(r=arguments[e])&&(o=n(r))&&(t&&(t+=" "),t+=o);return t}exports.clsx=f;exports.default=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("./index174.js"),q=require("./index344.js"),x={top:"top",bottom:"top",left:"left",right:"left"},z={top:"bottom",bottom:"top",left:"right",right:"left"},ct={top:"left",left:"top"},j={top:"height",left:"width"},B={width:"totalWidth",height:"totalHeight"},H={};let $=typeof document<"u"?window.visualViewport:null;function G(e){let t=0,o=0,c=0,i=0,r=0,f=0,l={};var v;let p=((v=$==null?void 0:$.scale)!==null&&v!==void 0?v:1)>1;if(e.tagName==="BODY"){let h=document.documentElement;c=h.clientWidth,i=h.clientHeight;var s;t=(s=$==null?void 0:$.width)!==null&&s!==void 0?s:c;var d;o=(d=$==null?void 0:$.height)!==null&&d!==void 0?d:i,l.top=h.scrollTop||e.scrollTop,l.left=h.scrollLeft||e.scrollLeft,$&&(r=$.offsetTop,f=$.offsetLeft)}else({width:t,height:o,top:r,left:f}=M(e)),l.top=e.scrollTop,l.left=e.scrollLeft,c=t,i=o;if(it.isWebKit()&&(e.tagName==="BODY"||e.tagName==="HTML")&&p){l.top=0,l.left=0;var g;r=(g=$==null?void 0:$.pageTop)!==null&&g!==void 0?g:0;var n;f=(n=$==null?void 0:$.pageLeft)!==null&&n!==void 0?n:0}return{width:t,height:o,totalWidth:c,totalHeight:i,scroll:l,top:r,left:f}}function nt(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function K(e,t,o,c,i,r,f){var l;let v=(l=i.scroll[e])!==null&&l!==void 0?l:0,p=c[j[e]],s=c.scroll[x[e]]+r,d=p+c.scroll[x[e]]-r,g=t-v+f[e]-c[x[e]],n=t-v+o+f[e]-c[x[e]];return g<s?s-g:n>d?Math.max(d-n,s-g):0}function rt(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function J(e){if(H[e])return H[e];let[t,o]=e.split(" "),c=x[t]||"right",i=ct[c];x[o]||(o="center");let r=j[c],f=j[i];return H[e]={placement:t,crossPlacement:o,axis:c,crossAxis:i,size:r,crossSize:f},H[e]}function Z(e,t,o,c,i,r,f,l,v,p){let{placement:s,crossPlacement:d,axis:g,crossAxis:n,size:h,crossSize:u}=c,a={};var w;a[n]=(w=e[n])!==null&&w!==void 0?w:0;var m,P,E,T;d==="center"?a[n]+=(((m=e[u])!==null&&m!==void 0?m:0)-((P=o[u])!==null&&P!==void 0?P:0))/2:d!==n&&(a[n]+=((E=e[u])!==null&&E!==void 0?E:0)-((T=o[u])!==null&&T!==void 0?T:0)),a[n]+=r;const _=e[n]-o[u]+v+p,S=e[n]+e[u]-v-p;if(a[n]=q.clamp(a[n],_,S),s===g){const L=l?f[h]:t[B[h]];a[z[g]]=Math.floor(L-e[g]+i)}else a[g]=Math.floor(e[g]+e[h]+i);return a}function at(e,t,o,c,i,r,f,l){const v=c?o.height:t[B.height];var p;let s=e.top!=null?o.top+e.top:o.top+(v-((p=e.bottom)!==null&&p!==void 0?p:0)-f);var d,g,n,h,u,a;let w=l!=="top"?Math.max(0,t.height+t.top+((d=t.scroll.top)!==null&&d!==void 0?d:0)-s-(((g=i.top)!==null&&g!==void 0?g:0)+((n=i.bottom)!==null&&n!==void 0?n:0)+r)):Math.max(0,s+f-(t.top+((h=t.scroll.top)!==null&&h!==void 0?h:0))-(((u=i.top)!==null&&u!==void 0?u:0)+((a=i.bottom)!==null&&a!==void 0?a:0)+r));return Math.min(t.height-r*2,w)}function Q(e,t,o,c,i,r){let{placement:f,axis:l,size:v}=r;var p,s;if(f===l)return Math.max(0,o[l]-e[l]-((p=e.scroll[l])!==null&&p!==void 0?p:0)+t[l]-((s=c[l])!==null&&s!==void 0?s:0)-c[z[l]]-i);var d;return Math.max(0,e[v]+e[l]+e.scroll[l]-t[l]-o[l]-o[v]-((d=c[l])!==null&&d!==void 0?d:0)-c[z[l]]-i)}function V(e,t,o,c,i,r,f,l,v,p,s,d,g,n,h,u){let a=J(e),{size:w,crossAxis:m,crossSize:P,placement:E,crossPlacement:T}=a,_=Z(t,l,o,a,s,d,p,g,h,u),S=s,L=Q(l,p,t,i,r+s,a);if(f&&c[w]>L){let X=J(`${z[E]} ${T}`),ot=Z(t,l,o,X,s,d,p,g,h,u);Q(l,p,t,i,r+s,X)>L&&(a=X,_=ot,S=s)}let b="bottom";a.axis==="top"?a.placement==="top"?b="top":a.placement==="bottom"&&(b="bottom"):a.crossAxis==="top"&&(a.crossPlacement==="top"?b="bottom":a.crossPlacement==="bottom"&&(b="top"));let I=K(m,_[m],o[P],l,v,r,p);_[m]+=I;let C=at(_,l,p,g,i,r,o.height,b);n&&n<C&&(C=n),o.height=Math.min(o.height,C),_=Z(t,l,o,a,S,d,p,g,h,u),I=K(m,_[m],o[P],l,v,r,p),_[m]+=I;let A={},k=t[m]+.5*t[P]-_[m]-i[x[m]];const D=h/2+u;var F,N,R,Y;const O=x[m]==="left"?((F=i.left)!==null&&F!==void 0?F:0)+((N=i.right)!==null&&N!==void 0?N:0):((R=i.top)!==null&&R!==void 0?R:0)+((Y=i.bottom)!==null&&Y!==void 0?Y:0),y=o[P]-O-h/2-u,tt=t[m]+h/2-(_[m]+i[x[m]]),et=t[m]+t[P]-h/2-(_[m]+i[x[m]]),lt=q.clamp(k,tt,et);return A[m]=q.clamp(lt,D,y),{position:_,maxHeight:C,arrowOffsetLeft:A.left,arrowOffsetTop:A.top,placement:a.placement}}function pt(e){let{placement:t,targetNode:o,overlayNode:c,scrollNode:i,padding:r,shouldFlip:f,boundaryElement:l,offset:v,crossOffset:p,maxHeight:s,arrowSize:d=0,arrowBoundaryOffset:g=0}=e,n=c instanceof HTMLElement?st(c):document.documentElement,h=n===document.documentElement;const u=window.getComputedStyle(n).position;let a=!!u&&u!=="static",w=h?M(o):U(o,n);if(!h){let{marginTop:A,marginLeft:k}=window.getComputedStyle(o);w.top+=parseInt(A,10)||0,w.left+=parseInt(k,10)||0}let m=M(c),P=rt(c);var E,T;m.width+=((E=P.left)!==null&&E!==void 0?E:0)+((T=P.right)!==null&&T!==void 0?T:0);var _,S;m.height+=((_=P.top)!==null&&_!==void 0?_:0)+((S=P.bottom)!==null&&S!==void 0?S:0);let L=nt(i),b=G(l),I=G(n),C=l.tagName==="BODY"?M(n):U(n,l);return n.tagName==="HTML"&&l.tagName==="BODY"&&(I.scroll.top=0,I.scroll.left=0),V(t,w,m,L,P,r,f,b,I,C,v,p,a,s,d,g)}function M(e){let{top:t,left:o,width:c,height:i}=e.getBoundingClientRect(),{scrollTop:r,scrollLeft:f,clientTop:l,clientLeft:v}=document.documentElement;return{top:t+r-l,left:o+f-v,width:c,height:i}}function U(e,t){let o=window.getComputedStyle(e),c;if(o.position==="fixed"){let{top:i,left:r,width:f,height:l}=e.getBoundingClientRect();c={top:i,left:r,width:f,height:l}}else{c=M(e);let i=M(t),r=window.getComputedStyle(t);i.top+=(parseInt(r.borderTopWidth,10)||0)-t.scrollTop,i.left+=(parseInt(r.borderLeftWidth,10)||0)-t.scrollLeft,c.top-=i.top,c.left-=i.left}return c.top-=parseInt(o.marginTop,10)||0,c.left-=parseInt(o.marginLeft,10)||0,c}function st(e){let t=e.offsetParent;if(t&&t===document.body&&window.getComputedStyle(t).position==="static"&&!W(t)&&(t=document.documentElement),t==null)for(t=e.parentElement;t&&!W(t);)t=t.parentElement;return t||document.documentElement}function W(e){let t=window.getComputedStyle(e);return t.transform!=="none"||/transform|perspective/.test(t.willChange)||t.filter!=="none"||t.contain==="paint"||"backdropFilter"in t&&t.backdropFilter!=="none"||"WebkitBackdropFilter"in t&&t.WebkitBackdropFilter!=="none"}exports.calculatePosition=pt;exports.calculatePositionInternal=V;