@swisspost/design-system-components 9.0.0-next.2 → 9.0.0-next.21

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 (538) hide show
  1. package/dist/.config/bindings.angular.js +4 -0
  2. package/dist/cjs/{attribute-observer-10f08c04.js → attribute-observer-6d8b886b.js} +4 -4
  3. package/dist/cjs/check-non-empty-bd99d236.js +15 -0
  4. package/dist/cjs/check-one-of-75d270b5.js +13 -0
  5. package/dist/cjs/check-type-cdbf6d29.js +21 -0
  6. package/dist/cjs/check-url-220a286c.js +19 -0
  7. package/dist/cjs/debounce-158fd76f.js +13 -0
  8. package/dist/cjs/fade-72d5ef55.js +14 -0
  9. package/dist/cjs/get-root-7a3498ef.js +11 -0
  10. package/dist/cjs/index-23e36ff7.js +37 -0
  11. package/dist/cjs/{index-c15bd800.js → index-5acef487.js} +54 -17
  12. package/dist/cjs/index.browser-2f65f583.js +15 -0
  13. package/dist/cjs/index.cjs.js +56 -27
  14. package/dist/cjs/loader.cjs.js +2 -2
  15. package/dist/cjs/{package-a7150f64.js → package-c6bc9e82.js} +1 -1
  16. package/dist/cjs/{post-accordion-62d2fd79.js → post-accordion-d1345784.js} +9 -8
  17. package/dist/cjs/post-accordion-item-a796d803.js +64 -0
  18. package/dist/cjs/post-accordion-item.cjs.entry.js +8 -5
  19. package/dist/cjs/post-accordion.cjs.entry.js +4 -4
  20. package/dist/cjs/post-avatar-b4e96354.js +144 -0
  21. package/dist/cjs/post-avatar.cjs.entry.js +13 -0
  22. package/dist/cjs/post-back-to-top-fc541c6b.js +76 -0
  23. package/dist/cjs/post-back-to-top.cjs.entry.js +15 -0
  24. package/dist/cjs/post-banner-46522b4f.js +96 -0
  25. package/dist/cjs/post-banner.cjs.entry.js +19 -0
  26. package/dist/cjs/post-breadcrumb-799d34da.js +112 -0
  27. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +17 -0
  28. package/dist/cjs/post-breadcrumb.cjs.entry.js +13 -0
  29. package/dist/cjs/post-card-control-7bf7d3f2.js +283 -0
  30. package/dist/cjs/post-card-control.cjs.entry.js +5 -5
  31. package/dist/cjs/post-closebutton_15.cjs.entry.js +34 -0
  32. package/dist/cjs/{post-collapsible-trigger-9dca8493.js → post-collapsible-trigger-0568e3ec.js} +50 -56
  33. package/dist/cjs/post-collapsible_2.cjs.entry.js +10 -6
  34. package/dist/cjs/post-components.cjs.js +2 -2
  35. package/dist/cjs/post-footer-f87a556b.js +88 -0
  36. package/dist/cjs/post-footer.cjs.entry.js +11 -0
  37. package/dist/cjs/post-linkarea-0ccf93fc.js +30 -0
  38. package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
  39. package/dist/cjs/post-menu-item-eba24c40.js +68 -0
  40. package/dist/cjs/post-popover-35f679f6.js +106 -0
  41. package/dist/cjs/post-popover.cjs.entry.js +4 -4
  42. package/dist/cjs/{post-rating-db5a397a.js → post-rating-d12fa214.js} +16 -6
  43. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  44. package/dist/cjs/post-tab-header-89dca04b.js +33 -0
  45. package/dist/cjs/post-tab-header.cjs.entry.js +5 -4
  46. package/dist/cjs/{post-tab-panel-d59cf1ec.js → post-tab-panel-ad1ab180.js} +6 -5
  47. package/dist/cjs/post-tab-panel.cjs.entry.js +4 -3
  48. package/dist/cjs/{post-tabs-7afae61a.js → post-tabs-0db75745.js} +23 -16
  49. package/dist/cjs/post-tabs.cjs.entry.js +4 -4
  50. package/dist/cjs/post-tag-396a46c9.js +47 -0
  51. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  52. package/dist/cjs/post-togglebutton-69983699.js +3861 -0
  53. package/dist/cjs/{post-tooltip-432852c7.js → post-tooltip-7174ea97.js} +38 -25
  54. package/dist/cjs/post-tooltip.cjs.entry.js +8 -6
  55. package/dist/cjs/slide-8ae17ee4.js +28 -0
  56. package/dist/collection/animations/collapse.js +5 -5
  57. package/dist/collection/animations/fade.js +6 -2
  58. package/dist/collection/animations/slide.js +23 -0
  59. package/dist/collection/collection-manifest.json +22 -3
  60. package/dist/collection/components/post-accordion/post-accordion.css +1 -1
  61. package/dist/collection/components/post-accordion/post-accordion.js +5 -3
  62. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  63. package/dist/collection/components/post-accordion-item/post-accordion-item.js +29 -11
  64. package/dist/collection/components/post-avatar/post-avatar.css +3 -0
  65. package/dist/collection/components/post-avatar/post-avatar.js +234 -0
  66. package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -0
  67. package/dist/collection/components/post-back-to-top/post-back-to-top.js +109 -0
  68. package/dist/collection/components/post-banner/banner-types.js +1 -0
  69. package/dist/collection/components/post-banner/post-banner.css +3 -0
  70. package/dist/collection/components/{post-alert/post-alert.js → post-banner/post-banner.js} +51 -73
  71. package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +3 -0
  72. package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +163 -0
  73. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -0
  74. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +98 -0
  75. package/dist/collection/components/post-card-control/post-card-control.css +1 -1
  76. package/dist/collection/components/post-card-control/post-card-control.js +55 -43
  77. package/dist/collection/components/post-closebutton/post-closebutton.js +13 -0
  78. package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
  79. package/dist/collection/components/post-collapsible/post-collapsible.js +15 -6
  80. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +21 -20
  81. package/dist/collection/components/post-footer/post-footer.css +1 -0
  82. package/dist/collection/components/post-footer/post-footer.js +76 -0
  83. package/dist/collection/components/post-header/post-header.css +1 -0
  84. package/dist/collection/components/post-header/post-header.js +267 -0
  85. package/dist/collection/components/post-icon/post-icon.js +80 -47
  86. package/dist/collection/components/post-language-option/post-language-option.css +3 -0
  87. package/dist/collection/components/post-language-option/post-language-option.js +224 -0
  88. package/dist/collection/components/post-language-switch/post-language-switch.css +1 -0
  89. package/dist/collection/components/post-language-switch/post-language-switch.js +164 -0
  90. package/dist/collection/components/post-language-switch/switch-variants.js +1 -0
  91. package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
  92. package/dist/collection/components/post-linkarea/post-linkarea.js +30 -0
  93. package/dist/collection/components/post-list/post-list.css +3 -0
  94. package/dist/collection/components/post-list/post-list.js +90 -0
  95. package/dist/collection/components/post-list-item/post-list-item.css +1 -0
  96. package/dist/collection/components/post-list-item/post-list-item.js +26 -0
  97. package/dist/collection/components/post-logo/post-logo.css +1 -1
  98. package/dist/collection/components/post-logo/post-logo.js +4 -3
  99. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -0
  100. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +255 -0
  101. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -0
  102. package/dist/collection/components/post-megadropdown/post-megadropdown.js +268 -0
  103. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -0
  104. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +127 -0
  105. package/dist/collection/components/post-menu/post-menu.css +3 -0
  106. package/dist/collection/components/post-menu/post-menu.js +297 -0
  107. package/dist/collection/components/post-menu-item/post-menu-item.js +8 -0
  108. package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +1 -0
  109. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +122 -0
  110. package/dist/collection/components/post-popover/post-popover.css +1 -1
  111. package/dist/collection/components/post-popover/post-popover.js +6 -3
  112. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  113. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +193 -38
  114. package/dist/collection/components/post-rating/post-rating.css +1 -1
  115. package/dist/collection/components/post-rating/post-rating.js +13 -2
  116. package/dist/collection/components/post-tab-header/post-tab-header.css +2 -2
  117. package/dist/collection/components/post-tab-header/post-tab-header.js +6 -4
  118. package/dist/collection/components/post-tab-panel/post-tab-panel.js +4 -2
  119. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  120. package/dist/collection/components/post-tabs/post-tabs.js +17 -14
  121. package/dist/collection/components/post-tag/post-tag.css +1 -1
  122. package/dist/collection/components/post-tag/post-tag.js +3 -2
  123. package/dist/collection/components/post-togglebutton/post-togglebutton.css +1 -0
  124. package/dist/collection/components/post-togglebutton/post-togglebutton.js +75 -0
  125. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  126. package/dist/collection/components/post-tooltip/post-tooltip.js +35 -17
  127. package/dist/collection/index.js +21 -2
  128. package/dist/collection/utils/attribute-observer.js +4 -4
  129. package/dist/collection/utils/breakpoints.js +50 -0
  130. package/dist/collection/utils/component-on-ready.js +4 -4
  131. package/dist/collection/utils/debounce.js +2 -1
  132. package/dist/collection/utils/get-focusable-children.js +33 -0
  133. package/dist/collection/utils/property-checkers/check-non-empty.js +6 -2
  134. package/dist/collection/utils/property-checkers/check-one-of.js +8 -3
  135. package/dist/collection/utils/property-checkers/check-pattern.js +8 -3
  136. package/dist/collection/utils/property-checkers/check-type.js +11 -6
  137. package/dist/collection/utils/property-checkers/check-url.js +11 -6
  138. package/dist/collection/utils/property-checkers/empty-or.js +5 -2
  139. package/dist/collection/utils/sass-export.js +8 -5
  140. package/dist/components/attribute-observer.js +4 -4
  141. package/dist/components/check-non-empty.js +6 -2
  142. package/dist/components/check-one-of.js +8 -3
  143. package/dist/components/check-type.js +11 -6
  144. package/dist/components/debounce.js +11 -0
  145. package/dist/components/fade.js +6 -2
  146. package/dist/components/get-focusable-children.js +35 -0
  147. package/dist/components/get-root.js +9 -0
  148. package/dist/components/index.browser.js +13 -0
  149. package/dist/components/index.js +21 -2
  150. package/dist/components/index2.js +25 -12
  151. package/dist/components/index3.js +135 -0
  152. package/dist/components/package.js +1 -1
  153. package/dist/components/post-accordion-item2.js +36 -16
  154. package/dist/components/post-accordion2.js +6 -5
  155. package/dist/components/post-avatar.d.ts +11 -0
  156. package/dist/components/post-avatar.js +6 -0
  157. package/dist/components/post-avatar2.js +169 -0
  158. package/dist/components/post-back-to-top.d.ts +11 -0
  159. package/dist/components/post-back-to-top.js +6 -0
  160. package/dist/components/post-back-to-top2.js +101 -0
  161. package/dist/components/post-banner.d.ts +11 -0
  162. package/dist/components/post-banner.js +6 -0
  163. package/dist/components/post-banner2.js +131 -0
  164. package/dist/components/post-breadcrumb-item.d.ts +11 -0
  165. package/dist/components/post-breadcrumb-item.js +6 -0
  166. package/dist/components/post-breadcrumb-item2.js +82 -0
  167. package/dist/components/post-breadcrumb.d.ts +11 -0
  168. package/dist/components/post-breadcrumb.js +6 -0
  169. package/dist/components/post-breadcrumb2.js +169 -0
  170. package/dist/components/post-card-control2.js +50 -39
  171. package/dist/components/post-closebutton.d.ts +11 -0
  172. package/dist/components/post-closebutton.js +6 -0
  173. package/dist/components/post-closebutton2.js +34 -0
  174. package/dist/components/post-collapsible-trigger2.js +23 -38
  175. package/dist/components/post-collapsible2.js +22 -14
  176. package/dist/components/post-footer.d.ts +11 -0
  177. package/dist/components/post-footer.js +6 -0
  178. package/dist/components/post-footer2.js +128 -0
  179. package/dist/components/post-header.d.ts +11 -0
  180. package/dist/components/post-header.js +6 -0
  181. package/dist/components/post-header2.js +217 -0
  182. package/dist/components/post-icon2.js +82 -46
  183. package/dist/components/post-language-option.d.ts +11 -0
  184. package/dist/components/post-language-option.js +6 -0
  185. package/dist/components/post-language-option2.js +102 -0
  186. package/dist/components/post-language-switch.d.ts +11 -0
  187. package/dist/components/post-language-switch.js +6 -0
  188. package/dist/components/post-language-switch2.js +135 -0
  189. package/dist/components/post-linkarea.d.ts +11 -0
  190. package/dist/components/post-linkarea.js +6 -0
  191. package/dist/components/post-linkarea2.js +42 -0
  192. package/dist/components/post-list-item.d.ts +11 -0
  193. package/dist/components/post-list-item.js +6 -0
  194. package/dist/components/post-list-item2.js +35 -0
  195. package/dist/components/{post-alert.d.ts → post-list.d.ts} +4 -4
  196. package/dist/components/post-list.js +6 -0
  197. package/dist/components/post-list2.js +55 -0
  198. package/dist/components/post-logo2.js +5 -5
  199. package/dist/components/post-mainnavigation.d.ts +11 -0
  200. package/dist/components/post-mainnavigation.js +6 -0
  201. package/dist/components/post-mainnavigation2.js +258 -0
  202. package/dist/components/post-megadropdown-trigger.d.ts +11 -0
  203. package/dist/components/post-megadropdown-trigger.js +6 -0
  204. package/dist/components/post-megadropdown-trigger2.js +113 -0
  205. package/dist/components/post-megadropdown.d.ts +11 -0
  206. package/dist/components/post-megadropdown.js +6 -0
  207. package/dist/components/post-megadropdown2.js +186 -0
  208. package/dist/components/post-menu-item.d.ts +11 -0
  209. package/dist/components/post-menu-item.js +6 -0
  210. package/dist/components/post-menu-item2.js +27 -0
  211. package/dist/components/post-menu-trigger.d.ts +11 -0
  212. package/dist/components/post-menu-trigger.js +6 -0
  213. package/dist/components/post-menu-trigger2.js +109 -0
  214. package/dist/components/post-menu.d.ts +11 -0
  215. package/dist/components/post-menu.js +6 -0
  216. package/dist/components/post-menu2.js +193 -0
  217. package/dist/components/post-popover2.js +6 -4
  218. package/dist/components/post-popovercontainer2.js +227 -59
  219. package/dist/components/post-rating2.js +14 -4
  220. package/dist/components/post-tab-header2.js +7 -6
  221. package/dist/components/post-tab-panel2.js +4 -3
  222. package/dist/components/post-tabs2.js +20 -13
  223. package/dist/components/post-tag2.js +3 -3
  224. package/dist/components/post-togglebutton.d.ts +11 -0
  225. package/dist/components/post-togglebutton.js +6 -0
  226. package/dist/components/post-togglebutton2.js +61 -0
  227. package/dist/components/post-tooltip2.js +35 -22
  228. package/dist/components/slide.js +25 -0
  229. package/dist/docs.json +1956 -270
  230. package/dist/esm/{attribute-observer-37fa950a.js → attribute-observer-2f203993.js} +4 -4
  231. package/dist/esm/check-non-empty-258a56b3.js +13 -0
  232. package/dist/esm/check-one-of-0bee20f5.js +11 -0
  233. package/dist/esm/check-type-37d5d307.js +19 -0
  234. package/dist/esm/check-url-17962bc8.js +17 -0
  235. package/dist/esm/debounce-e54c7131.js +11 -0
  236. package/dist/esm/fade-1f3cacf4.js +11 -0
  237. package/dist/esm/get-root-7af2e0d1.js +9 -0
  238. package/dist/esm/{index-0b56fc28.js → index-40846676.js} +54 -17
  239. package/dist/esm/index-8f8fe5b0.js +32 -0
  240. package/dist/esm/index.browser-51485f85.js +13 -0
  241. package/dist/esm/index.js +32 -22
  242. package/dist/esm/loader.js +3 -3
  243. package/dist/esm/package-5614c98b.js +3 -0
  244. package/dist/esm/{post-accordion-6f4d2b9a.js → post-accordion-f6d1834d.js} +9 -8
  245. package/dist/esm/post-accordion-item-7cb93300.js +62 -0
  246. package/dist/esm/post-accordion-item.entry.js +8 -5
  247. package/dist/esm/post-accordion.entry.js +4 -4
  248. package/dist/esm/post-avatar-96108967.js +142 -0
  249. package/dist/esm/post-avatar.entry.js +5 -0
  250. package/dist/esm/post-back-to-top-7f8a61c8.js +74 -0
  251. package/dist/esm/post-back-to-top.entry.js +7 -0
  252. package/dist/esm/post-banner-bb69bce8.js +94 -0
  253. package/dist/esm/post-banner.entry.js +11 -0
  254. package/dist/esm/post-breadcrumb-9d9efa4e.js +110 -0
  255. package/dist/esm/post-breadcrumb-item_2.entry.js +8 -0
  256. package/dist/esm/post-breadcrumb.entry.js +5 -0
  257. package/dist/esm/post-card-control-fdced7d5.js +281 -0
  258. package/dist/esm/post-card-control.entry.js +5 -5
  259. package/dist/esm/post-closebutton_15.entry.js +12 -0
  260. package/dist/esm/{post-collapsible-trigger-85c2064a.js → post-collapsible-trigger-17b2f067.js} +49 -55
  261. package/dist/esm/post-collapsible_2.entry.js +10 -6
  262. package/dist/esm/post-components.js +3 -3
  263. package/dist/esm/post-footer-2dcd8159.js +86 -0
  264. package/dist/esm/post-footer.entry.js +3 -0
  265. package/dist/esm/post-linkarea-06c5144d.js +28 -0
  266. package/dist/esm/post-linkarea.entry.js +3 -0
  267. package/dist/esm/post-menu-item-e917bf99.js +65 -0
  268. package/dist/esm/post-popover-67a3cbf2.js +104 -0
  269. package/dist/esm/post-popover.entry.js +4 -4
  270. package/dist/esm/{post-rating-d9fc0b40.js → post-rating-9613bee8.js} +16 -6
  271. package/dist/esm/post-rating.entry.js +3 -3
  272. package/dist/esm/post-tab-header-dff3a025.js +31 -0
  273. package/dist/esm/post-tab-header.entry.js +5 -4
  274. package/dist/esm/{post-tab-panel-926439f4.js → post-tab-panel-2b3f82a8.js} +6 -5
  275. package/dist/esm/post-tab-panel.entry.js +4 -3
  276. package/dist/esm/{post-tabs-13b2d9a6.js → post-tabs-46d1165f.js} +23 -16
  277. package/dist/esm/post-tabs.entry.js +4 -4
  278. package/dist/esm/post-tag-4176268e.js +45 -0
  279. package/dist/esm/post-tag.entry.js +3 -3
  280. package/dist/esm/post-togglebutton-5892c5bd.js +3845 -0
  281. package/dist/esm/{post-tooltip-3cde6b53.js → post-tooltip-5a45a569.js} +38 -25
  282. package/dist/esm/post-tooltip.entry.js +8 -6
  283. package/dist/esm/slide-62768431.js +25 -0
  284. package/dist/post-components/index.esm.js +1 -1
  285. package/dist/post-components/p-017dc6c7.js +1 -0
  286. package/dist/post-components/p-0227b899.js +1 -0
  287. package/dist/post-components/p-04895a54.js +1 -0
  288. package/dist/post-components/p-04c38bfe.entry.js +1 -0
  289. package/dist/post-components/p-07a0a626.js +1 -0
  290. package/dist/post-components/p-12573893.js +1 -0
  291. package/dist/post-components/p-1289b0a7.entry.js +1 -0
  292. package/dist/post-components/p-12a11565.js +1 -0
  293. package/dist/post-components/p-1542a80e.entry.js +1 -0
  294. package/dist/post-components/p-181c73d5.js +1 -0
  295. package/dist/post-components/p-254a9bd2.entry.js +1 -0
  296. package/dist/post-components/p-28500934.entry.js +1 -0
  297. package/dist/post-components/p-2b1281af.js +1 -0
  298. package/dist/post-components/p-2c69e7f2.entry.js +1 -0
  299. package/dist/post-components/p-30132b19.entry.js +1 -0
  300. package/dist/post-components/p-30af1d48.js +1 -0
  301. package/dist/post-components/p-3bdeb686.entry.js +1 -0
  302. package/dist/post-components/p-47cb31dd.js +1 -0
  303. package/dist/post-components/p-4af6dbed.js +1 -0
  304. package/dist/post-components/p-4f41f63e.js +1 -0
  305. package/dist/post-components/p-52790b8b.js +1 -0
  306. package/dist/post-components/p-5959f2bd.js +1 -0
  307. package/dist/post-components/{p-82dcf8c6.js → p-59ca0a13.js} +3 -3
  308. package/dist/post-components/p-5aaa5703.entry.js +1 -0
  309. package/dist/post-components/p-64e3de38.js +1 -0
  310. package/dist/post-components/p-67a45f16.js +1 -0
  311. package/dist/post-components/p-6d8ac9bd.entry.js +1 -0
  312. package/dist/post-components/p-7709c14a.js +1 -0
  313. package/dist/post-components/p-77cc2a5e.entry.js +1 -0
  314. package/dist/post-components/p-79c552fb.js +1 -0
  315. package/dist/post-components/p-7dd05e6d.entry.js +1 -0
  316. package/dist/post-components/p-803b7598.js +1 -0
  317. package/dist/post-components/p-85fdc2d3.js +1 -0
  318. package/dist/post-components/p-9748a355.js +1 -0
  319. package/dist/post-components/p-98fcf90b.entry.js +1 -0
  320. package/dist/post-components/p-994fae4c.entry.js +1 -0
  321. package/dist/post-components/p-a805515a.entry.js +1 -0
  322. package/dist/post-components/p-b5b48f66.entry.js +1 -0
  323. package/dist/post-components/p-b9bf5a5f.js +1 -0
  324. package/dist/post-components/p-c6b3a926.js +1 -0
  325. package/dist/post-components/p-c9dd3cdb.entry.js +1 -0
  326. package/dist/post-components/p-cb5e4a06.js +1 -0
  327. package/dist/post-components/p-d45df336.js +1 -0
  328. package/dist/post-components/p-dd4a5c0a.entry.js +1 -0
  329. package/dist/post-components/p-e1baac59.js +1 -0
  330. package/dist/post-components/p-e585c6fe.js +1 -0
  331. package/dist/post-components/p-e6d54838.entry.js +1 -0
  332. package/dist/post-components/p-f4b0cc7d.js +1 -0
  333. package/dist/post-components/p-fc91cbc2.js +1 -0
  334. package/dist/post-components/p-fe8c300c.js +1 -0
  335. package/dist/post-components/p-ff95dcd3.js +2 -0
  336. package/dist/post-components/post-components.esm.js +1 -1
  337. package/dist/types/animations/collapse.d.ts +2 -2
  338. package/dist/types/animations/fade.d.ts +2 -2
  339. package/dist/types/animations/slide.d.ts +2 -0
  340. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +8 -2
  341. package/dist/types/components/post-avatar/post-avatar.d.ts +51 -0
  342. package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +19 -0
  343. package/dist/types/components/post-banner/banner-types.d.ts +2 -0
  344. package/dist/types/components/post-banner/post-banner.d.ts +49 -0
  345. package/dist/types/components/post-breadcrumb/post-breadcrumb.d.ts +30 -0
  346. package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +20 -0
  347. package/dist/types/components/post-card-control/post-card-control.d.ts +9 -9
  348. package/dist/types/components/post-closebutton/post-closebutton.d.ts +7 -0
  349. package/dist/types/components/post-footer/post-footer.d.ts +23 -0
  350. package/dist/types/components/post-header/post-header.d.ts +45 -0
  351. package/dist/types/components/post-icon/post-icon.d.ts +14 -12
  352. package/dist/types/components/post-language-option/post-language-option.d.ts +45 -0
  353. package/dist/types/components/post-language-switch/post-language-switch.d.ts +31 -0
  354. package/dist/types/components/post-language-switch/switch-variants.d.ts +2 -0
  355. package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
  356. package/dist/types/components/post-list/post-list.d.ts +24 -0
  357. package/dist/types/components/post-list-item/post-list-item.d.ts +8 -0
  358. package/dist/types/components/post-logo/post-logo.d.ts +1 -1
  359. package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +70 -0
  360. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +57 -0
  361. package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +31 -0
  362. package/dist/types/components/post-menu/post-menu.d.ts +48 -0
  363. package/dist/types/components/post-menu-item/post-menu-item.d.ts +3 -0
  364. package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +28 -0
  365. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +23 -1
  366. package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
  367. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
  368. package/dist/types/components/post-tag/post-tag.d.ts +1 -1
  369. package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +15 -0
  370. package/dist/types/components.d.ts +609 -48
  371. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
  372. package/dist/types/index.d.ts +22 -3
  373. package/dist/types/utils/attribute-observer.d.ts +1 -1
  374. package/dist/types/utils/breakpoints.d.ts +12 -0
  375. package/dist/types/utils/component-on-ready.d.ts +1 -1
  376. package/dist/types/utils/get-focusable-children.d.ts +1 -0
  377. package/dist/types/utils/get-root.d.ts +1 -1
  378. package/dist/types/utils/property-checkers/check-non-empty.d.ts +3 -1
  379. package/dist/types/utils/property-checkers/check-one-of.d.ts +3 -1
  380. package/dist/types/utils/property-checkers/check-pattern.d.ts +3 -1
  381. package/dist/types/utils/property-checkers/check-type.d.ts +3 -1
  382. package/dist/types/utils/property-checkers/check-url.d.ts +3 -1
  383. package/dist/types/utils/property-checkers/index.d.ts +12 -4
  384. package/dist/types/utils/sass-export.d.ts +5 -1
  385. package/loaders/attribute-observer.js +4 -4
  386. package/loaders/check-non-empty.js +6 -2
  387. package/loaders/check-one-of.js +8 -3
  388. package/loaders/check-type.js +11 -6
  389. package/loaders/debounce.js +11 -0
  390. package/loaders/fade.js +6 -2
  391. package/loaders/get-focusable-children.js +35 -0
  392. package/loaders/get-root.js +9 -0
  393. package/loaders/index.browser.js +13 -0
  394. package/loaders/index.d.ts +40 -2
  395. package/loaders/index.js +21 -2
  396. package/loaders/index2.js +25 -12
  397. package/loaders/index3.js +135 -0
  398. package/loaders/package.js +1 -1
  399. package/loaders/post-accordion-item.js +1 -81
  400. package/loaders/post-accordion-item2.js +103 -0
  401. package/loaders/post-accordion.js +6 -5
  402. package/loaders/post-avatar.d.ts +11 -0
  403. package/loaders/post-avatar.js +172 -0
  404. package/loaders/post-back-to-top.d.ts +11 -0
  405. package/loaders/post-back-to-top.js +104 -0
  406. package/loaders/post-banner.d.ts +11 -0
  407. package/loaders/post-banner.js +134 -0
  408. package/loaders/post-breadcrumb-item.d.ts +11 -0
  409. package/loaders/post-breadcrumb-item.js +6 -0
  410. package/loaders/post-breadcrumb-item2.js +82 -0
  411. package/loaders/post-breadcrumb.d.ts +11 -0
  412. package/loaders/post-breadcrumb.js +172 -0
  413. package/loaders/post-card-control.js +50 -39
  414. package/loaders/post-closebutton.d.ts +11 -0
  415. package/loaders/post-closebutton.js +37 -0
  416. package/loaders/post-collapsible-trigger2.js +23 -38
  417. package/loaders/post-collapsible2.js +21 -13
  418. package/loaders/post-footer.d.ts +11 -0
  419. package/loaders/post-footer.js +131 -0
  420. package/loaders/post-header.d.ts +11 -0
  421. package/loaders/post-header.js +220 -0
  422. package/loaders/post-icon2.js +82 -46
  423. package/loaders/post-language-option.d.ts +11 -0
  424. package/loaders/post-language-option.js +105 -0
  425. package/loaders/post-language-switch.d.ts +11 -0
  426. package/loaders/post-language-switch.js +138 -0
  427. package/loaders/post-linkarea.d.ts +11 -0
  428. package/loaders/post-linkarea.js +45 -0
  429. package/loaders/post-list-item.d.ts +11 -0
  430. package/loaders/post-list-item.js +38 -0
  431. package/loaders/{post-alert.d.ts → post-list.d.ts} +4 -4
  432. package/loaders/post-list.js +58 -0
  433. package/loaders/post-logo.js +6 -6
  434. package/loaders/post-mainnavigation.d.ts +11 -0
  435. package/loaders/post-mainnavigation.js +261 -0
  436. package/loaders/post-megadropdown-trigger.d.ts +11 -0
  437. package/loaders/post-megadropdown-trigger.js +116 -0
  438. package/loaders/post-megadropdown.d.ts +11 -0
  439. package/loaders/post-megadropdown.js +189 -0
  440. package/loaders/post-menu-item.d.ts +11 -0
  441. package/loaders/post-menu-item.js +6 -0
  442. package/loaders/post-menu-item2.js +27 -0
  443. package/loaders/post-menu-trigger.d.ts +11 -0
  444. package/loaders/post-menu-trigger.js +6 -0
  445. package/loaders/post-menu-trigger2.js +109 -0
  446. package/loaders/post-menu.d.ts +11 -0
  447. package/loaders/post-menu.js +6 -0
  448. package/loaders/post-menu2.js +193 -0
  449. package/loaders/post-popover.js +6 -4
  450. package/loaders/post-popovercontainer2.js +227 -59
  451. package/loaders/post-rating.js +14 -4
  452. package/loaders/post-tab-header.js +7 -6
  453. package/loaders/post-tab-panel.js +4 -3
  454. package/loaders/post-tabs.js +20 -13
  455. package/loaders/post-tag.js +3 -3
  456. package/loaders/post-togglebutton.d.ts +11 -0
  457. package/loaders/post-togglebutton.js +64 -0
  458. package/loaders/post-tooltip.js +34 -21
  459. package/loaders/slide.js +25 -0
  460. package/package.json +26 -20
  461. package/dist/cjs/check-non-empty-eeaa8f77.js +0 -11
  462. package/dist/cjs/check-one-of-f4f5d0c0.js +0 -8
  463. package/dist/cjs/fade-35a3633a.js +0 -10
  464. package/dist/cjs/index-01f30442.js +0 -52
  465. package/dist/cjs/post-accordion-item-7b348fa5.js +0 -51
  466. package/dist/cjs/post-alert-fca3a4a3.js +0 -98
  467. package/dist/cjs/post-alert.cjs.entry.js +0 -16
  468. package/dist/cjs/post-card-control-b4e4b4d5.js +0 -272
  469. package/dist/cjs/post-icon-3934be0b.js +0 -104
  470. package/dist/cjs/post-icon.cjs.entry.js +0 -15
  471. package/dist/cjs/post-logo-c3603fc7.js +0 -39
  472. package/dist/cjs/post-logo.cjs.entry.js +0 -14
  473. package/dist/cjs/post-popover-15f9620a.js +0 -104
  474. package/dist/cjs/post-popovercontainer-7d536276.js +0 -2186
  475. package/dist/cjs/post-popovercontainer.cjs.entry.js +0 -11
  476. package/dist/cjs/post-tab-header-29b8d4e1.js +0 -32
  477. package/dist/cjs/post-tag-b7d0bbff.js +0 -47
  478. package/dist/collection/components/post-alert/alert-types.js +0 -1
  479. package/dist/collection/components/post-alert/post-alert.css +0 -7
  480. package/dist/components/post-alert.js +0 -6
  481. package/dist/components/post-alert2.js +0 -136
  482. package/dist/esm/check-non-empty-58bd6b17.js +0 -9
  483. package/dist/esm/check-one-of-6b3ef8eb.js +0 -6
  484. package/dist/esm/fade-7fd71785.js +0 -7
  485. package/dist/esm/index-f41b763f.js +0 -46
  486. package/dist/esm/package-3d758f77.js +0 -3
  487. package/dist/esm/post-accordion-item-6b5a65ad.js +0 -49
  488. package/dist/esm/post-alert-f19db551.js +0 -96
  489. package/dist/esm/post-alert.entry.js +0 -8
  490. package/dist/esm/post-card-control-1b5df6cb.js +0 -270
  491. package/dist/esm/post-icon-40929043.js +0 -102
  492. package/dist/esm/post-icon.entry.js +0 -7
  493. package/dist/esm/post-logo-c6351ba8.js +0 -37
  494. package/dist/esm/post-logo.entry.js +0 -6
  495. package/dist/esm/post-popover-58149de7.js +0 -102
  496. package/dist/esm/post-popovercontainer-8bde9fc3.js +0 -2184
  497. package/dist/esm/post-popovercontainer.entry.js +0 -3
  498. package/dist/esm/post-tab-header-ae8feb19.js +0 -30
  499. package/dist/esm/post-tag-887d5fbe.js +0 -45
  500. package/dist/post-components/p-0b71bf5a.js +0 -1
  501. package/dist/post-components/p-0e09dc41.js +0 -1
  502. package/dist/post-components/p-19e54be9.js +0 -1
  503. package/dist/post-components/p-1e8f0f36.js +0 -1
  504. package/dist/post-components/p-22257eff.entry.js +0 -1
  505. package/dist/post-components/p-249ac168.entry.js +0 -1
  506. package/dist/post-components/p-2737eaf5.js +0 -1
  507. package/dist/post-components/p-2b10e265.js +0 -1
  508. package/dist/post-components/p-3325086e.js +0 -1
  509. package/dist/post-components/p-3b823fee.entry.js +0 -1
  510. package/dist/post-components/p-45f4c803.entry.js +0 -1
  511. package/dist/post-components/p-47935dbb.js +0 -1
  512. package/dist/post-components/p-486fbbce.entry.js +0 -1
  513. package/dist/post-components/p-4a7fb0f3.entry.js +0 -1
  514. package/dist/post-components/p-5f231c2c.js +0 -1
  515. package/dist/post-components/p-611b3c41.js +0 -1
  516. package/dist/post-components/p-6a28f8b9.js +0 -1
  517. package/dist/post-components/p-6adeaa6c.js +0 -1
  518. package/dist/post-components/p-6ed3497a.entry.js +0 -1
  519. package/dist/post-components/p-820c5c19.entry.js +0 -1
  520. package/dist/post-components/p-8aeb549f.entry.js +0 -1
  521. package/dist/post-components/p-92aeec3c.js +0 -1
  522. package/dist/post-components/p-9a99cfc7.js +0 -1
  523. package/dist/post-components/p-aa8a08dc.entry.js +0 -1
  524. package/dist/post-components/p-b095519d.js +0 -1
  525. package/dist/post-components/p-b99fdec3.js +0 -1
  526. package/dist/post-components/p-ba40b28a.entry.js +0 -1
  527. package/dist/post-components/p-c62de925.js +0 -1
  528. package/dist/post-components/p-d2101b8a.entry.js +0 -1
  529. package/dist/post-components/p-d2f9de94.js +0 -2
  530. package/dist/post-components/p-d7a44f45.js +0 -1
  531. package/dist/post-components/p-db4b8ea1.entry.js +0 -1
  532. package/dist/post-components/p-deb4131c.js +0 -1
  533. package/dist/post-components/p-eedc6ae8.entry.js +0 -1
  534. package/dist/post-components/p-f217f420.js +0 -1
  535. package/dist/post-components/p-f707d163.entry.js +0 -1
  536. package/dist/types/components/post-alert/alert-types.d.ts +0 -2
  537. package/dist/types/components/post-alert/post-alert.d.ts +0 -54
  538. package/loaders/post-alert.js +0 -139
