@quantinuum/quantinuum-ui 4.0.0 → 4.0.1-fix-update-radix.1

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 (241) hide show
  1. package/dist/_virtual/index.js +4 -0
  2. package/dist/_virtual/index.js.map +1 -0
  3. package/dist/_virtual/use-sync-external-store-shim.development.js +4 -0
  4. package/dist/_virtual/use-sync-external-store-shim.development.js.map +1 -0
  5. package/dist/_virtual/use-sync-external-store-shim.production.js +4 -0
  6. package/dist/_virtual/use-sync-external-store-shim.production.js.map +1 -0
  7. package/dist/node_modules/@radix-ui/number/dist/index.mjs.js +4 -3
  8. package/dist/node_modules/@radix-ui/number/dist/index.mjs.js.map +1 -1
  9. package/dist/node_modules/@radix-ui/primitive/dist/index.mjs.js +9 -6
  10. package/dist/node_modules/@radix-ui/primitive/dist/index.mjs.js.map +1 -1
  11. package/dist/node_modules/@radix-ui/react-accordion/dist/index.mjs.js +279 -267
  12. package/dist/node_modules/@radix-ui/react-accordion/dist/index.mjs.js.map +1 -1
  13. package/dist/node_modules/@radix-ui/react-arrow/dist/index.mjs.js +26 -0
  14. package/dist/node_modules/@radix-ui/react-arrow/dist/index.mjs.js.map +1 -0
  15. package/dist/node_modules/@radix-ui/react-avatar/dist/index.mjs.js +114 -92
  16. package/dist/node_modules/@radix-ui/react-avatar/dist/index.mjs.js.map +1 -1
  17. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.mjs.js +255 -138
  18. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.mjs.js.map +1 -1
  19. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.mjs.js +135 -130
  20. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.mjs.js.map +1 -1
  21. package/dist/node_modules/@radix-ui/react-collection/dist/index.mjs.js +66 -88
  22. package/dist/node_modules/@radix-ui/react-collection/dist/index.mjs.js.map +1 -1
  23. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.mjs.js +81 -73
  24. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +1 -1
  25. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.js +34 -21
  26. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.js.map +1 -1
  27. package/dist/node_modules/@radix-ui/react-context/dist/index.mjs.js +72 -93
  28. package/dist/node_modules/@radix-ui/react-context/dist/index.mjs.js.map +1 -1
  29. package/dist/node_modules/@radix-ui/react-dialog/dist/index.mjs.js +297 -254
  30. package/dist/node_modules/@radix-ui/react-dialog/dist/index.mjs.js.map +1 -1
  31. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs.js +81 -73
  32. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +1 -1
  33. package/dist/node_modules/@radix-ui/react-direction/dist/index.mjs.js +8 -6
  34. package/dist/node_modules/@radix-ui/react-direction/dist/index.mjs.js.map +1 -1
  35. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.js +190 -217
  36. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.js.map +1 -1
  37. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs.js +243 -217
  38. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs.js.map +1 -1
  39. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.js +26 -25
  40. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.js.map +1 -1
  41. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.js +191 -259
  42. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.js.map +1 -1
  43. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.mjs.js +224 -205
  44. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.mjs.js.map +1 -1
  45. package/dist/node_modules/@radix-ui/react-id/dist/index.mjs.js +11 -14
  46. package/dist/node_modules/@radix-ui/react-id/dist/index.mjs.js.map +1 -1
  47. package/dist/node_modules/@radix-ui/react-label/dist/index.mjs.js +22 -14
  48. package/dist/node_modules/@radix-ui/react-label/dist/index.mjs.js.map +1 -1
  49. package/dist/node_modules/@radix-ui/react-menu/dist/index.mjs.js +765 -820
  50. package/dist/node_modules/@radix-ui/react-menu/dist/index.mjs.js.map +1 -1
  51. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.mjs.js +81 -73
  52. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +1 -1
  53. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs.js +717 -730
  54. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs.js.map +1 -1
  55. package/dist/node_modules/@radix-ui/react-popover/dist/index.mjs.js +268 -199
  56. package/dist/node_modules/@radix-ui/react-popover/dist/index.mjs.js.map +1 -1
  57. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.mjs.js +81 -73
  58. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +1 -1
  59. package/dist/node_modules/@radix-ui/react-popper/dist/index.mjs.js +267 -223
  60. package/dist/node_modules/@radix-ui/react-popper/dist/index.mjs.js.map +1 -1
  61. package/dist/node_modules/@radix-ui/react-portal/dist/index.mjs.js +14 -10
  62. package/dist/node_modules/@radix-ui/react-portal/dist/index.mjs.js.map +1 -1
  63. package/dist/node_modules/@radix-ui/react-presence/dist/index.mjs.js +122 -121
  64. package/dist/node_modules/@radix-ui/react-presence/dist/index.mjs.js.map +1 -1
  65. package/dist/node_modules/@radix-ui/react-primitive/dist/index.mjs.js +39 -83
  66. package/dist/node_modules/@radix-ui/react-primitive/dist/index.mjs.js.map +1 -1
  67. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.mjs.js +81 -73
  68. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +1 -1
  69. package/dist/node_modules/@radix-ui/react-progress/dist/index.mjs.js +77 -78
  70. package/dist/node_modules/@radix-ui/react-progress/dist/index.mjs.js.map +1 -1
  71. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.mjs.js +264 -217
  72. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.mjs.js.map +1 -1
  73. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.js +204 -216
  74. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.js.map +1 -1
  75. package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.mjs.js +9 -9
  76. package/dist/node_modules/@radix-ui/react-select/dist/index.mjs.js +1080 -1079
  77. package/dist/node_modules/@radix-ui/react-select/dist/index.mjs.js.map +1 -1
  78. package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.mjs.js +81 -73
  79. package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +1 -1
  80. package/dist/node_modules/@radix-ui/react-separator/dist/index.mjs.js +26 -43
  81. package/dist/node_modules/@radix-ui/react-separator/dist/index.mjs.js.map +1 -1
  82. package/dist/node_modules/@radix-ui/react-slot/dist/index.mjs.js +1 -1
  83. package/dist/node_modules/@radix-ui/react-switch/dist/index.mjs.js +140 -112
  84. package/dist/node_modules/@radix-ui/react-switch/dist/index.mjs.js.map +1 -1
  85. package/dist/node_modules/@radix-ui/react-tabs/dist/index.mjs.js +173 -141
  86. package/dist/node_modules/@radix-ui/react-tabs/dist/index.mjs.js.map +1 -1
  87. package/dist/node_modules/@radix-ui/react-toggle/dist/index.mjs.js +34 -25
  88. package/dist/node_modules/@radix-ui/react-toggle/dist/index.mjs.js.map +1 -1
  89. package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.mjs.js +154 -145
  90. package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.mjs.js.map +1 -1
  91. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.mjs.js +462 -491
  92. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.mjs.js.map +1 -1
  93. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.mjs.js +13 -78
  94. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +1 -1
  95. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.js +9 -15
  96. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.js.map +1 -1
  97. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.js +66 -43
  98. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.js.map +1 -1
  99. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.js +15 -18
  100. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.js.map +1 -1
  101. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs.js +18 -0
  102. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs.js.map +1 -0
  103. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.js +5 -9
  104. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.js.map +1 -1
  105. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.mjs.js +12 -18
  106. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.mjs.js.map +1 -1
  107. package/dist/node_modules/@radix-ui/react-use-size/dist/index.mjs.js +37 -48
  108. package/dist/node_modules/@radix-ui/react-use-size/dist/index.mjs.js.map +1 -1
  109. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs.js +32 -23
  110. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs.js.map +1 -1
  111. package/dist/node_modules/aria-hidden/dist/es2015/index.js +22 -16
  112. package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -1
  113. package/dist/node_modules/class-variance-authority/dist/index.mjs.js +7 -9
  114. package/dist/node_modules/class-variance-authority/dist/index.mjs.js.map +1 -1
  115. package/dist/node_modules/cmdk/dist/chunk-NZJY6EH4.mjs.js +4 -0
  116. package/dist/node_modules/cmdk/dist/chunk-NZJY6EH4.mjs.js.map +1 -0
  117. package/dist/node_modules/cmdk/dist/index.mjs.js +8 -4
  118. package/dist/node_modules/cmdk/dist/index.mjs.js.map +1 -1
  119. package/dist/node_modules/{@radix-ui/react-scroll-area → cmdk}/node_modules/@radix-ui/react-primitive/dist/index.mjs.js +1 -1
  120. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.mjs.js.map +1 -0
  121. package/dist/node_modules/input-otp/dist/index.mjs.js +1 -1
  122. package/dist/node_modules/input-otp/dist/index.mjs.js.map +1 -1
  123. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +23 -5
  124. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
  125. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +2 -2
  126. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
  127. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +18 -6
  128. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
  129. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +25 -5
  130. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
  131. package/dist/node_modules/sonner/dist/index.mjs.js +46 -26
  132. package/dist/node_modules/sonner/dist/index.mjs.js.map +1 -1
  133. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +27 -1
  134. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
  135. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +107 -0
  136. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  137. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +78 -0
  138. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  139. package/dist/node_modules/use-sync-external-store/shim/index.js +13 -0
  140. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  141. package/dist/src/index.js +1 -1
  142. package/dist/src/shadcn/ui/accordion.js +7 -7
  143. package/dist/src/shadcn/ui/avatar.js +7 -7
  144. package/dist/src/shadcn/ui/checkbox.js +3 -3
  145. package/dist/src/shadcn/ui/command.js +15 -15
  146. package/dist/src/shadcn/ui/dialog.js +14 -14
  147. package/dist/src/shadcn/ui/dropdown-menu.js +23 -23
  148. package/dist/src/shadcn/ui/hover-card.js +5 -5
  149. package/dist/src/shadcn/ui/label.js +3 -3
  150. package/dist/src/shadcn/ui/navigation-menu.js +15 -15
  151. package/dist/src/shadcn/ui/navigation-menu.js.map +1 -1
  152. package/dist/src/shadcn/ui/popover.js +32 -6
  153. package/dist/src/shadcn/ui/popover.js.map +1 -1
  154. package/dist/src/shadcn/ui/progress.js +3 -3
  155. package/dist/src/shadcn/ui/radio-group.js +5 -5
  156. package/dist/src/shadcn/ui/select.js +19 -19
  157. package/dist/src/shadcn/ui/separator.js +3 -3
  158. package/dist/src/shadcn/ui/sheet.js +14 -14
  159. package/dist/src/shadcn/ui/switch.js +3 -3
  160. package/dist/src/shadcn/ui/tabs.js +8 -8
  161. package/dist/src/shadcn/ui/toggle-group.js +5 -5
  162. package/dist/src/shadcn/ui/toggle.js +3 -3
  163. package/dist/src/shadcn/ui/tooltip.js +7 -7
  164. package/dist/tailwind-manifest.js +12595 -14091
  165. package/dist/types/src/shadcn/ui/command.d.ts +44 -8
  166. package/dist/types/src/shadcn/ui/popover.d.ts +8 -4
  167. package/dist/types/src/shadcn/ui/sheet.d.ts +1 -1
  168. package/package.json +10 -31
  169. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -12
  170. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
  171. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/number/dist/index.mjs.js +0 -7
  172. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/number/dist/index.mjs.js.map +0 -1
  173. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/primitive/dist/index.mjs.js +0 -12
  174. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/primitive/dist/index.mjs.js.map +0 -1
  175. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.js +0 -40
  176. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.js.map +0 -1
  177. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-context/dist/index.mjs.js +0 -64
  178. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-context/dist/index.mjs.js.map +0 -1
  179. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-direction/dist/index.mjs.js +0 -12
  180. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-direction/dist/index.mjs.js.map +0 -1
  181. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-presence/dist/index.mjs.js +0 -132
  182. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-presence/dist/index.mjs.js.map +0 -1
  183. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-primitive/dist/index.mjs.js.map +0 -1
  184. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-slot/dist/index.mjs.js +0 -90
  185. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-slot/dist/index.mjs.js.map +0 -1
  186. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.js +0 -13
  187. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.js.map +0 -1
  188. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.js +0 -8
  189. package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.js.map +0 -1
  190. package/dist/node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.js +0 -37
  191. package/dist/node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs/dist/index.mjs.js.map +0 -1
  192. package/dist/node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs.js +0 -4
  193. package/dist/node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs.js.map +0 -1
  194. package/dist/node_modules/cmdk/node_modules/@radix-ui/primitive/dist/index.module.js +0 -9
  195. package/dist/node_modules/cmdk/node_modules/@radix-ui/primitive/dist/index.module.js.map +0 -1
  196. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-compose-refs/dist/index.module.js +0 -27
  197. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-compose-refs/dist/index.module.js.map +0 -1
  198. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-context/dist/index.module.js +0 -101
  199. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-context/dist/index.module.js.map +0 -1
  200. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.module.js +0 -214
  201. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.module.js.map +0 -1
  202. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.module.js +0 -233
  203. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.module.js.map +0 -1
  204. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-guards/dist/index.module.js +0 -30
  205. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-guards/dist/index.module.js.map +0 -1
  206. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.module.js +0 -252
  207. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.module.js.map +0 -1
  208. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-id/dist/index.module.js +0 -19
  209. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-id/dist/index.module.js.map +0 -1
  210. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.module.js +0 -15
  211. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.module.js.map +0 -1
  212. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-presence/dist/index.module.js +0 -131
  213. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-presence/dist/index.module.js.map +0 -1
  214. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.module.js +0 -85
  215. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.module.js.map +0 -1
  216. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.module.js +0 -79
  217. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.module.js.map +0 -1
  218. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-callback-ref/dist/index.module.js +0 -19
  219. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-callback-ref/dist/index.module.js.map +0 -1
  220. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-controllable-state/dist/index.module.js +0 -48
  221. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-controllable-state/dist/index.module.js.map +0 -1
  222. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-escape-keydown/dist/index.module.js +0 -21
  223. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-escape-keydown/dist/index.module.js.map +0 -1
  224. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-layout-effect/dist/index.module.js +0 -12
  225. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-use-layout-effect/dist/index.module.js.map +0 -1
  226. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -10
  227. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +0 -1
  228. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -146
  229. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +0 -1
  230. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -39
  231. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/UI.js.map +0 -1
  232. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -22
  233. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +0 -1
  234. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -97
  235. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +0 -1
  236. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -9
  237. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/medium.js.map +0 -1
  238. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -10
  239. package/dist/node_modules/cmdk/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +0 -1
  240. package/dist/node_modules/command-score/index.js +0 -138
  241. package/dist/node_modules/command-score/index.js.map +0 -1
