@trintel/zooy 1.0.1-beta.0

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 (210) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +471 -0
  3. package/dist/chunks/16-30f5E9no.js +1 -0
  4. package/dist/chunks/16-41wFkj7S.js +1 -0
  5. package/dist/chunks/16-4Ffg4DOO.js +1 -0
  6. package/dist/chunks/16-8pr5mbIO.js +28 -0
  7. package/dist/chunks/16-B56B50XT.js +1 -0
  8. package/dist/chunks/16-BFJN6B6d.js +39 -0
  9. package/dist/chunks/16-BTonF5Je.js +29 -0
  10. package/dist/chunks/16-BiShwKPX.js +28 -0
  11. package/dist/chunks/16-BwDdccyH.js +33 -0
  12. package/dist/chunks/16-C7Xs-wKv.js +1 -0
  13. package/dist/chunks/16-CDRTWf-C.js +21 -0
  14. package/dist/chunks/16-CSWwhDUY.js +21 -0
  15. package/dist/chunks/16-ChlL35BX.js +62 -0
  16. package/dist/chunks/16-CpNRIuiB.js +1 -0
  17. package/dist/chunks/16-CqC9427V.js +21 -0
  18. package/dist/chunks/16-Cubm18Em.js +1 -0
  19. package/dist/chunks/16-D3Ol0pdg.js +21 -0
  20. package/dist/chunks/16-DH311Of_.js +1 -0
  21. package/dist/chunks/16-Dlq3qxDh.js +1 -0
  22. package/dist/chunks/16-Drl9-5Gn.js +21 -0
  23. package/dist/chunks/16-Dt4v0bcc.js +1 -0
  24. package/dist/chunks/16-DylBiJnm.js +1 -0
  25. package/dist/chunks/20-CZPIOG-A.js +84 -0
  26. package/dist/chunks/20-gmyNFvDv.js +1 -0
  27. package/dist/chunks/button-DdJepOoE.js +271 -0
  28. package/dist/chunks/button-skeleton-COf2kCDL.js +48 -0
  29. package/dist/chunks/button-skeleton-rf3WDPTZ.js +21 -0
  30. package/dist/chunks/button-zHEPxpXa.js +66 -0
  31. package/dist/chunks/carbon-element-CbfPUYRT.js +1 -0
  32. package/dist/chunks/carbon-element-DzDuXiyl.js +25 -0
  33. package/dist/chunks/checkbox-B5mHvx0J.js +200 -0
  34. package/dist/chunks/checkbox-BRPCg-DN.js +40 -0
  35. package/dist/chunks/class-map-BfNAkUL_.js +5 -0
  36. package/dist/chunks/class-map-DEHG4tmw.js +32 -0
  37. package/dist/chunks/collection-helpers-BwUB2CEz.js +8 -0
  38. package/dist/chunks/collection-helpers-CYLIiyii.js +1 -0
  39. package/dist/chunks/content-switcher-item-DeGjVRQY.js +350 -0
  40. package/dist/chunks/content-switcher-item-DucclV1b.js +27 -0
  41. package/dist/chunks/defs-DMmigODC.js +1077 -0
  42. package/dist/chunks/defs-DPD20sPK.js +1 -0
  43. package/dist/chunks/directive-Dp4ZTz-F.js +5 -0
  44. package/dist/chunks/directive-kLG6oqUu.js +27 -0
  45. package/dist/chunks/dropdown-item-BgLQ1VLo.js +69 -0
  46. package/dist/chunks/dropdown-item-DPdwOION.js +620 -0
  47. package/dist/chunks/focus-B9JYe97T.js +20 -0
  48. package/dist/chunks/focus-rQSNiwy7.js +1 -0
  49. package/dist/chunks/form-D6Tce4-W.js +1 -0
  50. package/dist/chunks/form-DpI-v6DA.js +20 -0
  51. package/dist/chunks/host-listener-CN245INl.js +37 -0
  52. package/dist/chunks/host-listener-DD3oGxvg.js +16 -0
  53. package/dist/chunks/host-listener-gxrTpxgv.js +1 -0
  54. package/dist/chunks/host-listener-rUcT_LUW.js +1 -0
  55. package/dist/chunks/icon-loader-Dk_AU26w.js +7 -0
  56. package/dist/chunks/icon-loader-o_JYDmJX.js +1 -0
  57. package/dist/chunks/icon-loader-utils-BBjK16O-.js +5 -0
  58. package/dist/chunks/icon-loader-utils-BEOGXn0q.js +117 -0
  59. package/dist/chunks/if-defined-BdZRLDJ6.js +5 -0
  60. package/dist/chunks/if-defined-C0yJsxi2.js +10 -0
  61. package/dist/chunks/if-non-empty-CEHK-hqx.js +1 -0
  62. package/dist/chunks/if-non-empty-DTGflHtA.js +5 -0
  63. package/dist/chunks/index-16wphaSo.js +4 -0
  64. package/dist/chunks/index-27oFQaOS.js +37 -0
  65. package/dist/chunks/index-45EApaFs.js +205 -0
  66. package/dist/chunks/index-5jmZyISW.js +1 -0
  67. package/dist/chunks/index-B1vQ44Hl.js +363 -0
  68. package/dist/chunks/index-B3CDjjXh.js +214 -0
  69. package/dist/chunks/index-B3mXrMt1.js +24 -0
  70. package/dist/chunks/index-B7mGUQhz.js +79 -0
  71. package/dist/chunks/index-BBNaYDog.js +22 -0
  72. package/dist/chunks/index-BBt9OmO5.js +12 -0
  73. package/dist/chunks/index-BIaF1Dfx.js +107 -0
  74. package/dist/chunks/index-BJAuRs3y.js +75 -0
  75. package/dist/chunks/index-BJKftWYn.js +89 -0
  76. package/dist/chunks/index-BLjNrhkN.js +4 -0
  77. package/dist/chunks/index-BOTu9u-3.js +86 -0
  78. package/dist/chunks/index-BPVpH8ll.js +160 -0
  79. package/dist/chunks/index-BRuvyoCz.js +15 -0
  80. package/dist/chunks/index-BSgHSOVT.js +65 -0
  81. package/dist/chunks/index-BSh7UYcP.js +9 -0
  82. package/dist/chunks/index-BUxB7aWd.js +96 -0
  83. package/dist/chunks/index-BXIxcS00.js +22 -0
  84. package/dist/chunks/index-BXczHDk-.js +187 -0
  85. package/dist/chunks/index-BaVyBv2V.js +25 -0
  86. package/dist/chunks/index-BgbqX0uv.js +234 -0
  87. package/dist/chunks/index-BjQlt8g2.js +451 -0
  88. package/dist/chunks/index-BoNLj7PW.js +44 -0
  89. package/dist/chunks/index-BwIoRMDI.js +24 -0
  90. package/dist/chunks/index-Bwix1iwB.js +38 -0
  91. package/dist/chunks/index-BxVW3p3I.js +258 -0
  92. package/dist/chunks/index-ByKyGGzb.js +3 -0
  93. package/dist/chunks/index-ByTSSU1x.js +1 -0
  94. package/dist/chunks/index-C8LyfVmf.js +428 -0
  95. package/dist/chunks/index-CBbsFlsv.js +290 -0
  96. package/dist/chunks/index-CByffhPq.js +762 -0
  97. package/dist/chunks/index-CIbRjtWm.js +32 -0
  98. package/dist/chunks/index-CIzeMGQv.js +81 -0
  99. package/dist/chunks/index-CLGxSjLW.js +62 -0
  100. package/dist/chunks/index-CMF5Cawn.js +70 -0
  101. package/dist/chunks/index-CO-A2KY9.js +562 -0
  102. package/dist/chunks/index-CONgwvp0.js +12 -0
  103. package/dist/chunks/index-CT43RMOu.js +20 -0
  104. package/dist/chunks/index-CUgiXqyk.js +4 -0
  105. package/dist/chunks/index-C_K070Kn.js +284 -0
  106. package/dist/chunks/index-C_ttE2g9.js +16 -0
  107. package/dist/chunks/index-CcgnA1uu.js +29 -0
  108. package/dist/chunks/index-Cd7aoWrX.js +336 -0
  109. package/dist/chunks/index-Ce-pMzBC.js +19 -0
  110. package/dist/chunks/index-CgYZ66P_.js +187 -0
  111. package/dist/chunks/index-ChcHMeAS.js +35 -0
  112. package/dist/chunks/index-Cixdzvwd.js +682 -0
  113. package/dist/chunks/index-Clq0Fl19.js +15 -0
  114. package/dist/chunks/index-CtxTJnIm.js +58 -0
  115. package/dist/chunks/index-Cv1hWa_y.js +242 -0
  116. package/dist/chunks/index-CzTjJ8lP.js +432 -0
  117. package/dist/chunks/index-D0xRAPD5.js +75 -0
  118. package/dist/chunks/index-D25buhRm.js +79 -0
  119. package/dist/chunks/index-D4DqJG5_.js +16 -0
  120. package/dist/chunks/index-D5GGFPcS.js +251 -0
  121. package/dist/chunks/index-D5kiHJpX.js +413 -0
  122. package/dist/chunks/index-DEjRiv5B.js +1 -0
  123. package/dist/chunks/index-DFA4_spk.js +160 -0
  124. package/dist/chunks/index-DFZsXFsx.js +19 -0
  125. package/dist/chunks/index-DGauWNwV.js +156 -0
  126. package/dist/chunks/index-DIR0jr3f.js +127 -0
  127. package/dist/chunks/index-DNeagy5a.js +65 -0
  128. package/dist/chunks/index-DO0fmDR9.js +2 -0
  129. package/dist/chunks/index-DSitHBEh.js +36 -0
  130. package/dist/chunks/index-DW7ST0tB.js +1 -0
  131. package/dist/chunks/index-DWfFgEXE.js +110 -0
  132. package/dist/chunks/index-DX6WAtmo.js +874 -0
  133. package/dist/chunks/index-DaPfSuLu.js +393 -0
  134. package/dist/chunks/index-DbKlVm7y.js +74 -0
  135. package/dist/chunks/index-DdNZTQw1.js +48 -0
  136. package/dist/chunks/index-Dgi-m1K-.js +1 -0
  137. package/dist/chunks/index-Dh4uigJs.js +454 -0
  138. package/dist/chunks/index-DnYNK1mz.js +8 -0
  139. package/dist/chunks/index-DnierBep.js +510 -0
  140. package/dist/chunks/index-DnpSGM23.js +213 -0
  141. package/dist/chunks/index-DntY4deR.js +41 -0
  142. package/dist/chunks/index-Dp4A8k6C.js +103 -0
  143. package/dist/chunks/index-Dphpk5r2.js +1 -0
  144. package/dist/chunks/index-DrBrgF-v.js +49 -0
  145. package/dist/chunks/index-Dr_cqQ-_.js +77 -0
  146. package/dist/chunks/index-Dt-nBtrQ.js +26 -0
  147. package/dist/chunks/index-DurPWBYc.js +24 -0
  148. package/dist/chunks/index-DwTj7cFr.js +57 -0
  149. package/dist/chunks/index-DyZVAYLv.js +52 -0
  150. package/dist/chunks/index-Hh597Yu6.js +121 -0
  151. package/dist/chunks/index-LxkAuMAA.js +1 -0
  152. package/dist/chunks/index-OaQhvPR1.js +46 -0
  153. package/dist/chunks/index-UPr2EvBX.js +149 -0
  154. package/dist/chunks/index-WNXgzThF.js +2340 -0
  155. package/dist/chunks/index-WvrCPen2.js +367 -0
  156. package/dist/chunks/index-cTXIVcWI.js +45 -0
  157. package/dist/chunks/index-caLn8cu1.js +1603 -0
  158. package/dist/chunks/index-hLI0Bnyb.js +77 -0
  159. package/dist/chunks/index-jBse-XgU.js +35 -0
  160. package/dist/chunks/index-oTjafsfN.js +25 -0
  161. package/dist/chunks/index-qNmuI3RB.js +149 -0
  162. package/dist/chunks/index-qiqzy9MI.js +23 -0
  163. package/dist/chunks/index-rwBsdvh6.js +87 -0
  164. package/dist/chunks/index-siqJUhKa.js +1 -0
  165. package/dist/chunks/index-w-G9CFId.js +1 -0
  166. package/dist/chunks/index-x6SeA7x7.js +405 -0
  167. package/dist/chunks/loading-icon-DJQIjg97.js +23 -0
  168. package/dist/chunks/loading-icon-DhJR6LyV.js +16 -0
  169. package/dist/chunks/main-DUusfqrI.js +18 -0
  170. package/dist/chunks/main-Dp7wHHgP.js +2882 -0
  171. package/dist/chunks/on-BPhwbVf3.js +10 -0
  172. package/dist/chunks/on-XRofyGQh.js +1 -0
  173. package/dist/chunks/property-DCYiZTFF.js +5 -0
  174. package/dist/chunks/property-pT1z5CCa.js +36 -0
  175. package/dist/chunks/query-CbRg6ZGy.js +23 -0
  176. package/dist/chunks/query-Dh8joWcT.js +9 -0
  177. package/dist/chunks/radio-group-manager-DBAEmhDM.js +1 -0
  178. package/dist/chunks/radio-group-manager-Du5wSOS1.js +102 -0
  179. package/dist/chunks/register-BK21_Wkj.js +11035 -0
  180. package/dist/chunks/register-BMNs2hNG.js +2157 -0
  181. package/dist/chunks/register-Cc9zkA5F.js +1 -0
  182. package/dist/chunks/register-JwwMwdRf.js +1273 -0
  183. package/dist/chunks/search-C3raqgOD.js +30 -0
  184. package/dist/chunks/search-CIhxkVjj.js +239 -0
  185. package/dist/chunks/select-item-4aISXm0r.js +76 -0
  186. package/dist/chunks/select-item-DjoxYopL.js +356 -0
  187. package/dist/chunks/settings-BPOpwVkr.js +594 -0
  188. package/dist/chunks/settings-CK2vhfPu.js +78 -0
  189. package/dist/chunks/shared-enums-BJDDuJr7.js +1 -0
  190. package/dist/chunks/shared-enums-DALKjQ7e.js +7 -0
  191. package/dist/chunks/state-Bpmgn27B.js +12 -0
  192. package/dist/chunks/state-FnSmMH94.js +5 -0
  193. package/dist/chunks/text-input-BygzMjjc.js +371 -0
  194. package/dist/chunks/text-input-cjcnMXO-.js +68 -0
  195. package/dist/chunks/tooltip-content-BjdZJ_Ui.js +134 -0
  196. package/dist/chunks/tooltip-content-DHyDYyOH.js +3 -0
  197. package/dist/chunks/tslib.es6-B07k2eac.js +1 -0
  198. package/dist/chunks/tslib.es6-C5gLNDSD.js +160 -0
  199. package/dist/chunks/unsafe-html-C_MKAcuC.js +5 -0
  200. package/dist/chunks/unsafe-html-D49sIpJ5.js +27 -0
  201. package/dist/chunks/validity-BMLNCMmP.js +1 -0
  202. package/dist/chunks/validity-CTz7ivUd.js +59 -0
  203. package/dist/zooy.cjs.js +1 -0
  204. package/dist/zooy.es.js +4 -0
  205. package/package.json +57 -0
  206. package/src/sass/carbon-icons.scss +46 -0
  207. package/src/sass/main.scss +7 -0
  208. package/src/sass/panels.scss +642 -0
  209. package/src/sass/reset.scss +43 -0
  210. package/src/sass/split.scss +131 -0
