tttb 0.1.24

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 (235) hide show
  1. package/README.md +42 -0
  2. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  3. package/dist/components/Button/index.js +6 -0
  4. package/dist/components/Button/index.vue.js +7 -0
  5. package/dist/components/Button/index.vue2.js +57 -0
  6. package/dist/components/Button/types.js +8 -0
  7. package/dist/components/Checkbox/index.js +6 -0
  8. package/dist/components/Checkbox/index.vue.js +7 -0
  9. package/dist/components/Checkbox/index.vue2.js +35 -0
  10. package/dist/components/Checkbox/types.js +7 -0
  11. package/dist/components/Dialog/DialogItem.vue.js +7 -0
  12. package/dist/components/Dialog/DialogItem.vue2.js +78 -0
  13. package/dist/components/Dialog/DialogPrompt.vue.js +7 -0
  14. package/dist/components/Dialog/DialogPrompt.vue2.js +63 -0
  15. package/dist/components/Dialog/index.js +6 -0
  16. package/dist/components/Dialog/index.vue.js +7 -0
  17. package/dist/components/Dialog/index.vue2.js +81 -0
  18. package/dist/components/Icon/index.js +6 -0
  19. package/dist/components/Icon/index.vue.js +43 -0
  20. package/dist/components/Icon/index.vue2.js +4 -0
  21. package/dist/components/Loading/index.js +6 -0
  22. package/dist/components/Loading/index.vue.js +7 -0
  23. package/dist/components/Loading/index.vue2.js +37 -0
  24. package/dist/components/Loading/types.js +7 -0
  25. package/dist/components/Message/index.js +6 -0
  26. package/dist/components/Message/index.vue.js +7 -0
  27. package/dist/components/Message/index.vue2.js +91 -0
  28. package/dist/components/Modal/index.js +6 -0
  29. package/dist/components/Modal/index.vue.js +7 -0
  30. package/dist/components/Modal/index.vue2.js +39 -0
  31. package/dist/components/Modal/types.js +7 -0
  32. package/dist/components/Nav/index.js +6 -0
  33. package/dist/components/Nav/index.vue.js +7 -0
  34. package/dist/components/Nav/index.vue2.js +95 -0
  35. package/dist/components/Pagination/index.js +6 -0
  36. package/dist/components/Pagination/index.vue.js +7 -0
  37. package/dist/components/Pagination/index.vue2.js +162 -0
  38. package/dist/components/Pagination/types.js +8 -0
  39. package/dist/components/Popconfirm/index.js +7 -0
  40. package/dist/components/Popconfirm/index.vue.js +92 -0
  41. package/dist/components/Popconfirm/index.vue3.js +5 -0
  42. package/dist/components/Popconfirm/types.js +14 -0
  43. package/dist/components/Popover/index.js +7 -0
  44. package/dist/components/Popover/index.vue.js +32 -0
  45. package/dist/components/Popover/index.vue3.js +5 -0
  46. package/dist/components/Progress/index.js +6 -0
  47. package/dist/components/Progress/index.vue.js +7 -0
  48. package/dist/components/Progress/index.vue2.js +38 -0
  49. package/dist/components/Progress/types.js +7 -0
  50. package/dist/components/RouterNav/index.js +6 -0
  51. package/dist/components/RouterNav/index.vue.js +33 -0
  52. package/dist/components/RouterNav/index.vue2.js +4 -0
  53. package/dist/components/Switch/index.js +6 -0
  54. package/dist/components/Switch/index.vue.js +7 -0
  55. package/dist/components/Switch/index.vue2.js +76 -0
  56. package/dist/components/Switch/types.js +6 -0
  57. package/dist/components/Table/index.js +6 -0
  58. package/dist/components/Table/index.vue.js +7 -0
  59. package/dist/components/Table/index.vue2.js +57 -0
  60. package/dist/components/Timer/index.js +6 -0
  61. package/dist/components/Timer/index.vue.js +31 -0
  62. package/dist/components/Timer/index.vue2.js +4 -0
  63. package/dist/components/Tooltip/TooltipContent.vue.js +33 -0
  64. package/dist/components/Tooltip/TooltipContent.vue2.js +4 -0
  65. package/dist/components/Tooltip/TooltipItem.vue.js +58 -0
  66. package/dist/components/Tooltip/TooltipItem.vue2.js +4 -0
  67. package/dist/components/Tooltip/TooltipLayer.vue.js +49 -0
  68. package/dist/components/Tooltip/TooltipLayer.vue2.js +4 -0
  69. package/dist/components/Tooltip/index.js +6 -0
  70. package/dist/components/Tooltip/index.vue.js +74 -0
  71. package/dist/components/Tooltip/index.vue2.js +4 -0
  72. package/dist/components/Tooltip/manager.js +107 -0
  73. package/dist/components/Tooltip/types.js +21 -0
  74. package/dist/components/Tooltip/useTooltip.js +43 -0
  75. package/dist/components/Warn/index.js +6 -0
  76. package/dist/components/Warn/index.vue.js +7 -0
  77. package/dist/components/Warn/index.vue2.js +21 -0
  78. package/dist/components/Warn/types.js +6 -0
  79. package/dist/components/Watermark/index.js +6 -0
  80. package/dist/components/Watermark/index.vue.js +7 -0
  81. package/dist/components/Watermark/index.vue2.js +54 -0
  82. package/dist/components/Watermark/types.js +10 -0
  83. package/dist/components/Watermark/useWatermarkBg.js +11 -0
  84. package/dist/components/helpers.js +25 -0
  85. package/dist/components.js +40 -0
  86. package/dist/directives/vBackTop.js +110 -0
  87. package/dist/directives/vDelayIn.js +41 -0
  88. package/dist/directives/vHoldPointer.js +112 -0
  89. package/dist/directives/vLazy.js +65 -0
  90. package/dist/directives/vLoading.js +50 -0
  91. package/dist/directives/vRipple.js +81 -0
  92. package/dist/directives/vSlideIn.js +39 -0
  93. package/dist/directives/vTextJump.js +50 -0
  94. package/dist/directives/vTooltip.js +55 -0
  95. package/dist/directives.js +20 -0
  96. package/dist/hooks/useAudio.js +112 -0
  97. package/dist/hooks/useElementScroll.js +30 -0
  98. package/dist/hooks/useGSAP.js +40 -0
  99. package/dist/hooks/useRefreshRate.js +26 -0
  100. package/dist/hooks/useWindowBackTop.js +86 -0
  101. package/dist/hooks.js +13 -0
  102. package/dist/icons/brands.js +554 -0
  103. package/dist/icons/regular.js +278 -0
  104. package/dist/icons/solid.js +1989 -0
  105. package/dist/index.js +130 -0
  106. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +448 -0
  107. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +400 -0
  108. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  109. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
  110. package/dist/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +131 -0
  111. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.js +3074 -0
  112. package/dist/node_modules/@fortawesome/free-brands-svg-icons/index.js +3156 -0
  113. package/dist/node_modules/@fortawesome/free-regular-svg-icons/index.js +1228 -0
  114. package/dist/node_modules/@fortawesome/free-solid-svg-icons/index.js +9602 -0
  115. package/dist/node_modules/@fortawesome/vue-fontawesome/index.es.js +487 -0
  116. package/dist/node_modules/gsap/CSSPlugin.js +424 -0
  117. package/dist/node_modules/gsap/gsap-core.js +1645 -0
  118. package/dist/node_modules/gsap/index.js +13 -0
  119. package/dist/tttb.css +1 -0
  120. package/dist/types/bundle.d.ts +10 -0
  121. package/dist/types/components/Button/index.d.ts +22 -0
  122. package/dist/types/components/Button/types.d.ts +12 -0
  123. package/dist/types/components/Checkbox/index.d.ts +29 -0
  124. package/dist/types/components/Checkbox/types.d.ts +8 -0
  125. package/dist/types/components/Dialog/DialogItem.d.ts +38 -0
  126. package/dist/types/components/Dialog/DialogPrompt.d.ts +16 -0
  127. package/dist/types/components/Dialog/index.d.ts +10 -0
  128. package/dist/types/components/Dialog/types.d.ts +35 -0
  129. package/dist/types/components/Icon/index.d.ts +3 -0
  130. package/dist/types/components/Icon/types.d.ts +2 -0
  131. package/dist/types/components/Loading/index.d.ts +6 -0
  132. package/dist/types/components/Loading/types.d.ts +8 -0
  133. package/dist/types/components/Message/index.d.ts +9 -0
  134. package/dist/types/components/Message/types.d.ts +12 -0
  135. package/dist/types/components/Modal/index.d.ts +21 -0
  136. package/dist/types/components/Modal/types.d.ts +11 -0
  137. package/dist/types/components/Nav/index.d.ts +7 -0
  138. package/dist/types/components/Nav/types.d.ts +14 -0
  139. package/dist/types/components/Pagination/index.d.ts +18 -0
  140. package/dist/types/components/Pagination/types.d.ts +16 -0
  141. package/dist/types/components/Popconfirm/index.d.ts +266 -0
  142. package/dist/types/components/Popconfirm/types.d.ts +26 -0
  143. package/dist/types/components/Popover/index.d.ts +150 -0
  144. package/dist/types/components/Progress/index.d.ts +21 -0
  145. package/dist/types/components/Progress/types.d.ts +9 -0
  146. package/dist/types/components/RouterNav/index.d.ts +2 -0
  147. package/dist/types/components/Switch/index.d.ts +13 -0
  148. package/dist/types/components/Switch/types.d.ts +6 -0
  149. package/dist/types/components/Table/index.d.ts +31 -0
  150. package/dist/types/components/Table/types.d.ts +3 -0
  151. package/dist/types/components/Timer/index.d.ts +6 -0
  152. package/dist/types/components/Tooltip/TooltipContent.d.ts +16 -0
  153. package/dist/types/components/Tooltip/TooltipItem.d.ts +45 -0
  154. package/dist/types/components/Tooltip/TooltipLayer.d.ts +2 -0
  155. package/dist/types/components/Tooltip/index.d.ts +42 -0
  156. package/dist/types/components/Tooltip/manager.d.ts +3384 -0
  157. package/dist/types/components/Tooltip/types.d.ts +52 -0
  158. package/dist/types/components/Tooltip/useTooltip.d.ts +8 -0
  159. package/dist/types/components/Warn/index.d.ts +20 -0
  160. package/dist/types/components/Warn/types.d.ts +6 -0
  161. package/dist/types/components/Watermark/index.d.ts +28 -0
  162. package/dist/types/components/Watermark/types.d.ts +14 -0
  163. package/dist/types/components/Watermark/useWatermarkBg.d.ts +6 -0
  164. package/dist/types/components/helpers.d.ts +14 -0
  165. package/dist/types/components/index.d.ts +19 -0
  166. package/dist/types/directives/helper.d.ts +4 -0
  167. package/dist/types/directives/index.d.ts +9 -0
  168. package/dist/types/directives/vBackTop.d.ts +3 -0
  169. package/dist/types/directives/vDelayIn.d.ts +3 -0
  170. package/dist/types/directives/vHoldPointer.d.ts +3 -0
  171. package/dist/types/directives/vLazy.d.ts +3 -0
  172. package/dist/types/directives/vLoading.d.ts +3 -0
  173. package/dist/types/directives/vRipple.d.ts +3 -0
  174. package/dist/types/directives/vSlideIn.d.ts +3 -0
  175. package/dist/types/directives/vTextJump.d.ts +3 -0
  176. package/dist/types/directives/vTooltip.d.ts +8 -0
  177. package/dist/types/hooks/index.d.ts +5 -0
  178. package/dist/types/hooks/useAudio.d.ts +38 -0
  179. package/dist/types/hooks/useElementScroll.d.ts +32 -0
  180. package/dist/types/hooks/useGSAP.d.ts +32 -0
  181. package/dist/types/hooks/useRefreshRate.d.ts +5 -0
  182. package/dist/types/hooks/useWindowBackTop.d.ts +14 -0
  183. package/dist/types/icons/brands.d.ts +551 -0
  184. package/dist/types/icons/regular.d.ts +275 -0
  185. package/dist/types/icons/solid.d.ts +1986 -0
  186. package/dist/types/router/index.d.ts +2 -0
  187. package/dist/types/utils/chance.d.ts +7 -0
  188. package/dist/types/utils/copyToClipboard.d.ts +6 -0
  189. package/dist/types/utils/debounce.d.ts +15 -0
  190. package/dist/types/utils/deepClone.d.ts +6 -0
  191. package/dist/types/utils/deepEqual.d.ts +5 -0
  192. package/dist/types/utils/dialog.d.ts +8 -0
  193. package/dist/types/utils/getId.d.ts +6 -0
  194. package/dist/types/utils/getRandomColor.d.ts +4 -0
  195. package/dist/types/utils/getRandomInt.d.ts +6 -0
  196. package/dist/types/utils/getRandomStr.d.ts +6 -0
  197. package/dist/types/utils/index.d.ts +23 -0
  198. package/dist/types/utils/injectStyles.d.ts +9 -0
  199. package/dist/types/utils/isElementOverflow.d.ts +20 -0
  200. package/dist/types/utils/isEmpty.d.ts +6 -0
  201. package/dist/types/utils/isMobile.d.ts +6 -0
  202. package/dist/types/utils/isObject.d.ts +4 -0
  203. package/dist/types/utils/isPromise.d.ts +6 -0
  204. package/dist/types/utils/localStorage.d.ts +24 -0
  205. package/dist/types/utils/msg.d.ts +8 -0
  206. package/dist/types/utils/omit.d.ts +6 -0
  207. package/dist/types/utils/pick.d.ts +6 -0
  208. package/dist/types/utils/sessionStorage.d.ts +24 -0
  209. package/dist/types/utils/shuffleArray.d.ts +6 -0
  210. package/dist/types/utils/throttle.d.ts +7 -0
  211. package/dist/utils/chance.js +7 -0
  212. package/dist/utils/copyToClipboard.js +21 -0
  213. package/dist/utils/debounce.js +14 -0
  214. package/dist/utils/deepClone.js +17 -0
  215. package/dist/utils/deepEqual.js +40 -0
  216. package/dist/utils/dialog.js +43 -0
  217. package/dist/utils/getId.js +10 -0
  218. package/dist/utils/getRandomColor.js +4 -0
  219. package/dist/utils/getRandomInt.js +4 -0
  220. package/dist/utils/getRandomStr.js +5 -0
  221. package/dist/utils/injectStyles.js +24 -0
  222. package/dist/utils/isElementOverflow.js +22 -0
  223. package/dist/utils/isEmpty.js +4 -0
  224. package/dist/utils/isMobile.js +7 -0
  225. package/dist/utils/isObject.js +4 -0
  226. package/dist/utils/isPromise.js +4 -0
  227. package/dist/utils/localStorage.js +47 -0
  228. package/dist/utils/msg.js +21 -0
  229. package/dist/utils/omit.js +9 -0
  230. package/dist/utils/pick.js +9 -0
  231. package/dist/utils/sessionStorage.js +47 -0
  232. package/dist/utils/shuffleArray.js +10 -0
  233. package/dist/utils/throttle.js +11 -0
  234. package/dist/utils.js +49 -0
  235. package/package.json +95 -0
