@getflip/swirl-components-react 0.1.0 → 0.2.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 (160) hide show
  1. package/dist/_commonjsHelpers-44457d8d.ba94af77.js +37 -0
  2. package/dist/a11y-dialog.esm-d7a94c8c.bd6ae411.js +99 -0
  3. package/dist/bodyScrollLock.esm-ce6356d8.2c600fb9.js +93 -0
  4. package/dist/{flip-action-list-item.entry.1b728e6a.js → flip-action-list-item.entry.66f33805.js} +3 -2
  5. package/dist/{flip-action-list-section.entry.da3e6186.js → flip-action-list-section.entry.2927ba41.js} +1 -1
  6. package/dist/{flip-action-list.entry.400a309a.js → flip-action-list.entry.66352b19.js} +2 -2
  7. package/dist/flip-avatar-group.entry.be7886a3.js +20 -0
  8. package/dist/{flip-avatar.entry.2eb3242e.js → flip-avatar.entry.f95286a1.js} +3 -2
  9. package/dist/flip-badge.entry.3f2d34e9.js +20 -0
  10. package/dist/{flip-banner.entry.b3012465.js → flip-banner.entry.32f2ef57.js} +3 -2
  11. package/dist/flip-button-group.entry.ed86679b.js +15 -0
  12. package/dist/flip-button.entry.555b8fd4.js +33 -0
  13. package/dist/{flip-checkbox.entry.2f740fb8.js → flip-checkbox.entry.9768035f.js} +10 -9
  14. package/dist/{flip-chip.entry.e9729ac7.js → flip-chip.entry.5ebbf411.js} +3 -2
  15. package/dist/flip-date-input.entry.7bf9efc5.js +5473 -0
  16. package/dist/flip-date-picker_3.entry.54e0b84d.js +1270 -0
  17. package/dist/{flip-description-list-item.entry.c789511e.js → flip-description-list-item.entry.f4e6faf7.js} +1 -1
  18. package/dist/{flip-description-list.entry.3b158436.js → flip-description-list.entry.2b1d4579.js} +1 -1
  19. package/dist/flip-dialog.entry.2bbc3bff.js +45 -0
  20. package/dist/flip-empty-state.entry.376592fa.js +15 -0
  21. package/dist/flip-file-uploader.entry.c0ddf5a7.js +32 -0
  22. package/dist/flip-file-viewer-audio_6.entry.d60d1099.js +16174 -0
  23. package/dist/flip-file-viewer.entry.0c2922e5.js +95 -0
  24. package/dist/flip-form-control.entry.71c275f5.js +58 -0
  25. package/dist/flip-form-group.entry.ad2385d5.js +18 -0
  26. package/dist/flip-heading.entry.1245bdda.js +18 -0
  27. package/dist/{flip-icon-add-photo.entry.a1003bdf.js → flip-icon-add-photo.entry.c3178433.js} +1 -1
  28. package/dist/{flip-icon-add.entry.7103fbe7.js → flip-icon-add.entry.708a8c7c.js} +1 -1
  29. package/dist/{flip-icon-admin-panel-settings.entry.36a12e47.js → flip-icon-admin-panel-settings.entry.88af777a.js} +1 -1
  30. package/dist/{flip-icon-arrow-back.entry.e35ba078.js → flip-icon-arrow-back.entry.abd86e13.js} +1 -1
  31. package/dist/{flip-icon-arrow-forward.entry.5138c404.js → flip-icon-arrow-forward.entry.ef6e8b77.js} +1 -1
  32. package/dist/flip-icon-arrow-left.entry.70be0607.js +15 -0
  33. package/dist/{flip-icon-arrow-right-small.entry.d1eeb150.js → flip-icon-arrow-right-small.entry.d342c71f.js} +1 -1
  34. package/dist/flip-icon-arrow-right.entry.bd9eae8e.js +15 -0
  35. package/dist/{flip-icon-attachment.entry.594b602b.js → flip-icon-attachment.entry.898243d2.js} +1 -1
  36. package/dist/flip-icon-cancel.entry.fac41df2.js +15 -0
  37. package/dist/{flip-icon-chat-bubble.entry.f56fcdc4.js → flip-icon-chat-bubble.entry.016c1f0d.js} +1 -1
  38. package/dist/{flip-icon-check-circle.entry.e4f8169d.js → flip-icon-check-circle.entry.330f4038.js} +1 -1
  39. package/dist/{flip-icon-check-small.entry.308d57d1.js → flip-icon-check-small.entry.590b928f.js} +1 -1
  40. package/dist/{flip-icon-check-strong.entry.b61365d2.js → flip-icon-check-strong.entry.8fb90e69.js} +1 -1
  41. package/dist/{flip-icon-check.entry.f2c6b547.js → flip-icon-check.entry.bf4892a9.js} +1 -1
  42. package/dist/{flip-icon-chevron-left.entry.dbe9b291.js → flip-icon-chevron-left.entry.8a5cd7ef.js} +1 -1
  43. package/dist/{flip-icon-chevron-right.entry.9565c0f1.js → flip-icon-chevron-right.entry.ba87bdc8.js} +1 -1
  44. package/dist/{flip-icon-close-small.entry.8bfcf1b1.js → flip-icon-close-small.entry.d3ca39fb.js} +1 -1
  45. package/dist/{flip-icon-close.entry.41992748.js → flip-icon-close.entry.ebcf0fe6.js} +1 -1
  46. package/dist/flip-icon-cloud-upload.entry.bf4e840b.js +15 -0
  47. package/dist/{flip-icon-comment.entry.2aac2c10.js → flip-icon-comment.entry.dd07b7a4.js} +1 -1
  48. package/dist/{flip-icon-copy.entry.8e59bf1d.js → flip-icon-copy.entry.796dcb43.js} +1 -1
  49. package/dist/{flip-icon-date-range.entry.c1dd2730.js → flip-icon-date-range.entry.53c670dc.js} +1 -1
  50. package/dist/{flip-icon-delete.entry.bc0b61ff.js → flip-icon-delete.entry.df480685.js} +1 -1
  51. package/dist/{flip-icon-description.entry.e01b2d40.js → flip-icon-description.entry.da40cecc.js} +1 -1
  52. package/dist/{flip-icon-download.entry.a512f353.js → flip-icon-download.entry.3926477e.js} +1 -1
  53. package/dist/{flip-icon-edit.entry.7e3cd472.js → flip-icon-edit.entry.0f50ba4c.js} +1 -1
  54. package/dist/{flip-icon-emoji-mood.entry.df7b536f.js → flip-icon-emoji-mood.entry.4fa27f13.js} +1 -1
  55. package/dist/{flip-icon-emoji-satisfied.entry.e3e5352b.js → flip-icon-emoji-satisfied.entry.9246c39b.js} +1 -1
  56. package/dist/{flip-icon-error.entry.96c3c29b.js → flip-icon-error_3.entry.4e8dcd9e.js} +30 -6
  57. package/dist/flip-icon-expand-less_3.entry.f191352f.js +35 -0
  58. package/dist/{flip-icon-expand-more.entry.4c1fa160.js → flip-icon-expand-more.entry.5dbcc3e3.js} +1 -1
  59. package/dist/{flip-icon-file.entry.3a18cce8.js → flip-icon-file.entry.64c3e030.js} +1 -1
  60. package/dist/{flip-icon-folder-shared.entry.38b22cd2.js → flip-icon-folder-shared.entry.87cd72cd.js} +1 -1
  61. package/dist/flip-icon-fullscreen-exit.entry.b274fc5c.js +15 -0
  62. package/dist/flip-icon-fullscreen.entry.a0a70cc8.js +15 -0
  63. package/dist/{flip-icon-group-assign.entry.a640254f.js → flip-icon-group-assign.entry.17e70921.js} +1 -1
  64. package/dist/{flip-icon-groups-custom.entry.d77901cd.js → flip-icon-groups-custom.entry.ed78b313.js} +1 -1
  65. package/dist/{flip-icon-groups.entry.80196d79.js → flip-icon-groups.entry.ff8a5e63.js} +1 -1
  66. package/dist/{flip-icon-image.entry.601bf2ae.js → flip-icon-image.entry.b010afb8.js} +1 -1
  67. package/dist/{flip-icon-info.entry.b480a255.js → flip-icon-info.entry.61351d50.js} +1 -1
  68. package/dist/{flip-icon-inventory.entry.bb8a5615.js → flip-icon-inventory.entry.f0ffd90a.js} +1 -1
  69. package/dist/{flip-icon-like.entry.af8b36e2.js → flip-icon-like.entry.6b0034de.js} +1 -1
  70. package/dist/{flip-icon-link.entry.be72688c.js → flip-icon-link.entry.9229312e.js} +1 -1
  71. package/dist/{flip-icon-lock.entry.440459fe.js → flip-icon-lock.entry.03e5fa85.js} +1 -1
  72. package/dist/{flip-icon-logout.entry.dde0bfc8.js → flip-icon-logout.entry.8b073a7d.js} +1 -1
  73. package/dist/{flip-icon-mail.entry.b57a0093.js → flip-icon-mail.entry.91482af2.js} +1 -1
  74. package/dist/{flip-icon-manage-accounts.entry.11cc3149.js → flip-icon-manage-accounts.entry.5de8be6f.js} +1 -1
  75. package/dist/{flip-icon-mention.entry.32771810.js → flip-icon-mention.entry.ef803509.js} +1 -1
  76. package/dist/{flip-icon-message.entry.636088c3.js → flip-icon-message.entry.20ae73fb.js} +1 -1
  77. package/dist/{flip-icon-more-horizontal.entry.38f14508.js → flip-icon-more-horizontal.entry.9a2357f0.js} +1 -1
  78. package/dist/{flip-icon-more-vertikal.entry.8a4c613a.js → flip-icon-more-vertikal.entry.0447fdab.js} +1 -1
  79. package/dist/{flip-icon-notifications-active.entry.5658308d.js → flip-icon-notifications-active.entry.3aa487b9.js} +1 -1
  80. package/dist/{flip-icon-notifications-off.entry.8d3b11ff.js → flip-icon-notifications-off.entry.285c2bb6.js} +1 -1
  81. package/dist/{flip-icon-notifications.entry.91f77dd2.js → flip-icon-notifications.entry.e60fed91.js} +1 -1
  82. package/dist/flip-icon-open-in-new.entry.9de4d7c0.js +15 -0
  83. package/dist/{flip-icon-people-alt.entry.b0b2e20c.js → flip-icon-people-alt.entry.dd840fb1.js} +1 -1
  84. package/dist/{flip-icon-person-off.entry.e79df0e6.js → flip-icon-person-off.entry.df6c63b6.js} +1 -1
  85. package/dist/{flip-icon-person.entry.1bc59e68.js → flip-icon-person.entry.37939889.js} +1 -1
  86. package/dist/{flip-icon-phone.entry.03e81177.js → flip-icon-phone.entry.08245320.js} +1 -1
  87. package/dist/{flip-icon-poll.entry.4e059f77.js → flip-icon-poll.entry.e0ff1d9f.js} +1 -1
  88. package/dist/flip-icon-print.entry.f5fbd804.js +15 -0
  89. package/dist/{flip-icon-recieved.entry.e3410f9e.js → flip-icon-recieved.entry.5b4e2a50.js} +1 -1
  90. package/dist/flip-icon-remove.entry.98d516c6.js +15 -0
  91. package/dist/{flip-icon-search-strong.entry.ec0849a6.js → flip-icon-search-strong.entry.afcf6af9.js} +1 -1
  92. package/dist/{flip-icon-cancel_2.entry.eb8d1a8c.js → flip-icon-search.entry.0f103075.js} +3 -13
  93. package/dist/{flip-icon-send.entry.3f80869c.js → flip-icon-send.entry.fd3001a2.js} +1 -1
  94. package/dist/{flip-icon-settings.entry.c86a7bca.js → flip-icon-settings.entry.2b1e4bb0.js} +1 -1
  95. package/dist/{flip-icon-time-filled.entry.ad86a08f.js → flip-icon-time-filled.entry.7fa814d7.js} +1 -1
  96. package/dist/{flip-icon-time-outlined.entry.75a29f76.js → flip-icon-time-outlined.entry.e3f601ce.js} +1 -1
  97. package/dist/{flip-icon-user-assign.entry.1f331180.js → flip-icon-user-assign.entry.4951e82f.js} +1 -1
  98. package/dist/{flip-icon-video-camera.entry.40ea3d7d.js → flip-icon-video-camera.entry.74f8a7b6.js} +1 -1
  99. package/dist/{flip-icon-warning.entry.1c1540b8.js → flip-icon-warning.entry.76ebfb1e.js} +1 -1
  100. package/dist/{flip-link.entry.fe817ab1.js → flip-link.entry.f67e488c.js} +1 -1
  101. package/dist/flip-list.entry.5cc5b288.js +18 -0
  102. package/dist/flip-modal.entry.4921d0b4.js +61 -0
  103. package/dist/flip-option-list-item.entry.fd1d85dd.js +30 -0
  104. package/dist/flip-option-list-section.entry.5509895e.js +15 -0
  105. package/dist/flip-option-list.entry.efe97de9.js +95 -0
  106. package/dist/flip-pagination.entry.b109c35d.js +27 -0
  107. package/dist/flip-progress-indicator.entry.b7cf2985.js +18 -0
  108. package/dist/flip-radio-group.entry.dfc6ef8e.js +35 -0
  109. package/dist/{flip-radio.entry.817d976d.js → flip-radio.entry.f153fc92.js} +6 -5
  110. package/dist/flip-resource-list-file-item.entry.26beeeee.js +20 -0
  111. package/dist/flip-resource-list-item.entry.7cac7a7c.js +41 -0
  112. package/dist/flip-resource-list.entry.75d10224.js +49 -0
  113. package/dist/{flip-search.entry.6717d77a.js → flip-search.entry.eccdd9b5.js} +3 -2
  114. package/dist/{flip-stack.entry.50d88d6f.js → flip-stack.entry.2448bd6b.js} +3 -2
  115. package/dist/{flip-switch.entry.ef96875e.js → flip-switch.entry.71d04383.js} +3 -2
  116. package/dist/flip-tab.entry.184626dd.js +18 -0
  117. package/dist/flip-tabs.entry.9434fd96.js +92 -0
  118. package/dist/{flip-tag.entry.31a7d0f7.js → flip-tag.entry.5df8a6b4.js} +3 -2
  119. package/dist/flip-text-input.entry.55decf50.js +55 -0
  120. package/dist/flip-text.entry.2b6e3f56.js +18 -0
  121. package/dist/{flip-theme-provider.entry.9c054d33.js → flip-theme-provider.entry.1570cb6b.js} +1 -1
  122. package/dist/{flip-thumbnail.entry.449e93ef.js → flip-thumbnail.entry.54ea67cf.js} +3 -2
  123. package/dist/{flip-toast-provider.entry.59025e1a.js → flip-toast-provider.entry.0ee21f8b.js} +1 -1
  124. package/dist/{flip-toast.entry.78522d59.js → flip-toast.entry.29ea2ead.js} +3 -2
  125. package/dist/flip-tooltip.entry.e6a904e4.js +94 -0
  126. package/dist/flip-video-thumbnail.entry.f3cf1c28.js +83 -0
  127. package/dist/{flip-visually-hidden.entry.ae0ff292.js → flip-visually-hidden.entry.47d25a46.js} +1 -1
  128. package/dist/floating-ui.dom.esm-1a4e8b8a.87557233.js +752 -0
  129. package/dist/index-6d2e18c6.289636d4.js +37 -0
  130. package/dist/index.b6e7bb76.js +1359 -0
  131. package/dist/index.d.ts +1 -0
  132. package/dist/stencil-generated/index.d.ts +136 -0
  133. package/dist/stencil-generated/react-component-lib/createComponent.d.ts +10 -0
  134. package/dist/stencil-generated/react-component-lib/createOverlayComponent.d.ts +21 -0
  135. package/dist/stencil-generated/react-component-lib/index.d.ts +2 -0
  136. package/dist/stencil-generated/react-component-lib/interfaces.d.ts +29 -0
  137. package/dist/stencil-generated/react-component-lib/utils/attachProps.d.ts +12 -0
  138. package/dist/stencil-generated/react-component-lib/utils/case.d.ts +2 -0
  139. package/dist/stencil-generated/react-component-lib/utils/index.d.ts +10 -0
  140. package/dist/swirl-components-react.js +133 -96
  141. package/dist/swirl-components-react.umd.cjs +137 -17
  142. package/dist/utils-b46bcd4f.79126bb2.js +30 -0
  143. package/dist/vite-env.d.ts +1 -0
  144. package/package.json +5 -3
  145. package/dist/flip-avatar-group.entry.71bf1f2a.js +0 -19
  146. package/dist/flip-badge.entry.ebda6058.js +0 -19
  147. package/dist/flip-button_2.entry.a323451d.js +0 -42
  148. package/dist/flip-dialog.entry.f2be9a9c.js +0 -139
  149. package/dist/flip-icon-expand-less.entry.3e970433.js +0 -15
  150. package/dist/flip-icon-today.entry.ab272990.js +0 -15
  151. package/dist/flip-icon-visibility-off.entry.ed4db3b5.js +0 -15
  152. package/dist/flip-icon-visibility.entry.1a7dfd44.js +0 -15
  153. package/dist/flip-inline-error.entry.38c26d13.js +0 -17
  154. package/dist/flip-popover.entry.18c5ead6.js +0 -878
  155. package/dist/flip-radio-group.entry.187f29ee.js +0 -35
  156. package/dist/flip-spinner.entry.f8f179be.js +0 -17
  157. package/dist/flip-tooltip.entry.8b5f35c7.js +0 -102
  158. package/dist/index-3c78bcaf.2675909b.js +0 -48
  159. package/dist/main.7e7363a7.js +0 -1322
  160. package/dist/utils-03e3261c.f5223801.js +0 -16
