@servicetitan/anvil2 1.3.0 → 1.3.2

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 (259) hide show
  1. package/{Alert-49d915aa.js → Alert-012e475c.js} +22 -22
  2. package/Alert-012e475c.js.map +1 -0
  3. package/Alert-066f00f2.cjs +2 -0
  4. package/Alert-066f00f2.cjs.map +1 -0
  5. package/Alert.cjs +1 -1
  6. package/Alert.js +1 -1
  7. package/Announcement-cd9602ed.cjs +2 -0
  8. package/Announcement-cd9602ed.cjs.map +1 -0
  9. package/{Announcement-eb5fd003.js → Announcement-f9b09ba3.js} +5 -5
  10. package/Announcement-f9b09ba3.js.map +1 -0
  11. package/Announcement.cjs +1 -1
  12. package/Announcement.js +1 -1
  13. package/AnvilProvider.cjs +1 -1
  14. package/AnvilProvider.js +1 -1
  15. package/Avatar.cjs +1 -1
  16. package/Avatar.js +1 -1
  17. package/Button.cjs +1 -1
  18. package/Button.cjs.map +1 -1
  19. package/Button.js +19 -26
  20. package/Button.js.map +1 -1
  21. package/ButtonCompound.cjs +1 -1
  22. package/ButtonCompound.cjs.map +1 -1
  23. package/ButtonCompound.js +19 -26
  24. package/ButtonCompound.js.map +1 -1
  25. package/ButtonLink.cjs +1 -1
  26. package/ButtonLink.cjs.map +1 -1
  27. package/ButtonLink.js +19 -26
  28. package/ButtonLink.js.map +1 -1
  29. package/ButtonToggle.cjs +1 -1
  30. package/ButtonToggle.cjs.map +1 -1
  31. package/ButtonToggle.js +19 -26
  32. package/ButtonToggle.js.map +1 -1
  33. package/{Calendar-6af49637.js → Calendar-31bcb381.js} +2 -2
  34. package/{Calendar-6af49637.js.map → Calendar-31bcb381.js.map} +1 -1
  35. package/Calendar-d0baf4b1.cjs +2 -0
  36. package/{Calendar-21727a1d.cjs.map → Calendar-d0baf4b1.cjs.map} +1 -1
  37. package/Calendar.cjs +1 -1
  38. package/Calendar.js +1 -1
  39. package/Checkbox.cjs +1 -1
  40. package/Checkbox.cjs.map +1 -1
  41. package/Checkbox.js +49 -22
  42. package/Checkbox.js.map +1 -1
  43. package/{Chip-de78e3f6.cjs → Chip-5b63e48c.cjs} +2 -2
  44. package/{Chip-de78e3f6.cjs.map → Chip-5b63e48c.cjs.map} +1 -1
  45. package/{Chip-6dbdbc2e.js → Chip-6dde28bc.js} +3 -3
  46. package/{Chip-6dbdbc2e.js.map → Chip-6dde28bc.js.map} +1 -1
  47. package/Chip.cjs +1 -1
  48. package/Chip.js +1 -1
  49. package/Combobox.cjs +1 -1
  50. package/Combobox.cjs.map +1 -1
  51. package/Combobox.js +31 -38
  52. package/Combobox.js.map +1 -1
  53. package/Details.cjs +1 -1
  54. package/Details.cjs.map +1 -1
  55. package/Details.js +22 -29
  56. package/Details.js.map +1 -1
  57. package/Dialog.cjs +1 -1
  58. package/Dialog.cjs.map +1 -1
  59. package/Dialog.js +35 -42
  60. package/Dialog.js.map +1 -1
  61. package/Drawer.cjs +1 -1
  62. package/Drawer.cjs.map +1 -1
  63. package/Drawer.js +63 -36
  64. package/Drawer.js.map +1 -1
  65. package/Link.cjs +1 -1
  66. package/Link.cjs.map +1 -1
  67. package/Link.js +24 -31
  68. package/Link.js.map +1 -1
  69. package/ListView-3b1adecb.js +557 -0
  70. package/ListView-3b1adecb.js.map +1 -0
  71. package/ListView-88e49b19.cjs +2 -0
  72. package/ListView-88e49b19.cjs.map +1 -0
  73. package/ListView.cjs +1 -1
  74. package/ListView.css +1 -1
  75. package/ListView.js +1 -1
  76. package/{Listbox-030b2993.js → Listbox-60fbdaa1.js} +2 -2
  77. package/{Listbox-030b2993.js.map → Listbox-60fbdaa1.js.map} +1 -1
  78. package/Listbox.js +1 -1
  79. package/Menu.cjs +1 -1
  80. package/Menu.cjs.map +1 -1
  81. package/Menu.js +52 -25
  82. package/Menu.js.map +1 -1
  83. package/Overflow.cjs +1 -1
  84. package/Overflow.cjs.map +1 -1
  85. package/Overflow.js +26 -33
  86. package/Overflow.js.map +1 -1
  87. package/Page.cjs +1 -1
  88. package/Page.js +2 -2
  89. package/Popover.cjs +1 -1
  90. package/Popover.cjs.map +1 -1
  91. package/Popover.js +28 -35
  92. package/Popover.js.map +1 -1
  93. package/ProgressBar-c1b5c7c3.js +516 -0
  94. package/ProgressBar-c1b5c7c3.js.map +1 -0
  95. package/ProgressBar-fa511478.cjs +2 -0
  96. package/ProgressBar-fa511478.cjs.map +1 -0
  97. package/ProgressBar.cjs +1 -1
  98. package/ProgressBar.css +1 -1
  99. package/ProgressBar.js +1 -1
  100. package/Radio.cjs +1 -1
  101. package/Radio.cjs.map +1 -1
  102. package/Radio.js +50 -23
  103. package/Radio.js.map +1 -1
  104. package/SegmentedControl.cjs +1 -1
  105. package/SegmentedControl.cjs.map +1 -1
  106. package/SegmentedControl.d.ts +9 -5
  107. package/SegmentedControl.js +72 -12
  108. package/SegmentedControl.js.map +1 -1
  109. package/{SideNav-80e5ce2f.js → SideNav-33a404ec.js} +2 -2
  110. package/{SideNav-80e5ce2f.js.map → SideNav-33a404ec.js.map} +1 -1
  111. package/SideNav.js +1 -1
  112. package/{Stepper-85a93af9.js → Stepper-7e3a130c.js} +79 -79
  113. package/Stepper-7e3a130c.js.map +1 -0
  114. package/Stepper-8675700c.cjs +2 -0
  115. package/Stepper-8675700c.cjs.map +1 -0
  116. package/Stepper.cjs +1 -1
  117. package/Stepper.js +1 -1
  118. package/Switch.cjs +1 -1
  119. package/Switch.cjs.map +1 -1
  120. package/Switch.js +44 -17
  121. package/Switch.js.map +1 -1
  122. package/{Tab-68267c78.js → Tab-dd4ab045.js} +2 -2
  123. package/{Tab-68267c78.js.map → Tab-dd4ab045.js.map} +1 -1
  124. package/Tab.js +1 -1
  125. package/TextField.cjs +1 -1
  126. package/TextField.cjs.map +1 -1
  127. package/TextField.js +23 -30
  128. package/TextField.js.map +1 -1
  129. package/Textarea.cjs +1 -1
  130. package/Textarea.cjs.map +1 -1
  131. package/Textarea.js +23 -30
  132. package/Textarea.js.map +1 -1
  133. package/ThemeProvider.cjs +1 -1
  134. package/ThemeProvider.js +1 -1
  135. package/Toast-32a4ab22.cjs +9 -0
  136. package/Toast-32a4ab22.cjs.map +1 -0
  137. package/{Toast-330e28fb.js → Toast-6cd7d2e1.js} +58 -58
  138. package/Toast-6cd7d2e1.js.map +1 -0
  139. package/Toast.cjs +1 -1
  140. package/Toast.js +1 -1
  141. package/Tooltip.cjs +1 -1
  142. package/Tooltip.cjs.map +1 -1
  143. package/Tooltip.js +19 -26
  144. package/Tooltip.js.map +1 -1
  145. package/anvil2.cjs +1 -1
  146. package/anvil2.d.ts +5 -5
  147. package/anvil2.js +171 -178
  148. package/anvil2.js.map +1 -1
  149. package/{floating-ui.react-8d61182d.js → floating-ui.react-51a3fa68.js} +26 -26
  150. package/{floating-ui.react-8d61182d.js.map → floating-ui.react-51a3fa68.js.map} +1 -1
  151. package/{Button-855c7b85.js → index-3a4e28a9-3d7ba14f.js} +90 -90
  152. package/index-3a4e28a9-3d7ba14f.js.map +1 -0
  153. package/index-3a4e28a9-b649e635.cjs +2 -0
  154. package/index-3a4e28a9-b649e635.cjs.map +1 -0
  155. package/{index-439b5871.js → index-3f218083.js} +9 -9
  156. package/{index-439b5871.js.map → index-3f218083.js.map} +1 -1
  157. package/{index-f6c22572.cjs → index-63e13299.cjs} +2 -2
  158. package/{index-f6c22572.cjs.map → index-63e13299.cjs.map} +1 -1
  159. package/index-c41dc41a.js +4972 -0
  160. package/index-c41dc41a.js.map +1 -0
  161. package/index-ca7c66ae.cjs +23 -0
  162. package/index-ca7c66ae.cjs.map +1 -0
  163. package/index-d46fa8de-c02f7a12.cjs +2 -0
  164. package/index-d46fa8de-c02f7a12.cjs.map +1 -0
  165. package/index-d46fa8de-f8bf17b6.js +540 -0
  166. package/index-d46fa8de-f8bf17b6.js.map +1 -0
  167. package/{index-f7658447-d8b2b888.js → index-f7658447-1cfbda8f.js} +8 -9
  168. package/{index-f7658447-d8b2b888.js.map → index-f7658447-1cfbda8f.js.map} +1 -1
  169. package/index-f7658447-f447ade8.cjs +2 -0
  170. package/{index-f7658447-d9ca2747.cjs.map → index-f7658447-f447ade8.cjs.map} +1 -1
  171. package/index3.css +1 -1
  172. package/package.json +2 -2
  173. package/useAccessibleColor.cjs +1 -1
  174. package/useAccessibleColor.js +19 -26
  175. package/useAccessibleColor.js.map +1 -1
  176. package/useLinkStyles.cjs +1 -1
  177. package/useLinkStyles.js +18 -25
  178. package/useLinkStyles.js.map +1 -1
  179. package/useMergeRefs.cjs +1 -1
  180. package/useMergeRefs.js +19 -26
  181. package/useMergeRefs.js.map +1 -1
  182. package/usePrefersColorScheme.cjs +1 -1
  183. package/usePrefersColorScheme.js +19 -26
  184. package/usePrefersColorScheme.js.map +1 -1
  185. package/useSwipe.cjs +1 -1
  186. package/useSwipe.js +19 -26
  187. package/useSwipe.js.map +1 -1
  188. package/Alert-49d915aa.js.map +0 -1
  189. package/Alert-e48c196e.cjs +0 -2
  190. package/Alert-e48c196e.cjs.map +0 -1
  191. package/Announcement-d598ea11.cjs +0 -2
  192. package/Announcement-d598ea11.cjs.map +0 -1
  193. package/Announcement-eb5fd003.js.map +0 -1
  194. package/Button-855c7b85.js.map +0 -1
  195. package/Button-8fe1ed7f.cjs +0 -2
  196. package/Button-8fe1ed7f.cjs.map +0 -1
  197. package/Calendar-21727a1d.cjs +0 -2
  198. package/Checkbox-28412a96.cjs +0 -2
  199. package/Checkbox-28412a96.cjs.map +0 -1
  200. package/Checkbox-54ecbd70.js +0 -163
  201. package/Checkbox-54ecbd70.js.map +0 -1
  202. package/Checkbox.css +0 -1
  203. package/Drawer-45208baf.cjs +0 -2
  204. package/Drawer-45208baf.cjs.map +0 -1
  205. package/Drawer-f95784bb.js +0 -209
  206. package/Drawer-f95784bb.js.map +0 -1
  207. package/Drawer.css +0 -1
  208. package/ListView-ad64a337.js +0 -403
  209. package/ListView-ad64a337.js.map +0 -1
  210. package/ListView-fcd88dd1.cjs +0 -2
  211. package/ListView-fcd88dd1.cjs.map +0 -1
  212. package/ProgressBar-0c2b3852.cjs +0 -2
  213. package/ProgressBar-0c2b3852.cjs.map +0 -1
  214. package/ProgressBar-f54440d6.js +0 -301
  215. package/ProgressBar-f54440d6.js.map +0 -1
  216. package/Radio-845d1fe6.cjs +0 -2
  217. package/Radio-845d1fe6.cjs.map +0 -1
  218. package/Radio-8f8e771e.js +0 -124
  219. package/Radio-8f8e771e.js.map +0 -1
  220. package/Radio.css +0 -1
  221. package/SegmentedControl-d223643c.js +0 -108
  222. package/SegmentedControl-d223643c.js.map +0 -1
  223. package/SegmentedControl-e5e48c23.cjs +0 -2
  224. package/SegmentedControl-e5e48c23.cjs.map +0 -1
  225. package/SegmentedControl.css +0 -1
  226. package/Stepper-51ada533.cjs +0 -2
  227. package/Stepper-51ada533.cjs.map +0 -1
  228. package/Stepper-85a93af9.js.map +0 -1
  229. package/Switch-7bfb6be6.cjs +0 -2
  230. package/Switch-7bfb6be6.cjs.map +0 -1
  231. package/Switch-917c699a.js +0 -54
  232. package/Switch-917c699a.js.map +0 -1
  233. package/Switch.css +0 -1
  234. package/Toast-330e28fb.js.map +0 -1
  235. package/Toast-f154bebc.cjs +0 -9
  236. package/Toast-f154bebc.cjs.map +0 -1
  237. package/getKeyboardFocusableElements-ea0e208d-58a00025.js +0 -14
  238. package/getKeyboardFocusableElements-ea0e208d-58a00025.js.map +0 -1
  239. package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs +0 -2
  240. package/getKeyboardFocusableElements-ea0e208d-aba1bd01.cjs.map +0 -1
  241. package/index-06c0bdf0.js +0 -480
  242. package/index-06c0bdf0.js.map +0 -1
  243. package/index-09cb022c-28ca3469.js +0 -520
  244. package/index-09cb022c-28ca3469.js.map +0 -1
  245. package/index-09cb022c-f4ddfd52.cjs +0 -2
  246. package/index-09cb022c-f4ddfd52.cjs.map +0 -1
  247. package/index-09cb022c.css +0 -1
  248. package/index-671f29a9.cjs +0 -23
  249. package/index-671f29a9.cjs.map +0 -1
  250. package/index-6ad2779a.js +0 -4227
  251. package/index-6ad2779a.js.map +0 -1
  252. package/index-a53df036.cjs +0 -2
  253. package/index-a53df036.cjs.map +0 -1
  254. package/index-d46fa8de-08092573.cjs +0 -2
  255. package/index-d46fa8de-08092573.cjs.map +0 -1
  256. package/index-d46fa8de-8695742b.js +0 -62
  257. package/index-d46fa8de-8695742b.js.map +0 -1
  258. package/index-f7658447-d9ca2747.cjs +0 -2
  259. /package/{Button.css → index-3a4e28a9.css} +0 -0
