@ukic/canary-web-components 2.0.0-canary.7 → 2.0.0-canary.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (449) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/date-helpers-c9551119.js +150 -0
  3. package/dist/cjs/date-helpers-c9551119.js.map +1 -0
  4. package/dist/cjs/{helpers-00b08718.js → helpers-7a069459.js} +8 -3
  5. package/dist/cjs/helpers-7a069459.js.map +1 -0
  6. package/dist/cjs/helpers-f75cf7cf.js +280 -0
  7. package/dist/cjs/helpers-f75cf7cf.js.map +1 -0
  8. package/dist/cjs/ic-accordion-group.cjs.entry.js +6 -2
  9. package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-alert.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-badge.cjs.entry.js +4 -3
  14. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  16. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  17. package/dist/cjs/ic-button_3.cjs.entry.js +29 -12
  18. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ic-card.cjs.entry.js +5 -6
  20. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  21. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  22. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  24. package/dist/cjs/ic-data-entity.cjs.entry.js +3 -6
  25. package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
  26. package/dist/cjs/ic-data-row.cjs.entry.js +21 -35
  27. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  28. package/dist/cjs/ic-date-input.cjs.entry.js +1073 -0
  29. package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -0
  30. package/dist/cjs/ic-date-picker.cjs.entry.js +1043 -0
  31. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -0
  32. package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  34. package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
  35. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  37. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  38. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-input-component-container_4.cjs.entry.js +150 -0
  41. package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +1 -0
  42. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  43. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +2599 -0
  46. package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -0
  47. package/dist/cjs/{ic-input-component-container_3.cjs.entry.js → ic-menu.cjs.entry.js} +8 -70
  48. package/dist/cjs/ic-menu.cjs.entry.js.map +1 -0
  49. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  50. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  51. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  52. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  53. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-pagination-bar.cjs.entry.js +2 -18
  55. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -1
  56. package/dist/cjs/ic-pagination_4.cjs.entry.js +21 -13
  57. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  58. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  60. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  61. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  62. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  63. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  64. package/dist/cjs/ic-select-with-multi.cjs.entry.js +824 -0
  65. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -0
  66. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
  67. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  71. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  72. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  73. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  74. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  75. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  76. package/dist/cjs/ic-toggle-button-group.cjs.entry.js +184 -0
  77. package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -0
  78. package/dist/cjs/ic-toggle-button.cjs.entry.js +6 -3
  79. package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
  80. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  81. package/dist/cjs/ic-typography.cjs.entry.js +1 -1
  82. package/dist/cjs/index-4cf27b16.js +24 -4
  83. package/dist/cjs/loader.cjs.js +1 -1
  84. package/dist/collection/assets/calendar.svg +3 -0
  85. package/dist/collection/collection-manifest.json +6 -1
  86. package/dist/collection/components/ic-date-input/ic-date-input.css +560 -0
  87. package/dist/collection/components/ic-date-input/ic-date-input.js +1668 -0
  88. package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -0
  89. package/dist/collection/components/ic-date-input/story-data.js +28 -0
  90. package/dist/collection/components/ic-date-input/story-data.js.map +1 -0
  91. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +1156 -0
  92. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -0
  93. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js +42 -0
  94. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js.map +1 -0
  95. package/dist/collection/components/ic-date-picker/ic-date-picker.css +878 -0
  96. package/dist/collection/components/ic-date-picker/ic-date-picker.js +1499 -0
  97. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -0
  98. package/dist/collection/components/ic-date-picker/ic-day-button.js +36 -0
  99. package/dist/collection/components/ic-date-picker/ic-day-button.js.map +1 -0
  100. package/dist/collection/components/ic-date-picker/ic-month-picker.js +29 -0
  101. package/dist/collection/components/ic-date-picker/ic-month-picker.js.map +1 -0
  102. package/dist/collection/components/ic-date-picker/ic-year-picker.js +39 -0
  103. package/dist/collection/components/ic-date-picker/ic-year-picker.js.map +1 -0
  104. package/dist/collection/components/ic-date-picker/story-data.js +143 -0
  105. package/dist/collection/components/ic-date-picker/story-data.js.map +1 -0
  106. package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js +13 -0
  107. package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js.map +1 -0
  108. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js +207 -0
  109. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js.map +1 -0
  110. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +962 -0
  111. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -0
  112. package/dist/collection/components/ic-menu-with-multi/ic-menu.css +701 -0
  113. package/dist/collection/components/ic-menu-with-multi/ic-menu.js +1458 -0
  114. package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -0
  115. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js +880 -0
  116. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js.map +1 -0
  117. package/dist/collection/components/ic-select-with-multi/assets/Check.svg +3 -0
  118. package/dist/collection/components/ic-select-with-multi/assets/Clear.svg +3 -0
  119. package/dist/collection/components/ic-select-with-multi/assets/Expand.svg +3 -0
  120. package/dist/collection/components/ic-select-with-multi/ic-select.css +693 -0
  121. package/dist/collection/components/ic-select-with-multi/ic-select.js +1649 -0
  122. package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -0
  123. package/dist/collection/components/ic-select-with-multi/story-data.js +216 -0
  124. package/dist/collection/components/ic-select-with-multi/story-data.js.map +1 -0
  125. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js +146 -0
  126. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js.map +1 -0
  127. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js +2040 -0
  128. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js.map +1 -0
  129. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js +1518 -0
  130. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js.map +1 -0
  131. package/dist/collection/utils/constants.js +83 -0
  132. package/dist/collection/utils/constants.js.map +1 -0
  133. package/dist/collection/utils/date-helpers.js +133 -0
  134. package/dist/collection/utils/date-helpers.js.map +1 -0
  135. package/dist/collection/utils/helpers.js +417 -5
  136. package/dist/collection/utils/helpers.js.map +1 -1
  137. package/dist/collection/utils/types.js +58 -0
  138. package/dist/collection/utils/types.js.map +1 -0
  139. package/dist/components/helpers.js +8 -3
  140. package/dist/components/helpers.js.map +1 -1
  141. package/dist/components/helpers2.js +262 -0
  142. package/dist/components/helpers2.js.map +1 -0
  143. package/dist/components/ic-accordion-group.js +7 -2
  144. package/dist/components/ic-accordion-group.js.map +1 -1
  145. package/dist/components/ic-badge.js +3 -2
  146. package/dist/components/ic-badge.js.map +1 -1
  147. package/dist/components/ic-button2.js +32 -13
  148. package/dist/components/ic-button2.js.map +1 -1
  149. package/dist/components/ic-card.js +6 -19
  150. package/dist/components/ic-card.js.map +1 -1
  151. package/dist/components/ic-checkbox-group.js +1 -1
  152. package/dist/components/ic-checkbox.js +1 -1
  153. package/dist/components/ic-chip.js +1 -1
  154. package/dist/components/ic-data-entity.js +3 -6
  155. package/dist/components/ic-data-entity.js.map +1 -1
  156. package/dist/components/ic-data-row.js +20 -34
  157. package/dist/components/ic-data-row.js.map +1 -1
  158. package/dist/components/ic-date-input.d.ts +11 -0
  159. package/dist/components/ic-date-input.js +8 -0
  160. package/dist/components/ic-date-input.js.map +1 -0
  161. package/dist/components/ic-date-input2.js +1301 -0
  162. package/dist/components/ic-date-input2.js.map +1 -0
  163. package/dist/components/ic-date-picker.d.ts +11 -0
  164. package/dist/components/ic-date-picker.js +1164 -0
  165. package/dist/components/ic-date-picker.js.map +1 -0
  166. package/dist/components/ic-input-component-container2.js +7 -6
  167. package/dist/components/ic-input-component-container2.js.map +1 -1
  168. package/dist/components/ic-link2.js +1 -1
  169. package/dist/components/ic-menu-item2.js +1 -1
  170. package/dist/components/ic-menu-with-multi.d.ts +11 -0
  171. package/dist/components/ic-menu-with-multi.js +8 -0
  172. package/dist/components/ic-menu-with-multi.js.map +1 -0
  173. package/dist/components/ic-menu2.js +5 -4
  174. package/dist/components/ic-menu2.js.map +1 -1
  175. package/dist/components/ic-menu3.js +2665 -0
  176. package/dist/components/ic-menu3.js.map +1 -0
  177. package/dist/components/ic-navigation-button.js +1 -1
  178. package/dist/components/ic-pagination-bar2.js +1 -17
  179. package/dist/components/ic-pagination-bar2.js.map +1 -1
  180. package/dist/components/ic-pagination-item2.js +1 -1
  181. package/dist/components/ic-pagination2.js +1 -1
  182. package/dist/components/ic-popover-menu.js +1 -1
  183. package/dist/components/ic-popover-menu.js.map +1 -1
  184. package/dist/components/ic-radio-group.js +1 -1
  185. package/dist/components/ic-radio-option.js +1 -1
  186. package/dist/components/ic-search-bar.js +1 -1
  187. package/dist/components/ic-search-bar.js.map +1 -1
  188. package/dist/components/ic-select-with-multi.d.ts +11 -0
  189. package/dist/components/ic-select-with-multi.js +949 -0
  190. package/dist/components/ic-select-with-multi.js.map +1 -0
  191. package/dist/components/ic-select2.js +23 -14
  192. package/dist/components/ic-select2.js.map +1 -1
  193. package/dist/components/ic-switch.js +1 -1
  194. package/dist/components/ic-tab.js +1 -1
  195. package/dist/components/ic-text-field2.js +1 -1
  196. package/dist/components/ic-toggle-button-group.js +210 -0
  197. package/dist/components/ic-toggle-button-group.js.map +1 -0
  198. package/dist/components/ic-toggle-button.js +6 -3
  199. package/dist/components/ic-toggle-button.js.map +1 -1
  200. package/dist/core/core.css +8 -5
  201. package/dist/core/core.esm.js +1 -1
  202. package/dist/core/core.esm.js.map +1 -1
  203. package/dist/core/{p-5e94fae8.entry.js → p-06ae5bec.entry.js} +2 -2
  204. package/dist/core/p-06ae5bec.entry.js.map +1 -0
  205. package/dist/core/{p-d5cc084b.entry.js → p-0939ce92.entry.js} +2 -2
  206. package/dist/core/{p-d5cc084b.entry.js.map → p-0939ce92.entry.js.map} +1 -1
  207. package/dist/core/{p-6de46cb7.entry.js → p-16f67397.entry.js} +2 -2
  208. package/dist/core/p-16f67397.entry.js.map +1 -0
  209. package/dist/core/{p-a2f366c7.entry.js → p-1832f4b5.entry.js} +2 -2
  210. package/dist/core/{p-28fb7cca.entry.js → p-1b7d426b.entry.js} +2 -2
  211. package/dist/core/p-1b7d426b.entry.js.map +1 -0
  212. package/dist/core/{p-ff1d23cd.entry.js → p-1ce75941.entry.js} +2 -2
  213. package/dist/core/{p-5746577f.entry.js → p-2e2e0099.entry.js} +2 -2
  214. package/dist/core/p-33679c06.entry.js +2 -0
  215. package/dist/core/p-33679c06.entry.js.map +1 -0
  216. package/dist/core/{p-ca262cdc.entry.js → p-36508aad.entry.js} +2 -2
  217. package/dist/core/{p-7276339a.entry.js → p-3745da83.entry.js} +2 -2
  218. package/dist/core/{p-b43bd4f3.entry.js → p-3f2e77c3.entry.js} +2 -2
  219. package/dist/core/{p-24945ee5.entry.js → p-452985d9.entry.js} +2 -2
  220. package/dist/core/p-452985d9.entry.js.map +1 -0
  221. package/dist/core/{p-3c859b9e.entry.js → p-47ac6838.entry.js} +2 -2
  222. package/dist/core/{p-3d2fcf84.entry.js → p-4f1ffa39.entry.js} +2 -2
  223. package/dist/core/{p-4df42c76.entry.js → p-5759d771.entry.js} +2 -2
  224. package/dist/core/{p-32f18701.entry.js → p-5e2e6c3b.entry.js} +2 -2
  225. package/dist/core/{p-f436630b.entry.js → p-5fe96107.entry.js} +2 -2
  226. package/dist/core/{p-7dfd61bb.entry.js → p-62e22508.entry.js} +2 -2
  227. package/dist/core/{p-d49660e0.entry.js → p-6690bc04.entry.js} +2 -2
  228. package/dist/core/{p-f827e4c0.entry.js → p-6c0e2ceb.entry.js} +2 -2
  229. package/dist/core/{p-a3ab9f4c.entry.js → p-76915584.entry.js} +2 -2
  230. package/dist/core/p-76915584.entry.js.map +1 -0
  231. package/dist/core/{p-966ab920.entry.js → p-76d26018.entry.js} +2 -2
  232. package/dist/core/{p-79b71c18.entry.js → p-776671cf.entry.js} +2 -2
  233. package/dist/core/{p-434780c8.entry.js → p-7cecf5d5.entry.js} +2 -2
  234. package/dist/core/{p-88971cea.entry.js → p-85609bdd.entry.js} +2 -2
  235. package/dist/core/{p-95d3cd52.entry.js → p-86012178.entry.js} +2 -2
  236. package/dist/core/{p-2094c844.entry.js → p-8a7e7d23.entry.js} +2 -2
  237. package/dist/core/{p-aafb2c79.entry.js → p-8c90110a.entry.js} +2 -2
  238. package/dist/core/{p-9ce5f082.entry.js → p-8ea47d42.entry.js} +2 -2
  239. package/dist/core/{p-0d181ac8.entry.js → p-982a6e88.entry.js} +2 -2
  240. package/dist/core/{p-3b9f3a07.entry.js → p-98448bdb.entry.js} +2 -2
  241. package/dist/core/{p-c263542a.entry.js → p-9d01a7ad.entry.js} +2 -2
  242. package/dist/core/{p-051b8266.entry.js → p-9d540656.entry.js} +2 -2
  243. package/dist/core/p-9e3178e8.entry.js +2 -0
  244. package/dist/core/p-9e3178e8.entry.js.map +1 -0
  245. package/dist/core/{p-9fd84c69.entry.js → p-a0f9b259.entry.js} +2 -2
  246. package/dist/core/{p-7632acc6.entry.js → p-a42c2f37.entry.js} +2 -2
  247. package/dist/core/{p-fbb1fba0.entry.js → p-a6447b13.entry.js} +2 -2
  248. package/dist/core/p-aabab75f.entry.js +2 -0
  249. package/dist/core/p-aabab75f.entry.js.map +1 -0
  250. package/dist/core/{p-116b18fe.entry.js → p-ae422058.entry.js} +2 -2
  251. package/dist/core/{p-a7d52bd1.entry.js → p-b306cbc8.entry.js} +2 -2
  252. package/dist/core/p-c7590421.entry.js +2 -0
  253. package/dist/core/p-c7590421.entry.js.map +1 -0
  254. package/dist/core/{p-a162744e.entry.js → p-c7820c23.entry.js} +2 -2
  255. package/dist/core/{p-a162744e.entry.js.map → p-c7820c23.entry.js.map} +1 -1
  256. package/dist/core/{p-d78fd9f3.entry.js → p-ca8cbd6a.entry.js} +2 -2
  257. package/dist/core/{p-da4f0a58.entry.js → p-caf857de.entry.js} +2 -2
  258. package/dist/core/p-cc7bc438.entry.js +2 -0
  259. package/dist/core/p-cc7bc438.entry.js.map +1 -0
  260. package/dist/core/p-cd799087.js +2 -0
  261. package/dist/core/p-cd799087.js.map +1 -0
  262. package/dist/core/p-d32692e2.entry.js +2 -0
  263. package/dist/core/p-d32692e2.entry.js.map +1 -0
  264. package/dist/core/p-d35c7c18.js +2 -0
  265. package/dist/core/p-d35c7c18.js.map +1 -0
  266. package/dist/core/{p-27aa95e7.entry.js → p-d3856ed3.entry.js} +2 -2
  267. package/dist/core/{p-c345a874.entry.js → p-d4fdd8c1.entry.js} +2 -2
  268. package/dist/core/{p-337b6e05.entry.js → p-d5c99ec3.entry.js} +2 -2
  269. package/dist/core/p-e473bbf8.entry.js +2 -0
  270. package/dist/core/p-e473bbf8.entry.js.map +1 -0
  271. package/dist/core/p-e74f1d09.entry.js +2 -0
  272. package/dist/core/p-e74f1d09.entry.js.map +1 -0
  273. package/dist/core/p-e79e0292.entry.js +2 -0
  274. package/dist/core/p-e79e0292.entry.js.map +1 -0
  275. package/dist/core/{p-0f0509ee.entry.js → p-e84b0310.entry.js} +2 -2
  276. package/dist/core/p-e84b0310.entry.js.map +1 -0
  277. package/dist/core/{p-93c5b849.entry.js → p-f55ad6ae.entry.js} +2 -2
  278. package/dist/core/p-f8cf2978.js +2 -0
  279. package/dist/core/p-f8cf2978.js.map +1 -0
  280. package/dist/core/p-f91527a0.entry.js +2 -0
  281. package/dist/core/p-f91527a0.entry.js.map +1 -0
  282. package/dist/core/{p-d9342548.entry.js → p-fbf4e9b7.entry.js} +2 -2
  283. package/dist/esm/core.js +1 -1
  284. package/dist/esm/date-helpers-4f432e92.js +136 -0
  285. package/dist/esm/date-helpers-4f432e92.js.map +1 -0
  286. package/dist/esm/{helpers-d06dc4ed.js → helpers-7aa21b0a.js} +8 -3
  287. package/dist/esm/helpers-7aa21b0a.js.map +1 -0
  288. package/dist/esm/helpers-f328a7b6.js +262 -0
  289. package/dist/esm/helpers-f328a7b6.js.map +1 -0
  290. package/dist/esm/ic-accordion-group.entry.js +6 -2
  291. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  292. package/dist/esm/ic-accordion.entry.js +1 -1
  293. package/dist/esm/ic-alert.entry.js +1 -1
  294. package/dist/esm/ic-back-to-top.entry.js +1 -1
  295. package/dist/esm/ic-badge.entry.js +4 -3
  296. package/dist/esm/ic-badge.entry.js.map +1 -1
  297. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  298. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  299. package/dist/esm/ic-button_3.entry.js +29 -12
  300. package/dist/esm/ic-button_3.entry.js.map +1 -1
  301. package/dist/esm/ic-card.entry.js +5 -6
  302. package/dist/esm/ic-card.entry.js.map +1 -1
  303. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  304. package/dist/esm/ic-checkbox.entry.js +1 -1
  305. package/dist/esm/ic-chip.entry.js +1 -1
  306. package/dist/esm/ic-data-entity.entry.js +3 -6
  307. package/dist/esm/ic-data-entity.entry.js.map +1 -1
  308. package/dist/esm/ic-data-row.entry.js +21 -35
  309. package/dist/esm/ic-data-row.entry.js.map +1 -1
  310. package/dist/esm/ic-date-input.entry.js +1069 -0
  311. package/dist/esm/ic-date-input.entry.js.map +1 -0
  312. package/dist/esm/ic-date-picker.entry.js +1039 -0
  313. package/dist/esm/ic-date-picker.entry.js.map +1 -0
  314. package/dist/esm/ic-dialog.entry.js +1 -1
  315. package/dist/esm/ic-divider.entry.js +1 -1
  316. package/dist/esm/ic-empty-state.entry.js +1 -1
  317. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  318. package/dist/esm/ic-footer-link.entry.js +1 -1
  319. package/dist/esm/ic-footer.entry.js +1 -1
  320. package/dist/esm/ic-hero.entry.js +1 -1
  321. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  322. package/dist/esm/ic-input-component-container_4.entry.js +143 -0
  323. package/dist/esm/ic-input-component-container_4.entry.js.map +1 -0
  324. package/dist/esm/ic-link.entry.js +1 -1
  325. package/dist/esm/ic-menu-group.entry.js +1 -1
  326. package/dist/esm/ic-menu-item.entry.js +1 -1
  327. package/dist/esm/ic-menu-with-multi.entry.js +2595 -0
  328. package/dist/esm/ic-menu-with-multi.entry.js.map +1 -0
  329. package/dist/esm/{ic-input-component-container_3.entry.js → ic-menu.entry.js} +10 -70
  330. package/dist/esm/ic-menu.entry.js.map +1 -0
  331. package/dist/esm/ic-navigation-button.entry.js +1 -1
  332. package/dist/esm/ic-navigation-group.entry.js +1 -1
  333. package/dist/esm/ic-navigation-item.entry.js +1 -1
  334. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  335. package/dist/esm/ic-page-header.entry.js +1 -1
  336. package/dist/esm/ic-pagination-bar.entry.js +1 -17
  337. package/dist/esm/ic-pagination-bar.entry.js.map +1 -1
  338. package/dist/esm/ic-pagination_4.entry.js +21 -13
  339. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  340. package/dist/esm/ic-popover-menu.entry.js +1 -1
  341. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  342. package/dist/esm/ic-radio-group.entry.js +1 -1
  343. package/dist/esm/ic-radio-option.entry.js +1 -1
  344. package/dist/esm/ic-search-bar.entry.js +1 -1
  345. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  346. package/dist/esm/ic-select-with-multi.entry.js +820 -0
  347. package/dist/esm/ic-select-with-multi.entry.js.map +1 -0
  348. package/dist/esm/ic-side-navigation.entry.js +1 -1
  349. package/dist/esm/ic-status-tag.entry.js +1 -1
  350. package/dist/esm/ic-step.entry.js +1 -1
  351. package/dist/esm/ic-stepper.entry.js +1 -1
  352. package/dist/esm/ic-switch.entry.js +1 -1
  353. package/dist/esm/ic-tab-group.entry.js +1 -1
  354. package/dist/esm/ic-tab-panel.entry.js +1 -1
  355. package/dist/esm/ic-tab.entry.js +1 -1
  356. package/dist/esm/ic-theme.entry.js +1 -1
  357. package/dist/esm/ic-toast.entry.js +1 -1
  358. package/dist/esm/ic-toggle-button-group.entry.js +180 -0
  359. package/dist/esm/ic-toggle-button-group.entry.js.map +1 -0
  360. package/dist/esm/ic-toggle-button.entry.js +6 -3
  361. package/dist/esm/ic-toggle-button.entry.js.map +1 -1
  362. package/dist/esm/ic-top-navigation.entry.js +1 -1
  363. package/dist/esm/ic-typography.entry.js +1 -1
  364. package/dist/esm/index-93509377.js +24 -4
  365. package/dist/esm/loader.js +1 -1
  366. package/dist/types/components/ic-date-input/ic-date-input.d.ts +242 -0
  367. package/dist/types/components/ic-date-input/story-data.d.ts +1 -0
  368. package/dist/types/components/ic-date-input/test/helpers/ic-date-input.d.ts +23 -0
  369. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +251 -0
  370. package/dist/types/components/ic-date-picker/ic-day-button.d.ts +16 -0
  371. package/dist/types/components/ic-date-picker/ic-month-picker.d.ts +14 -0
  372. package/dist/types/components/ic-date-picker/ic-year-picker.d.ts +16 -0
  373. package/dist/types/components/ic-date-picker/story-data.d.ts +22 -0
  374. package/dist/types/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.d.ts +1 -0
  375. package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +208 -0
  376. package/dist/types/components/ic-select-with-multi/ic-select.d.ts +289 -0
  377. package/dist/types/components/ic-select-with-multi/story-data.d.ts +32 -0
  378. package/dist/types/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.d.ts +1 -0
  379. package/dist/types/components.d.ts +966 -0
  380. package/dist/types/utils/constants.d.ts +38 -0
  381. package/dist/types/utils/date-helpers.d.ts +22 -0
  382. package/dist/types/utils/helpers.d.ts +133 -2
  383. package/dist/types/utils/types.d.ts +107 -0
  384. package/hydrate/index.js +12358 -6070
  385. package/package.json +3 -3
  386. package/dist/cjs/helpers-00b08718.js.map +0 -1
  387. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +0 -1
  388. package/dist/cjs/ic-input-label_2.cjs.entry.js +0 -86
  389. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +0 -1
  390. package/dist/core/p-0f0509ee.entry.js.map +0 -1
  391. package/dist/core/p-24945ee5.entry.js.map +0 -1
  392. package/dist/core/p-28fb7cca.entry.js.map +0 -1
  393. package/dist/core/p-2aad58b6.js +0 -2
  394. package/dist/core/p-2aad58b6.js.map +0 -1
  395. package/dist/core/p-38314d45.entry.js +0 -2
  396. package/dist/core/p-38314d45.entry.js.map +0 -1
  397. package/dist/core/p-5e94fae8.entry.js.map +0 -1
  398. package/dist/core/p-6de46cb7.entry.js.map +0 -1
  399. package/dist/core/p-7b849cb5.entry.js +0 -2
  400. package/dist/core/p-7b849cb5.entry.js.map +0 -1
  401. package/dist/core/p-9fdd7d73.entry.js +0 -2
  402. package/dist/core/p-9fdd7d73.entry.js.map +0 -1
  403. package/dist/core/p-a3ab9f4c.entry.js.map +0 -1
  404. package/dist/core/p-c9b11488.entry.js +0 -2
  405. package/dist/core/p-c9b11488.entry.js.map +0 -1
  406. package/dist/core/p-f163a406.entry.js +0 -2
  407. package/dist/core/p-f163a406.entry.js.map +0 -1
  408. package/dist/esm/helpers-d06dc4ed.js.map +0 -1
  409. package/dist/esm/ic-input-component-container_3.entry.js.map +0 -1
  410. package/dist/esm/ic-input-label_2.entry.js +0 -81
  411. package/dist/esm/ic-input-label_2.entry.js.map +0 -1
  412. /package/dist/core/{p-a2f366c7.entry.js.map → p-1832f4b5.entry.js.map} +0 -0
  413. /package/dist/core/{p-ff1d23cd.entry.js.map → p-1ce75941.entry.js.map} +0 -0
  414. /package/dist/core/{p-5746577f.entry.js.map → p-2e2e0099.entry.js.map} +0 -0
  415. /package/dist/core/{p-ca262cdc.entry.js.map → p-36508aad.entry.js.map} +0 -0
  416. /package/dist/core/{p-7276339a.entry.js.map → p-3745da83.entry.js.map} +0 -0
  417. /package/dist/core/{p-b43bd4f3.entry.js.map → p-3f2e77c3.entry.js.map} +0 -0
  418. /package/dist/core/{p-3c859b9e.entry.js.map → p-47ac6838.entry.js.map} +0 -0
  419. /package/dist/core/{p-3d2fcf84.entry.js.map → p-4f1ffa39.entry.js.map} +0 -0
  420. /package/dist/core/{p-4df42c76.entry.js.map → p-5759d771.entry.js.map} +0 -0
  421. /package/dist/core/{p-32f18701.entry.js.map → p-5e2e6c3b.entry.js.map} +0 -0
  422. /package/dist/core/{p-f436630b.entry.js.map → p-5fe96107.entry.js.map} +0 -0
  423. /package/dist/core/{p-7dfd61bb.entry.js.map → p-62e22508.entry.js.map} +0 -0
  424. /package/dist/core/{p-d49660e0.entry.js.map → p-6690bc04.entry.js.map} +0 -0
  425. /package/dist/core/{p-f827e4c0.entry.js.map → p-6c0e2ceb.entry.js.map} +0 -0
  426. /package/dist/core/{p-966ab920.entry.js.map → p-76d26018.entry.js.map} +0 -0
  427. /package/dist/core/{p-79b71c18.entry.js.map → p-776671cf.entry.js.map} +0 -0
  428. /package/dist/core/{p-434780c8.entry.js.map → p-7cecf5d5.entry.js.map} +0 -0
  429. /package/dist/core/{p-88971cea.entry.js.map → p-85609bdd.entry.js.map} +0 -0
  430. /package/dist/core/{p-95d3cd52.entry.js.map → p-86012178.entry.js.map} +0 -0
  431. /package/dist/core/{p-2094c844.entry.js.map → p-8a7e7d23.entry.js.map} +0 -0
  432. /package/dist/core/{p-aafb2c79.entry.js.map → p-8c90110a.entry.js.map} +0 -0
  433. /package/dist/core/{p-9ce5f082.entry.js.map → p-8ea47d42.entry.js.map} +0 -0
  434. /package/dist/core/{p-0d181ac8.entry.js.map → p-982a6e88.entry.js.map} +0 -0
  435. /package/dist/core/{p-3b9f3a07.entry.js.map → p-98448bdb.entry.js.map} +0 -0
  436. /package/dist/core/{p-c263542a.entry.js.map → p-9d01a7ad.entry.js.map} +0 -0
  437. /package/dist/core/{p-051b8266.entry.js.map → p-9d540656.entry.js.map} +0 -0
  438. /package/dist/core/{p-9fd84c69.entry.js.map → p-a0f9b259.entry.js.map} +0 -0
  439. /package/dist/core/{p-7632acc6.entry.js.map → p-a42c2f37.entry.js.map} +0 -0
  440. /package/dist/core/{p-fbb1fba0.entry.js.map → p-a6447b13.entry.js.map} +0 -0
  441. /package/dist/core/{p-116b18fe.entry.js.map → p-ae422058.entry.js.map} +0 -0
  442. /package/dist/core/{p-a7d52bd1.entry.js.map → p-b306cbc8.entry.js.map} +0 -0
  443. /package/dist/core/{p-d78fd9f3.entry.js.map → p-ca8cbd6a.entry.js.map} +0 -0
  444. /package/dist/core/{p-da4f0a58.entry.js.map → p-caf857de.entry.js.map} +0 -0
  445. /package/dist/core/{p-27aa95e7.entry.js.map → p-d3856ed3.entry.js.map} +0 -0
  446. /package/dist/core/{p-c345a874.entry.js.map → p-d4fdd8c1.entry.js.map} +0 -0
  447. /package/dist/core/{p-337b6e05.entry.js.map → p-d5c99ec3.entry.js.map} +0 -0
  448. /package/dist/core/{p-93c5b849.entry.js.map → p-f55ad6ae.entry.js.map} +0 -0
  449. /package/dist/core/{p-d9342548.entry.js.map → p-fbf4e9b7.entry.js.map} +0 -0