@@ -1,878 +0,0 @@
1
- import { r as Rt, h as S, H as Tt, g as St } from "./main.7e7363a7.js";
2
- import { c as Et } from "./index-3c78bcaf.2675909b.js";
3
- import { q as Pt } from "./utils-03e3261c.f5223801.js";
4
- import "react";
5
- import "react-dom";
6
- function j(t) {
7
- return t.split("-")[0];
8
- }
9
- function pt(t) {
10
- return t.split("-")[1];
11
- }
12
- function Q(t) {
13
- return ["top", "bottom"].includes(j(t)) ? "x" : "y";
14
- }
15
- function ht(t) {
16
- return t === "y" ? "height" : "width";
17
- }
18
- function it(t, e, o) {
19
- let {
20
- reference: n,
21
- floating: i
22
- } = t;
23
- const s = n.x + n.width / 2 - i.width / 2, a = n.y + n.height / 2 - i.height / 2, r = Q(e), l = ht(r), c = n[l] / 2 - i[l] / 2, p = j(e), d = r === "x";
24
- let f;
25
- switch (p) {
26
- case "top":
27
- f = {
28
- x: s,
29
- y: n.y - i.height
30
- };
31
- break;
32
- case "bottom":
33
- f = {
34
- x: s,
35
- y: n.y + n.height
36
- };
37
- break;
38
- case "right":
39
- f = {
40
- x: n.x + n.width,
41
- y: a
42
- };
43
- break;
44
- case "left":
45
- f = {
46
- x: n.x - i.width,
47
- y: a
48
- };
49
- break;
50
- default:
51
- f = {
52
- x: n.x,
53
- y: n.y
54
- };
55
- }
56
- switch (pt(e)) {
57
- case "start":
58
- f[r] -= c * (o && d ? -1 : 1);
59
- break;
60
- case "end":
61
- f[r] += c * (o && d ? -1 : 1);
62
- break;
63
- }
64
- return f;
65
- }
66
- const Lt = async (t, e, o) => {
67
- const {
68
- placement: n = "bottom",
69
- strategy: i = "absolute",
70
- middleware: s = [],
71
- platform: a
72
- } = o, r = await (a.isRTL == null ? void 0 : a.isRTL(e));
73
- let l = await a.getElementRects({
74
- reference: t,
75
- floating: e,
76
- strategy: i
77
- }), {
78
- x: c,
79
- y: p
80
- } = it(l, n, r), d = n, f = {}, h = 0;
81
- for (let m = 0; m < s.length; m++) {
82
- const {
83
- name: u,
84
- fn: v
85
- } = s[m], {
86
- x: g,
87
- y: w,
88
- data: k,
89
- reset: y
90
- } = await v({
91
- x: c,
92
- y: p,
93
- initialPlacement: n,
94
- placement: d,
95
- strategy: i,
96
- middlewareData: f,
97
- rects: l,
98
- platform: a,
99
- elements: {
100
- reference: t,
101
- floating: e
102
- }
103
- });
104
- if (c = g != null ? g : c, p = w != null ? w : p, f = {
105
- ...f,
106
- [u]: {
107
- ...f[u],
108
- ...k
109
- }
110
- }, y && h <= 50) {
111
- h++, typeof y == "object" && (y.placement && (d = y.placement), y.rects && (l = y.rects === !0 ? await a.getElementRects({
112
- reference: t,
113
- floating: e,
114
- strategy: i
115
- }) : y.rects), {
116
- x: c,
117
- y: p
118
- } = it(l, d, r)), m = -1;
119
- continue;
120
- }
121
- }
122
- return {
123
- x: c,
124
- y: p,
125
- placement: d,
126
- strategy: i,
127
- middlewareData: f
128
- };
129
- };
130
- function Ot(t) {
131
- return {
132
- top: 0,
133
- right: 0,
134
- bottom: 0,
135
- left: 0,
136
- ...t
137
- };
138
- }
139
- function Bt(t) {
140
- return typeof t != "number" ? Ot(t) : {
141
- top: t,
142
- right: t,
143
- bottom: t,
144
- left: t
145
- };
146
- }
147
- function N(t) {
148
- return {
149
- ...t,
150
- top: t.y,
151
- left: t.x,
152
- right: t.x + t.width,
153
- bottom: t.y + t.height
154
- };
155
- }
156
- async function mt(t, e) {
157
- var o;
158
- e === void 0 && (e = {});
159
- const {
160
- x: n,
161
- y: i,
162
- platform: s,
163
- rects: a,
164
- elements: r,
165
- strategy: l
166
- } = t, {
167
- boundary: c = "clippingAncestors",
168
- rootBoundary: p = "viewport",
169
- elementContext: d = "floating",
170
- altBoundary: f = !1,
171
- padding: h = 0
172
- } = e, m = Bt(h), v = r[f ? d === "floating" ? "reference" : "floating" : d], g = N(await s.getClippingRect({
173
- element: (o = await (s.isElement == null ? void 0 : s.isElement(v))) == null || o ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(r.floating)),
174
- boundary: c,
175
- rootBoundary: p,
176
- strategy: l
177
- })), w = N(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
178
- rect: d === "floating" ? {
179
- ...a.floating,
180
- x: n,
181
- y: i
182
- } : a.reference,
183
- offsetParent: await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(r.floating)),
184
- strategy: l
185
- }) : a[d]);
186
- return {
187
- top: g.top - w.top + m.top,
188
- bottom: w.bottom - g.bottom + m.bottom,
189
- left: g.left - w.left + m.left,
190
- right: w.right - g.right + m.right
191
- };
192
- }
193
- const Dt = Math.min, Mt = Math.max;
194
- function rt(t, e, o) {
195
- return Mt(t, Dt(e, o));
196
- }
197
- const It = {
198
- left: "right",
199
- right: "left",
200
- bottom: "top",
201
- top: "bottom"
202
- };
203
- function Y(t) {
204
- return t.replace(/left|right|bottom|top/g, (e) => It[e]);
205
- }
206
- function Ht(t, e, o) {
207
- o === void 0 && (o = !1);
208
- const n = pt(t), i = Q(t), s = ht(i);
209
- let a = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
210
- return e.reference[s] > e.floating[s] && (a = Y(a)), {
211
- main: a,
212
- cross: Y(a)
213
- };
214
- }
215
- const Ft = {
216
- start: "end",
217
- end: "start"
218
- };
219
- function st(t) {
220
- return t.replace(/start|end/g, (e) => Ft[e]);
221
- }
222
- function Vt(t) {
223
- const e = Y(t);
224
- return [st(t), e, st(e)];
225
- }
226
- const Wt = function(t) {
227
- return t === void 0 && (t = {}), {
228
- name: "flip",
229
- options: t,
230
- async fn(e) {
231
- var o;
232
- const {
233
- placement: n,
234
- middlewareData: i,
235
- rects: s,
236
- initialPlacement: a,
237
- platform: r,
238
- elements: l
239
- } = e, {
240
- mainAxis: c = !0,
241
- crossAxis: p = !0,
242
- fallbackPlacements: d,
243
- fallbackStrategy: f = "bestFit",
244
- flipAlignment: h = !0,
245
- ...m
246
- } = t, u = j(n), g = d || (u === a || !h ? [Y(a)] : Vt(a)), w = [a, ...g], k = await mt(e, m), y = [];
247
- let H = ((o = i.flip) == null ? void 0 : o.overflows) || [];
248
- if (c && y.push(k[u]), p) {
249
- const {
250
- main: L,
251
- cross: F
252
- } = Ht(n, s, await (r.isRTL == null ? void 0 : r.isRTL(l.floating)));
253
- y.push(k[L], k[F]);
254
- }
255
- if (H = [...H, {
256
- placement: n,
257
- overflows: y
258
- }], !y.every((L) => L <= 0)) {
259
- var tt, et;
260
- const L = ((tt = (et = i.flip) == null ? void 0 : et.index) != null ? tt : 0) + 1, F = w[L];
261
- if (F)
262
- return {
263
- data: {
264
- index: L,
265
- overflows: H
266
- },
267
- reset: {
268
- placement: F
269
- }
270
- };
271
- let V = "bottom";
272
- switch (f) {
273
- case "bestFit": {
274
- var ot;
275
- const nt = (ot = H.map((W) => [W, W.overflows.filter((B) => B > 0).reduce((B, _t) => B + _t, 0)]).sort((W, B) => W[1] - B[1])[0]) == null ? void 0 : ot[0].placement;
276
- nt && (V = nt);
277
- break;
278
- }
279
- case "initialPlacement":
280
- V = a;
281
- break;
282
- }
283
- if (n !== V)
284
- return {
285
- reset: {
286
- placement: V
287
- }
288
- };
289
- }
290
- return {};
291
- }
292
- };
293
- };
294
- function Nt(t) {
295
- return t === "x" ? "y" : "x";
296
- }
297
- const Yt = function(t) {
298
- return t === void 0 && (t = {}), {
299
- name: "shift",
300
- options: t,
301
- async fn(e) {
302
- const {
303
- x: o,
304
- y: n,
305
- placement: i
306
- } = e, {
307
- mainAxis: s = !0,
308
- crossAxis: a = !1,
309
- limiter: r = {
310
- fn: (v) => {
311
- let {
312
- x: g,
313
- y: w
314
- } = v;
315
- return {
316
- x: g,
317
- y: w
318
- };
319
- }
320
- },
321
- ...l
322
- } = t, c = {
323
- x: o,
324
- y: n
325
- }, p = await mt(e, l), d = Q(j(i)), f = Nt(d);
326
- let h = c[d], m = c[f];
327
- if (s) {
328
- const v = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", w = h + p[v], k = h - p[g];
329
- h = rt(w, h, k);
330
- }
331
- if (a) {
332
- const v = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", w = m + p[v], k = m - p[g];
333
- m = rt(w, m, k);
334
- }
335
- const u = r.fn({
336
- ...e,
337
- [d]: h,
338
- [f]: m
339
- });
340
- return {
341
- ...u,
342
- data: {
343
- x: u.x - o,
344
- y: u.y - n
345
- }
346
- };
347
- }
348
- };
349
- };
350
- function vt(t) {
351
- return t && t.document && t.location && t.alert && t.setInterval;
352
- }
353
- function _(t) {
354
- if (t == null)
355
- return window;
356
- if (!vt(t)) {
357
- const e = t.ownerDocument;
358
- return e && e.defaultView || window;
359
- }
360
- return t;
361
- }
362
- function b(t) {
363
- return _(t).getComputedStyle(t);
364
- }
365
- function A(t) {
366
- return vt(t) ? "" : t ? (t.nodeName || "").toLowerCase() : "";
367
- }
368
- function gt() {
369
- const t = navigator.userAgentData;
370
- return t != null && t.brands ? t.brands.map((e) => e.brand + "/" + e.version).join(" ") : navigator.userAgent;
371
- }
372
- function x(t) {
373
- return t instanceof _(t).HTMLElement;
374
- }
375
- function R(t) {
376
- return t instanceof _(t).Element;
377
- }
378
- function $t(t) {
379
- return t instanceof _(t).Node;
380
- }
381
- function O(t) {
382
- if (typeof ShadowRoot > "u")
383
- return !1;
384
- const e = _(t).ShadowRoot;
385
- return t instanceof e || t instanceof ShadowRoot;
386
- }
387
- function K(t) {
388
- const {
389
- overflow: e,
390
- overflowX: o,
391
- overflowY: n
392
- } = b(t);
393
- return /auto|scroll|overlay|hidden/.test(e + n + o);
394
- }
395
- function zt(t) {
396
- return ["table", "td", "th"].includes(A(t));
397
- }
398
- function wt(t) {
399
- const e = /firefox/i.test(gt()), o = b(t);
400
- return o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].includes(o.willChange) || e && o.willChange === "filter" || e && (o.filter ? o.filter !== "none" : !1);
401
- }
402
- function yt() {
403
- return !/^((?!chrome|android).)*safari/i.test(gt());
404
- }
405
- const at = Math.min, D = Math.max, $ = Math.round;
406
- function C(t, e, o) {
407
- var n, i, s, a;
408
- e === void 0 && (e = !1), o === void 0 && (o = !1);
409
- const r = t.getBoundingClientRect();
410
- let l = 1, c = 1;
411
- e && x(t) && (l = t.offsetWidth > 0 && $(r.width) / t.offsetWidth || 1, c = t.offsetHeight > 0 && $(r.height) / t.offsetHeight || 1);
412
- const p = R(t) ? _(t) : window, d = !yt() && o, f = (r.left + (d && (n = (i = p.visualViewport) == null ? void 0 : i.offsetLeft) != null ? n : 0)) / l, h = (r.top + (d && (s = (a = p.visualViewport) == null ? void 0 : a.offsetTop) != null ? s : 0)) / c, m = r.width / l, u = r.height / c;
413
- return {
414
- width: m,
415
- height: u,
416
- top: h,
417
- right: f + m,
418
- bottom: h + u,
419
- left: f,
420
- x: f,
421
- y: h
422
- };
423
- }
424
- function T(t) {
425
- return (($t(t) ? t.ownerDocument : t.document) || window.document).documentElement;
426
- }
427
- function G(t) {
428
- return R(t) ? {
429
- scrollLeft: t.scrollLeft,
430
- scrollTop: t.scrollTop
431
- } : {
432
- scrollLeft: t.pageXOffset,
433
- scrollTop: t.pageYOffset
434
- };
435
- }
436
- function bt(t) {
437
- return C(T(t)).left + G(t).scrollLeft;
438
- }
439
- function Ut(t) {
440
- const e = C(t);
441
- return $(e.width) !== t.offsetWidth || $(e.height) !== t.offsetHeight;
442
- }
443
- function qt(t, e, o) {
444
- const n = x(e), i = T(e), s = C(
445
- t,
446
- n && Ut(e),
447
- o === "fixed"
448
- );
449
- let a = {
450
- scrollLeft: 0,
451
- scrollTop: 0
452
- };
453
- const r = {
454
- x: 0,
455
- y: 0
456
- };
457
- if (n || !n && o !== "fixed")
458
- if ((A(e) !== "body" || K(i)) && (a = G(e)), x(e)) {
459
- const l = C(e, !0);
460
- r.x = l.x + e.clientLeft, r.y = l.y + e.clientTop;
461
- } else
462
- i && (r.x = bt(i));
463
- return {
464
- x: s.left + a.scrollLeft - r.x,
465
- y: s.top + a.scrollTop - r.y,
466
- width: s.width,
467
- height: s.height
468
- };
469
- }
470
- function xt(t) {
471
- return A(t) === "html" ? t : t.assignedSlot || t.parentNode || (O(t) ? t.host : null) || T(t);
472
- }
473
- function lt(t) {
474
- return !x(t) || b(t).position === "fixed" ? null : Xt(t);
475
- }
476
- function Xt(t) {
477
- let {
478
- offsetParent: e
479
- } = t, o = t, n = !1;
480
- for (; o && o !== e; ) {
481
- const {
482
- assignedSlot: i
483
- } = o;
484
- if (i) {
485
- let s = i.offsetParent;
486
- if (b(i).display === "contents") {
487
- const a = i.hasAttribute("style"), r = i.style.display;
488
- i.style.display = b(o).display, s = i.offsetParent, i.style.display = r, a || i.removeAttribute("style");
489
- }
490
- o = i, e !== s && (e = s, n = !0);
491
- } else if (O(o) && o.host && n)
492
- break;
493
- o = O(o) && o.host || o.parentNode;
494
- }
495
- return e;
496
- }
497
- function jt(t) {
498
- let e = xt(t);
499
- for (O(e) && (e = e.host); x(e) && !["html", "body"].includes(A(e)); ) {
500
- if (wt(e))
501
- return e;
502
- {
503
- const o = e.parentNode;
504
- e = O(o) ? o.host : o;
505
- }
506
- }
507
- return null;
508
- }
509
- function J(t) {
510
- const e = _(t);
511
- let o = lt(t);
512
- for (; o && zt(o) && b(o).position === "static"; )
513
- o = lt(o);
514
- return o && (A(o) === "html" || A(o) === "body" && b(o).position === "static" && !wt(o)) ? e : o || jt(t) || e;
515
- }
516
- function ct(t) {
517
- if (x(t))
518
- return {
519
- width: t.offsetWidth,
520
- height: t.offsetHeight
521
- };
522
- const e = C(t);
523
- return {
524
- width: e.width,
525
- height: e.height
526
- };
527
- }
528
- function Kt(t) {
529
- let {
530
- rect: e,
531
- offsetParent: o,
532
- strategy: n
533
- } = t;
534
- const i = x(o), s = T(o);
535
- if (o === s)
536
- return e;
537
- let a = {
538
- scrollLeft: 0,
539
- scrollTop: 0
540
- };
541
- const r = {
542
- x: 0,
543
- y: 0
544
- };
545
- if ((i || !i && n !== "fixed") && ((A(o) !== "body" || K(s)) && (a = G(o)), x(o))) {
546
- const l = C(o, !0);
547
- r.x = l.x + o.clientLeft, r.y = l.y + o.clientTop;
548
- }
549
- return {
550
- ...e,
551
- x: e.x - a.scrollLeft + r.x,
552
- y: e.y - a.scrollTop + r.y
553
- };
554
- }
555
- function Gt(t, e) {
556
- const o = _(t), n = T(t), i = o.visualViewport;
557
- let s = n.clientWidth, a = n.clientHeight, r = 0, l = 0;
558
- if (i) {
559
- s = i.width, a = i.height;
560
- const c = yt();
561
- (c || !c && e === "fixed") && (r = i.offsetLeft, l = i.offsetTop);
562
- }
563
- return {
564
- width: s,
565
- height: a,
566
- x: r,
567
- y: l
568
- };
569
- }
570
- function Jt(t) {
571
- var e;
572
- const o = T(t), n = G(t), i = (e = t.ownerDocument) == null ? void 0 : e.body, s = D(o.scrollWidth, o.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), a = D(o.scrollHeight, o.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0);
573
- let r = -n.scrollLeft + bt(t);
574
- const l = -n.scrollTop;
575
- return b(i || o).direction === "rtl" && (r += D(o.clientWidth, i ? i.clientWidth : 0) - s), {
576
- width: s,
577
- height: a,
578
- x: r,
579
- y: l
580
- };
581
- }
582
- function kt(t) {
583
- const e = xt(t);
584
- return ["html", "body", "#document"].includes(A(e)) ? t.ownerDocument.body : x(e) && K(e) ? e : kt(e);
585
- }
586
- function z(t, e) {
587
- var o;
588
- e === void 0 && (e = []);
589
- const n = kt(t), i = n === ((o = t.ownerDocument) == null ? void 0 : o.body), s = _(n), a = i ? [s].concat(s.visualViewport || [], K(n) ? n : []) : n, r = e.concat(a);
590
- return i ? r : r.concat(z(a));
591
- }
592
- function Qt(t, e) {
593
- const o = e.getRootNode == null ? void 0 : e.getRootNode();
594
- if (t.contains(e))
595
- return !0;
596
- if (o && O(o)) {
597
- let n = e;
598
- do {
599
- if (n && t === n)
600
- return !0;
601
- n = n.parentNode || n.host;
602
- } while (n);
603
- }
604
- return !1;
605
- }
606
- function Zt(t, e) {
607
- const o = C(t, !1, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft;
608
- return {
609
- top: n,
610
- left: i,
611
- x: i,
612
- y: n,
613
- right: i + t.clientWidth,
614
- bottom: n + t.clientHeight,
615
- width: t.clientWidth,
616
- height: t.clientHeight
617
- };
618
- }
619
- function dt(t, e, o) {
620
- return e === "viewport" ? N(Gt(t, o)) : R(e) ? Zt(e, o) : N(Jt(T(t)));
621
- }
622
- function te(t) {
623
- const e = z(t), n = ["absolute", "fixed"].includes(b(t).position) && x(t) ? J(t) : t;
624
- return R(n) ? e.filter((i) => R(i) && Qt(i, n) && A(i) !== "body") : [];
625
- }
626
- function ee(t) {
627
- let {
628
- element: e,
629
- boundary: o,
630
- rootBoundary: n,
631
- strategy: i
632
- } = t;
633
- const a = [...o === "clippingAncestors" ? te(e) : [].concat(o), n], r = a[0], l = a.reduce((c, p) => {
634
- const d = dt(e, p, i);
635
- return c.top = D(d.top, c.top), c.right = at(d.right, c.right), c.bottom = at(d.bottom, c.bottom), c.left = D(d.left, c.left), c;
636
- }, dt(e, r, i));
637
- return {
638
- width: l.right - l.left,
639
- height: l.bottom - l.top,
640
- x: l.left,
641
- y: l.top
642
- };
643
- }
644
- const oe = {
645
- getClippingRect: ee,
646
- convertOffsetParentRelativeRectToViewportRelativeRect: Kt,
647
- isElement: R,
648
- getDimensions: ct,
649
- getOffsetParent: J,
650
- getDocumentElement: T,
651
- getElementRects: (t) => {
652
- let {
653
- reference: e,
654
- floating: o,
655
- strategy: n
656
- } = t;
657
- return {
658
- reference: qt(e, J(o), n),
659
- floating: {
660
- ...ct(o),
661
- x: 0,
662
- y: 0
663
- }
664
- };
665
- },
666
- getClientRects: (t) => Array.from(t.getClientRects()),
667
- isRTL: (t) => b(t).direction === "rtl"
668
- };
669
- function ne(t, e, o, n) {
670
- n === void 0 && (n = {});
671
- const {
672
- ancestorScroll: i = !0,
673
- ancestorResize: s = !0,
674
- elementResize: a = !0,
675
- animationFrame: r = !1
676
- } = n, l = i && !r, c = s && !r, p = l || c ? [...R(t) ? z(t) : [], ...z(e)] : [];
677
- p.forEach((u) => {
678
- l && u.addEventListener("scroll", o, {
679
- passive: !0
680
- }), c && u.addEventListener("resize", o);
681
- });
682
- let d = null;
683
- if (a) {
684
- let u = !0;
685
- d = new ResizeObserver(() => {
686
- u || o(), u = !1;
687
- }), R(t) && !r && d.observe(t), d.observe(e);
688
- }
689
- let f, h = r ? C(t) : null;
690
- r && m();
691
- function m() {
692
- const u = C(t);
693
- h && (u.x !== h.x || u.y !== h.y || u.width !== h.width || u.height !== h.height) && o(), h = u, f = requestAnimationFrame(m);
694
- }
695
- return o(), () => {
696
- var u;
697
- p.forEach((v) => {
698
- l && v.removeEventListener("scroll", o), c && v.removeEventListener("resize", o);
699
- }), (u = d) == null || u.disconnect(), d = null, r && cancelAnimationFrame(f);
700
- };
701
- }
702
- const ie = (t, e, o) => Lt(t, e, {
703
- platform: oe,
704
- ...o
705
- });
706
- function re(t) {
707
- if (Array.isArray(t)) {
708
- for (var e = 0, o = Array(t.length); e < t.length; e++)
709
- o[e] = t[e];
710
- return o;
711
- } else
712
- return Array.from(t);
713
- }
714
- var Z = !1;
715
- if (typeof window < "u") {
716
- var ft = {
717
- get passive() {
718
- Z = !0;
719
- }
720
- };
721
- window.addEventListener("testPassive", null, ft), window.removeEventListener("testPassive", null, ft);
722
- }
723
- var U = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), P = [], q = !1, At = -1, M = void 0, E = void 0, I = void 0, Ct = function(e) {
724
- return P.some(function(o) {
725
- return !!(o.options.allowTouchMove && o.options.allowTouchMove(e));
726
- });
727
- }, X = function(e) {
728
- var o = e || window.event;
729
- return Ct(o.target) || o.touches.length > 1 ? !0 : (o.preventDefault && o.preventDefault(), !1);
730
- }, se = function(e) {
731
- if (I === void 0) {
732
- var o = !!e && e.reserveScrollBarGap === !0, n = window.innerWidth - document.documentElement.clientWidth;
733
- if (o && n > 0) {
734
- var i = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"), 10);
735
- I = document.body.style.paddingRight, document.body.style.paddingRight = i + n + "px";
736
- }
737
- }
738
- M === void 0 && (M = document.body.style.overflow, document.body.style.overflow = "hidden");
739
- }, ae = function() {
740
- I !== void 0 && (document.body.style.paddingRight = I, I = void 0), M !== void 0 && (document.body.style.overflow = M, M = void 0);
741
- }, le = function() {
742
- return window.requestAnimationFrame(function() {
743
- if (E === void 0) {
744
- E = {
745
- position: document.body.style.position,
746
- top: document.body.style.top,
747
- left: document.body.style.left
748
- };
749
- var e = window, o = e.scrollY, n = e.scrollX, i = e.innerHeight;
750
- document.body.style.position = "fixed", document.body.style.top = -o, document.body.style.left = -n, setTimeout(function() {
751
- return window.requestAnimationFrame(function() {
752
- var s = i - window.innerHeight;
753
- s && o >= i && (document.body.style.top = -(o + s));
754
- });
755
- }, 300);
756
- }
757
- });
758
- }, ce = function() {
759
- if (E !== void 0) {
760
- var e = -parseInt(document.body.style.top, 10), o = -parseInt(document.body.style.left, 10);
761
- document.body.style.position = E.position, document.body.style.top = E.top, document.body.style.left = E.left, window.scrollTo(o, e), E = void 0;
762
- }
763
- }, de = function(e) {
764
- return e ? e.scrollHeight - e.scrollTop <= e.clientHeight : !1;
765
- }, fe = function(e, o) {
766
- var n = e.targetTouches[0].clientY - At;
767
- return Ct(e.target) ? !1 : o && o.scrollTop === 0 && n > 0 || de(o) && n < 0 ? X(e) : (e.stopPropagation(), !0);
768
- }, ue = function(e, o) {
769
- if (!e) {
770
- console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
771
- return;
772
- }
773
- if (!P.some(function(i) {
774
- return i.targetElement === e;
775
- })) {
776
- var n = {
777
- targetElement: e,
778
- options: o || {}
779
- };
780
- P = [].concat(re(P), [n]), U ? le() : se(o), U && (e.ontouchstart = function(i) {
781
- i.targetTouches.length === 1 && (At = i.targetTouches[0].clientY);
782
- }, e.ontouchmove = function(i) {
783
- i.targetTouches.length === 1 && fe(i, e);
784
- }, q || (document.addEventListener("touchmove", X, Z ? { passive: !1 } : void 0), q = !0));
785
- }
786
- }, ut = function(e) {
787
- if (!e) {
788
- console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");
789
- return;
790
- }
791
- P = P.filter(function(o) {
792
- return o.targetElement !== e;
793
- }), U && (e.ontouchstart = null, e.ontouchmove = null, q && P.length === 0 && (document.removeEventListener("touchmove", X, Z ? { passive: !1 } : void 0), q = !1)), U ? ce() : ae();
794
- };
795
- const pe = ":host{position:relative;z-index:var(--s-z-40);display:inline-flex}:host *{box-sizing:border-box}.popover--active:not(.popover--closing) .popover__backdrop{-webkit-animation:0.15s popover-fade-in;animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__backdrop{-webkit-animation:none;animation:none}}.popover--active:not(.popover--closing) .popover__content{-webkit-animation:0.15s popover-slide-in;animation:0.15s popover-slide-in}@media (min-width: 768px){.popover--active:not(.popover--closing) .popover__content{transform-origin:top left;-webkit-animation:0.15s popover-fade-scale-in;animation:0.15s popover-fade-scale-in}}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__content{-webkit-animation:none;animation:none}}.popover--closing .popover__backdrop{-webkit-animation:0.15s popover-fade-out;animation:0.15s popover-fade-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (prefers-reduced-motion){.popover--closing .popover__backdrop{-webkit-animation:none;animation:none}}.popover--closing .popover__content{-webkit-animation:0.15s popover-slide-out;animation:0.15s popover-slide-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (min-width: 768px){.popover--closing .popover__content{-webkit-animation:0.15s popover-fade-out;animation:0.15s popover-fade-out}}@media (prefers-reduced-motion){.popover--closing .popover__content{-webkit-animation:none;animation:none}}.popover--inactive .popover__content{display:none}.popover__backdrop{position:fixed;z-index:0;background-color:rgba(0, 0, 0, 0.2);-webkit-animation:0.15s popover-backdrop-fade-in;animation:0.15s popover-backdrop-fade-in;inset:0}@media (prefers-reduced-motion){.popover__backdrop{-webkit-animation:none;animation:none}}@media (min-width: 768px){.popover__backdrop{display:none}}.popover__content{position:fixed;z-index:2;right:0;bottom:0;left:0;overflow:hidden;border-top-left-radius:var(--s-border-radius-xl);border-top-right-radius:var(--s-border-radius-xl);background-color:var(--s-surface-overlay-default)}@media (min-width: 768px){.popover__content{right:unset;bottom:unset;left:unset;max-width:22.5rem;border-radius:var(--s-border-radius-xl);-webkit-animation:none;animation:none;box-shadow:0.125rem 0.25rem 2.5rem rgba(0, 0, 0, 0.14)}}.popover__scroll-container{overflow-x:hidden;overflow-y:auto;width:100%;max-height:90vh;padding-top:var(--s-space-24);padding-bottom:var(--s-space-24);overscroll-behavior:contain}@media (min-width: 768px){.popover__scroll-container{max-height:19rem;padding-top:var(--s-space-8);padding-bottom:var(--s-space-8)}}.popover__handle{position:absolute;top:var(--s-space-8);left:50%;width:2.5rem;height:0.375rem;border-radius:0.1875rem;background-color:var(--s-border-default);transform:translatex(-50%)}@media (min-width: 768px){.popover__handle{display:none}}@-webkit-keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes popover-fade-scale-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes popover-fade-scale-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}", he = class {
796
- constructor(t) {
797
- Rt(this, t), this.active = !1, this.closing = !1, this.close = () => {
798
- var e;
799
- this.closing || (this.disableAutoUpdate && this.disableAutoUpdate(), this.closing = !0, setTimeout(() => {
800
- this.active = !1, this.closing = !1, this.updateTriggerAttributes();
801
- }, 150), this.unlockBodyScroll(), (e = this.triggerEl) === null || e === void 0 || e.focus());
802
- }, this.open = () => {
803
- this.active = !0, this.updateChildMenuItems(), this.updateTriggerAttributes(), requestAnimationFrame(async () => {
804
- await this.reposition(), this.childMenuItems.length > 0 ? this.childMenuItems[0].focus() : this.contentContainer.focus(), this.disableAutoUpdate && this.disableAutoUpdate(), this.disableAutoUpdate = ne(this.triggerEl, this.contentContainer, this.reposition), this.scrollContainer.scrollTop = 0, this.lockBodyScroll();
805
- });
806
- }, this.toggle = () => {
807
- this.active ? this.close() : this.open();
808
- }, this.onKeydown = (e) => {
809
- e.code === "Escape" && this.active && this.close();
810
- }, this.onContentClick = () => {
811
- !this.active || this.close();
812
- }, this.reposition = async () => {
813
- const e = !window.matchMedia("(min-width: 768px)").matches;
814
- if (!(!Boolean(this.triggerEl) || !Boolean(this.contentContainer))) {
815
- if (e) {
816
- this.position = void 0;
817
- return;
818
- }
819
- this.position = await ie(this.triggerEl, this.contentContainer, {
820
- middleware: [Yt(), Wt()],
821
- placement: "bottom-start",
822
- strategy: "fixed"
823
- });
824
- }
825
- };
826
- }
827
- componentDidLoad() {
828
- this.connectTrigger(), this.updateChildMenuItems(), this.updateTriggerAttributes();
829
- }
830
- disconnectedCallback() {
831
- ut(this.scrollContainer);
832
- }
833
- onWindowFocusout(t) {
834
- if (!this.active)
835
- return;
836
- const e = t.relatedTarget;
837
- (e === null || !this.el.contains(e) && !this.childMenuItems.some((n) => {
838
- var i;
839
- return (i = e.shadowRoot) === null || i === void 0 ? void 0 : i.contains(n);
840
- })) && this.close();
841
- }
842
- connectTrigger() {
843
- var t;
844
- const e = document.querySelector(`#${this.trigger}`);
845
- this.triggerEl = (e == null ? void 0 : e.children[0]) || ((t = e == null ? void 0 : e.shadowRoot) === null || t === void 0 ? void 0 : t.children[0]) || e, Boolean(this.triggerEl) && this.triggerEl.addEventListener("click", this.toggle);
846
- }
847
- updateTriggerAttributes() {
848
- !Boolean(this.triggerEl) || (this.triggerEl.setAttribute("aria-controls", this.popoverId), this.triggerEl.setAttribute("aria-expanded", String(this.active)), this.triggerEl.setAttribute("aria-haspopup", "dialog"));
849
- }
850
- updateChildMenuItems() {
851
- this.childMenuItems = Pt(this.el, '[role="menuitem"]');
852
- }
853
- lockBodyScroll() {
854
- window.matchMedia("(min-width: 768px)").matches || ue(this.scrollContainer);
855
- }
856
- unlockBodyScroll() {
857
- ut(this.scrollContainer);
858
- }
859
- render() {
860
- var t, e;
861
- const o = Et("popover", {
862
- "popover--closing": this.closing,
863
- "popover--active": this.active,
864
- "popover--inactive": !this.active
865
- });
866
- return S(Tt, { id: this.popoverId }, S("div", { class: o, onKeyDown: this.onKeydown }, S("div", { "aria-hidden": this.active ? "false" : "true", "aria-label": this.label, class: "popover__content", onClick: this.onContentClick, role: "dialog", tabindex: "-1", ref: (n) => this.contentContainer = n, style: {
867
- top: Boolean(this.position) ? `${(t = this.position) === null || t === void 0 ? void 0 : t.y}px` : "",
868
- left: Boolean(this.position) ? `${(e = this.position) === null || e === void 0 ? void 0 : e.x}px` : ""
869
- } }, S("span", { class: "popover__handle" }), S("div", { class: "popover__scroll-container", ref: (n) => this.scrollContainer = n }, S("slot", null))), this.active && S("div", { class: "popover__backdrop", onClick: this.close })));
870
- }
871
- get el() {
872
- return St(this);
873
- }
874
- };
875
- he.style = pe;
876
- export {
877
- he as flip_popover
878
- };