@siberiacancode/reactuse 0.0.96 → 0.0.98

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 (320) hide show
  1. package/dist/cjs/{_rollupPluginBabelHelpers-zZt1zBDH.js → _rollupPluginBabelHelpers-Du0ODElA.js} +2 -2
  2. package/dist/cjs/_rollupPluginBabelHelpers-Du0ODElA.js.map +1 -0
  3. package/dist/cjs/hooks/index.js +2 -2
  4. package/dist/cjs/hooks/useActiveElement/useActiveElement.js +2 -2
  5. package/dist/cjs/hooks/useAsync/useAsync.js +2 -2
  6. package/dist/cjs/hooks/useBattery/useBattery.js +2 -2
  7. package/dist/cjs/hooks/useBluetooth/useBluetooth.js +2 -2
  8. package/dist/cjs/hooks/useBoolean/useBoolean.js +2 -2
  9. package/dist/cjs/hooks/useBreakpoints/useBreakpoints.js +2 -2
  10. package/dist/cjs/hooks/useBreakpoints/useBreakpoints.js.map +1 -1
  11. package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
  12. package/dist/cjs/hooks/useClickOutside/useClickOutside.js +2 -2
  13. package/dist/cjs/hooks/useClipboard/useClipboard.js +2 -2
  14. package/dist/cjs/hooks/useConst/useConst.js +1 -1
  15. package/dist/cjs/hooks/useCookie/useCookie.js +2 -2
  16. package/dist/cjs/hooks/useCookie/useCookie.js.map +1 -1
  17. package/dist/cjs/hooks/useCookies/useCookies.js +3 -0
  18. package/dist/cjs/hooks/useCookies/useCookies.js.map +1 -0
  19. package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
  20. package/dist/cjs/hooks/useCssVar/useCssVar.js +2 -2
  21. package/dist/cjs/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
  22. package/dist/cjs/hooks/useDebounceValue/useDebounceValue.js +2 -2
  23. package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
  24. package/dist/cjs/hooks/useDeviceMotion/useDeviceMotion.js +2 -2
  25. package/dist/cjs/hooks/useDeviceOrientation/useDeviceOrientation.js +2 -2
  26. package/dist/cjs/hooks/useDevicePixelRatio/useDevicePixelRatio.js +2 -2
  27. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
  28. package/dist/cjs/hooks/useDisclosure/useDisclosure.js +2 -2
  29. package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.js +2 -2
  30. package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
  31. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  32. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  33. package/dist/cjs/hooks/useElementSize/useElementSize.js +2 -2
  34. package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
  35. package/dist/cjs/hooks/useEventListener/useEventListener.js +2 -2
  36. package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
  37. package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
  38. package/dist/cjs/hooks/useField/useField.js +2 -2
  39. package/dist/cjs/hooks/useFileDialog/useFileDialog.js +2 -2
  40. package/dist/cjs/hooks/useFocus/useFocus.js +2 -2
  41. package/dist/cjs/hooks/useFps/useFps.js +2 -2
  42. package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
  43. package/dist/cjs/hooks/useGamepad/helpers/index.js +1 -1
  44. package/dist/cjs/hooks/useGamepad/helpers/mapGamepadToXbox360Controller.js +1 -1
  45. package/dist/cjs/hooks/useGamepad/useGamepad.js +2 -2
  46. package/dist/cjs/hooks/useGamepad/useGamepad.js.map +1 -1
  47. package/dist/cjs/hooks/useGeolocation/useGeolocation.js +2 -2
  48. package/dist/cjs/hooks/useHash/useHash.js +2 -2
  49. package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
  50. package/dist/cjs/hooks/useHover/useHover.js +2 -2
  51. package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
  52. package/dist/cjs/hooks/useImage/useImage.js +2 -2
  53. package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
  54. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  55. package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
  56. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  57. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  58. package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
  59. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
  60. package/dist/cjs/hooks/useKeyboard/useKeyboard.js +2 -2
  61. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
  62. package/dist/cjs/hooks/useLastChanged/useLastChanged.js +2 -2
  63. package/dist/cjs/hooks/useLatest/useLatest.js +1 -1
  64. package/dist/cjs/hooks/useList/useList.js +2 -2
  65. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
  66. package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
  67. package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
  68. package/dist/cjs/hooks/useMap/useMap.js +2 -2
  69. package/dist/cjs/hooks/useMeasure/useMeasure.js +2 -2
  70. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
  71. package/dist/cjs/hooks/useMemory/useMemory.js +2 -2
  72. package/dist/cjs/hooks/useMount/useMount.js +1 -1
  73. package/dist/cjs/hooks/useMouse/useMouse.js +2 -2
  74. package/dist/cjs/hooks/useMutation/useMutation.js +2 -2
  75. package/dist/cjs/hooks/useMutationObserver/useMutationObserver.js +2 -2
  76. package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
  77. package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.js +2 -2
  78. package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
  79. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  80. package/dist/cjs/hooks/useOptimistic/useOptimistic.js +2 -2
  81. package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
  82. package/dist/cjs/hooks/useOtpCredential/useOtpCredential.js +2 -2
  83. package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
  84. package/dist/cjs/hooks/usePaint/usePaint.js +2 -2
  85. package/dist/cjs/hooks/usePaint/usePaint.js.map +1 -1
  86. package/dist/cjs/hooks/useParallax/useParallax.js +2 -2
  87. package/dist/cjs/hooks/usePermission/usePermission.js +2 -2
  88. package/dist/cjs/hooks/usePointerLock/usePointerLock.js +2 -2
  89. package/dist/cjs/hooks/usePostMessage/usePostMessage.js +1 -1
  90. package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  91. package/dist/cjs/hooks/usePreferredContrast/usePreferredContrast.js +1 -1
  92. package/dist/cjs/hooks/usePreferredDark/usePreferredDark.js +1 -1
  93. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  94. package/dist/cjs/hooks/usePreferredReducedMotion/usePreferredReducedMotion.js +1 -1
  95. package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
  96. package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
  97. package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
  98. package/dist/cjs/hooks/useRaf/useRaf.js +2 -2
  99. package/dist/cjs/hooks/useRafValue/useRafValue.js +2 -2
  100. package/dist/cjs/hooks/useRefState/useRefState.js +2 -2
  101. package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
  102. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
  103. package/dist/cjs/hooks/useRerender/useRerender.js +1 -1
  104. package/dist/cjs/hooks/useResizeObserver/useResizeObserver.js +2 -2
  105. package/dist/cjs/hooks/useScreenOrientation/useScreenOrientation.js +2 -2
  106. package/dist/cjs/hooks/useScript/useScript.js +2 -2
  107. package/dist/cjs/hooks/useScroll/useScroll.js +2 -2
  108. package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.js +2 -2
  109. package/dist/cjs/hooks/useScrollTo/useScrollTo.js +2 -2
  110. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
  111. package/dist/cjs/hooks/useSet/useSet.js +2 -2
  112. package/dist/cjs/hooks/useShare/useShare.js +2 -2
  113. package/dist/cjs/hooks/useStateHistory/useStateHistory.js +2 -2
  114. package/dist/cjs/hooks/useStep/useStep.js +2 -2
  115. package/dist/cjs/hooks/useStopwatch/useStopwatch.js +2 -2
  116. package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
  117. package/dist/cjs/hooks/useTextDirection/useTextDirection.js +2 -2
  118. package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
  119. package/dist/cjs/hooks/useThrottleCallback/useThrottleCallback.js +1 -1
  120. package/dist/cjs/hooks/useThrottleValue/useThrottleValue.js +2 -2
  121. package/dist/cjs/hooks/useTime/useTime.js +2 -2
  122. package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
  123. package/dist/cjs/hooks/useTimer/useTimer.js +2 -2
  124. package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
  125. package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
  126. package/dist/cjs/hooks/useVibrate/useVibrate.js +2 -2
  127. package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
  128. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +2 -2
  129. package/dist/cjs/hooks/useWindowFocus/useWindowFocus.js +2 -2
  130. package/dist/cjs/hooks/useWindowScroll/useWindowScroll.js +2 -2
  131. package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
  132. package/dist/cjs/hooks/useWizard/useWizard.js +2 -2
  133. package/dist/cjs/index.js +2 -2
  134. package/dist/cjs/utils/helpers/debounce.js +1 -1
  135. package/dist/cjs/utils/helpers/getDate.js +1 -1
  136. package/dist/cjs/utils/helpers/getElement.js +1 -1
  137. package/dist/cjs/utils/helpers/getRetry.js +1 -1
  138. package/dist/cjs/utils/helpers/index.js +2 -2
  139. package/dist/cjs/utils/helpers/isTarget.js +2 -2
  140. package/dist/cjs/utils/helpers/throttle.js +1 -1
  141. package/dist/esm/{_rollupPluginBabelHelpers-B03Kl8w9.js → _rollupPluginBabelHelpers-DMxTFLvA.js} +3 -3
  142. package/dist/esm/_rollupPluginBabelHelpers-DMxTFLvA.js.map +1 -0
  143. package/dist/esm/hooks/index.js +2 -2
  144. package/dist/esm/hooks/useActiveElement/useActiveElement.js +2 -2
  145. package/dist/esm/hooks/useAsync/useAsync.js +2 -2
  146. package/dist/esm/hooks/useBattery/useBattery.js +2 -2
  147. package/dist/esm/hooks/useBluetooth/useBluetooth.js +2 -2
  148. package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
  149. package/dist/esm/hooks/useBreakpoints/useBreakpoints.js +2 -2
  150. package/dist/esm/hooks/useBreakpoints/useBreakpoints.js.map +1 -1
  151. package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
  152. package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
  153. package/dist/esm/hooks/useClipboard/useClipboard.js +2 -2
  154. package/dist/esm/hooks/useConst/useConst.js +1 -1
  155. package/dist/esm/hooks/useCookie/useCookie.js +2 -2
  156. package/dist/esm/hooks/useCookie/useCookie.js.map +1 -1
  157. package/dist/esm/hooks/useCookies/useCookies.js +3 -0
  158. package/dist/esm/hooks/useCookies/useCookies.js.map +1 -0
  159. package/dist/esm/hooks/useCounter/useCounter.js +2 -2
  160. package/dist/esm/hooks/useCssVar/useCssVar.js +2 -2
  161. package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
  162. package/dist/esm/hooks/useDebounceValue/useDebounceValue.js +2 -2
  163. package/dist/esm/hooks/useDefault/useDefault.js +2 -2
  164. package/dist/esm/hooks/useDeviceMotion/useDeviceMotion.js +2 -2
  165. package/dist/esm/hooks/useDeviceOrientation/useDeviceOrientation.js +2 -2
  166. package/dist/esm/hooks/useDevicePixelRatio/useDevicePixelRatio.js +2 -2
  167. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +1 -1
  168. package/dist/esm/hooks/useDisclosure/useDisclosure.js +2 -2
  169. package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.js +2 -2
  170. package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
  171. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  172. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  173. package/dist/esm/hooks/useElementSize/useElementSize.js +2 -2
  174. package/dist/esm/hooks/useEvent/useEvent.js +1 -1
  175. package/dist/esm/hooks/useEventListener/useEventListener.js +2 -2
  176. package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
  177. package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
  178. package/dist/esm/hooks/useField/useField.js +2 -2
  179. package/dist/esm/hooks/useFileDialog/useFileDialog.js +2 -2
  180. package/dist/esm/hooks/useFocus/useFocus.js +2 -2
  181. package/dist/esm/hooks/useFps/useFps.js +2 -2
  182. package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
  183. package/dist/esm/hooks/useGamepad/helpers/index.js +1 -1
  184. package/dist/esm/hooks/useGamepad/helpers/mapGamepadToXbox360Controller.js +1 -1
  185. package/dist/esm/hooks/useGamepad/useGamepad.js +2 -2
  186. package/dist/esm/hooks/useGamepad/useGamepad.js.map +1 -1
  187. package/dist/esm/hooks/useGeolocation/useGeolocation.js +2 -2
  188. package/dist/esm/hooks/useHash/useHash.js +2 -2
  189. package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
  190. package/dist/esm/hooks/useHover/useHover.js +2 -2
  191. package/dist/esm/hooks/useIdle/useIdle.js +2 -2
  192. package/dist/esm/hooks/useImage/useImage.js +2 -2
  193. package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
  194. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  195. package/dist/esm/hooks/useInterval/useInterval.js +2 -2
  196. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  197. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  198. package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
  199. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
  200. package/dist/esm/hooks/useKeyboard/useKeyboard.js +2 -2
  201. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
  202. package/dist/esm/hooks/useLastChanged/useLastChanged.js +2 -2
  203. package/dist/esm/hooks/useLatest/useLatest.js +1 -1
  204. package/dist/esm/hooks/useList/useList.js +2 -2
  205. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
  206. package/dist/esm/hooks/useLogger/useLogger.js +2 -2
  207. package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
  208. package/dist/esm/hooks/useMap/useMap.js +2 -2
  209. package/dist/esm/hooks/useMeasure/useMeasure.js +2 -2
  210. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
  211. package/dist/esm/hooks/useMemory/useMemory.js +2 -2
  212. package/dist/esm/hooks/useMount/useMount.js +1 -1
  213. package/dist/esm/hooks/useMouse/useMouse.js +2 -2
  214. package/dist/esm/hooks/useMutation/useMutation.js +2 -2
  215. package/dist/esm/hooks/useMutationObserver/useMutationObserver.js +2 -2
  216. package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
  217. package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.js +2 -2
  218. package/dist/esm/hooks/useOnline/useOnline.js +1 -1
  219. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  220. package/dist/esm/hooks/useOptimistic/useOptimistic.js +2 -2
  221. package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
  222. package/dist/esm/hooks/useOtpCredential/useOtpCredential.js +2 -2
  223. package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
  224. package/dist/esm/hooks/usePaint/usePaint.js +2 -2
  225. package/dist/esm/hooks/usePaint/usePaint.js.map +1 -1
  226. package/dist/esm/hooks/useParallax/useParallax.js +2 -2
  227. package/dist/esm/hooks/usePermission/usePermission.js +2 -2
  228. package/dist/esm/hooks/usePointerLock/usePointerLock.js +2 -2
  229. package/dist/esm/hooks/usePostMessage/usePostMessage.js +1 -1
  230. package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  231. package/dist/esm/hooks/usePreferredContrast/usePreferredContrast.js +1 -1
  232. package/dist/esm/hooks/usePreferredDark/usePreferredDark.js +1 -1
  233. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  234. package/dist/esm/hooks/usePreferredReducedMotion/usePreferredReducedMotion.js +1 -1
  235. package/dist/esm/hooks/usePrevious/usePrevious.js +1 -1
  236. package/dist/esm/hooks/useQuery/useQuery.js +2 -2
  237. package/dist/esm/hooks/useQueue/useQueue.js +2 -2
  238. package/dist/esm/hooks/useRaf/useRaf.js +2 -2
  239. package/dist/esm/hooks/useRafValue/useRafValue.js +2 -2
  240. package/dist/esm/hooks/useRefState/useRefState.js +2 -2
  241. package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
  242. package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +1 -1
  243. package/dist/esm/hooks/useRerender/useRerender.js +1 -1
  244. package/dist/esm/hooks/useResizeObserver/useResizeObserver.js +2 -2
  245. package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.js +2 -2
  246. package/dist/esm/hooks/useScript/useScript.js +2 -2
  247. package/dist/esm/hooks/useScroll/useScroll.js +2 -2
  248. package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.js +2 -2
  249. package/dist/esm/hooks/useScrollTo/useScrollTo.js +2 -2
  250. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
  251. package/dist/esm/hooks/useSet/useSet.js +2 -2
  252. package/dist/esm/hooks/useShare/useShare.js +2 -2
  253. package/dist/esm/hooks/useStateHistory/useStateHistory.js +2 -2
  254. package/dist/esm/hooks/useStep/useStep.js +2 -2
  255. package/dist/esm/hooks/useStopwatch/useStopwatch.js +2 -2
  256. package/dist/esm/hooks/useStorage/useStorage.js +2 -2
  257. package/dist/esm/hooks/useTextDirection/useTextDirection.js +2 -2
  258. package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
  259. package/dist/esm/hooks/useThrottleCallback/useThrottleCallback.js +1 -1
  260. package/dist/esm/hooks/useThrottleValue/useThrottleValue.js +2 -2
  261. package/dist/esm/hooks/useTime/useTime.js +2 -2
  262. package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
  263. package/dist/esm/hooks/useTimer/useTimer.js +2 -2
  264. package/dist/esm/hooks/useToggle/useToggle.js +2 -2
  265. package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
  266. package/dist/esm/hooks/useVibrate/useVibrate.js +2 -2
  267. package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
  268. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +2 -2
  269. package/dist/esm/hooks/useWindowFocus/useWindowFocus.js +2 -2
  270. package/dist/esm/hooks/useWindowScroll/useWindowScroll.js +2 -2
  271. package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
  272. package/dist/esm/hooks/useWizard/useWizard.js +2 -2
  273. package/dist/esm/index.js +2 -2
  274. package/dist/esm/utils/helpers/debounce.js +1 -1
  275. package/dist/esm/utils/helpers/getDate.js +1 -1
  276. package/dist/esm/utils/helpers/getElement.js +1 -1
  277. package/dist/esm/utils/helpers/getRetry.js +1 -1
  278. package/dist/esm/utils/helpers/index.js +2 -2
  279. package/dist/esm/utils/helpers/isTarget.js +2 -2
  280. package/dist/esm/utils/helpers/throttle.js +1 -1
  281. package/dist/types/index.d.ts +83 -56
  282. package/package.json +91 -91
  283. package/dist/cjs/_rollupPluginBabelHelpers-zZt1zBDH.js.map +0 -1
  284. package/dist/cjs/hooks/useBreakpoints/helpers/breakpoints.js +0 -3
  285. package/dist/cjs/hooks/useBreakpoints/helpers/breakpoints.js.map +0 -1
  286. package/dist/cjs/hooks/useBreakpoints/helpers/index.js +0 -3
  287. package/dist/cjs/hooks/useBreakpoints/helpers/index.js.map +0 -1
  288. package/dist/cjs/hooks/useCookie/helpers/clearCookies.js +0 -3
  289. package/dist/cjs/hooks/useCookie/helpers/clearCookies.js.map +0 -1
  290. package/dist/cjs/hooks/useCookie/helpers/getCookies.js +0 -3
  291. package/dist/cjs/hooks/useCookie/helpers/getCookies.js.map +0 -1
  292. package/dist/cjs/hooks/useCookie/helpers/index.js +0 -3
  293. package/dist/cjs/hooks/useCookie/helpers/index.js.map +0 -1
  294. package/dist/cjs/hooks/useCookie/helpers/removeCookie.js +0 -3
  295. package/dist/cjs/hooks/useCookie/helpers/removeCookie.js.map +0 -1
  296. package/dist/cjs/hooks/useCookie/helpers/setCookie.js +0 -3
  297. package/dist/cjs/hooks/useCookie/helpers/setCookie.js.map +0 -1
  298. package/dist/cjs/hooks/usePaint/helpers/Paint.js +0 -3
  299. package/dist/cjs/hooks/usePaint/helpers/Paint.js.map +0 -1
  300. package/dist/cjs/hooks/usePaint/helpers/Pointer.js +0 -3
  301. package/dist/cjs/hooks/usePaint/helpers/Pointer.js.map +0 -1
  302. package/dist/esm/_rollupPluginBabelHelpers-B03Kl8w9.js.map +0 -1
  303. package/dist/esm/hooks/useBreakpoints/helpers/breakpoints.js +0 -3
  304. package/dist/esm/hooks/useBreakpoints/helpers/breakpoints.js.map +0 -1
  305. package/dist/esm/hooks/useBreakpoints/helpers/index.js +0 -3
  306. package/dist/esm/hooks/useBreakpoints/helpers/index.js.map +0 -1
  307. package/dist/esm/hooks/useCookie/helpers/clearCookies.js +0 -3
  308. package/dist/esm/hooks/useCookie/helpers/clearCookies.js.map +0 -1
  309. package/dist/esm/hooks/useCookie/helpers/getCookies.js +0 -3
  310. package/dist/esm/hooks/useCookie/helpers/getCookies.js.map +0 -1
  311. package/dist/esm/hooks/useCookie/helpers/index.js +0 -3
  312. package/dist/esm/hooks/useCookie/helpers/index.js.map +0 -1
  313. package/dist/esm/hooks/useCookie/helpers/removeCookie.js +0 -3
  314. package/dist/esm/hooks/useCookie/helpers/removeCookie.js.map +0 -1
  315. package/dist/esm/hooks/useCookie/helpers/setCookie.js +0 -3
  316. package/dist/esm/hooks/useCookie/helpers/setCookie.js.map +0 -1
  317. package/dist/esm/hooks/usePaint/helpers/Paint.js +0 -3
  318. package/dist/esm/hooks/usePaint/helpers/Paint.js.map +0 -1
  319. package/dist/esm/hooks/usePaint/helpers/Pointer.js +0 -3
  320. package/dist/esm/hooks/usePaint/helpers/Pointer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"usePaint.js","sources":["../../../../src/hooks/usePaint/usePaint.ts"],"sourcesContent":["import type { RefObject } from 'react';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { getElement } from '@/utils/helpers';\n\nimport type { Point } from './helpers/Pointer';\n\nimport { useEvent } from '../useEvent/useEvent';\nimport { Paint } from './helpers/Paint';\n\nconst DEFAULT_BRUSH_RADIUS = 10;\n\nexport interface UsePaintOptions {\n /** Brush color */\n color?: string;\n /** Initial lines */\n initialLines?: Paint['lines'];\n /** Brush opacity */\n opacity?: number;\n /** Brush radius */\n radius?: number;\n /** Smooth brush movement */\n smooth?: boolean;\n /** Callback when the mouse is down */\n onMouseDown?: (event: MouseEvent, paint: Paint) => void;\n /** Callback when the mouse is moved */\n onMouseMove?: (event: MouseEvent, paint: Paint) => void;\n /** Callback when the mouse is up */\n onMouseUp?: (event: MouseEvent, paint: Paint) => void;\n}\n\nexport interface UsePaintReturn {\n drawing: boolean;\n lines: Paint['lines'];\n clear: () => void;\n draw: (points: Point[], color: string, opacity: number, radius: number) => void;\n undo: () => void;\n}\n\n/** The use paint return type */\nexport type UsePaintTarget =\n | (() => HTMLCanvasElement)\n | HTMLCanvasElement\n | RefObject<HTMLCanvasElement>;\n\nexport interface UsePaint {\n <Target extends UsePaintTarget>(target: Target, options?: UsePaintOptions): UsePaintReturn;\n\n (\n options?: UsePaintOptions,\n target?: never\n ): { ref: RefObject<HTMLCanvasElement> } & UsePaintReturn;\n}\n\n/**\n * @name usePaint\n * @description - Hook that allows you to draw in a specific area\n * @category Browser\n *\n * @overload\n * @template Target The target element\n * @param {Target} target The target element to be painted\n * @param {UsePaintOptions} [options] The options to be used\n * @returns {UsePaintReturn} An object containing the current pencil options and functions to interact with the paint\n *\n * @example\n * const drawing = usePaint(canvasRef);\n *\n * @overload\n * @param {UsePaintOptions} [options] The options to be used\n * @returns {UsePaintReturn & { ref: RefObject<HTMLCanvasElement> }} An object containing the current pencil options and functions to interact with the paint\n *\n * @example\n * const { ref, drawing } = usePaint();\n */\n\nexport const usePaint = ((...params: any[]) => {\n const target = (\n typeof params[0] === 'object' && !('current' in params[0]) ? undefined : params[0]\n ) as UsePaintTarget | undefined;\n const options = (target ? params[1] : params[0]) as UsePaintOptions | undefined;\n\n const color = options?.color ?? 'black';\n const opacity = options?.opacity ?? 1;\n const radius = options?.radius ?? DEFAULT_BRUSH_RADIUS;\n\n const paintRef = useRef<Paint>(\n new Paint({\n x: 0,\n y: 0,\n radius: options?.radius ?? DEFAULT_BRUSH_RADIUS,\n smooth: options?.smooth ?? false\n })\n );\n const [drawing, setIsDrawing] = useState(false);\n const internalRef = useRef<HTMLCanvasElement>(null);\n const contextRef = useRef<CanvasRenderingContext2D | null>(null);\n\n const draw = (points: Point[], color: string, opacity: number, radius: number) => {\n if (!contextRef.current) return;\n\n contextRef.current.globalAlpha = opacity;\n contextRef.current.strokeStyle = color;\n contextRef.current.lineWidth = radius * 2;\n contextRef.current.lineCap = 'round';\n contextRef.current.lineJoin = 'round';\n\n let p1 = points[0];\n let p2 = points[1];\n\n contextRef.current.beginPath();\n\n for (let i = 1; i < points.length; i += 1) {\n const midPoint = {\n x: p1.x + (p2.x - p1.x) / 2,\n y: p1.y + (p2.y - p1.y) / 2\n };\n contextRef.current.quadraticCurveTo(p1.x, p1.y, midPoint.x, midPoint.y);\n p1 = points[i];\n p2 = points[i + 1];\n }\n contextRef.current.lineTo(p1.x, p1.y);\n contextRef.current.stroke();\n };\n\n const clearCanvas = () => {\n if (!contextRef.current) return;\n contextRef.current.clearRect(\n 0,\n 0,\n contextRef.current.canvas.width,\n contextRef.current.canvas.height\n );\n };\n\n const onMouseMove = useEvent((event: MouseEvent) => {\n if (!drawing) return;\n options?.onMouseMove?.(event, paintRef.current);\n\n const point = { x: event.offsetX, y: event.offsetY };\n\n const isUpdated = paintRef.current.update(point);\n\n if (!isUpdated) return;\n if (!contextRef.current) return;\n clearCanvas();\n contextRef.current.clearRect(\n 0,\n 0,\n contextRef.current.canvas.width,\n contextRef.current.canvas.height\n );\n\n // const brush = paintRef.current.getBrushCoordinates();\n // // Draw brush point\n // contextRef.current.beginPath();\n // contextRef.current.fillStyle = 'red';\n // contextRef.current.arc(brush.x, brush.y, radius, 0, Math.PI * 2, true);\n // contextRef.current.fill();\n\n // // Draw the lazy radius.\n // contextRef.current.beginPath();\n // contextRef.current.strokeStyle = '#ccc';\n // contextRef.current.arc(brush.x, brush.y, radius * 2, 0, Math.PI * 2, true);\n // contextRef.current.stroke();\n\n paintRef.current.lines.forEach(({ points, color, opacity, radius }) =>\n draw(points, color, opacity, radius)\n );\n draw(paintRef.current.points, color, opacity, radius);\n });\n\n const onMouseDown = useEvent((event: MouseEvent) => {\n if (!contextRef.current) return;\n\n const point = { x: event.offsetX, y: event.offsetY };\n paintRef.current.brush.update(point);\n paintRef.current.points.push(point);\n draw(paintRef.current.points, color, opacity, radius);\n\n options?.onMouseDown?.(event, paintRef.current);\n setIsDrawing(true);\n });\n\n const onMouseUp = useEvent((event: MouseEvent) => {\n if (!contextRef.current) return;\n\n if (paintRef.current.points.length) {\n paintRef.current.lines.push({ points: paintRef.current.points, color, opacity, radius });\n paintRef.current.points = [];\n }\n\n options?.onMouseUp?.(event, paintRef.current);\n setIsDrawing(false);\n });\n\n const clear = () => {\n if (!contextRef.current) return;\n clearCanvas();\n paintRef.current.lines = [];\n paintRef.current.points = [];\n };\n\n const undo = () => {\n if (!contextRef.current) return;\n clearCanvas();\n\n paintRef.current.lines.pop();\n paintRef.current.lines.forEach(({ points, color, opacity, radius }) =>\n draw(points, color, opacity, radius)\n );\n };\n\n useEffect(() => {\n const element = (target ? getElement(target) : internalRef.current) as HTMLCanvasElement;\n if (!element) return;\n contextRef.current = element.getContext('2d');\n\n if (options?.initialLines) {\n paintRef.current.lines = options.initialLines;\n options.initialLines.forEach(({ points, color, opacity, radius }) =>\n draw(points, color, opacity, radius)\n );\n }\n\n element.addEventListener('mousedown', onMouseDown);\n element.addEventListener('mousemove', onMouseMove);\n element.addEventListener('mouseup', onMouseUp);\n\n return () => {\n if (!element) return;\n element.removeEventListener('mousedown', onMouseDown);\n element.removeEventListener('mousemove', onMouseMove);\n element.removeEventListener('mouseup', onMouseUp);\n };\n }, []);\n\n if (target) return { drawing, clear, undo, draw, lines: paintRef.current.lines };\n return { ref: internalRef, drawing, clear, undo, draw, lines: paintRef.current.lines };\n}) as UsePaint;\n"],"names":["_options$color","_options$opacity","_options$radius","_options$radius2","_options$smooth","target","_typeof","arguments","length","undefined","options","color","opacity","radius","paintRef","useRef","Paint","x","y","smooth","_useState","useState","_useState2","_slicedToArray","drawing","setIsDrawing","internalRef","contextRef","draw","points","current","globalAlpha","strokeStyle","lineWidth","lineCap","lineJoin","p1","p2","beginPath","i","midPoint","quadraticCurveTo","lineTo","stroke","clearCanvas","clearRect","canvas","width","height","onMouseMove","useEvent","event","_options$onMouseMove","call","point","offsetX","offsetY","update","lines","forEach","_ref","onMouseDown","_options$onMouseDown","brush","push","onMouseUp","_options$onMouseUp","clear","undo","pop","_ref2","useEffect","element","getElement","getContext","initialLines","_ref3","addEventListener","removeEventListener","ref"],"mappings":";kQA6EyB,WAAsB,IAAAA,EAAAC,EAAAC,EAAAC,EAAAC,EACvCC,EACiB,WAArBC,EAAAA,QAAAC,UAAAC,QAAA,OAA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AAQiE,aAAahB,SAAQ,SAAAiB,GAAA,IAAG/C,EAAM+C,EAAN/C,OAAQlB,EAAKiE,EAALjE,MAAOC,EAAOgE,EAAPhE,QAASC,EAAM+D,EAAN/D,OAAM,OAC5De,EAAKC,EAAQlB,EAAOC,EAASC,EAAO,KAIxC2D,EAAQK,iBAAiB,YAAahB,GACtCW,EAAQK,iBAAiB,YAAa5B,GACtCuB,EAAQK,iBAAiB,UAAWZ,GAE7B,WACAO,IACLA,EAAQM,oBAAoB,YAAajB,GACzCW,EAAQM,oBAAoB,YAAa7B,GACzCuB,EAAQM,oBAAoB,UAAWb,GACxC,CACF,GAAE,IAEC5D,EAAe,CAAEmB,QAAAA,EAAS2C,MAAAA,EAAOC,KAAAA,EAAMxC,KAAAA,EAAM8B,MAAO5C,EAASgB,QAAQ4B,OAClE,CAAEqB,IAAKrD,EAAaF,QAAAA,EAAS2C,MAAAA,EAAOC,KAAAA,EAAMxC,KAAAA,EAAM8B,MAAO5C,EAASgB,QAAQ4B,MACjF"}
