element-plus 2.10.6 → 2.10.7

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 (645) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.full.js +2750 -848
  3. package/dist/index.full.min.js +14 -14
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +15 -15
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +2750 -849
  8. package/dist/locale/af.js +1 -1
  9. package/dist/locale/af.min.js +1 -1
  10. package/dist/locale/af.min.mjs +1 -1
  11. package/dist/locale/af.mjs +1 -1
  12. package/dist/locale/ar-eg.js +1 -1
  13. package/dist/locale/ar-eg.min.js +1 -1
  14. package/dist/locale/ar-eg.min.mjs +1 -1
  15. package/dist/locale/ar-eg.mjs +1 -1
  16. package/dist/locale/ar.js +1 -1
  17. package/dist/locale/ar.min.js +1 -1
  18. package/dist/locale/ar.min.mjs +1 -1
  19. package/dist/locale/ar.mjs +1 -1
  20. package/dist/locale/az.js +1 -1
  21. package/dist/locale/az.min.js +1 -1
  22. package/dist/locale/az.min.mjs +1 -1
  23. package/dist/locale/az.mjs +1 -1
  24. package/dist/locale/bg.js +1 -1
  25. package/dist/locale/bg.min.js +1 -1
  26. package/dist/locale/bg.min.mjs +1 -1
  27. package/dist/locale/bg.mjs +1 -1
  28. package/dist/locale/bn.js +1 -1
  29. package/dist/locale/bn.min.js +1 -1
  30. package/dist/locale/bn.min.mjs +1 -1
  31. package/dist/locale/bn.mjs +1 -1
  32. package/dist/locale/ca.js +1 -1
  33. package/dist/locale/ca.min.js +1 -1
  34. package/dist/locale/ca.min.mjs +1 -1
  35. package/dist/locale/ca.mjs +1 -1
  36. package/dist/locale/ckb.js +1 -1
  37. package/dist/locale/ckb.min.js +1 -1
  38. package/dist/locale/ckb.min.mjs +1 -1
  39. package/dist/locale/ckb.mjs +1 -1
  40. package/dist/locale/cs.js +1 -1
  41. package/dist/locale/cs.min.js +1 -1
  42. package/dist/locale/cs.min.mjs +1 -1
  43. package/dist/locale/cs.mjs +1 -1
  44. package/dist/locale/da.js +1 -1
  45. package/dist/locale/da.min.js +1 -1
  46. package/dist/locale/da.min.mjs +1 -1
  47. package/dist/locale/da.mjs +1 -1
  48. package/dist/locale/de.js +1 -1
  49. package/dist/locale/de.min.js +1 -1
  50. package/dist/locale/de.min.mjs +1 -1
  51. package/dist/locale/de.mjs +1 -1
  52. package/dist/locale/el.js +1 -1
  53. package/dist/locale/el.min.js +1 -1
  54. package/dist/locale/el.min.mjs +1 -1
  55. package/dist/locale/el.mjs +1 -1
  56. package/dist/locale/en.js +1 -1
  57. package/dist/locale/en.min.js +1 -1
  58. package/dist/locale/en.min.mjs +1 -1
  59. package/dist/locale/en.mjs +1 -1
  60. package/dist/locale/eo.js +1 -1
  61. package/dist/locale/eo.min.js +1 -1
  62. package/dist/locale/eo.min.mjs +1 -1
  63. package/dist/locale/eo.mjs +1 -1
  64. package/dist/locale/es.js +1 -1
  65. package/dist/locale/es.min.js +1 -1
  66. package/dist/locale/es.min.mjs +1 -1
  67. package/dist/locale/es.mjs +1 -1
  68. package/dist/locale/et.js +1 -1
  69. package/dist/locale/et.min.js +1 -1
  70. package/dist/locale/et.min.mjs +1 -1
  71. package/dist/locale/et.mjs +1 -1
  72. package/dist/locale/eu.js +1 -1
  73. package/dist/locale/eu.min.js +1 -1
  74. package/dist/locale/eu.min.mjs +1 -1
  75. package/dist/locale/eu.mjs +1 -1
  76. package/dist/locale/fa.js +1 -1
  77. package/dist/locale/fa.min.js +1 -1
  78. package/dist/locale/fa.min.mjs +1 -1
  79. package/dist/locale/fa.mjs +1 -1
  80. package/dist/locale/fi.js +1 -1
  81. package/dist/locale/fi.min.js +1 -1
  82. package/dist/locale/fi.min.mjs +1 -1
  83. package/dist/locale/fi.mjs +1 -1
  84. package/dist/locale/fr.js +1 -1
  85. package/dist/locale/fr.min.js +1 -1
  86. package/dist/locale/fr.min.mjs +1 -1
  87. package/dist/locale/fr.mjs +1 -1
  88. package/dist/locale/he.js +1 -1
  89. package/dist/locale/he.min.js +1 -1
  90. package/dist/locale/he.min.mjs +1 -1
  91. package/dist/locale/he.mjs +1 -1
  92. package/dist/locale/hi.js +1 -1
  93. package/dist/locale/hi.min.js +1 -1
  94. package/dist/locale/hi.min.mjs +1 -1
  95. package/dist/locale/hi.mjs +1 -1
  96. package/dist/locale/hr.js +1 -1
  97. package/dist/locale/hr.min.js +1 -1
  98. package/dist/locale/hr.min.mjs +1 -1
  99. package/dist/locale/hr.mjs +1 -1
  100. package/dist/locale/hu.js +1 -1
  101. package/dist/locale/hu.min.js +1 -1
  102. package/dist/locale/hu.min.mjs +1 -1
  103. package/dist/locale/hu.mjs +1 -1
  104. package/dist/locale/hy-am.js +1 -1
  105. package/dist/locale/hy-am.min.js +1 -1
  106. package/dist/locale/hy-am.min.mjs +1 -1
  107. package/dist/locale/hy-am.mjs +1 -1
  108. package/dist/locale/id.js +1 -1
  109. package/dist/locale/id.min.js +1 -1
  110. package/dist/locale/id.min.mjs +1 -1
  111. package/dist/locale/id.mjs +1 -1
  112. package/dist/locale/it.js +1 -1
  113. package/dist/locale/it.min.js +1 -1
  114. package/dist/locale/it.min.mjs +1 -1
  115. package/dist/locale/it.mjs +1 -1
  116. package/dist/locale/ja.js +1 -1
  117. package/dist/locale/ja.min.js +1 -1
  118. package/dist/locale/ja.min.mjs +1 -1
  119. package/dist/locale/ja.mjs +1 -1
  120. package/dist/locale/kk.js +1 -1
  121. package/dist/locale/kk.min.js +1 -1
  122. package/dist/locale/kk.min.mjs +1 -1
  123. package/dist/locale/kk.mjs +1 -1
  124. package/dist/locale/km.js +1 -1
  125. package/dist/locale/km.min.js +1 -1
  126. package/dist/locale/km.min.mjs +1 -1
  127. package/dist/locale/km.mjs +1 -1
  128. package/dist/locale/ko.js +1 -1
  129. package/dist/locale/ko.min.js +1 -1
  130. package/dist/locale/ko.min.mjs +1 -1
  131. package/dist/locale/ko.mjs +1 -1
  132. package/dist/locale/ku.js +1 -1
  133. package/dist/locale/ku.min.js +1 -1
  134. package/dist/locale/ku.min.mjs +1 -1
  135. package/dist/locale/ku.mjs +1 -1
  136. package/dist/locale/ky.js +1 -1
  137. package/dist/locale/ky.min.js +1 -1
  138. package/dist/locale/ky.min.mjs +1 -1
  139. package/dist/locale/ky.mjs +1 -1
  140. package/dist/locale/lo.js +1 -1
  141. package/dist/locale/lo.min.js +1 -1
  142. package/dist/locale/lo.min.mjs +1 -1
  143. package/dist/locale/lo.mjs +1 -1
  144. package/dist/locale/lt.js +1 -1
  145. package/dist/locale/lt.min.js +1 -1
  146. package/dist/locale/lt.min.mjs +1 -1
  147. package/dist/locale/lt.mjs +1 -1
  148. package/dist/locale/lv.js +1 -1
  149. package/dist/locale/lv.min.js +1 -1
  150. package/dist/locale/lv.min.mjs +1 -1
  151. package/dist/locale/lv.mjs +1 -1
  152. package/dist/locale/mg.js +1 -1
  153. package/dist/locale/mg.min.js +1 -1
  154. package/dist/locale/mg.min.mjs +1 -1
  155. package/dist/locale/mg.mjs +1 -1
  156. package/dist/locale/mn.js +1 -1
  157. package/dist/locale/mn.min.js +1 -1
  158. package/dist/locale/mn.min.mjs +1 -1
  159. package/dist/locale/mn.mjs +1 -1
  160. package/dist/locale/ms.js +1 -1
  161. package/dist/locale/ms.min.js +1 -1
  162. package/dist/locale/ms.min.mjs +1 -1
  163. package/dist/locale/ms.mjs +1 -1
  164. package/dist/locale/my.js +1 -1
  165. package/dist/locale/my.min.js +1 -1
  166. package/dist/locale/my.min.mjs +1 -1
  167. package/dist/locale/my.mjs +1 -1
  168. package/dist/locale/nb-no.js +1 -1
  169. package/dist/locale/nb-no.min.js +1 -1
  170. package/dist/locale/nb-no.min.mjs +1 -1
  171. package/dist/locale/nb-no.mjs +1 -1
  172. package/dist/locale/nl.js +1 -1
  173. package/dist/locale/nl.min.js +1 -1
  174. package/dist/locale/nl.min.mjs +1 -1
  175. package/dist/locale/nl.mjs +1 -1
  176. package/dist/locale/no.js +1 -1
  177. package/dist/locale/no.min.js +1 -1
  178. package/dist/locale/no.min.mjs +1 -1
  179. package/dist/locale/no.mjs +1 -1
  180. package/dist/locale/pa.js +1 -1
  181. package/dist/locale/pa.min.js +1 -1
  182. package/dist/locale/pa.min.mjs +1 -1
  183. package/dist/locale/pa.mjs +1 -1
  184. package/dist/locale/pl.js +1 -1
  185. package/dist/locale/pl.min.js +1 -1
  186. package/dist/locale/pl.min.mjs +1 -1
  187. package/dist/locale/pl.mjs +1 -1
  188. package/dist/locale/pt-br.js +1 -1
  189. package/dist/locale/pt-br.min.js +1 -1
  190. package/dist/locale/pt-br.min.mjs +1 -1
  191. package/dist/locale/pt-br.mjs +1 -1
  192. package/dist/locale/pt.js +1 -1
  193. package/dist/locale/pt.min.js +1 -1
  194. package/dist/locale/pt.min.mjs +1 -1
  195. package/dist/locale/pt.mjs +1 -1
  196. package/dist/locale/ro.js +1 -1
  197. package/dist/locale/ro.min.js +1 -1
  198. package/dist/locale/ro.min.mjs +1 -1
  199. package/dist/locale/ro.mjs +1 -1
  200. package/dist/locale/ru.js +1 -1
  201. package/dist/locale/ru.min.js +1 -1
  202. package/dist/locale/ru.min.mjs +1 -1
  203. package/dist/locale/ru.mjs +1 -1
  204. package/dist/locale/sk.js +1 -1
  205. package/dist/locale/sk.min.js +1 -1
  206. package/dist/locale/sk.min.mjs +1 -1
  207. package/dist/locale/sk.mjs +1 -1
  208. package/dist/locale/sl.js +1 -1
  209. package/dist/locale/sl.min.js +1 -1
  210. package/dist/locale/sl.min.mjs +1 -1
  211. package/dist/locale/sl.mjs +1 -1
  212. package/dist/locale/sr.js +1 -1
  213. package/dist/locale/sr.min.js +1 -1
  214. package/dist/locale/sr.min.mjs +1 -1
  215. package/dist/locale/sr.mjs +1 -1
  216. package/dist/locale/sv.js +1 -1
  217. package/dist/locale/sv.min.js +1 -1
  218. package/dist/locale/sv.min.mjs +1 -1
  219. package/dist/locale/sv.mjs +1 -1
  220. package/dist/locale/sw.js +1 -1
  221. package/dist/locale/sw.min.js +1 -1
  222. package/dist/locale/sw.min.mjs +1 -1
  223. package/dist/locale/sw.mjs +1 -1
  224. package/dist/locale/ta.js +1 -1
  225. package/dist/locale/ta.min.js +1 -1
  226. package/dist/locale/ta.min.mjs +1 -1
  227. package/dist/locale/ta.mjs +1 -1
  228. package/dist/locale/te.js +1 -1
  229. package/dist/locale/te.min.js +1 -1
  230. package/dist/locale/te.min.mjs +1 -1
  231. package/dist/locale/te.mjs +1 -1
  232. package/dist/locale/th.js +1 -1
  233. package/dist/locale/th.min.js +1 -1
  234. package/dist/locale/th.min.mjs +1 -1
  235. package/dist/locale/th.mjs +1 -1
  236. package/dist/locale/tk.js +1 -1
  237. package/dist/locale/tk.min.js +1 -1
  238. package/dist/locale/tk.min.mjs +1 -1
  239. package/dist/locale/tk.mjs +1 -1
  240. package/dist/locale/tr.js +1 -1
  241. package/dist/locale/tr.min.js +1 -1
  242. package/dist/locale/tr.min.mjs +1 -1
  243. package/dist/locale/tr.mjs +1 -1
  244. package/dist/locale/ug-cn.js +1 -1
  245. package/dist/locale/ug-cn.min.js +1 -1
  246. package/dist/locale/ug-cn.min.mjs +1 -1
  247. package/dist/locale/ug-cn.mjs +1 -1
  248. package/dist/locale/uk.js +1 -1
  249. package/dist/locale/uk.min.js +1 -1
  250. package/dist/locale/uk.min.mjs +1 -1
  251. package/dist/locale/uk.mjs +1 -1
  252. package/dist/locale/uz-uz.js +1 -1
  253. package/dist/locale/uz-uz.min.js +1 -1
  254. package/dist/locale/uz-uz.min.mjs +1 -1
  255. package/dist/locale/uz-uz.mjs +1 -1
  256. package/dist/locale/vi.js +1 -1
  257. package/dist/locale/vi.min.js +1 -1
  258. package/dist/locale/vi.min.mjs +1 -1
  259. package/dist/locale/vi.mjs +1 -1
  260. package/dist/locale/zh-cn.js +1 -1
  261. package/dist/locale/zh-cn.min.js +1 -1
  262. package/dist/locale/zh-cn.min.mjs +1 -1
  263. package/dist/locale/zh-cn.mjs +1 -1
  264. package/dist/locale/zh-hk.js +1 -1
  265. package/dist/locale/zh-hk.min.js +1 -1
  266. package/dist/locale/zh-hk.min.mjs +1 -1
  267. package/dist/locale/zh-hk.mjs +1 -1
  268. package/dist/locale/zh-mo.js +1 -1
  269. package/dist/locale/zh-mo.min.js +1 -1
  270. package/dist/locale/zh-mo.min.mjs +1 -1
  271. package/dist/locale/zh-mo.mjs +1 -1
  272. package/dist/locale/zh-tw.js +1 -1
  273. package/dist/locale/zh-tw.min.js +1 -1
  274. package/dist/locale/zh-tw.min.mjs +1 -1
  275. package/dist/locale/zh-tw.mjs +1 -1
  276. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  277. package/es/components/avatar/index.mjs +2 -2
  278. package/es/components/avatar/src/avatar.mjs +65 -31
  279. package/es/components/avatar/src/avatar.mjs.map +1 -1
  280. package/es/components/avatar/src/avatar2.mjs +31 -65
  281. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  282. package/es/components/backtop/index.mjs +2 -2
  283. package/es/components/backtop/src/backtop.mjs +53 -21
  284. package/es/components/backtop/src/backtop.mjs.map +1 -1
  285. package/es/components/backtop/src/backtop2.mjs +21 -53
  286. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  287. package/es/components/calendar/index.mjs +2 -2
  288. package/es/components/calendar/src/calendar.mjs +134 -16
  289. package/es/components/calendar/src/calendar.mjs.map +1 -1
  290. package/es/components/calendar/src/calendar2.mjs +16 -134
  291. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  292. package/es/components/cascader/src/cascader.mjs +1 -1
  293. package/es/components/checkbox/index.mjs +2 -2
  294. package/es/components/checkbox/src/checkbox-button.mjs +1 -1
  295. package/es/components/checkbox/src/checkbox.mjs +119 -59
  296. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  297. package/es/components/checkbox/src/checkbox2.mjs +59 -119
  298. package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
  299. package/es/components/collection/index.mjs +1 -1
  300. package/es/components/collection/src/collection.mjs +62 -10
  301. package/es/components/collection/src/collection.mjs.map +1 -1
  302. package/es/components/collection/src/collection2.mjs +10 -62
  303. package/es/components/collection/src/collection2.mjs.map +1 -1
  304. package/es/components/color-picker/src/color-picker.mjs +1 -1
  305. package/es/components/config-provider/src/config-provider-props.d.ts +7 -0
  306. package/es/components/config-provider/src/config-provider-props.mjs +3 -0
  307. package/es/components/config-provider/src/config-provider-props.mjs.map +1 -1
  308. package/es/components/config-provider/src/config-provider.d.ts +12 -0
  309. package/es/components/date-picker/src/date-picker-com/panel-date-range.mjs +1 -0
  310. package/es/components/date-picker/src/date-picker-com/panel-date-range.mjs.map +1 -1
  311. package/es/components/descriptions/src/description2.mjs +1 -1
  312. package/es/components/descriptions/src/descriptions-row.mjs +63 -6
  313. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  314. package/es/components/descriptions/src/descriptions-row2.mjs +6 -63
  315. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  316. package/es/components/dialog/index.mjs +1 -1
  317. package/es/components/dialog/src/dialog-content.d.ts +3 -3
  318. package/es/components/dialog/src/dialog-content.mjs +38 -88
  319. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  320. package/es/components/dialog/src/dialog-content.vue.d.ts +9 -9
  321. package/es/components/dialog/src/dialog-content2.mjs +88 -29
  322. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  323. package/es/components/dialog/src/dialog.d.ts +12 -5
  324. package/es/components/dialog/src/dialog.mjs +4 -4
  325. package/es/components/dialog/src/dialog.mjs.map +1 -1
  326. package/es/components/dialog/src/dialog.vue.d.ts +11 -11
  327. package/es/components/dialog/src/dialog2.mjs +7 -5
  328. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  329. package/es/components/dialog/src/use-dialog.d.ts +4 -1
  330. package/es/components/dialog/src/use-dialog.mjs +37 -12
  331. package/es/components/dialog/src/use-dialog.mjs.map +1 -1
  332. package/es/components/drawer/src/drawer.d.ts +4 -4
  333. package/es/components/drawer/src/drawer.vue.d.ts +11 -11
  334. package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -2
  335. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  336. package/es/components/dropdown/src/dropdown.mjs +3 -3
  337. package/es/components/dropdown/src/dropdown2.mjs +1 -1
  338. package/es/components/icon/index.mjs +2 -2
  339. package/es/components/icon/src/icon.mjs +8 -35
  340. package/es/components/icon/src/icon.mjs.map +1 -1
  341. package/es/components/icon/src/icon2.mjs +35 -8
  342. package/es/components/icon/src/icon2.mjs.map +1 -1
  343. package/es/components/image/src/image.vue.d.ts +1 -1
  344. package/es/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  345. package/es/components/index.mjs +21 -21
  346. package/es/components/input/src/utils.mjs +3 -3
  347. package/es/components/input/src/utils.mjs.map +1 -1
  348. package/es/components/input-tag/index.mjs +2 -2
  349. package/es/components/input-tag/src/input-tag.mjs +215 -70
  350. package/es/components/input-tag/src/input-tag.mjs.map +1 -1
  351. package/es/components/input-tag/src/input-tag.vue.d.ts +1 -1
  352. package/es/components/input-tag/src/input-tag2.mjs +70 -215
  353. package/es/components/input-tag/src/input-tag2.mjs.map +1 -1
  354. package/es/components/menu/index.mjs +2 -2
  355. package/es/components/menu/src/menu-item.mjs +15 -100
  356. package/es/components/menu/src/menu-item.mjs.map +1 -1
  357. package/es/components/menu/src/menu-item2.mjs +100 -15
  358. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  359. package/es/components/message/src/message.vue.d.ts +1 -1
  360. package/es/components/message-box/src/index.vue.d.ts +1 -1
  361. package/es/components/notification/src/notification.vue.d.ts +1 -1
  362. package/es/components/pagination/src/components/pager.mjs +16 -210
  363. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  364. package/es/components/pagination/src/components/pager2.mjs +210 -16
  365. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  366. package/es/components/pagination/src/pagination.mjs +1 -1
  367. package/es/components/popconfirm/src/popconfirm.mjs +1 -1
  368. package/es/components/popconfirm/src/popconfirm.vue.d.ts +4 -1
  369. package/es/components/popconfirm/src/popconfirm2.mjs +10 -2
  370. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  371. package/es/components/popover/src/popover.mjs +1 -1
  372. package/es/components/popper/index.mjs +4 -4
  373. package/es/components/popper/src/arrow.mjs +30 -7
  374. package/es/components/popper/src/arrow.mjs.map +1 -1
  375. package/es/components/popper/src/arrow2.mjs +7 -30
  376. package/es/components/popper/src/arrow2.mjs.map +1 -1
  377. package/es/components/popper/src/content.mjs +1 -1
  378. package/es/components/popper/src/popper.mjs +32 -22
  379. package/es/components/popper/src/popper.mjs.map +1 -1
  380. package/es/components/popper/src/popper2.mjs +22 -32
  381. package/es/components/popper/src/popper2.mjs.map +1 -1
  382. package/es/components/radio/index.mjs +2 -2
  383. package/es/components/radio/src/radio-button.mjs +1 -1
  384. package/es/components/radio/src/radio-group.mjs +1 -1
  385. package/es/components/radio/src/radio.mjs +74 -32
  386. package/es/components/radio/src/radio.mjs.map +1 -1
  387. package/es/components/radio/src/radio2.mjs +32 -74
  388. package/es/components/radio/src/radio2.mjs.map +1 -1
  389. package/es/components/rate/index.mjs +2 -2
  390. package/es/components/rate/src/rate.mjs +258 -83
  391. package/es/components/rate/src/rate.mjs.map +1 -1
  392. package/es/components/rate/src/rate2.mjs +83 -258
  393. package/es/components/rate/src/rate2.mjs.map +1 -1
  394. package/es/components/result/index.mjs +2 -2
  395. package/es/components/result/src/result.mjs +62 -30
  396. package/es/components/result/src/result.mjs.map +1 -1
  397. package/es/components/result/src/result2.mjs +30 -62
  398. package/es/components/result/src/result2.mjs.map +1 -1
  399. package/es/components/roving-focus-group/index.mjs +3 -3
  400. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  401. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -27
  402. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  403. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -27
  404. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  405. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  406. package/es/components/scrollbar/src/scrollbar2.mjs +3 -0
  407. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  408. package/es/components/select/index.mjs +2 -2
  409. package/es/components/select/src/select.mjs +497 -140
  410. package/es/components/select/src/select.mjs.map +1 -1
  411. package/es/components/select/src/select2.mjs +140 -497
  412. package/es/components/select/src/select2.mjs.map +1 -1
  413. package/es/components/select/src/useSelect.mjs +1 -1
  414. package/es/components/select/src/useSelect.mjs.map +1 -1
  415. package/es/components/select-v2/src/defaults.mjs +1 -1
  416. package/es/components/select-v2/src/useSelect.mjs +1 -1
  417. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  418. package/es/components/skeleton/index.mjs +2 -2
  419. package/es/components/skeleton/src/skeleton.mjs +18 -48
  420. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  421. package/es/components/skeleton/src/skeleton2.mjs +48 -18
  422. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  423. package/es/components/slider/index.mjs +2 -2
  424. package/es/components/slider/src/slider.mjs +238 -92
  425. package/es/components/slider/src/slider.mjs.map +1 -1
  426. package/es/components/slider/src/slider2.mjs +92 -238
  427. package/es/components/slider/src/slider2.mjs.map +1 -1
  428. package/es/components/splitter/index.mjs +2 -2
  429. package/es/components/splitter/src/split-panel.mjs +152 -17
  430. package/es/components/splitter/src/split-panel.mjs.map +1 -1
  431. package/es/components/splitter/src/split-panel2.mjs +17 -152
  432. package/es/components/splitter/src/split-panel2.mjs.map +1 -1
  433. package/es/components/table/src/filter-panel.mjs +1 -1
  434. package/es/components/tabs/index.mjs +3 -3
  435. package/es/components/tabs/src/tab-bar.mjs +11 -87
  436. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  437. package/es/components/tabs/src/tab-bar2.mjs +87 -11
  438. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  439. package/es/components/tabs/src/tab-nav.mjs +1 -1
  440. package/es/components/tabs/src/tab-pane.mjs +13 -82
  441. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  442. package/es/components/tabs/src/tab-pane2.mjs +82 -13
  443. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  444. package/es/components/tooltip/index.mjs +1 -1
  445. package/es/components/tooltip/src/content.mjs +193 -29
  446. package/es/components/tooltip/src/content.mjs.map +1 -1
  447. package/es/components/tooltip/src/content2.mjs +29 -193
  448. package/es/components/tooltip/src/content2.mjs.map +1 -1
  449. package/es/components/tooltip/src/tooltip.mjs +3 -3
  450. package/es/components/tooltip/src/tooltip2.mjs +2 -2
  451. package/es/components/tour/src/tour.vue.d.ts +1 -1
  452. package/es/components/tree/src/tree.vue.d.ts +1 -1
  453. package/es/index.d.ts +70 -39
  454. package/es/index.mjs +21 -21
  455. package/es/version.d.ts +1 -1
  456. package/es/version.mjs +1 -1
  457. package/es/version.mjs.map +1 -1
  458. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  459. package/lib/components/avatar/index.js +2 -2
  460. package/lib/components/avatar/src/avatar.js +65 -32
  461. package/lib/components/avatar/src/avatar.js.map +1 -1
  462. package/lib/components/avatar/src/avatar2.js +32 -65
  463. package/lib/components/avatar/src/avatar2.js.map +1 -1
  464. package/lib/components/backtop/index.js +2 -2
  465. package/lib/components/backtop/src/backtop.js +53 -22
  466. package/lib/components/backtop/src/backtop.js.map +1 -1
  467. package/lib/components/backtop/src/backtop2.js +22 -53
  468. package/lib/components/backtop/src/backtop2.js.map +1 -1
  469. package/lib/components/calendar/index.js +2 -2
  470. package/lib/components/calendar/src/calendar.js +134 -17
  471. package/lib/components/calendar/src/calendar.js.map +1 -1
  472. package/lib/components/calendar/src/calendar2.js +17 -134
  473. package/lib/components/calendar/src/calendar2.js.map +1 -1
  474. package/lib/components/cascader/src/cascader.js +1 -1
  475. package/lib/components/checkbox/index.js +2 -2
  476. package/lib/components/checkbox/src/checkbox-button.js +1 -1
  477. package/lib/components/checkbox/src/checkbox.js +119 -60
  478. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  479. package/lib/components/checkbox/src/checkbox2.js +60 -119
  480. package/lib/components/checkbox/src/checkbox2.js.map +1 -1
  481. package/lib/components/collection/index.js +1 -1
  482. package/lib/components/collection/src/collection.js +62 -9
  483. package/lib/components/collection/src/collection.js.map +1 -1
  484. package/lib/components/collection/src/collection2.js +9 -62
  485. package/lib/components/collection/src/collection2.js.map +1 -1
  486. package/lib/components/color-picker/src/color-picker.js +1 -1
  487. package/lib/components/config-provider/src/config-provider-props.d.ts +7 -0
  488. package/lib/components/config-provider/src/config-provider-props.js +3 -0
  489. package/lib/components/config-provider/src/config-provider-props.js.map +1 -1
  490. package/lib/components/config-provider/src/config-provider.d.ts +12 -0
  491. package/lib/components/date-picker/src/date-picker-com/panel-date-range.js +1 -0
  492. package/lib/components/date-picker/src/date-picker-com/panel-date-range.js.map +1 -1
  493. package/lib/components/descriptions/src/description2.js +1 -1
  494. package/lib/components/descriptions/src/descriptions-row.js +63 -6
  495. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  496. package/lib/components/descriptions/src/descriptions-row2.js +6 -63
  497. package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
  498. package/lib/components/dialog/index.js +1 -0
  499. package/lib/components/dialog/index.js.map +1 -1
  500. package/lib/components/dialog/src/dialog-content.d.ts +3 -3
  501. package/lib/components/dialog/src/dialog-content.js +38 -87
  502. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  503. package/lib/components/dialog/src/dialog-content.vue.d.ts +9 -9
  504. package/lib/components/dialog/src/dialog-content2.js +87 -29
  505. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  506. package/lib/components/dialog/src/dialog.d.ts +12 -5
  507. package/lib/components/dialog/src/dialog.js +4 -3
  508. package/lib/components/dialog/src/dialog.js.map +1 -1
  509. package/lib/components/dialog/src/dialog.vue.d.ts +11 -11
  510. package/lib/components/dialog/src/dialog2.js +7 -5
  511. package/lib/components/dialog/src/dialog2.js.map +1 -1
  512. package/lib/components/dialog/src/use-dialog.d.ts +4 -1
  513. package/lib/components/dialog/src/use-dialog.js +37 -12
  514. package/lib/components/dialog/src/use-dialog.js.map +1 -1
  515. package/lib/components/drawer/src/drawer.d.ts +4 -4
  516. package/lib/components/drawer/src/drawer.vue.d.ts +11 -11
  517. package/lib/components/dropdown/src/dropdown-item-impl.js +2 -2
  518. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  519. package/lib/components/dropdown/src/dropdown.js +3 -3
  520. package/lib/components/dropdown/src/dropdown2.js +1 -1
  521. package/lib/components/icon/index.js +2 -2
  522. package/lib/components/icon/src/icon.js +8 -35
  523. package/lib/components/icon/src/icon.js.map +1 -1
  524. package/lib/components/icon/src/icon2.js +35 -8
  525. package/lib/components/icon/src/icon2.js.map +1 -1
  526. package/lib/components/image/src/image.vue.d.ts +1 -1
  527. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  528. package/lib/components/index.js +21 -20
  529. package/lib/components/index.js.map +1 -1
  530. package/lib/components/input/src/utils.js +3 -3
  531. package/lib/components/input/src/utils.js.map +1 -1
  532. package/lib/components/input-tag/index.js +2 -2
  533. package/lib/components/input-tag/src/input-tag.js +214 -70
  534. package/lib/components/input-tag/src/input-tag.js.map +1 -1
  535. package/lib/components/input-tag/src/input-tag.vue.d.ts +1 -1
  536. package/lib/components/input-tag/src/input-tag2.js +70 -214
  537. package/lib/components/input-tag/src/input-tag2.js.map +1 -1
  538. package/lib/components/menu/index.js +2 -2
  539. package/lib/components/menu/src/menu-item.js +16 -100
  540. package/lib/components/menu/src/menu-item.js.map +1 -1
  541. package/lib/components/menu/src/menu-item2.js +100 -16
  542. package/lib/components/menu/src/menu-item2.js.map +1 -1
  543. package/lib/components/message/src/message.vue.d.ts +1 -1
  544. package/lib/components/message-box/src/index.vue.d.ts +1 -1
  545. package/lib/components/notification/src/notification.vue.d.ts +1 -1
  546. package/lib/components/pagination/src/components/pager.js +16 -210
  547. package/lib/components/pagination/src/components/pager.js.map +1 -1
  548. package/lib/components/pagination/src/components/pager2.js +210 -16
  549. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  550. package/lib/components/pagination/src/pagination.js +1 -1
  551. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  552. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +4 -1
  553. package/lib/components/popconfirm/src/popconfirm2.js +9 -1
  554. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  555. package/lib/components/popover/src/popover.js +1 -1
  556. package/lib/components/popper/index.js +4 -4
  557. package/lib/components/popper/src/arrow.js +30 -8
  558. package/lib/components/popper/src/arrow.js.map +1 -1
  559. package/lib/components/popper/src/arrow2.js +8 -30
  560. package/lib/components/popper/src/arrow2.js.map +1 -1
  561. package/lib/components/popper/src/content.js +1 -1
  562. package/lib/components/popper/src/popper.js +32 -25
  563. package/lib/components/popper/src/popper.js.map +1 -1
  564. package/lib/components/popper/src/popper2.js +25 -32
  565. package/lib/components/popper/src/popper2.js.map +1 -1
  566. package/lib/components/radio/index.js +2 -2
  567. package/lib/components/radio/src/radio-button.js +1 -1
  568. package/lib/components/radio/src/radio-group.js +1 -1
  569. package/lib/components/radio/src/radio.js +73 -33
  570. package/lib/components/radio/src/radio.js.map +1 -1
  571. package/lib/components/radio/src/radio2.js +33 -73
  572. package/lib/components/radio/src/radio2.js.map +1 -1
  573. package/lib/components/rate/index.js +2 -2
  574. package/lib/components/rate/src/rate.js +257 -83
  575. package/lib/components/rate/src/rate.js.map +1 -1
  576. package/lib/components/rate/src/rate2.js +83 -257
  577. package/lib/components/rate/src/rate2.js.map +1 -1
  578. package/lib/components/result/index.js +2 -2
  579. package/lib/components/result/src/result.js +62 -32
  580. package/lib/components/result/src/result.js.map +1 -1
  581. package/lib/components/result/src/result2.js +32 -62
  582. package/lib/components/result/src/result2.js.map +1 -1
  583. package/lib/components/roving-focus-group/index.js +2 -2
  584. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  585. package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -31
  586. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  587. package/lib/components/roving-focus-group/src/roving-focus-group2.js +31 -27
  588. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  589. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  590. package/lib/components/scrollbar/src/scrollbar2.js +3 -0
  591. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  592. package/lib/components/select/index.js +2 -2
  593. package/lib/components/select/src/select.js +497 -141
  594. package/lib/components/select/src/select.js.map +1 -1
  595. package/lib/components/select/src/select2.js +141 -497
  596. package/lib/components/select/src/select2.js.map +1 -1
  597. package/lib/components/select/src/useSelect.js +1 -1
  598. package/lib/components/select/src/useSelect.js.map +1 -1
  599. package/lib/components/select-v2/src/defaults.js +1 -1
  600. package/lib/components/select-v2/src/useSelect.js +1 -1
  601. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  602. package/lib/components/skeleton/index.js +2 -2
  603. package/lib/components/skeleton/src/skeleton.js +18 -48
  604. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  605. package/lib/components/skeleton/src/skeleton2.js +48 -18
  606. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  607. package/lib/components/slider/index.js +2 -2
  608. package/lib/components/slider/src/slider.js +238 -93
  609. package/lib/components/slider/src/slider.js.map +1 -1
  610. package/lib/components/slider/src/slider2.js +93 -238
  611. package/lib/components/slider/src/slider2.js.map +1 -1
  612. package/lib/components/splitter/index.js +2 -2
  613. package/lib/components/splitter/src/split-panel.js +152 -17
  614. package/lib/components/splitter/src/split-panel.js.map +1 -1
  615. package/lib/components/splitter/src/split-panel2.js +17 -152
  616. package/lib/components/splitter/src/split-panel2.js.map +1 -1
  617. package/lib/components/table/src/filter-panel.js +1 -1
  618. package/lib/components/tabs/index.js +3 -3
  619. package/lib/components/tabs/src/tab-bar.js +11 -87
  620. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  621. package/lib/components/tabs/src/tab-bar2.js +87 -11
  622. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  623. package/lib/components/tabs/src/tab-nav.js +1 -1
  624. package/lib/components/tabs/src/tab-pane.js +13 -82
  625. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  626. package/lib/components/tabs/src/tab-pane2.js +82 -13
  627. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  628. package/lib/components/tooltip/index.js +1 -1
  629. package/lib/components/tooltip/src/content.js +193 -29
  630. package/lib/components/tooltip/src/content.js.map +1 -1
  631. package/lib/components/tooltip/src/content2.js +29 -193
  632. package/lib/components/tooltip/src/content2.js.map +1 -1
  633. package/lib/components/tooltip/src/tooltip.js +3 -3
  634. package/lib/components/tooltip/src/tooltip2.js +2 -2
  635. package/lib/components/tour/src/tour.vue.d.ts +1 -1
  636. package/lib/components/tree/src/tree.vue.d.ts +1 -1
  637. package/lib/index.d.ts +70 -39
  638. package/lib/index.js +21 -20
  639. package/lib/index.js.map +1 -1
  640. package/lib/version.d.ts +1 -1
  641. package/lib/version.js +1 -1
  642. package/lib/version.js.map +1 -1
  643. package/package.json +2 -2
  644. package/tags.json +1 -1
  645. package/web-types.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! Element Plus v2.10.6 */
