@brumaombra/ui-vintage 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -0
  3. package/dist/AlertDialogTitle.vue_vue_type_script_setup_true_lang-CWCr2erD.js +360 -0
  4. package/dist/AlertDialogTrigger.vue_vue_type_script_setup_true_lang-vNwxOYhM.js +158 -0
  5. package/dist/BackgroundGrid-Cxvbtefm.js +13 -0
  6. package/dist/Busy-B65Nd9ec.js +62 -0
  7. package/dist/BusyIndicator-CnWzSMDb.js +4 -0
  8. package/dist/BusyIndicator.vue_vue_type_script_setup_true_lang-CYeXMI_V.js +66 -0
  9. package/dist/CalendarPrevButton.vue_vue_type_script_setup_true_lang-C-WnFnvj.js +3805 -0
  10. package/dist/Card.vue_vue_type_script_setup_true_lang-6ol3rxy1.js +27 -0
  11. package/dist/CardTitle.vue_vue_type_script_setup_true_lang-DVAd7AWF.js +112 -0
  12. package/dist/Collection-CmOoLBo7.js +76 -0
  13. package/dist/ConfigProvider-D2O0Jles.js +6 -0
  14. package/dist/ConfirmDialog-DEsvF0b_.js +4 -0
  15. package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-BAd1l1zF.js +230 -0
  16. package/dist/DashboardShell.vue_vue_type_script_setup_true_lang-CT2SQBXv.js +171 -0
  17. package/dist/DatePicker.vue_vue_type_script_setup_true_lang-D8mev2ha.js +92 -0
  18. package/dist/DialogClose-BNlqG4G2.js +36 -0
  19. package/dist/DialogTitle-DXj0nkXn.js +522 -0
  20. package/dist/DialogTitle.vue_vue_type_script_setup_true_lang-Bw40D4AK.js +174 -0
  21. package/dist/DialogTrigger-CpyKnu11.js +52 -0
  22. package/dist/DialogTrigger.vue_vue_type_script_setup_true_lang-DLrFiCsw.js +141 -0
  23. package/dist/FocusScope-C3mcVwsf.js +454 -0
  24. package/dist/Input.vue_vue_type_script_setup_true_lang-U778IWa0.js +37 -0
  25. package/dist/Label.vue_vue_type_script_setup_true_lang-B_fwvfJ-.js +65 -0
  26. package/dist/MessageDialog-BrowppID.js +4 -0
  27. package/dist/MessageDialog.vue_vue_type_script_setup_true_lang-Ddih5Isd.js +242 -0
  28. package/dist/NativeSelectOption.vue_vue_type_script_setup_true_lang-DS87OTLT.js +73 -0
  29. package/dist/PopoverAnchor.vue_vue_type_script_setup_true_lang-CsfybvZp.js +61 -0
  30. package/dist/PopoverTrigger.vue_vue_type_script_setup_true_lang-KTcg6Jnl.js +798 -0
  31. package/dist/PopperContent-BiM0YLO3.js +2144 -0
  32. package/dist/Primitive-D3IcFg81.js +61 -0
  33. package/dist/SelectValue.vue_vue_type_script_setup_true_lang-DGAI4hw5.js +2124 -0
  34. package/dist/Separator-CFm_M4pb.js +87 -0
  35. package/dist/Separator.vue_vue_type_script_setup_true_lang-COrZ60NR.js +29 -0
  36. package/dist/SheetTitle.vue_vue_type_script_setup_true_lang-DLoXGMbx.js +175 -0
  37. package/dist/SheetTrigger.vue_vue_type_script_setup_true_lang-CE2XJNHy.js +62 -0
  38. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-BSbVyZz7.js +20 -0
  39. package/dist/Slider.vue_vue_type_script_setup_true_lang-D-cAN-4Q.js +802 -0
  40. package/dist/SliderFormComponent.vue_vue_type_script_setup_true_lang-KPzC_Lmr.js +59 -0
  41. package/dist/Switch.vue_vue_type_script_setup_true_lang-BWKCycMm.js +226 -0
  42. package/dist/SwitchFormComponent.vue_vue_type_script_setup_true_lang-XOBEs3pa.js +39 -0
  43. package/dist/Teleport-CuUn4UkG.js +493 -0
  44. package/dist/TooltipProvider.vue_vue_type_script_setup_true_lang-DwIfCQjY.js +28 -0
  45. package/dist/TooltipTrigger.vue_vue_type_script_setup_true_lang-BRyHTWgw.js +1117 -0
  46. package/dist/VisuallyHidden-udQT2Fmo.js +60 -0
  47. package/dist/VisuallyHiddenInput-DLAsRwUw.js +142 -0
  48. package/dist/_plugin-vue_export-helper-1tPrXgE0.js +10 -0
  49. package/dist/alert-dialog.d.ts +2 -0
  50. package/dist/alert-dialog.js +13 -0
  51. package/dist/alert.d.ts +2 -0
  52. package/dist/alert.js +76 -0
  53. package/dist/background-grid.d.ts +6 -0
  54. package/dist/background-grid.js +5 -0
  55. package/dist/busy-indicator.d.ts +2 -0
  56. package/dist/busy-indicator.js +6 -0
  57. package/dist/busy.d.ts +2 -0
  58. package/dist/busy.js +4 -0
  59. package/dist/button.d.ts +2 -0
  60. package/dist/button.js +63 -0
  61. package/dist/calendar.d.ts +2 -0
  62. package/dist/calendar.js +15 -0
  63. package/dist/card.d.ts +2 -0
  64. package/dist/card.js +11 -0
  65. package/dist/check-iejznCzf.js +11 -0
  66. package/dist/chevron-down-DP-oz-sL.js +13 -0
  67. package/dist/clamp-D5Ye0kJT.js +6 -0
  68. package/dist/command.d.ts +2 -0
  69. package/dist/command.js +1122 -0
  70. package/dist/components/background-grid/BackgroundGrid.vue.d.ts +2 -0
  71. package/dist/components/background-grid/index.d.ts +2 -0
  72. package/dist/components/busy-indicator/BusyIndicator.vue.d.ts +2 -0
  73. package/dist/components/busy-indicator/busy-indicator-state.d.ts +15 -0
  74. package/dist/components/busy-indicator/index.d.ts +3 -0
  75. package/dist/components/confirm-dialog/ConfirmDialog.vue.d.ts +2 -0
  76. package/dist/components/confirm-dialog/confirm-dialog-state.d.ts +37 -0
  77. package/dist/components/confirm-dialog/index.d.ts +3 -0
  78. package/dist/components/dashboard-shell/DashboardShell.vue.d.ts +54 -0
  79. package/dist/components/dashboard-shell/index.d.ts +2 -0
  80. package/dist/components/message-dialog/MessageDialog.vue.d.ts +2 -0
  81. package/dist/components/message-dialog/index.d.ts +3 -0
  82. package/dist/components/message-dialog/message-dialog-state.d.ts +28 -0
  83. package/dist/components/slider-form-component/SliderFormComponent.vue.d.ts +23 -0
  84. package/dist/components/slider-form-component/index.d.ts +2 -0
  85. package/dist/components/switch-form-component/SwitchFormComponent.vue.d.ts +12 -0
  86. package/dist/components/switch-form-component/index.d.ts +2 -0
  87. package/dist/components/ui/alert/Alert.vue.d.ts +23 -0
  88. package/dist/components/ui/alert/AlertDescription.vue.d.ts +21 -0
  89. package/dist/components/ui/alert/AlertTitle.vue.d.ts +21 -0
  90. package/dist/components/ui/alert/index.d.ts +8 -0
  91. package/dist/components/ui/alert-dialog/AlertDialog.vue.d.ts +25 -0
  92. package/dist/components/ui/alert-dialog/AlertDialogAction.vue.d.ts +22 -0
  93. package/dist/components/ui/alert-dialog/AlertDialogCancel.vue.d.ts +22 -0
  94. package/dist/components/ui/alert-dialog/AlertDialogContent.vue.d.ts +36 -0
  95. package/dist/components/ui/alert-dialog/AlertDialogDescription.vue.d.ts +22 -0
  96. package/dist/components/ui/alert-dialog/AlertDialogFooter.vue.d.ts +21 -0
  97. package/dist/components/ui/alert-dialog/AlertDialogHeader.vue.d.ts +21 -0
  98. package/dist/components/ui/alert-dialog/AlertDialogTitle.vue.d.ts +22 -0
  99. package/dist/components/ui/alert-dialog/AlertDialogTrigger.vue.d.ts +18 -0
  100. package/dist/components/ui/alert-dialog/index.d.ts +9 -0
  101. package/dist/components/ui/busy/Busy.vue.d.ts +27 -0
  102. package/dist/components/ui/busy/index.d.ts +1 -0
  103. package/dist/components/ui/button/Button.vue.d.ts +27 -0
  104. package/dist/components/ui/button/index.d.ts +7 -0
  105. package/dist/components/ui/calendar/Calendar.vue.d.ts +44 -0
  106. package/dist/components/ui/calendar/CalendarCell.vue.d.ts +22 -0
  107. package/dist/components/ui/calendar/CalendarCellTrigger.vue.d.ts +24 -0
  108. package/dist/components/ui/calendar/CalendarGrid.vue.d.ts +22 -0
  109. package/dist/components/ui/calendar/CalendarGridBody.vue.d.ts +18 -0
  110. package/dist/components/ui/calendar/CalendarGridHead.vue.d.ts +22 -0
  111. package/dist/components/ui/calendar/CalendarGridRow.vue.d.ts +22 -0
  112. package/dist/components/ui/calendar/CalendarHeadCell.vue.d.ts +22 -0
  113. package/dist/components/ui/calendar/CalendarHeader.vue.d.ts +22 -0
  114. package/dist/components/ui/calendar/CalendarHeading.vue.d.ts +28 -0
  115. package/dist/components/ui/calendar/CalendarNextButton.vue.d.ts +22 -0
  116. package/dist/components/ui/calendar/CalendarPrevButton.vue.d.ts +22 -0
  117. package/dist/components/ui/calendar/index.d.ts +13 -0
  118. package/dist/components/ui/card/Card.vue.d.ts +21 -0
  119. package/dist/components/ui/card/CardAction.vue.d.ts +21 -0
  120. package/dist/components/ui/card/CardContent.vue.d.ts +21 -0
  121. package/dist/components/ui/card/CardDescription.vue.d.ts +21 -0
  122. package/dist/components/ui/card/CardFooter.vue.d.ts +21 -0
  123. package/dist/components/ui/card/CardHeader.vue.d.ts +21 -0
  124. package/dist/components/ui/card/CardTitle.vue.d.ts +21 -0
  125. package/dist/components/ui/card/index.d.ts +7 -0
  126. package/dist/components/ui/command/Command.vue.d.ts +40 -0
  127. package/dist/components/ui/command/CommandDialog.vue.d.ts +32 -0
  128. package/dist/components/ui/command/CommandEmpty.vue.d.ts +22 -0
  129. package/dist/components/ui/command/CommandGroup.vue.d.ts +23 -0
  130. package/dist/components/ui/command/CommandInput.vue.d.ts +7 -0
  131. package/dist/components/ui/command/CommandItem.vue.d.ts +30 -0
  132. package/dist/components/ui/command/CommandList.vue.d.ts +22 -0
  133. package/dist/components/ui/command/CommandSeparator.vue.d.ts +22 -0
  134. package/dist/components/ui/command/CommandShortcut.vue.d.ts +21 -0
  135. package/dist/components/ui/command/index.d.ts +90 -0
  136. package/dist/components/ui/date-picker/DatePicker.vue.d.ts +19 -0
  137. package/dist/components/ui/date-picker/index.d.ts +2 -0
  138. package/dist/components/ui/dialog/Dialog.vue.d.ts +25 -0
  139. package/dist/components/ui/dialog/DialogClose.vue.d.ts +18 -0
  140. package/dist/components/ui/dialog/DialogContent.vue.d.ts +39 -0
  141. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +22 -0
  142. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +24 -0
  143. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +21 -0
  144. package/dist/components/ui/dialog/DialogOverlay.vue.d.ts +22 -0
  145. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +36 -0
  146. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +22 -0
  147. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +18 -0
  148. package/dist/components/ui/dialog/index.d.ts +10 -0
  149. package/dist/components/ui/field/Field.vue.d.ts +23 -0
  150. package/dist/components/ui/field/FieldContent.vue.d.ts +21 -0
  151. package/dist/components/ui/field/FieldDescription.vue.d.ts +21 -0
  152. package/dist/components/ui/field/FieldError.vue.d.ts +24 -0
  153. package/dist/components/ui/field/FieldGroup.vue.d.ts +21 -0
  154. package/dist/components/ui/field/FieldLabel.vue.d.ts +21 -0
  155. package/dist/components/ui/field/FieldLegend.vue.d.ts +22 -0
  156. package/dist/components/ui/field/FieldSeparator.vue.d.ts +21 -0
  157. package/dist/components/ui/field/FieldSet.vue.d.ts +21 -0
  158. package/dist/components/ui/field/FieldTitle.vue.d.ts +21 -0
  159. package/dist/components/ui/field/index.d.ts +15 -0
  160. package/dist/components/ui/input/Input.vue.d.ts +12 -0
  161. package/dist/components/ui/input/index.d.ts +1 -0
  162. package/dist/components/ui/label/Label.vue.d.ts +22 -0
  163. package/dist/components/ui/label/index.d.ts +1 -0
  164. package/dist/components/ui/native-select/NativeSelect.vue.d.ts +27 -0
  165. package/dist/components/ui/native-select/NativeSelectOptGroup.vue.d.ts +21 -0
  166. package/dist/components/ui/native-select/NativeSelectOption.vue.d.ts +21 -0
  167. package/dist/components/ui/native-select/index.d.ts +3 -0
  168. package/dist/components/ui/popover/Popover.vue.d.ts +25 -0
  169. package/dist/components/ui/popover/PopoverAnchor.vue.d.ts +18 -0
  170. package/dist/components/ui/popover/PopoverContent.vue.d.ts +39 -0
  171. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +18 -0
  172. package/dist/components/ui/popover/index.d.ts +4 -0
  173. package/dist/components/ui/select/Select.vue.d.ts +28 -0
  174. package/dist/components/ui/select/SelectContent.vue.d.ts +32 -0
  175. package/dist/components/ui/select/SelectGroup.vue.d.ts +18 -0
  176. package/dist/components/ui/select/SelectItem.vue.d.ts +24 -0
  177. package/dist/components/ui/select/SelectItemText.vue.d.ts +18 -0
  178. package/dist/components/ui/select/SelectLabel.vue.d.ts +22 -0
  179. package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +22 -0
  180. package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +22 -0
  181. package/dist/components/ui/select/SelectSeparator.vue.d.ts +7 -0
  182. package/dist/components/ui/select/SelectTrigger.vue.d.ts +25 -0
  183. package/dist/components/ui/select/SelectValue.vue.d.ts +18 -0
  184. package/dist/components/ui/select/index.d.ts +11 -0
  185. package/dist/components/ui/separator/Separator.vue.d.ts +10 -0
  186. package/dist/components/ui/separator/index.d.ts +1 -0
  187. package/dist/components/ui/sheet/Sheet.vue.d.ts +25 -0
  188. package/dist/components/ui/sheet/SheetClose.vue.d.ts +18 -0
  189. package/dist/components/ui/sheet/SheetContent.vue.d.ts +39 -0
  190. package/dist/components/ui/sheet/SheetDescription.vue.d.ts +22 -0
  191. package/dist/components/ui/sheet/SheetFooter.vue.d.ts +21 -0
  192. package/dist/components/ui/sheet/SheetHeader.vue.d.ts +21 -0
  193. package/dist/components/ui/sheet/SheetOverlay.vue.d.ts +22 -0
  194. package/dist/components/ui/sheet/SheetTitle.vue.d.ts +22 -0
  195. package/dist/components/ui/sheet/SheetTrigger.vue.d.ts +18 -0
  196. package/dist/components/ui/sheet/index.d.ts +8 -0
  197. package/dist/components/ui/sidebar/Sidebar.vue.d.ts +24 -0
  198. package/dist/components/ui/sidebar/SidebarContent.vue.d.ts +21 -0
  199. package/dist/components/ui/sidebar/SidebarFooter.vue.d.ts +21 -0
  200. package/dist/components/ui/sidebar/SidebarGroup.vue.d.ts +21 -0
  201. package/dist/components/ui/sidebar/SidebarGroupAction.vue.d.ts +22 -0
  202. package/dist/components/ui/sidebar/SidebarGroupContent.vue.d.ts +21 -0
  203. package/dist/components/ui/sidebar/SidebarGroupLabel.vue.d.ts +22 -0
  204. package/dist/components/ui/sidebar/SidebarHeader.vue.d.ts +21 -0
  205. package/dist/components/ui/sidebar/SidebarInput.vue.d.ts +21 -0
  206. package/dist/components/ui/sidebar/SidebarInset.vue.d.ts +21 -0
  207. package/dist/components/ui/sidebar/SidebarMenu.vue.d.ts +21 -0
  208. package/dist/components/ui/sidebar/SidebarMenuAction.vue.d.ts +25 -0
  209. package/dist/components/ui/sidebar/SidebarMenuBadge.vue.d.ts +21 -0
  210. package/dist/components/ui/sidebar/SidebarMenuButton.vue.d.ts +27 -0
  211. package/dist/components/ui/sidebar/SidebarMenuButtonChild.vue.d.ts +30 -0
  212. package/dist/components/ui/sidebar/SidebarMenuItem.vue.d.ts +21 -0
  213. package/dist/components/ui/sidebar/SidebarMenuSkeleton.vue.d.ts +7 -0
  214. package/dist/components/ui/sidebar/SidebarMenuSub.vue.d.ts +21 -0
  215. package/dist/components/ui/sidebar/SidebarMenuSubButton.vue.d.ts +27 -0
  216. package/dist/components/ui/sidebar/SidebarMenuSubItem.vue.d.ts +21 -0
  217. package/dist/components/ui/sidebar/SidebarProvider.vue.d.ts +30 -0
  218. package/dist/components/ui/sidebar/SidebarRail.vue.d.ts +21 -0
  219. package/dist/components/ui/sidebar/SidebarSeparator.vue.d.ts +21 -0
  220. package/dist/components/ui/sidebar/SidebarTrigger.vue.d.ts +6 -0
  221. package/dist/components/ui/sidebar/index.d.ts +37 -0
  222. package/dist/components/ui/sidebar/utils.d.ts +56 -0
  223. package/dist/components/ui/skeleton/Skeleton.vue.d.ts +6 -0
  224. package/dist/components/ui/skeleton/index.d.ts +1 -0
  225. package/dist/components/ui/slider/Slider.vue.d.ts +13 -0
  226. package/dist/components/ui/slider/index.d.ts +1 -0
  227. package/dist/components/ui/switch/Switch.vue.d.ts +29 -0
  228. package/dist/components/ui/switch/index.d.ts +1 -0
  229. package/dist/components/ui/tooltip/Tooltip.vue.d.ts +24 -0
  230. package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +30 -0
  231. package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts +20 -0
  232. package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +18 -0
  233. package/dist/components/ui/tooltip/index.d.ts +4 -0
  234. package/dist/confirm-dialog.d.ts +2 -0
  235. package/dist/confirm-dialog.js +9 -0
  236. package/dist/createLucideIcon-CCMB2vDW.js +130 -0
  237. package/dist/dashboard-shell.d.ts +6 -0
  238. package/dist/dashboard-shell.js +5 -0
  239. package/dist/date-picker.d.ts +6 -0
  240. package/dist/date-picker.js +5 -0
  241. package/dist/dialog.d.ts +2 -0
  242. package/dist/dialog.js +14 -0
  243. package/dist/field.d.ts +2 -0
  244. package/dist/field.js +294 -0
  245. package/dist/index-C1_fxYhb.js +251 -0
  246. package/dist/index-Dfi5ESP2.js +299 -0
  247. package/dist/index-FpH8cK6B.js +44 -0
  248. package/dist/index.d.ts +28 -0
  249. package/dist/index.js +171 -0
  250. package/dist/info-DZrSmi42.js +15 -0
  251. package/dist/input.d.ts +2 -0
  252. package/dist/input.js +4 -0
  253. package/dist/label.d.ts +2 -0
  254. package/dist/label.js +4 -0
  255. package/dist/lib/utils.d.ts +2 -0
  256. package/dist/message-dialog.d.ts +2 -0
  257. package/dist/message-dialog.js +8 -0
  258. package/dist/native-select.d.ts +2 -0
  259. package/dist/native-select.js +25 -0
  260. package/dist/popover.d.ts +2 -0
  261. package/dist/popover.js +8 -0
  262. package/dist/select.d.ts +2 -0
  263. package/dist/select.js +14 -0
  264. package/dist/separator.d.ts +2 -0
  265. package/dist/separator.js +4 -0
  266. package/dist/sheet.d.ts +2 -0
  267. package/dist/sheet.js +12 -0
  268. package/dist/sidebar.d.ts +2 -0
  269. package/dist/sidebar.js +813 -0
  270. package/dist/skeleton.d.ts +2 -0
  271. package/dist/skeleton.js +4 -0
  272. package/dist/slider-form-component.d.ts +6 -0
  273. package/dist/slider-form-component.js +5 -0
  274. package/dist/slider.d.ts +2 -0
  275. package/dist/slider.js +4 -0
  276. package/dist/style.css +4021 -0
  277. package/dist/switch-form-component.d.ts +6 -0
  278. package/dist/switch-form-component.js +5 -0
  279. package/dist/switch.d.ts +2 -0
  280. package/dist/switch.js +4 -0
  281. package/dist/tooltip.d.ts +2 -0
  282. package/dist/tooltip.js +8 -0
  283. package/dist/useDirection-SIyEYNxv.js +12 -0
  284. package/dist/useFocusGuards-tgErlvMF.js +29 -0
  285. package/dist/useFormControl-7ytzz-r7.js +11 -0
  286. package/dist/useForwardExpose-CNVHwdF2.js +58 -0
  287. package/dist/useForwardPropsEmits-DmumnZO5.js +63 -0
  288. package/dist/useKbd-JjFOu4f7.js +41 -0
  289. package/dist/usePrimitiveElement-CijaRBgF.js +16 -0
  290. package/dist/useSize-DO9Z3wC4.js +51 -0
  291. package/dist/useTypeahead-Dqe1QXq1.js +159 -0
  292. package/dist/utils-Bz4m9VPB.js +3192 -0
  293. package/dist/utils-RRmyeqLm.js +16 -0
  294. package/dist/utils.d.ts +2 -0
  295. package/dist/utils.js +4 -0
  296. package/dist/x-2_VzbDS9.js +48 -0
  297. package/package.json +186 -0
