@blockend/widget 1.0.31 → 1.0.32

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 (162) hide show
  1. package/dist/AllRoutes-CPwuTwqd.js +2209 -0
  2. package/dist/Box-CIChapvH.js +55 -0
  3. package/dist/EstGas-CEFILtyf.js +12867 -0
  4. package/dist/Grow-DJZj9zjv.js +1656 -0
  5. package/dist/InputComp-DqF1JGIu.js +106 -0
  6. package/dist/LoadRoute-r3sHTYXM.js +126 -0
  7. package/dist/QuotesProgress-BXVLxZ8U.js +28 -0
  8. package/dist/SwapAsset-07WvVwl-.js +64 -0
  9. package/dist/Tooltip-CNAsCF8n.js +572 -0
  10. package/dist/TxnButton-D2TTkFYA.js +207 -0
  11. package/dist/WidgetForm.module-QHJ0-m5f.js +9 -0
  12. package/dist/{add-B8AfyNIx.js → add-t2GqC9VA.js} +3 -3
  13. package/dist/{all-wallets-BaLLU39i.js → all-wallets-DFyf0q31.js} +3 -3
  14. package/dist/{app-store-DNpoABj1.js → app-store-aAahwmBP.js} +3 -3
  15. package/dist/{apple-DzzHtaL4.js → apple-DeRgpwlc.js} +3 -3
  16. package/dist/{arrow-bottom-D2c13c51.js → arrow-bottom-DdEOkaAj.js} +3 -3
  17. package/dist/{arrow-bottom-circle-ls9OCLx1.js → arrow-bottom-circle-BWwREWcv.js} +3 -3
  18. package/dist/{arrow-left-BI3rQkNI.js → arrow-left-CulyLmoH.js} +3 -3
  19. package/dist/{arrow-right-rnMzhVod.js → arrow-right-Dwr7TISn.js} +3 -3
  20. package/dist/{arrow-top-CfA6PVMz.js → arrow-top-pL4rM_y8.js} +3 -3
  21. package/dist/{bank-CmpAmHgg.js → bank-CPuyK_08.js} +3 -3
  22. package/dist/basic-CVc9xEvb.js +5783 -0
  23. package/dist/{browser-mEcjgS1H.js → browser-Cbq2Zbp4.js} +3 -3
  24. package/dist/{card-DkgIWcMc.js → card-B_hUtPWK.js} +3 -3
  25. package/dist/ccip-BLVGcR4A.js +228 -0
  26. package/dist/{checkmark-B_A013n2.js → checkmark-WEqTsFAc.js} +3 -3
  27. package/dist/{checkmark-bold-DestuG2T.js → checkmark-bold-Du_ZvhqM.js} +3 -3
  28. package/dist/{chevron-bottom-Di3S86dj.js → chevron-bottom-C-s-lv4L.js} +3 -3
  29. package/dist/{chevron-left-A9Wj-3tj.js → chevron-left-C7NcRElx.js} +3 -3
  30. package/dist/{chevron-right-UFxJogOZ.js → chevron-right-CSzmAmdn.js} +3 -3
  31. package/dist/{chevron-top-BbZs3eaC.js → chevron-top-Dd99Wfel.js} +3 -3
  32. package/dist/{chrome-store-B4F6hJmy.js → chrome-store-C4p77Of0.js} +3 -3
  33. package/dist/{clock-BbAQ09uV.js → clock-Cib24qjH.js} +3 -3
  34. package/dist/clockIcon-C2W5xvyt.js +76 -0
  35. package/dist/{close-CY3oZP_D.js → close-BXjEkTvS.js} +3 -3
  36. package/dist/{coinPlaceholder-DpfsobZT.js → coinPlaceholder-BFNC7cQN.js} +3 -3
  37. package/dist/{compass-CHS7RZFk.js → compass-CXPX5Ycp.js} +3 -3
  38. package/dist/{copy-CEd4nGhs.js → copy-BEawMbmF.js} +3 -3
  39. package/dist/core-Bez9Ow7F.js +14967 -0
  40. package/dist/cursor-Cxq4Q9jk.js +7 -0
  41. package/dist/{cursor-transparent-Tm6k6Ws4.js → cursor-transparent-ZjJ0P2vr.js} +3 -3
  42. package/dist/{desktop-CrSyXZkL.js → desktop-BhZVovAp.js} +3 -3
  43. package/dist/{disconnect-BooT10E1.js → disconnect-AC-bffZO.js} +3 -3
  44. package/dist/{discord-B982Qaml.js → discord-dT97h-CC.js} +3 -3
  45. package/dist/down-DP56YSKp.js +606 -0
  46. package/dist/{etherscan-CFL0IcNl.js → etherscan-rYFRhRTM.js} +3 -3
  47. package/dist/ethertousd-CC_ezooz.js +6 -0
  48. package/dist/{exclamation-triangle-BBeGXYgt.js → exclamation-triangle-C-pCuC08.js} +3 -3
  49. package/dist/{extension-C5WqJw73.js → extension-BnqauLSn.js} +3 -3
  50. package/dist/{external-link-CcSxVDcd.js → external-link-M9D6e_F3.js} +3 -3
  51. package/dist/{facebook-DF0v9ED8.js → facebook-DHezcoD-.js} +3 -3
  52. package/dist/{farcaster-Boq7M4VK.js → farcaster-D0Ky-Imv.js} +3 -3
  53. package/dist/{filters-DfeymbPx.js → filters-B02NYLWq.js} +3 -3
  54. package/dist/getChainIds-CJd2TZYT.js +1888 -0
  55. package/dist/getCosmosAddress-DTZfw04G.js +9565 -0
  56. package/dist/{github-DQ8FV4bD.js → github-BzQkIMuE.js} +3 -3
  57. package/dist/{google-Dm8FDDZR.js → google-BpwCJ4Fs.js} +3 -3
  58. package/dist/hamburger-BzqwkUjE.js +3915 -0
  59. package/dist/{help-circle-CbgiAebR.js → help-circle-C0nOySHC.js} +3 -3
  60. package/dist/{id-CzqxUksI.js → id-DFP_kFd4.js} +3 -3
  61. package/dist/{image-CsCGTIN-.js → image-QiYOAGjM.js} +3 -3
  62. package/dist/index-CDq3vNnP.js +22 -0
  63. package/dist/index-CLzkn733.js +28223 -0
  64. package/dist/index-CjtwASJt.js +252 -0
  65. package/dist/index-CrC4B7xn.js +331 -0
  66. package/dist/index-D5hLIe-N.js +9 -0
  67. package/dist/index-DDk00SOL.js +159 -0
  68. package/dist/index-DTish3yr.js +1014 -0
  69. package/dist/index-DW3W7zaF.js +473 -0
  70. package/dist/index-DXdD3L9f.js +1460 -0
  71. package/dist/index-DaJ1272l.js +18613 -0
  72. package/dist/index-DxPp2gBS.js +992 -0
  73. package/dist/index-Dy_n2MPD.js +3010 -0
  74. package/dist/index-oc8HPfOF.js +13583 -0
  75. package/dist/index.es-Bsr7zP98.js +366 -0
  76. package/dist/index.es-C-j-Ghef.js +11678 -0
  77. package/dist/index.es.js +4 -4
  78. package/dist/{info-fKCfLW0k.js → info-BTLQJ-wd.js} +3 -3
  79. package/dist/{info-circle-Bt350Yzj.js → info-circle-Dla9169_.js} +3 -3
  80. package/dist/{lightbulb-BL9YBxiA.js → lightbulb-PN8DA_Wh.js} +3 -3
  81. package/dist/{mail-_g6CHQeQ.js → mail-BGYZut_4.js} +3 -3
  82. package/dist/{mobile-B-EQ4IcH.js → mobile-BM760ZzX.js} +3 -3
  83. package/dist/{more-C3rpOdUy.js → more-rHGnl2ck.js} +3 -3
  84. package/dist/{network-placeholder-D9Ak7Xj_.js → network-placeholder-CyQl-3_2.js} +3 -3
  85. package/dist/{nftPlaceholder-CIIm2V_o.js → nftPlaceholder-nuUJ8nKY.js} +3 -3
  86. package/dist/{off-DZjgI0eE.js → off-GYlwYDrT.js} +3 -3
  87. package/dist/{play-store-DvRnagoF.js → play-store-Ck01Ez1F.js} +3 -3
  88. package/dist/{plus-C2jN2huZ.js → plus-CQfXWgLw.js} +3 -3
  89. package/dist/{qr-code-B64HnZgi.js → qr-code-CyLVwLY7.js} +3 -3
  90. package/dist/{recycle-horizontal-CovcJGa_.js → recycle-horizontal-DvnWPcEQ.js} +3 -3
  91. package/dist/{refresh-J1Vw6QMA.js → refresh-BOxj8b2n.js} +3 -3
  92. package/dist/{reown-logo-BsXoZ3KT.js → reown-logo-D1iprOTg.js} +3 -3
  93. package/dist/{search-BC86wYXR.js → search-DrPaZPnc.js} +3 -3
  94. package/dist/secp256k1-DgmH1qVg.js +1251 -0
  95. package/dist/{send-BPA1bK5G.js → send-ybBREe4b.js} +3 -3
  96. package/dist/shareicon-D3Qj5j1T.js +262 -0
  97. package/dist/{sortDown-cDA6MpOw.js → sortDown-CjBaDQTU.js} +13 -13
  98. package/dist/{swapHorizontal-47_8ePle.js → swapHorizontal-BddjZdXK.js} +3 -3
  99. package/dist/{swapHorizontalBold-CJ7TzeQP.js → swapHorizontalBold-B6AWjPZ9.js} +3 -3
  100. package/dist/{swapHorizontalMedium-CTACgUR9.js → swapHorizontalMedium-CNacWoBn.js} +3 -3
  101. package/dist/{swapHorizontalRoundedBold-Ht3_LABp.js → swapHorizontalRoundedBold-B8VcPnqt.js} +3 -3
  102. package/dist/{swapVertical-DlS0V6DD.js → swapVertical-zY2BbSyQ.js} +3 -3
  103. package/dist/{telegram-UZ00kvIE.js → telegram-DS4l-8Oc.js} +3 -3
  104. package/dist/{three-dots-D9zVXr1j.js → three-dots-RctNqamK.js} +3 -3
  105. package/dist/truncate-D9t92mVX.js +7 -0
  106. package/dist/{twitch-CP6rpz4m.js → twitch-CJ0llIIH.js} +3 -3
  107. package/dist/{twitterIcon-Cm3I3FRU.js → twitterIcon-pgvN9-bP.js} +3 -3
  108. package/dist/unsupportedProp-BJVuEW_b.js +10 -0
  109. package/dist/useRegisterError-C_YLA1dw.js +9857 -0
  110. package/dist/validError-CDlJpg_f.js +6 -0
  111. package/dist/{verify-DuUE85WT.js → verify-BeZLo1Fq.js} +3 -3
  112. package/dist/{verify-filled-CfgydKPa.js → verify-filled-meyb7E16.js} +3 -3
  113. package/dist/w3m-modal-C-Jp9NVv.js +1471 -0
  114. package/dist/{wallet-BC2LSDlF.js → wallet-CFcOgSsz.js} +3 -3
  115. package/dist/{wallet-placeholder-DugEJ7xM.js → wallet-placeholder-CeUMILZq.js} +3 -3
  116. package/dist/{walletconnect-wayCaYfk.js → walletconnect-D6LB1PyC.js} +7 -9
  117. package/dist/{warning-circle-Cy9YuvwU.js → warning-circle-BRtzofvT.js} +3 -3
  118. package/dist/{x-jggPFiy-.js → x-DKQAOOh3.js} +3 -3
  119. package/package.json +1 -1
  120. package/dist/AllRoutes-Bdi5ZW8W.js +0 -2604
  121. package/dist/Box-e4gA-y_H.js +0 -60
  122. package/dist/EstGas-C5ihS0Mw.js +0 -17108
  123. package/dist/Grow-B4K-I-E-.js +0 -2212
  124. package/dist/InputComp-C_UUZxNU.js +0 -114
  125. package/dist/LoadRoute-CnDhVKdh.js +0 -142
  126. package/dist/QuotesProgress-DxgPgPJE.js +0 -29
  127. package/dist/SwapAsset-CmmuxeQF.js +0 -65
  128. package/dist/Tooltip-D8YjOOKU.js +0 -718
  129. package/dist/TxnButton-CF-TLZrD.js +0 -302
  130. package/dist/WidgetForm.module-DhUUlwZP.js +0 -13
  131. package/dist/basic-Cx2xxgd9.js +0 -7109
  132. package/dist/ccip-BKpquA5i.js +0 -250
  133. package/dist/clockIcon-jSNFFrLy.js +0 -76
  134. package/dist/core-C-gr9X18.js +0 -17217
  135. package/dist/cursor-BTtIlTHP.js +0 -7
  136. package/dist/down-DDk8OoJG.js +0 -809
  137. package/dist/ethertousd-BOknTgU4.js +0 -7
  138. package/dist/getChainIds-6iugk2h0.js +0 -2431
  139. package/dist/getCosmosAddress-BgD5iV6f.js +0 -13998
  140. package/dist/hamburger-BYe_G11E.js +0 -4562
  141. package/dist/index-BAmjBHYR.js +0 -1087
  142. package/dist/index-BxHeZ9IF.js +0 -543
  143. package/dist/index-C7cb2O7r.js +0 -16078
  144. package/dist/index-CF9p4S_X.js +0 -11
  145. package/dist/index-C_vo1L7p.js +0 -24384
  146. package/dist/index-Ch7w83dW.js +0 -4217
  147. package/dist/index-Crhenmgw.js +0 -188
  148. package/dist/index-Cz5Dosd2.js +0 -412
  149. package/dist/index-D5OnT-__.js +0 -35858
  150. package/dist/index-DArR1lwi.js +0 -1759
  151. package/dist/index-hEJSpZe-.js +0 -308
  152. package/dist/index-m2O0cbD8.js +0 -1883
  153. package/dist/index-sLx4Edw4.js +0 -22
  154. package/dist/index.es-DIbGJsfa.js +0 -475
  155. package/dist/index.es-t6sHlseh.js +0 -12916
  156. package/dist/secp256k1-BkBK0mD5.js +0 -1681
  157. package/dist/shareicon-C88Wx-AM.js +0 -314
  158. package/dist/truncate-DSxFWEga.js +0 -7
  159. package/dist/unsupportedProp-DkeDzLfM.js +0 -14
  160. package/dist/useRegisterError-W_UfecIN.js +0 -19288
  161. package/dist/validError-rariWQ7G.js +0 -14
  162. package/dist/w3m-modal-Bl-DPlah.js +0 -1721