1
+ {"version":3,"file":"usePaint.js","sources":["../../../../src/hooks/usePaint/usePaint.ts"],"sourcesContent":["import type { RefObject } from 'react';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { getElement } from '@/utils/helpers';\n\nimport { useEvent } from '../useEvent/useEvent';\n\nconst DEFAULT_BRUSH_RADIUS = 10;\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport class Pointer implements Point {\n x: number;\n\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n update(point: Point) {\n this.x = point.x;\n this.y = point.y;\n }\n\n getDifferenceTo(point: Point) {\n return new Pointer(this.x - point.x, this.y - point.y);\n }\n\n getDistanceTo(point: Point) {\n const diff = this.getDifferenceTo(point);\n return Math.sqrt(diff.x ** 2 + diff.y ** 2);\n }\n\n getAngleTo(point: Point) {\n const diff = this.getDifferenceTo(point);\n return Math.atan2(diff.y, diff.x);\n }\n\n equalsTo(point: Point) {\n return this.x === point.x && this.y === point.y;\n }\n\n moveByAngle(\n // The angle in radians\n angle: number,\n // How much the point should be moved\n distance: number\n ) {\n // Rotate the angle based on the browser coordinate system ([0,0] in the top left)\n const angleRotated = angle + Math.PI / 2;\n\n this.x += Math.sin(angleRotated) * distance;\n this.y -= Math.cos(angleRotated) * distance;\n\n return this;\n }\n}\n\nexport class Paint {\n pointer: Pointer;\n\n brush: Pointer;\n\n radius: number;\n\n smooth: boolean = false;\n\n points: Point[] = [];\n\n lines: { points: Point[]; color: string; radius: number; opacity: number }[] = [];\n\n constructor({ x, y, radius, smooth }: { x: number; y: number; radius: number; smooth: boolean }) {\n this.smooth = smooth;\n this.pointer = new Pointer(x, y);\n this.brush = new Pointer(x, y);\n this.radius = radius;\n this.points = [];\n this.lines = [];\n }\n\n getBrushCoordinates() {\n return {\n x: this.brush.x,\n y: this.brush.y\n };\n }\n\n getPointerCoordinates() {\n return {\n x: this.pointer.x,\n y: this.pointer.y\n };\n }\n\n update(point: Point) {\n if (this.pointer.equalsTo(point)) return false;\n this.pointer.update(point);\n\n if (!this.smooth) {\n this.brush.update(point);\n this.points.push(this.getBrushCoordinates());\n return true;\n }\n\n const distance = this.pointer.getDistanceTo(this.brush);\n const angle = this.pointer.getAngleTo(this.brush);\n const isOutside = Math.round((distance - this.radius) * 10) / 10 > 0;\n\n if (isOutside) {\n const angleRotated = angle + Math.PI / 2;\n this.brush.update({\n x: this.brush.x + Math.sin(angleRotated) * (distance - this.radius),\n y: this.brush.y - Math.cos(angleRotated) * (distance - this.radius)\n });\n this.points.push(this.getBrushCoordinates());\n return true;\n }\n\n return false;\n }\n}\n\nexport interface UsePaintOptions {\n /** Brush color */\n color?: string;\n /** Initial lines */\n initialLines?: Paint['lines'];\n /** Brush opacity */\n opacity?: number;\n /** Brush radius */\n radius?: number;\n /** Smooth brush movement */\n smooth?: boolean;\n /** Callback when the mouse is down */\n onMouseDown?: (event: MouseEvent, paint: Paint) => void;\n /** Callback when the mouse is moved */\n onMouseMove?: (event: MouseEvent, paint: Paint) => void;\n /** Callback when the mouse is up */\n onMouseUp?: (event: MouseEvent, paint: Paint) => void;\n}\n\nexport interface UsePaintReturn {\n drawing: boolean;\n lines: Paint['lines'];\n clear: () => void;\n draw: (points: Point[], color: string, opacity: number, radius: number) => void;\n undo: () => void;\n}\n\n/** The use paint return type */\nexport type UsePaintTarget =\n | (() => HTMLCanvasElement)\n | HTMLCanvasElement\n | RefObject<HTMLCanvasElement>;\n\nexport interface UsePaint {\n <Target extends UsePaintTarget>(target: Target, options?: UsePaintOptions): UsePaintReturn;\n\n (\n options?: UsePaintOptions,\n target?: never\n ): { ref: RefObject<HTMLCanvasElement> } & UsePaintReturn;\n}\n\n/**\n * @name usePaint\n * @description - Hook that allows you to draw in a specific area\n * @category Browser\n *\n * @overload\n * @template Target The target element\n * @param {Target} target The target element to be painted\n * @param {UsePaintOptions} [options] The options to be used\n * @returns {UsePaintReturn} An object containing the current pencil options and functions to interact with the paint\n *\n * @example\n * const drawing = usePaint(canvasRef);\n *\n * @overload\n * @param {UsePaintOptions} [options] The options to be used\n * @returns {UsePaintReturn & { ref: RefObject<HTMLCanvasElement> }} An object containing the current pencil options and functions to interact with the paint\n *\n * @example\n * const { ref, drawing } = usePaint();\n */\nexport const usePaint = ((...params: any[]) => {\n const target = (\n typeof params[0] === 'object' && !('current' in params[0]) ? undefined : params[0]\n ) as UsePaintTarget | undefined;\n const options = (target ? params[1] : params[0]) as UsePaintOptions | undefined;\n\n const color = options?.color ?? 'black';\n const opacity = options?.opacity ?? 1;\n const radius = options?.radius ?? DEFAULT_BRUSH_RADIUS;\n\n const paintRef = useRef<Paint>(\n new Paint({\n x: 0,\n y: 0,\n radius: options?.radius ?? DEFAULT_BRUSH_RADIUS,\n smooth: options?.smooth ?? false\n })\n );\n const [drawing, setIsDrawing] = useState(false);\n const internalRef = useRef<HTMLCanvasElement>(null);\n const contextRef = useRef<CanvasRenderingContext2D | null>(null);\n\n const draw = (points: Point[], color: string, opacity: number, radius: number) => {\n if (!contextRef.current) return;\n\n contextRef.current.globalAlpha = opacity;\n contextRef.current.strokeStyle = color;\n contextRef.current.lineWidth = radius * 2;\n contextRef.current.lineCap = 'round';\n contextRef.current.lineJoin = 'round';\n\n let p1 = points[0];\n let p2 = points[1];\n\n contextRef.current.beginPath();\n\n for (let i = 1; i < points.length; i += 1) {\n const midPoint = {\n x: p1.x + (p2.x - p1.x) / 2,\n y: p1.y + (p2.y - p1.y) / 2\n };\n contextRef.current.quadraticCurveTo(p1.x, p1.y, midPoint.x, midPoint.y);\n p1 = points[i];\n p2 = points[i + 1];\n }\n contextRef.current.lineTo(p1.x, p1.y);\n contextRef.current.stroke();\n };\n\n const clearCanvas = () => {\n if (!contextRef.current) return;\n contextRef.current.clearRect(\n 0,\n 0,\n contextRef.current.canvas.width,\n contextRef.current.canvas.height\n );\n };\n\n const onMouseMove = useEvent((event: MouseEvent) => {\n if (!drawing) return;\n options?.onMouseMove?.(event, paintRef.current);\n\n const point = { x: event.offsetX, y: event.offsetY };\n\n const isUpdated = paintRef.current.update(point);\n\n if (!isUpdated) return;\n if (!contextRef.current) return;\n clearCanvas();\n contextRef.current.clearRect(\n 0,\n 0,\n contextRef.current.canvas.width,\n contextRef.current.canvas.height\n );\n\n // const brush = paintRef.current.getBrushCoordinates();\n // // Draw brush point\n // contextRef.current.beginPath();\n // contextRef.current.fillStyle = 'red';\n // contextRef.current.arc(brush.x, brush.y, radius, 0, Math.PI * 2, true);\n // contextRef.current.fill();\n\n // // Draw the lazy radius.\n // contextRef.current.beginPath();\n // contextRef.current.strokeStyle = '#ccc';\n // contextRef.current.arc(brush.x, brush.y, radius * 2, 0, Math.PI * 2, true);\n // contextRef.current.stroke();\n\n paintRef.current.lines.forEach(({ points, color, opacity, radius }) =>\n draw(points, color, opacity, radius)\n );\n draw(paintRef.current.points, color, opacity, radius);\n });\n\n const onMouseDown = useEvent((event: MouseEvent) => {\n if (!contextRef.current) return;\n\n const point = { x: event.offsetX, y: event.offsetY };\n paintRef.current.brush.update(point);\n paintRef.current.points.push(point);\n draw(paintRef.current.points, color, opacity, radius);\n\n options?.onMouseDown?.(event, paintRef.current);\n setIsDrawing(true);\n });\n\n const onMouseUp = useEvent((event: MouseEvent) => {\n if (!contextRef.current) return;\n\n if (paintRef.current.points.length) {\n paintRef.current.lines.push({ points: paintRef.current.points, color, opacity, radius });\n paintRef.current.points = [];\n }\n\n options?.onMouseUp?.(event, paintRef.current);\n setIsDrawing(false);\n });\n\n const clear = () => {\n if (!contextRef.current) return;\n clearCanvas();\n paintRef.current.lines = [];\n paintRef.current.points = [];\n };\n\n const undo = () => {\n if (!contextRef.current) return;\n clearCanvas();\n\n paintRef.current.lines.pop();\n paintRef.current.lines.forEach(({ points, color, opacity, radius }) =>\n draw(points, color, opacity, radius)\n );\n };\n\n useEffect(() => {\n const element = (target ? getElement(target) : internalRef.current) as HTMLCanvasElement;\n if (!element) return;\n contextRef.current = element.getContext('2d');\n\n if (options?.initialLines) {\n paintRef.current.lines = options.initialLines;\n options.initialLines.forEach(({ points, color, opacity, radius }) =>\n draw(points, color, opacity, radius)\n );\n }\n\n element.addEventListener('mousedown', onMouseDown);\n element.addEventListener('mousemove', onMouseMove);\n element.addEventListener('mouseup', onMouseUp);\n\n return () => {\n if (!element) return;\n element.removeEventListener('mousedown', onMouseDown);\n element.removeEventListener('mousemove', onMouseMove);\n element.removeEventListener('mouseup', onMouseUp);\n };\n }, []);\n\n if (target) return { drawing, clear, undo, draw, lines: paintRef.current.lines };\n return { ref: internalRef, drawing, clear, undo, draw, lines: paintRef.current.lines };\n}) as UsePaint;\n"],"names":["Pointer","x","y","_classCallCheck","this","_createClass","key","value","point","diff","getDifferenceTo","Math","sqrt","pow","atan2","angle","distance","angleRotated","PI","sin","cos","Paint","_ref","radius","smooth","_defineProperty","pointer","brush","points","lines","equalsTo","update","push","getBrushCoordinates","getDistanceTo","getAngleTo","round","_options$color","_options$opacity","_options$radius","_options$radius2","_options$smooth","target","_typeof","arguments","length","undefined","options","color","opacity","paintRef","useRef","_useState","useState","_useState2","_slicedToArray","drawing","setIsDrawing","internalRef","contextRef","draw","current","globalAlpha","strokeStyle","lineWidth","lineCap","lineJoin","p1","p2","beginPath","i","midPoint","quadraticCurveTo","lineTo","stroke","clearCanvas","clearRect","canvas","width","height","onMouseMove","useEvent","event","_options$onMouseMove","call","offsetX","offsetY","forEach","_ref2","onMouseDown","_options$onMouseDown","onMouseUp","_options$onMouseUp","clear","undo","pop","_ref3","useEffect","element","getElement","getContext","initialLines","_ref4","addEventListener","removeEventListener","ref"],"mappings":";iLAeaA,EAAO,WAKlB,SAAAA,EAAYC,EAAWC,GAAWC,EAAAA,qBAAAH,GAChCI,KAAKH,EAAIA,EACTG,KAAKF,EAAIA,CACX,CAAC,OAAAG,EAAAA,aAAAL,EAAA,CAAA,CAAAM,IAAA,SAAAC,MAED,SAAOC,GACLJ,KAAKH,EAAIO,EAAMP,EACfG,KAAKF,EAAIM,EAAMN,CACjB,GAAC,CAAAI,IAAA,kBAAAC,MAED,SAAgBC,GACd,OAAO,IAAIR,EAAQI,KAAKH,EAAIO,EAAMP,EAAGG,KAAKF,EAAIM,EAAMN,EACtD,GAAC,CAAAI,IAAA,gBAAAC,MAED,SAAcC,GACZ,IAAMC,EAAOL,KAAKM,gBAAgBF,GAClC,OAAOG,KAAKC,KAAKD,KAAAE,IAAAJ,EAAKR,EAAK,GAACU,KAAAE,IAAGJ,EAAKP,EAAK,GAC3C,GAAC,CAAAI,IAAA,aAAAC,MAED,SAAWC,GACT,IAAMC,EAAOL,KAAKM,gBAAgBF,GAClC,OAAOG,KAAKG,MAAML,EAAKP,EAAGO,EAAKR,EACjC,GAAC,CAAAK,IAAA,WAAAC,MAED,SAASC,GACP,OAAOJ,KAAKH,IAAMO,EAAMP,GAAKG,KAAKF,IAAMM,EAAMN,CAChD,GAAC,CAAAI,IAAA,cAAAC,MAED,SAEEQ,EAEAC,GAGA,IAAMC,EAAeF,EAAQJ,KAAKO,GAAK,EAKvC,OA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AM0D,SAAQ,SAAAS,GAAA,IAAGpE,EAAMoE,EAANpE,OAAQoB,EAAKgD,EAALhD,MAAOC,EAAO+C,EAAP/C,QAAS1B,EAAMyE,EAANzE,OAAM,OAC9DqC,EAAKhC,EAAQoB,EAAOC,EAAS1B,EAAO,IAEvC,EA0BD,OAxBA0E,EAAAA,WAAU,WACR,IAAMC,EAAWxD,EAASyD,EAAAA,WAAWzD,GAAUgB,EAAYG,QAC3D,GAAKqC,EAcL,OAbAvC,EAAWE,QAAUqC,EAAQE,WAAW,MAEpCrD,SAAAA,EAASsD,eACXnD,EAASW,QAAQhC,MAAQkB,EAAQsD,aACjCtD,EAAQsD,aAAad,SAAQ,SAAAe,GAAA,IAAG1E,EAAM0E,EAAN1E,OAAQoB,EAAKsD,EAALtD,MAAOC,EAAOqD,EAAPrD,QAAS1B,EAAM+E,EAAN/E,OAAM,OAC5DqC,EAAKhC,EAAQoB,EAAOC,EAAS1B,EAAO,KAIxC2E,EAAQK,iBAAiB,YAAad,GACtCS,EAAQK,iBAAiB,YAAavB,GACtCkB,EAAQK,iBAAiB,UAAWZ,GAE7B,WACAO,IACLA,EAAQM,oBAAoB,YAAaf,GACzCS,EAAQM,oBAAoB,YAAaxB,GACzCkB,EAAQM,oBAAoB,UAAWb,GACxC,CACF,GAAE,IAECjD,EAAe,CAAEc,QAAAA,EAASqC,MAAAA,EAAOC,KAAAA,EAAMlC,KAAAA,EAAM/B,MAAOqB,EAASW,QAAQhC,OAClE,CAAE4E,IAAK/C,EAAaF,QAAAA,EAASqC,MAAAA,EAAOC,KAAAA,EAAMlC,KAAAA,EAAM/B,MAAOqB,EAASW,QAAQhC,MACjF"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),t=require("react"),a=require("../useDeviceOrientation/useDeviceOrientation.js"),n=require("../useMouse/useMouse.js"),r=require("../useRefState/useRefState.js"),i=require("../useScreenOrientation/useScreenOrientation.js");require("../../utils/helpers/getElement.js");exports.useParallax=function(){var u,l=(arguments.length<=0?void 0:arguments[0])instanceof Function||(arguments.length<=0?void 0:arguments[0])&&"current"in(arguments.length<=0?void 0:arguments[0])||(arguments.length<=0?void 0:arguments[0])instanceof Element?arguments.length<=0?void 0:arguments[0]:void 0,o=r.useRefState(),s=n.useMouse(null!=l?l:o.current),c=i.useScreenOrientation(),v=a.useDeviceOrientation(),d=null!==(u=l?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0])&&void 0!==u?u:{},m=d.deviceOrientationRollAdjust,f=void 0===m?function(e){return e}:m,p=d.deviceOrientationTiltAdjust,g=void 0===p?function(e){return e}:p,h=d.mouseRollAdjust,y=void 0===h?function(e){return e}:h,b=d.mouseTiltAdjust,O=void 0===b?function(e){return e}:b,j=t.useState({roll:0,tilt:0,source:"mouse"}),q=e._slicedToArray(j,2),R=q[0],S=q[1],k=function(){return v.supported&&(v.value.alpha||v.value.gamma)?"deviceOrientation":"mouse"};return t.useEffect((function(){if(s.element){var e=k(),t=function(){if("deviceOrientation"===k()){var e;switch(c.value.orientationType){case"landscape-primary":e=v.value.gamma/90;break;case"landscape-secondary":e=-v.value.gamma/90;break;case"portrait-primary":default:e=-v.value.beta/90;break;case"portrait-secondary":e=v.value.beta/90}return f(e)}if(!s.element)return 0;var t=s.y-s.elementPositionY,a=s.element.getBoundingClientRect().height;return y(-(t-a/2)/a)}(),a=function(){if("deviceOrientation"===k()){var e;switch(c.value.orientationType){case"landscape-primary":e=v.value.beta/90;break;case"landscape-secondary":e=-v.value.beta/90;break;case"portrait-primary":default:e=v.value.gamma/90;break;case"portrait-secondary":e=-v.value.gamma/90}return g(e)}if(!s.element)return 0;var t=s.x-s.elementPositionX,a=s.element.getBoundingClientRect().width;return O((t-a/2)/a)}();S({roll:t,source:e,tilt:a})}}),[c.value.angle,c.value.orientationType,v.value.gamma,v.value.beta,v.value.alpha,v.value.absolute,s.x,s.y,s.element]),l?{value:R}:{ref:o,value:R}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),t=require("react"),a=require("../useDeviceOrientation/useDeviceOrientation.js"),n=require("../useMouse/useMouse.js"),r=require("../useRefState/useRefState.js"),i=require("../useScreenOrientation/useScreenOrientation.js");require("../../utils/helpers/getElement.js");exports.useParallax=function(){var u,l=(arguments.length<=0?void 0:arguments[0])instanceof Function||(arguments.length<=0?void 0:arguments[0])&&"current"in(arguments.length<=0?void 0:arguments[0])||(arguments.length<=0?void 0:arguments[0])instanceof Element?arguments.length<=0?void 0:arguments[0]:void 0,o=r.useRefState(),s=n.useMouse(null!=l?l:o.current),c=i.useScreenOrientation(),v=a.useDeviceOrientation(),d=null!==(u=l?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0])&&void 0!==u?u:{},m=d.deviceOrientationRollAdjust,f=void 0===m?function(e){return e}:m,p=d.deviceOrientationTiltAdjust,g=void 0===p?function(e){return e}:p,h=d.mouseRollAdjust,y=void 0===h?function(e){return e}:h,b=d.mouseTiltAdjust,O=void 0===b?function(e){return e}:b,j=t.useState({roll:0,tilt:0,source:"mouse"}),q=e._slicedToArray(j,2),R=q[0],S=q[1],k=function(){return v.supported&&(v.value.alpha||v.value.gamma)?"deviceOrientation":"mouse"};return t.useEffect((function(){if(s.element){var e=k(),t=function(){if("deviceOrientation"===k()){var e;switch(c.value.orientationType){case"landscape-primary":e=v.value.gamma/90;break;case"landscape-secondary":e=-v.value.gamma/90;break;case"portrait-primary":default:e=-v.value.beta/90;break;case"portrait-secondary":e=v.value.beta/90}return f(e)}if(!s.element)return 0;var t=s.y-s.elementPositionY,a=s.element.getBoundingClientRect().height;return y(-(t-a/2)/a)}(),a=function(){if("deviceOrientation"===k()){var e;switch(c.value.orientationType){case"landscape-primary":e=v.value.beta/90;break;case"landscape-secondary":e=-v.value.beta/90;break;case"portrait-primary":default:e=v.value.gamma/90;break;case"portrait-secondary":e=-v.value.gamma/90}return g(e)}if(!s.element)return 0;var t=s.x-s.elementPositionX,a=s.element.getBoundingClientRect().width;return O((t-a/2)/a)}();S({roll:t,source:e,tilt:a})}}),[c.value.angle,c.value.orientationType,v.value.gamma,v.value.beta,v.value.alpha,v.value.absolute,s.x,s.y,s.element]),l?{value:R}:{ref:o,value:R}};
3
3
  //# sourceMappingURL=useParallax.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),t=require("../useEvent/useEvent.js");exports.usePermission=function(n,u){var s,a=r.useState("prompt"),i=e._slicedToArray(a,2),o=i[0],p=i[1],c="undefined"!=typeof navigator&&"permissions"in navigator,v=null===(s=null==u?void 0:u.enabled)||void 0===s||s,l={name:n},d=t.useEvent(e._asyncToGenerator(e._regeneratorRuntime().mark((function r(){var t;return e._regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.permissions.query(l);case 3:return t=e.sent,p(t.state),e.abrupt("return",t.state);case 8:return e.prev=8,e.t0=e.catch(0),p("prompt"),e.abrupt("return","prompt");case 12:case"end":return e.stop()}}),r,null,[[0,8]])}))));return r.useEffect((function(){if(c&&v)return d(),window.addEventListener("change",d),function(){window.removeEventListener("change",d)}}),[n,v]),{state:o,supported:c,query:d}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),t=require("../useEvent/useEvent.js");exports.usePermission=function(n,u){var s,a=r.useState("prompt"),i=e._slicedToArray(a,2),o=i[0],p=i[1],c="undefined"!=typeof navigator&&"permissions"in navigator,v=null===(s=null==u?void 0:u.enabled)||void 0===s||s,l={name:n},d=t.useEvent(e._asyncToGenerator(e._regeneratorRuntime().mark((function r(){var t;return e._regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.permissions.query(l);case 3:return t=e.sent,p(t.state),e.abrupt("return",t.state);case 8:return e.prev=8,e.t0=e.catch(0),p("prompt"),e.abrupt("return","prompt");case 12:case"end":return e.stop()}}),r,null,[[0,8]])}))));return r.useEffect((function(){if(c&&v)return d(),window.addEventListener("change",d),function(){window.removeEventListener("change",d)}}),[n,v]),{state:o,supported:c,query:d}};