package/index-6ad2779a.js DELETED
@@ -1,4227 +0,0 @@
1
- import "./index3.css";
2
- import "./Alert-49d915aa.js";
3
- import "./Announcement-eb5fd003.js";
4
- import "./index-f7658447-d8b2b888.js";
5
- import "./Badge-df96f15a.js";
6
- import { B as rt, l as xr } from "./Button-855c7b85.js";
7
- import "./Calendar-6af49637.js";
8
- import "./Card-bb358803.js";
9
- import { r as wr } from "./Checkbox-54ecbd70.js";
10
- import { A as on } from "./Chip-6dbdbc2e.js";
11
- import { B as Er } from "./index-09cb022c-28ca3469.js";
12
- import "./Divider-b3bff73a.js";
13
- import "./Drawer-f95784bb.js";
14
- import { j as Cr } from "./Flex-d338e855.js";
15
- import "./Grid-5bad450f.js";
16
- import { C as vt } from "./Icon-b94f924c.js";
17
- import { j as It } from "./ProgressBar-f54440d6.js";
18
- import { i as Nn } from "./Listbox-030b2993.js";
19
- import { t as ht } from "./ListView-ad64a337.js";
20
- import "./Stepper-85a93af9.js";
21
- import "./Radio-8f8e771e.js";
22
- import "./SegmentedControl-d223643c.js";
23
- import { P as m, _ as j, b as ge, a as Sr } from "./SideNav-80e5ce2f.js";
24
- import { p as Rn } from "./SrOnly-864bd4cb.js";
25
- import { f as E } from "./jsx-runtime-944c88e2-e73fa629.js";
26
- import { c as ue } from "./index-e0f6271a.js";
27
- import "./Switch-917c699a.js";
28
- import "./Tab-68267c78.js";
29
- import { $ as Or } from "./Text-465104f6.js";
30
- import "./Toast-330e28fb.js";
31
- import "./index-06c0bdf0.js";
32
- import { J as Me } from "./useLayoutPropsUtil-e307abc7-cbe2fb6d.js";
33
- import { U as Dr, T as Nr } from "./index-d46fa8de-8695742b.js";
34
- import "./usePrefersColorScheme-129544ad-cab6fc3f.js";
35
- import * as me from "react";
36
- import ot, { useRef as te, useCallback as ee, useEffect as le, useMemo as Ke, cloneElement as Rr, Component as Pr, useLayoutEffect as _t, useReducer as Mr, createContext as yt, forwardRef as ye, useContext as De, useState as Z, useId as Ie } from "react";
37
- import "./index-439b5871.js";
38
- import "./LocalizationProvider.js";
39
- import { u as We, v as kr, w as Tr, z as Vr, e as Ar, h as Hr, o as Kr, g as jr, f as $r, s as Fr, l as Lr, B as Br, k as Ur, i as zr, j as Wr, n as qr, m as Yr, r as Gr } from "./floating-ui.react-8d61182d.js";
40
- import { g as Xr } from "./_commonjsHelpers-c5d32002.js";
41
- import { PortalProviderContext as Jr } from "./PortalProvider.js";
42
- import { a as Qr } from "./close-064c8acc-7e0b4df7.js";
43
- import { a as Zr } from "./check-5f087ea0-b5474547.js";
44
- import { v as bt } from "./Helper-74a1f07f-092263c4.js";
45
- /* empty css */import "./useSwipe-82769b09-835234e6.js";
46
- function sn(e) {
47
- if (e === void 0)
48
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
49
- return e;
50
- }
51
- var gt = { exports: {} }, Y = {};
52
- /**
53
- * @license React
54
- * react-is.production.min.js
55
- *
56
- * Copyright (c) Facebook, Inc. and its affiliates.
57
- *
58
- * This source code is licensed under the MIT license found in the
59
- * LICENSE file in the root directory of this source tree.
60
- */
61
- var an;
62
- function eo() {
63
- if (an)
64
- return Y;
65
- an = 1;
66
- var e = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), s = Symbol.for("react.context"), a = Symbol.for("react.server_context"), d = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), I;
67
- I = Symbol.for("react.module.reference");
68
- function S(g) {
69
- if (typeof g == "object" && g !== null) {
70
- var M = g.$$typeof;
71
- switch (M) {
72
- case e:
73
- switch (g = g.type, g) {
74
- case r:
75
- case o:
76
- case i:
77
- case l:
78
- case u:
79
- return g;
80
- default:
81
- switch (g = g && g.$$typeof, g) {
82
- case a:
83
- case s:
84
- case d:
85
- case w:
86
- case h:
87
- case t:
88
- return g;
89
- default:
90
- return M;
91
- }
92
- }
93
- case n:
94
- return M;
95
- }
96
- }
97
- }
98
- return Y.ContextConsumer = s, Y.ContextProvider = t, Y.Element = e, Y.ForwardRef = d, Y.Fragment = r, Y.Lazy = w, Y.Memo = h, Y.Portal = n, Y.Profiler = o, Y.StrictMode = i, Y.Suspense = l, Y.SuspenseList = u, Y.isAsyncMode = function() {
99
- return !1;
100
- }, Y.isConcurrentMode = function() {
101
- return !1;
102
- }, Y.isContextConsumer = function(g) {
103
- return S(g) === s;
104
- }, Y.isContextProvider = function(g) {
105
- return S(g) === t;
106
- }, Y.isElement = function(g) {
107
- return typeof g == "object" && g !== null && g.$$typeof === e;
108
- }, Y.isForwardRef = function(g) {
109
- return S(g) === d;
110
- }, Y.isFragment = function(g) {
111
- return S(g) === r;
112
- }, Y.isLazy = function(g) {
113
- return S(g) === w;
114
- }, Y.isMemo = function(g) {
115
- return S(g) === h;
116
- }, Y.isPortal = function(g) {
117
- return S(g) === n;
118
- }, Y.isProfiler = function(g) {
119
- return S(g) === o;
120
- }, Y.isStrictMode = function(g) {
121
- return S(g) === i;
122
- }, Y.isSuspense = function(g) {
123
- return S(g) === l;
124
- }, Y.isSuspenseList = function(g) {
125
- return S(g) === u;
126
- }, Y.isValidElementType = function(g) {
127
- return typeof g == "string" || typeof g == "function" || g === r || g === o || g === i || g === l || g === u || g === b || typeof g == "object" && g !== null && (g.$$typeof === w || g.$$typeof === h || g.$$typeof === t || g.$$typeof === s || g.$$typeof === d || g.$$typeof === I || g.getModuleId !== void 0);
128
- }, Y.typeOf = S, Y;
129
- }
130
- var G = {};
131
- /**
132
- * @license React
133
- * react-is.development.js
134
- *
135
- * Copyright (c) Facebook, Inc. and its affiliates.
136
- *
137
- * This source code is licensed under the MIT license found in the
138
- * LICENSE file in the root directory of this source tree.
139
- */
140
- var ln;
141
- function to() {
142
- return ln || (ln = 1, process.env.NODE_ENV !== "production" && function() {
143
- var e = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), s = Symbol.for("react.context"), a = Symbol.for("react.server_context"), d = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), I = !1, S = !1, g = !1, M = !1, c = !1, f;
144
- f = Symbol.for("react.module.reference");
145
- function p(x) {
146
- return !!(typeof x == "string" || typeof x == "function" || x === r || x === o || c || x === i || x === l || x === u || M || x === b || I || S || g || typeof x == "object" && x !== null && (x.$$typeof === w || x.$$typeof === h || x.$$typeof === t || x.$$typeof === s || x.$$typeof === d || // This needs to include all possible module reference object
147
- // types supported by any Flight configuration anywhere since
148
- // we don't know which Flight build this will end up being used
149
- // with.
150
- x.$$typeof === f || x.getModuleId !== void 0));
151
- }
152
- function v(x) {
153
- if (typeof x == "object" && x !== null) {
154
- var pe = x.$$typeof;
155
- switch (pe) {
156
- case e:
157
- var ie = x.type;
158
- switch (ie) {
159
- case r:
160
- case o:
161
- case i:
162
- case l:
163
- case u:
164
- return ie;
165
- default:
166
- var ke = ie && ie.$$typeof;
167
- switch (ke) {
168
- case a:
169
- case s:
170
- case d:
171
- case w:
172
- case h:
173
- case t:
174
- return ke;
175
- default:
176
- return pe;
177
- }
178
- }
179
- case n:
180
- return pe;
181
- }
182
- }
183
- }
184
- var _ = s, k = t, O = e, A = d, R = r, C = w, P = h, V = n, K = o, z = i, W = l, $ = u, X = !1, Q = !1;
185
- function q(x) {
186
- return X || (X = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
187
- }
188
- function H(x) {
189
- return Q || (Q = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
190
- }
191
- function U(x) {
192
- return v(x) === s;
193
- }
194
- function J(x) {
195
- return v(x) === t;
196
- }
197
- function D(x) {
198
- return typeof x == "object" && x !== null && x.$$typeof === e;
199
- }
200
- function N(x) {
201
- return v(x) === d;
202
- }
203
- function T(x) {
204
- return v(x) === r;
205
- }
206
- function y(x) {
207
- return v(x) === w;
208
- }
209
- function B(x) {
210
- return v(x) === h;
211
- }
212
- function L(x) {
213
- return v(x) === n;
214
- }
215
- function F(x) {
216
- return v(x) === o;
217
- }
218
- function ne(x) {
219
- return v(x) === i;
220
- }
221
- function se(x) {
222
- return v(x) === l;
223
- }
224
- function ae(x) {
225
- return v(x) === u;
226
- }
227
- G.ContextConsumer = _, G.ContextProvider = k, G.Element = O, G.ForwardRef = A, G.Fragment = R, G.Lazy = C, G.Memo = P, G.Portal = V, G.Profiler = K, G.StrictMode = z, G.Suspense = W, G.SuspenseList = $, G.isAsyncMode = q, G.isConcurrentMode = H, G.isContextConsumer = U, G.isContextProvider = J, G.isElement = D, G.isForwardRef = N, G.isFragment = T, G.isLazy = y, G.isMemo = B, G.isPortal = L, G.isProfiler = F, G.isStrictMode = ne, G.isSuspense = se, G.isSuspenseList = ae, G.isValidElementType = p, G.typeOf = v;
228
- }()), G;
229
- }
230
- process.env.NODE_ENV === "production" ? gt.exports = eo() : gt.exports = to();
231
- var un = gt.exports;
232
- const dn = (e) => typeof e == "object" && e != null && e.nodeType === 1, cn = (e, n) => (!n || e !== "hidden") && e !== "visible" && e !== "clip", pt = (e, n) => {
233
- if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) {
234
- const r = getComputedStyle(e, null);
235
- return cn(r.overflowY, n) || cn(r.overflowX, n) || ((i) => {
236
- const o = ((t) => {
237
- if (!t.ownerDocument || !t.ownerDocument.defaultView)
238
- return null;
239
- try {
240
- return t.ownerDocument.defaultView.frameElement;
241
- } catch {
242
- return null;
243
- }
244
- })(i);
245
- return !!o && (o.clientHeight < i.scrollHeight || o.clientWidth < i.scrollWidth);
246
- })(e);
247
- }
248
- return !1;
249
- }, Ze = (e, n, r, i, o, t, s, a) => t < e && s > n || t > e && s < n ? 0 : t <= e && a <= r || s >= n && a >= r ? t - e - i : s > n && a < r || t < e && a > r ? s - n + o : 0, no = (e) => {
250
- const n = e.parentElement;
251
- return n ?? (e.getRootNode().host || null);
252
- }, ro = (e, n) => {
253
- var r, i, o, t;
254
- if (typeof document > "u")
255
- return [];
256
- const { scrollMode: s, block: a, inline: d, boundary: l, skipOverflowHiddenElements: u } = n, h = typeof l == "function" ? l : (W) => W !== l;
257
- if (!dn(e))
258
- throw new TypeError("Invalid target");
259
- const w = document.scrollingElement || document.documentElement, b = [];
260
- let I = e;
261
- for (; dn(I) && h(I); ) {
262
- if (I = no(I), I === w) {
263
- b.push(I);
264
- break;
265
- }
266
- I != null && I === document.body && pt(I) && !pt(document.documentElement) || I != null && pt(I, u) && b.push(I);
267
- }
268
- const S = (i = (r = window.visualViewport) == null ? void 0 : r.width) != null ? i : innerWidth, g = (t = (o = window.visualViewport) == null ? void 0 : o.height) != null ? t : innerHeight, { scrollX: M, scrollY: c } = window, { height: f, width: p, top: v, right: _, bottom: k, left: O } = e.getBoundingClientRect(), { top: A, right: R, bottom: C, left: P } = ((W) => {
269
- const $ = window.getComputedStyle(W);
270
- return { top: parseFloat($.scrollMarginTop) || 0, right: parseFloat($.scrollMarginRight) || 0, bottom: parseFloat($.scrollMarginBottom) || 0, left: parseFloat($.scrollMarginLeft) || 0 };
271
- })(e);
272
- let V = a === "start" || a === "nearest" ? v - A : a === "end" ? k + C : v + f / 2 - A + C, K = d === "center" ? O + p / 2 - P + R : d === "end" ? _ + R : O - P;
273
- const z = [];
274
- for (let W = 0; W < b.length; W++) {
275
- const $ = b[W], { height: X, width: Q, top: q, right: H, bottom: U, left: J } = $.getBoundingClientRect();
276
- if (s === "if-needed" && v >= 0 && O >= 0 && k <= g && _ <= S && v >= q && k <= U && O >= J && _ <= H)
277
- return z;
278
- const D = getComputedStyle($), N = parseInt(D.borderLeftWidth, 10), T = parseInt(D.borderTopWidth, 10), y = parseInt(D.borderRightWidth, 10), B = parseInt(D.borderBottomWidth, 10);
279
- let L = 0, F = 0;
280
- const ne = "offsetWidth" in $ ? $.offsetWidth - $.clientWidth - N - y : 0, se = "offsetHeight" in $ ? $.offsetHeight - $.clientHeight - T - B : 0, ae = "offsetWidth" in $ ? $.offsetWidth === 0 ? 0 : Q / $.offsetWidth : 0, x = "offsetHeight" in $ ? $.offsetHeight === 0 ? 0 : X / $.offsetHeight : 0;
281
- if (w === $)
282
- L = a === "start" ? V : a === "end" ? V - g : a === "nearest" ? Ze(c, c + g, g, T, B, c + V, c + V + f, f) : V - g / 2, F = d === "start" ? K : d === "center" ? K - S / 2 : d === "end" ? K - S : Ze(M, M + S, S, N, y, M + K, M + K + p, p), L = Math.max(0, L + c), F = Math.max(0, F + M);
283
- else {
284
- L = a === "start" ? V - q - T : a === "end" ? V - U + B + se : a === "nearest" ? Ze(q, U, X, T, B + se, V, V + f, f) : V - (q + X / 2) + se / 2, F = d === "start" ? K - J - N : d === "center" ? K - (J + Q / 2) + ne / 2 : d === "end" ? K - H + y + ne : Ze(J, H, Q, N, y + ne, K, K + p, p);
285
- const { scrollLeft: pe, scrollTop: ie } = $;
286
- L = x === 0 ? 0 : Math.max(0, Math.min(ie + L / x, $.scrollHeight - X / x + se)), F = ae === 0 ? 0 : Math.max(0, Math.min(pe + F / ae, $.scrollWidth - Q / ae + ne)), V += ie - L, K += pe - F;
287
- }
288
- z.push({ el: $, top: L, left: F });
289
- }
290
- return z;
291
- };
292
- var je = function() {
293
- return je = Object.assign || function(n) {
294
- for (var r, i = 1, o = arguments.length; i < o; i++) {
295
- r = arguments[i];
296
- for (var t in r)
297
- Object.prototype.hasOwnProperty.call(r, t) && (n[t] = r[t]);
298
- }
299
- return n;
300
- }, je.apply(this, arguments);
301
- };
302
- var oo = 0;
303
- function pn(e) {
304
- return typeof e == "function" ? e : he;
305
- }
306
- function he() {
307
- }
308
- function Pn(e, n) {
309
- if (e) {
310
- var r = ro(e, {
311
- boundary: n,
312
- block: "nearest",
313
- scrollMode: "if-needed"
314
- });
315
- r.forEach(function(i) {
316
- var o = i.el, t = i.top, s = i.left;
317
- o.scrollTop = t, o.scrollLeft = s;
318
- });
319
- }
320
- }
321
- function fn(e, n, r) {
322
- var i = e === n || n instanceof r.Node && e.contains && e.contains(n);
323
- return i;
324
- }
325
- function xt(e, n) {
326
- var r;
327
- function i() {
328
- r && clearTimeout(r);
329
- }
330
- function o() {
331
- for (var t = arguments.length, s = new Array(t), a = 0; a < t; a++)
332
- s[a] = arguments[a];
333
- i(), r = setTimeout(function() {
334
- r = null, e.apply(void 0, s);
335
- }, n);
336
- }
337
- return o.cancel = i, o;
338
- }
339
- function oe() {
340
- for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
341
- n[r] = arguments[r];
342
- return function(i) {
343
- for (var o = arguments.length, t = new Array(o > 1 ? o - 1 : 0), s = 1; s < o; s++)
344
- t[s - 1] = arguments[s];
345
- return n.some(function(a) {
346
- return a && a.apply(void 0, [i].concat(t)), i.preventDownshiftDefault || i.hasOwnProperty("nativeEvent") && i.nativeEvent.preventDownshiftDefault;
347
- });
348
- };
349
- }
350
- function Oe() {
351
- for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
352
- n[r] = arguments[r];
353
- return function(i) {
354
- n.forEach(function(o) {
355
- typeof o == "function" ? o(i) : o && (o.current = i);
356
- });
357
- };
358
- }
359
- function Mn() {
360
- return String(oo++);
361
- }
362
- function kn(e) {
363
- var n = e.isOpen, r = e.resultCount, i = e.previousResultCount;
364
- return n ? r ? r !== i ? r + " result" + (r === 1 ? " is" : "s are") + " available, use up and down arrow keys to navigate. Press Enter key to select." : "" : "No results are available." : "";
365
- }
366
- function hn(e, n) {
367
- return e = Array.isArray(e) ? (
368
- /* istanbul ignore next (preact) */
369
- e[0]
370
- ) : e, !e && n ? n : e;
371
- }
372
- function Tn(e) {
373
- return typeof e.type == "string";
374
- }
375
- function Vn(e) {
376
- return e.props;
377
- }
378
- function io(e, n) {
379
- console.error('The property "' + n + '" is required in "' + e + '"');
380
- }
381
- var so = ["highlightedIndex", "inputValue", "isOpen", "selectedItem", "type"];
382
- function et(e) {
383
- e === void 0 && (e = {});
384
- var n = {};
385
- return so.forEach(function(r) {
386
- e.hasOwnProperty(r) && (n[r] = e[r]);
387
- }), n;
388
- }
389
- function Ue(e, n) {
390
- return !e || !n ? e : Object.keys(e).reduce(function(r, i) {
391
- return r[i] = it(n, i) ? n[i] : e[i], r;
392
- }, {});
393
- }
394
- function it(e, n) {
395
- return e[n] !== void 0;
396
- }
397
- function ze(e) {
398
- var n = e.key, r = e.keyCode;
399
- return r >= 37 && r <= 40 && n.indexOf("Arrow") !== 0 ? "Arrow" + n : n;
400
- }
401
- function ao(e) {
402
- return Object.prototype.toString.call(e) === "[object Object]";
403
- }
404
- function Re(e, n, r, i, o) {
405
- o === void 0 && (o = !1);
406
- var t = r.length;
407
- if (t === 0)
408
- return -1;
409
- var s = t - 1;
410
- (typeof e != "number" || e < 0 || e > s) && (e = n > 0 ? -1 : s + 1);
411
- var a = e + n;
412
- a < 0 ? a = o ? s : 0 : a > s && (a = o ? 0 : s);
413
- var d = $e(a, n < 0, r, i, o);
414
- return d === -1 ? e >= t ? -1 : e : d;
415
- }
416
- function $e(e, n, r, i, o) {
417
- o === void 0 && (o = !1);
418
- var t = r.length;
419
- if (n) {
420
- for (var s = e; s >= 0; s--)
421
- if (!i(r[s], s))
422
- return s;
423
- } else
424
- for (var a = e; a < t; a++)
425
- if (!i(r[a], a))
426
- return a;
427
- return o ? $e(n ? t - 1 : 0, n, r, i) : -1;
428
- }
429
- function st(e, n, r, i) {
430
- return i === void 0 && (i = !0), r && n.some(function(o) {
431
- return o && (fn(o, e, r) || i && fn(o, r.document.activeElement, r));
432
- });
433
- }
434
- var wt = he;
435
- process.env.NODE_ENV !== "production" && (wt = function(n, r, i) {
436
- var o = "This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";
437
- Object.keys(n).forEach(function(t) {
438
- r[t] !== void 0 && i[t] === void 0 ? console.error('downshift: A component has changed the controlled prop "' + t + '" to be uncontrolled. ' + o) : r[t] === void 0 && i[t] !== void 0 && console.error('downshift: A component has changed the uncontrolled prop "' + t + '" to be controlled. ' + o);
439
- });
440
- });
441
- var lo = xt(function(e) {
442
- An(e).textContent = "";
443
- }, 500);
444
- function An(e) {
445
- var n = e.getElementById("a11y-status-message");
446
- return n || (n = e.createElement("div"), n.setAttribute("id", "a11y-status-message"), n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite"), n.setAttribute("aria-relevant", "additions text"), Object.assign(n.style, {
447
- border: "0",
448
- clip: "rect(0 0 0 0)",
449
- height: "1px",
450
- margin: "-1px",
451
- overflow: "hidden",
452
- padding: "0",
453
- position: "absolute",
454
- width: "1px"
455
- }), e.body.appendChild(n), n);
456
- }
457
- function Et(e, n) {
458
- if (!(!e || !n)) {
459
- var r = An(n);
460
- r.textContent = e, lo(n);
461
- }
462
- }
463
- var Hn = process.env.NODE_ENV !== "production" ? "__autocomplete_unknown__" : 0, Kn = process.env.NODE_ENV !== "production" ? "__autocomplete_mouseup__" : 1, jn = process.env.NODE_ENV !== "production" ? "__autocomplete_item_mouseenter__" : 2, tt = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_arrow_up__" : 3, nt = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_arrow_down__" : 4, $n = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_escape__" : 5, Fn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_enter__" : 6, Ln = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_home__" : 7, Bn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_end__" : 8, Un = process.env.NODE_ENV !== "production" ? "__autocomplete_click_item__" : 9, zn = process.env.NODE_ENV !== "production" ? "__autocomplete_blur_input__" : 10, Wn = process.env.NODE_ENV !== "production" ? "__autocomplete_change_input__" : 11, qn = process.env.NODE_ENV !== "production" ? "__autocomplete_keydown_space_button__" : 12, mt = process.env.NODE_ENV !== "production" ? "__autocomplete_click_button__" : 13, Yn = process.env.NODE_ENV !== "production" ? "__autocomplete_blur_button__" : 14, Gn = process.env.NODE_ENV !== "production" ? "__autocomplete_controlled_prop_updated_selected_item__" : 15, Xn = process.env.NODE_ENV !== "production" ? "__autocomplete_touchend__" : 16, uo = /* @__PURE__ */ Object.freeze({
464
- __proto__: null,
465
- unknown: Hn,
466
- mouseUp: Kn,
467
- itemMouseEnter: jn,
468
- keyDownArrowUp: tt,
469
- keyDownArrowDown: nt,
470
- keyDownEscape: $n,
471
- keyDownEnter: Fn,
472
- keyDownHome: Ln,
473
- keyDownEnd: Bn,
474
- clickItem: Un,
475
- blurInput: zn,
476
- changeInput: Wn,
477
- keyDownSpaceButton: qn,
478
- clickButton: mt,
479
- blurButton: Yn,
480
- controlledPropUpdatedSelectedItem: Gn,
481
- touchEnd: Xn
482
- }), co = ["refKey", "ref"], po = ["onClick", "onPress", "onKeyDown", "onKeyUp", "onBlur"], fo = ["onKeyDown", "onBlur", "onChange", "onInput", "onChangeText"], ho = ["refKey", "ref"], go = ["onMouseMove", "onMouseDown", "onClick", "onPress", "index", "item"], mo = /* @__PURE__ */ function() {
483
- var e = /* @__PURE__ */ function(n) {
484
- Sr(r, n);
485
- function r(o) {
486
- var t;
487
- t = n.call(this, o) || this, t.id = t.props.id || "downshift-" + Mn(), t.menuId = t.props.menuId || t.id + "-menu", t.labelId = t.props.labelId || t.id + "-label", t.inputId = t.props.inputId || t.id + "-input", t.getItemId = t.props.getItemId || function(c) {
488
- return t.id + "-item-" + c;
489
- }, t.items = [], t.itemCount = null, t.previousResultCount = 0, t.timeoutIds = [], t.internalSetTimeout = function(c, f) {
490
- var p = setTimeout(function() {
491
- t.timeoutIds = t.timeoutIds.filter(function(v) {
492
- return v !== p;
493
- }), c();
494
- }, f);
495
- t.timeoutIds.push(p);
496
- }, t.setItemCount = function(c) {
497
- t.itemCount = c;
498
- }, t.unsetItemCount = function() {
499
- t.itemCount = null;
500
- }, t.isItemDisabled = function(c, f) {
501
- var p = t.getItemNodeFromIndex(f);
502
- return p && p.hasAttribute("disabled");
503
- }, t.setHighlightedIndex = function(c, f) {
504
- c === void 0 && (c = t.props.defaultHighlightedIndex), f === void 0 && (f = {}), f = et(f), t.internalSetState(j({
505
- highlightedIndex: c
506
- }, f));
507
- }, t.clearSelection = function(c) {
508
- t.internalSetState({
509
- selectedItem: null,
510
- inputValue: "",
511
- highlightedIndex: t.props.defaultHighlightedIndex,
512
- isOpen: t.props.defaultIsOpen
513
- }, c);
514
- }, t.selectItem = function(c, f, p) {
515
- f = et(f), t.internalSetState(j({
516
- isOpen: t.props.defaultIsOpen,
517
- highlightedIndex: t.props.defaultHighlightedIndex,
518
- selectedItem: c,
519
- inputValue: t.props.itemToString(c)
520
- }, f), p);
521
- }, t.selectItemAtIndex = function(c, f, p) {
522
- var v = t.items[c];
523
- v != null && t.selectItem(v, f, p);
524
- }, t.selectHighlightedItem = function(c, f) {
525
- return t.selectItemAtIndex(t.getState().highlightedIndex, c, f);
526
- }, t.internalSetState = function(c, f) {
527
- var p, v, _ = {}, k = typeof c == "function";
528
- return !k && c.hasOwnProperty("inputValue") && t.props.onInputValueChange(c.inputValue, j({}, t.getStateAndHelpers(), c)), t.setState(function(O) {
529
- var A;
530
- O = t.getState(O);
531
- var R = k ? c(O) : c;
532
- R = t.props.stateReducer(O, R), p = R.hasOwnProperty("selectedItem");
533
- var C = {};
534
- return p && R.selectedItem !== O.selectedItem && (v = R.selectedItem), (A = R).type || (A.type = Hn), Object.keys(R).forEach(function(P) {
535
- O[P] !== R[P] && (_[P] = R[P]), P !== "type" && (R[P], it(t.props, P) || (C[P] = R[P]));
536
- }), k && R.hasOwnProperty("inputValue") && t.props.onInputValueChange(R.inputValue, j({}, t.getStateAndHelpers(), R)), C;
537
- }, function() {
538
- pn(f)();
539
- var O = Object.keys(_).length > 1;
540
- O && t.props.onStateChange(_, t.getStateAndHelpers()), p && t.props.onSelect(c.selectedItem, t.getStateAndHelpers()), v !== void 0 && t.props.onChange(v, t.getStateAndHelpers()), t.props.onUserAction(_, t.getStateAndHelpers());
541
- });
542
- }, t.rootRef = function(c) {
543
- return t._rootNode = c;
544
- }, t.getRootProps = function(c, f) {
545
- var p, v = c === void 0 ? {} : c, _ = v.refKey, k = _ === void 0 ? "ref" : _, O = v.ref, A = ge(v, co), R = f === void 0 ? {} : f, C = R.suppressRefError, P = C === void 0 ? !1 : C;
546
- t.getRootProps.called = !0, t.getRootProps.refKey = k, t.getRootProps.suppressRefError = P;
547
- var V = t.getState(), K = V.isOpen;
548
- return j((p = {}, p[k] = Oe(O, t.rootRef), p.role = "combobox", p["aria-expanded"] = K, p["aria-haspopup"] = "listbox", p["aria-owns"] = K ? t.menuId : void 0, p["aria-labelledby"] = t.labelId, p), A);
549
- }, t.keyDownHandlers = {
550
- ArrowDown: function(f) {
551
- var p = this;
552
- if (f.preventDefault(), this.getState().isOpen) {
553
- var v = f.shiftKey ? 5 : 1;
554
- this.moveHighlightedIndex(v, {
555
- type: nt
556
- });
557
- } else
558
- this.internalSetState({
559
- isOpen: !0,
560
- type: nt
561
- }, function() {
562
- var _ = p.getItemCount();
563
- if (_ > 0) {
564
- var k = p.getState(), O = k.highlightedIndex, A = Re(O, 1, {
565
- length: _
566
- }, p.isItemDisabled, !0);
567
- p.setHighlightedIndex(A, {
568
- type: nt
569
- });
570
- }
571
- });
572
- },
573
- ArrowUp: function(f) {
574
- var p = this;
575
- if (f.preventDefault(), this.getState().isOpen) {
576
- var v = f.shiftKey ? -5 : -1;
577
- this.moveHighlightedIndex(v, {
578
- type: tt
579
- });
580
- } else
581
- this.internalSetState({
582
- isOpen: !0,
583
- type: tt
584
- }, function() {
585
- var _ = p.getItemCount();
586
- if (_ > 0) {
587
- var k = p.getState(), O = k.highlightedIndex, A = Re(O, -1, {
588
- length: _
589
- }, p.isItemDisabled, !0);
590
- p.setHighlightedIndex(A, {
591
- type: tt
592
- });
593
- }
594
- });
595
- },
596
- Enter: function(f) {
597
- if (f.which !== 229) {
598
- var p = this.getState(), v = p.isOpen, _ = p.highlightedIndex;
599
- if (v && _ != null) {
600
- f.preventDefault();
601
- var k = this.items[_], O = this.getItemNodeFromIndex(_);
602
- if (k == null || O && O.hasAttribute("disabled"))
603
- return;
604
- this.selectHighlightedItem({
605
- type: Fn
606
- });
607
- }
608
- }
609
- },
610
- Escape: function(f) {
611
- f.preventDefault(), this.reset(j({
612
- type: $n
613
- }, !this.state.isOpen && {
614
- selectedItem: null,
615
- inputValue: ""
616
- }));
617
- }
618
- }, t.buttonKeyDownHandlers = j({}, t.keyDownHandlers, {
619
- " ": function(f) {
620
- f.preventDefault(), this.toggleMenu({
621
- type: qn
622
- });
623
- }
624
- }), t.inputKeyDownHandlers = j({}, t.keyDownHandlers, {
625
- Home: function(f) {
626
- var p = this.getState(), v = p.isOpen;
627
- if (v) {
628
- f.preventDefault();
629
- var _ = this.getItemCount();
630
- if (!(_ <= 0 || !v)) {
631
- var k = $e(0, !1, {
632
- length: _
633
- }, this.isItemDisabled);
634
- this.setHighlightedIndex(k, {
635
- type: Ln
636
- });
637
- }
638
- }
639
- },
640
- End: function(f) {
641
- var p = this.getState(), v = p.isOpen;
642
- if (v) {
643
- f.preventDefault();
644
- var _ = this.getItemCount();
645
- if (!(_ <= 0 || !v)) {
646
- var k = $e(_ - 1, !0, {
647
- length: _
648
- }, this.isItemDisabled);
649
- this.setHighlightedIndex(k, {
650
- type: Bn
651
- });
652
- }
653
- }
654
- }
655
- }), t.getToggleButtonProps = function(c) {
656
- var f = c === void 0 ? {} : c, p = f.onClick;
657
- f.onPress;
658
- var v = f.onKeyDown, _ = f.onKeyUp, k = f.onBlur, O = ge(f, po), A = t.getState(), R = A.isOpen, C = {
659
- onClick: oe(p, t.buttonHandleClick),
660
- onKeyDown: oe(v, t.buttonHandleKeyDown),
661
- onKeyUp: oe(_, t.buttonHandleKeyUp),
662
- onBlur: oe(k, t.buttonHandleBlur)
663
- }, P = O.disabled ? {} : C;
664
- return j({
665
- type: "button",
666
- role: "button",
667
- "aria-label": R ? "close menu" : "open menu",
668
- "aria-haspopup": !0,
669
- "data-toggle": !0
670
- }, P, O);
671
- }, t.buttonHandleKeyUp = function(c) {
672
- c.preventDefault();
673
- }, t.buttonHandleKeyDown = function(c) {
674
- var f = ze(c);
675
- t.buttonKeyDownHandlers[f] && t.buttonKeyDownHandlers[f].call(sn(t), c);
676
- }, t.buttonHandleClick = function(c) {
677
- if (c.preventDefault(), t.props.environment) {
678
- var f = t.props.environment.document, p = f.body, v = f.activeElement;
679
- p && p === v && c.target.focus();
680
- }
681
- process.env.NODE_ENV === "test" ? t.toggleMenu({
682
- type: mt
683
- }) : t.internalSetTimeout(function() {
684
- return t.toggleMenu({
685
- type: mt
686
- });
687
- });
688
- }, t.buttonHandleBlur = function(c) {
689
- var f = c.target;
690
- t.internalSetTimeout(function() {
691
- if (!(t.isMouseDown || !t.props.environment)) {
692
- var p = t.props.environment.document.activeElement;
693
- (p == null || p.id !== t.inputId) && p !== f && t.reset({
694
- type: Yn
695
- });
696
- }
697
- });
698
- }, t.getLabelProps = function(c) {
699
- return j({
700
- htmlFor: t.inputId,
701
- id: t.labelId
702
- }, c);
703
- }, t.getInputProps = function(c) {
704
- var f = c === void 0 ? {} : c, p = f.onKeyDown, v = f.onBlur, _ = f.onChange, k = f.onInput;
705
- f.onChangeText;
706
- var O = ge(f, fo), A, R = {};
707
- A = "onChange";
708
- var C = t.getState(), P = C.inputValue, V = C.isOpen, K = C.highlightedIndex;
709
- if (!O.disabled) {
710
- var z;
711
- R = (z = {}, z[A] = oe(_, k, t.inputHandleChange), z.onKeyDown = oe(p, t.inputHandleKeyDown), z.onBlur = oe(v, t.inputHandleBlur), z);
712
- }
713
- return j({
714
- "aria-autocomplete": "list",
715
- "aria-activedescendant": V && typeof K == "number" && K >= 0 ? t.getItemId(K) : void 0,
716
- "aria-controls": V ? t.menuId : void 0,
717
- "aria-labelledby": O && O["aria-label"] ? void 0 : t.labelId,
718
- // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
719
- // revert back since autocomplete="nope" is ignored on latest Chrome and Opera
720
- autoComplete: "off",
721
- value: P,
722
- id: t.inputId
723
- }, R, O);
724
- }, t.inputHandleKeyDown = function(c) {
725
- var f = ze(c);
726
- f && t.inputKeyDownHandlers[f] && t.inputKeyDownHandlers[f].call(sn(t), c);
727
- }, t.inputHandleChange = function(c) {
728
- t.internalSetState({
729
- type: Wn,
730
- isOpen: !0,
731
- inputValue: c.target.value,
732
- highlightedIndex: t.props.defaultHighlightedIndex
733
- });
734
- }, t.inputHandleBlur = function() {
735
- t.internalSetTimeout(function() {
736
- var c;
737
- if (!(t.isMouseDown || !t.props.environment)) {
738
- var f = t.props.environment.document.activeElement, p = (f == null || (c = f.dataset) == null ? void 0 : c.toggle) && t._rootNode && t._rootNode.contains(f);
739
- p || t.reset({
740
- type: zn
741
- });
742
- }
743
- });
744
- }, t.menuRef = function(c) {
745
- t._menuNode = c;
746
- }, t.getMenuProps = function(c, f) {
747
- var p, v = c === void 0 ? {} : c, _ = v.refKey, k = _ === void 0 ? "ref" : _, O = v.ref, A = ge(v, ho), R = f === void 0 ? {} : f, C = R.suppressRefError, P = C === void 0 ? !1 : C;
748
- return t.getMenuProps.called = !0, t.getMenuProps.refKey = k, t.getMenuProps.suppressRefError = P, j((p = {}, p[k] = Oe(O, t.menuRef), p.role = "listbox", p["aria-labelledby"] = A && A["aria-label"] ? void 0 : t.labelId, p.id = t.menuId, p), A);
749
- }, t.getItemProps = function(c) {
750
- var f, p = c === void 0 ? {} : c, v = p.onMouseMove, _ = p.onMouseDown, k = p.onClick;
751
- p.onPress;
752
- var O = p.index, A = p.item, R = A === void 0 ? process.env.NODE_ENV === "production" ? (
753
- /* istanbul ignore next */
754
- void 0
755
- ) : io("getItemProps", "item") : A, C = ge(p, go);
756
- O === void 0 ? (t.items.push(R), O = t.items.indexOf(R)) : t.items[O] = R;
757
- var P = "onClick", V = k, K = (f = {
758
- // onMouseMove is used over onMouseEnter here. onMouseMove
759
- // is only triggered on actual mouse movement while onMouseEnter
760
- // can fire on DOM changes, interrupting keyboard navigation
761
- onMouseMove: oe(v, function() {
762
- O !== t.getState().highlightedIndex && (t.setHighlightedIndex(O, {
763
- type: jn
764
- }), t.avoidScrolling = !0, t.internalSetTimeout(function() {
765
- return t.avoidScrolling = !1;
766
- }, 250));
767
- }),
768
- onMouseDown: oe(_, function(W) {
769
- W.preventDefault();
770
- })
771
- }, f[P] = oe(V, function() {
772
- t.selectItemAtIndex(O, {
773
- type: Un
774
- });
775
- }), f), z = C.disabled ? {
776
- onMouseDown: K.onMouseDown
777
- } : K;
778
- return j({
779
- id: t.getItemId(O),
780
- role: "option",
781
- "aria-selected": t.getState().highlightedIndex === O
782
- }, z, C);
783
- }, t.clearItems = function() {
784
- t.items = [];
785
- }, t.reset = function(c, f) {
786
- c === void 0 && (c = {}), c = et(c), t.internalSetState(function(p) {
787
- var v = p.selectedItem;
788
- return j({
789
- isOpen: t.props.defaultIsOpen,
790
- highlightedIndex: t.props.defaultHighlightedIndex,
791
- inputValue: t.props.itemToString(v)
792
- }, c);
793
- }, f);
794
- }, t.toggleMenu = function(c, f) {
795
- c === void 0 && (c = {}), c = et(c), t.internalSetState(function(p) {
796
- var v = p.isOpen;
797
- return j({
798
- isOpen: !v
799
- }, v && {
800
- highlightedIndex: t.props.defaultHighlightedIndex
801
- }, c);
802
- }, function() {
803
- var p = t.getState(), v = p.isOpen, _ = p.highlightedIndex;
804
- v && t.getItemCount() > 0 && typeof _ == "number" && t.setHighlightedIndex(_, c), pn(f)();
805
- });
806
- }, t.openMenu = function(c) {
807
- t.internalSetState({
808
- isOpen: !0
809
- }, c);
810
- }, t.closeMenu = function(c) {
811
- t.internalSetState({
812
- isOpen: !1
813
- }, c);
814
- }, t.updateStatus = xt(function() {
815
- var c;
816
- if ((c = t.props) != null && (c = c.environment) != null && c.document) {
817
- var f = t.getState(), p = t.items[f.highlightedIndex], v = t.getItemCount(), _ = t.props.getA11yStatusMessage(j({
818
- itemToString: t.props.itemToString,
819
- previousResultCount: t.previousResultCount,
820
- resultCount: v,
821
- highlightedItem: p
822
- }, f));
823
- t.previousResultCount = v, Et(_, t.props.environment.document);
824
- }
825
- }, 200);
826
- var s = t.props, a = s.defaultHighlightedIndex, d = s.initialHighlightedIndex, l = d === void 0 ? a : d, u = s.defaultIsOpen, h = s.initialIsOpen, w = h === void 0 ? u : h, b = s.initialInputValue, I = b === void 0 ? "" : b, S = s.initialSelectedItem, g = S === void 0 ? null : S, M = t.getState({
827
- highlightedIndex: l,
828
- isOpen: w,
829
- inputValue: I,
830
- selectedItem: g
831
- });
832
- return M.selectedItem != null && t.props.initialInputValue === void 0 && (M.inputValue = t.props.itemToString(M.selectedItem)), t.state = M, t;
833
- }
834
- var i = r.prototype;
835
- return i.internalClearTimeouts = function() {
836
- this.timeoutIds.forEach(function(t) {
837
- clearTimeout(t);
838
- }), this.timeoutIds = [];
839
- }, i.getState = function(t) {
840
- return t === void 0 && (t = this.state), Ue(t, this.props);
841
- }, i.getItemCount = function() {
842
- var t = this.items.length;
843
- return this.itemCount != null ? t = this.itemCount : this.props.itemCount !== void 0 && (t = this.props.itemCount), t;
844
- }, i.getItemNodeFromIndex = function(t) {
845
- return this.props.environment ? this.props.environment.document.getElementById(this.getItemId(t)) : null;
846
- }, i.scrollHighlightedItemIntoView = function() {
847
- {
848
- var t = this.getItemNodeFromIndex(this.getState().highlightedIndex);
849
- this.props.scrollIntoView(t, this._menuNode);
850
- }
851
- }, i.moveHighlightedIndex = function(t, s) {
852
- var a = this.getItemCount(), d = this.getState(), l = d.highlightedIndex;
853
- if (a > 0) {
854
- var u = Re(l, t, {
855
- length: a
856
- }, this.isItemDisabled, !0);
857
- this.setHighlightedIndex(u, s);
858
- }
859
- }, i.getStateAndHelpers = function() {
860
- var t = this.getState(), s = t.highlightedIndex, a = t.inputValue, d = t.selectedItem, l = t.isOpen, u = this.props.itemToString, h = this.id, w = this.getRootProps, b = this.getToggleButtonProps, I = this.getLabelProps, S = this.getMenuProps, g = this.getInputProps, M = this.getItemProps, c = this.openMenu, f = this.closeMenu, p = this.toggleMenu, v = this.selectItem, _ = this.selectItemAtIndex, k = this.selectHighlightedItem, O = this.setHighlightedIndex, A = this.clearSelection, R = this.clearItems, C = this.reset, P = this.setItemCount, V = this.unsetItemCount, K = this.internalSetState;
861
- return {
862
- // prop getters
863
- getRootProps: w,
864
- getToggleButtonProps: b,
865
- getLabelProps: I,
866
- getMenuProps: S,
867
- getInputProps: g,
868
- getItemProps: M,
869
- // actions
870
- reset: C,
871
- openMenu: c,
872
- closeMenu: f,
873
- toggleMenu: p,
874
- selectItem: v,
875
- selectItemAtIndex: _,
876
- selectHighlightedItem: k,
877
- setHighlightedIndex: O,
878
- clearSelection: A,
879
- clearItems: R,
880
- setItemCount: P,
881
- unsetItemCount: V,
882
- setState: K,
883
- // props
884
- itemToString: u,
885
- // derived
886
- id: h,
887
- // state
888
- highlightedIndex: s,
889
- inputValue: a,
890
- isOpen: l,
891
- selectedItem: d
892
- };
893
- }, i.componentDidMount = function() {
894
- var t = this;
895
- if (process.env.NODE_ENV !== "production" && this.getMenuProps.called && !this.getMenuProps.suppressRefError && gn(this._menuNode, this.getMenuProps), !this.props.environment)
896
- this.cleanup = function() {
897
- t.internalClearTimeouts();
898
- };
899
- else {
900
- var s = function() {
901
- t.isMouseDown = !0;
902
- }, a = function(b) {
903
- t.isMouseDown = !1;
904
- var I = st(b.target, [t._rootNode, t._menuNode], t.props.environment);
905
- !I && t.getState().isOpen && t.reset({
906
- type: Kn
907
- }, function() {
908
- return t.props.onOuterClick(t.getStateAndHelpers());
909
- });
910
- }, d = function() {
911
- t.isTouchMove = !1;
912
- }, l = function() {
913
- t.isTouchMove = !0;
914
- }, u = function(b) {
915
- var I = st(b.target, [t._rootNode, t._menuNode], t.props.environment, !1);
916
- !t.isTouchMove && !I && t.getState().isOpen && t.reset({
917
- type: Xn
918
- }, function() {
919
- return t.props.onOuterClick(t.getStateAndHelpers());
920
- });
921
- }, h = this.props.environment;
922
- h.addEventListener("mousedown", s), h.addEventListener("mouseup", a), h.addEventListener("touchstart", d), h.addEventListener("touchmove", l), h.addEventListener("touchend", u), this.cleanup = function() {
923
- t.internalClearTimeouts(), t.updateStatus.cancel(), h.removeEventListener("mousedown", s), h.removeEventListener("mouseup", a), h.removeEventListener("touchstart", d), h.removeEventListener("touchmove", l), h.removeEventListener("touchend", u);
924
- };
925
- }
926
- }, i.shouldScroll = function(t, s) {
927
- var a = this.props.highlightedIndex === void 0 ? this.getState() : this.props, d = a.highlightedIndex, l = s.highlightedIndex === void 0 ? t : s, u = l.highlightedIndex, h = d && this.getState().isOpen && !t.isOpen, w = d !== u;
928
- return h || w;
929
- }, i.componentDidUpdate = function(t, s) {
930
- process.env.NODE_ENV !== "production" && (wt(this.state, t, this.props), this.getMenuProps.called && !this.getMenuProps.suppressRefError && gn(this._menuNode, this.getMenuProps)), it(this.props, "selectedItem") && this.props.selectedItemChanged(t.selectedItem, this.props.selectedItem) && this.internalSetState({
931
- type: Gn,
932
- inputValue: this.props.itemToString(this.props.selectedItem)
933
- }), !this.avoidScrolling && this.shouldScroll(s, t) && this.scrollHighlightedItemIntoView(), this.updateStatus();
934
- }, i.componentWillUnmount = function() {
935
- this.cleanup();
936
- }, i.render = function() {
937
- var t = hn(this.props.children, he);
938
- this.clearItems(), this.getRootProps.called = !1, this.getRootProps.refKey = void 0, this.getRootProps.suppressRefError = void 0, this.getMenuProps.called = !1, this.getMenuProps.refKey = void 0, this.getMenuProps.suppressRefError = void 0, this.getLabelProps.called = !1, this.getInputProps.called = !1;
939
- var s = hn(t(this.getStateAndHelpers()));
940
- if (!s)
941
- return null;
942
- if (this.getRootProps.called || this.props.suppressRefError)
943
- return process.env.NODE_ENV !== "production" && !this.getRootProps.suppressRefError && !this.props.suppressRefError && vo(s, this.getRootProps), s;
944
- if (Tn(s))
945
- return /* @__PURE__ */ Rr(s, this.getRootProps(Vn(s)));
946
- if (process.env.NODE_ENV !== "production")
947
- throw new Error("downshift: If you return a non-DOM element, you must apply the getRootProps function");
948
- }, r;
949
- }(Pr);
950
- return e.defaultProps = {
951
- defaultHighlightedIndex: null,
952
- defaultIsOpen: !1,
953
- getA11yStatusMessage: kn,
954
- itemToString: function(r) {
955
- return r == null ? "" : (process.env.NODE_ENV !== "production" && ao(r) && !r.hasOwnProperty("toString") && console.warn("downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.", "The object that was passed:", r), String(r));
956
- },
957
- onStateChange: he,
958
- onInputValueChange: he,
959
- onUserAction: he,
960
- onChange: he,
961
- onSelect: he,
962
- onOuterClick: he,
963
- selectedItemChanged: function(r, i) {
964
- return r !== i;
965
- },
966
- environment: (
967
- /* istanbul ignore next (ssr) */
968
- typeof window > "u" ? void 0 : window
969
- ),
970
- stateReducer: function(r, i) {
971
- return i;
972
- },
973
- suppressRefError: !1,
974
- scrollIntoView: Pn
975
- }, e.stateChangeTypes = uo, e;
976
- }();
977
- process.env.NODE_ENV !== "production" && (mo.propTypes = {
978
- children: m.func,
979
- defaultHighlightedIndex: m.number,
980
- defaultIsOpen: m.bool,
981
- initialHighlightedIndex: m.number,
982
- initialSelectedItem: m.any,
983
- initialInputValue: m.string,
984
- initialIsOpen: m.bool,
985
- getA11yStatusMessage: m.func,
986
- itemToString: m.func,
987
- onChange: m.func,
988
- onSelect: m.func,
989
- onStateChange: m.func,
990
- onInputValueChange: m.func,
991
- onUserAction: m.func,
992
- onOuterClick: m.func,
993
- selectedItemChanged: m.func,
994
- stateReducer: m.func,
995
- itemCount: m.number,
996
- id: m.string,
997
- environment: m.shape({
998
- addEventListener: m.func.isRequired,
999
- removeEventListener: m.func.isRequired,
1000
- document: m.shape({
1001
- createElement: m.func.isRequired,
1002
- getElementById: m.func.isRequired,
1003
- activeElement: m.any.isRequired,
1004
- body: m.any.isRequired
1005
- }).isRequired,
1006
- Node: m.func.isRequired
1007
- }),
1008
- suppressRefError: m.bool,
1009
- scrollIntoView: m.func,
1010
- // things we keep in state for uncontrolled components
1011
- // but can accept as props for controlled components
1012
- /* eslint-disable react/no-unused-prop-types */
1013
- selectedItem: m.any,
1014
- isOpen: m.bool,
1015
- inputValue: m.string,
1016
- highlightedIndex: m.number,
1017
- labelId: m.string,
1018
- inputId: m.string,
1019
- menuId: m.string,
1020
- getItemId: m.func
1021
- /* eslint-enable react/no-unused-prop-types */
1022
- });
1023
- function gn(e, n) {
1024
- var r = n.refKey;
1025
- e || console.error('downshift: The ref prop "' + r + '" from getMenuProps was not applied correctly on your menu element.');
1026
- }
1027
- function vo(e, n) {
1028
- var r = n.refKey, i = r !== "ref", o = !Tn(e);
1029
- o && !i && !un.isForwardRef(e) ? console.error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps") : !o && i && console.error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "' + r + '"'), !un.isForwardRef(e) && !Vn(e)[r] && console.error('downshift: You must apply the ref prop "' + r + '" from getRootProps onto your root element.');
1030
- }
1031
- var Io = ["highlightedIndex", "items", "environment"], Jn = {
1032
- highlightedIndex: -1,
1033
- isOpen: !1,
1034
- selectedItem: null,
1035
- inputValue: ""
1036
- };
1037
- function _o(e, n, r) {
1038
- var i = e.props, o = e.type, t = {};
1039
- Object.keys(n).forEach(function(s) {
1040
- yo(s, e, n, r), r[s] !== n[s] && (t[s] = r[s]);
1041
- }), i.onStateChange && Object.keys(t).length && i.onStateChange(j({
1042
- type: o
1043
- }, t));
1044
- }
1045
- function yo(e, n, r, i) {
1046
- var o = n.props, t = n.type, s = "on" + Ct(e) + "Change";
1047
- o[s] && i[e] !== void 0 && i[e] !== r[e] && o[s](j({
1048
- type: t
1049
- }, i));
1050
- }
1051
- function bo(e, n) {
1052
- return n.changes;
1053
- }
1054
- function xo(e) {
1055
- var n = e.selectedItem, r = e.itemToString;
1056
- return n ? r(n) + " has been selected." : "";
1057
- }
1058
- var wo = xt(function(e, n) {
1059
- Et(e(), n);
1060
- }, 200), Eo = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? _t : le, Co = "useId" in ot ? function(n) {
1061
- var r = n.id, i = n.labelId, o = n.menuId, t = n.getItemId, s = n.toggleButtonId, a = n.inputId, d = "downshift-" + ot.useId();
1062
- r || (r = d);
1063
- var l = te({
1064
- labelId: i || r + "-label",
1065
- menuId: o || r + "-menu",
1066
- getItemId: t || function(u) {
1067
- return r + "-item-" + u;
1068
- },
1069
- toggleButtonId: s || r + "-toggle-button",
1070
- inputId: a || r + "-input"
1071
- });
1072
- return l.current;
1073
- } : function(n) {
1074
- var r = n.id, i = r === void 0 ? "downshift-" + Mn() : r, o = n.labelId, t = n.menuId, s = n.getItemId, a = n.toggleButtonId, d = n.inputId, l = te({
1075
- labelId: o || i + "-label",
1076
- menuId: t || i + "-menu",
1077
- getItemId: s || function(u) {
1078
- return i + "-item-" + u;
1079
- },
1080
- toggleButtonId: a || i + "-toggle-button",
1081
- inputId: d || i + "-input"
1082
- });
1083
- return l.current;
1084
- };
1085
- function Qn(e, n, r, i) {
1086
- var o, t;
1087
- if (e === void 0) {
1088
- if (n === void 0)
1089
- throw new Error(i);
1090
- o = r[n], t = n;
1091
- } else
1092
- t = n === void 0 ? r.indexOf(e) : n, o = e;
1093
- return [o, t];
1094
- }
1095
- function Ct(e) {
1096
- return "" + e.slice(0, 1).toUpperCase() + e.slice(1);
1097
- }
1098
- function St(e) {
1099
- var n = te(e);
1100
- return n.current = e, n;
1101
- }
1102
- function Zn(e, n, r, i) {
1103
- var o = te(), t = te(), s = ee(function(b, I) {
1104
- t.current = I, b = Ue(b, I.props);
1105
- var S = e(b, I), g = I.props.stateReducer(b, j({}, I, {
1106
- changes: S
1107
- }));
1108
- return g;
1109
- }, [e]), a = Mr(s, n, r), d = a[0], l = a[1], u = St(n), h = ee(function(b) {
1110
- return l(j({
1111
- props: u.current
1112
- }, b));
1113
- }, [u]), w = t.current;
1114
- return le(function() {
1115
- var b = Ue(o.current, w == null ? void 0 : w.props), I = w && o.current && !i(b, d);
1116
- I && _o(w, b, d), o.current = d;
1117
- }, [d, w, i]), [d, h];
1118
- }
1119
- function So(e, n, r, i) {
1120
- var o = Zn(e, n, r, i), t = o[0], s = o[1];
1121
- return [Ue(t, n), s];
1122
- }
1123
- var Ve = {
1124
- itemToString: function(n) {
1125
- return n ? String(n) : "";
1126
- },
1127
- itemToKey: function(n) {
1128
- return n;
1129
- },
1130
- stateReducer: bo,
1131
- getA11ySelectionMessage: xo,
1132
- scrollIntoView: Pn,
1133
- environment: (
1134
- /* istanbul ignore next (ssr) */
1135
- typeof window > "u" ? void 0 : window
1136
- )
1137
- };
1138
- function _e(e, n, r) {
1139
- r === void 0 && (r = Jn);
1140
- var i = e["default" + Ct(n)];
1141
- return i !== void 0 ? i : r[n];
1142
- }
1143
- function Ae(e, n, r) {
1144
- r === void 0 && (r = Jn);
1145
- var i = e[n];
1146
- if (i !== void 0)
1147
- return i;
1148
- var o = e["initial" + Ct(n)];
1149
- return o !== void 0 ? o : _e(e, n, r);
1150
- }
1151
- function Oo(e) {
1152
- var n = Ae(e, "selectedItem"), r = Ae(e, "isOpen"), i = Ae(e, "highlightedIndex"), o = Ae(e, "inputValue");
1153
- return {
1154
- highlightedIndex: i < 0 && n && r ? e.items.findIndex(function(t) {
1155
- return e.itemToKey(t) === e.itemToKey(n);
1156
- }) : i,
1157
- isOpen: r,
1158
- selectedItem: n,
1159
- inputValue: o
1160
- };
1161
- }
1162
- function Be(e, n, r) {
1163
- var i = e.items, o = e.initialHighlightedIndex, t = e.defaultHighlightedIndex, s = e.itemToKey, a = n.selectedItem, d = n.highlightedIndex;
1164
- return i.length === 0 ? -1 : o !== void 0 && d === o ? o : t !== void 0 ? t : a ? i.findIndex(function(l) {
1165
- return s(a) === s(l);
1166
- }) : r === 0 ? -1 : r < 0 ? i.length - 1 : 0;
1167
- }
1168
- function Do(e, n, r) {
1169
- var i = te({
1170
- isMouseDown: !1,
1171
- isTouchMove: !1,
1172
- isTouchEnd: !1
1173
- });
1174
- return le(function() {
1175
- if (!e)
1176
- return he;
1177
- var o = n.map(function(u) {
1178
- return u.current;
1179
- });
1180
- function t() {
1181
- i.current.isTouchEnd = !1, i.current.isMouseDown = !0;
1182
- }
1183
- function s(u) {
1184
- i.current.isMouseDown = !1, st(u.target, o, e) || r();
1185
- }
1186
- function a() {
1187
- i.current.isTouchEnd = !1, i.current.isTouchMove = !1;
1188
- }
1189
- function d() {
1190
- i.current.isTouchMove = !0;
1191
- }
1192
- function l(u) {
1193
- i.current.isTouchEnd = !0, !i.current.isTouchMove && !st(u.target, o, e, !1) && r();
1194
- }
1195
- return e.addEventListener("mousedown", t), e.addEventListener("mouseup", s), e.addEventListener("touchstart", a), e.addEventListener("touchmove", d), e.addEventListener("touchend", l), function() {
1196
- e.removeEventListener("mousedown", t), e.removeEventListener("mouseup", s), e.removeEventListener("touchstart", a), e.removeEventListener("touchmove", d), e.removeEventListener("touchend", l);
1197
- };
1198
- }, [e, r]), i.current;
1199
- }
1200
- var Ot = function() {
1201
- return he;
1202
- };
1203
- process.env.NODE_ENV !== "production" && (Ot = function() {
1204
- for (var n = te(!0), r = arguments.length, i = new Array(r), o = 0; o < r; o++)
1205
- i[o] = arguments[o];
1206
- var t = te(i.reduce(function(a, d) {
1207
- return a[d] = {}, a;
1208
- }, {}));
1209
- le(function() {
1210
- Object.keys(t.current).forEach(function(a) {
1211
- var d = t.current[a];
1212
- if (n.current && !Object.keys(d).length) {
1213
- console.error("downshift: You forgot to call the " + a + " getter function on your component / element.");
1214
- return;
1215
- }
1216
- var l = d.suppressRefError, u = d.refKey, h = d.elementRef;
1217
- (!h || !h.current) && !l && console.error('downshift: The ref prop "' + u + '" from ' + a + " was not applied correctly on your element.");
1218
- }), n.current = !1;
1219
- });
1220
- var s = ee(function(a, d, l, u) {
1221
- t.current[a] = {
1222
- suppressRefError: d,
1223
- refKey: l,
1224
- elementRef: u
1225
- };
1226
- }, []);
1227
- return s;
1228
- });
1229
- function mn(e, n, r) {
1230
- var i = r.highlightedIndex, o = r.items, t = r.environment, s = ge(r, Io), a = qe();
1231
- le(function() {
1232
- a || !(t != null && t.document) || wo(function() {
1233
- return e(j({
1234
- highlightedIndex: i,
1235
- highlightedItem: o[i],
1236
- resultCount: o.length
1237
- }, s));
1238
- }, t.document);
1239
- }, n);
1240
- }
1241
- function No(e) {
1242
- var n = e.highlightedIndex, r = e.isOpen, i = e.itemRefs, o = e.getItemNodeFromIndex, t = e.menuElement, s = e.scrollIntoView, a = te(!0);
1243
- return Eo(function() {
1244
- n < 0 || !r || !Object.keys(i.current).length || (a.current === !1 ? a.current = !0 : s(o(n), t));
1245
- }, [n]), a;
1246
- }
1247
- var Dt = he;
1248
- process.env.NODE_ENV !== "production" && (Dt = function(n) {
1249
- var r = n.props, i = n.state, o = te(r), t = qe();
1250
- le(function() {
1251
- t || (wt(i, o.current, r), o.current = r);
1252
- }, [i, r, t]);
1253
- });
1254
- function vn(e, n, r) {
1255
- var i;
1256
- r === void 0 && (r = !0);
1257
- var o = ((i = e.items) == null ? void 0 : i.length) && n >= 0;
1258
- return j({
1259
- isOpen: !1,
1260
- highlightedIndex: -1
1261
- }, o && j({
1262
- selectedItem: e.items[n],
1263
- isOpen: _e(e, "isOpen"),
1264
- highlightedIndex: _e(e, "highlightedIndex")
1265
- }, r && {
1266
- inputValue: e.itemToString(e.items[n])
1267
- }));
1268
- }
1269
- function Ro(e, n) {
1270
- return e.isOpen === n.isOpen && e.inputValue === n.inputValue && e.highlightedIndex === n.highlightedIndex && e.selectedItem === n.selectedItem;
1271
- }
1272
- function qe() {
1273
- var e = ot.useRef(!0);
1274
- return ot.useEffect(function() {
1275
- return e.current = !1, function() {
1276
- e.current = !0;
1277
- };
1278
- }, []), e.current;
1279
- }
1280
- var er = {
1281
- environment: m.shape({
1282
- addEventListener: m.func.isRequired,
1283
- removeEventListener: m.func.isRequired,
1284
- document: m.shape({
1285
- createElement: m.func.isRequired,
1286
- getElementById: m.func.isRequired,
1287
- activeElement: m.any.isRequired,
1288
- body: m.any.isRequired
1289
- }).isRequired,
1290
- Node: m.func.isRequired
1291
- }),
1292
- itemToString: m.func,
1293
- itemToKey: m.func,
1294
- stateReducer: m.func
1295
- }, tr = j({}, er, {
1296
- getA11yStatusMessage: m.func,
1297
- highlightedIndex: m.number,
1298
- defaultHighlightedIndex: m.number,
1299
- initialHighlightedIndex: m.number,
1300
- isOpen: m.bool,
1301
- defaultIsOpen: m.bool,
1302
- initialIsOpen: m.bool,
1303
- selectedItem: m.any,
1304
- initialSelectedItem: m.any,
1305
- defaultSelectedItem: m.any,
1306
- id: m.string,
1307
- labelId: m.string,
1308
- menuId: m.string,
1309
- getItemId: m.func,
1310
- toggleButtonId: m.string,
1311
- onSelectedItemChange: m.func,
1312
- onHighlightedIndexChange: m.func,
1313
- onStateChange: m.func,
1314
- onIsOpenChange: m.func,
1315
- scrollIntoView: m.func
1316
- });
1317
- function Po(e, n, r) {
1318
- var i = n.type, o = n.props, t;
1319
- switch (i) {
1320
- case r.ItemMouseMove:
1321
- t = {
1322
- highlightedIndex: n.disabled ? -1 : n.index
1323
- };
1324
- break;
1325
- case r.MenuMouseLeave:
1326
- t = {
1327
- highlightedIndex: -1
1328
- };
1329
- break;
1330
- case r.ToggleButtonClick:
1331
- case r.FunctionToggleMenu:
1332
- t = {
1333
- isOpen: !e.isOpen,
1334
- highlightedIndex: e.isOpen ? -1 : Be(o, e, 0)
1335
- };
1336
- break;
1337
- case r.FunctionOpenMenu:
1338
- t = {
1339
- isOpen: !0,
1340
- highlightedIndex: Be(o, e, 0)
1341
- };
1342
- break;
1343
- case r.FunctionCloseMenu:
1344
- t = {
1345
- isOpen: !1
1346
- };
1347
- break;
1348
- case r.FunctionSetHighlightedIndex:
1349
- t = {
1350
- highlightedIndex: n.highlightedIndex
1351
- };
1352
- break;
1353
- case r.FunctionSetInputValue:
1354
- t = {
1355
- inputValue: n.inputValue
1356
- };
1357
- break;
1358
- case r.FunctionReset:
1359
- t = {
1360
- highlightedIndex: _e(o, "highlightedIndex"),
1361
- isOpen: _e(o, "isOpen"),
1362
- selectedItem: _e(o, "selectedItem"),
1363
- inputValue: _e(o, "inputValue")
1364
- };
1365
- break;
1366
- default:
1367
- throw new Error("Reducer called without proper action type.");
1368
- }
1369
- return j({}, e, t);
1370
- }
1371
- je(je({}, tr), { items: m.array.isRequired, isItemDisabled: m.func, getA11ySelectionMessage: m.func });
1372
- function Mo(e) {
1373
- var n = e.isOpen, r = e.resultCount, i = e.previousResultCount;
1374
- return n ? r ? r !== i ? "".concat(r, " result").concat(r === 1 ? " is" : "s are", " available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.") : "" : "No results are available." : "";
1375
- }
1376
- je(je({}, Ve), { getA11yStatusMessage: Mo, isItemDisabled: function() {
1377
- return !1;
1378
- } });
1379
- process.env.NODE_ENV;
1380
- process.env.NODE_ENV;
1381
- process.env.NODE_ENV;
1382
- process.env.NODE_ENV;
1383
- process.env.NODE_ENV;
1384
- process.env.NODE_ENV;
1385
- process.env.NODE_ENV;
1386
- process.env.NODE_ENV;
1387
- process.env.NODE_ENV;
1388
- process.env.NODE_ENV;
1389
- process.env.NODE_ENV;
1390
- process.env.NODE_ENV;
1391
- process.env.NODE_ENV;
1392
- process.env.NODE_ENV;
1393
- process.env.NODE_ENV;
1394
- process.env.NODE_ENV;
1395
- process.env.NODE_ENV;
1396
- process.env.NODE_ENV;
1397
- process.env.NODE_ENV;
1398
- process.env.NODE_ENV;
1399
- process.env.NODE_ENV;
1400
- process.env.NODE_ENV;
1401
- process.env.NODE_ENV;
1402
- var Nt = process.env.NODE_ENV !== "production" ? "__input_keydown_arrow_down__" : 0, Rt = process.env.NODE_ENV !== "production" ? "__input_keydown_arrow_up__" : 1, Pt = process.env.NODE_ENV !== "production" ? "__input_keydown_escape__" : 2, Mt = process.env.NODE_ENV !== "production" ? "__input_keydown_home__" : 3, kt = process.env.NODE_ENV !== "production" ? "__input_keydown_end__" : 4, Tt = process.env.NODE_ENV !== "production" ? "__input_keydown_page_up__" : 5, Vt = process.env.NODE_ENV !== "production" ? "__input_keydown_page_down__" : 6, At = process.env.NODE_ENV !== "production" ? "__input_keydown_enter__" : 7, Ht = process.env.NODE_ENV !== "production" ? "__input_change__" : 8, at = process.env.NODE_ENV !== "production" ? "__input_blur__" : 9, Kt = process.env.NODE_ENV !== "production" ? "__input_click__" : 10, nr = process.env.NODE_ENV !== "production" ? "__menu_mouse_leave__" : 11, rr = process.env.NODE_ENV !== "production" ? "__item_mouse_move__" : 12, jt = process.env.NODE_ENV !== "production" ? "__item_click__" : 13, or = process.env.NODE_ENV !== "production" ? "__togglebutton_click__" : 14, ir = process.env.NODE_ENV !== "production" ? "__function_toggle_menu__" : 15, sr = process.env.NODE_ENV !== "production" ? "__function_open_menu__" : 16, ar = process.env.NODE_ENV !== "production" ? "__function_close_menu__" : 17, lr = process.env.NODE_ENV !== "production" ? "__function_set_highlighted_index__" : 18, $t = process.env.NODE_ENV !== "production" ? "__function_select_item__" : 19, ur = process.env.NODE_ENV !== "production" ? "__function_set_input_value__" : 20, dr = process.env.NODE_ENV !== "production" ? "__function_reset__" : 21, Ft = process.env.NODE_ENV !== "production" ? "__controlled_prop_updated_selected_item__" : 22, cr = /* @__PURE__ */ Object.freeze({
1403
- __proto__: null,
1404
- InputKeyDownArrowDown: Nt,
1405
- InputKeyDownArrowUp: Rt,
1406
- InputKeyDownEscape: Pt,
1407
- InputKeyDownHome: Mt,
1408
- InputKeyDownEnd: kt,
1409
- InputKeyDownPageUp: Tt,
1410
- InputKeyDownPageDown: Vt,
1411
- InputKeyDownEnter: At,
1412
- InputChange: Ht,
1413
- InputBlur: at,
1414
- InputClick: Kt,
1415
- MenuMouseLeave: nr,
1416
- ItemMouseMove: rr,
1417
- ItemClick: jt,
1418
- ToggleButtonClick: or,
1419
- FunctionToggleMenu: ir,
1420
- FunctionOpenMenu: sr,
1421
- FunctionCloseMenu: ar,
1422
- FunctionSetHighlightedIndex: lr,
1423
- FunctionSelectItem: $t,
1424
- FunctionSetInputValue: ur,
1425
- FunctionReset: dr,
1426
- ControlledPropUpdatedSelectedItem: Ft
1427
- });
1428
- function ko(e) {
1429
- var n = Oo(e), r = n.selectedItem, i = n.inputValue;
1430
- return i === "" && r && e.defaultInputValue === void 0 && e.initialInputValue === void 0 && e.inputValue === void 0 && (i = e.itemToString(r)), j({}, n, {
1431
- inputValue: i
1432
- });
1433
- }
1434
- var To = j({}, tr, {
1435
- items: m.array.isRequired,
1436
- isItemDisabled: m.func,
1437
- selectedItemChanged: m.func,
1438
- getA11ySelectionMessage: m.func,
1439
- inputValue: m.string,
1440
- defaultInputValue: m.string,
1441
- initialInputValue: m.string,
1442
- inputId: m.string,
1443
- onInputValueChange: m.func
1444
- });
1445
- function Vo(e, n, r, i) {
1446
- var o = te(), t = Zn(e, n, r, i), s = t[0], a = t[1], d = qe();
1447
- return le(function() {
1448
- if (it(n, "selectedItem")) {
1449
- if (!d) {
1450
- var l;
1451
- n.selectedItemChanged === void 0 ? l = n.itemToKey(n.selectedItem) !== n.itemToKey(o.current) : (console.warn('The "selectedItemChanged" is deprecated. Please use "itemToKey instead". https://github.com/downshift-js/downshift/blob/master/src/hooks/useCombobox/README.md#selecteditemchanged'), l = n.selectedItemChanged(o.current, n.selectedItem)), l && a({
1452
- type: Ft,
1453
- inputValue: n.itemToString(n.selectedItem)
1454
- });
1455
- }
1456
- o.current = s.selectedItem === o.current ? n.selectedItem : s.selectedItem;
1457
- }
1458
- }, [s.selectedItem, n.selectedItem]), [Ue(s, n), a];
1459
- }
1460
- var pr = he;
1461
- process.env.NODE_ENV !== "production" && (pr = function(n, r) {
1462
- m.checkPropTypes(To, n, "prop", r.name);
1463
- });
1464
- var Ao = j({}, Ve, {
1465
- getA11yStatusMessage: kn,
1466
- isItemDisabled: function() {
1467
- return !1;
1468
- }
1469
- });
1470
- function Ho(e, n) {
1471
- var r, i = n.type, o = n.props, t = n.altKey, s;
1472
- switch (i) {
1473
- case jt:
1474
- s = {
1475
- isOpen: _e(o, "isOpen"),
1476
- highlightedIndex: _e(o, "highlightedIndex"),
1477
- selectedItem: o.items[n.index],
1478
- inputValue: o.itemToString(o.items[n.index])
1479
- };
1480
- break;
1481
- case Nt:
1482
- e.isOpen ? s = {
1483
- highlightedIndex: Re(e.highlightedIndex, 1, o.items, o.isItemDisabled, !0)
1484
- } : s = {
1485
- highlightedIndex: t && e.selectedItem == null ? -1 : Be(o, e, 1),
1486
- isOpen: o.items.length >= 0
1487
- };
1488
- break;
1489
- case Rt:
1490
- e.isOpen ? t ? s = vn(o, e.highlightedIndex) : s = {
1491
- highlightedIndex: Re(e.highlightedIndex, -1, o.items, o.isItemDisabled, !0)
1492
- } : s = {
1493
- highlightedIndex: Be(o, e, -1),
1494
- isOpen: o.items.length >= 0
1495
- };
1496
- break;
1497
- case At:
1498
- s = vn(o, e.highlightedIndex);
1499
- break;
1500
- case Pt:
1501
- s = j({
1502
- isOpen: !1,
1503
- highlightedIndex: -1
1504
- }, !e.isOpen && {
1505
- selectedItem: null,
1506
- inputValue: ""
1507
- });
1508
- break;
1509
- case Tt:
1510
- s = {
1511
- highlightedIndex: Re(e.highlightedIndex, -10, o.items, o.isItemDisabled, !0)
1512
- };
1513
- break;
1514
- case Vt:
1515
- s = {
1516
- highlightedIndex: Re(e.highlightedIndex, 10, o.items, o.isItemDisabled, !0)
1517
- };
1518
- break;
1519
- case Mt:
1520
- s = {
1521
- highlightedIndex: $e(0, !1, o.items, o.isItemDisabled)
1522
- };
1523
- break;
1524
- case kt:
1525
- s = {
1526
- highlightedIndex: $e(o.items.length - 1, !0, o.items, o.isItemDisabled)
1527
- };
1528
- break;
1529
- case at:
1530
- s = j({
1531
- isOpen: !1,
1532
- highlightedIndex: -1
1533
- }, e.highlightedIndex >= 0 && ((r = o.items) == null ? void 0 : r.length) && n.selectItem && {
1534
- selectedItem: o.items[e.highlightedIndex],
1535
- inputValue: o.itemToString(o.items[e.highlightedIndex])
1536
- });
1537
- break;
1538
- case Ht:
1539
- s = {
1540
- isOpen: !0,
1541
- highlightedIndex: _e(o, "highlightedIndex"),
1542
- inputValue: n.inputValue
1543
- };
1544
- break;
1545
- case Kt:
1546
- s = {
1547
- isOpen: !e.isOpen,
1548
- highlightedIndex: e.isOpen ? -1 : Be(o, e, 0)
1549
- };
1550
- break;
1551
- case $t:
1552
- s = {
1553
- selectedItem: n.selectedItem,
1554
- inputValue: o.itemToString(n.selectedItem)
1555
- };
1556
- break;
1557
- case Ft:
1558
- s = {
1559
- inputValue: n.inputValue
1560
- };
1561
- break;
1562
- default:
1563
- return Po(e, n, cr);
1564
- }
1565
- return j({}, e, s);
1566
- }
1567
- var Ko = ["onMouseLeave", "refKey", "ref"], jo = ["item", "index", "refKey", "ref", "onMouseMove", "onMouseDown", "onClick", "onPress", "disabled"], $o = ["onClick", "onPress", "refKey", "ref"], Fo = ["onKeyDown", "onChange", "onInput", "onBlur", "onChangeText", "onClick", "refKey", "ref"];
1568
- fe.stateChangeTypes = cr;
1569
- function fe(e) {
1570
- e === void 0 && (e = {}), pr(e, fe);
1571
- var n = j({}, Ao, e), r = n.items, i = n.scrollIntoView, o = n.environment, t = n.getA11yStatusMessage, s = n.getA11ySelectionMessage, a = n.itemToString, d = Vo(Ho, n, ko, Ro), l = d[0], u = d[1], h = l.isOpen, w = l.highlightedIndex, b = l.selectedItem, I = l.inputValue, S = te(null), g = te({}), M = te(null), c = te(null), f = qe(), p = Co(n), v = te(), _ = St({
1572
- state: l,
1573
- props: n
1574
- }), k = ee(function(D) {
1575
- return g.current[p.getItemId(D)];
1576
- }, [p]);
1577
- mn(t, [h, w, I, r], j({
1578
- previousResultCount: v.current,
1579
- items: r,
1580
- environment: o,
1581
- itemToString: a
1582
- }, l)), mn(s, [b], j({
1583
- previousResultCount: v.current,
1584
- items: r,
1585
- environment: o,
1586
- itemToString: a
1587
- }, l));
1588
- var O = No({
1589
- menuElement: S.current,
1590
- highlightedIndex: w,
1591
- isOpen: h,
1592
- itemRefs: g,
1593
- scrollIntoView: i,
1594
- getItemNodeFromIndex: k
1595
- });
1596
- Dt({
1597
- props: n,
1598
- state: l
1599
- }), le(function() {
1600
- var D = Ae(n, "isOpen");
1601
- D && M.current && M.current.focus();
1602
- }, []), le(function() {
1603
- f || (v.current = r.length);
1604
- });
1605
- var A = Do(o, [c, S, M], ee(function() {
1606
- _.current.state.isOpen && u({
1607
- type: at,
1608
- selectItem: !1
1609
- });
1610
- }, [u, _])), R = Ot("getInputProps", "getMenuProps");
1611
- le(function() {
1612
- h || (g.current = {});
1613
- }, [h]), le(function() {
1614
- var D;
1615
- !h || !(o != null && o.document) || !(M != null && (D = M.current) != null && D.focus) || o.document.activeElement !== M.current && M.current.focus();
1616
- }, [h, o]);
1617
- var C = Ke(function() {
1618
- return {
1619
- ArrowDown: function(N) {
1620
- N.preventDefault(), u({
1621
- type: Nt,
1622
- altKey: N.altKey
1623
- });
1624
- },
1625
- ArrowUp: function(N) {
1626
- N.preventDefault(), u({
1627
- type: Rt,
1628
- altKey: N.altKey
1629
- });
1630
- },
1631
- Home: function(N) {
1632
- _.current.state.isOpen && (N.preventDefault(), u({
1633
- type: Mt
1634
- }));
1635
- },
1636
- End: function(N) {
1637
- _.current.state.isOpen && (N.preventDefault(), u({
1638
- type: kt
1639
- }));
1640
- },
1641
- Escape: function(N) {
1642
- var T = _.current.state;
1643
- (T.isOpen || T.inputValue || T.selectedItem || T.highlightedIndex > -1) && (N.preventDefault(), u({
1644
- type: Pt
1645
- }));
1646
- },
1647
- Enter: function(N) {
1648
- var T = _.current.state;
1649
- !T.isOpen || N.which === 229 || (N.preventDefault(), u({
1650
- type: At
1651
- }));
1652
- },
1653
- PageUp: function(N) {
1654
- _.current.state.isOpen && (N.preventDefault(), u({
1655
- type: Tt
1656
- }));
1657
- },
1658
- PageDown: function(N) {
1659
- _.current.state.isOpen && (N.preventDefault(), u({
1660
- type: Vt
1661
- }));
1662
- }
1663
- };
1664
- }, [u, _]), P = ee(function(D) {
1665
- return j({
1666
- id: p.labelId,
1667
- htmlFor: p.inputId
1668
- }, D);
1669
- }, [p]), V = ee(function(D, N) {
1670
- var T, y = D === void 0 ? {} : D, B = y.onMouseLeave, L = y.refKey, F = L === void 0 ? "ref" : L, ne = y.ref, se = ge(y, Ko), ae = N === void 0 ? {} : N, x = ae.suppressRefError, pe = x === void 0 ? !1 : x;
1671
- return R("getMenuProps", pe, F, S), j((T = {}, T[F] = Oe(ne, function(ie) {
1672
- S.current = ie;
1673
- }), T.id = p.menuId, T.role = "listbox", T["aria-labelledby"] = se && se["aria-label"] ? void 0 : "" + p.labelId, T.onMouseLeave = oe(B, function() {
1674
- u({
1675
- type: nr
1676
- });
1677
- }), T), se);
1678
- }, [u, R, p]), K = ee(function(D) {
1679
- var N, T, y = D === void 0 ? {} : D, B = y.item, L = y.index, F = y.refKey, ne = F === void 0 ? "ref" : F, se = y.ref, ae = y.onMouseMove, x = y.onMouseDown, pe = y.onClick;
1680
- y.onPress;
1681
- var ie = y.disabled, ke = ge(y, jo);
1682
- ie !== void 0 && console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');
1683
- var Fe = _.current, Xe = Fe.props, be = Fe.state, Je = Qn(B, L, Xe.items, "Pass either item or index to getItemProps!"), dt = Je[0], xe = Je[1], Le = Xe.isItemDisabled(dt, xe), ct = "onClick", Qe = pe, Ee = function() {
1684
- A.isTouchEnd || xe === be.highlightedIndex || (O.current = !1, u({
1685
- type: rr,
1686
- index: xe,
1687
- disabled: Le
1688
- }));
1689
- }, Ne = function() {
1690
- u({
1691
- type: jt,
1692
- index: xe
1693
- });
1694
- }, Ce = function(br) {
1695
- return br.preventDefault();
1696
- };
1697
- return j((N = {}, N[ne] = Oe(se, function(ve) {
1698
- ve && (g.current[p.getItemId(xe)] = ve);
1699
- }), N["aria-disabled"] = Le, N["aria-selected"] = "" + (xe === be.highlightedIndex), N.id = p.getItemId(xe), N.role = "option", N), !Le && (T = {}, T[ct] = oe(Qe, Ne), T), {
1700
- onMouseMove: oe(ae, Ee),
1701
- onMouseDown: oe(x, Ce)
1702
- }, ke);
1703
- }, [u, p, _, A, O]), z = ee(function(D) {
1704
- var N, T = D === void 0 ? {} : D, y = T.onClick;
1705
- T.onPress;
1706
- var B = T.refKey, L = B === void 0 ? "ref" : B, F = T.ref, ne = ge(T, $o), se = _.current.state, ae = function() {
1707
- u({
1708
- type: or
1709
- });
1710
- };
1711
- return j((N = {}, N[L] = Oe(F, function(x) {
1712
- c.current = x;
1713
- }), N["aria-controls"] = p.menuId, N["aria-expanded"] = se.isOpen, N.id = p.toggleButtonId, N.tabIndex = -1, N), !ne.disabled && j({}, {
1714
- onClick: oe(y, ae)
1715
- }), ne);
1716
- }, [u, _, p]), W = ee(function(D, N) {
1717
- var T, y = D === void 0 ? {} : D, B = y.onKeyDown, L = y.onChange, F = y.onInput, ne = y.onBlur;
1718
- y.onChangeText;
1719
- var se = y.onClick, ae = y.refKey, x = ae === void 0 ? "ref" : ae, pe = y.ref, ie = ge(y, Fo), ke = N === void 0 ? {} : N, Fe = ke.suppressRefError, Xe = Fe === void 0 ? !1 : Fe;
1720
- R("getInputProps", Xe, x, M);
1721
- var be = _.current.state, Je = function(Ce) {
1722
- var ve = ze(Ce);
1723
- ve && C[ve] && C[ve](Ce);
1724
- }, dt = function(Ce) {
1725
- u({
1726
- type: Ht,
1727
- inputValue: Ce.target.value
1728
- });
1729
- }, xe = function(Ce) {
1730
- if (o != null && o.document && be.isOpen && !A.isMouseDown) {
1731
- var ve = Ce.relatedTarget === null && o.document.activeElement !== o.document.body;
1732
- u({
1733
- type: at,
1734
- selectItem: !ve
1735
- });
1736
- }
1737
- }, Le = function() {
1738
- u({
1739
- type: Kt
1740
- });
1741
- }, ct = "onChange", Qe = {};
1742
- if (!ie.disabled) {
1743
- var Ee;
1744
- Qe = (Ee = {}, Ee[ct] = oe(L, F, dt), Ee.onKeyDown = oe(B, Je), Ee.onBlur = oe(ne, xe), Ee.onClick = oe(se, Le), Ee);
1745
- }
1746
- return j((T = {}, T[x] = Oe(pe, function(Ne) {
1747
- M.current = Ne;
1748
- }), T["aria-activedescendant"] = be.isOpen && be.highlightedIndex > -1 ? p.getItemId(be.highlightedIndex) : "", T["aria-autocomplete"] = "list", T["aria-controls"] = p.menuId, T["aria-expanded"] = be.isOpen, T["aria-labelledby"] = ie && ie["aria-label"] ? void 0 : p.labelId, T.autoComplete = "off", T.id = p.inputId, T.role = "combobox", T.value = be.inputValue, T), Qe, ie);
1749
- }, [u, p, o, C, _, A, R]), $ = ee(function() {
1750
- u({
1751
- type: ir
1752
- });
1753
- }, [u]), X = ee(function() {
1754
- u({
1755
- type: ar
1756
- });
1757
- }, [u]), Q = ee(function() {
1758
- u({
1759
- type: sr
1760
- });
1761
- }, [u]), q = ee(function(D) {
1762
- u({
1763
- type: lr,
1764
- highlightedIndex: D
1765
- });
1766
- }, [u]), H = ee(function(D) {
1767
- u({
1768
- type: $t,
1769
- selectedItem: D
1770
- });
1771
- }, [u]), U = ee(function(D) {
1772
- u({
1773
- type: ur,
1774
- inputValue: D
1775
- });
1776
- }, [u]), J = ee(function() {
1777
- u({
1778
- type: dr
1779
- });
1780
- }, [u]);
1781
- return {
1782
- // prop getters.
1783
- getItemProps: K,
1784
- getLabelProps: P,
1785
- getMenuProps: V,
1786
- getInputProps: W,
1787
- getToggleButtonProps: z,
1788
- // actions.
1789
- toggleMenu: $,
1790
- openMenu: Q,
1791
- closeMenu: X,
1792
- setHighlightedIndex: q,
1793
- setInputValue: U,
1794
- selectItem: H,
1795
- reset: J,
1796
- // state.
1797
- highlightedIndex: w,
1798
- isOpen: h,
1799
- selectedItem: b,
1800
- inputValue: I
1801
- };
1802
- }
1803
- var fr = {
1804
- activeIndex: -1,
1805
- selectedItems: []
1806
- };
1807
- function In(e, n) {
1808
- return Ae(e, n, fr);
1809
- }
1810
- function _n(e, n) {
1811
- return _e(e, n, fr);
1812
- }
1813
- function Lo(e) {
1814
- var n = In(e, "activeIndex"), r = In(e, "selectedItems");
1815
- return {
1816
- activeIndex: n,
1817
- selectedItems: r
1818
- };
1819
- }
1820
- function yn(e) {
1821
- if (e.shiftKey || e.metaKey || e.ctrlKey || e.altKey)
1822
- return !1;
1823
- var n = e.target;
1824
- return !(n instanceof HTMLInputElement && // if element is a text input
1825
- n.value !== "" && // and we have text in it
1826
- // and cursor is either not at the start or is currently highlighting text.
1827
- (n.selectionStart !== 0 || n.selectionEnd !== 0));
1828
- }
1829
- function Bo(e) {
1830
- var n = e.removedSelectedItem, r = e.itemToString;
1831
- return r(n) + " has been removed.";
1832
- }
1833
- function Uo(e, n) {
1834
- return e.selectedItems === n.selectedItems && e.activeIndex === n.activeIndex;
1835
- }
1836
- var zo = j({}, er, {
1837
- selectedItems: m.array,
1838
- initialSelectedItems: m.array,
1839
- defaultSelectedItems: m.array,
1840
- getA11yRemovalMessage: m.func,
1841
- activeIndex: m.number,
1842
- initialActiveIndex: m.number,
1843
- defaultActiveIndex: m.number,
1844
- onActiveIndexChange: m.func,
1845
- onSelectedItemsChange: m.func,
1846
- keyNavigationNext: m.string,
1847
- keyNavigationPrevious: m.string
1848
- }), Wo = {
1849
- itemToString: Ve.itemToString,
1850
- itemToKey: Ve.itemToKey,
1851
- stateReducer: Ve.stateReducer,
1852
- environment: Ve.environment,
1853
- getA11yRemovalMessage: Bo,
1854
- keyNavigationNext: "ArrowRight",
1855
- keyNavigationPrevious: "ArrowLeft"
1856
- }, hr = he;
1857
- process.env.NODE_ENV !== "production" && (hr = function(n, r) {
1858
- m.checkPropTypes(zo, n, "prop", r.name);
1859
- });
1860
- var Lt = process.env.NODE_ENV !== "production" ? "__selected_item_click__" : 0, Bt = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_delete__" : 1, Ut = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_backspace__" : 2, zt = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_navigation_next__" : 3, Wt = process.env.NODE_ENV !== "production" ? "__selected_item_keydown_navigation_previous__" : 4, qt = process.env.NODE_ENV !== "production" ? "__dropdown_keydown_navigation_previous__" : 5, Yt = process.env.NODE_ENV !== "production" ? "__dropdown_keydown_backspace__" : 6, Gt = process.env.NODE_ENV !== "production" ? "__dropdown_click__" : 7, Xt = process.env.NODE_ENV !== "production" ? "__function_add_selected_item__" : 8, Jt = process.env.NODE_ENV !== "production" ? "__function_remove_selected_item__" : 9, Qt = process.env.NODE_ENV !== "production" ? "__function_set_selected_items__" : 10, Zt = process.env.NODE_ENV !== "production" ? "__function_set_active_index__" : 11, en = process.env.NODE_ENV !== "production" ? "__function_reset__" : 12, qo = /* @__PURE__ */ Object.freeze({
1861
- __proto__: null,
1862
- SelectedItemClick: Lt,
1863
- SelectedItemKeyDownDelete: Bt,
1864
- SelectedItemKeyDownBackspace: Ut,
1865
- SelectedItemKeyDownNavigationNext: zt,
1866
- SelectedItemKeyDownNavigationPrevious: Wt,
1867
- DropdownKeyDownNavigationPrevious: qt,
1868
- DropdownKeyDownBackspace: Yt,
1869
- DropdownClick: Gt,
1870
- FunctionAddSelectedItem: Xt,
1871
- FunctionRemoveSelectedItem: Jt,
1872
- FunctionSetSelectedItems: Qt,
1873
- FunctionSetActiveIndex: Zt,
1874
- FunctionReset: en
1875
- });
1876
- function Yo(e, n) {
1877
- var r = n.type, i = n.index, o = n.props, t = n.selectedItem, s = e.activeIndex, a = e.selectedItems, d;
1878
- switch (r) {
1879
- case Lt:
1880
- d = {
1881
- activeIndex: i
1882
- };
1883
- break;
1884
- case Wt:
1885
- d = {
1886
- activeIndex: s - 1 < 0 ? 0 : s - 1
1887
- };
1888
- break;
1889
- case zt:
1890
- d = {
1891
- activeIndex: s + 1 >= a.length ? -1 : s + 1
1892
- };
1893
- break;
1894
- case Ut:
1895
- case Bt: {
1896
- if (s < 0)
1897
- break;
1898
- var l = s;
1899
- a.length === 1 ? l = -1 : s === a.length - 1 && (l = a.length - 2), d = j({
1900
- selectedItems: [].concat(a.slice(0, s), a.slice(s + 1))
1901
- }, {
1902
- activeIndex: l
1903
- });
1904
- break;
1905
- }
1906
- case qt:
1907
- d = {
1908
- activeIndex: a.length - 1
1909
- };
1910
- break;
1911
- case Yt:
1912
- d = {
1913
- selectedItems: a.slice(0, a.length - 1)
1914
- };
1915
- break;
1916
- case Xt:
1917
- d = {
1918
- selectedItems: [].concat(a, [t])
1919
- };
1920
- break;
1921
- case Gt:
1922
- d = {
1923
- activeIndex: -1
1924
- };
1925
- break;
1926
- case Jt: {
1927
- var u = s, h = a.findIndex(function(I) {
1928
- return o.itemToKey(I) === o.itemToKey(t);
1929
- });
1930
- if (h < 0)
1931
- break;
1932
- a.length === 1 ? u = -1 : h === a.length - 1 && (u = a.length - 2), d = {
1933
- selectedItems: [].concat(a.slice(0, h), a.slice(h + 1)),
1934
- activeIndex: u
1935
- };
1936
- break;
1937
- }
1938
- case Qt: {
1939
- var w = n.selectedItems;
1940
- d = {
1941
- selectedItems: w
1942
- };
1943
- break;
1944
- }
1945
- case Zt: {
1946
- var b = n.activeIndex;
1947
- d = {
1948
- activeIndex: b
1949
- };
1950
- break;
1951
- }
1952
- case en:
1953
- d = {
1954
- activeIndex: _n(o, "activeIndex"),
1955
- selectedItems: _n(o, "selectedItems")
1956
- };
1957
- break;
1958
- default:
1959
- throw new Error("Reducer called without proper action type.");
1960
- }
1961
- return j({}, e, d);
1962
- }
1963
- var Go = ["refKey", "ref", "onClick", "onKeyDown", "selectedItem", "index"], Xo = ["refKey", "ref", "onKeyDown", "onClick", "preventKeyAction"];
1964
- Se.stateChangeTypes = qo;
1965
- function Se(e) {
1966
- e === void 0 && (e = {}), hr(e, Se);
1967
- var n = j({}, Wo, e), r = n.getA11yRemovalMessage, i = n.itemToString, o = n.environment, t = n.keyNavigationNext, s = n.keyNavigationPrevious, a = So(Yo, n, Lo, Uo), d = a[0], l = a[1], u = d.activeIndex, h = d.selectedItems, w = qe(), b = te(null), I = te(h), S = te();
1968
- S.current = [];
1969
- var g = St({
1970
- state: d,
1971
- props: n
1972
- });
1973
- le(function() {
1974
- if (!(w || !(o != null && o.document))) {
1975
- if (h.length < I.current.length) {
1976
- var C = I.current.find(function(P) {
1977
- return h.findIndex(function(V) {
1978
- return n.itemToKey(V) === n.itemToKey(P);
1979
- }) < 0;
1980
- });
1981
- Et(r({
1982
- itemToString: i,
1983
- resultCount: h.length,
1984
- removedSelectedItem: C,
1985
- activeIndex: u,
1986
- activeSelectedItem: h[u]
1987
- }), o.document);
1988
- }
1989
- I.current = h;
1990
- }
1991
- }, [h.length]), le(function() {
1992
- w || (u === -1 && b.current ? b.current.focus() : S.current[u] && S.current[u].focus());
1993
- }, [u]), Dt({
1994
- props: n,
1995
- state: d
1996
- });
1997
- var M = Ot("getDropdownProps"), c = Ke(function() {
1998
- var C;
1999
- return C = {}, C[s] = function() {
2000
- l({
2001
- type: Wt
2002
- });
2003
- }, C[t] = function() {
2004
- l({
2005
- type: zt
2006
- });
2007
- }, C.Delete = function() {
2008
- l({
2009
- type: Bt
2010
- });
2011
- }, C.Backspace = function() {
2012
- l({
2013
- type: Ut
2014
- });
2015
- }, C;
2016
- }, [l, t, s]), f = Ke(function() {
2017
- var C;
2018
- return C = {}, C[s] = function(P) {
2019
- yn(P) && l({
2020
- type: qt
2021
- });
2022
- }, C.Backspace = function(V) {
2023
- yn(V) && l({
2024
- type: Yt
2025
- });
2026
- }, C;
2027
- }, [l, s]), p = ee(function(C) {
2028
- var P, V = C === void 0 ? {} : C, K = V.refKey, z = K === void 0 ? "ref" : K, W = V.ref, $ = V.onClick, X = V.onKeyDown, Q = V.selectedItem, q = V.index, H = ge(V, Go), U = g.current.state, J = Qn(Q, q, U.selectedItems, "Pass either item or index to getSelectedItemProps!"), D = J[1], N = D > -1 && D === U.activeIndex, T = function() {
2029
- l({
2030
- type: Lt,
2031
- index: D
2032
- });
2033
- }, y = function(L) {
2034
- var F = ze(L);
2035
- F && c[F] && c[F](L);
2036
- };
2037
- return j((P = {}, P[z] = Oe(W, function(B) {
2038
- B && S.current.push(B);
2039
- }), P.tabIndex = N ? 0 : -1, P.onClick = oe($, T), P.onKeyDown = oe(X, y), P), H);
2040
- }, [l, g, c]), v = ee(function(C, P) {
2041
- var V, K = C === void 0 ? {} : C, z = K.refKey, W = z === void 0 ? "ref" : z, $ = K.ref, X = K.onKeyDown, Q = K.onClick, q = K.preventKeyAction, H = q === void 0 ? !1 : q, U = ge(K, Xo), J = P === void 0 ? {} : P, D = J.suppressRefError, N = D === void 0 ? !1 : D;
2042
- M("getDropdownProps", N, W, b);
2043
- var T = function(L) {
2044
- var F = ze(L);
2045
- F && f[F] && f[F](L);
2046
- }, y = function() {
2047
- l({
2048
- type: Gt
2049
- });
2050
- };
2051
- return j((V = {}, V[W] = Oe($, function(B) {
2052
- B && (b.current = B);
2053
- }), V), !H && {
2054
- onKeyDown: oe(X, T),
2055
- onClick: oe(Q, y)
2056
- }, U);
2057
- }, [l, f, M]), _ = ee(function(C) {
2058
- l({
2059
- type: Xt,
2060
- selectedItem: C
2061
- });
2062
- }, [l]), k = ee(function(C) {
2063
- l({
2064
- type: Jt,
2065
- selectedItem: C
2066
- });
2067
- }, [l]), O = ee(function(C) {
2068
- l({
2069
- type: Qt,
2070
- selectedItems: C
2071
- });
2072
- }, [l]), A = ee(function(C) {
2073
- l({
2074
- type: Zt,
2075
- activeIndex: C
2076
- });
2077
- }, [l]), R = ee(function() {
2078
- l({
2079
- type: en
2080
- });
2081
- }, [l]);
2082
- return {
2083
- getSelectedItemProps: p,
2084
- getDropdownProps: v,
2085
- addSelectedItem: _,
2086
- removeSelectedItem: k,
2087
- setSelectedItems: O,
2088
- setActiveIndex: A,
2089
- reset: R,
2090
- selectedItems: h,
2091
- activeIndex: u
2092
- };
2093
- }
2094
- var lt = { exports: {} }, gr = {
2095
- À: "A",
2096
- Á: "A",
2097
- Â: "A",
2098
- Ã: "A",
2099
- Ä: "A",
2100
- Å: "A",
2101
- Ấ: "A",
2102
- Ắ: "A",
2103
- Ẳ: "A",
2104
- Ẵ: "A",
2105
- Ặ: "A",
2106
- Æ: "AE",
2107
- Ầ: "A",
2108
- Ằ: "A",
2109
- Ȃ: "A",
2110
- Ả: "A",
2111
- Ạ: "A",
2112
- Ẩ: "A",
2113
- Ẫ: "A",
2114
- Ậ: "A",
2115
- Ç: "C",
2116
- Ḉ: "C",
2117
- È: "E",
2118
- É: "E",
2119
- Ê: "E",
2120
- Ë: "E",
2121
- Ế: "E",
2122
- Ḗ: "E",
2123
- Ề: "E",
2124
- Ḕ: "E",
2125
- Ḝ: "E",
2126
- Ȇ: "E",
2127
- Ẻ: "E",
2128
- Ẽ: "E",
2129
- Ẹ: "E",
2130
- Ể: "E",
2131
- Ễ: "E",
2132
- Ệ: "E",
2133
- Ì: "I",
2134
- Í: "I",
2135
- Î: "I",
2136
- Ï: "I",
2137
- Ḯ: "I",
2138
- Ȋ: "I",
2139
- Ỉ: "I",
2140
- Ị: "I",
2141
- Ð: "D",
2142
- Ñ: "N",
2143
- Ò: "O",
2144
- Ó: "O",
2145
- Ô: "O",
2146
- Õ: "O",
2147
- Ö: "O",
2148
- Ø: "O",
2149
- Ố: "O",
2150
- Ṍ: "O",
2151
- Ṓ: "O",
2152
- Ȏ: "O",
2153
- Ỏ: "O",
2154
- Ọ: "O",
2155
- Ổ: "O",
2156
- Ỗ: "O",
2157
- Ộ: "O",
2158
- Ờ: "O",
2159
- Ở: "O",
2160
- Ỡ: "O",
2161
- Ớ: "O",
2162
- Ợ: "O",
2163
- Ù: "U",
2164
- Ú: "U",
2165
- Û: "U",
2166
- Ü: "U",
2167
- Ủ: "U",
2168
- Ụ: "U",
2169
- Ử: "U",
2170
- Ữ: "U",
2171
- Ự: "U",
2172
- Ý: "Y",
2173
- à: "a",
2174
- á: "a",
2175
- â: "a",
2176
- ã: "a",
2177
- ä: "a",
2178
- å: "a",
2179
- ấ: "a",
2180
- ắ: "a",
2181
- ẳ: "a",
2182
- ẵ: "a",
2183
- ặ: "a",
2184
- æ: "ae",
2185
- ầ: "a",
2186
- ằ: "a",
2187
- ȃ: "a",
2188
- ả: "a",
2189
- ạ: "a",
2190
- ẩ: "a",
2191
- ẫ: "a",
2192
- ậ: "a",
2193
- ç: "c",
2194
- ḉ: "c",
2195
- è: "e",
2196
- é: "e",
2197
- ê: "e",
2198
- ë: "e",
2199
- ế: "e",
2200
- ḗ: "e",
2201
- ề: "e",
2202
- ḕ: "e",
2203
- ḝ: "e",
2204
- ȇ: "e",
2205
- ẻ: "e",
2206
- ẽ: "e",
2207
- ẹ: "e",
2208
- ể: "e",
2209
- ễ: "e",
2210
- ệ: "e",
2211
- ì: "i",
2212
- í: "i",
2213
- î: "i",
2214
- ï: "i",
2215
- ḯ: "i",
2216
- ȋ: "i",
2217
- ỉ: "i",
2218
- ị: "i",
2219
- ð: "d",
2220
- ñ: "n",
2221
- ò: "o",
2222
- ó: "o",
2223
- ô: "o",
2224
- õ: "o",
2225
- ö: "o",
2226
- ø: "o",
2227
- ố: "o",
2228
- ṍ: "o",
2229
- ṓ: "o",
2230
- ȏ: "o",
2231
- ỏ: "o",
2232
- ọ: "o",
2233
- ổ: "o",
2234
- ỗ: "o",
2235
- ộ: "o",
2236
- ờ: "o",
2237
- ở: "o",
2238
- ỡ: "o",
2239
- ớ: "o",
2240
- ợ: "o",
2241
- ù: "u",
2242
- ú: "u",
2243
- û: "u",
2244
- ü: "u",
2245
- ủ: "u",
2246
- ụ: "u",
2247
- ử: "u",
2248
- ữ: "u",
2249
- ự: "u",
2250
- ý: "y",
2251
- ÿ: "y",
2252
- Ā: "A",
2253
- ā: "a",
2254
- Ă: "A",
2255
- ă: "a",
2256
- Ą: "A",
2257
- ą: "a",
2258
- Ć: "C",
2259
- ć: "c",
2260
- Ĉ: "C",
2261
- ĉ: "c",
2262
- Ċ: "C",
2263
- ċ: "c",
2264
- Č: "C",
2265
- č: "c",
2266
- C̆: "C",
2267
- c̆: "c",
2268
- Ď: "D",
2269
- ď: "d",
2270
- Đ: "D",
2271
- đ: "d",
2272
- Ē: "E",
2273
- ē: "e",
2274
- Ĕ: "E",
2275
- ĕ: "e",
2276
- Ė: "E",
2277
- ė: "e",
2278
- Ę: "E",
2279
- ę: "e",
2280
- Ě: "E",
2281
- ě: "e",
2282
- Ĝ: "G",
2283
- Ǵ: "G",
2284
- ĝ: "g",
2285
- ǵ: "g",
2286
- Ğ: "G",
2287
- ğ: "g",
2288
- Ġ: "G",
2289
- ġ: "g",
2290
- Ģ: "G",
2291
- ģ: "g",
2292
- Ĥ: "H",
2293
- ĥ: "h",
2294
- Ħ: "H",
2295
- ħ: "h",
2296
- Ḫ: "H",
2297
- ḫ: "h",
2298
- Ĩ: "I",
2299
- ĩ: "i",
2300
- Ī: "I",
2301
- ī: "i",
2302
- Ĭ: "I",
2303
- ĭ: "i",
2304
- Į: "I",
2305
- į: "i",
2306
- İ: "I",
2307
- ı: "i",
2308
- IJ: "IJ",
2309
- ij: "ij",
2310
- Ĵ: "J",
2311
- ĵ: "j",
2312
- Ķ: "K",
2313
- ķ: "k",
2314
- Ḱ: "K",
2315
- ḱ: "k",
2316
- K̆: "K",
2317
- k̆: "k",
2318
- Ĺ: "L",
2319
- ĺ: "l",
2320
- Ļ: "L",
2321
- ļ: "l",
2322
- Ľ: "L",
2323
- ľ: "l",
2324
- Ŀ: "L",
2325
- ŀ: "l",
2326
- Ł: "l",
2327
- ł: "l",
2328
- Ḿ: "M",
2329
- ḿ: "m",
2330
- M̆: "M",
2331
- m̆: "m",
2332
- Ń: "N",
2333
- ń: "n",
2334
- Ņ: "N",
2335
- ņ: "n",
2336
- Ň: "N",
2337
- ň: "n",
2338
- ʼn: "n",
2339
- N̆: "N",
2340
- n̆: "n",
2341
- Ō: "O",
2342
- ō: "o",
2343
- Ŏ: "O",
2344
- ŏ: "o",
2345
- Ő: "O",
2346
- ő: "o",
2347
- Œ: "OE",
2348
- œ: "oe",
2349
- P̆: "P",
2350
- p̆: "p",
2351
- Ŕ: "R",
2352
- ŕ: "r",
2353
- Ŗ: "R",
2354
- ŗ: "r",
2355
- Ř: "R",
2356
- ř: "r",
2357
- R̆: "R",
2358
- r̆: "r",
2359
- Ȓ: "R",
2360
- ȓ: "r",
2361
- Ś: "S",
2362
- ś: "s",
2363
- Ŝ: "S",
2364
- ŝ: "s",
2365
- Ş: "S",
2366
- Ș: "S",
2367
- ș: "s",
2368
- ş: "s",
2369
- Š: "S",
2370
- š: "s",
2371
- Ţ: "T",
2372
- ţ: "t",
2373
- ț: "t",
2374
- Ț: "T",
2375
- Ť: "T",
2376
- ť: "t",
2377
- Ŧ: "T",
2378
- ŧ: "t",
2379
- T̆: "T",
2380
- t̆: "t",
2381
- Ũ: "U",
2382
- ũ: "u",
2383
- Ū: "U",
2384
- ū: "u",
2385
- Ŭ: "U",
2386
- ŭ: "u",
2387
- Ů: "U",
2388
- ů: "u",
2389
- Ű: "U",
2390
- ű: "u",
2391
- Ų: "U",
2392
- ų: "u",
2393
- Ȗ: "U",
2394
- ȗ: "u",
2395
- V̆: "V",
2396
- v̆: "v",
2397
- Ŵ: "W",
2398
- ŵ: "w",
2399
- Ẃ: "W",
2400
- ẃ: "w",
2401
- X̆: "X",
2402
- x̆: "x",
2403
- Ŷ: "Y",
2404
- ŷ: "y",
2405
- Ÿ: "Y",
2406
- Y̆: "Y",
2407
- y̆: "y",
2408
- Ź: "Z",
2409
- ź: "z",
2410
- Ż: "Z",
2411
- ż: "z",
2412
- Ž: "Z",
2413
- ž: "z",
2414
- ſ: "s",
2415
- ƒ: "f",
2416
- Ơ: "O",
2417
- ơ: "o",
2418
- Ư: "U",
2419
- ư: "u",
2420
- Ǎ: "A",
2421
- ǎ: "a",
2422
- Ǐ: "I",
2423
- ǐ: "i",
2424
- Ǒ: "O",
2425
- ǒ: "o",
2426
- Ǔ: "U",
2427
- ǔ: "u",
2428
- Ǖ: "U",
2429
- ǖ: "u",
2430
- Ǘ: "U",
2431
- ǘ: "u",
2432
- Ǚ: "U",
2433
- ǚ: "u",
2434
- Ǜ: "U",
2435
- ǜ: "u",
2436
- Ứ: "U",
2437
- ứ: "u",
2438
- Ṹ: "U",
2439
- ṹ: "u",
2440
- Ǻ: "A",
2441
- ǻ: "a",
2442
- Ǽ: "AE",
2443
- ǽ: "ae",
2444
- Ǿ: "O",
2445
- ǿ: "o",
2446
- Þ: "TH",
2447
- þ: "th",
2448
- Ṕ: "P",
2449
- ṕ: "p",
2450
- Ṥ: "S",
2451
- ṥ: "s",
2452
- X́: "X",
2453
- x́: "x",
2454
- Ѓ: "Г",
2455
- ѓ: "г",
2456
- Ќ: "К",
2457
- ќ: "к",
2458
- A̋: "A",
2459
- a̋: "a",
2460
- E̋: "E",
2461
- e̋: "e",
2462
- I̋: "I",
2463
- i̋: "i",
2464
- Ǹ: "N",
2465
- ǹ: "n",
2466
- Ồ: "O",
2467
- ồ: "o",
2468
- Ṑ: "O",
2469
- ṑ: "o",
2470
- Ừ: "U",
2471
- ừ: "u",
2472
- Ẁ: "W",
2473
- ẁ: "w",
2474
- Ỳ: "Y",
2475
- ỳ: "y",
2476
- Ȁ: "A",
2477
- ȁ: "a",
2478
- Ȅ: "E",
2479
- ȅ: "e",
2480
- Ȉ: "I",
2481
- ȉ: "i",
2482
- Ȍ: "O",
2483
- ȍ: "o",
2484
- Ȑ: "R",
2485
- ȑ: "r",
2486
- Ȕ: "U",
2487
- ȕ: "u",
2488
- B̌: "B",
2489
- b̌: "b",
2490
- Č̣: "C",
2491
- č̣: "c",
2492
- Ê̌: "E",
2493
- ê̌: "e",
2494
- F̌: "F",
2495
- f̌: "f",
2496
- Ǧ: "G",
2497
- ǧ: "g",
2498
- Ȟ: "H",
2499
- ȟ: "h",
2500
- J̌: "J",
2501
- ǰ: "j",
2502
- Ǩ: "K",
2503
- ǩ: "k",
2504
- M̌: "M",
2505
- m̌: "m",
2506
- P̌: "P",
2507
- p̌: "p",
2508
- Q̌: "Q",
2509
- q̌: "q",
2510
- Ř̩: "R",
2511
- ř̩: "r",
2512
- Ṧ: "S",
2513
- ṧ: "s",
2514
- V̌: "V",
2515
- v̌: "v",
2516
- W̌: "W",
2517
- w̌: "w",
2518
- X̌: "X",
2519
- x̌: "x",
2520
- Y̌: "Y",
2521
- y̌: "y",
2522
- A̧: "A",
2523
- a̧: "a",
2524
- B̧: "B",
2525
- b̧: "b",
2526
- Ḑ: "D",
2527
- ḑ: "d",
2528
- Ȩ: "E",
2529
- ȩ: "e",
2530
- Ɛ̧: "E",
2531
- ɛ̧: "e",
2532
- Ḩ: "H",
2533
- ḩ: "h",
2534
- I̧: "I",
2535
- i̧: "i",
2536
- Ɨ̧: "I",
2537
- ɨ̧: "i",
2538
- M̧: "M",
2539
- m̧: "m",
2540
- O̧: "O",
2541
- o̧: "o",
2542
- Q̧: "Q",
2543
- q̧: "q",
2544
- U̧: "U",
2545
- u̧: "u",
2546
- X̧: "X",
2547
- x̧: "x",
2548
- Z̧: "Z",
2549
- z̧: "z",
2550
- й: "и",
2551
- Й: "И",
2552
- ё: "е",
2553
- Ё: "Е"
2554
- }, mr = Object.keys(gr).join("|"), Jo = new RegExp(mr, "g"), Qo = new RegExp(mr, "");
2555
- function Zo(e) {
2556
- return gr[e];
2557
- }
2558
- var vr = function(e) {
2559
- return e.replace(Jo, Zo);
2560
- }, ei = function(e) {
2561
- return !!e.match(Qo);
2562
- };
2563
- lt.exports = vr;
2564
- lt.exports.has = ei;
2565
- lt.exports.remove = vr;
2566
- var ti = lt.exports;
2567
- const ni = /* @__PURE__ */ Xr(ti);
2568
- /**
2569
- * @name match-sorter
2570
- * @license MIT license.
2571
- * @copyright (c) 2020 Kent C. Dodds
2572
- * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
2573
- */
2574
- const ce = {
2575
- CASE_SENSITIVE_EQUAL: 7,
2576
- EQUAL: 6,
2577
- STARTS_WITH: 5,
2578
- WORD_STARTS_WITH: 4,
2579
- CONTAINS: 3,
2580
- ACRONYM: 2,
2581
- MATCHES: 1,
2582
- NO_MATCH: 0
2583
- }, ri = (e, n) => String(e.rankedValue).localeCompare(String(n.rankedValue));
2584
- function tn(e, n, r) {
2585
- r === void 0 && (r = {});
2586
- const {
2587
- keys: i,
2588
- threshold: o = ce.MATCHES,
2589
- baseSort: t = ri,
2590
- sorter: s = (l) => l.sort((u, h) => ai(u, h, t))
2591
- } = r, a = e.reduce(d, []);
2592
- return s(a).map((l) => {
2593
- let {
2594
- item: u
2595
- } = l;
2596
- return u;
2597
- });
2598
- function d(l, u, h) {
2599
- const w = oi(u, i, n, r), {
2600
- rank: b,
2601
- keyThreshold: I = o
2602
- } = w;
2603
- return b >= I && l.push({
2604
- ...w,
2605
- item: u,
2606
- index: h
2607
- }), l;
2608
- }
2609
- }
2610
- tn.rankings = ce;
2611
- function oi(e, n, r, i) {
2612
- if (!n) {
2613
- const t = e;
2614
- return {
2615
- // ends up being duplicate of 'item' in matches but consistent
2616
- rankedValue: t,
2617
- rank: bn(t, r, i),
2618
- keyIndex: -1,
2619
- keyThreshold: i.threshold
2620
- };
2621
- }
2622
- return di(e, n).reduce((t, s, a) => {
2623
- let {
2624
- rank: d,
2625
- rankedValue: l,
2626
- keyIndex: u,
2627
- keyThreshold: h
2628
- } = t, {
2629
- itemValue: w,
2630
- attributes: b
2631
- } = s, I = bn(w, r, i), S = l;
2632
- const {
2633
- minRanking: g,
2634
- maxRanking: M,
2635
- threshold: c
2636
- } = b;
2637
- return I < g && I >= ce.MATCHES ? I = g : I > M && (I = M), I > d && (d = I, u = a, h = c, S = w), {
2638
- rankedValue: S,
2639
- rank: d,
2640
- keyIndex: u,
2641
- keyThreshold: h
2642
- };
2643
- }, {
2644
- rankedValue: e,
2645
- rank: ce.NO_MATCH,
2646
- keyIndex: -1,
2647
- keyThreshold: i.threshold
2648
- });
2649
- }
2650
- function bn(e, n, r) {
2651
- return e = xn(e, r), n = xn(n, r), n.length > e.length ? ce.NO_MATCH : e === n ? ce.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), n = n.toLowerCase(), e === n ? ce.EQUAL : e.startsWith(n) ? ce.STARTS_WITH : e.includes(` ${n}`) ? ce.WORD_STARTS_WITH : e.includes(n) ? ce.CONTAINS : n.length === 1 ? ce.NO_MATCH : ii(e).includes(n) ? ce.ACRONYM : si(e, n));
2652
- }
2653
- function ii(e) {
2654
- let n = "";
2655
- return e.split(" ").forEach((i) => {
2656
- i.split("-").forEach((t) => {
2657
- n += t.substr(0, 1);
2658
- });
2659
- }), n;
2660
- }
2661
- function si(e, n) {
2662
- let r = 0, i = 0;
2663
- function o(d, l, u) {
2664
- for (let h = u, w = l.length; h < w; h++)
2665
- if (l[h] === d)
2666
- return r += 1, h + 1;
2667
- return -1;
2668
- }
2669
- function t(d) {
2670
- const l = 1 / d, u = r / n.length;
2671
- return ce.MATCHES + u * l;
2672
- }
2673
- const s = o(n[0], e, 0);
2674
- if (s < 0)
2675
- return ce.NO_MATCH;
2676
- i = s;
2677
- for (let d = 1, l = n.length; d < l; d++) {
2678
- const u = n[d];
2679
- if (i = o(u, e, i), !(i > -1))
2680
- return ce.NO_MATCH;
2681
- }
2682
- const a = i - s;
2683
- return t(a);
2684
- }
2685
- function ai(e, n, r) {
2686
- const {
2687
- rank: t,
2688
- keyIndex: s
2689
- } = e, {
2690
- rank: a,
2691
- keyIndex: d
2692
- } = n;
2693
- return t === a ? s === d ? r(e, n) : s < d ? -1 : 1 : t > a ? -1 : 1;
2694
- }
2695
- function xn(e, n) {
2696
- let {
2697
- keepDiacritics: r
2698
- } = n;
2699
- return e = `${e}`, r || (e = ni(e)), e;
2700
- }
2701
- function li(e, n) {
2702
- typeof n == "object" && (n = n.key);
2703
- let r;
2704
- if (typeof n == "function")
2705
- r = n(e);
2706
- else if (e == null)
2707
- r = null;
2708
- else if (Object.hasOwnProperty.call(e, n))
2709
- r = e[n];
2710
- else {
2711
- if (n.includes("."))
2712
- return ui(n, e);
2713
- r = null;
2714
- }
2715
- return r == null ? [] : Array.isArray(r) ? r : [String(r)];
2716
- }
2717
- function ui(e, n) {
2718
- const r = e.split(".");
2719
- let i = [n];
2720
- for (let o = 0, t = r.length; o < t; o++) {
2721
- const s = r[o];
2722
- let a = [];
2723
- for (let d = 0, l = i.length; d < l; d++) {
2724
- const u = i[d];
2725
- if (u != null)
2726
- if (Object.hasOwnProperty.call(u, s)) {
2727
- const h = u[s];
2728
- h != null && a.push(h);
2729
- } else
2730
- s === "*" && (a = a.concat(u));
2731
- }
2732
- i = a;
2733
- }
2734
- return Array.isArray(i[0]) ? [].concat(...i) : i;
2735
- }
2736
- function di(e, n) {
2737
- const r = [];
2738
- for (let i = 0, o = n.length; i < o; i++) {
2739
- const t = n[i], s = ci(t), a = li(e, t);
2740
- for (let d = 0, l = a.length; d < l; d++)
2741
- r.push({
2742
- itemValue: a[d],
2743
- attributes: s
2744
- });
2745
- }
2746
- return r;
2747
- }
2748
- const wn = {
2749
- maxRanking: 1 / 0,
2750
- minRanking: -1 / 0
2751
- };
2752
- function ci(e) {
2753
- return typeof e == "string" ? wn : {
2754
- ...wn,
2755
- ...e
2756
- };
2757
- }
2758
- function pi({
2759
- defaultOpen: e,
2760
- placement: n = "bottom",
2761
- modal: r,
2762
- open: i,
2763
- onOpenChange: o,
2764
- onClose: t,
2765
- disableCloseOnClickOutside: s,
2766
- disableCloseOnEscape: a,
2767
- openOnHover: d,
2768
- fillAvailableHeight: l,
2769
- matchReferenceWidth: u,
2770
- fixedWidth: h,
2771
- disableCaret: w,
2772
- noPadding: b,
2773
- disableShift: I,
2774
- disableFlip: S,
2775
- disableFlipFallback: g,
2776
- disableAutoUpdate: M,
2777
- disableFocusLock: c,
2778
- root: f
2779
- } = {}) {
2780
- const [p, v] = Z(e), [_, k] = Z(), [O, A] = Z(), R = i ?? p, C = o ?? v, P = te(null), V = Ar({
2781
- placement: n,
2782
- open: R,
2783
- onOpenChange: C,
2784
- whileElementsMounted: M ? void 0 : Hr,
2785
- middleware: [
2786
- Kr(8),
2787
- jr({
2788
- padding: 5,
2789
- apply({ rects: q, availableHeight: H, elements: U }) {
2790
- Object.assign(U.floating.style, {
2791
- ...u ? { width: `${q.reference.width}px` } : h ? { width: "40dvw" } : {},
2792
- ...l ? (
2793
- // { maxHeight: "60dvh" }
2794
- // Minimum height is 236px before flip
2795
- { maxHeight: `${Math.max(236, H - 20)}px` }
2796
- ) : {},
2797
- zIndex: 1
2798
- });
2799
- }
2800
- }),
2801
- $r({
2802
- mainAxis: !S,
2803
- crossAxis: !1,
2804
- fallbackAxisSideDirection: g ? "none" : "end",
2805
- padding: 5
2806
- }),
2807
- Fr({
2808
- padding: 5,
2809
- mainAxis: !I,
2810
- crossAxis: !1,
2811
- limiter: Lr({
2812
- mainAxis: !I
2813
- })
2814
- }),
2815
- Br({ element: w ? null : P, padding: 5 })
2816
- ]
2817
- }), K = V.context, z = Ur(K, {
2818
- enabled: i == null && !d
2819
- }), W = zr(K, {
2820
- enabled: i == null && !!d,
2821
- handleClose: Wr()
2822
- }), $ = qr(K, {
2823
- escapeKey: !a,
2824
- outsidePress: () => s ? !1 : (t == null || t(), !0)
2825
- }), X = Yr(K), Q = Gr([z, W, $, X]);
2826
- return Ke(
2827
- () => ({
2828
- open: R,
2829
- setOpen: C,
2830
- onClose: t,
2831
- ...Q,
2832
- ...V,
2833
- modal: r,
2834
- labelId: _,
2835
- descriptionId: O,
2836
- setLabelId: k,
2837
- setDescriptionId: A,
2838
- arrowRef: P,
2839
- disableCaret: w,
2840
- noPadding: b,
2841
- fillAvailableHeight: l,
2842
- matchReferenceWidth: u,
2843
- fixedWidth: h,
2844
- disableFlipFallback: g,
2845
- disableAutoUpdate: M,
2846
- disableFocusLock: c,
2847
- root: f
2848
- }),
2849
- [
2850
- R,
2851
- C,
2852
- t,
2853
- Q,
2854
- V,
2855
- r,
2856
- _,
2857
- O,
2858
- w,
2859
- b,
2860
- l,
2861
- u,
2862
- h,
2863
- g,
2864
- M,
2865
- c,
2866
- f
2867
- ]
2868
- );
2869
- }
2870
- const Ir = yt(null), Ye = () => {
2871
- const e = De(Ir);
2872
- if (e == null)
2873
- throw new Error("Popover components must be wrapped in <Popover />");
2874
- return e;
2875
- }, fi = function(e) {
2876
- const { children: n } = e, r = Ye(), i = te(null), o = We([r.refs.setReference, i]);
2877
- return n({
2878
- "data-state": r.open ? "open" : "closed",
2879
- "data-anv": "popover-trigger",
2880
- ...r.getReferenceProps({ ref: o })
2881
- });
2882
- }, hi = "_content_x4y1q_4", gi = "_arrow_x4y1q_26", ft = {
2883
- content: hi,
2884
- arrow: gi,
2885
- "no-padding": "_no-padding_x4y1q_37"
2886
- }, mi = ye(
2887
- function({ className: e, style: n, ...r }, i) {
2888
- var o, t;
2889
- const {
2890
- context: s,
2891
- theme: a,
2892
- mode: d,
2893
- disableCaret: l,
2894
- noPadding: u,
2895
- onClose: h,
2896
- disableFocusLock: w,
2897
- root: b,
2898
- ...I
2899
- } = Ye(), S = De(Er), { root: g } = De(Jr), M = We([I.refs.setFloating, i]);
2900
- if (!s.open || S && !((o = S == null ? void 0 : S.ref) != null && o.current))
2901
- return null;
2902
- const c = ue(e, ft.content, {
2903
- [ft["no-padding"]]: u
2904
- }), f = (p) => {
2905
- p.code === "Escape" && (h == null || h());
2906
- };
2907
- return /* @__PURE__ */ E.jsx(kr, { root: ((t = S == null ? void 0 : S.ref) == null ? void 0 : t.current) ?? g ?? b, children: /* @__PURE__ */ E.jsx(
2908
- Tr,
2909
- {
2910
- context: s,
2911
- modal: I.modal,
2912
- order: ["reference", "content"],
2913
- disabled: w,
2914
- children: /* @__PURE__ */ E.jsx(Dr, { theme: a, mode: d, children: /* @__PURE__ */ E.jsxs(
2915
- "div",
2916
- {
2917
- ref: M,
2918
- "data-anv": "popover-content",
2919
- style: { ...I.floatingStyles, ...n },
2920
- "aria-labelledby": I.labelId,
2921
- "aria-describedby": I.descriptionId,
2922
- className: c,
2923
- ...I.getFloatingProps(r),
2924
- onKeyDown: f,
2925
- role: "presentation",
2926
- children: [
2927
- !l && /* @__PURE__ */ E.jsx(
2928
- Vr,
2929
- {
2930
- ref: I.arrowRef,
2931
- context: s,
2932
- className: ft.arrow
2933
- }
2934
- ),
2935
- r.children
2936
- ]
2937
- }
2938
- ) })
2939
- }
2940
- ) });
2941
- }
2942
- ), vi = ye(
2943
- function(e, n) {
2944
- const { setOpen: r, onClose: i } = Ye();
2945
- return /* @__PURE__ */ E.jsx(
2946
- rt,
2947
- {
2948
- ref: n,
2949
- "data-anv": "popover-close",
2950
- ...e,
2951
- onClick: (o) => {
2952
- var t;
2953
- (t = e.onClick) == null || t.call(e, o), i == null || i(), r(!1);
2954
- }
2955
- }
2956
- );
2957
- }
2958
- ), Ii = ye(
2959
- function(e, n) {
2960
- const { children: r, size: i, ...o } = e, t = Ye(), s = r.ref, a = We([
2961
- t.refs.setReference,
2962
- n,
2963
- s
2964
- ]);
2965
- return /* @__PURE__ */ E.jsx(
2966
- rt,
2967
- {
2968
- ref: a,
2969
- size: i,
2970
- "data-state": t.open ? "open" : "closed",
2971
- "data-anv": "popover-button",
2972
- ...t.getReferenceProps(o),
2973
- children: r
2974
- }
2975
- );
2976
- }
2977
- );
2978
- function _i({
2979
- children: e,
2980
- modal: n,
2981
- ...r
2982
- }) {
2983
- const i = pi({ modal: n, ...r }), { theme: o, mode: t = "light" } = De(Nr), s = Ke(
2984
- () => ({ ...i, theme: o, mode: t }),
2985
- [t, i, o]
2986
- );
2987
- return /* @__PURE__ */ E.jsx(Ir.Provider, { value: s, children: e });
2988
- }
2989
- const nn = Object.assign(_i, {
2990
- Trigger: fi,
2991
- Close: vi,
2992
- Content: mi,
2993
- Button: Ii
2994
- }), _r = (e) => /* @__PURE__ */ me.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e }, /* @__PURE__ */ me.createElement("path", { d: "M9.29 6.71a.996.996 0 0 0 0 1.41L13.17 12l-3.88 3.88a.996.996 0 1 0 1.41 1.41l4.59-4.59a.996.996 0 0 0 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01z" })), yi = "_combobox_1jt3w_2", bi = "_input_1jt3w_30", xi = "_error_1jt3w_61", wi = "_small_1jt3w_86", Ei = "_large_1jt3w_89", Ci = "_disabled_1jt3w_113", Si = "_chip_1jt3w_162", Oi = "_prefix_1jt3w_217", Di = "_suffix_1jt3w_218", Ni = "_empty_1jt3w_260", re = {
2995
- combobox: yi,
2996
- "search-field": "_search-field_1jt3w_6",
2997
- "popover-content": "_popover-content_1jt3w_21",
2998
- "input-wrapper": "_input-wrapper_1jt3w_30",
2999
- input: bi,
3000
- error: xi,
3001
- "buttons-wrapper": "_buttons-wrapper_1jt3w_69",
3002
- small: wi,
3003
- large: Ei,
3004
- "close-button-wrapper": "_close-button-wrapper_1jt3w_93",
3005
- "close-button": "_close-button_1jt3w_93",
3006
- "loading-infinite": "_loading-infinite_1jt3w_113",
3007
- "loading-progress": "_loading-progress_1jt3w_113",
3008
- disabled: Ci,
3009
- "toggle-button-wrapper": "_toggle-button-wrapper_1jt3w_117",
3010
- "toggle-button": "_toggle-button_1jt3w_117",
3011
- "rows-wrapper": "_rows-wrapper_1jt3w_151",
3012
- "chip-wrapper": "_chip-wrapper_1jt3w_162",
3013
- chip: Si,
3014
- prefix: Oi,
3015
- suffix: Di,
3016
- "listview-option": "_listview-option_1jt3w_255",
3017
- empty: Ni
3018
- }, rn = yt(null), Ge = function() {
3019
- const e = De(
3020
- rn
3021
- );
3022
- if (e == null)
3023
- throw new Error("useCombobox must be wrapped in <Combobox />");
3024
- return e;
3025
- }, Ri = function(e) {
3026
- const { multiple: n = !1, ...r } = e;
3027
- return n ? /* @__PURE__ */ E.jsx(Mi, { ...r }) : /* @__PURE__ */ E.jsx(Pi, { ...r });
3028
- }, Pi = function(e) {
3029
- const { layoutStyles: n, componentProps: r } = Me(e), {
3030
- className: i,
3031
- style: o,
3032
- children: t,
3033
- open: s,
3034
- items: a,
3035
- itemToString: d,
3036
- onChange: l,
3037
- onSelectedItemChange: u,
3038
- disableCloseOnClickOutside: h = !1,
3039
- filterOptions: w,
3040
- root: b,
3041
- ...I
3042
- } = r, [S, g] = Z(a), [M, c] = Z(!1), [f, p] = Z(!1), [v, _] = Z(!1), [k, O] = Z([]);
3043
- function A(H) {
3044
- return d && H ? d(H) : H ? String(H) : "";
3045
- }
3046
- const {
3047
- isOpen: R,
3048
- getLabelProps: C,
3049
- getInputProps: P,
3050
- getToggleButtonProps: V,
3051
- getMenuProps: K,
3052
- getItemProps: z,
3053
- highlightedIndex: W,
3054
- selectedItem: $,
3055
- selectItem: X,
3056
- setInputValue: Q,
3057
- inputValue: q
3058
- } = fe({
3059
- ...I,
3060
- items: S,
3061
- itemToString(H) {
3062
- return A(H);
3063
- },
3064
- onInputValueChange({ inputValue: H, type: U }) {
3065
- U === fe.stateChangeTypes.InputKeyDownEnter || U === fe.stateChangeTypes.ItemClick ? g(a) : H != null && H !== "" ? g(tn(a, H, w)) : g(a);
3066
- },
3067
- onSelectedItemChange({ selectedItem: H, ...U }) {
3068
- l != null && l(H || null), u != null && u({ selectedItem: H, ...U });
3069
- },
3070
- onIsOpenChange({ isOpen: H, inputValue: U, selectedItem: J }) {
3071
- H === !1 && U === "" ? X(null) : H === !1 && Q(J != null ? A(J) : "");
3072
- },
3073
- stateReducer(H, { type: U, changes: J }) {
3074
- switch (U) {
3075
- case fe.stateChangeTypes.InputBlur:
3076
- return h ? {
3077
- ...J,
3078
- isOpen: H.isOpen,
3079
- highlightedIndex: H.highlightedIndex
3080
- } : J;
3081
- default:
3082
- return J;
3083
- }
3084
- },
3085
- isItemDisabled(H) {
3086
- return M || !!(H && H instanceof Object && "disabled" in H && H.disabled || H && H instanceof Object && "readOnly" in H && H.readOnly || k.includes(H));
3087
- }
3088
- });
3089
- return /* @__PURE__ */ E.jsx(
3090
- rn.Provider,
3091
- {
3092
- value: {
3093
- multiple: !1,
3094
- items: S,
3095
- itemToString: A,
3096
- isOpen: R,
3097
- getLabelProps: C,
3098
- getInputProps: P,
3099
- getToggleButtonProps: V,
3100
- getMenuProps: K,
3101
- getItemProps: z,
3102
- highlightedIndex: W,
3103
- selectedItem: $,
3104
- selectedItems: [],
3105
- disabledItems: k,
3106
- setDisabledItems: O,
3107
- getSelectedItemProps: void 0,
3108
- getDropdownProps: void 0,
3109
- reset: void 0,
3110
- removeSelectedItem: void 0,
3111
- selectItem: X,
3112
- inputValue: q,
3113
- isDisabledOrReadOnly: M,
3114
- setIsDisabledOrReadOnly: c,
3115
- hasDisabledPopover: f,
3116
- setHasDisabledPopover: p,
3117
- hasEmpty: v,
3118
- setHasEmpty: _
3119
- },
3120
- children: /* @__PURE__ */ E.jsx(
3121
- "div",
3122
- {
3123
- className: i,
3124
- "data-anv": "combobox",
3125
- style: { ...o, ...n },
3126
- children: /* @__PURE__ */ E.jsx(
3127
- nn,
3128
- {
3129
- root: b,
3130
- open: s === !0 ? s : R,
3131
- noPadding: !0,
3132
- disableCaret: !0,
3133
- fillAvailableHeight: !0,
3134
- disableFlipFallback: !0,
3135
- matchReferenceWidth: !0,
3136
- children: t
3137
- }
3138
- )
3139
- }
3140
- )
3141
- }
3142
- );
3143
- }, Mi = function(e) {
3144
- const { layoutStyles: n, componentProps: r } = Me(e), {
3145
- className: i,
3146
- style: o,
3147
- children: t,
3148
- open: s,
3149
- items: a,
3150
- itemToString: d,
3151
- onChange: l,
3152
- onSelectedItemChange: u,
3153
- disableCloseOnClickOutside: h = !1,
3154
- filterOptions: w,
3155
- root: b,
3156
- ...I
3157
- } = r, [S, g] = Z(a), [M, c] = Z(!1), [f, p] = Z(!1), [v, _] = Z(!1), [k, O] = Z(""), [A, R] = Z([]), [C, P] = Z([]), { getSelectedItemProps: V, getDropdownProps: K, reset: z, removeSelectedItem: W } = Se({
3158
- selectedItems: A,
3159
- onStateChange({ selectedItems: y, type: B }) {
3160
- switch (B) {
3161
- case Se.stateChangeTypes.SelectedItemKeyDownBackspace:
3162
- case Se.stateChangeTypes.SelectedItemKeyDownDelete:
3163
- case Se.stateChangeTypes.DropdownKeyDownBackspace:
3164
- case Se.stateChangeTypes.FunctionRemoveSelectedItem:
3165
- l != null && l(y ?? []), R(y ?? []);
3166
- break;
3167
- case Se.stateChangeTypes.FunctionReset:
3168
- l != null && l([]), R([]), O("");
3169
- break;
3170
- }
3171
- }
3172
- });
3173
- function $(y) {
3174
- return d && y ? d(y) : y ? String(y) : "";
3175
- }
3176
- const {
3177
- isOpen: X,
3178
- getLabelProps: Q,
3179
- getInputProps: q,
3180
- getToggleButtonProps: H,
3181
- getMenuProps: U,
3182
- getItemProps: J,
3183
- highlightedIndex: D,
3184
- selectedItem: N,
3185
- selectItem: T
3186
- } = fe({
3187
- ...I,
3188
- items: S,
3189
- itemToString(y) {
3190
- return $(y);
3191
- },
3192
- selectedItem: null,
3193
- inputValue: k,
3194
- onInputValueChange({ inputValue: y, type: B }) {
3195
- B === fe.stateChangeTypes.InputKeyDownEnter || B === fe.stateChangeTypes.ItemClick ? g(a) : y != null && y !== "" ? g(tn(a, y, w)) : g(a);
3196
- },
3197
- onIsOpenChange({ isOpen: y }) {
3198
- y === !1 && O("");
3199
- },
3200
- stateReducer(y, { type: B, changes: L }) {
3201
- switch (B) {
3202
- case fe.stateChangeTypes.InputBlur:
3203
- return h ? {
3204
- ...L,
3205
- isOpen: y.isOpen,
3206
- highlightedIndex: y.highlightedIndex
3207
- } : L;
3208
- default:
3209
- return L;
3210
- }
3211
- },
3212
- isItemDisabled(y) {
3213
- return M || !!(y && y instanceof Object && "disabled" in y && y.disabled || y && y instanceof Object && "readOnly" in y && y.readOnly || C.includes(y));
3214
- },
3215
- onStateChange({
3216
- inputValue: y = "",
3217
- type: B,
3218
- selectedItem: L
3219
- }) {
3220
- switch (B) {
3221
- case fe.stateChangeTypes.InputKeyDownEnter:
3222
- case fe.stateChangeTypes.ItemClick:
3223
- case fe.stateChangeTypes.InputBlur:
3224
- if (L) {
3225
- const F = A.includes(L) ? A.filter((ne) => ne !== L) : [...A, L];
3226
- l != null && l(F), R(F), O("");
3227
- }
3228
- break;
3229
- case fe.stateChangeTypes.InputChange:
3230
- O(y);
3231
- break;
3232
- }
3233
- }
3234
- });
3235
- return /* @__PURE__ */ E.jsx(
3236
- rn.Provider,
3237
- {
3238
- value: {
3239
- multiple: !0,
3240
- items: S,
3241
- itemToString: $,
3242
- isOpen: X,
3243
- getLabelProps: Q,
3244
- getInputProps: q,
3245
- getToggleButtonProps: H,
3246
- getMenuProps: U,
3247
- getItemProps: J,
3248
- highlightedIndex: D,
3249
- selectedItem: N,
3250
- selectedItems: A,
3251
- disabledItems: C,
3252
- setDisabledItems: P,
3253
- getSelectedItemProps: V,
3254
- getDropdownProps: K,
3255
- reset: z,
3256
- removeSelectedItem: W,
3257
- selectItem: T,
3258
- inputValue: k,
3259
- isDisabledOrReadOnly: M,
3260
- setIsDisabledOrReadOnly: c,
3261
- hasDisabledPopover: f,
3262
- setHasDisabledPopover: p,
3263
- hasEmpty: v,
3264
- setHasEmpty: _
3265
- },
3266
- children: /* @__PURE__ */ E.jsx("div", { className: i, style: { ...o, ...n }, children: /* @__PURE__ */ E.jsx(
3267
- nn,
3268
- {
3269
- root: b,
3270
- open: s === !0 ? s : X,
3271
- noPadding: !0,
3272
- disableCaret: !0,
3273
- fillAvailableHeight: !0,
3274
- disableFlipFallback: !0,
3275
- matchReferenceWidth: !0,
3276
- children: t
3277
- }
3278
- ) })
3279
- }
3280
- );
3281
- }, ki = ({
3282
- className: e,
3283
- label: n,
3284
- size: r,
3285
- error: i,
3286
- hint: o,
3287
- description: t,
3288
- required: s,
3289
- moreInfo: a,
3290
- openMoreInfo: d,
3291
- disabled: l,
3292
- readOnly: u,
3293
- prefix: h,
3294
- suffix: w,
3295
- maxRows: b,
3296
- ...I
3297
- }) => {
3298
- const {
3299
- isOpen: S,
3300
- itemToString: g,
3301
- getLabelProps: M,
3302
- getInputProps: c,
3303
- getToggleButtonProps: f,
3304
- selectedItems: p,
3305
- getSelectedItemProps: v,
3306
- getDropdownProps: _,
3307
- reset: k,
3308
- removeSelectedItem: O,
3309
- selectItem: A,
3310
- inputValue: R,
3311
- setIsDisabledOrReadOnly: C,
3312
- hasDisabledPopover: P
3313
- } = Ge(), V = Ye(), K = ue(re["input-wrapper"], {
3314
- [re.small]: r === "small",
3315
- [re.large]: r === "large"
3316
- }), z = Ie(), W = Ie(), $ = ue(re.input, e, {
3317
- [re.error]: i
3318
- });
3319
- le(() => (C(!!(l || u)), () => {
3320
- C(!1);
3321
- }), [l, u, C]);
3322
- let X = `label${z} `;
3323
- X += ` helper${W}`;
3324
- const Q = typeof i != "boolean" ? i : void 0, q = te(null), [H, U] = Z(!1), [J, D] = Z(!1), [N, T] = Z(
3325
- null
3326
- ), [y, B] = Z(0);
3327
- _t(() => {
3328
- var F, ne;
3329
- if (b !== void 0) {
3330
- if (H === !1)
3331
- U(!0), D(!1), T(null), B((se) => se + 1);
3332
- else if ((F = q == null ? void 0 : q.current) != null && F.children) {
3333
- const se = (ne = q == null ? void 0 : q.current) == null ? void 0 : ne.children, ae = Array.from(se).reduce(
3334
- (x, pe) => {
3335
- const ie = pe.getBoundingClientRect().top;
3336
- return x.length ? x[x.length - 1].top === ie ? [
3337
- ...x.slice(0, -1),
3338
- { count: x[x.length - 1].count + 1, top: ie }
3339
- ] : x[x.length - 1].top !== ie ? [...x, { count: 1, top: ie }] : x : [{ count: 1, top: ie }];
3340
- },
3341
- []
3342
- );
3343
- if (!ae[1] || N === 0)
3344
- U(!1);
3345
- else {
3346
- if (D(!0), N == null) {
3347
- const x = Math.max(
3348
- ae[0].count + ae[1].count - 2,
3349
- 0
3350
- );
3351
- T(x);
3352
- } else
3353
- T(N - 1);
3354
- B((x) => x + 1);
3355
- }
3356
- }
3357
- }
3358
- }, [p.length, b, y]);
3359
- const L = J && b != null && N !== null ? N : p.length;
3360
- return /* @__PURE__ */ E.jsxs("div", { className: re["search-field"], "data-anv": "combobox-searchfield", children: [
3361
- /* @__PURE__ */ E.jsxs("div", { children: [
3362
- /* @__PURE__ */ E.jsx(
3363
- It,
3364
- {
3365
- ...M({
3366
- id: z,
3367
- required: s,
3368
- moreInfo: a,
3369
- openMoreInfo: d
3370
- }),
3371
- children: n
3372
- }
3373
- ),
3374
- /* @__PURE__ */ E.jsxs(
3375
- "div",
3376
- {
3377
- className: K,
3378
- ref: V.refs.setReference,
3379
- children: [
3380
- /* @__PURE__ */ E.jsxs("div", { className: re["buttons-wrapper"], children: [
3381
- R || p.length ? /* @__PURE__ */ E.jsx("div", { className: re["close-button-wrapper"], children: /* @__PURE__ */ E.jsx(
3382
- rt,
3383
- {
3384
- "aria-label": "clear selection",
3385
- appearance: "ghost",
3386
- size: "small",
3387
- icon: Qr,
3388
- className: re["close-button"],
3389
- onClick: () => {
3390
- k != null ? k() : A(null);
3391
- },
3392
- tabIndex: -1,
3393
- disabled: l || u
3394
- }
3395
- ) }) : null,
3396
- P ? null : /* @__PURE__ */ E.jsx("div", { className: re["toggle-button-wrapper"], children: /* @__PURE__ */ E.jsx(
3397
- rt,
3398
- {
3399
- "aria-label": "toggle menu",
3400
- ...f({
3401
- icon: _r,
3402
- className: re["toggle-button"],
3403
- disabled: l || u
3404
- }),
3405
- appearance: "ghost",
3406
- size: "small"
3407
- }
3408
- ) })
3409
- ] }),
3410
- /* @__PURE__ */ E.jsxs("div", { className: re["rows-wrapper"], ref: q, children: [
3411
- p.length && O != null && v != null ? p.slice(0, L).map((F, ne) => {
3412
- const { onClick: se, ...ae } = v({
3413
- selectedItem: F,
3414
- index: ne
3415
- });
3416
- return /* @__PURE__ */ E.jsx(
3417
- "div",
3418
- {
3419
- className: re["chip-wrapper"],
3420
- children: /* @__PURE__ */ E.jsx(
3421
- on,
3422
- {
3423
- ...ae,
3424
- label: g(F),
3425
- onClose: () => O(F),
3426
- className: re.chip,
3427
- title: g(F)
3428
- }
3429
- )
3430
- },
3431
- `selected-item-${ne}`
3432
- );
3433
- }) : null,
3434
- J && b != null ? /* @__PURE__ */ E.jsx("div", { className: re["chip-wrapper"], children: /* @__PURE__ */ E.jsx(
3435
- on,
3436
- {
3437
- label: `+${p.length - L}`,
3438
- className: re.chip,
3439
- title: p.slice(L).map((F) => g(F)).join(", ")
3440
- }
3441
- ) }) : null,
3442
- /* @__PURE__ */ E.jsxs(
3443
- Cr,
3444
- {
3445
- flex: "1 1 100px",
3446
- alignItems: "center",
3447
- style: { width: "100px" },
3448
- children: [
3449
- h ? /* @__PURE__ */ E.jsx("div", { className: re.prefix, children: h }) : null,
3450
- /* @__PURE__ */ E.jsx(
3451
- "input",
3452
- {
3453
- ..._ != null ? c(
3454
- _({
3455
- ...I,
3456
- className: $,
3457
- disabled: l,
3458
- readOnly: u,
3459
- required: s,
3460
- autoComplete: "off",
3461
- "aria-labelledby": X,
3462
- preventKeyAction: S
3463
- })
3464
- ) : c({
3465
- ...I,
3466
- className: $,
3467
- disabled: l,
3468
- readOnly: u,
3469
- required: s,
3470
- autoComplete: "off",
3471
- "aria-labelledby": X
3472
- })
3473
- }
3474
- ),
3475
- w ? /* @__PURE__ */ E.jsx("div", { className: re.suffix, children: w }) : null
3476
- ]
3477
- }
3478
- )
3479
- ] })
3480
- ]
3481
- }
3482
- )
3483
- ] }),
3484
- o || Q || t ? /* @__PURE__ */ E.jsx(
3485
- bt,
3486
- {
3487
- id: W,
3488
- errorMessage: Q,
3489
- hint: o,
3490
- description: t
3491
- }
3492
- ) : null
3493
- ] });
3494
- }, Ti = function({
3495
- children: e,
3496
- className: n,
3497
- disablePopover: r = !1,
3498
- ...i
3499
- }) {
3500
- const {
3501
- items: o,
3502
- highlightedIndex: t,
3503
- selectedItem: s,
3504
- selectedItems: a,
3505
- setHasDisabledPopover: d,
3506
- getMenuProps: l,
3507
- getItemProps: u,
3508
- isDisabledOrReadOnly: h
3509
- } = Ge(), w = ue(
3510
- re["popover-content"],
3511
- n
3512
- );
3513
- return le(() => (d(r), () => {
3514
- d(!1);
3515
- }), [r, d]), r ? /* @__PURE__ */ E.jsx("div", { ...i, className: w, children: e ? e({
3516
- items: o,
3517
- highlightedIndex: t,
3518
- selectedItem: s,
3519
- getMenuProps: l,
3520
- getItemProps: u,
3521
- listProps: {
3522
- ...l({}, { suppressRefError: !0 }),
3523
- style: {
3524
- display: o.length ? "" : "none",
3525
- overflow: "auto"
3526
- }
3527
- },
3528
- options: o.map((b, I) => ({
3529
- optionProps: {
3530
- ...u({
3531
- item: b,
3532
- index: I
3533
- }),
3534
- selected: s === b || a.includes(b),
3535
- disabled: h
3536
- // also see "isItemDisabled" function
3537
- },
3538
- item: b,
3539
- index: I
3540
- }))
3541
- }) : null }) : /* @__PURE__ */ E.jsx(
3542
- nn.Content,
3543
- {
3544
- "data-anv": "combobox-content",
3545
- ...i,
3546
- className: w,
3547
- children: e ? e({
3548
- items: o,
3549
- highlightedIndex: t,
3550
- selectedItem: s,
3551
- getMenuProps: l,
3552
- getItemProps: u,
3553
- listProps: {
3554
- ...l({}, { suppressRefError: !0 }),
3555
- style: {
3556
- display: o.length ? void 0 : "none",
3557
- overflow: "auto"
3558
- }
3559
- },
3560
- options: o.map((b, I) => ({
3561
- optionProps: {
3562
- ...u({
3563
- item: b,
3564
- index: I
3565
- }),
3566
- selected: s === b || a.includes(b),
3567
- disabled: h
3568
- // also see "isItemDisabled" function
3569
- },
3570
- item: b,
3571
- index: I
3572
- }))
3573
- }) : null
3574
- }
3575
- );
3576
- }, Vi = function({
3577
- children: e,
3578
- ...n
3579
- }) {
3580
- const { getMenuProps: r, multiple: i, items: o, hasEmpty: t } = Ge();
3581
- return i ? /* @__PURE__ */ E.jsx(
3582
- "div",
3583
- {
3584
- ...r(n),
3585
- "data-anv": "combobox-list",
3586
- className: ht.listview,
3587
- style: {
3588
- display: o.length ? void 0 : "none",
3589
- overflow: "scroll"
3590
- },
3591
- children: e
3592
- }
3593
- ) : /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
3594
- /* @__PURE__ */ E.jsx(
3595
- "ul",
3596
- {
3597
- ...r(n),
3598
- className: Nn.listbox,
3599
- style: {
3600
- display: o.length ? void 0 : "none",
3601
- overflow: "scroll"
3602
- },
3603
- children: e
3604
- }
3605
- ),
3606
- !o.length && !t ? /* @__PURE__ */ E.jsx("div", { className: re.empty, children: /* @__PURE__ */ E.jsx(Or, { subdued: !0, size: "small", children: "No results found" }) }) : null
3607
- ] });
3608
- }, Ai = function({
3609
- children: e,
3610
- disabled: n,
3611
- item: r,
3612
- index: i,
3613
- ...o
3614
- }) {
3615
- const {
3616
- getItemProps: t,
3617
- multiple: s,
3618
- selectedItem: a,
3619
- selectedItems: d,
3620
- disabledItems: l,
3621
- setDisabledItems: u
3622
- } = Ge(), h = n || r && r instanceof Object && "disabled" in r && r.disabled;
3623
- return le(() => (n && !l.includes(r) ? u([...l, r]) : l.includes(r) && u(l.filter((w) => w === r)), () => {
3624
- l.includes(r) && u(l.filter((w) => w === r));
3625
- }), [r, n, u]), s ? /* @__PURE__ */ E.jsx(
3626
- "div",
3627
- {
3628
- "data-anv": "combobox-item",
3629
- ...t({
3630
- item: r,
3631
- index: i,
3632
- ...o
3633
- }),
3634
- className: ue(
3635
- re["listview-option"],
3636
- ht["listview-option"]
3637
- ),
3638
- children: /* @__PURE__ */ E.jsxs("div", { className: ue(re.cell, ht.cell), children: [
3639
- /* @__PURE__ */ E.jsx(
3640
- wr,
3641
- {
3642
- checked: d.includes(r),
3643
- "aria-label": "Select",
3644
- ...h ? { disabled: !0 } : {}
3645
- }
3646
- ),
3647
- e
3648
- ] })
3649
- }
3650
- ) : /* @__PURE__ */ E.jsxs(
3651
- "li",
3652
- {
3653
- ...t({
3654
- item: r,
3655
- index: i,
3656
- ...o
3657
- }),
3658
- className: Nn.option,
3659
- ...h ? { "aria-disabled": !0 } : {},
3660
- children: [
3661
- /* @__PURE__ */ E.jsx("span", { children: e }),
3662
- /* @__PURE__ */ E.jsx(
3663
- vt,
3664
- {
3665
- "aria-hidden": !0,
3666
- svg: Zr,
3667
- inherit: !0,
3668
- className: re.Icon,
3669
- style: { opacity: a === r ? 1 : 0 }
3670
- }
3671
- )
3672
- ]
3673
- }
3674
- );
3675
- }, Hi = function({
3676
- children: e
3677
- }) {
3678
- const { items: n, setHasEmpty: r } = Ge();
3679
- return le(() => (r(!0), () => {
3680
- r(!1);
3681
- })), n.length ? null : e;
3682
- }, Ia = Object.assign(Ri, {
3683
- SearchField: ki,
3684
- Content: Ti,
3685
- List: Vi,
3686
- Item: Ai,
3687
- Empty: Hi
3688
- });
3689
- const Ki = "_details_1sjr5_4", ji = "_summary_1sjr5_17", $i = "_arrow_1sjr5_66", Fi = "_content_1sjr5_30", Li = "_expanded_1sjr5_111", Pe = {
3690
- details: Ki,
3691
- summary: ji,
3692
- "content-wrapper": "_content-wrapper_1sjr5_30",
3693
- arrow: $i,
3694
- content: Fi,
3695
- "is-expanded": "_is-expanded_1sjr5_108",
3696
- expanded: Li
3697
- }, ut = yt({
3698
- id: "",
3699
- isExpanded: !1,
3700
- expanded: () => {
3701
- },
3702
- close: () => {
3703
- },
3704
- toggle: () => {
3705
- }
3706
- }), Bi = ye(
3707
- function(e, n) {
3708
- const { layoutStyles: r, componentProps: i } = Me(e), {
3709
- children: o,
3710
- id: t,
3711
- expanded: s,
3712
- defaultExpanded: a = !1,
3713
- style: d,
3714
- className: l,
3715
- ...u
3716
- } = i, h = Ie(), [w, b] = Z(a);
3717
- function I() {
3718
- b(!0);
3719
- }
3720
- function S() {
3721
- b(!1);
3722
- }
3723
- function g() {
3724
- b((f) => !f);
3725
- }
3726
- const M = {
3727
- ...d,
3728
- ...r
3729
- }, c = Ke(
3730
- () => ({
3731
- id: t ?? h,
3732
- isExpanded: s ?? w,
3733
- expanded: I,
3734
- close: S,
3735
- toggle: g
3736
- }),
3737
- [h, t, w, s]
3738
- );
3739
- return /* @__PURE__ */ E.jsx(ut.Provider, { value: c, children: /* @__PURE__ */ E.jsx(
3740
- "div",
3741
- {
3742
- "data-anv": "details",
3743
- ref: n,
3744
- className: ue(Pe.details, l),
3745
- style: M,
3746
- ...u,
3747
- children: o
3748
- }
3749
- ) });
3750
- }
3751
- ), Ui = ye(function({ children: e, onClick: n, className: r, ...i }, o) {
3752
- const { id: t, isExpanded: s, toggle: a } = De(ut), d = (...u) => {
3753
- n == null || n(...u), a();
3754
- }, l = ue(Pe.summary, r);
3755
- return /* @__PURE__ */ E.jsxs(
3756
- "button",
3757
- {
3758
- "data-anv": "details-summary",
3759
- "aria-controls": t,
3760
- "aria-expanded": s,
3761
- className: l,
3762
- onClick: d,
3763
- ref: o,
3764
- ...i,
3765
- children: [
3766
- /* @__PURE__ */ E.jsx(zi, {}),
3767
- " ",
3768
- /* @__PURE__ */ E.jsx("span", { children: e })
3769
- ]
3770
- }
3771
- );
3772
- }), zi = ye(
3773
- function({ className: e, ...n }, r) {
3774
- const { isExpanded: i } = De(ut), o = ue(
3775
- Pe.arrow,
3776
- { [Pe["is-expanded"]]: i },
3777
- e
3778
- );
3779
- return /* @__PURE__ */ E.jsx("span", { className: o, ref: r, ...n, children: /* @__PURE__ */ E.jsx(vt, { size: "large", svg: _r }) });
3780
- }
3781
- ), Wi = ye(
3782
- function({
3783
- className: e,
3784
- children: n,
3785
- height: r,
3786
- maxHeight: i,
3787
- style: o,
3788
- ...t
3789
- }, s) {
3790
- const { id: a, isExpanded: d } = De(ut), l = {
3791
- height: r,
3792
- maxHeight: i,
3793
- ...r || i ? { overflow: "auto" } : {},
3794
- ...o
3795
- };
3796
- return /* @__PURE__ */ E.jsx(
3797
- "div",
3798
- {
3799
- "data-anv": "details-content",
3800
- id: a,
3801
- className: ue(Pe["content-wrapper"], {
3802
- [Pe.expanded]: d
3803
- }),
3804
- ref: s,
3805
- children: /* @__PURE__ */ E.jsx("div", { className: Pe.content, children: /* @__PURE__ */ E.jsx("div", { className: e, style: l, ...t, children: n }) })
3806
- }
3807
- );
3808
- }
3809
- ), _a = Object.assign(Bi, {
3810
- Summary: Ui,
3811
- Content: Wi
3812
- });
3813
- const qi = "_link_1ur2o_4", Yi = "_secondary_1ur2o_36", Gi = "_quiet_1ur2o_45", He = {
3814
- link: qi,
3815
- secondary: Yi,
3816
- quiet: Gi
3817
- }, Xi = (e) => /* @__PURE__ */ me.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...e }, /* @__PURE__ */ me.createElement("path", { d: "M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h5c.55 0 1-.45 1-1s-.45-1-1-1H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6c0-.55-.45-1-1-1s-1 .45-1 1v5c0 .55-.45 1-1 1zM14 4c0 .55.45 1 1 1h2.59l-9.13 9.13a.996.996 0 1 0 1.41 1.41L19 6.41V9c0 .55.45 1 1 1s1-.45 1-1V4c0-.55-.45-1-1-1h-5c-.55 0-1 .45-1 1z" })), Ji = ye((e, n) => {
3818
- const { layoutStyles: r, componentProps: i } = Me(e), {
3819
- children: o,
3820
- className: t,
3821
- appearance: s = "primary",
3822
- quiet: a,
3823
- style: d,
3824
- ...l
3825
- } = i, u = ue([He.link], t, {
3826
- [He.quiet]: a,
3827
- [He.secondary]: s === "secondary"
3828
- }), h = {
3829
- ...d,
3830
- ...r
3831
- };
3832
- return /* @__PURE__ */ E.jsxs(
3833
- "a",
3834
- {
3835
- className: u,
3836
- rel: "noopener noreferrer",
3837
- "data-anv": "link",
3838
- ref: n,
3839
- style: h,
3840
- ...l,
3841
- children: [
3842
- o,
3843
- l.target === "_blank" && /* @__PURE__ */ E.jsx(vt, { inherit: !0, svg: Xi })
3844
- ]
3845
- }
3846
- );
3847
- });
3848
- Ji.displayName = "Link";
3849
- const ya = (e) => {
3850
- const { layoutStyles: n, componentProps: r } = Me(e), { className: i, appearance: o = "primary", quiet: t, style: s } = r, a = ue([He.link], i, {
3851
- [He.quiet]: t,
3852
- [He.secondary]: o === "secondary"
3853
- }), d = Object.assign({}, s, n);
3854
- return { linkClassNames: a, styleCombined: d };
3855
- };
3856
- var Qi = _t, Zi = function(n) {
3857
- var r = me.useRef(n);
3858
- return Qi(function() {
3859
- r.current = n;
3860
- }), r;
3861
- }, En = function(n, r) {
3862
- if (typeof n == "function") {
3863
- n(r);
3864
- return;
3865
- }
3866
- n.current = r;
3867
- }, es = function(n, r) {
3868
- var i = te();
3869
- return ee(function(o) {
3870
- n.current = o, i.current && En(i.current, null), i.current = r, r && En(r, o);
3871
- }, [r]);
3872
- }, Cn = {
3873
- "min-height": "0",
3874
- "max-height": "none",
3875
- height: "0",
3876
- visibility: "hidden",
3877
- overflow: "hidden",
3878
- position: "absolute",
3879
- "z-index": "-1000",
3880
- top: "0",
3881
- right: "0"
3882
- }, ts = function(n) {
3883
- Object.keys(Cn).forEach(function(r) {
3884
- n.style.setProperty(r, Cn[r], "important");
3885
- });
3886
- }, Sn = ts, de = null, On = function(n, r) {
3887
- var i = n.scrollHeight;
3888
- return r.sizingStyle.boxSizing === "border-box" ? i + r.borderSize : i - r.paddingSize;
3889
- };
3890
- function ns(e, n, r, i) {
3891
- r === void 0 && (r = 1), i === void 0 && (i = 1 / 0), de || (de = document.createElement("textarea"), de.setAttribute("tabindex", "-1"), de.setAttribute("aria-hidden", "true"), Sn(de)), de.parentNode === null && document.body.appendChild(de);
3892
- var o = e.paddingSize, t = e.borderSize, s = e.sizingStyle, a = s.boxSizing;
3893
- Object.keys(s).forEach(function(w) {
3894
- var b = w;
3895
- de.style[b] = s[b];
3896
- }), Sn(de), de.value = n;
3897
- var d = On(de, e);
3898
- de.value = n, d = On(de, e), de.value = "x";
3899
- var l = de.scrollHeight - o, u = l * r;
3900
- a === "border-box" && (u = u + o + t), d = Math.max(u, d);
3901
- var h = l * i;
3902
- return a === "border-box" && (h = h + o + t), d = Math.min(h, d), [d, l];
3903
- }
3904
- var Dn = function() {
3905
- }, rs = function(n, r) {
3906
- return n.reduce(function(i, o) {
3907
- return i[o] = r[o], i;
3908
- }, {});
3909
- }, os = [
3910
- "borderBottomWidth",
3911
- "borderLeftWidth",
3912
- "borderRightWidth",
3913
- "borderTopWidth",
3914
- "boxSizing",
3915
- "fontFamily",
3916
- "fontSize",
3917
- "fontStyle",
3918
- "fontWeight",
3919
- "letterSpacing",
3920
- "lineHeight",
3921
- "paddingBottom",
3922
- "paddingLeft",
3923
- "paddingRight",
3924
- "paddingTop",
3925
- // non-standard
3926
- "tabSize",
3927
- "textIndent",
3928
- // non-standard
3929
- "textRendering",
3930
- "textTransform",
3931
- "width",
3932
- "wordBreak"
3933
- ], is = !!document.documentElement.currentStyle, ss = function(n) {
3934
- var r = window.getComputedStyle(n);
3935
- if (r === null)
3936
- return null;
3937
- var i = rs(os, r), o = i.boxSizing;
3938
- if (o === "")
3939
- return null;
3940
- is && o === "border-box" && (i.width = parseFloat(i.width) + parseFloat(i.borderRightWidth) + parseFloat(i.borderLeftWidth) + parseFloat(i.paddingRight) + parseFloat(i.paddingLeft) + "px");
3941
- var t = parseFloat(i.paddingBottom) + parseFloat(i.paddingTop), s = parseFloat(i.borderBottomWidth) + parseFloat(i.borderTopWidth);
3942
- return {
3943
- sizingStyle: i,
3944
- paddingSize: t,
3945
- borderSize: s
3946
- };
3947
- }, as = ss;
3948
- function yr(e, n, r) {
3949
- var i = Zi(r);
3950
- me.useLayoutEffect(function() {
3951
- var o = function(s) {
3952
- return i.current(s);
3953
- };
3954
- if (e)
3955
- return e.addEventListener(n, o), function() {
3956
- return e.removeEventListener(n, o);
3957
- };
3958
- }, []);
3959
- }
3960
- var ls = function(n) {
3961
- yr(window, "resize", n);
3962
- }, us = function(n) {
3963
- yr(document.fonts, "loadingdone", n);
3964
- }, ds = ["cacheMeasurements", "maxRows", "minRows", "onChange", "onHeightChange"], cs = function(n, r) {
3965
- var i = n.cacheMeasurements, o = n.maxRows, t = n.minRows, s = n.onChange, a = s === void 0 ? Dn : s, d = n.onHeightChange, l = d === void 0 ? Dn : d, u = ge(n, ds), h = u.value !== void 0, w = me.useRef(null), b = es(w, r), I = me.useRef(0), S = me.useRef(), g = function() {
3966
- var f = w.current, p = i && S.current ? S.current : as(f);
3967
- if (p) {
3968
- S.current = p;
3969
- var v = ns(p, f.value || f.placeholder || "x", t, o), _ = v[0], k = v[1];
3970
- I.current !== _ && (I.current = _, f.style.setProperty("height", _ + "px", "important"), l(_, {
3971
- rowHeight: k
3972
- }));
3973
- }
3974
- }, M = function(f) {
3975
- h || g(), a(f);
3976
- };
3977
- return me.useLayoutEffect(g), ls(g), us(g), /* @__PURE__ */ me.createElement("textarea", j({}, u, {
3978
- onChange: M,
3979
- ref: b
3980
- }));
3981
- }, ps = /* @__PURE__ */ me.forwardRef(cs);
3982
- const fs = "_textarea_vmtv0_4", hs = "_counter_vmtv0_49", gs = "_error_vmtv0_61", ms = "_disabled_vmtv0_68", vs = "_readonly_vmtv0_78", Te = {
3983
- textarea: fs,
3984
- "has-cols": "_has-cols_vmtv0_23",
3985
- counter: hs,
3986
- error: gs,
3987
- disabled: ms,
3988
- "disable-resize": "_disable-resize_vmtv0_75",
3989
- readonly: vs
3990
- }, Is = ye(
3991
- (e, n) => {
3992
- const { layoutStyles: r, componentProps: i } = Me(e), {
3993
- className: o,
3994
- disableResize: t,
3995
- error: s,
3996
- // errorAriaLive: errorAriaLiveProp = "assertive",
3997
- hint: a,
3998
- description: d,
3999
- label: l,
4000
- moreInfo: u,
4001
- onChange: h,
4002
- required: w,
4003
- showCounter: b,
4004
- onFocus: I,
4005
- onBlur: S,
4006
- id: g,
4007
- maxLength: M,
4008
- autoHeight: c,
4009
- labelProps: f,
4010
- placeholder: p,
4011
- style: v,
4012
- ..._
4013
- } = i, k = te(null), [O, A] = Z(0), [R, C] = Z(!1), [P, V] = Z(!1), [K, z] = Z("off");
4014
- le(() => {
4015
- var y;
4016
- A(((y = k.current) == null ? void 0 : y.defaultValue.length) ?? 0);
4017
- }, []);
4018
- const W = (y) => {
4019
- h == null || h(y, { value: y.target.value }), O !== y.target.value.length && C(!0), A(y.target.value.length);
4020
- }, $ = (y) => {
4021
- I == null || I(y), V(!0);
4022
- }, X = (y) => {
4023
- S == null || S(y), V(!1), z("off"), C(!1);
4024
- }, Q = Ie(), q = g ?? Q, H = Ie(), U = Ie(), J = typeof s != "boolean" ? s : void 0, D = ue([Te.textarea], o, {
4025
- [Te.error]: s,
4026
- [Te["disable-resize"]]: t,
4027
- [Te.disabled]: _.disabled,
4028
- [Te.readonly]: _.readOnly,
4029
- [Te["has-cols"]]: _.cols != null
4030
- }), N = { ...v, ...r }, T = c ? ps : "textarea";
4031
- return /* @__PURE__ */ E.jsxs(
4032
- "div",
4033
- {
4034
- className: D,
4035
- "data-anv": "textarea",
4036
- style: N,
4037
- children: [
4038
- l ? /* @__PURE__ */ E.jsx(
4039
- It,
4040
- {
4041
- htmlFor: q,
4042
- moreInfo: u,
4043
- openMoreInfo: P,
4044
- required: w,
4045
- ...f,
4046
- children: l
4047
- }
4048
- ) : null,
4049
- /* @__PURE__ */ E.jsx(
4050
- T,
4051
- {
4052
- rows: 3,
4053
- onChange: W,
4054
- onFocus: $,
4055
- onBlur: X,
4056
- ref: We([n, k]),
4057
- required: w,
4058
- maxLength: M,
4059
- id: q,
4060
- placeholder: p,
4061
- ..._,
4062
- "aria-describedby": [U, H].join(" "),
4063
- "aria-invalid": s ? !!s : void 0
4064
- }
4065
- ),
4066
- a || b || J || d ? /* @__PURE__ */ E.jsx(
4067
- bt,
4068
- {
4069
- id: H,
4070
- hint: a,
4071
- maxLength: M,
4072
- inputLength: O,
4073
- isTyping: R,
4074
- showCounter: b,
4075
- errorMessage: J,
4076
- errorAriaLive: K,
4077
- description: d
4078
- }
4079
- ) : null,
4080
- /* @__PURE__ */ E.jsx(Rn, { "aria-hidden": !0, id: U, children: p })
4081
- ]
4082
- }
4083
- );
4084
- }
4085
- );
4086
- Is.displayName = "Textarea";
4087
- const _s = "_textfield_1acx5_4", ys = "_input_1acx5_17", bs = "_prefix_1acx5_43", xs = "_suffix_1acx5_44", ws = "_small_1acx5_101", Es = "_large_1acx5_104", Cs = "_error_1acx5_113", we = {
4088
- textfield: _s,
4089
- input: ys,
4090
- "input-wrapper": "_input-wrapper_1acx5_30",
4091
- prefix: bs,
4092
- suffix: xs,
4093
- "loading-spinner": "_loading-spinner_1acx5_63",
4094
- small: ws,
4095
- large: Es,
4096
- error: Cs
4097
- }, Ss = ye(
4098
- function(e, n) {
4099
- const { layoutStyles: r, componentProps: i } = Me(e), {
4100
- className: o,
4101
- error: t,
4102
- errorAriaLive: s = "assertive",
4103
- label: a,
4104
- moreInfo: d,
4105
- prefix: l,
4106
- suffix: u,
4107
- size: h,
4108
- type: w = "text",
4109
- required: b,
4110
- onFocus: I,
4111
- onBlur: S,
4112
- id: g,
4113
- description: M,
4114
- hint: c,
4115
- loading: f,
4116
- disabled: p,
4117
- labelProps: v,
4118
- style: _,
4119
- placeholder: k,
4120
- ...O
4121
- } = i, [A, R] = Z(!1), [C, P] = Z("off"), V = (D) => {
4122
- I == null || I(D), R(!0), P(s);
4123
- }, K = (D) => {
4124
- S == null || S(D), R(!1), P("off");
4125
- }, z = Ie(), W = g ?? z, $ = Ie(), X = Ie(), Q = Ie(), q = Ie(), H = te(null), U = typeof t != "boolean" ? t : void 0, J = { ..._, ...r };
4126
- return /* @__PURE__ */ E.jsxs(
4127
- "div",
4128
- {
4129
- className: ue(we.textfield, o),
4130
- "data-anv": "textfield",
4131
- style: J,
4132
- children: [
4133
- a ? /* @__PURE__ */ E.jsx(
4134
- It,
4135
- {
4136
- moreInfo: d,
4137
- openMoreInfo: A,
4138
- required: b,
4139
- htmlFor: W,
4140
- ...v,
4141
- children: a
4142
- }
4143
- ) : null,
4144
- /* @__PURE__ */ E.jsxs(
4145
- "div",
4146
- {
4147
- className: ue(we["input-wrapper"], {
4148
- [we.small]: h === "small",
4149
- [we.large]: h === "large"
4150
- }),
4151
- role: "presentation",
4152
- onClick: () => {
4153
- var D;
4154
- return (D = H.current) == null ? void 0 : D.focus();
4155
- },
4156
- children: [
4157
- l ? /* @__PURE__ */ E.jsx(
4158
- "div",
4159
- {
4160
- "aria-hidden": !0,
4161
- className: we.prefix,
4162
- id: `prefix${$}`,
4163
- children: l
4164
- }
4165
- ) : null,
4166
- /* @__PURE__ */ E.jsx(
4167
- "input",
4168
- {
4169
- id: W,
4170
- className: ue(we.input, {
4171
- [we.error]: t
4172
- }),
4173
- onFocus: V,
4174
- onBlur: K,
4175
- ref: We([n, H]),
4176
- required: b,
4177
- placeholder: k,
4178
- type: w,
4179
- disabled: p,
4180
- ...O,
4181
- "aria-describedby": [q, Q].join(" "),
4182
- "aria-invalid": t ? !!t : void 0
4183
- }
4184
- ),
4185
- f ? /* @__PURE__ */ E.jsx(xr, { className: we["loading-spinner"] }) : null,
4186
- u ? /* @__PURE__ */ E.jsx(
4187
- "div",
4188
- {
4189
- className: we.suffix,
4190
- "aria-hidden": !0,
4191
- id: `suffix${X}`,
4192
- children: u
4193
- }
4194
- ) : null
4195
- ]
4196
- }
4197
- ),
4198
- c || U || M ? /* @__PURE__ */ E.jsx(
4199
- bt,
4200
- {
4201
- id: Q,
4202
- hint: c,
4203
- errorMessage: U,
4204
- errorAriaLive: C,
4205
- description: M
4206
- }
4207
- ) : null,
4208
- /* @__PURE__ */ E.jsx(Rn, { "aria-hidden": !0, id: q, children: k })
4209
- ]
4210
- }
4211
- );
4212
- }
4213
- ), ba = Object.assign(Ss, {});
4214
- export {
4215
- Ia as C,
4216
- _a as H,
4217
- nn as N,
4218
- ya as V,
4219
- Ii as _,
4220
- vi as a,
4221
- ba as b,
4222
- Is as d,
4223
- fi as h,
4224
- mi as j,
4225
- Ji as q
4226
- };
4227
- //# sourceMappingURL=index-6ad2779a.js.map