@onereach/ui-components 4.2.0-beta.2548.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (458) hide show
  1. package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.js +145 -0
  2. package/dist/bundled/v2/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +91 -0
  3. package/dist/bundled/v2/components/OrCheckboxGroupV3/index.d.ts +1 -0
  4. package/dist/bundled/v2/components/OrCheckboxGroupV3/index.js +31 -0
  5. package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.js +226 -0
  6. package/dist/bundled/v2/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +91 -0
  7. package/dist/bundled/v2/components/OrCheckboxTreeV3/index.d.ts +2 -0
  8. package/dist/bundled/v2/components/OrCheckboxTreeV3/index.js +23 -0
  9. package/dist/bundled/v2/components/OrCheckboxTreeV3/styles.d.ts +2 -0
  10. package/dist/bundled/v2/components/OrCheckboxTreeV3/styles.js +10 -0
  11. package/dist/bundled/v2/components/OrCheckboxTreeV3/types.d.ts +8 -0
  12. package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.js +37 -39
  13. package/dist/bundled/v2/components/OrCheckboxV3/OrCheckbox.vue.d.ts +18 -16
  14. package/dist/bundled/v2/components/OrCheckboxV3/index.js +1 -0
  15. package/dist/bundled/v2/components/OrCode/OrCode.js +3727 -6
  16. package/dist/bundled/v2/components/OrCode/index.js +2 -6
  17. package/dist/bundled/v2/components/OrCode/lang.js +3 -3897
  18. package/dist/bundled/v2/components/OrCode/theme.js +1 -2
  19. package/dist/bundled/v2/components/OrConfirm/OrConfirm.js +0 -1
  20. package/dist/bundled/v2/components/OrConfirm/index.js +0 -1
  21. package/dist/bundled/v2/components/OrFormGroupV3/OrFormGroup.js +127 -0
  22. package/dist/bundled/v2/components/OrFormGroupV3/OrFormGroup.vue.d.ts +87 -0
  23. package/dist/bundled/v2/components/OrFormGroupV3/index.d.ts +2 -0
  24. package/dist/bundled/v2/components/OrFormGroupV3/index.js +12 -0
  25. package/dist/bundled/v2/components/OrFormGroupV3/props.d.ts +4 -0
  26. package/dist/bundled/v2/components/OrFormGroupV3/props.js +7 -0
  27. package/dist/bundled/v2/components/OrFormGroupV3/styles.d.ts +5 -0
  28. package/dist/bundled/v2/components/OrFormGroupV3/styles.js +17 -0
  29. package/dist/bundled/v2/components/OrModal/OrModal.js +1266 -3
  30. package/dist/bundled/v2/components/OrModal/index.js +0 -1
  31. package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.js +132 -0
  32. package/dist/bundled/v2/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +110 -0
  33. package/dist/bundled/v2/components/OrRadioGroupV3/index.d.ts +1 -0
  34. package/dist/bundled/v2/components/OrRadioGroupV3/index.js +19 -0
  35. package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +1 -1
  36. package/dist/bundled/v2/components/OrSelectV3/index.js +1 -1
  37. package/dist/bundled/v2/components/OrTooltipContent/OrTooltipContent.js +2 -2
  38. package/dist/bundled/v2/components/index.d.ts +0 -1
  39. package/dist/bundled/v2/components/index.js +2 -15
  40. package/dist/bundled/v2/{index-f5487f12.js → index-6976c52a.js} +115 -3
  41. package/dist/bundled/v2/index.d.ts +1 -0
  42. package/dist/bundled/v2/index.js +8 -20
  43. package/dist/bundled/v2/{index-70ca38c5.js → lang-02d2bb2d.js} +3965 -73
  44. package/dist/bundled/v2/utils/functions/flattenDeep.d.ts +2 -0
  45. package/dist/bundled/v2/utils/functions/flattenDeep.js +5 -0
  46. package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-29e8ad0e.js → OrAvatar.vue_vue_type_script_lang-6511e348.js} +1 -1
  47. package/dist/bundled/v3/{OrButton.vue_vue_type_script_lang-a4a16fe5.js → OrButton.vue_vue_type_script_lang-da7f7ed0.js} +1 -1
  48. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-c1d83552.js → OrCardCollection.vue_vue_type_script_lang-7a2e1332.js} +3 -3
  49. package/dist/bundled/v3/{OrCarousel.vue_vue_type_script_lang-0e87c56b.js → OrCarousel.vue_vue_type_script_lang-6976844a.js} +1 -1
  50. package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-6ff51af9.js → OrCheckbox.vue_vue_type_script_lang-11b16d93.js} +1 -1
  51. package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-60cefcbd.js → OrCheckbox.vue_vue_type_script_lang-b274a5ee.js} +27 -11
  52. package/dist/bundled/v3/OrCheckboxTree.vue_vue_type_script_lang-f9807b75.js +115 -0
  53. package/dist/bundled/v3/{OrChip.vue_vue_type_script_lang-ceebbd82.js → OrChip.vue_vue_type_script_lang-5a390853.js} +1 -1
  54. package/dist/bundled/v3/{OrChips.vue_vue_type_script_lang-94b456c7.js → OrChips.vue_vue_type_script_lang-d4bb44eb.js} +1 -1
  55. package/dist/bundled/{v2/index-16aee5bc.js → v3/OrCode.vue_vue_type_script_lang-5397df6a.js} +234 -14
  56. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-36318ca2.js → OrConfirm.vue_vue_type_script_lang-89febea7.js} +2 -2
  57. package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-5c1a5d4a.js → OrDateTimePicker.vue_vue_type_script_lang-8ff54abd.js} +1 -1
  58. package/dist/bundled/v3/OrFormGroup.vue_vue_type_script_lang-1c6844d6.js +63 -0
  59. package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-5d204461.js → OrIconButton.vue_vue_type_script_lang-96cb5b59.js} +2 -2
  60. package/dist/bundled/v3/{OrInlineTextEdit.vue_vue_type_script_lang-424e2c26.js → OrInlineTextEdit.vue_vue_type_script_lang-45987769.js} +1 -1
  61. package/dist/bundled/v3/{OrList.vue_vue_type_script_lang-c65271b9.js → OrList.vue_vue_type_script_lang-2c7537cc.js} +3 -3
  62. package/dist/bundled/v3/{OrListOfInputs.vue_vue_type_script_lang-d3dce7b8.js → OrListOfInputs.vue_vue_type_script_lang-009f62a5.js} +3 -3
  63. package/dist/bundled/v3/{useFocusTrap-9567b3c8.js → OrModal.vue_vue_type_script_lang-c53617ae.js} +105 -3
  64. package/dist/bundled/v3/{OrNotification.vue_vue_type_script_lang-ef4f2661.js → OrNotification.vue_vue_type_script_lang-efb05bb2.js} +2 -2
  65. package/dist/bundled/v3/{OrOverflowMenu.vue_vue_type_script_lang-0c461991.js → OrOverflowMenu.vue_vue_type_script_lang-ba50133f.js} +2 -2
  66. package/dist/bundled/v3/{OrPassword.vue_vue_type_script_lang-3d308fef.js → OrPassword.vue_vue_type_script_lang-37f52611.js} +1 -1
  67. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-86f4f5c7.js → OrSearch.vue_vue_type_script_lang-bcb935c3.js} +1 -1
  68. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-f7601423.js → OrSelect.vue_vue_type_script_lang-098ea3ab.js} +1 -1
  69. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-d2fecd97.js → OrSelect.vue_vue_type_script_lang-c82d8f58.js} +3 -3
  70. package/dist/bundled/v3/{OrSlider.vue_vue_type_script_lang-900036a2.js → OrSlider.vue_vue_type_script_lang-45ecddbe.js} +1 -1
  71. package/dist/bundled/v3/{OrStepper.vue_vue_type_script_lang-2821c496.js → OrStepper.vue_vue_type_script_lang-975a4df6.js} +1 -1
  72. package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-f06b54a2.js → OrTag.vue_vue_type_script_lang-621e9307.js} +1 -1
  73. package/dist/bundled/v3/{OrTextbox.vue_vue_type_script_lang-b8d5341b.js → OrTextbox.vue_vue_type_script_lang-812f302d.js} +1 -1
  74. package/dist/bundled/v3/components/OrAvatar/OrAvatar.js +3 -3
  75. package/dist/bundled/v3/components/OrAvatar/index.js +2 -2
  76. package/dist/bundled/v3/components/OrButtonV2/OrButton.js +3 -3
  77. package/dist/bundled/v3/components/OrButtonV2/index.js +4 -4
  78. package/dist/bundled/v3/components/OrCardCollection/OrCardCollection.js +6 -6
  79. package/dist/bundled/v3/components/OrCardCollection/index.js +5 -5
  80. package/dist/bundled/v3/components/OrCarousel/OrCarousel.js +3 -3
  81. package/dist/bundled/v3/components/OrCarousel/index.js +2 -2
  82. package/dist/bundled/v3/components/OrCheckbox/OrCheckbox.js +3 -3
  83. package/dist/bundled/v3/components/OrCheckbox/index.js +2 -2
  84. package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.js +121 -0
  85. package/dist/bundled/v3/components/OrCheckboxGroupV3/OrCheckboxGroup.vue.d.ts +91 -0
  86. package/dist/bundled/v3/components/OrCheckboxGroupV3/index.d.ts +1 -0
  87. package/dist/bundled/v3/components/OrCheckboxGroupV3/index.js +40 -0
  88. package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.js +90 -0
  89. package/dist/bundled/v3/components/OrCheckboxTreeV3/OrCheckboxTree.vue.d.ts +91 -0
  90. package/dist/bundled/v3/components/OrCheckboxTreeV3/index.d.ts +2 -0
  91. package/dist/bundled/v3/components/OrCheckboxTreeV3/index.js +28 -0
  92. package/dist/bundled/v3/components/OrCheckboxTreeV3/styles.d.ts +2 -0
  93. package/dist/bundled/v3/components/OrCheckboxTreeV3/styles.js +10 -0
  94. package/dist/bundled/v3/components/OrCheckboxTreeV3/types.d.ts +8 -0
  95. package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.js +12 -9
  96. package/dist/bundled/v3/components/OrCheckboxV3/OrCheckbox.vue.d.ts +18 -16
  97. package/dist/bundled/v3/components/OrCheckboxV3/index.js +2 -1
  98. package/dist/bundled/v3/components/OrChip/OrChip.js +3 -3
  99. package/dist/bundled/v3/components/OrChip/index.js +2 -2
  100. package/dist/bundled/v3/components/OrChips/OrChips.js +4 -4
  101. package/dist/bundled/v3/components/OrChips/index.js +3 -3
  102. package/dist/bundled/v3/components/OrCode/OrCode.js +9 -13
  103. package/dist/bundled/v3/components/OrCode/index.js +7 -11
  104. package/dist/bundled/v3/components/OrCode/lang.js +3 -3897
  105. package/dist/bundled/v3/components/OrCode/theme.js +1 -2
  106. package/dist/bundled/v3/components/OrConfirm/OrConfirm.js +7 -8
  107. package/dist/bundled/v3/components/OrConfirm/index.js +6 -7
  108. package/dist/bundled/v3/components/OrDateTimePicker/OrDateTimePicker.js +5 -5
  109. package/dist/bundled/v3/components/OrDateTimePicker/index.js +4 -4
  110. package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.js +59 -0
  111. package/dist/bundled/v3/components/OrFormGroupV3/OrFormGroup.vue.d.ts +87 -0
  112. package/dist/bundled/v3/components/OrFormGroupV3/index.d.ts +2 -0
  113. package/dist/bundled/v3/components/OrFormGroupV3/index.js +15 -0
  114. package/dist/bundled/v3/components/OrFormGroupV3/props.d.ts +4 -0
  115. package/dist/bundled/v3/components/OrFormGroupV3/props.js +7 -0
  116. package/dist/bundled/v3/components/OrFormGroupV3/styles.d.ts +5 -0
  117. package/dist/bundled/v3/components/OrFormGroupV3/styles.js +17 -0
  118. package/dist/bundled/v3/components/OrIcon/OrIcon.js +2 -2
  119. package/dist/bundled/v3/components/OrIcon/index.js +1 -1
  120. package/dist/bundled/v3/components/OrIconButtonV2/OrIconButton.js +4 -4
  121. package/dist/bundled/v3/components/OrIconButtonV2/index.js +3 -3
  122. package/dist/bundled/v3/components/OrInlineTextEdit/OrInlineTextEdit.js +5 -5
  123. package/dist/bundled/v3/components/OrInlineTextEdit/index.js +4 -4
  124. package/dist/bundled/v3/components/OrList/OrList.js +6 -6
  125. package/dist/bundled/v3/components/OrList/index.js +5 -5
  126. package/dist/bundled/v3/components/OrListOfInputs/OrListOfInputs.js +7 -7
  127. package/dist/bundled/v3/components/OrListOfInputs/index.js +6 -6
  128. package/dist/bundled/v3/components/OrModal/OrModal.js +5 -6
  129. package/dist/bundled/v3/components/OrModal/index.js +4 -5
  130. package/dist/bundled/v3/components/OrNotification/OrNotification.js +5 -5
  131. package/dist/bundled/v3/components/OrNotification/index.js +4 -4
  132. package/dist/bundled/v3/components/OrOverflowMenu/OrOverflowMenu.js +6 -6
  133. package/dist/bundled/v3/components/OrOverflowMenu/index.js +5 -5
  134. package/dist/bundled/v3/components/OrPassword/OrPassword.js +5 -5
  135. package/dist/bundled/v3/components/OrPassword/index.js +4 -4
  136. package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.js +104 -0
  137. package/dist/bundled/v3/components/OrRadioGroupV3/OrRadioGroup.vue.d.ts +110 -0
  138. package/dist/bundled/v3/components/OrRadioGroupV3/index.d.ts +1 -0
  139. package/dist/bundled/v3/components/OrRadioGroupV3/index.js +24 -0
  140. package/dist/bundled/v3/components/OrSearch/OrSearch.js +5 -5
  141. package/dist/bundled/v3/components/OrSearch/index.js +4 -4
  142. package/dist/bundled/v3/components/OrSelect/OrSelect.js +5 -5
  143. package/dist/bundled/v3/components/OrSelect/index.js +4 -4
  144. package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +4 -4
  145. package/dist/bundled/v3/components/OrSelectV3/index.js +3 -3
  146. package/dist/bundled/v3/components/OrSlider/OrSlider.js +3 -3
  147. package/dist/bundled/v3/components/OrSlider/index.js +2 -2
  148. package/dist/bundled/v3/components/OrStepper/OrStepper.js +4 -4
  149. package/dist/bundled/v3/components/OrStepper/index.js +3 -3
  150. package/dist/bundled/v3/components/OrTag/OrTag.js +3 -3
  151. package/dist/bundled/v3/components/OrTag/index.js +2 -2
  152. package/dist/bundled/v3/components/OrTextbox/OrTextbox.js +5 -5
  153. package/dist/bundled/v3/components/OrTextbox/index.js +4 -4
  154. package/dist/bundled/v3/components/OrToast/OrToast.js +3 -3
  155. package/dist/bundled/v3/components/OrToast/index.js +4 -4
  156. package/dist/bundled/v3/components/OrToastContainer/OrToastContainer.js +5 -5
  157. package/dist/bundled/v3/components/OrToastContainer/index.js +4 -4
  158. package/dist/bundled/v3/components/OrTooltip/OrTooltip.js +2 -2
  159. package/dist/bundled/v3/components/OrTooltip/index.js +1 -1
  160. package/dist/bundled/v3/components/OrTooltipContent/OrTooltipContent.js +1 -1
  161. package/dist/bundled/v3/components/index.d.ts +0 -1
  162. package/dist/bundled/v3/components/index.js +31 -45
  163. package/dist/bundled/v3/{index-f5487f12.js → index-6976c52a.js} +115 -3
  164. package/dist/bundled/v3/index.d.ts +1 -0
  165. package/dist/bundled/v3/index.js +39 -53
  166. package/dist/bundled/v3/{index-70ca38c5.js → lang-02d2bb2d.js} +3965 -73
  167. package/dist/bundled/v3/utils/functions/flattenDeep.d.ts +2 -0
  168. package/dist/bundled/v3/utils/functions/flattenDeep.js +5 -0
  169. package/dist/esm/v2/{OrAvatar-da5cba16.js → OrAvatar-7c024521.js} +1 -1
  170. package/dist/esm/v2/{OrButton-bdddd8d4.js → OrButton-4e532ddb.js} +1 -1
  171. package/dist/esm/v2/{OrButton.vue_rollup-plugin-vue_styles.0-3dbd90b4.js → OrButton.vue_rollup-plugin-vue_styles.0-48c5883e.js} +2 -2
  172. package/dist/esm/v2/{OrCardCollection-4e014d25.js → OrCardCollection-9bf513b7.js} +5 -5
  173. package/dist/esm/v2/{OrCarousel-3c809a13.js → OrCarousel-e0c2e387.js} +1 -1
  174. package/dist/esm/v2/{OrCheckbox-dc587ec9.js → OrCheckbox-39c94019.js} +37 -40
  175. package/dist/esm/v2/{OrCheckbox-bf34eb0f.js → OrCheckbox-7b98fc08.js} +1 -1
  176. package/dist/esm/v2/OrCheckboxTree-7b81e76c.js +220 -0
  177. package/dist/esm/v2/{OrChip-416e848e.js → OrChip-8a1abfc5.js} +1 -1
  178. package/dist/esm/v2/{OrChips-77e789e9.js → OrChips-a01d8520.js} +1 -1
  179. package/dist/esm/v2/{OrChips.vue_rollup-plugin-vue_styles.0-e05c5ca8.js → OrChips.vue_rollup-plugin-vue_styles.0-3cbb0871.js} +1 -1
  180. package/dist/esm/v2/{OrCode-dcb0132a.js → OrCode-e54e09f7.js} +4 -4
  181. package/dist/esm/v2/{OrConfirm-497cd260.js → OrConfirm-5d5dd9bc.js} +3 -3
  182. package/dist/esm/v2/{OrDateTimePicker-c88ca716.js → OrDateTimePicker-6e2853ec.js} +3 -3
  183. package/dist/esm/v2/OrFormGroup-29a514db.js +141 -0
  184. package/dist/esm/v2/{OrIcon-8a6d663a.js → OrIcon-a40e60af.js} +2 -2
  185. package/dist/esm/v2/{OrIconButton-97bfd51d.js → OrIconButton-23972f7d.js} +1 -1
  186. package/dist/esm/v2/{OrIconButton.vue_rollup-plugin-vue_styles.0-e3806cef.js → OrIconButton.vue_rollup-plugin-vue_styles.0-277ce06c.js} +3 -3
  187. package/dist/esm/v2/{OrInlineTextEdit-e8414fb6.js → OrInlineTextEdit-9541b625.js} +3 -3
  188. package/dist/esm/v2/{OrList-a46d6306.js → OrList-61c7b8ea.js} +4 -4
  189. package/dist/esm/v2/{OrListOfInputs-33a7bf87.js → OrListOfInputs-e1b09290.js} +5 -5
  190. package/dist/esm/v2/{OrModal-6d84829c.js → OrModal-b9cfb8ec.js} +3 -3
  191. package/dist/esm/v2/{OrNotification-7945568d.js → OrNotification-fdb88eec.js} +4 -4
  192. package/dist/esm/v2/{OrOverflowMenu-5ce7171b.js → OrOverflowMenu-83540c76.js} +4 -4
  193. package/dist/esm/v2/{OrPassword-3597153d.js → OrPassword-022e10fd.js} +3 -3
  194. package/dist/esm/v2/{OrSearch-49ceaac4.js → OrSearch-620d5d76.js} +3 -3
  195. package/dist/esm/v2/{OrSelect-40183874.js → OrSelect-1865c781.js} +1 -1
  196. package/dist/esm/v2/{OrSelect-eb5cc918.js → OrSelect-d887118b.js} +4 -4
  197. package/dist/esm/v2/{OrSlider-32a14ca4.js → OrSlider-c0a7f9cf.js} +1 -1
  198. package/dist/esm/v2/{OrStepper-462bc9e6.js → OrStepper-b00f7531.js} +2 -2
  199. package/dist/esm/v2/{OrTag-a1fff567.js → OrTag-6349049b.js} +1 -1
  200. package/dist/esm/v2/{OrTextbox-0a89a533.js → OrTextbox-0373bd6a.js} +3 -3
  201. package/dist/esm/v2/{OrToastContainer-5ce15a5b.js → OrToastContainer-1625b803.js} +3 -3
  202. package/dist/esm/v2/{OrTooltip-cfb56e8f.js → OrTooltip-97a42707.js} +1 -1
  203. package/dist/esm/v2/{OrTooltip.vue_rollup-plugin-vue_styles.0-122f7804.js → OrTooltip.vue_rollup-plugin-vue_styles.0-a256ac18.js} +1 -1
  204. package/dist/esm/v2/{OrTooltipContent-c9540548.js → OrTooltipContent-d85e1071.js} +2 -2
  205. package/dist/esm/v2/components/index.d.ts +0 -1
  206. package/dist/esm/v2/components/index.js +34 -58
  207. package/dist/esm/v2/components/or-avatar/index.js +4 -4
  208. package/dist/esm/v2/components/or-button-v2/index.js +8 -8
  209. package/dist/esm/v2/components/or-card-collection/index.js +9 -9
  210. package/dist/esm/v2/components/or-carousel/index.js +4 -4
  211. package/dist/esm/v2/components/or-checkbox/index.js +4 -4
  212. package/dist/esm/v2/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +91 -0
  213. package/dist/esm/v2/components/or-checkbox-group-v3/index.d.ts +1 -0
  214. package/dist/esm/v2/components/or-checkbox-group-v3/index.js +130 -0
  215. package/dist/esm/v2/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +91 -0
  216. package/dist/esm/v2/components/or-checkbox-tree-v3/index.d.ts +2 -0
  217. package/dist/esm/v2/components/or-checkbox-tree-v3/index.js +12 -0
  218. package/dist/esm/v2/components/or-checkbox-tree-v3/styles.d.ts +2 -0
  219. package/dist/esm/v2/components/or-checkbox-tree-v3/types.d.ts +8 -0
  220. package/dist/esm/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -16
  221. package/dist/esm/v2/components/or-checkbox-v3/index.js +2 -2
  222. package/dist/esm/v2/components/or-chips/index.js +6 -6
  223. package/dist/esm/v2/components/or-chips/or-chip/index.js +4 -4
  224. package/dist/esm/v2/components/or-code/index.js +9 -9
  225. package/dist/esm/v2/components/or-confirm/index.js +10 -10
  226. package/dist/esm/v2/components/or-date-time-picker/index.js +8 -8
  227. package/dist/esm/v2/components/or-form-group-v3/OrFormGroup.vue.d.ts +87 -0
  228. package/dist/esm/v2/components/or-form-group-v3/index.d.ts +2 -0
  229. package/dist/esm/v2/components/or-form-group-v3/index.js +6 -0
  230. package/dist/esm/v2/components/or-form-group-v3/props.d.ts +4 -0
  231. package/dist/esm/v2/components/or-form-group-v3/styles.d.ts +5 -0
  232. package/dist/esm/v2/components/or-icon/index.js +3 -3
  233. package/dist/esm/v2/components/or-icon-button-v2/index.js +6 -6
  234. package/dist/esm/v2/components/or-inline-text-edit/index.js +8 -8
  235. package/dist/esm/v2/components/or-list/index.js +9 -9
  236. package/dist/esm/v2/components/or-list-of-inputs/index.js +10 -10
  237. package/dist/esm/v2/components/or-modal/index.js +8 -8
  238. package/dist/esm/v2/components/or-notification/index.js +8 -8
  239. package/dist/esm/v2/components/or-overflow-menu/index.js +9 -9
  240. package/dist/esm/v2/components/or-password/index.js +8 -8
  241. package/dist/esm/v2/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +110 -0
  242. package/dist/esm/v2/components/or-radio-group-v3/index.d.ts +1 -0
  243. package/dist/esm/v2/components/or-radio-group-v3/index.js +124 -0
  244. package/dist/esm/v2/components/or-search/index.js +8 -8
  245. package/dist/esm/v2/components/or-select/index.js +7 -7
  246. package/dist/esm/v2/components/or-select-v3/index.js +2 -2
  247. package/dist/esm/v2/components/or-slider/index.js +4 -4
  248. package/dist/esm/v2/components/or-stepper/index.js +8 -8
  249. package/dist/esm/v2/components/or-tag/index.js +4 -4
  250. package/dist/esm/v2/components/or-textbox/index.js +8 -8
  251. package/dist/esm/v2/components/or-toast/index.js +8 -8
  252. package/dist/esm/v2/components/or-toast/or-toast-container/index.js +8 -8
  253. package/dist/esm/v2/components/or-tooltip/index.js +3 -3
  254. package/dist/esm/v2/components/or-tooltip/or-tooltip-content/index.js +1 -1
  255. package/dist/esm/v2/flattenDeep-e7a8b995.js +5 -0
  256. package/dist/esm/v2/index.d.ts +1 -0
  257. package/dist/esm/v2/index.js +35 -58
  258. package/dist/esm/v2/utils/functions/flattenDeep.d.ts +2 -0
  259. package/dist/esm/v3/{OrAvatar-b18f2208.js → OrAvatar-14a5c5f0.js} +1 -1
  260. package/dist/esm/v3/{OrButton-170b493f.js → OrButton-f8b10d79.js} +2 -2
  261. package/dist/esm/v3/{OrCardCollection-dc158967.js → OrCardCollection-ffbb9eda.js} +4 -4
  262. package/dist/esm/v3/{OrCarousel-8de5d65b.js → OrCarousel-03597740.js} +1 -1
  263. package/dist/esm/v3/{OrCheckbox-56f849f7.js → OrCheckbox-488b6915.js} +36 -19
  264. package/dist/esm/v3/{OrCheckbox-c2d9cf53.js → OrCheckbox-7efd5f26.js} +1 -1
  265. package/dist/esm/v3/OrCheckboxTree-87d0528b.js +182 -0
  266. package/dist/esm/v3/{OrChip-ccd4b331.js → OrChip-97a85e10.js} +1 -1
  267. package/dist/esm/v3/{OrChips-9a19aa03.js → OrChips-64b86761.js} +1 -1
  268. package/dist/esm/v3/{OrCode-b0b514ab.js → OrCode-6f2e4d99.js} +3 -3
  269. package/dist/esm/v3/{OrConfirm-1ffb7ed6.js → OrConfirm-ab04201f.js} +3 -3
  270. package/dist/esm/v3/{OrDateTimePicker-02c6de49.js → OrDateTimePicker-014f7819.js} +2 -2
  271. package/dist/esm/v3/OrFormGroup-9f581536.js +122 -0
  272. package/dist/esm/v3/{OrIcon-9b3d24cc.js → OrIcon-925c5413.js} +2 -2
  273. package/dist/esm/v3/{OrIconButton-9d08aa44.js → OrIconButton-5387fd59.js} +3 -3
  274. package/dist/esm/v3/{OrInlineTextEdit-8cfde85c.js → OrInlineTextEdit-6f97629f.js} +2 -2
  275. package/dist/esm/v3/{OrList-d3e330be.js → OrList-b8799cf4.js} +3 -3
  276. package/dist/esm/v3/{OrListOfInputs-3c8eaf97.js → OrListOfInputs-16ba8358.js} +4 -4
  277. package/dist/esm/v3/{OrModal-f8ae7146.js → OrModal-e6513e8c.js} +2 -2
  278. package/dist/esm/v3/{OrNotification-24192897.js → OrNotification-4c56f7ea.js} +3 -3
  279. package/dist/esm/v3/{OrOverflowMenu-a7568f8d.js → OrOverflowMenu-fe77e22c.js} +2 -2
  280. package/dist/esm/v3/{OrPassword-88a67993.js → OrPassword-9c8a458d.js} +2 -2
  281. package/dist/esm/v3/{OrSearch-fb2dd591.js → OrSearch-c4caf04e.js} +2 -2
  282. package/dist/esm/v3/{OrSelect-5502d82d.js → OrSelect-35b41c3f.js} +1 -1
  283. package/dist/esm/v3/{OrSelect-3d923250.js → OrSelect-d8a78242.js} +4 -4
  284. package/dist/esm/v3/{OrSlider-ae7b8a11.js → OrSlider-80e0f2e6.js} +1 -1
  285. package/dist/esm/v3/{OrStepper-446007c5.js → OrStepper-3a586401.js} +2 -2
  286. package/dist/esm/v3/{OrTag-38d1ba92.js → OrTag-e7adb078.js} +1 -1
  287. package/dist/esm/v3/{OrTextbox-7de2b10c.js → OrTextbox-f7388a30.js} +2 -2
  288. package/dist/esm/v3/{OrToastContainer-c3ecb1c8.js → OrToastContainer-94ba2803.js} +2 -2
  289. package/dist/esm/v3/{OrTooltip-be7209e5.js → OrTooltip-618ce7c9.js} +1 -1
  290. package/dist/esm/v3/{OrTooltipContent-68c34911.js → OrTooltipContent-37a5f562.js} +1 -1
  291. package/dist/esm/v3/components/index.d.ts +0 -1
  292. package/dist/esm/v3/components/index.js +30 -54
  293. package/dist/esm/v3/components/or-avatar/index.js +4 -4
  294. package/dist/esm/v3/components/or-button-v2/index.js +5 -5
  295. package/dist/esm/v3/components/or-card-collection/index.js +7 -7
  296. package/dist/esm/v3/components/or-carousel/index.js +4 -4
  297. package/dist/esm/v3/components/or-checkbox/index.js +4 -4
  298. package/dist/esm/v3/components/or-checkbox-group-v3/OrCheckboxGroup.vue.d.ts +91 -0
  299. package/dist/esm/v3/components/or-checkbox-group-v3/index.d.ts +1 -0
  300. package/dist/esm/v3/components/or-checkbox-group-v3/index.js +97 -0
  301. package/dist/esm/v3/components/or-checkbox-tree-v3/OrCheckboxTree.vue.d.ts +91 -0
  302. package/dist/esm/v3/components/or-checkbox-tree-v3/index.d.ts +2 -0
  303. package/dist/esm/v3/components/or-checkbox-tree-v3/index.js +12 -0
  304. package/dist/esm/v3/components/or-checkbox-tree-v3/styles.d.ts +2 -0
  305. package/dist/esm/v3/components/or-checkbox-tree-v3/types.d.ts +8 -0
  306. package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -16
  307. package/dist/esm/v3/components/or-checkbox-v3/index.js +2 -2
  308. package/dist/esm/v3/components/or-chips/index.js +5 -5
  309. package/dist/esm/v3/components/or-chips/or-chip/index.js +4 -4
  310. package/dist/esm/v3/components/or-code/index.js +7 -7
  311. package/dist/esm/v3/components/or-confirm/index.js +7 -7
  312. package/dist/esm/v3/components/or-date-time-picker/index.js +6 -6
  313. package/dist/esm/v3/components/or-form-group-v3/OrFormGroup.vue.d.ts +87 -0
  314. package/dist/esm/v3/components/or-form-group-v3/index.d.ts +2 -0
  315. package/dist/esm/v3/components/or-form-group-v3/index.js +6 -0
  316. package/dist/esm/v3/components/or-form-group-v3/props.d.ts +4 -0
  317. package/dist/esm/v3/components/or-form-group-v3/styles.d.ts +5 -0
  318. package/dist/esm/v3/components/or-icon/index.js +3 -3
  319. package/dist/esm/v3/components/or-icon-button-v2/index.js +4 -4
  320. package/dist/esm/v3/components/or-inline-text-edit/index.js +6 -6
  321. package/dist/esm/v3/components/or-list/index.js +6 -6
  322. package/dist/esm/v3/components/or-list-of-inputs/index.js +7 -7
  323. package/dist/esm/v3/components/or-modal/index.js +6 -6
  324. package/dist/esm/v3/components/or-notification/index.js +6 -6
  325. package/dist/esm/v3/components/or-overflow-menu/index.js +6 -6
  326. package/dist/esm/v3/components/or-password/index.js +6 -6
  327. package/dist/esm/v3/components/or-radio-group-v3/OrRadioGroup.vue.d.ts +110 -0
  328. package/dist/esm/v3/components/or-radio-group-v3/index.d.ts +1 -0
  329. package/dist/esm/v3/components/or-radio-group-v3/index.js +91 -0
  330. package/dist/esm/v3/components/or-search/index.js +6 -6
  331. package/dist/esm/v3/components/or-select/index.js +7 -7
  332. package/dist/esm/v3/components/or-select-v3/index.js +2 -2
  333. package/dist/esm/v3/components/or-slider/index.js +4 -4
  334. package/dist/esm/v3/components/or-stepper/index.js +6 -6
  335. package/dist/esm/v3/components/or-tag/index.js +4 -4
  336. package/dist/esm/v3/components/or-textbox/index.js +6 -6
  337. package/dist/esm/v3/components/or-toast/index.js +6 -6
  338. package/dist/esm/v3/components/or-toast/or-toast-container/index.js +6 -6
  339. package/dist/esm/v3/components/or-tooltip/index.js +2 -2
  340. package/dist/esm/v3/components/or-tooltip/or-tooltip-content/index.js +1 -1
  341. package/dist/esm/v3/flattenDeep-e7a8b995.js +5 -0
  342. package/dist/esm/v3/index.d.ts +1 -0
  343. package/dist/esm/v3/index.js +31 -54
  344. package/dist/esm/v3/utils/functions/flattenDeep.d.ts +2 -0
  345. package/package.json +5 -25
  346. package/src/components/index.ts +0 -1
  347. package/src/components/or-checkbox-group-v3/OrCheckboxGroup.docs.mdx +7 -0
  348. package/src/components/or-checkbox-group-v3/OrCheckboxGroup.stories3.ts +373 -0
  349. package/src/components/or-checkbox-group-v3/OrCheckboxGroup.vue +80 -0
  350. package/src/components/or-checkbox-group-v3/index.ts +1 -0
  351. package/src/components/or-checkbox-tree-v3/OrCheckboxTree.docs.mdx +7 -0
  352. package/src/components/or-checkbox-tree-v3/OrCheckboxTree.stories3.ts +112 -0
  353. package/src/components/or-checkbox-tree-v3/OrCheckboxTree.vue +192 -0
  354. package/src/components/or-checkbox-tree-v3/index.ts +2 -0
  355. package/src/components/or-checkbox-tree-v3/styles.ts +15 -0
  356. package/src/components/or-checkbox-tree-v3/types.ts +8 -0
  357. package/src/components/or-checkbox-v3/OrCheckbox.vue +33 -13
  358. package/src/components/or-form-group-v3/OrFormGroup.stories3.ts +114 -0
  359. package/src/components/or-form-group-v3/OrFormGroup.vue +116 -0
  360. package/src/components/or-form-group-v3/index.ts +2 -0
  361. package/src/components/or-form-group-v3/props.ts +4 -0
  362. package/src/components/or-form-group-v3/styles.ts +33 -0
  363. package/src/components/or-radio-group-v3/OrRadioGroup.stories3.ts +81 -0
  364. package/src/components/or-radio-group-v3/OrRadioGroup.vue +80 -0
  365. package/src/components/or-radio-group-v3/index.ts +1 -0
  366. package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
  367. package/src/components/or-tooltip/or-tooltip-content/OrTooltipContent.vue +0 -1
  368. package/src/index.ts +1 -0
  369. package/src/utils/functions/flattenDeep.ts +5 -0
  370. package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +0 -1990
  371. package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +0 -170
  372. package/dist/bundled/v2/components/OrRichTextEditorV3/index.d.ts +0 -1
  373. package/dist/bundled/v2/components/OrRichTextEditorV3/index.js +0 -68
  374. package/dist/bundled/v2/components/OrRichTextEditorV3/styles.d.ts +0 -6
  375. package/dist/bundled/v2/components/OrRichTextEditorV3/styles.js +0 -38
  376. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.d.ts +0 -3
  377. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +0 -45
  378. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.d.ts +0 -27
  379. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +0 -184
  380. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/index.d.ts +0 -1
  381. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/index.js +0 -5
  382. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/theme.d.ts +0 -24
  383. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/theme.js +0 -190
  384. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/types.d.ts +0 -19
  385. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.d.ts +0 -3
  386. package/dist/bundled/v2/components/OrRichTextEditorV3/utils/markdown.js +0 -5
  387. package/dist/bundled/v2/index-62c3221b.js +0 -6956
  388. package/dist/bundled/v2/index.es-3f39f316.js +0 -115
  389. package/dist/bundled/v2/markdown-516daba9.js +0 -18737
  390. package/dist/bundled/v2/tiptap-core.esm-f85402b1.js +0 -9360
  391. package/dist/bundled/v2/useFocusTrap-9567b3c8.js +0 -1268
  392. package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-f6f74339.js +0 -236
  393. package/dist/bundled/v3/OrModal.vue_vue_type_script_lang-af0c4288.js +0 -107
  394. package/dist/bundled/v3/OrRichTextEditor.vue_vue_type_script_lang-fec87993.js +0 -1765
  395. package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +0 -228
  396. package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +0 -170
  397. package/dist/bundled/v3/components/OrRichTextEditorV3/index.d.ts +0 -1
  398. package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +0 -84
  399. package/dist/bundled/v3/components/OrRichTextEditorV3/styles.d.ts +0 -6
  400. package/dist/bundled/v3/components/OrRichTextEditorV3/styles.js +0 -38
  401. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.d.ts +0 -3
  402. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +0 -45
  403. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.d.ts +0 -27
  404. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +0 -184
  405. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.d.ts +0 -1
  406. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.js +0 -5
  407. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.d.ts +0 -24
  408. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.js +0 -190
  409. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/types.d.ts +0 -19
  410. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.d.ts +0 -3
  411. package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +0 -5
  412. package/dist/bundled/v3/index-16aee5bc.js +0 -3740
  413. package/dist/bundled/v3/index-62c3221b.js +0 -6956
  414. package/dist/bundled/v3/index.es-3f39f316.js +0 -115
  415. package/dist/bundled/v3/markdown-516daba9.js +0 -18737
  416. package/dist/bundled/v3/tiptap-core.esm-f85402b1.js +0 -9360
  417. package/dist/esm/v2/OrRichTextEditor-e19e74f4.js +0 -724
  418. package/dist/esm/v2/codemirrorView-be2c7423.js +0 -353
  419. package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -170
  420. package/dist/esm/v2/components/or-rich-text-editor-v3/index.d.ts +0 -1
  421. package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +0 -59
  422. package/dist/esm/v2/components/or-rich-text-editor-v3/styles.d.ts +0 -6
  423. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +0 -3
  424. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +0 -27
  425. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +0 -1
  426. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.js +0 -7
  427. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/theme.d.ts +0 -24
  428. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +0 -19
  429. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/markdown.d.ts +0 -3
  430. package/dist/esm/v3/OrRichTextEditor-f5c54d46.js +0 -687
  431. package/dist/esm/v3/codemirrorView-be2c7423.js +0 -353
  432. package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -170
  433. package/dist/esm/v3/components/or-rich-text-editor-v3/index.d.ts +0 -1
  434. package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +0 -57
  435. package/dist/esm/v3/components/or-rich-text-editor-v3/styles.d.ts +0 -6
  436. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +0 -3
  437. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +0 -27
  438. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +0 -1
  439. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.js +0 -7
  440. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/theme.d.ts +0 -24
  441. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +0 -19
  442. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/markdown.d.ts +0 -3
  443. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.docs.mdx +0 -7
  444. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +0 -102
  445. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +0 -624
  446. package/src/components/or-rich-text-editor-v3/index.ts +0 -1
  447. package/src/components/or-rich-text-editor-v3/styles.ts +0 -64
  448. package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.ts +0 -40
  449. package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.ts +0 -254
  450. package/src/components/or-rich-text-editor-v3/utils/codemirror/index.ts +0 -1
  451. package/src/components/or-rich-text-editor-v3/utils/codemirror/theme.ts +0 -213
  452. package/src/components/or-rich-text-editor-v3/utils/codemirror/types.ts +0 -22
  453. package/src/components/or-rich-text-editor-v3/utils/markdown.ts +0 -117
  454. /package/dist/bundled/v2/components/{OrRichTextEditorV3/utils/codemirror → OrCheckboxTreeV3}/types.js +0 -0
  455. /package/dist/bundled/v3/{OrIcon.vue_vue_type_script_lang-e3152dc5.js → OrIcon.vue_vue_type_script_lang-e5349e49.js} +0 -0
  456. /package/dist/bundled/v3/{OrToastContainer.vue_vue_type_script_lang-0811fd48.js → OrToastContainer.vue_vue_type_script_lang-70cc38be.js} +0 -0
  457. /package/dist/bundled/v3/{OrTooltip.vue_vue_type_script_lang-b8594f7e.js → OrTooltip.vue_vue_type_script_lang-76a6b7f4.js} +0 -0
  458. /package/dist/bundled/v3/components/{OrRichTextEditorV3/utils/codemirror → OrCheckboxTreeV3}/types.js +0 -0