3
3
  //# sourceMappingURL=usePermission.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),n=require("react");exports.usePointerLock=function(){var t="undefined"!=typeof document&&"pointerLockElement"in document,r=n.useState(),o=e._slicedToArray(r,2),c=o[0],i=o[1];n.useEffect((function(){if(t){var e=function(){var e;if(t){var n=null!==(e=document.pointerLockElement)&&void 0!==e?e:c;n&&n===c&&i(document.pointerLockElement)}},n=function(){var e;if(t){var n=null!==(e=document.pointerLockElement)&&void 0!==e?e:c;if(n&&n===c){var r=document.pointerLockElement?"release":"acquire";throw new Error("Failed to ".concat(r," pointer lock."))}}};return document.addEventListener("pointerlockchange",e),document.addEventListener("pointerlockerror",n),function(){document.removeEventListener("pointerlockchange",e),document.removeEventListener("pointerlockerror",n)}}}),[]);return{supported:t,element:c,lock:function(e){return!!t&&(!(e instanceof Event)&&(e.currentTarget.requestPointerLock(),i(e.currentTarget),!0))},unlock:function(){return!!t&&(!!c&&(document.exitPointerLock(),i(void 0),!0))}}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),n=require("react");exports.usePointerLock=function(){var t="undefined"!=typeof document&&"pointerLockElement"in document,r=n.useState(),o=e._slicedToArray(r,2),c=o[0],i=o[1];n.useEffect((function(){if(t){var e=function(){var e;if(t){var n=null!==(e=document.pointerLockElement)&&void 0!==e?e:c;n&&n===c&&i(document.pointerLockElement)}},n=function(){var e;if(t){var n=null!==(e=document.pointerLockElement)&&void 0!==e?e:c;if(n&&n===c){var r=document.pointerLockElement?"release":"acquire";throw new Error("Failed to ".concat(r," pointer lock."))}}};return document.addEventListener("pointerlockchange",e),document.addEventListener("pointerlockerror",n),function(){document.removeEventListener("pointerlockchange",e),document.removeEventListener("pointerlockerror",n)}}}),[]);return{supported:t,element:c,lock:function(e){return!!t&&(!(e instanceof Event)&&(e.currentTarget.requestPointerLock(),i(e.currentTarget),!0))},unlock:function(){return!!t&&(!!c&&(document.exitPointerLock(),i(void 0),!0))}}};