@@ -1,240 +1,213 @@
1
- import _extends from '../../../@babel/runtime/helpers/esm/extends.js';
2
- import { forwardRef, useContext, useState, useEffect, createElement, useRef, createContext } from 'react';
3
- import { composeEventHandlers as $e42e1063c40fb3ef$export$b9ecd428b558ff10 } from '../../primitive/dist/index.mjs.js';
4
- import { Primitive as $8927f6f2acc4f386$export$250ffa63cdc0d034, dispatchDiscreteCustomEvent as $8927f6f2acc4f386$export$6d1a0317bde7de7f } from '../../react-primitive/dist/index.mjs.js';
5
- import { useComposedRefs as $6ed0406888f73fc4$export$c7b2cbe3552a0d05 } from '../../react-compose-refs/dist/index.mjs.js';
6
- import { useCallbackRef as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a } from '../../react-use-callback-ref/dist/index.mjs.js';
7
- import { useEscapeKeydown as $addc16e1bbe58fd0$export$3a72a57244d6e765 } from '../../react-use-escape-keydown/dist/index.mjs.js';
1
+ 'use client';
2
+ import * as React from 'react';
3
+ import { composeEventHandlers } from '../../primitive/dist/index.mjs.js';
4
+ import { Primitive, dispatchDiscreteCustomEvent } from '../../react-primitive/dist/index.mjs.js';
5
+ import { useComposedRefs } from '../../react-compose-refs/dist/index.mjs.js';
6
+ import { useCallbackRef } from '../../react-use-callback-ref/dist/index.mjs.js';
7
+ import { useEscapeKeydown } from '../../react-use-escape-keydown/dist/index.mjs.js';
8
+ import { jsx } from 'react/jsx-runtime';
8
9
 
