@als-tp/als-react-ts-ui 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/dist/als-react-ts-ui.js +95 -12432
  2. package/dist/als-react-ts-ui10.js +9 -0
  3. package/dist/als-react-ts-ui100.js +142 -0
  4. package/dist/als-react-ts-ui101.js +199 -0
  5. package/dist/als-react-ts-ui102.js +146 -0
  6. package/dist/als-react-ts-ui103.js +31 -0
  7. package/dist/als-react-ts-ui104.js +52 -0
  8. package/dist/als-react-ts-ui105.js +28 -0
  9. package/dist/als-react-ts-ui106.js +27 -0
  10. package/dist/als-react-ts-ui107.js +24 -0
  11. package/dist/als-react-ts-ui108.js +23 -0
  12. package/dist/als-react-ts-ui109.js +311 -0
  13. package/dist/als-react-ts-ui11.js +9 -0
  14. package/dist/als-react-ts-ui110.js +7 -0
  15. package/dist/als-react-ts-ui111.js +7 -0
  16. package/dist/als-react-ts-ui112.js +7 -0
  17. package/dist/als-react-ts-ui113.js +26 -0
  18. package/dist/als-react-ts-ui114.js +25 -0
  19. package/dist/als-react-ts-ui115.js +172 -0
  20. package/dist/als-react-ts-ui116.js +305 -0
  21. package/dist/als-react-ts-ui117.js +37 -0
  22. package/dist/als-react-ts-ui118.js +40 -0
  23. package/dist/als-react-ts-ui119.js +40 -0
  24. package/dist/als-react-ts-ui12.js +9 -0
  25. package/dist/als-react-ts-ui120.js +34 -0
  26. package/dist/als-react-ts-ui121.js +41 -0
  27. package/dist/als-react-ts-ui122.js +61 -0
  28. package/dist/als-react-ts-ui123.js +5 -0
  29. package/dist/als-react-ts-ui124.js +181 -0
  30. package/dist/als-react-ts-ui125.js +7 -0
  31. package/dist/als-react-ts-ui126.js +7 -0
  32. package/dist/als-react-ts-ui127.js +7 -0
  33. package/dist/als-react-ts-ui128.js +7 -0
  34. package/dist/als-react-ts-ui129.js +85 -0
  35. package/dist/als-react-ts-ui13.js +127 -0
  36. package/dist/als-react-ts-ui130.js +35 -0
  37. package/dist/als-react-ts-ui131.js +9 -0
  38. package/dist/als-react-ts-ui132.js +9 -0
  39. package/dist/als-react-ts-ui133.js +206 -0
  40. package/dist/als-react-ts-ui134.js +127 -0
  41. package/dist/als-react-ts-ui135.js +20 -0
  42. package/dist/als-react-ts-ui136.js +85 -0
  43. package/dist/als-react-ts-ui137.js +37 -0
  44. package/dist/als-react-ts-ui138.js +101 -0
  45. package/dist/als-react-ts-ui139.js +68 -0
  46. package/dist/als-react-ts-ui14.js +9 -0
  47. package/dist/als-react-ts-ui140.js +39 -0
  48. package/dist/als-react-ts-ui141.js +21 -0
  49. package/dist/als-react-ts-ui142.js +26 -0
  50. package/dist/als-react-ts-ui143.js +65 -0
  51. package/dist/als-react-ts-ui144.js +24 -0
  52. package/dist/als-react-ts-ui145.js +112 -0
  53. package/dist/als-react-ts-ui146.js +34 -0
  54. package/dist/als-react-ts-ui147.js +27 -0
  55. package/dist/als-react-ts-ui148.js +44 -0
  56. package/dist/als-react-ts-ui149.js +17 -0
  57. package/dist/als-react-ts-ui15.js +9 -0
  58. package/dist/als-react-ts-ui150.js +24 -0
  59. package/dist/als-react-ts-ui151.js +15 -0
  60. package/dist/als-react-ts-ui152.js +24 -0
  61. package/dist/als-react-ts-ui153.js +61 -0
  62. package/dist/als-react-ts-ui154.js +23 -0
  63. package/dist/als-react-ts-ui155.js +33 -0
  64. package/dist/als-react-ts-ui156.js +29 -0
  65. package/dist/als-react-ts-ui157.js +29 -0
  66. package/dist/als-react-ts-ui158.js +109 -0
  67. package/dist/als-react-ts-ui159.js +31 -0
  68. package/dist/als-react-ts-ui16.js +9 -0
  69. package/dist/als-react-ts-ui160.js +29 -0
  70. package/dist/als-react-ts-ui161.js +6 -0
  71. package/dist/als-react-ts-ui162.js +11 -0
  72. package/dist/als-react-ts-ui163.js +81 -0
  73. package/dist/als-react-ts-ui164.js +10 -0
  74. package/dist/als-react-ts-ui165.js +14 -0
  75. package/dist/als-react-ts-ui166.js +57 -0
  76. package/dist/als-react-ts-ui167.js +35 -0
  77. package/dist/als-react-ts-ui168.js +19 -0
  78. package/dist/als-react-ts-ui169.js +69 -0
  79. package/dist/als-react-ts-ui17.js +35 -0
  80. package/dist/als-react-ts-ui170.js +7 -0
  81. package/dist/als-react-ts-ui171.js +66 -0
  82. package/dist/als-react-ts-ui172.js +14 -0
  83. package/dist/als-react-ts-ui173.js +55 -0
  84. package/dist/als-react-ts-ui174.js +14 -0
  85. package/dist/als-react-ts-ui175.js +14 -0
  86. package/dist/als-react-ts-ui176.js +6 -0
  87. package/dist/als-react-ts-ui177.js +21 -0
  88. package/dist/als-react-ts-ui178.js +69 -0
  89. package/dist/als-react-ts-ui179.js +91 -0
  90. package/dist/als-react-ts-ui18.js +9 -0
  91. package/dist/als-react-ts-ui180.js +25 -0
  92. package/dist/als-react-ts-ui181.js +167 -0
  93. package/dist/als-react-ts-ui182.js +6 -0
  94. package/dist/als-react-ts-ui183.js +20 -0
  95. package/dist/als-react-ts-ui184.js +9 -0
  96. package/dist/als-react-ts-ui185.js +89 -0
  97. package/dist/als-react-ts-ui186.js +14 -0
  98. package/dist/als-react-ts-ui187.js +65 -0
  99. package/dist/als-react-ts-ui188.js +40 -0
  100. package/dist/als-react-ts-ui189.js +16 -0
  101. package/dist/als-react-ts-ui19.js +9 -0
  102. package/dist/als-react-ts-ui190.js +6 -0
  103. package/dist/als-react-ts-ui191.js +7 -0
  104. package/dist/als-react-ts-ui192.js +14 -0
  105. package/dist/als-react-ts-ui193.js +294 -0
  106. package/dist/als-react-ts-ui194.js +7 -0
  107. package/dist/als-react-ts-ui195.js +41 -0
  108. package/dist/als-react-ts-ui196.js +127 -0
  109. package/dist/als-react-ts-ui197.js +7 -0
  110. package/dist/als-react-ts-ui198.js +22 -0
  111. package/dist/als-react-ts-ui199.js +83 -0
  112. package/dist/als-react-ts-ui20.js +9 -0
  113. package/dist/als-react-ts-ui200.js +66 -0
  114. package/dist/als-react-ts-ui201.js +48 -0
  115. package/dist/als-react-ts-ui202.js +7 -0
  116. package/dist/als-react-ts-ui203.js +21 -0
  117. package/dist/als-react-ts-ui204.js +18 -0
  118. package/dist/als-react-ts-ui205.js +35 -0
  119. package/dist/als-react-ts-ui206.js +14 -0
  120. package/dist/als-react-ts-ui207.js +11 -0
  121. package/dist/als-react-ts-ui208.js +14 -0
  122. package/dist/als-react-ts-ui209.js +16 -0
  123. package/dist/als-react-ts-ui21.js +9 -0
  124. package/dist/als-react-ts-ui210.js +6 -0
  125. package/dist/als-react-ts-ui211.js +6 -0
  126. package/dist/als-react-ts-ui212.js +8 -0
  127. package/dist/als-react-ts-ui213.js +82 -0
  128. package/dist/als-react-ts-ui214.js +6 -0
  129. package/dist/als-react-ts-ui215.js +23 -0
  130. package/dist/als-react-ts-ui216.js +20 -0
  131. package/dist/als-react-ts-ui217.js +28 -0
  132. package/dist/als-react-ts-ui218.js +45 -0
  133. package/dist/als-react-ts-ui219.js +7 -0
  134. package/dist/als-react-ts-ui22.js +9 -0
  135. package/dist/als-react-ts-ui220.js +6 -0
  136. package/dist/als-react-ts-ui221.js +136 -0
  137. package/dist/als-react-ts-ui222.js +8 -0
  138. package/dist/als-react-ts-ui223.js +68 -0
  139. package/dist/als-react-ts-ui224.js +6 -0
  140. package/dist/als-react-ts-ui225.js +19 -0
  141. package/dist/als-react-ts-ui226.js +14 -0
  142. package/dist/als-react-ts-ui227.js +6 -0
  143. package/dist/als-react-ts-ui228.js +23 -0
  144. package/dist/als-react-ts-ui229.js +32 -0
  145. package/dist/als-react-ts-ui23.js +104 -0
  146. package/dist/als-react-ts-ui230.js +20 -0
  147. package/dist/als-react-ts-ui231.js +76 -0
  148. package/dist/als-react-ts-ui232.js +131 -0
  149. package/dist/als-react-ts-ui233.js +117 -0
  150. package/dist/als-react-ts-ui234.js +104 -0
  151. package/dist/als-react-ts-ui235.js +53 -0
  152. package/dist/als-react-ts-ui236.js +106 -0
  153. package/dist/als-react-ts-ui237.js +24 -0
  154. package/dist/als-react-ts-ui238.js +35 -0
  155. package/dist/als-react-ts-ui239.js +77 -0
  156. package/dist/als-react-ts-ui24.js +9 -0
  157. package/dist/als-react-ts-ui240.js +229 -0
  158. package/dist/als-react-ts-ui241.js +72 -0
  159. package/dist/als-react-ts-ui242.js +50 -0
  160. package/dist/als-react-ts-ui243.js +202 -0
  161. package/dist/als-react-ts-ui244.js +50 -0
  162. package/dist/als-react-ts-ui245.js +22 -0
  163. package/dist/als-react-ts-ui246.js +8 -0
  164. package/dist/als-react-ts-ui247.js +11 -0
  165. package/dist/als-react-ts-ui248.js +14 -0
  166. package/dist/als-react-ts-ui249.js +24 -0
  167. package/dist/als-react-ts-ui25.js +11 -0
  168. package/dist/als-react-ts-ui250.js +97 -0
  169. package/dist/als-react-ts-ui251.js +16 -0
  170. package/dist/als-react-ts-ui252.js +8 -0
  171. package/dist/als-react-ts-ui253.js +24 -0
  172. package/dist/als-react-ts-ui254.js +60 -0
  173. package/dist/als-react-ts-ui255.js +19 -0
  174. package/dist/als-react-ts-ui256.js +29 -0
  175. package/dist/als-react-ts-ui257.js +45 -0
  176. package/dist/als-react-ts-ui258.js +23 -0
  177. package/dist/als-react-ts-ui259.js +51 -0
  178. package/dist/als-react-ts-ui26.js +9 -0
  179. package/dist/als-react-ts-ui260.js +53 -0
  180. package/dist/als-react-ts-ui261.js +20 -0
  181. package/dist/als-react-ts-ui262.js +14 -0
  182. package/dist/als-react-ts-ui263.js +38 -0
  183. package/dist/als-react-ts-ui264.js +285 -0
  184. package/dist/als-react-ts-ui265.js +56 -0
  185. package/dist/als-react-ts-ui266.js +82 -0
  186. package/dist/als-react-ts-ui267.js +8 -0
  187. package/dist/als-react-ts-ui268.js +6 -0
  188. package/dist/als-react-ts-ui269.js +26 -0
  189. package/dist/als-react-ts-ui27.js +9 -0
  190. package/dist/als-react-ts-ui270.js +18 -0
  191. package/dist/als-react-ts-ui271.js +6 -0
  192. package/dist/als-react-ts-ui272.js +265 -0
  193. package/dist/als-react-ts-ui273.js +14 -0
  194. package/dist/als-react-ts-ui274.js +13 -0
  195. package/dist/als-react-ts-ui275.js +44 -0
  196. package/dist/als-react-ts-ui276.js +7 -0
  197. package/dist/als-react-ts-ui277.js +12 -0
  198. package/dist/als-react-ts-ui278.js +10 -0
  199. package/dist/als-react-ts-ui279.js +8 -0
  200. package/dist/als-react-ts-ui28.js +122 -0
  201. package/dist/als-react-ts-ui280.js +14 -0
  202. package/dist/als-react-ts-ui281.js +14 -0
  203. package/dist/als-react-ts-ui282.js +7 -0
  204. package/dist/als-react-ts-ui283.js +6 -0
  205. package/dist/als-react-ts-ui284.js +14 -0
  206. package/dist/als-react-ts-ui285.js +92 -0
  207. package/dist/als-react-ts-ui286.js +58 -0
  208. package/dist/als-react-ts-ui287.js +4 -0
  209. package/dist/als-react-ts-ui288.js +26 -0
  210. package/dist/als-react-ts-ui289.js +155 -0
  211. package/dist/als-react-ts-ui29.js +9 -0
  212. package/dist/als-react-ts-ui290.js +116 -0
  213. package/dist/als-react-ts-ui291.js +67 -0
  214. package/dist/als-react-ts-ui292.js +14 -0
  215. package/dist/als-react-ts-ui293.js +14 -0
  216. package/dist/als-react-ts-ui294.js +63 -0
  217. package/dist/als-react-ts-ui295.js +62 -0
  218. package/dist/als-react-ts-ui296.js +90 -0
  219. package/dist/als-react-ts-ui297.js +19 -0
  220. package/dist/als-react-ts-ui298.js +211 -0
  221. package/dist/als-react-ts-ui299.js +6 -0
  222. package/dist/als-react-ts-ui3.js +142 -0
  223. package/dist/als-react-ts-ui30.js +9 -0
  224. package/dist/als-react-ts-ui300.js +16 -0
  225. package/dist/als-react-ts-ui301.js +50 -0
  226. package/dist/als-react-ts-ui302.js +15 -0
  227. package/dist/als-react-ts-ui303.js +17 -0
  228. package/dist/als-react-ts-ui304.js +17 -0
  229. package/dist/als-react-ts-ui305.js +78 -0
  230. package/dist/als-react-ts-ui306.js +183 -0
  231. package/dist/als-react-ts-ui307.js +57 -0
  232. package/dist/als-react-ts-ui308.js +32 -0
  233. package/dist/als-react-ts-ui309.js +16 -0
  234. package/dist/als-react-ts-ui31.js +9 -0
  235. package/dist/als-react-ts-ui310.js +11 -0
  236. package/dist/als-react-ts-ui311.js +209 -0
  237. package/dist/als-react-ts-ui312.js +401 -0
  238. package/dist/als-react-ts-ui313.js +17 -0
  239. package/dist/als-react-ts-ui314.js +14 -0
  240. package/dist/als-react-ts-ui315.js +12 -0
  241. package/dist/als-react-ts-ui316.js +6 -0
  242. package/dist/als-react-ts-ui317.js +130 -0
  243. package/dist/als-react-ts-ui318.js +47 -0
  244. package/dist/als-react-ts-ui319.js +20 -0
  245. package/dist/als-react-ts-ui32.js +11 -0
  246. package/dist/als-react-ts-ui320.js +14 -0
  247. package/dist/als-react-ts-ui321.js +7 -0
  248. package/dist/als-react-ts-ui322.js +14 -0
  249. package/dist/als-react-ts-ui323.js +16 -0
  250. package/dist/als-react-ts-ui324.js +6 -0
  251. package/dist/als-react-ts-ui325.js +6 -0
  252. package/dist/als-react-ts-ui326.js +14 -0
  253. package/dist/als-react-ts-ui327.js +6 -0
  254. package/dist/als-react-ts-ui328.js +28 -0
  255. package/dist/als-react-ts-ui329.js +597 -0
  256. package/dist/als-react-ts-ui33.js +173 -0
  257. package/dist/als-react-ts-ui330.js +44 -0
  258. package/dist/als-react-ts-ui331.js +41 -0
  259. package/dist/als-react-ts-ui332.js +59 -0
  260. package/dist/als-react-ts-ui333.js +10 -0
  261. package/dist/als-react-ts-ui334.js +14 -0
  262. package/dist/als-react-ts-ui335.js +14 -0
  263. package/dist/als-react-ts-ui336.js +14 -0
  264. package/dist/als-react-ts-ui337.js +23 -0
  265. package/dist/als-react-ts-ui338.js +6 -0
  266. package/dist/als-react-ts-ui339.js +10 -0
  267. package/dist/als-react-ts-ui34.js +9 -0
  268. package/dist/als-react-ts-ui340.js +19 -0
  269. package/dist/als-react-ts-ui341.js +14 -0
  270. package/dist/als-react-ts-ui342.js +15 -0
  271. package/dist/als-react-ts-ui343.js +6 -0
  272. package/dist/als-react-ts-ui344.js +324 -0
  273. package/dist/als-react-ts-ui345.js +5 -0
  274. package/dist/als-react-ts-ui346.js +489 -0
  275. package/dist/als-react-ts-ui347.js +23 -0
  276. package/dist/als-react-ts-ui348.js +8 -0
  277. package/dist/als-react-ts-ui349.js +6 -0
  278. package/dist/als-react-ts-ui35.js +9 -0
  279. package/dist/als-react-ts-ui350.js +10 -0
  280. package/dist/als-react-ts-ui351.js +4 -0
  281. package/dist/als-react-ts-ui352.js +57 -0
  282. package/dist/als-react-ts-ui353.js +58 -0
  283. package/dist/als-react-ts-ui354.js +10 -0
  284. package/dist/als-react-ts-ui355.js +14 -0
  285. package/dist/als-react-ts-ui356.js +9 -0
  286. package/dist/als-react-ts-ui357.js +4 -0
  287. package/dist/als-react-ts-ui358.js +34 -0
  288. package/dist/als-react-ts-ui359.js +14 -0
  289. package/dist/als-react-ts-ui36.js +9 -0
  290. package/dist/als-react-ts-ui360.js +4 -0
  291. package/dist/als-react-ts-ui361.js +6 -0
  292. package/dist/als-react-ts-ui362.js +6 -0
  293. package/dist/als-react-ts-ui363.js +78 -0
  294. package/dist/als-react-ts-ui364.js +4 -0
  295. package/dist/als-react-ts-ui365.js +10 -0
  296. package/dist/als-react-ts-ui366.js +4 -0
  297. package/dist/als-react-ts-ui367.js +6 -0
  298. package/dist/als-react-ts-ui368.js +134 -0
  299. package/dist/als-react-ts-ui369.js +4 -0
  300. package/dist/als-react-ts-ui37.js +9 -0
  301. package/dist/als-react-ts-ui370.js +46 -0
  302. package/dist/als-react-ts-ui371.js +58 -0
  303. package/dist/als-react-ts-ui372.js +4 -0
  304. package/dist/als-react-ts-ui373.js +4 -0
  305. package/dist/als-react-ts-ui38.js +257 -0
  306. package/dist/als-react-ts-ui39.js +48 -0
  307. package/dist/als-react-ts-ui4.js +158 -0
  308. package/dist/als-react-ts-ui40.js +96 -0
  309. package/dist/als-react-ts-ui41.js +78 -0
  310. package/dist/als-react-ts-ui42.js +23 -0
  311. package/dist/als-react-ts-ui43.js +111 -0
  312. package/dist/als-react-ts-ui44.js +112 -0
  313. package/dist/als-react-ts-ui45.js +40 -0
  314. package/dist/als-react-ts-ui46.js +45 -0
  315. package/dist/als-react-ts-ui47.js +55 -0
  316. package/dist/als-react-ts-ui48.js +39 -0
  317. package/dist/als-react-ts-ui49.js +50 -0
  318. package/dist/als-react-ts-ui5.js +26 -0
  319. package/dist/als-react-ts-ui50.js +79 -0
  320. package/dist/als-react-ts-ui51.js +24 -0
  321. package/dist/als-react-ts-ui52.js +24 -0
  322. package/dist/als-react-ts-ui53.js +40 -0
  323. package/dist/als-react-ts-ui54.js +30 -0
  324. package/dist/als-react-ts-ui55.js +208 -0
  325. package/dist/als-react-ts-ui56.js +17 -0
  326. package/dist/als-react-ts-ui57.js +24 -0
  327. package/dist/als-react-ts-ui58.js +30 -0
  328. package/dist/als-react-ts-ui59.js +39 -0
  329. package/dist/als-react-ts-ui6.js +103 -0
  330. package/dist/als-react-ts-ui60.js +30 -0
  331. package/dist/als-react-ts-ui61.js +24 -0
  332. package/dist/als-react-ts-ui62.js +7 -0
  333. package/dist/als-react-ts-ui63.js +7 -0
  334. package/dist/als-react-ts-ui64.js +7 -0
  335. package/dist/als-react-ts-ui65.js +7 -0
  336. package/dist/als-react-ts-ui66.js +7 -0
  337. package/dist/als-react-ts-ui67.js +25 -0
  338. package/dist/als-react-ts-ui68.js +50 -0
  339. package/dist/als-react-ts-ui69.js +7 -0
  340. package/dist/als-react-ts-ui7.js +42 -0
  341. package/dist/als-react-ts-ui70.js +7 -0
  342. package/dist/als-react-ts-ui71.js +7 -0
  343. package/dist/als-react-ts-ui72.js +15 -0
  344. package/dist/als-react-ts-ui73.js +13 -0
  345. package/dist/als-react-ts-ui74.js +7 -0
  346. package/dist/als-react-ts-ui75.js +7 -0
  347. package/dist/als-react-ts-ui76.js +7 -0
  348. package/dist/als-react-ts-ui77.js +7 -0
  349. package/dist/als-react-ts-ui78.js +7 -0
  350. package/dist/als-react-ts-ui79.js +17 -0
  351. package/dist/als-react-ts-ui8.js +9 -0
  352. package/dist/als-react-ts-ui80.js +120 -0
  353. package/dist/als-react-ts-ui81.js +110 -0
  354. package/dist/als-react-ts-ui82.js +111 -0
  355. package/dist/als-react-ts-ui83.js +38 -0
  356. package/dist/als-react-ts-ui84.js +26 -0
  357. package/dist/als-react-ts-ui85.js +26 -0
  358. package/dist/als-react-ts-ui86.js +36 -0
  359. package/dist/als-react-ts-ui87.js +39 -0
  360. package/dist/als-react-ts-ui88.js +110 -0
  361. package/dist/als-react-ts-ui89.js +25 -0
  362. package/dist/als-react-ts-ui9.js +9 -0
  363. package/dist/als-react-ts-ui90.js +7 -0
  364. package/dist/als-react-ts-ui91.js +74 -0
  365. package/dist/als-react-ts-ui92.js +7 -0
  366. package/dist/als-react-ts-ui93.js +7 -0
  367. package/dist/als-react-ts-ui94.js +21 -0
  368. package/dist/als-react-ts-ui95.js +6 -0
  369. package/dist/als-react-ts-ui96.js +6 -0
  370. package/dist/als-react-ts-ui97.js +141 -0
  371. package/dist/als-react-ts-ui98.js +34 -0
  372. package/dist/als-react-ts-ui99.js +30 -0
  373. package/dist/components/ALSAccordion/index.module.css +1 -0
  374. package/dist/components/ALSAlertDialog/ALSAlertDialog.d.ts +106 -0
  375. package/dist/components/ALSAlertDialog/ALSAlertDialog.d.ts.map +1 -0
  376. package/dist/components/ALSAlertDialog/index.d.ts +16 -4
  377. package/dist/components/ALSAlertDialog/index.d.ts.map +1 -1
  378. package/dist/components/ALSAlertDialog/index.module.css +1 -0
  379. package/dist/components/ALSAutocomplete/ALSAutocomplete.d.ts +46 -0
  380. package/dist/components/ALSAutocomplete/ALSAutocomplete.d.ts.map +1 -0
  381. package/dist/components/ALSAutocomplete/index.d.ts +25 -4
  382. package/dist/components/ALSAutocomplete/index.d.ts.map +1 -1
  383. package/dist/components/ALSAutocomplete/index.module.css +1 -0
  384. package/dist/components/ALSAvatar/index.d.ts +75 -3
  385. package/dist/components/ALSAvatar/index.d.ts.map +1 -1
  386. package/dist/components/ALSAvatar/index.module.css +1 -0
  387. package/dist/components/ALSButton/index.module.css +1 -0
  388. package/dist/components/ALSCheckbox/index.module.css +0 -0
  389. package/dist/components/ALSDialog/index.module.css +1 -0
  390. package/dist/components/ALSInput/index.module.css +1 -0
  391. package/dist/components/ALSPopover/index.module.css +1 -0
  392. package/dist/components/ALSProgress/index.module.css +1 -0
  393. package/dist/components/ALSSelect/index.module.css +1 -0
  394. package/dist/components/ALSTabs/index.module.css +1 -0
  395. package/dist/components/ALSToast/index.module.css +1 -0
  396. package/dist/{als-react-ts-ui.css → index.css} +1 -1
  397. package/dist/index.d.ts +1 -1
  398. package/dist/index.d.ts.map +1 -1
  399. package/dist/layout/MainLayout/index.module.css +1 -0
  400. package/package.json +1 -1
  401. package/dist/als-react-ts-ui.cjs +0 -21
  402. package/dist/als-react-ts-ui.cjs.map +0 -1
  403. package/dist/als-react-ts-ui.js.map +0 -1