3
3
  //# sourceMappingURL=usePointerLock.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("react");exports.usePostMessage=function(r,n){var s=e.useRef(n);s.current=n,e.useEffect((function(){var e=function(e){!(!Array.isArray(r)||r.includes(e.origin)&&r.includes("*"))||e.origin!==r&&"*"!==r||s.current(e.data,e)};return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}}),[]);return function(e){Array.isArray(r)?r.forEach((function(r){return window.postMessage(e,r)})):window.postMessage(e,r)}};
3
3
  //# sourceMappingURL=usePostMessage.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("../useMediaQuery/useMediaQuery.js");require("react");exports.usePreferredColorScheme=function(){var r=e.useMediaQuery("(prefers-color-scheme: light)"),u=e.useMediaQuery("(prefers-color-scheme: dark)");return r?"light":u?"dark":"no-preference"};
3
3
  //# sourceMappingURL=usePreferredColorScheme.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("../useMediaQuery/useMediaQuery.js");require("react");exports.usePreferredContrast=function(){var r=e.useMediaQuery("(prefers-contrast: more)"),s=e.useMediaQuery("(prefers-contrast: less)"),u=e.useMediaQuery("(prefers-contrast: custom)");return r?"more":s?"less":u?"custom":"no-preference"};
3
3
  //# sourceMappingURL=usePreferredContrast.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("../useMediaQuery/useMediaQuery.js");require("react");exports.usePreferredDark=function(){return e.useMediaQuery("(prefers-color-scheme: dark)")};
3
3
  //# sourceMappingURL=usePreferredDark.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("react"),n=function(){return window.navigator.languages},r=function(){return[]},t=function(e){return window.addEventListener("languagechange",e),function(){window.removeEventListener("languagechange",e)}};exports.usePreferredLanguages=function(){return e.useSyncExternalStore(t,n,r)};
3
3
  //# sourceMappingURL=usePreferredLanguages.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("../useMediaQuery/useMediaQuery.js");require("react");exports.usePreferredReducedMotion=function(){return e.useMediaQuery("(prefers-reduced-motion: reduce)")?"reduce":"no-preference"};
3
3
  //# sourceMappingURL=usePreferredReducedMotion.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var r=require("react");exports.usePrevious=function(e,u){var t,n=r.useRef(e),c=r.useRef();return(null!==(t=null==u?void 0:u.equality)&&void 0!==t?t:Object.is)(e,n.current)||(c.current=n.current,n.current=e),c.current};