@@ -0,0 +1,2144 @@
1
+ import { u as useForwardExpose } from "./useForwardExpose-CNVHwdF2.js";
2
+ import { P as Primitive } from "./Primitive-D3IcFg81.js";
3
+ import { defineComponent, ref, renderSlot, watchPostEffect, openBlock, createBlock, unref, withCtx, computed, shallowRef, watch, getCurrentScope, onScopeDispose, shallowReadonly, watchEffect, createElementBlock, normalizeStyle, createVNode, mergeProps, mergeDefaults } from "vue";
4
+ import { c as createContext } from "./useForwardPropsEmits-DmumnZO5.js";
5
+ import { u as useSize } from "./useSize-DO9Z3wC4.js";
6
+ import { n as computedEager } from "./index-Dfi5ESP2.js";
7
+ const [injectPopperRootContext, providePopperRootContext] = createContext("PopperRoot");
8
+ var PopperRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
9
+ inheritAttrs: false,
10
+ __name: "PopperRoot",
11
+ setup(__props) {
12
+ const anchor = ref();
13
+ providePopperRootContext({
14
+ anchor,
15
+ onAnchorChange: (element) => anchor.value = element
16
+ });
17
+ return (_ctx, _cache) => {
18
+ return renderSlot(_ctx.$slots, "default");
19
+ };
20
+ }
21
+ });
22
+ var PopperRoot_default = PopperRoot_vue_vue_type_script_setup_true_lang_default;
23
+ var PopperAnchor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
24
+ __name: "PopperAnchor",
25
+ props: {
26
+ reference: {
27
+ type: null,
28
+ required: false
29
+ },
30
+ asChild: {
31
+ type: Boolean,
32
+ required: false
33
+ },
34
+ as: {
35
+ type: null,
36
+ required: false
37
+ }
38
+ },
39
+ setup(__props) {
40
+ const props = __props;
41
+ const { forwardRef, currentElement } = useForwardExpose();
42
+ const rootContext = injectPopperRootContext();
43
+ watchPostEffect(() => {
44
+ rootContext.onAnchorChange(props.reference ?? currentElement.value);
45
+ });
46
+ return (_ctx, _cache) => {
47
+ return openBlock(), createBlock(unref(Primitive), {
48
+ ref: unref(forwardRef),
49
+ as: _ctx.as,
50
+ "as-child": _ctx.asChild
51
+ }, {
52
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
53
+ _: 3
54
+ }, 8, ["as", "as-child"]);
55
+ };
56
+ }
57
+ });
58
+ var PopperAnchor_default = PopperAnchor_vue_vue_type_script_setup_true_lang_default;
59
+ function isNotNull(value) {
60
+ return value !== null;
61
+ }
62
+ function transformOrigin(options) {
63
+ return {
64
+ name: "transformOrigin",
65
+ options,
66
+ fn(data) {
67
+ var _a, _b, _c;
68
+ const { placement, rects, middlewareData } = data;
69
+ const cannotCenterArrow = ((_a = middlewareData.arrow) == null ? void 0 : _a.centerOffset) !== 0;
70
+ const isArrowHidden = cannotCenterArrow;
71
+ const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
72
+ const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
73
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
74
+ const noArrowAlign = {
75
+ start: "0%",
76
+ center: "50%",
77
+ end: "100%"
78
+ }[placedAlign];
79
+ const arrowXCenter = (((_b = middlewareData.arrow) == null ? void 0 : _b.x) ?? 0) + arrowWidth / 2;
80
+ const arrowYCenter = (((_c = middlewareData.arrow) == null ? void 0 : _c.y) ?? 0) + arrowHeight / 2;
81
+ let x = "";
82
+ let y = "";
83
+ if (placedSide === "bottom") {
84
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
85
+ y = `${-arrowHeight}px`;
86
+ } else if (placedSide === "top") {
87
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
88
+ y = `${rects.floating.height + arrowHeight}px`;
89
+ } else if (placedSide === "right") {
90
+ x = `${-arrowHeight}px`;
91
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
92
+ } else if (placedSide === "left") {
93
+ x = `${rects.floating.width + arrowHeight}px`;
94
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
95
+ }
96
+ return { data: {
97
+ x,
98
+ y
99
+ } };
100
+ }
101
+ };
102
+ }
103
+ function getSideAndAlignFromPlacement(placement) {
104
+ const [side, align = "center"] = placement.split("-");
105
+ return [side, align];
106
+ }
107
+ const sides = ["top", "right", "bottom", "left"];
108
+ const min = Math.min;
109
+ const max = Math.max;
110
+ const round = Math.round;
111
+ const floor = Math.floor;
112
+ const createCoords = (v) => ({
113
+ x: v,
114
+ y: v
115
+ });
116
+ const oppositeSideMap = {
117
+ left: "right",
118
+ right: "left",
119
+ bottom: "top",
120
+ top: "bottom"
121
+ };
122
+ function clamp(start, value, end) {
123
+ return max(start, min(value, end));
124
+ }
125
+ function evaluate(value, param) {
126
+ return typeof value === "function" ? value(param) : value;
127
+ }
128
+ function getSide(placement) {
129
+ return placement.split("-")[0];
130
+ }
131
+ function getAlignment(placement) {
132
+ return placement.split("-")[1];
133
+ }
134
+ function getOppositeAxis(axis) {
135
+ return axis === "x" ? "y" : "x";
136
+ }
137
+ function getAxisLength(axis) {
138
+ return axis === "y" ? "height" : "width";
139
+ }
140
+ function getSideAxis(placement) {
141
+ const firstChar = placement[0];
142
+ return firstChar === "t" || firstChar === "b" ? "y" : "x";
143
+ }
144
+ function getAlignmentAxis(placement) {
145
+ return getOppositeAxis(getSideAxis(placement));
146
+ }
147
+ function getAlignmentSides(placement, rects, rtl) {
148
+ if (rtl === void 0) {
149
+ rtl = false;
150
+ }
151
+ const alignment = getAlignment(placement);
152
+ const alignmentAxis = getAlignmentAxis(placement);
153
+ const length = getAxisLength(alignmentAxis);
154
+ let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
155
+ if (rects.reference[length] > rects.floating[length]) {
156
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
157
+ }
158
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
159
+ }
160
+ function getExpandedPlacements(placement) {
161
+ const oppositePlacement = getOppositePlacement(placement);
162
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
163
+ }
164
+ function getOppositeAlignmentPlacement(placement) {
165
+ return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
166
+ }
167
+ const lrPlacement = ["left", "right"];
168
+ const rlPlacement = ["right", "left"];
169
+ const tbPlacement = ["top", "bottom"];
170
+ const btPlacement = ["bottom", "top"];
171
+ function getSideList(side, isStart, rtl) {
172
+ switch (side) {
173
+ case "top":
174
+ case "bottom":
175
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
176
+ return isStart ? lrPlacement : rlPlacement;
177
+ case "left":
178
+ case "right":
179
+ return isStart ? tbPlacement : btPlacement;
180
+ default:
181
+ return [];
182
+ }
183
+ }
184
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
185
+ const alignment = getAlignment(placement);
186
+ let list = getSideList(getSide(placement), direction === "start", rtl);
187
+ if (alignment) {
188
+ list = list.map((side) => side + "-" + alignment);
189
+ if (flipAlignment) {
190
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
191
+ }
192
+ }
193
+ return list;
194
+ }
195
+ function getOppositePlacement(placement) {
196
+ const side = getSide(placement);
197
+ return oppositeSideMap[side] + placement.slice(side.length);
198
+ }
199
+ function expandPaddingObject(padding) {
200
+ return {
201
+ top: 0,
202
+ right: 0,
203
+ bottom: 0,
204
+ left: 0,
205
+ ...padding
206
+ };
207
+ }
208
+ function getPaddingObject(padding) {
209
+ return typeof padding !== "number" ? expandPaddingObject(padding) : {
210
+ top: padding,
211
+ right: padding,
212
+ bottom: padding,
213
+ left: padding
214
+ };
215
+ }
216
+ function rectToClientRect(rect) {
217
+ const {
218
+ x,
219
+ y,
220
+ width,
221
+ height
222
+ } = rect;
223
+ return {
224
+ width,
225
+ height,
226
+ top: y,
227
+ left: x,
228
+ right: x + width,
229
+ bottom: y + height,
230
+ x,
231
+ y
232
+ };
233
+ }
234
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
235
+ let {
236
+ reference,
237
+ floating
238
+ } = _ref;
239
+ const sideAxis = getSideAxis(placement);
240
+ const alignmentAxis = getAlignmentAxis(placement);
241
+ const alignLength = getAxisLength(alignmentAxis);
242
+ const side = getSide(placement);
243
+ const isVertical = sideAxis === "y";
244
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
245
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
246
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
247
+ let coords;
248
+ switch (side) {
249
+ case "top":
250
+ coords = {
251
+ x: commonX,
252
+ y: reference.y - floating.height
253
+ };
254
+ break;
255
+ case "bottom":
256
+ coords = {
257
+ x: commonX,
258
+ y: reference.y + reference.height
259
+ };
260
+ break;
261
+ case "right":
262
+ coords = {
263
+ x: reference.x + reference.width,
264
+ y: commonY
265
+ };
266
+ break;
267
+ case "left":
268
+ coords = {
269
+ x: reference.x - floating.width,
270
+ y: commonY
271
+ };
272
+ break;
273
+ default:
274
+ coords = {
275
+ x: reference.x,
276
+ y: reference.y
277
+ };
278
+ }
279
+ switch (getAlignment(placement)) {
280
+ case "start":
281
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
282
+ break;
283
+ case "end":
284
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
285
+ break;
286
+ }
287
+ return coords;
288
+ }
289
+ async function detectOverflow(state, options) {
290
+ var _await$platform$isEle;
291
+ if (options === void 0) {
292
+ options = {};
293
+ }
294
+ const {
295
+ x,
296
+ y,
297
+ platform: platform2,
298
+ rects,
299
+ elements,
300
+ strategy
301
+ } = state;
302
+ const {
303
+ boundary = "clippingAncestors",
304
+ rootBoundary = "viewport",
305
+ elementContext = "floating",
306
+ altBoundary = false,
307
+ padding = 0
308
+ } = evaluate(options, state);
309
+ const paddingObject = getPaddingObject(padding);
310
+ const altContext = elementContext === "floating" ? "reference" : "floating";
311
+ const element = elements[altBoundary ? altContext : elementContext];
312
+ const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
313
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
314
+ boundary,
315
+ rootBoundary,
316
+ strategy
317
+ }));
318
+ const rect = elementContext === "floating" ? {
319
+ x,
320
+ y,
321
+ width: rects.floating.width,
322
+ height: rects.floating.height
323
+ } : rects.reference;
324
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
325
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
326
+ x: 1,
327
+ y: 1
328
+ } : {
329
+ x: 1,
330
+ y: 1
331
+ };
332
+ const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
333
+ elements,
334
+ rect,
335
+ offsetParent,
336
+ strategy
337
+ }) : rect);
338
+ return {
339
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
340
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
341
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
342
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
343
+ };
344
+ }
345
+ const MAX_RESET_COUNT = 50;
346
+ const computePosition$1 = async (reference, floating, config) => {
347
+ const {
348
+ placement = "bottom",
349
+ strategy = "absolute",
350
+ middleware = [],
351
+ platform: platform2
352
+ } = config;
353
+ const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
354
+ ...platform2,
355
+ detectOverflow
356
+ };
357
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
358
+ let rects = await platform2.getElementRects({
359
+ reference,
360
+ floating,
361
+ strategy
362
+ });
363
+ let {
364
+ x,
365
+ y
366
+ } = computeCoordsFromPlacement(rects, placement, rtl);
367
+ let statefulPlacement = placement;
368
+ let resetCount = 0;
369
+ const middlewareData = {};
370
+ for (let i = 0; i < middleware.length; i++) {
371
+ const currentMiddleware = middleware[i];
372
+ if (!currentMiddleware) {
373
+ continue;
374
+ }
375
+ const {
376
+ name,
377
+ fn
378
+ } = currentMiddleware;
379
+ const {
380
+ x: nextX,
381
+ y: nextY,
382
+ data,
383
+ reset
384
+ } = await fn({
385
+ x,
386
+ y,
387
+ initialPlacement: placement,
388
+ placement: statefulPlacement,
389
+ strategy,
390
+ middlewareData,
391
+ rects,
392
+ platform: platformWithDetectOverflow,
393
+ elements: {
394
+ reference,
395
+ floating
396
+ }
397
+ });
398
+ x = nextX != null ? nextX : x;
399
+ y = nextY != null ? nextY : y;
400
+ middlewareData[name] = {
401
+ ...middlewareData[name],
402
+ ...data
403
+ };
404
+ if (reset && resetCount < MAX_RESET_COUNT) {
405
+ resetCount++;
406
+ if (typeof reset === "object") {
407
+ if (reset.placement) {
408
+ statefulPlacement = reset.placement;
409
+ }
410
+ if (reset.rects) {
411
+ rects = reset.rects === true ? await platform2.getElementRects({
412
+ reference,
413
+ floating,
414
+ strategy
415
+ }) : reset.rects;
416
+ }
417
+ ({
418
+ x,
419
+ y
420
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
421
+ }
422
+ i = -1;
423
+ }
424
+ }
425
+ return {
426
+ x,
427
+ y,
428
+ placement: statefulPlacement,
429
+ strategy,
430
+ middlewareData
431
+ };
432
+ };
433
+ const arrow$2 = (options) => ({
434
+ name: "arrow",
435
+ options,
436
+ async fn(state) {
437
+ const {
438
+ x,
439
+ y,
440
+ placement,
441
+ rects,
442
+ platform: platform2,
443
+ elements,
444
+ middlewareData
445
+ } = state;
446
+ const {
447
+ element,
448
+ padding = 0
449
+ } = evaluate(options, state) || {};
450
+ if (element == null) {
451
+ return {};
452
+ }
453
+ const paddingObject = getPaddingObject(padding);
454
+ const coords = {
455
+ x,
456
+ y
457
+ };
458
+ const axis = getAlignmentAxis(placement);
459
+ const length = getAxisLength(axis);
460
+ const arrowDimensions = await platform2.getDimensions(element);
461
+ const isYAxis = axis === "y";
462
+ const minProp = isYAxis ? "top" : "left";
463
+ const maxProp = isYAxis ? "bottom" : "right";
464
+ const clientProp = isYAxis ? "clientHeight" : "clientWidth";
465
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
466
+ const startDiff = coords[axis] - rects.reference[axis];
467
+ const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
468
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
469
+ if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
470
+ clientSize = elements.floating[clientProp] || rects.floating[length];
471
+ }
472
+ const centerToReference = endDiff / 2 - startDiff / 2;
473
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
474
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
475
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
476
+ const min$1 = minPadding;
477
+ const max2 = clientSize - arrowDimensions[length] - maxPadding;
478
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
479
+ const offset2 = clamp(min$1, center, max2);
480
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
481
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
482
+ return {
483
+ [axis]: coords[axis] + alignmentOffset,
484
+ data: {
485
+ [axis]: offset2,
486
+ centerOffset: center - offset2 - alignmentOffset,
487
+ ...shouldAddOffset && {
488
+ alignmentOffset
489
+ }
490
+ },
491
+ reset: shouldAddOffset
492
+ };
493
+ }
494
+ });
495
+ const flip$1 = function(options) {
496
+ if (options === void 0) {
497
+ options = {};
498
+ }
499
+ return {
500
+ name: "flip",
501
+ options,
502
+ async fn(state) {
503
+ var _middlewareData$arrow, _middlewareData$flip;
504
+ const {
505
+ placement,
506
+ middlewareData,
507
+ rects,
508
+ initialPlacement,
509
+ platform: platform2,
510
+ elements
511
+ } = state;
512
+ const {
513
+ mainAxis: checkMainAxis = true,
514
+ crossAxis: checkCrossAxis = true,
515
+ fallbackPlacements: specifiedFallbackPlacements,
516
+ fallbackStrategy = "bestFit",
517
+ fallbackAxisSideDirection = "none",
518
+ flipAlignment = true,
519
+ ...detectOverflowOptions
520
+ } = evaluate(options, state);
521
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
522
+ return {};
523
+ }
524
+ const side = getSide(placement);
525
+ const initialSideAxis = getSideAxis(initialPlacement);
526
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
527
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
528
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
529
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
530
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
531
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
532
+ }
533
+ const placements = [initialPlacement, ...fallbackPlacements];
534
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
535
+ const overflows = [];
536
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
537
+ if (checkMainAxis) {
538
+ overflows.push(overflow[side]);
539
+ }
540
+ if (checkCrossAxis) {
541
+ const sides2 = getAlignmentSides(placement, rects, rtl);
542
+ overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
543
+ }
544
+ overflowsData = [...overflowsData, {
545
+ placement,
546
+ overflows
547
+ }];
548
+ if (!overflows.every((side2) => side2 <= 0)) {
549
+ var _middlewareData$flip2, _overflowsData$filter;
550
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
551
+ const nextPlacement = placements[nextIndex];
552
+ if (nextPlacement) {
553
+ const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
554
+ if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
555
+ // overflows the main axis.
556
+ overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
557
+ return {
558
+ data: {
559
+ index: nextIndex,
560
+ overflows: overflowsData
561
+ },
562
+ reset: {
563
+ placement: nextPlacement
564
+ }
565
+ };
566
+ }
567
+ }
568
+ 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;
569
+ if (!resetPlacement) {
570
+ switch (fallbackStrategy) {
571
+ case "bestFit": {
572
+ var _overflowsData$filter2;
573
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
574
+ if (hasFallbackAxisSideDirection) {
575
+ const currentSideAxis = getSideAxis(d.placement);
576
+ return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
577
+ // reading directions favoring greater width.
578
+ currentSideAxis === "y";
579
+ }
580
+ return true;
581
+ }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
582
+ if (placement2) {
583
+ resetPlacement = placement2;
584
+ }
585
+ break;
586
+ }
587
+ case "initialPlacement":
588
+ resetPlacement = initialPlacement;
589
+ break;
590
+ }
591
+ }
592
+ if (placement !== resetPlacement) {
593
+ return {
594
+ reset: {
595
+ placement: resetPlacement
596
+ }
597
+ };
598
+ }
599
+ }
600
+ return {};
601
+ }
602
+ };
603
+ };
604
+ function getSideOffsets(overflow, rect) {
605
+ return {
606
+ top: overflow.top - rect.height,
607
+ right: overflow.right - rect.width,
608
+ bottom: overflow.bottom - rect.height,
609
+ left: overflow.left - rect.width
610
+ };
611
+ }
612
+ function isAnySideFullyClipped(overflow) {
613
+ return sides.some((side) => overflow[side] >= 0);
614
+ }
615
+ const hide$1 = function(options) {
616
+ if (options === void 0) {
617
+ options = {};
618
+ }
619
+ return {
620
+ name: "hide",
621
+ options,
622
+ async fn(state) {
623
+ const {
624
+ rects,
625
+ platform: platform2
626
+ } = state;
627
+ const {
628
+ strategy = "referenceHidden",
629
+ ...detectOverflowOptions
630
+ } = evaluate(options, state);
631
+ switch (strategy) {
632
+ case "referenceHidden": {
633
+ const overflow = await platform2.detectOverflow(state, {
634
+ ...detectOverflowOptions,
635
+ elementContext: "reference"
636
+ });
637
+ const offsets = getSideOffsets(overflow, rects.reference);
638
+ return {
639
+ data: {
640
+ referenceHiddenOffsets: offsets,
641
+ referenceHidden: isAnySideFullyClipped(offsets)
642
+ }
643
+ };
644
+ }
645
+ case "escaped": {
646
+ const overflow = await platform2.detectOverflow(state, {
647
+ ...detectOverflowOptions,
648
+ altBoundary: true
649
+ });
650
+ const offsets = getSideOffsets(overflow, rects.floating);
651
+ return {
652
+ data: {
653
+ escapedOffsets: offsets,
654
+ escaped: isAnySideFullyClipped(offsets)
655
+ }
656
+ };
657
+ }
658
+ default: {
659
+ return {};
660
+ }
661
+ }
662
+ }
663
+ };
664
+ };
665
+ const originSides = /* @__PURE__ */ new Set(["left", "top"]);
666
+ async function convertValueToCoords(state, options) {
667
+ const {
668
+ placement,
669
+ platform: platform2,
670
+ elements
671
+ } = state;
672
+ const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
673
+ const side = getSide(placement);
674
+ const alignment = getAlignment(placement);
675
+ const isVertical = getSideAxis(placement) === "y";
676
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
677
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
678
+ const rawValue = evaluate(options, state);
679
+ let {
680
+ mainAxis,
681
+ crossAxis,
682
+ alignmentAxis
683
+ } = typeof rawValue === "number" ? {
684
+ mainAxis: rawValue,
685
+ crossAxis: 0,
686
+ alignmentAxis: null
687
+ } : {
688
+ mainAxis: rawValue.mainAxis || 0,
689
+ crossAxis: rawValue.crossAxis || 0,
690
+ alignmentAxis: rawValue.alignmentAxis
691
+ };
692
+ if (alignment && typeof alignmentAxis === "number") {
693
+ crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
694
+ }
695
+ return isVertical ? {
696
+ x: crossAxis * crossAxisMulti,
697
+ y: mainAxis * mainAxisMulti
698
+ } : {
699
+ x: mainAxis * mainAxisMulti,
700
+ y: crossAxis * crossAxisMulti
701
+ };
702
+ }
703
+ const offset$1 = function(options) {
704
+ if (options === void 0) {
705
+ options = 0;
706
+ }
707
+ return {
708
+ name: "offset",
709
+ options,
710
+ async fn(state) {
711
+ var _middlewareData$offse, _middlewareData$arrow;
712
+ const {
713
+ x,
714
+ y,
715
+ placement,
716
+ middlewareData
717
+ } = state;
718
+ const diffCoords = await convertValueToCoords(state, options);
719
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
720
+ return {};
721
+ }
722
+ return {
723
+ x: x + diffCoords.x,
724
+ y: y + diffCoords.y,
725
+ data: {
726
+ ...diffCoords,
727
+ placement
728
+ }
729
+ };
730
+ }
731
+ };
732
+ };
733
+ const shift$1 = function(options) {
734
+ if (options === void 0) {
735
+ options = {};
736
+ }
737
+ return {
738
+ name: "shift",
739
+ options,
740
+ async fn(state) {
741
+ const {
742
+ x,
743
+ y,
744
+ placement,
745
+ platform: platform2
746
+ } = state;
747
+ const {
748
+ mainAxis: checkMainAxis = true,
749
+ crossAxis: checkCrossAxis = false,
750
+ limiter = {
751
+ fn: (_ref) => {
752
+ let {
753
+ x: x2,
754
+ y: y2
755
+ } = _ref;
756
+ return {
757
+ x: x2,
758
+ y: y2
759
+ };
760
+ }
761
+ },
762
+ ...detectOverflowOptions
763
+ } = evaluate(options, state);
764
+ const coords = {
765
+ x,
766
+ y
767
+ };
768
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
769
+ const crossAxis = getSideAxis(getSide(placement));
770
+ const mainAxis = getOppositeAxis(crossAxis);
771
+ let mainAxisCoord = coords[mainAxis];
772
+ let crossAxisCoord = coords[crossAxis];
773
+ if (checkMainAxis) {
774
+ const minSide = mainAxis === "y" ? "top" : "left";
775
+ const maxSide = mainAxis === "y" ? "bottom" : "right";
776
+ const min2 = mainAxisCoord + overflow[minSide];
777
+ const max2 = mainAxisCoord - overflow[maxSide];
778
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
779
+ }
780
+ if (checkCrossAxis) {
781
+ const minSide = crossAxis === "y" ? "top" : "left";
782
+ const maxSide = crossAxis === "y" ? "bottom" : "right";
783
+ const min2 = crossAxisCoord + overflow[minSide];
784
+ const max2 = crossAxisCoord - overflow[maxSide];
785
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
786
+ }
787
+ const limitedCoords = limiter.fn({
788
+ ...state,
789
+ [mainAxis]: mainAxisCoord,
790
+ [crossAxis]: crossAxisCoord
791
+ });
792
+ return {
793
+ ...limitedCoords,
794
+ data: {
795
+ x: limitedCoords.x - x,
796
+ y: limitedCoords.y - y,
797
+ enabled: {
798
+ [mainAxis]: checkMainAxis,
799
+ [crossAxis]: checkCrossAxis
800
+ }
801
+ }
802
+ };
803
+ }
804
+ };
805
+ };
806
+ const limitShift$1 = function(options) {
807
+ if (options === void 0) {
808
+ options = {};
809
+ }
810
+ return {
811
+ options,
812
+ fn(state) {
813
+ const {
814
+ x,
815
+ y,
816
+ placement,
817
+ rects,
818
+ middlewareData
819
+ } = state;
820
+ const {
821
+ offset: offset2 = 0,
822
+ mainAxis: checkMainAxis = true,
823
+ crossAxis: checkCrossAxis = true
824
+ } = evaluate(options, state);
825
+ const coords = {
826
+ x,
827
+ y
828
+ };
829
+ const crossAxis = getSideAxis(placement);
830
+ const mainAxis = getOppositeAxis(crossAxis);
831
+ let mainAxisCoord = coords[mainAxis];
832
+ let crossAxisCoord = coords[crossAxis];
833
+ const rawOffset = evaluate(offset2, state);
834
+ const computedOffset = typeof rawOffset === "number" ? {
835
+ mainAxis: rawOffset,
836
+ crossAxis: 0
837
+ } : {
838
+ mainAxis: 0,
839
+ crossAxis: 0,
840
+ ...rawOffset
841
+ };
842
+ if (checkMainAxis) {
843
+ const len = mainAxis === "y" ? "height" : "width";
844
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
845
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
846
+ if (mainAxisCoord < limitMin) {
847
+ mainAxisCoord = limitMin;
848
+ } else if (mainAxisCoord > limitMax) {
849
+ mainAxisCoord = limitMax;
850
+ }
851
+ }
852
+ if (checkCrossAxis) {
853
+ var _middlewareData$offse, _middlewareData$offse2;
854
+ const len = mainAxis === "y" ? "width" : "height";
855
+ const isOriginSide = originSides.has(getSide(placement));
856
+ 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);
857
+ 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);
858
+ if (crossAxisCoord < limitMin) {
859
+ crossAxisCoord = limitMin;
860
+ } else if (crossAxisCoord > limitMax) {
861
+ crossAxisCoord = limitMax;
862
+ }
863
+ }
864
+ return {
865
+ [mainAxis]: mainAxisCoord,
866
+ [crossAxis]: crossAxisCoord
867
+ };
868
+ }
869
+ };
870
+ };
871
+ const size$1 = function(options) {
872
+ if (options === void 0) {
873
+ options = {};
874
+ }
875
+ return {
876
+ name: "size",
877
+ options,
878
+ async fn(state) {
879
+ var _state$middlewareData, _state$middlewareData2;
880
+ const {
881
+ placement,
882
+ rects,
883
+ platform: platform2,
884
+ elements
885
+ } = state;
886
+ const {
887
+ apply = () => {
888
+ },
889
+ ...detectOverflowOptions
890
+ } = evaluate(options, state);
891
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
892
+ const side = getSide(placement);
893
+ const alignment = getAlignment(placement);
894
+ const isYAxis = getSideAxis(placement) === "y";
895
+ const {
896
+ width,
897
+ height
898
+ } = rects.floating;
899
+ let heightSide;
900
+ let widthSide;
901
+ if (side === "top" || side === "bottom") {
902
+ heightSide = side;
903
+ widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
904
+ } else {
905
+ widthSide = side;
906
+ heightSide = alignment === "end" ? "top" : "bottom";
907
+ }
908
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
909
+ const maximumClippingWidth = width - overflow.left - overflow.right;
910
+ const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
911
+ const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
912
+ const noShift = !state.middlewareData.shift;
913
+ let availableHeight = overflowAvailableHeight;
914
+ let availableWidth = overflowAvailableWidth;
915
+ if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
916
+ availableWidth = maximumClippingWidth;
917
+ }
918
+ if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
919
+ availableHeight = maximumClippingHeight;
920
+ }
921
+ if (noShift && !alignment) {
922
+ const xMin = max(overflow.left, 0);
923
+ const xMax = max(overflow.right, 0);
924
+ const yMin = max(overflow.top, 0);
925
+ const yMax = max(overflow.bottom, 0);
926
+ if (isYAxis) {
927
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
928
+ } else {
929
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
930
+ }
931
+ }
932
+ await apply({
933
+ ...state,
934
+ availableWidth,
935
+ availableHeight
936
+ });
937
+ const nextDimensions = await platform2.getDimensions(elements.floating);
938
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
939
+ return {
940
+ reset: {
941
+ rects: true
942
+ }
943
+ };
944
+ }
945
+ return {};
946
+ }
947
+ };
948
+ };
949
+ function hasWindow() {
950
+ return typeof window !== "undefined";
951
+ }
952
+ function getNodeName(node) {
953
+ if (isNode(node)) {
954
+ return (node.nodeName || "").toLowerCase();
955
+ }
956
+ return "#document";
957
+ }
958
+ function getWindow(node) {
959
+ var _node$ownerDocument;
960
+ return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
961
+ }
962
+ function getDocumentElement(node) {
963
+ var _ref;
964
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
965
+ }
966
+ function isNode(value) {
967
+ if (!hasWindow()) {
968
+ return false;
969
+ }
970
+ return value instanceof Node || value instanceof getWindow(value).Node;
971
+ }
972
+ function isElement(value) {
973
+ if (!hasWindow()) {
974
+ return false;
975
+ }
976
+ return value instanceof Element || value instanceof getWindow(value).Element;
977
+ }
978
+ function isHTMLElement(value) {
979
+ if (!hasWindow()) {
980
+ return false;
981
+ }
982
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
983
+ }
984
+ function isShadowRoot(value) {
985
+ if (!hasWindow() || typeof ShadowRoot === "undefined") {
986
+ return false;
987
+ }
988
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
989
+ }
990
+ function isOverflowElement(element) {
991
+ const {
992
+ overflow,
993
+ overflowX,
994
+ overflowY,
995
+ display
996
+ } = getComputedStyle$1(element);
997
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
998
+ }
999
+ function isTableElement(element) {
1000
+ return /^(table|td|th)$/.test(getNodeName(element));
1001
+ }
1002
+ function isTopLayer(element) {
1003
+ try {
1004
+ if (element.matches(":popover-open")) {
1005
+ return true;
1006
+ }
1007
+ } catch (_e) {
1008
+ }
1009
+ try {
1010
+ return element.matches(":modal");
1011
+ } catch (_e) {
1012
+ return false;
1013
+ }
1014
+ }
1015
+ const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
1016
+ const containRe = /paint|layout|strict|content/;
1017
+ const isNotNone = (value) => !!value && value !== "none";
1018
+ let isWebKitValue;
1019
+ function isContainingBlock(elementOrCss) {
1020
+ const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
1021
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
1022
+ }
1023
+ function getContainingBlock(element) {
1024
+ let currentNode = getParentNode(element);
1025
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1026
+ if (isContainingBlock(currentNode)) {
1027
+ return currentNode;
1028
+ } else if (isTopLayer(currentNode)) {
1029
+ return null;
1030
+ }
1031
+ currentNode = getParentNode(currentNode);
1032
+ }
1033
+ return null;
1034
+ }
1035
+ function isWebKit() {
1036
+ if (isWebKitValue == null) {
1037
+ isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
1038
+ }
1039
+ return isWebKitValue;
1040
+ }
1041
+ function isLastTraversableNode(node) {
1042
+ return /^(html|body|#document)$/.test(getNodeName(node));
1043
+ }
1044
+ function getComputedStyle$1(element) {
1045
+ return getWindow(element).getComputedStyle(element);
1046
+ }
1047
+ function getNodeScroll(element) {
1048
+ if (isElement(element)) {
1049
+ return {
1050
+ scrollLeft: element.scrollLeft,
1051
+ scrollTop: element.scrollTop
1052
+ };
1053
+ }
1054
+ return {
1055
+ scrollLeft: element.scrollX,
1056
+ scrollTop: element.scrollY
1057
+ };
1058
+ }
1059
+ function getParentNode(node) {
1060
+ if (getNodeName(node) === "html") {
1061
+ return node;
1062
+ }
1063
+ const result = (
1064
+ // Step into the shadow DOM of the parent of a slotted node.
1065
+ node.assignedSlot || // DOM Element detected.
1066
+ node.parentNode || // ShadowRoot detected.
1067
+ isShadowRoot(node) && node.host || // Fallback.
1068
+ getDocumentElement(node)
1069
+ );
1070
+ return isShadowRoot(result) ? result.host : result;
1071
+ }
1072
+ function getNearestOverflowAncestor(node) {
1073
+ const parentNode = getParentNode(node);
1074
+ if (isLastTraversableNode(parentNode)) {
1075
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
1076
+ }
1077
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1078
+ return parentNode;
1079
+ }
1080
+ return getNearestOverflowAncestor(parentNode);
1081
+ }
1082
+ function getOverflowAncestors(node, list, traverseIframes) {
1083
+ var _node$ownerDocument2;
1084
+ if (list === void 0) {
1085
+ list = [];
1086
+ }
1087
+ if (traverseIframes === void 0) {
1088
+ traverseIframes = true;
1089
+ }
1090
+ const scrollableAncestor = getNearestOverflowAncestor(node);
1091
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1092
+ const win = getWindow(scrollableAncestor);
1093
+ if (isBody) {
1094
+ const frameElement = getFrameElement(win);
1095
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
1096
+ } else {
1097
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1098
+ }
1099
+ }
1100
+ function getFrameElement(win) {
1101
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
1102
+ }
1103
+ function getCssDimensions(element) {
1104
+ const css = getComputedStyle$1(element);
1105
+ let width = parseFloat(css.width) || 0;
1106
+ let height = parseFloat(css.height) || 0;
1107
+ const hasOffset = isHTMLElement(element);
1108
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
1109
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
1110
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
1111
+ if (shouldFallback) {
1112
+ width = offsetWidth;
1113
+ height = offsetHeight;
1114
+ }
1115
+ return {
1116
+ width,
1117
+ height,
1118
+ $: shouldFallback
1119
+ };
1120
+ }
1121
+ function unwrapElement$1(element) {
1122
+ return !isElement(element) ? element.contextElement : element;
1123
+ }
1124
+ function getScale(element) {
1125
+ const domElement = unwrapElement$1(element);
1126
+ if (!isHTMLElement(domElement)) {
1127
+ return createCoords(1);
1128
+ }
1129
+ const rect = domElement.getBoundingClientRect();
1130
+ const {
1131
+ width,
1132
+ height,
1133
+ $
1134
+ } = getCssDimensions(domElement);
1135
+ let x = ($ ? round(rect.width) : rect.width) / width;
1136
+ let y = ($ ? round(rect.height) : rect.height) / height;
1137
+ if (!x || !Number.isFinite(x)) {
1138
+ x = 1;
1139
+ }
1140
+ if (!y || !Number.isFinite(y)) {
1141
+ y = 1;
1142
+ }
1143
+ return {
1144
+ x,
1145
+ y
1146
+ };
1147
+ }
1148
+ const noOffsets = /* @__PURE__ */ createCoords(0);
1149
+ function getVisualOffsets(element) {
1150
+ const win = getWindow(element);
1151
+ if (!isWebKit() || !win.visualViewport) {
1152
+ return noOffsets;
1153
+ }
1154
+ return {
1155
+ x: win.visualViewport.offsetLeft,
1156
+ y: win.visualViewport.offsetTop
1157
+ };
1158
+ }
1159
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1160
+ if (isFixed === void 0) {
1161
+ isFixed = false;
1162
+ }
1163
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1164
+ return false;
1165
+ }
1166
+ return isFixed;
1167
+ }
1168
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1169
+ if (includeScale === void 0) {
1170
+ includeScale = false;
1171
+ }
1172
+ if (isFixedStrategy === void 0) {
1173
+ isFixedStrategy = false;
1174
+ }
1175
+ const clientRect = element.getBoundingClientRect();
1176
+ const domElement = unwrapElement$1(element);
1177
+ let scale = createCoords(1);
1178
+ if (includeScale) {
1179
+ if (offsetParent) {
1180
+ if (isElement(offsetParent)) {
1181
+ scale = getScale(offsetParent);
1182
+ }
1183
+ } else {
1184
+ scale = getScale(element);
1185
+ }
1186
+ }
1187
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1188
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
1189
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
1190
+ let width = clientRect.width / scale.x;
1191
+ let height = clientRect.height / scale.y;
1192
+ if (domElement) {
1193
+ const win = getWindow(domElement);
1194
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1195
+ let currentWin = win;
1196
+ let currentIFrame = getFrameElement(currentWin);
1197
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1198
+ const iframeScale = getScale(currentIFrame);
1199
+ const iframeRect = currentIFrame.getBoundingClientRect();
1200
+ const css = getComputedStyle$1(currentIFrame);
1201
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1202
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1203
+ x *= iframeScale.x;
1204
+ y *= iframeScale.y;
1205
+ width *= iframeScale.x;
1206
+ height *= iframeScale.y;
1207
+ x += left;
1208
+ y += top;
1209
+ currentWin = getWindow(currentIFrame);
1210
+ currentIFrame = getFrameElement(currentWin);
1211
+ }
1212
+ }
1213
+ return rectToClientRect({
1214
+ width,
1215
+ height,
1216
+ x,
1217
+ y
1218
+ });
1219
+ }
1220
+ function getWindowScrollBarX(element, rect) {
1221
+ const leftScroll = getNodeScroll(element).scrollLeft;
1222
+ if (!rect) {
1223
+ return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
1224
+ }
1225
+ return rect.left + leftScroll;
1226
+ }
1227
+ function getHTMLOffset(documentElement, scroll) {
1228
+ const htmlRect = documentElement.getBoundingClientRect();
1229
+ const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
1230
+ const y = htmlRect.top + scroll.scrollTop;
1231
+ return {
1232
+ x,
1233
+ y
1234
+ };
1235
+ }
1236
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1237
+ let {
1238
+ elements,
1239
+ rect,
1240
+ offsetParent,
1241
+ strategy
1242
+ } = _ref;
1243
+ const isFixed = strategy === "fixed";
1244
+ const documentElement = getDocumentElement(offsetParent);
1245
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
1246
+ if (offsetParent === documentElement || topLayer && isFixed) {
1247
+ return rect;
1248
+ }
1249
+ let scroll = {
1250
+ scrollLeft: 0,
1251
+ scrollTop: 0
1252
+ };
1253
+ let scale = createCoords(1);
1254
+ const offsets = createCoords(0);
1255
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1256
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1257
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
1258
+ scroll = getNodeScroll(offsetParent);
1259
+ }
1260
+ if (isOffsetParentAnElement) {
1261
+ const offsetRect = getBoundingClientRect(offsetParent);
1262
+ scale = getScale(offsetParent);
1263
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1264
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1265
+ }
1266
+ }
1267
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1268
+ return {
1269
+ width: rect.width * scale.x,
1270
+ height: rect.height * scale.y,
1271
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
1272
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
1273
+ };
1274
+ }
1275
+ function getClientRects(element) {
1276
+ return Array.from(element.getClientRects());
1277
+ }
1278
+ function getDocumentRect(element) {
1279
+ const html = getDocumentElement(element);
1280
+ const scroll = getNodeScroll(element);
1281
+ const body = element.ownerDocument.body;
1282
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1283
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1284
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1285
+ const y = -scroll.scrollTop;
1286
+ if (getComputedStyle$1(body).direction === "rtl") {
1287
+ x += max(html.clientWidth, body.clientWidth) - width;
1288
+ }
1289
+ return {
1290
+ width,
1291
+ height,
1292
+ x,
1293
+ y
1294
+ };
1295
+ }
1296
+ const SCROLLBAR_MAX = 25;
1297
+ function getViewportRect(element, strategy) {
1298
+ const win = getWindow(element);
1299
+ const html = getDocumentElement(element);
1300
+ const visualViewport = win.visualViewport;
1301
+ let width = html.clientWidth;
1302
+ let height = html.clientHeight;
1303
+ let x = 0;
1304
+ let y = 0;
1305
+ if (visualViewport) {
1306
+ width = visualViewport.width;
1307
+ height = visualViewport.height;
1308
+ const visualViewportBased = isWebKit();
1309
+ if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
1310
+ x = visualViewport.offsetLeft;
1311
+ y = visualViewport.offsetTop;
1312
+ }
1313
+ }
1314
+ const windowScrollbarX = getWindowScrollBarX(html);
1315
+ if (windowScrollbarX <= 0) {
1316
+ const doc = html.ownerDocument;
1317
+ const body = doc.body;
1318
+ const bodyStyles = getComputedStyle(body);
1319
+ const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
1320
+ const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
1321
+ if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
1322
+ width -= clippingStableScrollbarWidth;
1323
+ }
1324
+ } else if (windowScrollbarX <= SCROLLBAR_MAX) {
1325
+ width += windowScrollbarX;
1326
+ }
1327
+ return {
1328
+ width,
1329
+ height,
1330
+ x,
1331
+ y
1332
+ };
1333
+ }
1334
+ function getInnerBoundingClientRect(element, strategy) {
1335
+ const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
1336
+ const top = clientRect.top + element.clientTop;
1337
+ const left = clientRect.left + element.clientLeft;
1338
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1339
+ const width = element.clientWidth * scale.x;
1340
+ const height = element.clientHeight * scale.y;
1341
+ const x = left * scale.x;
1342
+ const y = top * scale.y;
1343
+ return {
1344
+ width,
1345
+ height,
1346
+ x,
1347
+ y
1348
+ };
1349
+ }
1350
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1351
+ let rect;
1352
+ if (clippingAncestor === "viewport") {
1353
+ rect = getViewportRect(element, strategy);
1354
+ } else if (clippingAncestor === "document") {
1355
+ rect = getDocumentRect(getDocumentElement(element));
1356
+ } else if (isElement(clippingAncestor)) {
1357
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1358
+ } else {
1359
+ const visualOffsets = getVisualOffsets(element);
1360
+ rect = {
1361
+ x: clippingAncestor.x - visualOffsets.x,
1362
+ y: clippingAncestor.y - visualOffsets.y,
1363
+ width: clippingAncestor.width,
1364
+ height: clippingAncestor.height
1365
+ };
1366
+ }
1367
+ return rectToClientRect(rect);
1368
+ }
1369
+ function hasFixedPositionAncestor(element, stopNode) {
1370
+ const parentNode = getParentNode(element);
1371
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1372
+ return false;
1373
+ }
1374
+ return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
1375
+ }
1376
+ function getClippingElementAncestors(element, cache) {
1377
+ const cachedResult = cache.get(element);
1378
+ if (cachedResult) {
1379
+ return cachedResult;
1380
+ }
1381
+ let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
1382
+ let currentContainingBlockComputedStyle = null;
1383
+ const elementIsFixed = getComputedStyle$1(element).position === "fixed";
1384
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1385
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1386
+ const computedStyle = getComputedStyle$1(currentNode);
1387
+ const currentNodeIsContaining = isContainingBlock(currentNode);
1388
+ if (!currentNodeIsContaining && computedStyle.position === "fixed") {
1389
+ currentContainingBlockComputedStyle = null;
1390
+ }
1391
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1392
+ if (shouldDropCurrentNode) {
1393
+ result = result.filter((ancestor) => ancestor !== currentNode);
1394
+ } else {
1395
+ currentContainingBlockComputedStyle = computedStyle;
1396
+ }
1397
+ currentNode = getParentNode(currentNode);
1398
+ }
1399
+ cache.set(element, result);
1400
+ return result;
1401
+ }
1402
+ function getClippingRect(_ref) {
1403
+ let {
1404
+ element,
1405
+ boundary,
1406
+ rootBoundary,
1407
+ strategy
1408
+ } = _ref;
1409
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
1410
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1411
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
1412
+ let top = firstRect.top;
1413
+ let right = firstRect.right;
1414
+ let bottom = firstRect.bottom;
1415
+ let left = firstRect.left;
1416
+ for (let i = 1; i < clippingAncestors.length; i++) {
1417
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
1418
+ top = max(rect.top, top);
1419
+ right = min(rect.right, right);
1420
+ bottom = min(rect.bottom, bottom);
1421
+ left = max(rect.left, left);
1422
+ }
1423
+ return {
1424
+ width: right - left,
1425
+ height: bottom - top,
1426
+ x: left,
1427
+ y: top
1428
+ };
1429
+ }
1430
+ function getDimensions(element) {
1431
+ const {
1432
+ width,
1433
+ height
1434
+ } = getCssDimensions(element);
1435
+ return {
1436
+ width,
1437
+ height
1438
+ };
1439
+ }
1440
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1441
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1442
+ const documentElement = getDocumentElement(offsetParent);
1443
+ const isFixed = strategy === "fixed";
1444
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1445
+ let scroll = {
1446
+ scrollLeft: 0,
1447
+ scrollTop: 0
1448
+ };
1449
+ const offsets = createCoords(0);
1450
+ function setLeftRTLScrollbarOffset() {
1451
+ offsets.x = getWindowScrollBarX(documentElement);
1452
+ }
1453
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1454
+ if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
1455
+ scroll = getNodeScroll(offsetParent);
1456
+ }
1457
+ if (isOffsetParentAnElement) {
1458
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1459
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1460
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1461
+ } else if (documentElement) {
1462
+ setLeftRTLScrollbarOffset();
1463
+ }
1464
+ }
1465
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
1466
+ setLeftRTLScrollbarOffset();
1467
+ }
1468
+ const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1469
+ const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
1470
+ const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
1471
+ return {
1472
+ x,
1473
+ y,
1474
+ width: rect.width,
1475
+ height: rect.height
1476
+ };
1477
+ }
1478
+ function isStaticPositioned(element) {
1479
+ return getComputedStyle$1(element).position === "static";
1480
+ }
1481
+ function getTrueOffsetParent(element, polyfill) {
1482
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
1483
+ return null;
1484
+ }
1485
+ if (polyfill) {
1486
+ return polyfill(element);
1487
+ }
1488
+ let rawOffsetParent = element.offsetParent;
1489
+ if (getDocumentElement(element) === rawOffsetParent) {
1490
+ rawOffsetParent = rawOffsetParent.ownerDocument.body;
1491
+ }
1492
+ return rawOffsetParent;
1493
+ }
1494
+ function getOffsetParent(element, polyfill) {
1495
+ const win = getWindow(element);
1496
+ if (isTopLayer(element)) {
1497
+ return win;
1498
+ }
1499
+ if (!isHTMLElement(element)) {
1500
+ let svgOffsetParent = getParentNode(element);
1501
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1502
+ if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1503
+ return svgOffsetParent;
1504
+ }
1505
+ svgOffsetParent = getParentNode(svgOffsetParent);
1506
+ }
1507
+ return win;
1508
+ }
1509
+ let offsetParent = getTrueOffsetParent(element, polyfill);
1510
+ while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1511
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1512
+ }
1513
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1514
+ return win;
1515
+ }
1516
+ return offsetParent || getContainingBlock(element) || win;
1517
+ }
1518
+ const getElementRects = async function(data) {
1519
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1520
+ const getDimensionsFn = this.getDimensions;
1521
+ const floatingDimensions = await getDimensionsFn(data.floating);
1522
+ return {
1523
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1524
+ floating: {
1525
+ x: 0,
1526
+ y: 0,
1527
+ width: floatingDimensions.width,
1528
+ height: floatingDimensions.height
1529
+ }
1530
+ };
1531
+ };
1532
+ function isRTL(element) {
1533
+ return getComputedStyle$1(element).direction === "rtl";
1534
+ }
1535
+ const platform = {
1536
+ convertOffsetParentRelativeRectToViewportRelativeRect,
1537
+ getDocumentElement,
1538
+ getClippingRect,
1539
+ getOffsetParent,
1540
+ getElementRects,
1541
+ getClientRects,
1542
+ getDimensions,
1543
+ getScale,
1544
+ isElement,
1545
+ isRTL
1546
+ };
1547
+ function rectsAreEqual(a, b) {
1548
+ return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1549
+ }
1550
+ function observeMove(element, onMove) {
1551
+ let io = null;
1552
+ let timeoutId;
1553
+ const root = getDocumentElement(element);
1554
+ function cleanup() {
1555
+ var _io;
1556
+ clearTimeout(timeoutId);
1557
+ (_io = io) == null || _io.disconnect();
1558
+ io = null;
1559
+ }
1560
+ function refresh(skip, threshold) {
1561
+ if (skip === void 0) {
1562
+ skip = false;
1563
+ }
1564
+ if (threshold === void 0) {
1565
+ threshold = 1;
1566
+ }
1567
+ cleanup();
1568
+ const elementRectForRootMargin = element.getBoundingClientRect();
1569
+ const {
1570
+ left,
1571
+ top,
1572
+ width,
1573
+ height
1574
+ } = elementRectForRootMargin;
1575
+ if (!skip) {
1576
+ onMove();
1577
+ }
1578
+ if (!width || !height) {
1579
+ return;
1580
+ }
1581
+ const insetTop = floor(top);
1582
+ const insetRight = floor(root.clientWidth - (left + width));
1583
+ const insetBottom = floor(root.clientHeight - (top + height));
1584
+ const insetLeft = floor(left);
1585
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1586
+ const options = {
1587
+ rootMargin,
1588
+ threshold: max(0, min(1, threshold)) || 1
1589
+ };
1590
+ let isFirstUpdate = true;
1591
+ function handleObserve(entries) {
1592
+ const ratio = entries[0].intersectionRatio;
1593
+ if (ratio !== threshold) {
1594
+ if (!isFirstUpdate) {
1595
+ return refresh();
1596
+ }
1597
+ if (!ratio) {
1598
+ timeoutId = setTimeout(() => {
1599
+ refresh(false, 1e-7);
1600
+ }, 1e3);
1601
+ } else {
1602
+ refresh(false, ratio);
1603
+ }
1604
+ }
1605
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
1606
+ refresh();
1607
+ }
1608
+ isFirstUpdate = false;
1609
+ }
1610
+ try {
1611
+ io = new IntersectionObserver(handleObserve, {
1612
+ ...options,
1613
+ // Handle <iframe>s
1614
+ root: root.ownerDocument
1615
+ });
1616
+ } catch (_e) {
1617
+ io = new IntersectionObserver(handleObserve, options);
1618
+ }
1619
+ io.observe(element);
1620
+ }
1621
+ refresh(true);
1622
+ return cleanup;
1623
+ }
1624
+ function autoUpdate(reference, floating, update, options) {
1625
+ if (options === void 0) {
1626
+ options = {};
1627
+ }
1628
+ const {
1629
+ ancestorScroll = true,
1630
+ ancestorResize = true,
1631
+ elementResize = typeof ResizeObserver === "function",
1632
+ layoutShift = typeof IntersectionObserver === "function",
1633
+ animationFrame = false
1634
+ } = options;
1635
+ const referenceEl = unwrapElement$1(reference);
1636
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
1637
+ ancestors.forEach((ancestor) => {
1638
+ ancestorScroll && ancestor.addEventListener("scroll", update, {
1639
+ passive: true
1640
+ });
1641
+ ancestorResize && ancestor.addEventListener("resize", update);
1642
+ });
1643
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1644
+ let reobserveFrame = -1;
1645
+ let resizeObserver = null;
1646
+ if (elementResize) {
1647
+ resizeObserver = new ResizeObserver((_ref) => {
1648
+ let [firstEntry] = _ref;
1649
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
1650
+ resizeObserver.unobserve(floating);
1651
+ cancelAnimationFrame(reobserveFrame);
1652
+ reobserveFrame = requestAnimationFrame(() => {
1653
+ var _resizeObserver;
1654
+ (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1655
+ });
1656
+ }
1657
+ update();
1658
+ });
1659
+ if (referenceEl && !animationFrame) {
1660
+ resizeObserver.observe(referenceEl);
1661
+ }
1662
+ if (floating) {
1663
+ resizeObserver.observe(floating);
1664
+ }
1665
+ }
1666
+ let frameId;
1667
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1668
+ if (animationFrame) {
1669
+ frameLoop();
1670
+ }
1671
+ function frameLoop() {
1672
+ const nextRefRect = getBoundingClientRect(reference);
1673
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
1674
+ update();
1675
+ }
1676
+ prevRefRect = nextRefRect;
1677
+ frameId = requestAnimationFrame(frameLoop);
1678
+ }
1679
+ update();
1680
+ return () => {
1681
+ var _resizeObserver2;
1682
+ ancestors.forEach((ancestor) => {
1683
+ ancestorScroll && ancestor.removeEventListener("scroll", update);
1684
+ ancestorResize && ancestor.removeEventListener("resize", update);
1685
+ });
1686
+ cleanupIo == null || cleanupIo();
1687
+ (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1688
+ resizeObserver = null;
1689
+ if (animationFrame) {
1690
+ cancelAnimationFrame(frameId);
1691
+ }
1692
+ };
1693
+ }
1694
+ const offset = offset$1;
1695
+ const shift = shift$1;
1696
+ const flip = flip$1;
1697
+ const size = size$1;
1698
+ const hide = hide$1;
1699
+ const arrow$1 = arrow$2;
1700
+ const limitShift = limitShift$1;
1701
+ const computePosition = (reference, floating, options) => {
1702
+ const cache = /* @__PURE__ */ new Map();
1703
+ const mergedOptions = {
1704
+ platform,
1705
+ ...options
1706
+ };
1707
+ const platformWithCache = {
1708
+ ...mergedOptions.platform,
1709
+ _c: cache
1710
+ };
1711
+ return computePosition$1(reference, floating, {
1712
+ ...mergedOptions,
1713
+ platform: platformWithCache
1714
+ });
1715
+ };
1716
+ function isComponentPublicInstance(target) {
1717
+ return target != null && typeof target === "object" && "$el" in target;
1718
+ }
1719
+ function unwrapElement(target) {
1720
+ if (isComponentPublicInstance(target)) {
1721
+ const element = target.$el;
1722
+ return isNode(element) && getNodeName(element) === "#comment" ? null : element;
1723
+ }
1724
+ return target;
1725
+ }
1726
+ function toValue(source) {
1727
+ return typeof source === "function" ? source() : unref(source);
1728
+ }
1729
+ function arrow(options) {
1730
+ return {
1731
+ name: "arrow",
1732
+ options,
1733
+ fn(args) {
1734
+ const element = unwrapElement(toValue(options.element));
1735
+ if (element == null) {
1736
+ return {};
1737
+ }
1738
+ return arrow$1({
1739
+ element,
1740
+ padding: options.padding
1741
+ }).fn(args);
1742
+ }
1743
+ };
1744
+ }
1745
+ function getDPR(element) {
1746
+ if (typeof window === "undefined") {
1747
+ return 1;
1748
+ }
1749
+ const win = element.ownerDocument.defaultView || window;
1750
+ return win.devicePixelRatio || 1;
1751
+ }
1752
+ function roundByDPR(element, value) {
1753
+ const dpr = getDPR(element);
1754
+ return Math.round(value * dpr) / dpr;
1755
+ }
1756
+ function useFloating(reference, floating, options) {
1757
+ if (options === void 0) {
1758
+ options = {};
1759
+ }
1760
+ const whileElementsMountedOption = options.whileElementsMounted;
1761
+ const openOption = computed(() => {
1762
+ var _toValue;
1763
+ return (_toValue = toValue(options.open)) != null ? _toValue : true;
1764
+ });
1765
+ const middlewareOption = computed(() => toValue(options.middleware));
1766
+ const placementOption = computed(() => {
1767
+ var _toValue2;
1768
+ return (_toValue2 = toValue(options.placement)) != null ? _toValue2 : "bottom";
1769
+ });
1770
+ const strategyOption = computed(() => {
1771
+ var _toValue3;
1772
+ return (_toValue3 = toValue(options.strategy)) != null ? _toValue3 : "absolute";
1773
+ });
1774
+ const transformOption = computed(() => {
1775
+ var _toValue4;
1776
+ return (_toValue4 = toValue(options.transform)) != null ? _toValue4 : true;
1777
+ });
1778
+ const referenceElement = computed(() => unwrapElement(reference.value));
1779
+ const floatingElement = computed(() => unwrapElement(floating.value));
1780
+ const x = ref(0);
1781
+ const y = ref(0);
1782
+ const strategy = ref(strategyOption.value);
1783
+ const placement = ref(placementOption.value);
1784
+ const middlewareData = shallowRef({});
1785
+ const isPositioned = ref(false);
1786
+ const floatingStyles = computed(() => {
1787
+ const initialStyles = {
1788
+ position: strategy.value,
1789
+ left: "0",
1790
+ top: "0"
1791
+ };
1792
+ if (!floatingElement.value) {
1793
+ return initialStyles;
1794
+ }
1795
+ const xVal = roundByDPR(floatingElement.value, x.value);
1796
+ const yVal = roundByDPR(floatingElement.value, y.value);
1797
+ if (transformOption.value) {
1798
+ return {
1799
+ ...initialStyles,
1800
+ transform: "translate(" + xVal + "px, " + yVal + "px)",
1801
+ ...getDPR(floatingElement.value) >= 1.5 && {
1802
+ willChange: "transform"
1803
+ }
1804
+ };
1805
+ }
1806
+ return {
1807
+ position: strategy.value,
1808
+ left: xVal + "px",
1809
+ top: yVal + "px"
1810
+ };
1811
+ });
1812
+ let whileElementsMountedCleanup;
1813
+ function update() {
1814
+ if (referenceElement.value == null || floatingElement.value == null) {
1815
+ return;
1816
+ }
1817
+ const open = openOption.value;
1818
+ computePosition(referenceElement.value, floatingElement.value, {
1819
+ middleware: middlewareOption.value,
1820
+ placement: placementOption.value,
1821
+ strategy: strategyOption.value
1822
+ }).then((position) => {
1823
+ x.value = position.x;
1824
+ y.value = position.y;
1825
+ strategy.value = position.strategy;
1826
+ placement.value = position.placement;
1827
+ middlewareData.value = position.middlewareData;
1828
+ isPositioned.value = open !== false;
1829
+ });
1830
+ }
1831
+ function cleanup() {
1832
+ if (typeof whileElementsMountedCleanup === "function") {
1833
+ whileElementsMountedCleanup();
1834
+ whileElementsMountedCleanup = void 0;
1835
+ }
1836
+ }
1837
+ function attach() {
1838
+ cleanup();
1839
+ if (whileElementsMountedOption === void 0) {
1840
+ update();
1841
+ return;
1842
+ }
1843
+ if (referenceElement.value != null && floatingElement.value != null) {
1844
+ whileElementsMountedCleanup = whileElementsMountedOption(referenceElement.value, floatingElement.value, update);
1845
+ return;
1846
+ }
1847
+ }
1848
+ function reset() {
1849
+ if (!openOption.value) {
1850
+ isPositioned.value = false;
1851
+ }
1852
+ }
1853
+ watch([middlewareOption, placementOption, strategyOption, openOption], update, {
1854
+ flush: "sync"
1855
+ });
1856
+ watch([referenceElement, floatingElement], attach, {
1857
+ flush: "sync"
1858
+ });
1859
+ watch(openOption, reset, {
1860
+ flush: "sync"
1861
+ });
1862
+ if (getCurrentScope()) {
1863
+ onScopeDispose(cleanup);
1864
+ }
1865
+ return {
1866
+ x: shallowReadonly(x),
1867
+ y: shallowReadonly(y),
1868
+ strategy: shallowReadonly(strategy),
1869
+ placement: shallowReadonly(placement),
1870
+ middlewareData: shallowReadonly(middlewareData),
1871
+ isPositioned: shallowReadonly(isPositioned),
1872
+ floatingStyles,
1873
+ update
1874
+ };
1875
+ }
1876
+ const PopperContentPropsDefaultValue = {
1877
+ side: "bottom",
1878
+ sideOffset: 0,
1879
+ sideFlip: true,
1880
+ align: "center",
1881
+ alignOffset: 0,
1882
+ alignFlip: true,
1883
+ arrowPadding: 0,
1884
+ hideShiftedArrow: true,
1885
+ avoidCollisions: true,
1886
+ collisionBoundary: () => [],
1887
+ collisionPadding: 0,
1888
+ sticky: "partial",
1889
+ hideWhenDetached: false,
1890
+ positionStrategy: "fixed",
1891
+ updatePositionStrategy: "optimized",
1892
+ prioritizePosition: false
1893
+ };
1894
+ const [injectPopperContentContext, providePopperContentContext] = createContext("PopperContent");
1895
+ var PopperContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
1896
+ inheritAttrs: false,
1897
+ __name: "PopperContent",
1898
+ props: /* @__PURE__ */ mergeDefaults({
1899
+ side: {
1900
+ type: null,
1901
+ required: false
1902
+ },
1903
+ sideOffset: {
1904
+ type: Number,
1905
+ required: false
1906
+ },
1907
+ sideFlip: {
1908
+ type: Boolean,
1909
+ required: false
1910
+ },
1911
+ align: {
1912
+ type: null,
1913
+ required: false
1914
+ },
1915
+ alignOffset: {
1916
+ type: Number,
1917
+ required: false
1918
+ },
1919
+ alignFlip: {
1920
+ type: Boolean,
1921
+ required: false
1922
+ },
1923
+ avoidCollisions: {
1924
+ type: Boolean,
1925
+ required: false
1926
+ },
1927
+ collisionBoundary: {
1928
+ type: null,
1929
+ required: false
1930
+ },
1931
+ collisionPadding: {
1932
+ type: [Number, Object],
1933
+ required: false
1934
+ },
1935
+ arrowPadding: {
1936
+ type: Number,
1937
+ required: false
1938
+ },
1939
+ hideShiftedArrow: {
1940
+ type: Boolean,
1941
+ required: false
1942
+ },
1943
+ sticky: {
1944
+ type: String,
1945
+ required: false
1946
+ },
1947
+ hideWhenDetached: {
1948
+ type: Boolean,
1949
+ required: false
1950
+ },
1951
+ positionStrategy: {
1952
+ type: String,
1953
+ required: false
1954
+ },
1955
+ updatePositionStrategy: {
1956
+ type: String,
1957
+ required: false
1958
+ },
1959
+ disableUpdateOnLayoutShift: {
1960
+ type: Boolean,
1961
+ required: false
1962
+ },
1963
+ prioritizePosition: {
1964
+ type: Boolean,
1965
+ required: false
1966
+ },
1967
+ reference: {
1968
+ type: null,
1969
+ required: false
1970
+ },
1971
+ asChild: {
1972
+ type: Boolean,
1973
+ required: false
1974
+ },
1975
+ as: {
1976
+ type: null,
1977
+ required: false
1978
+ }
1979
+ }, { ...PopperContentPropsDefaultValue }),
1980
+ emits: ["placed"],
1981
+ setup(__props, { emit: __emit }) {
1982
+ const props = __props;
1983
+ const emits = __emit;
1984
+ const rootContext = injectPopperRootContext();
1985
+ const { forwardRef, currentElement: contentElement } = useForwardExpose();
1986
+ const floatingRef = ref();
1987
+ const arrow$12 = ref();
1988
+ const { width: arrowWidth, height: arrowHeight } = useSize(arrow$12);
1989
+ const desiredPlacement = computed(() => props.side + (props.align !== "center" ? `-${props.align}` : ""));
1990
+ const collisionPadding = computed(() => {
1991
+ return typeof props.collisionPadding === "number" ? props.collisionPadding : {
1992
+ top: 0,
1993
+ right: 0,
1994
+ bottom: 0,
1995
+ left: 0,
1996
+ ...props.collisionPadding
1997
+ };
1998
+ });
1999
+ const boundary = computed(() => {
2000
+ return Array.isArray(props.collisionBoundary) ? props.collisionBoundary : [props.collisionBoundary];
2001
+ });
2002
+ const detectOverflowOptions = computed(() => {
2003
+ return {
2004
+ padding: collisionPadding.value,
2005
+ boundary: boundary.value.filter(isNotNull),
2006
+ altBoundary: boundary.value.length > 0
2007
+ };
2008
+ });
2009
+ const flipOptions = computed(() => {
2010
+ return {
2011
+ mainAxis: props.sideFlip,
2012
+ crossAxis: props.alignFlip
2013
+ };
2014
+ });
2015
+ const computedMiddleware = computedEager(() => {
2016
+ return [
2017
+ offset({
2018
+ mainAxis: props.sideOffset + arrowHeight.value,
2019
+ alignmentAxis: props.alignOffset
2020
+ }),
2021
+ props.prioritizePosition && props.avoidCollisions && flip({
2022
+ ...detectOverflowOptions.value,
2023
+ ...flipOptions.value
2024
+ }),
2025
+ props.avoidCollisions && shift({
2026
+ mainAxis: true,
2027
+ crossAxis: !!props.prioritizePosition,
2028
+ limiter: props.sticky === "partial" ? limitShift() : void 0,
2029
+ ...detectOverflowOptions.value
2030
+ }),
2031
+ !props.prioritizePosition && props.avoidCollisions && flip({
2032
+ ...detectOverflowOptions.value,
2033
+ ...flipOptions.value
2034
+ }),
2035
+ size({
2036
+ ...detectOverflowOptions.value,
2037
+ apply: ({ elements, rects, availableWidth, availableHeight }) => {
2038
+ const { width: anchorWidth, height: anchorHeight } = rects.reference;
2039
+ const contentStyle = elements.floating.style;
2040
+ contentStyle.setProperty("--reka-popper-available-width", `${availableWidth}px`);
2041
+ contentStyle.setProperty("--reka-popper-available-height", `${availableHeight}px`);
2042
+ contentStyle.setProperty("--reka-popper-anchor-width", `${anchorWidth}px`);
2043
+ contentStyle.setProperty("--reka-popper-anchor-height", `${anchorHeight}px`);
2044
+ }
2045
+ }),
2046
+ arrow$12.value && arrow({
2047
+ element: arrow$12.value,
2048
+ padding: props.arrowPadding
2049
+ }),
2050
+ transformOrigin({
2051
+ arrowWidth: arrowWidth.value,
2052
+ arrowHeight: arrowHeight.value
2053
+ }),
2054
+ props.hideWhenDetached && hide({
2055
+ strategy: "referenceHidden",
2056
+ ...detectOverflowOptions.value
2057
+ })
2058
+ ];
2059
+ });
2060
+ const reference = computed(() => props.reference ?? rootContext.anchor.value);
2061
+ const { floatingStyles, placement, isPositioned, middlewareData } = useFloating(reference, floatingRef, {
2062
+ strategy: props.positionStrategy,
2063
+ placement: desiredPlacement,
2064
+ whileElementsMounted: (...args) => {
2065
+ const cleanup = autoUpdate(...args, {
2066
+ layoutShift: !props.disableUpdateOnLayoutShift,
2067
+ animationFrame: props.updatePositionStrategy === "always"
2068
+ });
2069
+ return cleanup;
2070
+ },
2071
+ middleware: computedMiddleware
2072
+ });
2073
+ const placedSide = computed(() => getSideAndAlignFromPlacement(placement.value)[0]);
2074
+ const placedAlign = computed(() => getSideAndAlignFromPlacement(placement.value)[1]);
2075
+ watchPostEffect(() => {
2076
+ if (isPositioned.value) emits("placed");
2077
+ });
2078
+ const shouldHideArrow = computed(() => {
2079
+ var _a;
2080
+ const cannotCenterArrow = ((_a = middlewareData.value.arrow) == null ? void 0 : _a.centerOffset) !== 0;
2081
+ return props.hideShiftedArrow && cannotCenterArrow;
2082
+ });
2083
+ const contentZIndex = ref("");
2084
+ watchEffect(() => {
2085
+ if (contentElement.value) contentZIndex.value = window.getComputedStyle(contentElement.value).zIndex;
2086
+ });
2087
+ const arrowX = computed(() => {
2088
+ var _a;
2089
+ return ((_a = middlewareData.value.arrow) == null ? void 0 : _a.x) ?? 0;
2090
+ });
2091
+ const arrowY = computed(() => {
2092
+ var _a;
2093
+ return ((_a = middlewareData.value.arrow) == null ? void 0 : _a.y) ?? 0;
2094
+ });
2095
+ providePopperContentContext({
2096
+ placedSide,
2097
+ onArrowChange: (element) => arrow$12.value = element,
2098
+ arrowX,
2099
+ arrowY,
2100
+ shouldHideArrow
2101
+ });
2102
+ return (_ctx, _cache) => {
2103
+ var _a, _b, _c;
2104
+ return openBlock(), createElementBlock("div", {
2105
+ ref_key: "floatingRef",
2106
+ ref: floatingRef,
2107
+ "data-reka-popper-content-wrapper": "",
2108
+ style: normalizeStyle({
2109
+ ...unref(floatingStyles),
2110
+ transform: unref(isPositioned) ? unref(floatingStyles).transform : "translate(0, -200%)",
2111
+ minWidth: "max-content",
2112
+ zIndex: contentZIndex.value,
2113
+ ["--reka-popper-transform-origin"]: [(_a = unref(middlewareData).transformOrigin) == null ? void 0 : _a.x, (_b = unref(middlewareData).transformOrigin) == null ? void 0 : _b.y].join(" "),
2114
+ ...((_c = unref(middlewareData).hide) == null ? void 0 : _c.referenceHidden) && {
2115
+ visibility: "hidden",
2116
+ pointerEvents: "none"
2117
+ }
2118
+ })
2119
+ }, [createVNode(unref(Primitive), mergeProps({ ref: unref(forwardRef) }, _ctx.$attrs, {
2120
+ "as-child": props.asChild,
2121
+ as: _ctx.as,
2122
+ "data-side": placedSide.value,
2123
+ "data-align": placedAlign.value,
2124
+ style: { animation: !unref(isPositioned) ? "none" : void 0 }
2125
+ }), {
2126
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2127
+ _: 3
2128
+ }, 16, [
2129
+ "as-child",
2130
+ "as",
2131
+ "data-side",
2132
+ "data-align",
2133
+ "style"
2134
+ ])], 4);
2135
+ };
2136
+ }
2137
+ });
2138
+ var PopperContent_default = PopperContent_vue_vue_type_script_setup_true_lang_default;
2139
+ export {
2140
+ PopperAnchor_default as P,
2141
+ PopperRoot_default as a,
2142
+ PopperContent_default as b,
2143
+ injectPopperContentContext as i
2144
+ };