9
- const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
10
- const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
11
- const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
12
- let $5cb92bef7577960e$var$originalBodyPointerEvents;
13
- const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
14
- layers: new Set(),
15
- layersWithOutsidePointerEventsDisabled: new Set(),
16
- branches: new Set()
10
+ var DISMISSABLE_LAYER_NAME = "DismissableLayer";
11
+ var CONTEXT_UPDATE = "dismissableLayer.update";
12
+ var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
13
+ var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
14
+ var originalBodyPointerEvents;
15
+ var DismissableLayerContext = React.createContext({
16
+ layers: /* @__PURE__ */ new Set(),
17
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
18
+ branches: /* @__PURE__ */ new Set()
17
19
  });
18
- const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
19
- var _node$ownerDocument;
20
- const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
21
- const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
22
- const [node1, setNode] = useState(null);
23
- const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
24
- const [, force] = useState({});
25
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
26
- );
20
+ var DismissableLayer = React.forwardRef(
21
+ (props, forwardedRef) => {
22
+ const {
23
+ disableOutsidePointerEvents = false,
24
+ onEscapeKeyDown,
25
+ onPointerDownOutside,
26
+ onFocusOutside,
27
+ onInteractOutside,
28
+ onDismiss,
29
+ ...layerProps
30
+ } = props;
31
+ const context = React.useContext(DismissableLayerContext);
32
+ const [node, setNode] = React.useState(null);
33
+ const ownerDocument = node?.ownerDocument ?? globalThis?.document;
34
+ const [, force] = React.useState({});
35
+ const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
27
36
  const layers = Array.from(context.layers);
28
- const [highestLayerWithOutsidePointerEventsDisabled] = [
29
- ...context.layersWithOutsidePointerEventsDisabled
30
- ].slice(-1); // prettier-ignore
31
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
32
- const index = node1 ? layers.indexOf(node1) : -1;
37
+ const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
38
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
39
+ const index = node ? layers.indexOf(node) : -1;
33
40
  const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
34
41
  const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
35
- const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
36
- const target = event.target;
37
- const isPointerDownOnBranch = [
38
- ...context.branches
39
- ].some((branch)=>branch.contains(target)
40
- );
41
- if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
42
- onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
43
- onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
44
- if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
42
+ const pointerDownOutside = usePointerDownOutside((event) => {
43
+ const target = event.target;
44
+ const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
45
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
46
+ onPointerDownOutside?.(event);
47
+ onInteractOutside?.(event);
48
+ if (!event.defaultPrevented) onDismiss?.();
45
49
  }, ownerDocument);
46
- const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
47
- const target = event.target;
48
- const isFocusInBranch = [
49
- ...context.branches
50
- ].some((branch)=>branch.contains(target)
51
- );
52
- if (isFocusInBranch) return;
53
- onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
54
- onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
55
- if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
50
+ const focusOutside = useFocusOutside((event) => {
51
+ const target = event.target;
52
+ const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
53
+ if (isFocusInBranch) return;
54
+ onFocusOutside?.(event);
55
+ onInteractOutside?.(event);
56
+ if (!event.defaultPrevented) onDismiss?.();
56
57
  }, ownerDocument);
57
- $addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
58
- const isHighestLayer = index === context.layers.size - 1;
59
- if (!isHighestLayer) return;
60
- onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
61
- if (!event.defaultPrevented && onDismiss) {
62
- event.preventDefault();
63
- onDismiss();
64
- }
58
+ useEscapeKeydown((event) => {
59
+ const isHighestLayer = index === context.layers.size - 1;
60
+ if (!isHighestLayer) return;
61
+ onEscapeKeyDown?.(event);
62
+ if (!event.defaultPrevented && onDismiss) {
63
+ event.preventDefault();
64
+ onDismiss();
65
+ }
65
66
  }, ownerDocument);
66
- useEffect(()=>{
67
- if (!node1) return;
68
- if (disableOutsidePointerEvents) {
69
- if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
70
- $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
71
- ownerDocument.body.style.pointerEvents = 'none';
72
- }
73
- context.layersWithOutsidePointerEventsDisabled.add(node1);
67
+ React.useEffect(() => {
68
+ if (!node) return;
69
+ if (disableOutsidePointerEvents) {
70
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
71
+ originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
72
+ ownerDocument.body.style.pointerEvents = "none";
74
73
  }
75
- context.layers.add(node1);
76
- $5cb92bef7577960e$var$dispatchUpdate();
77
- return ()=>{
78
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
79
- };
80
- }, [
81
- node1,
82
- ownerDocument,
83
- disableOutsidePointerEvents,
84
- context
85
- ]);
86
- /**
87
- * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
88
- * because a change to `disableOutsidePointerEvents` would remove this layer from the stack
89
- * and add it to the end again so the layering order wouldn't be _creation order_.
90
- * We only want them to be removed from context stacks when unmounted.
91
- */ useEffect(()=>{
92
- return ()=>{
93
- if (!node1) return;
94
- context.layers.delete(node1);
95
- context.layersWithOutsidePointerEventsDisabled.delete(node1);
96
- $5cb92bef7577960e$var$dispatchUpdate();
97
- };
98
- }, [
99
- node1,
100
- context
101
- ]);
102
- useEffect(()=>{
103
- const handleUpdate = ()=>force({})
104
- ;
105
- document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
106
- return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
107
- ;
74
+ context.layersWithOutsidePointerEventsDisabled.add(node);
75
+ }
76
+ context.layers.add(node);
77
+ dispatchUpdate();
78
+ return () => {
79
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
80
+ ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
81
+ }
82
+ };
83
+ }, [node, ownerDocument, disableOutsidePointerEvents, context]);
84
+ React.useEffect(() => {
85
+ return () => {
86
+ if (!node) return;
87
+ context.layers.delete(node);
88
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
89
+ dispatchUpdate();
90
+ };
91
+ }, [node, context]);
92
+ React.useEffect(() => {
93
+ const handleUpdate = () => force({});
94
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
95
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
108
96
  }, []);
109
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
97
+ return /* @__PURE__ */ jsx(
98
+ Primitive.div,
99
+ {
100
+ ...layerProps,
110
101
  ref: composedRefs,
111
102
  style: {
112
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
113
- ...props.style
103
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
104
+ ...props.style
114
105
  },
115
- onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
116
- onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
117
- onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
118
- }));
106
+ onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
107
+ onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
108
+ onPointerDownCapture: composeEventHandlers(
109
+ props.onPointerDownCapture,
110
+ pointerDownOutside.onPointerDownCapture
111
+ )
112
+ }
113
+ );
114
+ }
115
+ );
116
+ DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
117
+ var BRANCH_NAME = "DismissableLayerBranch";
118
+ var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
119
+ const context = React.useContext(DismissableLayerContext);
120
+ const ref = React.useRef(null);
121
+ const composedRefs = useComposedRefs(forwardedRef, ref);
122
+ React.useEffect(() => {
123
+ const node = ref.current;
124
+ if (node) {
125
+ context.branches.add(node);
126
+ return () => {
127
+ context.branches.delete(node);
128
+ };
129
+ }
130
+ }, [context.branches]);
131
+ return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
119
132
  });