3
3
  //# sourceMappingURL=usePrevious.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),t=require("../../utils/helpers/getRetry.js"),n=require("../useDidUpdate/useDidUpdate.js"),l=require("../useMount/useMount.js");require("../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js");exports.useQuery=function(u,i){var o,a,c=null===(o=null==i?void 0:i.enabled)||void 0===o||o,s=r.useRef(null!=i&&i.retry?t.getRetry(i.retry):0),d=r.useRef(!1),f=r.useState(!1),v=e._slicedToArray(f,2),y=v[0],h=v[1],p=r.useState(!1),A=e._slicedToArray(p,2),D=A[0],_=A[1],g=r.useState(!1),S=e._slicedToArray(g,2),b=S[0],I=S[1],R=r.useState(!1),T=e._slicedToArray(R,2),q=T[0],j=T[1],m=r.useState(!(null==i||!i.initialData)),E=e._slicedToArray(m,2),C=E[0],L=E[1],M=r.useState(void 0),U=e._slicedToArray(M,2),k=U[0],w=U[1],F=r.useState(null==i?void 0:i.initialData),x=e._slicedToArray(F,2),B=x[0],H=x[1],P=r.useRef(new AbortController),Q=r.useRef(),z=null!==(a=null==i?void 0:i.keys)&&void 0!==a?a:[],G=function(){P.current.abort(),P.current=new AbortController},J=function(e){G(),h(!0),"init"===e&&(d.current=!0,_(!0)),"refetch"===e&&j(!0),u({signal:P.current.signal,keys:z}).then((function(r){var t,n=null!=i&&i.select?null==i?void 0:i.select(r):r;null==i||null===(t=i.onSuccess)||void 0===t||t.call(i,n),H(n),L(!0),w(void 0),I(!1),h(!1),"init"===e&&_(!1),"refetch"===e&&j(!1)})).catch((function(r){var n;if(s.current>0){s.current-=1;var l="function"==typeof(null==i?void 0:i.retryDelay)?null==i?void 0:i.retryDelay(s.current,r):null==i?void 0:i.retryDelay;return l?void setTimeout((function(){return J(e)}),l):J(e)}null==i||null===(n=i.onError)||void 0===n||n.call(i,r),H(void 0),L(!1),w(r),I(!0),h(!1),"init"===e&&_(!1),"refetch"===e&&j(!1),s.current=null!=i&&i.retry?t.getRetry(i.retry):0})).finally((function(){if(null!=i&&i.refetchInterval){var e=setInterval((function(){clearInterval(e),J("refetch")}),null==i?void 0:i.refetchInterval);Q.current=e}}))};l.useMount((function(){c&&J("init")})),n.useDidUpdate((function(){c&&J(d.current?"refetch":"init")}),[c].concat(e._toConsumableArray(z))),r.useEffect((function(){return function(){clearInterval(Q.current)}}),[c,null==i?void 0:i.refetchInterval,null==i?void 0:i.retry].concat(e._toConsumableArray(z)));var K=(null==i?void 0:i.placeholderData)instanceof Function?null==i?void 0:i.placeholderData():null==i?void 0:i.placeholderData;return{abort:G,data:null!=B?B:K,error:k,refetch:function(){return J("refetch")},isFetching:y,isLoading:D,isError:b,isSuccess:C,isRefetching:q}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),t=require("../../utils/helpers/getRetry.js"),n=require("../useDidUpdate/useDidUpdate.js"),l=require("../useMount/useMount.js");require("../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js");exports.useQuery=function(u,i){var o,a,c=null===(o=null==i?void 0:i.enabled)||void 0===o||o,s=r.useRef(null!=i&&i.retry?t.getRetry(i.retry):0),d=r.useRef(!1),f=r.useState(!1),v=e._slicedToArray(f,2),y=v[0],h=v[1],p=r.useState(!1),A=e._slicedToArray(p,2),D=A[0],_=A[1],g=r.useState(!1),S=e._slicedToArray(g,2),b=S[0],I=S[1],R=r.useState(!1),T=e._slicedToArray(R,2),q=T[0],j=T[1],m=r.useState(!(null==i||!i.initialData)),E=e._slicedToArray(m,2),C=E[0],L=E[1],M=r.useState(void 0),U=e._slicedToArray(M,2),k=U[0],w=U[1],F=r.useState(null==i?void 0:i.initialData),x=e._slicedToArray(F,2),B=x[0],H=x[1],P=r.useRef(new AbortController),Q=r.useRef(),z=null!==(a=null==i?void 0:i.keys)&&void 0!==a?a:[],G=function(){P.current.abort(),P.current=new AbortController},J=function(e){G(),h(!0),"init"===e&&(d.current=!0,_(!0)),"refetch"===e&&j(!0),u({signal:P.current.signal,keys:z}).then((function(r){var t,n=null!=i&&i.select?null==i?void 0:i.select(r):r;null==i||null===(t=i.onSuccess)||void 0===t||t.call(i,n),H(n),L(!0),w(void 0),I(!1),h(!1),"init"===e&&_(!1),"refetch"===e&&j(!1)})).catch((function(r){var n;if(s.current>0){s.current-=1;var l="function"==typeof(null==i?void 0:i.retryDelay)?null==i?void 0:i.retryDelay(s.current,r):null==i?void 0:i.retryDelay;return l?void setTimeout((function(){return J(e)}),l):J(e)}null==i||null===(n=i.onError)||void 0===n||n.call(i,r),H(void 0),L(!1),w(r),I(!0),h(!1),"init"===e&&_(!1),"refetch"===e&&j(!1),s.current=null!=i&&i.retry?t.getRetry(i.retry):0})).finally((function(){if(null!=i&&i.refetchInterval){var e=setInterval((function(){clearInterval(e),J("refetch")}),null==i?void 0:i.refetchInterval);Q.current=e}}))};l.useMount((function(){c&&J("init")})),n.useDidUpdate((function(){c&&J(d.current?"refetch":"init")}),[c].concat(e._toConsumableArray(z))),r.useEffect((function(){return function(){clearInterval(Q.current)}}),[c,null==i?void 0:i.refetchInterval,null==i?void 0:i.retry].concat(e._toConsumableArray(z)));var K=(null==i?void 0:i.placeholderData)instanceof Function?null==i?void 0:i.placeholderData():null==i?void 0:i.placeholderData;return{abort:G,data:null!=B?B:K,error:k,refetch:function(){return J("refetch")},isFetching:y,isLoading:D,isError:b,isSuccess:C,isRefetching:q}};
3
3
  //# sourceMappingURL=useQuery.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var r=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),e=require("react"),t=require("react-dom");exports.useQueue=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=e.useState(n),i=r._slicedToArray(u,2),o=i[0],a=i[1];return{add:function(e){return a((function(t){return[].concat(r._toConsumableArray(t),[e])}))},remove:function(){var e;return t.flushSync((function(){a((function(t){var n=r._toArray(t),u=n[0],i=n.slice(1);return e=u,i}))})),e},clear:function(){return a([])},first:o[0],last:o[o.length-1],size:o.length,queue:o}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var r=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),e=require("react"),t=require("react-dom");exports.useQueue=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=e.useState(n),i=r._slicedToArray(u,2),o=i[0],a=i[1];return{add:function(e){return a((function(t){return[].concat(r._toConsumableArray(t),[e])}))},remove:function(){var e;return t.flushSync((function(){a((function(t){var n=r._toArray(t),u=n[0],i=n.slice(1);return e=u,i}))})),e},clear:function(){return a([])},first:o[0],last:o[o.length-1],size:o.length,queue:o}};
3
3
  //# sourceMappingURL=useQueue.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react");exports.useRaf=function(n,u){var t,i=r.useRef(null),l=r.useRef(0),a=r.useState(!1),c=e._slicedToArray(a,2),o=c[0],s=c[1],d=null===(t=null==u?void 0:u.enabled)||void 0===t||t,f=r.useRef(n);f.current=n;var m=function(e){var r=e-l.current;null!=u&&u.delay&&r<(null==u?void 0:u.delay)||(l.current=e,f.current({delta:r,timestamp:e})),i.current=window.requestAnimationFrame(m)},v=function(){o||(s(!0),l.current=0,i.current=window.requestAnimationFrame(m))};function w(){i.current&&(s(!1),window.cancelAnimationFrame(i.current),i.current=null)}return r.useEffect((function(){if(d)return v(),w}),[d,null==u?void 0:u.delay]),{active:o,pause:w,resume:v}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react");exports.useRaf=function(n,u){var t,i=r.useRef(null),l=r.useRef(0),a=r.useState(!1),c=e._slicedToArray(a,2),o=c[0],s=c[1],d=null===(t=null==u?void 0:u.enabled)||void 0===t||t,f=r.useRef(n);f.current=n;var m=function(e){var r=e-l.current;null!=u&&u.delay&&r<(null==u?void 0:u.delay)||(l.current=e,f.current({delta:r,timestamp:e})),i.current=window.requestAnimationFrame(m)},v=function(){o||(s(!0),l.current=0,i.current=window.requestAnimationFrame(m))};function w(){i.current&&(s(!1),window.cancelAnimationFrame(i.current),i.current=null)}return r.useEffect((function(){if(d)return v(),w}),[d,null==u?void 0:u.delay]),{active:o,pause:w,resume:v}};
3
3
  //# sourceMappingURL=useRaf.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),n=require("../useUnmount/useUnmount.js");exports.useRafValue=function(u){var t=r.useRef(0),a=r.useState(u),i=e._slicedToArray(a,2),c=i[0],s=i[1];return n.useUnmount((function(){return cancelAnimationFrame(t.current)})),[c,function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame((function(){return s(e)}))}]};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),n=require("../useUnmount/useUnmount.js");exports.useRafValue=function(u){var t=r.useRef(0),a=r.useState(u),i=e._slicedToArray(a,2),c=i[0],s=i[1];return n.useUnmount((function(){return cancelAnimationFrame(t.current)})),[c,function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame((function(){return s(e)}))}]};
3
3
  //# sourceMappingURL=useRafValue.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react");exports.useRefState=function(t){var n=r.useState(t),u=e._slicedToArray(n,2),i=u[0],a=u[1],c=r.useState((function(){return function(e,r){var t=e;function n(e){t!==e&&r(t=e)}return Object.defineProperty(n,"current",{get:function(){return t},set:function(e){t!==e&&r(t=e)},configurable:!0,enumerable:!0}),n}(t,a)})),o=e._slicedToArray(c,1)[0];return o.state=i,o};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react");exports.useRefState=function(t){var n=r.useState(t),u=e._slicedToArray(n,2),i=u[0],a=u[1],c=r.useState((function(){return function(e,r){var t=e;function n(e){t!==e&&r(t=e)}return Object.defineProperty(n,"current",{get:function(){return t},set:function(e){t!==e&&r(t=e)},configurable:!0,enumerable:!0}),n}(t,a)})),o=e._slicedToArray(c,1)[0];return o.state=i,o};
3
3
  //# sourceMappingURL=useRefState.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("react");exports.useRenderCount=function(){var r=e.useRef(0);return e.useEffect((function(){r.current+=1})),r.current};
3
3
  //# sourceMappingURL=useRenderCount.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("react");exports.useRenderInfo=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Unknown",r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e.useRef({component:n,renders:0,timestamp:Date.now(),sinceLast:0}),c=Date.now();return t.current.renders+=1,t.current.sinceLast=t.current.timestamp?c-t.current.timestamp:0,t.current.timestamp=c,r&&(console.group("".concat(n," info, render number: ").concat(t.current.renders)),console.log("Timestamp: ".concat(t.current.timestamp)),console.log("Since last render: ".concat(t.current.sinceLast)),console.log("Renders: ".concat(t.current.renders)),console.dir(t.current),console.groupEnd()),t.current};
3
3
  //# sourceMappingURL=useRenderInfo.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("react");exports.useRerender=function(){return e.useReducer((function(){return{}}),{})[1]};
3
3
  //# sourceMappingURL=useRerender.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),t=require("react"),r=require("../../utils/helpers/getElement.js"),n=require("../useRefState/useRefState.js");exports.useResizeObserver=function(){var i,u="object"!==e._typeof(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,l=u?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],s=null===(i=null==l?void 0:l.enabled)||void 0===i||i,o=t.useState([]),v=e._slicedToArray(o,2),a=v[0],c=v[1],d=n.useRefState(),f=t.useRef();return f.current=null==l?void 0:l.onChange,t.useEffect((function(){if(s||u||d.state){var e=u?r.getElement(u):d.current;if(e){var t=new ResizeObserver((function(e){var r;c(e),null===(r=f.current)||void 0===r||r.call(f,e,t)}));return t.observe(e,l),function(){t.disconnect()}}}}),[u,d.state,null==l?void 0:l.box,s]),u?{entries:a}:{ref:d,entries:a}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),t=require("react"),r=require("../../utils/helpers/getElement.js"),n=require("../useRefState/useRefState.js");exports.useResizeObserver=function(){var i,u="object"!==e._typeof(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,l=u?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],s=null===(i=null==l?void 0:l.enabled)||void 0===i||i,o=t.useState([]),v=e._slicedToArray(o,2),a=v[0],c=v[1],d=n.useRefState(),f=t.useRef();return f.current=null==l?void 0:l.onChange,t.useEffect((function(){if(s||u||d.state){var e=u?r.getElement(u):d.current;if(e){var t=new ResizeObserver((function(e){var r;c(e),null===(r=f.current)||void 0===r||r.call(f,e,t)}));return t.observe(e,l),function(){t.disconnect()}}}}),[u,d.state,null==l?void 0:l.box,s]),u?{entries:a}:{ref:d,entries:a}};
3
3
  //# sourceMappingURL=useResizeObserver.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var n=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),e=require("react");exports.useScreenOrientation=function(){var o="undefined"!=typeof window&&"screen"in window&&"orientation"in window.screen,t=o?window.screen.orientation:{},i=e.useState((function(){var n;return{angle:null!==(n=null==t?void 0:t.angle)&&void 0!==n?n:0,orientationType:null==t?void 0:t.type}})),r=n._slicedToArray(i,2),u=r[0],c=r[1];e.useEffect((function(){if(o){var n=function(){return c({angle:t.angle,orientationType:t.type})};return window.addEventListener("orientationchange",n),function(){window.removeEventListener("orientationchange",n)}}}));return{supported:o,value:u,lock:function(n){if(o&&"function"==typeof t.lock)return t.lock(n)},unlock:function(){o&&"function"==typeof t.unlock&&t.unlock()}}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var n=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),e=require("react");exports.useScreenOrientation=function(){var o="undefined"!=typeof window&&"screen"in window&&"orientation"in window.screen,t=o?window.screen.orientation:{},i=e.useState((function(){var n;return{angle:null!==(n=null==t?void 0:t.angle)&&void 0!==n?n:0,orientationType:null==t?void 0:t.type}})),r=n._slicedToArray(i,2),u=r[0],c=r[1];e.useEffect((function(){if(o){var n=function(){return c({angle:t.angle,orientationType:t.type})};return window.addEventListener("orientationchange",n),function(){window.removeEventListener("orientationchange",n)}}}));return{supported:o,value:u,lock:function(n){if(o&&"function"==typeof t.lock)return t.lock(n)},unlock:function(){o&&"function"==typeof t.unlock&&t.unlock()}}};
3
3
  //# sourceMappingURL=useScreenOrientation.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),t="script-status";exports.SCRIPT_STATUS_ATTRIBUTE_NAME=t,exports.useScript=function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.useState((function(){var e=document.querySelector('script[src="'.concat(n,'"]')),r=null==e?void 0:e.getAttribute(t);return r||(e?"unknown":"loading")})),u=e._slicedToArray(i,2),c=u[0],s=u[1],a=o.removeOnUnmount,d=void 0===a||a,l=o.async,v=void 0===l||l;return r.useEffect((function(){var r=document.querySelector('script[src="'.concat(n,'"]')),i=null==r?void 0:r.getAttribute(t);if(i)return s(i);if(r)return s("unknown");var u=document.createElement("script");u.src=n,u.async=v;for(var c=0,a=Object.entries(o);c<a.length;c++){var l=e._slicedToArray(a[c],2),f=l[0],p=l[1];u.setAttribute(f,String(p))}u.setAttribute(t,"loading"),document.body.appendChild(u);var A=function(){u.setAttribute(t,"ready"),s("ready")},m=function(){u.setAttribute(t,"error"),s("error")};return u.addEventListener("load",A),u.addEventListener("error",m),function(){d&&u.remove(),u.removeEventListener("load",A),u.removeEventListener("error",m)}}),[n,d]),c};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),t="script-status";exports.SCRIPT_STATUS_ATTRIBUTE_NAME=t,exports.useScript=function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.useState((function(){var e=document.querySelector('script[src="'.concat(n,'"]')),r=null==e?void 0:e.getAttribute(t);return r||(e?"unknown":"loading")})),u=e._slicedToArray(i,2),c=u[0],s=u[1],a=o.removeOnUnmount,d=void 0===a||a,l=o.async,v=void 0===l||l;return r.useEffect((function(){var r=document.querySelector('script[src="'.concat(n,'"]')),i=null==r?void 0:r.getAttribute(t);if(i)return s(i);if(r)return s("unknown");var u=document.createElement("script");u.src=n,u.async=v;for(var c=0,a=Object.entries(o);c<a.length;c++){var l=e._slicedToArray(a[c],2),f=l[0],p=l[1];u.setAttribute(f,String(p))}u.setAttribute(t,"loading"),document.body.appendChild(u);var A=function(){u.setAttribute(t,"ready"),s("ready")},m=function(){u.setAttribute(t,"error"),s("error")};return u.addEventListener("load",A),u.addEventListener("error",m),function(){d&&u.remove(),u.removeEventListener("load",A),u.removeEventListener("error",m)}}),[n,d]),c};