1
+ /*! Element Plus v2.10.7 */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
@@ -3040,7 +3040,7 @@
3040
3040
  return number;
3041
3041
  }
3042
3042
 
3043
- function clamp(number, lower, upper) {
3043
+ function clamp$1(number, lower, upper) {
3044
3044
  if (upper === void 0) {
3045
3045
  upper = lower;
3046
3046
  lower = void 0;
@@ -4649,7 +4649,7 @@
4649
4649
  }
4650
4650
 
4651
4651
  var WRAP_FLIP_FLAG = 512;
4652
- function flip$1(func) {
4652
+ function flip$2(func) {
4653
4653
  return createWrap(func, WRAP_FLIP_FLAG);
4654
4654
  }
4655
4655
 
@@ -4984,7 +4984,7 @@
4984
4984
  var nodeIsDate = nodeUtil && nodeUtil.isDate;
4985
4985
  var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
4986
4986
 
4987
- function isElement$2(value) {
4987
+ function isElement$3(value) {
4988
4988
  return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
4989
4989
  }
4990
4990
 
@@ -5195,7 +5195,7 @@
5195
5195
  return result;
5196
5196
  }
5197
5197
 
5198
- function max$3(array) {
5198
+ function max$4(array) {
5199
5199
  return array && array.length ? baseExtremum(array, identity, baseGt) : void 0;
5200
5200
  }
5201
5201
 
@@ -5244,7 +5244,7 @@
5244
5244
  };
5245
5245
  });
5246
5246
 
5247
- function min$3(array) {
5247
+ function min$4(array) {
5248
5248
  return array && array.length ? baseExtremum(array, identity, baseLt) : void 0;
5249
5249
  }
5250
5250
 
@@ -5963,7 +5963,7 @@
5963
5963
  return array == null ? array : nativeReverse.call(array);
5964
5964
  }
5965
5965
 
5966
- var round$1 = createRound("round");
5966
+ var round$2 = createRound("round");
5967
5967
 
5968
5968
  function arraySample(array) {
5969
5969
  var length = array.length;
@@ -6034,7 +6034,7 @@
6034
6034
 
6035
6035
  var mapTag = "[object Map]";
6036
6036
  var setTag = "[object Set]";
6037
- function size(collection) {
6037
+ function size$1(collection) {
6038
6038
  if (collection == null) {
6039
6039
  return 0;
6040
6040
  }
@@ -6970,7 +6970,7 @@
6970
6970
  sample,
6971
6971
  sampleSize,
6972
6972
  shuffle,
6973
- size,
6973
+ size: size$1,
6974
6974
  some,
6975
6975
  sortBy
6976
6976
  };
@@ -6990,7 +6990,7 @@
6990
6990
  debounce,
6991
6991
  defer,
6992
6992
  delay,
6993
- flip: flip$1,
6993
+ flip: flip$2,
6994
6994
  memoize,
6995
6995
  negate,
6996
6996
  once,
@@ -7023,7 +7023,7 @@
7023
7023
  isBoolean: isBoolean$1,
7024
7024
  isBuffer,
7025
7025
  isDate,
7026
- isElement: isElement$2,
7026
+ isElement: isElement$3,
7027
7027
  isEmpty: isEmpty$1,
7028
7028
  isEqual: isEqual$1,
7029
7029
  isEqualWith,
@@ -7069,21 +7069,21 @@
7069
7069
  ceil,
7070
7070
  divide,
7071
7071
  floor: floor$1,
7072
- max: max$3,
7072
+ max: max$4,
7073
7073
  maxBy,
7074
7074
  mean,
7075
7075
  meanBy,
7076
- min: min$3,
7076
+ min: min$4,
7077
7077
  minBy,
7078
7078
  multiply,
7079
- round: round$1,
7079
+ round: round$2,
7080
7080
  subtract,
7081
7081
  sum: sum$1,
7082
7082
  sumBy
7083
7083
  };
7084
7084
 
7085
7085
  var number = {
7086
- clamp,
7086
+ clamp: clamp$1,
7087
7087
  inRange,
7088
7088
  random
7089
7089
  };
@@ -7811,7 +7811,7 @@
7811
7811
  const isBoolean = (val) => typeof val === "boolean";
7812
7812
  const isNumber = (val) => typeof val === "number";
7813
7813
  const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
7814
- const isElement$1 = (e) => {
7814
+ const isElement$2 = (e) => {
7815
7815
  if (typeof Element === "undefined")
7816
7816
  return false;
7817
7817
  return e instanceof Element;
@@ -10115,36 +10115,156 @@
10115
10115
  };
10116
10116
  };
10117
10117
 
10118
- function getSide(placement) {
10118
+ /**
10119
+ * Custom positioning reference element.
10120
+ * @see https://floating-ui.com/docs/virtual-elements
10121
+ */
10122
+
10123
+ const sides = ['top', 'right', 'bottom', 'left'];
10124
+ const alignments = ['start', 'end'];
10125
+ const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
10126
+ const min$3 = Math.min;
10127
+ const max$3 = Math.max;
10128
+ const round$1 = Math.round;
10129
+ const createCoords = v => ({
10130
+ x: v,
10131
+ y: v
10132
+ });
10133
+ const oppositeSideMap = {
10134
+ left: 'right',
10135
+ right: 'left',
10136
+ bottom: 'top',
10137
+ top: 'bottom'
10138
+ };
10139
+ const oppositeAlignmentMap = {
10140
+ start: 'end',
10141
+ end: 'start'
10142
+ };
10143
+ function clamp(start, value, end) {
10144
+ return max$3(start, min$3(value, end));
10145
+ }
10146
+ function evaluate(value, param) {
10147
+ return typeof value === 'function' ? value(param) : value;
10148
+ }
10149
+ function getSide$1(placement) {
10119
10150
  return placement.split('-')[0];
10120
10151
  }
10121
-
10122
- function getAlignment(placement) {
10152
+ function getAlignment$1(placement) {
10123
10153
  return placement.split('-')[1];
10124
10154
  }
10125
-
10126
- function getMainAxisFromPlacement(placement) {
10127
- return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
10155
+ function getOppositeAxis(axis) {
10156
+ return axis === 'x' ? 'y' : 'x';
10128
10157
  }
10129
-
10130
- function getLengthFromAxis(axis) {
10158
+ function getAxisLength(axis) {
10131
10159
  return axis === 'y' ? 'height' : 'width';
10132
10160
  }
10161
+ function getSideAxis(placement) {
10162
+ return ['top', 'bottom'].includes(getSide$1(placement)) ? 'y' : 'x';
10163
+ }
10164
+ function getAlignmentAxis(placement) {
10165
+ return getOppositeAxis(getSideAxis(placement));
10166
+ }
10167
+ function getAlignmentSides$1(placement, rects, rtl) {
10168
+ if (rtl === void 0) {
10169
+ rtl = false;
10170
+ }
10171
+ const alignment = getAlignment$1(placement);
10172
+ const alignmentAxis = getAlignmentAxis(placement);
10173
+ const length = getAxisLength(alignmentAxis);
10174
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
10175
+ if (rects.reference[length] > rects.floating[length]) {
10176
+ mainAlignmentSide = getOppositePlacement$1(mainAlignmentSide);
10177
+ }
10178
+ return [mainAlignmentSide, getOppositePlacement$1(mainAlignmentSide)];
10179
+ }
10180
+ function getExpandedPlacements$1(placement) {
10181
+ const oppositePlacement = getOppositePlacement$1(placement);
10182
+ return [getOppositeAlignmentPlacement$1(placement), oppositePlacement, getOppositeAlignmentPlacement$1(oppositePlacement)];
10183
+ }
10184
+ function getOppositeAlignmentPlacement$1(placement) {
10185
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
10186
+ }
10187
+ function getSideList(side, isStart, rtl) {
10188
+ const lr = ['left', 'right'];
10189
+ const rl = ['right', 'left'];
10190
+ const tb = ['top', 'bottom'];
10191
+ const bt = ['bottom', 'top'];
10192
+ switch (side) {
10193
+ case 'top':
10194
+ case 'bottom':
10195
+ if (rtl) return isStart ? rl : lr;
10196
+ return isStart ? lr : rl;
10197
+ case 'left':
10198
+ case 'right':
10199
+ return isStart ? tb : bt;
10200
+ default:
10201
+ return [];
10202
+ }
10203
+ }
10204
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
10205
+ const alignment = getAlignment$1(placement);
10206
+ let list = getSideList(getSide$1(placement), direction === 'start', rtl);
10207
+ if (alignment) {
10208
+ list = list.map(side => side + "-" + alignment);
10209
+ if (flipAlignment) {
10210
+ list = list.concat(list.map(getOppositeAlignmentPlacement$1));
10211
+ }
10212
+ }
10213
+ return list;
10214
+ }
10215
+ function getOppositePlacement$1(placement) {
10216
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
10217
+ }
10218
+ function expandPaddingObject$1(padding) {
10219
+ return {
10220
+ top: 0,
10221
+ right: 0,
10222
+ bottom: 0,
10223
+ left: 0,
10224
+ ...padding
10225
+ };
10226
+ }
10227
+ function getPaddingObject(padding) {
10228
+ return typeof padding !== 'number' ? expandPaddingObject$1(padding) : {
10229
+ top: padding,
10230
+ right: padding,
10231
+ bottom: padding,
10232
+ left: padding
10233
+ };
10234
+ }
10235
+ function rectToClientRect$1(rect) {
10236
+ const {
10237
+ x,
10238
+ y,
10239
+ width,
10240
+ height
10241
+ } = rect;
10242
+ return {
10243
+ width,
10244
+ height,
10245
+ top: y,
10246
+ left: x,
10247
+ right: x + width,
10248
+ bottom: y + height,
10249
+ x,
10250
+ y
10251
+ };
10252
+ }
10133
10253
 
10134
- function computeCoordsFromPlacement(_ref, placement, rtl) {
10254
+ function computeCoordsFromPlacement$1(_ref, placement, rtl) {
10135
10255
  let {
10136
10256
  reference,
10137
10257
  floating
10138
10258
  } = _ref;
10259
+ const sideAxis = getSideAxis(placement);
10260
+ const alignmentAxis = getAlignmentAxis(placement);
10261
+ const alignLength = getAxisLength(alignmentAxis);
10262
+ const side = getSide$1(placement);
10263
+ const isVertical = sideAxis === 'y';
10139
10264
  const commonX = reference.x + reference.width / 2 - floating.width / 2;
10140
10265
  const commonY = reference.y + reference.height / 2 - floating.height / 2;
10141
- const mainAxis = getMainAxisFromPlacement(placement);
10142
- const length = getLengthFromAxis(mainAxis);
10143
- const commonAlign = reference[length] / 2 - floating[length] / 2;
10144
- const side = getSide(placement);
10145
- const isVertical = mainAxis === 'x';
10266
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
10146
10267
  let coords;
10147
-
10148
10268
  switch (side) {
10149
10269
  case 'top':
10150
10270
  coords = {
@@ -10152,65 +10272,57 @@
10152
10272
  y: reference.y - floating.height
10153
10273
  };
10154
10274
  break;
10155
-
10156
10275
  case 'bottom':
10157
10276
  coords = {
10158
10277
  x: commonX,
10159
10278
  y: reference.y + reference.height
10160
10279
  };
10161
10280
  break;
10162
-
10163
10281
  case 'right':
10164
10282
  coords = {
10165
10283
  x: reference.x + reference.width,
10166
10284
  y: commonY
10167
10285
  };
10168
10286
  break;
10169
-
10170
10287
  case 'left':
10171
10288
  coords = {
10172
10289
  x: reference.x - floating.width,
10173
10290
  y: commonY
10174
10291
  };
10175
10292
  break;
10176
-
10177
10293
  default:
10178
10294
  coords = {
10179
10295
  x: reference.x,
10180
10296
  y: reference.y
10181
10297
  };
10182
10298
  }
10183
-
10184
- switch (getAlignment(placement)) {
10299
+ switch (getAlignment$1(placement)) {
10185
10300
  case 'start':
10186
- coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
10301
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
10187
10302
  break;
10188
-
10189
10303
  case 'end':
10190
- coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
10304
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
10191
10305
  break;
10192
10306
  }
10193
-
10194
10307
  return coords;
10195
10308
  }
10196
10309
 
10197
10310
  /**
10198
10311
  * Computes the `x` and `y` coordinates that will place the floating element
10199
- * next to a reference element when it is given a certain positioning strategy.
10312
+ * next to a given reference element.
10200
10313
  *
10201
10314
  * This export does not have any `platform` interface logic. You will need to
10202
10315
  * write one for the platform you are using Floating UI with.
10203
10316
  */
10204
-
10205
- const computePosition$1 = async (reference, floating, config) => {
10317
+ const computePosition$3 = async (reference, floating, config) => {
10206
10318
  const {
10207
10319
  placement = 'bottom',
10208
10320
  strategy = 'absolute',
10209
10321
  middleware = [],
10210
10322
  platform
10211
10323
  } = config;
10324
+ const validMiddleware = middleware.filter(Boolean);
10212
10325
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
10213
-
10214
10326
  let rects = await platform.getElementRects({
10215
10327
  reference,
10216
10328
  floating,
@@ -10219,16 +10331,15 @@
10219
10331
  let {
10220
10332
  x,
10221
10333
  y
10222
- } = computeCoordsFromPlacement(rects, placement, rtl);
10334
+ } = computeCoordsFromPlacement$1(rects, placement, rtl);
10223
10335
  let statefulPlacement = placement;
10224
10336
  let middlewareData = {};
10225
10337
  let resetCount = 0;
10226
-
10227
- for (let i = 0; i < middleware.length; i++) {
10338
+ for (let i = 0; i < validMiddleware.length; i++) {
10228
10339
  const {
10229
10340
  name,
10230
10341
  fn
10231
- } = middleware[i];
10342
+ } = validMiddleware[i];
10232
10343
  const {
10233
10344
  x: nextX,
10234
10345
  y: nextY,
@@ -10250,20 +10361,19 @@
10250
10361
  });
10251
10362
  x = nextX != null ? nextX : x;
10252
10363
  y = nextY != null ? nextY : y;
10253
- middlewareData = { ...middlewareData,
10254
- [name]: { ...middlewareData[name],
10364
+ middlewareData = {
10365
+ ...middlewareData,
10366
+ [name]: {
10367
+ ...middlewareData[name],
10255
10368
  ...data
10256
10369
  }
10257
10370
  };
10258
-
10259
10371
  if (reset && resetCount <= 50) {
10260
10372
  resetCount++;
10261
-
10262
10373
  if (typeof reset === 'object') {
10263
10374
  if (reset.placement) {
10264
10375
  statefulPlacement = reset.placement;
10265
10376
  }
10266
-
10267
10377
  if (reset.rects) {
10268
10378
  rects = reset.rects === true ? await platform.getElementRects({
10269
10379
  reference,
@@ -10271,18 +10381,14 @@
10271
10381
  strategy
10272
10382
  }) : reset.rects;
10273
10383
  }
10274
-
10275
10384
  ({
10276
10385
  x,
10277
10386
  y
10278
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
10387
+ } = computeCoordsFromPlacement$1(rects, statefulPlacement, rtl));
10279
10388
  }
10280
-
10281
10389
  i = -1;
10282
- continue;
10283
10390
  }
10284
10391
  }
10285
-
10286
10392
  return {
10287
10393
  x,
10288
10394
  y,
@@ -10292,49 +10398,19 @@
10292
10398
  };
10293
10399
  };
10294
10400
 
10295
- function expandPaddingObject(padding) {
10296
- return {
10297
- top: 0,
10298
- right: 0,
10299
- bottom: 0,
10300
- left: 0,
10301
- ...padding
10302
- };
10303
- }
10304
-
10305
- function getSideObjectFromPadding(padding) {
10306
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
10307
- top: padding,
10308
- right: padding,
10309
- bottom: padding,
10310
- left: padding
10311
- };
10312
- }
10313
-
10314
- function rectToClientRect(rect) {
10315
- return { ...rect,
10316
- top: rect.y,
10317
- left: rect.x,
10318
- right: rect.x + rect.width,
10319
- bottom: rect.y + rect.height
10320
- };
10321
- }
10322
-
10323
10401
  /**
10324
10402
  * Resolves with an object of overflow side offsets that determine how much the
10325
- * element is overflowing a given clipping boundary.
10403
+ * element is overflowing a given clipping boundary on each side.
10326
10404
  * - positive = overflowing the boundary by that number of pixels
10327
10405
  * - negative = how many pixels left before it will overflow
10328
10406
  * - 0 = lies flush with the boundary
10329
10407
  * @see https://floating-ui.com/docs/detectOverflow
10330
10408
  */
10331
- async function detectOverflow(middlewareArguments, options) {
10409
+ async function detectOverflow$1(state, options) {
10332
10410
  var _await$platform$isEle;
10333
-
10334
10411
  if (options === void 0) {
10335
10412
  options = {};
10336
10413
  }
10337
-
10338
10414
  const {
10339
10415
  x,
10340
10416
  y,
@@ -10342,176 +10418,251 @@
10342
10418
  rects,
10343
10419
  elements,
10344
10420
  strategy
10345
- } = middlewareArguments;
10421
+ } = state;
10346
10422
  const {
10347
10423
  boundary = 'clippingAncestors',
10348
10424
  rootBoundary = 'viewport',
10349
10425
  elementContext = 'floating',
10350
10426
  altBoundary = false,
10351
10427
  padding = 0
10352
- } = options;
10353
- const paddingObject = getSideObjectFromPadding(padding);
10428
+ } = evaluate(options, state);
10429
+ const paddingObject = getPaddingObject(padding);
10354
10430
  const altContext = elementContext === 'floating' ? 'reference' : 'floating';
10355
10431
  const element = elements[altBoundary ? altContext : elementContext];
10356
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
10432
+ const clippingClientRect = rectToClientRect$1(await platform.getClippingRect({
10357
10433
  element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
10358
10434
  boundary,
10359
10435
  rootBoundary,
10360
10436
  strategy
10361
10437
  }));
10362
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
10363
- rect: elementContext === 'floating' ? { ...rects.floating,
10364
- x,
10365
- y
10366
- } : rects.reference,
10367
- offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
10438
+ const rect = elementContext === 'floating' ? {
10439
+ x,
10440
+ y,
10441
+ width: rects.floating.width,
10442
+ height: rects.floating.height
10443
+ } : rects.reference;
10444
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
10445
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
10446
+ x: 1,
10447
+ y: 1
10448
+ } : {
10449
+ x: 1,
10450
+ y: 1
10451
+ };
10452
+ const elementClientRect = rectToClientRect$1(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
10453
+ elements,
10454
+ rect,
10455
+ offsetParent,
10368
10456
  strategy
10369
- }) : rects[elementContext]);
10457
+ }) : rect);
10370
10458
  return {
10371
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
10372
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
10373
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
10374
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
10459
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
10460
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
10461
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
10462
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
10375
10463
  };
10376
10464
  }
10377
10465
 
10378
- const min$2 = Math.min;
10379
- const max$2 = Math.max;
10380
-
10381
- function within(min$1, value, max$1) {
10382
- return max$2(min$1, min$2(value, max$1));
10383
- }
10384
-
10385
10466
  /**
10386
- * Positions an inner element of the floating element such that it is centered
10387
- * to the reference element.
10467
+ * Provides data to position an inner element of the floating element so that it
10468
+ * appears centered to the reference element.
10388
10469
  * @see https://floating-ui.com/docs/arrow
10389
10470
  */
10390
- const arrow = options => ({
10471
+ const arrow$2 = options => ({
10391
10472
  name: 'arrow',
10392
10473
  options,
10393
-
10394
- async fn(middlewareArguments) {
10395
- // Since `element` is required, we don't Partial<> the type
10396
- const {
10397
- element,
10398
- padding = 0
10399
- } = options != null ? options : {};
10474
+ async fn(state) {
10400
10475
  const {
10401
10476
  x,
10402
10477
  y,
10403
10478
  placement,
10404
10479
  rects,
10405
- platform
10406
- } = middlewareArguments;
10407
-
10480
+ platform,
10481
+ elements,
10482
+ middlewareData
10483
+ } = state;
10484
+ // Since `element` is required, we don't Partial<> the type.
10485
+ const {
10486
+ element,
10487
+ padding = 0
10488
+ } = evaluate(options, state) || {};
10408
10489
  if (element == null) {
10409
-
10410
10490
  return {};
10411
10491
  }
10412
-
10413
- const paddingObject = getSideObjectFromPadding(padding);
10492
+ const paddingObject = getPaddingObject(padding);
10414
10493
  const coords = {
10415
10494
  x,
10416
10495
  y
10417
10496
  };
10418
- const axis = getMainAxisFromPlacement(placement);
10419
- const alignment = getAlignment(placement);
10420
- const length = getLengthFromAxis(axis);
10497
+ const axis = getAlignmentAxis(placement);
10498
+ const length = getAxisLength(axis);
10421
10499
  const arrowDimensions = await platform.getDimensions(element);
10422
- const minProp = axis === 'y' ? 'top' : 'left';
10423
- const maxProp = axis === 'y' ? 'bottom' : 'right';
10500
+ const isYAxis = axis === 'y';
10501
+ const minProp = isYAxis ? 'top' : 'left';
10502
+ const maxProp = isYAxis ? 'bottom' : 'right';
10503
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
10424
10504
  const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
10425
10505
  const startDiff = coords[axis] - rects.reference[axis];
10426
10506
  const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
10427
- let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
10507
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
10428
10508
 
10429
- if (clientSize === 0) {
10430
- clientSize = rects.floating[length];
10509
+ // DOM platform can return `window` as the `offsetParent`.
10510
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
10511
+ clientSize = elements.floating[clientProp] || rects.floating[length];
10431
10512
  }
10513
+ const centerToReference = endDiff / 2 - startDiff / 2;
10432
10514
 
10433
- const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
10434
- // point is outside the floating element's bounds
10515
+ // If the padding is large enough that it causes the arrow to no longer be
10516
+ // centered, modify the padding so that it is centered.
10517
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
10518
+ const minPadding = min$3(paddingObject[minProp], largestPossiblePadding);
10519
+ const maxPadding = min$3(paddingObject[maxProp], largestPossiblePadding);
10435
10520
 
10436
- const min = paddingObject[minProp];
10437
- const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
10521
+ // Make sure the arrow doesn't overflow the floating element if the center
10522
+ // point is outside the floating element's bounds.
10523
+ const min$1 = minPadding;
10524
+ const max = clientSize - arrowDimensions[length] - maxPadding;
10438
10525
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
10439
- const offset = within(min, center, max); // Make sure that arrow points at the reference
10440
-
10441
- const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
10442
- const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
10443
- const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
10526
+ const offset = clamp(min$1, center, max);
10527
+
10528
+ // If the reference is small enough that the arrow's padding causes it to
10529
+ // to point to nothing for an aligned placement, adjust the offset of the
10530
+ // floating element itself. To ensure `shift()` continues to take action,
10531
+ // a single reset is performed when this is true.
10532
+ const shouldAddOffset = !middlewareData.arrow && getAlignment$1(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
10533
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
10444
10534
  return {
10445
- [axis]: coords[axis] - alignmentOffset,
10535
+ [axis]: coords[axis] + alignmentOffset,
10446
10536
  data: {
10447
10537
  [axis]: offset,
10448
- centerOffset: center - offset
10449
- }
10538
+ centerOffset: center - offset - alignmentOffset,
10539
+ ...(shouldAddOffset && {
10540
+ alignmentOffset
10541
+ })
10542
+ },
10543
+ reset: shouldAddOffset
10450
10544
  };
10451
10545
  }
10452
-
10453
10546
  });
10454
10547
 
10455
- const hash$1 = {
10456
- left: 'right',
10457
- right: 'left',
10458
- bottom: 'top',
10459
- top: 'bottom'
10460
- };
10461
- function getOppositePlacement(placement) {
10462
- return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
10548
+ function getPlacementList(alignment, autoAlignment, allowedPlacements) {
10549
+ const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment$1(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment$1(placement) !== alignment)] : allowedPlacements.filter(placement => getSide$1(placement) === placement);
10550
+ return allowedPlacementsSortedByAlignment.filter(placement => {
10551
+ if (alignment) {
10552
+ return getAlignment$1(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement$1(placement) !== placement : false);
10553
+ }
10554
+ return true;
10555
+ });
10463
10556
  }
10464
-
10465
- function getAlignmentSides(placement, rects, rtl) {
10466
- if (rtl === void 0) {
10467
- rtl = false;
10557
+ /**
10558
+ * Optimizes the visibility of the floating element by choosing the placement
10559
+ * that has the most space available automatically, without needing to specify a
10560
+ * preferred placement. Alternative to `flip`.
10561
+ * @see https://floating-ui.com/docs/autoPlacement
10562
+ */
10563
+ const autoPlacement = function (options) {
10564
+ if (options === void 0) {
10565
+ options = {};
10468
10566
  }
10567
+ return {
10568
+ name: 'autoPlacement',
10569
+ options,
10570
+ async fn(state) {
10571
+ var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
10572
+ const {
10573
+ rects,
10574
+ middlewareData,
10575
+ placement,
10576
+ platform,
10577
+ elements
10578
+ } = state;
10579
+ const {
10580
+ crossAxis = false,
10581
+ alignment,
10582
+ allowedPlacements = placements,
10583
+ autoAlignment = true,
10584
+ ...detectOverflowOptions
10585
+ } = evaluate(options, state);
10586
+ const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
10587
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
10588
+ const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
10589
+ const currentPlacement = placements$1[currentIndex];
10590
+ if (currentPlacement == null) {
10591
+ return {};
10592
+ }
10593
+ const alignmentSides = getAlignmentSides$1(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
10469
10594
 
10470
- const alignment = getAlignment(placement);
10471
- const mainAxis = getMainAxisFromPlacement(placement);
10472
- const length = getLengthFromAxis(mainAxis);
10473
- let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
10474
-
10475
- if (rects.reference[length] > rects.floating[length]) {
10476
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
10477
- }
10595
+ // Make `computeCoords` start from the right place.
10596
+ if (placement !== currentPlacement) {
10597
+ return {
10598
+ reset: {
10599
+ placement: placements$1[0]
10600
+ }
10601
+ };
10602
+ }
10603
+ const currentOverflows = [overflow[getSide$1(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
10604
+ const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
10605
+ placement: currentPlacement,
10606
+ overflows: currentOverflows
10607
+ }];
10608
+ const nextPlacement = placements$1[currentIndex + 1];
10478
10609
 
10479
- return {
10480
- main: mainAlignmentSide,
10481
- cross: getOppositePlacement(mainAlignmentSide)
10610
+ // There are more placements to check.
10611
+ if (nextPlacement) {
10612
+ return {
10613
+ data: {
10614
+ index: currentIndex + 1,
10615
+ overflows: allOverflows
10616
+ },
10617
+ reset: {
10618
+ placement: nextPlacement
10619
+ }
10620
+ };
10621
+ }
10622
+ const placementsSortedByMostSpace = allOverflows.map(d => {
10623
+ const alignment = getAlignment$1(d.placement);
10624
+ return [d.placement, alignment && crossAxis ?
10625
+ // Check along the mainAxis and main crossAxis side.
10626
+ d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
10627
+ // Check only the mainAxis.
10628
+ d.overflows[0], d.overflows];
10629
+ }).sort((a, b) => a[1] - b[1]);
10630
+ const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
10631
+ // Aligned placements should not check their opposite crossAxis
10632
+ // side.
10633
+ getAlignment$1(d[0]) ? 2 : 3).every(v => v <= 0));
10634
+ const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
10635
+ if (resetPlacement !== placement) {
10636
+ return {
10637
+ data: {
10638
+ index: currentIndex + 1,
10639
+ overflows: allOverflows
10640
+ },
10641
+ reset: {
10642
+ placement: resetPlacement
10643
+ }
10644
+ };
10645
+ }
10646
+ return {};
10647
+ }
10482
10648
  };
10483
- }
10484
-
10485
- const hash = {
10486
- start: 'end',
10487
- end: 'start'
10488
10649
  };
10489
- function getOppositeAlignmentPlacement(placement) {
10490
- return placement.replace(/start|end/g, matched => hash[matched]);
10491
- }
10492
-
10493
- function getExpandedPlacements(placement) {
10494
- const oppositePlacement = getOppositePlacement(placement);
10495
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
10496
- }
10497
10650
 
10498
10651
  /**
10499
- * Changes the placement of the floating element to one that will fit if the
10500
- * initially specified `placement` does not.
10652
+ * Optimizes the visibility of the floating element by flipping the `placement`
10653
+ * in order to keep it in view when the preferred placement(s) will overflow the
10654
+ * clipping boundary. Alternative to `autoPlacement`.
10501
10655
  * @see https://floating-ui.com/docs/flip
10502
10656
  */
10503
- const flip = function (options) {
10657
+ const flip$1 = function (options) {
10504
10658
  if (options === void 0) {
10505
10659
  options = {};
10506
10660
  }
10507
-
10508
10661
  return {
10509
10662
  name: 'flip',
10510
10663
  options,
10511
-
10512
- async fn(middlewareArguments) {
10513
- var _middlewareData$flip;
10514
-
10664
+ async fn(state) {
10665
+ var _middlewareData$arrow, _middlewareData$flip;
10515
10666
  const {
10516
10667
  placement,
10517
10668
  middlewareData,
@@ -10519,48 +10670,56 @@
10519
10670
  initialPlacement,
10520
10671
  platform,
10521
10672
  elements
10522
- } = middlewareArguments;
10673
+ } = state;
10523
10674
  const {
10524
10675
  mainAxis: checkMainAxis = true,
10525
10676
  crossAxis: checkCrossAxis = true,
10526
10677
  fallbackPlacements: specifiedFallbackPlacements,
10527
10678
  fallbackStrategy = 'bestFit',
10679
+ fallbackAxisSideDirection = 'none',
10528
10680
  flipAlignment = true,
10529
10681
  ...detectOverflowOptions
10530
- } = options;
10531
- const side = getSide(placement);
10532
- const isBasePlacement = side === initialPlacement;
10533
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
10682
+ } = evaluate(options, state);
10683
+
10684
+ // If a reset by the arrow was caused due to an alignment offset being
10685
+ // added, we should skip any logic now since `flip()` has already done its
10686
+ // work.
10687
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
10688
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
10689
+ return {};
10690
+ }
10691
+ const side = getSide$1(placement);
10692
+ const initialSideAxis = getSideAxis(initialPlacement);
10693
+ const isBasePlacement = getSide$1(initialPlacement) === initialPlacement;
10694
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
10695
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement$1(initialPlacement)] : getExpandedPlacements$1(initialPlacement));
10696
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
10697
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
10698
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
10699
+ }
10534
10700
  const placements = [initialPlacement, ...fallbackPlacements];
10535
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
10701
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
10536
10702
  const overflows = [];
10537
10703
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
10538
-
10539
10704
  if (checkMainAxis) {
10540
10705
  overflows.push(overflow[side]);
10541
10706
  }
10542
-
10543
10707
  if (checkCrossAxis) {
10544
- const {
10545
- main,
10546
- cross
10547
- } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
10548
- overflows.push(overflow[main], overflow[cross]);
10708
+ const sides = getAlignmentSides$1(placement, rects, rtl);
10709
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
10549
10710
  }
10550
-
10551
10711
  overflowsData = [...overflowsData, {
10552
10712
  placement,
10553
10713
  overflows
10554
- }]; // One or more sides is overflowing
10714
+ }];
10555
10715
 
10716
+ // One or more sides is overflowing.
10556
10717
  if (!overflows.every(side => side <= 0)) {
10557
- var _middlewareData$flip$, _middlewareData$flip2;
10558
-
10559
- const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
10718
+ var _middlewareData$flip2, _overflowsData$filter;
10719
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
10560
10720
  const nextPlacement = placements[nextIndex];
10561
-
10562
10721
  if (nextPlacement) {
10563
- // Try next placement and re-run the lifecycle
10722
+ // Try next placement and re-run the lifecycle.
10564
10723
  return {
10565
10724
  data: {
10566
10725
  index: nextIndex,
@@ -10572,27 +10731,36 @@
10572
10731
  };
10573
10732
  }
10574
10733
 
10575
- let resetPlacement = 'bottom';
10576
-
10577
- switch (fallbackStrategy) {
10578
- case 'bestFit':
10579
- {
10580
- var _overflowsData$map$so;
10581
-
10582
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
10734
+ // First, find the candidates that fit on the mainAxis side of overflow,
10735
+ // then find the placement that fits the best on the main crossAxis side.
10736
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
10583
10737
 
10584
- if (placement) {
10585
- resetPlacement = placement;
10738
+ // Otherwise fallback.
10739
+ if (!resetPlacement) {
10740
+ switch (fallbackStrategy) {
10741
+ case 'bestFit':
10742
+ {
10743
+ var _overflowsData$filter2;
10744
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
10745
+ if (hasFallbackAxisSideDirection) {
10746
+ const currentSideAxis = getSideAxis(d.placement);
10747
+ return currentSideAxis === initialSideAxis ||
10748
+ // Create a bias to the `y` side axis due to horizontal
10749
+ // reading directions favoring greater width.
10750
+ currentSideAxis === 'y';
10751
+ }
10752
+ return true;
10753
+ }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
10754
+ if (placement) {
10755
+ resetPlacement = placement;
10756
+ }
10757
+ break;
10586
10758
  }
10587
-
10759
+ case 'initialPlacement':
10760
+ resetPlacement = initialPlacement;
10588
10761
  break;
10589
- }
10590
-
10591
- case 'initialPlacement':
10592
- resetPlacement = initialPlacement;
10593
- break;
10762
+ }
10594
10763
  }
10595
-
10596
10764
  if (placement !== resetPlacement) {
10597
10765
  return {
10598
10766
  reset: {
@@ -10601,27 +10769,229 @@
10601
10769
  };
10602
10770
  }
10603
10771
  }
10604
-
10605
10772
  return {};
10606
10773
  }
10774
+ };
10775
+ };
10607
10776
 
10777
+ function getSideOffsets(overflow, rect) {
10778
+ return {
10779
+ top: overflow.top - rect.height,
10780
+ right: overflow.right - rect.width,
10781
+ bottom: overflow.bottom - rect.height,
10782
+ left: overflow.left - rect.width
10783
+ };
10784
+ }
10785
+ function isAnySideFullyClipped(overflow) {
10786
+ return sides.some(side => overflow[side] >= 0);
10787
+ }
10788
+ /**
10789
+ * Provides data to hide the floating element in applicable situations, such as
10790
+ * when it is not in the same clipping context as the reference element.
10791
+ * @see https://floating-ui.com/docs/hide
10792
+ */
10793
+ const hide = function (options) {
10794
+ if (options === void 0) {
10795
+ options = {};
10796
+ }
10797
+ return {
10798
+ name: 'hide',
10799
+ options,
10800
+ async fn(state) {
10801
+ const {
10802
+ rects
10803
+ } = state;
10804
+ const {
10805
+ strategy = 'referenceHidden',
10806
+ ...detectOverflowOptions
10807
+ } = evaluate(options, state);
10808
+ switch (strategy) {
10809
+ case 'referenceHidden':
10810
+ {
10811
+ const overflow = await detectOverflow$1(state, {
10812
+ ...detectOverflowOptions,
10813
+ elementContext: 'reference'
10814
+ });
10815
+ const offsets = getSideOffsets(overflow, rects.reference);
10816
+ return {
10817
+ data: {
10818
+ referenceHiddenOffsets: offsets,
10819
+ referenceHidden: isAnySideFullyClipped(offsets)
10820
+ }
10821
+ };
10822
+ }
10823
+ case 'escaped':
10824
+ {
10825
+ const overflow = await detectOverflow$1(state, {
10826
+ ...detectOverflowOptions,
10827
+ altBoundary: true
10828
+ });
10829
+ const offsets = getSideOffsets(overflow, rects.floating);
10830
+ return {
10831
+ data: {
10832
+ escapedOffsets: offsets,
10833
+ escaped: isAnySideFullyClipped(offsets)
10834
+ }
10835
+ };
10836
+ }
10837
+ default:
10838
+ {
10839
+ return {};
10840
+ }
10841
+ }
10842
+ }
10608
10843
  };
10609
10844
  };
10610
10845
 
10611
- async function convertValueToCoords(middlewareArguments, value) {
10846
+ function getBoundingRect(rects) {
10847
+ const minX = min$3(...rects.map(rect => rect.left));
10848
+ const minY = min$3(...rects.map(rect => rect.top));
10849
+ const maxX = max$3(...rects.map(rect => rect.right));
10850
+ const maxY = max$3(...rects.map(rect => rect.bottom));
10851
+ return {
10852
+ x: minX,
10853
+ y: minY,
10854
+ width: maxX - minX,
10855
+ height: maxY - minY
10856
+ };
10857
+ }
10858
+ function getRectsByLine(rects) {
10859
+ const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
10860
+ const groups = [];
10861
+ let prevRect = null;
10862
+ for (let i = 0; i < sortedRects.length; i++) {
10863
+ const rect = sortedRects[i];
10864
+ if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
10865
+ groups.push([rect]);
10866
+ } else {
10867
+ groups[groups.length - 1].push(rect);
10868
+ }
10869
+ prevRect = rect;
10870
+ }
10871
+ return groups.map(rect => rectToClientRect$1(getBoundingRect(rect)));
10872
+ }
10873
+ /**
10874
+ * Provides improved positioning for inline reference elements that can span
10875
+ * over multiple lines, such as hyperlinks or range selections.
10876
+ * @see https://floating-ui.com/docs/inline
10877
+ */
10878
+ const inline = function (options) {
10879
+ if (options === void 0) {
10880
+ options = {};
10881
+ }
10882
+ return {
10883
+ name: 'inline',
10884
+ options,
10885
+ async fn(state) {
10886
+ const {
10887
+ placement,
10888
+ elements,
10889
+ rects,
10890
+ platform,
10891
+ strategy
10892
+ } = state;
10893
+ // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
10894
+ // ClientRect's bounds, despite the event listener being triggered. A
10895
+ // padding of 2 seems to handle this issue.
10896
+ const {
10897
+ padding = 2,
10898
+ x,
10899
+ y
10900
+ } = evaluate(options, state);
10901
+ const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
10902
+ const clientRects = getRectsByLine(nativeClientRects);
10903
+ const fallback = rectToClientRect$1(getBoundingRect(nativeClientRects));
10904
+ const paddingObject = getPaddingObject(padding);
10905
+ function getBoundingClientRect() {
10906
+ // There are two rects and they are disjoined.
10907
+ if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
10908
+ // Find the first rect in which the point is fully inside.
10909
+ return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
10910
+ }
10911
+
10912
+ // There are 2 or more connected rects.
10913
+ if (clientRects.length >= 2) {
10914
+ if (getSideAxis(placement) === 'y') {
10915
+ const firstRect = clientRects[0];
10916
+ const lastRect = clientRects[clientRects.length - 1];
10917
+ const isTop = getSide$1(placement) === 'top';
10918
+ const top = firstRect.top;
10919
+ const bottom = lastRect.bottom;
10920
+ const left = isTop ? firstRect.left : lastRect.left;
10921
+ const right = isTop ? firstRect.right : lastRect.right;
10922
+ const width = right - left;
10923
+ const height = bottom - top;
10924
+ return {
10925
+ top,
10926
+ bottom,
10927
+ left,
10928
+ right,
10929
+ width,
10930
+ height,
10931
+ x: left,
10932
+ y: top
10933
+ };
10934
+ }
10935
+ const isLeftSide = getSide$1(placement) === 'left';
10936
+ const maxRight = max$3(...clientRects.map(rect => rect.right));
10937
+ const minLeft = min$3(...clientRects.map(rect => rect.left));
10938
+ const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
10939
+ const top = measureRects[0].top;
10940
+ const bottom = measureRects[measureRects.length - 1].bottom;
10941
+ const left = minLeft;
10942
+ const right = maxRight;
10943
+ const width = right - left;
10944
+ const height = bottom - top;
10945
+ return {
10946
+ top,
10947
+ bottom,
10948
+ left,
10949
+ right,
10950
+ width,
10951
+ height,
10952
+ x: left,
10953
+ y: top
10954
+ };
10955
+ }
10956
+ return fallback;
10957
+ }
10958
+ const resetRects = await platform.getElementRects({
10959
+ reference: {
10960
+ getBoundingClientRect
10961
+ },
10962
+ floating: elements.floating,
10963
+ strategy
10964
+ });
10965
+ if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
10966
+ return {
10967
+ reset: {
10968
+ rects: resetRects
10969
+ }
10970
+ };
10971
+ }
10972
+ return {};
10973
+ }
10974
+ };
10975
+ };
10976
+
10977
+ // For type backwards-compatibility, the `OffsetOptions` type was also
10978
+ // Derivable.
10979
+
10980
+ async function convertValueToCoords$1(state, options) {
10612
10981
  const {
10613
10982
  placement,
10614
10983
  platform,
10615
10984
  elements
10616
- } = middlewareArguments;
10985
+ } = state;
10617
10986
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
10618
- const side = getSide(placement);
10619
- const alignment = getAlignment(placement);
10620
- const isVertical = getMainAxisFromPlacement(placement) === 'x';
10987
+ const side = getSide$1(placement);
10988
+ const alignment = getAlignment$1(placement);
10989
+ const isVertical = getSideAxis(placement) === 'y';
10621
10990
  const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
10622
10991
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
10623
- const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
10992
+ const rawValue = evaluate(options, state);
10624
10993
 
10994
+ // eslint-disable-next-line prefer-const
10625
10995
  let {
10626
10996
  mainAxis,
10627
10997
  crossAxis,
@@ -10636,11 +11006,9 @@
10636
11006
  alignmentAxis: null,
10637
11007
  ...rawValue
10638
11008
  };
10639
-
10640
11009
  if (alignment && typeof alignmentAxis === 'number') {
10641
11010
  crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
10642
11011
  }
10643
-
10644
11012
  return isVertical ? {
10645
11013
  x: crossAxis * crossAxisMulti,
10646
11014
  y: mainAxis * mainAxisMulti
@@ -10649,60 +11017,66 @@
10649
11017
  y: crossAxis * crossAxisMulti
10650
11018
  };
10651
11019
  }
11020
+
10652
11021
  /**
10653
- * Displaces the floating element from its reference element.
11022
+ * Modifies the placement by translating the floating element along the
11023
+ * specified axes.
11024
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
11025
+ * object may be passed.
10654
11026
  * @see https://floating-ui.com/docs/offset
10655
11027
  */
10656
-
10657
- const offset = function (value) {
10658
- if (value === void 0) {
10659
- value = 0;
11028
+ const offset$1 = function (options) {
11029
+ if (options === void 0) {
11030
+ options = 0;
10660
11031
  }
10661
-
10662
11032
  return {
10663
11033
  name: 'offset',
10664
- options: value,
10665
-
10666
- async fn(middlewareArguments) {
11034
+ options,
11035
+ async fn(state) {
11036
+ var _middlewareData$offse, _middlewareData$arrow;
10667
11037
  const {
10668
11038
  x,
10669
- y
10670
- } = middlewareArguments;
10671
- const diffCoords = await convertValueToCoords(middlewareArguments, value);
11039
+ y,
11040
+ placement,
11041
+ middlewareData
11042
+ } = state;
11043
+ const diffCoords = await convertValueToCoords$1(state, options);
11044
+
11045
+ // If the placement is the same and the arrow caused an alignment offset
11046
+ // then we don't need to change the positioning coordinates.
11047
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
11048
+ return {};
11049
+ }
10672
11050
  return {
10673
11051
  x: x + diffCoords.x,
10674
11052
  y: y + diffCoords.y,
10675
- data: diffCoords
11053
+ data: {
11054
+ ...diffCoords,
11055
+ placement
11056
+ }
10676
11057
  };
10677
11058
  }
10678
-
10679
11059
  };
10680
11060
  };
10681
11061
 
10682
- function getCrossAxis(axis) {
10683
- return axis === 'x' ? 'y' : 'x';
10684
- }
10685
-
10686
11062
  /**
10687
- * Shifts the floating element in order to keep it in view when it will overflow
10688
- * a clipping boundary.
11063
+ * Optimizes the visibility of the floating element by shifting it in order to
11064
+ * keep it in view when it will overflow the clipping boundary.
10689
11065
  * @see https://floating-ui.com/docs/shift
10690
11066
  */
10691
- const shift = function (options) {
11067
+ const shift$1 = function (options) {
10692
11068
  if (options === void 0) {
10693
11069
  options = {};
10694
11070
  }
10695
-
10696
11071
  return {
10697
11072
  name: 'shift',
10698
11073
  options,
10699
-
10700
- async fn(middlewareArguments) {
11074
+ async fn(state) {
10701
11075
  const {
10702
11076
  x,
10703
11077
  y,
10704
11078
  placement
10705
- } = middlewareArguments;
11079
+ } = state;
10706
11080
  const {
10707
11081
  mainAxis: checkMainAxis = true,
10708
11082
  crossAxis: checkCrossAxis = false,
@@ -10719,424 +11093,547 @@
10719
11093
  }
10720
11094
  },
10721
11095
  ...detectOverflowOptions
10722
- } = options;
11096
+ } = evaluate(options, state);
10723
11097
  const coords = {
10724
11098
  x,
10725
11099
  y
10726
11100
  };
10727
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
10728
- const mainAxis = getMainAxisFromPlacement(getSide(placement));
10729
- const crossAxis = getCrossAxis(mainAxis);
11101
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
11102
+ const crossAxis = getSideAxis(getSide$1(placement));
11103
+ const mainAxis = getOppositeAxis(crossAxis);
10730
11104
  let mainAxisCoord = coords[mainAxis];
10731
11105
  let crossAxisCoord = coords[crossAxis];
10732
-
10733
11106
  if (checkMainAxis) {
10734
11107
  const minSide = mainAxis === 'y' ? 'top' : 'left';
10735
11108
  const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
10736
11109
  const min = mainAxisCoord + overflow[minSide];
10737
11110
  const max = mainAxisCoord - overflow[maxSide];
10738
- mainAxisCoord = within(min, mainAxisCoord, max);
11111
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
10739
11112
  }
10740
-
10741
11113
  if (checkCrossAxis) {
10742
11114
  const minSide = crossAxis === 'y' ? 'top' : 'left';
10743
11115
  const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
10744
11116
  const min = crossAxisCoord + overflow[minSide];
10745
11117
  const max = crossAxisCoord - overflow[maxSide];
10746
- crossAxisCoord = within(min, crossAxisCoord, max);
11118
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
10747
11119
  }
10748
-
10749
- const limitedCoords = limiter.fn({ ...middlewareArguments,
11120
+ const limitedCoords = limiter.fn({
11121
+ ...state,
10750
11122
  [mainAxis]: mainAxisCoord,
10751
11123
  [crossAxis]: crossAxisCoord
10752
11124
  });
10753
- return { ...limitedCoords,
11125
+ return {
11126
+ ...limitedCoords,
10754
11127
  data: {
10755
11128
  x: limitedCoords.x - x,
10756
11129
  y: limitedCoords.y - y
10757
11130
  }
10758
11131
  };
10759
11132
  }
10760
-
10761
11133
  };
10762
11134
  };
10763
-
10764
- function isWindow(value) {
10765
- return value && value.document && value.location && value.alert && value.setInterval;
10766
- }
10767
- function getWindow(node) {
10768
- if (node == null) {
10769
- return window;
11135
+ /**
11136
+ * Built-in `limiter` that will stop `shift()` at a certain point.
11137
+ */
11138
+ const limitShift = function (options) {
11139
+ if (options === void 0) {
11140
+ options = {};
10770
11141
  }
11142
+ return {
11143
+ options,
11144
+ fn(state) {
11145
+ const {
11146
+ x,
11147
+ y,
11148
+ placement,
11149
+ rects,
11150
+ middlewareData
11151
+ } = state;
11152
+ const {
11153
+ offset = 0,
11154
+ mainAxis: checkMainAxis = true,
11155
+ crossAxis: checkCrossAxis = true
11156
+ } = evaluate(options, state);
11157
+ const coords = {
11158
+ x,
11159
+ y
11160
+ };
11161
+ const crossAxis = getSideAxis(placement);
11162
+ const mainAxis = getOppositeAxis(crossAxis);
11163
+ let mainAxisCoord = coords[mainAxis];
11164
+ let crossAxisCoord = coords[crossAxis];
11165
+ const rawOffset = evaluate(offset, state);
11166
+ const computedOffset = typeof rawOffset === 'number' ? {
11167
+ mainAxis: rawOffset,
11168
+ crossAxis: 0
11169
+ } : {
11170
+ mainAxis: 0,
11171
+ crossAxis: 0,
11172
+ ...rawOffset
11173
+ };
11174
+ if (checkMainAxis) {
11175
+ const len = mainAxis === 'y' ? 'height' : 'width';
11176
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
11177
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
11178
+ if (mainAxisCoord < limitMin) {
11179
+ mainAxisCoord = limitMin;
11180
+ } else if (mainAxisCoord > limitMax) {
11181
+ mainAxisCoord = limitMax;
11182
+ }
11183
+ }
11184
+ if (checkCrossAxis) {
11185
+ var _middlewareData$offse, _middlewareData$offse2;
11186
+ const len = mainAxis === 'y' ? 'width' : 'height';
11187
+ const isOriginSide = ['top', 'left'].includes(getSide$1(placement));
11188
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
11189
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
11190
+ if (crossAxisCoord < limitMin) {
11191
+ crossAxisCoord = limitMin;
11192
+ } else if (crossAxisCoord > limitMax) {
11193
+ crossAxisCoord = limitMax;
11194
+ }
11195
+ }
11196
+ return {
11197
+ [mainAxis]: mainAxisCoord,
11198
+ [crossAxis]: crossAxisCoord
11199
+ };
11200
+ }
11201
+ };
11202
+ };
10771
11203
 
10772
- if (!isWindow(node)) {
10773
- const ownerDocument = node.ownerDocument;
10774
- return ownerDocument ? ownerDocument.defaultView || window : window;
11204
+ /**
11205
+ * Provides data that allows you to change the size of the floating element —
11206
+ * for instance, prevent it from overflowing the clipping boundary or match the
11207
+ * width of the reference element.
11208
+ * @see https://floating-ui.com/docs/size
11209
+ */
11210
+ const size = function (options) {
11211
+ if (options === void 0) {
11212
+ options = {};
10775
11213
  }
11214
+ return {
11215
+ name: 'size',
11216
+ options,
11217
+ async fn(state) {
11218
+ const {
11219
+ placement,
11220
+ rects,
11221
+ platform,
11222
+ elements
11223
+ } = state;
11224
+ const {
11225
+ apply = () => {},
11226
+ ...detectOverflowOptions
11227
+ } = evaluate(options, state);
11228
+ const overflow = await detectOverflow$1(state, detectOverflowOptions);
11229
+ const side = getSide$1(placement);
11230
+ const alignment = getAlignment$1(placement);
11231
+ const isYAxis = getSideAxis(placement) === 'y';
11232
+ const {
11233
+ width,
11234
+ height
11235
+ } = rects.floating;
11236
+ let heightSide;
11237
+ let widthSide;
11238
+ if (side === 'top' || side === 'bottom') {
11239
+ heightSide = side;
11240
+ widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
11241
+ } else {
11242
+ widthSide = side;
11243
+ heightSide = alignment === 'end' ? 'top' : 'bottom';
11244
+ }
11245
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
11246
+ const maximumClippingWidth = width - overflow.left - overflow.right;
11247
+ const overflowAvailableHeight = min$3(height - overflow[heightSide], maximumClippingHeight);
11248
+ const overflowAvailableWidth = min$3(width - overflow[widthSide], maximumClippingWidth);
11249
+ const noShift = !state.middlewareData.shift;
11250
+ let availableHeight = overflowAvailableHeight;
11251
+ let availableWidth = overflowAvailableWidth;
11252
+ if (isYAxis) {
11253
+ availableWidth = alignment || noShift ? min$3(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
11254
+ } else {
11255
+ availableHeight = alignment || noShift ? min$3(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
11256
+ }
11257
+ if (noShift && !alignment) {
11258
+ const xMin = max$3(overflow.left, 0);
11259
+ const xMax = max$3(overflow.right, 0);
11260
+ const yMin = max$3(overflow.top, 0);
11261
+ const yMax = max$3(overflow.bottom, 0);
11262
+ if (isYAxis) {
11263
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$3(overflow.left, overflow.right));
11264
+ } else {
11265
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$3(overflow.top, overflow.bottom));
11266
+ }
11267
+ }
11268
+ await apply({
11269
+ ...state,
11270
+ availableWidth,
11271
+ availableHeight
11272
+ });
11273
+ const nextDimensions = await platform.getDimensions(elements.floating);
11274
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
11275
+ return {
11276
+ reset: {
11277
+ rects: true
11278
+ }
11279
+ };
11280
+ }
11281
+ return {};
11282
+ }
11283
+ };
11284
+ };
10776
11285
 
10777
- return node;
10778
- }
10779
-
10780
- function getComputedStyle$1(element) {
10781
- return getWindow(element).getComputedStyle(element);
11286
+ function getNodeName$1(node) {
11287
+ if (isNode$1(node)) {
11288
+ return (node.nodeName || '').toLowerCase();
11289
+ }
11290
+ // Mocked nodes in testing environments may not be instances of Node. By
11291
+ // returning `#document` an infinite loop won't occur.
11292
+ // https://github.com/floating-ui/floating-ui/issues/2317
11293
+ return '#document';
10782
11294
  }
10783
-
10784
- function getNodeName(node) {
10785
- return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
11295
+ function getWindow$1(node) {
11296
+ var _node$ownerDocument;
11297
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
10786
11298
  }
10787
-
10788
- function getUAString() {
10789
- const uaData = navigator.userAgentData;
10790
-
10791
- if (uaData != null && uaData.brands) {
10792
- return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
10793
- }
10794
-
10795
- return navigator.userAgent;
11299
+ function getDocumentElement$1(node) {
11300
+ var _ref;
11301
+ return (_ref = (isNode$1(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
10796
11302
  }
10797
-
10798
- function isHTMLElement(value) {
10799
- return value instanceof getWindow(value).HTMLElement;
11303
+ function isNode$1(value) {
11304
+ return value instanceof Node || value instanceof getWindow$1(value).Node;
10800
11305
  }
10801
- function isElement(value) {
10802
- return value instanceof getWindow(value).Element;
11306
+ function isElement$1(value) {
11307
+ return value instanceof Element || value instanceof getWindow$1(value).Element;
10803
11308
  }
10804
- function isNode(value) {
10805
- return value instanceof getWindow(value).Node;
11309
+ function isHTMLElement$1(value) {
11310
+ return value instanceof HTMLElement || value instanceof getWindow$1(value).HTMLElement;
10806
11311
  }
10807
- function isShadowRoot(node) {
10808
- // Browsers without `ShadowRoot` support
11312
+ function isShadowRoot$1(value) {
11313
+ // Browsers without `ShadowRoot` support.
10809
11314
  if (typeof ShadowRoot === 'undefined') {
10810
11315
  return false;
10811
11316
  }
10812
-
10813
- const OwnElement = getWindow(node).ShadowRoot;
10814
- return node instanceof OwnElement || node instanceof ShadowRoot;
11317
+ return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
10815
11318
  }
10816
- function isOverflowElement(element) {
10817
- // Firefox wants us to check `-x` and `-y` variations as well
11319
+ function isOverflowElement$1(element) {
10818
11320
  const {
10819
11321
  overflow,
10820
11322
  overflowX,
10821
- overflowY
10822
- } = getComputedStyle$1(element);
10823
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
10824
- }
10825
- function isTableElement(element) {
10826
- return ['table', 'td', 'th'].includes(getNodeName(element));
11323
+ overflowY,
11324
+ display
11325
+ } = getComputedStyle$2(element);
11326
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
10827
11327
  }
10828
- function isContainingBlock(element) {
10829
- // TODO: Try and use feature detection here instead
10830
- const isFirefox = /firefox/i.test(getUAString());
10831
- const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
10832
- // create a containing block.
10833
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
10834
-
10835
- return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
10836
- css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
11328
+ function isTableElement$1(element) {
11329
+ return ['table', 'td', 'th'].includes(getNodeName$1(element));
10837
11330
  }
10838
- function isLayoutViewport() {
10839
- // Not Safari
10840
- return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
10841
- // • Always-visible scrollbar or not
10842
- // Width of <html>, etc.
10843
- // const vV = win.visualViewport;
10844
- // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
11331
+ function isTopLayer(element) {
11332
+ return [':popover-open', ':modal'].some(selector => {
11333
+ try {
11334
+ return element.matches(selector);
11335
+ } catch (e) {
11336
+ return false;
11337
+ }
11338
+ });
10845
11339
  }
11340
+ function isContainingBlock$1(elementOrCss) {
11341
+ const webkit = isWebKit();
11342
+ const css = isElement$1(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss;
10846
11343
 
10847
- const min$1 = Math.min;
10848
- const max$1 = Math.max;
10849
- const round = Math.round;
10850
-
10851
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
10852
- var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
10853
-
10854
- if (includeScale === void 0) {
10855
- includeScale = false;
10856
- }
10857
-
10858
- if (isFixedStrategy === void 0) {
10859
- isFixedStrategy = false;
10860
- }
10861
-
10862
- const clientRect = element.getBoundingClientRect();
10863
- let scaleX = 1;
10864
- let scaleY = 1;
10865
-
10866
- if (includeScale && isHTMLElement(element)) {
10867
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
10868
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
11344
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
11345
+ return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
11346
+ }
11347
+ function getContainingBlock$1(element) {
11348
+ let currentNode = getParentNode$1(element);
11349
+ while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
11350
+ if (isContainingBlock$1(currentNode)) {
11351
+ return currentNode;
11352
+ } else if (isTopLayer(currentNode)) {
11353
+ return null;
11354
+ }
11355
+ currentNode = getParentNode$1(currentNode);
10869
11356
  }
10870
-
10871
- const win = isElement(element) ? getWindow(element) : window;
10872
- const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
10873
- const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
10874
- const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
10875
- const width = clientRect.width / scaleX;
10876
- const height = clientRect.height / scaleY;
10877
- return {
10878
- width,
10879
- height,
10880
- top: y,
10881
- right: x + width,
10882
- bottom: y + height,
10883
- left: x,
10884
- x,
10885
- y
10886
- };
11357
+ return null;
10887
11358
  }
10888
-
10889
- function getDocumentElement(node) {
10890
- return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
11359
+ function isWebKit() {
11360
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
11361
+ return CSS.supports('-webkit-backdrop-filter', 'none');
10891
11362
  }
10892
-
10893
- function getNodeScroll(element) {
10894
- if (isElement(element)) {
11363
+ function isLastTraversableNode(node) {
11364
+ return ['html', 'body', '#document'].includes(getNodeName$1(node));
11365
+ }
11366
+ function getComputedStyle$2(element) {
11367
+ return getWindow$1(element).getComputedStyle(element);
11368
+ }
11369
+ function getNodeScroll$1(element) {
11370
+ if (isElement$1(element)) {
10895
11371
  return {
10896
11372
  scrollLeft: element.scrollLeft,
10897
11373
  scrollTop: element.scrollTop
10898
11374
  };
10899
11375
  }
10900
-
10901
11376
  return {
10902
- scrollLeft: element.pageXOffset,
10903
- scrollTop: element.pageYOffset
11377
+ scrollLeft: element.scrollX,
11378
+ scrollTop: element.scrollY
10904
11379
  };
10905
11380
  }
10906
-
10907
- function getWindowScrollBarX(element) {
10908
- // If <html> has a CSS width greater than the viewport, then this will be
10909
- // incorrect for RTL.
10910
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
11381
+ function getParentNode$1(node) {
11382
+ if (getNodeName$1(node) === 'html') {
11383
+ return node;
11384
+ }
11385
+ const result =
11386
+ // Step into the shadow DOM of the parent of a slotted node.
11387
+ node.assignedSlot ||
11388
+ // DOM Element detected.
11389
+ node.parentNode ||
11390
+ // ShadowRoot detected.
11391
+ isShadowRoot$1(node) && node.host ||
11392
+ // Fallback.
11393
+ getDocumentElement$1(node);
11394
+ return isShadowRoot$1(result) ? result.host : result;
11395
+ }
11396
+ function getNearestOverflowAncestor$1(node) {
11397
+ const parentNode = getParentNode$1(node);
11398
+ if (isLastTraversableNode(parentNode)) {
11399
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
11400
+ }
11401
+ if (isHTMLElement$1(parentNode) && isOverflowElement$1(parentNode)) {
11402
+ return parentNode;
11403
+ }
11404
+ return getNearestOverflowAncestor$1(parentNode);
10911
11405
  }
10912
-
10913
- function isScaled(element) {
10914
- const rect = getBoundingClientRect(element);
10915
- return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
11406
+ function getOverflowAncestors$1(node, list, traverseIframes) {
11407
+ var _node$ownerDocument2;
11408
+ if (list === void 0) {
11409
+ list = [];
11410
+ }
11411
+ if (traverseIframes === void 0) {
11412
+ traverseIframes = true;
11413
+ }
11414
+ const scrollableAncestor = getNearestOverflowAncestor$1(node);
11415
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
11416
+ const win = getWindow$1(scrollableAncestor);
11417
+ if (isBody) {
11418
+ return list.concat(win, win.visualViewport || [], isOverflowElement$1(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors$1(win.frameElement) : []);
11419
+ }
11420
+ return list.concat(scrollableAncestor, getOverflowAncestors$1(scrollableAncestor, [], traverseIframes));
10916
11421
  }
10917
11422
 
10918
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
10919
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
10920
- const documentElement = getDocumentElement(offsetParent);
10921
- const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
10922
- isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
10923
- let scroll = {
10924
- scrollLeft: 0,
10925
- scrollTop: 0
10926
- };
10927
- const offsets = {
10928
- x: 0,
10929
- y: 0
10930
- };
10931
-
10932
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
10933
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
10934
- scroll = getNodeScroll(offsetParent);
10935
- }
10936
-
10937
- if (isHTMLElement(offsetParent)) {
10938
- const offsetRect = getBoundingClientRect(offsetParent, true);
10939
- offsets.x = offsetRect.x + offsetParent.clientLeft;
10940
- offsets.y = offsetRect.y + offsetParent.clientTop;
10941
- } else if (documentElement) {
10942
- offsets.x = getWindowScrollBarX(documentElement);
10943
- }
11423
+ function getCssDimensions(element) {
11424
+ const css = getComputedStyle$2(element);
11425
+ // In testing environments, the `width` and `height` properties are empty
11426
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
11427
+ let width = parseFloat(css.width) || 0;
11428
+ let height = parseFloat(css.height) || 0;
11429
+ const hasOffset = isHTMLElement$1(element);
11430
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
11431
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
11432
+ const shouldFallback = round$1(width) !== offsetWidth || round$1(height) !== offsetHeight;
11433
+ if (shouldFallback) {
11434
+ width = offsetWidth;
11435
+ height = offsetHeight;
10944
11436
  }
10945
-
10946
11437
  return {
10947
- x: rect.left + scroll.scrollLeft - offsets.x,
10948
- y: rect.top + scroll.scrollTop - offsets.y,
10949
- width: rect.width,
10950
- height: rect.height
11438
+ width,
11439
+ height,
11440
+ $: shouldFallback
10951
11441
  };
10952
11442
  }
10953
11443
 
10954
- function getParentNode(node) {
10955
- if (getNodeName(node) === 'html') {
10956
- return node;
10957
- }
10958
-
10959
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
10960
- // @ts-ignore
10961
- node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
10962
- node.parentNode || ( // DOM Element detected
10963
- isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
10964
- getDocumentElement(node) // fallback
10965
-
10966
- );
11444
+ function unwrapElement(element) {
11445
+ return !isElement$1(element) ? element.contextElement : element;
10967
11446
  }
10968
11447
 
10969
- function getTrueOffsetParent(element) {
10970
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
10971
- return null;
11448
+ function getScale(element) {
11449
+ const domElement = unwrapElement(element);
11450
+ if (!isHTMLElement$1(domElement)) {
11451
+ return createCoords(1);
10972
11452
  }
11453
+ const rect = domElement.getBoundingClientRect();
11454
+ const {
11455
+ width,
11456
+ height,
11457
+ $
11458
+ } = getCssDimensions(domElement);
11459
+ let x = ($ ? round$1(rect.width) : rect.width) / width;
11460
+ let y = ($ ? round$1(rect.height) : rect.height) / height;
10973
11461
 
10974
- return composedOffsetParent(element);
10975
- }
10976
- /**
10977
- * Polyfills the old offsetParent behavior from before the spec was changed:
10978
- * https://github.com/w3c/csswg-drafts/issues/159
10979
- */
10980
-
10981
-
10982
- function composedOffsetParent(element) {
10983
- let {
10984
- offsetParent
10985
- } = element;
10986
- let ancestor = element;
10987
- let foundInsideSlot = false;
10988
-
10989
- while (ancestor && ancestor !== offsetParent) {
10990
- const {
10991
- assignedSlot
10992
- } = ancestor;
10993
-
10994
- if (assignedSlot) {
10995
- let newOffsetParent = assignedSlot.offsetParent;
10996
-
10997
- if (getComputedStyle$1(assignedSlot).display === 'contents') {
10998
- const hadStyleAttribute = assignedSlot.hasAttribute('style');
10999
- const oldDisplay = assignedSlot.style.display;
11000
- assignedSlot.style.display = getComputedStyle$1(ancestor).display;
11001
- newOffsetParent = assignedSlot.offsetParent;
11002
- assignedSlot.style.display = oldDisplay;
11003
-
11004
- if (!hadStyleAttribute) {
11005
- assignedSlot.removeAttribute('style');
11006
- }
11007
- }
11008
-
11009
- ancestor = assignedSlot;
11010
-
11011
- if (offsetParent !== newOffsetParent) {
11012
- offsetParent = newOffsetParent;
11013
- foundInsideSlot = true;
11014
- }
11015
- } else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
11016
- break;
11017
- }
11462
+ // 0, NaN, or Infinity should always fallback to 1.
11018
11463
 
11019
- ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
11464
+ if (!x || !Number.isFinite(x)) {
11465
+ x = 1;
11020
11466
  }
11021
-
11022
- return offsetParent;
11023
- }
11024
-
11025
- function getContainingBlock(element) {
11026
- let currentNode = getParentNode(element);
11027
-
11028
- if (isShadowRoot(currentNode)) {
11029
- currentNode = currentNode.host;
11467
+ if (!y || !Number.isFinite(y)) {
11468
+ y = 1;
11030
11469
  }
11470
+ return {
11471
+ x,
11472
+ y
11473
+ };
11474
+ }
11031
11475
 
11032
- while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
11033
- if (isContainingBlock(currentNode)) {
11034
- return currentNode;
11035
- } else {
11036
- const parent = currentNode.parentNode;
11037
- currentNode = isShadowRoot(parent) ? parent.host : parent;
11038
- }
11476
+ const noOffsets = /*#__PURE__*/createCoords(0);
11477
+ function getVisualOffsets(element) {
11478
+ const win = getWindow$1(element);
11479
+ if (!isWebKit() || !win.visualViewport) {
11480
+ return noOffsets;
11039
11481
  }
11040
-
11041
- return null;
11042
- } // Gets the closest ancestor positioned element. Handles some edge cases,
11043
- // such as table ancestors and cross browser bugs.
11044
-
11045
-
11046
- function getOffsetParent(element) {
11047
- const window = getWindow(element);
11048
- let offsetParent = getTrueOffsetParent(element);
11049
-
11050
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
11051
- offsetParent = getTrueOffsetParent(offsetParent);
11482
+ return {
11483
+ x: win.visualViewport.offsetLeft,
11484
+ y: win.visualViewport.offsetTop
11485
+ };
11486
+ }
11487
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
11488
+ if (isFixed === void 0) {
11489
+ isFixed = false;
11052
11490
  }
11053
-
11054
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
11055
- return window;
11491
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow$1(element)) {
11492
+ return false;
11056
11493
  }
11057
-
11058
- return offsetParent || getContainingBlock(element) || window;
11494
+ return isFixed;
11059
11495
  }
11060
11496
 
11061
- function getDimensions(element) {
11062
- if (isHTMLElement(element)) {
11063
- return {
11064
- width: element.offsetWidth,
11065
- height: element.offsetHeight
11066
- };
11497
+ function getBoundingClientRect$1(element, includeScale, isFixedStrategy, offsetParent) {
11498
+ if (includeScale === void 0) {
11499
+ includeScale = false;
11067
11500
  }
11068
-
11069
- const rect = getBoundingClientRect(element);
11070
- return {
11071
- width: rect.width,
11072
- height: rect.height
11073
- };
11501
+ if (isFixedStrategy === void 0) {
11502
+ isFixedStrategy = false;
11503
+ }
11504
+ const clientRect = element.getBoundingClientRect();
11505
+ const domElement = unwrapElement(element);
11506
+ let scale = createCoords(1);
11507
+ if (includeScale) {
11508
+ if (offsetParent) {
11509
+ if (isElement$1(offsetParent)) {
11510
+ scale = getScale(offsetParent);
11511
+ }
11512
+ } else {
11513
+ scale = getScale(element);
11514
+ }
11515
+ }
11516
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
11517
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
11518
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
11519
+ let width = clientRect.width / scale.x;
11520
+ let height = clientRect.height / scale.y;
11521
+ if (domElement) {
11522
+ const win = getWindow$1(domElement);
11523
+ const offsetWin = offsetParent && isElement$1(offsetParent) ? getWindow$1(offsetParent) : offsetParent;
11524
+ let currentWin = win;
11525
+ let currentIFrame = currentWin.frameElement;
11526
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
11527
+ const iframeScale = getScale(currentIFrame);
11528
+ const iframeRect = currentIFrame.getBoundingClientRect();
11529
+ const css = getComputedStyle$2(currentIFrame);
11530
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
11531
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
11532
+ x *= iframeScale.x;
11533
+ y *= iframeScale.y;
11534
+ width *= iframeScale.x;
11535
+ height *= iframeScale.y;
11536
+ x += left;
11537
+ y += top;
11538
+ currentWin = getWindow$1(currentIFrame);
11539
+ currentIFrame = currentWin.frameElement;
11540
+ }
11541
+ }
11542
+ return rectToClientRect$1({
11543
+ width,
11544
+ height,
11545
+ x,
11546
+ y
11547
+ });
11074
11548
  }
11075
11549
 
11076
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
11550
+ function convertOffsetParentRelativeRectToViewportRelativeRect$1(_ref) {
11077
11551
  let {
11552
+ elements,
11078
11553
  rect,
11079
11554
  offsetParent,
11080
11555
  strategy
11081
11556
  } = _ref;
11082
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
11083
- const documentElement = getDocumentElement(offsetParent);
11084
-
11085
- if (offsetParent === documentElement) {
11557
+ const isFixed = strategy === 'fixed';
11558
+ const documentElement = getDocumentElement$1(offsetParent);
11559
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
11560
+ if (offsetParent === documentElement || topLayer && isFixed) {
11086
11561
  return rect;
11087
11562
  }
11088
-
11089
11563
  let scroll = {
11090
11564
  scrollLeft: 0,
11091
11565
  scrollTop: 0
11092
11566
  };
11093
- const offsets = {
11094
- x: 0,
11095
- y: 0
11096
- };
11097
-
11098
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
11099
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
11100
- scroll = getNodeScroll(offsetParent);
11567
+ let scale = createCoords(1);
11568
+ const offsets = createCoords(0);
11569
+ const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
11570
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
11571
+ if (getNodeName$1(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
11572
+ scroll = getNodeScroll$1(offsetParent);
11101
11573
  }
11102
-
11103
- if (isHTMLElement(offsetParent)) {
11104
- const offsetRect = getBoundingClientRect(offsetParent, true);
11574
+ if (isHTMLElement$1(offsetParent)) {
11575
+ const offsetRect = getBoundingClientRect$1(offsetParent);
11576
+ scale = getScale(offsetParent);
11105
11577
  offsets.x = offsetRect.x + offsetParent.clientLeft;
11106
11578
  offsets.y = offsetRect.y + offsetParent.clientTop;
11107
- } // This doesn't appear to be need to be negated.
11108
- // else if (documentElement) {
11109
- // offsets.x = getWindowScrollBarX(documentElement);
11110
- // }
11111
-
11579
+ }
11112
11580
  }
11581
+ return {
11582
+ width: rect.width * scale.x,
11583
+ height: rect.height * scale.y,
11584
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
11585
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
11586
+ };
11587
+ }
11113
11588
 
11114
- return { ...rect,
11115
- x: rect.x - scroll.scrollLeft + offsets.x,
11116
- y: rect.y - scroll.scrollTop + offsets.y
11589
+ function getClientRects(element) {
11590
+ return Array.from(element.getClientRects());
11591
+ }
11592
+
11593
+ function getWindowScrollBarX$1(element) {
11594
+ // If <html> has a CSS width greater than the viewport, then this will be
11595
+ // incorrect for RTL.
11596
+ return getBoundingClientRect$1(getDocumentElement$1(element)).left + getNodeScroll$1(element).scrollLeft;
11597
+ }
11598
+
11599
+ // Gets the entire size of the scrollable document area, even extending outside
11600
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
11601
+ function getDocumentRect$1(element) {
11602
+ const html = getDocumentElement$1(element);
11603
+ const scroll = getNodeScroll$1(element);
11604
+ const body = element.ownerDocument.body;
11605
+ const width = max$3(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
11606
+ const height = max$3(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
11607
+ let x = -scroll.scrollLeft + getWindowScrollBarX$1(element);
11608
+ const y = -scroll.scrollTop;
11609
+ if (getComputedStyle$2(body).direction === 'rtl') {
11610
+ x += max$3(html.clientWidth, body.clientWidth) - width;
11611
+ }
11612
+ return {
11613
+ width,
11614
+ height,
11615
+ x,
11616
+ y
11117
11617
  };
11118
11618
  }
11119
11619
 
11120
- function getViewportRect(element, strategy) {
11121
- const win = getWindow(element);
11122
- const html = getDocumentElement(element);
11620
+ function getViewportRect$1(element, strategy) {
11621
+ const win = getWindow$1(element);
11622
+ const html = getDocumentElement$1(element);
11123
11623
  const visualViewport = win.visualViewport;
11124
11624
  let width = html.clientWidth;
11125
11625
  let height = html.clientHeight;
11126
11626
  let x = 0;
11127
11627
  let y = 0;
11128
-
11129
11628
  if (visualViewport) {
11130
11629
  width = visualViewport.width;
11131
11630
  height = visualViewport.height;
11132
- const layoutViewport = isLayoutViewport();
11133
-
11134
- if (layoutViewport || !layoutViewport && strategy === 'fixed') {
11631
+ const visualViewportBased = isWebKit();
11632
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
11135
11633
  x = visualViewport.offsetLeft;
11136
11634
  y = visualViewport.offsetTop;
11137
11635
  }
11138
11636
  }
11139
-
11140
11637
  return {
11141
11638
  width,
11142
11639
  height,
@@ -11145,23 +11642,16 @@
11145
11642
  };
11146
11643
  }
11147
11644
 
11148
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
11149
-
11150
- function getDocumentRect(element) {
11151
- var _element$ownerDocumen;
11152
-
11153
- const html = getDocumentElement(element);
11154
- const scroll = getNodeScroll(element);
11155
- const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
11156
- const width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
11157
- const height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
11158
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
11159
- const y = -scroll.scrollTop;
11160
-
11161
- if (getComputedStyle$1(body || html).direction === 'rtl') {
11162
- x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
11163
- }
11164
-
11645
+ // Returns the inner client rect, subtracting scrollbars if present.
11646
+ function getInnerBoundingClientRect$1(element, strategy) {
11647
+ const clientRect = getBoundingClientRect$1(element, true, strategy === 'fixed');
11648
+ const top = clientRect.top + element.clientTop;
11649
+ const left = clientRect.left + element.clientLeft;
11650
+ const scale = isHTMLElement$1(element) ? getScale(element) : createCoords(1);
11651
+ const width = element.clientWidth * scale.x;
11652
+ const height = element.clientHeight * scale.y;
11653
+ const x = left * scale.x;
11654
+ const y = top * scale.y;
11165
11655
  return {
11166
11656
  width,
11167
11657
  height,
@@ -11169,125 +11659,86 @@
11169
11659
  y
11170
11660
  };
11171
11661
  }
11172
-
11173
- function getNearestOverflowAncestor(node) {
11174
- const parentNode = getParentNode(node);
11175
-
11176
- if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
11177
- // @ts-ignore assume body is always available
11178
- return node.ownerDocument.body;
11179
- }
11180
-
11181
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
11182
- return parentNode;
11183
- }
11184
-
11185
- return getNearestOverflowAncestor(parentNode);
11186
- }
11187
-
11188
- function getOverflowAncestors(node, list) {
11189
- var _node$ownerDocument;
11190
-
11191
- if (list === void 0) {
11192
- list = [];
11662
+ function getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy) {
11663
+ let rect;
11664
+ if (clippingAncestor === 'viewport') {
11665
+ rect = getViewportRect$1(element, strategy);
11666
+ } else if (clippingAncestor === 'document') {
11667
+ rect = getDocumentRect$1(getDocumentElement$1(element));
11668
+ } else if (isElement$1(clippingAncestor)) {
11669
+ rect = getInnerBoundingClientRect$1(clippingAncestor, strategy);
11670
+ } else {
11671
+ const visualOffsets = getVisualOffsets(element);
11672
+ rect = {
11673
+ ...clippingAncestor,
11674
+ x: clippingAncestor.x - visualOffsets.x,
11675
+ y: clippingAncestor.y - visualOffsets.y
11676
+ };
11193
11677
  }
11194
-
11195
- const scrollableAncestor = getNearestOverflowAncestor(node);
11196
- const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
11197
- const win = getWindow(scrollableAncestor);
11198
- const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
11199
- const updatedList = list.concat(target);
11200
- return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
11201
- updatedList.concat(getOverflowAncestors(target));
11678
+ return rectToClientRect$1(rect);
11202
11679
  }
11203
-
11204
- function contains(parent, child) {
11205
- const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
11206
-
11207
- if (parent.contains(child)) {
11208
- return true;
11209
- } // then fallback to custom implementation with Shadow DOM support
11210
- else if (rootNode && isShadowRoot(rootNode)) {
11211
- let next = child;
11212
-
11213
- do {
11214
- // use `===` replace node.isSameNode()
11215
- if (next && parent === next) {
11216
- return true;
11217
- } // @ts-ignore: need a better way to handle this...
11218
-
11219
-
11220
- next = next.parentNode || next.host;
11221
- } while (next);
11680
+ function hasFixedPositionAncestor(element, stopNode) {
11681
+ const parentNode = getParentNode$1(element);
11682
+ if (parentNode === stopNode || !isElement$1(parentNode) || isLastTraversableNode(parentNode)) {
11683
+ return false;
11222
11684
  }
11223
-
11224
- return false;
11225
- }
11226
-
11227
- function getInnerBoundingClientRect(element, strategy) {
11228
- const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
11229
- const top = clientRect.top + element.clientTop;
11230
- const left = clientRect.left + element.clientLeft;
11231
- return {
11232
- top,
11233
- left,
11234
- x: left,
11235
- y: top,
11236
- right: left + element.clientWidth,
11237
- bottom: top + element.clientHeight,
11238
- width: element.clientWidth,
11239
- height: element.clientHeight
11240
- };
11685
+ return getComputedStyle$2(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
11241
11686
  }
11242
11687
 
11243
- function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
11244
- if (clippingParent === 'viewport') {
11245
- return rectToClientRect(getViewportRect(element, strategy));
11688
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
11689
+ // clipping (or hiding) child elements. This returns all clipping ancestors
11690
+ // of the given element up the tree.
11691
+ function getClippingElementAncestors(element, cache) {
11692
+ const cachedResult = cache.get(element);
11693
+ if (cachedResult) {
11694
+ return cachedResult;
11246
11695
  }
11696
+ let result = getOverflowAncestors$1(element, [], false).filter(el => isElement$1(el) && getNodeName$1(el) !== 'body');
11697
+ let currentContainingBlockComputedStyle = null;
11698
+ const elementIsFixed = getComputedStyle$2(element).position === 'fixed';
11699
+ let currentNode = elementIsFixed ? getParentNode$1(element) : element;
11247
11700
 
11248
- if (isElement(clippingParent)) {
11249
- return getInnerBoundingClientRect(clippingParent, strategy);
11701
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
11702
+ while (isElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
11703
+ const computedStyle = getComputedStyle$2(currentNode);
11704
+ const currentNodeIsContaining = isContainingBlock$1(currentNode);
11705
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
11706
+ currentContainingBlockComputedStyle = null;
11707
+ }
11708
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement$1(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
11709
+ if (shouldDropCurrentNode) {
11710
+ // Drop non-containing blocks.
11711
+ result = result.filter(ancestor => ancestor !== currentNode);
11712
+ } else {
11713
+ // Record last containing block for next iteration.
11714
+ currentContainingBlockComputedStyle = computedStyle;
11715
+ }
11716
+ currentNode = getParentNode$1(currentNode);
11250
11717
  }
11718
+ cache.set(element, result);
11719
+ return result;
11720
+ }
11251
11721
 
11252
- return rectToClientRect(getDocumentRect(getDocumentElement(element)));
11253
- } // A "clipping ancestor" is an overflowable container with the characteristic of
11254
- // clipping (or hiding) overflowing elements with a position different from
11255
- // `initial`
11256
-
11257
-
11258
- function getClippingAncestors(element) {
11259
- const clippingAncestors = getOverflowAncestors(element);
11260
- const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
11261
- const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
11262
-
11263
- if (!isElement(clipperElement)) {
11264
- return [];
11265
- } // @ts-ignore isElement check ensures we return Array<Element>
11266
-
11267
-
11268
- return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
11269
- } // Gets the maximum area that the element is visible in due to any number of
11270
- // clipping ancestors
11271
-
11272
-
11273
- function getClippingRect(_ref) {
11722
+ // Gets the maximum area that the element is visible in due to any number of
11723
+ // clipping ancestors.
11724
+ function getClippingRect$1(_ref) {
11274
11725
  let {
11275
11726
  element,
11276
11727
  boundary,
11277
11728
  rootBoundary,
11278
11729
  strategy
11279
11730
  } = _ref;
11280
- const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
11281
- const clippingAncestors = [...mainClippingAncestors, rootBoundary];
11731
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
11732
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
11282
11733
  const firstClippingAncestor = clippingAncestors[0];
11283
11734
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
11284
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
11285
- accRect.top = max$1(rect.top, accRect.top);
11286
- accRect.right = min$1(rect.right, accRect.right);
11287
- accRect.bottom = min$1(rect.bottom, accRect.bottom);
11288
- accRect.left = max$1(rect.left, accRect.left);
11735
+ const rect = getClientRectFromClippingAncestor$1(element, clippingAncestor, strategy);
11736
+ accRect.top = max$3(rect.top, accRect.top);
11737
+ accRect.right = min$3(rect.right, accRect.right);
11738
+ accRect.bottom = min$3(rect.bottom, accRect.bottom);
11739
+ accRect.left = max$3(rect.left, accRect.left);
11289
11740
  return accRect;
11290
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
11741
+ }, getClientRectFromClippingAncestor$1(element, firstClippingAncestor, strategy));
11291
11742
  return {
11292
11743
  width: clippingRect.right - clippingRect.left,
11293
11744
  height: clippingRect.bottom - clippingRect.top,
@@ -11296,115 +11747,210 @@
11296
11747
  };
11297
11748
  }
11298
11749
 
11299
- const platform = {
11300
- getClippingRect,
11301
- convertOffsetParentRelativeRectToViewportRelativeRect,
11302
- isElement,
11303
- getDimensions,
11304
- getOffsetParent,
11305
- getDocumentElement,
11306
- getElementRects: _ref => {
11307
- let {
11308
- reference,
11309
- floating,
11310
- strategy
11311
- } = _ref;
11312
- return {
11313
- reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
11314
- floating: { ...getDimensions(floating),
11315
- x: 0,
11316
- y: 0
11317
- }
11318
- };
11319
- },
11320
- getClientRects: element => Array.from(element.getClientRects()),
11321
- isRTL: element => getComputedStyle$1(element).direction === 'rtl'
11322
- };
11750
+ function getDimensions$1(element) {
11751
+ const {
11752
+ width,
11753
+ height
11754
+ } = getCssDimensions(element);
11755
+ return {
11756
+ width,
11757
+ height
11758
+ };
11759
+ }
11323
11760
 
11324
- /**
11325
- * Automatically updates the position of the floating element when necessary.
11326
- * @see https://floating-ui.com/docs/autoUpdate
11327
- */
11328
- function autoUpdate(reference, floating, update, options) {
11329
- if (options === void 0) {
11330
- options = {};
11761
+ function getRectRelativeToOffsetParent$1(element, offsetParent, strategy) {
11762
+ const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
11763
+ const documentElement = getDocumentElement$1(offsetParent);
11764
+ const isFixed = strategy === 'fixed';
11765
+ const rect = getBoundingClientRect$1(element, true, isFixed, offsetParent);
11766
+ let scroll = {
11767
+ scrollLeft: 0,
11768
+ scrollTop: 0
11769
+ };
11770
+ const offsets = createCoords(0);
11771
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
11772
+ if (getNodeName$1(offsetParent) !== 'body' || isOverflowElement$1(documentElement)) {
11773
+ scroll = getNodeScroll$1(offsetParent);
11774
+ }
11775
+ if (isOffsetParentAnElement) {
11776
+ const offsetRect = getBoundingClientRect$1(offsetParent, true, isFixed, offsetParent);
11777
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
11778
+ offsets.y = offsetRect.y + offsetParent.clientTop;
11779
+ } else if (documentElement) {
11780
+ offsets.x = getWindowScrollBarX$1(documentElement);
11781
+ }
11331
11782
  }
11783
+ const x = rect.left + scroll.scrollLeft - offsets.x;
11784
+ const y = rect.top + scroll.scrollTop - offsets.y;
11785
+ return {
11786
+ x,
11787
+ y,
11788
+ width: rect.width,
11789
+ height: rect.height
11790
+ };
11791
+ }
11332
11792
 
11333
- const {
11334
- ancestorScroll: _ancestorScroll = true,
11335
- ancestorResize: _ancestorResize = true,
11336
- elementResize = true,
11337
- animationFrame = false
11338
- } = options;
11339
- const ancestorScroll = _ancestorScroll && !animationFrame;
11340
- const ancestorResize = _ancestorResize && !animationFrame;
11341
- const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
11342
- ancestors.forEach(ancestor => {
11343
- ancestorScroll && ancestor.addEventListener('scroll', update, {
11344
- passive: true
11345
- });
11346
- ancestorResize && ancestor.addEventListener('resize', update);
11347
- });
11348
- let observer = null;
11793
+ function isStaticPositioned(element) {
11794
+ return getComputedStyle$2(element).position === 'static';
11795
+ }
11349
11796
 
11350
- if (elementResize) {
11351
- let initialUpdate = true;
11352
- observer = new ResizeObserver(() => {
11353
- if (!initialUpdate) {
11354
- update();
11355
- }
11797
+ function getTrueOffsetParent$1(element, polyfill) {
11798
+ if (!isHTMLElement$1(element) || getComputedStyle$2(element).position === 'fixed') {
11799
+ return null;
11800
+ }
11801
+ if (polyfill) {
11802
+ return polyfill(element);
11803
+ }
11804
+ return element.offsetParent;
11805
+ }
11356
11806
 
11357
- initialUpdate = false;
11358
- });
11359
- isElement(reference) && !animationFrame && observer.observe(reference);
11360
- observer.observe(floating);
11807
+ // Gets the closest ancestor positioned element. Handles some edge cases,
11808
+ // such as table ancestors and cross browser bugs.
11809
+ function getOffsetParent$1(element, polyfill) {
11810
+ const win = getWindow$1(element);
11811
+ if (isTopLayer(element)) {
11812
+ return win;
11361
11813
  }
11814
+ if (!isHTMLElement$1(element)) {
11815
+ let svgOffsetParent = getParentNode$1(element);
11816
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
11817
+ if (isElement$1(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
11818
+ return svgOffsetParent;
11819
+ }
11820
+ svgOffsetParent = getParentNode$1(svgOffsetParent);
11821
+ }
11822
+ return win;
11823
+ }
11824
+ let offsetParent = getTrueOffsetParent$1(element, polyfill);
11825
+ while (offsetParent && isTableElement$1(offsetParent) && isStaticPositioned(offsetParent)) {
11826
+ offsetParent = getTrueOffsetParent$1(offsetParent, polyfill);
11827
+ }
11828
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock$1(offsetParent)) {
11829
+ return win;
11830
+ }
11831
+ return offsetParent || getContainingBlock$1(element) || win;
11832
+ }
11362
11833
 
11363
- let frameId;
11364
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
11834
+ const getElementRects = async function (data) {
11835
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent$1;
11836
+ const getDimensionsFn = this.getDimensions;
11837
+ const floatingDimensions = await getDimensionsFn(data.floating);
11838
+ return {
11839
+ reference: getRectRelativeToOffsetParent$1(data.reference, await getOffsetParentFn(data.floating), data.strategy),
11840
+ floating: {
11841
+ x: 0,
11842
+ y: 0,
11843
+ width: floatingDimensions.width,
11844
+ height: floatingDimensions.height
11845
+ }
11846
+ };
11847
+ };
11365
11848
 
11366
- if (animationFrame) {
11367
- frameLoop();
11368
- }
11849
+ function isRTL$1(element) {
11850
+ return getComputedStyle$2(element).direction === 'rtl';
11851
+ }
11369
11852
 
11370
- function frameLoop() {
11371
- const nextRefRect = getBoundingClientRect(reference);
11853
+ const platform$1 = {
11854
+ convertOffsetParentRelativeRectToViewportRelativeRect: convertOffsetParentRelativeRectToViewportRelativeRect$1,
11855
+ getDocumentElement: getDocumentElement$1,
11856
+ getClippingRect: getClippingRect$1,
11857
+ getOffsetParent: getOffsetParent$1,
11858
+ getElementRects,
11859
+ getClientRects,
11860
+ getDimensions: getDimensions$1,
11861
+ getScale,
11862
+ isElement: isElement$1,
11863
+ isRTL: isRTL$1
11864
+ };
11372
11865
 
11373
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
11374
- update();
11375
- }
11866
+ /**
11867
+ * Modifies the placement by translating the floating element along the
11868
+ * specified axes.
11869
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
11870
+ * object may be passed.
11871
+ * @see https://floating-ui.com/docs/offset
11872
+ */
11873
+ offset$1;
11376
11874
 
11377
- prevRefRect = nextRefRect;
11378
- frameId = requestAnimationFrame(frameLoop);
11379
- }
11875
+ /**
11876
+ * Optimizes the visibility of the floating element by choosing the placement
11877
+ * that has the most space available automatically, without needing to specify a
11878
+ * preferred placement. Alternative to `flip`.
11879
+ * @see https://floating-ui.com/docs/autoPlacement
11880
+ */
11881
+ autoPlacement;
11380
11882
 
11381
- update();
11382
- return () => {
11383
- var _observer;
11883
+ /**
11884
+ * Optimizes the visibility of the floating element by shifting it in order to
11885
+ * keep it in view when it will overflow the clipping boundary.
11886
+ * @see https://floating-ui.com/docs/shift
11887
+ */
11888
+ shift$1;
11384
11889
 
11385
- ancestors.forEach(ancestor => {
11386
- ancestorScroll && ancestor.removeEventListener('scroll', update);
11387
- ancestorResize && ancestor.removeEventListener('resize', update);
11388
- });
11389
- (_observer = observer) == null ? void 0 : _observer.disconnect();
11390
- observer = null;
11890
+ /**
11891
+ * Optimizes the visibility of the floating element by flipping the `placement`
11892
+ * in order to keep it in view when the preferred placement(s) will overflow the
11893
+ * clipping boundary. Alternative to `autoPlacement`.
11894
+ * @see https://floating-ui.com/docs/flip
11895
+ */
11896
+ flip$1;
11391
11897
 
11392
- if (animationFrame) {
11393
- cancelAnimationFrame(frameId);
11394
- }
11395
- };
11396
- }
11898
+ /**
11899
+ * Provides data that allows you to change the size of the floating element —
11900
+ * for instance, prevent it from overflowing the clipping boundary or match the
11901
+ * width of the reference element.
11902
+ * @see https://floating-ui.com/docs/size
11903
+ */
11904
+ size;
11397
11905
 
11398
11906
  /**
11399
- * Computes the `x` and `y` coordinates that will place the floating element
11400
- * next to a reference element when it is given a certain CSS positioning
11401
- * strategy.
11907
+ * Provides data to hide the floating element in applicable situations, such as
11908
+ * when it is not in the same clipping context as the reference element.
11909
+ * @see https://floating-ui.com/docs/hide
11402
11910
  */
11911
+ hide;
11403
11912
 
11404
- const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
11405
- platform,
11406
- ...options
11407
- });
11913
+ /**
11914
+ * Provides data to position an inner element of the floating element so that it
11915
+ * appears centered to the reference element.
11916
+ * @see https://floating-ui.com/docs/arrow
11917
+ */
11918
+ const arrow$1 = arrow$2;
11919
+
11920
+ /**
11921
+ * Provides improved positioning for inline reference elements that can span
11922
+ * over multiple lines, such as hyperlinks or range selections.
11923
+ * @see https://floating-ui.com/docs/inline
11924
+ */
11925
+ inline;
11926
+
11927
+ /**
11928
+ * Built-in `limiter` that will stop `shift()` at a certain point.
11929
+ */
11930
+ limitShift;
11931
+
11932
+ /**
11933
+ * Computes the `x` and `y` coordinates that will place the floating element
11934
+ * next to a given reference element.
11935
+ */
11936
+ const computePosition$2 = (reference, floating, options) => {
11937
+ // This caches the expensive `getClippingElementAncestors` function so that
11938
+ // multiple lifecycle resets re-use the same result. It only lives for a
11939
+ // single call. If other functions become expensive, we can add them as well.
11940
+ const cache = new Map();
11941
+ const mergedOptions = {
11942
+ platform: platform$1,
11943
+ ...options
11944
+ };
11945
+ const platformWithCache = {
11946
+ ...mergedOptions.platform,
11947
+ _c: cache
11948
+ };
11949
+ return computePosition$3(reference, floating, {
11950
+ ...mergedOptions,
11951
+ platform: platformWithCache
11952
+ });
11953
+ };
11408
11954
 
11409
11955
  const useFloatingProps = buildProps({});
11410
11956
  const unrefReference = (elRef) => {
@@ -11445,7 +11991,7 @@
11445
11991
  const contentEl = unrefElement(contentRef);
11446
11992
  if (!referenceEl || !contentEl)
11447
11993
  return;
11448
- const data = await computePosition(referenceEl, contentEl, {
11994
+ const data = await computePosition$2(referenceEl, contentEl, {
11449
11995
  placement: vue.unref(placement),
11450
11996
  strategy: vue.unref(strategy),
11451
11997
  middleware: vue.unref(middleware)
@@ -11480,7 +12026,7 @@
11480
12026
  const arrowEl = vue.unref(arrowRef);
11481
12027
  if (!arrowEl)
11482
12028
  return {};
11483
- return arrow({
12029
+ return arrow$1({
11484
12030
  element: arrowEl,
11485
12031
  padding
11486
12032
  }).fn(args);
@@ -11848,6 +12394,9 @@
11848
12394
  card: {
11849
12395
  type: definePropType(Object)
11850
12396
  },
12397
+ dialog: {
12398
+ type: definePropType(Object)
12399
+ },
11851
12400
  link: {
11852
12401
  type: definePropType(Object)
11853
12402
  },
@@ -11885,7 +12434,7 @@
11885
12434
 
11886
12435
  const ElConfigProvider = withInstall(ConfigProvider);
11887
12436
 
11888
- const version$1 = "2.10.6";
12437
+ const version$1 = "2.10.7";
11889
12438
 
11890
12439
  const makeInstaller = (components = []) => {
11891
12440
  const install = (app, options) => {
@@ -14101,10 +14650,10 @@
14101
14650
  return { contextStyle, paddingSize, borderSize, boxSizing };
14102
14651
  }
14103
14652
  function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
14104
- var _a;
14653
+ var _a, _b;
14105
14654
  if (!hiddenTextarea) {
14106
14655
  hiddenTextarea = document.createElement("textarea");
14107
- document.body.appendChild(hiddenTextarea);
14656
+ ((_a = targetElement.parentNode) != null ? _a : document.body).appendChild(hiddenTextarea);
14108
14657
  }
14109
14658
  const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
14110
14659
  contextStyle.forEach(([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value));
@@ -14135,7 +14684,7 @@
14135
14684
  height = Math.min(maxHeight, height);
14136
14685
  }
14137
14686
  result.height = `${height}px`;
14138
- (_a = hiddenTextarea.parentNode) == null ? void 0 : _a.removeChild(hiddenTextarea);
14687
+ (_b = hiddenTextarea.parentNode) == null ? void 0 : _b.removeChild(hiddenTextarea);
14139
14688
  hiddenTextarea = void 0;
14140
14689
  return result;
14141
14690
  }
@@ -14977,6 +15526,7 @@
14977
15526
  const props = __props;
14978
15527
  const ns = useNamespace("scrollbar");
14979
15528
  let stopResizeObserver = void 0;
15529
+ let stopWrapResizeObserver = void 0;
14980
15530
  let stopResizeListener = void 0;
14981
15531
  let wrapScrollTop = 0;
14982
15532
  let wrapScrollLeft = 0;
@@ -15093,9 +15643,11 @@
15093
15643
  vue.watch(() => props.noresize, (noresize) => {
15094
15644
  if (noresize) {
15095
15645
  stopResizeObserver == null ? void 0 : stopResizeObserver();
15646
+ stopWrapResizeObserver == null ? void 0 : stopWrapResizeObserver();
15096
15647
  stopResizeListener == null ? void 0 : stopResizeListener();
15097
15648
  } else {
15098
15649
  ({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
15650
+ ({ stop: stopWrapResizeObserver } = useResizeObserver(wrapRef, update));
15099
15651
  stopResizeListener = useEventListener("resize", update);
15100
15652
  }
15101
15653
  }, { immediate: true });
@@ -15399,7 +15951,7 @@
15399
15951
  vue.watch(triggerRef, (el, prevEl) => {
15400
15952
  virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
15401
15953
  virtualTriggerAriaStopWatch = void 0;
15402
- if (isElement$1(el)) {
15954
+ if (isElement$2(el)) {
15403
15955
  TRIGGER_ELE_EVENTS.forEach((eventName) => {
15404
15956
  var _a;
15405
15957
  const handler = props[eventName];
@@ -15421,7 +15973,7 @@
15421
15973
  }, { immediate: true });
15422
15974
  }
15423
15975
  }
15424
- if (isElement$1(prevEl) && isFocusable(prevEl)) {
15976
+ if (isElement$2(prevEl) && isFocusable(prevEl)) {
15425
15977
  [
15426
15978
  "aria-controls",
15427
15979
  "aria-describedby",
@@ -15436,7 +15988,7 @@
15436
15988
  vue.onBeforeUnmount(() => {
15437
15989
  virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
15438
15990
  virtualTriggerAriaStopWatch = void 0;
15439
- if (triggerRef.value && isElement$1(triggerRef.value)) {
15991
+ if (triggerRef.value && isElement$2(triggerRef.value)) {
15440
15992
  const el = triggerRef.value;
15441
15993
  TRIGGER_ELE_EVENTS.forEach((eventName) => {
15442
15994
  const handler = props[eventName];
@@ -15531,7 +16083,7 @@
15531
16083
  if (element && element.focus) {
15532
16084
  const prevFocusedElement = document.activeElement;
15533
16085
  let cleanup = false;
15534
- if (isElement$1(element) && !isFocusable(element) && !element.getAttribute("tabindex")) {
16086
+ if (isElement$2(element) && !isFocusable(element) && !element.getAttribute("tabindex")) {
15535
16087
  element.setAttribute("tabindex", "-1");
15536
16088
  cleanup = true;
15537
16089
  }
@@ -15540,7 +16092,7 @@
15540
16092
  if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
15541
16093
  element.select();
15542
16094
  }
15543
- if (isElement$1(element) && cleanup) {
16095
+ if (isElement$2(element) && cleanup) {
15544
16096
  element.removeAttribute("tabindex");
15545
16097
  }
15546
16098
  }
@@ -16226,14 +16778,14 @@
16226
16778
  triggerTargetAriaStopWatch = void 0;
16227
16779
  const el = vue.unref(triggerTargetEl || contentRef.value);
16228
16780
  const prevEl = vue.unref(prevTriggerTargetEl || contentRef.value);
16229
- if (isElement$1(el)) {
16781
+ if (isElement$2(el)) {
16230
16782
  triggerTargetAriaStopWatch = vue.watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
16231
16783
  ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
16232
16784
  isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
16233
16785
  });
16234
16786
  }, { immediate: true });
16235
16787
  }
16236
- if (prevEl !== el && isElement$1(prevEl)) {
16788
+ if (prevEl !== el && isElement$2(prevEl)) {
16237
16789
  ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
16238
16790
  prevEl.removeAttribute(key);
16239
16791
  });
@@ -18338,6 +18890,10 @@
18338
18890
  this.roundA = Math.round(100 * this.a) / 100;
18339
18891
  return this;
18340
18892
  };
18893
+ TinyColor2.prototype.isMonochrome = function() {
18894
+ var s = this.toHsl().s;
18895
+ return s === 0;
18896
+ };
18341
18897
  TinyColor2.prototype.toHsv = function() {
18342
18898
  var hsv = rgbToHsv(this.r, this.g, this.b);
18343
18899
  return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
@@ -18384,6 +18940,12 @@
18384
18940
  }
18385
18941
  return "#" + this.toHex8(allow4Char);
18386
18942
  };
18943
+ TinyColor2.prototype.toHexShortString = function(allowShortChar) {
18944
+ if (allowShortChar === void 0) {
18945
+ allowShortChar = false;
18946
+ }
18947
+ return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
18948
+ };
18387
18949
  TinyColor2.prototype.toRgb = function() {
18388
18950
  return {
18389
18951
  r: Math.round(this.r),
@@ -18609,10 +19171,12 @@
18609
19171
  TinyColor2.prototype.onBackground = function(background) {
18610
19172
  var fg = this.toRgb();
18611
19173
  var bg = new TinyColor2(background).toRgb();
19174
+ var alpha = fg.a + bg.a * (1 - fg.a);
18612
19175
  return new TinyColor2({
18613
- r: bg.r + (fg.r - bg.r) * fg.a,
18614
- g: bg.g + (fg.g - bg.g) * fg.a,
18615
- b: bg.b + (fg.b - bg.b) * fg.a
19176
+ r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
19177
+ g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
19178
+ b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
19179
+ a: alpha
18616
19180
  });
18617
19181
  };
18618
19182
  TinyColor2.prototype.triad = function() {
@@ -20313,7 +20877,7 @@
20313
20877
  let excludes = [];
20314
20878
  if (isArray$1(binding.arg)) {
20315
20879
  excludes = binding.arg;
20316
- } else if (isElement$1(binding.arg)) {
20880
+ } else if (isElement$2(binding.arg)) {
20317
20881
  excludes.push(binding.arg);
20318
20882
  }
20319
20883
  return function(mouseup, mousedown) {
@@ -23871,7 +24435,7 @@
23871
24435
  }
23872
24436
  return nodes;
23873
24437
  };
23874
- class Node$2 {
24438
+ class Node$3 {
23875
24439
  constructor(data, config, parent, root = false) {
23876
24440
  this.data = data;
23877
24441
  this.config = config;
@@ -23891,7 +24455,7 @@
23891
24455
  this.pathValues = pathNodes.map((node) => node.value);
23892
24456
  this.pathLabels = pathNodes.map((node) => node.label);
23893
24457
  this.childrenData = childrenData;
23894
- this.children = (childrenData || []).map((child) => new Node$2(child, config, this));
24458
+ this.children = (childrenData || []).map((child) => new Node$3(child, config, this));
23895
24459
  this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
23896
24460
  this.text = "";
23897
24461
  }
@@ -23912,7 +24476,7 @@
23912
24476
  }
23913
24477
  appendChild(childData) {
23914
24478
  const { childrenData, children } = this;
23915
- const node = new Node$2(childData, this.config, this);
24479
+ const node = new Node$3(childData, this.config, this);
23916
24480
  if (isArray$1(childrenData)) {
23917
24481
  childrenData.push(childData);
23918
24482
  } else {
@@ -23976,7 +24540,7 @@
23976
24540
  }
23977
24541
  }
23978
24542
  }
23979
- var Node$3 = Node$2;
24543
+ var Node$4 = Node$3;
23980
24544
 
23981
24545
  const flatNodes = (nodes, leafOnly) => {
23982
24546
  return nodes.reduce((res, node) => {
@@ -23992,7 +24556,7 @@
23992
24556
  class Store {
23993
24557
  constructor(data, config) {
23994
24558
  this.config = config;
23995
- const nodes = (data || []).map((nodeData) => new Node$3(nodeData, this.config));
24559
+ const nodes = (data || []).map((nodeData) => new Node$4(nodeData, this.config));
23996
24560
  this.nodes = nodes;
23997
24561
  this.allNodes = flatNodes(nodes, false);
23998
24562
  this.leafNodes = flatNodes(nodes, true);
@@ -24004,7 +24568,7 @@
24004
24568
  return leafOnly ? this.leafNodes : this.allNodes;
24005
24569
  }
24006
24570
  appendNode(nodeData, parentNode) {
24007
- const node = parentNode ? parentNode.appendChild(nodeData) : new Node$3(nodeData, this.config);
24571
+ const node = parentNode ? parentNode.appendChild(nodeData) : new Node$4(nodeData, this.config);
24008
24572
  if (!parentNode)
24009
24573
  this.nodes.push(node);
24010
24574
  this.appendAllNodesAndLeafNodes(node);
@@ -24166,7 +24730,7 @@
24166
24730
  };
24167
24731
  const lazyLoad = (node, cb) => {
24168
24732
  const cfg = config.value;
24169
- node = node || new Node$3({}, cfg, void 0, true);
24733
+ node = node || new Node$4({}, cfg, void 0, true);
24170
24734
  node.loading = true;
24171
24735
  const resolve = (dataList) => {
24172
24736
  const _node = node;
@@ -29415,6 +29979,7 @@
29415
29979
  vue.watch([maxDate, minDate], ([max, min]) => {
29416
29980
  if (max && min) {
29417
29981
  handleRangeConfirm(shouldBeVisible);
29982
+ shouldBeVisible = true;
29418
29983
  }
29419
29984
  });
29420
29985
  const minTimePickerVisible = vue.ref(false);
@@ -31152,12 +31717,21 @@
31152
31717
 
31153
31718
  const dialogContentProps = buildProps({
31154
31719
  center: Boolean,
31155
- alignCenter: Boolean,
31720
+ alignCenter: {
31721
+ type: Boolean,
31722
+ default: void 0
31723
+ },
31156
31724
  closeIcon: {
31157
31725
  type: iconPropType
31158
31726
  },
31159
- draggable: Boolean,
31160
- overflow: Boolean,
31727
+ draggable: {
31728
+ type: Boolean,
31729
+ default: void 0
31730
+ },
31731
+ overflow: {
31732
+ type: Boolean,
31733
+ default: void 0
31734
+ },
31161
31735
  fullscreen: Boolean,
31162
31736
  headerClass: String,
31163
31737
  bodyClass: String,
@@ -31193,13 +31767,13 @@
31193
31767
  const dialogKls = vue.computed(() => [
31194
31768
  ns.b(),
31195
31769
  ns.is("fullscreen", props.fullscreen),
31196
- ns.is("draggable", props.draggable),
31197
- ns.is("align-center", props.alignCenter),
31770
+ ns.is("draggable", !!props.draggable),
31771
+ ns.is("align-center", !!props.alignCenter),
31198
31772
  { [ns.m("center")]: props.center }
31199
31773
  ]);
31200
31774
  const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
31201
- const draggable = vue.computed(() => props.draggable);
31202
- const overflow = vue.computed(() => props.overflow);
31775
+ const draggable = vue.computed(() => !!props.draggable);
31776
+ const overflow = vue.computed(() => !!props.overflow);
31203
31777
  const { resetPosition, updatePosition } = useDraggable(dialogRef, headerRef, draggable, overflow);
31204
31778
  expose({
31205
31779
  resetPosition,
@@ -31316,7 +31890,7 @@
31316
31890
  },
31317
31891
  transition: {
31318
31892
  type: definePropType([String, Object]),
31319
- default: DEFAULT_DIALOG_TRANSITION
31893
+ default: void 0
31320
31894
  }
31321
31895
  });
31322
31896
  const dialogEmits = {
@@ -31328,6 +31902,7 @@
31328
31902
  openAutoFocus: () => true,
31329
31903
  closeAutoFocus: () => true
31330
31904
  };
31905
+ const dialogContextKey = Symbol("dialogContextKey");
31331
31906
 
31332
31907
  const useDialog = (props, targetRef) => {
31333
31908
  var _a;
@@ -31343,7 +31918,15 @@
31343
31918
  const zIndex = vue.ref((_a = props.zIndex) != null ? _a : nextZIndex());
31344
31919
  let openTimer = void 0;
31345
31920
  let closeTimer = void 0;
31346
- const namespace = useGlobalConfig("namespace", defaultNamespace);
31921
+ const config = useGlobalConfig();
31922
+ const namespace = vue.computed(() => {
31923
+ var _a2, _b;
31924
+ return (_b = (_a2 = config.value) == null ? void 0 : _a2.namespace) != null ? _b : defaultNamespace;
31925
+ });
31926
+ const globalConfig = vue.computed(() => {
31927
+ var _a2;
31928
+ return (_a2 = config.value) == null ? void 0 : _a2.dialog;
31929
+ });
31347
31930
  const style = vue.computed(() => {
31348
31931
  const style2 = {};
31349
31932
  const varPrefix = `--${namespace.value}-dialog`;
@@ -31357,21 +31940,35 @@
31357
31940
  }
31358
31941
  return style2;
31359
31942
  });
31943
+ const _draggable = vue.computed(() => {
31944
+ var _a2, _b, _c;
31945
+ return ((_c = (_b = props.draggable) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.draggable) != null ? _c : false) && !props.fullscreen;
31946
+ });
31947
+ const _alignCenter = vue.computed(() => {
31948
+ var _a2, _b, _c;
31949
+ return (_c = (_b = props.alignCenter) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.alignCenter) != null ? _c : false;
31950
+ });
31951
+ const _overflow = vue.computed(() => {
31952
+ var _a2, _b, _c;
31953
+ return (_c = (_b = props.overflow) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.overflow) != null ? _c : false;
31954
+ });
31360
31955
  const overlayDialogStyle = vue.computed(() => {
31361
- if (props.alignCenter) {
31956
+ if (_alignCenter.value) {
31362
31957
  return { display: "flex" };
31363
31958
  }
31364
31959
  return {};
31365
31960
  });
31366
31961
  const transitionConfig = vue.computed(() => {
31962
+ var _a2, _b, _c;
31963
+ const transition = (_c = (_b = props.transition) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.transition) != null ? _c : DEFAULT_DIALOG_TRANSITION;
31367
31964
  const baseConfig = {
31368
- name: props.transition,
31965
+ name: transition,
31369
31966
  onAfterEnter: afterEnter,
31370
31967
  onBeforeLeave: beforeLeave,
31371
31968
  onAfterLeave: afterLeave
31372
31969
  };
31373
- if (isObject$1(props.transition)) {
31374
- const config = { ...props.transition };
31970
+ if (isObject$1(transition)) {
31971
+ const config2 = { ...transition };
31375
31972
  const _mergeHook = (userHook, defaultHook) => {
31376
31973
  return (el) => {
31377
31974
  if (isArray$1(userHook)) {
@@ -31385,13 +31982,13 @@
31385
31982
  defaultHook();
31386
31983
  };
31387
31984
  };
31388
- config.onAfterEnter = _mergeHook(config.onAfterEnter, afterEnter);
31389
- config.onBeforeLeave = _mergeHook(config.onBeforeLeave, beforeLeave);
31390
- config.onAfterLeave = _mergeHook(config.onAfterLeave, afterLeave);
31391
- if (!config.name) {
31392
- config.name = DEFAULT_DIALOG_TRANSITION;
31985
+ config2.onAfterEnter = _mergeHook(config2.onAfterEnter, afterEnter);
31986
+ config2.onBeforeLeave = _mergeHook(config2.onBeforeLeave, beforeLeave);
31987
+ config2.onAfterLeave = _mergeHook(config2.onAfterLeave, afterLeave);
31988
+ if (!config2.name) {
31989
+ config2.name = DEFAULT_DIALOG_TRANSITION;
31393
31990
  }
31394
- return config;
31991
+ return config2;
31395
31992
  }
31396
31993
  return baseConfig;
31397
31994
  });
@@ -31534,7 +32131,10 @@
31534
32131
  rendered,
31535
32132
  visible,
31536
32133
  zIndex,
31537
- transitionConfig
32134
+ transitionConfig,
32135
+ _draggable,
32136
+ _alignCenter,
32137
+ _overflow
31538
32138
  };
31539
32139
  };
31540
32140
 
@@ -31569,6 +32169,9 @@
31569
32169
  rendered,
31570
32170
  transitionConfig,
31571
32171
  zIndex,
32172
+ _draggable,
32173
+ _alignCenter,
32174
+ _overflow,
31572
32175
  handleClose,
31573
32176
  onModalClick,
31574
32177
  onOpenAutoFocus,
@@ -31585,7 +32188,6 @@
31585
32188
  style
31586
32189
  });
31587
32190
  const overlayEvent = useSameTarget(onModalClick);
31588
- const draggable = vue.computed(() => props.draggable && !props.fullscreen);
31589
32191
  const penetrable = vue.computed(() => props.modalPenetrable && !props.modal && !props.fullscreen);
31590
32192
  const resetPosition = () => {
31591
32193
  var _a;
@@ -31646,10 +32248,10 @@
31646
32248
  ref: dialogContentRef
31647
32249
  }, _ctx.$attrs, {
31648
32250
  center: _ctx.center,
31649
- "align-center": _ctx.alignCenter,
32251
+ "align-center": vue.unref(_alignCenter),
31650
32252
  "close-icon": _ctx.closeIcon,
31651
- draggable: vue.unref(draggable),
31652
- overflow: _ctx.overflow,
32253
+ draggable: vue.unref(_draggable),
32254
+ overflow: vue.unref(_overflow),
31653
32255
  fullscreen: _ctx.fullscreen,
31654
32256
  "header-class": _ctx.headerClass,
31655
32257
  "body-class": _ctx.bodyClass,
@@ -33811,7 +34413,7 @@
33811
34413
  return;
33812
34414
  await vue.nextTick();
33813
34415
  const { scrollContainer } = props;
33814
- if (isElement$1(scrollContainer)) {
34416
+ if (isElement$2(scrollContainer)) {
33815
34417
  _scrollContainer.value = scrollContainer;
33816
34418
  } else if (isString$1(scrollContainer) && scrollContainer !== "") {
33817
34419
  _scrollContainer.value = (_a = document.querySelector(scrollContainer)) != null ? _a : void 0;
@@ -36907,7 +37509,7 @@
36907
37509
  const handleClickOutside = (event) => {
36908
37510
  expanded.value = false;
36909
37511
  if (isFocused.value) {
36910
- const _event = new FocusEvent("focus", event);
37512
+ const _event = new FocusEvent("blur", event);
36911
37513
  vue.nextTick(() => handleBlur(_event));
36912
37514
  }
36913
37515
  };
@@ -38543,11 +39145,15 @@
38543
39145
  ...__default__$M,
38544
39146
  props: popconfirmProps,
38545
39147
  emits: popconfirmEmits,
38546
- setup(__props, { emit }) {
39148
+ setup(__props, { expose, emit }) {
38547
39149
  const props = __props;
38548
39150
  const { t } = useLocale();
38549
39151
  const ns = useNamespace("popconfirm");
38550
39152
  const tooltipRef = vue.ref();
39153
+ const popperRef = vue.computed(() => {
39154
+ var _a;
39155
+ return (_a = vue.unref(tooltipRef)) == null ? void 0 : _a.popperRef;
39156
+ });
38551
39157
  const hidePopper = () => {
38552
39158
  var _a, _b;
38553
39159
  (_b = (_a = tooltipRef.value) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
@@ -38567,6 +39173,10 @@
38567
39173
  };
38568
39174
  const finalConfirmButtonText = vue.computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
38569
39175
  const finalCancelButtonText = vue.computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
39176
+ expose({
39177
+ popperRef,
39178
+ hide: hidePopper
39179
+ });
38570
39180
  return (_ctx, _cache) => {
38571
39181
  return vue.openBlock(), vue.createBlock(vue.unref(ElTooltip), vue.mergeProps({
38572
39182
  ref_key: "tooltipRef",
@@ -41085,7 +41695,7 @@
41085
41695
  });
41086
41696
  var FixedSizeGrid$1 = FixedSizeGrid;
41087
41697
 
41088
- const { max, min, floor } = Math;
41698
+ const { max: max$2, min: min$2, floor } = Math;
41089
41699
  const ACCESS_SIZER_KEY_MAP = {
41090
41700
  column: "columnWidth",
41091
41701
  row: "rowHeight"
@@ -41130,7 +41740,7 @@
41130
41740
  high = mid - 1;
41131
41741
  }
41132
41742
  }
41133
- return max(0, low - 1);
41743
+ return max$2(0, low - 1);
41134
41744
  };
41135
41745
  const es = (props, gridCache, idx, offset, type) => {
41136
41746
  const total = type === "column" ? props.totalColumn : props.totalRow;
@@ -41139,7 +41749,7 @@
41139
41749
  idx += exponent;
41140
41750
  exponent *= 2;
41141
41751
  }
41142
- return bs(props, gridCache, floor(idx / 2), min(idx, total - 1), offset, type);
41752
+ return bs(props, gridCache, floor(idx / 2), min$2(idx, total - 1), offset, type);
41143
41753
  };
41144
41754
  const findItem = (props, gridCache, offset, type) => {
41145
41755
  const [cache, lastVisitedIndex] = [
@@ -41150,7 +41760,7 @@
41150
41760
  if (lastVisitedItemOffset >= offset) {
41151
41761
  return bs(props, gridCache, 0, lastVisitedIndex, offset, type);
41152
41762
  }
41153
- return es(props, gridCache, max(0, lastVisitedIndex), offset, type);
41763
+ return es(props, gridCache, max$2(0, lastVisitedIndex), offset, type);
41154
41764
  };
41155
41765
  const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
41156
41766
  let sizeOfVisitedRows = 0;
@@ -41189,8 +41799,8 @@
41189
41799
  ];
41190
41800
  const item = getItemFromCache(props, index, cache, type);
41191
41801
  const estimatedSize = estimatedSizeAssociates(props, cache);
41192
- const maxOffset = max(0, min(estimatedSize - size, item.offset));
41193
- const minOffset = max(0, item.offset - size + scrollBarWidth + item.size);
41802
+ const maxOffset = max$2(0, min$2(estimatedSize - size, item.offset));
41803
+ const minOffset = max$2(0, item.offset - size + scrollBarWidth + item.size);
41194
41804
  if (alignment === SMART_ALIGNMENT) {
41195
41805
  if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
41196
41806
  alignment = AUTO_ALIGNMENT;
@@ -42411,7 +43021,7 @@
42411
43021
  const handleClickOutside = (event) => {
42412
43022
  expanded.value = false;
42413
43023
  if (isFocused.value) {
42414
- const _event = new FocusEvent("focus", event);
43024
+ const _event = new FocusEvent("blur", event);
42415
43025
  handleBlur(_event);
42416
43026
  }
42417
43027
  };
@@ -47142,7 +47752,7 @@
47142
47752
  if (column.children && column.children.length > 0)
47143
47753
  return;
47144
47754
  const el = event.target;
47145
- if (!isElement$1(el)) {
47755
+ if (!isElement$2(el)) {
47146
47756
  return;
47147
47757
  }
47148
47758
  const target = el == null ? void 0 : el.closest("th");
@@ -53267,6 +53877,1297 @@
53267
53877
  });
53268
53878
  var TooltipV2Arrow = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "arrow.vue"]]);
53269
53879
 
53880
+ function getSide(placement) {
53881
+ return placement.split('-')[0];
53882
+ }
53883
+
53884
+ function getAlignment(placement) {
53885
+ return placement.split('-')[1];
53886
+ }
53887
+
53888
+ function getMainAxisFromPlacement(placement) {
53889
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
53890
+ }
53891
+
53892
+ function getLengthFromAxis(axis) {
53893
+ return axis === 'y' ? 'height' : 'width';
53894
+ }
53895
+
53896
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
53897
+ let {
53898
+ reference,
53899
+ floating
53900
+ } = _ref;
53901
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
53902
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
53903
+ const mainAxis = getMainAxisFromPlacement(placement);
53904
+ const length = getLengthFromAxis(mainAxis);
53905
+ const commonAlign = reference[length] / 2 - floating[length] / 2;
53906
+ const side = getSide(placement);
53907
+ const isVertical = mainAxis === 'x';
53908
+ let coords;
53909
+
53910
+ switch (side) {
53911
+ case 'top':
53912
+ coords = {
53913
+ x: commonX,
53914
+ y: reference.y - floating.height
53915
+ };
53916
+ break;
53917
+
53918
+ case 'bottom':
53919
+ coords = {
53920
+ x: commonX,
53921
+ y: reference.y + reference.height
53922
+ };
53923
+ break;
53924
+
53925
+ case 'right':
53926
+ coords = {
53927
+ x: reference.x + reference.width,
53928
+ y: commonY
53929
+ };
53930
+ break;
53931
+
53932
+ case 'left':
53933
+ coords = {
53934
+ x: reference.x - floating.width,
53935
+ y: commonY
53936
+ };
53937
+ break;
53938
+
53939
+ default:
53940
+ coords = {
53941
+ x: reference.x,
53942
+ y: reference.y
53943
+ };
53944
+ }
53945
+
53946
+ switch (getAlignment(placement)) {
53947
+ case 'start':
53948
+ coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
53949
+ break;
53950
+
53951
+ case 'end':
53952
+ coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
53953
+ break;
53954
+ }
53955
+
53956
+ return coords;
53957
+ }
53958
+
53959
+ /**
53960
+ * Computes the `x` and `y` coordinates that will place the floating element
53961
+ * next to a reference element when it is given a certain positioning strategy.
53962
+ *
53963
+ * This export does not have any `platform` interface logic. You will need to
53964
+ * write one for the platform you are using Floating UI with.
53965
+ */
53966
+
53967
+ const computePosition$1 = async (reference, floating, config) => {
53968
+ const {
53969
+ placement = 'bottom',
53970
+ strategy = 'absolute',
53971
+ middleware = [],
53972
+ platform
53973
+ } = config;
53974
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
53975
+
53976
+ let rects = await platform.getElementRects({
53977
+ reference,
53978
+ floating,
53979
+ strategy
53980
+ });
53981
+ let {
53982
+ x,
53983
+ y
53984
+ } = computeCoordsFromPlacement(rects, placement, rtl);
53985
+ let statefulPlacement = placement;
53986
+ let middlewareData = {};
53987
+ let resetCount = 0;
53988
+
53989
+ for (let i = 0; i < middleware.length; i++) {
53990
+ const {
53991
+ name,
53992
+ fn
53993
+ } = middleware[i];
53994
+ const {
53995
+ x: nextX,
53996
+ y: nextY,
53997
+ data,
53998
+ reset
53999
+ } = await fn({
54000
+ x,
54001
+ y,
54002
+ initialPlacement: placement,
54003
+ placement: statefulPlacement,
54004
+ strategy,
54005
+ middlewareData,
54006
+ rects,
54007
+ platform,
54008
+ elements: {
54009
+ reference,
54010
+ floating
54011
+ }
54012
+ });
54013
+ x = nextX != null ? nextX : x;
54014
+ y = nextY != null ? nextY : y;
54015
+ middlewareData = { ...middlewareData,
54016
+ [name]: { ...middlewareData[name],
54017
+ ...data
54018
+ }
54019
+ };
54020
+
54021
+ if (reset && resetCount <= 50) {
54022
+ resetCount++;
54023
+
54024
+ if (typeof reset === 'object') {
54025
+ if (reset.placement) {
54026
+ statefulPlacement = reset.placement;
54027
+ }
54028
+
54029
+ if (reset.rects) {
54030
+ rects = reset.rects === true ? await platform.getElementRects({
54031
+ reference,
54032
+ floating,
54033
+ strategy
54034
+ }) : reset.rects;
54035
+ }
54036
+
54037
+ ({
54038
+ x,
54039
+ y
54040
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
54041
+ }
54042
+
54043
+ i = -1;
54044
+ continue;
54045
+ }
54046
+ }
54047
+
54048
+ return {
54049
+ x,
54050
+ y,
54051
+ placement: statefulPlacement,
54052
+ strategy,
54053
+ middlewareData
54054
+ };
54055
+ };
54056
+
54057
+ function expandPaddingObject(padding) {
54058
+ return {
54059
+ top: 0,
54060
+ right: 0,
54061
+ bottom: 0,
54062
+ left: 0,
54063
+ ...padding
54064
+ };
54065
+ }
54066
+
54067
+ function getSideObjectFromPadding(padding) {
54068
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
54069
+ top: padding,
54070
+ right: padding,
54071
+ bottom: padding,
54072
+ left: padding
54073
+ };
54074
+ }
54075
+
54076
+ function rectToClientRect(rect) {
54077
+ return { ...rect,
54078
+ top: rect.y,
54079
+ left: rect.x,
54080
+ right: rect.x + rect.width,
54081
+ bottom: rect.y + rect.height
54082
+ };
54083
+ }
54084
+
54085
+ /**
54086
+ * Resolves with an object of overflow side offsets that determine how much the
54087
+ * element is overflowing a given clipping boundary.
54088
+ * - positive = overflowing the boundary by that number of pixels
54089
+ * - negative = how many pixels left before it will overflow
54090
+ * - 0 = lies flush with the boundary
54091
+ * @see https://floating-ui.com/docs/detectOverflow
54092
+ */
54093
+ async function detectOverflow(middlewareArguments, options) {
54094
+ var _await$platform$isEle;
54095
+
54096
+ if (options === void 0) {
54097
+ options = {};
54098
+ }
54099
+
54100
+ const {
54101
+ x,
54102
+ y,
54103
+ platform,
54104
+ rects,
54105
+ elements,
54106
+ strategy
54107
+ } = middlewareArguments;
54108
+ const {
54109
+ boundary = 'clippingAncestors',
54110
+ rootBoundary = 'viewport',
54111
+ elementContext = 'floating',
54112
+ altBoundary = false,
54113
+ padding = 0
54114
+ } = options;
54115
+ const paddingObject = getSideObjectFromPadding(padding);
54116
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
54117
+ const element = elements[altBoundary ? altContext : elementContext];
54118
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
54119
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
54120
+ boundary,
54121
+ rootBoundary,
54122
+ strategy
54123
+ }));
54124
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
54125
+ rect: elementContext === 'floating' ? { ...rects.floating,
54126
+ x,
54127
+ y
54128
+ } : rects.reference,
54129
+ offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
54130
+ strategy
54131
+ }) : rects[elementContext]);
54132
+ return {
54133
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
54134
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
54135
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
54136
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
54137
+ };
54138
+ }
54139
+
54140
+ const min$1 = Math.min;
54141
+ const max$1 = Math.max;
54142
+
54143
+ function within(min$1$1, value, max$1$1) {
54144
+ return max$1(min$1$1, min$1(value, max$1$1));
54145
+ }
54146
+
54147
+ /**
54148
+ * Positions an inner element of the floating element such that it is centered
54149
+ * to the reference element.
54150
+ * @see https://floating-ui.com/docs/arrow
54151
+ */
54152
+ const arrow = options => ({
54153
+ name: 'arrow',
54154
+ options,
54155
+
54156
+ async fn(middlewareArguments) {
54157
+ // Since `element` is required, we don't Partial<> the type
54158
+ const {
54159
+ element,
54160
+ padding = 0
54161
+ } = options != null ? options : {};
54162
+ const {
54163
+ x,
54164
+ y,
54165
+ placement,
54166
+ rects,
54167
+ platform
54168
+ } = middlewareArguments;
54169
+
54170
+ if (element == null) {
54171
+
54172
+ return {};
54173
+ }
54174
+
54175
+ const paddingObject = getSideObjectFromPadding(padding);
54176
+ const coords = {
54177
+ x,
54178
+ y
54179
+ };
54180
+ const axis = getMainAxisFromPlacement(placement);
54181
+ const alignment = getAlignment(placement);
54182
+ const length = getLengthFromAxis(axis);
54183
+ const arrowDimensions = await platform.getDimensions(element);
54184
+ const minProp = axis === 'y' ? 'top' : 'left';
54185
+ const maxProp = axis === 'y' ? 'bottom' : 'right';
54186
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
54187
+ const startDiff = coords[axis] - rects.reference[axis];
54188
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
54189
+ let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
54190
+
54191
+ if (clientSize === 0) {
54192
+ clientSize = rects.floating[length];
54193
+ }
54194
+
54195
+ const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
54196
+ // point is outside the floating element's bounds
54197
+
54198
+ const min = paddingObject[minProp];
54199
+ const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
54200
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
54201
+ const offset = within(min, center, max); // Make sure that arrow points at the reference
54202
+
54203
+ const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
54204
+ const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
54205
+ const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
54206
+ return {
54207
+ [axis]: coords[axis] - alignmentOffset,
54208
+ data: {
54209
+ [axis]: offset,
54210
+ centerOffset: center - offset
54211
+ }
54212
+ };
54213
+ }
54214
+
54215
+ });
54216
+
54217
+ const hash$1 = {
54218
+ left: 'right',
54219
+ right: 'left',
54220
+ bottom: 'top',
54221
+ top: 'bottom'
54222
+ };
54223
+ function getOppositePlacement(placement) {
54224
+ return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
54225
+ }
54226
+
54227
+ function getAlignmentSides(placement, rects, rtl) {
54228
+ if (rtl === void 0) {
54229
+ rtl = false;
54230
+ }
54231
+
54232
+ const alignment = getAlignment(placement);
54233
+ const mainAxis = getMainAxisFromPlacement(placement);
54234
+ const length = getLengthFromAxis(mainAxis);
54235
+ let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
54236
+
54237
+ if (rects.reference[length] > rects.floating[length]) {
54238
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
54239
+ }
54240
+
54241
+ return {
54242
+ main: mainAlignmentSide,
54243
+ cross: getOppositePlacement(mainAlignmentSide)
54244
+ };
54245
+ }
54246
+
54247
+ const hash = {
54248
+ start: 'end',
54249
+ end: 'start'
54250
+ };
54251
+ function getOppositeAlignmentPlacement(placement) {
54252
+ return placement.replace(/start|end/g, matched => hash[matched]);
54253
+ }
54254
+
54255
+ function getExpandedPlacements(placement) {
54256
+ const oppositePlacement = getOppositePlacement(placement);
54257
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
54258
+ }
54259
+
54260
+ /**
54261
+ * Changes the placement of the floating element to one that will fit if the
54262
+ * initially specified `placement` does not.
54263
+ * @see https://floating-ui.com/docs/flip
54264
+ */
54265
+ const flip = function (options) {
54266
+ if (options === void 0) {
54267
+ options = {};
54268
+ }
54269
+
54270
+ return {
54271
+ name: 'flip',
54272
+ options,
54273
+
54274
+ async fn(middlewareArguments) {
54275
+ var _middlewareData$flip;
54276
+
54277
+ const {
54278
+ placement,
54279
+ middlewareData,
54280
+ rects,
54281
+ initialPlacement,
54282
+ platform,
54283
+ elements
54284
+ } = middlewareArguments;
54285
+ const {
54286
+ mainAxis: checkMainAxis = true,
54287
+ crossAxis: checkCrossAxis = true,
54288
+ fallbackPlacements: specifiedFallbackPlacements,
54289
+ fallbackStrategy = 'bestFit',
54290
+ flipAlignment = true,
54291
+ ...detectOverflowOptions
54292
+ } = options;
54293
+ const side = getSide(placement);
54294
+ const isBasePlacement = side === initialPlacement;
54295
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
54296
+ const placements = [initialPlacement, ...fallbackPlacements];
54297
+ const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
54298
+ const overflows = [];
54299
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
54300
+
54301
+ if (checkMainAxis) {
54302
+ overflows.push(overflow[side]);
54303
+ }
54304
+
54305
+ if (checkCrossAxis) {
54306
+ const {
54307
+ main,
54308
+ cross
54309
+ } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
54310
+ overflows.push(overflow[main], overflow[cross]);
54311
+ }
54312
+
54313
+ overflowsData = [...overflowsData, {
54314
+ placement,
54315
+ overflows
54316
+ }]; // One or more sides is overflowing
54317
+
54318
+ if (!overflows.every(side => side <= 0)) {
54319
+ var _middlewareData$flip$, _middlewareData$flip2;
54320
+
54321
+ const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
54322
+ const nextPlacement = placements[nextIndex];
54323
+
54324
+ if (nextPlacement) {
54325
+ // Try next placement and re-run the lifecycle
54326
+ return {
54327
+ data: {
54328
+ index: nextIndex,
54329
+ overflows: overflowsData
54330
+ },
54331
+ reset: {
54332
+ placement: nextPlacement
54333
+ }
54334
+ };
54335
+ }
54336
+
54337
+ let resetPlacement = 'bottom';
54338
+
54339
+ switch (fallbackStrategy) {
54340
+ case 'bestFit':
54341
+ {
54342
+ var _overflowsData$map$so;
54343
+
54344
+ const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
54345
+
54346
+ if (placement) {
54347
+ resetPlacement = placement;
54348
+ }
54349
+
54350
+ break;
54351
+ }
54352
+
54353
+ case 'initialPlacement':
54354
+ resetPlacement = initialPlacement;
54355
+ break;
54356
+ }
54357
+
54358
+ if (placement !== resetPlacement) {
54359
+ return {
54360
+ reset: {
54361
+ placement: resetPlacement
54362
+ }
54363
+ };
54364
+ }
54365
+ }
54366
+
54367
+ return {};
54368
+ }
54369
+
54370
+ };
54371
+ };
54372
+
54373
+ async function convertValueToCoords(middlewareArguments, value) {
54374
+ const {
54375
+ placement,
54376
+ platform,
54377
+ elements
54378
+ } = middlewareArguments;
54379
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
54380
+ const side = getSide(placement);
54381
+ const alignment = getAlignment(placement);
54382
+ const isVertical = getMainAxisFromPlacement(placement) === 'x';
54383
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
54384
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
54385
+ const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
54386
+
54387
+ let {
54388
+ mainAxis,
54389
+ crossAxis,
54390
+ alignmentAxis
54391
+ } = typeof rawValue === 'number' ? {
54392
+ mainAxis: rawValue,
54393
+ crossAxis: 0,
54394
+ alignmentAxis: null
54395
+ } : {
54396
+ mainAxis: 0,
54397
+ crossAxis: 0,
54398
+ alignmentAxis: null,
54399
+ ...rawValue
54400
+ };
54401
+
54402
+ if (alignment && typeof alignmentAxis === 'number') {
54403
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
54404
+ }
54405
+
54406
+ return isVertical ? {
54407
+ x: crossAxis * crossAxisMulti,
54408
+ y: mainAxis * mainAxisMulti
54409
+ } : {
54410
+ x: mainAxis * mainAxisMulti,
54411
+ y: crossAxis * crossAxisMulti
54412
+ };
54413
+ }
54414
+ /**
54415
+ * Displaces the floating element from its reference element.
54416
+ * @see https://floating-ui.com/docs/offset
54417
+ */
54418
+
54419
+ const offset = function (value) {
54420
+ if (value === void 0) {
54421
+ value = 0;
54422
+ }
54423
+
54424
+ return {
54425
+ name: 'offset',
54426
+ options: value,
54427
+
54428
+ async fn(middlewareArguments) {
54429
+ const {
54430
+ x,
54431
+ y
54432
+ } = middlewareArguments;
54433
+ const diffCoords = await convertValueToCoords(middlewareArguments, value);
54434
+ return {
54435
+ x: x + diffCoords.x,
54436
+ y: y + diffCoords.y,
54437
+ data: diffCoords
54438
+ };
54439
+ }
54440
+
54441
+ };
54442
+ };
54443
+
54444
+ function getCrossAxis(axis) {
54445
+ return axis === 'x' ? 'y' : 'x';
54446
+ }
54447
+
54448
+ /**
54449
+ * Shifts the floating element in order to keep it in view when it will overflow
54450
+ * a clipping boundary.
54451
+ * @see https://floating-ui.com/docs/shift
54452
+ */
54453
+ const shift = function (options) {
54454
+ if (options === void 0) {
54455
+ options = {};
54456
+ }
54457
+
54458
+ return {
54459
+ name: 'shift',
54460
+ options,
54461
+
54462
+ async fn(middlewareArguments) {
54463
+ const {
54464
+ x,
54465
+ y,
54466
+ placement
54467
+ } = middlewareArguments;
54468
+ const {
54469
+ mainAxis: checkMainAxis = true,
54470
+ crossAxis: checkCrossAxis = false,
54471
+ limiter = {
54472
+ fn: _ref => {
54473
+ let {
54474
+ x,
54475
+ y
54476
+ } = _ref;
54477
+ return {
54478
+ x,
54479
+ y
54480
+ };
54481
+ }
54482
+ },
54483
+ ...detectOverflowOptions
54484
+ } = options;
54485
+ const coords = {
54486
+ x,
54487
+ y
54488
+ };
54489
+ const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
54490
+ const mainAxis = getMainAxisFromPlacement(getSide(placement));
54491
+ const crossAxis = getCrossAxis(mainAxis);
54492
+ let mainAxisCoord = coords[mainAxis];
54493
+ let crossAxisCoord = coords[crossAxis];
54494
+
54495
+ if (checkMainAxis) {
54496
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
54497
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
54498
+ const min = mainAxisCoord + overflow[minSide];
54499
+ const max = mainAxisCoord - overflow[maxSide];
54500
+ mainAxisCoord = within(min, mainAxisCoord, max);
54501
+ }
54502
+
54503
+ if (checkCrossAxis) {
54504
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
54505
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
54506
+ const min = crossAxisCoord + overflow[minSide];
54507
+ const max = crossAxisCoord - overflow[maxSide];
54508
+ crossAxisCoord = within(min, crossAxisCoord, max);
54509
+ }
54510
+
54511
+ const limitedCoords = limiter.fn({ ...middlewareArguments,
54512
+ [mainAxis]: mainAxisCoord,
54513
+ [crossAxis]: crossAxisCoord
54514
+ });
54515
+ return { ...limitedCoords,
54516
+ data: {
54517
+ x: limitedCoords.x - x,
54518
+ y: limitedCoords.y - y
54519
+ }
54520
+ };
54521
+ }
54522
+
54523
+ };
54524
+ };
54525
+
54526
+ function isWindow(value) {
54527
+ return value && value.document && value.location && value.alert && value.setInterval;
54528
+ }
54529
+ function getWindow(node) {
54530
+ if (node == null) {
54531
+ return window;
54532
+ }
54533
+
54534
+ if (!isWindow(node)) {
54535
+ const ownerDocument = node.ownerDocument;
54536
+ return ownerDocument ? ownerDocument.defaultView || window : window;
54537
+ }
54538
+
54539
+ return node;
54540
+ }
54541
+
54542
+ function getComputedStyle$1(element) {
54543
+ return getWindow(element).getComputedStyle(element);
54544
+ }
54545
+
54546
+ function getNodeName(node) {
54547
+ return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
54548
+ }
54549
+
54550
+ function getUAString() {
54551
+ const uaData = navigator.userAgentData;
54552
+
54553
+ if (uaData != null && uaData.brands) {
54554
+ return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
54555
+ }
54556
+
54557
+ return navigator.userAgent;
54558
+ }
54559
+
54560
+ function isHTMLElement(value) {
54561
+ return value instanceof getWindow(value).HTMLElement;
54562
+ }
54563
+ function isElement(value) {
54564
+ return value instanceof getWindow(value).Element;
54565
+ }
54566
+ function isNode(value) {
54567
+ return value instanceof getWindow(value).Node;
54568
+ }
54569
+ function isShadowRoot(node) {
54570
+ // Browsers without `ShadowRoot` support
54571
+ if (typeof ShadowRoot === 'undefined') {
54572
+ return false;
54573
+ }
54574
+
54575
+ const OwnElement = getWindow(node).ShadowRoot;
54576
+ return node instanceof OwnElement || node instanceof ShadowRoot;
54577
+ }
54578
+ function isOverflowElement(element) {
54579
+ // Firefox wants us to check `-x` and `-y` variations as well
54580
+ const {
54581
+ overflow,
54582
+ overflowX,
54583
+ overflowY
54584
+ } = getComputedStyle$1(element);
54585
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
54586
+ }
54587
+ function isTableElement(element) {
54588
+ return ['table', 'td', 'th'].includes(getNodeName(element));
54589
+ }
54590
+ function isContainingBlock(element) {
54591
+ // TODO: Try and use feature detection here instead
54592
+ const isFirefox = /firefox/i.test(getUAString());
54593
+ const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
54594
+ // create a containing block.
54595
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
54596
+
54597
+ return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
54598
+ css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
54599
+ }
54600
+ function isLayoutViewport() {
54601
+ // Not Safari
54602
+ return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
54603
+ // • Always-visible scrollbar or not
54604
+ // • Width of <html>, etc.
54605
+ // const vV = win.visualViewport;
54606
+ // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
54607
+ }
54608
+
54609
+ const min = Math.min;
54610
+ const max = Math.max;
54611
+ const round = Math.round;
54612
+
54613
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
54614
+ var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
54615
+
54616
+ if (includeScale === void 0) {
54617
+ includeScale = false;
54618
+ }
54619
+
54620
+ if (isFixedStrategy === void 0) {
54621
+ isFixedStrategy = false;
54622
+ }
54623
+
54624
+ const clientRect = element.getBoundingClientRect();
54625
+ let scaleX = 1;
54626
+ let scaleY = 1;
54627
+
54628
+ if (includeScale && isHTMLElement(element)) {
54629
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
54630
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
54631
+ }
54632
+
54633
+ const win = isElement(element) ? getWindow(element) : window;
54634
+ const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
54635
+ const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
54636
+ const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
54637
+ const width = clientRect.width / scaleX;
54638
+ const height = clientRect.height / scaleY;
54639
+ return {
54640
+ width,
54641
+ height,
54642
+ top: y,
54643
+ right: x + width,
54644
+ bottom: y + height,
54645
+ left: x,
54646
+ x,
54647
+ y
54648
+ };
54649
+ }
54650
+
54651
+ function getDocumentElement(node) {
54652
+ return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
54653
+ }
54654
+
54655
+ function getNodeScroll(element) {
54656
+ if (isElement(element)) {
54657
+ return {
54658
+ scrollLeft: element.scrollLeft,
54659
+ scrollTop: element.scrollTop
54660
+ };
54661
+ }
54662
+
54663
+ return {
54664
+ scrollLeft: element.pageXOffset,
54665
+ scrollTop: element.pageYOffset
54666
+ };
54667
+ }
54668
+
54669
+ function getWindowScrollBarX(element) {
54670
+ // If <html> has a CSS width greater than the viewport, then this will be
54671
+ // incorrect for RTL.
54672
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
54673
+ }
54674
+
54675
+ function isScaled(element) {
54676
+ const rect = getBoundingClientRect(element);
54677
+ return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
54678
+ }
54679
+
54680
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
54681
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
54682
+ const documentElement = getDocumentElement(offsetParent);
54683
+ const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
54684
+ isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
54685
+ let scroll = {
54686
+ scrollLeft: 0,
54687
+ scrollTop: 0
54688
+ };
54689
+ const offsets = {
54690
+ x: 0,
54691
+ y: 0
54692
+ };
54693
+
54694
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
54695
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
54696
+ scroll = getNodeScroll(offsetParent);
54697
+ }
54698
+
54699
+ if (isHTMLElement(offsetParent)) {
54700
+ const offsetRect = getBoundingClientRect(offsetParent, true);
54701
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
54702
+ offsets.y = offsetRect.y + offsetParent.clientTop;
54703
+ } else if (documentElement) {
54704
+ offsets.x = getWindowScrollBarX(documentElement);
54705
+ }
54706
+ }
54707
+
54708
+ return {
54709
+ x: rect.left + scroll.scrollLeft - offsets.x,
54710
+ y: rect.top + scroll.scrollTop - offsets.y,
54711
+ width: rect.width,
54712
+ height: rect.height
54713
+ };
54714
+ }
54715
+
54716
+ function getParentNode(node) {
54717
+ if (getNodeName(node) === 'html') {
54718
+ return node;
54719
+ }
54720
+
54721
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
54722
+ // @ts-ignore
54723
+ node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
54724
+ node.parentNode || ( // DOM Element detected
54725
+ isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
54726
+ getDocumentElement(node) // fallback
54727
+
54728
+ );
54729
+ }
54730
+
54731
+ function getTrueOffsetParent(element) {
54732
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
54733
+ return null;
54734
+ }
54735
+
54736
+ return composedOffsetParent(element);
54737
+ }
54738
+ /**
54739
+ * Polyfills the old offsetParent behavior from before the spec was changed:
54740
+ * https://github.com/w3c/csswg-drafts/issues/159
54741
+ */
54742
+
54743
+
54744
+ function composedOffsetParent(element) {
54745
+ let {
54746
+ offsetParent
54747
+ } = element;
54748
+ let ancestor = element;
54749
+ let foundInsideSlot = false;
54750
+
54751
+ while (ancestor && ancestor !== offsetParent) {
54752
+ const {
54753
+ assignedSlot
54754
+ } = ancestor;
54755
+
54756
+ if (assignedSlot) {
54757
+ let newOffsetParent = assignedSlot.offsetParent;
54758
+
54759
+ if (getComputedStyle$1(assignedSlot).display === 'contents') {
54760
+ const hadStyleAttribute = assignedSlot.hasAttribute('style');
54761
+ const oldDisplay = assignedSlot.style.display;
54762
+ assignedSlot.style.display = getComputedStyle$1(ancestor).display;
54763
+ newOffsetParent = assignedSlot.offsetParent;
54764
+ assignedSlot.style.display = oldDisplay;
54765
+
54766
+ if (!hadStyleAttribute) {
54767
+ assignedSlot.removeAttribute('style');
54768
+ }
54769
+ }
54770
+
54771
+ ancestor = assignedSlot;
54772
+
54773
+ if (offsetParent !== newOffsetParent) {
54774
+ offsetParent = newOffsetParent;
54775
+ foundInsideSlot = true;
54776
+ }
54777
+ } else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
54778
+ break;
54779
+ }
54780
+
54781
+ ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
54782
+ }
54783
+
54784
+ return offsetParent;
54785
+ }
54786
+
54787
+ function getContainingBlock(element) {
54788
+ let currentNode = getParentNode(element);
54789
+
54790
+ if (isShadowRoot(currentNode)) {
54791
+ currentNode = currentNode.host;
54792
+ }
54793
+
54794
+ while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
54795
+ if (isContainingBlock(currentNode)) {
54796
+ return currentNode;
54797
+ } else {
54798
+ const parent = currentNode.parentNode;
54799
+ currentNode = isShadowRoot(parent) ? parent.host : parent;
54800
+ }
54801
+ }
54802
+
54803
+ return null;
54804
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
54805
+ // such as table ancestors and cross browser bugs.
54806
+
54807
+
54808
+ function getOffsetParent(element) {
54809
+ const window = getWindow(element);
54810
+ let offsetParent = getTrueOffsetParent(element);
54811
+
54812
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
54813
+ offsetParent = getTrueOffsetParent(offsetParent);
54814
+ }
54815
+
54816
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
54817
+ return window;
54818
+ }
54819
+
54820
+ return offsetParent || getContainingBlock(element) || window;
54821
+ }
54822
+
54823
+ function getDimensions(element) {
54824
+ if (isHTMLElement(element)) {
54825
+ return {
54826
+ width: element.offsetWidth,
54827
+ height: element.offsetHeight
54828
+ };
54829
+ }
54830
+
54831
+ const rect = getBoundingClientRect(element);
54832
+ return {
54833
+ width: rect.width,
54834
+ height: rect.height
54835
+ };
54836
+ }
54837
+
54838
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
54839
+ let {
54840
+ rect,
54841
+ offsetParent,
54842
+ strategy
54843
+ } = _ref;
54844
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
54845
+ const documentElement = getDocumentElement(offsetParent);
54846
+
54847
+ if (offsetParent === documentElement) {
54848
+ return rect;
54849
+ }
54850
+
54851
+ let scroll = {
54852
+ scrollLeft: 0,
54853
+ scrollTop: 0
54854
+ };
54855
+ const offsets = {
54856
+ x: 0,
54857
+ y: 0
54858
+ };
54859
+
54860
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
54861
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
54862
+ scroll = getNodeScroll(offsetParent);
54863
+ }
54864
+
54865
+ if (isHTMLElement(offsetParent)) {
54866
+ const offsetRect = getBoundingClientRect(offsetParent, true);
54867
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
54868
+ offsets.y = offsetRect.y + offsetParent.clientTop;
54869
+ } // This doesn't appear to be need to be negated.
54870
+ // else if (documentElement) {
54871
+ // offsets.x = getWindowScrollBarX(documentElement);
54872
+ // }
54873
+
54874
+ }
54875
+
54876
+ return { ...rect,
54877
+ x: rect.x - scroll.scrollLeft + offsets.x,
54878
+ y: rect.y - scroll.scrollTop + offsets.y
54879
+ };
54880
+ }
54881
+
54882
+ function getViewportRect(element, strategy) {
54883
+ const win = getWindow(element);
54884
+ const html = getDocumentElement(element);
54885
+ const visualViewport = win.visualViewport;
54886
+ let width = html.clientWidth;
54887
+ let height = html.clientHeight;
54888
+ let x = 0;
54889
+ let y = 0;
54890
+
54891
+ if (visualViewport) {
54892
+ width = visualViewport.width;
54893
+ height = visualViewport.height;
54894
+ const layoutViewport = isLayoutViewport();
54895
+
54896
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
54897
+ x = visualViewport.offsetLeft;
54898
+ y = visualViewport.offsetTop;
54899
+ }
54900
+ }
54901
+
54902
+ return {
54903
+ width,
54904
+ height,
54905
+ x,
54906
+ y
54907
+ };
54908
+ }
54909
+
54910
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
54911
+
54912
+ function getDocumentRect(element) {
54913
+ var _element$ownerDocumen;
54914
+
54915
+ const html = getDocumentElement(element);
54916
+ const scroll = getNodeScroll(element);
54917
+ const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
54918
+ const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
54919
+ const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
54920
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
54921
+ const y = -scroll.scrollTop;
54922
+
54923
+ if (getComputedStyle$1(body || html).direction === 'rtl') {
54924
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
54925
+ }
54926
+
54927
+ return {
54928
+ width,
54929
+ height,
54930
+ x,
54931
+ y
54932
+ };
54933
+ }
54934
+
54935
+ function getNearestOverflowAncestor(node) {
54936
+ const parentNode = getParentNode(node);
54937
+
54938
+ if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
54939
+ // @ts-ignore assume body is always available
54940
+ return node.ownerDocument.body;
54941
+ }
54942
+
54943
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
54944
+ return parentNode;
54945
+ }
54946
+
54947
+ return getNearestOverflowAncestor(parentNode);
54948
+ }
54949
+
54950
+ function getOverflowAncestors(node, list) {
54951
+ var _node$ownerDocument;
54952
+
54953
+ if (list === void 0) {
54954
+ list = [];
54955
+ }
54956
+
54957
+ const scrollableAncestor = getNearestOverflowAncestor(node);
54958
+ const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
54959
+ const win = getWindow(scrollableAncestor);
54960
+ const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
54961
+ const updatedList = list.concat(target);
54962
+ return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
54963
+ updatedList.concat(getOverflowAncestors(target));
54964
+ }
54965
+
54966
+ function contains(parent, child) {
54967
+ const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
54968
+
54969
+ if (parent.contains(child)) {
54970
+ return true;
54971
+ } // then fallback to custom implementation with Shadow DOM support
54972
+ else if (rootNode && isShadowRoot(rootNode)) {
54973
+ let next = child;
54974
+
54975
+ do {
54976
+ // use `===` replace node.isSameNode()
54977
+ if (next && parent === next) {
54978
+ return true;
54979
+ } // @ts-ignore: need a better way to handle this...
54980
+
54981
+
54982
+ next = next.parentNode || next.host;
54983
+ } while (next);
54984
+ }
54985
+
54986
+ return false;
54987
+ }
54988
+
54989
+ function getInnerBoundingClientRect(element, strategy) {
54990
+ const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
54991
+ const top = clientRect.top + element.clientTop;
54992
+ const left = clientRect.left + element.clientLeft;
54993
+ return {
54994
+ top,
54995
+ left,
54996
+ x: left,
54997
+ y: top,
54998
+ right: left + element.clientWidth,
54999
+ bottom: top + element.clientHeight,
55000
+ width: element.clientWidth,
55001
+ height: element.clientHeight
55002
+ };
55003
+ }
55004
+
55005
+ function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
55006
+ if (clippingParent === 'viewport') {
55007
+ return rectToClientRect(getViewportRect(element, strategy));
55008
+ }
55009
+
55010
+ if (isElement(clippingParent)) {
55011
+ return getInnerBoundingClientRect(clippingParent, strategy);
55012
+ }
55013
+
55014
+ return rectToClientRect(getDocumentRect(getDocumentElement(element)));
55015
+ } // A "clipping ancestor" is an overflowable container with the characteristic of
55016
+ // clipping (or hiding) overflowing elements with a position different from
55017
+ // `initial`
55018
+
55019
+
55020
+ function getClippingAncestors(element) {
55021
+ const clippingAncestors = getOverflowAncestors(element);
55022
+ const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
55023
+ const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
55024
+
55025
+ if (!isElement(clipperElement)) {
55026
+ return [];
55027
+ } // @ts-ignore isElement check ensures we return Array<Element>
55028
+
55029
+
55030
+ return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
55031
+ } // Gets the maximum area that the element is visible in due to any number of
55032
+ // clipping ancestors
55033
+
55034
+
55035
+ function getClippingRect(_ref) {
55036
+ let {
55037
+ element,
55038
+ boundary,
55039
+ rootBoundary,
55040
+ strategy
55041
+ } = _ref;
55042
+ const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
55043
+ const clippingAncestors = [...mainClippingAncestors, rootBoundary];
55044
+ const firstClippingAncestor = clippingAncestors[0];
55045
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
55046
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
55047
+ accRect.top = max(rect.top, accRect.top);
55048
+ accRect.right = min(rect.right, accRect.right);
55049
+ accRect.bottom = min(rect.bottom, accRect.bottom);
55050
+ accRect.left = max(rect.left, accRect.left);
55051
+ return accRect;
55052
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
55053
+ return {
55054
+ width: clippingRect.right - clippingRect.left,
55055
+ height: clippingRect.bottom - clippingRect.top,
55056
+ x: clippingRect.left,
55057
+ y: clippingRect.top
55058
+ };
55059
+ }
55060
+
55061
+ const platform = {
55062
+ getClippingRect,
55063
+ convertOffsetParentRelativeRectToViewportRelativeRect,
55064
+ isElement,
55065
+ getDimensions,
55066
+ getOffsetParent,
55067
+ getDocumentElement,
55068
+ getElementRects: _ref => {
55069
+ let {
55070
+ reference,
55071
+ floating,
55072
+ strategy
55073
+ } = _ref;
55074
+ return {
55075
+ reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
55076
+ floating: { ...getDimensions(floating),
55077
+ x: 0,
55078
+ y: 0
55079
+ }
55080
+ };
55081
+ },
55082
+ getClientRects: element => Array.from(element.getClientRects()),
55083
+ isRTL: element => getComputedStyle$1(element).direction === 'rtl'
55084
+ };
55085
+
55086
+ /**
55087
+ * Automatically updates the position of the floating element when necessary.
55088
+ * @see https://floating-ui.com/docs/autoUpdate
55089
+ */
55090
+ function autoUpdate(reference, floating, update, options) {
55091
+ if (options === void 0) {
55092
+ options = {};
55093
+ }
55094
+
55095
+ const {
55096
+ ancestorScroll: _ancestorScroll = true,
55097
+ ancestorResize: _ancestorResize = true,
55098
+ elementResize = true,
55099
+ animationFrame = false
55100
+ } = options;
55101
+ const ancestorScroll = _ancestorScroll && !animationFrame;
55102
+ const ancestorResize = _ancestorResize && !animationFrame;
55103
+ const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
55104
+ ancestors.forEach(ancestor => {
55105
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
55106
+ passive: true
55107
+ });
55108
+ ancestorResize && ancestor.addEventListener('resize', update);
55109
+ });
55110
+ let observer = null;
55111
+
55112
+ if (elementResize) {
55113
+ let initialUpdate = true;
55114
+ observer = new ResizeObserver(() => {
55115
+ if (!initialUpdate) {
55116
+ update();
55117
+ }
55118
+
55119
+ initialUpdate = false;
55120
+ });
55121
+ isElement(reference) && !animationFrame && observer.observe(reference);
55122
+ observer.observe(floating);
55123
+ }
55124
+
55125
+ let frameId;
55126
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
55127
+
55128
+ if (animationFrame) {
55129
+ frameLoop();
55130
+ }
55131
+
55132
+ function frameLoop() {
55133
+ const nextRefRect = getBoundingClientRect(reference);
55134
+
55135
+ if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
55136
+ update();
55137
+ }
55138
+
55139
+ prevRefRect = nextRefRect;
55140
+ frameId = requestAnimationFrame(frameLoop);
55141
+ }
55142
+
55143
+ update();
55144
+ return () => {
55145
+ var _observer;
55146
+
55147
+ ancestors.forEach(ancestor => {
55148
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
55149
+ ancestorResize && ancestor.removeEventListener('resize', update);
55150
+ });
55151
+ (_observer = observer) == null ? void 0 : _observer.disconnect();
55152
+ observer = null;
55153
+
55154
+ if (animationFrame) {
55155
+ cancelAnimationFrame(frameId);
55156
+ }
55157
+ };
55158
+ }
55159
+
55160
+ /**
55161
+ * Computes the `x` and `y` coordinates that will place the floating element
55162
+ * next to a reference element when it is given a certain CSS positioning
55163
+ * strategy.
55164
+ */
55165
+
55166
+ const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
55167
+ platform,
55168
+ ...options
55169
+ });
55170
+
53270
55171
  const visualHiddenProps = buildProps({
53271
55172
  style: {
53272
55173
  type: definePropType([String, Object, Array]),
@@ -54199,7 +56100,7 @@
54199
56100
  });
54200
56101
  };
54201
56102
  let nodeIdSeed = 0;
54202
- class Node {
56103
+ class Node$1 {
54203
56104
  constructor(options) {
54204
56105
  this.isLeafByUser = void 0;
54205
56106
  this.isLeaf = void 0;
@@ -54330,7 +56231,7 @@
54330
56231
  insertChild(child, index, batch) {
54331
56232
  if (!child)
54332
56233
  throw new Error("InsertChild error: child is required.");
54333
- if (!(child instanceof Node)) {
56234
+ if (!(child instanceof Node$1)) {
54334
56235
  if (!batch) {
54335
56236
  const children = this.getChildren(true);
54336
56237
  if (!(children == null ? void 0 : children.includes(child.data))) {
@@ -54345,8 +56246,8 @@
54345
56246
  parent: this,
54346
56247
  store: this.store
54347
56248
  });
54348
- child = vue.reactive(new Node(child));
54349
- if (child instanceof Node) {
56249
+ child = vue.reactive(new Node$1(child));
56250
+ if (child instanceof Node$1) {
54350
56251
  child.initialize();
54351
56252
  }
54352
56253
  }
@@ -54580,7 +56481,7 @@
54580
56481
  reInitChecked(this);
54581
56482
  }
54582
56483
  }
54583
- var Node$1 = Node;
56484
+ var Node$2 = Node$1;
54584
56485
 
54585
56486
  class TreeStore {
54586
56487
  constructor(options) {
@@ -54599,7 +56500,7 @@
54599
56500
  this.nodesMap = {};
54600
56501
  }
54601
56502
  initialize() {
54602
- this.root = new Node$1({
56503
+ this.root = new Node$2({
54603
56504
  data: this.data,
54604
56505
  store: this
54605
56506
  });
@@ -54657,7 +56558,7 @@
54657
56558
  }
54658
56559
  }
54659
56560
  getNode(data) {
54660
- if (data instanceof Node$1)
56561
+ if (data instanceof Node$2)
54661
56562
  return data;
54662
56563
  const key = isObject$1(data) ? getNodeKey(this.key, data) : data;
54663
56564
  return this.nodesMap[key] || null;
@@ -55135,7 +57036,7 @@
55135
57036
  },
55136
57037
  props: {
55137
57038
  node: {
55138
- type: Node$1,
57039
+ type: Node$2,
55139
57040
  default: () => ({})
55140
57041
  },
55141
57042
  props: {
@@ -61780,7 +63681,7 @@
61780
63681
  normalized.appendTo = document.body;
61781
63682
  } else if (isString$1(normalized.appendTo)) {
61782
63683
  let appendTo = document.querySelector(normalized.appendTo);
61783
- if (!isElement$1(appendTo)) {
63684
+ if (!isElement$2(appendTo)) {
61784
63685
  appendTo = document.body;
61785
63686
  }
61786
63687
  normalized.appendTo = appendTo;
@@ -62367,10 +64268,10 @@
62367
64268
  if (isString$1(props.appendTo)) {
62368
64269
  appendTo = document.querySelector(props.appendTo);
62369
64270
  }
62370
- if (isElement$1(props.appendTo)) {
64271
+ if (isElement$2(props.appendTo)) {
62371
64272
  appendTo = props.appendTo;
62372
64273
  }
62373
- if (!isElement$1(appendTo)) {
64274
+ if (!isElement$2(appendTo)) {
62374
64275
  appendTo = document.body;
62375
64276
  }
62376
64277
  }
@@ -62738,12 +64639,12 @@
62738
64639
  }
62739
64640
  };
62740
64641
  let appendTo = document.body;
62741
- if (isElement$1(options.appendTo)) {
64642
+ if (isElement$2(options.appendTo)) {
62742
64643
  appendTo = options.appendTo;
62743
64644
  } else if (isString$1(options.appendTo)) {
62744
64645
  appendTo = document.querySelector(options.appendTo);
62745
64646
  }
62746
- if (!isElement$1(appendTo)) {
64647
+ if (!isElement$2(appendTo)) {
62747
64648
  appendTo = document.body;
62748
64649
  }
62749
64650
  const container = document.createElement("div");
@@ -63091,6 +64992,7 @@
63091
64992
  exports.defaultProps = defaultProps;
63092
64993
  exports.descriptionItemProps = descriptionItemProps;
63093
64994
  exports.descriptionProps = descriptionProps;
64995
+ exports.dialogContextKey = dialogContextKey;
63094
64996
  exports.dialogEmits = dialogEmits;
63095
64997
  exports.dialogInjectionKey = dialogInjectionKey;
63096
64998
  exports.dialogProps = dialogProps;