@@ -1,8 +1,7 @@
1
- import { defineComponent, ref, watch, onBeforeUnmount } from 'vue-demi';
1
+ import { ref, watch, defineComponent, onBeforeUnmount } from 'vue-demi';
2
2
  import _ from 'lodash';
3
3
  import { OrModalSizes } from './constants.js';
4
- import { onClickOutside } from '@vueuse/core';
5
- import { u as useFocusTrap } from '../../useFocusTrap-9567b3c8.js';
4
+ import { unrefElement, tryOnScopeDispose, onClickOutside } from '@vueuse/core';
6
5
  import __vue_component__$1 from '../OrIconButtonV2/OrIconButton.js';
7
6
  import __vue_component__$2 from '../OrOverlay/OrOverlay.js';
8
7
  import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
@@ -23,6 +22,1270 @@ import '../../utils/functions/px-to-rem.js';
23
22
  import '../OrLoader/OrLoader.js';
24
23
  import '../OrLoader/constants.js';
25
24
 
25
+ /*!
26
+ * tabbable 6.0.1
27
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
28
+ */
29
+ var candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])', 'details>summary:first-of-type', 'details'];
30
+ var candidateSelector = /* #__PURE__ */candidateSelectors.join(',');
31
+ var NoElement = typeof Element === 'undefined';
32
+ var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
33
+ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {
34
+ return element.getRootNode();
35
+ } : function (element) {
36
+ return element.ownerDocument;
37
+ };
38
+
39
+ /**
40
+ * @param {Element} el container to check in
41
+ * @param {boolean} includeContainer add container to check
42
+ * @param {(node: Element) => boolean} filter filter candidates
43
+ * @returns {Element[]}
44
+ */
45
+ var getCandidates = function getCandidates(el, includeContainer, filter) {
46
+ var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
47
+ if (includeContainer && matches.call(el, candidateSelector)) {
48
+ candidates.unshift(el);
49
+ }
50
+ candidates = candidates.filter(filter);
51
+ return candidates;
52
+ };
53
+
54
+ /**
55
+ * @callback GetShadowRoot
56
+ * @param {Element} element to check for shadow root
57
+ * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.
58
+ */
59
+
60
+ /**
61
+ * @callback ShadowRootFilter
62
+ * @param {Element} shadowHostNode the element which contains shadow content
63
+ * @returns {boolean} true if a shadow root could potentially contain valid candidates.
64
+ */
65
+
66
+ /**
67
+ * @typedef {Object} CandidateScope
68
+ * @property {Element} scopeParent contains inner candidates
69
+ * @property {Element[]} candidates list of candidates found in the scope parent
70
+ */
71
+
72
+ /**
73
+ * @typedef {Object} IterativeOptions
74
+ * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;
75
+ * if a function, implies shadow support is enabled and either returns the shadow root of an element
76
+ * or a boolean stating if it has an undisclosed shadow root
77
+ * @property {(node: Element) => boolean} filter filter candidates
78
+ * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list
79
+ * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;
80
+ */
81
+
82
+ /**
83
+ * @param {Element[]} elements list of element containers to match candidates from
84
+ * @param {boolean} includeContainer add container list to check
85
+ * @param {IterativeOptions} options
86
+ * @returns {Array.<Element|CandidateScope>}
87
+ */
88
+ var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
89
+ var candidates = [];
90
+ var elementsToCheck = Array.from(elements);
91
+ while (elementsToCheck.length) {
92
+ var element = elementsToCheck.shift();
93
+ if (element.tagName === 'SLOT') {
94
+ // add shadow dom slot scope (slot itself cannot be focusable)
95
+ var assigned = element.assignedElements();
96
+ var content = assigned.length ? assigned : element.children;
97
+ var nestedCandidates = getCandidatesIteratively(content, true, options);
98
+ if (options.flatten) {
99
+ candidates.push.apply(candidates, nestedCandidates);
100
+ } else {
101
+ candidates.push({
102
+ scopeParent: element,
103
+ candidates: nestedCandidates
104
+ });
105
+ }
106
+ } else {
107
+ // check candidate element
108
+ var validCandidate = matches.call(element, candidateSelector);
109
+ if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
110
+ candidates.push(element);
111
+ }
112
+
113
+ // iterate over shadow content if possible
114
+ var shadowRoot = element.shadowRoot ||
115
+ // check for an undisclosed shadow
116
+ typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);
117
+ var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);
118
+ if (shadowRoot && validShadowRoot) {
119
+ // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
120
+ // shadow exists, so look at light dom children as fallback BUT create a scope for any
121
+ // child candidates found because they're likely slotted elements (elements that are
122
+ // children of the web component element (which has the shadow), in the light dom, but
123
+ // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
124
+ // _after_ we return from this recursive call
125
+ var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
126
+ if (options.flatten) {
127
+ candidates.push.apply(candidates, _nestedCandidates);
128
+ } else {
129
+ candidates.push({
130
+ scopeParent: element,
131
+ candidates: _nestedCandidates
132
+ });
133
+ }
134
+ } else {
135
+ // there's not shadow so just dig into the element's (light dom) children
136
+ // __without__ giving the element special scope treatment
137
+ elementsToCheck.unshift.apply(elementsToCheck, element.children);
138
+ }
139
+ }
140
+ }
141
+ return candidates;
142
+ };
143
+ var getTabindex = function getTabindex(node, isScope) {
144
+ if (node.tabIndex < 0) {
145
+ // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
146
+ // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
147
+ // yet they are still part of the regular tab order; in FF, they get a default
148
+ // `tabIndex` of 0; since Chrome still puts those elements in the regular tab
149
+ // order, consider their tab index to be 0.
150
+ // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
151
+ // so if they don't have a tabindex attribute specifically set, assume it's 0.
152
+ //
153
+ // isScope is positive for custom element with shadow root or slot that by default
154
+ // have tabIndex -1, but need to be sorted by document order in order for their
155
+ // content to be inserted in the correct position
156
+ if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
157
+ return 0;
158
+ }
159
+ }
160
+ return node.tabIndex;
161
+ };
162
+ var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
163
+ return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
164
+ };
165
+ var isInput = function isInput(node) {
166
+ return node.tagName === 'INPUT';
167
+ };
168
+ var isHiddenInput = function isHiddenInput(node) {
169
+ return isInput(node) && node.type === 'hidden';
170
+ };
171
+ var isDetailsWithSummary = function isDetailsWithSummary(node) {
172
+ var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {
173
+ return child.tagName === 'SUMMARY';
174
+ });
175
+ return r;
176
+ };
177
+ var getCheckedRadio = function getCheckedRadio(nodes, form) {
178
+ for (var i = 0; i < nodes.length; i++) {
179
+ if (nodes[i].checked && nodes[i].form === form) {
180
+ return nodes[i];
181
+ }
182
+ }
183
+ };
184
+ var isTabbableRadio = function isTabbableRadio(node) {
185
+ if (!node.name) {
186
+ return true;
187
+ }
188
+ var radioScope = node.form || getRootNode(node);
189
+ var queryRadios = function queryRadios(name) {
190
+ return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
191
+ };
192
+ var radioSet;
193
+ if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {
194
+ radioSet = queryRadios(window.CSS.escape(node.name));
195
+ } else {
196
+ try {
197
+ radioSet = queryRadios(node.name);
198
+ } catch (err) {
199
+ // eslint-disable-next-line no-console
200
+ console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);
201
+ return false;
202
+ }
203
+ }
204
+ var checked = getCheckedRadio(radioSet, node.form);
205
+ return !checked || checked === node;
206
+ };
207
+ var isRadio = function isRadio(node) {
208
+ return isInput(node) && node.type === 'radio';
209
+ };
210
+ var isNonTabbableRadio = function isNonTabbableRadio(node) {
211
+ return isRadio(node) && !isTabbableRadio(node);
212
+ };
213
+
214
+ // determines if a node is ultimately attached to the window's document
215
+ var isNodeAttached = function isNodeAttached(node) {
216
+ var _nodeRootHost;
217
+ // The root node is the shadow root if the node is in a shadow DOM; some document otherwise
218
+ // (but NOT _the_ document; see second 'If' comment below for more).
219
+ // If rootNode is shadow root, it'll have a host, which is the element to which the shadow
220
+ // is attached, and the one we need to check if it's in the document or not (because the
221
+ // shadow, and all nodes it contains, is never considered in the document since shadows
222
+ // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,
223
+ // is hidden, or is not in the document itself but is detached, it will affect the shadow's
224
+ // visibility, including all the nodes it contains). The host could be any normal node,
225
+ // or a custom element (i.e. web component). Either way, that's the one that is considered
226
+ // part of the document, not the shadow root, nor any of its children (i.e. the node being
227
+ // tested).
228
+ // To further complicate things, we have to look all the way up until we find a shadow HOST
229
+ // that is attached (or find none) because the node might be in nested shadows...
230
+ // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the
231
+ // document (per the docs) and while it's a Document-type object, that document does not
232
+ // appear to be the same as the node's `ownerDocument` for some reason, so it's safer
233
+ // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,
234
+ // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when
235
+ // node is actually detached.
236
+ var nodeRootHost = getRootNode(node).host;
237
+ var attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && _nodeRootHost.ownerDocument.contains(nodeRootHost) || node.ownerDocument.contains(node));
238
+ while (!attached && nodeRootHost) {
239
+ var _nodeRootHost2;
240
+ // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,
241
+ // which means we need to get the host's host and check if that parent host is contained
242
+ // in (i.e. attached to) the document
243
+ nodeRootHost = getRootNode(nodeRootHost).host;
244
+ attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && _nodeRootHost2.ownerDocument.contains(nodeRootHost));
245
+ }
246
+ return attached;
247
+ };
248
+ var isZeroArea = function isZeroArea(node) {
249
+ var _node$getBoundingClie = node.getBoundingClientRect(),
250
+ width = _node$getBoundingClie.width,
251
+ height = _node$getBoundingClie.height;
252
+ return width === 0 && height === 0;
253
+ };
254
+ var isHidden = function isHidden(node, _ref) {
255
+ var displayCheck = _ref.displayCheck,
256
+ getShadowRoot = _ref.getShadowRoot;
257
+ // NOTE: visibility will be `undefined` if node is detached from the document
258
+ // (see notes about this further down), which means we will consider it visible
259
+ // (this is legacy behavior from a very long way back)
260
+ // NOTE: we check this regardless of `displayCheck="none"` because this is a
261
+ // _visibility_ check, not a _display_ check
262
+ if (getComputedStyle(node).visibility === 'hidden') {
263
+ return true;
264
+ }
265
+ var isDirectSummary = matches.call(node, 'details>summary:first-of-type');
266
+ var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
267
+ if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {
268
+ return true;
269
+ }
270
+ if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
271
+ if (typeof getShadowRoot === 'function') {
272
+ // figure out if we should consider the node to be in an undisclosed shadow and use the
273
+ // 'non-zero-area' fallback
274
+ var originalNode = node;
275
+ while (node) {
276
+ var parentElement = node.parentElement;
277
+ var rootNode = getRootNode(node);
278
+ if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow
279
+ ) {
280
+ // node has an undisclosed shadow which means we can only treat it as a black box, so we
281
+ // fall back to a non-zero-area test
282
+ return isZeroArea(node);
283
+ } else if (node.assignedSlot) {
284
+ // iterate up slot
285
+ node = node.assignedSlot;
286
+ } else if (!parentElement && rootNode !== node.ownerDocument) {
287
+ // cross shadow boundary
288
+ node = rootNode.host;
289
+ } else {
290
+ // iterate up normal dom
291
+ node = parentElement;
292
+ }
293
+ }
294
+ node = originalNode;
295
+ }
296
+ // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support
297
+ // (i.e. it does not also presume that all nodes might have undisclosed shadows); or
298
+ // it might be a falsy value, which means shadow DOM support is disabled
299
+
300
+ // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)
301
+ // now we can just test to see if it would normally be visible or not, provided it's
302
+ // attached to the main document.
303
+ // NOTE: We must consider case where node is inside a shadow DOM and given directly to
304
+ // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.
305
+
306
+ if (isNodeAttached(node)) {
307
+ // this works wherever the node is: if there's at least one client rect, it's
308
+ // somehow displayed; it also covers the CSS 'display: contents' case where the
309
+ // node itself is hidden in place of its contents; and there's no need to search
310
+ // up the hierarchy either
311
+ return !node.getClientRects().length;
312
+ }
313
+
314
+ // Else, the node isn't attached to the document, which means the `getClientRects()`
315
+ // API will __always__ return zero rects (this can happen, for example, if React
316
+ // is used to render nodes onto a detached tree, as confirmed in this thread:
317
+ // https://github.com/facebook/react/issues/9117#issuecomment-284228870)
318
+ //
319
+ // It also means that even window.getComputedStyle(node).display will return `undefined`
320
+ // because styles are only computed for nodes that are in the document.
321
+ //
322
+ // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable
323
+ // somehow. Though it was never stated officially, anyone who has ever used tabbable
324
+ // APIs on nodes in detached containers has actually implicitly used tabbable in what
325
+ // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck="none"` mode -- essentially
326
+ // considering __everything__ to be visible because of the innability to determine styles.
327
+ //
328
+ // v6.0.0: As of this major release, the default 'full' option __no longer treats detached
329
+ // nodes as visible with the 'none' fallback.__
330
+ if (displayCheck !== 'legacy-full') {
331
+ return true; // hidden
332
+ }
333
+ // else, fallback to 'none' mode and consider the node visible
334
+ } else if (displayCheck === 'non-zero-area') {
335
+ // NOTE: Even though this tests that the node's client rect is non-zero to determine
336
+ // whether it's displayed, and that a detached node will __always__ have a zero-area
337
+ // client rect, we don't special-case for whether the node is attached or not. In
338
+ // this mode, we do want to consider nodes that have a zero area to be hidden at all
339
+ // times, and that includes attached or not.
340
+ return isZeroArea(node);
341
+ }
342
+
343
+ // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume
344
+ // it's visible
345
+ return false;
346
+ };
347
+
348
+ // form fields (nested) inside a disabled fieldset are not focusable/tabbable
349
+ // unless they are in the _first_ <legend> element of the top-most disabled
350
+ // fieldset
351
+ var isDisabledFromFieldset = function isDisabledFromFieldset(node) {
352
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
353
+ var parentNode = node.parentElement;
354
+ // check if `node` is contained in a disabled <fieldset>
355
+ while (parentNode) {
356
+ if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {
357
+ // look for the first <legend> among the children of the disabled <fieldset>
358
+ for (var i = 0; i < parentNode.children.length; i++) {
359
+ var child = parentNode.children.item(i);
360
+ // when the first <legend> (in document order) is found
361
+ if (child.tagName === 'LEGEND') {
362
+ // if its parent <fieldset> is not nested in another disabled <fieldset>,
363
+ // return whether `node` is a descendant of its first <legend>
364
+ return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);
365
+ }
366
+ }
367
+ // the disabled <fieldset> containing `node` has no <legend>
368
+ return true;
369
+ }
370
+ parentNode = parentNode.parentElement;
371
+ }
372
+ }
373
+
374
+ // else, node's tabbable/focusable state should not be affected by a fieldset's
375
+ // enabled/disabled state
376
+ return false;
377
+ };
378
+ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {
379
+ if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||
380
+ // For a details element with a summary, the summary element gets the focus
381
+ isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
382
+ return false;
383
+ }
384
+ return true;
385
+ };
386
+ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
387
+ if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
388
+ return false;
389
+ }
390
+ return true;
391
+ };
392
+ var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
393
+ var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
394
+ if (isNaN(tabIndex) || tabIndex >= 0) {
395
+ return true;
396
+ }
397
+ // If a custom element has an explicit negative tabindex,
398
+ // browsers will not allow tab targeting said element's children.
399
+ return false;
400
+ };
401
+
402
+ /**
403
+ * @param {Array.<Element|CandidateScope>} candidates
404
+ * @returns Element[]
405
+ */
406
+ var sortByOrder = function sortByOrder(candidates) {
407
+ var regularTabbables = [];
408
+ var orderedTabbables = [];
409
+ candidates.forEach(function (item, i) {
410
+ var isScope = !!item.scopeParent;
411
+ var element = isScope ? item.scopeParent : item;
412
+ var candidateTabindex = getTabindex(element, isScope);
413
+ var elements = isScope ? sortByOrder(item.candidates) : element;
414
+ if (candidateTabindex === 0) {
415
+ isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
416
+ } else {
417
+ orderedTabbables.push({
418
+ documentOrder: i,
419
+ tabIndex: candidateTabindex,
420
+ item: item,
421
+ isScope: isScope,
422
+ content: elements
423
+ });
424
+ }
425
+ });
426
+ return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {
427
+ sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
428
+ return acc;
429
+ }, []).concat(regularTabbables);
430
+ };
431
+ var tabbable = function tabbable(el, options) {
432
+ options = options || {};
433
+ var candidates;
434
+ if (options.getShadowRoot) {
435
+ candidates = getCandidatesIteratively([el], options.includeContainer, {
436
+ filter: isNodeMatchingSelectorTabbable.bind(null, options),
437
+ flatten: false,
438
+ getShadowRoot: options.getShadowRoot,
439
+ shadowRootFilter: isValidShadowRootTabbable
440
+ });
441
+ } else {
442
+ candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
443
+ }
444
+ return sortByOrder(candidates);
445
+ };
446
+ var focusable = function focusable(el, options) {
447
+ options = options || {};
448
+ var candidates;
449
+ if (options.getShadowRoot) {
450
+ candidates = getCandidatesIteratively([el], options.includeContainer, {
451
+ filter: isNodeMatchingSelectorFocusable.bind(null, options),
452
+ flatten: true,
453
+ getShadowRoot: options.getShadowRoot
454
+ });
455
+ } else {
456
+ candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));
457
+ }
458
+ return candidates;
459
+ };
460
+ var isTabbable = function isTabbable(node, options) {
461
+ options = options || {};
462
+ if (!node) {
463
+ throw new Error('No node provided');
464
+ }
465
+ if (matches.call(node, candidateSelector) === false) {
466
+ return false;
467
+ }
468
+ return isNodeMatchingSelectorTabbable(options, node);
469
+ };
470
+ var focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');
471
+ var isFocusable = function isFocusable(node, options) {
472
+ options = options || {};
473
+ if (!node) {
474
+ throw new Error('No node provided');
475
+ }
476
+ if (matches.call(node, focusableCandidateSelector) === false) {
477
+ return false;
478
+ }
479
+ return isNodeMatchingSelectorFocusable(options, node);
480
+ };
481
+
482
+ /*!
483
+ * focus-trap 7.2.0
484
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
485
+ */
486
+ function ownKeys(object, enumerableOnly) {
487
+ var keys = Object.keys(object);
488
+ if (Object.getOwnPropertySymbols) {
489
+ var symbols = Object.getOwnPropertySymbols(object);
490
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
491
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
492
+ })), keys.push.apply(keys, symbols);
493
+ }
494
+ return keys;
495
+ }
496
+ function _objectSpread2(target) {
497
+ for (var i = 1; i < arguments.length; i++) {
498
+ var source = null != arguments[i] ? arguments[i] : {};
499
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
500
+ _defineProperty(target, key, source[key]);
501
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
502
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
503
+ });
504
+ }
505
+ return target;
506
+ }
507
+ function _defineProperty(obj, key, value) {
508
+ key = _toPropertyKey(key);
509
+ if (key in obj) {
510
+ Object.defineProperty(obj, key, {
511
+ value: value,
512
+ enumerable: true,
513
+ configurable: true,
514
+ writable: true
515
+ });
516
+ } else {
517
+ obj[key] = value;
518
+ }
519
+ return obj;
520
+ }
521
+ function _toPrimitive(input, hint) {
522
+ if (typeof input !== "object" || input === null) return input;
523
+ var prim = input[Symbol.toPrimitive];
524
+ if (prim !== undefined) {
525
+ var res = prim.call(input, hint || "default");
526
+ if (typeof res !== "object") return res;
527
+ throw new TypeError("@@toPrimitive must return a primitive value.");
528
+ }
529
+ return (hint === "string" ? String : Number)(input);
530
+ }
531
+ function _toPropertyKey(arg) {
532
+ var key = _toPrimitive(arg, "string");
533
+ return typeof key === "symbol" ? key : String(key);
534
+ }
535
+ var activeFocusTraps = {
536
+ activateTrap: function activateTrap(trapStack, trap) {
537
+ if (trapStack.length > 0) {
538
+ var activeTrap = trapStack[trapStack.length - 1];
539
+ if (activeTrap !== trap) {
540
+ activeTrap.pause();
541
+ }
542
+ }
543
+ var trapIndex = trapStack.indexOf(trap);
544
+ if (trapIndex === -1) {
545
+ trapStack.push(trap);
546
+ } else {
547
+ // move this existing trap to the front of the queue
548
+ trapStack.splice(trapIndex, 1);
549
+ trapStack.push(trap);
550
+ }
551
+ },
552
+ deactivateTrap: function deactivateTrap(trapStack, trap) {
553
+ var trapIndex = trapStack.indexOf(trap);
554
+ if (trapIndex !== -1) {
555
+ trapStack.splice(trapIndex, 1);
556
+ }
557
+ if (trapStack.length > 0) {
558
+ trapStack[trapStack.length - 1].unpause();
559
+ }
560
+ }
561
+ };
562
+ var isSelectableInput = function isSelectableInput(node) {
563
+ return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
564
+ };
565
+ var isEscapeEvent = function isEscapeEvent(e) {
566
+ return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
567
+ };
568
+ var isTabEvent = function isTabEvent(e) {
569
+ return e.key === 'Tab' || e.keyCode === 9;
570
+ };
571
+
572
+ // checks for TAB by default
573
+ var isKeyForward = function isKeyForward(e) {
574
+ return isTabEvent(e) && !e.shiftKey;
575
+ };
576
+
577
+ // checks for SHIFT+TAB by default
578
+ var isKeyBackward = function isKeyBackward(e) {
579
+ return isTabEvent(e) && e.shiftKey;
580
+ };
581
+ var delay = function delay(fn) {
582
+ return setTimeout(fn, 0);
583
+ };
584
+
585
+ // Array.find/findIndex() are not supported on IE; this replicates enough
586
+ // of Array.findIndex() for our needs
587
+ var findIndex = function findIndex(arr, fn) {
588
+ var idx = -1;
589
+ arr.every(function (value, i) {
590
+ if (fn(value)) {
591
+ idx = i;
592
+ return false; // break
593
+ }
594
+
595
+ return true; // next
596
+ });
597
+
598
+ return idx;
599
+ };
600
+
601
+ /**
602
+ * Get an option's value when it could be a plain value, or a handler that provides
603
+ * the value.
604
+ * @param {*} value Option's value to check.
605
+ * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.
606
+ * @returns {*} The `value`, or the handler's returned value.
607
+ */
608
+ var valueOrHandler = function valueOrHandler(value) {
609
+ for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
610
+ params[_key - 1] = arguments[_key];
611
+ }
612
+ return typeof value === 'function' ? value.apply(void 0, params) : value;
613
+ };
614
+ var getActualTarget = function getActualTarget(event) {
615
+ // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
616
+ // shadow host. However, event.target.composedPath() will be an array of
617
+ // nodes "clicked" from inner-most (the actual element inside the shadow) to
618
+ // outer-most (the host HTML document). If we have access to composedPath(),
619
+ // then use its first element; otherwise, fall back to event.target (and
620
+ // this only works for an _open_ shadow DOM; otherwise,
621
+ // composedPath()[0] === event.target always).
622
+ return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;
623
+ };
624
+
625
+ // NOTE: this must be _outside_ `createFocusTrap()` to make sure all traps in this
626
+ // current instance use the same stack if `userOptions.trapStack` isn't specified
627
+ var internalTrapStack = [];
628
+ var createFocusTrap = function createFocusTrap(elements, userOptions) {
629
+ // SSR: a live trap shouldn't be created in this type of environment so this
630
+ // should be safe code to execute if the `document` option isn't specified
631
+ var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
632
+ var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack;
633
+ var config = _objectSpread2({
634
+ returnFocusOnDeactivate: true,
635
+ escapeDeactivates: true,
636
+ delayInitialFocus: true,
637
+ isKeyForward: isKeyForward,
638
+ isKeyBackward: isKeyBackward
639
+ }, userOptions);
640
+ var state = {
641
+ // containers given to createFocusTrap()
642
+ // @type {Array<HTMLElement>}
643
+ containers: [],
644
+ // list of objects identifying tabbable nodes in `containers` in the trap
645
+ // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
646
+ // is active, but the trap should never get to a state where there isn't at least one group
647
+ // with at least one tabbable node in it (that would lead to an error condition that would
648
+ // result in an error being thrown)
649
+ // @type {Array<{
650
+ // container: HTMLElement,
651
+ // tabbableNodes: Array<HTMLElement>, // empty if none
652
+ // focusableNodes: Array<HTMLElement>, // empty if none
653
+ // firstTabbableNode: HTMLElement|null,
654
+ // lastTabbableNode: HTMLElement|null,
655
+ // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
656
+ // }>}
657
+ containerGroups: [],
658
+ // same order/length as `containers` list
659
+
660
+ // references to objects in `containerGroups`, but only those that actually have
661
+ // tabbable nodes in them
662
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
663
+ // the same length
664
+ tabbableGroups: [],
665
+ nodeFocusedBeforeActivation: null,
666
+ mostRecentlyFocusedNode: null,
667
+ active: false,
668
+ paused: false,
669
+ // timer ID for when delayInitialFocus is true and initial focus in this trap
670
+ // has been delayed during activation
671
+ delayInitialFocusTimer: undefined
672
+ };
673
+ var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later
674
+
675
+ /**
676
+ * Gets a configuration option value.
677
+ * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,
678
+ * value will be taken from this object. Otherwise, value will be taken from base configuration.
679
+ * @param {string} optionName Name of the option whose value is sought.
680
+ * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`
681
+ * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.
682
+ */
683
+ var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {
684
+ return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];
685
+ };
686
+
687
+ /**
688
+ * Finds the index of the container that contains the element.
689
+ * @param {HTMLElement} element
690
+ * @returns {number} Index of the container in either `state.containers` or
691
+ * `state.containerGroups` (the order/length of these lists are the same); -1
692
+ * if the element isn't found.
693
+ */
694
+ var findContainerIndex = function findContainerIndex(element) {
695
+ // NOTE: search `containerGroups` because it's possible a group contains no tabbable
696
+ // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
697
+ // and we still need to find the element in there
698
+ return state.containerGroups.findIndex(function (_ref) {
699
+ var container = _ref.container,
700
+ tabbableNodes = _ref.tabbableNodes;
701
+ return container.contains(element) ||
702
+ // fall back to explicit tabbable search which will take into consideration any
703
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
704
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
705
+ // look inside web components even if open)
706
+ tabbableNodes.find(function (node) {
707
+ return node === element;
708
+ });
709
+ });
710
+ };
711
+
712
+ /**
713
+ * Gets the node for the given option, which is expected to be an option that
714
+ * can be either a DOM node, a string that is a selector to get a node, `false`
715
+ * (if a node is explicitly NOT given), or a function that returns any of these
716
+ * values.
717
+ * @param {string} optionName
718
+ * @returns {undefined | false | HTMLElement | SVGElement} Returns
719
+ * `undefined` if the option is not specified; `false` if the option
720
+ * resolved to `false` (node explicitly not given); otherwise, the resolved
721
+ * DOM node.
722
+ * @throws {Error} If the option is set, not `false`, and is not, or does not
723
+ * resolve to a node.
724
+ */
725
+ var getNodeForOption = function getNodeForOption(optionName) {
726
+ var optionValue = config[optionName];
727
+ if (typeof optionValue === 'function') {
728
+ for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
729
+ params[_key2 - 1] = arguments[_key2];
730
+ }
731
+ optionValue = optionValue.apply(void 0, params);
732
+ }
733
+ if (optionValue === true) {
734
+ optionValue = undefined; // use default value
735
+ }
736
+
737
+ if (!optionValue) {
738
+ if (optionValue === undefined || optionValue === false) {
739
+ return optionValue;
740
+ }
741
+ // else, empty string (invalid), null (invalid), 0 (invalid)
742
+
743
+ throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
744
+ }
745
+ var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
746
+
747
+ if (typeof optionValue === 'string') {
748
+ node = doc.querySelector(optionValue); // resolve to node, or null if fails
749
+ if (!node) {
750
+ throw new Error("`".concat(optionName, "` as selector refers to no known node"));
751
+ }
752
+ }
753
+ return node;
754
+ };
755
+ var getInitialFocusNode = function getInitialFocusNode() {
756
+ var node = getNodeForOption('initialFocus');
757
+
758
+ // false explicitly indicates we want no initialFocus at all
759
+ if (node === false) {
760
+ return false;
761
+ }
762
+ if (node === undefined) {
763
+ // option not specified: use fallback options
764
+ if (findContainerIndex(doc.activeElement) >= 0) {
765
+ node = doc.activeElement;
766
+ } else {
767
+ var firstTabbableGroup = state.tabbableGroups[0];
768
+ var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode;
769
+
770
+ // NOTE: `fallbackFocus` option function cannot return `false` (not supported)
771
+ node = firstTabbableNode || getNodeForOption('fallbackFocus');
772
+ }
773
+ }
774
+ if (!node) {
775
+ throw new Error('Your focus-trap needs to have at least one focusable element');
776
+ }
777
+ return node;
778
+ };
779
+ var updateTabbableNodes = function updateTabbableNodes() {
780
+ state.containerGroups = state.containers.map(function (container) {
781
+ var tabbableNodes = tabbable(container, config.tabbableOptions);
782
+
783
+ // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes
784
+ // are a superset of tabbable nodes
785
+ var focusableNodes = focusable(container, config.tabbableOptions);
786
+ return {
787
+ container: container,
788
+ tabbableNodes: tabbableNodes,
789
+ focusableNodes: focusableNodes,
790
+ firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,
791
+ lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,
792
+ /**
793
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
794
+ * in this container, if any.
795
+ * @param {HTMLElement} node
796
+ * @param {boolean} [forward] True if going in forward tab order; false if going
797
+ * in reverse.
798
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
799
+ */
800
+ nextTabbableNode: function nextTabbableNode(node) {
801
+ var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
802
+ // NOTE: If tabindex is positive (in order to manipulate the tab order separate
803
+ // from the DOM order), this __will not work__ because the list of focusableNodes,
804
+ // while it contains tabbable nodes, does not sort its nodes in any order other
805
+ // than DOM order, because it can't: Where would you place focusable (but not
806
+ // tabbable) nodes in that order? They have no order, because they aren't tabbale...
807
+ // Support for positive tabindex is already broken and hard to manage (possibly
808
+ // not supportable, TBD), so this isn't going to make things worse than they
809
+ // already are, and at least makes things better for the majority of cases where
810
+ // tabindex is either 0/unset or negative.
811
+ // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375
812
+ var nodeIdx = focusableNodes.findIndex(function (n) {
813
+ return n === node;
814
+ });
815
+ if (nodeIdx < 0) {
816
+ return undefined;
817
+ }
818
+ if (forward) {
819
+ return focusableNodes.slice(nodeIdx + 1).find(function (n) {
820
+ return isTabbable(n, config.tabbableOptions);
821
+ });
822
+ }
823
+ return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {
824
+ return isTabbable(n, config.tabbableOptions);
825
+ });
826
+ }
827
+ };
828
+ });
829
+ state.tabbableGroups = state.containerGroups.filter(function (group) {
830
+ return group.tabbableNodes.length > 0;
831
+ });
832
+
833
+ // throw if no groups have tabbable nodes and we don't have a fallback focus node either
834
+ if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option
835
+ ) {
836
+ throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');
837
+ }
838
+ };
839
+ var tryFocus = function tryFocus(node) {
840
+ if (node === false) {
841
+ return;
842
+ }
843
+ if (node === doc.activeElement) {
844
+ return;
845
+ }
846
+ if (!node || !node.focus) {
847
+ tryFocus(getInitialFocusNode());
848
+ return;
849
+ }
850
+ node.focus({
851
+ preventScroll: !!config.preventScroll
852
+ });
853
+ state.mostRecentlyFocusedNode = node;
854
+ if (isSelectableInput(node)) {
855
+ node.select();
856
+ }
857
+ };
858
+ var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {
859
+ var node = getNodeForOption('setReturnFocus', previousActiveElement);
860
+ return node ? node : node === false ? false : previousActiveElement;
861
+ };
862
+
863
+ // This needs to be done on mousedown and touchstart instead of click
864
+ // so that it precedes the focus event.
865
+ var checkPointerDown = function checkPointerDown(e) {
866
+ var target = getActualTarget(e);
867
+ if (findContainerIndex(target) >= 0) {
868
+ // allow the click since it ocurred inside the trap
869
+ return;
870
+ }
871
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
872
+ // immediately deactivate the trap
873
+ trap.deactivate({
874
+ // if, on deactivation, we should return focus to the node originally-focused
875
+ // when the trap was activated (or the configured `setReturnFocus` node),
876
+ // then assume it's also OK to return focus to the outside node that was
877
+ // just clicked, causing deactivation, as long as that node is focusable;
878
+ // if it isn't focusable, then return focus to the original node focused
879
+ // on activation (or the configured `setReturnFocus` node)
880
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
881
+ // which will result in the outside click setting focus to the node
882
+ // that was clicked, whether it's focusable or not; by setting
883
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
884
+ // on activation (or the configured `setReturnFocus` node)
885
+ returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)
886
+ });
887
+ return;
888
+ }
889
+
890
+ // This is needed for mobile devices.
891
+ // (If we'll only let `click` events through,
892
+ // then on mobile they will be blocked anyways if `touchstart` is blocked.)
893
+ if (valueOrHandler(config.allowOutsideClick, e)) {
894
+ // allow the click outside the trap to take place
895
+ return;
896
+ }
897
+
898
+ // otherwise, prevent the click
899
+ e.preventDefault();
900
+ };
901
+
902
+ // In case focus escapes the trap for some strange reason, pull it back in.
903
+ var checkFocusIn = function checkFocusIn(e) {
904
+ var target = getActualTarget(e);
905
+ var targetContained = findContainerIndex(target) >= 0;
906
+
907
+ // In Firefox when you Tab out of an iframe the Document is briefly focused.
908
+ if (targetContained || target instanceof Document) {
909
+ if (targetContained) {
910
+ state.mostRecentlyFocusedNode = target;
911
+ }
912
+ } else {
913
+ // escaped! pull it back in to where it just left
914
+ e.stopImmediatePropagation();
915
+ tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
916
+ }
917
+ };
918
+
919
+ // Hijack key nav events on the first and last focusable nodes of the trap,
920
+ // in order to prevent focus from escaping. If it escapes for even a
921
+ // moment it can end up scrolling the page and causing confusion so we
922
+ // kind of need to capture the action at the keydown phase.
923
+ var checkKeyNav = function checkKeyNav(event) {
924
+ var isBackward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
925
+ var target = getActualTarget(event);
926
+ updateTabbableNodes();
927
+ var destinationNode = null;
928
+ if (state.tabbableGroups.length > 0) {
929
+ // make sure the target is actually contained in a group
930
+ // NOTE: the target may also be the container itself if it's focusable
931
+ // with tabIndex='-1' and was given initial focus
932
+ var containerIndex = findContainerIndex(target);
933
+ var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;
934
+ if (containerIndex < 0) {
935
+ // target not found in any group: quite possible focus has escaped the trap,
936
+ // so bring it back into...
937
+ if (isBackward) {
938
+ // ...the last node in the last group
939
+ destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;
940
+ } else {
941
+ // ...the first node in the first group
942
+ destinationNode = state.tabbableGroups[0].firstTabbableNode;
943
+ }
944
+ } else if (isBackward) {
945
+ // REVERSE
946
+
947
+ // is the target the first tabbable node in a group?
948
+ var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {
949
+ var firstTabbableNode = _ref2.firstTabbableNode;
950
+ return target === firstTabbableNode;
951
+ });
952
+ if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {
953
+ // an exception case where the target is either the container itself, or
954
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
955
+ // and user clicked on it or node was programmatically given focus)
956
+ // and is not followed by any other tabbable node, in which
957
+ // case, we should handle shift+tab as if focus were on the container's
958
+ // first tabbable node, and go to the last tabbable node of the LAST group
959
+ startOfGroupIndex = containerIndex;
960
+ }
961
+ if (startOfGroupIndex >= 0) {
962
+ // YES: then shift+tab should go to the last tabbable node in the
963
+ // previous group (and wrap around to the last tabbable node of
964
+ // the LAST group if it's the first tabbable node of the FIRST group)
965
+ var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;
966
+ var destinationGroup = state.tabbableGroups[destinationGroupIndex];
967
+ destinationNode = destinationGroup.lastTabbableNode;
968
+ } else if (!isTabEvent(event)) {
969
+ // user must have customized the nav keys so we have to move focus manually _within_
970
+ // the active group: do this based on the order determined by tabbable()
971
+ destinationNode = containerGroup.nextTabbableNode(target, false);
972
+ }
973
+ } else {
974
+ // FORWARD
975
+
976
+ // is the target the last tabbable node in a group?
977
+ var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {
978
+ var lastTabbableNode = _ref3.lastTabbableNode;
979
+ return target === lastTabbableNode;
980
+ });
981
+ if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {
982
+ // an exception case where the target is the container itself, or
983
+ // a non-tabbable node that was given focus (i.e. tabindex is negative
984
+ // and user clicked on it or node was programmatically given focus)
985
+ // and is not followed by any other tabbable node, in which
986
+ // case, we should handle tab as if focus were on the container's
987
+ // last tabbable node, and go to the first tabbable node of the FIRST group
988
+ lastOfGroupIndex = containerIndex;
989
+ }
990
+ if (lastOfGroupIndex >= 0) {
991
+ // YES: then tab should go to the first tabbable node in the next
992
+ // group (and wrap around to the first tabbable node of the FIRST
993
+ // group if it's the last tabbable node of the LAST group)
994
+ var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;
995
+ var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];
996
+ destinationNode = _destinationGroup.firstTabbableNode;
997
+ } else if (!isTabEvent(event)) {
998
+ // user must have customized the nav keys so we have to move focus manually _within_
999
+ // the active group: do this based on the order determined by tabbable()
1000
+ destinationNode = containerGroup.nextTabbableNode(target);
1001
+ }
1002
+ }
1003
+ } else {
1004
+ // no groups available
1005
+ // NOTE: the fallbackFocus option does not support returning false to opt-out
1006
+ destinationNode = getNodeForOption('fallbackFocus');
1007
+ }
1008
+ if (destinationNode) {
1009
+ if (isTabEvent(event)) {
1010
+ // since tab natively moves focus, we wouldn't have a destination node unless we
1011
+ // were on the edge of a container and had to move to the next/previous edge, in
1012
+ // which case we want to prevent default to keep the browser from moving focus
1013
+ // to where it normally would
1014
+ event.preventDefault();
1015
+ }
1016
+ tryFocus(destinationNode);
1017
+ }
1018
+ // else, let the browser take care of [shift+]tab and move the focus
1019
+ };
1020
+
1021
+ var checkKey = function checkKey(event) {
1022
+ if (isEscapeEvent(event) && valueOrHandler(config.escapeDeactivates, event) !== false) {
1023
+ event.preventDefault();
1024
+ trap.deactivate();
1025
+ return;
1026
+ }
1027
+ if (config.isKeyForward(event) || config.isKeyBackward(event)) {
1028
+ checkKeyNav(event, config.isKeyBackward(event));
1029
+ }
1030
+ };
1031
+ var checkClick = function checkClick(e) {
1032
+ var target = getActualTarget(e);
1033
+ if (findContainerIndex(target) >= 0) {
1034
+ return;
1035
+ }
1036
+ if (valueOrHandler(config.clickOutsideDeactivates, e)) {
1037
+ return;
1038
+ }
1039
+ if (valueOrHandler(config.allowOutsideClick, e)) {
1040
+ return;
1041
+ }
1042
+ e.preventDefault();
1043
+ e.stopImmediatePropagation();
1044
+ };
1045
+
1046
+ //
1047
+ // EVENT LISTENERS
1048
+ //
1049
+
1050
+ var addListeners = function addListeners() {
1051
+ if (!state.active) {
1052
+ return;
1053
+ }
1054
+
1055
+ // There can be only one listening focus trap at a time
1056
+ activeFocusTraps.activateTrap(trapStack, trap);
1057
+
1058
+ // Delay ensures that the focused element doesn't capture the event
1059
+ // that caused the focus trap activation.
1060
+ state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {
1061
+ tryFocus(getInitialFocusNode());
1062
+ }) : tryFocus(getInitialFocusNode());
1063
+ doc.addEventListener('focusin', checkFocusIn, true);
1064
+ doc.addEventListener('mousedown', checkPointerDown, {
1065
+ capture: true,
1066
+ passive: false
1067
+ });
1068
+ doc.addEventListener('touchstart', checkPointerDown, {
1069
+ capture: true,
1070
+ passive: false
1071
+ });
1072
+ doc.addEventListener('click', checkClick, {
1073
+ capture: true,
1074
+ passive: false
1075
+ });
1076
+ doc.addEventListener('keydown', checkKey, {
1077
+ capture: true,
1078
+ passive: false
1079
+ });
1080
+ return trap;
1081
+ };
1082
+ var removeListeners = function removeListeners() {
1083
+ if (!state.active) {
1084
+ return;
1085
+ }
1086
+ doc.removeEventListener('focusin', checkFocusIn, true);
1087
+ doc.removeEventListener('mousedown', checkPointerDown, true);
1088
+ doc.removeEventListener('touchstart', checkPointerDown, true);
1089
+ doc.removeEventListener('click', checkClick, true);
1090
+ doc.removeEventListener('keydown', checkKey, true);
1091
+ return trap;
1092
+ };
1093
+
1094
+ //
1095
+ // TRAP DEFINITION
1096
+ //
1097
+
1098
+ trap = {
1099
+ get active() {
1100
+ return state.active;
1101
+ },
1102
+ get paused() {
1103
+ return state.paused;
1104
+ },
1105
+ activate: function activate(activateOptions) {
1106
+ if (state.active) {
1107
+ return this;
1108
+ }
1109
+ var onActivate = getOption(activateOptions, 'onActivate');
1110
+ var onPostActivate = getOption(activateOptions, 'onPostActivate');
1111
+ var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');
1112
+ if (!checkCanFocusTrap) {
1113
+ updateTabbableNodes();
1114
+ }
1115
+ state.active = true;
1116
+ state.paused = false;
1117
+ state.nodeFocusedBeforeActivation = doc.activeElement;
1118
+ if (onActivate) {
1119
+ onActivate();
1120
+ }
1121
+ var finishActivation = function finishActivation() {
1122
+ if (checkCanFocusTrap) {
1123
+ updateTabbableNodes();
1124
+ }
1125
+ addListeners();
1126
+ if (onPostActivate) {
1127
+ onPostActivate();
1128
+ }
1129
+ };
1130
+ if (checkCanFocusTrap) {
1131
+ checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
1132
+ return this;
1133
+ }
1134
+ finishActivation();
1135
+ return this;
1136
+ },
1137
+ deactivate: function deactivate(deactivateOptions) {
1138
+ if (!state.active) {
1139
+ return this;
1140
+ }
1141
+ var options = _objectSpread2({
1142
+ onDeactivate: config.onDeactivate,
1143
+ onPostDeactivate: config.onPostDeactivate,
1144
+ checkCanReturnFocus: config.checkCanReturnFocus
1145
+ }, deactivateOptions);
1146
+ clearTimeout(state.delayInitialFocusTimer); // noop if undefined
1147
+ state.delayInitialFocusTimer = undefined;
1148
+ removeListeners();
1149
+ state.active = false;
1150
+ state.paused = false;
1151
+ activeFocusTraps.deactivateTrap(trapStack, trap);
1152
+ var onDeactivate = getOption(options, 'onDeactivate');
1153
+ var onPostDeactivate = getOption(options, 'onPostDeactivate');
1154
+ var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
1155
+ var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
1156
+ if (onDeactivate) {
1157
+ onDeactivate();
1158
+ }
1159
+ var finishDeactivation = function finishDeactivation() {
1160
+ delay(function () {
1161
+ if (returnFocus) {
1162
+ tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
1163
+ }
1164
+ if (onPostDeactivate) {
1165
+ onPostDeactivate();
1166
+ }
1167
+ });
1168
+ };
1169
+ if (returnFocus && checkCanReturnFocus) {
1170
+ checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);
1171
+ return this;
1172
+ }
1173
+ finishDeactivation();
1174
+ return this;
1175
+ },
1176
+ pause: function pause() {
1177
+ if (state.paused || !state.active) {
1178
+ return this;
1179
+ }
1180
+ state.paused = true;
1181
+ removeListeners();
1182
+ return this;
1183
+ },
1184
+ unpause: function unpause() {
1185
+ if (!state.paused || !state.active) {
1186
+ return this;
1187
+ }
1188
+ state.paused = false;
1189
+ updateTabbableNodes();
1190
+ addListeners();
1191
+ return this;
1192
+ },
1193
+ updateContainerElements: function updateContainerElements(containerElements) {
1194
+ var elementsAsArray = [].concat(containerElements).filter(Boolean);
1195
+ state.containers = elementsAsArray.map(function (element) {
1196
+ return typeof element === 'string' ? doc.querySelector(element) : element;
1197
+ });
1198
+ if (state.active) {
1199
+ updateTabbableNodes();
1200
+ }
1201
+ return this;
1202
+ }
1203
+ };
1204
+
1205
+ // initialize container elements
1206
+ trap.updateContainerElements(elements);
1207
+ return trap;
1208
+ };
1209
+
1210
+ var __defProp = Object.defineProperty;
1211
+ var __defProps = Object.defineProperties;
1212
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1213
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
1214
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
1215
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
1216
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1217
+ var __spreadValues = (a, b) => {
1218
+ for (var prop in b || (b = {}))
1219
+ if (__hasOwnProp.call(b, prop))
1220
+ __defNormalProp(a, prop, b[prop]);
1221
+ if (__getOwnPropSymbols)
1222
+ for (var prop of __getOwnPropSymbols(b)) {
1223
+ if (__propIsEnum.call(b, prop))
1224
+ __defNormalProp(a, prop, b[prop]);
1225
+ }
1226
+ return a;
1227
+ };
1228
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1229
+ var __objRest = (source, exclude) => {
1230
+ var target = {};
1231
+ for (var prop in source)
1232
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
1233
+ target[prop] = source[prop];
1234
+ if (source != null && __getOwnPropSymbols)
1235
+ for (var prop of __getOwnPropSymbols(source)) {
1236
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
1237
+ target[prop] = source[prop];
1238
+ }
1239
+ return target;
1240
+ };
1241
+ function useFocusTrap(target, options = {}) {
1242
+ let trap;
1243
+ const _a = options, { immediate } = _a, focusTrapOptions = __objRest(_a, ["immediate"]);
1244
+ const hasFocus = ref(false);
1245
+ const isPaused = ref(false);
1246
+ const activate = (opts) => trap && trap.activate(opts);
1247
+ const deactivate = (opts) => trap && trap.deactivate(opts);
1248
+ const pause = () => {
1249
+ if (trap) {
1250
+ trap.pause();
1251
+ isPaused.value = true;
1252
+ }
1253
+ };
1254
+ const unpause = () => {
1255
+ if (trap) {
1256
+ trap.unpause();
1257
+ isPaused.value = false;
1258
+ }
1259
+ };
1260
+ watch(() => unrefElement(target), (el) => {
1261
+ if (!el)
1262
+ return;
1263
+ trap = createFocusTrap(el, __spreadProps(__spreadValues({}, focusTrapOptions), {
1264
+ onActivate() {
1265
+ hasFocus.value = true;
1266
+ if (options.onActivate)
1267
+ options.onActivate();
1268
+ },
1269
+ onDeactivate() {
1270
+ hasFocus.value = false;
1271
+ if (options.onDeactivate)
1272
+ options.onDeactivate();
1273
+ }
1274
+ }));
1275
+ if (immediate)
1276
+ activate();
1277
+ }, { flush: "post" });
1278
+ tryOnScopeDispose(() => deactivate());
1279
+ return {
1280
+ hasFocus,
1281
+ isPaused,
1282
+ activate,
1283
+ deactivate,
1284
+ pause,
1285
+ unpause
1286
+ };
1287
+ }
1288
+
26
1289
  var script = defineComponent({
27
1290
  name: 'OrModal',
28
1291
  components: {