@@ -1,2186 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./index-c15bd800.js');
4
- const _package = require('./package-a7150f64.js');
5
-
6
- /**
7
- * Custom positioning reference element.
8
- * @see https://floating-ui.com/docs/virtual-elements
9
- */
10
-
11
- const sides = ['top', 'right', 'bottom', 'left'];
12
- const alignments = ['start', 'end'];
13
- const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
14
- const min = Math.min;
15
- const max = Math.max;
16
- const round = Math.round;
17
- const floor = Math.floor;
18
- const createCoords = v => ({
19
- x: v,
20
- y: v
21
- });
22
- const oppositeSideMap = {
23
- left: 'right',
24
- right: 'left',
25
- bottom: 'top',
26
- top: 'bottom'
27
- };
28
- const oppositeAlignmentMap = {
29
- start: 'end',
30
- end: 'start'
31
- };
32
- function clamp(start, value, end) {
33
- return max(start, min(value, end));
34
- }
35
- function evaluate(value, param) {
36
- return typeof value === 'function' ? value(param) : value;
37
- }
38
- function getSide(placement) {
39
- return placement.split('-')[0];
40
- }
41
- function getAlignment(placement) {
42
- return placement.split('-')[1];
43
- }
44
- function getOppositeAxis(axis) {
45
- return axis === 'x' ? 'y' : 'x';
46
- }
47
- function getAxisLength(axis) {
48
- return axis === 'y' ? 'height' : 'width';
49
- }
50
- function getSideAxis(placement) {
51
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
52
- }
53
- function getAlignmentAxis(placement) {
54
- return getOppositeAxis(getSideAxis(placement));
55
- }
56
- function getAlignmentSides(placement, rects, rtl) {
57
- if (rtl === void 0) {
58
- rtl = false;
59
- }
60
- const alignment = getAlignment(placement);
61
- const alignmentAxis = getAlignmentAxis(placement);
62
- const length = getAxisLength(alignmentAxis);
63
- let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
64
- if (rects.reference[length] > rects.floating[length]) {
65
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
66
- }
67
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
68
- }
69
- function getExpandedPlacements(placement) {
70
- const oppositePlacement = getOppositePlacement(placement);
71
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
72
- }
73
- function getOppositeAlignmentPlacement(placement) {
74
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
75
- }
76
- function getSideList(side, isStart, rtl) {
77
- const lr = ['left', 'right'];
78
- const rl = ['right', 'left'];
79
- const tb = ['top', 'bottom'];
80
- const bt = ['bottom', 'top'];
81
- switch (side) {
82
- case 'top':
83
- case 'bottom':
84
- if (rtl) return isStart ? rl : lr;
85
- return isStart ? lr : rl;
86
- case 'left':
87
- case 'right':
88
- return isStart ? tb : bt;
89
- default:
90
- return [];
91
- }
92
- }
93
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
94
- const alignment = getAlignment(placement);
95
- let list = getSideList(getSide(placement), direction === 'start', rtl);
96
- if (alignment) {
97
- list = list.map(side => side + "-" + alignment);
98
- if (flipAlignment) {
99
- list = list.concat(list.map(getOppositeAlignmentPlacement));
100
- }
101
- }
102
- return list;
103
- }
104
- function getOppositePlacement(placement) {
105
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
106
- }
107
- function expandPaddingObject(padding) {
108
- return {
109
- top: 0,
110
- right: 0,
111
- bottom: 0,
112
- left: 0,
113
- ...padding
114
- };
115
- }
116
- function getPaddingObject(padding) {
117
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
118
- top: padding,
119
- right: padding,
120
- bottom: padding,
121
- left: padding
122
- };
123
- }
124
- function rectToClientRect(rect) {
125
- const {
126
- x,
127
- y,
128
- width,
129
- height
130
- } = rect;
131
- return {
132
- width,
133
- height,
134
- top: y,
135
- left: x,
136
- right: x + width,
137
- bottom: y + height,
138
- x,
139
- y
140
- };
141
- }
142
-
143
- function computeCoordsFromPlacement(_ref, placement, rtl) {
144
- let {
145
- reference,
146
- floating
147
- } = _ref;
148
- const sideAxis = getSideAxis(placement);
149
- const alignmentAxis = getAlignmentAxis(placement);
150
- const alignLength = getAxisLength(alignmentAxis);
151
- const side = getSide(placement);
152
- const isVertical = sideAxis === 'y';
153
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
154
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
155
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
156
- let coords;
157
- switch (side) {
158
- case 'top':
159
- coords = {
160
- x: commonX,
161
- y: reference.y - floating.height
162
- };
163
- break;
164
- case 'bottom':
165
- coords = {
166
- x: commonX,
167
- y: reference.y + reference.height
168
- };
169
- break;
170
- case 'right':
171
- coords = {
172
- x: reference.x + reference.width,
173
- y: commonY
174
- };
175
- break;
176
- case 'left':
177
- coords = {
178
- x: reference.x - floating.width,
179
- y: commonY
180
- };
181
- break;
182
- default:
183
- coords = {
184
- x: reference.x,
185
- y: reference.y
186
- };
187
- }
188
- switch (getAlignment(placement)) {
189
- case 'start':
190
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
191
- break;
192
- case 'end':
193
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
194
- break;
195
- }
196
- return coords;
197
- }
198
-
199
- /**
200
- * Computes the `x` and `y` coordinates that will place the floating element
201
- * next to a given reference element.
202
- *
203
- * This export does not have any `platform` interface logic. You will need to
204
- * write one for the platform you are using Floating UI with.
205
- */
206
- const computePosition$1 = async (reference, floating, config) => {
207
- const {
208
- placement = 'bottom',
209
- strategy = 'absolute',
210
- middleware = [],
211
- platform
212
- } = config;
213
- const validMiddleware = middleware.filter(Boolean);
214
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
215
- let rects = await platform.getElementRects({
216
- reference,
217
- floating,
218
- strategy
219
- });
220
- let {
221
- x,
222
- y
223
- } = computeCoordsFromPlacement(rects, placement, rtl);
224
- let statefulPlacement = placement;
225
- let middlewareData = {};
226
- let resetCount = 0;
227
- for (let i = 0; i < validMiddleware.length; i++) {
228
- const {
229
- name,
230
- fn
231
- } = validMiddleware[i];
232
- const {
233
- x: nextX,
234
- y: nextY,
235
- data,
236
- reset
237
- } = await fn({
238
- x,
239
- y,
240
- initialPlacement: placement,
241
- placement: statefulPlacement,
242
- strategy,
243
- middlewareData,
244
- rects,
245
- platform,
246
- elements: {
247
- reference,
248
- floating
249
- }
250
- });
251
- x = nextX != null ? nextX : x;
252
- y = nextY != null ? nextY : y;
253
- middlewareData = {
254
- ...middlewareData,
255
- [name]: {
256
- ...middlewareData[name],
257
- ...data
258
- }
259
- };
260
- if (reset && resetCount <= 50) {
261
- resetCount++;
262
- if (typeof reset === 'object') {
263
- if (reset.placement) {
264
- statefulPlacement = reset.placement;
265
- }
266
- if (reset.rects) {
267
- rects = reset.rects === true ? await platform.getElementRects({
268
- reference,
269
- floating,
270
- strategy
271
- }) : reset.rects;
272
- }
273
- ({
274
- x,
275
- y
276
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
277
- }
278
- i = -1;
279
- }
280
- }
281
- return {
282
- x,
283
- y,
284
- placement: statefulPlacement,
285
- strategy,
286
- middlewareData
287
- };
288
- };
289
-
290
- /**
291
- * Resolves with an object of overflow side offsets that determine how much the
292
- * element is overflowing a given clipping boundary on each side.
293
- * - positive = overflowing the boundary by that number of pixels
294
- * - negative = how many pixels left before it will overflow
295
- * - 0 = lies flush with the boundary
296
- * @see https://floating-ui.com/docs/detectOverflow
297
- */
298
- async function detectOverflow(state, options) {
299
- var _await$platform$isEle;
300
- if (options === void 0) {
301
- options = {};
302
- }
303
- const {
304
- x,
305
- y,
306
- platform,
307
- rects,
308
- elements,
309
- strategy
310
- } = state;
311
- const {
312
- boundary = 'clippingAncestors',
313
- rootBoundary = 'viewport',
314
- elementContext = 'floating',
315
- altBoundary = false,
316
- padding = 0
317
- } = evaluate(options, state);
318
- const paddingObject = getPaddingObject(padding);
319
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
320
- const element = elements[altBoundary ? altContext : elementContext];
321
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
322
- element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
323
- boundary,
324
- rootBoundary,
325
- strategy
326
- }));
327
- const rect = elementContext === 'floating' ? {
328
- ...rects.floating,
329
- x,
330
- y
331
- } : rects.reference;
332
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
333
- const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
334
- x: 1,
335
- y: 1
336
- } : {
337
- x: 1,
338
- y: 1
339
- };
340
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
341
- elements,
342
- rect,
343
- offsetParent,
344
- strategy
345
- }) : rect);
346
- return {
347
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
348
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
349
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
350
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
351
- };
352
- }
353
-
354
- /**
355
- * Provides data to position an inner element of the floating element so that it
356
- * appears centered to the reference element.
357
- * @see https://floating-ui.com/docs/arrow
358
- */
359
- const arrow$1 = options => ({
360
- name: 'arrow',
361
- options,
362
- async fn(state) {
363
- const {
364
- x,
365
- y,
366
- placement,
367
- rects,
368
- platform,
369
- elements,
370
- middlewareData
371
- } = state;
372
- // Since `element` is required, we don't Partial<> the type.
373
- const {
374
- element,
375
- padding = 0
376
- } = evaluate(options, state) || {};
377
- if (element == null) {
378
- return {};
379
- }
380
- const paddingObject = getPaddingObject(padding);
381
- const coords = {
382
- x,
383
- y
384
- };
385
- const axis = getAlignmentAxis(placement);
386
- const length = getAxisLength(axis);
387
- const arrowDimensions = await platform.getDimensions(element);
388
- const isYAxis = axis === 'y';
389
- const minProp = isYAxis ? 'top' : 'left';
390
- const maxProp = isYAxis ? 'bottom' : 'right';
391
- const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
392
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
393
- const startDiff = coords[axis] - rects.reference[axis];
394
- const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
395
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
396
-
397
- // DOM platform can return `window` as the `offsetParent`.
398
- if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
399
- clientSize = elements.floating[clientProp] || rects.floating[length];
400
- }
401
- const centerToReference = endDiff / 2 - startDiff / 2;
402
-
403
- // If the padding is large enough that it causes the arrow to no longer be
404
- // centered, modify the padding so that it is centered.
405
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
406
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
407
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
408
-
409
- // Make sure the arrow doesn't overflow the floating element if the center
410
- // point is outside the floating element's bounds.
411
- const min$1 = minPadding;
412
- const max = clientSize - arrowDimensions[length] - maxPadding;
413
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
414
- const offset = clamp(min$1, center, max);
415
-
416
- // If the reference is small enough that the arrow's padding causes it to
417
- // to point to nothing for an aligned placement, adjust the offset of the
418
- // floating element itself. To ensure `shift()` continues to take action,
419
- // a single reset is performed when this is true.
420
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
421
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
422
- return {
423
- [axis]: coords[axis] + alignmentOffset,
424
- data: {
425
- [axis]: offset,
426
- centerOffset: center - offset - alignmentOffset,
427
- ...(shouldAddOffset && {
428
- alignmentOffset
429
- })
430
- },
431
- reset: shouldAddOffset
432
- };
433
- }
434
- });
435
-
436
- function getPlacementList(alignment, autoAlignment, allowedPlacements) {
437
- const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
438
- return allowedPlacementsSortedByAlignment.filter(placement => {
439
- if (alignment) {
440
- return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
441
- }
442
- return true;
443
- });
444
- }
445
- /**
446
- * Optimizes the visibility of the floating element by choosing the placement
447
- * that has the most space available automatically, without needing to specify a
448
- * preferred placement. Alternative to `flip`.
449
- * @see https://floating-ui.com/docs/autoPlacement
450
- */
451
- const autoPlacement = function (options) {
452
- if (options === void 0) {
453
- options = {};
454
- }
455
- return {
456
- name: 'autoPlacement',
457
- options,
458
- async fn(state) {
459
- var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
460
- const {
461
- rects,
462
- middlewareData,
463
- placement,
464
- platform,
465
- elements
466
- } = state;
467
- const {
468
- crossAxis = false,
469
- alignment,
470
- allowedPlacements = placements,
471
- autoAlignment = true,
472
- ...detectOverflowOptions
473
- } = evaluate(options, state);
474
- const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
475
- const overflow = await detectOverflow(state, detectOverflowOptions);
476
- const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
477
- const currentPlacement = placements$1[currentIndex];
478
- if (currentPlacement == null) {
479
- return {};
480
- }
481
- const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
482
-
483
- // Make `computeCoords` start from the right place.
484
- if (placement !== currentPlacement) {
485
- return {
486
- reset: {
487
- placement: placements$1[0]
488
- }
489
- };
490
- }
491
- const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
492
- const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
493
- placement: currentPlacement,
494
- overflows: currentOverflows
495
- }];
496
- const nextPlacement = placements$1[currentIndex + 1];
497
-
498
- // There are more placements to check.
499
- if (nextPlacement) {
500
- return {
501
- data: {
502
- index: currentIndex + 1,
503
- overflows: allOverflows
504
- },
505
- reset: {
506
- placement: nextPlacement
507
- }
508
- };
509
- }
510
- const placementsSortedByMostSpace = allOverflows.map(d => {
511
- const alignment = getAlignment(d.placement);
512
- return [d.placement, alignment && crossAxis ?
513
- // Check along the mainAxis and main crossAxis side.
514
- d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
515
- // Check only the mainAxis.
516
- d.overflows[0], d.overflows];
517
- }).sort((a, b) => a[1] - b[1]);
518
- const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
519
- // Aligned placements should not check their opposite crossAxis
520
- // side.
521
- getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
522
- const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
523
- if (resetPlacement !== placement) {
524
- return {
525
- data: {
526
- index: currentIndex + 1,
527
- overflows: allOverflows
528
- },
529
- reset: {
530
- placement: resetPlacement
531
- }
532
- };
533
- }
534
- return {};
535
- }
536
- };
537
- };
538
-
539
- /**
540
- * Optimizes the visibility of the floating element by flipping the `placement`
541
- * in order to keep it in view when the preferred placement(s) will overflow the
542
- * clipping boundary. Alternative to `autoPlacement`.
543
- * @see https://floating-ui.com/docs/flip
544
- */
545
- const flip$1 = function (options) {
546
- if (options === void 0) {
547
- options = {};
548
- }
549
- return {
550
- name: 'flip',
551
- options,
552
- async fn(state) {
553
- var _middlewareData$arrow, _middlewareData$flip;
554
- const {
555
- placement,
556
- middlewareData,
557
- rects,
558
- initialPlacement,
559
- platform,
560
- elements
561
- } = state;
562
- const {
563
- mainAxis: checkMainAxis = true,
564
- crossAxis: checkCrossAxis = true,
565
- fallbackPlacements: specifiedFallbackPlacements,
566
- fallbackStrategy = 'bestFit',
567
- fallbackAxisSideDirection = 'none',
568
- flipAlignment = true,
569
- ...detectOverflowOptions
570
- } = evaluate(options, state);
571
-
572
- // If a reset by the arrow was caused due to an alignment offset being
573
- // added, we should skip any logic now since `flip()` has already done its
574
- // work.
575
- // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
576
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
577
- return {};
578
- }
579
- const side = getSide(placement);
580
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
581
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
582
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
583
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
584
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
585
- }
586
- const placements = [initialPlacement, ...fallbackPlacements];
587
- const overflow = await detectOverflow(state, detectOverflowOptions);
588
- const overflows = [];
589
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
590
- if (checkMainAxis) {
591
- overflows.push(overflow[side]);
592
- }
593
- if (checkCrossAxis) {
594
- const sides = getAlignmentSides(placement, rects, rtl);
595
- overflows.push(overflow[sides[0]], overflow[sides[1]]);
596
- }
597
- overflowsData = [...overflowsData, {
598
- placement,
599
- overflows
600
- }];
601
-
602
- // One or more sides is overflowing.
603
- if (!overflows.every(side => side <= 0)) {
604
- var _middlewareData$flip2, _overflowsData$filter;
605
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
606
- const nextPlacement = placements[nextIndex];
607
- if (nextPlacement) {
608
- // Try next placement and re-run the lifecycle.
609
- return {
610
- data: {
611
- index: nextIndex,
612
- overflows: overflowsData
613
- },
614
- reset: {
615
- placement: nextPlacement
616
- }
617
- };
618
- }
619
-
620
- // First, find the candidates that fit on the mainAxis side of overflow,
621
- // then find the placement that fits the best on the main crossAxis side.
622
- 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;
623
-
624
- // Otherwise fallback.
625
- if (!resetPlacement) {
626
- switch (fallbackStrategy) {
627
- case 'bestFit':
628
- {
629
- var _overflowsData$map$so;
630
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
631
- if (placement) {
632
- resetPlacement = placement;
633
- }
634
- break;
635
- }
636
- case 'initialPlacement':
637
- resetPlacement = initialPlacement;
638
- break;
639
- }
640
- }
641
- if (placement !== resetPlacement) {
642
- return {
643
- reset: {
644
- placement: resetPlacement
645
- }
646
- };
647
- }
648
- }
649
- return {};
650
- }
651
- };
652
- };
653
-
654
- function getSideOffsets(overflow, rect) {
655
- return {
656
- top: overflow.top - rect.height,
657
- right: overflow.right - rect.width,
658
- bottom: overflow.bottom - rect.height,
659
- left: overflow.left - rect.width
660
- };
661
- }
662
- function isAnySideFullyClipped(overflow) {
663
- return sides.some(side => overflow[side] >= 0);
664
- }
665
- /**
666
- * Provides data to hide the floating element in applicable situations, such as
667
- * when it is not in the same clipping context as the reference element.
668
- * @see https://floating-ui.com/docs/hide
669
- */
670
- const hide = function (options) {
671
- if (options === void 0) {
672
- options = {};
673
- }
674
- return {
675
- name: 'hide',
676
- options,
677
- async fn(state) {
678
- const {
679
- rects
680
- } = state;
681
- const {
682
- strategy = 'referenceHidden',
683
- ...detectOverflowOptions
684
- } = evaluate(options, state);
685
- switch (strategy) {
686
- case 'referenceHidden':
687
- {
688
- const overflow = await detectOverflow(state, {
689
- ...detectOverflowOptions,
690
- elementContext: 'reference'
691
- });
692
- const offsets = getSideOffsets(overflow, rects.reference);
693
- return {
694
- data: {
695
- referenceHiddenOffsets: offsets,
696
- referenceHidden: isAnySideFullyClipped(offsets)
697
- }
698
- };
699
- }
700
- case 'escaped':
701
- {
702
- const overflow = await detectOverflow(state, {
703
- ...detectOverflowOptions,
704
- altBoundary: true
705
- });
706
- const offsets = getSideOffsets(overflow, rects.floating);
707
- return {
708
- data: {
709
- escapedOffsets: offsets,
710
- escaped: isAnySideFullyClipped(offsets)
711
- }
712
- };
713
- }
714
- default:
715
- {
716
- return {};
717
- }
718
- }
719
- }
720
- };
721
- };
722
-
723
- function getBoundingRect(rects) {
724
- const minX = min(...rects.map(rect => rect.left));
725
- const minY = min(...rects.map(rect => rect.top));
726
- const maxX = max(...rects.map(rect => rect.right));
727
- const maxY = max(...rects.map(rect => rect.bottom));
728
- return {
729
- x: minX,
730
- y: minY,
731
- width: maxX - minX,
732
- height: maxY - minY
733
- };
734
- }
735
- function getRectsByLine(rects) {
736
- const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
737
- const groups = [];
738
- let prevRect = null;
739
- for (let i = 0; i < sortedRects.length; i++) {
740
- const rect = sortedRects[i];
741
- if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
742
- groups.push([rect]);
743
- } else {
744
- groups[groups.length - 1].push(rect);
745
- }
746
- prevRect = rect;
747
- }
748
- return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
749
- }
750
- /**
751
- * Provides improved positioning for inline reference elements that can span
752
- * over multiple lines, such as hyperlinks or range selections.
753
- * @see https://floating-ui.com/docs/inline
754
- */
755
- const inline$1 = function (options) {
756
- if (options === void 0) {
757
- options = {};
758
- }
759
- return {
760
- name: 'inline',
761
- options,
762
- async fn(state) {
763
- const {
764
- placement,
765
- elements,
766
- rects,
767
- platform,
768
- strategy
769
- } = state;
770
- // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
771
- // ClientRect's bounds, despite the event listener being triggered. A
772
- // padding of 2 seems to handle this issue.
773
- const {
774
- padding = 2,
775
- x,
776
- y
777
- } = evaluate(options, state);
778
- const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
779
- const clientRects = getRectsByLine(nativeClientRects);
780
- const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
781
- const paddingObject = getPaddingObject(padding);
782
- function getBoundingClientRect() {
783
- // There are two rects and they are disjoined.
784
- if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
785
- // Find the first rect in which the point is fully inside.
786
- return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
787
- }
788
-
789
- // There are 2 or more connected rects.
790
- if (clientRects.length >= 2) {
791
- if (getSideAxis(placement) === 'y') {
792
- const firstRect = clientRects[0];
793
- const lastRect = clientRects[clientRects.length - 1];
794
- const isTop = getSide(placement) === 'top';
795
- const top = firstRect.top;
796
- const bottom = lastRect.bottom;
797
- const left = isTop ? firstRect.left : lastRect.left;
798
- const right = isTop ? firstRect.right : lastRect.right;
799
- const width = right - left;
800
- const height = bottom - top;
801
- return {
802
- top,
803
- bottom,
804
- left,
805
- right,
806
- width,
807
- height,
808
- x: left,
809
- y: top
810
- };
811
- }
812
- const isLeftSide = getSide(placement) === 'left';
813
- const maxRight = max(...clientRects.map(rect => rect.right));
814
- const minLeft = min(...clientRects.map(rect => rect.left));
815
- const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
816
- const top = measureRects[0].top;
817
- const bottom = measureRects[measureRects.length - 1].bottom;
818
- const left = minLeft;
819
- const right = maxRight;
820
- const width = right - left;
821
- const height = bottom - top;
822
- return {
823
- top,
824
- bottom,
825
- left,
826
- right,
827
- width,
828
- height,
829
- x: left,
830
- y: top
831
- };
832
- }
833
- return fallback;
834
- }
835
- const resetRects = await platform.getElementRects({
836
- reference: {
837
- getBoundingClientRect
838
- },
839
- floating: elements.floating,
840
- strategy
841
- });
842
- if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
843
- return {
844
- reset: {
845
- rects: resetRects
846
- }
847
- };
848
- }
849
- return {};
850
- }
851
- };
852
- };
853
-
854
- // For type backwards-compatibility, the `OffsetOptions` type was also
855
- // Derivable.
856
-
857
- async function convertValueToCoords(state, options) {
858
- const {
859
- placement,
860
- platform,
861
- elements
862
- } = state;
863
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
864
- const side = getSide(placement);
865
- const alignment = getAlignment(placement);
866
- const isVertical = getSideAxis(placement) === 'y';
867
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
868
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
869
- const rawValue = evaluate(options, state);
870
- let {
871
- mainAxis,
872
- crossAxis,
873
- alignmentAxis
874
- } = typeof rawValue === 'number' ? {
875
- mainAxis: rawValue,
876
- crossAxis: 0,
877
- alignmentAxis: null
878
- } : {
879
- mainAxis: 0,
880
- crossAxis: 0,
881
- alignmentAxis: null,
882
- ...rawValue
883
- };
884
- if (alignment && typeof alignmentAxis === 'number') {
885
- crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
886
- }
887
- return isVertical ? {
888
- x: crossAxis * crossAxisMulti,
889
- y: mainAxis * mainAxisMulti
890
- } : {
891
- x: mainAxis * mainAxisMulti,
892
- y: crossAxis * crossAxisMulti
893
- };
894
- }
895
-
896
- /**
897
- * Modifies the placement by translating the floating element along the
898
- * specified axes.
899
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
900
- * object may be passed.
901
- * @see https://floating-ui.com/docs/offset
902
- */
903
- const offset$1 = function (options) {
904
- if (options === void 0) {
905
- options = 0;
906
- }
907
- return {
908
- name: 'offset',
909
- options,
910
- async fn(state) {
911
- var _middlewareData$offse, _middlewareData$arrow;
912
- const {
913
- x,
914
- y,
915
- placement,
916
- middlewareData
917
- } = state;
918
- const diffCoords = await convertValueToCoords(state, options);
919
-
920
- // If the placement is the same and the arrow caused an alignment offset
921
- // then we don't need to change the positioning coordinates.
922
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
923
- return {};
924
- }
925
- return {
926
- x: x + diffCoords.x,
927
- y: y + diffCoords.y,
928
- data: {
929
- ...diffCoords,
930
- placement
931
- }
932
- };
933
- }
934
- };
935
- };
936
-
937
- /**
938
- * Optimizes the visibility of the floating element by shifting it in order to
939
- * keep it in view when it will overflow the clipping boundary.
940
- * @see https://floating-ui.com/docs/shift
941
- */
942
- const shift$1 = function (options) {
943
- if (options === void 0) {
944
- options = {};
945
- }
946
- return {
947
- name: 'shift',
948
- options,
949
- async fn(state) {
950
- const {
951
- x,
952
- y,
953
- placement
954
- } = state;
955
- const {
956
- mainAxis: checkMainAxis = true,
957
- crossAxis: checkCrossAxis = false,
958
- limiter = {
959
- fn: _ref => {
960
- let {
961
- x,
962
- y
963
- } = _ref;
964
- return {
965
- x,
966
- y
967
- };
968
- }
969
- },
970
- ...detectOverflowOptions
971
- } = evaluate(options, state);
972
- const coords = {
973
- x,
974
- y
975
- };
976
- const overflow = await detectOverflow(state, detectOverflowOptions);
977
- const crossAxis = getSideAxis(getSide(placement));
978
- const mainAxis = getOppositeAxis(crossAxis);
979
- let mainAxisCoord = coords[mainAxis];
980
- let crossAxisCoord = coords[crossAxis];
981
- if (checkMainAxis) {
982
- const minSide = mainAxis === 'y' ? 'top' : 'left';
983
- const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
984
- const min = mainAxisCoord + overflow[minSide];
985
- const max = mainAxisCoord - overflow[maxSide];
986
- mainAxisCoord = clamp(min, mainAxisCoord, max);
987
- }
988
- if (checkCrossAxis) {
989
- const minSide = crossAxis === 'y' ? 'top' : 'left';
990
- const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
991
- const min = crossAxisCoord + overflow[minSide];
992
- const max = crossAxisCoord - overflow[maxSide];
993
- crossAxisCoord = clamp(min, crossAxisCoord, max);
994
- }
995
- const limitedCoords = limiter.fn({
996
- ...state,
997
- [mainAxis]: mainAxisCoord,
998
- [crossAxis]: crossAxisCoord
999
- });
1000
- return {
1001
- ...limitedCoords,
1002
- data: {
1003
- x: limitedCoords.x - x,
1004
- y: limitedCoords.y - y
1005
- }
1006
- };
1007
- }
1008
- };
1009
- };
1010
- /**
1011
- * Built-in `limiter` that will stop `shift()` at a certain point.
1012
- */
1013
- const limitShift$1 = function (options) {
1014
- if (options === void 0) {
1015
- options = {};
1016
- }
1017
- return {
1018
- options,
1019
- fn(state) {
1020
- const {
1021
- x,
1022
- y,
1023
- placement,
1024
- rects,
1025
- middlewareData
1026
- } = state;
1027
- const {
1028
- offset = 0,
1029
- mainAxis: checkMainAxis = true,
1030
- crossAxis: checkCrossAxis = true
1031
- } = evaluate(options, state);
1032
- const coords = {
1033
- x,
1034
- y
1035
- };
1036
- const crossAxis = getSideAxis(placement);
1037
- const mainAxis = getOppositeAxis(crossAxis);
1038
- let mainAxisCoord = coords[mainAxis];
1039
- let crossAxisCoord = coords[crossAxis];
1040
- const rawOffset = evaluate(offset, state);
1041
- const computedOffset = typeof rawOffset === 'number' ? {
1042
- mainAxis: rawOffset,
1043
- crossAxis: 0
1044
- } : {
1045
- mainAxis: 0,
1046
- crossAxis: 0,
1047
- ...rawOffset
1048
- };
1049
- if (checkMainAxis) {
1050
- const len = mainAxis === 'y' ? 'height' : 'width';
1051
- const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
1052
- const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
1053
- if (mainAxisCoord < limitMin) {
1054
- mainAxisCoord = limitMin;
1055
- } else if (mainAxisCoord > limitMax) {
1056
- mainAxisCoord = limitMax;
1057
- }
1058
- }
1059
- if (checkCrossAxis) {
1060
- var _middlewareData$offse, _middlewareData$offse2;
1061
- const len = mainAxis === 'y' ? 'width' : 'height';
1062
- const isOriginSide = ['top', 'left'].includes(getSide(placement));
1063
- 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);
1064
- 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);
1065
- if (crossAxisCoord < limitMin) {
1066
- crossAxisCoord = limitMin;
1067
- } else if (crossAxisCoord > limitMax) {
1068
- crossAxisCoord = limitMax;
1069
- }
1070
- }
1071
- return {
1072
- [mainAxis]: mainAxisCoord,
1073
- [crossAxis]: crossAxisCoord
1074
- };
1075
- }
1076
- };
1077
- };
1078
-
1079
- /**
1080
- * Provides data that allows you to change the size of the floating element —
1081
- * for instance, prevent it from overflowing the clipping boundary or match the
1082
- * width of the reference element.
1083
- * @see https://floating-ui.com/docs/size
1084
- */
1085
- const size$1 = function (options) {
1086
- if (options === void 0) {
1087
- options = {};
1088
- }
1089
- return {
1090
- name: 'size',
1091
- options,
1092
- async fn(state) {
1093
- const {
1094
- placement,
1095
- rects,
1096
- platform,
1097
- elements
1098
- } = state;
1099
- const {
1100
- apply = () => {},
1101
- ...detectOverflowOptions
1102
- } = evaluate(options, state);
1103
- const overflow = await detectOverflow(state, detectOverflowOptions);
1104
- const side = getSide(placement);
1105
- const alignment = getAlignment(placement);
1106
- const isYAxis = getSideAxis(placement) === 'y';
1107
- const {
1108
- width,
1109
- height
1110
- } = rects.floating;
1111
- let heightSide;
1112
- let widthSide;
1113
- if (side === 'top' || side === 'bottom') {
1114
- heightSide = side;
1115
- widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
1116
- } else {
1117
- widthSide = side;
1118
- heightSide = alignment === 'end' ? 'top' : 'bottom';
1119
- }
1120
- const overflowAvailableHeight = height - overflow[heightSide];
1121
- const overflowAvailableWidth = width - overflow[widthSide];
1122
- const noShift = !state.middlewareData.shift;
1123
- let availableHeight = overflowAvailableHeight;
1124
- let availableWidth = overflowAvailableWidth;
1125
- if (isYAxis) {
1126
- const maximumClippingWidth = width - overflow.left - overflow.right;
1127
- availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
1128
- } else {
1129
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
1130
- availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
1131
- }
1132
- if (noShift && !alignment) {
1133
- const xMin = max(overflow.left, 0);
1134
- const xMax = max(overflow.right, 0);
1135
- const yMin = max(overflow.top, 0);
1136
- const yMax = max(overflow.bottom, 0);
1137
- if (isYAxis) {
1138
- availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
1139
- } else {
1140
- availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
1141
- }
1142
- }
1143
- await apply({
1144
- ...state,
1145
- availableWidth,
1146
- availableHeight
1147
- });
1148
- const nextDimensions = await platform.getDimensions(elements.floating);
1149
- if (width !== nextDimensions.width || height !== nextDimensions.height) {
1150
- return {
1151
- reset: {
1152
- rects: true
1153
- }
1154
- };
1155
- }
1156
- return {};
1157
- }
1158
- };
1159
- };
1160
-
1161
- function getNodeName(node) {
1162
- if (isNode(node)) {
1163
- return (node.nodeName || '').toLowerCase();
1164
- }
1165
- // Mocked nodes in testing environments may not be instances of Node. By
1166
- // returning `#document` an infinite loop won't occur.
1167
- // https://github.com/floating-ui/floating-ui/issues/2317
1168
- return '#document';
1169
- }
1170
- function getWindow(node) {
1171
- var _node$ownerDocument;
1172
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1173
- }
1174
- function getDocumentElement(node) {
1175
- var _ref;
1176
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1177
- }
1178
- function isNode(value) {
1179
- return value instanceof Node || value instanceof getWindow(value).Node;
1180
- }
1181
- function isElement(value) {
1182
- return value instanceof Element || value instanceof getWindow(value).Element;
1183
- }
1184
- function isHTMLElement(value) {
1185
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
1186
- }
1187
- function isShadowRoot(value) {
1188
- // Browsers without `ShadowRoot` support.
1189
- if (typeof ShadowRoot === 'undefined') {
1190
- return false;
1191
- }
1192
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1193
- }
1194
- function isOverflowElement(element) {
1195
- const {
1196
- overflow,
1197
- overflowX,
1198
- overflowY,
1199
- display
1200
- } = getComputedStyle(element);
1201
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
1202
- }
1203
- function isTableElement(element) {
1204
- return ['table', 'td', 'th'].includes(getNodeName(element));
1205
- }
1206
- function isTopLayer(element) {
1207
- return [':popover-open', ':modal'].some(selector => {
1208
- try {
1209
- return element.matches(selector);
1210
- } catch (e) {
1211
- return false;
1212
- }
1213
- });
1214
- }
1215
- function isContainingBlock(elementOrCss) {
1216
- const webkit = isWebKit();
1217
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
1218
-
1219
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1220
- return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
1221
- }
1222
- function getContainingBlock(element) {
1223
- let currentNode = getParentNode(element);
1224
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1225
- if (isContainingBlock(currentNode)) {
1226
- return currentNode;
1227
- } else if (isTopLayer(currentNode)) {
1228
- return null;
1229
- }
1230
- currentNode = getParentNode(currentNode);
1231
- }
1232
- return null;
1233
- }
1234
- function isWebKit() {
1235
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
1236
- return CSS.supports('-webkit-backdrop-filter', 'none');
1237
- }
1238
- function isLastTraversableNode(node) {
1239
- return ['html', 'body', '#document'].includes(getNodeName(node));
1240
- }
1241
- function getComputedStyle(element) {
1242
- return getWindow(element).getComputedStyle(element);
1243
- }
1244
- function getNodeScroll(element) {
1245
- if (isElement(element)) {
1246
- return {
1247
- scrollLeft: element.scrollLeft,
1248
- scrollTop: element.scrollTop
1249
- };
1250
- }
1251
- return {
1252
- scrollLeft: element.scrollX,
1253
- scrollTop: element.scrollY
1254
- };
1255
- }
1256
- function getParentNode(node) {
1257
- if (getNodeName(node) === 'html') {
1258
- return node;
1259
- }
1260
- const result =
1261
- // Step into the shadow DOM of the parent of a slotted node.
1262
- node.assignedSlot ||
1263
- // DOM Element detected.
1264
- node.parentNode ||
1265
- // ShadowRoot detected.
1266
- isShadowRoot(node) && node.host ||
1267
- // Fallback.
1268
- getDocumentElement(node);
1269
- return isShadowRoot(result) ? result.host : result;
1270
- }
1271
- function getNearestOverflowAncestor(node) {
1272
- const parentNode = getParentNode(node);
1273
- if (isLastTraversableNode(parentNode)) {
1274
- return node.ownerDocument ? node.ownerDocument.body : node.body;
1275
- }
1276
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1277
- return parentNode;
1278
- }
1279
- return getNearestOverflowAncestor(parentNode);
1280
- }
1281
- function getOverflowAncestors(node, list, traverseIframes) {
1282
- var _node$ownerDocument2;
1283
- if (list === void 0) {
1284
- list = [];
1285
- }
1286
- if (traverseIframes === void 0) {
1287
- traverseIframes = true;
1288
- }
1289
- const scrollableAncestor = getNearestOverflowAncestor(node);
1290
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
1291
- const win = getWindow(scrollableAncestor);
1292
- if (isBody) {
1293
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
1294
- }
1295
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
1296
- }
1297
-
1298
- function getCssDimensions(element) {
1299
- const css = getComputedStyle(element);
1300
- // In testing environments, the `width` and `height` properties are empty
1301
- // strings for SVG elements, returning NaN. Fallback to `0` in this case.
1302
- let width = parseFloat(css.width) || 0;
1303
- let height = parseFloat(css.height) || 0;
1304
- const hasOffset = isHTMLElement(element);
1305
- const offsetWidth = hasOffset ? element.offsetWidth : width;
1306
- const offsetHeight = hasOffset ? element.offsetHeight : height;
1307
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
1308
- if (shouldFallback) {
1309
- width = offsetWidth;
1310
- height = offsetHeight;
1311
- }
1312
- return {
1313
- width,
1314
- height,
1315
- $: shouldFallback
1316
- };
1317
- }
1318
-
1319
- function unwrapElement(element) {
1320
- return !isElement(element) ? element.contextElement : element;
1321
- }
1322
-
1323
- function getScale(element) {
1324
- const domElement = unwrapElement(element);
1325
- if (!isHTMLElement(domElement)) {
1326
- return createCoords(1);
1327
- }
1328
- const rect = domElement.getBoundingClientRect();
1329
- const {
1330
- width,
1331
- height,
1332
- $
1333
- } = getCssDimensions(domElement);
1334
- let x = ($ ? round(rect.width) : rect.width) / width;
1335
- let y = ($ ? round(rect.height) : rect.height) / height;
1336
-
1337
- // 0, NaN, or Infinity should always fallback to 1.
1338
-
1339
- if (!x || !Number.isFinite(x)) {
1340
- x = 1;
1341
- }
1342
- if (!y || !Number.isFinite(y)) {
1343
- y = 1;
1344
- }
1345
- return {
1346
- x,
1347
- y
1348
- };
1349
- }
1350
-
1351
- const noOffsets = /*#__PURE__*/createCoords(0);
1352
- function getVisualOffsets(element) {
1353
- const win = getWindow(element);
1354
- if (!isWebKit() || !win.visualViewport) {
1355
- return noOffsets;
1356
- }
1357
- return {
1358
- x: win.visualViewport.offsetLeft,
1359
- y: win.visualViewport.offsetTop
1360
- };
1361
- }
1362
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1363
- if (isFixed === void 0) {
1364
- isFixed = false;
1365
- }
1366
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
1367
- return false;
1368
- }
1369
- return isFixed;
1370
- }
1371
-
1372
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1373
- if (includeScale === void 0) {
1374
- includeScale = false;
1375
- }
1376
- if (isFixedStrategy === void 0) {
1377
- isFixedStrategy = false;
1378
- }
1379
- const clientRect = element.getBoundingClientRect();
1380
- const domElement = unwrapElement(element);
1381
- let scale = createCoords(1);
1382
- if (includeScale) {
1383
- if (offsetParent) {
1384
- if (isElement(offsetParent)) {
1385
- scale = getScale(offsetParent);
1386
- }
1387
- } else {
1388
- scale = getScale(element);
1389
- }
1390
- }
1391
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1392
- let x = (clientRect.left + visualOffsets.x) / scale.x;
1393
- let y = (clientRect.top + visualOffsets.y) / scale.y;
1394
- let width = clientRect.width / scale.x;
1395
- let height = clientRect.height / scale.y;
1396
- if (domElement) {
1397
- const win = getWindow(domElement);
1398
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1399
- let currentWin = win;
1400
- let currentIFrame = currentWin.frameElement;
1401
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1402
- const iframeScale = getScale(currentIFrame);
1403
- const iframeRect = currentIFrame.getBoundingClientRect();
1404
- const css = getComputedStyle(currentIFrame);
1405
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1406
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1407
- x *= iframeScale.x;
1408
- y *= iframeScale.y;
1409
- width *= iframeScale.x;
1410
- height *= iframeScale.y;
1411
- x += left;
1412
- y += top;
1413
- currentWin = getWindow(currentIFrame);
1414
- currentIFrame = currentWin.frameElement;
1415
- }
1416
- }
1417
- return rectToClientRect({
1418
- width,
1419
- height,
1420
- x,
1421
- y
1422
- });
1423
- }
1424
-
1425
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1426
- let {
1427
- elements,
1428
- rect,
1429
- offsetParent,
1430
- strategy
1431
- } = _ref;
1432
- const isFixed = strategy === 'fixed';
1433
- const documentElement = getDocumentElement(offsetParent);
1434
- const topLayer = elements ? isTopLayer(elements.floating) : false;
1435
- if (offsetParent === documentElement || topLayer && isFixed) {
1436
- return rect;
1437
- }
1438
- let scroll = {
1439
- scrollLeft: 0,
1440
- scrollTop: 0
1441
- };
1442
- let scale = createCoords(1);
1443
- const offsets = createCoords(0);
1444
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1445
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1446
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1447
- scroll = getNodeScroll(offsetParent);
1448
- }
1449
- if (isHTMLElement(offsetParent)) {
1450
- const offsetRect = getBoundingClientRect(offsetParent);
1451
- scale = getScale(offsetParent);
1452
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1453
- offsets.y = offsetRect.y + offsetParent.clientTop;
1454
- }
1455
- }
1456
- return {
1457
- width: rect.width * scale.x,
1458
- height: rect.height * scale.y,
1459
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
1460
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
1461
- };
1462
- }
1463
-
1464
- function getClientRects(element) {
1465
- return Array.from(element.getClientRects());
1466
- }
1467
-
1468
- function getWindowScrollBarX(element) {
1469
- // If <html> has a CSS width greater than the viewport, then this will be
1470
- // incorrect for RTL.
1471
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
1472
- }
1473
-
1474
- // Gets the entire size of the scrollable document area, even extending outside
1475
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
1476
- function getDocumentRect(element) {
1477
- const html = getDocumentElement(element);
1478
- const scroll = getNodeScroll(element);
1479
- const body = element.ownerDocument.body;
1480
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1481
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1482
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1483
- const y = -scroll.scrollTop;
1484
- if (getComputedStyle(body).direction === 'rtl') {
1485
- x += max(html.clientWidth, body.clientWidth) - width;
1486
- }
1487
- return {
1488
- width,
1489
- height,
1490
- x,
1491
- y
1492
- };
1493
- }
1494
-
1495
- function getViewportRect(element, strategy) {
1496
- const win = getWindow(element);
1497
- const html = getDocumentElement(element);
1498
- const visualViewport = win.visualViewport;
1499
- let width = html.clientWidth;
1500
- let height = html.clientHeight;
1501
- let x = 0;
1502
- let y = 0;
1503
- if (visualViewport) {
1504
- width = visualViewport.width;
1505
- height = visualViewport.height;
1506
- const visualViewportBased = isWebKit();
1507
- if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
1508
- x = visualViewport.offsetLeft;
1509
- y = visualViewport.offsetTop;
1510
- }
1511
- }
1512
- return {
1513
- width,
1514
- height,
1515
- x,
1516
- y
1517
- };
1518
- }
1519
-
1520
- // Returns the inner client rect, subtracting scrollbars if present.
1521
- function getInnerBoundingClientRect(element, strategy) {
1522
- const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1523
- const top = clientRect.top + element.clientTop;
1524
- const left = clientRect.left + element.clientLeft;
1525
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1526
- const width = element.clientWidth * scale.x;
1527
- const height = element.clientHeight * scale.y;
1528
- const x = left * scale.x;
1529
- const y = top * scale.y;
1530
- return {
1531
- width,
1532
- height,
1533
- x,
1534
- y
1535
- };
1536
- }
1537
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1538
- let rect;
1539
- if (clippingAncestor === 'viewport') {
1540
- rect = getViewportRect(element, strategy);
1541
- } else if (clippingAncestor === 'document') {
1542
- rect = getDocumentRect(getDocumentElement(element));
1543
- } else if (isElement(clippingAncestor)) {
1544
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1545
- } else {
1546
- const visualOffsets = getVisualOffsets(element);
1547
- rect = {
1548
- ...clippingAncestor,
1549
- x: clippingAncestor.x - visualOffsets.x,
1550
- y: clippingAncestor.y - visualOffsets.y
1551
- };
1552
- }
1553
- return rectToClientRect(rect);
1554
- }
1555
- function hasFixedPositionAncestor(element, stopNode) {
1556
- const parentNode = getParentNode(element);
1557
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
1558
- return false;
1559
- }
1560
- return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
1561
- }
1562
-
1563
- // A "clipping ancestor" is an `overflow` element with the characteristic of
1564
- // clipping (or hiding) child elements. This returns all clipping ancestors
1565
- // of the given element up the tree.
1566
- function getClippingElementAncestors(element, cache) {
1567
- const cachedResult = cache.get(element);
1568
- if (cachedResult) {
1569
- return cachedResult;
1570
- }
1571
- let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
1572
- let currentContainingBlockComputedStyle = null;
1573
- const elementIsFixed = getComputedStyle(element).position === 'fixed';
1574
- let currentNode = elementIsFixed ? getParentNode(element) : element;
1575
-
1576
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1577
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1578
- const computedStyle = getComputedStyle(currentNode);
1579
- const currentNodeIsContaining = isContainingBlock(currentNode);
1580
- if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
1581
- currentContainingBlockComputedStyle = null;
1582
- }
1583
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
1584
- if (shouldDropCurrentNode) {
1585
- // Drop non-containing blocks.
1586
- result = result.filter(ancestor => ancestor !== currentNode);
1587
- } else {
1588
- // Record last containing block for next iteration.
1589
- currentContainingBlockComputedStyle = computedStyle;
1590
- }
1591
- currentNode = getParentNode(currentNode);
1592
- }
1593
- cache.set(element, result);
1594
- return result;
1595
- }
1596
-
1597
- // Gets the maximum area that the element is visible in due to any number of
1598
- // clipping ancestors.
1599
- function getClippingRect(_ref) {
1600
- let {
1601
- element,
1602
- boundary,
1603
- rootBoundary,
1604
- strategy
1605
- } = _ref;
1606
- const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
1607
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1608
- const firstClippingAncestor = clippingAncestors[0];
1609
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1610
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1611
- accRect.top = max(rect.top, accRect.top);
1612
- accRect.right = min(rect.right, accRect.right);
1613
- accRect.bottom = min(rect.bottom, accRect.bottom);
1614
- accRect.left = max(rect.left, accRect.left);
1615
- return accRect;
1616
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1617
- return {
1618
- width: clippingRect.right - clippingRect.left,
1619
- height: clippingRect.bottom - clippingRect.top,
1620
- x: clippingRect.left,
1621
- y: clippingRect.top
1622
- };
1623
- }
1624
-
1625
- function getDimensions(element) {
1626
- const {
1627
- width,
1628
- height
1629
- } = getCssDimensions(element);
1630
- return {
1631
- width,
1632
- height
1633
- };
1634
- }
1635
-
1636
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1637
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1638
- const documentElement = getDocumentElement(offsetParent);
1639
- const isFixed = strategy === 'fixed';
1640
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1641
- let scroll = {
1642
- scrollLeft: 0,
1643
- scrollTop: 0
1644
- };
1645
- const offsets = createCoords(0);
1646
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1647
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1648
- scroll = getNodeScroll(offsetParent);
1649
- }
1650
- if (isOffsetParentAnElement) {
1651
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1652
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1653
- offsets.y = offsetRect.y + offsetParent.clientTop;
1654
- } else if (documentElement) {
1655
- offsets.x = getWindowScrollBarX(documentElement);
1656
- }
1657
- }
1658
- const x = rect.left + scroll.scrollLeft - offsets.x;
1659
- const y = rect.top + scroll.scrollTop - offsets.y;
1660
- return {
1661
- x,
1662
- y,
1663
- width: rect.width,
1664
- height: rect.height
1665
- };
1666
- }
1667
-
1668
- function isStaticPositioned(element) {
1669
- return getComputedStyle(element).position === 'static';
1670
- }
1671
-
1672
- function getTrueOffsetParent(element, polyfill) {
1673
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1674
- return null;
1675
- }
1676
- if (polyfill) {
1677
- return polyfill(element);
1678
- }
1679
- return element.offsetParent;
1680
- }
1681
-
1682
- // Gets the closest ancestor positioned element. Handles some edge cases,
1683
- // such as table ancestors and cross browser bugs.
1684
- function getOffsetParent(element, polyfill) {
1685
- const win = getWindow(element);
1686
- if (isTopLayer(element)) {
1687
- return win;
1688
- }
1689
- if (!isHTMLElement(element)) {
1690
- let svgOffsetParent = getParentNode(element);
1691
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1692
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
1693
- return svgOffsetParent;
1694
- }
1695
- svgOffsetParent = getParentNode(svgOffsetParent);
1696
- }
1697
- return win;
1698
- }
1699
- let offsetParent = getTrueOffsetParent(element, polyfill);
1700
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
1701
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1702
- }
1703
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
1704
- return win;
1705
- }
1706
- return offsetParent || getContainingBlock(element) || win;
1707
- }
1708
-
1709
- const getElementRects = async function (data) {
1710
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1711
- const getDimensionsFn = this.getDimensions;
1712
- const floatingDimensions = await getDimensionsFn(data.floating);
1713
- return {
1714
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1715
- floating: {
1716
- x: 0,
1717
- y: 0,
1718
- width: floatingDimensions.width,
1719
- height: floatingDimensions.height
1720
- }
1721
- };
1722
- };
1723
-
1724
- function isRTL(element) {
1725
- return getComputedStyle(element).direction === 'rtl';
1726
- }
1727
-
1728
- const platform = {
1729
- convertOffsetParentRelativeRectToViewportRelativeRect,
1730
- getDocumentElement,
1731
- getClippingRect,
1732
- getOffsetParent,
1733
- getElementRects,
1734
- getClientRects,
1735
- getDimensions,
1736
- getScale,
1737
- isElement,
1738
- isRTL
1739
- };
1740
-
1741
- // https://samthor.au/2021/observing-dom/
1742
- function observeMove(element, onMove) {
1743
- let io = null;
1744
- let timeoutId;
1745
- const root = getDocumentElement(element);
1746
- function cleanup() {
1747
- var _io;
1748
- clearTimeout(timeoutId);
1749
- (_io = io) == null || _io.disconnect();
1750
- io = null;
1751
- }
1752
- function refresh(skip, threshold) {
1753
- if (skip === void 0) {
1754
- skip = false;
1755
- }
1756
- if (threshold === void 0) {
1757
- threshold = 1;
1758
- }
1759
- cleanup();
1760
- const {
1761
- left,
1762
- top,
1763
- width,
1764
- height
1765
- } = element.getBoundingClientRect();
1766
- if (!skip) {
1767
- onMove();
1768
- }
1769
- if (!width || !height) {
1770
- return;
1771
- }
1772
- const insetTop = floor(top);
1773
- const insetRight = floor(root.clientWidth - (left + width));
1774
- const insetBottom = floor(root.clientHeight - (top + height));
1775
- const insetLeft = floor(left);
1776
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
1777
- const options = {
1778
- rootMargin,
1779
- threshold: max(0, min(1, threshold)) || 1
1780
- };
1781
- let isFirstUpdate = true;
1782
- function handleObserve(entries) {
1783
- const ratio = entries[0].intersectionRatio;
1784
- if (ratio !== threshold) {
1785
- if (!isFirstUpdate) {
1786
- return refresh();
1787
- }
1788
- if (!ratio) {
1789
- // If the reference is clipped, the ratio is 0. Throttle the refresh
1790
- // to prevent an infinite loop of updates.
1791
- timeoutId = setTimeout(() => {
1792
- refresh(false, 1e-7);
1793
- }, 1000);
1794
- } else {
1795
- refresh(false, ratio);
1796
- }
1797
- }
1798
- isFirstUpdate = false;
1799
- }
1800
-
1801
- // Older browsers don't support a `document` as the root and will throw an
1802
- // error.
1803
- try {
1804
- io = new IntersectionObserver(handleObserve, {
1805
- ...options,
1806
- // Handle <iframe>s
1807
- root: root.ownerDocument
1808
- });
1809
- } catch (e) {
1810
- io = new IntersectionObserver(handleObserve, options);
1811
- }
1812
- io.observe(element);
1813
- }
1814
- refresh(true);
1815
- return cleanup;
1816
- }
1817
-
1818
- /**
1819
- * Automatically updates the position of the floating element when necessary.
1820
- * Should only be called when the floating element is mounted on the DOM or
1821
- * visible on the screen.
1822
- * @returns cleanup function that should be invoked when the floating element is
1823
- * removed from the DOM or hidden from the screen.
1824
- * @see https://floating-ui.com/docs/autoUpdate
1825
- */
1826
- function autoUpdate(reference, floating, update, options) {
1827
- if (options === void 0) {
1828
- options = {};
1829
- }
1830
- const {
1831
- ancestorScroll = true,
1832
- ancestorResize = true,
1833
- elementResize = typeof ResizeObserver === 'function',
1834
- layoutShift = typeof IntersectionObserver === 'function',
1835
- animationFrame = false
1836
- } = options;
1837
- const referenceEl = unwrapElement(reference);
1838
- const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
1839
- ancestors.forEach(ancestor => {
1840
- ancestorScroll && ancestor.addEventListener('scroll', update, {
1841
- passive: true
1842
- });
1843
- ancestorResize && ancestor.addEventListener('resize', update);
1844
- });
1845
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1846
- let reobserveFrame = -1;
1847
- let resizeObserver = null;
1848
- if (elementResize) {
1849
- resizeObserver = new ResizeObserver(_ref => {
1850
- let [firstEntry] = _ref;
1851
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
1852
- // Prevent update loops when using the `size` middleware.
1853
- // https://github.com/floating-ui/floating-ui/issues/1740
1854
- resizeObserver.unobserve(floating);
1855
- cancelAnimationFrame(reobserveFrame);
1856
- reobserveFrame = requestAnimationFrame(() => {
1857
- var _resizeObserver;
1858
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1859
- });
1860
- }
1861
- update();
1862
- });
1863
- if (referenceEl && !animationFrame) {
1864
- resizeObserver.observe(referenceEl);
1865
- }
1866
- resizeObserver.observe(floating);
1867
- }
1868
- let frameId;
1869
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1870
- if (animationFrame) {
1871
- frameLoop();
1872
- }
1873
- function frameLoop() {
1874
- const nextRefRect = getBoundingClientRect(reference);
1875
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
1876
- update();
1877
- }
1878
- prevRefRect = nextRefRect;
1879
- frameId = requestAnimationFrame(frameLoop);
1880
- }
1881
- update();
1882
- return () => {
1883
- var _resizeObserver2;
1884
- ancestors.forEach(ancestor => {
1885
- ancestorScroll && ancestor.removeEventListener('scroll', update);
1886
- ancestorResize && ancestor.removeEventListener('resize', update);
1887
- });
1888
- cleanupIo == null || cleanupIo();
1889
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1890
- resizeObserver = null;
1891
- if (animationFrame) {
1892
- cancelAnimationFrame(frameId);
1893
- }
1894
- };
1895
- }
1896
-
1897
- /**
1898
- * Modifies the placement by translating the floating element along the
1899
- * specified axes.
1900
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
1901
- * object may be passed.
1902
- * @see https://floating-ui.com/docs/offset
1903
- */
1904
- const offset = offset$1;
1905
-
1906
- /**
1907
- * Optimizes the visibility of the floating element by choosing the placement
1908
- * that has the most space available automatically, without needing to specify a
1909
- * preferred placement. Alternative to `flip`.
1910
- * @see https://floating-ui.com/docs/autoPlacement
1911
- */
1912
- autoPlacement;
1913
-
1914
- /**
1915
- * Optimizes the visibility of the floating element by shifting it in order to
1916
- * keep it in view when it will overflow the clipping boundary.
1917
- * @see https://floating-ui.com/docs/shift
1918
- */
1919
- const shift = shift$1;
1920
-
1921
- /**
1922
- * Optimizes the visibility of the floating element by flipping the `placement`
1923
- * in order to keep it in view when the preferred placement(s) will overflow the
1924
- * clipping boundary. Alternative to `autoPlacement`.
1925
- * @see https://floating-ui.com/docs/flip
1926
- */
1927
- const flip = flip$1;
1928
-
1929
- /**
1930
- * Provides data that allows you to change the size of the floating element —
1931
- * for instance, prevent it from overflowing the clipping boundary or match the
1932
- * width of the reference element.
1933
- * @see https://floating-ui.com/docs/size
1934
- */
1935
- const size = size$1;
1936
-
1937
- /**
1938
- * Provides data to hide the floating element in applicable situations, such as
1939
- * when it is not in the same clipping context as the reference element.
1940
- * @see https://floating-ui.com/docs/hide
1941
- */
1942
- hide;
1943
-
1944
- /**
1945
- * Provides data to position an inner element of the floating element so that it
1946
- * appears centered to the reference element.
1947
- * @see https://floating-ui.com/docs/arrow
1948
- */
1949
- const arrow = arrow$1;
1950
-
1951
- /**
1952
- * Provides improved positioning for inline reference elements that can span
1953
- * over multiple lines, such as hyperlinks or range selections.
1954
- * @see https://floating-ui.com/docs/inline
1955
- */
1956
- const inline = inline$1;
1957
-
1958
- /**
1959
- * Built-in `limiter` that will stop `shift()` at a certain point.
1960
- */
1961
- const limitShift = limitShift$1;
1962
-
1963
- /**
1964
- * Computes the `x` and `y` coordinates that will place the floating element
1965
- * next to a given reference element.
1966
- */
1967
- const computePosition = (reference, floating, options) => {
1968
- // This caches the expensive `getClippingElementAncestors` function so that
1969
- // multiple lifecycle resets re-use the same result. It only lives for a
1970
- // single call. If other functions become expensive, we can add them as well.
1971
- const cache = new Map();
1972
- const mergedOptions = {
1973
- platform,
1974
- ...options
1975
- };
1976
- const platformWithCache = {
1977
- ...mergedOptions.platform,
1978
- _c: cache
1979
- };
1980
- return computePosition$1(reference, floating, {
1981
- ...mergedOptions,
1982
- platform: platformWithCache
1983
- });
1984
- };
1985
-
1986
- (()=>{var c=class extends Event{oldState;newState;constructor(t,{oldState:o="",newState:r="",...i}={}){super(t,i),this.oldState=String(o||""),this.newState=String(r||"");}},R=new WeakMap;function A(e,t,o){R.set(e,setTimeout(()=>{R.has(e)&&e.dispatchEvent(new c("toggle",{cancelable:!1,oldState:t,newState:o}));},0));}var D=globalThis.ShadowRoot||function(){},z=globalThis.HTMLDialogElement||function(){},M=new WeakMap,p=new WeakMap,h=new WeakMap;function L(e){return h.get(e)||"hidden"}var b=new WeakMap;function O(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let o=L(t);e.popoverTargetAction==="show"&&o==="showing"||e.popoverTargetAction==="hide"&&o==="hidden"||(o==="showing"?m(t,!0,!0):d(t,!1)&&(b.set(t,e),S(t)));}function d(e,t){return !(e.popover!=="auto"&&e.popover!=="manual"||!e.isConnected||t&&L(e)!=="showing"||!t&&L(e)!=="hidden"||e instanceof z&&e.hasAttribute("open")||document.fullscreenElement===e)}function N(e){return e?Array.from(p.get(e.ownerDocument)||[]).indexOf(e)+1:0}function V(e){let t=W(e),o=U(e);return N(t)>N(o)?t:o}function y(e){let t=p.get(e);for(let o of t||[])if(!o.isConnected)t.delete(o);else return o;return null}function v(e){return typeof e.getRootNode=="function"?e.getRootNode():e.parentNode?v(e.parentNode):e}function W(e){for(;e;){if(e instanceof HTMLElement&&e.popover==="auto"&&h.get(e)==="showing")return e;if(e=e.parentElement||v(e),e instanceof D&&(e=e.host),e instanceof Document)return}}function U(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||v(e),e instanceof D&&(e=e.host),e instanceof Document)return}}function G(e){let t=new Map,o=0,r=e.ownerDocument;for(let a of p.get(r)||[])t.set(a,o),o+=1;t.set(e,o),o+=1;let i=null;function l(a){let g=W(a);if(g===null)return null;let n=t.get(g);(i===null||t.get(i)<n)&&(i=g);}return l(e?.parentElement),i}function Q(e){return e.hidden||e instanceof D||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e instanceof HTMLAnchorElement&&e.href===""?!1:typeof e.tabIndex=="number"&&e.tabIndex!==-1}function _(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let o=t.querySelector("[autofocus]");if(o)return o;{let l=t.querySelectorAll("slot");for(let a of l){let g=a.assignedElements({flatten:!0});for(let n of g){if(n.hasAttribute("autofocus"))return n;if(o=n.querySelector("[autofocus]"),o)return o}}}let r=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){if(Q(i))return i;i=r.nextNode();}}function $(e){_(e)?.focus();}var H=new WeakMap;function S(e){if(!d(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new c("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!d(e,!1))return;let o=!1;if(e.popover==="auto"){let i=e.getAttribute("popover"),l=G(e)||t;if(T(l,!1,!0),i!==e.getAttribute("popover")||!d(e,!1))return}y(t)||(o=!0),H.delete(e);let r=t.activeElement;e.classList.add(":popover-open"),h.set(e,"showing"),M.has(t)||M.set(t,new Set),M.get(t).add(e),$(e),e.popover==="auto"&&(p.has(t)||p.set(t,new Set),p.get(t).add(e),q(b.get(e),!0)),o&&r&&e.popover==="auto"&&H.set(e,r),A(e,"closed","open");}function m(e,t=!1,o=!1){if(!d(e,!0))return;let r=e.ownerDocument;if(e.popover==="auto"&&(T(e,t,o),!d(e,!0))||(q(b.get(e),!1),b.delete(e),o&&(e.dispatchEvent(new c("beforetoggle",{oldState:"open",newState:"closed"})),!d(e,!0))))return;M.get(r)?.delete(e),p.get(r)?.delete(e),e.classList.remove(":popover-open"),h.set(e,"hidden"),o&&A(e,"open","closed");let i=H.get(e);i&&(H.delete(e),t&&i.focus());}function F(e,t=!1,o=!1){let r=y(e);for(;r;)m(r,t,o),r=y(e);}function T(e,t,o){let r=e.ownerDocument||e;if(e instanceof Document)return F(r,t,o);let i=null,l=!1;for(let a of p.get(r)||[])if(a===e)l=!0;else if(l){i=a;break}if(!l)return F(r,t,o);for(;i&&L(i)==="showing"&&p.get(r)?.size;)m(i,t,o);}var P=new WeakMap;function x(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let o=t.ownerDocument;if(!y(o))return;let i=V(t);if(i&&e.type==="pointerdown")P.set(o,i);else if(e.type==="pointerup"){let l=P.get(o)===i;P.delete(o),l&&T(i||o,!1,!0);}}var k=new WeakMap;function q(e,t=!1){if(!e)return;k.has(e)||k.set(e,e.getAttribute("aria-expanded"));let o=e.popoverTargetElement;if(o instanceof HTMLElement&&o.popover==="auto")e.setAttribute("aria-expanded",String(t));else {let r=k.get(e);r?e.setAttribute("aria-expanded",r):e.removeAttribute("aria-expanded");}}var B=globalThis.ShadowRoot||function(){};function j(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function f(e,t,o){let r=e[t];Object.defineProperty(e,t,{value(i){return r.call(this,o(i))}});}var J=/(^|[^\\]):popover-open\b/g,C=`
1987
- :where([popover]) {
1988
- position: fixed;
1989
- z-index: 2147483647;
1990
- inset: 0;
1991
- padding: 0.25em;
1992
- width: fit-content;
1993
- height: fit-content;
1994
- border-width: initial;
1995
- border-color: initial;
1996
- border-image: initial;
1997
- border-style: solid;
1998
- background-color: canvas;
1999
- color: canvastext;
2000
- overflow: auto;
2001
- margin: auto;
2002
- }
2003
-
2004
- :where(dialog[popover][open]) {
2005
- display: revert;
2006
- }
2007
-
2008
- :where([anchor].\\:popover-open) {
2009
- inset: auto;
2010
- }
2011
-
2012
- :where([anchor]:popover-open) {
2013
- inset: auto;
2014
- }
2015
-
2016
- @supports not (background-color: canvas) {
2017
- :where([popover]) {
2018
- background-color: white;
2019
- color: black;
2020
- }
2021
- }
2022
-
2023
- @supports (width: -moz-fit-content) {
2024
- :where([popover]) {
2025
- width: -moz-fit-content;
2026
- height: -moz-fit-content;
2027
- }
2028
- }
2029
-
2030
- @supports not (inset: 0) {
2031
- :where([popover]) {
2032
- top: 0;
2033
- left: 0;
2034
- right: 0;
2035
- bottom: 0;
2036
- }
2037
- }
2038
-
2039
- :where([popover]:not(.\\:popover-open)) {
2040
- display: none;
2041
- }
2042
- `,E=null;function I(e){if(E===null)try{E=new CSSStyleSheet,E.replaceSync(C);}catch{E=!1;}if(E===!1){let t=document.createElement("style");t.textContent=C,e instanceof Document?e.head.prepend(t):e.prepend(t);}else e.adoptedStyleSheets=[E,...e.adoptedStyleSheets];}function K(){window.ToggleEvent=window.ToggleEvent||c;function e(n){return n?.includes(":popover-open")&&(n=n.replace(J,"$1.\\:popover-open")),n}f(Document.prototype,"querySelector",e),f(Document.prototype,"querySelectorAll",e),f(Element.prototype,"querySelector",e),f(Element.prototype,"querySelectorAll",e),f(Element.prototype,"matches",e),f(Element.prototype,"closest",e),f(DocumentFragment.prototype,"querySelectorAll",e),f(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let n=(this.getAttribute("popover")||"").toLowerCase();return n===""||n=="auto"?"auto":"manual"},set(n){this.setAttribute("popover",n);}},showPopover:{enumerable:!0,configurable:!0,value(){S(this);}},hidePopover:{enumerable:!0,configurable:!0,value(){m(this,!0,!0);}},togglePopover:{enumerable:!0,configurable:!0,value(n){h.get(this)==="showing"&&n===void 0||n===!1?m(this,!0,!0):(n===void 0||n===!0)&&S(this);}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(n){let s=t.call(this,n);return I(s),s}}});let o=HTMLElement.prototype.attachInternals;o&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let n=o.call(this);return n.shadowRoot&&I(n.shadowRoot),n}}});let r=new WeakMap;function i(n){Object.defineProperties(n.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(s){if(s===null)this.removeAttribute("popovertarget"),r.delete(this);else if(s instanceof Element)this.setAttribute("popovertarget",""),r.set(this,s);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let s=r.get(this);if(s&&s.isConnected)return s;if(s&&!s.isConnected)return r.delete(this),null;let u=v(this),w=this.getAttribute("popovertarget");return (u instanceof Document||u instanceof B)&&w&&u.getElementById(w)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let s=(this.getAttribute("popovertargetaction")||"").toLowerCase();return s==="show"||s==="hide"?s:"toggle"},set(s){this.setAttribute("popovertargetaction",s);}}});}i(HTMLButtonElement),i(HTMLInputElement);let l=n=>{if(!n.isTrusted)return;let s=n.composedPath()[0];if(!(s instanceof Element)||s?.shadowRoot)return;let u=v(s);if(!(u instanceof B||u instanceof Document))return;let w=s.closest("[popovertargetaction],[popovertarget]");if(w){O(w),n.preventDefault();return}},a=n=>{let s=n.key,u=n.target;!n.defaultPrevented&&u&&(s==="Escape"||s==="Esc")&&T(u.ownerDocument,!0,!0);};(n=>{n.addEventListener("click",l),n.addEventListener("keydown",a),n.addEventListener("pointerdown",x),n.addEventListener("pointerup",x);})(document),I(document);}j()||K();})();
2043
-
2044
- const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;color:var(--post-contrast-color);background-color:rgb(var(--post-bg-rgb));border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
2045
- const PostPopovercontainerStyle0 = postPopovercontainerCss;
2046
-
2047
- const SIDE_MAP = {
2048
- top: 'bottom',
2049
- right: 'left',
2050
- bottom: 'top',
2051
- left: 'right',
2052
- };
2053
- const PostPopovercontainer = class {
2054
- constructor(hostRef) {
2055
- index.registerInstance(this, hostRef);
2056
- this.postToggle = index.createEvent(this, "postToggle", 7);
2057
- this.placement = 'top';
2058
- this.arrow = false;
2059
- }
2060
- componentDidLoad() {
2061
- this.host.setAttribute('popover', '');
2062
- this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
2063
- }
2064
- disconnectedCallback() {
2065
- if (typeof this.clearAutoUpdate === 'function')
2066
- this.clearAutoUpdate();
2067
- }
2068
- /**
2069
- * Programmatically display the tooltip
2070
- * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
2071
- */
2072
- async show(target) {
2073
- if (!this.toggleTimeoutId) {
2074
- this.eventTarget = target;
2075
- this.calculatePosition();
2076
- this.host.showPopover();
2077
- }
2078
- }
2079
- /**
2080
- * Programmatically hide this tooltip
2081
- */
2082
- async hide() {
2083
- if (!this.toggleTimeoutId) {
2084
- this.eventTarget = null;
2085
- this.host.hidePopover();
2086
- }
2087
- }
2088
- /**
2089
- * Toggle tooltip display
2090
- * @param target An element with [data-tooltip-target="id"] where the tooltip should be shown
2091
- * @param force Pass true to always show or false to always hide
2092
- */
2093
- async toggle(target, force) {
2094
- // Prevent instant double toggle
2095
- if (!this.toggleTimeoutId) {
2096
- this.eventTarget = target;
2097
- this.calculatePosition();
2098
- this.host.togglePopover(force);
2099
- this.toggleTimeoutId = null;
2100
- }
2101
- return this.host.matches(':where(:popover-open, .popover-open');
2102
- }
2103
- /**
2104
- * Start or stop auto updates based on tooltip events.
2105
- * Tooltips can be closed or opened with other methods than class members,
2106
- * therefore listening to the toggle event is safer for cleaning up.
2107
- * @param e ToggleEvent
2108
- */
2109
- handleToggle(e) {
2110
- this.toggleTimeoutId = window.setTimeout(() => (this.toggleTimeoutId = null), 10);
2111
- const isOpen = e.newState === 'open';
2112
- if (isOpen) {
2113
- this.startAutoupdates();
2114
- }
2115
- else {
2116
- if (typeof this.clearAutoUpdate === 'function')
2117
- this.clearAutoUpdate();
2118
- }
2119
- this.postToggle.emit(isOpen);
2120
- }
2121
- /**
2122
- * Start listening for DOM updates, scroll events etc. that have
2123
- * an influence on tooltip positioning
2124
- */
2125
- startAutoupdates() {
2126
- this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.calculatePosition.bind(this));
2127
- }
2128
- async calculatePosition() {
2129
- const middleware = [
2130
- flip(),
2131
- inline(),
2132
- shift({
2133
- padding: 8,
2134
- // Prevents shifting away from the anchor too far, while shifting as far as possible
2135
- // https://floating-ui.com/docs/shift#limiter
2136
- limiter: limitShift({
2137
- offset: 32,
2138
- }),
2139
- }),
2140
- size({
2141
- apply({ availableWidth, elements }) {
2142
- Object.assign(elements.floating.style, {
2143
- maxWidth: `${availableWidth - 16}px`,
2144
- });
2145
- },
2146
- }),
2147
- offset(this.arrow ? 12 : 8), // 4px outside of element to account for focus outline + ~arrow size
2148
- ];
2149
- if (this.arrow) {
2150
- middleware.push(arrow({ element: this.arrowRef, padding: 8 }));
2151
- }
2152
- const { x, y, middlewareData, placement: currentPlacement, } = await computePosition(this.eventTarget, this.host, {
2153
- placement: this.placement || 'top',
2154
- strategy: 'fixed',
2155
- middleware,
2156
- });
2157
- // Tooltip
2158
- this.host.style.left = `${x}px`;
2159
- this.host.style.top = `${y}px`;
2160
- // Arrow
2161
- if (this.arrow) {
2162
- // Tutorial: https://codesandbox.io/s/mystifying-kare-ee3hmh?file=/src/index.js
2163
- const side = currentPlacement.split('-')[0];
2164
- const { x: arrowX, y: arrowY } = middlewareData.arrow;
2165
- const staticSide = SIDE_MAP[side];
2166
- const offsetBorderLineJoin = 2;
2167
- Object.assign(this.arrowRef.style, {
2168
- top: arrowY ? `${arrowY}px` : '',
2169
- left: arrowX ? `${arrowX}px` : '',
2170
- [staticSide]: `${-this.arrowRef.offsetWidth / 2 - offsetBorderLineJoin}px`,
2171
- });
2172
- // Add position as a class to be able to style arrow for HCM
2173
- this.arrowRef.classList.remove(...Object.values(SIDE_MAP));
2174
- this.arrowRef.classList.add(staticSide);
2175
- }
2176
- }
2177
- render() {
2178
- return (index.h(index.Host, { key: 'daf21d119057a14c2c2f68b8068901ab698beae3', "data-version": _package.version }, this.arrow && (index.h("span", { key: '4f5cfb1422217f9ef71732cdfc0c97b6b29e4809', class: "arrow", ref: el => {
2179
- this.arrowRef = el;
2180
- } })), index.h("slot", { key: 'f6e4beefb8e365dbf20a0a5019cceaac4ecb73a4' })));
2181
- }
2182
- get host() { return index.getElement(this); }
2183
- };
2184
- PostPopovercontainer.style = PostPopovercontainerStyle0;
2185
-
2186
- exports.PostPopovercontainer = PostPopovercontainer;