package/dist/index.js ADDED
@@ -0,0 +1,130 @@
1
+ /* empty css */
2
+ import * as r from "./components.js";
3
+ import * as t from "./directives.js";
4
+ import { chance as l } from "./utils/chance.js";
5
+ import { copyToClipboard as d } from "./utils/copyToClipboard.js";
6
+ import { debounce as i } from "./utils/debounce.js";
7
+ import { deepClone as c } from "./utils/deepClone.js";
8
+ import { deepEqual as v } from "./utils/deepEqual.js";
9
+ import { dialog as T } from "./utils/dialog.js";
10
+ import { getId as h } from "./utils/getId.js";
11
+ import { getRandomColor as R } from "./utils/getRandomColor.js";
12
+ import { getRandomInt as y } from "./utils/getRandomInt.js";
13
+ import { getRandomStr as O, getRandomString as k } from "./utils/getRandomStr.js";
14
+ import { injectStyles as A } from "./utils/injectStyles.js";
15
+ import { isElementOverflow as L } from "./utils/isElementOverflow.js";
16
+ import { isEmpty as B } from "./utils/isEmpty.js";
17
+ import { isMobile as M } from "./utils/isMobile.js";
18
+ import { isObject as W } from "./utils/isObject.js";
19
+ import { isPromise as z } from "./utils/isPromise.js";
20
+ import { localStorage as G } from "./utils/localStorage.js";
21
+ import { msg as J } from "./utils/msg.js";
22
+ import { omit as _ } from "./utils/omit.js";
23
+ import { pick as Q } from "./utils/pick.js";
24
+ import { sessionStorage as X } from "./utils/sessionStorage.js";
25
+ import { shuffleArray as Z } from "./utils/shuffleArray.js";
26
+ import { throttle as oo } from "./utils/throttle.js";
27
+ import { useAudio as ro } from "./hooks/useAudio.js";
28
+ import { useElementScroll as ao } from "./hooks/useElementScroll.js";
29
+ import { useGSAP as mo } from "./hooks/useGSAP.js";
30
+ import { useRefreshRate as so } from "./hooks/useRefreshRate.js";
31
+ import { DEFAULT_OPTIONS as xo, useWindowBackTop as uo } from "./hooks/useWindowBackTop.js";
32
+ import { default as no } from "./directives/vBackTop.js";
33
+ import { default as go } from "./directives/vDelayIn.js";
34
+ import { default as So } from "./directives/vHoldPointer.js";
35
+ import { default as bo } from "./directives/vLazy.js";
36
+ import { default as Po } from "./directives/vLoading.js";
37
+ import { default as Eo } from "./directives/vRipple.js";
38
+ import { default as Io } from "./directives/vSlideIn.js";
39
+ import { default as ko } from "./directives/vTextJump.js";
40
+ import { default as Ao } from "./directives/vTooltip.js";
41
+ import { default as Lo } from "./components/Button/index.js";
42
+ import { default as Bo } from "./components/Checkbox/index.js";
43
+ import { default as Mo } from "./components/Dialog/index.js";
44
+ import { default as Wo } from "./components/Icon/index.js";
45
+ import { default as zo } from "./components/Loading/index.js";
46
+ import { default as Go } from "./components/Message/index.js";
47
+ import { default as Jo } from "./components/Modal/index.js";
48
+ import { default as _o } from "./components/Nav/index.js";
49
+ import { default as Qo } from "./components/Pagination/index.js";
50
+ import { default as Xo } from "./components/Popconfirm/index.js";
51
+ import { default as Zo } from "./components/Popover/index.js";
52
+ import { default as oe } from "./components/Progress/index.js";
53
+ import { default as re } from "./components/RouterNav/index.js";
54
+ import { default as ae } from "./components/Switch/index.js";
55
+ import { default as me } from "./components/Table/index.js";
56
+ import { default as se } from "./components/Timer/index.js";
57
+ import { default as xe } from "./components/Tooltip/index.js";
58
+ import { default as ue } from "./components/Warn/index.js";
59
+ import { default as ne } from "./components/Watermark/index.js";
60
+ const a = (e) => {
61
+ Object.values(r).forEach((o) => {
62
+ e.component(o.name, o);
63
+ }), Object.values(t).forEach((o) => {
64
+ e.directive(o.name, o);
65
+ });
66
+ }, m = {
67
+ install: a
68
+ };
69
+ export {
70
+ Lo as Button,
71
+ Bo as Checkbox,
72
+ xo as DEFAULT_OPTIONS,
73
+ Mo as Dialog,
74
+ Wo as Icon,
75
+ zo as Loading,
76
+ Go as Message,
77
+ Jo as Modal,
78
+ _o as Nav,
79
+ Qo as Pagination,
80
+ Xo as Popconfirm,
81
+ Zo as Popover,
82
+ oe as Progress,
83
+ re as RouterNav,
84
+ ae as Switch,
85
+ me as Table,
86
+ se as Timer,
87
+ xe as Tooltip,
88
+ ue as Warn,
89
+ ne as Watermark,
90
+ l as chance,
91
+ d as copyToClipboard,
92
+ i as debounce,
93
+ c as deepClone,
94
+ v as deepEqual,
95
+ m as default,
96
+ T as dialog,
97
+ h as getId,
98
+ R as getRandomColor,
99
+ y as getRandomInt,
100
+ O as getRandomStr,
101
+ k as getRandomString,
102
+ A as injectStyles,
103
+ a as install,
104
+ L as isElementOverflow,
105
+ B as isEmpty,
106
+ M as isMobile,
107
+ W as isObject,
108
+ z as isPromise,
109
+ G as localStorage,
110
+ J as msg,
111
+ _ as omit,
112
+ Q as pick,
113
+ X as sessionStorage,
114
+ Z as shuffleArray,
115
+ oo as throttle,
116
+ ro as useAudio,
117
+ ao as useElementScroll,
118
+ mo as useGSAP,
119
+ so as useRefreshRate,
120
+ uo as useWindowBackTop,
121
+ no as vBackTop,
122
+ go as vDelayIn,
123
+ So as vHoldPointer,
124
+ bo as vLazy,
125
+ Po as vLoading,
126
+ Eo as vRipple,
127
+ Io as vSlideIn,
128
+ ko as vTextJump,
129
+ Ao as vTooltip
130
+ };
@@ -0,0 +1,448 @@
1
+ import { evaluate as V, getSide as j, getSideAxis as F, getOppositePlacement as N, getExpandedPlacements as Q, getOppositeAxisPlacements as U, getAlignmentSides as Z, clamp as Y, getAlignment as $, getOppositeAxis as ee, getPaddingObject as q, getAlignmentAxis as G, sides as te, getAxisLength as J, min as X, rectToClientRect as z } from "../../utils/dist/floating-ui.utils.js";
2
+ function I(t, e, m) {
3
+ let {
4
+ reference: s,
5
+ floating: r
6
+ } = t;
7
+ const i = F(e), a = G(e), o = J(a), d = j(e), g = i === "y", u = s.x + s.width / 2 - r.width / 2, c = s.y + s.height / 2 - r.height / 2, f = s[o] / 2 - r[o] / 2;
8
+ let n;
9
+ switch (d) {
10
+ case "top":
11
+ n = {
12
+ x: u,
13
+ y: s.y - r.height
14
+ };
15
+ break;
16
+ case "bottom":
17
+ n = {
18
+ x: u,
19
+ y: s.y + s.height
20
+ };
21
+ break;
22
+ case "right":
23
+ n = {
24
+ x: s.x + s.width,
25
+ y: c
26
+ };
27
+ break;
28
+ case "left":
29
+ n = {
30
+ x: s.x - r.width,
31
+ y: c
32
+ };
33
+ break;
34
+ default:
35
+ n = {
36
+ x: s.x,
37
+ y: s.y
38
+ };
39
+ }
40
+ switch ($(e)) {
41
+ case "start":
42
+ n[a] -= f * (m && g ? -1 : 1);
43
+ break;
44
+ case "end":
45
+ n[a] += f * (m && g ? -1 : 1);
46
+ break;
47
+ }
48
+ return n;
49
+ }
50
+ async function ne(t, e) {
51
+ var m;
52
+ e === void 0 && (e = {});
53
+ const {
54
+ x: s,
55
+ y: r,
56
+ platform: i,
57
+ rects: a,
58
+ elements: o,
59
+ strategy: d
60
+ } = t, {
61
+ boundary: g = "clippingAncestors",
62
+ rootBoundary: u = "viewport",
63
+ elementContext: c = "floating",
64
+ altBoundary: f = !1,
65
+ padding: n = 0
66
+ } = V(e, t), l = q(n), x = o[f ? c === "floating" ? "reference" : "floating" : c], p = z(await i.getClippingRect({
67
+ element: (m = await (i.isElement == null ? void 0 : i.isElement(x))) == null || m ? x : x.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
68
+ boundary: g,
69
+ rootBoundary: u,
70
+ strategy: d
71
+ })), v = c === "floating" ? {
72
+ x: s,
73
+ y: r,
74
+ width: a.floating.width,
75
+ height: a.floating.height
76
+ } : a.reference, h = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), y = await (i.isElement == null ? void 0 : i.isElement(h)) ? await (i.getScale == null ? void 0 : i.getScale(h)) || {
77
+ x: 1,
78
+ y: 1
79
+ } : {
80
+ x: 1,
81
+ y: 1
82
+ }, O = z(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
83
+ elements: o,
84
+ rect: v,
85
+ offsetParent: h,
86
+ strategy: d
87
+ }) : v);
88
+ return {
89
+ top: (p.top - O.top + l.top) / y.y,
90
+ bottom: (O.bottom - p.bottom + l.bottom) / y.y,
91
+ left: (p.left - O.left + l.left) / y.x,
92
+ right: (O.right - p.right + l.right) / y.x
93
+ };
94
+ }
95
+ const ae = async (t, e, m) => {
96
+ const {
97
+ placement: s = "bottom",
98
+ strategy: r = "absolute",
99
+ middleware: i = [],
100
+ platform: a
101
+ } = m, o = i.filter(Boolean), d = await (a.isRTL == null ? void 0 : a.isRTL(e));
102
+ let g = await a.getElementRects({
103
+ reference: t,
104
+ floating: e,
105
+ strategy: r
106
+ }), {
107
+ x: u,
108
+ y: c
109
+ } = I(g, s, d), f = s, n = {}, l = 0;
110
+ for (let x = 0; x < o.length; x++) {
111
+ var w;
112
+ const {
113
+ name: p,
114
+ fn: v
115
+ } = o[x], {
116
+ x: h,
117
+ y,
118
+ data: O,
119
+ reset: b
120
+ } = await v({
121
+ x: u,
122
+ y: c,
123
+ initialPlacement: s,
124
+ placement: f,
125
+ strategy: r,
126
+ middlewareData: n,
127
+ rects: g,
128
+ platform: {
129
+ ...a,
130
+ detectOverflow: (w = a.detectOverflow) != null ? w : ne
131
+ },
132
+ elements: {
133
+ reference: t,
134
+ floating: e
135
+ }
136
+ });
137
+ u = h ?? u, c = y ?? c, n = {
138
+ ...n,
139
+ [p]: {
140
+ ...n[p],
141
+ ...O
142
+ }
143
+ }, b && l <= 50 && (l++, typeof b == "object" && (b.placement && (f = b.placement), b.rects && (g = b.rects === !0 ? await a.getElementRects({
144
+ reference: t,
145
+ floating: e,
146
+ strategy: r
147
+ }) : b.rects), {
148
+ x: u,
149
+ y: c
150
+ } = I(g, f, d)), x = -1);
151
+ }
152
+ return {
153
+ x: u,
154
+ y: c,
155
+ placement: f,
156
+ strategy: r,
157
+ middlewareData: n
158
+ };
159
+ }, ce = (t) => ({
160
+ name: "arrow",
161
+ options: t,
162
+ async fn(e) {
163
+ const {
164
+ x: m,
165
+ y: s,
166
+ placement: r,
167
+ rects: i,
168
+ platform: a,
169
+ elements: o,
170
+ middlewareData: d
171
+ } = e, {
172
+ element: g,
173
+ padding: u = 0
174
+ } = V(t, e) || {};
175
+ if (g == null)
176
+ return {};
177
+ const c = q(u), f = {
178
+ x: m,
179
+ y: s
180
+ }, n = G(r), l = J(n), w = await a.getDimensions(g), x = n === "y", p = x ? "top" : "left", v = x ? "bottom" : "right", h = x ? "clientHeight" : "clientWidth", y = i.reference[l] + i.reference[n] - f[n] - i.floating[l], O = f[n] - i.reference[n], b = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(g));
181
+ let D = b ? b[h] : 0;
182
+ (!D || !await (a.isElement == null ? void 0 : a.isElement(b))) && (D = o.floating[h] || i.floating[l]);
183
+ const B = y / 2 - O / 2, E = D / 2 - w[l] / 2 - 1, C = X(c[p], E), H = X(c[v], E), T = C, M = D - w[l] - H, A = D / 2 - w[l] / 2 + B, L = Y(T, A, M), S = !d.arrow && $(r) != null && A !== L && i.reference[l] / 2 - (A < T ? C : H) - w[l] / 2 < 0, P = S ? A < T ? A - T : A - M : 0;
184
+ return {
185
+ [n]: f[n] + P,
186
+ data: {
187
+ [n]: L,
188
+ centerOffset: A - L - P,
189
+ ...S && {
190
+ alignmentOffset: P
191
+ }
192
+ },
193
+ reset: S
194
+ };
195
+ }
196
+ }), le = function(t) {
197
+ return t === void 0 && (t = {}), {
198
+ name: "flip",
199
+ options: t,
200
+ async fn(e) {
201
+ var m, s;
202
+ const {
203
+ placement: r,
204
+ middlewareData: i,
205
+ rects: a,
206
+ initialPlacement: o,
207
+ platform: d,
208
+ elements: g
209
+ } = e, {
210
+ mainAxis: u = !0,
211
+ crossAxis: c = !0,
212
+ fallbackPlacements: f,
213
+ fallbackStrategy: n = "bestFit",
214
+ fallbackAxisSideDirection: l = "none",
215
+ flipAlignment: w = !0,
216
+ ...x
217
+ } = V(t, e);
218
+ if ((m = i.arrow) != null && m.alignmentOffset)
219
+ return {};
220
+ const p = j(r), v = F(o), h = j(o) === o, y = await (d.isRTL == null ? void 0 : d.isRTL(g.floating)), O = f || (h || !w ? [N(o)] : Q(o)), b = l !== "none";
221
+ !f && b && O.push(...U(o, w, l, y));
222
+ const D = [o, ...O], B = await d.detectOverflow(e, x), E = [];
223
+ let C = ((s = i.flip) == null ? void 0 : s.overflows) || [];
224
+ if (u && E.push(B[p]), c) {
225
+ const A = Z(r, a, y);
226
+ E.push(B[A[0]], B[A[1]]);
227
+ }
228
+ if (C = [...C, {
229
+ placement: r,
230
+ overflows: E
231
+ }], !E.every((A) => A <= 0)) {
232
+ var H, T;
233
+ const A = (((H = i.flip) == null ? void 0 : H.index) || 0) + 1, L = D[A];
234
+ if (L && (!(c === "alignment" ? v !== F(L) : !1) || // We leave the current main axis only if every placement on that axis
235
+ // overflows the main axis.
236
+ C.every((R) => F(R.placement) === v ? R.overflows[0] > 0 : !0)))
237
+ return {
238
+ data: {
239
+ index: A,
240
+ overflows: C
241
+ },
242
+ reset: {
243
+ placement: L
244
+ }
245
+ };
246
+ let S = (T = C.filter((P) => P.overflows[0] <= 0).sort((P, R) => P.overflows[1] - R.overflows[1])[0]) == null ? void 0 : T.placement;
247
+ if (!S)
248
+ switch (n) {
249
+ case "bestFit": {
250
+ var M;
251
+ const P = (M = C.filter((R) => {
252
+ if (b) {
253
+ const k = F(R.placement);
254
+ return k === v || // Create a bias to the `y` side axis due to horizontal
255
+ // reading directions favoring greater width.
256
+ k === "y";
257
+ }
258
+ return !0;
259
+ }).map((R) => [R.placement, R.overflows.filter((k) => k > 0).reduce((k, K) => k + K, 0)]).sort((R, k) => R[1] - k[1])[0]) == null ? void 0 : M[0];
260
+ P && (S = P);
261
+ break;
262
+ }
263
+ case "initialPlacement":
264
+ S = o;
265
+ break;
266
+ }
267
+ if (r !== S)
268
+ return {
269
+ reset: {
270
+ placement: S
271
+ }
272
+ };
273
+ }
274
+ return {};
275
+ }
276
+ };
277
+ };
278
+ function W(t, e) {
279
+ return {
280
+ top: t.top - e.height,
281
+ right: t.right - e.width,
282
+ bottom: t.bottom - e.height,
283
+ left: t.left - e.width
284
+ };
285
+ }
286
+ function _(t) {
287
+ return te.some((e) => t[e] >= 0);
288
+ }
289
+ const re = function(t) {
290
+ return t === void 0 && (t = {}), {
291
+ name: "hide",
292
+ options: t,
293
+ async fn(e) {
294
+ const {
295
+ rects: m,
296
+ platform: s
297
+ } = e, {
298
+ strategy: r = "referenceHidden",
299
+ ...i
300
+ } = V(t, e);
301
+ switch (r) {
302
+ case "referenceHidden": {
303
+ const a = await s.detectOverflow(e, {
304
+ ...i,
305
+ elementContext: "reference"
306
+ }), o = W(a, m.reference);
307
+ return {
308
+ data: {
309
+ referenceHiddenOffsets: o,
310
+ referenceHidden: _(o)
311
+ }
312
+ };
313
+ }
314
+ case "escaped": {
315
+ const a = await s.detectOverflow(e, {
316
+ ...i,
317
+ altBoundary: !0
318
+ }), o = W(a, m.floating);
319
+ return {
320
+ data: {
321
+ escapedOffsets: o,
322
+ escaped: _(o)
323
+ }
324
+ };
325
+ }
326
+ default:
327
+ return {};
328
+ }
329
+ }
330
+ };
331
+ }, ie = /* @__PURE__ */ new Set(["left", "top"]);
332
+ async function se(t, e) {
333
+ const {
334
+ placement: m,
335
+ platform: s,
336
+ elements: r
337
+ } = t, i = await (s.isRTL == null ? void 0 : s.isRTL(r.floating)), a = j(m), o = $(m), d = F(m) === "y", g = ie.has(a) ? -1 : 1, u = i && d ? -1 : 1, c = V(e, t);
338
+ let {
339
+ mainAxis: f,
340
+ crossAxis: n,
341
+ alignmentAxis: l
342
+ } = typeof c == "number" ? {
343
+ mainAxis: c,
344
+ crossAxis: 0,
345
+ alignmentAxis: null
346
+ } : {
347
+ mainAxis: c.mainAxis || 0,
348
+ crossAxis: c.crossAxis || 0,
349
+ alignmentAxis: c.alignmentAxis
350
+ };
351
+ return o && typeof l == "number" && (n = o === "end" ? l * -1 : l), d ? {
352
+ x: n * u,
353
+ y: f * g
354
+ } : {
355
+ x: f * g,
356
+ y: n * u
357
+ };
358
+ }
359
+ const fe = function(t) {
360
+ return t === void 0 && (t = 0), {
361
+ name: "offset",
362
+ options: t,
363
+ async fn(e) {
364
+ var m, s;
365
+ const {
366
+ x: r,
367
+ y: i,
368
+ placement: a,
369
+ middlewareData: o
370
+ } = e, d = await se(e, t);
371
+ return a === ((m = o.offset) == null ? void 0 : m.placement) && (s = o.arrow) != null && s.alignmentOffset ? {} : {
372
+ x: r + d.x,
373
+ y: i + d.y,
374
+ data: {
375
+ ...d,
376
+ placement: a
377
+ }
378
+ };
379
+ }
380
+ };
381
+ }, me = function(t) {
382
+ return t === void 0 && (t = {}), {
383
+ name: "shift",
384
+ options: t,
385
+ async fn(e) {
386
+ const {
387
+ x: m,
388
+ y: s,
389
+ placement: r,
390
+ platform: i
391
+ } = e, {
392
+ mainAxis: a = !0,
393
+ crossAxis: o = !1,
394
+ limiter: d = {
395
+ fn: (p) => {
396
+ let {
397
+ x: v,
398
+ y: h
399
+ } = p;
400
+ return {
401
+ x: v,
402
+ y: h
403
+ };
404
+ }
405
+ },
406
+ ...g
407
+ } = V(t, e), u = {
408
+ x: m,
409
+ y: s
410
+ }, c = await i.detectOverflow(e, g), f = F(j(r)), n = ee(f);
411
+ let l = u[n], w = u[f];
412
+ if (a) {
413
+ const p = n === "y" ? "top" : "left", v = n === "y" ? "bottom" : "right", h = l + c[p], y = l - c[v];
414
+ l = Y(h, l, y);
415
+ }
416
+ if (o) {
417
+ const p = f === "y" ? "top" : "left", v = f === "y" ? "bottom" : "right", h = w + c[p], y = w - c[v];
418
+ w = Y(h, w, y);
419
+ }
420
+ const x = d.fn({
421
+ ...e,
422
+ [n]: l,
423
+ [f]: w
424
+ });
425
+ return {
426
+ ...x,
427
+ data: {
428
+ x: x.x - m,
429
+ y: x.y - s,
430
+ enabled: {
431
+ [n]: a,
432
+ [f]: o
433
+ }
434
+ }
435
+ };
436
+ }
437
+ };
438
+ };
439
+ export {
440
+ ce as arrow,
441
+ ae as computePosition,
442
+ ne as detectOverflow,
443
+ le as flip,
444
+ re as hide,
445
+ fe as offset,
446
+ z as rectToClientRect,
447
+ me as shift
448
+ };