@@ -1,21 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),Z=require("react"),yu=require("react-dom");function Ai(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=Ai(Z),it=Ai(yu);function pn({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=a.useRef(e!==void 0),[s,i]=a.useState(t),c=r?e:s;if(process.env.NODE_ENV!=="production"){a.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${o} state of ${n} to be ${r?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
2
- `))},[o,n,e]);const{current:l}=a.useRef(t);a.useEffect(()=>{!r&&JSON.stringify(l)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${o} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
3
- `))},[JSON.stringify(t)])}const u=a.useCallback(l=>{r||i(l)},[]);return[c,u]}const Is={};function Je(e,t){const n=a.useRef(Is);return n.current===Is&&(n.current=e(t)),n}const Uo=a[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],bu=Uo&&Uo!==a.useLayoutEffect?Uo:e=>e();function Q(e){const t=Je(vu).current;return t.next=e,bu(t.effect),t.trampoline}function vu(){const e={next:void 0,callback:xu,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function xu(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Eu=()=>{},J=typeof document<"u"?a.useLayoutEffect:Eu;let lr;process.env.NODE_ENV!=="production"&&(lr=new Set);function Nr(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");lr.has(t)||(lr.add(t),console.warn(`Base UI: ${t}`))}}const Ar=a.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(Ar.displayName="CompositeListContext");function Su(){return a.useContext(Ar)}function Ro(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=Q(r),i=a.useRef(0),c=Je(wu).current,u=Je(Ru).current,[l,d]=a.useState(0),f=a.useRef(l),p=Q((b,y)=>{u.set(b,y??null),f.current+=1,d(f.current)}),g=Q(b=>{u.delete(b),f.current+=1,d(f.current)}),m=a.useMemo(()=>{const b=new Map;return Array.from(u.keys()).sort(Cu).forEach((x,v)=>{const R=u.get(x)??{};b.set(x,{...R,index:v})}),b},[u,l]);J(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const b=new MutationObserver(y=>{const x=new Set,v=R=>x.has(R)?x.delete(R):x.add(R);y.forEach(R=>{R.removedNodes.forEach(v),R.addedNodes.forEach(v)}),x.size===0&&(f.current+=1,d(f.current))});return m.forEach((y,x)=>{x.parentElement&&b.observe(x.parentElement,{childList:!0})}),()=>{b.disconnect()}},[m]),J(()=>{f.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),o&&o.current.length!==m.size&&(o.current.length=m.size),i.current=m.size),s(m)},[s,m,n,o,l]),J(()=>()=>{n.current=[]},[n]),J(()=>()=>{o&&(o.current=[])},[o]);const h=Q(b=>(c.add(b),()=>{c.delete(b)}));J(()=>{c.forEach(b=>b(m))},[c,m]);const E=a.useMemo(()=>({register:p,unregister:g,subscribeMapChange:h,elementsRef:n,labelsRef:o,nextIndexRef:i}),[p,g,h,n,o,i]);return P.jsx(Ar.Provider,{value:E,children:t})}function Ru(){return new Map}function wu(){return new Set}function Cu(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Ii=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ii.displayName="DirectionContext");function En(){return a.useContext(Ii)?.direction??"ltr"}function Oe(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}const Ir=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ir.displayName="AccordionRootContext");function Mr(){const e=a.useContext(Ir);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: AccordionRootContext is missing. Accordion parts must be placed within <Accordion.Root>.":Oe(10));return e}function gt(e,t,n,o){const r=Je(Mi).current;return _u(r,e,t,n,o)&&Li(r,[e,t,n,o]),r.callback}function Tu(e){const t=Je(Mi).current;return Ou(t,e)&&Li(t,e),t.callback}function Mi(){return{callback:null,cleanup:null,refs:[]}}function _u(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Ou(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Li(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Pu=parseInt(a.version,10);function Di(e){return Pu>=e}function Ms(e){if(!a.isValidElement(e))return null;const t=e,n=t.props;return(Di(19)?n?.ref:t.ref)??null}function ur(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Nu(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function Au(e,t){return typeof e=="function"?e(t):e}function Iu(e,t){return typeof e=="function"?e(t):e}const Dn={};function Lr(e,t,n,o,r){let s={...dr(e,Dn)};return t&&(s=Mn(s,t)),n&&(s=Mn(s,n)),o&&(s=Mn(s,o)),r&&(s=Mn(s,r)),s}function Mu(e){if(e.length===0)return Dn;if(e.length===1)return dr(e[0],Dn);let t={...dr(e[0],Dn)};for(let n=1;n<e.length;n+=1)t=Mn(t,e[n]);return t}function Mn(e,t){return ki(t)?t(e):Lu(e,t)}function Lu(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=ur(e.style,o);break}case"className":{e[n]=Fi(e.className,o);break}default:Du(n,o)?e[n]=ku(e[n],o):e[n]=o}}return e}function Du(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function ki(e){return typeof e=="function"}function dr(e,t){return ki(e)?e(t):e??Dn}function ku(e,t){return t?e?n=>{if(Fu(n)){const r=n;fr(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function fr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Fi(e,t){return t?e?t+" "+e:t:e}function Fu(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function ot(){}const gn=Object.freeze([]),$e=Object.freeze({}),Vu=500,ju={style:{transition:"none"}},Dr="data-base-ui-click-trigger",Bu={fallbackAxisSide:"none"},$u={fallbackAxisSide:"end"},Hu={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ue(e,t,n={}){const o=t.render,r=zu(t,n);if(n.enabled===!1)return null;const s=n.state??$e;return Wu(e,o,r,s)}function zu(e,t={}){const{className:n,style:o,render:r}=e,{state:s=$e,ref:i,props:c,stateAttributesMapping:u,enabled:l=!0}=t,d=l?Au(n,s):void 0,f=l?Iu(o,s):void 0,p=l?Nu(s,u):$e,g=l?ur(p,Array.isArray(c)?Mu(c):c)??$e:$e;return typeof document<"u"&&(l?Array.isArray(i)?g.ref=Tu([g.ref,Ms(r),...i]):g.ref=gt(g.ref,Ms(r),i):gt(null,null)),l?(d!==void 0&&(g.className=Fi(g.className,d)),f!==void 0&&(g.style=ur(g.style,f)),g):$e}function Wu(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Lr(n,t.props);return r.ref=n.ref,a.cloneElement(t,r)}if(e&&typeof e=="string")return Uu(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Oe(8))}function Uu(e,t){return e==="button"?Z.createElement("button",{type:"button",...t,key:t.key}):e==="img"?Z.createElement("img",{alt:"",...t,key:t.key}):a.createElement(e,t)}const Dt="none",xt="trigger-press",rt="trigger-hover",Vi="outside-press",Ko="item-press",ji="close-press",Zt="focus-out",Bi="escape-key",qo="list-navigation",Ku="cancel-open",$i="imperative-action",qu="window-resize";function me(e,t,n,o){let r=!1,s=!1;const i=o??$e;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}const Yu={value:()=>null},Hi=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,hiddenUntilFound:i,keepMounted:c,loopFocus:u=!0,onValueChange:l,multiple:d=!1,orientation:f="vertical",value:p,defaultValue:g,...m}=t,h=En();process.env.NODE_ENV!=="production"&&J(()=>{i&&c===!1&&Nr("The `keepMounted={false}` prop on a Accordion.Root will be ignored when using `hiddenUntilFound` since it requires Panels to remain mounted when closed.")},[i,c]);const E=a.useMemo(()=>{if(p===void 0)return g??[]},[p,g]),b=Q(l),y=a.useRef([]),[x,v]=pn({controlled:p,default:E,name:"Accordion",state:"value"}),R=Q((M,k)=>{const L=me(Dt);if(d)if(k){const O=x.slice();if(O.push(M),b(O,L),L.isCanceled)return;v(O)}else{const O=x.filter(S=>S!==M);if(b(O,L),L.isCanceled)return;v(O)}else{const O=x[0]===M?[]:[M];if(b(O,L),L.isCanceled)return;v(O)}}),w=a.useMemo(()=>({value:x,disabled:s,orientation:f}),[x,s,f]),_=a.useMemo(()=>({accordionItemRefs:y,direction:h,disabled:s,handleValueChange:R,hiddenUntilFound:i??!1,keepMounted:c??!1,loopFocus:u,orientation:f,state:w,value:x}),[h,s,R,i,c,u,f,w,x]),N=ue("div",t,{state:w,ref:n,props:[{dir:h,role:"region"},m],stateAttributesMapping:Yu});return P.jsx(Ir.Provider,{value:_,children:P.jsx(Ro,{elementsRef:y,children:N})})});process.env.NODE_ENV!=="production"&&(Hi.displayName="AccordionRoot");const Gu={...a};let Ls=0;function Xu(e,t="mui"){const[n,o]=a.useState(e),r=e||n;return a.useEffect(()=>{n==null&&(Ls+=1,o(`${t}-${Ls}`))},[n,t]),r}const Ds=Gu.useId;function Ft(e,t){if(Ds!==void 0){const n=Ds();return e??(t?`${t}-${n}`:n)}return Xu(e,t)}function Qe(e){return Ft(e,"base-ui")}const Zu=[];function zn(e){a.useEffect(e,Zu)}const Gn=null;let ks=globalThis.requestAnimationFrame;class Ju{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const o=process.env.NODE_ENV==="test"&&ks!==requestAnimationFrame&&(ks=requestAnimationFrame,!0);return(!this.isScheduled||o)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Xn=new Ju;class Me{static create(){return new Me}static request(t){return Xn.request(t)}static cancel(t){return Xn.cancel(t)}currentId=Gn;request(t){this.cancel(),this.currentId=Xn.request(()=>{this.currentId=Gn,t()})}cancel=()=>{this.currentId!==Gn&&(Xn.cancel(this.currentId),this.currentId=Gn)};disposeEffect=()=>this.cancel}function Sn(){const e=Je(Me.create).current;return zn(e.disposeEffect),e}function qt(e){return e==null?e:"current"in e?e.current:e}function wo(e,t=!1,n=!0){const o=Sn();return Q((r,s=null)=>{o.cancel();const i=qt(e);i!=null&&(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?r():o.request(()=>{function c(){i&&Promise.all(i.getAnimations().map(u=>u.finished)).then(()=>{s!=null&&s.aborted||it.flushSync(r)}).catch(()=>{if(n){if(s!=null&&s.aborted)return;it.flushSync(r)}else i.getAnimations().length>0&&i.getAnimations().some(u=>u.pending||u.playState!=="finished")&&c()})}t?o.request(c):c()}))})}function Co(e,t=!1,n=!1){const[o,r]=a.useState(e&&t?"idle":void 0),[s,i]=a.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),J(()=>{if(!e&&s&&o!=="ending"&&n){const c=Me.request(()=>{r("ending")});return()=>{Me.cancel(c)}}},[e,s,o,n]),J(()=>{if(!e||t)return;const c=Me.request(()=>{it.flushSync(()=>{r(void 0)})});return()=>{Me.cancel(c)}},[t,e]),J(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const c=Me.request(()=>{r("idle")});return()=>{Me.cancel(c)}},[t,e,s,r,o]),a.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}function Qu(e){const{open:t,defaultOpen:n,onOpenChange:o,disabled:r}=e,s=t!==void 0,[i,c]=pn({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:u,setMounted:l,transitionStatus:d}=Co(i,!0,!0),[f,p]=a.useState(i),[{height:g,width:m},h]=a.useState({height:void 0,width:void 0}),E=Qe(),[b,y]=a.useState(),x=b??E,[v,R]=a.useState(!1),[w,_]=a.useState(!1),N=a.useRef(null),M=a.useRef(null),k=a.useRef(null),L=a.useRef(null),O=wo(L,!1),S=Q(I=>{const T=!i,A=me(xt,I.nativeEvent);if(o(T,A),A.isCanceled)return;const D=L.current;M.current==="css-animation"&&D!=null&&D.style.removeProperty("animation-name"),!v&&!w&&(M.current!=null&&M.current!=="css-animation"&&!u&&T&&l(!0),M.current==="css-animation"&&(!f&&T&&p(!0),!u&&T&&l(!0))),c(T),M.current==="none"&&u&&!T&&l(!1)});return J(()=>{s&&M.current==="none"&&!w&&!i&&l(!1)},[s,w,i,t,l]),a.useMemo(()=>({abortControllerRef:N,animationTypeRef:M,disabled:r,handleTrigger:S,height:g,mounted:u,open:i,panelId:x,panelRef:L,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:R,setKeepMounted:_,setMounted:l,setOpen:c,setPanelIdState:y,setVisible:p,transitionDimensionRef:k,transitionStatus:d,visible:f,width:m}),[N,M,r,S,g,u,i,x,L,O,h,R,_,l,c,p,k,d,f,m])}const kr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(kr.displayName="CollapsibleRootContext");function zi(){const e=a.useContext(kr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.":Oe(15));return e}let Wi=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function To(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:c,subscribeMapChange:u,elementsRef:l,labelsRef:d,nextIndexRef:f}=Su(),p=a.useRef(-1),[g,m]=a.useState(s??(r===Wi.GuessFromOrder?()=>{if(p.current===-1){const b=f.current;f.current+=1,p.current=b}return p.current}:-1)),h=a.useRef(null),E=a.useCallback(b=>{if(h.current=b,g!==-1&&b!==null&&(l.current[g]=b,d)){const y=t!==void 0;d.current[g]=y?t:o?.current?.textContent??b.textContent}},[g,l,d,t,o]);return J(()=>{if(s!=null)return;const b=h.current;if(b)return i(b,n),()=>{c(b)}},[s,i,c,n]),J(()=>{if(s==null)return u(b=>{const y=h.current?b.get(h.current)?.index:null;y!=null&&m(y)})},[s,u,m]),a.useMemo(()=>({ref:E,index:g}),[g,E])}const Fr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Fr.displayName="AccordionItemContext");function Vr(){const e=a.useContext(Fr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: AccordionItemContext is missing. Accordion parts must be placed within <Accordion.Item>.":Oe(9));return e}let mn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const ed={[mn.startingStyle]:""},td={[mn.endingStyle]:""},Vt={transitionStatus(e){return e==="starting"?ed:e==="ending"?td:null}};let kn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=mn.startingStyle]="startingStyle",e[e.endingStyle=mn.endingStyle]="endingStyle",e})({}),nd=(function(e){return e.panelOpen="data-panel-open",e})({});const od={[kn.open]:""},rd={[kn.closed]:""},sd={open(e){return e?{[nd.panelOpen]:""}:null}},id={open(e){return e?od:rd}};let cd=(function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e})({});const jr={...id,index:e=>Number.isInteger(e)?{[cd.index]:String(e)}:null,...Vt,value:()=>null},Ui=a.forwardRef(function(t,n){const{className:o,disabled:r=!1,onOpenChange:s,render:i,value:c,...u}=t,{ref:l,index:d}=To(),f=gt(n,l),{disabled:p,handleValueChange:g,state:m,value:h}=Mr(),E=Qe(),b=c??E,y=r||p,x=a.useMemo(()=>{if(!h)return!1;for(let S=0;S<h.length;S+=1)if(h[S]===b)return!0;return!1},[h,b]),v=Q((S,I)=>{s?.(S,I),!I.isCanceled&&g(b,S)}),R=Qu({open:x,onOpenChange:v,disabled:y}),w=a.useMemo(()=>({open:R.open,disabled:R.disabled,hidden:!R.mounted,transitionStatus:R.transitionStatus}),[R.open,R.disabled,R.mounted,R.transitionStatus]),_=a.useMemo(()=>({...R,onOpenChange:v,state:w}),[R,w,v]),N=a.useMemo(()=>({...m,index:d,disabled:y,open:x}),[y,d,x,m]),[M,k]=a.useState(Qe()),L=a.useMemo(()=>({open:x,state:N,setTriggerId:k,triggerId:M}),[x,N,k,M]),O=ue("div",t,{state:N,ref:f,props:u,stateAttributesMapping:jr});return P.jsx(kr.Provider,{value:_,children:P.jsx(Fr.Provider,{value:L,children:O})})});process.env.NODE_ENV!=="production"&&(Ui.displayName="AccordionItem");const Ki=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{state:i}=Vr();return ue("h3",t,{state:i,ref:n,props:s,stateAttributesMapping:jr})});process.env.NODE_ENV!=="production"&&(Ki.displayName="AccordionHeader");function pr(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function _o(){return typeof window<"u"}function jt(e){return Br(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ht(e){var t;return(t=(Br(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Br(e){return _o()?e instanceof Node||e instanceof Le(e).Node:!1}function Te(e){return _o()?e instanceof Element||e instanceof Le(e).Element:!1}function Ae(e){return _o()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function gr(e){return!_o()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}const ad=new Set(["inline","contents"]);function nn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ad.has(r)}const ld=new Set(["table","td","th"]);function ud(e){return ld.has(jt(e))}const dd=[":popover-open",":modal"];function Oo(e){return dd.some(t=>{try{return e.matches(t)}catch{return!1}})}const fd=["transform","translate","scale","rotate","perspective"],pd=["transform","translate","scale","rotate","perspective","filter"],gd=["paint","layout","strict","content"];function $r(e){const t=Po(),n=Te(e)?et(e):e;return fd.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||pd.some(o=>(n.willChange||"").includes(o))||gd.some(o=>(n.contain||"").includes(o))}function md(e){let t=Rt(e);for(;Ae(t)&&!Et(t);){if($r(t))return t;if(Oo(t))return null;t=Rt(t)}return null}function Po(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const hd=new Set(["html","body","#document"]);function Et(e){return hd.has(jt(e))}function et(e){return Le(e).getComputedStyle(e)}function No(e){return Te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if(jt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gr(e)&&e.host||ht(e);return gr(t)?t.host:t}function qi(e){const t=Rt(e);return Et(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ae(t)&&nn(t)?t:qi(t)}function Pt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=qi(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=Le(r);if(s){const c=mr(i);return t.concat(i,i.visualViewport||[],nn(r)?r:[],c&&n?Pt(c):[])}return t.concat(r,Pt(r,[],n))}function mr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let hr;process.env.NODE_ENV!=="production"&&(hr=new Set);function Fs(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");hr.has(t)||(hr.add(t),console.error(`Base UI: ${t}`))}}const Hr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Hr.displayName="CompositeRootContext");function Yi(e=!1){const t=a.useContext(Hr);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Oe(16));return t}function yd(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,c=o&&t===!1;return{props:a.useMemo(()=>{const l={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||c)&&(l.disabled=n),l},[o,n,t,i,c,s,r])}}function yt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=a.useRef(null),i=Yi(!0)!==void 0,c=Q(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:u}=yd({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r});process.env.NODE_ENV!=="production"&&a.useEffect(()=>{if(!s.current)return;const p=s.current.tagName==="BUTTON";r?p||Fs("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`."):p&&Fs("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.")},[r]);const l=a.useCallback(()=>{const p=s.current;bd(p)&&i&&t&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,u.disabled,i]);J(l,[l]);const d=a.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:h,onKeyDown:E,onPointerDown:b,...y}=p;return Lr({type:r?"button":void 0,onClick(v){if(t){v.preventDefault();return}g?.(v)},onMouseDown(v){t||m?.(v)},onKeyDown(v){if(t||(fr(v),E?.(v)),v.baseUIHandlerPrevented)return;const R=v.target===v.currentTarget&&!r&&!c()&&!t,w=v.key==="Enter",_=v.key===" ";R&&((_||w)&&v.preventDefault(),w&&g?.(v))},onKeyUp(v){t||(fr(v),h?.(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!r&&!t&&v.key===" "&&g?.(v)},onPointerDown(v){if(t){v.preventDefault();return}b?.(v)}},r?void 0:{role:"button"},u,y)},[t,u,r,c]),f=Q(p=>{s.current=p,l()});return{getButtonProps:d,buttonRef:f}}function bd(e){return Ae(e)&&e.tagName==="BUTTON"}const Rn=typeof navigator<"u",Yo=Ed(),Gi=Rd(),Xi=Sd(),Zi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),vd=Yo.platform==="MacIntel"&&Yo.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Yo.platform),xd=Rn&&/apple/i.test(navigator.vendor),yr=Rn&&/android/i.test(Gi)||/android/i.test(Xi);Rn&&Gi.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Ji=Xi.includes("jsdom/");function Ed(){if(!Rn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Sd(){if(!Rn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Rd(){if(!Rn)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const br="data-base-ui-focusable",Qi="active",ec="selected",tc="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Nt="ArrowLeft",At="ArrowRight",zr="ArrowUp",Wn="ArrowDown";function st(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ee(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&gr(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function dt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function wd(e){return e.matches("html,body")}function De(e){return e?.ownerDocument||document}function nc(e){return Ae(e)&&e.matches(tc)}function vr(e){return e?e.getAttribute("role")==="combobox"&&nc(e):!1}function xr(e){if(!e||Ji)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Fn(e){return e?e.hasAttribute(br)?e:e.querySelector(`[${br}]`)||e:null}function Gt(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...Gt(e,r.id,n)])}function Vs(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function We(e){e.preventDefault(),e.stopPropagation()}function Cd(e){return"nativeEvent"in e}function oc(e){return e.mozInputSource===0&&e.isTrusted?!0:yr&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function rc(e){return Ji?!1:!yr&&e.width===0&&e.height===0||yr&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function hn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}const Td=["top","right","bottom","left"],yn=Math.min,nt=Math.max,bn=Math.round,cn=Math.floor,ft=e=>({x:e,y:e}),_d={left:"right",right:"left",bottom:"top",top:"bottom"},Od={start:"end",end:"start"};function Er(e,t,n){return nt(e,yn(t,n))}function wt(e,t){return typeof e=="function"?e(t):e}function Ze(e){return e.split("-")[0]}function Bt(e){return e.split("-")[1]}function Wr(e){return e==="x"?"y":"x"}function Ur(e){return e==="y"?"height":"width"}const Pd=new Set(["top","bottom"]);function lt(e){return Pd.has(Ze(e))?"y":"x"}function Kr(e){return Wr(lt(e))}function Nd(e,t,n){n===void 0&&(n=!1);const o=Bt(e),r=Kr(e),s=Ur(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=mo(i)),[i,mo(i)]}function Ad(e){const t=mo(e);return[Sr(e),t,Sr(t)]}function Sr(e){return e.replace(/start|end/g,t=>Od[t])}const js=["left","right"],Bs=["right","left"],Id=["top","bottom"],Md=["bottom","top"];function Ld(e,t,n){switch(e){case"top":case"bottom":return n?t?Bs:js:t?js:Bs;case"left":case"right":return t?Id:Md;default:return[]}}function Dd(e,t,n,o){const r=Bt(e);let s=Ld(Ze(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Sr)))),s}function mo(e){return e.replace(/left|right|bottom|top/g,t=>_d[t])}function kd(e){return{top:0,right:0,bottom:0,left:0,...e}}function sc(e){return typeof e!="number"?kd(e):{top:e,right:e,bottom:e,left:e}}function ho(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Zn(e,t,n){return Math.floor(e/t)!==n}function an(e,t){return t<0||t>=e.current.length}function lo(e,t){return ze(e,{disabledIndices:t})}function Rr(e,t){return ze(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ze(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.current.length-1&&It(e,s,o));return s}function ic(e,{event:t,orientation:n,loopFocus:o,rtl:r,cols:s,disabledIndices:i,minIndex:c,maxIndex:u,prevIndex:l,stopEvent:d=!1}){let f=l;const p=[],g={};let m=!1;{let b=null,y=-1;e.current.forEach((x,v)=>{if(x==null)return;const R=x.closest('[role="row"]');R&&(m=!0),(R!==b||y===-1)&&(b=R,y+=1,p[y]=[]),p[y].push(v),g[v]=y})}const h=m&&p.length>0&&p.some(b=>b.length!==s);function E(b){if(!h||l===-1)return;const y=g[l];if(y==null)return;const x=p[y].indexOf(l);let v=b==="up"?y-1:y+1;o&&(v<0?v=p.length-1:v>=p.length&&(v=0));const R=new Set;for(;v>=0&&v<p.length&&!R.has(v);){R.add(v);const w=p[v];if(w.length===0){v=b==="up"?v-1:v+1;continue}const _=Math.min(x,w.length-1);for(let N=_;N>=0;N-=1){const M=w[N];if(!It(e,M,i))return M}v=b==="up"?v-1:v+1,o&&(v<0?v=p.length-1:v>=p.length&&(v=0))}}if(t.key===zr){const b=E("up");if(b!==void 0)d&&We(t),f=b;else{if(d&&We(t),l===-1)f=u;else if(f=ze(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:i}),o&&(l-s<c||f<0)){const y=l%s,x=u%s,v=u-(x-y);x===y?f=u:f=x>y?v:v-s}an(e,f)&&(f=l)}}if(t.key===Wn){const b=E("down");b!==void 0?(d&&We(t),f=b):(d&&We(t),l===-1?f=c:(f=ze(e,{startingIndex:l,amount:s,disabledIndices:i}),o&&l+s>u&&(f=ze(e,{startingIndex:l%s-s,amount:s,disabledIndices:i}))),an(e,f)&&(f=l))}if(n==="both"){const b=cn(l/s);t.key===(r?Nt:At)&&(d&&We(t),l%s!==s-1?(f=ze(e,{startingIndex:l,disabledIndices:i}),o&&Zn(f,s,b)&&(f=ze(e,{startingIndex:l-l%s-1,disabledIndices:i}))):o&&(f=ze(e,{startingIndex:l-l%s-1,disabledIndices:i})),Zn(f,s,b)&&(f=l)),t.key===(r?At:Nt)&&(d&&We(t),l%s!==0?(f=ze(e,{startingIndex:l,decrement:!0,disabledIndices:i}),o&&Zn(f,s,b)&&(f=ze(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i}))):o&&(f=ze(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i})),Zn(f,s,b)&&(f=l));const y=cn(u/s)===b;an(e,f)&&(o&&y?f=t.key===(r?At:Nt)?u:ze(e,{startingIndex:l-l%s-1,disabledIndices:i}):f=l)}return f}function cc(e,t,n){const o=[];let r=0;return e.forEach(({width:s,height:i},c)=>{if(s>t&&process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV!=="production"?`[Floating UI]: Invalid grid - item width at index ${c} is greater than grid columns`:Oe(29,c));let u=!1;for(n&&(r=0);!u;){const l=[];for(let d=0;d<s;d+=1)for(let f=0;f<i;f+=1)l.push(r+d+f*t);r%t+s<=t&&l.every(d=>o[d]==null)?(l.forEach(d=>{o[d]=c}),u=!0):r+=1}}),[...o]}function ac(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function lc(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function It(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}var Fd=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],yo=Fd.join(","),uc=typeof Element>"u",vn=uc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bo=!uc&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Vn=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&Vn(t.parentNode);return i},Vd=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},dc=function(t,n,o){if(Vn(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(yo));return n&&vn.call(t,yo)&&r.unshift(t),r=r.filter(o),r},vo=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Vn(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),u=c.length?c:i.children,l=vo(u,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var d=vn.call(i,yo);d&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Vn(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var g=vo(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,g):r.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return r},fc=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},pc=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Vd(t))&&!fc(t)?0:t.tabIndex},jd=function(t,n){var o=pc(t);return o<0&&n&&!fc(t)?0:o},Bd=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},gc=function(t){return t.tagName==="INPUT"},$d=function(t){return gc(t)&&t.type==="hidden"},Hd=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},zd=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Wd=function(t){if(!t.name)return!0;var n=t.form||bo(t),o=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=zd(r,t.form);return!s||s===t},Ud=function(t){return gc(t)&&t.type==="radio"},Kd=function(t){return Ud(t)&&!Wd(t)},qd=function(t){var n,o=t&&bo(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,c,u;for(s=!!((i=r)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(r)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&r;){var l,d,f;o=bo(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((d=r)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},$s=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Yd=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=vn.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(vn.call(c,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var u=t;t;){var l=t.parentElement,d=bo(t);if(l&&!l.shadowRoot&&r(l)===!0)return $s(t);t.assignedSlot?t=t.assignedSlot:!l&&d!==t.ownerDocument?t=d.host:t=l}t=u}if(qd(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return $s(t);return!1},Gd=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return vn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},wr=function(t,n){return!(n.disabled||Vn(n)||$d(n)||Yd(n,t)||Hd(n)||Gd(n))},Cr=function(t,n){return!(Kd(n)||pc(n)<0||!wr(t,n))},Xd=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},mc=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,c=i?r.scopeParent:r,u=jd(c,i),l=i?mc(r.candidates):c;u===0?i?n.push.apply(n,l):n.push(c):o.push({documentOrder:s,tabIndex:u,item:r,isScope:i,content:l})}),o.sort(Bd).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},Un=function(t,n){n=n||{};var o;return n.getShadowRoot?o=vo([t],n.includeContainer,{filter:Cr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Xd}):o=dc(t,n.includeContainer,Cr.bind(null,n)),mc(o)},Zd=function(t,n){n=n||{};var o;return n.getShadowRoot?o=vo([t],n.includeContainer,{filter:wr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=dc(t,n.includeContainer,wr.bind(null,n)),o},hc=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return vn.call(t,yo)===!1?!1:Cr(n,t)};const wn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function yc(e,t){const n=Un(e,wn()),o=n.length;if(o===0)return;const r=st(De(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function qr(e){return yc(De(e).body,1)||e}function bc(e){return yc(De(e).body,-1)||e}function vc(e,t){if(!e)return null;const n=Un(De(e).body,wn()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function Jd(e){return vc(e,1)}function Qd(e){return vc(e,-1)}function ln(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Ee(n,o)}function ef(e){Un(e,wn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Hs(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const Mt="ArrowUp",vt="ArrowDown",Jt="ArrowLeft",Lt="ArrowRight",Cn="Home",Tn="End",xc=new Set([Jt,Lt]),tf=new Set([Jt,Lt,Cn,Tn]),Ec=new Set([Mt,vt]),nf=new Set([Mt,vt,Cn,Tn]),Sc=new Set([...xc,...Ec]),of=new Set([...Sc,Cn,Tn]),Yr=new Set([Mt,vt,Jt,Lt,Cn,Tn]),rf="Shift",sf="Control",cf="Alt",af="Meta",lf=new Set([rf,sf,cf,af]);function uf(e){return Ae(e)&&e.tagName==="INPUT"}function zs(e){return!!(uf(e)&&e.selectionStart!=null||Ae(e)&&e.tagName==="TEXTAREA")}function Ws(e,t,n,o){if(!e||!t||!t.scrollTo)return;let r=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(i&&o!=="vertical"){const u=Us(e,t,"left"),l=Jn(e),d=Jn(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-l.scrollPaddingRight?r=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+l.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+l.scrollPaddingLeft&&(r=u-d.scrollMarginLeft-l.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginRight<e.scrollLeft+l.scrollPaddingLeft?r=u-d.scrollMarginLeft-l.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-l.scrollPaddingRight&&(r=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+l.scrollPaddingRight))}if(c&&o!=="horizontal"){const u=Us(e,t,"top"),l=Jn(e),d=Jn(t);u-d.scrollMarginTop<e.scrollTop+l.scrollPaddingTop?s=u-d.scrollMarginTop-l.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-l.scrollPaddingBottom&&(s=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+l.scrollPaddingBottom)}e.scrollTo({left:r,top:s,behavior:"auto"})}function Us(e,t,n){const o=n==="left"?"offsetLeft":"offsetTop";let r=0;for(;t.offsetParent&&(r+=t[o],t.offsetParent!==e);)t=t.offsetParent;return r}function Jn(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const df=new Set([vt,Mt,Lt,Jt,Cn,Tn]);function ff(e){const{current:t}=e,n=[];for(let o=0;o<t.length;o+=1){const r=t[o];if(!pr(r)){const s=r?.querySelector('[type="button"]');pr(s)||n.push(s)}}return n}const Rc=a.forwardRef(function(t,n){const{disabled:o,className:r,id:s,render:i,nativeButton:c=!0,...u}=t,{panelId:l,open:d,handleTrigger:f,disabled:p}=zi(),g=o??p,{getButtonProps:m,buttonRef:h}=yt({disabled:g,focusableWhenDisabled:!0,native:c}),{accordionItemRefs:E,direction:b,loopFocus:y,orientation:x}=Mr(),v=b==="rtl",R=x==="horizontal",{state:w,setTriggerId:_,triggerId:N}=Vr();J(()=>(s&&_(s),()=>{_(void 0)}),[s,_]);const M=a.useMemo(()=>({"aria-controls":d?l:void 0,"aria-expanded":d,disabled:g,id:N,onClick:f,onKeyDown(L){if(!df.has(L.key))return;We(L);const O=ff(E),I=O.length-1;let T=-1;const A=O.indexOf(L.target);function D(){y?T=A+1>I?0:A+1:T=Math.min(A+1,I)}function C(){y?T=A===0?I:A-1:T=A-1}switch(L.key){case vt:R||D();break;case Mt:R||C();break;case Lt:R&&(v?C():D());break;case Jt:R&&(v?D():C());break;case"Home":T=0;break;case"End":T=I;break}T>-1&&O[T].focus()}}),[E,g,f,N,R,v,y,d,l]);return ue("button",t,{state:w,ref:[n,h],props:[M,u,m],stateAttributesMapping:sd})});process.env.NODE_ENV!=="production"&&(Rc.displayName="AccordionTrigger");let pf=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function gf(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:o,height:r,hiddenUntilFound:s,keepMounted:i,id:c,mounted:u,onOpenChange:l,open:d,panelRef:f,runOnceAnimationsFinish:p,setDimensions:g,setMounted:m,setOpen:h,setVisible:E,transitionDimensionRef:b,visible:y,width:x}=e,v=a.useRef(!1),R=a.useRef(null),w=a.useRef(d),_=a.useRef(d),N=Sn(),M=a.useMemo(()=>n.current==="css-animation"?!y:!d&&!u,[d,u,y,n]),k=Q(O=>{if(!O)return;if(n.current==null||b.current==null){const T=getComputedStyle(O),A=T.animationName!=="none"&&T.animationName!=="",D=T.transitionDuration!=="0s"&&T.transitionDuration!=="";A&&D?process.env.NODE_ENV!=="production"&&Nr("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):T.animationName==="none"&&T.transitionDuration!=="0s"?n.current="css-transition":T.animationName!=="none"&&T.transitionDuration==="0s"?n.current="css-animation":n.current="none",O.getAttribute(pf.orientation)==="horizontal"||T.transitionProperty.indexOf("width")>-1?b.current="width":b.current="height"}if(n.current!=="css-transition")return;(r===void 0||x===void 0)&&(g({height:O.scrollHeight,width:O.scrollWidth}),_.current&&O.style.setProperty("transition-duration","0s"));let S=-1,I=-1;return S=Me.request(()=>{_.current=!1,I=Me.request(()=>{setTimeout(()=>{O.style.removeProperty("transition-duration")})})}),()=>{Me.cancel(S),Me.cancel(I)}}),L=gt(o,f,k);return J(()=>{if(n.current!=="css-transition")return;const O=f.current;if(!O)return;let S=-1;if(t.current!=null&&(t.current.abort(),t.current=null),d){const I={"justify-content":O.style.justifyContent,"align-items":O.style.alignItems,"align-content":O.style.alignContent,"justify-items":O.style.justifyItems};Object.keys(I).forEach(T=>{O.style.setProperty(T,"initial","important")}),!_.current&&!i&&O.setAttribute(kn.startingStyle,""),g({height:O.scrollHeight,width:O.scrollWidth}),S=Me.request(()=>{Object.entries(I).forEach(([T,A])=>{A===""?O.style.removeProperty(T):O.style.setProperty(T,A)})})}else{if(O.scrollHeight===0&&O.scrollWidth===0)return;g({height:O.scrollHeight,width:O.scrollWidth});const I=new AbortController;t.current=I;const T=I.signal;let A=null;const D=kn.endingStyle;return A=new MutationObserver(C=>{C.some(j=>j.type==="attributes"&&j.attributeName===D)&&(A?.disconnect(),A=null,p(()=>{g({height:0,width:0}),O.style.removeProperty("content-visibility"),m(!1),t.current===I&&(t.current=null)},T))}),A.observe(O,{attributes:!0,attributeFilter:[D]}),()=>{A?.disconnect(),N.cancel(),t.current===I&&(I.abort(),t.current=null)}}return()=>{Me.cancel(S)}},[t,n,N,s,i,u,d,f,p,g,m]),J(()=>{if(n.current!=="css-animation")return;const O=f.current;O&&(R.current=O.style.animationName||R.current,O.style.setProperty("animation-name","none"),g({height:O.scrollHeight,width:O.scrollWidth}),!w.current&&!v.current&&O.style.removeProperty("animation-name"),d?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),E(!0)):(t.current=new AbortController,p(()=>{m(!1),E(!1),t.current=null},t.current.signal)))},[t,n,d,f,p,g,m,E,y]),zn(()=>{const O=Me.request(()=>{w.current=!1});return()=>Me.cancel(O)}),J(()=>{if(!s)return;const O=f.current;if(!O)return;let S=-1,I=-1;return d&&v.current&&(O.style.transitionDuration="0s",g({height:O.scrollHeight,width:O.scrollWidth}),S=Me.request(()=>{v.current=!1,I=Me.request(()=>{setTimeout(()=>{O.style.removeProperty("transition-duration")})})})),()=>{Me.cancel(S),Me.cancel(I)}},[s,d,f,g]),J(()=>{const O=f.current;O&&s&&M&&(O.setAttribute("hidden","until-found"),n.current==="css-transition"&&O.setAttribute(kn.startingStyle,""))},[s,M,n,f]),a.useEffect(function(){const S=f.current;if(!S)return;function I(T){v.current=!0,h(!0),l(!0,me(Dt,T))}return S.addEventListener("beforematch",I),()=>{S.removeEventListener("beforematch",I)}},[l,f,h]),a.useMemo(()=>({props:{hidden:M,id:c,ref:L}}),[M,c,L])}let Ks=(function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e})({});function ke(e){const t=Je(mf,e).current;return t.next=e,J(t.effect),t}function mf(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function $t(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=ke(n),i=Q(r),c=wo(o,n);a.useEffect(()=>{t&&c(()=>{n===s.current&&i()})},[t,n,i,c,s])}const wc=a.forwardRef(function(t,n){const{className:o,hiddenUntilFound:r,keepMounted:s,id:i,render:c,...u}=t,{hiddenUntilFound:l,keepMounted:d}=Mr(),{abortControllerRef:f,animationTypeRef:p,height:g,mounted:m,onOpenChange:h,open:E,panelId:b,panelRef:y,runOnceAnimationsFinish:x,setDimensions:v,setHiddenUntilFound:R,setKeepMounted:w,setMounted:_,setOpen:N,setVisible:M,transitionDimensionRef:k,visible:L,width:O,setPanelIdState:S,transitionStatus:I}=zi(),T=r??l,A=s??d;process.env.NODE_ENV!=="production"&&J(()=>{s===!1&&T&&Nr("The `keepMounted={false}` prop on a Accordion.Panel will be ignored when using `contextHiddenUntilFound` on the Panel or the Root since it requires the panel to remain mounted when closed.")},[T,s]),J(()=>{if(i)return S(i),()=>{S(void 0)}},[i,S]),J(()=>{R(T)},[R,T]),J(()=>{w(A)},[w,A]),$t({open:E&&I==="idle",ref:y,onComplete(){E&&v({width:void 0,height:void 0})}});const{props:D}=gf({abortControllerRef:f,animationTypeRef:p,externalRef:n,height:g,hiddenUntilFound:T,id:i??b,keepMounted:A,mounted:m,onOpenChange:h,open:E,panelRef:y,runOnceAnimationsFinish:x,setDimensions:v,setMounted:_,setOpen:N,setVisible:M,transitionDimensionRef:k,visible:L,width:O}),{state:C,triggerId:F}=Vr(),j=a.useMemo(()=>({...C,transitionStatus:I}),[C,I]),H=ue("div",t,{state:j,ref:[n,y],props:[D,{"aria-labelledby":F,role:"region",style:{[Ks.accordionPanelHeight]:g===void 0?"auto":`${g}px`,[Ks.accordionPanelWidth]:O===void 0?"auto":`${O}px`}},u],stateAttributesMapping:jr});return A||T||!A&&m?H:null});process.env.NODE_ENV!=="production"&&(wc.displayName="AccordionPanel");const hf="_root_l6s1z_10",yf="_item_l6s1z_53",bf="_header_l6s1z_100",vf="_trigger_l6s1z_109",xf="_triggerContent_l6s1z_195",Ef="_triggerIcon_l6s1z_201",Sf="_chevronSvg_l6s1z_214",Rf="_panel_l6s1z_222",wf="_panelContent_l6s1z_255",je={root:hf,"root--default":"_root--default_l6s1z_17","root--bordered":"_root--bordered_l6s1z_21","root--separated":"_root--separated_l6s1z_28","root--minimal":"_root--minimal_l6s1z_32","root--sm":"_root--sm_l6s1z_37","root--md":"_root--md_l6s1z_41","root--lg":"_root--lg_l6s1z_45",item:yf,"item--default":"_item--default_l6s1z_60","item--bordered":"_item--bordered_l6s1z_68","item--separated":"_item--separated_l6s1z_76","item--minimal":"_item--minimal_l6s1z_82",header:bf,trigger:vf,"trigger--default":"_trigger--default_l6s1z_142","trigger--bordered":"_trigger--bordered_l6s1z_150","trigger--separated":"_trigger--separated_l6s1z_158","trigger--minimal":"_trigger--minimal_l6s1z_167","trigger--sm":"_trigger--sm_l6s1z_179","trigger--md":"_trigger--md_l6s1z_184","trigger--lg":"_trigger--lg_l6s1z_189",triggerContent:xf,triggerIcon:Ef,chevronSvg:Sf,panel:Rf,"panel--default":"_panel--default_l6s1z_238","panel--bordered":"_panel--bordered_l6s1z_242","panel--separated":"_panel--separated_l6s1z_246","panel--minimal":"_panel--minimal_l6s1z_250",panelContent:wf,"panel--sm":"_panel--sm_l6s1z_262","panel--md":"_panel--md_l6s1z_267","panel--lg":"_panel--lg_l6s1z_272"},Cc=Z.createContext({variant:"default",size:"md"}),Ao=()=>Z.useContext(Cc),Tc=Z.forwardRef(({value:e,defaultValue:t,onValueChange:n,openMultiple:o=!1,disabled:r=!1,orientation:s="vertical",variant:i="default",size:c="md",className:u,children:l},d)=>{const f=[je.root,je[`root--${i}`],je[`root--${c}`],u].filter(Boolean).join(" ");return P.jsx(Cc.Provider,{value:{variant:i,size:c},children:P.jsx(Hi,{ref:d,value:e,defaultValue:t,onValueChange:n,multiple:o,disabled:r,orientation:s,className:f,children:l})})});Tc.displayName="ALSAccordion.Root";const _c=Z.forwardRef(({value:e,disabled:t,onOpenChange:n,className:o,children:r},s)=>{const{variant:i,size:c}=Ao(),u=[je.item,je[`item--${i}`],je[`item--${c}`],o].filter(Boolean).join(" ");return P.jsx(Ui,{ref:s,value:e,disabled:t,onOpenChange:n,className:u,children:r})});_c.displayName="ALSAccordion.Item";const Oc=Z.forwardRef(({className:e,children:t},n)=>{const{variant:o,size:r}=Ao(),s=[je.header,je[`header--${o}`],je[`header--${r}`],e].filter(Boolean).join(" ");return P.jsx(Ki,{ref:n,className:s,children:t})});Oc.displayName="ALSAccordion.Header";const Pc=Z.forwardRef(({className:e,children:t},n)=>{const{variant:o,size:r}=Ao(),s=[je.trigger,je[`trigger--${o}`],je[`trigger--${r}`],e].filter(Boolean).join(" ");return P.jsxs(Rc,{ref:n,className:s,children:[P.jsx("span",{className:je.triggerContent,children:t}),P.jsx("span",{className:je.triggerIcon,"aria-hidden":"true",children:P.jsx(Cf,{})})]})});Pc.displayName="ALSAccordion.Trigger";const Nc=Z.forwardRef(({keepMounted:e=!1,className:t,children:n},o)=>{const{variant:r,size:s}=Ao(),i=[je.panel,je[`panel--${r}`],je[`panel--${s}`],t].filter(Boolean).join(" ");return P.jsx(wc,{ref:o,keepMounted:e,className:i,children:P.jsx("div",{className:je.panelContent,children:n})})});Nc.displayName="ALSAccordion.Panel";const Cf=()=>P.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:je.chevronSvg,children:P.jsx("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Tf={Root:Tc,Item:_c,Header:Oc,Trigger:Pc,Panel:Nc},_f="_root_1n1xb_1",Of={root:_f};function Pf(e){return P.jsx("div",{className:Of.root})}const Nf="_root_1wdul_1",Af={root:Nf};function If(e){return P.jsx("div",{className:Af.root})}const Mf="_root_rauug_1",Lf={root:Mf};function Df(e){return P.jsx("div",{className:Lf.root})}const kf="_button_1enjc_2",Ff="_block_1enjc_34",Vf="_disabled_1enjc_372",rn={button:kf,block:Ff,"size-sm":"_size-sm_1enjc_40","size-md":"_size-md_1enjc_46","size-lg":"_size-lg_1enjc_51","size-full":"_size-full_1enjc_57","variant-primary":"_variant-primary_1enjc_68","style-full":"_style-full_1enjc_68","style-outline":"_style-outline_1enjc_87","style-ghost":"_style-ghost_1enjc_100","style-empty":"_style-empty_1enjc_112","variant-secondary":"_variant-secondary_1enjc_129","variant-success":"_variant-success_1enjc_189","variant-danger":"_variant-danger_1enjc_250","variant-warning":"_variant-warning_1enjc_311",disabled:Vf},Ac=Z.forwardRef(({variant:e="primary",buttonStyle:t="full",size:n="md",block:o=!1,className:r="",children:s,disabled:i=!1,type:c="button",...u},l)=>{const d=[rn.button,rn[`variant-${e}`],rn[`style-${t}`],rn[`size-${n}`],o?rn.block:"",i?rn.disabled:"",r].filter(Boolean).join(" ");return P.jsx("button",{ref:l,className:d,disabled:i,type:c,...u,children:s})});Ac.displayName="ALSButton";const jf="_root_11pg6_1",Bf={root:jf};function $f(e){return P.jsx("div",{className:Bf.root})}const Hf="_root_1mrxf_1",zf={root:Hf};function Wf(e){return P.jsx("div",{className:zf.root})}const Uf="_root_1yvsq_1",Kf={root:Uf};function qf(e){return P.jsx("div",{className:Kf.root})}const Yf="_root_1kg0t_1",Gf={root:Yf};function Xf(e){return P.jsx("div",{className:Gf.root})}const Zf="_root_9j2r3_1",Jf={root:Zf};function Qf(e){return P.jsx("div",{className:Jf.root})}const Gr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Gr.displayName="DialogRootContext");function Ht(e){const t=a.useContext(Gr);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.":Oe(27));return t}let Yt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=mn.startingStyle]="startingStyle",e[e.endingStyle=mn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Tr=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const ep={[Tr.popupOpen]:""},tp={[Tr.popupOpen]:"",[Tr.pressed]:""},np={[Yt.open]:""},op={[Yt.closed]:""},rp={[Yt.anchorHidden]:""},Xr={open(e){return e?ep:null}},Ic={open(e){return e?tp:null}},zt={open(e){return e?np:op},anchorHidden(e){return e?rp:null}},sp={...zt,...Vt},Mc=a.forwardRef(function(t,n){const{render:o,className:r,forceRender:s=!1,...i}=t,{store:c}=Ht(),u=c.useState("open"),l=c.useState("nested"),d=c.useState("mounted"),f=c.useState("transitionStatus"),p=a.useMemo(()=>({open:u,transitionStatus:f}),[u,f]);return ue("div",t,{state:p,ref:[c.context.backdropRef,n],stateAttributesMapping:sp,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});process.env.NODE_ENV!=="production"&&(Mc.displayName="DialogBackdrop");const Lc=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{store:u}=Ht(),l=u.useState("open");function d(m){l&&u.setOpen(!1,me(ji,m.nativeEvent))}const{getButtonProps:f,buttonRef:p}=yt({disabled:s,native:i}),g=a.useMemo(()=>({disabled:s}),[s]);return ue("button",t,{state:g,ref:[n,p],props:[{onClick:d},c,f]})});process.env.NODE_ENV!=="production"&&(Lc.displayName="DialogClose");const Dc=a.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:c}=Ht(),u=Qe(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),ue("p",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(Dc.displayName="DialogDescription");const Nn=0;class mt{static create(){return new mt}currentId=Nn;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Nn,n()},t)}isStarted(){return this.currentId!==Nn}clear=()=>{this.currentId!==Nn&&(clearTimeout(this.currentId),this.currentId=Nn)};disposeEffect=()=>this.clear}function Xe(){const e=Je(mt.create).current;return zn(e.disposeEffect),e}function kc(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class ip{nodesRef={current:[]};events=kc();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Zr=a.createContext(null);process.env.NODE_ENV!=="production"&&(Zr.displayName="FloatingNodeContext");const Jr=a.createContext(null);process.env.NODE_ENV!=="production"&&(Jr.displayName="FloatingTreeContext");const Wt=()=>a.useContext(Zr)?.id||null,on=e=>{const t=a.useContext(Jr);return e??t};function cp(e){const t=Ft(),n=on(e),o=Wt();return J(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function ap(e){const{children:t,id:n}=e,o=Wt();return P.jsx(Zr.Provider,{value:a.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function lp(e){const{children:t,externalTree:n}=e,o=Je(()=>n??new ip).current;return P.jsx(Jr.Provider,{value:o,children:t})}function jn(e){return`data-base-ui-${e}`}function Go(e,t,n){if(n&&!hn(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}const Io={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function Ue(e){return e?.ownerDocument||document}const pt=a.forwardRef(function(t,n){const[o,r]=a.useState();J(()=>{xd&&r("button")},[]);const s={tabIndex:0,role:o};return P.jsx("span",{...t,ref:n,style:Io,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(pt.displayName="FocusGuard");let qs=0;function uo(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(qs);const s=()=>e?.focus({preventScroll:n});r?s():qs=requestAnimationFrame(s)}const un={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ys(e){return e==="inert"?un.inert:e==="aria-hidden"?un["aria-hidden"]:un.none}let Qn=new WeakSet,eo={},Xo=0;const Fc=e=>e&&(e.host||Fc(e.parentNode)),up=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Fc(n);return e.contains(o)?o:null}).filter(n=>n!=null);function dp(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=up(t,e),c=new Set,u=new Set(i),l=[];eo[r]||(eo[r]=new WeakMap);const d=eo[r];i.forEach(f),p(t),c.clear();function f(g){!g||c.has(g)||(c.add(g),g.parentNode&&f(g.parentNode))}function p(g){!g||u.has(g)||[].forEach.call(g.children,m=>{if(jt(m)!=="script")if(c.has(m))p(m);else{const h=s?m.getAttribute(s):null,E=h!==null&&h!=="false",b=Ys(s),y=(b.get(m)||0)+1,x=(d.get(m)||0)+1;b.set(m,y),d.set(m,x),l.push(m),y===1&&E&&Qn.add(m),x===1&&m.setAttribute(r,""),!E&&s&&m.setAttribute(s,s==="inert"?"":"true")}})}return Xo+=1,()=>{l.forEach(g=>{const m=Ys(s),E=(m.get(g)||0)-1,b=(d.get(g)||0)-1;m.set(g,E),d.set(g,b),E||(!Qn.has(g)&&s&&g.removeAttribute(s),Qn.delete(g)),b||g.removeAttribute(r)}),Xo-=1,Xo||(un.inert=new WeakMap,un["aria-hidden"]=new WeakMap,un.none=new WeakMap,Qn=new WeakSet,eo={})}}function fp(e,t=!1,n=!1){const o=De(e[0]).body;return dp(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Qr=a.createContext(null);process.env.NODE_ENV!=="production"&&(Qr.displayName="PortalContext");const Vc=()=>a.useContext(Qr),pp=jn("portal");function jc(e={}){const{ref:t,container:n,componentProps:o=$e,elementProps:r,elementState:s}=e,i=Ft(),u=Vc()?.portalNode,[l,d]=a.useState(null),[f,p]=a.useState(null),g=a.useRef(null);J(()=>{if(n===null){g.current&&(g.current=null,p(null),d(null));return}if(i==null)return;const E=(n&&(Br(n)?n:n.current))??u??document.body;if(E==null){g.current&&(g.current=null,p(null),d(null));return}g.current!==E&&(g.current=E,p(null),d(E))},[n,u,i]);const m=ue("div",o,{ref:[t,p],state:s,props:[{id:i,[pp]:""},r]});return{portalNode:f,portalSubtree:l&&m?it.createPortal(m,l):null}}const Mo=a.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:c,...u}=t,{portalNode:l,portalSubtree:d}=jc({container:r,ref:n,componentProps:t,elementProps:u}),f=a.useRef(null),p=a.useRef(null),g=a.useRef(null),m=a.useRef(null),[h,E]=a.useState(null),b=h?.modal,y=h?.open,x=typeof c=="boolean"?c:!!h&&!h.modal&&h.open&&!!l;a.useEffect(()=>{if(!l||b)return;function R(w){l&&ln(w)&&(w.type==="focusin"?Hs:ef)(l)}return l.addEventListener("focusin",R,!0),l.addEventListener("focusout",R,!0),()=>{l.removeEventListener("focusin",R,!0),l.removeEventListener("focusout",R,!0)}},[l,b]),a.useEffect(()=>{!l||y||Hs(l)},[y,l]);const v=a.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:m,portalNode:l,setFocusManagerState:E}),[l]);return P.jsxs(a.Fragment,{children:[d,P.jsxs(Qr.Provider,{value:v,children:[x&&l&&P.jsx(pt,{"data-type":"outside",ref:f,onFocus:R=>{if(ln(R,l))g.current?.focus();else{const w=h?h.domReference:null;bc(w)?.focus()}}}),x&&l&&P.jsx("span",{"aria-owns":l.id,style:Hu}),l&&it.createPortal(o,l),x&&l&&P.jsx(pt,{"data-type":"outside",ref:p,onFocus:R=>{if(ln(R,l))m.current?.focus();else{const w=h?h.domReference:null;qr(w)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,me(Zt,R.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(Mo.displayName="FloatingPortal");function gp(e,t){const n=Le(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Gs=20;let Ot=[];function es(){Ot=Ot.filter(e=>e.isConnected)}function mp(e){es(),e&&jt(e)!=="body"&&(Ot.push(e),Ot.length>Gs&&(Ot=Ot.slice(-Gs)))}function Zo(){return es(),Ot[Ot.length-1]}function hp(e){if(!e)return null;const t=wn();return hc(e,t)?e:Un(e,t)[0]||e}function yp(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():et(e).display!=="none"}function Xs(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=wn(),r=Zd(e,n).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return hc(i,n)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ts(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:c=!1,modal:u=!0,closeOnFocusOut:l=!0,openInteractionType:d="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:g,beforeContentFocusGuardRef:m,externalTree:h}=e,E="rootStore"in t?t.rootStore:t,b=E.useState("open"),y=E.useState("domReferenceElement"),x=E.useState("floatingElement"),{events:v,dataRef:R}=E.context,w=Q(()=>R.current.floatingContext?.nodeId),_=Q(f),N=s===!1,M=vr(y)&&N,k=ke(r),L=ke(s),O=ke(i),S=ke(d),I=on(h),T=Vc(),A=a.useRef(null),D=a.useRef(null),C=a.useRef(!1),F=a.useRef(!1),j=a.useRef(-1),H=a.useRef(""),ee=a.useRef(""),W=Xe(),X=Xe(),Y=Sn(),z=T!=null,V=Fn(x),ce=Q((U=V)=>U?Un(U,wn()):[]),fe=Q(U=>{const G=ce(U);return k.current.map(()=>G).filter(Boolean).flat()});a.useEffect(()=>{if(o||!u)return;function U(K){K.key==="Tab"&&Ee(V,st(De(V)))&&ce().length===0&&!M&&We(K)}const G=De(V);return G.addEventListener("keydown",U),()=>{G.removeEventListener("keydown",U)}},[o,y,V,u,k,M,ce,fe]),a.useEffect(()=>{if(o||!x)return;function U(G){const K=qe(G),le=ce().indexOf(K);le!==-1&&(j.current=le)}return x.addEventListener("focusin",U),()=>{x.removeEventListener("focusin",U)}},[o,x,ce]),a.useEffect(()=>{if(o||!b)return;const U=De(V);function G(ge){ee.current=ge.pointerType||"keyboard"}function K(){ee.current="keyboard"}return U.addEventListener("pointerdown",G,!0),U.addEventListener("keydown",K,!0),()=>{U.removeEventListener("pointerdown",G,!0),U.removeEventListener("keydown",K,!0)}},[o,x,y,V,b]),a.useEffect(()=>{if(o||!l)return;function U(){F.current=!0,X.start(0,()=>{F.current=!1})}function G(re){const B=re.relatedTarget,ae=re.currentTarget,ne=qe(re);queueMicrotask(()=>{const q=w(),te=E.context.triggerElements,de=!(Ee(y,B)||Ee(x,B)||Ee(B,x)||Ee(T?.portalNode,B)||B!=null&&te.hasElement(B)||te.hasMatchingElement(pe=>Ee(pe,B))||B?.hasAttribute(jn("focus-guard"))||I&&(Gt(I.nodesRef.current,q).find(pe=>Ee(pe.context?.elements.floating,B)||Ee(pe.context?.elements.domReference,B))||Vs(I.nodesRef.current,q).find(pe=>[pe.context?.elements.floating,Fn(pe.context?.elements.floating)].includes(B)||pe.context?.elements.domReference===B)));if(ae===y&&V&&Xs(V,k),c&&ae!==y&&!yp(ne)&&st(De(V))===De(V).body){if(Ae(V)&&(V.focus(),c==="popup")){Y.request(()=>{V.focus()});return}const pe=j.current,we=ce(),Re=we[pe]||we[we.length-1]||V;Ae(Re)&&Re.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(M||!u)&&B&&de&&(M||B!==Zo())&&(C.current=!0,E.setOpen(!1,me(Zt,re)))})}function K(){R.current.insideReactTree=!0,W.start(0,()=>{R.current.insideReactTree=!1})}const ge=Ae(y)?y:null,le=[];if(!(!x&&!ge))return ge&&(ge.addEventListener("focusout",G),ge.addEventListener("pointerdown",U),le.push(()=>{ge.removeEventListener("focusout",G),ge.removeEventListener("pointerdown",U)})),x&&(x.addEventListener("focusout",G),T&&(x.addEventListener("focusout",K,!0),le.push(()=>{x.removeEventListener("focusout",K,!0)})),le.push(()=>{x.removeEventListener("focusout",G)})),()=>{le.forEach(re=>{re()})}},[o,y,x,V,u,I,T,E,l,c,ce,M,w,k,R,W,X,Y]);const xe=a.useRef(null),$=a.useRef(null),ie=gt(xe,m,T?.beforeInsideRef),oe=gt($,T?.afterInsideRef);a.useEffect(()=>{if(o||!x||!b)return;const U=Array.from(T?.portalNode?.querySelectorAll(`[${jn("portal")}]`)||[]),K=(I?Vs(I.nodesRef.current,w()):[]).find(re=>vr(re.context?.elements.domReference||null))?.context?.elements.domReference,ge=[x,K,...U,..._(),A.current,D.current,xe.current,$.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,qt(g),qt(p),M?y:null].filter(re=>re!=null),le=fp(ge,u||M);return()=>{le()}},[b,o,y,x,u,k,T,M,I,w,_,p,g]),J(()=>{if(!b||o||!Ae(V))return;const U=De(V),G=st(U);queueMicrotask(()=>{const K=fe(V),ge=L.current,le=typeof ge=="function"?ge(S.current||""):ge;if(le===void 0||le===!1)return;let re;le===!0||le===null?re=K[0]||V:re=qt(le),re=re||K[0]||V,!Ee(V,G)&&uo(re,{preventScroll:re===V})})},[o,b,V,N,fe,L,S]),J(()=>{if(o||!V)return;const U=De(V),G=st(U);mp(G);function K(re){if(re.open||(H.current=gp(re.nativeEvent,ee.current)),re.reason===rt&&re.nativeEvent.type==="mouseleave"&&(C.current=!0),re.reason===Vi)if(re.nested)C.current=!1;else if(oc(re.nativeEvent)||rc(re.nativeEvent))C.current=!1;else{let B=!1;document.createElement("div").focus({get preventScroll(){return B=!0,!1}}),B?C.current=!1:C.current=!0}}v.on("openchange",K);const ge=U.createElement("span");ge.setAttribute("tabindex","-1"),ge.setAttribute("aria-hidden","true"),Object.assign(ge.style,Io),z&&y&&y.insertAdjacentElement("afterend",ge);function le(){const re=O.current;let B=typeof re=="function"?re(H.current):re;if(B===void 0||B===!1)return null;if(B===null&&(B=!0),typeof B=="boolean"){const ne=y||Zo();return ne&&ne.isConnected?ne:ge}const ae=y||Zo()||ge;return qt(B)||ae}return()=>{v.off("openchange",K);const re=st(U),B=Ee(x,re)||I&&Gt(I.nodesRef.current,w(),!1).some(ne=>Ee(ne.context?.elements.floating,re)),ae=le();queueMicrotask(()=>{const ne=hp(ae),q=typeof O.current!="boolean";O.current&&!C.current&&Ae(ne)&&(!(!q&&ne!==re&&re!==U.body)||B)&&ne.focus({preventScroll:!0}),ge.remove()})}},[o,x,V,O,R,v,I,z,y,w]),a.useEffect(()=>{queueMicrotask(()=>{C.current=!1})},[o]),a.useEffect(()=>{if(o||!b)return;function U(K){qe(K)?.closest(`[${Dr}]`)&&(F.current=!0)}const G=De(V);return G.addEventListener("pointerdown",U,!0),()=>{G.removeEventListener("pointerdown",U,!0)}},[o,b,V]),J(()=>{if(!o&&T)return T.setFocusManagerState({modal:u,closeOnFocusOut:l,open:b,onOpenChange:E.setOpen,domReference:y}),()=>{T.setFocusManagerState(null)}},[o,T,u,b,E,l,y]),J(()=>{if(!(o||!V))return Xs(V,k),()=>{queueMicrotask(es)}},[o,V,k]);const Se=!o&&(u?!M:!0)&&(z||u);return P.jsxs(a.Fragment,{children:[Se&&P.jsx(pt,{"data-type":"inside",ref:ie,onFocus:U=>{if(u){const G=fe();uo(G[G.length-1])}else T?.portalNode&&(C.current=!1,ln(U,T.portalNode)?qr(y)?.focus():qt(g??T.beforeOutsideRef)?.focus())}}),n,Se&&P.jsx(pt,{"data-type":"inside",ref:oe,onFocus:U=>{u?uo(fe()[0]):T?.portalNode&&(l&&(C.current=!0),ln(U,T.portalNode)?bc(y)?.focus():qt(p??T.afterOutsideRef)?.focus())}})]})}function ns(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:u=!0,touchOpenDelay:l=0}=t,d=a.useRef(void 0),f=Sn(),p=Xe(),g=a.useMemo(()=>({onPointerDown(m){d.current=m.pointerType},onMouseDown(m){const h=d.current,E=m.nativeEvent,b=n.select("open");if(m.button!==0||s==="click"||hn(h,!0)&&c)return;const y=o.current.openEvent,x=y?.type,v=n.select("domReferenceElement")!==m.currentTarget,R=b&&v||!(b&&i&&(!(y&&u)||x==="click"||x==="mousedown"));if(nc(E.target)){const _=me(xt,E,E.target);R&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,_)}):n.setOpen(R,_);return}const w=m.currentTarget;f.request(()=>{const _=me(xt,E,w);R&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,_)}):n.setOpen(R,_)})},onClick(m){if(s==="mousedown-only")return;const h=d.current;if(s==="mousedown"&&h){d.current=void 0;return}if(hn(h,!0)&&c)return;const E=n.select("open"),b=o.current.openEvent,y=b?.type,x=n.select("domReferenceElement")!==m.currentTarget,v=E&&x||!(E&&i&&(!(b&&u)||y==="click"||y==="mousedown"||y==="keydown"||y==="keyup")),R=me(xt,m.nativeEvent,m.currentTarget);v&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,R)}):n.setOpen(v,R)},onKeyDown(){d.current=void 0}}),[o,s,c,n,u,i,f,p,l]);return a.useMemo(()=>r?{reference:g}:$e,[r,g])}function Zs(e,t,n){let{reference:o,floating:r}=e;const s=lt(t),i=Kr(t),c=Ur(i),u=Ze(t),l=s==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[c]/2-r[c]/2;let g;switch(u){case"top":g={x:d,y:o.y-r.height};break;case"bottom":g={x:d,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-r.width,y:f};break;default:g={x:o.x,y:o.y}}switch(Bt(t)){case"start":g[i]-=p*(n&&l?-1:1);break;case"end":g[i]+=p*(n&&l?-1:1);break}return g}const bp=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=Zs(l,o,u),p=o,g={},m=0;for(let h=0;h<c.length;h++){const{name:E,fn:b}=c[h],{x:y,y:x,data:v,reset:R}=await b({x:d,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:l,platform:i,elements:{reference:e,floating:t}});d=y??d,f=x??f,g={...g,[E]:{...g[E],...v}},R&&m<=50&&(m++,typeof R=="object"&&(R.placement&&(p=R.placement),R.rects&&(l=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:d,y:f}=Zs(l,p,u)),h=-1)}return{x:d,y:f,placement:p,strategy:r,middlewareData:g}};async function Bn(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=wt(t,e),m=sc(g),E=c[p?f==="floating"?"reference":"floating":f],b=ho(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(E)))==null||n?E:E.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:u})),y=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},R=ho(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:x,strategy:u}):y);return{top:(b.top-R.top+m.top)/v.y,bottom:(R.bottom-b.bottom+m.bottom)/v.y,left:(b.left-R.left+m.left)/v.x,right:(R.right-b.right+m.right)/v.x}}const vp=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:u,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...E}=wt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=Ze(r),y=lt(c),x=Ze(c)===c,v=await(u.isRTL==null?void 0:u.isRTL(l.floating)),R=p||(x||!h?[mo(c)]:Ad(c)),w=m!=="none";!p&&w&&R.push(...Dd(c,h,m,v));const _=[c,...R],N=await Bn(t,E),M=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&M.push(N[b]),f){const I=Nd(r,i,v);M.push(N[I[0]],N[I[1]])}if(k=[...k,{placement:r,overflows:M}],!M.every(I=>I<=0)){var L,O;const I=(((L=s.flip)==null?void 0:L.index)||0)+1,T=_[I];if(T&&(!(f==="alignment"?y!==lt(T):!1)||k.every(C=>lt(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:I,overflows:k},reset:{placement:T}};let A=(O=k.filter(D=>D.overflows[0]<=0).sort((D,C)=>D.overflows[1]-C.overflows[1])[0])==null?void 0:O.placement;if(!A)switch(g){case"bestFit":{var S;const D=(S=k.filter(C=>{if(w){const F=lt(C.placement);return F===y||F==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(F=>F>0).reduce((F,j)=>F+j,0)]).sort((C,F)=>C[1]-F[1])[0])==null?void 0:S[0];D&&(A=D);break}case"initialPlacement":A=c;break}if(r!==A)return{reset:{placement:A}}}return{}}}};function Js(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qs(e){return Td.some(t=>e[t]>=0)}const xp=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=wt(e,t);switch(o){case"referenceHidden":{const s=await Bn(t,{...r,elementContext:"reference"}),i=Js(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Qs(i)}}}case"escaped":{const s=await Bn(t,{...r,altBoundary:!0}),i=Js(s,n.floating);return{data:{escapedOffsets:i,escaped:Qs(i)}}}default:return{}}}}},Bc=new Set(["left","top"]);async function Ep(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Ze(n),c=Bt(n),u=lt(n)==="y",l=Bc.has(i)?-1:1,d=s&&u?-1:1,f=wt(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof m=="number"&&(g=c==="end"?m*-1:m),u?{x:g*d,y:p*l}:{x:p*l,y:g*d}}const Sp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,u=await Ep(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},Rp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn:E=>{let{x:b,y}=E;return{x:b,y}}},...u}=wt(e,t),l={x:n,y:o},d=await Bn(t,u),f=lt(Ze(r)),p=Wr(f);let g=l[p],m=l[f];if(s){const E=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=g+d[E],x=g-d[b];g=Er(y,g,x)}if(i){const E=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=m+d[E],x=m-d[b];m=Er(y,m,x)}const h=c.fn({...t,[p]:g,[f]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:s,[f]:i}}}}}},wp=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:l=!0}=wt(e,t),d={x:n,y:o},f=lt(r),p=Wr(f);let g=d[p],m=d[f];const h=wt(c,t),E=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){const x=p==="y"?"height":"width",v=s.reference[p]-s.floating[x]+E.mainAxis,R=s.reference[p]+s.reference[x]-E.mainAxis;g<v?g=v:g>R&&(g=R)}if(l){var b,y;const x=p==="y"?"width":"height",v=Bc.has(Ze(r)),R=s.reference[f]-s.floating[x]+(v&&((b=i.offset)==null?void 0:b[f])||0)+(v?0:E.crossAxis),w=s.reference[f]+s.reference[x]+(v?0:((y=i.offset)==null?void 0:y[f])||0)-(v?E.crossAxis:0);m<R?m=R:m>w&&(m=w)}return{[p]:g,[f]:m}}}},Cp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:u=()=>{},...l}=wt(e,t),d=await Bn(t,l),f=Ze(r),p=Bt(r),g=lt(r)==="y",{width:m,height:h}=s.floating;let E,b;f==="top"||f==="bottom"?(E=f,b=p===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=f,E=p==="end"?"top":"bottom");const y=h-d.top-d.bottom,x=m-d.left-d.right,v=yn(h-d[E],y),R=yn(m-d[b],x),w=!t.middlewareData.shift;let _=v,N=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=y),w&&!p){const k=nt(d.left,0),L=nt(d.right,0),O=nt(d.top,0),S=nt(d.bottom,0);g?N=m-2*(k!==0||L!==0?k+L:nt(d.left,d.right)):_=h-2*(O!==0||S!==0?O+S:nt(d.top,d.bottom))}await u({...t,availableWidth:N,availableHeight:_});const M=await i.getDimensions(c.floating);return m!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}};function $c(e){const t=et(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ae(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=bn(n)!==s||bn(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function os(e){return Te(e)?e:e.contextElement}function dn(e){const t=os(e);if(!Ae(t))return ft(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=$c(t);let i=(s?bn(n.width):n.width)/o,c=(s?bn(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Tp=ft(0);function Hc(e){const t=Le(e);return!Po()||!t.visualViewport?Tp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _p(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Le(e)?!1:t}function Qt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=os(e);let i=ft(1);t&&(o?Te(o)&&(i=dn(o)):i=dn(e));const c=_p(s,n,o)?Hc(s):ft(0);let u=(r.left+c.x)/i.x,l=(r.top+c.y)/i.y,d=r.width/i.x,f=r.height/i.y;if(s){const p=Le(s),g=o&&Te(o)?Le(o):o;let m=p,h=mr(m);for(;h&&o&&g!==m;){const E=dn(h),b=h.getBoundingClientRect(),y=et(h),x=b.left+(h.clientLeft+parseFloat(y.paddingLeft))*E.x,v=b.top+(h.clientTop+parseFloat(y.paddingTop))*E.y;u*=E.x,l*=E.y,d*=E.x,f*=E.y,u+=x,l+=v,m=Le(h),h=mr(m)}}return ho({width:d,height:f,x:u,y:l})}function Lo(e,t){const n=No(e).scrollLeft;return t?t.left+n:Qt(ht(e)).left+n}function zc(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Lo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Op(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=ht(o),c=t?Oo(t.floating):!1;if(o===i||c&&s)return n;let u={scrollLeft:0,scrollTop:0},l=ft(1);const d=ft(0),f=Ae(o);if((f||!f&&!s)&&((jt(o)!=="body"||nn(i))&&(u=No(o)),Ae(o))){const g=Qt(o);l=dn(o),d.x=g.x+o.clientLeft,d.y=g.y+o.clientTop}const p=i&&!f&&!s?zc(i,u):ft(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+d.x+p.x,y:n.y*l.y-u.scrollTop*l.y+d.y+p.y}}function Pp(e){return Array.from(e.getClientRects())}function Np(e){const t=ht(e),n=No(e),o=e.ownerDocument.body,r=nt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=nt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Lo(e);const c=-n.scrollTop;return et(o).direction==="rtl"&&(i+=nt(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const ei=25;function Ap(e,t){const n=Le(e),o=ht(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,u=0;if(r){s=r.width,i=r.height;const d=Po();(!d||d&&t==="fixed")&&(c=r.offsetLeft,u=r.offsetTop)}const l=Lo(o);if(l<=0){const d=o.ownerDocument,f=d.body,p=getComputedStyle(f),g=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-f.clientWidth-g);m<=ei&&(s-=m)}else l<=ei&&(s+=l);return{width:s,height:i,x:c,y:u}}const Ip=new Set(["absolute","fixed"]);function Mp(e,t){const n=Qt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ae(e)?dn(e):ft(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,u=r*s.x,l=o*s.y;return{width:i,height:c,x:u,y:l}}function ti(e,t,n){let o;if(t==="viewport")o=Ap(e,n);else if(t==="document")o=Np(ht(e));else if(Te(t))o=Mp(t,n);else{const r=Hc(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ho(o)}function Wc(e,t){const n=Rt(e);return n===t||!Te(n)||Et(n)?!1:et(n).position==="fixed"||Wc(n,t)}function Lp(e,t){const n=t.get(e);if(n)return n;let o=Pt(e,[],!1).filter(c=>Te(c)&&jt(c)!=="body"),r=null;const s=et(e).position==="fixed";let i=s?Rt(e):e;for(;Te(i)&&!Et(i);){const c=et(i),u=$r(i);!u&&c.position==="fixed"&&(r=null),(s?!u&&!r:!u&&c.position==="static"&&!!r&&Ip.has(r.position)||nn(i)&&!u&&Wc(e,i))?o=o.filter(d=>d!==i):r=c,i=Rt(i)}return t.set(e,o),o}function Dp(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Oo(t)?[]:Lp(t,this._c):[].concat(n),o],c=i[0],u=i.reduce((l,d)=>{const f=ti(t,d,r);return l.top=nt(f.top,l.top),l.right=yn(f.right,l.right),l.bottom=yn(f.bottom,l.bottom),l.left=nt(f.left,l.left),l},ti(t,c,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function kp(e){const{width:t,height:n}=$c(e);return{width:t,height:n}}function Fp(e,t,n){const o=Ae(t),r=ht(t),s=n==="fixed",i=Qt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=ft(0);function l(){u.x=Lo(r)}if(o||!o&&!s)if((jt(t)!=="body"||nn(r))&&(c=No(t)),o){const g=Qt(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else r&&l();s&&!o&&r&&l();const d=r&&!o&&!s?zc(r,c):ft(0),f=i.left+c.scrollLeft-u.x-d.x,p=i.top+c.scrollTop-u.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Jo(e){return et(e).position==="static"}function ni(e,t){if(!Ae(e)||et(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ht(e)===n&&(n=n.ownerDocument.body),n}function Uc(e,t){const n=Le(e);if(Oo(e))return n;if(!Ae(e)){let r=Rt(e);for(;r&&!Et(r);){if(Te(r)&&!Jo(r))return r;r=Rt(r)}return n}let o=ni(e,t);for(;o&&ud(o)&&Jo(o);)o=ni(o,t);return o&&Et(o)&&Jo(o)&&!$r(o)?n:o||md(e)||n}const Vp=async function(e){const t=this.getOffsetParent||Uc,n=this.getDimensions,o=await n(e.floating);return{reference:Fp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function jp(e){return et(e).direction==="rtl"}const Bp={convertOffsetParentRelativeRectToViewportRelativeRect:Op,getDocumentElement:ht,getClippingRect:Dp,getOffsetParent:Uc,getElementRects:Vp,getClientRects:Pp,getDimensions:kp,getScale:dn,isElement:Te,isRTL:jp};function Kc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $p(e,t){let n=null,o;const r=ht(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:d,top:f,width:p,height:g}=l;if(c||t(),!p||!g)return;const m=cn(f),h=cn(r.clientWidth-(d+p)),E=cn(r.clientHeight-(f+g)),b=cn(d),x={rootMargin:-m+"px "+-h+"px "+-E+"px "+-b+"px",threshold:nt(0,yn(1,u))||1};let v=!0;function R(w){const _=w[0].intersectionRatio;if(_!==u){if(!v)return i();_?i(!1,_):o=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!Kc(l,e.getBoundingClientRect())&&i(),v=!1}try{n=new IntersectionObserver(R,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,x)}n.observe(e)}return i(!0),s}function oi(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,l=os(e),d=r||s?[...l?Pt(l):[],...Pt(t)]:[];d.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=l&&c?$p(l,n):null;let p=-1,g=null;i&&(g=new ResizeObserver(b=>{let[y]=b;y&&y.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),l&&!u&&g.observe(l),g.observe(t));let m,h=u?Qt(e):null;u&&E();function E(){const b=Qt(e);h&&!Kc(h,b)&&n(),h=b,m=requestAnimationFrame(E)}return n(),()=>{var b;d.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),f?.(),(b=g)==null||b.disconnect(),g=null,u&&cancelAnimationFrame(m)}}const Hp=Sp,zp=Rp,Wp=vp,Up=Cp,Kp=xp,qp=wp,Yp=(e,t,n)=>{const o=new Map,r={platform:Bp,...n},s={...r.platform,_c:o};return bp(e,t,{...r,platform:s})};var Gp=typeof document<"u",Xp=function(){},fo=Gp?Z.useLayoutEffect:Xp;function xo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!xo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!xo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function qc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ri(e,t){const n=qc(e);return Math.round(t*n)/n}function Qo(e){const t=a.useRef(e);return fo(()=>{t.current=e}),t}function Zp(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=a.useState(o);xo(p,o)||g(o);const[m,h]=a.useState(null),[E,b]=a.useState(null),y=a.useCallback(C=>{C!==w.current&&(w.current=C,h(C))},[]),x=a.useCallback(C=>{C!==_.current&&(_.current=C,b(C))},[]),v=s||m,R=i||E,w=a.useRef(null),_=a.useRef(null),N=a.useRef(d),M=u!=null,k=Qo(u),L=Qo(r),O=Qo(l),S=a.useCallback(()=>{if(!w.current||!_.current)return;const C={placement:t,strategy:n,middleware:p};L.current&&(C.platform=L.current),Yp(w.current,_.current,C).then(F=>{const j={...F,isPositioned:O.current!==!1};I.current&&!xo(N.current,j)&&(N.current=j,it.flushSync(()=>{f(j)}))})},[p,t,n,L,O]);fo(()=>{l===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[l]);const I=a.useRef(!1);fo(()=>(I.current=!0,()=>{I.current=!1}),[]),fo(()=>{if(v&&(w.current=v),R&&(_.current=R),v&&R){if(k.current)return k.current(v,R,S);S()}},[v,R,S,k,M]);const T=a.useMemo(()=>({reference:w,floating:_,setReference:y,setFloating:x}),[y,x]),A=a.useMemo(()=>({reference:v,floating:R}),[v,R]),D=a.useMemo(()=>{const C={position:n,left:0,top:0};if(!A.floating)return C;const F=ri(A.floating,d.x),j=ri(A.floating,d.y);return c?{...C,transform:"translate("+F+"px, "+j+"px)",...qc(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:j}},[n,c,A.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:S,refs:T,elements:A,floatingStyles:D}),[d,S,T,A,D])}const Jp=(e,t)=>({...Hp(e),options:[e,t]}),Qp=(e,t)=>({...zp(e),options:[e,t]}),eg=(e,t)=>({...qp(e),options:[e,t]}),tg=(e,t)=>({...Wp(e),options:[e,t]}),ng=(e,t)=>({...Up(e),options:[e,t]}),og=(e,t)=>({...Kp(e),options:[e,t]}),rg={intentional:"onClick",sloppy:"onPointerDown"};function sg(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function rs(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:u}=n.context,{enabled:l=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:g=!1,referencePressEvent:m="sloppy",ancestorScroll:h=!1,bubbles:E,externalTree:b}=t,y=on(b),x=Q(typeof f=="function"?f:()=>!1),v=typeof f=="function"?x:f,R=a.useRef(!1),{escapeKey:w,outsidePress:_}=sg(E),N=a.useRef(null),M=Xe(),k=Xe(),L=Q(()=>{k.clear(),u.current.insideReactTree=!1}),O=a.useRef(!1),S=a.useRef(""),I=Q($=>{S.current=$.pointerType}),T=Q(()=>{const $=S.current,ie=$==="pen"||!$?"mouse":$,oe=typeof p=="function"?p():p;return typeof oe=="string"?oe:oe[ie]}),A=Q($=>{if(!o||!l||!d||$.key!=="Escape"||O.current)return;const ie=u.current.floatingContext?.nodeId,oe=y?Gt(y.nodesRef.current,ie):[];if(!w&&oe.length>0){let G=!0;if(oe.forEach(K=>{K.context?.open&&!K.context.dataRef.current.__escapeKeyBubbles&&(G=!1)}),!G)return}const Se=Cd($)?$.nativeEvent:$,U=me(Bi,Se);n.setOpen(!1,U),!w&&!U.isPropagationAllowed&&$.stopPropagation()}),D=Q($=>{const ie=T();return ie==="intentional"&&$.type!=="click"||ie==="sloppy"&&$.type==="click"}),C=Q(()=>{u.current.insideReactTree=!0,k.start(0,L)}),F=Q(($,ie=!1)=>{if(D($)){L();return}if(u.current.insideReactTree){L();return}if(T()==="intentional"&&ie||typeof v=="function"&&!v($))return;const oe=qe($),Se=`[${jn("inert")}]`,U=De(n.select("floatingElement")).querySelectorAll(Se),G=n.context.triggerElements;if(oe&&(G.hasElement(oe)||G.hasMatchingElement(B=>Ee(B,oe))))return;let K=Te(oe)?oe:null;for(;K&&!Et(K);){const B=Rt(K);if(Et(B)||!Te(B))break;K=B}if(U.length&&Te(oe)&&!wd(oe)&&!Ee(oe,n.select("floatingElement"))&&Array.from(U).every(B=>!Ee(K,B)))return;if(Ae(oe)&&!("touches"in $)){const B=Et(oe),ae=et(oe),ne=/auto|scroll/,q=B||ne.test(ae.overflowX),te=B||ne.test(ae.overflowY),de=q&&oe.clientWidth>0&&oe.scrollWidth>oe.clientWidth,pe=te&&oe.clientHeight>0&&oe.scrollHeight>oe.clientHeight,we=ae.direction==="rtl",Re=pe&&(we?$.offsetX<=oe.offsetWidth-oe.clientWidth:$.offsetX>oe.clientWidth),Ce=de&&$.offsetY>oe.clientHeight;if(Re||Ce)return}const ge=u.current.floatingContext?.nodeId,le=y&&Gt(y.nodesRef.current,ge).some(B=>dt($,B.context?.elements.floating));if(dt($,n.select("floatingElement"))||dt($,n.select("domReferenceElement"))||le)return;const re=y?Gt(y.nodesRef.current,ge):[];if(re.length>0){let B=!0;if(re.forEach(ae=>{ae.context?.open&&!ae.context.dataRef.current.__outsidePressBubbles&&(B=!1)}),!B)return}n.setOpen(!1,me(Vi,$)),L()}),j=Q($=>{T()!=="sloppy"||$.pointerType==="touch"||!n.select("open")||!l||dt($,n.select("floatingElement"))||dt($,n.select("domReferenceElement"))||F($)}),H=Q($=>{if(T()!=="sloppy"||!n.select("open")||!l||dt($,n.select("floatingElement"))||dt($,n.select("domReferenceElement")))return;const ie=$.touches[0];ie&&(N.current={startTime:Date.now(),startX:ie.clientX,startY:ie.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{N.current&&(N.current.dismissOnTouchEnd=!1,N.current.dismissOnMouseDown=!1)}))}),ee=Q($=>{const ie=qe($);function oe(){H($),ie?.removeEventListener($.type,oe)}ie?.addEventListener($.type,oe)}),W=Q($=>{const ie=R.current;if(R.current=!1,M.clear(),$.type==="mousedown"&&N.current&&!N.current.dismissOnMouseDown)return;const oe=qe($);function Se(){$.type==="pointerdown"?j($):F($,ie),oe?.removeEventListener($.type,Se)}oe?.addEventListener($.type,Se)}),X=Q($=>{if(T()!=="sloppy"||!N.current||dt($,n.select("floatingElement"))||dt($,n.select("domReferenceElement")))return;const ie=$.touches[0];if(!ie)return;const oe=Math.abs(ie.clientX-N.current.startX),Se=Math.abs(ie.clientY-N.current.startY),U=Math.sqrt(oe*oe+Se*Se);U>5&&(N.current.dismissOnTouchEnd=!0),U>10&&(F($),M.clear(),N.current=null)}),Y=Q($=>{const ie=qe($);function oe(){X($),ie?.removeEventListener($.type,oe)}ie?.addEventListener($.type,oe)}),z=Q($=>{T()!=="sloppy"||!N.current||dt($,n.select("floatingElement"))||dt($,n.select("domReferenceElement"))||(N.current.dismissOnTouchEnd&&F($),M.clear(),N.current=null)}),V=Q($=>{const ie=qe($);function oe(){z($),ie?.removeEventListener($.type,oe)}ie?.addEventListener($.type,oe)});a.useEffect(()=>{if(!o||!l)return;u.current.__escapeKeyBubbles=w,u.current.__outsidePressBubbles=_;const $=new mt;function ie(K){n.setOpen(!1,me(Dt,K))}function oe(){$.clear(),O.current=!0}function Se(){$.start(Po()?5:0,()=>{O.current=!1})}const U=De(r);U.addEventListener("pointerdown",I,!0),d&&(U.addEventListener("keydown",A),U.addEventListener("compositionstart",oe),U.addEventListener("compositionend",Se)),v&&(U.addEventListener("click",W,!0),U.addEventListener("pointerdown",W,!0),U.addEventListener("touchstart",ee,!0),U.addEventListener("touchmove",Y,!0),U.addEventListener("touchend",V,!0),U.addEventListener("mousedown",W,!0));let G=[];return h&&(Te(i)&&(G=Pt(i)),Te(r)&&(G=G.concat(Pt(r))),!Te(s)&&s&&s.contextElement&&(G=G.concat(Pt(s.contextElement)))),G=G.filter(K=>K!==U.defaultView?.visualViewport),G.forEach(K=>{K.addEventListener("scroll",ie,{passive:!0})}),()=>{U.removeEventListener("pointerdown",I,!0),d&&(U.removeEventListener("keydown",A),U.removeEventListener("compositionstart",oe),U.removeEventListener("compositionend",Se)),v&&(U.removeEventListener("click",W,!0),U.removeEventListener("pointerdown",W,!0),U.removeEventListener("touchstart",ee,!0),U.removeEventListener("touchmove",Y,!0),U.removeEventListener("touchend",V,!0),U.removeEventListener("mousedown",W,!0)),G.forEach(K=>{K.removeEventListener("scroll",ie)}),$.clear()}},[u,r,s,i,d,v,o,c,h,l,w,_,A,F,W,j,ee,Y,V,I,n]),a.useEffect(L,[v,L]);const ce=a.useMemo(()=>({onKeyDown:A,...g&&{[rg[m]]:$=>{n.setOpen(!1,me(xt,$.nativeEvent))},...m!=="intentional"&&{onClick($){n.setOpen(!1,me(xt,$.nativeEvent))}}}}),[A,n,g,m]),fe=Q($=>{const ie=qe($.nativeEvent);!Ee(n.select("floatingElement"),ie)||$.button!==0||(R.current=!0)}),xe=a.useMemo(()=>({onKeyDown:A,onMouseDown:fe,onMouseUp:fe,onPointerDownCapture:C,onMouseDownCapture:C,onClickCapture:C,onMouseUpCapture:C,onTouchEndCapture:C,onTouchMoveCapture:C}),[A,fe,C]);return a.useMemo(()=>l?{reference:ce,floating:xe,trigger:ce}:{},[l,ce,xe])}var ig=(e,t,n)=>{if(t.length===1&&t[0]===n){let o=!1;try{const r={};e(r)===r&&(o=!0)}catch{}if(o){let r;try{throw new Error}catch(s){({stack:r}=s)}console.warn(`The result function returned its own inputs without modification. e.g
4
- \`createSelector([state => state.todos], todos => todos)\`
5
- This could lead to inefficient memoization and unnecessary re-renders.
6
- Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:r})}}},cg=(e,t,n)=>{const{memoize:o,memoizeOptions:r}=t,{inputSelectorResults:s,inputSelectorResultsCopy:i}=e,c=o(()=>({}),...r);if(!(c.apply(null,s)===c.apply(null,i))){let l;try{throw new Error}catch(d){({stack:l}=d)}console.warn(`An input selector returned a different result when passed same arguments.
7
- This means your output selector will likely run more frequently than intended.
8
- Avoid returning a new reference inside your input selector, e.g.
9
- \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:i,stack:l})}},ag={inputStabilityCheck:"once",identityFunctionCheck:"once"},Eo=Symbol("NOT_FOUND");function lg(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ug(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function dg(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var si=e=>Array.isArray(e)?e:[e];function fg(e){const t=Array.isArray(e[0])?e[0]:e;return dg(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ii(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}var pg=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:o}={...ag,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:ig},inputStabilityCheck:{shouldRun:o==="always"||o==="once"&&e,run:cg}}};function gg(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Eo},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function mg(e,t){let n=[];function o(c){const u=n.findIndex(l=>t(c,l.key));if(u>-1){const l=n[u];return u>0&&(n.splice(u,1),n.unshift(l)),l.value}return Eo}function r(c,u){o(c)===Eo&&(n.unshift({key:c,value:u}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var hg=(e,t)=>e===t;function yg(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function bg(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=hg,maxSize:r=1,resultEqualityCheck:s}=n,i=yg(o);let c=0;const u=r<=1?gg(i):mg(r,i);function l(){let d=u.get(arguments);if(d===Eo){if(d=e.apply(null,arguments),c++,s){const p=u.getEntries().find(g=>s(g.value,d));p&&(d=p.value,c!==0&&c--)}u.put(arguments,d)}return d}return l.clearCache=()=>{u.clear(),l.resetResultsCount()},l.resultsCount=()=>c,l.resetResultsCount=()=>{c=0},l}var vg=class{constructor(e){this.value=e}deref(){return this.value}},xg=typeof WeakRef<"u"?WeakRef:vg,Eg=0,ci=1;function to(){return{s:Eg,v:void 0,o:null,p:null}}function Yc(e,t={}){let n=to();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let c=n;const{length:u}=arguments;for(let f=0,p=u;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let m=c.o;m===null&&(c.o=m=new WeakMap);const h=m.get(g);h===void 0?(c=to(),m.set(g,c)):c=h}else{let m=c.p;m===null&&(c.p=m=new Map);const h=m.get(g);h===void 0?(c=to(),m.set(g,c)):c=h}}const l=c;let d;if(c.s===ci)d=c.v;else if(d=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,d)&&(d=f,s!==0&&s--),r=typeof d=="object"&&d!==null||typeof d=="function"?new xg(d):d}return l.s=ci,l.v=d,d}return i.clearCache=()=>{n=to(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Gc(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,c,u={},l=r.pop();typeof l=="object"&&(u=l,l=r.pop()),lg(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const d={...n,...u},{memoize:f,memoizeOptions:p=[],argsMemoize:g=Yc,argsMemoizeOptions:m=[],devModeChecks:h={}}=d,E=si(p),b=si(m),y=fg(r),x=f(function(){return s++,l.apply(null,arguments)},...E);let v=!0;const R=g(function(){i++;const _=ii(y,arguments);if(c=x.apply(null,_),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:N,inputStabilityCheck:M}=pg(v,h);if(N.shouldRun&&N.run(l,_,c),M.shouldRun){const k=ii(y,arguments);M.run({inputSelectorResults:_,inputSelectorResultsCopy:k},{memoize:f,memoizeOptions:E},arguments)}v&&(v=!1)}return c},...b);return Object.assign(R,{resultFunc:l,memoizedResultFunc:x,dependencies:y,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:g})};return Object.assign(o,{withTypes:()=>o}),o}var Sg=Gc(Yc),Rg=Object.assign((e,t=Sg)=>{ug(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,c,u)=>(i[n[u]]=c,i),{}))},{withTypes:()=>Rg});Gc({memoize:bg,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const se=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":Oe(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var no={exports:{}},er={},oo={exports:{}},tr={};var ai;function wg(){if(ai)return tr;ai=1;var e=Z;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(f,p){var g=p(),m=o({inst:{value:g,getSnapshot:p}}),h=m[0].inst,E=m[1];return s(function(){h.value=g,h.getSnapshot=p,u(h)&&E({inst:h})},[f,g,p]),r(function(){return u(h)&&E({inst:h}),f(function(){u(h)&&E({inst:h})})},[f]),i(g),g}function u(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function l(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return tr.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,tr}var nr={};var li;function Cg(){return li||(li=1,process.env.NODE_ENV!=="production"&&(function(){function e(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}function t(g,m){d||r.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=m();if(!f){var E=m();s(h,E)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}E=i({inst:{value:h,getSnapshot:m}});var b=E[0].inst,y=E[1];return u(function(){b.value=h,b.getSnapshot=m,n(b)&&y({inst:b})},[g,h,m]),c(function(){return n(b)&&y({inst:b}),g(function(){n(b)&&y({inst:b})})},[g]),l(h),h}function n(g){var m=g.getSnapshot;g=g.value;try{var h=m();return!s(g,h)}catch{return!0}}function o(g,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=Z,s=typeof Object.is=="function"?Object.is:e,i=r.useState,c=r.useEffect,u=r.useLayoutEffect,l=r.useDebugValue,d=!1,f=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;nr.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),nr}var ui;function Xc(){return ui||(ui=1,process.env.NODE_ENV==="production"?oo.exports=wg():oo.exports=Cg()),oo.exports}var di;function Tg(){if(di)return er;di=1;var e=Z,t=Xc();function n(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,c=e.useMemo,u=e.useDebugValue;return er.useSyncExternalStoreWithSelector=function(l,d,f,p,g){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=c(function(){function b(w){if(!y){if(y=!0,x=w,w=p(w),g!==void 0&&h.hasValue){var _=h.value;if(g(_,w))return v=_}return v=w}if(_=v,o(x,w))return _;var N=p(w);return g!==void 0&&g(_,N)?(x=w,_):(x=w,v=N)}var y=!1,x,v,R=f===void 0?null:f;return[function(){return b(d())},R===null?void 0:function(){return b(R())}]},[d,f,p,g]);var E=r(l,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=E},[E]),u(E),E},er}var or={};var fi;function _g(){return fi||(fi=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=Z,n=Xc(),o=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,c=t.useMemo,u=t.useDebugValue;or.useSyncExternalStoreWithSelector=function(l,d,f,p,g){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=c(function(){function b(w){if(!y){if(y=!0,x=w,w=p(w),g!==void 0&&h.hasValue){var _=h.value;if(g(_,w))return v=_}return v=w}if(_=v,o(x,w))return _;var N=p(w);return g!==void 0&&g(_,N)?(x=w,_):(x=w,v=N)}var y=!1,x,v,R=f===void 0?null:f;return[function(){return b(d())},R===null?void 0:function(){return b(R())}]},[d,f,p,g]);var E=r(l,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=E},[E]),u(E),E},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),or}var pi;function Og(){return pi||(pi=1,process.env.NODE_ENV==="production"?no.exports=Tg():no.exports=_g()),no.exports}var Pg=Og();function ve(e,t,n,o,r){const s=i=>t(i,n,o,r);return Pg.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s)}class fn{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){fn.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||fn.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};fn.prototype.setState.call(this,t)}}class ss extends fn{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){a.useDebugValue(t),J(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){J(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){if(process.env.NODE_ENV!=="production"){a.useDebugValue(t,s=>Object.keys(s));const o=a.useRef(Object.keys(t)).current,r=Object.keys(t);(o.length!==r.length||o.some((s,i)=>s!==r[i]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const n=Object.values(t);J(()=>{this.update(t)},n)}useControlledProp(t,n,o){a.useDebugValue(t);const r=n!==void 0;if(process.env.NODE_ENV!=="production"){const s=this.controlledValues.get(t);s!==void 0&&s!==r&&console.error(`A component is changing the ${r?"":"un"}controlled state of ${t.toString()} to be ${r?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}this.controlledValues.has(t)||(this.controlledValues.set(t,r),!r&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),J(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,o,r])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{a.useDebugValue(t);const s=this.selectors[t];return ve(this,s,n,o,r)};useContextCallback(t,n){a.useDebugValue(t);const o=Q(n??ot);this.context[t]=o}useStateSetter(t){const n=a.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const c=r;r=i,n(i,c,this)}})}}function Ng(){const[,e]=a.useState({});return a.useCallback(()=>{e({})},[])}const Ag={open:se(e=>e.open),domReferenceElement:se(e=>e.domReferenceElement),referenceElement:se(e=>e.positionReference??e.referenceElement),floatingElement:se(e=>e.floatingElement),floatingId:se(e=>e.floatingId)};class is extends ss{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:kc(),nested:n,noEmit:o,triggerElements:s},Ag)}setOpen=(t,n)=>{if(this.context.dataRef.current.openEvent=t?n.event:void 0,!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function Ig(e,t){const n=a.useRef(null);return a.useCallback(o=>{if(e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),o!==null))return n.current=e,t.context.triggerElements.add(e,o),()=>{n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null)}},[t,e])}function Zc(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=Ig(e,n),i=Q(c=>{const u=s(c);return c!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...o}),u});return J(()=>{r&&n.update({activeTriggerElement:t,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Jc(e){const t=e.useState("open");J(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Qc(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=Co(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=Q(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),c=t.useState("preventUnmountingOnClose");return $t({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class Do{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);if(o!==n&&(o!==void 0&&this.elements.delete(o),this.elements.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elements.size!==this.idMap.size))throw new Error(process.env.NODE_ENV!=="production"?"Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.":Oe(87))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function Mg(){return new is({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Do,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function ea(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:Mg(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:$e,inactiveTriggerProps:$e,popupProps:$e}}const ta={open:se(e=>e.open),mounted:se(e=>e.mounted),transitionStatus:se(e=>e.transitionStatus),floatingRootContext:se(e=>e.floatingRootContext),preventUnmountingOnClose:se(e=>e.preventUnmountingOnClose),payload:se(e=>e.payload),activeTriggerId:se(e=>e.activeTriggerId),activeTriggerElement:se(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:se((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:se((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:se((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:se((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:se(e=>e.popupProps),popupElement:se(e=>e.popupElement),positionerElement:se(e=>e.positionerElement)};function na(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=Ft(),s=Wt()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Te(c)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const i=Je(()=>new is({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new Do,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return J(()=>{const c={open:t,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=Te(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Lg(e={}){const{nodeId:t,externalTree:n}=e,o=na(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=a.useState(null),u=a.useRef(null),l=on(n);J(()=>{s.domReference&&(u.current=s.domReference)},[s.domReference]);const d=Zp({...e,elements:{...s,...i&&{reference:i}}}),f=a.useCallback(_=>{const N=Te(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;c(N),d.refs.setReference(N)},[d.refs]),[p,g]=a.useState(null),[m,h]=a.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",Te(p)?p:null),r.useSyncedValue("floatingElement",m);const E=a.useCallback(_=>{(Te(_)||_===null)&&(u.current=_,g(_)),(Te(d.refs.reference.current)||d.refs.reference.current===null||_!==null&&!Te(_))&&d.refs.setReference(_)},[d.refs,g]),b=a.useCallback(_=>{h(_),d.refs.setFloating(_)},[d.refs]),y=a.useMemo(()=>({...d.refs,setReference:E,setFloating:b,setPositionReference:f,domReference:u}),[d.refs,E,b,f]),x=a.useMemo(()=>({...d.elements,domReference:s.domReference}),[d.elements,s.domReference]),v=r.useState("open"),R=r.useState("floatingId"),w=a.useMemo(()=>({...d,dataRef:r.context.dataRef,open:v,onOpenChange:r.setOpen,events:r.context.events,floatingId:R,refs:y,elements:x,nodeId:t,rootStore:r}),[d,y,x,t,r,v,R]);return J(()=>{r.context.dataRef.current.floatingContext=w;const _=l?.nodesRef.current.find(N=>N.id===t);_&&(_.context=w)}),a.useMemo(()=>({...d,context:w,refs:y,elements:x,rootStore:r}),[d,y,x,w,r])}function oa(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=Ft(),i=Wt()!=null,c=t.useState("open"),u=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),d=t.context.triggerElements,f=Je(()=>new is({open:c,referenceElement:u,floatingElement:l,triggerElements:d,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return J(()=>{const p={open:c,floatingId:s,referenceElement:u,floatingElement:l};Te(u)&&(p.domReferenceElement=u),f.update(p)},[c,s,u,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const _r=jn("safe-polygon"),Dg=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${tc}`;function kg(e){return e?!!e.closest(Dg):!1}function ra(e){const t=a.useRef(void 0),n=a.useRef(!1),o=a.useRef(void 0),r=a.useRef(!0),s=a.useRef(!1),i=a.useRef(()=>{}),c=a.useRef(!1),u=Xe(),l=Xe(),d=a.useRef(void 0);return a.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:c,openChangeTimeout:u,restTimeout:l,handleCloseOptionsRef:d}),f.hoverInteractionState},[e,t,n,o,r,s,i,c,u,l,d])}const Fg=new Set(["click","mousedown"]);function Vg(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:c=!0,closeDelay:u=0,externalTree:l}=t,{pointerTypeRef:d,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:g,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:E,handleCloseOptionsRef:b}=ra(n),y=on(l),x=Wt(),v=Q(()=>f.current?!0:i.current.openEvent?Fg.has(i.current.openEvent.type):!1),R=Q(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),w=a.useCallback((k,L=!0)=>{const O=jg(u,d.current);O&&!p.current?E.start(O,()=>n.setOpen(!1,me(rt,k))):L&&(E.clear(),n.setOpen(!1,me(rt,k)))},[u,p,n,d,E]),_=Q(()=>{m.current(),p.current=void 0}),N=Q(()=>{if(g.current){const k=De(r).body;k.style.pointerEvents="",k.removeAttribute(_r),g.current=!1}}),M=Q(k=>{const L=qe(k);if(!kg(L)){f.current=!1;return}f.current=!0});J(()=>{o||(d.current=void 0,h.current=!1,f.current=!1,_(),N())},[o,d,h,f,_,N]),a.useEffect(()=>()=>{_()},[_]),a.useEffect(()=>N,[N]),J(()=>{if(c&&o&&b.current?.blockPointerEvents&&R()&&Te(s)&&r){g.current=!0;const k=De(r).body;k.setAttribute(_r,"");const L=s,O=r,S=y?.nodesRef.current.find(I=>I.id===x)?.context?.elements.floating;return S&&(S.style.pointerEvents=""),k.style.pointerEvents="none",L.style.pointerEvents="auto",O.style.pointerEvents="auto",()=>{k.style.pointerEvents="",L.style.pointerEvents="",O.style.pointerEvents=""}}},[c,o,s,r,b,R,y,x,g]),a.useEffect(()=>{if(!c)return;function k(I){if(v()||!i.current.floatingContext)return;const T=n.context.triggerElements;I.relatedTarget&&T.hasElement(I.relatedTarget)||(N(),_(),v()||w(I))}function L(I){E.clear(),N(),p.current?.(I),_()}function O(I){v()||w(I,!1)}const S=r;return S&&(S.addEventListener("mouseleave",k),S.addEventListener("mouseenter",L),S.addEventListener("mouseleave",O),S.addEventListener("pointerdown",M,!0)),()=>{S&&(S.removeEventListener("mouseleave",k),S.removeEventListener("mouseenter",L),S.removeEventListener("mouseleave",O),S.removeEventListener("pointerdown",M,!0))}})}function jg(e,t){return t&&!hn(t)?0:typeof e=="function"?e():e}function rr(e){return typeof e=="function"?e():e}function Bg(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:c=null,mouseOnly:u=!1,restMs:l=0,move:d=!0,triggerElement:f=null,externalTree:p,isActiveTrigger:g=!0}=t,m=on(p),{pointerTypeRef:h,interactedInsideRef:E,handlerRef:b,blockMouseMoveRef:y,performedPointerEventsMutationRef:x,unbindMouseMoveRef:v,restTimeoutPendingRef:R,openChangeTimeout:w,restTimeout:_,handleCloseOptionsRef:N}=ra(n),M=ke(c),k=ke(i),L=ke(l);g&&(N.current=M.current?.__options);const O=Q(()=>E.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),S=a.useCallback((D,C=!0)=>{const F=Go(k.current,"close",h.current);F&&!b.current?w.start(F,()=>n.setOpen(!1,me(rt,D))):C&&(w.clear(),n.setOpen(!1,me(rt,D)))},[k,b,n,h,w]),I=Q(()=>{v.current(),b.current=void 0}),T=Q(()=>{if(x.current){const D=De(n.select("domReferenceElement")).body;D.style.pointerEvents="",D.removeAttribute(_r),x.current=!1}});a.useEffect(()=>{if(!s)return;function D(C){C.open||(w.clear(),_.clear(),y.current=!0,R.current=!1)}return r.on("openchange",D),()=>{r.off("openchange",D)}},[s,r,w,_,y,R]);const A=Q(D=>{if(O()||!o.current.floatingContext)return;const C=n.context.triggerElements;D.relatedTarget&&C.hasElement(D.relatedTarget)||M.current?.({...o.current.floatingContext,tree:m,x:D.clientX,y:D.clientY,onClose(){T(),I(),O()||S(D)}})(D)});return a.useEffect(()=>{if(!s)return;const D=f??(g?n.select("domReferenceElement"):null);if(!Te(D))return;function C(H){if(w.clear(),y.current=!1,u&&!hn(h.current)||rr(L.current)>0&&!Go(k.current,"open"))return;const ee=Go(k.current,"open",h.current),W=n.select("domReferenceElement"),X=n.context.triggerElements,Y=(X.hasElement(H.target)||X.hasMatchingElement(V=>Ee(V,H.target)))&&(!W||!Ee(W,H.target)),z=H.currentTarget??null;ee?w.start(ee,()=>{n.select("open")||n.setOpen(!0,me(rt,H,z))}):(!n.select("open")||Y)&&n.setOpen(!0,me(rt,H,z))}function F(H){if(O()){T();return}v.current();const ee=n.select("domReferenceElement"),W=De(ee);_.clear(),R.current=!1;const X=n.context.triggerElements;if(H.relatedTarget&&X.hasElement(H.relatedTarget))return;if(M.current&&o.current.floatingContext){n.select("open")||w.clear(),b.current=M.current({...o.current.floatingContext,tree:m,x:H.clientX,y:H.clientY,onClose(){T(),I(),O()||S(H,!0)}});const z=b.current;z(H),W.addEventListener("mousemove",z),v.current=()=>{W.removeEventListener("mousemove",z)};return}(h.current==="touch"?!Ee(n.select("floatingElement"),H.relatedTarget):!0)&&S(H)}function j(H){A(H)}return n.select("open")&&D.addEventListener("mouseleave",j),d&&D.addEventListener("mousemove",C,{once:!0}),D.addEventListener("mouseenter",C),D.addEventListener("mouseleave",F),()=>{D.removeEventListener("mouseleave",j),d&&D.removeEventListener("mousemove",C),D.removeEventListener("mouseenter",C),D.removeEventListener("mouseleave",F)}},[I,T,y,o,k,S,n,s,M,A,g,O,u,d,h,L,_,R,w,f,m,v,b]),a.useMemo(()=>{function D(C){h.current=C.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(C){const{nativeEvent:F}=C,j=C.currentTarget,H=n.select("domReferenceElement"),ee=n.context.triggerElements,W=n.select("open"),X=(ee.hasElement(C.target)||ee.hasMatchingElement(z=>Ee(z,C.target)))&&(!H||!Ee(H,C.target));if(u&&!hn(h.current)||W&&!X||rr(L.current)===0||!X&&R.current&&C.movementX**2+C.movementY**2<2)return;_.clear();function Y(){!y.current&&(!W||X)&&n.setOpen(!0,me(rt,F,j))}h.current==="touch"?it.flushSync(()=>{Y()}):X&&W?Y():(R.current=!0,_.start(rr(L.current),Y))}}},[y,u,n,h,L,_,R])}function Kn(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=a.useCallback(l=>ro(l,e,"reference"),t),i=a.useCallback(l=>ro(l,e,"floating"),n),c=a.useCallback(l=>ro(l,e,"item"),o),u=a.useCallback(l=>ro(l,e,"trigger"),r);return a.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:u}),[s,i,c,u])}function ro(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[br]="");for(const i in e)r&&e&&(i===Qi||i===ec)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let c;const u=t[i]?.[n];typeof u=="function"?c=e?u(e):null:c=u,c&&gi(s,c,r,o)}return gi(s,e,r,o),s}function gi(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Qi||r===ec)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(c=>c(...i)).find(c=>c!==void 0))):e[r]=s)}}const $g="Escape";function ko(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function so(e,t){return ko(t,e===zr||e===Wn,e===Nt||e===At)}function sr(e,t,n){return ko(t,e===Wn,n?e===Nt:e===At)||e==="Enter"||e===" "||e===""}function Hg(e,t,n){return ko(t,n?e===Nt:e===At,e===Wn)}function zg(e,t,n,o){const r=n?e===At:e===Nt,s=e===zr;return t==="both"||t==="horizontal"&&o&&o>1?e===$g:ko(t,r,s)}function Wg(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:c,activeIndex:u,onNavigate:l=()=>{},enabled:d=!0,selectedIndex:f=null,allowEscape:p=!1,loopFocus:g=!1,nested:m=!1,rtl:h=!1,virtual:E=!1,focusItemOnOpen:b="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:x=!0,disabledIndices:v=void 0,orientation:R="vertical",parentOrientation:w,cols:_=1,scrollItemIntoView:N=!0,itemSizes:M,dense:k=!1,id:L,externalTree:O}=t;process.env.NODE_ENV!=="production"&&(p&&(g||console.warn("`useListNavigation` looping must be enabled to allow escaping."),E||console.warn("`useListNavigation` must be virtual to allow escaping.")),R==="vertical"&&_>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const S=Fn(r),I=ke(S),T=Wt(),A=on(O);J(()=>{i.current.orientation=R},[i,R]);const D=vr(s),C=a.useRef(b),F=a.useRef(f??-1),j=a.useRef(null),H=a.useRef(!0),ee=Q(B=>{l(F.current===-1?null:F.current,B)}),W=a.useRef(ee),X=a.useRef(!!r),Y=a.useRef(o),z=a.useRef(!1),V=a.useRef(!1),ce=ke(v),fe=ke(o),xe=ke(N),$=ke(f),ie=Q(()=>{function B(te){E?A?.events.emit("virtualfocus",te):uo(te,{sync:z.current,preventScroll:!0})}const ae=c.current[F.current],ne=V.current;ae&&B(ae),(z.current?te=>te():requestAnimationFrame)(()=>{const te=c.current[F.current]||ae;if(!te)return;ae||B(te);const de=xe.current;de&&Se&&(ne||!H.current)&&te.scrollIntoView?.(typeof de=="boolean"?{block:"nearest",inline:"nearest"}:de)})});J(()=>{d&&(o&&r?(F.current=f??-1,C.current&&f!=null&&(V.current=!0,ee())):X.current&&(F.current=-1,W.current()))},[d,o,r,f,ee]),J(()=>{if(d){if(!o){z.current=!1;return}if(r)if(u==null){if(z.current=!1,$.current!=null)return;if(X.current&&(F.current=-1,ie()),(!Y.current||!X.current)&&C.current&&(j.current!=null||C.current===!0&&j.current==null)){let B=0;const ae=()=>{c.current[0]==null?(B<2&&(B?requestAnimationFrame:queueMicrotask)(ae),B+=1):(F.current=j.current==null||sr(j.current,R,h)||m?lo(c):Rr(c),j.current=null,ee())};ae()}}else an(c,u)||(F.current=u,ie(),V.current=!1)}},[d,o,r,u,$,m,c,R,h,ee,ie,ce]),J(()=>{if(!d||r||!A||E||!X.current)return;const B=A.nodesRef.current,ae=B.find(te=>te.id===T)?.context?.elements.floating,ne=st(De(r)),q=B.some(te=>te.context&&Ee(te.context.elements.floating,ne));ae&&!q&&H.current&&ae.focus({preventScroll:!0})},[d,r,A,T,E]),J(()=>{W.current=ee,Y.current=o,X.current=!!r}),J(()=>{o||(j.current=null,C.current=b)},[o,b]);const oe=u!=null,Se=a.useMemo(()=>{function B(ne){if(!fe.current)return;const q=c.current.indexOf(ne.currentTarget);q!==-1&&F.current!==q&&(F.current=q,ee(ne))}return{onFocus(ne){z.current=!0,B(ne)},onClick:({currentTarget:ne})=>ne.focus({preventScroll:!0}),onMouseMove(ne){z.current=!0,V.current=!1,y&&B(ne)},onPointerLeave(ne){if(!fe.current||!H.current||ne.pointerType==="touch")return;z.current=!0;const q=ne.relatedTarget;!y||c.current.includes(q)||(F.current=-1,ee(ne),E||I.current?.focus({preventScroll:!0}))}}},[fe,I,y,c,ee,E]),U=a.useCallback(()=>w??A?.nodesRef.current.find(B=>B.id===T)?.context?.dataRef?.current.orientation,[T,A,w]),G=Q(B=>{if(H.current=!1,z.current=!0,B.which===229||!fe.current&&B.currentTarget===I.current)return;if(m&&zg(B.key,R,h,_)){so(B.key,U())||We(B),n.setOpen(!1,me(qo,B.nativeEvent)),Ae(s)&&(E?A?.events.emit("virtualfocus",s):s.focus());return}const ae=F.current,ne=lo(c,v),q=Rr(c,v);if(D||(B.key==="Home"&&(We(B),F.current=ne,ee(B)),B.key==="End"&&(We(B),F.current=q,ee(B))),_>1){const te=M||Array.from({length:c.current.length},()=>({width:1,height:1})),de=cc(te,_,k),pe=de.findIndex(Ce=>Ce!=null&&!It(c,Ce,v)),we=de.reduce((Ce,Be,ct)=>Be!=null&&!It(c,Be,v)?ct:Ce,-1),Re=de[ic({current:de.map(Ce=>Ce!=null?c.current[Ce]:null)},{event:B,orientation:R,loopFocus:g,rtl:h,cols:_,disabledIndices:lc([...(typeof v!="function"?v:null)||c.current.map((Ce,Be)=>It(c,Be,v)?Be:void 0),void 0],de),minIndex:pe,maxIndex:we,prevIndex:ac(F.current>q?ne:F.current,te,de,_,B.key===Wn?"bl":B.key===(h?Nt:At)?"tr":"tl"),stopEvent:!0})];if(Re!=null&&(F.current=Re,ee(B)),R==="both")return}if(so(B.key,R)){if(We(B),o&&!E&&st(B.currentTarget.ownerDocument)===B.currentTarget){F.current=sr(B.key,R,h)?ne:q,ee(B);return}sr(B.key,R,h)?g?ae>=q?p&&ae!==c.current.length?F.current=-1:(z.current=!1,F.current=ne):F.current=ze(c,{startingIndex:ae,disabledIndices:v}):F.current=Math.min(q,ze(c,{startingIndex:ae,disabledIndices:v})):g?ae<=ne?p&&ae!==-1?F.current=c.current.length:(z.current=!1,F.current=q):F.current=ze(c,{startingIndex:ae,decrement:!0,disabledIndices:v}):F.current=Math.max(ne,ze(c,{startingIndex:ae,decrement:!0,disabledIndices:v})),an(c,F.current)&&(F.current=-1),ee(B)}}),K=a.useMemo(()=>E&&o&&oe&&{"aria-activedescendant":`${L}-${u}`},[E,o,oe,L,u]),ge=a.useMemo(()=>({"aria-orientation":R==="both"?void 0:R,...D?{}:K,onKeyDown(B){if(B.key==="Tab"&&B.shiftKey&&o&&!E){const ae=qe(B.nativeEvent);if(ae&&!Ee(I.current,ae))return;We(B),n.setOpen(!1,me(Zt,B.nativeEvent)),Ae(s)&&s.focus();return}G(B)},onPointerMove(){H.current=!0}}),[K,G,I,R,D,n,o,E,s]),le=a.useMemo(()=>{function B(ne){b==="auto"&&oc(ne.nativeEvent)&&(C.current=!E)}function ae(ne){C.current=b,b==="auto"&&rc(ne.nativeEvent)&&(C.current=!0)}return{onKeyDown(ne){const q=n.select("open");H.current=!1;const te=ne.key.startsWith("Arrow"),de=Hg(ne.key,U(),h),pe=so(ne.key,R),we=(m?de:pe)||ne.key==="Enter"||ne.key.trim()==="";if(E&&q)return G(ne);if(!(!q&&!x&&te)){if(we){const Re=so(ne.key,U());j.current=m&&Re?null:ne.key}if(m){de&&(We(ne),q?(F.current=lo(c,ce.current),ee(ne)):n.setOpen(!0,me(qo,ne.nativeEvent,ne.currentTarget)));return}pe&&($.current!=null&&(F.current=$.current),We(ne),!q&&x?n.setOpen(!0,me(qo,ne.nativeEvent,ne.currentTarget)):G(ne),q&&ee(ne))}},onFocus(ne){n.select("open")&&!E&&(F.current=-1,ee(ne))},onPointerDown:ae,onPointerEnter:ae,onMouseDown:B,onClick:B}},[G,ce,b,c,m,ee,n,x,R,U,h,$,E]),re=a.useMemo(()=>({...K,...le}),[K,le]);return a.useMemo(()=>d?{reference:re,floating:ge,item:Se,trigger:le}:{},[d,re,ge,le,Se])}const Ug=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function sa(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:c=!0,role:u="dialog"}=t,l=Ft(),d=s?.id||l,f=a.useMemo(()=>Fn(i)?.id||r,[i,r]),p=Ug.get(u)??u,m=Wt()!=null,h=a.useMemo(()=>p==="tooltip"||u==="label"?$e:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&m&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[p,m,u]),E=a.useMemo(()=>p==="tooltip"||u==="label"?{[`aria-${u==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:d}},[p,f,o,d,u,h]),b=a.useMemo(()=>{const x={id:f,...p&&{role:p}};return p==="tooltip"||u==="label"?x:{...x,...p==="menu"&&{"aria-labelledby":d}}},[p,f,d,u]),y=a.useCallback(({active:x,selected:v})=>{const R={role:"option",...x&&{id:`${f}-fui-option`}};switch(u){case"select":case"combobox":return{...R,"aria-selected":v}}return{}},[f,u]);return a.useMemo(()=>c?{reference:E,floating:b,item:y,trigger:h}:{},[c,E,b,h,y])}function Kg(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.context.dataRef,{listRef:s,activeIndex:i,onMatch:c,onTypingChange:u,enabled:l=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:p=gn,selectedIndex:g=null}=t,m=Xe(),h=a.useRef(""),E=a.useRef(g??i??-1),b=a.useRef(null);J(()=>{o&&(m.clear(),b.current=null,h.current="")},[o,m]),J(()=>{o&&h.current===""&&(E.current=g??i??-1)},[o,g,i]);const y=Q(w=>{w?r.current.typing||(r.current.typing=w,u?.(w)):r.current.typing&&(r.current.typing=w,u?.(w))}),x=Q(w=>{function _(O,S,I){const T=d?d(S,I):S.find(A=>A?.toLocaleLowerCase().indexOf(I.toLocaleLowerCase())===0);return T?O.indexOf(T):-1}const N=s.current;if(h.current.length>0&&h.current[0]!==" "&&(_(N,N,h.current)===-1?y(!1):w.key===" "&&We(w)),N==null||p.includes(w.key)||w.key.length!==1||w.ctrlKey||w.metaKey||w.altKey)return;o&&w.key!==" "&&(We(w),y(!0)),N.every(O=>O?O[0]?.toLocaleLowerCase()!==O[1]?.toLocaleLowerCase():!0)&&h.current===w.key&&(h.current="",E.current=b.current),h.current+=w.key,m.start(f,()=>{h.current="",E.current=b.current,y(!1)});const k=E.current,L=_(N,[...N.slice((k||0)+1),...N.slice(0,(k||0)+1)],h.current);L!==-1?(c?.(L),b.current=L):w.key!==" "&&(h.current="",y(!1))}),v=a.useMemo(()=>({onKeyDown:x}),[x]),R=a.useMemo(()=>({onKeyDown:x,onKeyUp(w){w.key===" "&&y(!1)}}),[x,y]);return a.useMemo(()=>l?{reference:v,floating:R}:{},[l,v,R])}function mi(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,c=s-1;i<s;c=i++){const[u,l]=t[i]||[0,0],[d,f]=t[c]||[0,0];l>=o!=f>=o&&n<=(d-u)*(o-l)/(f-l)+u&&(r=!r)}return r}function qg(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Yg(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new mt;let s=!1,i=null,c=null,u=typeof performance<"u"?performance.now():0;function l(f,p){const g=performance.now(),m=g-u;if(i===null||c===null||m===0)return i=f,c=p,u=g,null;const h=f-i,E=p-c,y=Math.sqrt(h*h+E*E)/m;return i=f,c=p,u=g,y}const d=({x:f,y:p,placement:g,elements:m,onClose:h,nodeId:E,tree:b})=>function(x){function v(){r.clear(),h()}if(r.clear(),!m.domReference||!m.floating||g==null||f==null||p==null)return;const{clientX:R,clientY:w}=x,_=[R,w],N=qe(x),M=x.type==="mouseleave",k=Ee(m.floating,N),L=Ee(m.domReference,N),O=m.domReference.getBoundingClientRect(),S=m.floating.getBoundingClientRect(),I=g.split("-")[0],T=f>S.right-S.width/2,A=p>S.bottom-S.height/2,D=qg(_,O),C=S.width>O.width,F=S.height>O.height,j=(C?O:S).left,H=(C?O:S).right,ee=(F?O:S).top,W=(F?O:S).bottom;if(k&&(s=!0,!M))return;if(L&&(s=!1),L&&!M){s=!0;return}if(M&&Te(x.relatedTarget)&&Ee(m.floating,x.relatedTarget)||b&&Gt(b.nodesRef.current,E).some(({context:z})=>z?.open))return;if(I==="top"&&p>=O.bottom-1||I==="bottom"&&p<=O.top+1||I==="left"&&f>=O.right-1||I==="right"&&f<=O.left+1)return v();let X=[];switch(I){case"top":X=[[j,O.top+1],[j,S.bottom-1],[H,S.bottom-1],[H,O.top+1]];break;case"bottom":X=[[j,S.top+1],[j,O.bottom-1],[H,O.bottom-1],[H,S.top+1]];break;case"left":X=[[S.right-1,W],[S.right-1,ee],[O.left+1,ee],[O.left+1,W]];break;case"right":X=[[O.right-1,W],[O.right-1,ee],[S.left+1,ee],[S.left+1,W]];break}function Y([z,V]){switch(I){case"top":{const ce=[C?z+t/2:T?z+t*4:z-t*4,V+t+1],fe=[C?z-t/2:T?z+t*4:z-t*4,V+t+1],xe=[[S.left,T||C?S.bottom-t:S.top],[S.right,T?C?S.bottom-t:S.top:S.bottom-t]];return[ce,fe,...xe]}case"bottom":{const ce=[C?z+t/2:T?z+t*4:z-t*4,V-t],fe=[C?z-t/2:T?z+t*4:z-t*4,V-t],xe=[[S.left,T||C?S.top+t:S.bottom],[S.right,T?C?S.top+t:S.bottom:S.top+t]];return[ce,fe,...xe]}case"left":{const ce=[z+t+1,F?V+t/2:A?V+t*4:V-t*4],fe=[z+t+1,F?V-t/2:A?V+t*4:V-t*4];return[...[[A||F?S.right-t:S.left,S.top],[A?F?S.right-t:S.left:S.right-t,S.bottom]],ce,fe]}case"right":{const ce=[z-t,F?V+t/2:A?V+t*4:V-t*4],fe=[z-t,F?V-t/2:A?V+t*4:V-t*4],xe=[[A||F?S.left+t:S.right,S.top],[A?F?S.left+t:S.right:S.left+t,S.bottom]];return[ce,fe,...xe]}default:return[]}}if(!mi([R,w],X)){if(s&&!D)return v();if(!M&&o){const z=l(x.clientX,x.clientY);if(z!==null&&z<.1)return v()}mi([R,w],Y([f,p]))?!s&&o&&r.start(40,v):v()}};return d.__options={blockPointerEvents:n},d}let Gg=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),Xg=(function(e){return e[e.open=Yt.open]="open",e[e.closed=Yt.closed]="closed",e[e.startingStyle=Yt.startingStyle]="startingStyle",e[e.endingStyle=Yt.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const cs=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(cs.displayName="DialogPortalContext");function Zg(){const e=a.useContext(cs);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":Oe(26));return e}const Jg={...zt,...Vt,nestedDialogOpen(e){return e?{[Xg.nestedDialogOpen]:""}:null}},ia=a.forwardRef(function(t,n){const{className:o,finalFocus:r,initialFocus:s,render:i,...c}=t,{store:u}=Ht(),l=u.useState("descriptionElementId"),d=u.useState("disablePointerDismissal"),f=u.useState("floatingRootContext"),p=u.useState("popupProps"),g=u.useState("modal"),m=u.useState("mounted"),h=u.useState("nested"),E=u.useState("nestedOpenDialogCount"),b=u.useState("open"),y=u.useState("openMethod"),x=u.useState("titleElementId"),v=u.useState("transitionStatus"),R=u.useState("role");Zg(),$t({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});function w(L){return L==="touch"?u.context.popupRef.current:!0}const _=s===void 0?w:s,N=E>0,M=a.useMemo(()=>({open:b,nested:h,transitionStatus:v,nestedDialogOpen:N}),[b,h,v,N]),k=ue("div",t,{state:M,props:[p,{"aria-labelledby":x??void 0,"aria-describedby":l??void 0,role:R,tabIndex:-1,hidden:!m,onKeyDown(L){Yr.has(L.key)&&L.stopPropagation()},style:{[Gg.nestedDialogs]:E}},c],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:Jg});return P.jsx(ts,{context:f,openInteractionType:y,disabled:!m,closeOnFocusOut:!d,initialFocus:_,returnFocus:r,modal:g!==!1,restoreFocus:"popup",children:k})});process.env.NODE_ENV!=="production"&&(ia.displayName="DialogPopup");function Fo(e){return Di(19)?e:e?"true":void 0}const Vo=a.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
10
- 0% 0%,
11
- 100% 0%,
12
- 100% 100%,
13
- 0% 100%,
14
- 0% 0%,
15
- ${i.left}px ${i.top}px,
16
- ${i.left}px ${i.bottom}px,
17
- ${i.right}px ${i.bottom}px,
18
- ${i.right}px ${i.top}px,
19
- ${i.left}px ${i.top}px
20
- )`}return P.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Vo.displayName="InternalBackdrop");const ca=a.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=Ht(),i=s.useState("mounted"),c=s.useState("modal");return i||o?P.jsx(cs.Provider,{value:o,children:P.jsxs(Mo,{ref:n,...r,children:[i&&c===!0&&P.jsx(Vo,{ref:s.context.internalBackdropRef,inert:Fo(!open)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(ca.displayName="DialogPortal");let hi={},yi={},bi="";function Qg(e){if(typeof document>"u")return!1;const t=Ue(e);return Le(t).innerWidth-t.documentElement.clientWidth>0}function em(e){const t=Ue(e),n=t.documentElement,o=t.body,r=nn(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function tm(e){const t=Ue(e),n=t.documentElement,o=t.body,r=Le(n);let s=0,i=0;const c=Me.create(),u=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(Zi&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),g=r.getComputedStyle(o),E=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,hi={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},bi=n.style.scrollBehavior,yi={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,x=p.overflowY==="scroll"||g.overflowY==="scroll",v=p.overflowX==="scroll"||g.overflowX==="scroll",R=Math.max(0,r.innerWidth-n.clientWidth),w=Math.max(0,r.innerHeight-n.clientHeight),_=parseFloat(g.marginTop)+parseFloat(g.marginBottom),N=parseFloat(g.marginLeft)+parseFloat(g.marginRight),M=nn(n)?n:o;if(u){n.style.scrollbarGutter=E,M.style.overflowY="hidden",M.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(b||x)&&(n.style.overflowY="scroll"),(y||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:_||w?`calc(100dvh - ${_+w}px)`:"100dvh",width:N||R?`calc(100vw - ${N+R}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,hi),Object.assign(o.style,yi),u||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=bi)}function f(){d(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class nm{lockCount=0;restore=null;timeoutLock=mt.create();timeoutUnlock=mt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Ue(t).documentElement,r=Le(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=ot;return}const s=vd||!Qg(t);this.restore=s?em(t):tm(t)}}const om=new nm;function as(e=!0,t=null){J(()=>{if(e)return om.acquire(t)},[e,t])}function rm(e){const t=a.useRef(""),n=a.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:a.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function aa(e){const[t,n]=a.useState(null),o=Q((c,u)=>{e||n(u)}),r=a.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=rm(o);return a.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}function sm(e){const{store:t,parentContext:n,actionsRef:o}=e,r=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),c=t.useState("popupElement"),{openMethod:u,triggerProps:l,reset:d}=aa(r);Jc(t);const{forceUnmount:f}=Qc(r,t,()=>{d()}),p=Q(k=>{const L=me(k);return L.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},L}),g=a.useCallback(()=>{t.setOpen(!1,p($i))},[t,p]);a.useImperativeHandle(o,()=>({unmount:f,close:g}),[f,g]);const m=oa({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,E]=a.useState(0),b=h===0,y=sa(m),x=rs(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(k){if("button"in k&&k.button!==0||"touches"in k&&k.touches.length!==1)return!1;const L=qe(k);if(b&&!s){const O=L;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===O||t.context.backdropRef.current===O||Ee(O,c)&&!O?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:b});as(r&&i===!0,c);const{getReferenceProps:v,getFloatingProps:R,getTriggerProps:w}=Kn([y,x]);t.useContextCallback("onNestedDialogOpen",k=>{E(k+1)}),t.useContextCallback("onNestedDialogClose",()=>{E(0)}),a.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,h]);const _=a.useMemo(()=>v(l),[v,l]),N=a.useMemo(()=>w(l),[w,l]),M=a.useMemo(()=>R(),[R]);t.useSyncedValues({openMethod:u,activeTriggerProps:_,inactiveTriggerProps:N,popupProps:M,floatingRootContext:m,nestedOpenDialogCount:h})}const im={...ta,modal:se(e=>e.modal),nested:se(e=>e.nested),nestedOpenDialogCount:se(e=>e.nestedOpenDialogCount),disablePointerDismissal:se(e=>e.disablePointerDismissal),openMethod:se(e=>e.openMethod),descriptionElementId:se(e=>e.descriptionElementId),titleElementId:se(e=>e.titleElementId),viewportElement:se(e=>e.viewportElement),role:se(e=>e.role)};class cm extends ss{constructor(t){super(am(t),{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),triggerElements:new Do,onOpenChange:void 0,onOpenChangeComplete:void 0},im)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const r={open:t},s=n.trigger?.id??null;(s||t)&&(r.activeTriggerId=s,r.activeTriggerElement=n.trigger??null),this.update(r)}}function am(e={}){return{...ea(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function lm(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:d,defaultTriggerId:f=null}=e,p=Ht(!0),g=!!p,m=Je(()=>l?.store??new cm({open:n??o,activeTriggerId:d!==void 0?d:f,modal:c,disablePointerDismissal:i,nested:g})).current;m.useControlledProp("open",n,o),m.useControlledProp("activeTriggerId",d,f),m.useSyncedValues({disablePointerDismissal:i,nested:g,modal:c}),m.useContextCallback("onOpenChange",r),m.useContextCallback("onOpenChangeComplete",s);const h=m.useState("payload");sm({store:m,actionsRef:u,parentContext:p?.store.context});const E=a.useMemo(()=>({store:m}),[m]);return P.jsx(Gr.Provider,{value:E,children:typeof t=="function"?t({payload:h}):t})}const la=a.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:c}=Ht(),u=Qe(s);return c.useSyncedValueWithCleanup("titleElementId",u),ue("h2",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(la.displayName="DialogTitle");const ua=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...d}=t,f=Ht(!0),p=l?.store??f?.store;if(!p)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":Oe(79));const g=Qe(c),m=p.useState("floatingRootContext"),h=p.useState("isOpenedByTrigger",g),[E,b]=a.useState(null),{registerTrigger:y,isMountedByThisTrigger:x}=Zc(g,E,p,{payload:u}),{getButtonProps:v,buttonRef:R}=yt({disabled:s,native:i}),w=ns(m,{enabled:m!=null}),_=Kn([w]),N=a.useMemo(()=>({disabled:s,open:h}),[s,h]),M=p.useState("triggerProps",x);return ue("button",t,{state:N,ref:[R,n,y,b],props:[_.getReferenceProps(),M,{[Dr]:"",id:g},d,v],stateAttributesMapping:Xr})});process.env.NODE_ENV!=="production"&&(ua.displayName="DialogTrigger");const um="_backdrop_n0fed_10",dm="_popup_n0fed_32",fm="_title_n0fed_137",pm="_description_n0fed_150",gm="_close_n0fed_161",mm="_closeIcon_n0fed_194",hm="_trigger_n0fed_203",St={backdrop:um,popup:dm,"popup--default":"_popup--default_n0fed_59","popup--centered":"_popup--centered_n0fed_74","popup--fullscreen":"_popup--fullscreen_n0fed_89","popup--sm":"_popup--sm_n0fed_111","popup--md":"_popup--md_n0fed_117","popup--lg":"_popup--lg_n0fed_123",title:fm,description:pm,close:gm,closeIcon:mm,trigger:hm},da=Z.createContext({variant:"default",size:"md"}),ym=()=>Z.useContext(da),fa=Z.forwardRef(({open:e,defaultOpen:t=!1,onOpenChange:n,modal:o=!0,variant:r="default",size:s="md",children:i})=>P.jsx(da.Provider,{value:{variant:r,size:s},children:P.jsx(lm,{open:e,defaultOpen:t,onOpenChange:n,modal:o,children:i})}));fa.displayName="ALSDialog.Root";const pa=Z.forwardRef(({className:e,children:t},n)=>{const o=[St.trigger,e].filter(Boolean).join(" ");return P.jsx(ua,{ref:n,className:o,nativeButton:!1,render:r=>Z.cloneElement(t,r)})});pa.displayName="ALSDialog.Trigger";const ga=Z.forwardRef(({className:e},t)=>{const n=[St.backdrop,e].filter(Boolean).join(" ");return P.jsx(Mc,{ref:t,className:n})});ga.displayName="ALSDialog.Backdrop";const ma=({container:e,keepMounted:t=!1,children:n})=>P.jsx(ca,{container:e,keepMounted:t,children:n});ma.displayName="ALSDialog.Portal";const ha=Z.forwardRef(({className:e,children:t},n)=>{const{variant:o,size:r}=ym(),s=[St.popup,St[`popup--${o}`],St[`popup--${r}`],e].filter(Boolean).join(" ");return P.jsx(ia,{ref:n,className:s,children:t})});ha.displayName="ALSDialog.Popup";const ya=Z.forwardRef(({className:e,children:t},n)=>{const o=[St.title,e].filter(Boolean).join(" ");return P.jsx(la,{ref:n,className:o,children:t})});ya.displayName="ALSDialog.Title";const ba=Z.forwardRef(({className:e,children:t},n)=>{const o=[St.description,e].filter(Boolean).join(" ");return P.jsx(Dc,{ref:n,className:o,children:t})});ba.displayName="ALSDialog.Description";const va=Z.forwardRef(({className:e,children:t},n)=>{const o=[St.close,e].filter(Boolean).join(" ");return P.jsx(Lc,{ref:n,className:o,children:t||P.jsx(bm,{})})});va.displayName="ALSDialog.Close";const bm=()=>P.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:St.closeIcon,children:P.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),vm={Root:fa,Trigger:pa,Backdrop:ga,Portal:ma,Popup:ha,Title:ya,Description:ba,Close:va},xm="_root_1yzve_1",Em={root:xm};function Sm(e){return P.jsx("div",{className:Em.root})}const Rm="_root_o7syy_1",wm={root:Rm};function Cm(e){return P.jsx("div",{className:wm.root})}const Tm="_root_199mu_1",_m={root:Tm};function Om(e){return P.jsx("div",{className:_m.root})}let vi=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Pm={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},xa={valid(e){return e===null?null:e?{[vi.valid]:""}:{[vi.invalid]:""}}},Ea=a.createContext({invalid:void 0,name:void 0,validityData:{state:Pm,errors:[],error:"",value:"",initialValue:null},setValidityData:ot,disabled:void 0,touched:!1,setTouched:ot,dirty:!1,setDirty:ot,filled:!1,setFilled:ot,focused:!1,setFocused:ot,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=$e)=>e,getInputValidationProps:(e=$e)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Ea.displayName="FieldRootContext");function $n(e=!0){const t=a.useContext(Ea);if(t.setValidityData===ot&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Oe(28));return t}const Sa=a.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ot,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Sa.displayName="FormContext");function Ra(){return a.useContext(Sa)}const wa=a.createContext({controlId:void 0,setControlId:ot,labelId:void 0,setLabelId:ot,messageIds:[],setMessageIds:ot,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(wa.displayName="LabelableContext");function jo(){return a.useContext(wa)}function Nm(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Ca(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,setControlId:s}=jo(),i=Qe(t);return J(()=>{if(!(!n&&!t||s===ot)){if(n){const c=o?.current;Te(c)&&c.closest("label")!=null?s(t??null):s(r??i)}else t&&s(t);return()=>{t&&s(void 0)}}},[t,o,r,s,n,i]),r??i}function Ta(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:c}=Ra(),{invalid:u,markedDirtyRef:l,validityData:d,setValidityData:f}=$n(),p=Q(e.getValue);J(()=>{if(!t)return;let g=n;g===void 0&&(g=p()),d.initialValue===null&&g!==null&&f(m=>({...m,initialValue:g}))},[t,f,n,d.initialValue,p]),J(()=>{!t||!o||c.current.fields.set(o,{getValue:p,name:r,controlRef:s,validityData:Nm(d,u),validate(){let g=n;g===void 0&&(g=p()),l.current=!0,it.flushSync(()=>i(g))}})},[i,s,t,c,p,o,u,l,r,d,n]),J(()=>{const g=c.current.fields;return()=>{o&&g.delete(o)}},[c,o])}const _a=a.forwardRef(function(t,n){const{render:o,className:r,id:s,name:i,value:c,disabled:u=!1,onValueChange:l,defaultValue:d,...f}=t,{state:p,name:g,disabled:m}=$n(),h=m||u,E=g??i,b=a.useMemo(()=>({...p,disabled:h}),[p,h]),{setTouched:y,setDirty:x,validityData:v,setFocused:R,setFilled:w,validationMode:_,validation:N}=$n(),{labelId:M}=jo(),k=Ca({id:s});J(()=>{const A=c!=null;N.inputRef.current?.value||A&&c!==""?w(!0):A&&c===""&&w(!1)},[N.inputRef,w,c]);const[L,O]=pn({controlled:c,default:d,name:"FieldControl",state:"value"}),S=c!==void 0,I=Q((A,D)=>{l?.(A,D),!D.isCanceled&&O(A)});return Ta({id:k,name:E,commit:N.commit,value:L,getValue:()=>N.inputRef.current?.value,controlRef:N.inputRef}),ue("input",t,{ref:n,state:b,props:[{id:k,disabled:h,name:E,ref:N.inputRef,"aria-labelledby":M,...S?{value:L}:{defaultValue:d},onChange(A){const D=A.currentTarget.value;I(D,me(Dt,A.nativeEvent)),x(D!==v.initialValue),w(D!=="")},onFocus(){R(!0)},onBlur(A){y(!0),R(!1),_==="onBlur"&&N.commit(A.currentTarget.value)},onKeyDown(A){A.currentTarget.tagName==="INPUT"&&A.key==="Enter"&&(y(!0),N.commit(A.currentTarget.value))}},N.getInputValidationProps(),f],stateAttributesMapping:xa})});process.env.NODE_ENV!=="production"&&(_a.displayName="FieldControl");const Oa=a.forwardRef(function(t,n){return P.jsx(_a,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(Oa.displayName="Input");const Am="_input_1ph0q_5",io={input:Am,"input--outlined":"_input--outlined_1ph0q_25","input--filled":"_input--filled_1ph0q_40","input--sm":"_input--sm_1ph0q_59","input--md":"_input--md_1ph0q_64","input--lg":"_input--lg_1ph0q_69","input--success":"_input--success_1ph0q_78","input--warning":"_input--warning_1ph0q_87","input--error":"_input--error_1ph0q_96"},Pa=Z.forwardRef(({variant:e="outlined",size:t="md",status:n="default",className:o,disabled:r=!1,...s},i)=>{const c=[io.input,io[`input--${e}`],io[`input--${t}`],io[`input--${n}`],o].filter(Boolean).join(" ");return P.jsx(Oa,{ref:i,className:c,disabled:r,...s})});Pa.displayName="ALSInput";const Im="_root_so1gq_1",Mm={root:Im};function Lm(e){return P.jsx("div",{className:Mm.root})}const Dm="_root_g8l8f_1",km={root:Dm};function Fm(e){return P.jsx("div",{className:km.root})}const Vm="_root_krv6e_1",jm={root:Vm};function Bm(e){return P.jsx("div",{className:jm.root})}const $m="_root_qmqvr_1",Hm={root:$m};function zm(e){return P.jsx("div",{className:Hm.root})}const Wm="_root_1jbox_1",Um={root:Wm};function Km(e){return P.jsx("div",{className:Um.root})}const ls=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ls.displayName="PopoverRootContext");function bt(e){const t=a.useContext(ls);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.":Oe(47));return t}function qm(){return{...ea(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const Ym={...ta,disabled:se(e=>e.disabled),instantType:se(e=>e.instantType),openMethod:se(e=>e.openMethod),openChangeReason:se(e=>e.openChangeReason),modal:se(e=>e.modal),stickIfOpen:se(e=>e.stickIfOpen),titleElementId:se(e=>e.titleElementId),descriptionElementId:se(e=>e.descriptionElementId),openOnHover:se(e=>e.openOnHover),closeDelay:se(e=>e.closeDelay)};class us extends ss{constructor(t){const n={...qm(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:a.createRef(),beforeContentFocusGuardRef:a.createRef(),stickIfOpenTimeout:new mt,triggerElements:new Do},Ym)}setOpen=(t,n)=>{const o=n.reason===rt,r=n.reason===xt&&n.event.detail===0,s=!t&&(n.reason===Bi||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const u=()=>{const l={open:t,openChangeReason:n.reason},d=n.trigger?.id??null;(d||t)&&(l.activeTriggerId=d,l.activeTriggerElement=n.trigger??null),this.update(l)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Vu,()=>{this.set("stickIfOpen",!1)}),it.flushSync(u)):u(),r||s?this.set("instantType",r?"click":"dismiss"):n.reason===Zt?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const o=Je(()=>t??new us(n)).current;return zn(o.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function xi({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,modal:i=!1,handle:c,triggerId:u,defaultTriggerId:l=null}=e,d=us.useStore(c?.store,{open:n??o,modal:i,activeTriggerId:u!==void 0?u:l});d.useControlledProp("open",n,o),d.useControlledProp("activeTriggerId",u,l);const f=d.useState("open"),p=d.useState("positionerElement"),g=d.useState("payload"),m=d.useState("openChangeReason");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:E,reset:b}=aa(f);Jc(d);const{forceUnmount:y}=Qc(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null}),b()});as(f&&i===!0&&m!==rt&&h!=="touch",p),a.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]);const x=a.useCallback(T=>{const A=me(T);return A.preventUnmountOnClose=()=>{d.set("preventUnmountingOnClose",!0)},A},[d]),v=a.useCallback(()=>{d.setOpen(!1,x($i))},[d,x]);a.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:v}),[y,v]);const R=oa({popupStore:d,onOpenChange:d.setOpen}),w=rs(R,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),_=sa(R),{getReferenceProps:N,getFloatingProps:M,getTriggerProps:k}=Kn([w,_]),L=a.useMemo(()=>N(E),[N,E]),O=a.useMemo(()=>k(E),[k,E]),S=a.useMemo(()=>M(),[M]);d.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:L,inactiveTriggerProps:O,popupProps:S,floatingRootContext:R,nested:Wt()!=null});const I=a.useMemo(()=>({store:d}),[d]);return P.jsx(ls.Provider,{value:I,children:typeof t=="function"?t({payload:g}):t})}function Gm(e){return bt(!0)?P.jsx(xi,{props:e}):P.jsx(lp,{children:P.jsx(xi,{props:e})})}const Xm=300,Na=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,handle:c,payload:u,openOnHover:l=!1,delay:d=Xm,closeDelay:f=0,id:p,...g}=t,m=bt(!0),h=c?.store??m?.store;if(!h)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.":Oe(74));const E=Qe(p),b=h.useState("isTriggerActive",E),y=h.useState("floatingRootContext"),x=h.useState("isOpenedByTrigger",E),[v,R]=a.useState(null),{registerTrigger:w,isMountedByThisTrigger:_}=Zc(E,v,h,{payload:u,disabled:s,openOnHover:l,closeDelay:f}),N=h.useState("openChangeReason"),M=h.useState("stickIfOpen"),k=h.useState("openMethod"),L=Bg(y,{enabled:y!=null&&l&&(k!=="touch"||N!==xt),mouseOnly:!0,move:!1,handleClose:Yg(),restMs:d,delay:{close:f},triggerElement:v,isActiveTrigger:b}),O=ns(y,{enabled:y!=null,stickIfOpen:M}),S=Kn([O]),I=h.useState("triggerProps",_),T=a.useMemo(()=>({disabled:s,open:x}),[s,x]),{getButtonProps:A,buttonRef:D}=yt({disabled:s,native:i}),C=a.useMemo(()=>({open(W){return W&&N===xt?Ic.open(W):Xr.open(W)}}),[N]),F=ue("button",t,{state:T,ref:[D,n,w,R],props:[S.getReferenceProps(),L,I,{[Dr]:"",id:E},g,A],stateAttributesMapping:C}),j=a.useRef(null),H=Q(W=>{it.flushSync(()=>{h.setOpen(!1,me(Zt,W.nativeEvent,W.currentTarget))}),Qd(j.current)?.focus()}),ee=Q(W=>{const X=h.select("positionerElement");if(X&&ln(W,X))h.context.beforeContentFocusGuardRef.current?.focus();else{it.flushSync(()=>{h.setOpen(!1,me(Zt,W.nativeEvent,W.currentTarget))});let Y=Jd(v);for(;Y!==null&&Ee(X,Y)||Y?.hasAttribute("aria-hidden");){const z=Y;if(Y=qr(Y),Y===z)break}Y?.focus()}});return b?P.jsxs(a.Fragment,{children:[P.jsx(pt,{ref:j,onFocus:H}),P.jsx(a.Fragment,{children:F},E),P.jsx(pt,{ref:h.context.triggerFocusTargetRef,onFocus:ee})]}):P.jsx(a.Fragment,{children:F},E)});process.env.NODE_ENV!=="production"&&(Na.displayName="PopoverTrigger");const ds=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ds.displayName="PopoverPortalContext");function Zm(){const e=a.useContext(ds);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Portal> is missing.":Oe(45));return e}const Aa=a.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=bt();return s.useState("mounted")||o?P.jsx(ds.Provider,{value:o,children:P.jsx(Mo,{ref:n,...r,renderGuards:!1})}):null});process.env.NODE_ENV!=="production"&&(Aa.displayName="PopoverPortal");const fs=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(fs.displayName="PopoverPositionerContext");function Ia(){const e=a.useContext(fs);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.":Oe(46));return e}const Jm=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:l,padding:d=0,offsetParent:f="real"}=wt(e,t)||{};if(l==null)return{};const p=sc(d),g={x:n,y:o},m=Kr(r),h=Ur(m),E=await i.getDimensions(l),b=m==="y",y=b?"top":"left",x=b?"bottom":"right",v=b?"clientHeight":"clientWidth",R=s.reference[h]+s.reference[m]-g[m]-s.floating[h],w=g[m]-s.reference[m],_=f==="real"?await i.getOffsetParent?.(l):c.floating;let N=c.floating[v]||s.floating[h];(!N||!await i.isElement?.(_))&&(N=c.floating[v]||s.floating[h]);const M=R/2-w/2,k=N/2-E[h]/2-1,L=Math.min(p[y],k),O=Math.min(p[x],k),S=L,I=N-E[h]-O,T=N/2-E[h]/2+M,A=Er(S,T,I),D=!u.arrow&&Bt(r)!=null&&T!==A&&s.reference[h]/2-(T<S?L:O)-E[h]/2<0,C=D?T<S?T-S:T-I:0;return{[m]:g[m]+C,data:{[m]:A,centerOffset:T-A-C,...D&&{alignmentOffset:C}},reset:D}}}),Qm=(e,t)=>({...Jm(e),options:[e,t]}),eh={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await og().fn(e)).data?.referenceHidden||s}}}},po={sideX:"left",sideY:"top"},th={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:c}=e,u=Le(r),l=u.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:po};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&u?.visualViewport)p={width:u.visualViewport.width,height:u.visualViewport.height};else if(f===u){const y=Ue(r);p={width:y.documentElement.clientWidth,height:y.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const g=Ze(c);let m=t,h=n;g==="left"&&(m=p.width-(t+o.width)),g==="top"&&(h=p.height-(n+o.height));const E=g==="left"?"right":po.sideX,b=g==="top"?"bottom":po.sideY;return{x:m,y:h,data:{sideX:E,sideY:b}}}};function Ma(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Ei(e,t,n){const{rects:o,placement:r}=e;return{side:Ma(t,Ze(r),n),align:Bt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function La(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:g,mounted:m,collisionAvoidance:h,shiftCrossAxis:E=!1,nodeId:b,adaptiveOrigin:y,lazyFlip:x=!1,externalTree:v}=e,[R,w]=a.useState(null);!m&&R!==null&&w(null);const _=h.side||"flip",N=h.align||"flip",M=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,L=Q(k),O=k?L:t,S=ke(t),T=En()==="rtl",A=R||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":T?"left":"right","inline-start":T?"right":"left"}[o],D=s==="center"?A:`${A}-${s}`;let C=u;const F=1,j=o==="bottom"?F:0,H=o==="top"?F:0,ee=o==="right"?F:0,W=o==="left"?F:0;typeof C=="number"?C={top:C+j,right:C+W,bottom:C+H,left:C+ee}:C&&(C={top:(C.top||0)+j,right:(C.right||0)+W,bottom:(C.bottom||0)+H,left:(C.left||0)+ee});const X={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:C},Y=a.useRef(null),z=ke(r),V=ke(i),xe=[Jp(_e=>{const Ie=Ei(_e,o,T),He=typeof z.current=="function"?z.current(Ie):z.current,Fe=typeof V.current=="function"?V.current(Ie):V.current;return{mainAxis:He,crossAxis:Fe,alignmentAxis:Fe}},[typeof r!="function"?r:0,typeof i!="function"?i:0,T,o])],$=N==="none"&&_!=="shift",ie=!$&&(l||E||_==="shift"),oe=_==="none"?null:tg({...X,padding:{top:C.top+F,right:C.right+F,bottom:C.bottom+F,left:C.left+F},mainAxis:!E&&_==="flip",crossAxis:N==="flip"?"alignment":!1,fallbackAxisSideDirection:M}),Se=$?null:Qp(_e=>{const Ie=Ue(_e.elements.floating).documentElement;return{...X,rootBoundary:E?{x:0,y:0,width:Ie.clientWidth,height:Ie.clientHeight}:void 0,mainAxis:N!=="none",crossAxis:ie,limiter:l||E?void 0:eg(He=>{if(!Y.current)return{};const{width:Fe,height:be}=Y.current.getBoundingClientRect(),Ne=lt(Ze(He.placement)),Ve=Ne==="y"?Fe:be,Ke=Ne==="y"?C.left+C.right:C.top+C.bottom;return{offset:Ve/2+Ke/2}})}},[X,l,E,C,N]);_==="shift"||N==="shift"||s==="center"?xe.push(Se,oe):xe.push(oe,Se),xe.push(ng({...X,apply({elements:{floating:_e},rects:{reference:Ie},availableWidth:He,availableHeight:Fe}){Object.entries({"--available-width":`${He}px`,"--available-height":`${Fe}px`,"--anchor-width":`${Ie.width}px`,"--anchor-height":`${Ie.height}px`}).forEach(([be,Ne])=>{_e.style.setProperty(be,Ne)})}}),Qm(()=>({element:Y.current||document.createElement("div"),padding:d,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(_e){const{elements:Ie,middlewareData:He,placement:Fe,rects:be,y:Ne}=_e,Ve=Ze(Fe),Ke=lt(Ve),Ge=Y.current,Tt=He.arrow?.x||0,Yn=He.arrow?.y||0,zo=Ge?.clientWidth||0,du=Ge?.clientHeight||0,Wo=Tt+zo/2,As=Yn+du/2,fu=Math.abs(He.shift?.y||0),pu=be.reference.height/2,Pn=typeof r=="function"?r(Ei(_e,o,T)):r,gu=fu>Pn,mu={top:`${Wo}px calc(100% + ${Pn}px)`,bottom:`${Wo}px ${-Pn}px`,left:`calc(100% + ${Pn}px) ${As}px`,right:`${-Pn}px ${As}px`}[Ve],hu=`${Wo}px ${be.reference.y+pu-Ne}px`;return Ie.floating.style.setProperty("--transform-origin",ie&&Ke==="y"&&gu?hu:mu),{}}},eh,y),J(()=>{!m&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,g]);const U=a.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:G,elements:K,x:ge,y:le,middlewareData:re,update:B,placement:ae,context:ne,isPositioned:q,floatingStyles:te}=Lg({rootContext:g,placement:D,middleware:xe,strategy:n,whileElementsMounted:p?void 0:(..._e)=>oi(..._e,U),nodeId:b,externalTree:v}),{sideX:de,sideY:pe}=re.adaptiveOrigin||po,we=q?n:"fixed",Re=a.useMemo(()=>y?{position:we,[de]:ge,[pe]:le}:{position:we,...te},[y,we,de,ge,pe,le,te]),Ce=a.useRef(null);J(()=>{if(!m)return;const _e=S.current,Ie=typeof _e=="function"?_e():_e,Fe=(Si(Ie)?Ie.current:Ie)||null||null;Fe!==Ce.current&&(G.setPositionReference(Fe),Ce.current=Fe)},[m,G,O,S]),a.useEffect(()=>{if(!m)return;const _e=S.current;typeof _e!="function"&&Si(_e)&&_e.current!==Ce.current&&(G.setPositionReference(_e.current),Ce.current=_e.current)},[m,G,O,S]),a.useEffect(()=>{if(p&&m&&K.domReference&&K.floating)return oi(K.domReference,K.floating,B,U)},[p,m,K,B,U]);const Be=Ze(ae),ct=Ma(o,Be,T),Pe=Bt(ae)||"center",tt=!!re.hide?.referenceHidden;J(()=>{x&&m&&q&&w(Be)},[x,m,q,Be]);const Ye=a.useMemo(()=>({position:"absolute",top:re.arrow?.y,left:re.arrow?.x}),[re.arrow]),at=re.arrow?.centerOffset!==0;return a.useMemo(()=>({positionerStyles:Re,arrowStyles:Ye,arrowRef:Y,arrowUncentered:at,side:ct,align:Pe,physicalSide:Be,anchorHidden:tt,refs:G,context:ne,isPositioned:q,update:B}),[Re,Ye,Y,at,ct,Pe,Be,tt,G,ne,q,B])}function Si(e){return e!=null&&"current"in e}function ps(e){return e==="starting"?ju:$e}const Da=a.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="bottom",align:u="center",sideOffset:l=0,alignOffset:d=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:g=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:E=$u,...b}=t,{store:y}=bt(),x=Zm(),v=cp(),R=y.useState("floatingRootContext"),w=y.useState("mounted"),_=y.useState("open"),N=y.useState("openMethod"),M=y.useState("openChangeReason"),k=y.useState("activeTriggerElement"),L=y.useState("modal"),O=y.useState("positionerElement"),S=y.useState("instantType"),I=y.useState("transitionStatus"),T=a.useRef(null),A=wo(O,!1,!1),D=La({anchor:s,floatingRootContext:R,positionMethod:i,mounted:w,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:g,collisionBoundary:f,collisionPadding:p,sticky:m,disableAnchorTracking:h,keepMounted:x,nodeId:v,collisionAvoidance:E,adaptiveOrigin:th}),C=a.useMemo(()=>{const X={};return _||(X.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...D.positionerStyles,...X}}},[_,w,D.positionerStyles]),F=a.useMemo(()=>({props:C,...D}),[C,D]),j=R?.select("domReferenceElement");J(()=>{const X=j,Y=T.current;if(X&&(T.current=X),Y&&X&&X!==Y){y.set("instantType",void 0);const z=new AbortController;return A(()=>{y.set("instantType","trigger-change")},z.signal),()=>{z.abort()}}},[j,A,y]);const H=a.useMemo(()=>({open:_,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:S}),[_,F.side,F.align,F.anchorHidden,S]),ee=a.useCallback(X=>{y.set("positionerElement",X)},[y]),W=ue("div",t,{state:H,props:[F.props,ps(I),b],ref:[n,ee],stateAttributesMapping:zt});return P.jsxs(fs.Provider,{value:F,children:[w&&L===!0&&M!==rt&&N!=="touch"&&P.jsx(Vo,{ref:y.context.internalBackdropRef,inert:Fo(!_),cutout:k}),P.jsx(ap,{id:v,children:W})]})});process.env.NODE_ENV!=="production"&&(Da.displayName="PopoverPositioner");function Ri(e){const t=et(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ae(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o;return(bn(n)!==s||bn(o)!==i)&&(n=s,o=i),{width:n,height:o}}const nh=typeof ResizeObserver<"u",oh=()=>!0;function rh(e){const{popupElement:t,positionerElement:n,content:o,mounted:r,enabled:s=oh,onMeasureLayout:i,onMeasureLayoutComplete:c}=e,u=a.useRef(!0),l=wo(t,!0,!1),d=Sn(),f=a.useRef(null),p=Q(i),g=Q(c);J(()=>{if(!r||!s()||!nh){u.current=!0,f.current=null;return}if(!t||!n)return;const m=new ResizeObserver(w=>{const _=w[0];_&&(f.current===null?f.current={width:Math.ceil(_.borderBoxSize[0].inlineSize),height:Math.ceil(_.borderBoxSize[0].blockSize)}:(f.current.width=Math.ceil(_.borderBoxSize[0].inlineSize),f.current.height=Math.ceil(_.borderBoxSize[0].blockSize)))});m.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const h=An(t,"position","static"),E=An(t,"transform","none"),b=An(t,"scale","1"),y=An(n,"--available-width","max-content"),x=An(n,"--available-height","max-content");if(p?.(),u.current||f.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const w=Ri(t);return n.style.setProperty("--positioner-width",`${w.width}px`),n.style.setProperty("--positioner-height",`${w.height}px`),h(),E(),b(),y(),x(),g?.(null,w),u.current=!1,()=>{m.disconnect()}}t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto"),n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const v=Ri(t);t.style.setProperty("--popup-width",`${f.current.width}px`),t.style.setProperty("--popup-height",`${f.current.height}px`),h(),E(),y(),x(),g?.(f.current,v),n.style.setProperty("--positioner-width",`${v.width}px`),n.style.setProperty("--positioner-height",`${v.height}px`);const R=new AbortController;return d.request(()=>{t.style.setProperty("--popup-width",`${v.width}px`),t.style.setProperty("--popup-height",`${v.height}px`),l(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},R.signal)}),()=>{m.disconnect(),R.abort(),d.cancel()}},[o,t,n,l,d,s,r,p,g])}function An(e,t,n){const o=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,o)}}const ka=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ka.displayName="ToolbarRootContext");function Fa(e){return a.useContext(ka)}const sh={...zt,...Vt},Va=a.forwardRef(function(t,n){const{className:o,render:r,initialFocus:s,finalFocus:i,...c}=t,{store:u}=bt(),l=Ia(),d=Fa()!=null,f=En(),p=u.useState("open"),g=u.useState("openMethod"),m=u.useState("instantType"),h=u.useState("transitionStatus"),E=u.useState("popupProps"),b=u.useState("titleElementId"),y=u.useState("descriptionElementId"),x=u.useState("modal"),v=u.useState("mounted"),R=u.useState("openChangeReason"),w=u.useState("popupElement"),_=u.useState("payload"),N=u.useState("positionerElement"),M=u.useState("activeTriggerElement"),k=u.useState("floatingRootContext");$t({open:p,ref:u.context.popupRef,onComplete(){p&&u.context.onOpenChangeComplete?.(!0)}});const L=u.useState("disabled"),O=u.useState("openOnHover"),S=u.useState("closeDelay");Vg(k,{enabled:O&&!L,closeDelay:S});function I(W){return W==="touch"?u.context.popupRef.current:!0}const T=s===void 0?I:s,A=a.useMemo(()=>({open:p,side:l.side,align:l.align,instant:m,transitionStatus:h}),[p,l.side,l.align,m,h]),D=a.useCallback(W=>{u.set("popupElement",W)},[u]);function C(){k.context.events.emit("measure-layout")}function F(W,X){k.context.events.emit("measure-layout-complete",{previousDimensions:W,nextDimensions:X})}rh({popupElement:w,positionerElement:N,mounted:v,content:_,enabled:()=>u.context.triggerElements.size>1,onMeasureLayout:C,onMeasureLayoutComplete:F});const H=a.useMemo(()=>{let W=l.side==="top",X=l.side==="left";return f==="rtl"?(W=W||l.side==="inline-end",X=X||l.side==="inline-end"):(W=W||l.side==="inline-start",X=X||l.side==="inline-start"),W?{position:"absolute",[l.side==="top"?"bottom":"top"]:"0",[X?"right":"left"]:"0"}:$e},[l.side,f]),ee=ue("div",t,{state:A,ref:[n,u.context.popupRef,D],props:[E,{"aria-labelledby":b,"aria-describedby":y,style:H,onKeyDown(W){d&&Yr.has(W.key)&&W.stopPropagation()}},ps(h),c],stateAttributesMapping:sh});return P.jsx(ts,{context:k,openInteractionType:g,modal:x==="trap-focus",disabled:!v||R===rt,initialFocus:T,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Ae(M)?M:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:ee})});process.env.NODE_ENV!=="production"&&(Va.displayName="PopoverPopup");const ja=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=bt(),c=i.useState("open"),{arrowRef:u,side:l,align:d,arrowUncentered:f,arrowStyles:p}=Ia(),g=a.useMemo(()=>({open:c,side:l,align:d,uncentered:f}),[c,l,d,f]);return ue("div",t,{state:g,ref:[n,u],props:[{style:p,"aria-hidden":!0},s],stateAttributesMapping:zt})});process.env.NODE_ENV!=="production"&&(ja.displayName="PopoverArrow");const ih={...zt,...Vt},Ba=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=bt(),c=i.useState("open"),u=i.useState("mounted"),l=i.useState("transitionStatus"),d=i.useState("openChangeReason"),f=a.useMemo(()=>({open:c,transitionStatus:l}),[c,l]);return ue("div",t,{state:f,ref:[i.context.backdropRef,n],props:[{role:"presentation",hidden:!u,style:{pointerEvents:d===rt?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:ih})});process.env.NODE_ENV!=="production"&&(Ba.displayName="PopoverBackdrop");const $a=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i}=bt(),c=Qe(s.id);return J(()=>(i.set("titleElementId",c),()=>{i.set("titleElementId",void 0)}),[i,c]),ue("h2",t,{ref:n,props:[{id:c},s]})});process.env.NODE_ENV!=="production"&&($a.displayName="PopoverTitle");const Ha=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i}=bt(),c=Qe(s.id);return J(()=>(i.set("descriptionElementId",c),()=>{i.set("descriptionElementId",void 0)}),[i,c]),ue("p",t,{ref:n,props:[{id:c},s]})});process.env.NODE_ENV!=="production"&&(Ha.displayName="PopoverDescription");const za=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{buttonRef:u,getButtonProps:l}=yt({disabled:s,focusableWhenDisabled:!1,native:i}),{store:d}=bt();return ue("button",t,{ref:[n,u],props:[{onClick(p){d.setOpen(!1,me(ji,p.nativeEvent,p.currentTarget))}},c,l]})});process.env.NODE_ENV!=="production"&&(za.displayName="PopoverClose");const ch="_popup_1w2m7_1",ah="_arrow_1w2m7_25",lh="_title_1w2m7_35",uh="_description_1w2m7_42",dh="_close_1w2m7_49",fh="_backdrop_1w2m7_76",_n={popup:ch,arrow:ah,title:lh,description:uh,close:dh,backdrop:fh},Wa=Gm,Ua=a.forwardRef(function({children:t,...n},o){return P.jsx(Na,{...n,ref:o,nativeButton:!1,render:r=>a.cloneElement(t,r)})}),Ka=Aa,qa=a.forwardRef(function(t,n){return P.jsx(Da,{...t,ref:n})}),Ya=a.forwardRef(function({className:t,...n},o){return P.jsx(Va,{...n,className:`${_n.popup} ${t||""}`,ref:o})}),Ga=a.forwardRef(function({className:t,...n},o){return P.jsx(ja,{...n,className:`${_n.arrow} ${t||""}`,ref:o})}),Xa=a.forwardRef(function({className:t,...n},o){return P.jsx($a,{...n,className:`${_n.title} ${t||""}`,ref:o})}),Za=a.forwardRef(function({className:t,...n},o){return P.jsx(Ha,{...n,className:`${_n.description} ${t||""}`,ref:o})}),Ja=a.forwardRef(function({className:t,...n},o){return P.jsx(za,{...n,className:`${_n.close} ${t||""}`,ref:o})}),Qa=a.forwardRef(function({className:t,...n},o){return P.jsx(Ba,{...n,className:`${_n.backdrop} ${t||""}`,ref:o})}),ph={Root:Wa,Trigger:Ua,Portal:Ka,Positioner:qa,Popup:Ya,Arrow:Ga,Title:Xa,Description:Za,Close:Ja,Backdrop:Qa},gh="_root_1iiym_1",mh={root:gh};function hh(e){return P.jsx("div",{className:mh.root})}const wi=new Map;function yh(e,t){const n=JSON.stringify({locale:e,options:t}),o=wi.get(n);if(o)return o;const r=new Intl.NumberFormat(e,t);return wi.set(n,r),r}function Ci(e,t,n){return e==null?"":yh(t,n).format(e)}const gs=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(gs.displayName="ProgressRootContext");function Bo(){const e=a.useContext(gs);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ProgressRootContext is missing. Progress parts must be placed within <Progress.Root>.":Oe(51));return e}let ir=(function(e){return e.complete="data-complete",e.indeterminate="data-indeterminate",e.progressing="data-progressing",e})({});const qn={status(e){return e==="progressing"?{[ir.progressing]:""}:e==="complete"?{[ir.complete]:""}:e==="indeterminate"?{[ir.indeterminate]:""}:null}};function bh(e,t,n){return e==null?"":n?Ci(e,t,n):Ci(e/100,t,{style:"percent"})}function vh(e,t){return t==null?"indeterminate progress":e||`${t}%`}const el=a.forwardRef(function(t,n){const{format:o,getAriaValueText:r=vh,locale:s,max:i=100,min:c=0,value:u,render:l,className:d,...f}=t,[p,g]=a.useState(),m=ke(o);let h="indeterminate";Number.isFinite(u)&&(h=u===i?"complete":"progressing");const E=bh(u,s,m.current),b=a.useMemo(()=>({status:h}),[h]),y={"aria-labelledby":p,"aria-valuemax":i,"aria-valuemin":c,"aria-valuenow":u??void 0,"aria-valuetext":r(E,u),role:"progressbar"},x=a.useMemo(()=>({formattedValue:E,max:i,min:c,setLabelId:g,state:b,status:h,value:u}),[E,i,c,g,b,h,u]),v=ue("div",t,{state:b,ref:n,props:[y,f],stateAttributesMapping:qn});return P.jsx(gs.Provider,{value:x,children:v})});process.env.NODE_ENV!=="production"&&(el.displayName="ProgressRoot");const tl=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{state:i}=Bo();return ue("div",t,{state:i,ref:n,props:s,stateAttributesMapping:qn})});process.env.NODE_ENV!=="production"&&(tl.displayName="ProgressTrack");function xh(e,t,n){return(e-t)*100/(n-t)}const nl=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{max:i,min:c,value:u,state:l}=Bo(),d=Number.isFinite(u)&&u!==null?xh(u,c,i):null,f=a.useCallback(()=>d==null?{}:{insetInlineStart:0,height:"inherit",width:`${d}%`},[d]);return ue("div",t,{state:l,ref:n,props:[{style:f()},s],stateAttributesMapping:qn})});process.env.NODE_ENV!=="production"&&(nl.displayName="ProgressIndicator");const ol=a.forwardRef(function(t,n){const{className:o,render:r,children:s,...i}=t,{value:c,formattedValue:u,state:l}=Bo(),d=c==null?"indeterminate":u,f=c==null?null:u;return ue("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:typeof s=="function"?s(d,c):f},i],stateAttributesMapping:qn})});process.env.NODE_ENV!=="production"&&(ol.displayName="ProgressValue");const rl=a.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,c=Qe(s),{setLabelId:u,state:l}=Bo();return J(()=>(u(c),()=>u(void 0)),[c,u]),ue("span",t,{state:l,ref:n,props:[{id:c},i],stateAttributesMapping:qn})});process.env.NODE_ENV!=="production"&&(rl.displayName="ProgressLabel");function sl(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=sl(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function ut(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=sl(e))&&(o&&(o+=" "),o+=t);return o}const Eh="_root_1m4y4_2",Sh="_track_1m4y4_10",Rh="_indicator_1m4y4_19",wh="_label_1m4y4_27",Ch="_value_1m4y4_34",Th="_indeterminate_1m4y4_1",Xt={root:Eh,track:Sh,indicator:Rh,label:wh,value:Ch,"size-sm":"_size-sm_1m4y4_42","size-md":"_size-md_1m4y4_46","size-lg":"_size-lg_1m4y4_50","variant-primary":"_variant-primary_1m4y4_55","variant-success":"_variant-success_1m4y4_60","variant-warning":"_variant-warning_1m4y4_65","variant-error":"_variant-error_1m4y4_70",indeterminate:Th},il=Z.forwardRef(({className:e,variant:t="primary",size:n="md",...o},r)=>P.jsx(el,{ref:r,className:ut(Xt.root,Xt[`variant-${t}`],Xt[`size-${n}`],e),...o}));il.displayName="ALSProgressRoot";const cl=Z.forwardRef(({className:e,...t},n)=>P.jsx(tl,{ref:n,className:ut(Xt.track,e),...t}));cl.displayName="ALSProgressTrack";const al=Z.forwardRef(({className:e,...t},n)=>P.jsx(nl,{ref:n,className:ut(Xt.indicator,e),...t}));al.displayName="ALSProgressIndicator";const ll=Z.forwardRef(({className:e,...t},n)=>P.jsx(rl,{ref:n,className:ut(Xt.label,e),...t}));ll.displayName="ALSProgressLabel";const ul=Z.forwardRef(({className:e,...t},n)=>P.jsx(ol,{ref:n,className:ut(Xt.value,e),...t}));ul.displayName="ALSProgressValue";const _h={Root:il,Track:cl,Indicator:al,Label:ll,Value:ul},Oh="_root_1ei9z_1",Ph={root:Oh};function Nh(e){return P.jsx("div",{className:Ph.root})}const Ah="_root_1kuso_1",Ih={root:Ah};function Mh(e){return P.jsx("div",{className:Ih.root})}function Lh(e){const t=a.useRef(!0);t.current&&(t.current=!1,e())}const ms=a.createContext(null);process.env.NODE_ENV!=="production"&&(ms.displayName="SelectRootContext");const hs=a.createContext(null);process.env.NODE_ENV!=="production"&&(hs.displayName="SelectFloatingContext");function Ut(){const e=a.useContext(ms);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.":Oe(60));return e}function dl(){const e=a.useContext(hs);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.":Oe(61));return e}const Dh=(e,t)=>Object.is(e,t);function xn(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function cr(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:xn(o,t,n))}function Or(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:xn(o,t,n))}function kh(e,t,n){return e.filter(o=>!xn(o,t,n))}function Pr(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Fh(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Ln(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Pr(e)}function go(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Pr(e.value):Pr(e)}function Vh(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??Ln(e,n);if(Array.isArray(t)){const o=Fh(t)?t.flatMap(r=>r.items):t;if(e==null){const r=o.find(s=>s.value==null);return r&&r.label!=null?r.label:Ln(e,n)}if(typeof e!="object"){const r=o.find(s=>s&&s.value===e);return r&&r.label!=null?r.label:Ln(e,n)}if("value"in e){const r=o.find(s=>s&&s.value===e.value);if(r&&r.label!=null)return r.label}}return Ln(e,n)}function jh(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>Ln(n,t)).join(", ")}const ye={id:se(e=>e.id),modal:se(e=>e.modal),multiple:se(e=>e.multiple),items:se(e=>e.items),itemToStringLabel:se(e=>e.itemToStringLabel),itemToStringValue:se(e=>e.itemToStringValue),isItemEqualToValue:se(e=>e.isItemEqualToValue),value:se(e=>e.value),open:se(e=>e.open),mounted:se(e=>e.mounted),forceMount:se(e=>e.forceMount),transitionStatus:se(e=>e.transitionStatus),touchModality:se(e=>e.touchModality),activeIndex:se(e=>e.activeIndex),selectedIndex:se(e=>e.selectedIndex),isActive:se((e,t)=>e.activeIndex===t),isSelected:se((e,t,n)=>{const o=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>xn(s,n,o)):e.selectedIndex===t&&e.selectedIndex!==null?!0:xn(r,n,o)}),isSelectedByFocus:se((e,t)=>e.selectedIndex===t),popupProps:se(e=>e.popupProps),triggerProps:se(e=>e.triggerProps),triggerElement:se(e=>e.triggerElement),positionerElement:se(e=>e.positionerElement),listElement:se(e=>e.listElement),scrollUpArrowVisible:se(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:se(e=>e.scrollDownArrowVisible),hasScrollArrows:se(e=>e.hasScrollArrows),serializedValue:se(e=>{const{multiple:t,value:n,itemToStringValue:o}=e;return t&&Array.isArray(n)&&n.length===0?"":go(n,o)})};function Bh(e,t){const n=a.useRef(e),o=Q(t);J(()=>{n.current!==e&&o(n.current)},[e,o]),J(()=>{n.current=e},[e])}function $h(e){const{id:t,value:n,defaultValue:o=null,onValueChange:r,open:s,defaultOpen:i=!1,onOpenChange:c,name:u,disabled:l=!1,readOnly:d=!1,required:f=!1,modal:p=!0,actionsRef:g,inputRef:m,onOpenChangeComplete:h,items:E,multiple:b=!1,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v=Dh,children:R}=e,{clearErrors:w}=Ra(),{setDirty:_,shouldValidateOnChange:N,validityData:M,setFilled:k,name:L,disabled:O,validation:S}=$n(),{controlId:I}=jo(),T=Ca({id:t}),A=O||l,D=L??u,[C,F]=pn({controlled:n,default:b?o??gn:o,name:"Select",state:"value"}),[j,H]=pn({controlled:s,default:i,name:"Select",state:"open"}),ee=a.useRef([]),W=a.useRef([]),X=a.useRef(null),Y=a.useRef(null),z=a.useRef(0),V=a.useRef(null),ce=a.useRef([]),fe=a.useRef(!1),xe=a.useRef(!1),$=a.useRef(null),ie=a.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),oe=a.useRef(!1),{mounted:Se,setMounted:U,transitionStatus:G}=Co(j),K=Je(()=>new fn({id:T,modal:p,multiple:b,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v,value:C,open:j,mounted:Se,transitionStatus:G,items:E,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ge=ve(K,ye.activeIndex),le=ve(K,ye.selectedIndex),re=ve(K,ye.triggerElement),B=ve(K,ye.positionerElement),ae=a.useMemo(()=>b&&Array.isArray(C)&&C.length===0?"":go(C,x),[b,C,x]),ne=ke(K.state.triggerElement);Ta({id:T,commit:S.commit,value:C,controlRef:ne,name:D,getValue:()=>C});const q=a.useRef(C);J(()=>{C!==q.current&&K.set("forceMount",!0)},[K,C]),J(()=>{k(C!==null)},[C,k]),J(function(){if(j)return;const Ne=ce.current;if(b){const Ke=Array.isArray(C)?C:[];if(Ke.length===0){K.set("selectedIndex",null);return}const Ge=Ke[Ke.length-1],Tt=Or(Ne,Ge,v);K.set("selectedIndex",Tt===-1?null:Tt);return}const Ve=Or(Ne,C,v);K.set("selectedIndex",Ve===-1?null:Ve)},[b,j,C,ce,v,K]),Bh(C,()=>{w(D),_(C!==M.initialValue),N()?S.commit(C):S.commit(C,!0)});const te=Q((be,Ne)=>{if(c?.(be,Ne),!Ne.isCanceled&&(H(be),!be&&K.state.activeIndex!==null)){const Ve=ee.current[K.state.activeIndex];queueMicrotask(()=>{Ve?.setAttribute("tabindex","-1")})}}),de=Q(()=>{U(!1),K.set("activeIndex",null),h?.(!1)});$t({enabled:!g,open:j,ref:X,onComplete(){j||de()}}),a.useImperativeHandle(g,()=>({unmount:de}),[de]);const pe=Q((be,Ne)=>{r?.(be,Ne),!Ne.isCanceled&&F(be)}),we=Q(()=>{const be=K.state.listElement||X.current;if(!be)return;const Ne=be.scrollTop,Ve=be.scrollTop+be.clientHeight,Ke=Ne>1,Ge=Ve<be.scrollHeight-1;K.state.scrollUpArrowVisible!==Ke&&K.set("scrollUpArrowVisible",Ke),K.state.scrollDownArrowVisible!==Ge&&K.set("scrollDownArrowVisible",Ge)}),Re=na({open:j,onOpenChange:te,elements:{reference:re,floating:B}}),Ce=ns(Re,{enabled:!d&&!A,event:"mousedown"}),Be=rs(Re,{bubbles:!1}),ct=Wg(Re,{enabled:!d&&!A,listRef:ee,activeIndex:ge,selectedIndex:le,disabledIndices:gn,onNavigate(be){be===null&&!j||K.set("activeIndex",be)},focusItemOnHover:!1}),Pe=Kg(Re,{enabled:!d&&!A&&(j||!b),listRef:W,activeIndex:ge,selectedIndex:le,onMatch(be){j?K.set("activeIndex",be):pe(ce.current[be],me("none"))},onTypingChange(be){fe.current=be}}),{getReferenceProps:tt,getFloatingProps:Ye,getItemProps:at}=Kn([Ce,Be,ct,Pe]);Lh(()=>{K.update({popupProps:Ye(),triggerProps:tt()})}),J(()=>{K.update({id:T,modal:p,multiple:b,value:C,open:j,mounted:Se,transitionStatus:G,popupProps:Ye(),triggerProps:tt(),items:E,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v})},[K,T,p,b,C,j,Se,G,Ye,tt,E,y,x,v]);const _e=a.useMemo(()=>({store:K,name:D,required:f,disabled:A,readOnly:d,multiple:b,itemToStringLabel:y,itemToStringValue:x,setValue:pe,setOpen:te,listRef:ee,popupRef:X,scrollHandlerRef:Y,handleScrollArrowVisibility:we,scrollArrowsMountedCountRef:z,getItemProps:at,events:Re.context.events,valueRef:V,valuesRef:ce,labelsRef:W,typingRef:fe,selectionRef:ie,selectedItemTextRef:$,validation:S,onOpenChangeComplete:h,keyboardActiveRef:xe,alignItemWithTriggerActiveRef:oe,initialValueRef:q}),[K,D,f,A,d,b,y,x,pe,te,at,Re.context.events,S,h,we]),Ie=gt(m,S.inputRef),He=b&&Array.isArray(C)&&C.length>0,Fe=a.useMemo(()=>!b||!Array.isArray(C)||!D?null:C.map(be=>{const Ne=go(be,x);return P.jsx("input",{type:"hidden",name:D,value:Ne},Ne)}),[b,C,D,x]);return P.jsx(ms.Provider,{value:_e,children:P.jsxs(hs.Provider,{value:Re,children:[R,P.jsx("input",{...S.getInputValidationProps({onFocus(){K.state.triggerElement?.focus()},onChange(be){if(be.nativeEvent.defaultPrevented)return;const Ne=be.target.value,Ve=me(Dt,be.nativeEvent);function Ke(){if(b)return;const Ge=ce.current.find(Tt=>go(Tt,x).toLowerCase()===Ne.toLowerCase());Ge!=null&&(_(Ge!==M.initialValue),pe(Ge,Ve),N()&&S.commit(Ge))}K.set("forceMount",!0),queueMicrotask(Ke)}}),id:t||I||void 0,name:b?void 0:D,value:ae,disabled:A,required:f&&!He,readOnly:d,ref:Ie,style:Io,tabIndex:-1,"aria-hidden":!0}),Fe]})})}function Hh(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV==="test")return t;const n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,l=Math.max(t.width,s,c),d=Math.max(t.height,i,u),f=l-t.width,p=d-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-p/2,bottom:t.bottom+p/2}}const co=2,zh={...Ic,...xa,value:()=>null},fl=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{setTouched:u,setFocused:l,validationMode:d,state:f,disabled:p}=$n(),{labelId:g}=jo(),{store:m,setOpen:h,selectionRef:E,validation:b,readOnly:y,alignItemWithTriggerActiveRef:x,disabled:v,keyboardActiveRef:R}=Ut(),w=p||v||s,_=ve(m,ye.open),N=ve(m,ye.value),M=ve(m,ye.triggerProps),k=ve(m,ye.positionerElement),L=ve(m,ye.listElement),O=ve(m,ye.serializedValue),S=ke(k),I=a.useRef(null),T=Xe(),A=Xe(),{getButtonProps:D,buttonRef:C}=yt({disabled:w,native:i}),F=Q(z=>{m.set("triggerElement",z)}),j=gt(n,I,C,F),H=Xe(),ee=Xe();a.useEffect(()=>{if(_)return ee.start(200,()=>{E.current.allowUnselectedMouseUp=!0,H.start(200,()=>{E.current.allowSelectedMouseUp=!0})}),()=>{H.clear(),ee.clear()};E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},A.clear()},[_,E,A,H,ee]);const W=a.useMemo(()=>L?.id??Fn(k)?.id,[L,k]),X=Lr(M,{role:"combobox","aria-expanded":_?"true":"false","aria-haspopup":"listbox","aria-controls":_?W:void 0,"aria-labelledby":g,"aria-readonly":y||void 0,tabIndex:w?-1:0,ref:j,onFocus(z){l(!0),_&&x.current&&h(!1,me(Zt,z.nativeEvent)),T.start(0,()=>{m.set("forceMount",!0)})},onBlur(){u(!0),l(!1),d==="onBlur"&&b.commit(N)},onPointerMove({pointerType:z}){R.current=!1,m.set("touchModality",z==="touch")},onPointerDown({pointerType:z}){m.set("touchModality",z==="touch")},onKeyDown(){R.current=!0},onMouseDown(z){if(_)return;const V=Ue(z.currentTarget);function ce(fe){if(!I.current)return;const xe=fe.target;if(Ee(I.current,xe)||Ee(S.current,xe)||xe===I.current)return;const $=Hh(I.current);fe.clientX>=$.left-co&&fe.clientX<=$.right+co&&fe.clientY>=$.top-co&&fe.clientY<=$.bottom+co||h(!1,me(Ku,fe))}A.start(0,()=>{V.addEventListener("mouseup",ce,{once:!0})})}},b.getValidationProps,c,D);X.role="combobox";const Y=a.useMemo(()=>({...f,open:_,disabled:w,value:N,readOnly:y,placeholder:!O}),[f,_,w,N,y,O]);return ue("button",t,{ref:[n,I],state:Y,stateAttributesMapping:zh,props:X})});process.env.NODE_ENV!=="production"&&(fl.displayName="SelectTrigger");const Wh={value:()=>null},pl=a.forwardRef(function(t,n){const{className:o,render:r,children:s,...i}=t,{store:c,valueRef:u}=Ut(),l=ve(c,ye.value),d=ve(c,ye.items),f=ve(c,ye.itemToStringLabel),p=ve(c,ye.serializedValue),g=a.useMemo(()=>({value:l,placeholder:!p}),[l,p]),m=typeof s=="function"?s(l):s??(Array.isArray(l)?jh(l,f):Vh(l,d,f));return ue("span",t,{state:g,ref:[n,u],props:[{children:m},i],stateAttributesMapping:Wh})});process.env.NODE_ENV!=="production"&&(pl.displayName="SelectValue");const gl=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=Ut(),c=ve(i,ye.open),u=a.useMemo(()=>({open:c}),[c]);return ue("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:Xr})});process.env.NODE_ENV!=="production"&&(gl.displayName="SelectIcon");const ml=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ml.displayName="SelectPortalContext");const hl=a.forwardRef(function(t,n){const{store:o}=Ut(),r=ve(o,ye.mounted),s=ve(o,ye.forceMount);return r||s?P.jsx(ml.Provider,{value:!0,children:P.jsx(Mo,{ref:n,...t})}):null});process.env.NODE_ENV!=="production"&&(hl.displayName="SelectPortal");const ys=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ys.displayName="SelectPositionerContext");function Uh(){const e=a.useContext(ys);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.":Oe(59));return e}function So(e,t){e&&Object.assign(e.style,t)}const Kh={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},qh={position:"fixed"},yl=a.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:c="bottom",align:u="center",sideOffset:l=0,alignOffset:d=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:g=5,sticky:m=!1,disableAnchorTracking:h,alignItemWithTrigger:E=!0,collisionAvoidance:b=Bu,...y}=t,{store:x,listRef:v,labelsRef:R,alignItemWithTriggerActiveRef:w,selectedItemTextRef:_,valuesRef:N,initialValueRef:M,popupRef:k,setValue:L}=Ut(),O=dl(),S=ve(x,ye.open),I=ve(x,ye.mounted),T=ve(x,ye.modal),A=ve(x,ye.value),D=ve(x,ye.touchModality),C=ve(x,ye.positionerElement),F=ve(x,ye.triggerElement),j=ve(x,ye.isItemEqualToValue),H=a.useRef(null),ee=a.useRef(null),[W,X]=a.useState(E),Y=I&&W&&!D;!I&&W!==E&&X(E),J(()=>{I||(ye.scrollUpArrowVisible(x.state)&&x.set("scrollUpArrowVisible",!1),ye.scrollDownArrowVisible(x.state)&&x.set("scrollDownArrowVisible",!1))},[x,I]),a.useImperativeHandle(w,()=>Y),as((Y||T)&&S&&!D,F);const z=La({anchor:o,floatingRootContext:O,positionMethod:r,mounted:I,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:g,collisionBoundary:f,collisionPadding:p,sticky:m,disableAnchorTracking:h??Y,collisionAvoidance:b,keepMounted:!0}),V=Y?"none":z.side,ce=Y?qh:z.positionerStyles,fe=a.useMemo(()=>{const G={};return S||(G.pointerEvents="none"),{role:"presentation",hidden:!I,style:{...ce,...G}}},[S,I,ce]),xe=a.useMemo(()=>({open:S,side:V,align:z.align,anchorHidden:z.anchorHidden}),[S,V,z.align,z.anchorHidden]),$=Q(G=>{x.set("positionerElement",G)}),ie=ue("div",t,{ref:[n,$],state:xe,stateAttributesMapping:zt,props:[fe,y]}),oe=a.useRef(0),Se=Q(G=>{if(G.size===0&&oe.current===0||N.current.length===0)return;const K=oe.current;if(oe.current=G.size,G.size===K)return;const ge=me(Dt);if(K!==0&&!x.state.multiple&&A!==null&&Or(N.current,A,j)===-1){const re=M.current,ae=re!=null&&cr(N.current,re,j)?re:null;L(ae,ge),ae===null&&(x.set("selectedIndex",null),_.current=null)}if(K!==0&&x.state.multiple&&Array.isArray(A)){const le=A.filter(re=>cr(N.current,re,j));(le.length!==A.length||le.some(re=>!cr(A,re,j)))&&(L(le,ge),le.length===0&&(x.set("selectedIndex",null),_.current=null))}if(S&&Y){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const le={height:""};So(C,le),So(k.current,le)}}),U=a.useMemo(()=>({...z,side:V,alignItemWithTriggerActive:Y,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:H,scrollDownArrowRef:ee}),[z,V,Y,X]);return P.jsx(Ro,{elementsRef:v,labelsRef:R,onMapChange:Se,children:P.jsxs(ys.Provider,{value:U,children:[I&&T&&P.jsx(Vo,{inert:Fo(!S),cutout:F}),ie]})})});process.env.NODE_ENV!=="production"&&(yl.displayName="SelectPositioner");function bl(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const ao="base-ui-disable-scrollbar",Ti={className:ao,element:P.jsx("style",{href:ao,precedence:"base-ui:low",children:`.${ao}{scrollbar-width:none}.${ao}::-webkit-scrollbar{display:none}`})},Yh={...zt,...Vt},vl=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i,popupRef:c,onOpenChangeComplete:u,setOpen:l,valueRef:d,selectedItemTextRef:f,keyboardActiveRef:p,multiple:g,handleScrollArrowVisibility:m,scrollHandlerRef:h}=Ut(),{side:E,align:b,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:x,scrollDownArrowRef:v,scrollUpArrowRef:R}=Uh(),w=Fa()!=null,_=dl(),N=Xe(),M=ve(i,ye.id),k=ve(i,ye.open),L=ve(i,ye.mounted),O=ve(i,ye.popupProps),S=ve(i,ye.transitionStatus),I=ve(i,ye.triggerElement),T=ve(i,ye.positionerElement),A=ve(i,ye.listElement),D=a.useRef(0),C=a.useRef(!1),F=a.useRef(0),j=a.useRef(!1),H=a.useRef({}),ee=Sn(),W=Q(V=>{if(!T||!c.current||!j.current)return;if(C.current||!y){m();return}const ce=T.style.top==="0px",fe=T.style.bottom==="0px",xe=T.getBoundingClientRect().height,$=Ue(T),ie=getComputedStyle(T),oe=parseFloat(ie.marginTop),Se=parseFloat(ie.marginBottom),U=$.documentElement.clientHeight-oe-Se,G=V.scrollTop,K=V.scrollHeight,ge=V.clientHeight,le=K-ge;let re=null,B=null,ae=!1;if(ce){const ne=le-G,q=xe+ne,te=Math.min(q,U);re=te,te!==U?B=le:ae=!0}else if(fe){const ne=G-0,q=xe+ne,te=Math.min(q,U),de=q-U;re=te,te!==U?B=0:(ae=!0,G<le&&(B=G-(ne-de)))}re!=null&&(T.style.height=`${re}px`),B!=null&&(V.scrollTop=B),ae&&(C.current=!0),m()});a.useImperativeHandle(h,()=>W,[W]),$t({open:k,ref:c,onComplete(){k&&u?.(!0)}});const X=a.useMemo(()=>({open:k,transitionStatus:S,side:E,align:b}),[k,S,E,b]);J(()=>{!T||!c.current||Object.keys(H.current).length||(H.current={top:T.style.top||"0",left:T.style.left||"0",right:T.style.right,height:T.style.height,bottom:T.style.bottom,minHeight:T.style.minHeight,maxHeight:T.style.maxHeight,marginTop:T.style.marginTop,marginBottom:T.style.marginBottom})},[c,T]),J(()=>{L||y||(j.current=!1,C.current=!1,D.current=0,F.current=0,So(T,H.current))},[L,y,T,c]),J(()=>{const V=c.current;if(!(!L||!I||!T||!V)){if(!y){j.current=!0,ee.request(m);return}queueMicrotask(()=>{const ce=getComputedStyle(T),fe=getComputedStyle(V),xe=Ue(I),$=Le(T),ie=I.getBoundingClientRect(),oe=T.getBoundingClientRect(),Se=ie.left,U=ie.height,G=A||V,K=G.scrollHeight,ge=parseFloat(fe.borderBottomWidth),le=parseFloat(ce.marginTop)||10,re=parseFloat(ce.marginBottom)||10,B=parseFloat(ce.minHeight)||100,ae=5,ne=5,q=20,te=xe.documentElement.clientHeight-le-re,de=xe.documentElement.clientWidth,pe=te-ie.bottom+U,we=f.current,Re=d.current;let Ce=0,Be=0;if(we&&Re){const Ve=Re.getBoundingClientRect(),Ke=we.getBoundingClientRect(),Ge=Ve.left-Se,Tt=Ke.left-oe.left,Yn=Ve.top-ie.top+Ve.height/2,zo=Ke.top-oe.top+Ke.height/2;Ce=Ge-Tt,Be=zo-Yn}const ct=pe+Be+re+ge;let Pe=Math.min(te,ct);const tt=te-le-re,Ye=ct-Pe,at=Math.max(ae,Se+Ce),_e=de-ne,Ie=Math.max(0,at+oe.width-_e);T.style.left=`${at-Ie}px`,T.style.height=`${Pe}px`,T.style.maxHeight="auto",T.style.marginTop=`${le}px`,T.style.marginBottom=`${re}px`,V.style.height="100%";const He=G.scrollHeight-G.clientHeight,Fe=Ye>=He;Fe&&(Pe=Math.min(te,oe.height)-(Ye-He));const be=ie.top<q||ie.bottom>te-q||Pe<Math.min(K,B),Ne=($.visualViewport?.scale??1)!==1&&Zi;if(be||Ne){j.current=!0,So(T,H.current),it.flushSync(()=>x(!1));return}if(Fe){const Ve=Math.max(0,te-ct);T.style.top=oe.height>=tt?"0":`${Ve}px`,T.style.height=`${Pe}px`,G.scrollTop=G.scrollHeight-G.clientHeight,D.current=Math.max(B,Pe)}else T.style.bottom="0",D.current=Math.max(B,Pe),G.scrollTop=Ye;D.current===te&&(C.current=!0),m(),setTimeout(()=>{j.current=!0})})}},[i,L,T,I,d,f,c,m,y,x,ee,v,R,A]),a.useEffect(()=>{if(!y||!T||!L)return;const V=Le(T);function ce(fe){l(!1,me(qu,fe))}return V.addEventListener("resize",ce),()=>{V.removeEventListener("resize",ce)}},[l,y,T,L]);const Y={...A?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${M}-list`},onKeyDown(V){p.current=!0,w&&Yr.has(V.key)&&V.stopPropagation()},onMouseMove(){p.current=!1},onPointerLeave(V){if(bl(V)||V.pointerType==="touch")return;const ce=V.currentTarget;N.start(0,()=>{i.set("activeIndex",null),ce.focus({preventScroll:!0})})},onScroll(V){A||h.current?.(V.currentTarget)},...y&&{style:A?{height:"100%"}:Kh}},z=ue("div",t,{ref:[n,c],state:X,stateAttributesMapping:Yh,props:[O,Y,ps(S),{className:!A&&y?Ti.className:void 0},s]});return P.jsxs(a.Fragment,{children:[Ti.element,P.jsx(ts,{context:_,modal:!1,disabled:!L,restoreFocus:!0,children:z})]})});process.env.NODE_ENV!=="production"&&(vl.displayName="SelectPopup");const bs=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(bs.displayName="SelectItemContext");function vs(){const e=a.useContext(bs);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.":Oe(57));return e}const xl=a.memo(a.forwardRef(function(t,n){const{render:o,className:r,value:s=null,label:i,disabled:c=!1,nativeButton:u=!1,...l}=t,d=a.useRef(null),f=To({label:i,textRef:d,indexGuessBehavior:Wi.GuessFromOrder}),{store:p,getItemProps:g,setOpen:m,setValue:h,selectionRef:E,typingRef:b,valuesRef:y,keyboardActiveRef:x,multiple:v}=Ut(),R=Xe(),w=ve(p,ye.isActive,f.index),_=ve(p,ye.isSelected,f.index,s),N=ve(p,ye.isSelectedByFocus,f.index),M=ve(p,ye.isItemEqualToValue),k=f.index,L=k!==-1,O=a.useRef(null),S=ke(k);J(()=>{if(!L)return;const Y=y.current;return Y[k]=s,()=>{delete Y[k]}},[L,k,s,y]),J(()=>{if(!L)return;const Y=p.state.value;let z=Y;v&&Array.isArray(Y)&&Y.length>0&&(z=Y[Y.length-1]),z!==void 0&&xn(z,s,M)&&p.set("selectedIndex",k)},[L,k,v,M,p,s]);const I=a.useMemo(()=>({disabled:c,selected:_,highlighted:w}),[c,_,w]),T=g({active:w,selected:_});T.onFocus=void 0,T.id=void 0;const A=a.useRef(null),D=a.useRef("mouse"),C=a.useRef(!1),{getButtonProps:F,buttonRef:j}=yt({disabled:c,focusableWhenDisabled:!0,native:u});function H(Y){const z=p.state.value;if(v){const V=Array.isArray(z)?z:[],ce=_?kh(V,s,M):[...V,s];h(ce,me(Ko,Y))}else h(s,me(Ko,Y)),m(!1,me(Ko,Y))}const ee={role:"option","aria-selected":_,"aria-disabled":c||void 0,tabIndex:w?0:-1,onFocus(){p.set("activeIndex",k)},onMouseEnter(){!x.current&&p.state.selectedIndex===null&&p.set("activeIndex",k)},onMouseMove(){p.set("activeIndex",k)},onMouseLeave(Y){x.current||bl(Y)||R.start(0,()=>{p.state.activeIndex===k&&p.set("activeIndex",null)})},onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(Y){A.current=Y.key,p.set("activeIndex",k)},onClick(Y){C.current=!1,!(Y.type==="keydown"&&A.current===null)&&(c||A.current===" "&&b.current||D.current!=="touch"&&!w||(A.current=null,H(Y.nativeEvent)))},onPointerEnter(Y){D.current=Y.pointerType},onPointerDown(Y){D.current=Y.pointerType,C.current=!0},onMouseUp(Y){if(c)return;if(C.current){C.current=!1;return}const z=!E.current.allowSelectedMouseUp&&_,V=!E.current.allowUnselectedMouseUp&&!_;z||V||D.current!=="touch"&&!w||H(Y.nativeEvent)}},W=ue("div",t,{ref:[j,n,f.ref,O],state:I,props:[T,ee,l,F]}),X=a.useMemo(()=>({selected:_,indexRef:S,textRef:d,selectedByFocus:N,hasRegistered:L}),[_,S,d,N,L]);return P.jsx(bs.Provider,{value:X,children:W})}));process.env.NODE_ENV!=="production"&&(xl.displayName="SelectItem");const El=a.forwardRef(function(t,n){const o=t.keepMounted??!1,{selected:r}=vs();return o||r?P.jsx(Sl,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(El.displayName="SelectItemIndicator");const Sl=a.memo(a.forwardRef((e,t)=>{const{render:n,className:o,keepMounted:r,...s}=e,{selected:i}=vs(),c=a.useRef(null),{transitionStatus:u,setMounted:l}=Co(i),d=a.useMemo(()=>({selected:i,transitionStatus:u}),[i,u]),f=ue("span",e,{ref:[t,c],state:d,props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:Vt});return $t({open:i,ref:c,onComplete(){i||l(!1)}}),f}));process.env.NODE_ENV!=="production"&&(Sl.displayName="Inner");const Rl=a.memo(a.forwardRef(function(t,n){const{indexRef:o,textRef:r,selectedByFocus:s,hasRegistered:i}=vs(),{selectedItemTextRef:c}=Ut(),{className:u,render:l,...d}=t,f=a.useCallback(g=>{if(!g||!i)return;const m=c.current===null||!c.current.isConnected;(s||m&&o.current===0)&&(c.current=g)},[c,o,s,i]);return ue("div",t,{ref:[f,n,r],props:d})}));process.env.NODE_ENV!=="production"&&(Rl.displayName="SelectItemText");const xs=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(xs.displayName="SelectGroupContext");function Gh(){const e=a.useContext(xs);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.":Oe(56));return e}const wl=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,[i,c]=a.useState(),u=a.useMemo(()=>({labelId:i,setLabelId:c}),[i,c]),l=ue("div",t,{ref:n,props:[{role:"group","aria-labelledby":i},s]});return P.jsx(xs.Provider,{value:u,children:l})});process.env.NODE_ENV!=="production"&&(wl.displayName="SelectGroup");const Cl=a.forwardRef(function(t,n){const{className:o,render:r,id:s,...i}=t,{setLabelId:c}=Gh(),u=Qe(s);return J(()=>{c(u)},[u,c]),ue("div",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(Cl.displayName="SelectGroupLabel");const Tl=a.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t,c=a.useMemo(()=>({orientation:s}),[s]);return ue("div",t,{state:c,ref:n,props:[{role:"separator","aria-orientation":s},i]})});process.env.NODE_ENV!=="production"&&(Tl.displayName="Separator");const Xh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zh=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),_i=e=>{const t=Zh(e);return t.charAt(0).toUpperCase()+t.slice(1)},_l=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),Jh=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Qh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ey=Z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:s,iconNode:i,...c},u)=>Z.createElement("svg",{ref:u,...Qh,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:_l("lucide",r),...!s&&!Jh(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,d])=>Z.createElement(l,d)),...Array.isArray(s)?s:[s]]));const Ol=(e,t)=>{const n=Z.forwardRef(({className:o,...r},s)=>Z.createElement(ey,{ref:s,iconNode:t,className:_l(`lucide-${Xh(_i(e))}`,`lucide-${e}`,o),...r}));return n.displayName=_i(e),n};const ty=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ny=Ol("check",ty);const oy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ry=Ol("chevron-down",oy),sy="_trigger_krl6a_1",iy="_icon_krl6a_40",cy="_popup_krl6a_48",ay="_item_krl6a_69",ly="_itemIndicator_krl6a_99",uy="_group_krl6a_107",dy="_label_krl6a_111",fy="_separator_krl6a_118",kt={trigger:sy,icon:iy,popup:cy,item:ay,itemIndicator:ly,group:uy,label:dy,separator:fy};function py(e){return P.jsx($h,{...e})}const Pl=a.forwardRef(({className:e,children:t,placeholder:n,renderValue:o,...r},s)=>{const i=(c,u)=>!u.value||Array.isArray(u.value)&&u.value.length===0?P.jsx("span",{...c,children:n||"Select..."}):Array.isArray(u.value)?P.jsx("span",{...c,children:u.value.join(", ")}):P.jsx("span",{...c,children:String(u.value)});return P.jsxs(fl,{ref:s,className:ut(kt.trigger,e),...r,children:[P.jsx(pl,{render:o||i}),P.jsx(gl,{className:kt.icon,children:P.jsx(ry,{size:16})})]})});Pl.displayName="ALSSelect.Trigger";function gy(e){return P.jsx(hl,{...e})}const Nl=a.forwardRef(({className:e,...t},n)=>P.jsx(yl,{ref:n,className:ut(e),sideOffset:4,...t}));Nl.displayName="ALSSelect.Positioner";const Al=a.forwardRef(({className:e,...t},n)=>P.jsx(vl,{ref:n,className:ut(kt.popup,e),...t}));Al.displayName="ALSSelect.Popup";const Il=a.forwardRef(({className:e,children:t,...n},o)=>P.jsxs(xl,{ref:o,className:ut(kt.item,e),...n,children:[P.jsx(Rl,{children:t}),P.jsx(El,{className:kt.itemIndicator,children:P.jsx(ny,{size:16})})]}));Il.displayName="ALSSelect.Item";const Ml=a.forwardRef(({className:e,...t},n)=>P.jsx(wl,{ref:n,className:ut(kt.group,e),...t}));Ml.displayName="ALSSelect.Group";const Ll=a.forwardRef(({className:e,...t},n)=>P.jsx(Cl,{ref:n,className:ut(kt.label,e),...t}));Ll.displayName="ALSSelect.Label";const Dl=a.forwardRef(({className:e,...t},n)=>P.jsx(Tl,{ref:n,className:ut(kt.separator,e),...t}));Dl.displayName="ALSSelect.Separator";const my={Root:py,Trigger:Pl,Portal:gy,Positioner:Nl,Popup:Al,Item:Il,Group:Ml,Label:Ll,Separator:Dl},hy="_root_qrq0m_1",yy={root:hy};function by(e){return P.jsx("div",{className:yy.root})}const vy="_root_10n3a_1",xy={root:vy};function Ey(e){return P.jsx("div",{className:xy.root})}const Sy="_root_1vneq_1",Ry={root:Sy};function wy(e){return P.jsx("div",{className:Ry.root})}const Es=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Es.displayName="TabsRootContext");function Hn(){const e=a.useContext(Es);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.":Oe(64));return e}let Cy=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const $o={tabActivationDirection:e=>({[Cy.activationDirection]:e})},kl=a.forwardRef(function(t,n){const{className:o,defaultValue:r=0,onValueChange:s,orientation:i="horizontal",render:c,value:u,...l}=t,d=En(),f=a.useRef([]),[p,g]=pn({controlled:u,default:r,name:"Tabs",state:"value"}),[m,h]=a.useState(()=>new Map),[E,b]=a.useState(()=>new Map),[y,x]=a.useState("none"),v=Q((L,O)=>{s?.(L,O),!O.isCanceled&&(g(L),x(O.activationDirection))}),R=a.useCallback((L,O)=>{if(!(L===void 0&&O<0)){for(const S of m.values())if(L!==void 0&&S&&L===S?.value||L===void 0&&S?.index&&S?.index===O)return S.id}},[m]),w=a.useCallback((L,O)=>{if(!(L===void 0&&O<0)){for(const S of E.values())if(L!==void 0&&O>-1&&L===(S?.value??S?.index??void 0)||L===void 0&&O>-1&&O===(S?.value??S?.index??void 0))return S?.id}},[E]),_=a.useCallback(L=>{if(L===void 0)return null;for(const[O,S]of E.entries())if(S!=null&&L===(S.value??S.index))return O;return null},[E]),N=a.useMemo(()=>({direction:d,getTabElementBySelectedValue:_,getTabIdByPanelValueOrIndex:w,getTabPanelIdByTabValueOrIndex:R,onValueChange:v,orientation:i,setTabMap:b,tabActivationDirection:y,value:p}),[d,_,w,R,v,i,b,y,p]),k=ue("div",t,{state:{orientation:i,tabActivationDirection:y},ref:n,props:l,stateAttributesMapping:$o});return P.jsx(Es.Provider,{value:N,children:P.jsx(Ro,{elementsRef:f,onMapChange:h,children:k})})});process.env.NODE_ENV!=="production"&&(kl.displayName="TabsRoot");const Fl="data-composite-item-active";function Ty(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:o}=Yi(),{ref:r,index:s}=To(e),i=n===s,c=a.useRef(null),u=gt(r,c);return{compositeProps:a.useMemo(()=>({tabIndex:i?0:-1,onFocus(){o(s)},onMouseMove(){const d=c.current;if(!t||!d)return;const f=d.hasAttribute("disabled")||d.ariaDisabled==="true";!i&&!f&&d.focus()}}),[i,o,s,t]),compositeRef:u,index:s}}const Ss=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ss.displayName="TabsListContext");function Vl(){const e=a.useContext(Ss);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.":Oe(65));return e}const jl=a.forwardRef(function(t,n){const{className:o,disabled:r=!1,render:s,value:i,id:c,nativeButton:u=!0,...l}=t,{value:d,getTabPanelIdByTabValueOrIndex:f,orientation:p}=Hn(),{activateOnFocus:g,highlightedTabIndex:m,onTabActivation:h,setHighlightedTabIndex:E,tabsListElement:b}=Vl(),y=Qe(c),x=a.useMemo(()=>({disabled:r,id:y,value:i}),[r,y,i]),{compositeProps:v,compositeRef:R,index:w}=Ty({metadata:x}),_=i??w,N=a.useMemo(()=>i===void 0?w<0?!1:w===d:i===d,[w,d,i]),M=a.useRef(!1);J(()=>{if(M.current){M.current=!1;return}if(!(N&&w>-1&&m!==w))return;const j=b;if(j!=null){const H=st(Ue(j));if(H&&Ee(j,H))return}E(w)},[N,w,m,E,r,b]);const{getButtonProps:k,buttonRef:L}=yt({disabled:r,native:u,focusableWhenDisabled:!0}),O=w>-1?f(i,w):void 0,S=a.useRef(!1),I=a.useRef(!1);function T(j){N||r||h(_,me(Dt,j.nativeEvent,void 0,{activationDirection:"none"}))}function A(j){N||(w>-1&&E(w),!r&&g&&(!S.current||S.current&&I.current)&&h(_,me(Dt,j.nativeEvent,void 0,{activationDirection:"none"})))}function D(j){if(N||r)return;S.current=!0;function H(){S.current=!1,I.current=!1}(!j.button||j.button===0)&&(I.current=!0,Ue(j.currentTarget).addEventListener("pointerup",H,{once:!0}))}const C=a.useMemo(()=>({disabled:r,active:N,orientation:p}),[r,N,p]);return ue("button",t,{state:C,ref:[n,L,R],props:[v,{role:"tab","aria-controls":O,"aria-selected":N,id:y,onClick:T,onFocus:A,onPointerDown:D,[Fl]:N?"":void 0,onKeyDownCapture(){M.current=!0}},l,k]})});process.env.NODE_ENV!=="production"&&(jl.displayName="TabsTab");const _y='!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;const l=getComputedStyle(e).direction;let n=0,o=0,c=0,r=0,f=0,s=0;if(null!=i&&null!=e){const t=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=i.getBoundingClientRect();n=u-t.left+e.scrollLeft-e.clientLeft,c=d-t.top+e.scrollTop-e.clientTop,f=h,s=p,o="ltr"===l?e.scrollWidth-n-f-e.clientLeft:n-e.clientLeft,r=e.scrollHeight-c-s-e.clientTop}function u(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}u("left",n),u("right",o),u("top",c),u("bottom",r),u("width",f),u("height",s),f>0&&s>0&&t.removeAttribute("hidden")}();';let sn=(function(e){return e.activeTabLeft="--active-tab-left",e.activeTabRight="--active-tab-right",e.activeTabTop="--active-tab-top",e.activeTabBottom="--active-tab-bottom",e.activeTabWidth="--active-tab-width",e.activeTabHeight="--active-tab-height",e})({});const Oy={...$o,activeTabPosition:()=>null,activeTabSize:()=>null},Bl=a.forwardRef(function(t,n){const{className:o,render:r,renderBeforeHydration:s=!1,...i}=t,{getTabElementBySelectedValue:c,orientation:u,tabActivationDirection:l,value:d}=Hn(),{tabsListElement:f}=Vl(),[p,g]=a.useState(!1),{value:m}=Hn(),h=En();zn(()=>g(!0));const E=Ng();a.useEffect(()=>{if(d!=null&&f!=null&&typeof ResizeObserver<"u"){const I=new ResizeObserver(E);return I.observe(f),()=>{I.disconnect()}}},[d,f,E]);let b=0,y=0,x=0,v=0,R=0,w=0,_=!1;if(d!=null&&f!=null){const I=c(d);if(_=!0,I!=null){const T=f.getBoundingClientRect(),{left:A,top:D,width:C,height:F}=I.getBoundingClientRect();b=A-T.left+f.scrollLeft-f.clientLeft,x=D-T.top+f.scrollTop-f.clientTop,R=C,w=F,y=h==="ltr"?f.scrollWidth-b-R-f.clientLeft:b-f.clientLeft,v=f.scrollHeight-x-w-f.clientTop}}const N=a.useMemo(()=>_?{left:b,right:y,top:x,bottom:v}:null,[b,y,x,v,_]),M=a.useMemo(()=>_?{width:R,height:w}:null,[R,w,_]),k=a.useMemo(()=>{if(_)return{[sn.activeTabLeft]:`${b}px`,[sn.activeTabRight]:`${y}px`,[sn.activeTabTop]:`${x}px`,[sn.activeTabBottom]:`${v}px`,[sn.activeTabWidth]:`${R}px`,[sn.activeTabHeight]:`${w}px`}},[b,y,x,v,R,w,_]),L=_&&R>0&&w>0,O=a.useMemo(()=>({orientation:u,activeTabPosition:N,activeTabSize:M,tabActivationDirection:l}),[u,N,M,l]),S=ue("span",t,{state:O,ref:n,props:[{role:"presentation",style:k,hidden:!L},i,{suppressHydrationWarning:!0}],stateAttributesMapping:Oy});return m==null?null:P.jsxs(a.Fragment,{children:[S,!p&&s&&P.jsx("script",{dangerouslySetInnerHTML:{__html:_y},suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(Bl.displayName="TabsIndicator");let Py=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const $l=a.forwardRef(function(t,n){const{children:o,className:r,value:s,render:i,keepMounted:c=!1,...u}=t,{value:l,getTabIdByPanelValueOrIndex:d,orientation:f,tabActivationDirection:p}=Hn(),g=Qe(),m=a.useMemo(()=>({id:g,value:s}),[g,s]),{ref:h,index:E}=To({metadata:m}),y=(s??E)!==l,x=a.useMemo(()=>d(s,E),[d,E,s]),v=a.useMemo(()=>({hidden:y,orientation:f,tabActivationDirection:p}),[y,f,p]);return ue("div",t,{state:v,ref:[n,h],props:[{"aria-labelledby":x,hidden:y,id:g??void 0,role:"tabpanel",tabIndex:y?-1:0,[Py.index]:E},u,{children:y&&!c?void 0:o}],stateAttributesMapping:$o})});process.env.NODE_ENV!=="production"&&($l.displayName="TabsPanel");const Ny=[];function Ay(e){const{itemSizes:t,cols:n=1,loopFocus:o=!0,dense:r=!1,orientation:s="both",direction:i,highlightedIndex:c,onHighlightedIndexChange:u,rootRef:l,enableHomeAndEndKeys:d=!1,stopEventPropagation:f=!1,disabledIndices:p,modifierKeys:g=Ny}=e,[m,h]=a.useState(0),E=n>1,b=a.useRef(null),y=gt(b,l),x=a.useRef([]),v=a.useRef(!1),R=c??m,w=Q((M,k=!1)=>{if((u??h)(M),k){const L=x.current[M];Ws(b.current,L,i,s)}}),_=Q(M=>{if(M.size===0||v.current)return;v.current=!0;const k=Array.from(M.keys()),L=k.find(S=>S?.hasAttribute(Fl))??null,O=L?k.indexOf(L):-1;O!==-1&&w(O),Ws(b.current,L,i,s)}),N=a.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,ref:y,onFocus(M){!b.current||!zs(M.target)||M.target.setSelectionRange(0,M.target.value.length??0)},onKeyDown(M){const k=d?of:Sc;if(!k.has(M.key)||Iy(M,g)||!b.current)return;const O=i==="rtl",S=O?Jt:Lt,I={horizontal:S,vertical:vt,both:S}[s],T=O?Lt:Jt,A={horizontal:T,vertical:Mt,both:T}[s];if(zs(M.target)&&!pr(M.target)){const W=M.target.selectionStart,X=M.target.selectionEnd,Y=M.target.value??"";if(W==null||M.shiftKey||W!==X||M.key!==A&&W<Y.length||M.key!==I&&W>0)return}let D=R;const C=lo(x,p),F=Rr(x,p);if(E){const W=t||Array.from({length:x.current.length},()=>({width:1,height:1})),X=cc(W,n,r),Y=X.findIndex(V=>V!=null&&!It(x,V,p)),z=X.reduce((V,ce,fe)=>ce!=null&&!It(x,ce,p)?fe:V,-1);D=X[ic({current:X.map(V=>V?x.current[V]:null)},{event:M,orientation:s,loopFocus:o,cols:n,disabledIndices:lc([...p||x.current.map((V,ce)=>It(x,ce)?ce:void 0),void 0],X),minIndex:Y,maxIndex:z,prevIndex:ac(R>F?C:R,W,X,n,M.key===vt?"bl":M.key===Lt?"tr":"tl"),rtl:O})]}const j={horizontal:[S],vertical:[vt],both:[S,vt]}[s],H={horizontal:[T],vertical:[Mt],both:[T,Mt]}[s],ee=E?k:{horizontal:d?tf:xc,vertical:d?nf:Ec,both:k}[s];d&&(M.key===Cn?D=C:M.key===Tn&&(D=F)),D===R&&(j.includes(M.key)||H.includes(M.key))&&(o&&D===F&&j.includes(M.key)?D=C:o&&D===C&&H.includes(M.key)?D=F:D=ze(x,{startingIndex:D,decrement:H.includes(M.key),disabledIndices:p})),D!==R&&!an(x,D)&&(f&&M.stopPropagation(),ee.has(M.key)&&M.preventDefault(),w(D,!0),queueMicrotask(()=>{x.current[D]?.focus()}))}}),[n,r,i,p,x,d,R,E,t,o,y,g,w,s,f]);return a.useMemo(()=>({props:N,highlightedIndex:R,onHighlightedIndexChange:w,elementsRef:x,disabledIndices:p,onMapChange:_,relayKeyboardEvent:N.onKeyDown}),[N,R,w,x,p,_])}function Iy(e,t){for(const n of lf.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function My(e){const{render:t,className:n,refs:o=gn,props:r=gn,state:s=$e,stateAttributesMapping:i,highlightedIndex:c,onHighlightedIndexChange:u,orientation:l,dense:d,itemSizes:f,loopFocus:p,cols:g,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:E=!0,rootRef:b,disabledIndices:y,modifierKeys:x,highlightItemOnHover:v=!1,tag:R="div",...w}=e,_=En(),{props:N,highlightedIndex:M,onHighlightedIndexChange:k,elementsRef:L,onMapChange:O,relayKeyboardEvent:S}=Ay({itemSizes:f,cols:g,loopFocus:p,dense:d,orientation:l,highlightedIndex:c,onHighlightedIndexChange:u,rootRef:b,stopEventPropagation:E,enableHomeAndEndKeys:m,direction:_,disabledIndices:y,modifierKeys:x}),I=ue(R,e,{state:s,ref:o,props:[N,...r,w],stateAttributesMapping:i}),T=a.useMemo(()=>({highlightedIndex:M,onHighlightedIndexChange:k,highlightItemOnHover:v,relayKeyboardEvent:S}),[M,k,v,S]);return P.jsx(Hr.Provider,{value:T,children:P.jsx(Ro,{elementsRef:L,onMapChange:A=>{h?.(A),O(A)},children:I})})}const Hl=a.forwardRef(function(t,n){const{activateOnFocus:o=!1,className:r,loopFocus:s=!0,render:i,...c}=t,{getTabElementBySelectedValue:u,onValueChange:l,orientation:d,value:f,setTabMap:p,tabActivationDirection:g}=Hn(),[m,h]=a.useState(0),[E,b]=a.useState(null),y=Ly(f,d,E,u),x=Q((_,N)=>{if(_!==f){const M=y(_);N.activationDirection=M,l(_,N)}}),v=a.useMemo(()=>({orientation:d,tabActivationDirection:g}),[d,g]),R={"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist"},w=a.useMemo(()=>({activateOnFocus:o,highlightedTabIndex:m,onTabActivation:x,setHighlightedTabIndex:h,tabsListElement:E,value:f}),[o,m,x,h,E,f]);return P.jsx(Ss.Provider,{value:w,children:P.jsx(My,{render:i,className:r,state:v,refs:[n,b],props:[R,c],stateAttributesMapping:$o,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:s,orientation:d,onHighlightedIndexChange:h,onMapChange:p,disabledIndices:gn})})});process.env.NODE_ENV!=="production"&&(Hl.displayName="TabsList");function Oi(e,t){const{left:n,top:o}=e.getBoundingClientRect(),{left:r,top:s}=t.getBoundingClientRect(),i=n-r,c=o-s;return{left:i,top:c}}function Ly(e,t,n,o){const[r,s]=a.useState(null);return J(()=>{if(e==null||n==null){s(null);return}const i=o(e);if(i==null){s(null);return}const{left:c,top:u}=Oi(i,n);s(t==="horizontal"?c:u)},[t,o,n,e]),a.useCallback(i=>{if(i===e)return"none";if(i==null)return s(null),"none";if(i!=null&&n!=null){const c=o(i);if(c!=null){const{left:u,top:l}=Oi(c,n);if(r==null)return s(t==="horizontal"?u:l),"none";if(t==="horizontal"){if(u<r)return s(u),"left";if(u>r)return s(u),"right"}else{if(l<r)return s(l),"up";if(l>r)return s(l),"down"}}}return"none"},[o,t,r,n,e])}const Dy="_root_1soxo_5",ky="_list_1soxo_22",Fy="_tab_1soxo_44",Vy="_indicator_1soxo_129",jy="_panel_1soxo_154",By="_fadeIn_1soxo_1",en={root:Dy,list:ky,tab:Fy,"tab--sm":"_tab--sm_1soxo_76","tab--md":"_tab--md_1soxo_82","tab--lg":"_tab--lg_1soxo_88",indicator:Vy,panel:jy,fadeIn:By},zl=Z.createContext({size:"md"}),$y=()=>Z.useContext(zl),Wl=Z.forwardRef(({value:e,defaultValue:t=0,onValueChange:n,orientation:o="horizontal",size:r="md",className:s,children:i},c)=>{const u=[en.root,en[`root--${o}`],s].filter(Boolean).join(" ");return P.jsx(zl.Provider,{value:{size:r},children:P.jsx(kl,{ref:c,value:e,defaultValue:t,onValueChange:n,orientation:o,className:u,children:i})})});Wl.displayName="ALSTabs.Root";const Ul=Z.forwardRef(({activateOnFocus:e=!1,loopFocus:t=!0,className:n,children:o},r)=>{const s=[en.list,n].filter(Boolean).join(" ");return P.jsx(Hl,{ref:r,activateOnFocus:e,loopFocus:t,className:s,children:o})});Ul.displayName="ALSTabs.List";const Kl=Z.forwardRef(({value:e,disabled:t=!1,className:n,children:o},r)=>{const{size:s}=$y(),i=[en.tab,en[`tab--${s}`],n].filter(Boolean).join(" ");return P.jsx(jl,{ref:r,value:e,disabled:t,className:i,children:o})});Kl.displayName="ALSTabs.Tab";const ql=Z.forwardRef(({className:e,renderBeforeHydration:t=!1},n)=>{const o=[en.indicator,e].filter(Boolean).join(" ");return P.jsx(Bl,{ref:n,renderBeforeHydration:t,className:o})});ql.displayName="ALSTabs.Indicator";const Yl=Z.forwardRef(({value:e,keepMounted:t=!1,className:n,children:o},r)=>{const s=[en.panel,n].filter(Boolean).join(" ");return P.jsx($l,{ref:r,value:e,keepMounted:t,className:s,children:o})});Yl.displayName="ALSTabs.Panel";const Hy={Root:Wl,List:Ul,Tab:Kl,Indicator:ql,Panel:Yl};let Pi=0;function Gl(e){return Pi+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Pi}`}const Ho=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ho.displayName="ToastContext");function Rs(){const e=a.useContext(Ho);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Oe(73));return e}function ar(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const Xl=function(t){const{children:n,timeout:o=5e3,limit:r=3,toastManager:s}=t,[i,c]=a.useState([]),[u,l]=a.useState(!1),[d,f]=a.useState(!1),[p,g]=a.useState(null);i.length===0&&(u&&l(!1),d&&f(!1));const m=u||d,h=a.useRef(new Map),E=a.useRef(null),b=a.useRef(!0),y=a.useRef(!1);function x(S){const I=st(Ue(E.current));if(!E.current||!Ee(E.current,I)||!xr(I))return;const T=i.findIndex(C=>C.id===S);let A=null,D=T+1;for(;D<i.length;){if(i[D].transitionStatus!=="ending"){A=i[D];break}D+=1}if(!A)for(D=T-1;D>=0;){if(i[D].transitionStatus!=="ending"){A=i[D];break}D-=1}A?A.ref?.current?.focus():p?.focus({preventScroll:!0})}const v=Q(()=>{y.current||(y.current=!0,h.current.forEach(S=>{if(S.timeout){S.timeout.clear();const I=Date.now()-S.start,T=S.delay-I;S.remaining=T>0?T:0}}))}),R=Q(()=>{y.current&&(y.current=!1,h.current.forEach((S,I)=>{S.remaining=S.remaining>0?S.remaining:S.delay,S.timeout??=mt.create(),S.timeout.start(S.remaining,()=>{h.current.delete(I),S.callback()}),S.start=Date.now()}))}),w=Q(S=>{c(A=>{const D=A.map(F=>F.id===S?{...F,transitionStatus:"ending",height:0}:F),C=D.filter(F=>F.transitionStatus!=="ending");return D.map(F=>{if(F.transitionStatus==="ending")return F;const j=C.indexOf(F)>=r;return{...F,limited:j}})});const I=h.current.get(S);I&&I.timeout&&(I.timeout.clear(),h.current.delete(S)),i.find(A=>A.id===S)?.onClose?.(),x(S),i.length===1&&(l(!1),f(!1))}),_=Q(S=>{c(T=>T.filter(A=>A.id!==S)),i.find(T=>T.id===S)?.onRemove?.()}),N=Q((S,I,T)=>{const A=Date.now(),D=b.current&&!u&&!d,C=D?mt.create():void 0;C?.start(I,()=>{h.current.delete(S),T()}),h.current.set(S,{timeout:C,start:D?A:0,delay:I,remaining:I,callback:T})}),M=Q(S=>{const I=S.id||Gl("toast"),T={...S,id:I,transitionStatus:"starting"};c(D=>{const C=[T,...D],F=C.filter(j=>j.transitionStatus!=="ending");if(F.length>r){const j=F.length-r,H=F.slice(-j);return C.map(ee=>H.some(W=>W.id===ee.id)?{...ee,limited:!0}:{...ee,limited:!1})}return C.map(j=>({...j,limited:!1}))});const A=T.timeout??o;return T.type!=="loading"&&A>0&&N(I,A,()=>w(I)),(u||d||!b.current)&&v(),I}),k=Q((S,I)=>{c(T=>T.map(A=>A.id===S?{...A,...I}:A))}),L=Q((S,I)=>{const T=ar(I.loading),A=M({...T,type:"loading"}),D=S.then(C=>{const F=ar(I.success,C);k(A,{...F,type:"success"});const j=F.timeout??o;return j>0&&N(A,j,()=>w(A)),(u||d||!b.current)&&v(),C}).catch(C=>{const F=ar(I.error,C);k(A,{...F,type:"error"});const j=F.timeout??o;return j>0&&N(A,j,()=>w(A)),(u||d||!b.current)&&v(),Promise.reject(C)});return{}.hasOwnProperty.call(I,"setPromise")&&I.setPromise(D),D});a.useEffect(function(){return s?s[" subscribe"](({action:T,options:A})=>{const D=A.id;T==="promise"&&A.promise?L(A.promise,A):T==="update"&&D?k(D,A):T==="close"&&D?w(D):M(A)}):void 0},[M,k,N,o,s,L,w]);const O=a.useMemo(()=>({toasts:i,setToasts:c,hovering:u,setHovering:l,focused:d,setFocused:f,expanded:m,add:M,close:w,remove:_,update:k,promise:L,pauseTimers:v,resumeTimers:R,prevFocusElement:p,setPrevFocusElement:g,viewportRef:E,scheduleTimer:N,windowFocusedRef:b}),[M,w,d,u,m,v,p,L,_,R,N,i,k]);return P.jsx(Ho.Provider,{value:O,children:n})};process.env.NODE_ENV!=="production"&&(Xl.displayName="ToastProvider");const Zl=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Zl.displayName="ToastViewportContext");let zy=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const Jl=a.forwardRef(function(t,n){const{render:o,className:r,children:s,...i}=t,{toasts:c,pauseTimers:u,resumeTimers:l,setHovering:d,setFocused:f,viewportRef:p,windowFocusedRef:g,prevFocusElement:m,setPrevFocusElement:h,expanded:E,focused:b}=Rs(),y=a.useRef(!1),x=a.useRef(!1),v=c.length,R=c[0]?.height??0,w=a.useMemo(()=>c.some(C=>C.transitionStatus==="ending"),[c]);a.useEffect(()=>{if(!p.current)return;function C(j){v!==0&&j.key==="F6"&&j.target!==p.current&&(j.preventDefault(),h(st(Ue(p.current))),p.current?.focus({preventScroll:!0}),u(),f(!0))}const F=Le(p.current);return F.addEventListener("keydown",C),()=>{F.removeEventListener("keydown",C)}},[u,f,h,v,p]),a.useEffect(()=>{if(!p.current||!v)return;const C=Le(p.current);function F(H){H.target===C&&(g.current=!1,u())}function j(H){if(H.relatedTarget||H.target===C)return;const ee=qe(H),W=st(Ue(p.current));(!Ee(p.current,ee)||!xr(W))&&l(),setTimeout(()=>{g.current=!0})}return C.addEventListener("blur",F,!0),C.addEventListener("focus",j,!0),()=>{C.removeEventListener("blur",F,!0),C.removeEventListener("focus",j,!0)}},[u,l,p,g,f,v]),a.useEffect(()=>{const C=p.current;if(!C||v===0)return;const F=Ue(C);function j(H){if(H.pointerType!=="touch")return;const ee=qe(H);Ee(C,ee)||(l(),d(!1),f(!1))}return F.addEventListener("pointerdown",j,!0),()=>{F.removeEventListener("pointerdown",j,!0)}},[v,l,f,d,p]);function _(C){p.current&&(y.current=!0,C.relatedTarget===p.current?c[0]?.ref?.current?.focus():m?.focus({preventScroll:!0}))}function N(C){C.key==="Tab"&&C.shiftKey&&C.target===p.current&&(C.preventDefault(),m?.focus({preventScroll:!0}),l())}a.useEffect(()=>{!g.current||w||!x.current||(l(),d(!1),x.current=!1)},[w,l,d,g]);function M(){u(),d(!0),x.current=!1}function k(){c.some(C=>C.transitionStatus==="ending")?x.current=!0:(l(),d(!1))}function L(){if(y.current){y.current=!1;return}b||xr(Ue(p.current).activeElement)&&(f(!0),u())}function O(C){!b||Ee(p.current,C.relatedTarget)||(f(!1),l())}const S={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:M,onMouseMove:M,onMouseLeave:k,onFocus:L,onBlur:O,onKeyDown:N,onClick:L},I=a.useMemo(()=>({expanded:E}),[E]),T=ue("div",t,{ref:[n,p],state:I,props:[S,{style:{[zy.frontmostHeight]:R?`${R}px`:void 0}},i,{children:P.jsxs(a.Fragment,{children:[v>0&&m&&P.jsx(pt,{onFocus:_}),s,v>0&&m&&P.jsx(pt,{onFocus:_})]})}]}),A=a.useMemo(()=>({viewportRef:p}),[p]),D=a.useMemo(()=>c.filter(C=>C.priority==="high"),[c]);return P.jsxs(Zl.Provider,{value:A,children:[v>0&&m&&P.jsx(pt,{onFocus:_}),T,!b&&D.length>0&&P.jsx("div",{style:Io,children:D.map(C=>P.jsxs("div",{role:"alert","aria-atomic":!0,children:[P.jsx("div",{children:C.title}),P.jsx("div",{children:C.description})]},C.id))})]})});process.env.NODE_ENV!=="production"&&(Jl.displayName="ToastViewport");const ws=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ws.displayName="ToastRootContext");function tn(){const e=a.useContext(ws);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":Oe(66));return e}let Kt=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const Wy={...Vt,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},In=40,Uy=10,_t=.5,Ky=1;function Ni(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function qy(e){const n=window.getComputedStyle(e).transform;let o=0,r=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const c=i[1].split(", ").map(parseFloat);c.length===6?(o=c[4],r=c[5],s=Math.sqrt(c[0]*c[0]+c[1]*c[1])):c.length===16&&(o=c[12],r=c[13],s=c[0])}}return{x:o,y:r,scale:s}}const Ql=a.forwardRef(function(t,n){const{toast:o,render:r,className:s,swipeDirection:i=["down","right"],...c}=t,u=o.positionerProps?.anchor!==void 0;let l=[];u||(l=Array.isArray(i)?i:[i]);const d=l.length>0,{toasts:f,focused:p,close:g,remove:m,setToasts:h,pauseTimers:E,expanded:b,setHovering:y}=Rs(),[x,v]=a.useState(void 0),[R,w]=a.useState(!1),[_,N]=a.useState(!1),[M,k]=a.useState(!1),[L,O]=a.useState({x:0,y:0}),[S,I]=a.useState({x:0,y:0,scale:1}),[T,A]=a.useState(),[D,C]=a.useState(),[F,j]=a.useState(null),H=a.useRef(null),ee=a.useRef({x:0,y:0}),W=a.useRef({x:0,y:0,scale:1}),X=a.useRef(void 0),Y=a.useRef(0),z=a.useRef(!1),V=a.useRef({x:0,y:0}),ce=a.useRef(!1),fe=a.useMemo(()=>f.indexOf(o),[o,f]),xe=a.useMemo(()=>f.filter(q=>q.transitionStatus!=="ending").indexOf(o),[o,f]),$=a.useMemo(()=>f.slice(0,f.indexOf(o)).reduce((q,te)=>q+(te.height||0),0),[f,o]);$t({open:o.transitionStatus!=="ending",ref:H,onComplete(){o.transitionStatus==="ending"&&m(o.id)}});const ie=Q(()=>{const q=H.current;if(!q)return;const te=q.style.height;q.style.height="auto";const de=q.offsetHeight;q.style.height=te,h(pe=>pe.map(we=>we.id===o.id?{...we,ref:H,height:de,transitionStatus:void 0}:we))});J(ie,[ie]);function oe(q,te){let de=q,pe=te;return!l.includes("left")&&!l.includes("right")?de=q>0?q**_t:-(Math.abs(q)**_t):(!l.includes("right")&&q>0&&(de=q**_t),!l.includes("left")&&q<0&&(de=-(Math.abs(q)**_t))),!l.includes("up")&&!l.includes("down")?pe=te>0?te**_t:-(Math.abs(te)**_t):(!l.includes("down")&&te>0&&(pe=te**_t),!l.includes("up")&&te<0&&(pe=-(Math.abs(te)**_t))),{x:de,y:pe}}function Se(q){if(q.button!==0)return;q.pointerType==="touch"&&E();const te=qe(q.nativeEvent);if(!(te&&te.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(z.current=!1,X.current=void 0,Y.current=0,ee.current={x:q.clientX,y:q.clientY},V.current=ee.current,H.current){const pe=qy(H.current);W.current=pe,I(pe),O({x:pe.x,y:pe.y})}y(!0),w(!0),N(!1),j(null),ce.current=!0,H.current?.setPointerCapture(q.pointerId)}}function U(q){if(!R)return;q.preventDefault(),ce.current&&(ee.current={x:q.clientX,y:q.clientY},ce.current=!1);const{clientY:te,clientX:de,movementX:pe,movementY:we}=q;(we<0&&te>V.current.y||we>0&&te<V.current.y)&&(V.current={x:V.current.x,y:te}),(pe<0&&de>V.current.x||pe>0&&de<V.current.x)&&(V.current={x:de,y:V.current.y});const Re=de-ee.current.x,Ce=te-ee.current.y,Be=te-V.current.y,ct=de-V.current.x;if(!_&&Math.sqrt(Re*Re+Ce*Ce)>=Ky&&(N(!0),F===null)){const Ie=l.includes("left")||l.includes("right"),He=l.includes("up")||l.includes("down");if(Ie&&He){const Fe=Math.abs(Re),be=Math.abs(Ce);j(Fe>be?"horizontal":"vertical")}}let Pe;if(!X.current)F==="vertical"?Ce>0?Pe="down":Ce<0&&(Pe="up"):F==="horizontal"?Re>0?Pe="right":Re<0&&(Pe="left"):Math.abs(Re)>=Math.abs(Ce)?Pe=Re>0?"right":"left":Pe=Ce>0?"down":"up",Pe&&l.includes(Pe)&&(X.current=Pe,Y.current=Ni(Pe,Re,Ce),v(Pe));else{const _e=X.current,Ie=Ni(_e,ct,Be);Ie>In?(z.current=!1,v(_e)):Y.current-Ie>=Uy&&(z.current=!0)}const tt=oe(Re,Ce);let Ye=W.current.x,at=W.current.y;F==="horizontal"?(l.includes("left")||l.includes("right"))&&(Ye+=tt.x):(F==="vertical"||(l.includes("left")||l.includes("right"))&&(Ye+=tt.x),(l.includes("up")||l.includes("down"))&&(at+=tt.y)),O({x:Ye,y:at})}function G(q){if(!R)return;if(w(!1),N(!1),j(null),H.current?.releasePointerCapture(q.pointerId),z.current){O({x:S.x,y:S.y}),v(void 0);return}let te=!1;const de=L.x-S.x,pe=L.y-S.y;let we;for(const Re of l){switch(Re){case"right":de>In&&(te=!0,we="right");break;case"left":de<-In&&(te=!0,we="left");break;case"down":pe>In&&(te=!0,we="down");break;case"up":pe<-In&&(te=!0,we="up");break}if(te)break}te?(v(we),k(!0),g(o.id)):(O({x:S.x,y:S.y}),v(void 0))}function K(q){if(q.key==="Escape"){if(!H.current||!Ee(H.current,st(Ue(H.current))))return;g(o.id)}}a.useEffect(()=>{if(!d)return;const q=H.current;if(!q)return;function te(de){Ee(q,de.target)&&de.preventDefault()}return q.addEventListener("touchmove",te,{passive:!1}),()=>{q.removeEventListener("touchmove",te)}},[d]);function ge(){if(!R&&L.x===S.x&&L.y===S.y&&!M)return{[Kt.swipeMovementX]:"0px",[Kt.swipeMovementY]:"0px"};const q=L.x-S.x,te=L.y-S.y;return{transition:R?"none":void 0,transform:R?`translateX(${L.x}px) translateY(${L.y}px) scale(${S.scale})`:void 0,[Kt.swipeMovementX]:`${q}px`,[Kt.swipeMovementY]:`${te}px`}}const le=o.priority==="high",re={role:le?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":T,"aria-describedby":D,"aria-hidden":le&&!p?!0:void 0,onPointerDown:d?Se:void 0,onPointerMove:d?U:void 0,onPointerUp:d?G:void 0,onKeyDown:K,inert:Fo(o.limited),style:{...ge(),[Kt.index]:o.transitionStatus==="ending"?fe:xe,[Kt.offsetY]:`${$}px`,[Kt.height]:o.height?`${o.height}px`:void 0}},B=a.useMemo(()=>({rootRef:H,toast:o,titleId:T,setTitleId:A,descriptionId:D,setDescriptionId:C,swiping:R,swipeDirection:x,recalculateHeight:ie,index:fe,visibleIndex:xe,expanded:b}),[o,T,D,R,x,ie,fe,xe,b]),ae=a.useMemo(()=>({transitionStatus:o.transitionStatus,expanded:b,limited:o.limited||!1,type:o.type,swiping:B.swiping,swipeDirection:B.swipeDirection}),[b,o.transitionStatus,o.limited,o.type,B.swiping,B.swipeDirection]),ne=ue("div",t,{ref:[n,B.rootRef],state:ae,stateAttributesMapping:Wy,props:[re,c]});return P.jsx(ws.Provider,{value:B,children:ne})});process.env.NODE_ENV!=="production"&&(Ql.displayName="ToastRoot");const eu=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=tn(),l=a.useRef(null);J(()=>{const g=l.current;if(!g||(u(),typeof ResizeObserver!="function"))return;const m=new ResizeObserver(u);return m.observe(g),()=>{m.disconnect()}},[u]);const d=i>0,f=a.useMemo(()=>({expanded:c,behind:d}),[c,d]);return ue("div",t,{ref:[n,l],state:f,props:s})});process.env.NODE_ENV!=="production"&&(eu.displayName="ToastContent");const tu=a.forwardRef(function(t,n){const{render:o,className:r,id:s,children:i,...c}=t,{toast:u}=tn(),l=i??u.description,d=!!l,f=Ft(s),{setDescriptionId:p}=tn();J(()=>{if(d)return p(f),()=>{p(void 0)}},[d,f,p]);const g=a.useMemo(()=>({type:u.type}),[u.type]),m=ue("p",t,{ref:n,state:g,props:{...c,id:f,children:l}});return d?m:null});process.env.NODE_ENV!=="production"&&(tu.displayName="ToastDescription");const nu=a.forwardRef(function(t,n){const{render:o,className:r,id:s,children:i,...c}=t,{toast:u}=tn(),l=i??u.title,d=!!l,f=Ft(s),{setTitleId:p}=tn();J(()=>{if(d)return p(f),()=>{p(void 0)}},[d,f,p]);const g=a.useMemo(()=>({type:u.type}),[u.type]),m=ue("h2",t,{ref:n,state:g,props:{...c,id:f,children:l}});return d?m:null});process.env.NODE_ENV!=="production"&&(nu.displayName="ToastTitle");const ou=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s,nativeButton:i=!0,...c}=t,{close:u,expanded:l}=Rs(),{toast:d}=tn(),{getButtonProps:f,buttonRef:p}=yt({disabled:s,native:i}),g=a.useMemo(()=>({type:d.type}),[d.type]);return ue("button",t,{ref:[n,p],state:g,props:[{"aria-hidden":!l,onClick(){u(d.id)}},c,f]})});process.env.NODE_ENV!=="production"&&(ou.displayName="ToastClose");const ru=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=tn(),l=u.actionProps?.children??c.children,d=!!l,{getButtonProps:f,buttonRef:p}=yt({disabled:s,native:i}),g=a.useMemo(()=>({type:u.type}),[u.type]),m=ue("button",t,{ref:[n,p],state:g,props:[c,u.actionProps,f,{children:l}]});return d?m:null});process.env.NODE_ENV!=="production"&&(ru.displayName="ToastAction");const su=a.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,...c}=t,{portalNode:u,portalSubtree:l}=jc({container:r,ref:n,componentProps:t,elementProps:c});return!l&&!u?null:P.jsxs(a.Fragment,{children:[l,u&&it.createPortal(o,u)]})});process.env.NODE_ENV!=="production"&&(su.displayName="FloatingPortalLite");const Yy=su;function iu(){const e=a.useContext(Ho);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Oe(73));const{toasts:t,add:n,close:o,update:r,promise:s}=e;return a.useMemo(()=>({toasts:t,add:n,close:o,update:r,promise:s}),[t,n,o,r,s])}function Gy(){const e=[];function t(n){e.forEach(o=>o(n))}return{" subscribe":function(o){return e.push(o),()=>{const r=e.indexOf(o);r!==-1&&e.splice(r,1)}},add(n){const o=n.id||Gl("toast"),r={...n,id:o,transitionStatus:"starting"};return t({action:"add",options:r}),o},close(n){t({action:"close",options:{id:n}})},update(n,o){t({action:"update",options:{...o,id:n}})},promise(n,o){let r=n;return t({action:"promise",options:{...o,promise:n,setPromise(s){r=s}}}),r}}}const Xy="_viewport_x4zrf_2",Zy="_root_x4zrf_16",Jy="_content_x4zrf_120",Qy="_title_x4zrf_133",eb="_description_x4zrf_158",tb="_action_x4zrf_166",nb="_close_x4zrf_194",ob="_closeIcon_x4zrf_225",Ct={viewport:Xy,root:Zy,"root--success":"_root--success_x4zrf_99","root--error":"_root--error_x4zrf_103","root--warning":"_root--warning_x4zrf_107","root--info":"_root--info_x4zrf_111","root--default":"_root--default_x4zrf_115",content:Jy,title:Qy,description:eb,action:tb,close:nb,closeIcon:ob},cu=({limit:e=3,timeout:t=5e3,toastManager:n,children:o})=>P.jsx(Xl,{limit:e,timeout:t,toastManager:n,children:o});cu.displayName="ALSToast.Provider";const au=({container:e,children:t})=>P.jsx(Yy,{container:e,children:t});au.displayName="ALSToast.Portal";const lu=Z.forwardRef(({className:e,style:t},n)=>{const{toasts:o}=iu(),r=[Ct.viewport,e].filter(Boolean).join(" ");return P.jsx(Jl,{ref:n,className:r,style:t,children:o.slice().map((s,i)=>P.jsx(Cs,{toast:s,style:{"--toast-index":i},children:P.jsxs(Ts,{children:[s.title&&P.jsx(_s,{children:s.title}),s.description&&P.jsx(Os,{children:s.description}),s.actionProps&&P.jsx(Ps,{...s.actionProps}),P.jsx(Ns,{})]})},s.id))})});lu.displayName="ALSToast.Viewport";const Cs=Z.forwardRef(({toast:e,swipeDirection:t=["down","right"],className:n,style:o,children:r},s)=>{const i=e.type||"default",c=[Ct.root,Ct[`root--${i}`],n].filter(Boolean).join(" ");return P.jsx(Ql,{ref:s,toast:e,swipeDirection:t,className:c,style:o,children:r})});Cs.displayName="ALSToast.Root";const Ts=Z.forwardRef(({className:e,style:t,children:n},o)=>{const r=[Ct.content,e].filter(Boolean).join(" ");return P.jsx(eu,{ref:o,className:r,style:t,children:n})});Ts.displayName="ALSToast.Content";const _s=Z.forwardRef(({className:e,style:t,children:n},o)=>{const r=[Ct.title,e].filter(Boolean).join(" ");return P.jsx(nu,{ref:o,className:r,style:t,children:n})});_s.displayName="ALSToast.Title";const Os=Z.forwardRef(({className:e,style:t,children:n},o)=>{const r=[Ct.description,e].filter(Boolean).join(" ");return P.jsx(tu,{ref:o,className:r,style:t,children:n})});Os.displayName="ALSToast.Description";const Ps=Z.forwardRef(({className:e,style:t,children:n,onClick:o},r)=>{const s=[Ct.action,e].filter(Boolean).join(" ");return P.jsx(ru,{ref:r,className:s,style:t,onClick:o,children:n})});Ps.displayName="ALSToast.Action";const Ns=Z.forwardRef(({className:e,style:t,children:n},o)=>{const r=[Ct.close,e].filter(Boolean).join(" ");return P.jsx(ou,{ref:o,className:r,style:t,children:n||P.jsx(rb,{})})});Ns.displayName="ALSToast.Close";const rb=()=>P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Ct.closeIcon,children:P.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),sb={Provider:cu,Portal:au,Viewport:lu,Root:Cs,Content:Ts,Title:_s,Description:Os,Action:Ps,Close:Ns,useToastManager:iu,createToastManager:Gy},ib="_root_19t9o_1",cb={root:ib};function ab(e){return P.jsx("div",{className:cb.root})}const lb="_root_u2979_1",ub={root:lb};function db(e){return P.jsx("div",{className:ub.root})}const fb="_root_6lo3f_1",pb={root:fb};function gb(e){return P.jsx("div",{className:pb.root})}const mb="_root_z5dqm_1",hb={root:mb};function yb(e){return P.jsx("div",{className:hb.root})}const bb="_layout_8124k_4",vb="_layoutLeft_8124k_27",xb="_layoutRight_8124k_37",Eb="_layoutAsideHidden_8124k_47",Sb="_layoutAsideFullHeight_8124k_57",Rb="_header_8124k_76",wb="_headerSticky_8124k_92",Cb="_headerFixed_8124k_97",Tb="_headerRelative_8124k_105",_b="_headerHideOnScroll_8124k_109",Ob="_headerElevated_8124k_121",Pb="_headerTransparent_8124k_126",Nb="_headerWithFullHeightAside_8124k_132",Ab="_layoutAsideCollapsed_8124k_140",Ib="_aside_8124k_149",Mb="_asideFullHeight_8124k_168",Lb="_asideContent_8124k_202",Db="_asideContentCollapsed_8124k_234",kb="_asideRelative_8124k_239",Fb="_asideFixed_8124k_243",Vb="_asideCollapsed_8124k_275",jb="_asideOverlay_8124k_326",Bb="_asideOverlayClosing_8124k_369",$b="_asideOverlayBackdrop_8124k_400",Hb="_asideOverlayBackdropClosing_8124k_420",zb="_asideResizeHandle_8124k_436",Wb="_asideResizing_8124k_469",Ub="_main_8124k_489",Kb="_mainPaddingNone_8124k_521",qb="_mainPaddingSm_8124k_525",Yb="_mainPaddingMd_8124k_529",Gb="_mainPaddingLg_8124k_533",Xb="_mainPaddingXl_8124k_537",Zb="_mainFullWidth_8124k_542",Jb="_mainWithFullHeightAside_8124k_547",Qb="_footer_8124k_564",ev="_footerRelative_8124k_576",tv="_footerSticky_8124k_580",nv="_footerFixed_8124k_587",ov="_footerWithFullHeightAside_8124k_597",he={layout:bb,layoutLeft:vb,layoutRight:xb,layoutAsideHidden:Eb,layoutAsideFullHeight:Sb,header:Rb,headerSticky:wb,headerFixed:Cb,headerRelative:Tb,headerHideOnScroll:_b,headerElevated:Ob,headerTransparent:Pb,headerWithFullHeightAside:Nb,layoutAsideCollapsed:Ab,aside:Ib,asideFullHeight:Mb,asideContent:Lb,asideContentCollapsed:Db,asideRelative:kb,asideFixed:Fb,asideCollapsed:Vb,asideOverlay:jb,asideOverlayClosing:Bb,asideOverlayBackdrop:$b,asideOverlayBackdropClosing:Hb,asideResizeHandle:zb,asideResizing:Wb,main:Ub,mainPaddingNone:Kb,mainPaddingSm:qb,mainPaddingMd:Yb,mainPaddingLg:Gb,mainPaddingXl:Xb,mainFullWidth:Zb,mainWithFullHeightAside:Jb,footer:Qb,footerRelative:ev,footerSticky:tv,footerFixed:nv,footerWithFullHeightAside:ov},On=Z.createContext({asidePosition:"left",asideHidden:!1,asideCollapsed:!1,asideFullHeight:!1,headerBehavior:"sticky",scrollY:0,mainRef:null,registerAside:()=>{},registerHeader:()=>{}}),rv=()=>Z.useContext(On),sv=(e,t=10)=>{const[n,o]=Z.useState("up"),[r,s]=Z.useState(0),i=Z.useRef(0);return Z.useEffect(()=>{const c=e.current;if(!c)return;const u=()=>{const l=c.scrollTop;s(l),!(Math.abs(l-i.current)<t)&&(o(l>i.current?"down":"up"),i.current=l)};return c.addEventListener("scroll",u,{passive:!0}),()=>c.removeEventListener("scroll",u)},[e,t]),{scrollDirection:n,scrollY:r}},iv=({children:e,className:t="",behavior:n="sticky",scrollThreshold:o=50,elevated:r=!1,transparent:s=!1,height:i})=>{const{scrollY:c,registerHeader:u,asideFullHeight:l}=Z.useContext(On),[d,f]=Z.useState(!1),[p,g]=Z.useState(s);Z.useEffect(()=>{u(n)},[n,u]),Z.useEffect(()=>{r&&f(c>0),s&&g(c<o)},[c,n,o,r,s]);const m={fixed:he.headerFixed,sticky:he.headerSticky,relative:he.headerRelative,hideOnScroll:he.headerHideOnScroll}[n],h=[he.header,m,d&&he.headerElevated,p&&he.headerTransparent,l&&he.headerWithFullHeightAside,t].filter(Boolean).join(" "),E=i?{"--header-custom-height":typeof i=="number"?`${i}px`:i}:{};return P.jsx("header",{className:h,style:E,children:e})},uu=({children:e,className:t="",collapsed:n=!1,hidden:o=!1,variant:r="relative",width:s,collapsedWidth:i,resizable:c=!1,minWidth:u=200,maxWidth:l=500,onWidthChange:d,overlay:f=!1,onOverlayClose:p,collapsedContent:g,transitionDuration:m=300,fullHeight:h=!1})=>{const{registerAside:E,asidePosition:b}=Z.useContext(On),[y,x]=Z.useState(null),[v,R]=Z.useState(!1),[w,_]=Z.useState(!1),N=Z.useRef(null);Z.useEffect(()=>{E(n,o,h)},[n,o,h,E]);const M=Z.useCallback(()=>{p&&(_(!0),setTimeout(()=>{_(!1),p()},m))},[p,m]),k=Z.useCallback(T=>{c&&(T.preventDefault(),R(!0))},[c]);if(Z.useEffect(()=>{if(!v)return;const T=D=>{if(!N.current)return;const C=N.current.getBoundingClientRect();let F;b==="right"?F=C.right-D.clientX:F=D.clientX-C.left;const j=Math.min(Math.max(F,u),l);x(j),d?.(j)},A=()=>{R(!1)};return document.addEventListener("mousemove",T),document.addEventListener("mouseup",A),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",A)}},[v,u,l,d,b]),o)return null;const L=r==="fixed"?he.asideFixed:he.asideRelative,O=[he.aside,L,n&&he.asideCollapsed,f&&he.asideOverlay,f&&w&&he.asideOverlayClosing,v&&he.asideResizing,h&&he.asideFullHeight,t].filter(Boolean).join(" "),S={...s&&!n&&!y&&{"--aside-width":typeof s=="number"?`${s}px`:s},...i&&n&&{"--aside-collapsed-width":typeof i=="number"?`${i}px`:i},...y&&!n&&{"--aside-width":`${y}px`},"--aside-transition-duration":`${m}ms`},I=[he.asideContent,n&&he.asideContentCollapsed].filter(Boolean).join(" ");return P.jsxs(P.Fragment,{children:[f&&P.jsx("div",{className:`${he.asideOverlayBackdrop} ${w?he.asideOverlayBackdropClosing:""}`,onClick:M,"aria-hidden":"true"}),P.jsxs("aside",{ref:N,className:O,style:S,children:[P.jsx("div",{className:I,children:n&&g?g:e}),c&&!n&&P.jsx("div",{className:he.asideResizeHandle,onMouseDown:k,role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar"})]})]})},cv=({children:e,className:t="",maxWidth:n,centered:o=!1,padding:r="lg"})=>{const{asideHidden:s,asideFullHeight:i,mainRef:c}=Z.useContext(On),u={none:he.mainPaddingNone,sm:he.mainPaddingSm,md:he.mainPaddingMd,lg:he.mainPaddingLg,xl:he.mainPaddingXl}[r],l=[he.main,s&&he.mainFullWidth,i&&he.mainWithFullHeightAside,u,t].filter(Boolean).join(" "),d={...n&&{maxWidth:typeof n=="number"?`${n}px`:n},...o&&{margin:"0 auto"}};return P.jsx("main",{ref:c,className:l,children:n||o?P.jsx("div",{style:d,children:e}):e})},av=({children:e,className:t="",variant:n="relative",height:o})=>{const{asideFullHeight:r}=Z.useContext(On),s={fixed:he.footerFixed,sticky:he.footerSticky,relative:he.footerRelative}[n],i=[he.footer,s,r&&he.footerWithFullHeightAside,t].filter(Boolean).join(" "),c=o?{"--footer-custom-height":typeof o=="number"?`${o}px`:o}:{};return P.jsx("footer",{className:i,style:c,children:e})},lv=({children:e,className:t="",asidePosition:n="left"})=>{const[o,r]=Z.useState(!1),[s,i]=Z.useState(!1),[c,u]=Z.useState(!1),[l,d]=Z.useState("sticky"),f=Z.useRef(null),{scrollY:p}=sv(f),g=Z.useCallback((y,x,v)=>{i(y),r(x),u(v)},[]),m=Z.useCallback(y=>{d(y)},[]);Z.useEffect(()=>{Z.Children.toArray(e).some(x=>Z.isValidElement(x)&&x.type===uu&&!x.props.hidden)||r(!0)},[e]);const h=n==="right"?he.layoutRight:he.layoutLeft,E=[he.layout,h,s&&he.layoutAsideCollapsed,o&&he.layoutAsideHidden,c&&he.layoutAsideFullHeight,t].filter(Boolean).join(" "),b={asidePosition:n,asideHidden:o,asideCollapsed:s,asideFullHeight:c,headerBehavior:l,scrollY:p,mainRef:f,registerAside:g,registerHeader:m};return P.jsx(On.Provider,{value:b,children:P.jsx("div",{className:E,children:e})})},uv=Object.assign({Root:lv,Header:iv,Aside:uu,Main:cv,Footer:av});exports.ALSAccordion=Tf;exports.ALSAlertDialog=Pf;exports.ALSAutocomplete=If;exports.ALSAvatar=Df;exports.ALSButton=Ac;exports.ALSCheckbox=$f;exports.ALSCheckboxGroup=Wf;exports.ALSCollapsible=qf;exports.ALSCombobox=Xf;exports.ALSContextMenu=Qf;exports.ALSDialog=vm;exports.ALSField=Sm;exports.ALSFieldset=Cm;exports.ALSForm=Om;exports.ALSInput=Pa;exports.ALSMenu=Lm;exports.ALSMenubar=Fm;exports.ALSMeter=Bm;exports.ALSNavigationMenu=zm;exports.ALSNumberField=Km;exports.ALSPopover=ph;exports.ALSPopoverArrow=Ga;exports.ALSPopoverBackdrop=Qa;exports.ALSPopoverClose=Ja;exports.ALSPopoverDescription=Za;exports.ALSPopoverPopup=Ya;exports.ALSPopoverPortal=Ka;exports.ALSPopoverPositioner=qa;exports.ALSPopoverRoot=Wa;exports.ALSPopoverTitle=Xa;exports.ALSPopoverTrigger=Ua;exports.ALSPreviewCard=hh;exports.ALSProgress=_h;exports.ALSRadio=Nh;exports.ALSScrollArea=Mh;exports.ALSSelect=my;exports.ALSSeparator=by;exports.ALSSlider=Ey;exports.ALSSwitch=wy;exports.ALSTabs=Hy;exports.ALSToast=sb;exports.ALSToggle=ab;exports.ALSToggleGroup=db;exports.ALSToolbar=gb;exports.ALSTooltip=yb;exports.MainLayout=uv;exports.useLayout=rv;
21
- //# sourceMappingURL=als-react-ts-ui.cjs.map