3
3
  //# sourceMappingURL=useScript.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),t=require("react"),l=require("../../utils/helpers/getElement.js"),r=require("../../utils/helpers/isTarget.js"),o=require("../useRefState/useRefState.js");exports.useScroll=function(){var n=r.isTarget(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,i=n?"object"===e._typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onScroll:arguments.length<=1?void 0:arguments[1]}:"object"===e._typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:{onScroll:arguments.length<=0?void 0:arguments[0]},u=o.useRefState(),c=t.useRef(i);c.current=i;var s=t.useState(!1),d=e._slicedToArray(s,2),v=d[0],a=d[1],f=t.useRef({x:0,y:0});return t.useEffect((function(){if(n||u.state){var e=n?l.getElement(n):u.current;if(e){var t=function(e){var t;a(!1),null==i||null===(t=i.onStop)||void 0===t||t.call(i,e)},r=function(e){var t,l,r,o,n,i,u;a(!0);var s=e.target===document?e.target.documentElement:e.target,d=s.style,v=d.display,g=d.flexDirection,h="rtl"===d.direction?-1:1,m=s.scrollLeft,p=s.scrollTop;s instanceof Document&&!p&&(p=window.document.body.scrollTop);var y=null===(t=c.current)||void 0===t?void 0:t.offset,x=m*h<=(null!==(l=null==y?void 0:y.left)&&void 0!==l?l:0),S=m*h+s.clientWidth>=s.scrollWidth-(null!==(r=null==y?void 0:y.right)&&void 0!==r?r:0)-1,E=p<=(null!==(o=null==y?void 0:y.top)&&void 0!==o?o:0),b=p+s.clientHeight>=s.scrollHeight-(null!==(n=null==y?void 0:y.bottom)&&void 0!==n?n:0)-1,j="flex"===v&&"column-reverse"===g,q="flex"===v&&"column-reverse"===g,L={x:m,y:p,directions:{left:m<f.current.x,right:m>f.current.x,top:p<f.current.y,bottom:p>f.current.y},arrived:{left:q?S:x,right:q?x:S,top:j?b:E,bottom:j?E:b}};f.current={x:m,y:p},null===(i=c.current)||void 0===i||null===(u=i.onScroll)||void 0===u||u.call(i,L,e)};return e.addEventListener("scroll",r),e.addEventListener("scrollend",t),function(){e.removeEventListener("scroll",r),e.removeEventListener("scrollend",t)}}}}),[n,u.state]),n?v:[u,v]};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),t=require("react"),l=require("../../utils/helpers/getElement.js"),r=require("../../utils/helpers/isTarget.js"),o=require("../useRefState/useRefState.js");exports.useScroll=function(){var n=r.isTarget(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,i=n?"object"===e._typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onScroll:arguments.length<=1?void 0:arguments[1]}:"object"===e._typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:{onScroll:arguments.length<=0?void 0:arguments[0]},u=o.useRefState(),c=t.useRef(i);c.current=i;var s=t.useState(!1),d=e._slicedToArray(s,2),v=d[0],a=d[1],f=t.useRef({x:0,y:0});return t.useEffect((function(){if(n||u.state){var e=n?l.getElement(n):u.current;if(e){var t=function(e){var t;a(!1),null==i||null===(t=i.onStop)||void 0===t||t.call(i,e)},r=function(e){var t,l,r,o,n,i,u;a(!0);var s=e.target===document?e.target.documentElement:e.target,d=s.style,v=d.display,g=d.flexDirection,h="rtl"===d.direction?-1:1,m=s.scrollLeft,p=s.scrollTop;s instanceof Document&&!p&&(p=window.document.body.scrollTop);var y=null===(t=c.current)||void 0===t?void 0:t.offset,x=m*h<=(null!==(l=null==y?void 0:y.left)&&void 0!==l?l:0),S=m*h+s.clientWidth>=s.scrollWidth-(null!==(r=null==y?void 0:y.right)&&void 0!==r?r:0)-1,E=p<=(null!==(o=null==y?void 0:y.top)&&void 0!==o?o:0),b=p+s.clientHeight>=s.scrollHeight-(null!==(n=null==y?void 0:y.bottom)&&void 0!==n?n:0)-1,j="flex"===v&&"column-reverse"===g,q="flex"===v&&"column-reverse"===g,L={x:m,y:p,directions:{left:m<f.current.x,right:m>f.current.x,top:p<f.current.y,bottom:p>f.current.y},arrived:{left:q?S:x,right:q?x:S,top:j?b:E,bottom:j?E:b}};f.current={x:m,y:p},null===(i=c.current)||void 0===i||null===(u=i.onScroll)||void 0===u||u.call(i,L,e)};return e.addEventListener("scroll",r),e.addEventListener("scrollend",t),function(){e.removeEventListener("scroll",r),e.removeEventListener("scrollend",t)}}}}),[n,u.state]),n?v:[u,v]};
3
3
  //# sourceMappingURL=useScroll.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),t=require("react"),i=require("../../utils/helpers/getElement.js"),r=require("../useRefState/useRefState.js");exports.useScrollIntoView=function(){var n="object"!==e._typeof(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])||(arguments.length<=0?void 0:arguments[0])instanceof Element?arguments.length<=0?void 0:arguments[0]:void 0,l=n?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],o=r.useRefState(),s=null!=l?l:{},u=s.behavior,a=void 0===u?"smooth":u,v=s.block,c=void 0===v?"start":v,g=s.inline,f=void 0===g?"nearest":g,d=s.enabled,h=void 0===d||d;t.useEffect((function(){if(h&&(n||o.state)){var e=n?i.getElement(n):o.current;e&&e.scrollIntoView({behavior:a,block:c,inline:f})}}),[n,o.state,h]);var b=function(e){var t=n?i.getElement(n):o.current;if(t){var r=null!=e?e:{},l=r.behavior,s=r.block,u=r.inline;t.scrollIntoView({behavior:l,block:s,inline:u})}};return n?{trigger:b}:{ref:o,trigger:b}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),t=require("react"),i=require("../../utils/helpers/getElement.js"),r=require("../useRefState/useRefState.js");exports.useScrollIntoView=function(){var n="object"!==e._typeof(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])||(arguments.length<=0?void 0:arguments[0])instanceof Element?arguments.length<=0?void 0:arguments[0]:void 0,l=n?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],o=r.useRefState(),s=null!=l?l:{},u=s.behavior,a=void 0===u?"smooth":u,v=s.block,c=void 0===v?"start":v,g=s.inline,f=void 0===g?"nearest":g,d=s.enabled,h=void 0===d||d;t.useEffect((function(){if(h&&(n||o.state)){var e=n?i.getElement(n):o.current;e&&e.scrollIntoView({behavior:a,block:c,inline:f})}}),[n,o.state,h]);var b=function(e){var t=n?i.getElement(n):o.current;if(t){var r=null!=e?e:{},l=r.behavior,s=r.block,u=r.inline;t.scrollIntoView({behavior:l,block:s,inline:u})}};return n?{trigger:b}:{ref:o,trigger:b}};
3
3
  //# sourceMappingURL=useScrollIntoView.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("react"),t=require("../../utils/helpers/getElement.js"),r=require("../../utils/helpers/isTarget.js"),i=require("../useRefState/useRefState.js");require("../../_rollupPluginBabelHelpers-zZt1zBDH.js");exports.useScrollTo=function(){var l,o=r.isTarget(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,u=null!==(l=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0])&&void 0!==l?l:{},s=u.x,a=u.y,n=u.behavior,v=void 0===n?"auto":n,f=u.enabled,g=void 0===f||f,c=i.useRefState();e.useLayoutEffect((function(){if(g&&(o||c.state)){var e=o?t.getElement(o):c.current;e&&e.scrollTo({top:a,left:s,behavior:v})}}),[o,c.state]);var h=function(e){var r=o?t.getElement(o):c.current;if(r){var i=null!=e?e:{},l=i.x,u=i.y,s=i.behavior;r.scrollTo({left:l,top:u,behavior:s})}};return o?h:{ref:c,trigger:h}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("react"),t=require("../../utils/helpers/getElement.js"),r=require("../../utils/helpers/isTarget.js"),i=require("../useRefState/useRefState.js");require("../../_rollupPluginBabelHelpers-Du0ODElA.js");exports.useScrollTo=function(){var l,o=r.isTarget(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,u=null!==(l=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0])&&void 0!==l?l:{},s=u.x,a=u.y,n=u.behavior,v=void 0===n?"auto":n,f=u.enabled,g=void 0===f||f,c=i.useRefState();e.useLayoutEffect((function(){if(g&&(o||c.state)){var e=o?t.getElement(o):c.current;e&&e.scrollTo({top:a,left:s,behavior:v})}}),[o,c.state]);var h=function(e){var r=o?t.getElement(o):c.current;if(r){var i=null!=e?e:{},l=i.x,u=i.y,s=i.behavior;r.scrollTo({left:l,top:u,behavior:s})}};return o?h:{ref:c,trigger:h}};
3
3
  //# sourceMappingURL=useScrollTo.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("../useStorage/useStorage.js");require("react");exports.useSessionStorage=function(o,t,a){return r.useStorage(o,e._objectSpread2(e._objectSpread2({},a),{},{initialValue:t,storage:"undefined"!=typeof window?window.localStorage:void 0}))};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("../useStorage/useStorage.js");require("react");exports.useSessionStorage=function(o,t,a){return r.useStorage(o,e._objectSpread2(e._objectSpread2({},a),{},{initialValue:t,storage:"undefined"!=typeof window?window.localStorage:void 0}))};
3
3
  //# sourceMappingURL=useSessionStorage.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),n=require("react");exports.useSet=function(r){var t=n.useState(new Set(r)),u=e._slicedToArray(t,2),i=u[0],c=u[1];return{value:i,size:i.size,has:function(e){return i.has(e)},add:function(e){return c((function(n){return new Set(n).add(e)}))},remove:function(e){return c((function(n){if(!n.has(e))return n;var r=new Set(n);return r.delete(e),r}))},clear:function(){return c(new Set)},reset:function(){return c(new Set(r))},toggle:function(e){return c((function(n){if(!n.has(e))return new Set(n).add(e);var r=new Set(n);return r.delete(e),r}))},union:function(e){return c(i.union(e))},difference:function(e){return c(i.difference(e))},symmetricDifference:function(e){return c(i.symmetricDifference(e))},intersection:function(e){return c(i.intersection(e))}}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),n=require("react");exports.useSet=function(r){var t=n.useState(new Set(r)),u=e._slicedToArray(t,2),i=u[0],c=u[1];return{value:i,size:i.size,has:function(e){return i.has(e)},add:function(e){return c((function(n){return new Set(n).add(e)}))},remove:function(e){return c((function(n){if(!n.has(e))return n;var r=new Set(n);return r.delete(e),r}))},clear:function(){return c(new Set)},reset:function(){return c(new Set(r))},toggle:function(e){return c((function(n){if(!n.has(e))return new Set(n).add(e);var r=new Set(n);return r.delete(e),r}))},union:function(e){return c(i.union(e))},difference:function(e){return c(i.difference(e))},symmetricDifference:function(e){return c(i.symmetricDifference(e))},intersection:function(e){return c(i.intersection(e))}}};
3
3
  //# sourceMappingURL=useSet.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var r=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js");exports.useShare=function(e){var a="undefined"!=typeof navigator&&"share"in navigator,n=function(){var n=r._asyncToGenerator(r._regeneratorRuntime().mark((function n(t){var u;return r._regeneratorRuntime().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a){n.next=2;break}return n.abrupt("return");case 2:return(u=r._objectSpread2(r._objectSpread2({},e),t)).files&&navigator.canShare({files:u.files})&&navigator.share(u),n.abrupt("return",navigator.share(u));case 5:case"end":return n.stop()}}),n)})));return function(r){return n.apply(this,arguments)}}();return{share:n,supported:a}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var r=require("../../_rollupPluginBabelHelpers-Du0ODElA.js");exports.useShare=function(e){var a="undefined"!=typeof navigator&&"share"in navigator,n=function(){var n=r._asyncToGenerator(r._regeneratorRuntime().mark((function n(t){var u;return r._regeneratorRuntime().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a){n.next=2;break}return n.abrupt("return");case 2:return(u=r._objectSpread2(r._objectSpread2({},e),t)).files&&navigator.canShare({files:u.files})&&navigator.share(u),n.abrupt("return",navigator.share(u));case 5:case"end":return n.stop()}}),n)})));return function(r){return n.apply(this,arguments)}}();return{share:n,supported:a}};
3
3
  //# sourceMappingURL=useShare.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var r=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),e=require("react");exports.useStateHistory=function(t,n){var u=e.useState(t),c=r._slicedToArray(u,2),i=c[0],s=c[1],o=e.useState([t]),a=r._slicedToArray(o,2),l=a[0],f=a[1],h=e.useRef(0);return{history:l,value:i,set:function(r){f((function(e){var t=e.slice(0,h.current+1);return t.push(r),n&&t.length>n&&t.shift(),h.current=t.length-1,t})),s(r)},index:h.current,back:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h.current-r<0||(h.current-=r,s(l[h.current]))},forward:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h.current+r>=l.length||(h.current+=r,s(l[h.current]))},reset:function(){s(t),f([t]),h.current=0},undo:function(){0!==h.current&&(h.current--,s(l[h.current]),f((function(r){return r.slice(0,h.current+1)})))}}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var r=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),e=require("react");exports.useStateHistory=function(t,n){var u=e.useState(t),c=r._slicedToArray(u,2),i=c[0],s=c[1],o=e.useState([t]),a=r._slicedToArray(o,2),l=a[0],f=a[1],h=e.useRef(0);return{history:l,value:i,set:function(r){f((function(e){var t=e.slice(0,h.current+1);return t.push(r),n&&t.length>n&&t.shift(),h.current=t.length-1,t})),s(r)},index:h.current,back:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h.current-r<0||(h.current-=r,s(l[h.current]))},forward:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;h.current+r>=l.length||(h.current+=r,s(l[h.current]))},reset:function(){s(t),f([t]),h.current=0},undo:function(){0!==h.current&&(h.current--,s(l[h.current]),f((function(r){return r.slice(0,h.current+1)})))}}};