@@ -0,0 +1,2595 @@
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-93509377.js';
2
+ import { u as isMacDevice, o as onComponentRequiredPropUndefined, e as getOptionsWithoutGroupTitlesCount } from './helpers-f328a7b6.js';
3
+
4
+ var top = 'top';
5
+ var bottom = 'bottom';
6
+ var right = 'right';
7
+ var left = 'left';
8
+ var auto = 'auto';
9
+ var basePlacements = [top, bottom, right, left];
10
+ var start = 'start';
11
+ var end = 'end';
12
+ var clippingParents = 'clippingParents';
13
+ var viewport = 'viewport';
14
+ var popper = 'popper';
15
+ var reference = 'reference';
16
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
17
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
18
+ }, []);
19
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
20
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
21
+ }, []); // modifiers that need to read the DOM
22
+
23
+ var beforeRead = 'beforeRead';
24
+ var read = 'read';
25
+ var afterRead = 'afterRead'; // pure-logic modifiers
26
+
27
+ var beforeMain = 'beforeMain';
28
+ var main = 'main';
29
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
30
+
31
+ var beforeWrite = 'beforeWrite';
32
+ var write = 'write';
33
+ var afterWrite = 'afterWrite';
34
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
35
+
36
+ function getNodeName(element) {
37
+ return element ? (element.nodeName || '').toLowerCase() : null;
38
+ }
39
+
40
+ function getWindow(node) {
41
+ if (node == null) {
42
+ return window;
43
+ }
44
+
45
+ if (node.toString() !== '[object Window]') {
46
+ var ownerDocument = node.ownerDocument;
47
+ return ownerDocument ? ownerDocument.defaultView || window : window;
48
+ }
49
+
50
+ return node;
51
+ }
52
+
53
+ function isElement(node) {
54
+ var OwnElement = getWindow(node).Element;
55
+ return node instanceof OwnElement || node instanceof Element;
56
+ }
57
+
58
+ function isHTMLElement(node) {
59
+ var OwnElement = getWindow(node).HTMLElement;
60
+ return node instanceof OwnElement || node instanceof HTMLElement;
61
+ }
62
+
63
+ function isShadowRoot(node) {
64
+ // IE 11 has no ShadowRoot
65
+ if (typeof ShadowRoot === 'undefined') {
66
+ return false;
67
+ }
68
+
69
+ var OwnElement = getWindow(node).ShadowRoot;
70
+ return node instanceof OwnElement || node instanceof ShadowRoot;
71
+ }
72
+
73
+ // and applies them to the HTMLElements such as popper and arrow
74
+
75
+ function applyStyles(_ref) {
76
+ var state = _ref.state;
77
+ Object.keys(state.elements).forEach(function (name) {
78
+ var style = state.styles[name] || {};
79
+ var attributes = state.attributes[name] || {};
80
+ var element = state.elements[name]; // arrow is optional + virtual elements
81
+
82
+ if (!isHTMLElement(element) || !getNodeName(element)) {
83
+ return;
84
+ } // Flow doesn't support to extend this property, but it's the most
85
+ // effective way to apply styles to an HTMLElement
86
+ // $FlowFixMe[cannot-write]
87
+
88
+
89
+ Object.assign(element.style, style);
90
+ Object.keys(attributes).forEach(function (name) {
91
+ var value = attributes[name];
92
+
93
+ if (value === false) {
94
+ element.removeAttribute(name);
95
+ } else {
96
+ element.setAttribute(name, value === true ? '' : value);
97
+ }
98
+ });
99
+ });
100
+ }
101
+
102
+ function effect$2(_ref2) {
103
+ var state = _ref2.state;
104
+ var initialStyles = {
105
+ popper: {
106
+ position: state.options.strategy,
107
+ left: '0',
108
+ top: '0',
109
+ margin: '0'
110
+ },
111
+ arrow: {
112
+ position: 'absolute'
113
+ },
114
+ reference: {}
115
+ };
116
+ Object.assign(state.elements.popper.style, initialStyles.popper);
117
+ state.styles = initialStyles;
118
+
119
+ if (state.elements.arrow) {
120
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
121
+ }
122
+
123
+ return function () {
124
+ Object.keys(state.elements).forEach(function (name) {
125
+ var element = state.elements[name];
126
+ var attributes = state.attributes[name] || {};
127
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
128
+
129
+ var style = styleProperties.reduce(function (style, property) {
130
+ style[property] = '';
131
+ return style;
132
+ }, {}); // arrow is optional + virtual elements
133
+
134
+ if (!isHTMLElement(element) || !getNodeName(element)) {
135
+ return;
136
+ }
137
+
138
+ Object.assign(element.style, style);
139
+ Object.keys(attributes).forEach(function (attribute) {
140
+ element.removeAttribute(attribute);
141
+ });
142
+ });
143
+ };
144
+ } // eslint-disable-next-line import/no-unused-modules
145
+
146
+
147
+ const applyStyles$1 = {
148
+ name: 'applyStyles',
149
+ enabled: true,
150
+ phase: 'write',
151
+ fn: applyStyles,
152
+ effect: effect$2,
153
+ requires: ['computeStyles']
154
+ };
155
+
156
+ function getBasePlacement(placement) {
157
+ return placement.split('-')[0];
158
+ }
159
+
160
+ var max = Math.max;
161
+ var min = Math.min;
162
+ var round = Math.round;
163
+
164
+ function getUAString() {
165
+ var uaData = navigator.userAgentData;
166
+
167
+ if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
168
+ return uaData.brands.map(function (item) {
169
+ return item.brand + "/" + item.version;
170
+ }).join(' ');
171
+ }
172
+
173
+ return navigator.userAgent;
174
+ }
175
+
176
+ function isLayoutViewport() {
177
+ return !/^((?!chrome|android).)*safari/i.test(getUAString());
178
+ }
179
+
180
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
181
+ if (includeScale === void 0) {
182
+ includeScale = false;
183
+ }
184
+
185
+ if (isFixedStrategy === void 0) {
186
+ isFixedStrategy = false;
187
+ }
188
+
189
+ var clientRect = element.getBoundingClientRect();
190
+ var scaleX = 1;
191
+ var scaleY = 1;
192
+
193
+ if (includeScale && isHTMLElement(element)) {
194
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
195
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
196
+ }
197
+
198
+ var _ref = isElement(element) ? getWindow(element) : window,
199
+ visualViewport = _ref.visualViewport;
200
+
201
+ var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
202
+ var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
203
+ var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
204
+ var width = clientRect.width / scaleX;
205
+ var height = clientRect.height / scaleY;
206
+ return {
207
+ width: width,
208
+ height: height,
209
+ top: y,
210
+ right: x + width,
211
+ bottom: y + height,
212
+ left: x,
213
+ x: x,
214
+ y: y
215
+ };
216
+ }
217
+
218
+ // means it doesn't take into account transforms.
219
+
220
+ function getLayoutRect(element) {
221
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
222
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
223
+
224
+ var width = element.offsetWidth;
225
+ var height = element.offsetHeight;
226
+
227
+ if (Math.abs(clientRect.width - width) <= 1) {
228
+ width = clientRect.width;
229
+ }
230
+
231
+ if (Math.abs(clientRect.height - height) <= 1) {
232
+ height = clientRect.height;
233
+ }
234
+
235
+ return {
236
+ x: element.offsetLeft,
237
+ y: element.offsetTop,
238
+ width: width,
239
+ height: height
240
+ };
241
+ }
242
+
243
+ function contains(parent, child) {
244
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
245
+
246
+ if (parent.contains(child)) {
247
+ return true;
248
+ } // then fallback to custom implementation with Shadow DOM support
249
+ else if (rootNode && isShadowRoot(rootNode)) {
250
+ var next = child;
251
+
252
+ do {
253
+ if (next && parent.isSameNode(next)) {
254
+ return true;
255
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
256
+
257
+
258
+ next = next.parentNode || next.host;
259
+ } while (next);
260
+ } // Give up, the result is false
261
+
262
+
263
+ return false;
264
+ }
265
+
266
+ function getComputedStyle(element) {
267
+ return getWindow(element).getComputedStyle(element);
268
+ }
269
+
270
+ function isTableElement(element) {
271
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
272
+ }
273
+
274
+ function getDocumentElement(element) {
275
+ // $FlowFixMe[incompatible-return]: assume body is always available
276
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
277
+ element.document) || window.document).documentElement;
278
+ }
279
+
280
+ function getParentNode(element) {
281
+ if (getNodeName(element) === 'html') {
282
+ return element;
283
+ }
284
+
285
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
286
+ // $FlowFixMe[incompatible-return]
287
+ // $FlowFixMe[prop-missing]
288
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
289
+ element.parentNode || ( // DOM Element detected
290
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
291
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
292
+ getDocumentElement(element) // fallback
293
+
294
+ );
295
+ }
296
+
297
+ function getTrueOffsetParent(element) {
298
+ if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
299
+ getComputedStyle(element).position === 'fixed') {
300
+ return null;
301
+ }
302
+
303
+ return element.offsetParent;
304
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
305
+ // return the containing block
306
+
307
+
308
+ function getContainingBlock(element) {
309
+ var isFirefox = /firefox/i.test(getUAString());
310
+ var isIE = /Trident/i.test(getUAString());
311
+
312
+ if (isIE && isHTMLElement(element)) {
313
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
314
+ var elementCss = getComputedStyle(element);
315
+
316
+ if (elementCss.position === 'fixed') {
317
+ return null;
318
+ }
319
+ }
320
+
321
+ var currentNode = getParentNode(element);
322
+
323
+ if (isShadowRoot(currentNode)) {
324
+ currentNode = currentNode.host;
325
+ }
326
+
327
+ while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
328
+ var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
329
+ // create a containing block.
330
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
331
+
332
+ if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
333
+ return currentNode;
334
+ } else {
335
+ currentNode = currentNode.parentNode;
336
+ }
337
+ }
338
+
339
+ return null;
340
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
341
+ // such as table ancestors and cross browser bugs.
342
+
343
+
344
+ function getOffsetParent(element) {
345
+ var window = getWindow(element);
346
+ var offsetParent = getTrueOffsetParent(element);
347
+
348
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
349
+ offsetParent = getTrueOffsetParent(offsetParent);
350
+ }
351
+
352
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
353
+ return window;
354
+ }
355
+
356
+ return offsetParent || getContainingBlock(element) || window;
357
+ }
358
+
359
+ function getMainAxisFromPlacement(placement) {
360
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
361
+ }
362
+
363
+ function within(min$1, value, max$1) {
364
+ return max(min$1, min(value, max$1));
365
+ }
366
+ function withinMaxClamp(min, value, max) {
367
+ var v = within(min, value, max);
368
+ return v > max ? max : v;
369
+ }
370
+
371
+ function getFreshSideObject() {
372
+ return {
373
+ top: 0,
374
+ right: 0,
375
+ bottom: 0,
376
+ left: 0
377
+ };
378
+ }
379
+
380
+ function mergePaddingObject(paddingObject) {
381
+ return Object.assign({}, getFreshSideObject(), paddingObject);
382
+ }
383
+
384
+ function expandToHashMap(value, keys) {
385
+ return keys.reduce(function (hashMap, key) {
386
+ hashMap[key] = value;
387
+ return hashMap;
388
+ }, {});
389
+ }
390
+
391
+ var toPaddingObject = function toPaddingObject(padding, state) {
392
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
393
+ placement: state.placement
394
+ })) : padding;
395
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
396
+ };
397
+
398
+ function arrow(_ref) {
399
+ var _state$modifiersData$;
400
+
401
+ var state = _ref.state,
402
+ name = _ref.name,
403
+ options = _ref.options;
404
+ var arrowElement = state.elements.arrow;
405
+ var popperOffsets = state.modifiersData.popperOffsets;
406
+ var basePlacement = getBasePlacement(state.placement);
407
+ var axis = getMainAxisFromPlacement(basePlacement);
408
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
409
+ var len = isVertical ? 'height' : 'width';
410
+
411
+ if (!arrowElement || !popperOffsets) {
412
+ return;
413
+ }
414
+
415
+ var paddingObject = toPaddingObject(options.padding, state);
416
+ var arrowRect = getLayoutRect(arrowElement);
417
+ var minProp = axis === 'y' ? top : left;
418
+ var maxProp = axis === 'y' ? bottom : right;
419
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
420
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
421
+ var arrowOffsetParent = getOffsetParent(arrowElement);
422
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
423
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
424
+ // outside of the popper bounds
425
+
426
+ var min = paddingObject[minProp];
427
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
428
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
429
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
430
+
431
+ var axisProp = axis;
432
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
433
+ }
434
+
435
+ function effect$1(_ref2) {
436
+ var state = _ref2.state,
437
+ options = _ref2.options;
438
+ var _options$element = options.element,
439
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
440
+
441
+ if (arrowElement == null) {
442
+ return;
443
+ } // CSS selector
444
+
445
+
446
+ if (typeof arrowElement === 'string') {
447
+ arrowElement = state.elements.popper.querySelector(arrowElement);
448
+
449
+ if (!arrowElement) {
450
+ return;
451
+ }
452
+ }
453
+
454
+ if (!contains(state.elements.popper, arrowElement)) {
455
+ return;
456
+ }
457
+
458
+ state.elements.arrow = arrowElement;
459
+ } // eslint-disable-next-line import/no-unused-modules
460
+
461
+
462
+ const arrow$1 = {
463
+ name: 'arrow',
464
+ enabled: true,
465
+ phase: 'main',
466
+ fn: arrow,
467
+ effect: effect$1,
468
+ requires: ['popperOffsets'],
469
+ requiresIfExists: ['preventOverflow']
470
+ };
471
+
472
+ function getVariation(placement) {
473
+ return placement.split('-')[1];
474
+ }
475
+
476
+ var unsetSides = {
477
+ top: 'auto',
478
+ right: 'auto',
479
+ bottom: 'auto',
480
+ left: 'auto'
481
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
482
+ // Zooming can change the DPR, but it seems to report a value that will
483
+ // cleanly divide the values into the appropriate subpixels.
484
+
485
+ function roundOffsetsByDPR(_ref, win) {
486
+ var x = _ref.x,
487
+ y = _ref.y;
488
+ var dpr = win.devicePixelRatio || 1;
489
+ return {
490
+ x: round(x * dpr) / dpr || 0,
491
+ y: round(y * dpr) / dpr || 0
492
+ };
493
+ }
494
+
495
+ function mapToStyles(_ref2) {
496
+ var _Object$assign2;
497
+
498
+ var popper = _ref2.popper,
499
+ popperRect = _ref2.popperRect,
500
+ placement = _ref2.placement,
501
+ variation = _ref2.variation,
502
+ offsets = _ref2.offsets,
503
+ position = _ref2.position,
504
+ gpuAcceleration = _ref2.gpuAcceleration,
505
+ adaptive = _ref2.adaptive,
506
+ roundOffsets = _ref2.roundOffsets,
507
+ isFixed = _ref2.isFixed;
508
+ var _offsets$x = offsets.x,
509
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
510
+ _offsets$y = offsets.y,
511
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
512
+
513
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
514
+ x: x,
515
+ y: y
516
+ }) : {
517
+ x: x,
518
+ y: y
519
+ };
520
+
521
+ x = _ref3.x;
522
+ y = _ref3.y;
523
+ var hasX = offsets.hasOwnProperty('x');
524
+ var hasY = offsets.hasOwnProperty('y');
525
+ var sideX = left;
526
+ var sideY = top;
527
+ var win = window;
528
+
529
+ if (adaptive) {
530
+ var offsetParent = getOffsetParent(popper);
531
+ var heightProp = 'clientHeight';
532
+ var widthProp = 'clientWidth';
533
+
534
+ if (offsetParent === getWindow(popper)) {
535
+ offsetParent = getDocumentElement(popper);
536
+
537
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
538
+ heightProp = 'scrollHeight';
539
+ widthProp = 'scrollWidth';
540
+ }
541
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
542
+
543
+
544
+ offsetParent = offsetParent;
545
+
546
+ if (placement === top || (placement === left || placement === right) && variation === end) {
547
+ sideY = bottom;
548
+ var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
549
+ offsetParent[heightProp];
550
+ y -= offsetY - popperRect.height;
551
+ y *= gpuAcceleration ? 1 : -1;
552
+ }
553
+
554
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
555
+ sideX = right;
556
+ var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
557
+ offsetParent[widthProp];
558
+ x -= offsetX - popperRect.width;
559
+ x *= gpuAcceleration ? 1 : -1;
560
+ }
561
+ }
562
+
563
+ var commonStyles = Object.assign({
564
+ position: position
565
+ }, adaptive && unsetSides);
566
+
567
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
568
+ x: x,
569
+ y: y
570
+ }, getWindow(popper)) : {
571
+ x: x,
572
+ y: y
573
+ };
574
+
575
+ x = _ref4.x;
576
+ y = _ref4.y;
577
+
578
+ if (gpuAcceleration) {
579
+ var _Object$assign;
580
+
581
+ return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
582
+ }
583
+
584
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
585
+ }
586
+
587
+ function computeStyles(_ref5) {
588
+ var state = _ref5.state,
589
+ options = _ref5.options;
590
+ var _options$gpuAccelerat = options.gpuAcceleration,
591
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
592
+ _options$adaptive = options.adaptive,
593
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
594
+ _options$roundOffsets = options.roundOffsets,
595
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
596
+ var commonStyles = {
597
+ placement: getBasePlacement(state.placement),
598
+ variation: getVariation(state.placement),
599
+ popper: state.elements.popper,
600
+ popperRect: state.rects.popper,
601
+ gpuAcceleration: gpuAcceleration,
602
+ isFixed: state.options.strategy === 'fixed'
603
+ };
604
+
605
+ if (state.modifiersData.popperOffsets != null) {
606
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
607
+ offsets: state.modifiersData.popperOffsets,
608
+ position: state.options.strategy,
609
+ adaptive: adaptive,
610
+ roundOffsets: roundOffsets
611
+ })));
612
+ }
613
+
614
+ if (state.modifiersData.arrow != null) {
615
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
616
+ offsets: state.modifiersData.arrow,
617
+ position: 'absolute',
618
+ adaptive: false,
619
+ roundOffsets: roundOffsets
620
+ })));
621
+ }
622
+
623
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
624
+ 'data-popper-placement': state.placement
625
+ });
626
+ } // eslint-disable-next-line import/no-unused-modules
627
+
628
+
629
+ const computeStyles$1 = {
630
+ name: 'computeStyles',
631
+ enabled: true,
632
+ phase: 'beforeWrite',
633
+ fn: computeStyles,
634
+ data: {}
635
+ };
636
+
637
+ var passive = {
638
+ passive: true
639
+ };
640
+
641
+ function effect(_ref) {
642
+ var state = _ref.state,
643
+ instance = _ref.instance,
644
+ options = _ref.options;
645
+ var _options$scroll = options.scroll,
646
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
647
+ _options$resize = options.resize,
648
+ resize = _options$resize === void 0 ? true : _options$resize;
649
+ var window = getWindow(state.elements.popper);
650
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
651
+
652
+ if (scroll) {
653
+ scrollParents.forEach(function (scrollParent) {
654
+ scrollParent.addEventListener('scroll', instance.update, passive);
655
+ });
656
+ }
657
+
658
+ if (resize) {
659
+ window.addEventListener('resize', instance.update, passive);
660
+ }
661
+
662
+ return function () {
663
+ if (scroll) {
664
+ scrollParents.forEach(function (scrollParent) {
665
+ scrollParent.removeEventListener('scroll', instance.update, passive);
666
+ });
667
+ }
668
+
669
+ if (resize) {
670
+ window.removeEventListener('resize', instance.update, passive);
671
+ }
672
+ };
673
+ } // eslint-disable-next-line import/no-unused-modules
674
+
675
+
676
+ const eventListeners = {
677
+ name: 'eventListeners',
678
+ enabled: true,
679
+ phase: 'write',
680
+ fn: function fn() {},
681
+ effect: effect,
682
+ data: {}
683
+ };
684
+
685
+ var hash$1 = {
686
+ left: 'right',
687
+ right: 'left',
688
+ bottom: 'top',
689
+ top: 'bottom'
690
+ };
691
+ function getOppositePlacement(placement) {
692
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
693
+ return hash$1[matched];
694
+ });
695
+ }
696
+
697
+ var hash = {
698
+ start: 'end',
699
+ end: 'start'
700
+ };
701
+ function getOppositeVariationPlacement(placement) {
702
+ return placement.replace(/start|end/g, function (matched) {
703
+ return hash[matched];
704
+ });
705
+ }
706
+
707
+ function getWindowScroll(node) {
708
+ var win = getWindow(node);
709
+ var scrollLeft = win.pageXOffset;
710
+ var scrollTop = win.pageYOffset;
711
+ return {
712
+ scrollLeft: scrollLeft,
713
+ scrollTop: scrollTop
714
+ };
715
+ }
716
+
717
+ function getWindowScrollBarX(element) {
718
+ // If <html> has a CSS width greater than the viewport, then this will be
719
+ // incorrect for RTL.
720
+ // Popper 1 is broken in this case and never had a bug report so let's assume
721
+ // it's not an issue. I don't think anyone ever specifies width on <html>
722
+ // anyway.
723
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
724
+ // this (e.g. Edge 2019, IE11, Safari)
725
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
726
+ }
727
+
728
+ function getViewportRect(element, strategy) {
729
+ var win = getWindow(element);
730
+ var html = getDocumentElement(element);
731
+ var visualViewport = win.visualViewport;
732
+ var width = html.clientWidth;
733
+ var height = html.clientHeight;
734
+ var x = 0;
735
+ var y = 0;
736
+
737
+ if (visualViewport) {
738
+ width = visualViewport.width;
739
+ height = visualViewport.height;
740
+ var layoutViewport = isLayoutViewport();
741
+
742
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
743
+ x = visualViewport.offsetLeft;
744
+ y = visualViewport.offsetTop;
745
+ }
746
+ }
747
+
748
+ return {
749
+ width: width,
750
+ height: height,
751
+ x: x + getWindowScrollBarX(element),
752
+ y: y
753
+ };
754
+ }
755
+
756
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
757
+
758
+ function getDocumentRect(element) {
759
+ var _element$ownerDocumen;
760
+
761
+ var html = getDocumentElement(element);
762
+ var winScroll = getWindowScroll(element);
763
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
764
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
765
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
766
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
767
+ var y = -winScroll.scrollTop;
768
+
769
+ if (getComputedStyle(body || html).direction === 'rtl') {
770
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
771
+ }
772
+
773
+ return {
774
+ width: width,
775
+ height: height,
776
+ x: x,
777
+ y: y
778
+ };
779
+ }
780
+
781
+ function isScrollParent(element) {
782
+ // Firefox wants us to check `-x` and `-y` variations as well
783
+ var _getComputedStyle = getComputedStyle(element),
784
+ overflow = _getComputedStyle.overflow,
785
+ overflowX = _getComputedStyle.overflowX,
786
+ overflowY = _getComputedStyle.overflowY;
787
+
788
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
789
+ }
790
+
791
+ function getScrollParent(node) {
792
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
793
+ // $FlowFixMe[incompatible-return]: assume body is always available
794
+ return node.ownerDocument.body;
795
+ }
796
+
797
+ if (isHTMLElement(node) && isScrollParent(node)) {
798
+ return node;
799
+ }
800
+
801
+ return getScrollParent(getParentNode(node));
802
+ }
803
+
804
+ /*
805
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
806
+ until we get to the top window object. This list is what we attach scroll listeners
807
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
808
+ reference element's position.
809
+ */
810
+
811
+ function listScrollParents(element, list) {
812
+ var _element$ownerDocumen;
813
+
814
+ if (list === void 0) {
815
+ list = [];
816
+ }
817
+
818
+ var scrollParent = getScrollParent(element);
819
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
820
+ var win = getWindow(scrollParent);
821
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
822
+ var updatedList = list.concat(target);
823
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
824
+ updatedList.concat(listScrollParents(getParentNode(target)));
825
+ }
826
+
827
+ function rectToClientRect(rect) {
828
+ return Object.assign({}, rect, {
829
+ left: rect.x,
830
+ top: rect.y,
831
+ right: rect.x + rect.width,
832
+ bottom: rect.y + rect.height
833
+ });
834
+ }
835
+
836
+ function getInnerBoundingClientRect(element, strategy) {
837
+ var rect = getBoundingClientRect(element, false, strategy === 'fixed');
838
+ rect.top = rect.top + element.clientTop;
839
+ rect.left = rect.left + element.clientLeft;
840
+ rect.bottom = rect.top + element.clientHeight;
841
+ rect.right = rect.left + element.clientWidth;
842
+ rect.width = element.clientWidth;
843
+ rect.height = element.clientHeight;
844
+ rect.x = rect.left;
845
+ rect.y = rect.top;
846
+ return rect;
847
+ }
848
+
849
+ function getClientRectFromMixedType(element, clippingParent, strategy) {
850
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
851
+ } // A "clipping parent" is an overflowable container with the characteristic of
852
+ // clipping (or hiding) overflowing elements with a position different from
853
+ // `initial`
854
+
855
+
856
+ function getClippingParents(element) {
857
+ var clippingParents = listScrollParents(getParentNode(element));
858
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
859
+ var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
860
+
861
+ if (!isElement(clipperElement)) {
862
+ return [];
863
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
864
+
865
+
866
+ return clippingParents.filter(function (clippingParent) {
867
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
868
+ });
869
+ } // Gets the maximum area that the element is visible in due to any number of
870
+ // clipping parents
871
+
872
+
873
+ function getClippingRect(element, boundary, rootBoundary, strategy) {
874
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
875
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
876
+ var firstClippingParent = clippingParents[0];
877
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
878
+ var rect = getClientRectFromMixedType(element, clippingParent, strategy);
879
+ accRect.top = max(rect.top, accRect.top);
880
+ accRect.right = min(rect.right, accRect.right);
881
+ accRect.bottom = min(rect.bottom, accRect.bottom);
882
+ accRect.left = max(rect.left, accRect.left);
883
+ return accRect;
884
+ }, getClientRectFromMixedType(element, firstClippingParent, strategy));
885
+ clippingRect.width = clippingRect.right - clippingRect.left;
886
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
887
+ clippingRect.x = clippingRect.left;
888
+ clippingRect.y = clippingRect.top;
889
+ return clippingRect;
890
+ }
891
+
892
+ function computeOffsets(_ref) {
893
+ var reference = _ref.reference,
894
+ element = _ref.element,
895
+ placement = _ref.placement;
896
+ var basePlacement = placement ? getBasePlacement(placement) : null;
897
+ var variation = placement ? getVariation(placement) : null;
898
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
899
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
900
+ var offsets;
901
+
902
+ switch (basePlacement) {
903
+ case top:
904
+ offsets = {
905
+ x: commonX,
906
+ y: reference.y - element.height
907
+ };
908
+ break;
909
+
910
+ case bottom:
911
+ offsets = {
912
+ x: commonX,
913
+ y: reference.y + reference.height
914
+ };
915
+ break;
916
+
917
+ case right:
918
+ offsets = {
919
+ x: reference.x + reference.width,
920
+ y: commonY
921
+ };
922
+ break;
923
+
924
+ case left:
925
+ offsets = {
926
+ x: reference.x - element.width,
927
+ y: commonY
928
+ };
929
+ break;
930
+
931
+ default:
932
+ offsets = {
933
+ x: reference.x,
934
+ y: reference.y
935
+ };
936
+ }
937
+
938
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
939
+
940
+ if (mainAxis != null) {
941
+ var len = mainAxis === 'y' ? 'height' : 'width';
942
+
943
+ switch (variation) {
944
+ case start:
945
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
946
+ break;
947
+
948
+ case end:
949
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
950
+ break;
951
+ }
952
+ }
953
+
954
+ return offsets;
955
+ }
956
+
957
+ function detectOverflow(state, options) {
958
+ if (options === void 0) {
959
+ options = {};
960
+ }
961
+
962
+ var _options = options,
963
+ _options$placement = _options.placement,
964
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
965
+ _options$strategy = _options.strategy,
966
+ strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
967
+ _options$boundary = _options.boundary,
968
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
969
+ _options$rootBoundary = _options.rootBoundary,
970
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
971
+ _options$elementConte = _options.elementContext,
972
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
973
+ _options$altBoundary = _options.altBoundary,
974
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
975
+ _options$padding = _options.padding,
976
+ padding = _options$padding === void 0 ? 0 : _options$padding;
977
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
978
+ var altContext = elementContext === popper ? reference : popper;
979
+ var popperRect = state.rects.popper;
980
+ var element = state.elements[altBoundary ? altContext : elementContext];
981
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
982
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
983
+ var popperOffsets = computeOffsets({
984
+ reference: referenceClientRect,
985
+ element: popperRect,
986
+ strategy: 'absolute',
987
+ placement: placement
988
+ });
989
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
990
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
991
+ // 0 or negative = within the clipping rect
992
+
993
+ var overflowOffsets = {
994
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
995
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
996
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
997
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
998
+ };
999
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
1000
+
1001
+ if (elementContext === popper && offsetData) {
1002
+ var offset = offsetData[placement];
1003
+ Object.keys(overflowOffsets).forEach(function (key) {
1004
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
1005
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
1006
+ overflowOffsets[key] += offset[axis] * multiply;
1007
+ });
1008
+ }
1009
+
1010
+ return overflowOffsets;
1011
+ }
1012
+
1013
+ function computeAutoPlacement(state, options) {
1014
+ if (options === void 0) {
1015
+ options = {};
1016
+ }
1017
+
1018
+ var _options = options,
1019
+ placement = _options.placement,
1020
+ boundary = _options.boundary,
1021
+ rootBoundary = _options.rootBoundary,
1022
+ padding = _options.padding,
1023
+ flipVariations = _options.flipVariations,
1024
+ _options$allowedAutoP = _options.allowedAutoPlacements,
1025
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1026
+ var variation = getVariation(placement);
1027
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
1028
+ return getVariation(placement) === variation;
1029
+ }) : basePlacements;
1030
+ var allowedPlacements = placements$1.filter(function (placement) {
1031
+ return allowedAutoPlacements.indexOf(placement) >= 0;
1032
+ });
1033
+
1034
+ if (allowedPlacements.length === 0) {
1035
+ allowedPlacements = placements$1;
1036
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
1037
+
1038
+
1039
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
1040
+ acc[placement] = detectOverflow(state, {
1041
+ placement: placement,
1042
+ boundary: boundary,
1043
+ rootBoundary: rootBoundary,
1044
+ padding: padding
1045
+ })[getBasePlacement(placement)];
1046
+ return acc;
1047
+ }, {});
1048
+ return Object.keys(overflows).sort(function (a, b) {
1049
+ return overflows[a] - overflows[b];
1050
+ });
1051
+ }
1052
+
1053
+ function getExpandedFallbackPlacements(placement) {
1054
+ if (getBasePlacement(placement) === auto) {
1055
+ return [];
1056
+ }
1057
+
1058
+ var oppositePlacement = getOppositePlacement(placement);
1059
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1060
+ }
1061
+
1062
+ function flip(_ref) {
1063
+ var state = _ref.state,
1064
+ options = _ref.options,
1065
+ name = _ref.name;
1066
+
1067
+ if (state.modifiersData[name]._skip) {
1068
+ return;
1069
+ }
1070
+
1071
+ var _options$mainAxis = options.mainAxis,
1072
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1073
+ _options$altAxis = options.altAxis,
1074
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1075
+ specifiedFallbackPlacements = options.fallbackPlacements,
1076
+ padding = options.padding,
1077
+ boundary = options.boundary,
1078
+ rootBoundary = options.rootBoundary,
1079
+ altBoundary = options.altBoundary,
1080
+ _options$flipVariatio = options.flipVariations,
1081
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1082
+ allowedAutoPlacements = options.allowedAutoPlacements;
1083
+ var preferredPlacement = state.options.placement;
1084
+ var basePlacement = getBasePlacement(preferredPlacement);
1085
+ var isBasePlacement = basePlacement === preferredPlacement;
1086
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1087
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1088
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1089
+ placement: placement,
1090
+ boundary: boundary,
1091
+ rootBoundary: rootBoundary,
1092
+ padding: padding,
1093
+ flipVariations: flipVariations,
1094
+ allowedAutoPlacements: allowedAutoPlacements
1095
+ }) : placement);
1096
+ }, []);
1097
+ var referenceRect = state.rects.reference;
1098
+ var popperRect = state.rects.popper;
1099
+ var checksMap = new Map();
1100
+ var makeFallbackChecks = true;
1101
+ var firstFittingPlacement = placements[0];
1102
+
1103
+ for (var i = 0; i < placements.length; i++) {
1104
+ var placement = placements[i];
1105
+
1106
+ var _basePlacement = getBasePlacement(placement);
1107
+
1108
+ var isStartVariation = getVariation(placement) === start;
1109
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1110
+ var len = isVertical ? 'width' : 'height';
1111
+ var overflow = detectOverflow(state, {
1112
+ placement: placement,
1113
+ boundary: boundary,
1114
+ rootBoundary: rootBoundary,
1115
+ altBoundary: altBoundary,
1116
+ padding: padding
1117
+ });
1118
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1119
+
1120
+ if (referenceRect[len] > popperRect[len]) {
1121
+ mainVariationSide = getOppositePlacement(mainVariationSide);
1122
+ }
1123
+
1124
+ var altVariationSide = getOppositePlacement(mainVariationSide);
1125
+ var checks = [];
1126
+
1127
+ if (checkMainAxis) {
1128
+ checks.push(overflow[_basePlacement] <= 0);
1129
+ }
1130
+
1131
+ if (checkAltAxis) {
1132
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1133
+ }
1134
+
1135
+ if (checks.every(function (check) {
1136
+ return check;
1137
+ })) {
1138
+ firstFittingPlacement = placement;
1139
+ makeFallbackChecks = false;
1140
+ break;
1141
+ }
1142
+
1143
+ checksMap.set(placement, checks);
1144
+ }
1145
+
1146
+ if (makeFallbackChecks) {
1147
+ // `2` may be desired in some cases – research later
1148
+ var numberOfChecks = flipVariations ? 3 : 1;
1149
+
1150
+ var _loop = function _loop(_i) {
1151
+ var fittingPlacement = placements.find(function (placement) {
1152
+ var checks = checksMap.get(placement);
1153
+
1154
+ if (checks) {
1155
+ return checks.slice(0, _i).every(function (check) {
1156
+ return check;
1157
+ });
1158
+ }
1159
+ });
1160
+
1161
+ if (fittingPlacement) {
1162
+ firstFittingPlacement = fittingPlacement;
1163
+ return "break";
1164
+ }
1165
+ };
1166
+
1167
+ for (var _i = numberOfChecks; _i > 0; _i--) {
1168
+ var _ret = _loop(_i);
1169
+
1170
+ if (_ret === "break") break;
1171
+ }
1172
+ }
1173
+
1174
+ if (state.placement !== firstFittingPlacement) {
1175
+ state.modifiersData[name]._skip = true;
1176
+ state.placement = firstFittingPlacement;
1177
+ state.reset = true;
1178
+ }
1179
+ } // eslint-disable-next-line import/no-unused-modules
1180
+
1181
+
1182
+ const flip$1 = {
1183
+ name: 'flip',
1184
+ enabled: true,
1185
+ phase: 'main',
1186
+ fn: flip,
1187
+ requiresIfExists: ['offset'],
1188
+ data: {
1189
+ _skip: false
1190
+ }
1191
+ };
1192
+
1193
+ function getSideOffsets(overflow, rect, preventedOffsets) {
1194
+ if (preventedOffsets === void 0) {
1195
+ preventedOffsets = {
1196
+ x: 0,
1197
+ y: 0
1198
+ };
1199
+ }
1200
+
1201
+ return {
1202
+ top: overflow.top - rect.height - preventedOffsets.y,
1203
+ right: overflow.right - rect.width + preventedOffsets.x,
1204
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
1205
+ left: overflow.left - rect.width - preventedOffsets.x
1206
+ };
1207
+ }
1208
+
1209
+ function isAnySideFullyClipped(overflow) {
1210
+ return [top, right, bottom, left].some(function (side) {
1211
+ return overflow[side] >= 0;
1212
+ });
1213
+ }
1214
+
1215
+ function hide(_ref) {
1216
+ var state = _ref.state,
1217
+ name = _ref.name;
1218
+ var referenceRect = state.rects.reference;
1219
+ var popperRect = state.rects.popper;
1220
+ var preventedOffsets = state.modifiersData.preventOverflow;
1221
+ var referenceOverflow = detectOverflow(state, {
1222
+ elementContext: 'reference'
1223
+ });
1224
+ var popperAltOverflow = detectOverflow(state, {
1225
+ altBoundary: true
1226
+ });
1227
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1228
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1229
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1230
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1231
+ state.modifiersData[name] = {
1232
+ referenceClippingOffsets: referenceClippingOffsets,
1233
+ popperEscapeOffsets: popperEscapeOffsets,
1234
+ isReferenceHidden: isReferenceHidden,
1235
+ hasPopperEscaped: hasPopperEscaped
1236
+ };
1237
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
1238
+ 'data-popper-reference-hidden': isReferenceHidden,
1239
+ 'data-popper-escaped': hasPopperEscaped
1240
+ });
1241
+ } // eslint-disable-next-line import/no-unused-modules
1242
+
1243
+
1244
+ const hide$1 = {
1245
+ name: 'hide',
1246
+ enabled: true,
1247
+ phase: 'main',
1248
+ requiresIfExists: ['preventOverflow'],
1249
+ fn: hide
1250
+ };
1251
+
1252
+ function distanceAndSkiddingToXY(placement, rects, offset) {
1253
+ var basePlacement = getBasePlacement(placement);
1254
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1255
+
1256
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1257
+ placement: placement
1258
+ })) : offset,
1259
+ skidding = _ref[0],
1260
+ distance = _ref[1];
1261
+
1262
+ skidding = skidding || 0;
1263
+ distance = (distance || 0) * invertDistance;
1264
+ return [left, right].indexOf(basePlacement) >= 0 ? {
1265
+ x: distance,
1266
+ y: skidding
1267
+ } : {
1268
+ x: skidding,
1269
+ y: distance
1270
+ };
1271
+ }
1272
+
1273
+ function offset(_ref2) {
1274
+ var state = _ref2.state,
1275
+ options = _ref2.options,
1276
+ name = _ref2.name;
1277
+ var _options$offset = options.offset,
1278
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1279
+ var data = placements.reduce(function (acc, placement) {
1280
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1281
+ return acc;
1282
+ }, {});
1283
+ var _data$state$placement = data[state.placement],
1284
+ x = _data$state$placement.x,
1285
+ y = _data$state$placement.y;
1286
+
1287
+ if (state.modifiersData.popperOffsets != null) {
1288
+ state.modifiersData.popperOffsets.x += x;
1289
+ state.modifiersData.popperOffsets.y += y;
1290
+ }
1291
+
1292
+ state.modifiersData[name] = data;
1293
+ } // eslint-disable-next-line import/no-unused-modules
1294
+
1295
+
1296
+ const offset$1 = {
1297
+ name: 'offset',
1298
+ enabled: true,
1299
+ phase: 'main',
1300
+ requires: ['popperOffsets'],
1301
+ fn: offset
1302
+ };
1303
+
1304
+ function popperOffsets(_ref) {
1305
+ var state = _ref.state,
1306
+ name = _ref.name;
1307
+ // Offsets are the actual position the popper needs to have to be
1308
+ // properly positioned near its reference element
1309
+ // This is the most basic placement, and will be adjusted by
1310
+ // the modifiers in the next step
1311
+ state.modifiersData[name] = computeOffsets({
1312
+ reference: state.rects.reference,
1313
+ element: state.rects.popper,
1314
+ strategy: 'absolute',
1315
+ placement: state.placement
1316
+ });
1317
+ } // eslint-disable-next-line import/no-unused-modules
1318
+
1319
+
1320
+ const popperOffsets$1 = {
1321
+ name: 'popperOffsets',
1322
+ enabled: true,
1323
+ phase: 'read',
1324
+ fn: popperOffsets,
1325
+ data: {}
1326
+ };
1327
+
1328
+ function getAltAxis(axis) {
1329
+ return axis === 'x' ? 'y' : 'x';
1330
+ }
1331
+
1332
+ function preventOverflow(_ref) {
1333
+ var state = _ref.state,
1334
+ options = _ref.options,
1335
+ name = _ref.name;
1336
+ var _options$mainAxis = options.mainAxis,
1337
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1338
+ _options$altAxis = options.altAxis,
1339
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1340
+ boundary = options.boundary,
1341
+ rootBoundary = options.rootBoundary,
1342
+ altBoundary = options.altBoundary,
1343
+ padding = options.padding,
1344
+ _options$tether = options.tether,
1345
+ tether = _options$tether === void 0 ? true : _options$tether,
1346
+ _options$tetherOffset = options.tetherOffset,
1347
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1348
+ var overflow = detectOverflow(state, {
1349
+ boundary: boundary,
1350
+ rootBoundary: rootBoundary,
1351
+ padding: padding,
1352
+ altBoundary: altBoundary
1353
+ });
1354
+ var basePlacement = getBasePlacement(state.placement);
1355
+ var variation = getVariation(state.placement);
1356
+ var isBasePlacement = !variation;
1357
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
1358
+ var altAxis = getAltAxis(mainAxis);
1359
+ var popperOffsets = state.modifiersData.popperOffsets;
1360
+ var referenceRect = state.rects.reference;
1361
+ var popperRect = state.rects.popper;
1362
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1363
+ placement: state.placement
1364
+ })) : tetherOffset;
1365
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
1366
+ mainAxis: tetherOffsetValue,
1367
+ altAxis: tetherOffsetValue
1368
+ } : Object.assign({
1369
+ mainAxis: 0,
1370
+ altAxis: 0
1371
+ }, tetherOffsetValue);
1372
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1373
+ var data = {
1374
+ x: 0,
1375
+ y: 0
1376
+ };
1377
+
1378
+ if (!popperOffsets) {
1379
+ return;
1380
+ }
1381
+
1382
+ if (checkMainAxis) {
1383
+ var _offsetModifierState$;
1384
+
1385
+ var mainSide = mainAxis === 'y' ? top : left;
1386
+ var altSide = mainAxis === 'y' ? bottom : right;
1387
+ var len = mainAxis === 'y' ? 'height' : 'width';
1388
+ var offset = popperOffsets[mainAxis];
1389
+ var min$1 = offset + overflow[mainSide];
1390
+ var max$1 = offset - overflow[altSide];
1391
+ var additive = tether ? -popperRect[len] / 2 : 0;
1392
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
1393
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1394
+ // outside the reference bounds
1395
+
1396
+ var arrowElement = state.elements.arrow;
1397
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1398
+ width: 0,
1399
+ height: 0
1400
+ };
1401
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1402
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
1403
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1404
+ // to include its full size in the calculation. If the reference is small
1405
+ // and near the edge of a boundary, the popper can overflow even if the
1406
+ // reference is not overflowing as well (e.g. virtual elements with no
1407
+ // width or height)
1408
+
1409
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1410
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1411
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1412
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1413
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1414
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1415
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
1416
+ var tetherMax = offset + maxOffset - offsetModifierValue;
1417
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1418
+ popperOffsets[mainAxis] = preventedOffset;
1419
+ data[mainAxis] = preventedOffset - offset;
1420
+ }
1421
+
1422
+ if (checkAltAxis) {
1423
+ var _offsetModifierState$2;
1424
+
1425
+ var _mainSide = mainAxis === 'x' ? top : left;
1426
+
1427
+ var _altSide = mainAxis === 'x' ? bottom : right;
1428
+
1429
+ var _offset = popperOffsets[altAxis];
1430
+
1431
+ var _len = altAxis === 'y' ? 'height' : 'width';
1432
+
1433
+ var _min = _offset + overflow[_mainSide];
1434
+
1435
+ var _max = _offset - overflow[_altSide];
1436
+
1437
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1438
+
1439
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1440
+
1441
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1442
+
1443
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1444
+
1445
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1446
+
1447
+ popperOffsets[altAxis] = _preventedOffset;
1448
+ data[altAxis] = _preventedOffset - _offset;
1449
+ }
1450
+
1451
+ state.modifiersData[name] = data;
1452
+ } // eslint-disable-next-line import/no-unused-modules
1453
+
1454
+
1455
+ const preventOverflow$1 = {
1456
+ name: 'preventOverflow',
1457
+ enabled: true,
1458
+ phase: 'main',
1459
+ fn: preventOverflow,
1460
+ requiresIfExists: ['offset']
1461
+ };
1462
+
1463
+ function getHTMLElementScroll(element) {
1464
+ return {
1465
+ scrollLeft: element.scrollLeft,
1466
+ scrollTop: element.scrollTop
1467
+ };
1468
+ }
1469
+
1470
+ function getNodeScroll(node) {
1471
+ if (node === getWindow(node) || !isHTMLElement(node)) {
1472
+ return getWindowScroll(node);
1473
+ } else {
1474
+ return getHTMLElementScroll(node);
1475
+ }
1476
+ }
1477
+
1478
+ function isElementScaled(element) {
1479
+ var rect = element.getBoundingClientRect();
1480
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
1481
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
1482
+ return scaleX !== 1 || scaleY !== 1;
1483
+ } // Returns the composite rect of an element relative to its offsetParent.
1484
+ // Composite means it takes into account transforms as well as layout.
1485
+
1486
+
1487
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1488
+ if (isFixed === void 0) {
1489
+ isFixed = false;
1490
+ }
1491
+
1492
+ var isOffsetParentAnElement = isHTMLElement(offsetParent);
1493
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1494
+ var documentElement = getDocumentElement(offsetParent);
1495
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
1496
+ var scroll = {
1497
+ scrollLeft: 0,
1498
+ scrollTop: 0
1499
+ };
1500
+ var offsets = {
1501
+ x: 0,
1502
+ y: 0
1503
+ };
1504
+
1505
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1506
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1507
+ isScrollParent(documentElement)) {
1508
+ scroll = getNodeScroll(offsetParent);
1509
+ }
1510
+
1511
+ if (isHTMLElement(offsetParent)) {
1512
+ offsets = getBoundingClientRect(offsetParent, true);
1513
+ offsets.x += offsetParent.clientLeft;
1514
+ offsets.y += offsetParent.clientTop;
1515
+ } else if (documentElement) {
1516
+ offsets.x = getWindowScrollBarX(documentElement);
1517
+ }
1518
+ }
1519
+
1520
+ return {
1521
+ x: rect.left + scroll.scrollLeft - offsets.x,
1522
+ y: rect.top + scroll.scrollTop - offsets.y,
1523
+ width: rect.width,
1524
+ height: rect.height
1525
+ };
1526
+ }
1527
+
1528
+ function order(modifiers) {
1529
+ var map = new Map();
1530
+ var visited = new Set();
1531
+ var result = [];
1532
+ modifiers.forEach(function (modifier) {
1533
+ map.set(modifier.name, modifier);
1534
+ }); // On visiting object, check for its dependencies and visit them recursively
1535
+
1536
+ function sort(modifier) {
1537
+ visited.add(modifier.name);
1538
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1539
+ requires.forEach(function (dep) {
1540
+ if (!visited.has(dep)) {
1541
+ var depModifier = map.get(dep);
1542
+
1543
+ if (depModifier) {
1544
+ sort(depModifier);
1545
+ }
1546
+ }
1547
+ });
1548
+ result.push(modifier);
1549
+ }
1550
+
1551
+ modifiers.forEach(function (modifier) {
1552
+ if (!visited.has(modifier.name)) {
1553
+ // check for visited object
1554
+ sort(modifier);
1555
+ }
1556
+ });
1557
+ return result;
1558
+ }
1559
+
1560
+ function orderModifiers(modifiers) {
1561
+ // order based on dependencies
1562
+ var orderedModifiers = order(modifiers); // order based on phase
1563
+
1564
+ return modifierPhases.reduce(function (acc, phase) {
1565
+ return acc.concat(orderedModifiers.filter(function (modifier) {
1566
+ return modifier.phase === phase;
1567
+ }));
1568
+ }, []);
1569
+ }
1570
+
1571
+ function debounce(fn) {
1572
+ var pending;
1573
+ return function () {
1574
+ if (!pending) {
1575
+ pending = new Promise(function (resolve) {
1576
+ Promise.resolve().then(function () {
1577
+ pending = undefined;
1578
+ resolve(fn());
1579
+ });
1580
+ });
1581
+ }
1582
+
1583
+ return pending;
1584
+ };
1585
+ }
1586
+
1587
+ function mergeByName(modifiers) {
1588
+ var merged = modifiers.reduce(function (merged, current) {
1589
+ var existing = merged[current.name];
1590
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
1591
+ options: Object.assign({}, existing.options, current.options),
1592
+ data: Object.assign({}, existing.data, current.data)
1593
+ }) : current;
1594
+ return merged;
1595
+ }, {}); // IE11 does not support Object.values
1596
+
1597
+ return Object.keys(merged).map(function (key) {
1598
+ return merged[key];
1599
+ });
1600
+ }
1601
+
1602
+ var DEFAULT_OPTIONS = {
1603
+ placement: 'bottom',
1604
+ modifiers: [],
1605
+ strategy: 'absolute'
1606
+ };
1607
+
1608
+ function areValidElements() {
1609
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1610
+ args[_key] = arguments[_key];
1611
+ }
1612
+
1613
+ return !args.some(function (element) {
1614
+ return !(element && typeof element.getBoundingClientRect === 'function');
1615
+ });
1616
+ }
1617
+
1618
+ function popperGenerator(generatorOptions) {
1619
+ if (generatorOptions === void 0) {
1620
+ generatorOptions = {};
1621
+ }
1622
+
1623
+ var _generatorOptions = generatorOptions,
1624
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
1625
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1626
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
1627
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1628
+ return function createPopper(reference, popper, options) {
1629
+ if (options === void 0) {
1630
+ options = defaultOptions;
1631
+ }
1632
+
1633
+ var state = {
1634
+ placement: 'bottom',
1635
+ orderedModifiers: [],
1636
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1637
+ modifiersData: {},
1638
+ elements: {
1639
+ reference: reference,
1640
+ popper: popper
1641
+ },
1642
+ attributes: {},
1643
+ styles: {}
1644
+ };
1645
+ var effectCleanupFns = [];
1646
+ var isDestroyed = false;
1647
+ var instance = {
1648
+ state: state,
1649
+ setOptions: function setOptions(setOptionsAction) {
1650
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
1651
+ cleanupModifierEffects();
1652
+ state.options = Object.assign({}, defaultOptions, state.options, options);
1653
+ state.scrollParents = {
1654
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1655
+ popper: listScrollParents(popper)
1656
+ }; // Orders the modifiers based on their dependencies and `phase`
1657
+ // properties
1658
+
1659
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1660
+
1661
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
1662
+ return m.enabled;
1663
+ });
1664
+ runModifierEffects();
1665
+ return instance.update();
1666
+ },
1667
+ // Sync update – it will always be executed, even if not necessary. This
1668
+ // is useful for low frequency updates where sync behavior simplifies the
1669
+ // logic.
1670
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
1671
+ // prefer the async Popper#update method
1672
+ forceUpdate: function forceUpdate() {
1673
+ if (isDestroyed) {
1674
+ return;
1675
+ }
1676
+
1677
+ var _state$elements = state.elements,
1678
+ reference = _state$elements.reference,
1679
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1680
+ // anymore
1681
+
1682
+ if (!areValidElements(reference, popper)) {
1683
+ return;
1684
+ } // Store the reference and popper rects to be read by modifiers
1685
+
1686
+
1687
+ state.rects = {
1688
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1689
+ popper: getLayoutRect(popper)
1690
+ }; // Modifiers have the ability to reset the current update cycle. The
1691
+ // most common use case for this is the `flip` modifier changing the
1692
+ // placement, which then needs to re-run all the modifiers, because the
1693
+ // logic was previously ran for the previous placement and is therefore
1694
+ // stale/incorrect
1695
+
1696
+ state.reset = false;
1697
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1698
+ // is filled with the initial data specified by the modifier. This means
1699
+ // it doesn't persist and is fresh on each update.
1700
+ // To ensure persistent data, use `${name}#persistent`
1701
+
1702
+ state.orderedModifiers.forEach(function (modifier) {
1703
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1704
+ });
1705
+
1706
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
1707
+ if (state.reset === true) {
1708
+ state.reset = false;
1709
+ index = -1;
1710
+ continue;
1711
+ }
1712
+
1713
+ var _state$orderedModifie = state.orderedModifiers[index],
1714
+ fn = _state$orderedModifie.fn,
1715
+ _state$orderedModifie2 = _state$orderedModifie.options,
1716
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1717
+ name = _state$orderedModifie.name;
1718
+
1719
+ if (typeof fn === 'function') {
1720
+ state = fn({
1721
+ state: state,
1722
+ options: _options,
1723
+ name: name,
1724
+ instance: instance
1725
+ }) || state;
1726
+ }
1727
+ }
1728
+ },
1729
+ // Async and optimistically optimized update – it will not be executed if
1730
+ // not necessary (debounced to run at most once-per-tick)
1731
+ update: debounce(function () {
1732
+ return new Promise(function (resolve) {
1733
+ instance.forceUpdate();
1734
+ resolve(state);
1735
+ });
1736
+ }),
1737
+ destroy: function destroy() {
1738
+ cleanupModifierEffects();
1739
+ isDestroyed = true;
1740
+ }
1741
+ };
1742
+
1743
+ if (!areValidElements(reference, popper)) {
1744
+ return instance;
1745
+ }
1746
+
1747
+ instance.setOptions(options).then(function (state) {
1748
+ if (!isDestroyed && options.onFirstUpdate) {
1749
+ options.onFirstUpdate(state);
1750
+ }
1751
+ }); // Modifiers have the ability to execute arbitrary code before the first
1752
+ // update cycle runs. They will be executed in the same order as the update
1753
+ // cycle. This is useful when a modifier adds some persistent data that
1754
+ // other modifiers need to use, but the modifier is run after the dependent
1755
+ // one.
1756
+
1757
+ function runModifierEffects() {
1758
+ state.orderedModifiers.forEach(function (_ref) {
1759
+ var name = _ref.name,
1760
+ _ref$options = _ref.options,
1761
+ options = _ref$options === void 0 ? {} : _ref$options,
1762
+ effect = _ref.effect;
1763
+
1764
+ if (typeof effect === 'function') {
1765
+ var cleanupFn = effect({
1766
+ state: state,
1767
+ name: name,
1768
+ instance: instance,
1769
+ options: options
1770
+ });
1771
+
1772
+ var noopFn = function noopFn() {};
1773
+
1774
+ effectCleanupFns.push(cleanupFn || noopFn);
1775
+ }
1776
+ });
1777
+ }
1778
+
1779
+ function cleanupModifierEffects() {
1780
+ effectCleanupFns.forEach(function (fn) {
1781
+ return fn();
1782
+ });
1783
+ effectCleanupFns = [];
1784
+ }
1785
+
1786
+ return instance;
1787
+ };
1788
+ }
1789
+
1790
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1791
+ var createPopper = /*#__PURE__*/popperGenerator({
1792
+ defaultModifiers: defaultModifiers
1793
+ }); // eslint-disable-next-line import/no-unused-modules
1794
+
1795
+ const Check = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1796
+ <path d="M8.79502 15.875L4.62502 11.705L3.20502 13.115L8.79502 18.705L20.795 6.70501L19.385 5.29501L8.79502 15.875Z" fill="currentColor"/>
1797
+ </svg>
1798
+ `;
1799
+
1800
+ const icMenuCss = "html.sc-ic-menu-with-multi{line-height:1.15;-webkit-text-size-adjust:100%}body.sc-ic-menu-with-multi{margin:0}main.sc-ic-menu-with-multi{display:block}h1.sc-ic-menu-with-multi{font-size:2em;margin:0.67em 0}hr.sc-ic-menu-with-multi{box-sizing:content-box;height:0;overflow:visible}pre.sc-ic-menu-with-multi{font-family:monospace, monospace;font-size:1em}a.sc-ic-menu-with-multi{background-color:transparent}abbr[title].sc-ic-menu-with-multi{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b.sc-ic-menu-with-multi,strong.sc-ic-menu-with-multi{font-weight:bolder}code.sc-ic-menu-with-multi,kbd.sc-ic-menu-with-multi,samp.sc-ic-menu-with-multi{font-family:monospace, monospace;font-size:1em}small.sc-ic-menu-with-multi{font-size:80%}sub.sc-ic-menu-with-multi,sup.sc-ic-menu-with-multi{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub.sc-ic-menu-with-multi{bottom:-0.25em}sup.sc-ic-menu-with-multi{top:-0.5em}img.sc-ic-menu-with-multi{border-style:none}button.sc-ic-menu-with-multi,input.sc-ic-menu-with-multi,optgroup.sc-ic-menu-with-multi,select.sc-ic-menu-with-multi,textarea.sc-ic-menu-with-multi{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button.sc-ic-menu-with-multi,input.sc-ic-menu-with-multi{overflow:visible}button.sc-ic-menu-with-multi,select.sc-ic-menu-with-multi{text-transform:none}button.sc-ic-menu-with-multi,[type=\"button\"].sc-ic-menu-with-multi,[type=\"reset\"].sc-ic-menu-with-multi,[type=\"submit\"].sc-ic-menu-with-multi{-webkit-appearance:button}button.sc-ic-menu-with-multi::-moz-focus-inner,[type=\"button\"].sc-ic-menu-with-multi::-moz-focus-inner,[type=\"reset\"].sc-ic-menu-with-multi::-moz-focus-inner,[type=\"submit\"].sc-ic-menu-with-multi::-moz-focus-inner{border-style:none;padding:0}button.sc-ic-menu-with-multi:-moz-focusring,[type=\"button\"].sc-ic-menu-with-multi:-moz-focusring,[type=\"reset\"].sc-ic-menu-with-multi:-moz-focusring,[type=\"submit\"].sc-ic-menu-with-multi:-moz-focusring{outline:1px dotted ButtonText}fieldset.sc-ic-menu-with-multi{padding:0.35em 0.75em 0.625em}legend.sc-ic-menu-with-multi{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress.sc-ic-menu-with-multi{vertical-align:baseline}textarea.sc-ic-menu-with-multi{overflow:auto}[type=\"checkbox\"].sc-ic-menu-with-multi,[type=\"radio\"].sc-ic-menu-with-multi{box-sizing:border-box;padding:0}[type=\"number\"].sc-ic-menu-with-multi::-webkit-inner-spin-button,[type=\"number\"].sc-ic-menu-with-multi::-webkit-outer-spin-button{height:auto}[type=\"search\"].sc-ic-menu-with-multi{-webkit-appearance:textfield;outline-offset:-2px}[type=\"search\"].sc-ic-menu-with-multi::-webkit-search-decoration{-webkit-appearance:none}.sc-ic-menu-with-multi::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details.sc-ic-menu-with-multi{display:block}summary.sc-ic-menu-with-multi{display:list-item}template.sc-ic-menu-with-multi{display:none}[hidden].sc-ic-menu-with-multi{display:none}html.sc-ic-menu-with-multi,body.sc-ic-menu-with-multi,div.sc-ic-menu-with-multi,span.sc-ic-menu-with-multi,applet.sc-ic-menu-with-multi,object.sc-ic-menu-with-multi,iframe.sc-ic-menu-with-multi,h1.sc-ic-menu-with-multi,h2.sc-ic-menu-with-multi,h3.sc-ic-menu-with-multi,h4.sc-ic-menu-with-multi,h5.sc-ic-menu-with-multi,h6.sc-ic-menu-with-multi,p.sc-ic-menu-with-multi,blockquote.sc-ic-menu-with-multi,pre.sc-ic-menu-with-multi,a.sc-ic-menu-with-multi,abbr.sc-ic-menu-with-multi,acronym.sc-ic-menu-with-multi,address.sc-ic-menu-with-multi,big.sc-ic-menu-with-multi,cite.sc-ic-menu-with-multi,code.sc-ic-menu-with-multi,del.sc-ic-menu-with-multi,dfn.sc-ic-menu-with-multi,em.sc-ic-menu-with-multi,img.sc-ic-menu-with-multi,ins.sc-ic-menu-with-multi,kbd.sc-ic-menu-with-multi,q.sc-ic-menu-with-multi,s.sc-ic-menu-with-multi,samp.sc-ic-menu-with-multi,small.sc-ic-menu-with-multi,strike.sc-ic-menu-with-multi,strong.sc-ic-menu-with-multi,sub.sc-ic-menu-with-multi,sup.sc-ic-menu-with-multi,tt.sc-ic-menu-with-multi,var.sc-ic-menu-with-multi,b.sc-ic-menu-with-multi,u.sc-ic-menu-with-multi,i.sc-ic-menu-with-multi,center.sc-ic-menu-with-multi,dl.sc-ic-menu-with-multi,dt.sc-ic-menu-with-multi,dd.sc-ic-menu-with-multi,ol.sc-ic-menu-with-multi,ul.sc-ic-menu-with-multi,li.sc-ic-menu-with-multi,fieldset.sc-ic-menu-with-multi,form.sc-ic-menu-with-multi,label.sc-ic-menu-with-multi,legend.sc-ic-menu-with-multi,table.sc-ic-menu-with-multi,caption.sc-ic-menu-with-multi,tbody.sc-ic-menu-with-multi,tfoot.sc-ic-menu-with-multi,thead.sc-ic-menu-with-multi,tr.sc-ic-menu-with-multi,th.sc-ic-menu-with-multi,td.sc-ic-menu-with-multi,article.sc-ic-menu-with-multi,aside.sc-ic-menu-with-multi,canvas.sc-ic-menu-with-multi,details.sc-ic-menu-with-multi,embed.sc-ic-menu-with-multi,figure.sc-ic-menu-with-multi,figcaption.sc-ic-menu-with-multi,footer.sc-ic-menu-with-multi,header.sc-ic-menu-with-multi,hgroup.sc-ic-menu-with-multi,menu.sc-ic-menu-with-multi,nav.sc-ic-menu-with-multi,output.sc-ic-menu-with-multi,ruby.sc-ic-menu-with-multi,section.sc-ic-menu-with-multi,summary.sc-ic-menu-with-multi,time.sc-ic-menu-with-multi,mark.sc-ic-menu-with-multi,audio.sc-ic-menu-with-multi,video.sc-ic-menu-with-multi{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}@media (prefers-reduced-motion: no-preference){.open.sc-ic-menu-with-multi-h .menu.sc-ic-menu-with-multi{transition:max-height var(--ic-transition-duration-slow)}}.sc-ic-menu-with-multi-h{max-height:0;width:var(--menu-width, var(--input-width, 20rem));min-width:20rem;color:var(--ic-color-primary-text);background-color:var(--ic-architectural-white);position:relative;z-index:var(--ic-z-index-menu);box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);border-radius:var(--ic-border-radius)}.open.sc-ic-menu-with-multi-h:not(.no-focus):focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline)}.select-all-focused.sc-ic-menu-with-multi-h{box-shadow:var(--ic-elevation-overlay) !important}#retry-button.sc-ic-menu-with-multi::part(button){height:var(--ic-space-lg)}.small.sc-ic-menu-with-multi #retry-button.sc-ic-menu-with-multi::part(button){height:var(--ic-space-md)}.on-dialog.sc-ic-menu-with-multi-h{inset:auto !important}.menu.sc-ic-menu-with-multi{text-decoration:none;list-style-type:none;border-radius:1px;background-color:var(--ic-architectural-white);visibility:hidden;max-height:0;overflow-y:hidden}.menu.sc-ic-menu-with-multi:has(+.option-bar).sc-ic-menu-with-multi{border-radius:0 0 1px 1px}.menu-scroll.sc-ic-menu-with-multi{overflow-y:auto}.menu.sc-ic-menu-with-multi:focus-visible{outline:none}.open.sc-ic-menu-with-multi-h{max-height:none;display:flex;flex-direction:column-reverse;border:var(--ic-border-width) solid var(--ic-architectural-400);transition:box-shadow var(--ic-easing-transition-fast)}.open.sc-ic-menu-with-multi-h .menu.sc-ic-menu-with-multi{visibility:visible;max-height:calc(var(--ic-space-xl) * 10 + var(--ic-space-xxxs))}.open.sc-ic-menu-with-multi-h .option-bar.sc-ic-menu-with-multi{visibility:visible}.open.sc-ic-menu-with-multi-h .select-all-button.sc-ic-menu-with-multi{display:block}.full-width.sc-ic-menu-with-multi-h{width:100%}.option.sc-ic-menu-with-multi{padding:var(--ic-space-xs) calc(var(--ic-space-xs) - var(--ic-space-1px));cursor:pointer;display:flex;align-items:center}.loading-option.sc-ic-menu-with-multi p.sc-ic-menu-with-multi{margin-bottom:0 !important}.option.sc-ic-menu-with-multi:not(.loading-option){justify-content:space-between}.small.sc-ic-menu-with-multi-h .option.sc-ic-menu-with-multi{padding:var(--ic-space-xxs) calc(var(--ic-space-xs) - var(--ic-space-1px))}.large.sc-ic-menu-with-multi-h .option.sc-ic-menu-with-multi{padding:var(--ic-space-sm) calc(var(--ic-space-xs) - var(--ic-space-1px))}.option.sc-ic-menu-with-multi:last-child{border-radius:0 0 1px 1px}.sc-ic-menu-with-multi:not(.menu:has(+.option-bar)).sc-ic-menu-with-multi .option.sc-ic-menu-with-multi:first-child{border-radius:1px 1px 0 0}.option.sc-ic-menu-with-multi:not(.disabled-option):hover{background-color:var(--ic-action-dark-bg-hover)}.option.sc-ic-menu-with-multi:not(.disabled-option):active{background-color:var(--ic-action-dark-bg-active)}.option.sc-ic-menu-with-multi:focus-visible{outline:var(--ic-hc-focus-outline)}.option.sc-ic-menu-with-multi:not(.disabled-option) .option-description.sc-ic-menu-with-multi{color:var(--ic-color-secondary-text)}.option.sc-ic-menu-with-multi .option-label.sc-ic-menu-with-multi{display:flex;flex-direction:row;align-items:top}.option.sc-ic-menu-with-multi .option-element.sc-ic-menu-with-multi{margin-top:var(--ic-space-xxs)}.option.sc-ic-menu-with-multi .option-icon.sc-ic-menu-with-multi{height:var(--ic-space-md);width:var(--ic-space-md);margin-top:var(--ic-space-xxs);margin-right:var(--ic-space-xxxs)}.option-text-container.sc-ic-menu-with-multi{pointer-events:none;max-width:calc(var(--ic-space-lg) * 10 + var(--ic-space-xl))}.option.loading-option.sc-ic-menu-with-multi .option-text-container.sc-ic-menu-with-multi{margin-left:calc(var(--ic-space-xs) + var(--ic-space-xxxs));color:var(--ic-color-secondary-text)}.error-icon-svg.sc-ic-menu-with-multi{height:var(--ic-space-md);width:var(--ic-space-md);fill:var(--ic-status-error);align-self:center;display:flex;margin-right:calc(var(--ic-space-xxs) * 1.2)}.loading-error-info.sc-ic-menu-with-multi{display:flex}.check-icon.sc-ic-menu-with-multi{height:var(--ic-space-lg);min-width:var(--ic-space-lg);width:var(--ic-space-lg);margin-left:var(--ic-space-xs);pointer-events:none}.focused-option.sc-ic-menu-with-multi .check-icon.sc-ic-menu-with-multi *.sc-ic-menu-with-multi{fill:currentcolor}.option-group-title.sc-ic-menu-with-multi{padding:var(--ic-space-lg) calc(var(--ic-space-xs) - var(--ic-space-1px))\n var(--ic-space-xs);color:var(--ic-color-tertiary-text)}.small.sc-ic-menu-with-multi-h .option-group-title.sc-ic-menu-with-multi{padding:var(--ic-space-sm) calc(var(--ic-space-xs) - var(--ic-space-1px))\n var(--ic-space-xxs)}.last-recommended-option.sc-ic-menu-with-multi{border-bottom:var(--ic-border-default)}.disabled-option.sc-ic-menu-with-multi{color:var(--ic-architectural-200);cursor:default;pointer-events:none}.focused-option.sc-ic-menu-with-multi,.focused-option.sc-ic-menu-with-multi .option-description.sc-ic-menu-with-multi{background-color:var(--ic-focus-blue) !important;color:var(--ic-color-white-text) !important}.no-results.sc-ic-menu-with-multi-h li.sc-ic-menu-with-multi{cursor:no-drop}.no-results.sc-ic-menu-with-multi-h li.sc-ic-menu-with-multi:hover{background-color:transparent}.option-bar.sc-ic-menu-with-multi{padding:var(--ic-space-xxs) var(--ic-space-xs);display:flex;align-items:center;justify-content:space-between;background-color:var(--ic-architectural-40);visibility:hidden;border-bottom:var(--ic-border-width) solid var(--ic-architectural-400);border-radius:1px 1px 0 0}.option-bar.sc-ic-menu-with-multi p.sc-ic-menu-with-multi{margin-bottom:0 !important}.large.sc-ic-menu-with-multi-h .option-bar.sc-ic-menu-with-multi{padding:var(--ic-space-xs)}.select-all-button.sc-ic-menu-with-multi{display:none}.select-all-button.sc-ic-menu-with-multi:focus{z-index:calc(var(--ic-z-index-menu) + 1)}@media (forced-colors: active){.focused-option.sc-ic-menu-with-multi:focus{outline:none;border:0.125rem solid transparent}}";
1801
+
1802
+ const Menu = class {
1803
+ constructor(hostRef) {
1804
+ registerInstance(this, hostRef);
1805
+ this.menuKeyPress = createEvent(this, "menuKeyPress", 7);
1806
+ this.menuOptionId = createEvent(this, "menuOptionId", 7);
1807
+ this.menuOptionSelect = createEvent(this, "menuOptionSelect", 7);
1808
+ this.menuOptionSelectAll = createEvent(this, "menuOptionSelectAll", 7);
1809
+ this.menuStateChange = createEvent(this, "menuStateChange", 7);
1810
+ this.retryButtonClicked = createEvent(this, "retryButtonClicked", 7);
1811
+ this.timeoutBlur = createEvent(this, "timeoutBlur", 7);
1812
+ this.ungroupedOptionsSet = createEvent(this, "ungroupedOptionsSet", 7);
1813
+ this.activeDescendantAttr = "aria-activedescendant"; // Prevent duplicate literal string lint error
1814
+ this.clearButtonId = "clear-button"; // Prevent duplicate literal string lint error
1815
+ this.disabledOptionSelected = false;
1816
+ this.hasPreviouslyBlurred = false;
1817
+ this.hasTimedOut = false;
1818
+ this.isLoading = false;
1819
+ this.isMultiSelect = false;
1820
+ this.isSearchBar = false;
1821
+ this.isSearchableSelect = false;
1822
+ this.multiOptionClicked = null;
1823
+ this.preventClickOpen = false; // Prevents menu re-opening immediately after it is closed on blur when clicking input.
1824
+ this.preventMenuFocus = false; // (When multiple) ensures focus moves straight to select all button from menu.
1825
+ this.ungroupedOptions = [];
1826
+ this.handleClearListener = () => {
1827
+ this.optionHighlighted = "";
1828
+ };
1829
+ this.handleSubmitSearch = () => {
1830
+ const highlightedOptionIndex = this.options.findIndex((option) => option[this.valueField] === this.optionHighlighted);
1831
+ this.setInputValue(highlightedOptionIndex);
1832
+ };
1833
+ this.handleMenuChange = (open, focusInput) => {
1834
+ this.menuStateChange.emit({ open, focusInput });
1835
+ if (!open) {
1836
+ if (focusInput !== false) {
1837
+ this.inputEl.focus();
1838
+ this.preventClickOpen = false;
1839
+ }
1840
+ // Reset optionHighlighted so previously highlighted option doesn't get reselected when Enter pressed
1841
+ if (this.isMultiSelect) {
1842
+ this.optionHighlighted = undefined;
1843
+ this.multiOptionClicked = null;
1844
+ }
1845
+ }
1846
+ };
1847
+ this.setNextOptionValue = (selectedOptionIndex) => {
1848
+ if (this.ungroupedOptions[selectedOptionIndex + 1]) {
1849
+ this.menuOptionSelect.emit({
1850
+ value: this.ungroupedOptions[selectedOptionIndex + 1][this.valueField],
1851
+ optionId: this.getOptionId(this.ungroupedOptions[selectedOptionIndex + 1][this.valueField]),
1852
+ });
1853
+ }
1854
+ else {
1855
+ this.menuOptionSelect.emit({
1856
+ value: this.ungroupedOptions[0][this.valueField],
1857
+ optionId: this.getOptionId(this.ungroupedOptions[0][this.valueField]),
1858
+ });
1859
+ }
1860
+ };
1861
+ this.setPreviousOptionValue = (selectedOptionIndex) => {
1862
+ if (this.ungroupedOptions[selectedOptionIndex - 1]) {
1863
+ this.menuOptionSelect.emit({
1864
+ value: this.ungroupedOptions[selectedOptionIndex - 1][this.valueField],
1865
+ optionId: this.getOptionId(this.ungroupedOptions[selectedOptionIndex - 1][this.valueField]),
1866
+ });
1867
+ }
1868
+ else {
1869
+ this.menuOptionSelect.emit({
1870
+ value: this.ungroupedOptions[this.ungroupedOptions.length - 1][this.valueField],
1871
+ optionId: this.getOptionId(this.ungroupedOptions[this.ungroupedOptions.length - 1][this.valueField]),
1872
+ });
1873
+ }
1874
+ };
1875
+ this.getParentEl = (parent) => {
1876
+ if (parent.tagName === "IC-SEARCH-BAR") {
1877
+ this.isSearchBar = true;
1878
+ }
1879
+ else if (parent.tagName === "IC-SELECT" ||
1880
+ parent.tagName === "IC-SELECT-WITH-MULTI") {
1881
+ if (parent.getAttribute("searchable") !== null &&
1882
+ parent.getAttribute("searchable") !== undefined) {
1883
+ this.isSearchableSelect = true;
1884
+ }
1885
+ else if (parent.getAttribute("multiple") !== null &&
1886
+ parent.getAttribute("multiple") !== undefined) {
1887
+ this.isMultiSelect = true;
1888
+ }
1889
+ }
1890
+ };
1891
+ // Open menu when up or down arrow keys are pressed
1892
+ this.arrowBehaviour = (event) => {
1893
+ event.preventDefault();
1894
+ this.handleMenuChange(true);
1895
+ };
1896
+ this.getMenuOptions = () => this.isSearchBar ? this.options : this.ungroupedOptions;
1897
+ // Set option that is focused and so should show focus state
1898
+ this.setHighlightedOption = (highlightedIndex) => {
1899
+ const menuOptions = this.getMenuOptions();
1900
+ menuOptions[highlightedIndex] &&
1901
+ !menuOptions[highlightedIndex].timedOut &&
1902
+ (this.optionHighlighted =
1903
+ menuOptions[highlightedIndex][this.valueField] || undefined);
1904
+ };
1905
+ // Determines keyboard behaviour when selection is automatic
1906
+ // (i.e. you don't have to press Enter select an option - just focus on it)
1907
+ // and menu is closed
1908
+ this.autoSetInputValueKeyboardOpen = (event) => {
1909
+ const selectedOptionIndex = this.ungroupedOptions.findIndex((option) => option[this.valueField] === this.value);
1910
+ this.keyboardNav = false;
1911
+ switch (event.key) {
1912
+ case "ArrowDown":
1913
+ this.keyboardNav = true;
1914
+ this.arrowBehaviour(event);
1915
+ this.setNextOptionValue(selectedOptionIndex);
1916
+ break;
1917
+ case "ArrowUp":
1918
+ this.keyboardNav = true;
1919
+ this.arrowBehaviour(event);
1920
+ this.setPreviousOptionValue(selectedOptionIndex);
1921
+ break;
1922
+ case " ":
1923
+ case "Enter":
1924
+ if (event.target.id !== this.clearButtonId) {
1925
+ this.handleMenuChange(true);
1926
+ }
1927
+ break;
1928
+ }
1929
+ };
1930
+ this.selectHighlightedOption = (target, options, highlightedOptionIndex) => {
1931
+ if (!this.isLoading && !this.hasTimedOut) {
1932
+ this.keyboardNav = true;
1933
+ }
1934
+ const isOpen = this.isSearchBar || this.isSearchableSelect || this.open;
1935
+ if (isOpen) {
1936
+ if (highlightedOptionIndex >= 0) {
1937
+ if (options[highlightedOptionIndex] !== undefined) {
1938
+ if (this.isSearchBar &&
1939
+ options[highlightedOptionIndex].disabled === true) {
1940
+ this.disabledOptionSelected = true;
1941
+ }
1942
+ else {
1943
+ this.setInputValue(highlightedOptionIndex);
1944
+ this.value = options[highlightedOptionIndex][this.valueField];
1945
+ }
1946
+ }
1947
+ }
1948
+ else {
1949
+ this.setInputValue(highlightedOptionIndex);
1950
+ }
1951
+ }
1952
+ else if (target.id !== this.clearButtonId &&
1953
+ this.isMultiSelect) {
1954
+ this.handleMenuChange(true);
1955
+ }
1956
+ };
1957
+ // Determines keyboard behaviour when selection is manual (i.e. when you have to press Enter to select an option)
1958
+ this.manualSetInputValueKeyboardOpen = (event) => {
1959
+ const menuOptions = this.getMenuOptions();
1960
+ this.keyboardNav = false;
1961
+ const highlightedOptionIndex = menuOptions.findIndex((option) => option[this.valueField] === this.optionHighlighted);
1962
+ const clickedMultiOptionIndex = menuOptions.findIndex((option) => option[this.valueField] === this.multiOptionClicked);
1963
+ const getOptionId = (index) => { var _a; return (_a = Array.from(this.el.querySelectorAll("li"))[index]) === null || _a === void 0 ? void 0 : _a.id; };
1964
+ // Space press should be equivalent to Enter when multi-select
1965
+ if (event.key === " " && this.isMultiSelect) {
1966
+ this.selectHighlightedOption(event.target, menuOptions, highlightedOptionIndex);
1967
+ }
1968
+ else {
1969
+ switch (event.key) {
1970
+ case "ArrowDown":
1971
+ this.keyboardNav = true;
1972
+ this.arrowBehaviour(event);
1973
+ if (this.multiOptionClicked) {
1974
+ // Set focus to option last clicked
1975
+ // Prevents it resetting to the top of the menu when user switches to using keyboard
1976
+ this.setHighlightedOption(clickedMultiOptionIndex);
1977
+ this.multiOptionClicked = null;
1978
+ }
1979
+ else if (highlightedOptionIndex < menuOptions.length - 1) {
1980
+ this.setHighlightedOption(highlightedOptionIndex + 1);
1981
+ this.menuOptionId.emit({
1982
+ optionId: getOptionId(highlightedOptionIndex + 1),
1983
+ });
1984
+ }
1985
+ else {
1986
+ this.setHighlightedOption(0);
1987
+ this.menuOptionId.emit({
1988
+ optionId: getOptionId(0),
1989
+ });
1990
+ }
1991
+ this.preventIncorrectTabOrder = false;
1992
+ this.focusFromSearchKeypress = false;
1993
+ break;
1994
+ case "ArrowUp":
1995
+ this.keyboardNav = true;
1996
+ this.arrowBehaviour(event);
1997
+ if (this.multiOptionClicked) {
1998
+ // Set focus to option last clicked
1999
+ // Prevents it resetting to the bottom of the menu when user switches to using keyboard
2000
+ this.setHighlightedOption(clickedMultiOptionIndex);
2001
+ this.multiOptionClicked = null;
2002
+ }
2003
+ else if (highlightedOptionIndex <= 0 ||
2004
+ highlightedOptionIndex > menuOptions.length + 1) {
2005
+ this.setHighlightedOption(menuOptions.length - 1);
2006
+ this.menuOptionId.emit({
2007
+ optionId: getOptionId(menuOptions.length - 1),
2008
+ });
2009
+ }
2010
+ else {
2011
+ this.setHighlightedOption(highlightedOptionIndex - 1);
2012
+ this.menuOptionId.emit({
2013
+ optionId: getOptionId(highlightedOptionIndex - 1),
2014
+ });
2015
+ }
2016
+ this.preventIncorrectTabOrder = false;
2017
+ this.focusFromSearchKeypress = false;
2018
+ break;
2019
+ case "Home":
2020
+ this.keyboardNav = true;
2021
+ event.preventDefault();
2022
+ this.arrowBehaviour(event);
2023
+ this.setHighlightedOption(0);
2024
+ this.menuOptionId.emit({
2025
+ optionId: getOptionId(0),
2026
+ });
2027
+ break;
2028
+ case "End":
2029
+ this.keyboardNav = true;
2030
+ event.preventDefault();
2031
+ this.arrowBehaviour(event);
2032
+ this.setHighlightedOption(menuOptions.length - 1);
2033
+ this.menuOptionId.emit({
2034
+ optionId: getOptionId(menuOptions.length - 1),
2035
+ });
2036
+ break;
2037
+ case " ":
2038
+ if (this.isSearchBar || this.isSearchableSelect) {
2039
+ break;
2040
+ }
2041
+ else {
2042
+ if (event.target.id !== this.clearButtonId) {
2043
+ this.handleMenuChange(true);
2044
+ }
2045
+ }
2046
+ break;
2047
+ case "Enter":
2048
+ event.preventDefault();
2049
+ this.selectHighlightedOption(event.target, menuOptions, highlightedOptionIndex);
2050
+ break;
2051
+ case "Escape":
2052
+ if (this.open) {
2053
+ event.stopImmediatePropagation();
2054
+ }
2055
+ this.handleMenuChange(false);
2056
+ this.menuOptionId.emit({ optionId: undefined });
2057
+ break;
2058
+ case "a":
2059
+ // Checks if Cmd (meta) key is pressed if Mac device (while excluding meta key on Windows)
2060
+ // Otherwise, if a different OS, checks Ctrl key
2061
+ if ((isMacDevice() && event.metaKey) ||
2062
+ (!isMacDevice() && event.ctrlKey)) {
2063
+ this.emitSelectAll();
2064
+ }
2065
+ break;
2066
+ case "Shift":
2067
+ case "Tab":
2068
+ if (this.isSearchBar) {
2069
+ this.keyboardNav = true;
2070
+ }
2071
+ if (this.isMultiSelect) {
2072
+ if (this.open && !event.shiftKey && this.selectAllButton) {
2073
+ event.preventDefault();
2074
+ this.selectAllButton.focus(); // Move focus to select all button instead of focused option
2075
+ this.preventMenuFocus = true;
2076
+ this.preventClickOpen = true;
2077
+ this.optionHighlighted = undefined; // Stop any option focus states showing when focus moved to select all button
2078
+ }
2079
+ }
2080
+ else {
2081
+ this.preventIncorrectTabOrder = true;
2082
+ }
2083
+ break;
2084
+ case "Backspace":
2085
+ if (this.isSearchBar) {
2086
+ this.parentEl.setFocus();
2087
+ if (this.searchMode === "navigation")
2088
+ this.setHighlightedOption(0);
2089
+ }
2090
+ else if (this.isSearchableSelect) {
2091
+ this.parentEl.setFocus();
2092
+ }
2093
+ this.focusFromSearchKeypress = true;
2094
+ break;
2095
+ default:
2096
+ if (event.key !== "Tab") {
2097
+ if (this.isSearchBar) {
2098
+ this.parentEl.setFocus();
2099
+ if (this.searchMode === "navigation")
2100
+ this.setHighlightedOption(0);
2101
+ }
2102
+ else if (this.isSearchableSelect) {
2103
+ this.parentEl.setFocus();
2104
+ }
2105
+ this.focusFromSearchKeypress = true;
2106
+ break;
2107
+ }
2108
+ }
2109
+ }
2110
+ };
2111
+ this.setInputValue = (highlightedOptionIndex) => {
2112
+ const menuOptions = this.getMenuOptions();
2113
+ if (menuOptions[highlightedOptionIndex] !== undefined) {
2114
+ this.menuOptionSelect.emit({
2115
+ value: menuOptions[highlightedOptionIndex][this.valueField],
2116
+ });
2117
+ if (this.closeOnSelect) {
2118
+ this.optionHighlighted = undefined;
2119
+ this.menuOptionId.emit({ optionId: undefined });
2120
+ }
2121
+ }
2122
+ if (this.closeOnSelect) {
2123
+ if (!this.hasTimedOut) {
2124
+ this.handleMenuChange(false);
2125
+ }
2126
+ else {
2127
+ this.parentEl.setFocus();
2128
+ }
2129
+ }
2130
+ };
2131
+ this.handleOptionClick = (event) => {
2132
+ const { value, label } = event.target.dataset;
2133
+ this.menuOptionSelect.emit({ value, label });
2134
+ this.optionHighlighted = undefined;
2135
+ if (this.isMultiSelect) {
2136
+ this.multiOptionClicked = value;
2137
+ }
2138
+ else {
2139
+ this.handleMenuChange(false);
2140
+ }
2141
+ };
2142
+ this.handleRetry = () => {
2143
+ this.retryButtonClicked.emit({ value: this.value });
2144
+ };
2145
+ this.handleRetryKeyDown = (ev) => {
2146
+ if (ev.key === "Enter" || ev.key === " ") {
2147
+ ev.preventDefault();
2148
+ this.retryButtonClicked.emit({ value: this.value, keyPressed: ev.key });
2149
+ }
2150
+ };
2151
+ this.handleBlur = (event) => {
2152
+ if (event.relatedTarget !== this.inputEl) {
2153
+ if (event.relatedTarget === this.selectAllButton) {
2154
+ this.menu.removeAttribute(this.activeDescendantAttr);
2155
+ }
2156
+ if (!(this.menu.contains(event.relatedTarget) ||
2157
+ event.relatedTarget === this.selectAllButton)) {
2158
+ this.handleMenuChange(false, this.hasPreviouslyBlurred);
2159
+ this.menu.removeAttribute(this.activeDescendantAttr);
2160
+ }
2161
+ }
2162
+ else {
2163
+ this.handleMenuChange(false);
2164
+ this.preventClickOpen = true;
2165
+ this.menu.removeAttribute(this.activeDescendantAttr);
2166
+ }
2167
+ if (!this.isSearchBar)
2168
+ this.hasPreviouslyBlurred = !!event.relatedTarget;
2169
+ };
2170
+ this.handleMouseDown = (event) => {
2171
+ event.preventDefault();
2172
+ };
2173
+ this.handleMenuKeyDown = (event) => {
2174
+ if (this.activationType === "automatic") {
2175
+ this.autoSetValueOnMenuKeyDown(event);
2176
+ }
2177
+ else if (this.activationType === "manual" && !this.isSearchBar) {
2178
+ this.manualSetInputValueKeyboardOpen(event);
2179
+ }
2180
+ };
2181
+ this.handleMenuKeyUp = (event) => {
2182
+ if (event.key === "Tab" && event.shiftKey) {
2183
+ this.preventClickOpen = false;
2184
+ }
2185
+ if (event.key === "Enter" && this.disabledOptionSelected) {
2186
+ this.disabledOptionSelected = false;
2187
+ event.stopImmediatePropagation();
2188
+ }
2189
+ };
2190
+ this.handleSelectAllClick = () => {
2191
+ this.keyboardNav = false;
2192
+ this.menu.focus();
2193
+ this.emitSelectAll();
2194
+ };
2195
+ this.handleSelectAllBlur = (event) => {
2196
+ this.el.classList.remove("select-all-focused");
2197
+ if (!this.menu.contains(event.relatedTarget)) {
2198
+ this.handleMenuChange(false, false);
2199
+ }
2200
+ };
2201
+ this.handleSelectAllFocus = () => {
2202
+ this.el.classList.add("select-all-focused");
2203
+ };
2204
+ // Fix for Safari - select all button click was causing menu to close
2205
+ this.handleSelectAllMouseDown = (event) => {
2206
+ event.preventDefault();
2207
+ };
2208
+ this.emitSelectAll = () => {
2209
+ var _a;
2210
+ // Select all if there is either no value or not all options are selected
2211
+ // 'true' means select all, 'false' means clear all
2212
+ this.menuOptionSelectAll.emit({
2213
+ select: !this.value || !(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) === this.ungroupedOptions.length),
2214
+ });
2215
+ };
2216
+ this.emitMenuKeyPress = (isNavKey, key) => {
2217
+ this.menuKeyPress.emit({ isNavKey: isNavKey, key: key });
2218
+ };
2219
+ // Determines keyboard behaviour when selection is automatic
2220
+ // (i.e. you don't have to press Enter select an option - just focus on it)
2221
+ // and menu is focused
2222
+ this.autoSetValueOnMenuKeyDown = (event) => {
2223
+ event.cancelBubble = true;
2224
+ const selectedOptionIndex = this.ungroupedOptions.findIndex((option) => option[this.valueField] === this.value);
2225
+ const isSearchableSelect = this.inputEl.tagName === "INPUT";
2226
+ this.keyboardNav = false;
2227
+ switch (event.key) {
2228
+ case " ":
2229
+ event.preventDefault();
2230
+ break;
2231
+ case "ArrowUp":
2232
+ if (!this.hasTimedOut) {
2233
+ event.preventDefault();
2234
+ this.setPreviousOptionValue(selectedOptionIndex);
2235
+ this.keyboardNav = true;
2236
+ }
2237
+ break;
2238
+ case "ArrowDown":
2239
+ if (!this.hasTimedOut) {
2240
+ event.preventDefault();
2241
+ this.setNextOptionValue(selectedOptionIndex);
2242
+ this.keyboardNav = true;
2243
+ }
2244
+ break;
2245
+ case "Home":
2246
+ this.menuOptionSelect.emit({
2247
+ value: this.ungroupedOptions[0][this.valueField],
2248
+ });
2249
+ this.keyboardNav = true;
2250
+ break;
2251
+ case "End":
2252
+ this.menuOptionSelect.emit({
2253
+ value: this.ungroupedOptions[this.ungroupedOptions.length - 1][this.valueField],
2254
+ });
2255
+ this.keyboardNav = true;
2256
+ break;
2257
+ case "Enter":
2258
+ !this.hasTimedOut && this.handleMenuChange(false);
2259
+ break;
2260
+ case "Escape":
2261
+ this.handleMenuChange(false);
2262
+ break;
2263
+ case "Backspace":
2264
+ if (isSearchableSelect) {
2265
+ this.inputEl.focus();
2266
+ }
2267
+ break;
2268
+ case "Shift":
2269
+ break;
2270
+ default:
2271
+ if (isSearchableSelect && event.key !== "Tab" && !this.hasTimedOut) {
2272
+ this.inputEl.focus();
2273
+ }
2274
+ if (event.key.length === 1) {
2275
+ this.keyboardNav = true;
2276
+ }
2277
+ break;
2278
+ }
2279
+ this.emitMenuKeyPress(this.keyboardNav, event.key);
2280
+ };
2281
+ this.getOptionId = (value) => {
2282
+ return `${this.menuId}-${value}`;
2283
+ };
2284
+ this.getOptionAriaLabel = (option, parentOption) => {
2285
+ let ariaLabel = option[this.labelField];
2286
+ if (option.description) {
2287
+ ariaLabel = `${ariaLabel}, ${option.description}`;
2288
+ }
2289
+ if (option.element) {
2290
+ ariaLabel = `${ariaLabel}, ${option.element.ariaLabel}`;
2291
+ }
2292
+ if (parentOption) {
2293
+ return `${ariaLabel}, ${parentOption[this.labelField]} group`;
2294
+ }
2295
+ else {
2296
+ return ariaLabel;
2297
+ }
2298
+ };
2299
+ this.getSortedOptions = (options) => {
2300
+ let sorted = [];
2301
+ if (options.sort) {
2302
+ sorted = options.sort((optionA, optionB) => optionA.recommended && !optionB.recommended ? -1 : 0);
2303
+ }
2304
+ return sorted;
2305
+ };
2306
+ this.isManualMode = this.activationType === "manual";
2307
+ this.scrollToSelected = (menu) => {
2308
+ const selectedOption = this.selectOnEnter
2309
+ ? this.el.querySelector(`li[data-value="${this.optionHighlighted}"]`)
2310
+ : menu.querySelector(".option[aria-selected='true']");
2311
+ if (selectedOption) {
2312
+ const elTop = selectedOption.offsetTop + selectedOption.offsetHeight;
2313
+ if (elTop > menu.scrollTop + menu.offsetHeight ||
2314
+ elTop < menu.scrollTop + menu.offsetHeight) {
2315
+ menu.scrollTop = selectedOption.offsetTop;
2316
+ }
2317
+ // 'aria-activedescendant' affects screen reader focus
2318
+ // https://www.w3.org/TR/2017/WD-wai-aria-practices-1.1-20170628/#kbd_focus_activedescendant
2319
+ this.menu.setAttribute(this.activeDescendantAttr, selectedOption.id);
2320
+ selectedOption.focus();
2321
+ }
2322
+ };
2323
+ // Set 'ungroupedOptions' variable and emit its value
2324
+ // - this is all the options with disabled options and group titles removed
2325
+ this.loadUngroupedOptions = () => {
2326
+ if (this.options.length > 0 && this.options.map) {
2327
+ this.options.map((option) => {
2328
+ if (option.children) {
2329
+ option.children.map((option) => !option.disabled && this.ungroupedOptions.push(option));
2330
+ }
2331
+ else if (!option.disabled) {
2332
+ this.ungroupedOptions.push(option);
2333
+ }
2334
+ });
2335
+ }
2336
+ this.ungroupedOptions = this.getSortedOptions(this.ungroupedOptions);
2337
+ this.ungroupedOptionsSet.emit({ options: this.ungroupedOptions });
2338
+ };
2339
+ this.setMenuScrollbar = () => {
2340
+ let optionsHeight = 0;
2341
+ this.el
2342
+ .querySelectorAll(".option")
2343
+ .forEach((option) => (optionsHeight += option.clientHeight));
2344
+ if (optionsHeight >= 320) {
2345
+ this.menu.classList.add("menu-scroll");
2346
+ }
2347
+ };
2348
+ this.handleTimeoutBlur = (ev) => {
2349
+ this.timeoutBlur.emit({ ev });
2350
+ };
2351
+ this.optionContent = (option, selected) => {
2352
+ return (h(Fragment, null, option.loading && h("ic-loading-indicator", { size: "icon" }), h("div", { class: "option-text-container" }, h("div", { class: "option-label" }, option.icon && (h("div", { class: "option-icon", innerHTML: option.icon, "aria-hidden": "true" })), h("ic-typography", { variant: "body", "aria-hidden": "true" }, h("p", null, option[this.labelField]))), option.description && (h("ic-typography", { id: `${this.getOptionId(option[this.valueField])}-description`, class: "option-description", variant: "caption", "aria-hidden": "true" }, h("p", null, option.description))), option.element && (h("div", { class: "option-element", innerHTML: option.element.component, "aria-hidden": "true" }))), !!option[this.valueField] &&
2353
+ !!this.value &&
2354
+ selected &&
2355
+ this.parentEl.tagName !== "IC-SEARCH-BAR" && (h("span", { class: "check-icon", innerHTML: Check }))));
2356
+ };
2357
+ this.displayOption = (option, selected, index, parentOption) => {
2358
+ const { open, keyboardNav, isManualMode, initialOptionsListRender, optionHighlighted, options, } = this;
2359
+ return (h("li", { id: this.getOptionId(option[this.valueField]), class: {
2360
+ option: true,
2361
+ "focused-option": isManualMode
2362
+ ? (keyboardNav || initialOptionsListRender) &&
2363
+ option[this.valueField] === optionHighlighted
2364
+ : keyboardNav && selected,
2365
+ "last-recommended-option": option.recommended &&
2366
+ options[index + 1] &&
2367
+ !options[index + 1].recommended,
2368
+ "disabled-option": option.disabled,
2369
+ "loading-option": option.loading,
2370
+ timeout: option.timedOut,
2371
+ }, role: "option", tabindex: open &&
2372
+ (selected || option[this.valueField] === optionHighlighted) &&
2373
+ keyboardNav
2374
+ ? "0"
2375
+ : "-1", "aria-label": this.getOptionAriaLabel(option, parentOption), "aria-selected": selected ? "true" : "false", "aria-disabled": option.disabled ? "true" : "false", onClick: !option.timedOut && !option.loading && this.handleOptionClick, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, "data-value": option[this.valueField], "data-label": option[this.labelField] }, option.timedOut ? (h(Fragment, null, h("div", { class: "loading-error-info" }, h("svg", { class: "error-icon-svg", "aria-labelledby": "error-title", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#000000" }, h("title", { id: "error-title" }, "Error"), h("g", { id: "close-octagon" }, h("path", { id: "Vector", d: "M8.77 3L3.5 8.27V15.73L8.77 21H16.23L21.5 15.73V8.27L16.23 3M8.91 7L12.5 10.59L16.09 7L17.5 8.41L13.91 12L17.5 15.59L16.09 17L12.5 13.41L8.91 17L7.5 15.59L11.09 12L7.5 8.41" }))), h("ic-typography", { variant: "label" }, option[this.labelField])), h("ic-button", { size: "small", variant: "tertiary", onClick: this.handleRetry, onKeyDown: this.handleRetryKeyDown, onBlur: this.handleTimeoutBlur, id: "retry-button" }, "Retry"))) : (this.optionContent(option, selected))));
2376
+ };
2377
+ this.focusFromSearchKeypress = false;
2378
+ this.initialOptionsListRender = false;
2379
+ this.keyboardNav = false;
2380
+ this.optionHighlighted = undefined;
2381
+ this.preventIncorrectTabOrder = false;
2382
+ this.menuOptions = undefined;
2383
+ this.activationType = "automatic";
2384
+ this.anchorEl = undefined;
2385
+ this.autoFocusOnSelected = true;
2386
+ this.closeOnSelect = true;
2387
+ this.fullWidth = false;
2388
+ this.inputEl = undefined;
2389
+ this.inputLabel = undefined;
2390
+ this.labelField = "label";
2391
+ this.menuId = undefined;
2392
+ this.open = undefined;
2393
+ this.parentEl = undefined;
2394
+ this.searchMode = "navigation";
2395
+ this.selectOnEnter = false;
2396
+ this.size = "default";
2397
+ this.small = false;
2398
+ this.options = undefined;
2399
+ this.value = undefined;
2400
+ this.valueField = "value";
2401
+ }
2402
+ watchOpenHandler() {
2403
+ if (!this.open && this.popperInstance) {
2404
+ this.popperInstance.destroy();
2405
+ this.popperInstance = null;
2406
+ }
2407
+ }
2408
+ watchOptionsHandler(newOptions) {
2409
+ this.hasTimedOut = newOptions.some((opt) => opt.timedOut);
2410
+ this.isLoading = newOptions.some((opt) => opt.loading);
2411
+ this.ungroupedOptions = [];
2412
+ this.loadUngroupedOptions();
2413
+ }
2414
+ connectedCallback() {
2415
+ this.getParentEl(this.parentEl);
2416
+ if (this.isSearchBar) {
2417
+ if (this.searchMode === "navigation")
2418
+ this.setHighlightedOption(0);
2419
+ this.initialOptionsListRender = true;
2420
+ }
2421
+ }
2422
+ disconnectedCallback() {
2423
+ if (this.popperInstance) {
2424
+ this.popperInstance.destroy();
2425
+ }
2426
+ this.parentEl.removeEventListener("icClear", this.handleClearListener);
2427
+ this.parentEl.removeEventListener("icSubmitSearch", this.handleSubmitSearch);
2428
+ }
2429
+ componentWillLoad() {
2430
+ var _a, _b;
2431
+ this.loadUngroupedOptions();
2432
+ this.parentEl.addEventListener("icClear", this.handleClearListener);
2433
+ this.parentEl.addEventListener("icSubmitSearch", this.handleSubmitSearch);
2434
+ this.hasTimedOut = (_a = this.options) === null || _a === void 0 ? void 0 : _a.some((opt) => opt.timedOut);
2435
+ this.isLoading = (_b = this.options) === null || _b === void 0 ? void 0 : _b.some((opt) => opt.loading);
2436
+ }
2437
+ componentDidLoad() {
2438
+ if (this.isSearchBar &&
2439
+ this.parentEl.disableFilter) {
2440
+ this.focusFromSearchKeypress = true;
2441
+ }
2442
+ onComponentRequiredPropUndefined([
2443
+ { prop: this.open, propName: "open" },
2444
+ { prop: this.options, propName: "options" },
2445
+ { prop: this.menuId, propName: "menu-id" },
2446
+ { prop: this.inputLabel, propName: "input-label" },
2447
+ //NOTE: no check for value, input-el or anchor-el as otherwise get console errors on first load of select component
2448
+ ], "Menu");
2449
+ }
2450
+ componentDidUpdate() {
2451
+ const inputValueInOptions = this.options.some((option) => option[this.valueField] === this.value);
2452
+ const optionHighlightedIsSet = this.optionHighlighted !== null &&
2453
+ this.optionHighlighted !== undefined &&
2454
+ this.optionHighlighted !== "";
2455
+ if (this.open && this.options.length !== 0 && !this.preventMenuFocus) {
2456
+ if (this.value &&
2457
+ this.keyboardNav &&
2458
+ inputValueInOptions &&
2459
+ this.autoFocusOnSelected &&
2460
+ !this.isSearchableSelect) {
2461
+ this.scrollToSelected(this.menu);
2462
+ }
2463
+ else if (optionHighlightedIsSet &&
2464
+ !this.focusFromSearchKeypress &&
2465
+ !this.preventIncorrectTabOrder) {
2466
+ const highlightedEl = this.el.querySelector(`li[data-value="${this.optionHighlighted}"]`);
2467
+ if (highlightedEl) {
2468
+ this.menu.setAttribute(this.activeDescendantAttr, highlightedEl.id);
2469
+ highlightedEl.focus();
2470
+ }
2471
+ }
2472
+ else if (this.inputEl.tagName !== "IC-TEXT-FIELD" &&
2473
+ this.inputEl.tagName !== "INPUT") {
2474
+ this.menu.focus();
2475
+ }
2476
+ }
2477
+ if (this.open && !this.value && this.selectOnEnter) {
2478
+ this.scrollToSelected(this.menu);
2479
+ }
2480
+ this.preventMenuFocus = false;
2481
+ }
2482
+ componentDidRender() {
2483
+ if (this.open && !this.popperInstance && this.anchorEl) {
2484
+ this.initPopperJs(this.anchorEl);
2485
+ }
2486
+ if (this.open && !!this.options.length) {
2487
+ this.setMenuScrollbar();
2488
+ }
2489
+ }
2490
+ /**
2491
+ * @internal If menu is opened with the mouse, emit menuStateChange custom event.
2492
+ */
2493
+ async handleClickOpen() {
2494
+ if (!this.preventClickOpen) {
2495
+ this.menuStateChange.emit({ open: !this.open });
2496
+ this.keyboardNav = false;
2497
+ }
2498
+ this.preventClickOpen = false;
2499
+ }
2500
+ /**
2501
+ * Used alongside activationType
2502
+ * If menu is opened via keyboard navigation (i.e. Enter, ArrowUp or ArrowDown), emit optionSelect custom event.
2503
+ * @param {KeyboardEvent} event - keyboard event
2504
+ */
2505
+ async handleKeyboardOpen(event) {
2506
+ this.keyboardNav = false;
2507
+ if (this.activationType === "automatic") {
2508
+ this.autoSetInputValueKeyboardOpen(event);
2509
+ }
2510
+ else {
2511
+ this.manualSetInputValueKeyboardOpen(event);
2512
+ }
2513
+ }
2514
+ /**
2515
+ * @internal Used to highlight the first option in the menu.
2516
+ */
2517
+ async handleSetFirstOption() {
2518
+ this.setHighlightedOption(0);
2519
+ }
2520
+ /**
2521
+ * @internal Used to initialize popperJS with an anchor element.
2522
+ * 5/12/2023: Tested with Floating UI, however, discovered inconsistent
2523
+ * boundary behaviour so sticking with PopperJS.
2524
+ */
2525
+ async initPopperJs(anchor) {
2526
+ // Placements set to "-start" to accommodate for custom menu width - menu should always be aligned to the left
2527
+ this.popperInstance = createPopper(anchor, this.el, {
2528
+ placement: "bottom-start",
2529
+ modifiers: [
2530
+ {
2531
+ name: "offset",
2532
+ options: {
2533
+ offset: [0, 7],
2534
+ },
2535
+ },
2536
+ {
2537
+ name: "flip",
2538
+ options: {
2539
+ fallbackPlacements: ["top-start"],
2540
+ rootBoundary: "viewport",
2541
+ },
2542
+ },
2543
+ ],
2544
+ });
2545
+ }
2546
+ render() {
2547
+ const { inputLabel, options, menuId, value, fullWidth, hasTimedOut, isLoading, size, small, open, inputEl, keyboardNav, } = this;
2548
+ const selectAllButtonText = `${(value === null || value === void 0 ? void 0 : value.length) === this.ungroupedOptions.length ? "Clear" : "Select"} all`;
2549
+ const hasNoResults = this.el.classList.contains("no-results");
2550
+ return (h(Host, { class: {
2551
+ "full-width": fullWidth,
2552
+ "no-focus": (inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) === "INPUT" ||
2553
+ hasTimedOut ||
2554
+ isLoading ||
2555
+ hasNoResults,
2556
+ small: small,
2557
+ [size]: true,
2558
+ open: open && options.length !== 0,
2559
+ multiple: this.isMultiSelect,
2560
+ } }, options.length !== 0 && (h("ul", { id: menuId, class: "menu", role: "listbox", "aria-label": `${inputLabel} pop-up`, "aria-multiselectable": this.isMultiSelect ? "true" : "false", tabindex: open && !keyboardNav && (inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) !== "INPUT" ? "0" : "-1", ref: (el) => (this.menu = el), onKeyDown: this.handleMenuKeyDown, onKeyUp: this.handleMenuKeyUp, onBlur: this.handleBlur }, this.getSortedOptions(options).map((option, index) => {
2561
+ if (option.children) {
2562
+ if (option.children.length > 0) {
2563
+ return (h("div", null, h("ic-typography", { class: "option-group-title", role: "presentation", variant: "subtitle-small" }, h("p", null, option[this.labelField])), option.children.map((childOption) => childOption.label &&
2564
+ this.displayOption(childOption, this.isMultiSelect
2565
+ ? value === null || value === void 0 ? void 0 : value.includes(childOption[this.valueField])
2566
+ : childOption[this.valueField] === value, index, option))));
2567
+ }
2568
+ else {
2569
+ return null;
2570
+ }
2571
+ }
2572
+ else {
2573
+ // Display option only if it has a label (rather than displaying an empty space)
2574
+ return (option.label &&
2575
+ this.displayOption(option, this.isMultiSelect
2576
+ ? value === null || value === void 0 ? void 0 : value.includes(option[this.valueField])
2577
+ : option[this.valueField] === value, index));
2578
+ }
2579
+ }))), options.length !== 0 &&
2580
+ this.isMultiSelect &&
2581
+ !isLoading &&
2582
+ !hasTimedOut &&
2583
+ !hasNoResults && (h("div", { class: "option-bar" }, h("ic-typography", null, h("p", null, `${value ? value.length : 0}/${getOptionsWithoutGroupTitlesCount(this.options)} selected`)), h("ic-button", { class: "select-all-button", "aria-label": `${selectAllButtonText} options for ${inputLabel}`, ref: (el) => (this.selectAllButton = el), variant: "tertiary", onClick: this.handleSelectAllClick, onMouseDown: this.handleSelectAllMouseDown, onBlur: this.handleSelectAllBlur, onFocus: this.handleSelectAllFocus, size: size === "small" ? "small" : "default" }, selectAllButtonText)))));
2584
+ }
2585
+ get el() { return getElement(this); }
2586
+ static get watchers() { return {
2587
+ "open": ["watchOpenHandler"],
2588
+ "options": ["watchOptionsHandler"]
2589
+ }; }
2590
+ };
2591
+ Menu.style = icMenuCss;
2592
+
2593
+ export { Menu as ic_menu_with_multi };
2594
+
2595
+ //# sourceMappingURL=ic-menu-with-multi.entry.js.map