120
- /* -----------------------------------------------------------------------------------------------*/ /**
121
- * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
122
- * to mimic layer dismissing behaviour present in OS.
123
- * Returns props to pass to the node we want to check for outside events.
124
- */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
125
- const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
126
- const isPointerInsideReactTreeRef = useRef(false);
127
- const handleClickRef = useRef(()=>{});
128
- useEffect(()=>{
129
- const handlePointerDown = (event)=>{
130
- if (event.target && !isPointerInsideReactTreeRef.current) {
131
- const eventDetail = {
132
- originalEvent: event
133
- };
134
- function handleAndDispatchPointerDownOutsideEvent() {
135
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
136
- discrete: true
137
- });
138
- }
139
- /**
140
- * On touch devices, we need to wait for a click event because browsers implement
141
- * a ~350ms delay between the time the user stops touching the display and when the
142
- * browser executres events. We need to ensure we don't reactivate pointer-events within
143
- * this timeframe otherwise the browser may execute events that should have been prevented.
144
- *
145
- * Additionally, this also lets us deal automatically with cancellations when a click event
146
- * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
147
- *
148
- * This is why we also continuously remove the previous listener, because we cannot be
149
- * certain that it was raised, and therefore cleaned-up.
150
- */ if (event.pointerType === 'touch') {
151
- ownerDocument.removeEventListener('click', handleClickRef.current);
152
- handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
153
- ownerDocument.addEventListener('click', handleClickRef.current, {
154
- once: true
155
- });
156
- } else handleAndDispatchPointerDownOutsideEvent();
157
- } else // We need to remove the event listener in case the outside click has been canceled.
158
- // See: https://github.com/radix-ui/primitives/issues/2171
159
- ownerDocument.removeEventListener('click', handleClickRef.current);
160
- isPointerInsideReactTreeRef.current = false;
161
- };
162
- /**
163
- * if this hook executes in a component that mounts via a `pointerdown` event, the event
164
- * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
165
- * this by delaying the event listener registration on the document.
166
- * This is not React specific, but rather how the DOM works, ie:
167
- * ```
168
- * button.addEventListener('pointerdown', () => {
169
- * console.log('I will log');
170
- * document.addEventListener('pointerdown', () => {
171
- * console.log('I will also log');
172
- * })
173
- * });
174
- */ const timerId = window.setTimeout(()=>{
175
- ownerDocument.addEventListener('pointerdown', handlePointerDown);
176
- }, 0);
177
- return ()=>{
178
- window.clearTimeout(timerId);
179
- ownerDocument.removeEventListener('pointerdown', handlePointerDown);
180
- ownerDocument.removeEventListener('click', handleClickRef.current);
133
+ DismissableLayerBranch.displayName = BRANCH_NAME;
134
+ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
135
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
136
+ const isPointerInsideReactTreeRef = React.useRef(false);
137
+ const handleClickRef = React.useRef(() => {
138
+ });
139
+ React.useEffect(() => {
140
+ const handlePointerDown = (event) => {
141
+ if (event.target && !isPointerInsideReactTreeRef.current) {
142
+ let handleAndDispatchPointerDownOutsideEvent2 = function() {
143
+ handleAndDispatchCustomEvent(
144
+ POINTER_DOWN_OUTSIDE,
145
+ handlePointerDownOutside,
146
+ eventDetail,
147
+ { discrete: true }
148
+ );
181
149
  };
182
- }, [
183
- ownerDocument,
184
- handlePointerDownOutside
185
- ]);
186
- return {
187
- // ensures we check React component tree (not just DOM tree)
188
- onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
150
+ const eventDetail = { originalEvent: event };
151
+ if (event.pointerType === "touch") {
152
+ ownerDocument.removeEventListener("click", handleClickRef.current);
153
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
154
+ ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
155
+ } else {
156
+ handleAndDispatchPointerDownOutsideEvent2();
157
+ }
158
+ } else {
159
+ ownerDocument.removeEventListener("click", handleClickRef.current);
160
+ }
161
+ isPointerInsideReactTreeRef.current = false;
189
162
  };
163
+ const timerId = window.setTimeout(() => {
164
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
165
+ }, 0);
166
+ return () => {
167
+ window.clearTimeout(timerId);
168
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
169
+ ownerDocument.removeEventListener("click", handleClickRef.current);
170
+ };
171
+ }, [ownerDocument, handlePointerDownOutside]);
172
+ return {
173
+ // ensures we check React component tree (not just DOM tree)
174
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
175
+ };
190
176
  }