3
3
  //# sourceMappingURL=useStateHistory.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var t=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),e=require("react");exports.useStep=function(r){var n="object"===t._typeof(r)?r.max:r,u="object"===t._typeof(r)?r.initial:1,i=e.useRef(u>n||u<1?1:u),s=e.useState(u),c=t._slicedToArray(s,2),o=c[0],a=c[1],f=1===o,l=o===n;return{counts:n,currentStep:o,isFirst:f,isLast:l,next:function(){l||a((function(t){return t+1}))},back:function(){f||a((function(t){return t-1}))},reset:function(){return a(i.current)},set:function(t){return"first"===t?a(i.current):"last"===t||t>=n?a(n):t<=1?a(1):void a(t)}}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var t=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),e=require("react");exports.useStep=function(r){var n="object"===t._typeof(r)?r.max:r,u="object"===t._typeof(r)?r.initial:1,i=e.useRef(u>n||u<1?1:u),s=e.useState(u),c=t._slicedToArray(s,2),o=c[0],a=c[1],f=1===o,l=o===n;return{counts:n,currentStep:o,isFirst:f,isLast:l,next:function(){l||a((function(t){return t+1}))},back:function(){f||a((function(t){return t-1}))},reset:function(){return a(i.current)},set:function(t){return"first"===t?a(i.current):"last"===t||t>=n?a(n):t<=1?a(1):void a(t)}}};
3
3
  //# sourceMappingURL=useStep.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),t=require("react"),r=function(e){return e?{days:Math.floor(e/86400),hours:Math.floor(e%86400/3600),minutes:Math.floor(e%3600/60),seconds:Math.floor(e%60),count:e}:{days:0,hours:0,minutes:0,seconds:0,count:0}};exports.useStopwatch=function(){for(var n,o,u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];var a=null!==(n="number"==typeof s[0]?s[0]:null===(o=s[0])||void 0===o?void 0:o.initialTime)&&void 0!==n?n:0,i="number"==typeof s[0]?s[1]:s[0],d=t.useState(r(a)),l=e._slicedToArray(d,2),f=l[0],p=l[1],b=t.useState(!(null!=i&&i.enabled)),S=e._slicedToArray(b,2),_=S[0],h=S[1];return t.useEffect((function(){if(!_){var t=setInterval((function(){p((function(t){var r=t.count+1;return r%60==0?e._objectSpread2(e._objectSpread2({},t),{},{minutes:t.minutes+1,seconds:0,count:r}):r%3600==0?e._objectSpread2(e._objectSpread2({},t),{},{hours:t.hours+1,minutes:0,seconds:0,count:r}):r%86400==0?e._objectSpread2(e._objectSpread2({},t),{},{days:t.days+1,hours:0,minutes:0,seconds:0,count:r}):e._objectSpread2(e._objectSpread2({},t),{},{seconds:t.seconds+1,count:r})}))}),1e3);return function(){return clearInterval(t)}}}),[_]),e._objectSpread2(e._objectSpread2({},f),{},{paused:_,pause:function(){return h(!0)},start:function(){return h(!1)},reset:function(){return p(r(a))},toggle:function(){return h((function(e){return!e}))}})};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),t=require("react"),r=function(e){return e?{days:Math.floor(e/86400),hours:Math.floor(e%86400/3600),minutes:Math.floor(e%3600/60),seconds:Math.floor(e%60),count:e}:{days:0,hours:0,minutes:0,seconds:0,count:0}};exports.useStopwatch=function(){for(var n,o,u=arguments.length,s=new Array(u),c=0;c<u;c++)s[c]=arguments[c];var a=null!==(n="number"==typeof s[0]?s[0]:null===(o=s[0])||void 0===o?void 0:o.initialTime)&&void 0!==n?n:0,i="number"==typeof s[0]?s[1]:s[0],d=t.useState(r(a)),l=e._slicedToArray(d,2),f=l[0],p=l[1],b=t.useState(!(null!=i&&i.enabled)),S=e._slicedToArray(b,2),_=S[0],h=S[1];return t.useEffect((function(){if(!_){var t=setInterval((function(){p((function(t){var r=t.count+1;return r%60==0?e._objectSpread2(e._objectSpread2({},t),{},{minutes:t.minutes+1,seconds:0,count:r}):r%3600==0?e._objectSpread2(e._objectSpread2({},t),{},{hours:t.hours+1,minutes:0,seconds:0,count:r}):r%86400==0?e._objectSpread2(e._objectSpread2({},t),{},{days:t.days+1,hours:0,minutes:0,seconds:0,count:r}):e._objectSpread2(e._objectSpread2({},t),{},{seconds:t.seconds+1,count:r})}))}),1e3);return function(){return clearInterval(t)}}}),[_]),e._objectSpread2(e._objectSpread2({},f),{},{paused:_,pause:function(){return h(!0)},start:function(){return h(!1)},reset:function(){return p(r(a))},toggle:function(){return h((function(e){return!e}))}})};
3
3
  //# sourceMappingURL=useStopwatch.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),n="reactuse-storage",t=function(e){return window.dispatchEvent(new StorageEvent(n,e))},i=function(e,r,n){var i=e.getItem(r);e.setItem(r,n),t({key:r,oldValue:i,newValue:n,storageArea:e})},o=function(e,r){var n=e.getItem(r);if(n)return n};exports.STORAGE_EVENT=n,exports.dispatchStorageEvent=t,exports.useStorage=function(u,a){var l,s,v="object"===e._typeof(a)&&a&&("serializer"in a||"deserializer"in a||"initialValue"in a||"storage"in a)?a:void 0,d=v?null==v?void 0:v.initialValue:a;if("undefined"==typeof window)return{value:d instanceof Function?d():d};var c=function(e){return null!=v&&v.serializer?v.serializer(e):JSON.stringify(e)},f=null!==(l=null==v?void 0:v.storage)&&void 0!==l?l:null===(s=window)||void 0===s?void 0:s.localStorage,g=function(e){if(null!=v&&v.deserializer)return v.deserializer(e);if("undefined"!==e)try{return JSON.parse(e)}catch(r){return e}},w=r.useState((function(){var e=o(f,u);if(void 0===e&&void 0!==d){var r=d instanceof Function?d():d;return i(f,u,c(r)),r}return e?g(e):void 0})),p=e._slicedToArray(w,2),E=p[0],m=p[1];return r.useEffect((function(){var e=function(){var e=o(f,u);m(e?g(e):void 0)};return window.addEventListener(n,e),function(){return window.removeEventListener(n,e)}}),[u]),{value:E,set:function(e){return i(f,u,c(e))},remove:function(){return function(e,r){var n=e.getItem(r);e.removeItem(r),t({key:r,oldValue:n,newValue:null,storageArea:e})}(f,u)}}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),n="reactuse-storage",t=function(e){return window.dispatchEvent(new StorageEvent(n,e))},i=function(e,r,n){var i=e.getItem(r);e.setItem(r,n),t({key:r,oldValue:i,newValue:n,storageArea:e})},o=function(e,r){var n=e.getItem(r);if(n)return n};exports.STORAGE_EVENT=n,exports.dispatchStorageEvent=t,exports.useStorage=function(u,a){var l,s,v="object"===e._typeof(a)&&a&&("serializer"in a||"deserializer"in a||"initialValue"in a||"storage"in a)?a:void 0,d=v?null==v?void 0:v.initialValue:a;if("undefined"==typeof window)return{value:d instanceof Function?d():d};var c=function(e){return null!=v&&v.serializer?v.serializer(e):JSON.stringify(e)},f=null!==(l=null==v?void 0:v.storage)&&void 0!==l?l:null===(s=window)||void 0===s?void 0:s.localStorage,g=function(e){if(null!=v&&v.deserializer)return v.deserializer(e);if("undefined"!==e)try{return JSON.parse(e)}catch(r){return e}},w=r.useState((function(){var e=o(f,u);if(void 0===e&&void 0!==d){var r=d instanceof Function?d():d;return i(f,u,c(r)),r}return e?g(e):void 0})),p=e._slicedToArray(w,2),E=p[0],m=p[1];return r.useEffect((function(){var e=function(){var e=o(f,u);m(e?g(e):void 0)};return window.addEventListener(n,e),function(){return window.removeEventListener(n,e)}}),[u]),{value:E,set:function(e){return i(f,u,c(e))},remove:function(){return function(e,r){var n=e.getItem(r);e.removeItem(r),t({key:r,oldValue:n,newValue:null,storageArea:e})}(f,u)}}};
3
3
  //# sourceMappingURL=useStorage.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),t=require("react"),r=require("../../utils/helpers/getElement.js"),u=require("../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js"),i=require("../useRefState/useRefState.js");exports.useTextDirection=function(){var n,o="string"==typeof(arguments.length<=0?void 0:arguments[0])&&["auto","ltr","rtl"].includes(arguments.length<=0?void 0:arguments[0])||arguments.length<=0?void 0:arguments[0],l=null!==(n=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0])&&void 0!==n?n:"ltr",s=i.useRefState(),c=function(){var e,t=o?r.getElement(o):s.current;return null!==(e=null==t?void 0:t.getAttribute("dir"))&&void 0!==e?e:l},a=t.useState(c()),v=e._slicedToArray(a,2),f=v[0],d=v[1],g=function(){var e=o?r.getElement(o):s.current;e&&(null==e||e.removeAttribute("dir"))},m=function(e){var t=o?r.getElement(o):s.current;t&&(d(e),t.setAttribute("dir",e))};return u.useIsomorphicLayoutEffect((function(){if(o||s){var e=o?r.getElement(o):s.current;if(e){var t=c();e.setAttribute("dir",t),d(t);var u=new MutationObserver(c);return u.observe(e,{attributes:!0}),function(){u.disconnect()}}}}),[s.current,o]),o?{value:f,set:m,remove:g}:{ref:s,value:f,set:m,remove:g}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),t=require("react"),r=require("../../utils/helpers/getElement.js"),u=require("../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js"),i=require("../useRefState/useRefState.js");exports.useTextDirection=function(){var n,o="string"==typeof(arguments.length<=0?void 0:arguments[0])&&["auto","ltr","rtl"].includes(arguments.length<=0?void 0:arguments[0])||arguments.length<=0?void 0:arguments[0],l=null!==(n=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0])&&void 0!==n?n:"ltr",s=i.useRefState(),c=function(){var e,t=o?r.getElement(o):s.current;return null!==(e=null==t?void 0:t.getAttribute("dir"))&&void 0!==e?e:l},a=t.useState(c()),v=e._slicedToArray(a,2),f=v[0],d=v[1],g=function(){var e=o?r.getElement(o):s.current;e&&(null==e||e.removeAttribute("dir"))},m=function(e){var t=o?r.getElement(o):s.current;t&&(d(e),t.setAttribute("dir",e))};return u.useIsomorphicLayoutEffect((function(){if(o||s){var e=o?r.getElement(o):s.current;if(e){var t=c();e.setAttribute("dir",t),d(t);var u=new MutationObserver(c);return u.observe(e,{attributes:!0}),function(){u.disconnect()}}}}),[s.current,o]),o?{value:f,set:m,remove:g}:{ref:s,value:f,set:m,remove:g}};
3
3
  //# sourceMappingURL=useTextDirection.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),n=require("react"),t=require("../useRerender/useRerender.js"),r=function(e){var n,t=null!==(n=e.rangeCount)&&void 0!==n?n:0;return Array.from({length:t},(function(n,t){return e.getRangeAt(t)}))};exports.getRangesSelection=r,exports.useTextSelection=function(){var u,o=t.useRerender(),i=n.useState("undefined"!=typeof document?document.getSelection():null),c=e._slicedToArray(i,2),l=c[0],s=c[1];n.useEffect((function(){var e=function(){s(document.getSelection()),o()};return document.addEventListener("selectionchange",e),function(){return document.removeEventListener("selectionchange",e)}}),[]);var a=null!==(u=null==l?void 0:l.toString())&&void 0!==u?u:"",d=l?r(l):[],g=d.map((function(e){return e.getBoundingClientRect()}));return{text:a,ranges:d,rects:g,selection:l}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),n=require("react"),t=require("../useRerender/useRerender.js"),r=function(e){var n,t=null!==(n=e.rangeCount)&&void 0!==n?n:0;return Array.from({length:t},(function(n,t){return e.getRangeAt(t)}))};exports.getRangesSelection=r,exports.useTextSelection=function(){var u,o=t.useRerender(),i=n.useState("undefined"!=typeof document?document.getSelection():null),c=e._slicedToArray(i,2),l=c[0],s=c[1];n.useEffect((function(){var e=function(){s(document.getSelection()),o()};return document.addEventListener("selectionchange",e),function(){return document.removeEventListener("selectionchange",e)}}),[]);var a=null!==(u=null==l?void 0:l.toString())&&void 0!==u?u:"",d=l?r(l):[],g=d.map((function(e){return e.getBoundingClientRect()}));return{text:a,ranges:d,rects:g,selection:l}};
3
3
  //# sourceMappingURL=useTextSelection.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("react"),t=require("../../utils/helpers/throttle.js"),r=require("../useEvent/useEvent.js");exports.useThrottleCallback=function(u,s){var n=r.useEvent(u);return e.useMemo((function(){return t.throttle(n,s)}),[s])};
3
3
  //# sourceMappingURL=useThrottleCallback.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),t=require("../useThrottleCallback/useThrottleCallback.js");require("../../utils/helpers/throttle.js"),require("../useEvent/useEvent.js");exports.useThrottleValue=function(u,l){var s=r.useRef(u),a=r.useState(u),c=e._slicedToArray(a,2),i=c[0],n=c[1],o=t.useThrottleCallback(n,l);return r.useEffect((function(){s.current!==u&&(o(u),s.current=u)}),[u]),i};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),t=require("../useThrottleCallback/useThrottleCallback.js");require("../../utils/helpers/throttle.js"),require("../useEvent/useEvent.js");exports.useThrottleValue=function(u,l){var s=r.useRef(u),a=r.useState(u),c=e._slicedToArray(a,2),i=c[0],n=c[1],o=t.useThrottleCallback(n,l);return r.useEffect((function(){s.current!==u&&(o(u),s.current=u)}),[u]),i};
3
3
  //# sourceMappingURL=useThrottleValue.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),t=require("../../utils/helpers/getDate.js"),u=require("../useInterval/useInterval.js");exports.useTime=function(){var s=r.useState(t.getDate()),a=e._slicedToArray(s,2),i=a[0],l=a[1];return u.useInterval((function(){return l(t.getDate())}),1e3),i};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),t=require("../../utils/helpers/getDate.js"),u=require("../useInterval/useInterval.js");exports.useTime=function(){var s=r.useState(t.getDate()),a=e._slicedToArray(s,2),i=a[0],l=a[1];return u.useInterval((function(){return l(t.getDate())}),1e3),i};
3
3
  //# sourceMappingURL=useTime.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react"),u=require("../useEvent/useEvent.js");exports.useTimeout=function(t,n){var c=r.useState(!1),i=e._slicedToArray(c,2),s=i[0],o=i[1],a=r.useRef(),l=u.useEvent(t);return r.useEffect((function(){return a.current=setTimeout((function(){l(),o(!0)}),n),function(){clearTimeout(a.current)}}),[n]),{ready:s,clear:function(){clearTimeout(a.current),o(!0)}}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react"),u=require("../useEvent/useEvent.js");exports.useTimeout=function(t,n){var c=r.useState(!1),i=e._slicedToArray(c,2),s=i[0],o=i[1],a=r.useRef(),l=u.useEvent(t);return r.useEffect((function(){return a.current=setTimeout((function(){l(),o(!0)}),n),function(){clearTimeout(a.current)}}),[n]),{ready:s,clear:function(){clearTimeout(a.current),o(!0)}}};