@@ -1,2212 +0,0 @@
1
- import * as React from "react";
2
- import React__default from "react";
3
- import { p as process$1, P as PropTypes, h as getDefaultExportFromCjs, g as generateUtilityClass, _ as _objectWithoutPropertiesLoose, b as _extends } from "./index-D5OnT-__.js";
4
- import { jsx } from "react/jsx-runtime";
5
- import { X as require$$1, g as generateUtilityClasses, t as ownerDocument, P as Portal, h as useForkRef, e as useEnhancedEffect, v as useSlotProps, a as composeClasses, b as refType, n as chainPropTypes, H as HTMLElementType, d as useDefaultProps, s as styled, T as Transition, z as useTimeout, o as useTheme$1, x as getReactElementRef, E as getTransitionProps, I as reflow, J as elementAcceptingRef } from "./useRegisterError-W_UfecIN.js";
6
- let globalId = 0;
7
- function useGlobalId(idOverride) {
8
- const [defaultId, setDefaultId] = React.useState(idOverride);
9
- const id = idOverride || defaultId;
10
- React.useEffect(() => {
11
- if (defaultId == null) {
12
- globalId += 1;
13
- setDefaultId(`mui-${globalId}`);
14
- }
15
- }, [defaultId]);
16
- return id;
17
- }
18
- const maybeReactUseId = React["useId".toString()];
19
- function useId(idOverride) {
20
- if (maybeReactUseId !== void 0) {
21
- const reactId = maybeReactUseId();
22
- return idOverride != null ? idOverride : reactId;
23
- }
24
- return useGlobalId(idOverride);
25
- }
26
- function useControlled({
27
- controlled,
28
- default: defaultProp,
29
- name,
30
- state = "value"
31
- }) {
32
- const {
33
- current: isControlled
34
- } = React.useRef(controlled !== void 0);
35
- const [valueState, setValue] = React.useState(defaultProp);
36
- const value = isControlled ? controlled : valueState;
37
- if (process$1.env.NODE_ENV !== "production") {
38
- React.useEffect(() => {
39
- if (isControlled !== (controlled !== void 0)) {
40
- }
41
- }, [state, name, controlled]);
42
- const {
43
- current: defaultValue
44
- } = React.useRef(defaultProp);
45
- React.useEffect(() => {
46
- if (!isControlled && !Object.is(defaultValue, defaultProp)) {
47
- }
48
- }, [JSON.stringify(defaultProp)]);
49
- }
50
- const setValueIfUncontrolled = React.useCallback((newValue) => {
51
- if (!isControlled) {
52
- setValue(newValue);
53
- }
54
- }, []);
55
- return [value, setValueIfUncontrolled];
56
- }
57
- const RtlContext = /* @__PURE__ */ React.createContext();
58
- process$1.env.NODE_ENV !== "production" ? {
59
- children: PropTypes.node,
60
- value: PropTypes.bool
61
- } : void 0;
62
- const useRtl = () => {
63
- const value = React.useContext(RtlContext);
64
- return value != null ? value : false;
65
- };
66
- var useThemeWithoutDefault = {};
67
- var hasRequiredUseThemeWithoutDefault;
68
- function requireUseThemeWithoutDefault() {
69
- if (hasRequiredUseThemeWithoutDefault) return useThemeWithoutDefault;
70
- hasRequiredUseThemeWithoutDefault = 1;
71
- Object.defineProperty(useThemeWithoutDefault, "__esModule", {
72
- value: true
73
- });
74
- useThemeWithoutDefault.default = void 0;
75
- var React2 = _interopRequireWildcard(React__default);
76
- var _styledEngine = require$$1;
77
- function _getRequireWildcardCache(e) {
78
- if ("function" != typeof WeakMap) return null;
79
- var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
80
- return (_getRequireWildcardCache = function(e2) {
81
- return e2 ? t : r;
82
- })(e);
83
- }
84
- function _interopRequireWildcard(e, r) {
85
- if (e && e.__esModule) return e;
86
- if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };
87
- var t = _getRequireWildcardCache(r);
88
- if (t && t.has(e)) return t.get(e);
89
- var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
90
- for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
91
- var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
92
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
93
- }
94
- return n.default = e, t && t.set(e, n), n;
95
- }
96
- function isObjectEmpty(obj) {
97
- return Object.keys(obj).length === 0;
98
- }
99
- function useTheme2(defaultTheme = null) {
100
- const contextTheme = React2.useContext(_styledEngine.ThemeContext);
101
- return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
102
- }
103
- useThemeWithoutDefault.default = useTheme2;
104
- return useThemeWithoutDefault;
105
- }
106
- var useThemeWithoutDefaultExports = /* @__PURE__ */ requireUseThemeWithoutDefault();
107
- const useTheme = /* @__PURE__ */ getDefaultExportFromCjs(useThemeWithoutDefaultExports);
108
- var top = "top";
109
- var bottom = "bottom";
110
- var right = "right";
111
- var left = "left";
112
- var auto = "auto";
113
- var basePlacements = [top, bottom, right, left];
114
- var start = "start";
115
- var end = "end";
116
- var clippingParents = "clippingParents";
117
- var viewport = "viewport";
118
- var popper = "popper";
119
- var reference = "reference";
120
- var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
121
- return acc.concat([placement + "-" + start, placement + "-" + end]);
122
- }, []);
123
- var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
124
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
125
- }, []);
126
- var beforeRead = "beforeRead";
127
- var read = "read";
128
- var afterRead = "afterRead";
129
- var beforeMain = "beforeMain";
130
- var main = "main";
131
- var afterMain = "afterMain";
132
- var beforeWrite = "beforeWrite";
133
- var write = "write";
134
- var afterWrite = "afterWrite";
135
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
136
- function getNodeName(element) {
137
- return element ? (element.nodeName || "").toLowerCase() : null;
138
- }
139
- function getWindow(node) {
140
- if (node == null) {
141
- return window;
142
- }
143
- if (node.toString() !== "[object Window]") {
144
- var ownerDocument2 = node.ownerDocument;
145
- return ownerDocument2 ? ownerDocument2.defaultView || window : window;
146
- }
147
- return node;
148
- }
149
- function isElement(node) {
150
- var OwnElement = getWindow(node).Element;
151
- return node instanceof OwnElement || node instanceof Element;
152
- }
153
- function isHTMLElement$1(node) {
154
- var OwnElement = getWindow(node).HTMLElement;
155
- return node instanceof OwnElement || node instanceof HTMLElement;
156
- }
157
- function isShadowRoot(node) {
158
- if (typeof ShadowRoot === "undefined") {
159
- return false;
160
- }
161
- var OwnElement = getWindow(node).ShadowRoot;
162
- return node instanceof OwnElement || node instanceof ShadowRoot;
163
- }
164
- function applyStyles(_ref) {
165
- var state = _ref.state;
166
- Object.keys(state.elements).forEach(function(name) {
167
- var style = state.styles[name] || {};
168
- var attributes = state.attributes[name] || {};
169
- var element = state.elements[name];
170
- if (!isHTMLElement$1(element) || !getNodeName(element)) {
171
- return;
172
- }
173
- Object.assign(element.style, style);
174
- Object.keys(attributes).forEach(function(name2) {
175
- var value = attributes[name2];
176
- if (value === false) {
177
- element.removeAttribute(name2);
178
- } else {
179
- element.setAttribute(name2, value === true ? "" : value);
180
- }
181
- });
182
- });
183
- }
184
- function effect$2(_ref2) {
185
- var state = _ref2.state;
186
- var initialStyles = {
187
- popper: {
188
- position: state.options.strategy,
189
- left: "0",
190
- top: "0",
191
- margin: "0"
192
- },
193
- arrow: {
194
- position: "absolute"
195
- },
196
- reference: {}
197
- };
198
- Object.assign(state.elements.popper.style, initialStyles.popper);
199
- state.styles = initialStyles;
200
- if (state.elements.arrow) {
201
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
202
- }
203
- return function() {
204
- Object.keys(state.elements).forEach(function(name) {
205
- var element = state.elements[name];
206
- var attributes = state.attributes[name] || {};
207
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
208
- var style = styleProperties.reduce(function(style2, property) {
209
- style2[property] = "";
210
- return style2;
211
- }, {});
212
- if (!isHTMLElement$1(element) || !getNodeName(element)) {
213
- return;
214
- }
215
- Object.assign(element.style, style);
216
- Object.keys(attributes).forEach(function(attribute) {
217
- element.removeAttribute(attribute);
218
- });
219
- });
220
- };
221
- }
222
- const applyStyles$1 = {
223
- name: "applyStyles",
224
- enabled: true,
225
- phase: "write",
226
- fn: applyStyles,
227
- effect: effect$2,
228
- requires: ["computeStyles"]
229
- };
230
- function getBasePlacement(placement) {
231
- return placement.split("-")[0];
232
- }
233
- var max = Math.max;
234
- var min = Math.min;
235
- var round = Math.round;
236
- function getUAString() {
237
- var uaData = navigator.userAgentData;
238
- if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
239
- return uaData.brands.map(function(item) {
240
- return item.brand + "/" + item.version;
241
- }).join(" ");
242
- }
243
- return navigator.userAgent;
244
- }
245
- function isLayoutViewport() {
246
- return !/^((?!chrome|android).)*safari/i.test(getUAString());
247
- }
248
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
249
- if (includeScale === void 0) {
250
- includeScale = false;
251
- }
252
- if (isFixedStrategy === void 0) {
253
- isFixedStrategy = false;
254
- }
255
- var clientRect = element.getBoundingClientRect();
256
- var scaleX = 1;
257
- var scaleY = 1;
258
- if (includeScale && isHTMLElement$1(element)) {
259
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
260
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
261
- }
262
- var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
263
- var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
264
- var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
265
- var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
266
- var width = clientRect.width / scaleX;
267
- var height = clientRect.height / scaleY;
268
- return {
269
- width,
270
- height,
271
- top: y,
272
- right: x + width,
273
- bottom: y + height,
274
- left: x,
275
- x,
276
- y
277
- };
278
- }
279
- function getLayoutRect(element) {
280
- var clientRect = getBoundingClientRect(element);
281
- var width = element.offsetWidth;
282
- var height = element.offsetHeight;
283
- if (Math.abs(clientRect.width - width) <= 1) {
284
- width = clientRect.width;
285
- }
286
- if (Math.abs(clientRect.height - height) <= 1) {
287
- height = clientRect.height;
288
- }
289
- return {
290
- x: element.offsetLeft,
291
- y: element.offsetTop,
292
- width,
293
- height
294
- };
295
- }
296
- function contains(parent, child) {
297
- var rootNode = child.getRootNode && child.getRootNode();
298
- if (parent.contains(child)) {
299
- return true;
300
- } else if (rootNode && isShadowRoot(rootNode)) {
301
- var next = child;
302
- do {
303
- if (next && parent.isSameNode(next)) {
304
- return true;
305
- }
306
- next = next.parentNode || next.host;
307
- } while (next);
308
- }
309
- return false;
310
- }
311
- function getComputedStyle(element) {
312
- return getWindow(element).getComputedStyle(element);
313
- }
314
- function isTableElement(element) {
315
- return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
316
- }
317
- function getDocumentElement(element) {
318
- return ((isElement(element) ? element.ownerDocument : (
319
- // $FlowFixMe[prop-missing]
320
- element.document
321
- )) || window.document).documentElement;
322
- }
323
- function getParentNode(element) {
324
- if (getNodeName(element) === "html") {
325
- return element;
326
- }
327
- return (
328
- // this is a quicker (but less type safe) way to save quite some bytes from the bundle
329
- // $FlowFixMe[incompatible-return]
330
- // $FlowFixMe[prop-missing]
331
- element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
332
- element.parentNode || // DOM Element detected
333
- (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
334
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
335
- getDocumentElement(element)
336
- );
337
- }
338
- function getTrueOffsetParent(element) {
339
- if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
340
- getComputedStyle(element).position === "fixed") {
341
- return null;
342
- }
343
- return element.offsetParent;
344
- }
345
- function getContainingBlock(element) {
346
- var isFirefox = /firefox/i.test(getUAString());
347
- var isIE = /Trident/i.test(getUAString());
348
- if (isIE && isHTMLElement$1(element)) {
349
- var elementCss = getComputedStyle(element);
350
- if (elementCss.position === "fixed") {
351
- return null;
352
- }
353
- }
354
- var currentNode = getParentNode(element);
355
- if (isShadowRoot(currentNode)) {
356
- currentNode = currentNode.host;
357
- }
358
- while (isHTMLElement$1(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
359
- var css = getComputedStyle(currentNode);
360
- if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
361
- return currentNode;
362
- } else {
363
- currentNode = currentNode.parentNode;
364
- }
365
- }
366
- return null;
367
- }
368
- function getOffsetParent(element) {
369
- var window2 = getWindow(element);
370
- var offsetParent = getTrueOffsetParent(element);
371
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
372
- offsetParent = getTrueOffsetParent(offsetParent);
373
- }
374
- if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
375
- return window2;
376
- }
377
- return offsetParent || getContainingBlock(element) || window2;
378
- }
379
- function getMainAxisFromPlacement(placement) {
380
- return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
381
- }
382
- function within(min$1, value, max$1) {
383
- return max(min$1, min(value, max$1));
384
- }
385
- function withinMaxClamp(min2, value, max2) {
386
- var v = within(min2, value, max2);
387
- return v > max2 ? max2 : v;
388
- }
389
- function getFreshSideObject() {
390
- return {
391
- top: 0,
392
- right: 0,
393
- bottom: 0,
394
- left: 0
395
- };
396
- }
397
- function mergePaddingObject(paddingObject) {
398
- return Object.assign({}, getFreshSideObject(), paddingObject);
399
- }
400
- function expandToHashMap(value, keys) {
401
- return keys.reduce(function(hashMap, key) {
402
- hashMap[key] = value;
403
- return hashMap;
404
- }, {});
405
- }
406
- var toPaddingObject = function toPaddingObject2(padding, state) {
407
- padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
408
- placement: state.placement
409
- })) : padding;
410
- return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
411
- };
412
- function arrow(_ref) {
413
- var _state$modifiersData$;
414
- var state = _ref.state, name = _ref.name, options = _ref.options;
415
- var arrowElement = state.elements.arrow;
416
- var popperOffsets2 = state.modifiersData.popperOffsets;
417
- var basePlacement = getBasePlacement(state.placement);
418
- var axis = getMainAxisFromPlacement(basePlacement);
419
- var isVertical = [left, right].indexOf(basePlacement) >= 0;
420
- var len = isVertical ? "height" : "width";
421
- if (!arrowElement || !popperOffsets2) {
422
- return;
423
- }
424
- var paddingObject = toPaddingObject(options.padding, state);
425
- var arrowRect = getLayoutRect(arrowElement);
426
- var minProp = axis === "y" ? top : left;
427
- var maxProp = axis === "y" ? bottom : right;
428
- var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
429
- var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
430
- var arrowOffsetParent = getOffsetParent(arrowElement);
431
- var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
432
- var centerToReference = endDiff / 2 - startDiff / 2;
433
- var min2 = paddingObject[minProp];
434
- var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
435
- var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
436
- var offset2 = within(min2, center, max2);
437
- var axisProp = axis;
438
- state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
439
- }
440
- function effect$1(_ref2) {
441
- var state = _ref2.state, options = _ref2.options;
442
- var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
443
- if (arrowElement == null) {
444
- return;
445
- }
446
- if (typeof arrowElement === "string") {
447
- arrowElement = state.elements.popper.querySelector(arrowElement);
448
- if (!arrowElement) {
449
- return;
450
- }
451
- }
452
- if (!contains(state.elements.popper, arrowElement)) {
453
- return;
454
- }
455
- state.elements.arrow = arrowElement;
456
- }
457
- const arrow$1 = {
458
- name: "arrow",
459
- enabled: true,
460
- phase: "main",
461
- fn: arrow,
462
- effect: effect$1,
463
- requires: ["popperOffsets"],
464
- requiresIfExists: ["preventOverflow"]
465
- };
466
- function getVariation(placement) {
467
- return placement.split("-")[1];
468
- }
469
- var unsetSides = {
470
- top: "auto",
471
- right: "auto",
472
- bottom: "auto",
473
- left: "auto"
474
- };
475
- function roundOffsetsByDPR(_ref, win) {
476
- var x = _ref.x, y = _ref.y;
477
- var dpr = win.devicePixelRatio || 1;
478
- return {
479
- x: round(x * dpr) / dpr || 0,
480
- y: round(y * dpr) / dpr || 0
481
- };
482
- }
483
- function mapToStyles(_ref2) {
484
- var _Object$assign2;
485
- var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
486
- var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
487
- var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
488
- x,
489
- y
490
- }) : {
491
- x,
492
- y
493
- };
494
- x = _ref3.x;
495
- y = _ref3.y;
496
- var hasX = offsets.hasOwnProperty("x");
497
- var hasY = offsets.hasOwnProperty("y");
498
- var sideX = left;
499
- var sideY = top;
500
- var win = window;
501
- if (adaptive) {
502
- var offsetParent = getOffsetParent(popper2);
503
- var heightProp = "clientHeight";
504
- var widthProp = "clientWidth";
505
- if (offsetParent === getWindow(popper2)) {
506
- offsetParent = getDocumentElement(popper2);
507
- if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
508
- heightProp = "scrollHeight";
509
- widthProp = "scrollWidth";
510
- }
511
- }
512
- offsetParent = offsetParent;
513
- if (placement === top || (placement === left || placement === right) && variation === end) {
514
- sideY = bottom;
515
- var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
516
- // $FlowFixMe[prop-missing]
517
- offsetParent[heightProp]
518
- );
519
- y -= offsetY - popperRect.height;
520
- y *= gpuAcceleration ? 1 : -1;
521
- }
522
- if (placement === left || (placement === top || placement === bottom) && variation === end) {
523
- sideX = right;
524
- var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
525
- // $FlowFixMe[prop-missing]
526
- offsetParent[widthProp]
527
- );
528
- x -= offsetX - popperRect.width;
529
- x *= gpuAcceleration ? 1 : -1;
530
- }
531
- }
532
- var commonStyles = Object.assign({
533
- position
534
- }, adaptive && unsetSides);
535
- var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
536
- x,
537
- y
538
- }, getWindow(popper2)) : {
539
- x,
540
- y
541
- };
542
- x = _ref4.x;
543
- y = _ref4.y;
544
- if (gpuAcceleration) {
545
- var _Object$assign;
546
- return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
547
- }
548
- return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
549
- }
550
- function computeStyles(_ref5) {
551
- var state = _ref5.state, options = _ref5.options;
552
- var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
553
- var commonStyles = {
554
- placement: getBasePlacement(state.placement),
555
- variation: getVariation(state.placement),
556
- popper: state.elements.popper,
557
- popperRect: state.rects.popper,
558
- gpuAcceleration,
559
- isFixed: state.options.strategy === "fixed"
560
- };
561
- if (state.modifiersData.popperOffsets != null) {
562
- state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
563
- offsets: state.modifiersData.popperOffsets,
564
- position: state.options.strategy,
565
- adaptive,
566
- roundOffsets
567
- })));
568
- }
569
- if (state.modifiersData.arrow != null) {
570
- state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
571
- offsets: state.modifiersData.arrow,
572
- position: "absolute",
573
- adaptive: false,
574
- roundOffsets
575
- })));
576
- }
577
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
578
- "data-popper-placement": state.placement
579
- });
580
- }
581
- const computeStyles$1 = {
582
- name: "computeStyles",
583
- enabled: true,
584
- phase: "beforeWrite",
585
- fn: computeStyles,
586
- data: {}
587
- };
588
- var passive = {
589
- passive: true
590
- };
591
- function effect(_ref) {
592
- var state = _ref.state, instance = _ref.instance, options = _ref.options;
593
- var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
594
- var window2 = getWindow(state.elements.popper);
595
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
596
- if (scroll) {
597
- scrollParents.forEach(function(scrollParent) {
598
- scrollParent.addEventListener("scroll", instance.update, passive);
599
- });
600
- }
601
- if (resize) {
602
- window2.addEventListener("resize", instance.update, passive);
603
- }
604
- return function() {
605
- if (scroll) {
606
- scrollParents.forEach(function(scrollParent) {
607
- scrollParent.removeEventListener("scroll", instance.update, passive);
608
- });
609
- }
610
- if (resize) {
611
- window2.removeEventListener("resize", instance.update, passive);
612
- }
613
- };
614
- }
615
- const eventListeners = {
616
- name: "eventListeners",
617
- enabled: true,
618
- phase: "write",
619
- fn: function fn() {
620
- },
621
- effect,
622
- data: {}
623
- };
624
- var hash$1 = {
625
- left: "right",
626
- right: "left",
627
- bottom: "top",
628
- top: "bottom"
629
- };
630
- function getOppositePlacement(placement) {
631
- return placement.replace(/left|right|bottom|top/g, function(matched) {
632
- return hash$1[matched];
633
- });
634
- }
635
- var hash = {
636
- start: "end",
637
- end: "start"
638
- };
639
- function getOppositeVariationPlacement(placement) {
640
- return placement.replace(/start|end/g, function(matched) {
641
- return hash[matched];
642
- });
643
- }
644
- function getWindowScroll(node) {
645
- var win = getWindow(node);
646
- var scrollLeft = win.pageXOffset;
647
- var scrollTop = win.pageYOffset;
648
- return {
649
- scrollLeft,
650
- scrollTop
651
- };
652
- }
653
- function getWindowScrollBarX(element) {
654
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
655
- }
656
- function getViewportRect(element, strategy) {
657
- var win = getWindow(element);
658
- var html = getDocumentElement(element);
659
- var visualViewport = win.visualViewport;
660
- var width = html.clientWidth;
661
- var height = html.clientHeight;
662
- var x = 0;
663
- var y = 0;
664
- if (visualViewport) {
665
- width = visualViewport.width;
666
- height = visualViewport.height;
667
- var layoutViewport = isLayoutViewport();
668
- if (layoutViewport || !layoutViewport && strategy === "fixed") {
669
- x = visualViewport.offsetLeft;
670
- y = visualViewport.offsetTop;
671
- }
672
- }
673
- return {
674
- width,
675
- height,
676
- x: x + getWindowScrollBarX(element),
677
- y
678
- };
679
- }
680
- function getDocumentRect(element) {
681
- var _element$ownerDocumen;
682
- var html = getDocumentElement(element);
683
- var winScroll = getWindowScroll(element);
684
- var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
685
- var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
686
- var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
687
- var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
688
- var y = -winScroll.scrollTop;
689
- if (getComputedStyle(body || html).direction === "rtl") {
690
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
691
- }
692
- return {
693
- width,
694
- height,
695
- x,
696
- y
697
- };
698
- }
699
- function isScrollParent(element) {
700
- var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
701
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
702
- }
703
- function getScrollParent(node) {
704
- if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
705
- return node.ownerDocument.body;
706
- }
707
- if (isHTMLElement$1(node) && isScrollParent(node)) {
708
- return node;
709
- }
710
- return getScrollParent(getParentNode(node));
711
- }
712
- function listScrollParents(element, list) {
713
- var _element$ownerDocumen;
714
- if (list === void 0) {
715
- list = [];
716
- }
717
- var scrollParent = getScrollParent(element);
718
- var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
719
- var win = getWindow(scrollParent);
720
- var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
721
- var updatedList = list.concat(target);
722
- return isBody ? updatedList : (
723
- // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
724
- updatedList.concat(listScrollParents(getParentNode(target)))
725
- );
726
- }
727
- function rectToClientRect(rect) {
728
- return Object.assign({}, rect, {
729
- left: rect.x,
730
- top: rect.y,
731
- right: rect.x + rect.width,
732
- bottom: rect.y + rect.height
733
- });
734
- }
735
- function getInnerBoundingClientRect(element, strategy) {
736
- var rect = getBoundingClientRect(element, false, strategy === "fixed");
737
- rect.top = rect.top + element.clientTop;
738
- rect.left = rect.left + element.clientLeft;
739
- rect.bottom = rect.top + element.clientHeight;
740
- rect.right = rect.left + element.clientWidth;
741
- rect.width = element.clientWidth;
742
- rect.height = element.clientHeight;
743
- rect.x = rect.left;
744
- rect.y = rect.top;
745
- return rect;
746
- }
747
- function getClientRectFromMixedType(element, clippingParent, strategy) {
748
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
749
- }
750
- function getClippingParents(element) {
751
- var clippingParents2 = listScrollParents(getParentNode(element));
752
- var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
753
- var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent(element) : element;
754
- if (!isElement(clipperElement)) {
755
- return [];
756
- }
757
- return clippingParents2.filter(function(clippingParent) {
758
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
759
- });
760
- }
761
- function getClippingRect(element, boundary, rootBoundary, strategy) {
762
- var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
763
- var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
764
- var firstClippingParent = clippingParents2[0];
765
- var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
766
- var rect = getClientRectFromMixedType(element, clippingParent, strategy);
767
- accRect.top = max(rect.top, accRect.top);
768
- accRect.right = min(rect.right, accRect.right);
769
- accRect.bottom = min(rect.bottom, accRect.bottom);
770
- accRect.left = max(rect.left, accRect.left);
771
- return accRect;
772
- }, getClientRectFromMixedType(element, firstClippingParent, strategy));
773
- clippingRect.width = clippingRect.right - clippingRect.left;
774
- clippingRect.height = clippingRect.bottom - clippingRect.top;
775
- clippingRect.x = clippingRect.left;
776
- clippingRect.y = clippingRect.top;
777
- return clippingRect;
778
- }
779
- function computeOffsets(_ref) {
780
- var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
781
- var basePlacement = placement ? getBasePlacement(placement) : null;
782
- var variation = placement ? getVariation(placement) : null;
783
- var commonX = reference2.x + reference2.width / 2 - element.width / 2;
784
- var commonY = reference2.y + reference2.height / 2 - element.height / 2;
785
- var offsets;
786
- switch (basePlacement) {
787
- case top:
788
- offsets = {
789
- x: commonX,
790
- y: reference2.y - element.height
791
- };
792
- break;
793
- case bottom:
794
- offsets = {
795
- x: commonX,
796
- y: reference2.y + reference2.height
797
- };
798
- break;
799
- case right:
800
- offsets = {
801
- x: reference2.x + reference2.width,
802
- y: commonY
803
- };
804
- break;
805
- case left:
806
- offsets = {
807
- x: reference2.x - element.width,
808
- y: commonY
809
- };
810
- break;
811
- default:
812
- offsets = {
813
- x: reference2.x,
814
- y: reference2.y
815
- };
816
- }
817
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
818
- if (mainAxis != null) {
819
- var len = mainAxis === "y" ? "height" : "width";
820
- switch (variation) {
821
- case start:
822
- offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
823
- break;
824
- case end:
825
- offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
826
- break;
827
- }
828
- }
829
- return offsets;
830
- }
831
- function detectOverflow(state, options) {
832
- if (options === void 0) {
833
- options = {};
834
- }
835
- var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
836
- var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
837
- var altContext = elementContext === popper ? reference : popper;
838
- var popperRect = state.rects.popper;
839
- var element = state.elements[altBoundary ? altContext : elementContext];
840
- var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
841
- var referenceClientRect = getBoundingClientRect(state.elements.reference);
842
- var popperOffsets2 = computeOffsets({
843
- reference: referenceClientRect,
844
- element: popperRect,
845
- placement
846
- });
847
- var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
848
- var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
849
- var overflowOffsets = {
850
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
851
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
852
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
853
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
854
- };
855
- var offsetData = state.modifiersData.offset;
856
- if (elementContext === popper && offsetData) {
857
- var offset2 = offsetData[placement];
858
- Object.keys(overflowOffsets).forEach(function(key) {
859
- var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
860
- var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
861
- overflowOffsets[key] += offset2[axis] * multiply;
862
- });
863
- }
864
- return overflowOffsets;
865
- }
866
- function computeAutoPlacement(state, options) {
867
- if (options === void 0) {
868
- options = {};
869
- }
870
- var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
871
- var variation = getVariation(placement);
872
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
873
- return getVariation(placement2) === variation;
874
- }) : basePlacements;
875
- var allowedPlacements = placements$1.filter(function(placement2) {
876
- return allowedAutoPlacements.indexOf(placement2) >= 0;
877
- });
878
- if (allowedPlacements.length === 0) {
879
- allowedPlacements = placements$1;
880
- }
881
- var overflows = allowedPlacements.reduce(function(acc, placement2) {
882
- acc[placement2] = detectOverflow(state, {
883
- placement: placement2,
884
- boundary,
885
- rootBoundary,
886
- padding
887
- })[getBasePlacement(placement2)];
888
- return acc;
889
- }, {});
890
- return Object.keys(overflows).sort(function(a, b) {
891
- return overflows[a] - overflows[b];
892
- });
893
- }
894
- function getExpandedFallbackPlacements(placement) {
895
- if (getBasePlacement(placement) === auto) {
896
- return [];
897
- }
898
- var oppositePlacement = getOppositePlacement(placement);
899
- return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
900
- }
901
- function flip(_ref) {
902
- var state = _ref.state, options = _ref.options, name = _ref.name;
903
- if (state.modifiersData[name]._skip) {
904
- return;
905
- }
906
- var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
907
- var preferredPlacement = state.options.placement;
908
- var basePlacement = getBasePlacement(preferredPlacement);
909
- var isBasePlacement = basePlacement === preferredPlacement;
910
- var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
911
- var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
912
- return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
913
- placement: placement2,
914
- boundary,
915
- rootBoundary,
916
- padding,
917
- flipVariations,
918
- allowedAutoPlacements
919
- }) : placement2);
920
- }, []);
921
- var referenceRect = state.rects.reference;
922
- var popperRect = state.rects.popper;
923
- var checksMap = /* @__PURE__ */ new Map();
924
- var makeFallbackChecks = true;
925
- var firstFittingPlacement = placements2[0];
926
- for (var i = 0; i < placements2.length; i++) {
927
- var placement = placements2[i];
928
- var _basePlacement = getBasePlacement(placement);
929
- var isStartVariation = getVariation(placement) === start;
930
- var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
931
- var len = isVertical ? "width" : "height";
932
- var overflow = detectOverflow(state, {
933
- placement,
934
- boundary,
935
- rootBoundary,
936
- altBoundary,
937
- padding
938
- });
939
- var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
940
- if (referenceRect[len] > popperRect[len]) {
941
- mainVariationSide = getOppositePlacement(mainVariationSide);
942
- }
943
- var altVariationSide = getOppositePlacement(mainVariationSide);
944
- var checks = [];
945
- if (checkMainAxis) {
946
- checks.push(overflow[_basePlacement] <= 0);
947
- }
948
- if (checkAltAxis) {
949
- checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
950
- }
951
- if (checks.every(function(check) {
952
- return check;
953
- })) {
954
- firstFittingPlacement = placement;
955
- makeFallbackChecks = false;
956
- break;
957
- }
958
- checksMap.set(placement, checks);
959
- }
960
- if (makeFallbackChecks) {
961
- var numberOfChecks = flipVariations ? 3 : 1;
962
- var _loop = function _loop2(_i2) {
963
- var fittingPlacement = placements2.find(function(placement2) {
964
- var checks2 = checksMap.get(placement2);
965
- if (checks2) {
966
- return checks2.slice(0, _i2).every(function(check) {
967
- return check;
968
- });
969
- }
970
- });
971
- if (fittingPlacement) {
972
- firstFittingPlacement = fittingPlacement;
973
- return "break";
974
- }
975
- };
976
- for (var _i = numberOfChecks; _i > 0; _i--) {
977
- var _ret = _loop(_i);
978
- if (_ret === "break") break;
979
- }
980
- }
981
- if (state.placement !== firstFittingPlacement) {
982
- state.modifiersData[name]._skip = true;
983
- state.placement = firstFittingPlacement;
984
- state.reset = true;
985
- }
986
- }
987
- const flip$1 = {
988
- name: "flip",
989
- enabled: true,
990
- phase: "main",
991
- fn: flip,
992
- requiresIfExists: ["offset"],
993
- data: {
994
- _skip: false
995
- }
996
- };
997
- function getSideOffsets(overflow, rect, preventedOffsets) {
998
- if (preventedOffsets === void 0) {
999
- preventedOffsets = {
1000
- x: 0,
1001
- y: 0
1002
- };
1003
- }
1004
- return {
1005
- top: overflow.top - rect.height - preventedOffsets.y,
1006
- right: overflow.right - rect.width + preventedOffsets.x,
1007
- bottom: overflow.bottom - rect.height + preventedOffsets.y,
1008
- left: overflow.left - rect.width - preventedOffsets.x
1009
- };
1010
- }
1011
- function isAnySideFullyClipped(overflow) {
1012
- return [top, right, bottom, left].some(function(side) {
1013
- return overflow[side] >= 0;
1014
- });
1015
- }
1016
- function hide(_ref) {
1017
- var state = _ref.state, name = _ref.name;
1018
- var referenceRect = state.rects.reference;
1019
- var popperRect = state.rects.popper;
1020
- var preventedOffsets = state.modifiersData.preventOverflow;
1021
- var referenceOverflow = detectOverflow(state, {
1022
- elementContext: "reference"
1023
- });
1024
- var popperAltOverflow = detectOverflow(state, {
1025
- altBoundary: true
1026
- });
1027
- var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1028
- var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1029
- var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1030
- var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1031
- state.modifiersData[name] = {
1032
- referenceClippingOffsets,
1033
- popperEscapeOffsets,
1034
- isReferenceHidden,
1035
- hasPopperEscaped
1036
- };
1037
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
1038
- "data-popper-reference-hidden": isReferenceHidden,
1039
- "data-popper-escaped": hasPopperEscaped
1040
- });
1041
- }
1042
- const hide$1 = {
1043
- name: "hide",
1044
- enabled: true,
1045
- phase: "main",
1046
- requiresIfExists: ["preventOverflow"],
1047
- fn: hide
1048
- };
1049
- function distanceAndSkiddingToXY(placement, rects, offset2) {
1050
- var basePlacement = getBasePlacement(placement);
1051
- var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1052
- var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
1053
- placement
1054
- })) : offset2, skidding = _ref[0], distance = _ref[1];
1055
- skidding = skidding || 0;
1056
- distance = (distance || 0) * invertDistance;
1057
- return [left, right].indexOf(basePlacement) >= 0 ? {
1058
- x: distance,
1059
- y: skidding
1060
- } : {
1061
- x: skidding,
1062
- y: distance
1063
- };
1064
- }
1065
- function offset(_ref2) {
1066
- var state = _ref2.state, options = _ref2.options, name = _ref2.name;
1067
- var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
1068
- var data = placements.reduce(function(acc, placement) {
1069
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
1070
- return acc;
1071
- }, {});
1072
- var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
1073
- if (state.modifiersData.popperOffsets != null) {
1074
- state.modifiersData.popperOffsets.x += x;
1075
- state.modifiersData.popperOffsets.y += y;
1076
- }
1077
- state.modifiersData[name] = data;
1078
- }
1079
- const offset$1 = {
1080
- name: "offset",
1081
- enabled: true,
1082
- phase: "main",
1083
- requires: ["popperOffsets"],
1084
- fn: offset
1085
- };
1086
- function popperOffsets(_ref) {
1087
- var state = _ref.state, name = _ref.name;
1088
- state.modifiersData[name] = computeOffsets({
1089
- reference: state.rects.reference,
1090
- element: state.rects.popper,
1091
- placement: state.placement
1092
- });
1093
- }
1094
- const popperOffsets$1 = {
1095
- name: "popperOffsets",
1096
- enabled: true,
1097
- phase: "read",
1098
- fn: popperOffsets,
1099
- data: {}
1100
- };
1101
- function getAltAxis(axis) {
1102
- return axis === "x" ? "y" : "x";
1103
- }
1104
- function preventOverflow(_ref) {
1105
- var state = _ref.state, options = _ref.options, name = _ref.name;
1106
- var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1107
- var overflow = detectOverflow(state, {
1108
- boundary,
1109
- rootBoundary,
1110
- padding,
1111
- altBoundary
1112
- });
1113
- var basePlacement = getBasePlacement(state.placement);
1114
- var variation = getVariation(state.placement);
1115
- var isBasePlacement = !variation;
1116
- var mainAxis = getMainAxisFromPlacement(basePlacement);
1117
- var altAxis = getAltAxis(mainAxis);
1118
- var popperOffsets2 = state.modifiersData.popperOffsets;
1119
- var referenceRect = state.rects.reference;
1120
- var popperRect = state.rects.popper;
1121
- var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
1122
- placement: state.placement
1123
- })) : tetherOffset;
1124
- var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
1125
- mainAxis: tetherOffsetValue,
1126
- altAxis: tetherOffsetValue
1127
- } : Object.assign({
1128
- mainAxis: 0,
1129
- altAxis: 0
1130
- }, tetherOffsetValue);
1131
- var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1132
- var data = {
1133
- x: 0,
1134
- y: 0
1135
- };
1136
- if (!popperOffsets2) {
1137
- return;
1138
- }
1139
- if (checkMainAxis) {
1140
- var _offsetModifierState$;
1141
- var mainSide = mainAxis === "y" ? top : left;
1142
- var altSide = mainAxis === "y" ? bottom : right;
1143
- var len = mainAxis === "y" ? "height" : "width";
1144
- var offset2 = popperOffsets2[mainAxis];
1145
- var min$1 = offset2 + overflow[mainSide];
1146
- var max$1 = offset2 - overflow[altSide];
1147
- var additive = tether ? -popperRect[len] / 2 : 0;
1148
- var minLen = variation === start ? referenceRect[len] : popperRect[len];
1149
- var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
1150
- var arrowElement = state.elements.arrow;
1151
- var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1152
- width: 0,
1153
- height: 0
1154
- };
1155
- var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
1156
- var arrowPaddingMin = arrowPaddingObject[mainSide];
1157
- var arrowPaddingMax = arrowPaddingObject[altSide];
1158
- var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1159
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1160
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1161
- var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1162
- var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1163
- var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1164
- var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
1165
- var tetherMax = offset2 + maxOffset - offsetModifierValue;
1166
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$1, tetherMax) : max$1);
1167
- popperOffsets2[mainAxis] = preventedOffset;
1168
- data[mainAxis] = preventedOffset - offset2;
1169
- }
1170
- if (checkAltAxis) {
1171
- var _offsetModifierState$2;
1172
- var _mainSide = mainAxis === "x" ? top : left;
1173
- var _altSide = mainAxis === "x" ? bottom : right;
1174
- var _offset = popperOffsets2[altAxis];
1175
- var _len = altAxis === "y" ? "height" : "width";
1176
- var _min = _offset + overflow[_mainSide];
1177
- var _max = _offset - overflow[_altSide];
1178
- var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1179
- var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1180
- var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1181
- var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1182
- var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1183
- popperOffsets2[altAxis] = _preventedOffset;
1184
- data[altAxis] = _preventedOffset - _offset;
1185
- }
1186
- state.modifiersData[name] = data;
1187
- }
1188
- const preventOverflow$1 = {
1189
- name: "preventOverflow",
1190
- enabled: true,
1191
- phase: "main",
1192
- fn: preventOverflow,
1193
- requiresIfExists: ["offset"]
1194
- };
1195
- function getHTMLElementScroll(element) {
1196
- return {
1197
- scrollLeft: element.scrollLeft,
1198
- scrollTop: element.scrollTop
1199
- };
1200
- }
1201
- function getNodeScroll(node) {
1202
- if (node === getWindow(node) || !isHTMLElement$1(node)) {
1203
- return getWindowScroll(node);
1204
- } else {
1205
- return getHTMLElementScroll(node);
1206
- }
1207
- }
1208
- function isElementScaled(element) {
1209
- var rect = element.getBoundingClientRect();
1210
- var scaleX = round(rect.width) / element.offsetWidth || 1;
1211
- var scaleY = round(rect.height) / element.offsetHeight || 1;
1212
- return scaleX !== 1 || scaleY !== 1;
1213
- }
1214
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1215
- if (isFixed === void 0) {
1216
- isFixed = false;
1217
- }
1218
- var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
1219
- var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
1220
- var documentElement = getDocumentElement(offsetParent);
1221
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
1222
- var scroll = {
1223
- scrollLeft: 0,
1224
- scrollTop: 0
1225
- };
1226
- var offsets = {
1227
- x: 0,
1228
- y: 0
1229
- };
1230
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1231
- if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1232
- isScrollParent(documentElement)) {
1233
- scroll = getNodeScroll(offsetParent);
1234
- }
1235
- if (isHTMLElement$1(offsetParent)) {
1236
- offsets = getBoundingClientRect(offsetParent, true);
1237
- offsets.x += offsetParent.clientLeft;
1238
- offsets.y += offsetParent.clientTop;
1239
- } else if (documentElement) {
1240
- offsets.x = getWindowScrollBarX(documentElement);
1241
- }
1242
- }
1243
- return {
1244
- x: rect.left + scroll.scrollLeft - offsets.x,
1245
- y: rect.top + scroll.scrollTop - offsets.y,
1246
- width: rect.width,
1247
- height: rect.height
1248
- };
1249
- }
1250
- function order(modifiers) {
1251
- var map = /* @__PURE__ */ new Map();
1252
- var visited = /* @__PURE__ */ new Set();
1253
- var result = [];
1254
- modifiers.forEach(function(modifier) {
1255
- map.set(modifier.name, modifier);
1256
- });
1257
- function sort(modifier) {
1258
- visited.add(modifier.name);
1259
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1260
- requires.forEach(function(dep) {
1261
- if (!visited.has(dep)) {
1262
- var depModifier = map.get(dep);
1263
- if (depModifier) {
1264
- sort(depModifier);
1265
- }
1266
- }
1267
- });
1268
- result.push(modifier);
1269
- }
1270
- modifiers.forEach(function(modifier) {
1271
- if (!visited.has(modifier.name)) {
1272
- sort(modifier);
1273
- }
1274
- });
1275
- return result;
1276
- }
1277
- function orderModifiers(modifiers) {
1278
- var orderedModifiers = order(modifiers);
1279
- return modifierPhases.reduce(function(acc, phase) {
1280
- return acc.concat(orderedModifiers.filter(function(modifier) {
1281
- return modifier.phase === phase;
1282
- }));
1283
- }, []);
1284
- }
1285
- function debounce(fn2) {
1286
- var pending;
1287
- return function() {
1288
- if (!pending) {
1289
- pending = new Promise(function(resolve) {
1290
- Promise.resolve().then(function() {
1291
- pending = void 0;
1292
- resolve(fn2());
1293
- });
1294
- });
1295
- }
1296
- return pending;
1297
- };
1298
- }
1299
- function mergeByName(modifiers) {
1300
- var merged = modifiers.reduce(function(merged2, current) {
1301
- var existing = merged2[current.name];
1302
- merged2[current.name] = existing ? Object.assign({}, existing, current, {
1303
- options: Object.assign({}, existing.options, current.options),
1304
- data: Object.assign({}, existing.data, current.data)
1305
- }) : current;
1306
- return merged2;
1307
- }, {});
1308
- return Object.keys(merged).map(function(key) {
1309
- return merged[key];
1310
- });
1311
- }
1312
- var DEFAULT_OPTIONS = {
1313
- placement: "bottom",
1314
- modifiers: [],
1315
- strategy: "absolute"
1316
- };
1317
- function areValidElements() {
1318
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1319
- args[_key] = arguments[_key];
1320
- }
1321
- return !args.some(function(element) {
1322
- return !(element && typeof element.getBoundingClientRect === "function");
1323
- });
1324
- }
1325
- function popperGenerator(generatorOptions) {
1326
- if (generatorOptions === void 0) {
1327
- generatorOptions = {};
1328
- }
1329
- var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1330
- return function createPopper2(reference2, popper2, options) {
1331
- if (options === void 0) {
1332
- options = defaultOptions;
1333
- }
1334
- var state = {
1335
- placement: "bottom",
1336
- orderedModifiers: [],
1337
- options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1338
- modifiersData: {},
1339
- elements: {
1340
- reference: reference2,
1341
- popper: popper2
1342
- },
1343
- attributes: {},
1344
- styles: {}
1345
- };
1346
- var effectCleanupFns = [];
1347
- var isDestroyed = false;
1348
- var instance = {
1349
- state,
1350
- setOptions: function setOptions(setOptionsAction) {
1351
- var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
1352
- cleanupModifierEffects();
1353
- state.options = Object.assign({}, defaultOptions, state.options, options2);
1354
- state.scrollParents = {
1355
- reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
1356
- popper: listScrollParents(popper2)
1357
- };
1358
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
1359
- state.orderedModifiers = orderedModifiers.filter(function(m) {
1360
- return m.enabled;
1361
- });
1362
- runModifierEffects();
1363
- return instance.update();
1364
- },
1365
- // Sync update – it will always be executed, even if not necessary. This
1366
- // is useful for low frequency updates where sync behavior simplifies the
1367
- // logic.
1368
- // For high frequency updates (e.g. `resize` and `scroll` events), always
1369
- // prefer the async Popper#update method
1370
- forceUpdate: function forceUpdate() {
1371
- if (isDestroyed) {
1372
- return;
1373
- }
1374
- var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
1375
- if (!areValidElements(reference3, popper3)) {
1376
- return;
1377
- }
1378
- state.rects = {
1379
- reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
1380
- popper: getLayoutRect(popper3)
1381
- };
1382
- state.reset = false;
1383
- state.placement = state.options.placement;
1384
- state.orderedModifiers.forEach(function(modifier) {
1385
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1386
- });
1387
- for (var index = 0; index < state.orderedModifiers.length; index++) {
1388
- if (state.reset === true) {
1389
- state.reset = false;
1390
- index = -1;
1391
- continue;
1392
- }
1393
- var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
1394
- if (typeof fn2 === "function") {
1395
- state = fn2({
1396
- state,
1397
- options: _options,
1398
- name,
1399
- instance
1400
- }) || state;
1401
- }
1402
- }
1403
- },
1404
- // Async and optimistically optimized update – it will not be executed if
1405
- // not necessary (debounced to run at most once-per-tick)
1406
- update: debounce(function() {
1407
- return new Promise(function(resolve) {
1408
- instance.forceUpdate();
1409
- resolve(state);
1410
- });
1411
- }),
1412
- destroy: function destroy() {
1413
- cleanupModifierEffects();
1414
- isDestroyed = true;
1415
- }
1416
- };
1417
- if (!areValidElements(reference2, popper2)) {
1418
- return instance;
1419
- }
1420
- instance.setOptions(options).then(function(state2) {
1421
- if (!isDestroyed && options.onFirstUpdate) {
1422
- options.onFirstUpdate(state2);
1423
- }
1424
- });
1425
- function runModifierEffects() {
1426
- state.orderedModifiers.forEach(function(_ref) {
1427
- var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect2 = _ref.effect;
1428
- if (typeof effect2 === "function") {
1429
- var cleanupFn = effect2({
1430
- state,
1431
- name,
1432
- instance,
1433
- options: options2
1434
- });
1435
- var noopFn = function noopFn2() {
1436
- };
1437
- effectCleanupFns.push(cleanupFn || noopFn);
1438
- }
1439
- });
1440
- }
1441
- function cleanupModifierEffects() {
1442
- effectCleanupFns.forEach(function(fn2) {
1443
- return fn2();
1444
- });
1445
- effectCleanupFns = [];
1446
- }
1447
- return instance;
1448
- };
1449
- }
1450
- var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1451
- var createPopper = /* @__PURE__ */ popperGenerator({
1452
- defaultModifiers
1453
- });
1454
- function getPopperUtilityClass(slot) {
1455
- return generateUtilityClass("MuiPopper", slot);
1456
- }
1457
- generateUtilityClasses("MuiPopper", ["root"]);
1458
- const _excluded$2 = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "placement", "popperOptions", "popperRef", "slotProps", "slots", "TransitionProps", "ownerState"], _excluded2 = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition", "slotProps", "slots"];
1459
- function flipPlacement(placement, direction) {
1460
- if (direction === "ltr") {
1461
- return placement;
1462
- }
1463
- switch (placement) {
1464
- case "bottom-end":
1465
- return "bottom-start";
1466
- case "bottom-start":
1467
- return "bottom-end";
1468
- case "top-end":
1469
- return "top-start";
1470
- case "top-start":
1471
- return "top-end";
1472
- default:
1473
- return placement;
1474
- }
1475
- }
1476
- function resolveAnchorEl(anchorEl) {
1477
- return typeof anchorEl === "function" ? anchorEl() : anchorEl;
1478
- }
1479
- function isHTMLElement(element) {
1480
- return element.nodeType !== void 0;
1481
- }
1482
- function isVirtualElement(element) {
1483
- return !isHTMLElement(element);
1484
- }
1485
- const useUtilityClasses = (ownerState) => {
1486
- const {
1487
- classes
1488
- } = ownerState;
1489
- const slots = {
1490
- root: ["root"]
1491
- };
1492
- return composeClasses(slots, getPopperUtilityClass, classes);
1493
- };
1494
- const defaultPopperOptions = {};
1495
- const PopperTooltip = /* @__PURE__ */ React.forwardRef(function PopperTooltip2(props, forwardedRef) {
1496
- var _slots$root;
1497
- const {
1498
- anchorEl,
1499
- children,
1500
- direction,
1501
- disablePortal,
1502
- modifiers,
1503
- open,
1504
- placement: initialPlacement,
1505
- popperOptions,
1506
- popperRef: popperRefProp,
1507
- slotProps = {},
1508
- slots = {},
1509
- TransitionProps
1510
- // @ts-ignore internal logic
1511
- // prevent from spreading to DOM, it can come from the parent component e.g. Select.
1512
- } = props, other = _objectWithoutPropertiesLoose(props, _excluded$2);
1513
- const tooltipRef = React.useRef(null);
1514
- const ownRef = useForkRef(tooltipRef, forwardedRef);
1515
- const popperRef = React.useRef(null);
1516
- const handlePopperRef = useForkRef(popperRef, popperRefProp);
1517
- const handlePopperRefRef = React.useRef(handlePopperRef);
1518
- useEnhancedEffect(() => {
1519
- handlePopperRefRef.current = handlePopperRef;
1520
- }, [handlePopperRef]);
1521
- React.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1522
- const rtlPlacement = flipPlacement(initialPlacement, direction);
1523
- const [placement, setPlacement] = React.useState(rtlPlacement);
1524
- const [resolvedAnchorElement, setResolvedAnchorElement] = React.useState(resolveAnchorEl(anchorEl));
1525
- React.useEffect(() => {
1526
- if (popperRef.current) {
1527
- popperRef.current.forceUpdate();
1528
- }
1529
- });
1530
- React.useEffect(() => {
1531
- if (anchorEl) {
1532
- setResolvedAnchorElement(resolveAnchorEl(anchorEl));
1533
- }
1534
- }, [anchorEl]);
1535
- useEnhancedEffect(() => {
1536
- if (!resolvedAnchorElement || !open) {
1537
- return void 0;
1538
- }
1539
- const handlePopperUpdate = (data) => {
1540
- setPlacement(data.placement);
1541
- };
1542
- if (process$1.env.NODE_ENV !== "production") {
1543
- if (resolvedAnchorElement && isHTMLElement(resolvedAnchorElement) && resolvedAnchorElement.nodeType === 1) {
1544
- const box = resolvedAnchorElement.getBoundingClientRect();
1545
- if (process$1.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
1546
- }
1547
- }
1548
- }
1549
- let popperModifiers = [{
1550
- name: "preventOverflow",
1551
- options: {
1552
- altBoundary: disablePortal
1553
- }
1554
- }, {
1555
- name: "flip",
1556
- options: {
1557
- altBoundary: disablePortal
1558
- }
1559
- }, {
1560
- name: "onUpdate",
1561
- enabled: true,
1562
- phase: "afterWrite",
1563
- fn: ({
1564
- state
1565
- }) => {
1566
- handlePopperUpdate(state);
1567
- }
1568
- }];
1569
- if (modifiers != null) {
1570
- popperModifiers = popperModifiers.concat(modifiers);
1571
- }
1572
- if (popperOptions && popperOptions.modifiers != null) {
1573
- popperModifiers = popperModifiers.concat(popperOptions.modifiers);
1574
- }
1575
- const popper2 = createPopper(resolvedAnchorElement, tooltipRef.current, _extends({
1576
- placement: rtlPlacement
1577
- }, popperOptions, {
1578
- modifiers: popperModifiers
1579
- }));
1580
- handlePopperRefRef.current(popper2);
1581
- return () => {
1582
- popper2.destroy();
1583
- handlePopperRefRef.current(null);
1584
- };
1585
- }, [resolvedAnchorElement, disablePortal, modifiers, open, popperOptions, rtlPlacement]);
1586
- const childProps = {
1587
- placement
1588
- };
1589
- if (TransitionProps !== null) {
1590
- childProps.TransitionProps = TransitionProps;
1591
- }
1592
- const classes = useUtilityClasses(props);
1593
- const Root = (_slots$root = slots.root) != null ? _slots$root : "div";
1594
- const rootProps = useSlotProps({
1595
- elementType: Root,
1596
- externalSlotProps: slotProps.root,
1597
- externalForwardedProps: other,
1598
- additionalProps: {
1599
- role: "tooltip",
1600
- ref: ownRef
1601
- },
1602
- ownerState: props,
1603
- className: classes.root
1604
- });
1605
- return /* @__PURE__ */ jsx(Root, _extends({}, rootProps, {
1606
- children: typeof children === "function" ? children(childProps) : children
1607
- }));
1608
- });
1609
- const Popper$1 = /* @__PURE__ */ React.forwardRef(function Popper(props, forwardedRef) {
1610
- const {
1611
- anchorEl,
1612
- children,
1613
- container: containerProp,
1614
- direction = "ltr",
1615
- disablePortal = false,
1616
- keepMounted = false,
1617
- modifiers,
1618
- open,
1619
- placement = "bottom",
1620
- popperOptions = defaultPopperOptions,
1621
- popperRef,
1622
- style,
1623
- transition = false,
1624
- slotProps = {},
1625
- slots = {}
1626
- } = props, other = _objectWithoutPropertiesLoose(props, _excluded2);
1627
- const [exited, setExited] = React.useState(true);
1628
- const handleEnter = () => {
1629
- setExited(false);
1630
- };
1631
- const handleExited = () => {
1632
- setExited(true);
1633
- };
1634
- if (!keepMounted && !open && (!transition || exited)) {
1635
- return null;
1636
- }
1637
- let container;
1638
- if (containerProp) {
1639
- container = containerProp;
1640
- } else if (anchorEl) {
1641
- const resolvedAnchorEl = resolveAnchorEl(anchorEl);
1642
- container = resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) ? ownerDocument(resolvedAnchorEl).body : ownerDocument(null).body;
1643
- }
1644
- const display = !open && keepMounted && (!transition || exited) ? "none" : void 0;
1645
- const transitionProps = transition ? {
1646
- in: open,
1647
- onEnter: handleEnter,
1648
- onExited: handleExited
1649
- } : void 0;
1650
- return /* @__PURE__ */ jsx(Portal, {
1651
- disablePortal,
1652
- container,
1653
- children: /* @__PURE__ */ jsx(PopperTooltip, _extends({
1654
- anchorEl,
1655
- direction,
1656
- disablePortal,
1657
- modifiers,
1658
- ref: forwardedRef,
1659
- open: transition ? !exited : open,
1660
- placement,
1661
- popperOptions,
1662
- popperRef,
1663
- slotProps,
1664
- slots
1665
- }, other, {
1666
- style: _extends({
1667
- // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
1668
- position: "fixed",
1669
- // Fix Popper.js display issue
1670
- top: 0,
1671
- left: 0,
1672
- display
1673
- }, style),
1674
- TransitionProps: transitionProps,
1675
- children
1676
- }))
1677
- });
1678
- });
1679
- process$1.env.NODE_ENV !== "production" ? Popper$1.propTypes = {
1680
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1681
- // │ These PropTypes are generated from the TypeScript type definitions. │
1682
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1683
- // └─────────────────────────────────────────────────────────────────────┘
1684
- /**
1685
- * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
1686
- * or a function that returns either.
1687
- * It's used to set the position of the popper.
1688
- * The return value will passed as the reference object of the Popper instance.
1689
- */
1690
- anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]), (props) => {
1691
- if (props.open) {
1692
- const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
1693
- if (resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) && resolvedAnchorEl.nodeType === 1) {
1694
- const box = resolvedAnchorEl.getBoundingClientRect();
1695
- if (process$1.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
1696
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
1697
- }
1698
- } else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== "function" || isVirtualElement(resolvedAnchorEl) && resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
1699
- return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "It should be an HTML element instance or a virtualElement ", "(https://popper.js.org/docs/v2/virtual-elements/)."].join("\n"));
1700
- }
1701
- }
1702
- return null;
1703
- }),
1704
- /**
1705
- * Popper render function or node.
1706
- */
1707
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
1708
- /**
1709
- * An HTML element or function that returns one.
1710
- * The `container` will have the portal children appended to it.
1711
- *
1712
- * You can also provide a callback, which is called in a React layout effect.
1713
- * This lets you set the container from a ref, and also makes server-side rendering possible.
1714
- *
1715
- * By default, it uses the body of the top-level document object,
1716
- * so it's simply `document.body` most of the time.
1717
- */
1718
- container: PropTypes.oneOfType([HTMLElementType, PropTypes.func]),
1719
- /**
1720
- * Direction of the text.
1721
- * @default 'ltr'
1722
- */
1723
- direction: PropTypes.oneOf(["ltr", "rtl"]),
1724
- /**
1725
- * The `children` will be under the DOM hierarchy of the parent component.
1726
- * @default false
1727
- */
1728
- disablePortal: PropTypes.bool,
1729
- /**
1730
- * Always keep the children in the DOM.
1731
- * This prop can be useful in SEO situation or
1732
- * when you want to maximize the responsiveness of the Popper.
1733
- * @default false
1734
- */
1735
- keepMounted: PropTypes.bool,
1736
- /**
1737
- * Popper.js is based on a "plugin-like" architecture,
1738
- * most of its features are fully encapsulated "modifiers".
1739
- *
1740
- * A modifier is a function that is called each time Popper.js needs to
1741
- * compute the position of the popper.
1742
- * For this reason, modifiers should be very performant to avoid bottlenecks.
1743
- * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
1744
- */
1745
- modifiers: PropTypes.arrayOf(PropTypes.shape({
1746
- data: PropTypes.object,
1747
- effect: PropTypes.func,
1748
- enabled: PropTypes.bool,
1749
- fn: PropTypes.func,
1750
- name: PropTypes.any,
1751
- options: PropTypes.object,
1752
- phase: PropTypes.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
1753
- requires: PropTypes.arrayOf(PropTypes.string),
1754
- requiresIfExists: PropTypes.arrayOf(PropTypes.string)
1755
- })),
1756
- /**
1757
- * If `true`, the component is shown.
1758
- */
1759
- open: PropTypes.bool.isRequired,
1760
- /**
1761
- * Popper placement.
1762
- * @default 'bottom'
1763
- */
1764
- placement: PropTypes.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1765
- /**
1766
- * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
1767
- * @default {}
1768
- */
1769
- popperOptions: PropTypes.shape({
1770
- modifiers: PropTypes.array,
1771
- onFirstUpdate: PropTypes.func,
1772
- placement: PropTypes.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1773
- strategy: PropTypes.oneOf(["absolute", "fixed"])
1774
- }),
1775
- /**
1776
- * A ref that points to the used popper instance.
1777
- */
1778
- popperRef: refType,
1779
- /**
1780
- * The props used for each slot inside the Popper.
1781
- * @default {}
1782
- */
1783
- slotProps: PropTypes.shape({
1784
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
1785
- }),
1786
- /**
1787
- * The components used for each slot inside the Popper.
1788
- * Either a string to use a HTML element or a component.
1789
- * @default {}
1790
- */
1791
- slots: PropTypes.shape({
1792
- root: PropTypes.elementType
1793
- }),
1794
- /**
1795
- * Help supporting a react-transition-group/Transition component.
1796
- * @default false
1797
- */
1798
- transition: PropTypes.bool
1799
- } : void 0;
1800
- const _excluded$1 = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
1801
- const PopperRoot = styled(Popper$1, {
1802
- name: "MuiPopper",
1803
- slot: "Root",
1804
- overridesResolver: (props, styles2) => styles2.root
1805
- })({});
1806
- const Popper2 = /* @__PURE__ */ React.forwardRef(function Popper3(inProps, ref) {
1807
- var _slots$root;
1808
- const theme = useTheme();
1809
- const props = useDefaultProps({
1810
- props: inProps,
1811
- name: "MuiPopper"
1812
- });
1813
- const {
1814
- anchorEl,
1815
- component,
1816
- components,
1817
- componentsProps,
1818
- container,
1819
- disablePortal,
1820
- keepMounted,
1821
- modifiers,
1822
- open,
1823
- placement,
1824
- popperOptions,
1825
- popperRef,
1826
- transition,
1827
- slots,
1828
- slotProps
1829
- } = props, other = _objectWithoutPropertiesLoose(props, _excluded$1);
1830
- const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
1831
- const otherProps = _extends({
1832
- anchorEl,
1833
- container,
1834
- disablePortal,
1835
- keepMounted,
1836
- modifiers,
1837
- open,
1838
- placement,
1839
- popperOptions,
1840
- popperRef,
1841
- transition
1842
- }, other);
1843
- return /* @__PURE__ */ jsx(PopperRoot, _extends({
1844
- as: component,
1845
- direction: theme == null ? void 0 : theme.direction,
1846
- slots: {
1847
- root: RootComponent
1848
- },
1849
- slotProps: slotProps != null ? slotProps : componentsProps
1850
- }, otherProps, {
1851
- ref
1852
- }));
1853
- });
1854
- process$1.env.NODE_ENV !== "production" ? Popper2.propTypes = {
1855
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1856
- // │ These PropTypes are generated from the TypeScript type definitions. │
1857
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
1858
- // └─────────────────────────────────────────────────────────────────────┘
1859
- /**
1860
- * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
1861
- * or a function that returns either.
1862
- * It's used to set the position of the popper.
1863
- * The return value will passed as the reference object of the Popper instance.
1864
- */
1865
- anchorEl: PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
1866
- /**
1867
- * Popper render function or node.
1868
- */
1869
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
1870
- /**
1871
- * The component used for the root node.
1872
- * Either a string to use a HTML element or a component.
1873
- */
1874
- component: PropTypes.elementType,
1875
- /**
1876
- * The components used for each slot inside the Popper.
1877
- * Either a string to use a HTML element or a component.
1878
- * @default {}
1879
- */
1880
- components: PropTypes.shape({
1881
- Root: PropTypes.elementType
1882
- }),
1883
- /**
1884
- * The props used for each slot inside the Popper.
1885
- * @default {}
1886
- */
1887
- componentsProps: PropTypes.shape({
1888
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
1889
- }),
1890
- /**
1891
- * An HTML element or function that returns one.
1892
- * The `container` will have the portal children appended to it.
1893
- *
1894
- * You can also provide a callback, which is called in a React layout effect.
1895
- * This lets you set the container from a ref, and also makes server-side rendering possible.
1896
- *
1897
- * By default, it uses the body of the top-level document object,
1898
- * so it's simply `document.body` most of the time.
1899
- */
1900
- container: PropTypes.oneOfType([HTMLElementType, PropTypes.func]),
1901
- /**
1902
- * The `children` will be under the DOM hierarchy of the parent component.
1903
- * @default false
1904
- */
1905
- disablePortal: PropTypes.bool,
1906
- /**
1907
- * Always keep the children in the DOM.
1908
- * This prop can be useful in SEO situation or
1909
- * when you want to maximize the responsiveness of the Popper.
1910
- * @default false
1911
- */
1912
- keepMounted: PropTypes.bool,
1913
- /**
1914
- * Popper.js is based on a "plugin-like" architecture,
1915
- * most of its features are fully encapsulated "modifiers".
1916
- *
1917
- * A modifier is a function that is called each time Popper.js needs to
1918
- * compute the position of the popper.
1919
- * For this reason, modifiers should be very performant to avoid bottlenecks.
1920
- * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
1921
- */
1922
- modifiers: PropTypes.arrayOf(PropTypes.shape({
1923
- data: PropTypes.object,
1924
- effect: PropTypes.func,
1925
- enabled: PropTypes.bool,
1926
- fn: PropTypes.func,
1927
- name: PropTypes.any,
1928
- options: PropTypes.object,
1929
- phase: PropTypes.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
1930
- requires: PropTypes.arrayOf(PropTypes.string),
1931
- requiresIfExists: PropTypes.arrayOf(PropTypes.string)
1932
- })),
1933
- /**
1934
- * If `true`, the component is shown.
1935
- */
1936
- open: PropTypes.bool.isRequired,
1937
- /**
1938
- * Popper placement.
1939
- * @default 'bottom'
1940
- */
1941
- placement: PropTypes.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1942
- /**
1943
- * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
1944
- * @default {}
1945
- */
1946
- popperOptions: PropTypes.shape({
1947
- modifiers: PropTypes.array,
1948
- onFirstUpdate: PropTypes.func,
1949
- placement: PropTypes.oneOf(["auto-end", "auto-start", "auto", "bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
1950
- strategy: PropTypes.oneOf(["absolute", "fixed"])
1951
- }),
1952
- /**
1953
- * A ref that points to the used popper instance.
1954
- */
1955
- popperRef: refType,
1956
- /**
1957
- * The props used for each slot inside the Popper.
1958
- * @default {}
1959
- */
1960
- slotProps: PropTypes.shape({
1961
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
1962
- }),
1963
- /**
1964
- * The components used for each slot inside the Popper.
1965
- * Either a string to use a HTML element or a component.
1966
- * @default {}
1967
- */
1968
- slots: PropTypes.shape({
1969
- root: PropTypes.elementType
1970
- }),
1971
- /**
1972
- * The system prop that allows defining system overrides as well as additional CSS styles.
1973
- */
1974
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
1975
- /**
1976
- * Help supporting a react-transition-group/Transition component.
1977
- * @default false
1978
- */
1979
- transition: PropTypes.bool
1980
- } : void 0;
1981
- const _excluded = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
1982
- function getScale(value) {
1983
- return `scale(${value}, ${value ** 2})`;
1984
- }
1985
- const styles = {
1986
- entering: {
1987
- opacity: 1,
1988
- transform: getScale(1)
1989
- },
1990
- entered: {
1991
- opacity: 1,
1992
- transform: "none"
1993
- }
1994
- };
1995
- const isWebKit154 = typeof navigator !== "undefined" && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);
1996
- const Grow = /* @__PURE__ */ React.forwardRef(function Grow2(props, ref) {
1997
- const {
1998
- addEndListener,
1999
- appear = true,
2000
- children,
2001
- easing,
2002
- in: inProp,
2003
- onEnter,
2004
- onEntered,
2005
- onEntering,
2006
- onExit,
2007
- onExited,
2008
- onExiting,
2009
- style,
2010
- timeout = "auto",
2011
- // eslint-disable-next-line react/prop-types
2012
- TransitionComponent = Transition
2013
- } = props, other = _objectWithoutPropertiesLoose(props, _excluded);
2014
- const timer = useTimeout();
2015
- const autoTimeout = React.useRef();
2016
- const theme = useTheme$1();
2017
- const nodeRef = React.useRef(null);
2018
- const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
2019
- const normalizedTransitionCallback = (callback) => (maybeIsAppearing) => {
2020
- if (callback) {
2021
- const node = nodeRef.current;
2022
- if (maybeIsAppearing === void 0) {
2023
- callback(node);
2024
- } else {
2025
- callback(node, maybeIsAppearing);
2026
- }
2027
- }
2028
- };
2029
- const handleEntering = normalizedTransitionCallback(onEntering);
2030
- const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
2031
- reflow(node);
2032
- const {
2033
- duration: transitionDuration,
2034
- delay,
2035
- easing: transitionTimingFunction
2036
- } = getTransitionProps({
2037
- style,
2038
- timeout,
2039
- easing
2040
- }, {
2041
- mode: "enter"
2042
- });
2043
- let duration;
2044
- if (timeout === "auto") {
2045
- duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
2046
- autoTimeout.current = duration;
2047
- } else {
2048
- duration = transitionDuration;
2049
- }
2050
- node.style.transition = [theme.transitions.create("opacity", {
2051
- duration,
2052
- delay
2053
- }), theme.transitions.create("transform", {
2054
- duration: isWebKit154 ? duration : duration * 0.666,
2055
- delay,
2056
- easing: transitionTimingFunction
2057
- })].join(",");
2058
- if (onEnter) {
2059
- onEnter(node, isAppearing);
2060
- }
2061
- });
2062
- const handleEntered = normalizedTransitionCallback(onEntered);
2063
- const handleExiting = normalizedTransitionCallback(onExiting);
2064
- const handleExit = normalizedTransitionCallback((node) => {
2065
- const {
2066
- duration: transitionDuration,
2067
- delay,
2068
- easing: transitionTimingFunction
2069
- } = getTransitionProps({
2070
- style,
2071
- timeout,
2072
- easing
2073
- }, {
2074
- mode: "exit"
2075
- });
2076
- let duration;
2077
- if (timeout === "auto") {
2078
- duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
2079
- autoTimeout.current = duration;
2080
- } else {
2081
- duration = transitionDuration;
2082
- }
2083
- node.style.transition = [theme.transitions.create("opacity", {
2084
- duration,
2085
- delay
2086
- }), theme.transitions.create("transform", {
2087
- duration: isWebKit154 ? duration : duration * 0.666,
2088
- delay: isWebKit154 ? delay : delay || duration * 0.333,
2089
- easing: transitionTimingFunction
2090
- })].join(",");
2091
- node.style.opacity = 0;
2092
- node.style.transform = getScale(0.75);
2093
- if (onExit) {
2094
- onExit(node);
2095
- }
2096
- });
2097
- const handleExited = normalizedTransitionCallback(onExited);
2098
- const handleAddEndListener = (next) => {
2099
- if (timeout === "auto") {
2100
- timer.start(autoTimeout.current || 0, next);
2101
- }
2102
- if (addEndListener) {
2103
- addEndListener(nodeRef.current, next);
2104
- }
2105
- };
2106
- return /* @__PURE__ */ jsx(TransitionComponent, _extends({
2107
- appear,
2108
- in: inProp,
2109
- nodeRef,
2110
- onEnter: handleEnter,
2111
- onEntered: handleEntered,
2112
- onEntering: handleEntering,
2113
- onExit: handleExit,
2114
- onExited: handleExited,
2115
- onExiting: handleExiting,
2116
- addEndListener: handleAddEndListener,
2117
- timeout: timeout === "auto" ? null : timeout
2118
- }, other, {
2119
- children: (state, childProps) => {
2120
- return /* @__PURE__ */ React.cloneElement(children, _extends({
2121
- style: _extends({
2122
- opacity: 0,
2123
- transform: getScale(0.75),
2124
- visibility: state === "exited" && !inProp ? "hidden" : void 0
2125
- }, styles[state], style, children.props.style),
2126
- ref: handleRef
2127
- }, childProps));
2128
- }
2129
- }));
2130
- });
2131
- process$1.env.NODE_ENV !== "production" ? Grow.propTypes = {
2132
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2133
- // │ These PropTypes are generated from the TypeScript type definitions. │
2134
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
2135
- // └─────────────────────────────────────────────────────────────────────┘
2136
- /**
2137
- * Add a custom transition end trigger. Called with the transitioning DOM
2138
- * node and a done callback. Allows for more fine grained transition end
2139
- * logic. Note: Timeouts are still used as a fallback if provided.
2140
- */
2141
- addEndListener: PropTypes.func,
2142
- /**
2143
- * Perform the enter transition when it first mounts if `in` is also `true`.
2144
- * Set this to `false` to disable this behavior.
2145
- * @default true
2146
- */
2147
- appear: PropTypes.bool,
2148
- /**
2149
- * A single child content element.
2150
- */
2151
- children: elementAcceptingRef.isRequired,
2152
- /**
2153
- * The transition timing function.
2154
- * You may specify a single easing or a object containing enter and exit values.
2155
- */
2156
- easing: PropTypes.oneOfType([PropTypes.shape({
2157
- enter: PropTypes.string,
2158
- exit: PropTypes.string
2159
- }), PropTypes.string]),
2160
- /**
2161
- * If `true`, the component will transition in.
2162
- */
2163
- in: PropTypes.bool,
2164
- /**
2165
- * @ignore
2166
- */
2167
- onEnter: PropTypes.func,
2168
- /**
2169
- * @ignore
2170
- */
2171
- onEntered: PropTypes.func,
2172
- /**
2173
- * @ignore
2174
- */
2175
- onEntering: PropTypes.func,
2176
- /**
2177
- * @ignore
2178
- */
2179
- onExit: PropTypes.func,
2180
- /**
2181
- * @ignore
2182
- */
2183
- onExited: PropTypes.func,
2184
- /**
2185
- * @ignore
2186
- */
2187
- onExiting: PropTypes.func,
2188
- /**
2189
- * @ignore
2190
- */
2191
- style: PropTypes.object,
2192
- /**
2193
- * The duration for the transition, in milliseconds.
2194
- * You may specify a single timeout for all transitions, or individually with an object.
2195
- *
2196
- * Set to 'auto' to automatically calculate transition time based on height.
2197
- * @default 'auto'
2198
- */
2199
- timeout: PropTypes.oneOfType([PropTypes.oneOf(["auto"]), PropTypes.number, PropTypes.shape({
2200
- appear: PropTypes.number,
2201
- enter: PropTypes.number,
2202
- exit: PropTypes.number
2203
- })])
2204
- } : void 0;
2205
- Grow.muiSupportAuto = true;
2206
- export {
2207
- Grow as G,
2208
- Popper2 as P,
2209
- useId as a,
2210
- useRtl as b,
2211
- useControlled as u
2212
- };