191
- /**
192
- * Listens for when focus happens outside a react subtree.
193
- * Returns props to pass to the root (node) of the subtree we want to check.
194
- */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
195
- const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
196
- const isFocusInsideReactTreeRef = useRef(false);
197
- useEffect(()=>{
198
- const handleFocus = (event)=>{
199
- if (event.target && !isFocusInsideReactTreeRef.current) {
200
- const eventDetail = {
201
- originalEvent: event
202
- };
203
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
204
- discrete: false
205
- });
206
- }
207
- };
208
- ownerDocument.addEventListener('focusin', handleFocus);
209
- return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
210
- ;
211
- }, [
212
- ownerDocument,
213
- handleFocusOutside
214
- ]);
215
- return {
216
- onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
217
- ,
218
- onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
177
+ function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
178
+ const handleFocusOutside = useCallbackRef(onFocusOutside);
179
+ const isFocusInsideReactTreeRef = React.useRef(false);
180
+ React.useEffect(() => {
181
+ const handleFocus = (event) => {
182
+ if (event.target && !isFocusInsideReactTreeRef.current) {
183
+ const eventDetail = { originalEvent: event };
184
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
185
+ discrete: false
186
+ });
187
+ }
219
188
  };
189
+ ownerDocument.addEventListener("focusin", handleFocus);
190
+ return () => ownerDocument.removeEventListener("focusin", handleFocus);
191
+ }, [ownerDocument, handleFocusOutside]);
192
+ return {
193
+ onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
194
+ onBlurCapture: () => isFocusInsideReactTreeRef.current = false
195
+ };
220
196
  }