3
3
  //# sourceMappingURL=useTimeout.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),t=require("react"),r=require("../useInterval/useInterval.js"),n=function(e){var t=Math.ceil(e),r=Math.floor(t/86400),n=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return{seconds:Math.floor(t%60),minutes:o,hours:n,days:r}};exports.getTimeFromSeconds=n,exports.useTimer=function(){var o,l=arguments.length<=0?void 0:arguments[0],i="object"===e._typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onExpire:arguments.length<=1?void 0:arguments[1]},u=null===(o=null==i?void 0:i.autostart)||void 0===o||o,a=t.useState(Math.ceil(l/1e3)),s=e._slicedToArray(a,2),c=s[0],d=s[1],v=t.useState(u),h=e._slicedToArray(v,2),f=h[0],g=h[1];return r.useInterval((function(){var e,t,r=c-1;(null==i||null===(e=i.onTick)||void 0===e||e.call(i,c),d(r),0===r)&&(g(!1),null==i||null===(t=i.onExpire)||void 0===t||t.call(i))}),1e3,{enabled:f}),e._objectSpread2(e._objectSpread2({},n(c)),{},{pause:function(){return g(!1)},toggle:function(){return g(!f)},start:function(){g(!0),d(Math.ceil(l/1e3))},restart:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];d(Math.ceil(e/1e3)),g(t)},running:f})};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),t=require("react"),r=require("../useInterval/useInterval.js"),n=function(e){var t=Math.ceil(e),r=Math.floor(t/86400),n=Math.floor(t%86400/3600),o=Math.floor(t%3600/60);return{seconds:Math.floor(t%60),minutes:o,hours:n,days:r}};exports.getTimeFromSeconds=n,exports.useTimer=function(){var o,l=arguments.length<=0?void 0:arguments[0],i="object"===e._typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onExpire:arguments.length<=1?void 0:arguments[1]},u=null===(o=null==i?void 0:i.autostart)||void 0===o||o,a=t.useState(Math.ceil(l/1e3)),s=e._slicedToArray(a,2),c=s[0],d=s[1],v=t.useState(u),h=e._slicedToArray(v,2),f=h[0],g=h[1];return r.useInterval((function(){var e,t,r=c-1;(null==i||null===(e=i.onTick)||void 0===e||e.call(i,c),d(r),0===r)&&(g(!1),null==i||null===(t=i.onExpire)||void 0===t||t.call(i))}),1e3,{enabled:f}),e._objectSpread2(e._objectSpread2({},n(c)),{},{pause:function(){return g(!1)},toggle:function(){return g(!f)},start:function(){g(!0),d(Math.ceil(l/1e3))},restart:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];d(Math.ceil(e/1e3)),g(t)},running:f})};
3
3
  //# sourceMappingURL=useTimer.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react");exports.useToggle=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[!1,!0],n=r.useReducer((function(e,r){var i=r instanceof Function?r(e[0]):r,n=Math.abs(e.indexOf(i));return e.slice(n).concat(e.slice(0,n))}),i),c=e._slicedToArray(n,2);return[e._slicedToArray(c[0],1)[0],c[1]]};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react");exports.useToggle=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[!1,!0],n=r.useReducer((function(e,r){var i=r instanceof Function?r(e[0]):r,n=Math.abs(e.indexOf(i));return e.slice(n).concat(e.slice(0,n))}),i),c=e._slicedToArray(n,2);return[e._slicedToArray(c[0],1)[0],c[1]]};
3
3
  //# sourceMappingURL=useToggle.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
2
  "use strict";var e=require("react");exports.useUnmount=function(r){var t=e.useRef(r);t.current=r,e.useEffect((function(){return function(){t.current()}}),[])};
3
3
  //# sourceMappingURL=useUnmount.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var r=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),e=require("react");exports.useVibrate=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a="undefined"!=typeof navigator&&"vibrate"in navigator,u=e.useRef(),i=e.useState(!1),c=r._slicedToArray(i,2),o=c[0],v=c[1],l=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;a&&navigator.vibrate(r)},s=function(){a&&(navigator.vibrate(0),v(!1),u.current&&clearInterval(u.current))},f=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n;a&&(u.current&&clearInterval(u.current),v(!0),u.current=setInterval(l,r))};return e.useEffect((function(){if(a&&!(n<=0))return f(n),function(){s()}}),[n,t]),{supported:a,trigger:l,stop:s,active:o,pause:function(){a&&(v(!1),u.current&&clearInterval(u.current))},resume:f}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var r=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),e=require("react");exports.useVibrate=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a="undefined"!=typeof navigator&&"vibrate"in navigator,u=e.useRef(),i=e.useState(!1),c=r._slicedToArray(i,2),o=c[0],v=c[1],l=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;a&&navigator.vibrate(r)},s=function(){a&&(navigator.vibrate(0),v(!1),u.current&&clearInterval(u.current))},f=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n;a&&(u.current&&clearInterval(u.current),v(!0),u.current=setInterval(l,r))};return e.useEffect((function(){if(a&&!(n<=0))return f(n),function(){s()}}),[n,t]),{supported:a,trigger:l,stop:s,active:o,pause:function(){a&&(v(!1),u.current&&clearInterval(u.current))},resume:f}};
3
3
  //# sourceMappingURL=useVibrate.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),n=require("react"),r=require("../../utils/helpers/getRetry.js"),t=require("../useEvent/useEvent.js");exports.useWebSocket=function(u,o){var c=n.useRef(),l=n.useRef(null!=o&&o.retry?r.getRetry(o.retry):0),i=n.useRef(!1),s=n.useState("connecting"),v=e._slicedToArray(s,2),a=v[0],d=v[1],f=t.useEvent((function(){c.current=new WebSocket("function"==typeof u?u():u,null==o?void 0:o.protocols),d("connecting");var e=c.current;e&&(e.onopen=function(){var n;d("connected"),null==o||null===(n=o.onConnected)||void 0===n||n.call(o,e)},e.onerror=function(n){var r;d("failed"),null==o||null===(r=o.onError)||void 0===r||r.call(o,n,e)},e.onmessage=function(n){var r;return null==o||null===(r=o.onMessage)||void 0===r?void 0:r.call(o,n,e)},e.onclose=function(n){var t;if(d("disconnected"),null==o||null===(t=o.onDisconnected)||void 0===t||t.call(o,n,e),!i.current)return l.current>0?(l.current-=1,f()):void(l.current=null!=o&&o.retry?r.getRetry(o.retry):0)})}));n.useEffect((function(){return f(),function(){c.current&&(c.current.close(),c.current=void 0)}}),[u]);return{client:c.current,close:function(){var e;i.current=!0,null===(e=c.current)||void 0===e||e.close()},open:function(){i.current=!1,f()},send:function(e){var n;return null===(n=c.current)||void 0===n?void 0:n.send(e)},status:a}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),n=require("react"),r=require("../../utils/helpers/getRetry.js"),t=require("../useEvent/useEvent.js");exports.useWebSocket=function(u,o){var c=n.useRef(),l=n.useRef(null!=o&&o.retry?r.getRetry(o.retry):0),i=n.useRef(!1),s=n.useState("connecting"),v=e._slicedToArray(s,2),a=v[0],d=v[1],f=t.useEvent((function(){c.current=new WebSocket("function"==typeof u?u():u,null==o?void 0:o.protocols),d("connecting");var e=c.current;e&&(e.onopen=function(){var n;d("connected"),null==o||null===(n=o.onConnected)||void 0===n||n.call(o,e)},e.onerror=function(n){var r;d("failed"),null==o||null===(r=o.onError)||void 0===r||r.call(o,n,e)},e.onmessage=function(n){var r;return null==o||null===(r=o.onMessage)||void 0===r?void 0:r.call(o,n,e)},e.onclose=function(n){var t;if(d("disconnected"),null==o||null===(t=o.onDisconnected)||void 0===t||t.call(o,n,e),!i.current)return l.current>0?(l.current-=1,f()):void(l.current=null!=o&&o.retry?r.getRetry(o.retry):0)})}));n.useEffect((function(){return f(),function(){c.current&&(c.current.close(),c.current=void 0)}}),[u]);return{client:c.current,close:function(){var e;i.current=!0,null===(e=c.current)||void 0===e||e.close()},open:function(){i.current=!1,f()},send:function(e){var n;return null===(n=c.current)||void 0===n?void 0:n.send(e)},status:a}};
3
3
  //# sourceMappingURL=useWebSocket.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../useEventListener/useEventListener.js");require("react"),require("../../utils/helpers/getElement.js"),require("../useEvent/useEvent.js"),require("../useRefState/useRefState.js"),require("../../_rollupPluginBabelHelpers-zZt1zBDH.js");exports.useWindowEvent=function(r,s,t){return e.useEventListener(window,r,s,t)};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../useEventListener/useEventListener.js");require("react"),require("../../utils/helpers/getElement.js"),require("../useEvent/useEvent.js"),require("../useRefState/useRefState.js"),require("../../_rollupPluginBabelHelpers-Du0ODElA.js");exports.useWindowEvent=function(r,s,t){return e.useEventListener(window,r,s,t)};
3
3
  //# sourceMappingURL=useWindowEvent.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),r=require("react");exports.useWindowFocus=function(){var n=r.useState(!1),t=e._slicedToArray(n,2),u=t[0],i=t[1];return r.useEffect((function(){var e=function(){return i(!0)},r=function(){return i(!1)};return window.addEventListener("focus",e),window.addEventListener("blur",r),function(){window.removeEventListener("focus",e),window.removeEventListener("blur",r)}})),u};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),r=require("react");exports.useWindowFocus=function(){var n=r.useState(!1),t=e._slicedToArray(n,2),u=t[0],i=t[1];return r.useEffect((function(){var e=function(){return i(!0)},r=function(){return i(!1)};return window.addEventListener("focus",e),window.addEventListener("blur",r),function(){window.removeEventListener("focus",e),window.removeEventListener("blur",r)}})),u};
3
3
  //# sourceMappingURL=useWindowFocus.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),o=require("react"),r=function(e){var o=e.x,r=e.y,n=e.behavior,i={behavior:void 0===n?"smooth":n};"number"==typeof o&&(i.left=o),"number"==typeof r&&(i.top=r),window.scrollTo(i)};exports.scrollTo=r,exports.useWindowScroll=function(){var n=o.useState({x:"undefined"!=typeof window?window.scrollX:Number.POSITIVE_INFINITY,y:"undefined"!=typeof window?window.scrollY:Number.POSITIVE_INFINITY}),i=e._slicedToArray(n,2),t=i[0],l=i[1];return o.useEffect((function(){var e=function(){return l({x:window.scrollX,y:window.scrollY})};return window.addEventListener("scroll",e),window.addEventListener("resize",e),function(){window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[]),{value:t,scrollTo:r}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),o=require("react"),r=function(e){var o=e.x,r=e.y,n=e.behavior,i={behavior:void 0===n?"smooth":n};"number"==typeof o&&(i.left=o),"number"==typeof r&&(i.top=r),window.scrollTo(i)};exports.scrollTo=r,exports.useWindowScroll=function(){var n=o.useState({x:"undefined"!=typeof window?window.scrollX:Number.POSITIVE_INFINITY,y:"undefined"!=typeof window?window.scrollY:Number.POSITIVE_INFINITY}),i=e._slicedToArray(n,2),t=i[0],l=i[1];return o.useEffect((function(){var e=function(){return l({x:window.scrollX,y:window.scrollY})};return window.addEventListener("scroll",e),window.addEventListener("resize",e),function(){window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}}),[]),{value:t,scrollTo:r}};
3
3
  //# sourceMappingURL=useWindowScroll.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var e=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),n=require("react");exports.useWindowSize=function(i){var t,d=null===(t=null==i?void 0:i.includeScrollbar)||void 0===t||t,o=n.useState((function(){return"undefined"==typeof window?{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY}:{width:d?window.innerWidth:window.document.documentElement.clientWidth,height:d?window.innerHeight:window.document.documentElement.clientHeight}})),r=e._slicedToArray(o,2),u=r[0],w=r[1];return n.useEffect((function(){var e=function(){w(d?{width:window.innerWidth,height:window.innerHeight}:{width:window.document.documentElement.clientWidth,height:window.document.documentElement.clientHeight})};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[null==i?void 0:i.includeScrollbar]),u};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var e=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),n=require("react");exports.useWindowSize=function(i){var t,d=null===(t=null==i?void 0:i.includeScrollbar)||void 0===t||t,o=n.useState((function(){return"undefined"==typeof window?{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY}:{width:d?window.innerWidth:window.document.documentElement.clientWidth,height:d?window.innerHeight:window.document.documentElement.clientHeight}})),r=e._slicedToArray(o,2),u=r[0],w=r[1];return n.useEffect((function(){var e=function(){w(d?{width:window.innerWidth,height:window.innerHeight}:{width:window.document.documentElement.clientWidth,height:window.document.documentElement.clientHeight})};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[null==i?void 0:i.includeScrollbar]),u};
3
3
  //# sourceMappingURL=useWindowSize.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.96 */
2
- "use strict";var r=require("../../_rollupPluginBabelHelpers-zZt1zBDH.js"),e=require("react");exports.useWizard=function(n,t){var o=null!=t?t:n[0].id,i=new Map(n.map((function(r){return[r.id,r]}))),a=e.useState(o),c=r._slicedToArray(a,2),l=c[0],u=c[1],s=e.useState([o]),d=r._slicedToArray(s,2),f=d[0],v=d[1];return{currentStepId:l,set:function(e){var n;if(null===(n=i.get(l))||void 0===n||null===(n=n.nodes)||void 0===n||!n.includes(e))throw new Error("Can't go to ".concat(e," from ").concat(l));v([].concat(r._toConsumableArray(f),[e])),u(e)},reset:function(){u(o),v([o])},back:function(){var r;if(1!==f.length){var e=f[f.length-2];if(null===(r=i.get(l))||void 0===r||null===(r=r.nodes)||void 0===r||!r.includes(e))throw new Error("Can't go to ".concat(e," from ").concat(l));v(f.slice(0,-1)),u(f[f.length-2])}},history:f}};
1
+ /* @license @siberiacancode/reactuse v0.0.98 */
2
+ "use strict";var r=require("../../_rollupPluginBabelHelpers-Du0ODElA.js"),e=require("react");exports.useWizard=function(n,t){var o=null!=t?t:n[0].id,i=new Map(n.map((function(r){return[r.id,r]}))),a=e.useState(o),c=r._slicedToArray(a,2),l=c[0],u=c[1],s=e.useState([o]),d=r._slicedToArray(s,2),f=d[0],v=d[1];return{currentStepId:l,set:function(e){var n;if(null===(n=i.get(l))||void 0===n||null===(n=n.nodes)||void 0===n||!n.includes(e))throw new Error("Can't go to ".concat(e," from ").concat(l));v([].concat(r._toConsumableArray(f),[e])),u(e)},reset:function(){u(o),v([o])},back:function(){var r;if(1!==f.length){var e=f[f.length-2];if(null===(r=i.get(l))||void 0===r||null===(r=r.nodes)||void 0===r||!r.includes(e))throw new Error("Can't go to ".concat(e," from ").concat(l));v(f.slice(0,-1)),u(f[f.length-2])}},history:f}};
3
3
  //# sourceMappingURL=useWizard.js.map