@@ -0,0 +1,1077 @@
1
+ const j = Math.min, C = Math.max, nt = Math.round, et = Math.floor, E = (t) => ({
2
+ x: t,
3
+ y: t
4
+ }), Mt = {
5
+ left: "right",
6
+ right: "left",
7
+ bottom: "top",
8
+ top: "bottom"
9
+ }, _t = {
10
+ start: "end",
11
+ end: "start"
12
+ };
13
+ function zt(t, e, n) {
14
+ return C(t, j(e, n));
15
+ }
16
+ function G(t, e) {
17
+ return typeof t == "function" ? t(e) : t;
18
+ }
19
+ function V(t) {
20
+ return t.split("-")[0];
21
+ }
22
+ function Z(t) {
23
+ return t.split("-")[1];
24
+ }
25
+ function Xt(t) {
26
+ return t === "x" ? "y" : "x";
27
+ }
28
+ function dt(t) {
29
+ return t === "y" ? "height" : "width";
30
+ }
31
+ const Yt = /* @__PURE__ */ new Set(["top", "bottom"]);
32
+ function Y(t) {
33
+ return Yt.has(V(t)) ? "y" : "x";
34
+ }
35
+ function mt(t) {
36
+ return Xt(Y(t));
37
+ }
38
+ function jt(t, e, n) {
39
+ n === void 0 && (n = !1);
40
+ const o = Z(t), i = mt(t), r = dt(i);
41
+ let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
42
+ return e.reference[r] > e.floating[r] && (s = ot(s)), [s, ot(s)];
43
+ }
44
+ function Ut(t) {
45
+ const e = ot(t);
46
+ return [ft(t), e, ft(e)];
47
+ }
48
+ function ft(t) {
49
+ return t.replace(/start|end/g, (e) => _t[e]);
50
+ }
51
+ const wt = ["left", "right"], yt = ["right", "left"], qt = ["top", "bottom"], Vt = ["bottom", "top"];
52
+ function Kt(t, e, n) {
53
+ switch (t) {
54
+ case "top":
55
+ case "bottom":
56
+ return n ? e ? yt : wt : e ? wt : yt;
57
+ case "left":
58
+ case "right":
59
+ return e ? qt : Vt;
60
+ default:
61
+ return [];
62
+ }
63
+ }
64
+ function Jt(t, e, n, o) {
65
+ const i = Z(t);
66
+ let r = Kt(V(t), n === "start", o);
67
+ return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ft)))), r;
68
+ }
69
+ function ot(t) {
70
+ return t.replace(/left|right|bottom|top/g, (e) => Mt[e]);
71
+ }
72
+ function Qt(t) {
73
+ return {
74
+ top: 0,
75
+ right: 0,
76
+ bottom: 0,
77
+ left: 0,
78
+ ...t
79
+ };
80
+ }
81
+ function Dt(t) {
82
+ return typeof t != "number" ? Qt(t) : {
83
+ top: t,
84
+ right: t,
85
+ bottom: t,
86
+ left: t
87
+ };
88
+ }
89
+ function it(t) {
90
+ const {
91
+ x: e,
92
+ y: n,
93
+ width: o,
94
+ height: i
95
+ } = t;
96
+ return {
97
+ width: o,
98
+ height: i,
99
+ top: n,
100
+ left: e,
101
+ right: e + o,
102
+ bottom: n + i,
103
+ x: e,
104
+ y: n
105
+ };
106
+ }
107
+ function xt(t, e, n) {
108
+ let {
109
+ reference: o,
110
+ floating: i
111
+ } = t;
112
+ const r = Y(e), s = mt(e), l = dt(s), a = V(e), f = r === "y", u = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, m = o[l] / 2 - i[l] / 2;
113
+ let c;
114
+ switch (a) {
115
+ case "top":
116
+ c = {
117
+ x: u,
118
+ y: o.y - i.height
119
+ };
120
+ break;
121
+ case "bottom":
122
+ c = {
123
+ x: u,
124
+ y: o.y + o.height
125
+ };
126
+ break;
127
+ case "right":
128
+ c = {
129
+ x: o.x + o.width,
130
+ y: d
131
+ };
132
+ break;
133
+ case "left":
134
+ c = {
135
+ x: o.x - i.width,
136
+ y: d
137
+ };
138
+ break;
139
+ default:
140
+ c = {
141
+ x: o.x,
142
+ y: o.y
143
+ };
144
+ }
145
+ switch (Z(e)) {
146
+ case "start":
147
+ c[s] -= m * (n && f ? -1 : 1);
148
+ break;
149
+ case "end":
150
+ c[s] += m * (n && f ? -1 : 1);
151
+ break;
152
+ }
153
+ return c;
154
+ }
155
+ const Zt = async (t, e, n) => {
156
+ const {
157
+ placement: o = "bottom",
158
+ strategy: i = "absolute",
159
+ middleware: r = [],
160
+ platform: s
161
+ } = n, l = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(e));
162
+ let f = await s.getElementRects({
163
+ reference: t,
164
+ floating: e,
165
+ strategy: i
166
+ }), {
167
+ x: u,
168
+ y: d
169
+ } = xt(f, o, a), m = o, c = {}, h = 0;
170
+ for (let g = 0; g < l.length; g++) {
171
+ const {
172
+ name: w,
173
+ fn: p
174
+ } = l[g], {
175
+ x: y,
176
+ y: b,
177
+ data: v,
178
+ reset: x
179
+ } = await p({
180
+ x: u,
181
+ y: d,
182
+ initialPlacement: o,
183
+ placement: m,
184
+ strategy: i,
185
+ middlewareData: c,
186
+ rects: f,
187
+ platform: s,
188
+ elements: {
189
+ reference: t,
190
+ floating: e
191
+ }
192
+ });
193
+ u = y ?? u, d = b ?? d, c = {
194
+ ...c,
195
+ [w]: {
196
+ ...c[w],
197
+ ...v
198
+ }
199
+ }, x && h <= 50 && (h++, typeof x == "object" && (x.placement && (m = x.placement), x.rects && (f = x.rects === !0 ? await s.getElementRects({
200
+ reference: t,
201
+ floating: e,
202
+ strategy: i
203
+ }) : x.rects), {
204
+ x: u,
205
+ y: d
206
+ } = xt(f, m, a)), g = -1);
207
+ }
208
+ return {
209
+ x: u,
210
+ y: d,
211
+ placement: m,
212
+ strategy: i,
213
+ middlewareData: c
214
+ };
215
+ };
216
+ async function Ot(t, e) {
217
+ var n;
218
+ e === void 0 && (e = {});
219
+ const {
220
+ x: o,
221
+ y: i,
222
+ platform: r,
223
+ rects: s,
224
+ elements: l,
225
+ strategy: a
226
+ } = t, {
227
+ boundary: f = "clippingAncestors",
228
+ rootBoundary: u = "viewport",
229
+ elementContext: d = "floating",
230
+ altBoundary: m = !1,
231
+ padding: c = 0
232
+ } = G(e, t), h = Dt(c), w = l[m ? d === "floating" ? "reference" : "floating" : d], p = it(await r.getClippingRect({
233
+ element: (n = await (r.isElement == null ? void 0 : r.isElement(w))) == null || n ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
234
+ boundary: f,
235
+ rootBoundary: u,
236
+ strategy: a
237
+ })), y = d === "floating" ? {
238
+ x: o,
239
+ y: i,
240
+ width: s.floating.width,
241
+ height: s.floating.height
242
+ } : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), v = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
243
+ x: 1,
244
+ y: 1
245
+ } : {
246
+ x: 1,
247
+ y: 1
248
+ }, x = it(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
249
+ elements: l,
250
+ rect: y,
251
+ offsetParent: b,
252
+ strategy: a
253
+ }) : y);
254
+ return {
255
+ top: (p.top - x.top + h.top) / v.y,
256
+ bottom: (x.bottom - p.bottom + h.bottom) / v.y,
257
+ left: (p.left - x.left + h.left) / v.x,
258
+ right: (x.right - p.right + h.right) / v.x
259
+ };
260
+ }
261
+ const It = (t) => ({
262
+ name: "arrow",
263
+ options: t,
264
+ async fn(e) {
265
+ const {
266
+ x: n,
267
+ y: o,
268
+ placement: i,
269
+ rects: r,
270
+ platform: s,
271
+ elements: l,
272
+ middlewareData: a
273
+ } = e, {
274
+ element: f,
275
+ padding: u = 0
276
+ } = G(t, e) || {};
277
+ if (f == null)
278
+ return {};
279
+ const d = Dt(u), m = {
280
+ x: n,
281
+ y: o
282
+ }, c = mt(i), h = dt(c), g = await s.getDimensions(f), w = c === "y", p = w ? "top" : "left", y = w ? "bottom" : "right", b = w ? "clientHeight" : "clientWidth", v = r.reference[h] + r.reference[c] - m[c] - r.floating[h], x = m[c] - r.reference[c], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f));
283
+ let T = R ? R[b] : 0;
284
+ (!T || !await (s.isElement == null ? void 0 : s.isElement(R))) && (T = l.floating[b] || r.floating[h]);
285
+ const P = v / 2 - x / 2, B = T / 2 - g[h] / 2 - 1, D = j(d[p], B), _ = j(d[y], B), W = D, z = T - g[h] - _, S = T / 2 - g[h] / 2 + P, q = zt(W, S, z), M = !a.arrow && Z(i) != null && S !== q && r.reference[h] / 2 - (S < W ? D : _) - g[h] / 2 < 0, O = M ? S < W ? S - W : S - z : 0;
286
+ return {
287
+ [c]: m[c] + O,
288
+ data: {
289
+ [c]: q,
290
+ centerOffset: S - q - O,
291
+ ...M && {
292
+ alignmentOffset: O
293
+ }
294
+ },
295
+ reset: M
296
+ };
297
+ }
298
+ }), Nt = function(t) {
299
+ return t === void 0 && (t = {}), {
300
+ name: "flip",
301
+ options: t,
302
+ async fn(e) {
303
+ var n, o;
304
+ const {
305
+ placement: i,
306
+ middlewareData: r,
307
+ rects: s,
308
+ initialPlacement: l,
309
+ platform: a,
310
+ elements: f
311
+ } = e, {
312
+ mainAxis: u = !0,
313
+ crossAxis: d = !0,
314
+ fallbackPlacements: m,
315
+ fallbackStrategy: c = "bestFit",
316
+ fallbackAxisSideDirection: h = "none",
317
+ flipAlignment: g = !0,
318
+ ...w
319
+ } = G(t, e);
320
+ if ((n = r.arrow) != null && n.alignmentOffset)
321
+ return {};
322
+ const p = V(i), y = Y(l), b = V(l) === l, v = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), x = m || (b || !g ? [ot(l)] : Ut(l)), R = h !== "none";
323
+ !m && R && x.push(...Jt(l, g, h, v));
324
+ const T = [l, ...x], P = await Ot(e, w), B = [];
325
+ let D = ((o = r.flip) == null ? void 0 : o.overflows) || [];
326
+ if (u && B.push(P[p]), d) {
327
+ const S = jt(i, s, v);
328
+ B.push(P[S[0]], P[S[1]]);
329
+ }
330
+ if (D = [...D, {
331
+ placement: i,
332
+ overflows: B
333
+ }], !B.every((S) => S <= 0)) {
334
+ var _, W;
335
+ const S = (((_ = r.flip) == null ? void 0 : _.index) || 0) + 1, q = T[S];
336
+ if (q && (!(d === "alignment" ? y !== Y(q) : !1) || // We leave the current main axis only if every placement on that axis
337
+ // overflows the main axis.
338
+ D.every((L) => Y(L.placement) === y ? L.overflows[0] > 0 : !0)))
339
+ return {
340
+ data: {
341
+ index: S,
342
+ overflows: D
343
+ },
344
+ reset: {
345
+ placement: q
346
+ }
347
+ };
348
+ let M = (W = D.filter((O) => O.overflows[0] <= 0).sort((O, L) => O.overflows[1] - L.overflows[1])[0]) == null ? void 0 : W.placement;
349
+ if (!M)
350
+ switch (c) {
351
+ case "bestFit": {
352
+ var z;
353
+ const O = (z = D.filter((L) => {
354
+ if (R) {
355
+ const X = Y(L.placement);
356
+ return X === y || // Create a bias to the `y` side axis due to horizontal
357
+ // reading directions favoring greater width.
358
+ X === "y";
359
+ }
360
+ return !0;
361
+ }).map((L) => [L.placement, L.overflows.filter((X) => X > 0).reduce((X, Pt) => X + Pt, 0)]).sort((L, X) => L[1] - X[1])[0]) == null ? void 0 : z[0];
362
+ O && (M = O);
363
+ break;
364
+ }
365
+ case "initialPlacement":
366
+ M = l;
367
+ break;
368
+ }
369
+ if (i !== M)
370
+ return {
371
+ reset: {
372
+ placement: M
373
+ }
374
+ };
375
+ }
376
+ return {};
377
+ }
378
+ };
379
+ }, Gt = /* @__PURE__ */ new Set(["left", "top"]);
380
+ async function te(t, e) {
381
+ const {
382
+ placement: n,
383
+ platform: o,
384
+ elements: i
385
+ } = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = V(n), l = Z(n), a = Y(n) === "y", f = Gt.has(s) ? -1 : 1, u = r && a ? -1 : 1, d = G(e, t);
386
+ let {
387
+ mainAxis: m,
388
+ crossAxis: c,
389
+ alignmentAxis: h
390
+ } = typeof d == "number" ? {
391
+ mainAxis: d,
392
+ crossAxis: 0,
393
+ alignmentAxis: null
394
+ } : {
395
+ mainAxis: d.mainAxis || 0,
396
+ crossAxis: d.crossAxis || 0,
397
+ alignmentAxis: d.alignmentAxis
398
+ };
399
+ return l && typeof h == "number" && (c = l === "end" ? h * -1 : h), a ? {
400
+ x: c * u,
401
+ y: m * f
402
+ } : {
403
+ x: m * f,
404
+ y: c * u
405
+ };
406
+ }
407
+ const ee = function(t) {
408
+ return t === void 0 && (t = 0), {
409
+ name: "offset",
410
+ options: t,
411
+ async fn(e) {
412
+ var n, o;
413
+ const {
414
+ x: i,
415
+ y: r,
416
+ placement: s,
417
+ middlewareData: l
418
+ } = e, a = await te(e, t);
419
+ return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
420
+ x: i + a.x,
421
+ y: r + a.y,
422
+ data: {
423
+ ...a,
424
+ placement: s
425
+ }
426
+ };
427
+ }
428
+ };
429
+ }, ne = function(t) {
430
+ return t === void 0 && (t = {}), {
431
+ name: "size",
432
+ options: t,
433
+ async fn(e) {
434
+ var n, o;
435
+ const {
436
+ placement: i,
437
+ rects: r,
438
+ platform: s,
439
+ elements: l
440
+ } = e, {
441
+ apply: a = () => {
442
+ },
443
+ ...f
444
+ } = G(t, e), u = await Ot(e, f), d = V(i), m = Z(i), c = Y(i) === "y", {
445
+ width: h,
446
+ height: g
447
+ } = r.floating;
448
+ let w, p;
449
+ d === "top" || d === "bottom" ? (w = d, p = m === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (p = d, w = m === "end" ? "top" : "bottom");
450
+ const y = g - u.top - u.bottom, b = h - u.left - u.right, v = j(g - u[w], y), x = j(h - u[p], b), R = !e.middlewareData.shift;
451
+ let T = v, P = x;
452
+ if ((n = e.middlewareData.shift) != null && n.enabled.x && (P = b), (o = e.middlewareData.shift) != null && o.enabled.y && (T = y), R && !m) {
453
+ const D = C(u.left, 0), _ = C(u.right, 0), W = C(u.top, 0), z = C(u.bottom, 0);
454
+ c ? P = h - 2 * (D !== 0 || _ !== 0 ? D + _ : C(u.left, u.right)) : T = g - 2 * (W !== 0 || z !== 0 ? W + z : C(u.top, u.bottom));
455
+ }
456
+ await a({
457
+ ...e,
458
+ availableWidth: P,
459
+ availableHeight: T
460
+ });
461
+ const B = await s.getDimensions(l.floating);
462
+ return h !== B.width || g !== B.height ? {
463
+ reset: {
464
+ rects: !0
465
+ }
466
+ } : {};
467
+ }
468
+ };
469
+ };
470
+ function st() {
471
+ return typeof window < "u";
472
+ }
473
+ function I(t) {
474
+ return Lt(t) ? (t.nodeName || "").toLowerCase() : "#document";
475
+ }
476
+ function A(t) {
477
+ var e;
478
+ return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
479
+ }
480
+ function $(t) {
481
+ var e;
482
+ return (e = (Lt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
483
+ }
484
+ function Lt(t) {
485
+ return st() ? t instanceof Node || t instanceof A(t).Node : !1;
486
+ }
487
+ function F(t) {
488
+ return st() ? t instanceof Element || t instanceof A(t).Element : !1;
489
+ }
490
+ function H(t) {
491
+ return st() ? t instanceof HTMLElement || t instanceof A(t).HTMLElement : !1;
492
+ }
493
+ function bt(t) {
494
+ return !st() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof A(t).ShadowRoot;
495
+ }
496
+ const oe = /* @__PURE__ */ new Set(["inline", "contents"]);
497
+ function tt(t) {
498
+ const {
499
+ overflow: e,
500
+ overflowX: n,
501
+ overflowY: o,
502
+ display: i
503
+ } = k(t);
504
+ return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !oe.has(i);
505
+ }
506
+ const ie = /* @__PURE__ */ new Set(["table", "td", "th"]);
507
+ function se(t) {
508
+ return ie.has(I(t));
509
+ }
510
+ const re = [":popover-open", ":modal"];
511
+ function rt(t) {
512
+ return re.some((e) => {
513
+ try {
514
+ return t.matches(e);
515
+ } catch {
516
+ return !1;
517
+ }
518
+ });
519
+ }
520
+ const le = ["transform", "translate", "scale", "rotate", "perspective"], ce = ["transform", "translate", "scale", "rotate", "perspective", "filter"], ae = ["paint", "layout", "strict", "content"];
521
+ function ht(t) {
522
+ const e = gt(), n = F(t) ? k(t) : t;
523
+ return le.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ce.some((o) => (n.willChange || "").includes(o)) || ae.some((o) => (n.contain || "").includes(o));
524
+ }
525
+ function fe(t) {
526
+ let e = U(t);
527
+ for (; H(e) && !Q(e); ) {
528
+ if (ht(e))
529
+ return e;
530
+ if (rt(e))
531
+ return null;
532
+ e = U(e);
533
+ }
534
+ return null;
535
+ }
536
+ function gt() {
537
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
538
+ }
539
+ const ue = /* @__PURE__ */ new Set(["html", "body", "#document"]);
540
+ function Q(t) {
541
+ return ue.has(I(t));
542
+ }
543
+ function k(t) {
544
+ return A(t).getComputedStyle(t);
545
+ }
546
+ function lt(t) {
547
+ return F(t) ? {
548
+ scrollLeft: t.scrollLeft,
549
+ scrollTop: t.scrollTop
550
+ } : {
551
+ scrollLeft: t.scrollX,
552
+ scrollTop: t.scrollY
553
+ };
554
+ }
555
+ function U(t) {
556
+ if (I(t) === "html")
557
+ return t;
558
+ const e = (
559
+ // Step into the shadow DOM of the parent of a slotted node.
560
+ t.assignedSlot || // DOM Element detected.
561
+ t.parentNode || // ShadowRoot detected.
562
+ bt(t) && t.host || // Fallback.
563
+ $(t)
564
+ );
565
+ return bt(e) ? e.host : e;
566
+ }
567
+ function Ft(t) {
568
+ const e = U(t);
569
+ return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : H(e) && tt(e) ? e : Ft(e);
570
+ }
571
+ function N(t, e, n) {
572
+ var o;
573
+ e === void 0 && (e = []), n === void 0 && (n = !0);
574
+ const i = Ft(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = A(i);
575
+ if (r) {
576
+ const l = ut(s);
577
+ return e.concat(s, s.visualViewport || [], tt(i) ? i : [], l && n ? N(l) : []);
578
+ }
579
+ return e.concat(i, N(i, [], n));
580
+ }
581
+ function ut(t) {
582
+ return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
583
+ }
584
+ function kt(t) {
585
+ const e = k(t);
586
+ let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
587
+ const i = H(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, l = nt(n) !== r || nt(o) !== s;
588
+ return l && (n = r, o = s), {
589
+ width: n,
590
+ height: o,
591
+ $: l
592
+ };
593
+ }
594
+ function pt(t) {
595
+ return F(t) ? t : t.contextElement;
596
+ }
597
+ function J(t) {
598
+ const e = pt(t);
599
+ if (!H(e))
600
+ return E(1);
601
+ const n = e.getBoundingClientRect(), {
602
+ width: o,
603
+ height: i,
604
+ $: r
605
+ } = kt(e);
606
+ let s = (r ? nt(n.width) : n.width) / o, l = (r ? nt(n.height) : n.height) / i;
607
+ return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
608
+ x: s,
609
+ y: l
610
+ };
611
+ }
612
+ const de = /* @__PURE__ */ E(0);
613
+ function Bt(t) {
614
+ const e = A(t);
615
+ return !gt() || !e.visualViewport ? de : {
616
+ x: e.visualViewport.offsetLeft,
617
+ y: e.visualViewport.offsetTop
618
+ };
619
+ }
620
+ function me(t, e, n) {
621
+ return e === void 0 && (e = !1), !n || e && n !== A(t) ? !1 : e;
622
+ }
623
+ function K(t, e, n, o) {
624
+ e === void 0 && (e = !1), n === void 0 && (n = !1);
625
+ const i = t.getBoundingClientRect(), r = pt(t);
626
+ let s = E(1);
627
+ e && (o ? F(o) && (s = J(o)) : s = J(t));
628
+ const l = me(r, n, o) ? Bt(r) : E(0);
629
+ let a = (i.left + l.x) / s.x, f = (i.top + l.y) / s.y, u = i.width / s.x, d = i.height / s.y;
630
+ if (r) {
631
+ const m = A(r), c = o && F(o) ? A(o) : o;
632
+ let h = m, g = ut(h);
633
+ for (; g && o && c !== h; ) {
634
+ const w = J(g), p = g.getBoundingClientRect(), y = k(g), b = p.left + (g.clientLeft + parseFloat(y.paddingLeft)) * w.x, v = p.top + (g.clientTop + parseFloat(y.paddingTop)) * w.y;
635
+ a *= w.x, f *= w.y, u *= w.x, d *= w.y, a += b, f += v, h = A(g), g = ut(h);
636
+ }
637
+ }
638
+ return it({
639
+ width: u,
640
+ height: d,
641
+ x: a,
642
+ y: f
643
+ });
644
+ }
645
+ function ct(t, e) {
646
+ const n = lt(t).scrollLeft;
647
+ return e ? e.left + n : K($(t)).left + n;
648
+ }
649
+ function Wt(t, e) {
650
+ const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - ct(t, n), i = n.top + e.scrollTop;
651
+ return {
652
+ x: o,
653
+ y: i
654
+ };
655
+ }
656
+ function he(t) {
657
+ let {
658
+ elements: e,
659
+ rect: n,
660
+ offsetParent: o,
661
+ strategy: i
662
+ } = t;
663
+ const r = i === "fixed", s = $(o), l = e ? rt(e.floating) : !1;
664
+ if (o === s || l && r)
665
+ return n;
666
+ let a = {
667
+ scrollLeft: 0,
668
+ scrollTop: 0
669
+ }, f = E(1);
670
+ const u = E(0), d = H(o);
671
+ if ((d || !d && !r) && ((I(o) !== "body" || tt(s)) && (a = lt(o)), H(o))) {
672
+ const c = K(o);
673
+ f = J(o), u.x = c.x + o.clientLeft, u.y = c.y + o.clientTop;
674
+ }
675
+ const m = s && !d && !r ? Wt(s, a) : E(0);
676
+ return {
677
+ width: n.width * f.x,
678
+ height: n.height * f.y,
679
+ x: n.x * f.x - a.scrollLeft * f.x + u.x + m.x,
680
+ y: n.y * f.y - a.scrollTop * f.y + u.y + m.y
681
+ };
682
+ }
683
+ function ge(t) {
684
+ return Array.from(t.getClientRects());
685
+ }
686
+ function pe(t) {
687
+ const e = $(t), n = lt(t), o = t.ownerDocument.body, i = C(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = C(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
688
+ let s = -n.scrollLeft + ct(t);
689
+ const l = -n.scrollTop;
690
+ return k(o).direction === "rtl" && (s += C(e.clientWidth, o.clientWidth) - i), {
691
+ width: i,
692
+ height: r,
693
+ x: s,
694
+ y: l
695
+ };
696
+ }
697
+ const vt = 25;
698
+ function we(t, e) {
699
+ const n = A(t), o = $(t), i = n.visualViewport;
700
+ let r = o.clientWidth, s = o.clientHeight, l = 0, a = 0;
701
+ if (i) {
702
+ r = i.width, s = i.height;
703
+ const u = gt();
704
+ (!u || u && e === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
705
+ }
706
+ const f = ct(o);
707
+ if (f <= 0) {
708
+ const u = o.ownerDocument, d = u.body, m = getComputedStyle(d), c = u.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, h = Math.abs(o.clientWidth - d.clientWidth - c);
709
+ h <= vt && (r -= h);
710
+ } else f <= vt && (r += f);
711
+ return {
712
+ width: r,
713
+ height: s,
714
+ x: l,
715
+ y: a
716
+ };
717
+ }
718
+ const ye = /* @__PURE__ */ new Set(["absolute", "fixed"]);
719
+ function xe(t, e) {
720
+ const n = K(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = H(t) ? J(t) : E(1), s = t.clientWidth * r.x, l = t.clientHeight * r.y, a = i * r.x, f = o * r.y;
721
+ return {
722
+ width: s,
723
+ height: l,
724
+ x: a,
725
+ y: f
726
+ };
727
+ }
728
+ function Tt(t, e, n) {
729
+ let o;
730
+ if (e === "viewport")
731
+ o = we(t, n);
732
+ else if (e === "document")
733
+ o = pe($(t));
734
+ else if (F(e))
735
+ o = xe(e, n);
736
+ else {
737
+ const i = Bt(t);
738
+ o = {
739
+ x: e.x - i.x,
740
+ y: e.y - i.y,
741
+ width: e.width,
742
+ height: e.height
743
+ };
744
+ }
745
+ return it(o);
746
+ }
747
+ function Et(t, e) {
748
+ const n = U(t);
749
+ return n === e || !F(n) || Q(n) ? !1 : k(n).position === "fixed" || Et(n, e);
750
+ }
751
+ function be(t, e) {
752
+ const n = e.get(t);
753
+ if (n)
754
+ return n;
755
+ let o = N(t, [], !1).filter((l) => F(l) && I(l) !== "body"), i = null;
756
+ const r = k(t).position === "fixed";
757
+ let s = r ? U(t) : t;
758
+ for (; F(s) && !Q(s); ) {
759
+ const l = k(s), a = ht(s);
760
+ !a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ye.has(i.position) || tt(s) && !a && Et(t, s)) ? o = o.filter((u) => u !== s) : i = l, s = U(s);
761
+ }
762
+ return e.set(t, o), o;
763
+ }
764
+ function ve(t) {
765
+ let {
766
+ element: e,
767
+ boundary: n,
768
+ rootBoundary: o,
769
+ strategy: i
770
+ } = t;
771
+ const s = [...n === "clippingAncestors" ? rt(e) ? [] : be(e, this._c) : [].concat(n), o], l = s[0], a = s.reduce((f, u) => {
772
+ const d = Tt(e, u, i);
773
+ return f.top = C(d.top, f.top), f.right = j(d.right, f.right), f.bottom = j(d.bottom, f.bottom), f.left = C(d.left, f.left), f;
774
+ }, Tt(e, l, i));
775
+ return {
776
+ width: a.right - a.left,
777
+ height: a.bottom - a.top,
778
+ x: a.left,
779
+ y: a.top
780
+ };
781
+ }
782
+ function Te(t) {
783
+ const {
784
+ width: e,
785
+ height: n
786
+ } = kt(t);
787
+ return {
788
+ width: e,
789
+ height: n
790
+ };
791
+ }
792
+ function Se(t, e, n) {
793
+ const o = H(e), i = $(e), r = n === "fixed", s = K(t, !0, r, e);
794
+ let l = {
795
+ scrollLeft: 0,
796
+ scrollTop: 0
797
+ };
798
+ const a = E(0);
799
+ function f() {
800
+ a.x = ct(i);
801
+ }
802
+ if (o || !o && !r)
803
+ if ((I(e) !== "body" || tt(i)) && (l = lt(e)), o) {
804
+ const c = K(e, !0, r, e);
805
+ a.x = c.x + e.clientLeft, a.y = c.y + e.clientTop;
806
+ } else i && f();
807
+ r && !o && i && f();
808
+ const u = i && !o && !r ? Wt(i, l) : E(0), d = s.left + l.scrollLeft - a.x - u.x, m = s.top + l.scrollTop - a.y - u.y;
809
+ return {
810
+ x: d,
811
+ y: m,
812
+ width: s.width,
813
+ height: s.height
814
+ };
815
+ }
816
+ function at(t) {
817
+ return k(t).position === "static";
818
+ }
819
+ function St(t, e) {
820
+ if (!H(t) || k(t).position === "fixed")
821
+ return null;
822
+ if (e)
823
+ return e(t);
824
+ let n = t.offsetParent;
825
+ return $(t) === n && (n = n.ownerDocument.body), n;
826
+ }
827
+ function Ht(t, e) {
828
+ const n = A(t);
829
+ if (rt(t))
830
+ return n;
831
+ if (!H(t)) {
832
+ let i = U(t);
833
+ for (; i && !Q(i); ) {
834
+ if (F(i) && !at(i))
835
+ return i;
836
+ i = U(i);
837
+ }
838
+ return n;
839
+ }
840
+ let o = St(t, e);
841
+ for (; o && se(o) && at(o); )
842
+ o = St(o, e);
843
+ return o && Q(o) && at(o) && !ht(o) ? n : o || fe(t) || n;
844
+ }
845
+ const Re = async function(t) {
846
+ const e = this.getOffsetParent || Ht, n = this.getDimensions, o = await n(t.floating);
847
+ return {
848
+ reference: Se(t.reference, await e(t.floating), t.strategy),
849
+ floating: {
850
+ x: 0,
851
+ y: 0,
852
+ width: o.width,
853
+ height: o.height
854
+ }
855
+ };
856
+ };
857
+ function Ce(t) {
858
+ return k(t).direction === "rtl";
859
+ }
860
+ const Ae = {
861
+ convertOffsetParentRelativeRectToViewportRelativeRect: he,
862
+ getDocumentElement: $,
863
+ getClippingRect: ve,
864
+ getOffsetParent: Ht,
865
+ getElementRects: Re,
866
+ getClientRects: ge,
867
+ getDimensions: Te,
868
+ getScale: J,
869
+ isElement: F,
870
+ isRTL: Ce
871
+ };
872
+ function $t(t, e) {
873
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
874
+ }
875
+ function De(t, e) {
876
+ let n = null, o;
877
+ const i = $(t);
878
+ function r() {
879
+ var l;
880
+ clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
881
+ }
882
+ function s(l, a) {
883
+ l === void 0 && (l = !1), a === void 0 && (a = 1), r();
884
+ const f = t.getBoundingClientRect(), {
885
+ left: u,
886
+ top: d,
887
+ width: m,
888
+ height: c
889
+ } = f;
890
+ if (l || e(), !m || !c)
891
+ return;
892
+ const h = et(d), g = et(i.clientWidth - (u + m)), w = et(i.clientHeight - (d + c)), p = et(u), b = {
893
+ rootMargin: -h + "px " + -g + "px " + -w + "px " + -p + "px",
894
+ threshold: C(0, j(1, a)) || 1
895
+ };
896
+ let v = !0;
897
+ function x(R) {
898
+ const T = R[0].intersectionRatio;
899
+ if (T !== a) {
900
+ if (!v)
901
+ return s();
902
+ T ? s(!1, T) : o = setTimeout(() => {
903
+ s(!1, 1e-7);
904
+ }, 1e3);
905
+ }
906
+ T === 1 && !$t(f, t.getBoundingClientRect()) && s(), v = !1;
907
+ }
908
+ try {
909
+ n = new IntersectionObserver(x, {
910
+ ...b,
911
+ // Handle <iframe>s
912
+ root: i.ownerDocument
913
+ });
914
+ } catch {
915
+ n = new IntersectionObserver(x, b);
916
+ }
917
+ n.observe(t);
918
+ }
919
+ return s(!0), r;
920
+ }
921
+ function Oe(t, e, n, o) {
922
+ o === void 0 && (o = {});
923
+ const {
924
+ ancestorScroll: i = !0,
925
+ ancestorResize: r = !0,
926
+ elementResize: s = typeof ResizeObserver == "function",
927
+ layoutShift: l = typeof IntersectionObserver == "function",
928
+ animationFrame: a = !1
929
+ } = o, f = pt(t), u = i || r ? [...f ? N(f) : [], ...N(e)] : [];
930
+ u.forEach((p) => {
931
+ i && p.addEventListener("scroll", n, {
932
+ passive: !0
933
+ }), r && p.addEventListener("resize", n);
934
+ });
935
+ const d = f && l ? De(f, n) : null;
936
+ let m = -1, c = null;
937
+ s && (c = new ResizeObserver((p) => {
938
+ let [y] = p;
939
+ y && y.target === f && c && (c.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
940
+ var b;
941
+ (b = c) == null || b.observe(e);
942
+ })), n();
943
+ }), f && !a && c.observe(f), c.observe(e));
944
+ let h, g = a ? K(t) : null;
945
+ a && w();
946
+ function w() {
947
+ const p = K(t);
948
+ g && !$t(g, p) && n(), g = p, h = requestAnimationFrame(w);
949
+ }
950
+ return n(), () => {
951
+ var p;
952
+ u.forEach((y) => {
953
+ i && y.removeEventListener("scroll", n), r && y.removeEventListener("resize", n);
954
+ }), d?.(), (p = c) == null || p.disconnect(), c = null, a && cancelAnimationFrame(h);
955
+ };
956
+ }
957
+ const Le = ee, Fe = Nt, Rt = ne, ke = It, Be = (t, e, n) => {
958
+ const o = /* @__PURE__ */ new Map(), i = {
959
+ platform: Ae,
960
+ ...n
961
+ }, r = {
962
+ ...i.platform,
963
+ _c: o
964
+ };
965
+ return Zt(t, e, {
966
+ ...i,
967
+ platform: r
968
+ });
969
+ };
970
+ class We {
971
+ /**
972
+ * register with host component
973
+ * @param host host component
974
+ */
975
+ constructor(e) {
976
+ this.updatePlacement = () => {
977
+ this.computePlacement();
978
+ }, this.host = e, e.addController(this);
979
+ }
980
+ async setPlacement(e = this.options) {
981
+ this.options = e;
982
+ const { trigger: n, target: o } = e;
983
+ this.cleanup = Oe(n, o, this.updatePlacement);
984
+ }
985
+ async computePlacement() {
986
+ var e;
987
+ const { arrowElement: n, alignment: o, caret: i, trigger: r, target: s, styleElement: l, matchWidth: a, open: f, flipArguments: u, alignmentAxisOffset: d } = this.options, m = l ?? s;
988
+ if (!m)
989
+ return;
990
+ let c;
991
+ switch (o) {
992
+ case "top-left":
993
+ c = "top-start";
994
+ break;
995
+ case "top-right":
996
+ c = "top-end";
997
+ break;
998
+ case "bottom-left":
999
+ c = "bottom-start";
1000
+ break;
1001
+ case "bottom-right":
1002
+ c = "bottom-end";
1003
+ break;
1004
+ case "left-bottom":
1005
+ c = "left-end";
1006
+ break;
1007
+ case "left-top":
1008
+ c = "left-start";
1009
+ break;
1010
+ case "right-bottom":
1011
+ c = "right-end";
1012
+ break;
1013
+ case "right-top":
1014
+ c = "right-start";
1015
+ break;
1016
+ default:
1017
+ c = o;
1018
+ break;
1019
+ }
1020
+ const h = [
1021
+ Fe(u),
1022
+ Le((d ?? 0) + (i ? 10 : 0)),
1023
+ ...i && n ? [ke({ element: n, padding: 15 })] : [],
1024
+ ...a && (c === "bottom" || c === "top") ? [
1025
+ Rt({
1026
+ apply({ rects: g, elements: w }) {
1027
+ w.floating.style.width = `${g.reference.width}px`;
1028
+ }
1029
+ })
1030
+ ] : [
1031
+ Rt({
1032
+ apply({ elements: g }) {
1033
+ g.floating.style.removeProperty("width");
1034
+ }
1035
+ })
1036
+ ]
1037
+ ];
1038
+ if (f) {
1039
+ const { x: g, y: w, placement: p, middlewareData: y, strategy: b } = await Be(r, m, {
1040
+ strategy: "fixed",
1041
+ middleware: h,
1042
+ placement: c
1043
+ });
1044
+ if (m.style.left = `${g}px`, m.style.top = `${w}px`, m.style.position = `${b}`, n) {
1045
+ const { x: v, y: x } = y.arrow, R = {
1046
+ top: "bottom",
1047
+ right: "left",
1048
+ bottom: "top",
1049
+ left: "right"
1050
+ }[p.split("-")[0]];
1051
+ n.style.left = v != null ? `${v}px` : "", n.style.top = x != null ? `${x}px` : "", n.style.right = "", n.style.bottom = "", n.style[R] = `${-n.offsetWidth / 2}px`;
1052
+ }
1053
+ (this.host.tagName === "CDS-AI-LABEL" || this.host.tagName === "CDS-SLUG") && ((e = this.host) === null || e === void 0 || e.setAttribute("alignment", p));
1054
+ }
1055
+ }
1056
+ hostUpdated() {
1057
+ var e;
1058
+ this.host.hasAttribute("open") || ((e = this.cleanup) === null || e === void 0 || e.call(this), this.cleanup = void 0);
1059
+ }
1060
+ hostDisconnected() {
1061
+ var e;
1062
+ (e = this.cleanup) === null || e === void 0 || e.call(this), this.cleanup = void 0;
1063
+ }
1064
+ }
1065
+ var Ct;
1066
+ (function(t) {
1067
+ t.TOP = "top", t.TOP_LEFT = "top-left", t.TOP_RIGHT = "top-right", t.TOP_START = "top-start", t.TOP_END = "top-end", t.BOTTOM = "bottom", t.BOTTOM_LEFT = "bottom-left", t.BOTTOM_RIGHT = "bottom-right", t.BOTTOM_START = "bottom-start", t.BOTTOM_END = "bottom-end", t.LEFT = "left", t.LEFT_BOTTOM = "left-bottom", t.LEFT_TOP = "left-top", t.LEFT_START = "left-start", t.LEFT_END = "left-end", t.RIGHT = "right", t.RIGHT_BOTTOM = "right-bottom", t.RIGHT_TOP = "right-top", t.RIGHT_START = "right-start", t.RIGHT_END = "right-end";
1068
+ })(Ct || (Ct = {}));
1069
+ var At;
1070
+ (function(t) {
1071
+ t.LAYER = "layer", t.BACKGROUND = "background";
1072
+ })(At || (At = {}));
1073
+ export {
1074
+ We as F,
1075
+ Ct as P,
1076
+ At as a
1077
+ };