221
- function $5cb92bef7577960e$var$dispatchUpdate() {
222
- const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
223
- document.dispatchEvent(event);
197
+ function dispatchUpdate() {
198
+ const event = new CustomEvent(CONTEXT_UPDATE);
199
+ document.dispatchEvent(event);
224
200
  }
225
- function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
226
- const target = detail.originalEvent.target;
227
- const event = new CustomEvent(name, {
228
- bubbles: false,
229
- cancelable: true,
230
- detail: detail
231
- });
232
- if (handler) target.addEventListener(name, handler, {
233
- once: true
234
- });
235
- if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
236
- else target.dispatchEvent(event);
201
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
202
+ const target = detail.originalEvent.target;
203
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
204
+ if (handler) target.addEventListener(name, handler, { once: true });
205
+ if (discrete) {
206
+ dispatchDiscreteCustomEvent(target, event);
207
+ } else {
208
+ target.dispatchEvent(event);
209
+ }
237
210
  }
238
211
 
239
- export { $5cb92bef7577960e$export$177fb62ff3ec1f22 as DismissableLayer };
212
+ export { DismissableLayer, DismissableLayerBranch };
240
213
  //# sourceMappingURL=index.mjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs.js","sources":["../../../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["import $kqwpH$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {createContext as $kqwpH$createContext, forwardRef as $kqwpH$forwardRef, useContext as $kqwpH$useContext, useState as $kqwpH$useState, useEffect as $kqwpH$useEffect, createElement as $kqwpH$createElement, useRef as $kqwpH$useRef} from \"react\";\nimport {composeEventHandlers as $kqwpH$composeEventHandlers} from \"@radix-ui/primitive\";\nimport {Primitive as $kqwpH$Primitive, dispatchDiscreteCustomEvent as $kqwpH$dispatchDiscreteCustomEvent} from \"@radix-ui/react-primitive\";\nimport {useComposedRefs as $kqwpH$useComposedRefs} from \"@radix-ui/react-compose-refs\";\nimport {useCallbackRef as $kqwpH$useCallbackRef} from \"@radix-ui/react-use-callback-ref\";\nimport {useEscapeKeydown as $kqwpH$useEscapeKeydown} from \"@radix-ui/react-use-escape-keydown\";\n\n\n\n\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayer\n * -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME = 'DismissableLayer';\nconst $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';\nconst $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';\nconst $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';\nlet $5cb92bef7577960e$var$originalBodyPointerEvents;\nconst $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ $kqwpH$createContext({\n layers: new Set(),\n layersWithOutsidePointerEventsDisabled: new Set(),\n branches: new Set()\n});\nconst $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ $kqwpH$forwardRef((props, forwardedRef)=>{\n var _node$ownerDocument;\n const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;\n const context = $kqwpH$useContext($5cb92bef7577960e$var$DismissableLayerContext);\n const [node1, setNode] = $kqwpH$useState(null);\n const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;\n const [, force] = $kqwpH$useState({});\n const composedRefs = $kqwpH$useComposedRefs(forwardedRef, (node)=>setNode(node)\n );\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [\n ...context.layersWithOutsidePointerEventsDisabled\n ].slice(-1); // prettier-ignore\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore\n const index = node1 ? layers.indexOf(node1) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{\n const target = event.target;\n const isPointerDownOnBranch = [\n ...context.branches\n ].some((branch)=>branch.contains(target)\n );\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);\n onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);\n if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();\n }, ownerDocument);\n const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{\n const target = event.target;\n const isFocusInBranch = [\n ...context.branches\n ].some((branch)=>branch.contains(target)\n );\n if (isFocusInBranch) return;\n onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);\n onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);\n if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();\n }, ownerDocument);\n $kqwpH$useEscapeKeydown((event)=>{\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n $kqwpH$useEffect(()=>{\n if (!node1) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = 'none';\n }\n context.layersWithOutsidePointerEventsDisabled.add(node1);\n }\n context.layers.add(node1);\n $5cb92bef7577960e$var$dispatchUpdate();\n return ()=>{\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;\n };\n }, [\n node1,\n ownerDocument,\n disableOutsidePointerEvents,\n context\n ]);\n /**\n * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect\n * because a change to `disableOutsidePointerEvents` would remove this layer from the stack\n * and add it to the end again so the layering order wouldn't be _creation order_.\n * We only want them to be removed from context stacks when unmounted.\n */ $kqwpH$useEffect(()=>{\n return ()=>{\n if (!node1) return;\n context.layers.delete(node1);\n context.layersWithOutsidePointerEventsDisabled.delete(node1);\n $5cb92bef7577960e$var$dispatchUpdate();\n };\n }, [\n node1,\n context\n ]);\n $kqwpH$useEffect(()=>{\n const handleUpdate = ()=>force({})\n ;\n document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);\n return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)\n ;\n }, []);\n return /*#__PURE__*/ $kqwpH$createElement($kqwpH$Primitive.div, $kqwpH$babelruntimehelpersesmextends({}, layerProps, {\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,\n ...props.style\n },\n onFocusCapture: $kqwpH$composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: $kqwpH$composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: $kqwpH$composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)\n }));\n});\n/*#__PURE__*/ Object.assign($5cb92bef7577960e$export$177fb62ff3ec1f22, {\n displayName: $5cb92bef7577960e$var$DISMISSABLE_LAYER_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * DismissableLayerBranch\n * -----------------------------------------------------------------------------------------------*/ const $5cb92bef7577960e$var$BRANCH_NAME = 'DismissableLayerBranch';\nconst $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ $kqwpH$forwardRef((props, forwardedRef)=>{\n const context = $kqwpH$useContext($5cb92bef7577960e$var$DismissableLayerContext);\n const ref = $kqwpH$useRef(null);\n const composedRefs = $kqwpH$useComposedRefs(forwardedRef, ref);\n $kqwpH$useEffect(()=>{\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return ()=>{\n context.branches.delete(node);\n };\n }\n }, [\n context.branches\n ]);\n return /*#__PURE__*/ $kqwpH$createElement($kqwpH$Primitive.div, $kqwpH$babelruntimehelpersesmextends({}, props, {\n ref: composedRefs\n }));\n});\n/*#__PURE__*/ Object.assign($5cb92bef7577960e$export$4d5eb2109db14228, {\n displayName: $5cb92bef7577960e$var$BRANCH_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ /**\n * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`\n * to mimic layer dismissing behaviour present in OS.\n * Returns props to pass to the node we want to check for outside events.\n */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {\n const handlePointerDownOutside = $kqwpH$useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = $kqwpH$useRef(false);\n const handleClickRef = $kqwpH$useRef(()=>{});\n $kqwpH$useEffect(()=>{\n const handlePointerDown = (event)=>{\n if (event.target && !isPointerInsideReactTreeRef.current) {\n const eventDetail = {\n originalEvent: event\n };\n function handleAndDispatchPointerDownOutsideEvent() {\n $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {\n discrete: true\n });\n }\n /**\n * On touch devices, we need to wait for a click event because browsers implement\n * a ~350ms delay between the time the user stops touching the display and when the\n * browser executres events. We need to ensure we don't reactivate pointer-events within\n * this timeframe otherwise the browser may execute events that should have been prevented.\n *\n * Additionally, this also lets us deal automatically with cancellations when a click event\n * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.\n *\n * This is why we also continuously remove the previous listener, because we cannot be\n * certain that it was raised, and therefore cleaned-up.\n */ if (event.pointerType === 'touch') {\n ownerDocument.removeEventListener('click', handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;\n ownerDocument.addEventListener('click', handleClickRef.current, {\n once: true\n });\n } else handleAndDispatchPointerDownOutsideEvent();\n } else // We need to remove the event listener in case the outside click has been canceled.\n // See: https://github.com/radix-ui/primitives/issues/2171\n ownerDocument.removeEventListener('click', handleClickRef.current);\n isPointerInsideReactTreeRef.current = false;\n };\n /**\n * if this hook executes in a component that mounts via a `pointerdown` event, the event\n * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid\n * this by delaying the event listener registration on the document.\n * This is not React specific, but rather how the DOM works, ie:\n * ```\n * button.addEventListener('pointerdown', () => {\n * console.log('I will log');\n * document.addEventListener('pointerdown', () => {\n * console.log('I will also log');\n * })\n * });\n */ const timerId = window.setTimeout(()=>{\n ownerDocument.addEventListener('pointerdown', handlePointerDown);\n }, 0);\n return ()=>{\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener('pointerdown', handlePointerDown);\n ownerDocument.removeEventListener('click', handleClickRef.current);\n };\n }, [\n ownerDocument,\n handlePointerDownOutside\n ]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true\n };\n}\n/**\n * Listens for when focus happens outside a react subtree.\n * Returns props to pass to the root (node) of the subtree we want to check.\n */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {\n const handleFocusOutside = $kqwpH$useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = $kqwpH$useRef(false);\n $kqwpH$useEffect(()=>{\n const handleFocus = (event)=>{\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = {\n originalEvent: event\n };\n $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener('focusin', handleFocus);\n return ()=>ownerDocument.removeEventListener('focusin', handleFocus)\n ;\n }, [\n ownerDocument,\n handleFocusOutside\n ]);\n return {\n onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true\n ,\n onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false\n };\n}\nfunction $5cb92bef7577960e$var$dispatchUpdate() {\n const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, {\n bubbles: false,\n cancelable: true,\n detail: detail\n });\n if (handler) target.addEventListener(name, handler, {\n once: true\n });\n if (discrete) $kqwpH$dispatchDiscreteCustomEvent(target, event);\n else target.dispatchEvent(event);\n}\nconst $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22;\nconst $5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$4d5eb2109db14228;\n\n\n\n\nexport {$5cb92bef7577960e$export$177fb62ff3ec1f22 as DismissableLayer, $5cb92bef7577960e$export$4d5eb2109db14228 as DismissableLayerBranch, $5cb92bef7577960e$export$be92b6f5f03c0fe9 as Root, $5cb92bef7577960e$export$aecb2ddcb55c95be as Branch};\n//# sourceMappingURL=index.mjs.map\n"],"names":["$kqwpH$createContext","$kqwpH$forwardRef","$kqwpH$useContext","$kqwpH$useState","$kqwpH$useComposedRefs","$kqwpH$useEscapeKeydown","$kqwpH$useEffect","$kqwpH$createElement","$kqwpH$Primitive","$kqwpH$babelruntimehelpersesmextends","$kqwpH$composeEventHandlers","$kqwpH$useCallbackRef","$kqwpH$useRef","$kqwpH$dispatch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AC,KAAK,CAAC,CAAC;AACrC;;;;"}
1
+ {"version":3,"file":"index.mjs.js","sources":["../../../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;;;;;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;"}