@react-three/drei 10.7.6 → 10.8.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (580) hide show
  1. package/README.md +49 -758
  2. package/_chunks/hls.mjs +3 -0
  3. package/_chunks/libs/@mediapipe/tasks-vision.mjs +4781 -0
  4. package/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
  5. package/_chunks/libs/@use-gesture/core.mjs +1650 -0
  6. package/_chunks/libs/@use-gesture/react.mjs +207 -0
  7. package/_chunks/libs/camera-controls.mjs +2207 -0
  8. package/_chunks/libs/detect-gpu.mjs +515 -0
  9. package/_chunks/libs/hls.js.mjs +21925 -0
  10. package/_chunks/libs/maath.mjs +5200 -0
  11. package/_chunks/libs/stats-gl.mjs +301 -0
  12. package/_chunks/libs/stats.js.mjs +90 -0
  13. package/_chunks/libs/suspend-react.mjs +60 -0
  14. package/_chunks/libs/three.mjs +23169 -0
  15. package/_chunks/libs/tunnel-rat.mjs +458 -0
  16. package/_chunks/libs/zustand.mjs +104 -0
  17. package/_chunks/rolldown-runtime.mjs +47 -0
  18. package/_chunks/vision_bundle.mjs +3 -0
  19. package/core/_chunks/hls.mjs +3 -0
  20. package/core/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
  21. package/core/_chunks/libs/@use-gesture/core.mjs +1650 -0
  22. package/core/_chunks/libs/@use-gesture/react.mjs +207 -0
  23. package/core/_chunks/libs/detect-gpu.mjs +515 -0
  24. package/core/_chunks/libs/hls.js.mjs +21925 -0
  25. package/core/_chunks/libs/maath.mjs +5200 -0
  26. package/core/_chunks/libs/stats-gl.mjs +301 -0
  27. package/core/_chunks/libs/stats.js.mjs +90 -0
  28. package/core/_chunks/libs/suspend-react.mjs +60 -0
  29. package/core/_chunks/libs/three.mjs +22457 -0
  30. package/core/_chunks/libs/tunnel-rat.mjs +458 -0
  31. package/core/_chunks/libs/zustand.mjs +104 -0
  32. package/core/_chunks/rolldown-runtime.mjs +47 -0
  33. package/core/core/index.d.mts +2232 -0
  34. package/core/core/index.mjs +11082 -0
  35. package/experimental/_chunks/libs/three.mjs +15386 -0
  36. package/experimental/experimental/index.d.mts +253 -0
  37. package/experimental/experimental/index.mjs +434 -0
  38. package/external/_chunks/hls.mjs +3 -0
  39. package/external/_chunks/libs/@mediapipe/tasks-vision.mjs +4781 -0
  40. package/external/_chunks/libs/camera-controls.mjs +2207 -0
  41. package/external/_chunks/libs/hls.js.mjs +21925 -0
  42. package/external/_chunks/libs/maath.mjs +5200 -0
  43. package/external/_chunks/libs/suspend-react.mjs +58 -0
  44. package/external/_chunks/libs/three.mjs +15387 -0
  45. package/external/_chunks/rolldown-runtime.mjs +32 -0
  46. package/external/_chunks/vision_bundle.mjs +3 -0
  47. package/external/external/index.d.mts +499 -0
  48. package/external/external/index.mjs +9422 -0
  49. package/index.d.mts +2567 -0
  50. package/index.mjs +20571 -0
  51. package/legacy/_chunks/hls.mjs +3 -0
  52. package/legacy/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
  53. package/legacy/_chunks/libs/@use-gesture/core.mjs +1650 -0
  54. package/legacy/_chunks/libs/@use-gesture/react.mjs +207 -0
  55. package/legacy/_chunks/libs/bidi-js.mjs +675 -0
  56. package/legacy/_chunks/libs/detect-gpu.mjs +515 -0
  57. package/legacy/_chunks/libs/hls.js.mjs +21925 -0
  58. package/legacy/_chunks/libs/maath.mjs +5200 -0
  59. package/legacy/_chunks/libs/stats-gl.mjs +301 -0
  60. package/legacy/_chunks/libs/stats.js.mjs +90 -0
  61. package/legacy/_chunks/libs/suspend-react.mjs +60 -0
  62. package/legacy/_chunks/libs/three.mjs +26062 -0
  63. package/legacy/_chunks/libs/troika-three-text.mjs +6494 -0
  64. package/legacy/_chunks/libs/tunnel-rat.mjs +458 -0
  65. package/legacy/_chunks/libs/zustand.mjs +104 -0
  66. package/legacy/_chunks/rolldown-runtime.mjs +47 -0
  67. package/legacy/legacy/index.d.mts +2788 -0
  68. package/legacy/legacy/index.mjs +14984 -0
  69. package/native/_chunks/hls.mjs +3 -0
  70. package/native/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
  71. package/native/_chunks/libs/@use-gesture/core.mjs +1650 -0
  72. package/native/_chunks/libs/@use-gesture/react.mjs +207 -0
  73. package/native/_chunks/libs/detect-gpu.mjs +515 -0
  74. package/native/_chunks/libs/hls.js.mjs +21925 -0
  75. package/native/_chunks/libs/maath.mjs +5200 -0
  76. package/native/_chunks/libs/stats-gl.mjs +301 -0
  77. package/native/_chunks/libs/stats.js.mjs +90 -0
  78. package/native/_chunks/libs/suspend-react.mjs +60 -0
  79. package/native/_chunks/libs/three.mjs +22592 -0
  80. package/native/_chunks/libs/tunnel-rat.mjs +458 -0
  81. package/native/_chunks/libs/zustand.mjs +104 -0
  82. package/native/_chunks/rolldown-runtime.mjs +47 -0
  83. package/native/native/index.d.mts +3168 -0
  84. package/native/native/index.mjs +14863 -0
  85. package/package.json +41 -10
  86. package/webgpu/_chunks/hls.mjs +3 -0
  87. package/webgpu/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
  88. package/webgpu/_chunks/libs/@use-gesture/core.mjs +1650 -0
  89. package/webgpu/_chunks/libs/@use-gesture/react.mjs +207 -0
  90. package/webgpu/_chunks/libs/detect-gpu.mjs +515 -0
  91. package/webgpu/_chunks/libs/hls.js.mjs +21925 -0
  92. package/webgpu/_chunks/libs/maath.mjs +5200 -0
  93. package/webgpu/_chunks/libs/stats-gl.mjs +301 -0
  94. package/webgpu/_chunks/libs/stats.js.mjs +90 -0
  95. package/webgpu/_chunks/libs/suspend-react.mjs +60 -0
  96. package/webgpu/_chunks/libs/three.mjs +22592 -0
  97. package/webgpu/_chunks/libs/tunnel-rat.mjs +458 -0
  98. package/webgpu/_chunks/libs/zustand.mjs +104 -0
  99. package/webgpu/_chunks/rolldown-runtime.mjs +47 -0
  100. package/webgpu/webgpu/index.d.mts +3166 -0
  101. package/webgpu/webgpu/index.mjs +15015 -0
  102. package/core/AccumulativeShadows.cjs.js +0 -1
  103. package/core/AccumulativeShadows.d.ts +0 -59
  104. package/core/AccumulativeShadows.js +0 -310
  105. package/core/AdaptiveDpr.cjs.js +0 -1
  106. package/core/AdaptiveDpr.d.ts +0 -3
  107. package/core/AdaptiveDpr.js +0 -28
  108. package/core/AdaptiveEvents.cjs.js +0 -1
  109. package/core/AdaptiveEvents.d.ts +0 -1
  110. package/core/AdaptiveEvents.js +0 -20
  111. package/core/ArcballControls.cjs.js +0 -1
  112. package/core/ArcballControls.d.ts +0 -15
  113. package/core/ArcballControls.js +0 -67
  114. package/core/AsciiRenderer.cjs.js +0 -1
  115. package/core/AsciiRenderer.d.ts +0 -11
  116. package/core/AsciiRenderer.js +0 -66
  117. package/core/BBAnchor.cjs.js +0 -1
  118. package/core/BBAnchor.d.ts +0 -7
  119. package/core/BBAnchor.js +0 -37
  120. package/core/Backdrop.cjs.js +0 -1
  121. package/core/Backdrop.d.ts +0 -15
  122. package/core/Backdrop.js +0 -33
  123. package/core/BakeShadows.cjs.js +0 -1
  124. package/core/BakeShadows.d.ts +0 -1
  125. package/core/BakeShadows.js +0 -16
  126. package/core/Billboard.cjs.js +0 -1
  127. package/core/Billboard.d.ts +0 -10
  128. package/core/Billboard.js +0 -53
  129. package/core/Bounds.cjs.js +0 -1
  130. package/core/Bounds.d.ts +0 -36
  131. package/core/Bounds.js +0 -254
  132. package/core/Bvh.cjs.js +0 -1
  133. package/core/Bvh.d.ts +0 -19
  134. package/core/Bvh.js +0 -92
  135. package/core/CameraControls.cjs.js +0 -1
  136. package/core/CameraControls.d.ts +0 -48
  137. package/core/CameraControls.js +0 -151
  138. package/core/CameraShake.cjs.js +0 -1
  139. package/core/CameraShake.d.ts +0 -17
  140. package/core/CameraShake.js +0 -57
  141. package/core/CatmullRomLine.cjs.js +0 -1
  142. package/core/CatmullRomLine.d.ts +0 -10
  143. package/core/CatmullRomLine.js +0 -42
  144. package/core/Caustics.cjs.js +0 -1
  145. package/core/Caustics.d.ts +0 -32
  146. package/core/Caustics.js +0 -388
  147. package/core/Center.cjs.js +0 -1
  148. package/core/Center.d.ts +0 -33
  149. package/core/Center.js +0 -67
  150. package/core/Clone.cjs.js +0 -1
  151. package/core/Clone.d.ts +0 -15
  152. package/core/Clone.js +0 -100
  153. package/core/Cloud.cjs.js +0 -1
  154. package/core/Cloud.d.ts +0 -97
  155. package/core/Cloud.js +0 -231
  156. package/core/ComputedAttribute.cjs.js +0 -1
  157. package/core/ComputedAttribute.d.ts +0 -8
  158. package/core/ComputedAttribute.js +0 -33
  159. package/core/ContactShadows.cjs.js +0 -1
  160. package/core/ContactShadows.d.ts +0 -18
  161. package/core/ContactShadows.js +0 -114
  162. package/core/CubeCamera.cjs.js +0 -1
  163. package/core/CubeCamera.d.ts +0 -21
  164. package/core/CubeCamera.js +0 -86
  165. package/core/CubeTexture.cjs.js +0 -1
  166. package/core/CubeTexture.d.ts +0 -14
  167. package/core/CubeTexture.js +0 -25
  168. package/core/CubicBezierLine.cjs.js +0 -1
  169. package/core/CubicBezierLine.d.ts +0 -12
  170. package/core/CubicBezierLine.js +0 -28
  171. package/core/CurveModifier.cjs.js +0 -1
  172. package/core/CurveModifier.d.ts +0 -11
  173. package/core/CurveModifier.js +0 -27
  174. package/core/Decal.cjs.js +0 -1
  175. package/core/Decal.d.ts +0 -16
  176. package/core/Decal.js +0 -128
  177. package/core/Detailed.cjs.js +0 -1
  178. package/core/Detailed.d.ts +0 -10
  179. package/core/Detailed.js +0 -33
  180. package/core/DetectGPU.cjs.js +0 -1
  181. package/core/DetectGPU.d.ts +0 -7
  182. package/core/DetectGPU.js +0 -14
  183. package/core/DeviceOrientationControls.cjs.js +0 -1
  184. package/core/DeviceOrientationControls.d.ts +0 -10
  185. package/core/DeviceOrientationControls.js +0 -51
  186. package/core/Edges.cjs.js +0 -1
  187. package/core/Edges.d.ts +0 -13
  188. package/core/Edges.js +0 -38
  189. package/core/Effects.cjs.js +0 -1
  190. package/core/Effects.d.ts +0 -25
  191. package/core/Effects.js +0 -91
  192. package/core/Environment.cjs.js +0 -1
  193. package/core/Environment.d.ts +0 -37
  194. package/core/Environment.js +0 -189
  195. package/core/Example.cjs.js +0 -1
  196. package/core/Example.d.ts +0 -13
  197. package/core/Example.js +0 -46
  198. package/core/Fbo.cjs.js +0 -1
  199. package/core/Fbo.d.ts +0 -22
  200. package/core/Fbo.js +0 -63
  201. package/core/Fbx.cjs.js +0 -1
  202. package/core/Fbx.d.ts +0 -11
  203. package/core/Fbx.js +0 -23
  204. package/core/FirstPersonControls.cjs.js +0 -1
  205. package/core/FirstPersonControls.d.ts +0 -8
  206. package/core/FirstPersonControls.js +0 -38
  207. package/core/Fisheye.cjs.js +0 -1
  208. package/core/Fisheye.d.ts +0 -10
  209. package/core/Fisheye.js +0 -95
  210. package/core/Float.cjs.js +0 -1
  211. package/core/Float.d.ts +0 -14
  212. package/core/Float.js +0 -37
  213. package/core/FlyControls.cjs.js +0 -1
  214. package/core/FlyControls.d.ts +0 -10
  215. package/core/FlyControls.js +0 -55
  216. package/core/GizmoHelper.cjs.js +0 -1
  217. package/core/GizmoHelper.d.ts +0 -16
  218. package/core/GizmoHelper.js +0 -116
  219. package/core/GizmoViewcube.cjs.js +0 -1
  220. package/core/GizmoViewcube.d.ts +0 -14
  221. package/core/GizmoViewcube.js +0 -133
  222. package/core/GizmoViewport.cjs.js +0 -1
  223. package/core/GizmoViewport.d.ts +0 -16
  224. package/core/GizmoViewport.js +0 -140
  225. package/core/Gltf.cjs.js +0 -1
  226. package/core/Gltf.d.ts +0 -27
  227. package/core/Gltf.js +0 -52
  228. package/core/GradientTexture.cjs.js +0 -1
  229. package/core/GradientTexture.d.ts +0 -18
  230. package/core/GradientTexture.js +0 -54
  231. package/core/Grid.cjs.js +0 -1
  232. package/core/Grid.d.ts +0 -26
  233. package/core/Grid.js +0 -142
  234. package/core/Helper.cjs.js +0 -1
  235. package/core/Helper.d.ts +0 -16
  236. package/core/Helper.js +0 -47
  237. package/core/Hud.cjs.js +0 -1
  238. package/core/Hud.d.ts +0 -6
  239. package/core/Hud.js +0 -55
  240. package/core/Image.cjs.js +0 -1
  241. package/core/Image.d.ts +0 -38
  242. package/core/Image.js +0 -160
  243. package/core/Instances.cjs.js +0 -1
  244. package/core/Instances.d.ts +0 -64
  245. package/core/Instances.js +0 -313
  246. package/core/Ktx2.cjs.js +0 -1
  247. package/core/Ktx2.d.ts +0 -14
  248. package/core/Ktx2.js +0 -48
  249. package/core/Lightformer.cjs.js +0 -1
  250. package/core/Lightformer.d.ts +0 -15
  251. package/core/Lightformer.js +0 -63
  252. package/core/Line.cjs.js +0 -1
  253. package/core/Line.d.ts +0 -13
  254. package/core/Line.js +0 -73
  255. package/core/MapControls.cjs.js +0 -1
  256. package/core/MapControls.d.ts +0 -14
  257. package/core/MapControls.js +0 -63
  258. package/core/MarchingCubes.cjs.js +0 -1
  259. package/core/MarchingCubes.d.ts +0 -24
  260. package/core/MarchingCubes.js +0 -78
  261. package/core/Mask.cjs.js +0 -1
  262. package/core/Mask.d.ts +0 -17
  263. package/core/Mask.js +0 -42
  264. package/core/MatcapTexture.cjs.js +0 -1
  265. package/core/MatcapTexture.d.ts +0 -9
  266. package/core/MatcapTexture.js +0 -51
  267. package/core/MeshDiscardMaterial.cjs.js +0 -1
  268. package/core/MeshDiscardMaterial.d.ts +0 -10
  269. package/core/MeshDiscardMaterial.js +0 -15
  270. package/core/MeshDistortMaterial.cjs.js +0 -1
  271. package/core/MeshDistortMaterial.d.ts +0 -39
  272. package/core/MeshDistortMaterial.js +0 -72
  273. package/core/MeshPortalMaterial.cjs.js +0 -1
  274. package/core/MeshPortalMaterial.d.ts +0 -25
  275. package/core/MeshPortalMaterial.js +0 -467
  276. package/core/MeshReflectorMaterial.cjs.js +0 -1
  277. package/core/MeshReflectorMaterial.d.ts +0 -14
  278. package/core/MeshReflectorMaterial.js +0 -180
  279. package/core/MeshRefractionMaterial.cjs.js +0 -1
  280. package/core/MeshRefractionMaterial.d.ts +0 -19
  281. package/core/MeshRefractionMaterial.js +0 -73
  282. package/core/MeshTransmissionMaterial.cjs.js +0 -1
  283. package/core/MeshTransmissionMaterial.d.ts +0 -34
  284. package/core/MeshTransmissionMaterial.js +0 -402
  285. package/core/MeshWobbleMaterial.cjs.js +0 -1
  286. package/core/MeshWobbleMaterial.d.ts +0 -36
  287. package/core/MeshWobbleMaterial.js +0 -60
  288. package/core/MotionPathControls.cjs.js +0 -1
  289. package/core/MotionPathControls.d.ts +0 -33
  290. package/core/MotionPathControls.js +0 -121
  291. package/core/MultiMaterial.cjs.js +0 -1
  292. package/core/MultiMaterial.d.ts +0 -4
  293. package/core/MultiMaterial.js +0 -29
  294. package/core/NormalTexture.cjs.js +0 -1
  295. package/core/NormalTexture.d.ts +0 -14
  296. package/core/NormalTexture.js +0 -42
  297. package/core/OrbitControls.cjs.js +0 -1
  298. package/core/OrbitControls.d.ts +0 -22
  299. package/core/OrbitControls.js +0 -79
  300. package/core/OrthographicCamera.cjs.js +0 -1
  301. package/core/OrthographicCamera.d.ts +0 -14
  302. package/core/OrthographicCamera.js +0 -76
  303. package/core/Outlines.cjs.js +0 -1
  304. package/core/Outlines.d.ts +0 -17
  305. package/core/Outlines.js +0 -166
  306. package/core/PerformanceMonitor.cjs.js +0 -1
  307. package/core/PerformanceMonitor.d.ts +0 -36
  308. package/core/PerformanceMonitor.js +0 -116
  309. package/core/PerspectiveCamera.cjs.js +0 -1
  310. package/core/PerspectiveCamera.d.ts +0 -14
  311. package/core/PerspectiveCamera.js +0 -72
  312. package/core/PointMaterial.cjs.js +0 -1
  313. package/core/PointMaterial.d.ts +0 -8
  314. package/core/PointMaterial.js +0 -36
  315. package/core/PointerLockControls.cjs.js +0 -1
  316. package/core/PointerLockControls.d.ts +0 -15
  317. package/core/PointerLockControls.js +0 -89
  318. package/core/Points.cjs.js +0 -1
  319. package/core/Points.d.ts +0 -31
  320. package/core/Points.js +0 -202
  321. package/core/PositionalAudio.cjs.js +0 -1
  322. package/core/PositionalAudio.d.ts +0 -9
  323. package/core/PositionalAudio.js +0 -46
  324. package/core/Preload.cjs.js +0 -1
  325. package/core/Preload.d.ts +0 -7
  326. package/core/Preload.js +0 -44
  327. package/core/Progress.cjs.js +0 -1
  328. package/core/Progress.d.ts +0 -14
  329. package/core/Progress.js +0 -55
  330. package/core/QuadraticBezierLine.cjs.js +0 -1
  331. package/core/QuadraticBezierLine.d.ts +0 -14
  332. package/core/QuadraticBezierLine.js +0 -42
  333. package/core/RenderCubeTexture.cjs.js +0 -1
  334. package/core/RenderCubeTexture.d.ts +0 -30
  335. package/core/RenderCubeTexture.js +0 -96
  336. package/core/RenderTexture.cjs.js +0 -1
  337. package/core/RenderTexture.d.ts +0 -18
  338. package/core/RenderTexture.js +0 -105
  339. package/core/Resize.cjs.js +0 -1
  340. package/core/Resize.d.ts +0 -17
  341. package/core/Resize.js +0 -39
  342. package/core/RoundedBox.cjs.js +0 -1
  343. package/core/RoundedBox.d.ts +0 -14
  344. package/core/RoundedBox.js +0 -70
  345. package/core/Sampler.cjs.js +0 -1
  346. package/core/Sampler.d.ts +0 -28
  347. package/core/Sampler.js +0 -75
  348. package/core/ScreenQuad.cjs.js +0 -1
  349. package/core/ScreenQuad.d.ts +0 -5
  350. package/core/ScreenQuad.js +0 -25
  351. package/core/ScreenSizer.cjs.js +0 -1
  352. package/core/ScreenSizer.d.ts +0 -7
  353. package/core/ScreenSizer.js +0 -39
  354. package/core/ScreenSpace.cjs.js +0 -1
  355. package/core/ScreenSpace.d.ts +0 -7
  356. package/core/ScreenSpace.js +0 -25
  357. package/core/Segments.cjs.js +0 -1
  358. package/core/Segments.d.ts +0 -29
  359. package/core/Segments.js +0 -96
  360. package/core/Shadow.cjs.js +0 -1
  361. package/core/Shadow.d.ts +0 -12
  362. package/core/Shadow.js +0 -42
  363. package/core/ShadowAlpha.cjs.js +0 -1
  364. package/core/ShadowAlpha.d.ts +0 -7
  365. package/core/ShadowAlpha.js +0 -108
  366. package/core/Sky.cjs.js +0 -1
  367. package/core/Sky.d.ts +0 -16
  368. package/core/Sky.js +0 -39
  369. package/core/Sparkles.cjs.js +0 -1
  370. package/core/Sparkles.d.ts +0 -26
  371. package/core/Sparkles.js +0 -161
  372. package/core/Splat.cjs.js +0 -1
  373. package/core/Splat.d.ts +0 -56
  374. package/core/Splat.js +0 -506
  375. package/core/SpotLight.cjs.js +0 -1
  376. package/core/SpotLight.d.ts +0 -27
  377. package/core/SpotLight.js +0 -223
  378. package/core/SpriteAnimator.cjs.js +0 -1
  379. package/core/SpriteAnimator.d.ts +0 -88
  380. package/core/SpriteAnimator.js +0 -413
  381. package/core/Stage.cjs.js +0 -1
  382. package/core/Stage.d.ts +0 -27
  383. package/core/Stage.js +0 -133
  384. package/core/Stars.cjs.js +0 -1
  385. package/core/Stars.d.ts +0 -22
  386. package/core/Stars.js +0 -100
  387. package/core/Stats.cjs.js +0 -1
  388. package/core/Stats.d.ts +0 -7
  389. package/core/Stats.js +0 -32
  390. package/core/StatsGl.cjs.js +0 -1
  391. package/core/StatsGl.d.ts +0 -14
  392. package/core/StatsGl.js +0 -44
  393. package/core/Svg.cjs.js +0 -1
  394. package/core/Svg.d.ts +0 -13
  395. package/core/Svg.js +0 -62
  396. package/core/Text.cjs.js +0 -1
  397. package/core/Text.d.ts +0 -38
  398. package/core/Text.js +0 -57
  399. package/core/Text3D.cjs.js +0 -1
  400. package/core/Text3D.d.ts +0 -20
  401. package/core/Text3D.js +0 -74
  402. package/core/Texture.cjs.js +0 -1
  403. package/core/Texture.d.ts +0 -20
  404. package/core/Texture.js +0 -60
  405. package/core/TrackballControls.cjs.js +0 -1
  406. package/core/TrackballControls.d.ts +0 -15
  407. package/core/TrackballControls.js +0 -72
  408. package/core/Trail.cjs.js +0 -1
  409. package/core/Trail.d.ts +0 -21
  410. package/core/Trail.js +0 -150
  411. package/core/TrailTexture.cjs.js +0 -1
  412. package/core/TrailTexture.d.ts +0 -19
  413. package/core/TrailTexture.js +0 -159
  414. package/core/TransformControls.cjs.js +0 -1
  415. package/core/TransformControls.d.ts +0 -28
  416. package/core/TransformControls.js +0 -114
  417. package/core/VideoTexture.cjs.js +0 -1
  418. package/core/VideoTexture.d.ts +0 -26
  419. package/core/VideoTexture.js +0 -111
  420. package/core/Wireframe.cjs.js +0 -1
  421. package/core/Wireframe.d.ts +0 -15
  422. package/core/Wireframe.js +0 -157
  423. package/core/calculateScaleFactor.cjs.js +0 -1
  424. package/core/calculateScaleFactor.d.ts +0 -3
  425. package/core/calculateScaleFactor.js +0 -31
  426. package/core/index.cjs.js +0 -1
  427. package/core/index.d.ts +0 -122
  428. package/core/index.js +0 -150
  429. package/core/meshBounds.cjs.js +0 -1
  430. package/core/meshBounds.d.ts +0 -2
  431. package/core/meshBounds.js +0 -28
  432. package/core/shaderMaterial.cjs.js +0 -1
  433. package/core/shaderMaterial.d.ts +0 -9
  434. package/core/shaderMaterial.js +0 -29
  435. package/core/shapes.cjs.js +0 -1
  436. package/core/shapes.d.ts +0 -26
  437. package/core/shapes.js +0 -65
  438. package/core/softShadows.cjs.js +0 -1
  439. package/core/softShadows.d.ts +0 -6
  440. package/core/softShadows.js +0 -158
  441. package/core/useAnimations.cjs.js +0 -1
  442. package/core/useAnimations.d.ts +0 -13
  443. package/core/useAnimations.js +0 -52
  444. package/core/useAspect.cjs.js +0 -1
  445. package/core/useAspect.d.ts +0 -1
  446. package/core/useAspect.js +0 -10
  447. package/core/useBoxProjectedEnv.cjs.js +0 -1
  448. package/core/useBoxProjectedEnv.d.ts +0 -19
  449. package/core/useBoxProjectedEnv.js +0 -95
  450. package/core/useCamera.cjs.js +0 -1
  451. package/core/useCamera.d.ts +0 -3
  452. package/core/useCamera.js +0 -19
  453. package/core/useContextBridge.cjs.js +0 -1
  454. package/core/useContextBridge.d.ts +0 -4
  455. package/core/useContextBridge.js +0 -20
  456. package/core/useDepthBuffer.cjs.js +0 -1
  457. package/core/useDepthBuffer.d.ts +0 -6
  458. package/core/useDepthBuffer.js +0 -38
  459. package/core/useEnvironment.cjs.js +0 -1
  460. package/core/useEnvironment.d.ts +0 -17
  461. package/core/useEnvironment.js +0 -150
  462. package/core/useFont.cjs.js +0 -1
  463. package/core/useFont.d.ts +0 -24
  464. package/core/useFont.js +0 -24
  465. package/core/useIntersect.cjs.js +0 -1
  466. package/core/useIntersect.d.ts +0 -3
  467. package/core/useIntersect.js +0 -36
  468. package/core/useSpriteLoader.cjs.js +0 -1
  469. package/core/useSpriteLoader.d.ts +0 -57
  470. package/core/useSpriteLoader.js +0 -402
  471. package/helpers/constants.cjs.js +0 -1
  472. package/helpers/constants.d.ts +0 -1
  473. package/helpers/constants.js +0 -6
  474. package/helpers/deprecated.cjs.js +0 -1
  475. package/helpers/deprecated.d.ts +0 -5
  476. package/helpers/deprecated.js +0 -8
  477. package/helpers/environment-assets.cjs.js +0 -1
  478. package/helpers/environment-assets.d.ts +0 -13
  479. package/helpers/environment-assets.js +0 -14
  480. package/helpers/glsl/DefaultSpotlightShadowShadows.glsl.js +0 -3
  481. package/helpers/glsl/distort.vert.glsl.js +0 -3
  482. package/helpers/ts-utils.cjs.js +0 -1
  483. package/helpers/ts-utils.d.ts +0 -7
  484. package/helpers/ts-utils.js +0 -1
  485. package/helpers/useEffectfulState.cjs.js +0 -1
  486. package/helpers/useEffectfulState.d.ts +0 -4
  487. package/helpers/useEffectfulState.js +0 -17
  488. package/index.cjs.js +0 -1
  489. package/index.d.ts +0 -1
  490. package/index.js +0 -139
  491. package/materials/BlurPass.cjs.js +0 -1
  492. package/materials/BlurPass.d.ts +0 -23
  493. package/materials/BlurPass.js +0 -72
  494. package/materials/ConvolutionMaterial.cjs.js +0 -1
  495. package/materials/ConvolutionMaterial.d.ts +0 -7
  496. package/materials/ConvolutionMaterial.js +0 -97
  497. package/materials/DiscardMaterial.cjs.js +0 -1
  498. package/materials/DiscardMaterial.d.ts +0 -3
  499. package/materials/DiscardMaterial.js +0 -5
  500. package/materials/MeshReflectorMaterial.cjs.js +0 -1
  501. package/materials/MeshReflectorMaterial.d.ts +0 -50
  502. package/materials/MeshReflectorMaterial.js +0 -256
  503. package/materials/MeshRefractionMaterial.cjs.js +0 -1
  504. package/materials/MeshRefractionMaterial.d.ts +0 -18
  505. package/materials/MeshRefractionMaterial.js +0 -163
  506. package/materials/SpotLightMaterial.cjs.js +0 -1
  507. package/materials/SpotLightMaterial.d.ts +0 -4
  508. package/materials/SpotLightMaterial.js +0 -115
  509. package/materials/WireframeMaterial.cjs.js +0 -1
  510. package/materials/WireframeMaterial.d.ts +0 -64
  511. package/materials/WireframeMaterial.js +0 -217
  512. package/native/index.cjs.js +0 -1
  513. package/native/index.d.ts +0 -1
  514. package/native/index.js +0 -150
  515. package/web/CycleRaycast.cjs.js +0 -1
  516. package/web/CycleRaycast.d.ts +0 -10
  517. package/web/CycleRaycast.js +0 -93
  518. package/web/DragControls.cjs.js +0 -1
  519. package/web/DragControls.d.ts +0 -17
  520. package/web/DragControls.js +0 -127
  521. package/web/FaceControls.cjs.js +0 -1
  522. package/web/FaceControls.d.ts +0 -29
  523. package/web/FaceControls.js +0 -236
  524. package/web/FaceLandmarker.cjs.js +0 -1
  525. package/web/FaceLandmarker.d.ts +0 -14
  526. package/web/FaceLandmarker.js +0 -49
  527. package/web/Facemesh.cjs.js +0 -1
  528. package/web/Facemesh.d.ts +0 -118
  529. package/web/Facemesh.js +0 -4538
  530. package/web/Html.cjs.js +0 -1
  531. package/web/Html.d.ts +0 -34
  532. package/web/Html.js +0 -375
  533. package/web/KeyboardControls.cjs.js +0 -1
  534. package/web/KeyboardControls.d.ts +0 -37
  535. package/web/KeyboardControls.js +0 -104
  536. package/web/Loader.cjs.js +0 -1
  537. package/web/Loader.d.ts +0 -12
  538. package/web/Loader.js +0 -101
  539. package/web/PresentationControls.cjs.js +0 -1
  540. package/web/PresentationControls.d.ts +0 -16
  541. package/web/PresentationControls.js +0 -79
  542. package/web/ScreenVideoTexture.cjs.js +0 -1
  543. package/web/ScreenVideoTexture.d.ts +0 -17
  544. package/web/ScreenVideoTexture.js +0 -30
  545. package/web/ScrollControls.cjs.js +0 -1
  546. package/web/ScrollControls.d.ts +0 -45
  547. package/web/ScrollControls.js +0 -237
  548. package/web/Select.cjs.js +0 -1
  549. package/web/Select.d.ts +0 -14
  550. package/web/Select.js +0 -171
  551. package/web/View.cjs.js +0 -1
  552. package/web/View.d.ts +0 -34
  553. package/web/View.js +0 -259
  554. package/web/WebcamVideoTexture.cjs.js +0 -1
  555. package/web/WebcamVideoTexture.d.ts +0 -17
  556. package/web/WebcamVideoTexture.js +0 -33
  557. package/web/index.cjs.js +0 -1
  558. package/web/index.d.ts +0 -17
  559. package/web/index.js +0 -176
  560. package/web/pivotControls/AxisArrow.cjs.js +0 -1
  561. package/web/pivotControls/AxisArrow.d.ts +0 -7
  562. package/web/pivotControls/AxisArrow.js +0 -193
  563. package/web/pivotControls/AxisRotator.cjs.js +0 -1
  564. package/web/pivotControls/AxisRotator.d.ts +0 -7
  565. package/web/pivotControls/AxisRotator.js +0 -220
  566. package/web/pivotControls/PlaneSlider.cjs.js +0 -1
  567. package/web/pivotControls/PlaneSlider.d.ts +0 -7
  568. package/web/pivotControls/PlaneSlider.js +0 -202
  569. package/web/pivotControls/ScalingSphere.cjs.js +0 -1
  570. package/web/pivotControls/ScalingSphere.d.ts +0 -7
  571. package/web/pivotControls/ScalingSphere.js +0 -192
  572. package/web/pivotControls/context.cjs.js +0 -1
  573. package/web/pivotControls/context.d.ts +0 -33
  574. package/web/pivotControls/context.js +0 -5
  575. package/web/pivotControls/index.cjs.js +0 -1
  576. package/web/pivotControls/index.d.ts +0 -39
  577. package/web/pivotControls/index.js +0 -213
  578. package/web/useCursor.cjs.js +0 -1
  579. package/web/useCursor.d.ts +0 -1
  580. package/web/useCursor.js +0 -12
@@ -0,0 +1,1650 @@
1
+ import { n as __esmMin, r as __export, t as __commonJSMin } from "../../rolldown-runtime.mjs";
2
+
3
+ //#region node_modules/@use-gesture/core/dist/maths-0ab39ae9.esm.js
4
+ function clamp(v, min, max) {
5
+ return Math.max(min, Math.min(v, max));
6
+ }
7
+ function rubberband(distance, dimension, constant) {
8
+ if (dimension === 0 || Math.abs(dimension) === Infinity) return Math.pow(distance, constant * 5);
9
+ return distance * dimension * constant / (dimension + constant * distance);
10
+ }
11
+ function rubberbandIfOutOfBounds(position, min, max, constant = .15) {
12
+ if (constant === 0) return clamp(position, min, max);
13
+ if (position < min) return -rubberband(min - position, max - min, constant) + min;
14
+ if (position > max) return +rubberband(position - max, max - min, constant) + max;
15
+ return position;
16
+ }
17
+ function computeRubberband(bounds, [Vx, Vy], [Rx, Ry]) {
18
+ const [[X0, X1], [Y0, Y1]] = bounds;
19
+ return [rubberbandIfOutOfBounds(Vx, X0, X1, Rx), rubberbandIfOutOfBounds(Vy, Y0, Y1, Ry)];
20
+ }
21
+ var V;
22
+ var init_maths_0ab39ae9_esm = __esmMin((() => {
23
+ V = {
24
+ toVector(v, fallback) {
25
+ if (v === void 0) v = fallback;
26
+ return Array.isArray(v) ? v : [v, v];
27
+ },
28
+ add(v1, v2) {
29
+ return [v1[0] + v2[0], v1[1] + v2[1]];
30
+ },
31
+ sub(v1, v2) {
32
+ return [v1[0] - v2[0], v1[1] - v2[1]];
33
+ },
34
+ addTo(v1, v2) {
35
+ v1[0] += v2[0];
36
+ v1[1] += v2[1];
37
+ },
38
+ subTo(v1, v2) {
39
+ v1[0] -= v2[0];
40
+ v1[1] -= v2[1];
41
+ }
42
+ };
43
+ }));
44
+
45
+ //#endregion
46
+ //#region node_modules/@use-gesture/core/dist/actions-fe213e88.esm.js
47
+ function _toPrimitive(input, hint) {
48
+ if (typeof input !== "object" || input === null) return input;
49
+ var prim = input[Symbol.toPrimitive];
50
+ if (prim !== void 0) {
51
+ var res = prim.call(input, hint || "default");
52
+ if (typeof res !== "object") return res;
53
+ throw new TypeError("@@toPrimitive must return a primitive value.");
54
+ }
55
+ return (hint === "string" ? String : Number)(input);
56
+ }
57
+ function _toPropertyKey(arg) {
58
+ var key = _toPrimitive(arg, "string");
59
+ return typeof key === "symbol" ? key : String(key);
60
+ }
61
+ function _defineProperty(obj, key, value) {
62
+ key = _toPropertyKey(key);
63
+ if (key in obj) Object.defineProperty(obj, key, {
64
+ value,
65
+ enumerable: true,
66
+ configurable: true,
67
+ writable: true
68
+ });
69
+ else obj[key] = value;
70
+ return obj;
71
+ }
72
+ function ownKeys(e, r) {
73
+ var t = Object.keys(e);
74
+ if (Object.getOwnPropertySymbols) {
75
+ var o = Object.getOwnPropertySymbols(e);
76
+ r && (o = o.filter(function(r$1) {
77
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
78
+ })), t.push.apply(t, o);
79
+ }
80
+ return t;
81
+ }
82
+ function _objectSpread2(e) {
83
+ for (var r = 1; r < arguments.length; r++) {
84
+ var t = null != arguments[r] ? arguments[r] : {};
85
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
86
+ _defineProperty(e, r$1, t[r$1]);
87
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
88
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
89
+ });
90
+ }
91
+ return e;
92
+ }
93
+ function capitalize(string) {
94
+ if (!string) return "";
95
+ return string[0].toUpperCase() + string.slice(1);
96
+ }
97
+ function hasCapture(capture = false, actionKey) {
98
+ return capture && !actionsWithoutCaptureSupported.includes(actionKey);
99
+ }
100
+ function toHandlerProp(device, action = "", capture = false) {
101
+ const deviceProps = EVENT_TYPE_MAP[device];
102
+ const actionKey = deviceProps ? deviceProps[action] || action : action;
103
+ return "on" + capitalize(device) + capitalize(actionKey) + (hasCapture(capture, actionKey) ? "Capture" : "");
104
+ }
105
+ function parseProp(prop) {
106
+ let eventKey = prop.substring(2).toLowerCase();
107
+ const passive = !!~eventKey.indexOf("passive");
108
+ if (passive) eventKey = eventKey.replace("passive", "");
109
+ const captureKey = pointerCaptureEvents.includes(eventKey) ? "capturecapture" : "capture";
110
+ const capture = !!~eventKey.indexOf(captureKey);
111
+ if (capture) eventKey = eventKey.replace("capture", "");
112
+ return {
113
+ device: eventKey,
114
+ capture,
115
+ passive
116
+ };
117
+ }
118
+ function toDomEventType(device, action = "") {
119
+ const deviceProps = EVENT_TYPE_MAP[device];
120
+ return device + (deviceProps ? deviceProps[action] || action : action);
121
+ }
122
+ function isTouch(event) {
123
+ return "touches" in event;
124
+ }
125
+ function getPointerType(event) {
126
+ if (isTouch(event)) return "touch";
127
+ if ("pointerType" in event) return event.pointerType;
128
+ return "mouse";
129
+ }
130
+ function getCurrentTargetTouchList(event) {
131
+ return Array.from(event.touches).filter((e) => {
132
+ var _event$currentTarget, _event$currentTarget$;
133
+ return e.target === event.currentTarget || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || (_event$currentTarget$ = _event$currentTarget.contains) === null || _event$currentTarget$ === void 0 ? void 0 : _event$currentTarget$.call(_event$currentTarget, e.target));
134
+ });
135
+ }
136
+ function getTouchList(event) {
137
+ return event.type === "touchend" || event.type === "touchcancel" ? event.changedTouches : event.targetTouches;
138
+ }
139
+ function getValueEvent(event) {
140
+ return isTouch(event) ? getTouchList(event)[0] : event;
141
+ }
142
+ function distanceAngle(P1, P2) {
143
+ try {
144
+ const dx = P2.clientX - P1.clientX;
145
+ const dy = P2.clientY - P1.clientY;
146
+ const cx = (P2.clientX + P1.clientX) / 2;
147
+ const cy = (P2.clientY + P1.clientY) / 2;
148
+ const distance = Math.hypot(dx, dy);
149
+ return {
150
+ angle: -(Math.atan2(dx, dy) * 180) / Math.PI,
151
+ distance,
152
+ origin: [cx, cy]
153
+ };
154
+ } catch (_unused) {}
155
+ return null;
156
+ }
157
+ function touchIds(event) {
158
+ return getCurrentTargetTouchList(event).map((touch) => touch.identifier);
159
+ }
160
+ function touchDistanceAngle(event, ids) {
161
+ const [P1, P2] = Array.from(event.touches).filter((touch) => ids.includes(touch.identifier));
162
+ return distanceAngle(P1, P2);
163
+ }
164
+ function pointerId(event) {
165
+ const valueEvent = getValueEvent(event);
166
+ return isTouch(event) ? valueEvent.identifier : valueEvent.pointerId;
167
+ }
168
+ function pointerValues(event) {
169
+ const valueEvent = getValueEvent(event);
170
+ return [valueEvent.clientX, valueEvent.clientY];
171
+ }
172
+ function wheelValues(event) {
173
+ let { deltaX, deltaY, deltaMode } = event;
174
+ if (deltaMode === 1) {
175
+ deltaX *= LINE_HEIGHT;
176
+ deltaY *= LINE_HEIGHT;
177
+ } else if (deltaMode === 2) {
178
+ deltaX *= PAGE_HEIGHT;
179
+ deltaY *= PAGE_HEIGHT;
180
+ }
181
+ return [deltaX, deltaY];
182
+ }
183
+ function scrollValues(event) {
184
+ var _ref, _ref2;
185
+ const { scrollX, scrollY, scrollLeft, scrollTop } = event.currentTarget;
186
+ return [(_ref = scrollX !== null && scrollX !== void 0 ? scrollX : scrollLeft) !== null && _ref !== void 0 ? _ref : 0, (_ref2 = scrollY !== null && scrollY !== void 0 ? scrollY : scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0];
187
+ }
188
+ function getEventDetails(event) {
189
+ const payload = {};
190
+ if ("buttons" in event) payload.buttons = event.buttons;
191
+ if ("shiftKey" in event) {
192
+ const { shiftKey, altKey, metaKey, ctrlKey } = event;
193
+ Object.assign(payload, {
194
+ shiftKey,
195
+ altKey,
196
+ metaKey,
197
+ ctrlKey
198
+ });
199
+ }
200
+ return payload;
201
+ }
202
+ function call(v, ...args) {
203
+ if (typeof v === "function") return v(...args);
204
+ else return v;
205
+ }
206
+ function noop() {}
207
+ function chain(...fns) {
208
+ if (fns.length === 0) return noop;
209
+ if (fns.length === 1) return fns[0];
210
+ return function() {
211
+ let result;
212
+ for (const fn of fns) result = fn.apply(this, arguments) || result;
213
+ return result;
214
+ };
215
+ }
216
+ function assignDefault(value, fallback) {
217
+ return Object.assign({}, fallback, value || {});
218
+ }
219
+ function selectAxis([dx, dy], threshold) {
220
+ const absDx = Math.abs(dx);
221
+ const absDy = Math.abs(dy);
222
+ if (absDx > absDy && absDx > threshold) return "x";
223
+ if (absDy > absDx && absDy > threshold) return "y";
224
+ }
225
+ function persistEvent(event) {
226
+ "persist" in event && typeof event.persist === "function" && event.persist();
227
+ }
228
+ function supportsTouchEvents() {
229
+ return isBrowser && "ontouchstart" in window;
230
+ }
231
+ function isTouchScreen() {
232
+ return supportsTouchEvents() || isBrowser && window.navigator.maxTouchPoints > 1;
233
+ }
234
+ function supportsPointerEvents() {
235
+ return isBrowser && "onpointerdown" in window;
236
+ }
237
+ function supportsPointerLock() {
238
+ return isBrowser && "exitPointerLock" in window.document;
239
+ }
240
+ function supportsGestureEvents() {
241
+ try {
242
+ return "constructor" in GestureEvent;
243
+ } catch (e) {
244
+ return false;
245
+ }
246
+ }
247
+ function clampStateInternalMovementToBounds(state) {
248
+ const [ox, oy] = state.overflow;
249
+ const [dx, dy] = state._delta;
250
+ const [dirx, diry] = state._direction;
251
+ if (ox < 0 && dx > 0 && dirx < 0 || ox > 0 && dx < 0 && dirx > 0) state._movement[0] = state._movementBound[0];
252
+ if (oy < 0 && dy > 0 && diry < 0 || oy > 0 && dy < 0 && diry > 0) state._movement[1] = state._movementBound[1];
253
+ }
254
+ function registerAction(action) {
255
+ EngineMap.set(action.key, action.engine);
256
+ ConfigResolverMap.set(action.key, action.resolver);
257
+ }
258
+ var EVENT_TYPE_MAP, actionsWithoutCaptureSupported, pointerCaptureEvents, LINE_HEIGHT, PAGE_HEIGHT, BEFORE_LAST_KINEMATICS_DELAY, Engine, CoordinatesEngine, identity, DEFAULT_RUBBERBAND, commonConfigResolver, DEFAULT_AXIS_THRESHOLD, coordinatesConfigResolver, KEYS_DELTA_MAP, DragEngine, isBrowser, SUPPORT, DEFAULT_PREVENT_SCROLL_DELAY, DEFAULT_DRAG_DELAY, DEFAULT_SWIPE_VELOCITY, DEFAULT_SWIPE_DISTANCE, DEFAULT_SWIPE_DURATION, DEFAULT_KEYBOARD_DISPLACEMENT, DEFAULT_DRAG_AXIS_THRESHOLD, dragConfigResolver, SCALE_ANGLE_RATIO_INTENT_DEG, PINCH_WHEEL_RATIO, PinchEngine, pinchConfigResolver, MoveEngine, moveConfigResolver, ScrollEngine, scrollConfigResolver, WheelEngine, wheelConfigResolver, HoverEngine, hoverConfigResolver, EngineMap, ConfigResolverMap, dragAction, hoverAction, moveAction, pinchAction, scrollAction, wheelAction;
259
+ var init_actions_fe213e88_esm = __esmMin((() => {
260
+ init_maths_0ab39ae9_esm();
261
+ EVENT_TYPE_MAP = {
262
+ pointer: {
263
+ start: "down",
264
+ change: "move",
265
+ end: "up"
266
+ },
267
+ mouse: {
268
+ start: "down",
269
+ change: "move",
270
+ end: "up"
271
+ },
272
+ touch: {
273
+ start: "start",
274
+ change: "move",
275
+ end: "end"
276
+ },
277
+ gesture: {
278
+ start: "start",
279
+ change: "change",
280
+ end: "end"
281
+ }
282
+ };
283
+ actionsWithoutCaptureSupported = ["enter", "leave"];
284
+ pointerCaptureEvents = ["gotpointercapture", "lostpointercapture"];
285
+ LINE_HEIGHT = 40;
286
+ PAGE_HEIGHT = 800;
287
+ BEFORE_LAST_KINEMATICS_DELAY = 32;
288
+ Engine = class {
289
+ constructor(ctrl, args, key) {
290
+ this.ctrl = ctrl;
291
+ this.args = args;
292
+ this.key = key;
293
+ if (!this.state) {
294
+ this.state = {};
295
+ this.computeValues([0, 0]);
296
+ this.computeInitial();
297
+ if (this.init) this.init();
298
+ this.reset();
299
+ }
300
+ }
301
+ get state() {
302
+ return this.ctrl.state[this.key];
303
+ }
304
+ set state(state) {
305
+ this.ctrl.state[this.key] = state;
306
+ }
307
+ get shared() {
308
+ return this.ctrl.state.shared;
309
+ }
310
+ get eventStore() {
311
+ return this.ctrl.gestureEventStores[this.key];
312
+ }
313
+ get timeoutStore() {
314
+ return this.ctrl.gestureTimeoutStores[this.key];
315
+ }
316
+ get config() {
317
+ return this.ctrl.config[this.key];
318
+ }
319
+ get sharedConfig() {
320
+ return this.ctrl.config.shared;
321
+ }
322
+ get handler() {
323
+ return this.ctrl.handlers[this.key];
324
+ }
325
+ reset() {
326
+ const { state, shared, ingKey, args } = this;
327
+ shared[ingKey] = state._active = state.active = state._blocked = state._force = false;
328
+ state._step = [false, false];
329
+ state.intentional = false;
330
+ state._movement = [0, 0];
331
+ state._distance = [0, 0];
332
+ state._direction = [0, 0];
333
+ state._delta = [0, 0];
334
+ state._bounds = [[-Infinity, Infinity], [-Infinity, Infinity]];
335
+ state.args = args;
336
+ state.axis = void 0;
337
+ state.memo = void 0;
338
+ state.elapsedTime = state.timeDelta = 0;
339
+ state.direction = [0, 0];
340
+ state.distance = [0, 0];
341
+ state.overflow = [0, 0];
342
+ state._movementBound = [false, false];
343
+ state.velocity = [0, 0];
344
+ state.movement = [0, 0];
345
+ state.delta = [0, 0];
346
+ state.timeStamp = 0;
347
+ }
348
+ start(event) {
349
+ const state = this.state;
350
+ const config = this.config;
351
+ if (!state._active) {
352
+ this.reset();
353
+ this.computeInitial();
354
+ state._active = true;
355
+ state.target = event.target;
356
+ state.currentTarget = event.currentTarget;
357
+ state.lastOffset = config.from ? call(config.from, state) : state.offset;
358
+ state.offset = state.lastOffset;
359
+ state.startTime = state.timeStamp = event.timeStamp;
360
+ }
361
+ }
362
+ computeValues(values) {
363
+ const state = this.state;
364
+ state._values = values;
365
+ state.values = this.config.transform(values);
366
+ }
367
+ computeInitial() {
368
+ const state = this.state;
369
+ state._initial = state._values;
370
+ state.initial = state.values;
371
+ }
372
+ compute(event) {
373
+ const { state, config, shared } = this;
374
+ state.args = this.args;
375
+ let dt = 0;
376
+ if (event) {
377
+ state.event = event;
378
+ if (config.preventDefault && event.cancelable) state.event.preventDefault();
379
+ state.type = event.type;
380
+ shared.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size;
381
+ shared.locked = !!document.pointerLockElement;
382
+ Object.assign(shared, getEventDetails(event));
383
+ shared.down = shared.pressed = shared.buttons % 2 === 1 || shared.touches > 0;
384
+ dt = event.timeStamp - state.timeStamp;
385
+ state.timeStamp = event.timeStamp;
386
+ state.elapsedTime = state.timeStamp - state.startTime;
387
+ }
388
+ if (state._active) {
389
+ const _absoluteDelta = state._delta.map(Math.abs);
390
+ V.addTo(state._distance, _absoluteDelta);
391
+ }
392
+ if (this.axisIntent) this.axisIntent(event);
393
+ const [_m0, _m1] = state._movement;
394
+ const [t0, t1] = config.threshold;
395
+ const { _step, values } = state;
396
+ if (config.hasCustomTransform) {
397
+ if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && values[0];
398
+ if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && values[1];
399
+ } else {
400
+ if (_step[0] === false) _step[0] = Math.abs(_m0) >= t0 && Math.sign(_m0) * t0;
401
+ if (_step[1] === false) _step[1] = Math.abs(_m1) >= t1 && Math.sign(_m1) * t1;
402
+ }
403
+ state.intentional = _step[0] !== false || _step[1] !== false;
404
+ if (!state.intentional) return;
405
+ const movement = [0, 0];
406
+ if (config.hasCustomTransform) {
407
+ const [v0, v1] = values;
408
+ movement[0] = _step[0] !== false ? v0 - _step[0] : 0;
409
+ movement[1] = _step[1] !== false ? v1 - _step[1] : 0;
410
+ } else {
411
+ movement[0] = _step[0] !== false ? _m0 - _step[0] : 0;
412
+ movement[1] = _step[1] !== false ? _m1 - _step[1] : 0;
413
+ }
414
+ if (this.restrictToAxis && !state._blocked) this.restrictToAxis(movement);
415
+ const previousOffset = state.offset;
416
+ const gestureIsActive = state._active && !state._blocked || state.active;
417
+ if (gestureIsActive) {
418
+ state.first = state._active && !state.active;
419
+ state.last = !state._active && state.active;
420
+ state.active = shared[this.ingKey] = state._active;
421
+ if (event) {
422
+ if (state.first) {
423
+ if ("bounds" in config) state._bounds = call(config.bounds, state);
424
+ if (this.setup) this.setup();
425
+ }
426
+ state.movement = movement;
427
+ this.computeOffset();
428
+ }
429
+ }
430
+ const [ox, oy] = state.offset;
431
+ const [[x0, x1], [y0, y1]] = state._bounds;
432
+ state.overflow = [ox < x0 ? -1 : ox > x1 ? 1 : 0, oy < y0 ? -1 : oy > y1 ? 1 : 0];
433
+ state._movementBound[0] = state.overflow[0] ? state._movementBound[0] === false ? state._movement[0] : state._movementBound[0] : false;
434
+ state._movementBound[1] = state.overflow[1] ? state._movementBound[1] === false ? state._movement[1] : state._movementBound[1] : false;
435
+ const rubberband$1 = state._active ? config.rubberband || [0, 0] : [0, 0];
436
+ state.offset = computeRubberband(state._bounds, state.offset, rubberband$1);
437
+ state.delta = V.sub(state.offset, previousOffset);
438
+ this.computeMovement();
439
+ if (gestureIsActive && (!state.last || dt > BEFORE_LAST_KINEMATICS_DELAY)) {
440
+ state.delta = V.sub(state.offset, previousOffset);
441
+ const absoluteDelta = state.delta.map(Math.abs);
442
+ V.addTo(state.distance, absoluteDelta);
443
+ state.direction = state.delta.map(Math.sign);
444
+ state._direction = state._delta.map(Math.sign);
445
+ if (!state.first && dt > 0) {
446
+ state.velocity = [absoluteDelta[0] / dt, absoluteDelta[1] / dt];
447
+ state.timeDelta = dt;
448
+ }
449
+ }
450
+ }
451
+ emit() {
452
+ const state = this.state;
453
+ const shared = this.shared;
454
+ const config = this.config;
455
+ if (!state._active) this.clean();
456
+ if ((state._blocked || !state.intentional) && !state._force && !config.triggerAllEvents) return;
457
+ const memo = this.handler(_objectSpread2(_objectSpread2(_objectSpread2({}, shared), state), {}, { [this.aliasKey]: state.values }));
458
+ if (memo !== void 0) state.memo = memo;
459
+ }
460
+ clean() {
461
+ this.eventStore.clean();
462
+ this.timeoutStore.clean();
463
+ }
464
+ };
465
+ CoordinatesEngine = class extends Engine {
466
+ constructor(...args) {
467
+ super(...args);
468
+ _defineProperty(this, "aliasKey", "xy");
469
+ }
470
+ reset() {
471
+ super.reset();
472
+ this.state.axis = void 0;
473
+ }
474
+ init() {
475
+ this.state.offset = [0, 0];
476
+ this.state.lastOffset = [0, 0];
477
+ }
478
+ computeOffset() {
479
+ this.state.offset = V.add(this.state.lastOffset, this.state.movement);
480
+ }
481
+ computeMovement() {
482
+ this.state.movement = V.sub(this.state.offset, this.state.lastOffset);
483
+ }
484
+ axisIntent(event) {
485
+ const state = this.state;
486
+ const config = this.config;
487
+ if (!state.axis && event) {
488
+ const threshold = typeof config.axisThreshold === "object" ? config.axisThreshold[getPointerType(event)] : config.axisThreshold;
489
+ state.axis = selectAxis(state._movement, threshold);
490
+ }
491
+ state._blocked = (config.lockDirection || !!config.axis) && !state.axis || !!config.axis && config.axis !== state.axis;
492
+ }
493
+ restrictToAxis(v) {
494
+ if (this.config.axis || this.config.lockDirection) switch (this.state.axis) {
495
+ case "x":
496
+ v[1] = 0;
497
+ break;
498
+ case "y":
499
+ v[0] = 0;
500
+ break;
501
+ }
502
+ }
503
+ };
504
+ identity = (v) => v;
505
+ DEFAULT_RUBBERBAND = .15;
506
+ commonConfigResolver = {
507
+ enabled(value = true) {
508
+ return value;
509
+ },
510
+ eventOptions(value, _k, config) {
511
+ return _objectSpread2(_objectSpread2({}, config.shared.eventOptions), value);
512
+ },
513
+ preventDefault(value = false) {
514
+ return value;
515
+ },
516
+ triggerAllEvents(value = false) {
517
+ return value;
518
+ },
519
+ rubberband(value = 0) {
520
+ switch (value) {
521
+ case true: return [DEFAULT_RUBBERBAND, DEFAULT_RUBBERBAND];
522
+ case false: return [0, 0];
523
+ default: return V.toVector(value);
524
+ }
525
+ },
526
+ from(value) {
527
+ if (typeof value === "function") return value;
528
+ if (value != null) return V.toVector(value);
529
+ },
530
+ transform(value, _k, config) {
531
+ const transform = value || config.shared.transform;
532
+ this.hasCustomTransform = !!transform;
533
+ if (process.env.NODE_ENV === "development") {
534
+ const originalTransform = transform || identity;
535
+ return (v) => {
536
+ const r = originalTransform(v);
537
+ if (!isFinite(r[0]) || !isFinite(r[1])) console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${r[0]},1]`);
538
+ return r;
539
+ };
540
+ }
541
+ return transform || identity;
542
+ },
543
+ threshold(value) {
544
+ return V.toVector(value, 0);
545
+ }
546
+ };
547
+ if (process.env.NODE_ENV === "development") Object.assign(commonConfigResolver, {
548
+ domTarget(value) {
549
+ if (value !== void 0) throw Error(`[@use-gesture]: \`domTarget\` option has been renamed to \`target\`.`);
550
+ return NaN;
551
+ },
552
+ lockDirection(value) {
553
+ if (value !== void 0) throw Error(`[@use-gesture]: \`lockDirection\` option has been merged with \`axis\`. Use it as in \`{ axis: 'lock' }\``);
554
+ return NaN;
555
+ },
556
+ initial(value) {
557
+ if (value !== void 0) throw Error(`[@use-gesture]: \`initial\` option has been renamed to \`from\`.`);
558
+ return NaN;
559
+ }
560
+ });
561
+ DEFAULT_AXIS_THRESHOLD = 0;
562
+ coordinatesConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
563
+ axis(_v, _k, { axis }) {
564
+ this.lockDirection = axis === "lock";
565
+ if (!this.lockDirection) return axis;
566
+ },
567
+ axisThreshold(value = DEFAULT_AXIS_THRESHOLD) {
568
+ return value;
569
+ },
570
+ bounds(value = {}) {
571
+ if (typeof value === "function") return (state) => coordinatesConfigResolver.bounds(value(state));
572
+ if ("current" in value) return () => value.current;
573
+ if (typeof HTMLElement === "function" && value instanceof HTMLElement) return value;
574
+ const { left = -Infinity, right = Infinity, top = -Infinity, bottom = Infinity } = value;
575
+ return [[left, right], [top, bottom]];
576
+ }
577
+ });
578
+ KEYS_DELTA_MAP = {
579
+ ArrowRight: (displacement, factor = 1) => [displacement * factor, 0],
580
+ ArrowLeft: (displacement, factor = 1) => [-1 * displacement * factor, 0],
581
+ ArrowUp: (displacement, factor = 1) => [0, -1 * displacement * factor],
582
+ ArrowDown: (displacement, factor = 1) => [0, displacement * factor]
583
+ };
584
+ DragEngine = class extends CoordinatesEngine {
585
+ constructor(...args) {
586
+ super(...args);
587
+ _defineProperty(this, "ingKey", "dragging");
588
+ }
589
+ reset() {
590
+ super.reset();
591
+ const state = this.state;
592
+ state._pointerId = void 0;
593
+ state._pointerActive = false;
594
+ state._keyboardActive = false;
595
+ state._preventScroll = false;
596
+ state._delayed = false;
597
+ state.swipe = [0, 0];
598
+ state.tap = false;
599
+ state.canceled = false;
600
+ state.cancel = this.cancel.bind(this);
601
+ }
602
+ setup() {
603
+ const state = this.state;
604
+ if (state._bounds instanceof HTMLElement) {
605
+ const boundRect = state._bounds.getBoundingClientRect();
606
+ const targetRect = state.currentTarget.getBoundingClientRect();
607
+ const _bounds = {
608
+ left: boundRect.left - targetRect.left + state.offset[0],
609
+ right: boundRect.right - targetRect.right + state.offset[0],
610
+ top: boundRect.top - targetRect.top + state.offset[1],
611
+ bottom: boundRect.bottom - targetRect.bottom + state.offset[1]
612
+ };
613
+ state._bounds = coordinatesConfigResolver.bounds(_bounds);
614
+ }
615
+ }
616
+ cancel() {
617
+ const state = this.state;
618
+ if (state.canceled) return;
619
+ state.canceled = true;
620
+ state._active = false;
621
+ setTimeout(() => {
622
+ this.compute();
623
+ this.emit();
624
+ }, 0);
625
+ }
626
+ setActive() {
627
+ this.state._active = this.state._pointerActive || this.state._keyboardActive;
628
+ }
629
+ clean() {
630
+ this.pointerClean();
631
+ this.state._pointerActive = false;
632
+ this.state._keyboardActive = false;
633
+ super.clean();
634
+ }
635
+ pointerDown(event) {
636
+ const config = this.config;
637
+ const state = this.state;
638
+ if (event.buttons != null && (Array.isArray(config.pointerButtons) ? !config.pointerButtons.includes(event.buttons) : config.pointerButtons !== -1 && config.pointerButtons !== event.buttons)) return;
639
+ const ctrlIds = this.ctrl.setEventIds(event);
640
+ if (config.pointerCapture) event.target.setPointerCapture(event.pointerId);
641
+ if (ctrlIds && ctrlIds.size > 1 && state._pointerActive) return;
642
+ this.start(event);
643
+ this.setupPointer(event);
644
+ state._pointerId = pointerId(event);
645
+ state._pointerActive = true;
646
+ this.computeValues(pointerValues(event));
647
+ this.computeInitial();
648
+ if (config.preventScrollAxis && getPointerType(event) !== "mouse") {
649
+ state._active = false;
650
+ this.setupScrollPrevention(event);
651
+ } else if (config.delay > 0) {
652
+ this.setupDelayTrigger(event);
653
+ if (config.triggerAllEvents) {
654
+ this.compute(event);
655
+ this.emit();
656
+ }
657
+ } else this.startPointerDrag(event);
658
+ }
659
+ startPointerDrag(event) {
660
+ const state = this.state;
661
+ state._active = true;
662
+ state._preventScroll = true;
663
+ state._delayed = false;
664
+ this.compute(event);
665
+ this.emit();
666
+ }
667
+ pointerMove(event) {
668
+ const state = this.state;
669
+ const config = this.config;
670
+ if (!state._pointerActive) return;
671
+ const id = pointerId(event);
672
+ if (state._pointerId !== void 0 && id !== state._pointerId) return;
673
+ const _values = pointerValues(event);
674
+ if (document.pointerLockElement === event.target) state._delta = [event.movementX, event.movementY];
675
+ else {
676
+ state._delta = V.sub(_values, state._values);
677
+ this.computeValues(_values);
678
+ }
679
+ V.addTo(state._movement, state._delta);
680
+ this.compute(event);
681
+ if (state._delayed && state.intentional) {
682
+ this.timeoutStore.remove("dragDelay");
683
+ state.active = false;
684
+ this.startPointerDrag(event);
685
+ return;
686
+ }
687
+ if (config.preventScrollAxis && !state._preventScroll) if (state.axis) if (state.axis === config.preventScrollAxis || config.preventScrollAxis === "xy") {
688
+ state._active = false;
689
+ this.clean();
690
+ return;
691
+ } else {
692
+ this.timeoutStore.remove("startPointerDrag");
693
+ this.startPointerDrag(event);
694
+ return;
695
+ }
696
+ else return;
697
+ this.emit();
698
+ }
699
+ pointerUp(event) {
700
+ this.ctrl.setEventIds(event);
701
+ try {
702
+ if (this.config.pointerCapture && event.target.hasPointerCapture(event.pointerId)) event.target.releasePointerCapture(event.pointerId);
703
+ } catch (_unused) {
704
+ if (process.env.NODE_ENV === "development") console.warn(`[@use-gesture]: If you see this message, it's likely that you're using an outdated version of \`@react-three/fiber\`. \n\nPlease upgrade to the latest version.`);
705
+ }
706
+ const state = this.state;
707
+ const config = this.config;
708
+ if (!state._active || !state._pointerActive) return;
709
+ const id = pointerId(event);
710
+ if (state._pointerId !== void 0 && id !== state._pointerId) return;
711
+ this.state._pointerActive = false;
712
+ this.setActive();
713
+ this.compute(event);
714
+ const [dx, dy] = state._distance;
715
+ state.tap = dx <= config.tapsThreshold && dy <= config.tapsThreshold;
716
+ if (state.tap && config.filterTaps) state._force = true;
717
+ else {
718
+ const [_dx, _dy] = state._delta;
719
+ const [_mx, _my] = state._movement;
720
+ const [svx, svy] = config.swipe.velocity;
721
+ const [sx, sy] = config.swipe.distance;
722
+ const sdt = config.swipe.duration;
723
+ if (state.elapsedTime < sdt) {
724
+ const _vx = Math.abs(_dx / state.timeDelta);
725
+ const _vy = Math.abs(_dy / state.timeDelta);
726
+ if (_vx > svx && Math.abs(_mx) > sx) state.swipe[0] = Math.sign(_dx);
727
+ if (_vy > svy && Math.abs(_my) > sy) state.swipe[1] = Math.sign(_dy);
728
+ }
729
+ }
730
+ this.emit();
731
+ }
732
+ pointerClick(event) {
733
+ if (!this.state.tap && event.detail > 0) {
734
+ event.preventDefault();
735
+ event.stopPropagation();
736
+ }
737
+ }
738
+ setupPointer(event) {
739
+ const config = this.config;
740
+ const device = config.device;
741
+ if (process.env.NODE_ENV === "development") try {
742
+ if (device === "pointer" && config.preventScrollDelay === void 0) {
743
+ const currentTarget = "uv" in event ? event.sourceEvent.currentTarget : event.currentTarget;
744
+ if (window.getComputedStyle(currentTarget).touchAction === "auto") console.warn(`[@use-gesture]: The drag target has its \`touch-action\` style property set to \`auto\`. It is recommended to add \`touch-action: 'none'\` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.`, currentTarget);
745
+ }
746
+ } catch (_unused2) {}
747
+ if (config.pointerLock) event.currentTarget.requestPointerLock();
748
+ if (!config.pointerCapture) {
749
+ this.eventStore.add(this.sharedConfig.window, device, "change", this.pointerMove.bind(this));
750
+ this.eventStore.add(this.sharedConfig.window, device, "end", this.pointerUp.bind(this));
751
+ this.eventStore.add(this.sharedConfig.window, device, "cancel", this.pointerUp.bind(this));
752
+ }
753
+ }
754
+ pointerClean() {
755
+ if (this.config.pointerLock && document.pointerLockElement === this.state.currentTarget) document.exitPointerLock();
756
+ }
757
+ preventScroll(event) {
758
+ if (this.state._preventScroll && event.cancelable) event.preventDefault();
759
+ }
760
+ setupScrollPrevention(event) {
761
+ this.state._preventScroll = false;
762
+ persistEvent(event);
763
+ const remove = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), { passive: false });
764
+ this.eventStore.add(this.sharedConfig.window, "touch", "end", remove);
765
+ this.eventStore.add(this.sharedConfig.window, "touch", "cancel", remove);
766
+ this.timeoutStore.add("startPointerDrag", this.startPointerDrag.bind(this), this.config.preventScrollDelay, event);
767
+ }
768
+ setupDelayTrigger(event) {
769
+ this.state._delayed = true;
770
+ this.timeoutStore.add("dragDelay", () => {
771
+ this.state._step = [0, 0];
772
+ this.startPointerDrag(event);
773
+ }, this.config.delay);
774
+ }
775
+ keyDown(event) {
776
+ const deltaFn = KEYS_DELTA_MAP[event.key];
777
+ if (deltaFn) {
778
+ const state = this.state;
779
+ const factor = event.shiftKey ? 10 : event.altKey ? .1 : 1;
780
+ this.start(event);
781
+ state._delta = deltaFn(this.config.keyboardDisplacement, factor);
782
+ state._keyboardActive = true;
783
+ V.addTo(state._movement, state._delta);
784
+ this.compute(event);
785
+ this.emit();
786
+ }
787
+ }
788
+ keyUp(event) {
789
+ if (!(event.key in KEYS_DELTA_MAP)) return;
790
+ this.state._keyboardActive = false;
791
+ this.setActive();
792
+ this.compute(event);
793
+ this.emit();
794
+ }
795
+ bind(bindFunction) {
796
+ const device = this.config.device;
797
+ bindFunction(device, "start", this.pointerDown.bind(this));
798
+ if (this.config.pointerCapture) {
799
+ bindFunction(device, "change", this.pointerMove.bind(this));
800
+ bindFunction(device, "end", this.pointerUp.bind(this));
801
+ bindFunction(device, "cancel", this.pointerUp.bind(this));
802
+ bindFunction("lostPointerCapture", "", this.pointerUp.bind(this));
803
+ }
804
+ if (this.config.keys) {
805
+ bindFunction("key", "down", this.keyDown.bind(this));
806
+ bindFunction("key", "up", this.keyUp.bind(this));
807
+ }
808
+ if (this.config.filterTaps) bindFunction("click", "", this.pointerClick.bind(this), {
809
+ capture: true,
810
+ passive: false
811
+ });
812
+ }
813
+ };
814
+ isBrowser = typeof window !== "undefined" && window.document && window.document.createElement;
815
+ SUPPORT = {
816
+ isBrowser,
817
+ gesture: supportsGestureEvents(),
818
+ touch: supportsTouchEvents(),
819
+ touchscreen: isTouchScreen(),
820
+ pointer: supportsPointerEvents(),
821
+ pointerLock: supportsPointerLock()
822
+ };
823
+ DEFAULT_PREVENT_SCROLL_DELAY = 250;
824
+ DEFAULT_DRAG_DELAY = 180;
825
+ DEFAULT_SWIPE_VELOCITY = .5;
826
+ DEFAULT_SWIPE_DISTANCE = 50;
827
+ DEFAULT_SWIPE_DURATION = 250;
828
+ DEFAULT_KEYBOARD_DISPLACEMENT = 10;
829
+ DEFAULT_DRAG_AXIS_THRESHOLD = {
830
+ mouse: 0,
831
+ touch: 0,
832
+ pen: 8
833
+ };
834
+ dragConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, {
835
+ device(_v, _k, { pointer: { touch = false, lock = false, mouse = false } = {} }) {
836
+ this.pointerLock = lock && SUPPORT.pointerLock;
837
+ if (SUPPORT.touch && touch) return "touch";
838
+ if (this.pointerLock) return "mouse";
839
+ if (SUPPORT.pointer && !mouse) return "pointer";
840
+ if (SUPPORT.touch) return "touch";
841
+ return "mouse";
842
+ },
843
+ preventScrollAxis(value, _k, { preventScroll }) {
844
+ this.preventScrollDelay = typeof preventScroll === "number" ? preventScroll : preventScroll || preventScroll === void 0 && value ? DEFAULT_PREVENT_SCROLL_DELAY : void 0;
845
+ if (!SUPPORT.touchscreen || preventScroll === false) return void 0;
846
+ return value ? value : preventScroll !== void 0 ? "y" : void 0;
847
+ },
848
+ pointerCapture(_v, _k, { pointer: { capture = true, buttons = 1, keys = true } = {} }) {
849
+ this.pointerButtons = buttons;
850
+ this.keys = keys;
851
+ return !this.pointerLock && this.device === "pointer" && capture;
852
+ },
853
+ threshold(value, _k, { filterTaps = false, tapsThreshold = 3, axis = void 0 }) {
854
+ const threshold = V.toVector(value, filterTaps ? tapsThreshold : axis ? 1 : 0);
855
+ this.filterTaps = filterTaps;
856
+ this.tapsThreshold = tapsThreshold;
857
+ return threshold;
858
+ },
859
+ swipe({ velocity = DEFAULT_SWIPE_VELOCITY, distance = DEFAULT_SWIPE_DISTANCE, duration = DEFAULT_SWIPE_DURATION } = {}) {
860
+ return {
861
+ velocity: this.transform(V.toVector(velocity)),
862
+ distance: this.transform(V.toVector(distance)),
863
+ duration
864
+ };
865
+ },
866
+ delay(value = 0) {
867
+ switch (value) {
868
+ case true: return DEFAULT_DRAG_DELAY;
869
+ case false: return 0;
870
+ default: return value;
871
+ }
872
+ },
873
+ axisThreshold(value) {
874
+ if (!value) return DEFAULT_DRAG_AXIS_THRESHOLD;
875
+ return _objectSpread2(_objectSpread2({}, DEFAULT_DRAG_AXIS_THRESHOLD), value);
876
+ },
877
+ keyboardDisplacement(value = DEFAULT_KEYBOARD_DISPLACEMENT) {
878
+ return value;
879
+ }
880
+ });
881
+ if (process.env.NODE_ENV === "development") Object.assign(dragConfigResolver, {
882
+ useTouch(value) {
883
+ if (value !== void 0) throw Error(`[@use-gesture]: \`useTouch\` option has been renamed to \`pointer.touch\`. Use it as in \`{ pointer: { touch: true } }\`.`);
884
+ return NaN;
885
+ },
886
+ experimental_preventWindowScrollY(value) {
887
+ if (value !== void 0) throw Error(`[@use-gesture]: \`experimental_preventWindowScrollY\` option has been renamed to \`preventScroll\`.`);
888
+ return NaN;
889
+ },
890
+ swipeVelocity(value) {
891
+ if (value !== void 0) throw Error(`[@use-gesture]: \`swipeVelocity\` option has been renamed to \`swipe.velocity\`. Use it as in \`{ swipe: { velocity: 0.5 } }\`.`);
892
+ return NaN;
893
+ },
894
+ swipeDistance(value) {
895
+ if (value !== void 0) throw Error(`[@use-gesture]: \`swipeDistance\` option has been renamed to \`swipe.distance\`. Use it as in \`{ swipe: { distance: 50 } }\`.`);
896
+ return NaN;
897
+ },
898
+ swipeDuration(value) {
899
+ if (value !== void 0) throw Error(`[@use-gesture]: \`swipeDuration\` option has been renamed to \`swipe.duration\`. Use it as in \`{ swipe: { duration: 250 } }\`.`);
900
+ return NaN;
901
+ }
902
+ });
903
+ SCALE_ANGLE_RATIO_INTENT_DEG = 30;
904
+ PINCH_WHEEL_RATIO = 100;
905
+ PinchEngine = class extends Engine {
906
+ constructor(...args) {
907
+ super(...args);
908
+ _defineProperty(this, "ingKey", "pinching");
909
+ _defineProperty(this, "aliasKey", "da");
910
+ }
911
+ init() {
912
+ this.state.offset = [1, 0];
913
+ this.state.lastOffset = [1, 0];
914
+ this.state._pointerEvents = /* @__PURE__ */ new Map();
915
+ }
916
+ reset() {
917
+ super.reset();
918
+ const state = this.state;
919
+ state._touchIds = [];
920
+ state.canceled = false;
921
+ state.cancel = this.cancel.bind(this);
922
+ state.turns = 0;
923
+ }
924
+ computeOffset() {
925
+ const { type, movement, lastOffset } = this.state;
926
+ if (type === "wheel") this.state.offset = V.add(movement, lastOffset);
927
+ else this.state.offset = [(1 + movement[0]) * lastOffset[0], movement[1] + lastOffset[1]];
928
+ }
929
+ computeMovement() {
930
+ const { offset, lastOffset } = this.state;
931
+ this.state.movement = [offset[0] / lastOffset[0], offset[1] - lastOffset[1]];
932
+ }
933
+ axisIntent() {
934
+ const state = this.state;
935
+ const [_m0, _m1] = state._movement;
936
+ if (!state.axis) {
937
+ const axisMovementDifference = Math.abs(_m0) * SCALE_ANGLE_RATIO_INTENT_DEG - Math.abs(_m1);
938
+ if (axisMovementDifference < 0) state.axis = "angle";
939
+ else if (axisMovementDifference > 0) state.axis = "scale";
940
+ }
941
+ }
942
+ restrictToAxis(v) {
943
+ if (this.config.lockDirection) {
944
+ if (this.state.axis === "scale") v[1] = 0;
945
+ else if (this.state.axis === "angle") v[0] = 0;
946
+ }
947
+ }
948
+ cancel() {
949
+ const state = this.state;
950
+ if (state.canceled) return;
951
+ setTimeout(() => {
952
+ state.canceled = true;
953
+ state._active = false;
954
+ this.compute();
955
+ this.emit();
956
+ }, 0);
957
+ }
958
+ touchStart(event) {
959
+ this.ctrl.setEventIds(event);
960
+ const state = this.state;
961
+ const ctrlTouchIds = this.ctrl.touchIds;
962
+ if (state._active) {
963
+ if (state._touchIds.every((id) => ctrlTouchIds.has(id))) return;
964
+ }
965
+ if (ctrlTouchIds.size < 2) return;
966
+ this.start(event);
967
+ state._touchIds = Array.from(ctrlTouchIds).slice(0, 2);
968
+ const payload = touchDistanceAngle(event, state._touchIds);
969
+ if (!payload) return;
970
+ this.pinchStart(event, payload);
971
+ }
972
+ pointerStart(event) {
973
+ if (event.buttons != null && event.buttons % 2 !== 1) return;
974
+ this.ctrl.setEventIds(event);
975
+ event.target.setPointerCapture(event.pointerId);
976
+ const state = this.state;
977
+ const _pointerEvents = state._pointerEvents;
978
+ const ctrlPointerIds = this.ctrl.pointerIds;
979
+ if (state._active) {
980
+ if (Array.from(_pointerEvents.keys()).every((id) => ctrlPointerIds.has(id))) return;
981
+ }
982
+ if (_pointerEvents.size < 2) _pointerEvents.set(event.pointerId, event);
983
+ if (state._pointerEvents.size < 2) return;
984
+ this.start(event);
985
+ const payload = distanceAngle(...Array.from(_pointerEvents.values()));
986
+ if (!payload) return;
987
+ this.pinchStart(event, payload);
988
+ }
989
+ pinchStart(event, payload) {
990
+ const state = this.state;
991
+ state.origin = payload.origin;
992
+ this.computeValues([payload.distance, payload.angle]);
993
+ this.computeInitial();
994
+ this.compute(event);
995
+ this.emit();
996
+ }
997
+ touchMove(event) {
998
+ if (!this.state._active) return;
999
+ const payload = touchDistanceAngle(event, this.state._touchIds);
1000
+ if (!payload) return;
1001
+ this.pinchMove(event, payload);
1002
+ }
1003
+ pointerMove(event) {
1004
+ const _pointerEvents = this.state._pointerEvents;
1005
+ if (_pointerEvents.has(event.pointerId)) _pointerEvents.set(event.pointerId, event);
1006
+ if (!this.state._active) return;
1007
+ const payload = distanceAngle(...Array.from(_pointerEvents.values()));
1008
+ if (!payload) return;
1009
+ this.pinchMove(event, payload);
1010
+ }
1011
+ pinchMove(event, payload) {
1012
+ const state = this.state;
1013
+ const prev_a = state._values[1];
1014
+ const delta_a = payload.angle - prev_a;
1015
+ let delta_turns = 0;
1016
+ if (Math.abs(delta_a) > 270) delta_turns += Math.sign(delta_a);
1017
+ this.computeValues([payload.distance, payload.angle - 360 * delta_turns]);
1018
+ state.origin = payload.origin;
1019
+ state.turns = delta_turns;
1020
+ state._movement = [state._values[0] / state._initial[0] - 1, state._values[1] - state._initial[1]];
1021
+ this.compute(event);
1022
+ this.emit();
1023
+ }
1024
+ touchEnd(event) {
1025
+ this.ctrl.setEventIds(event);
1026
+ if (!this.state._active) return;
1027
+ if (this.state._touchIds.some((id) => !this.ctrl.touchIds.has(id))) {
1028
+ this.state._active = false;
1029
+ this.compute(event);
1030
+ this.emit();
1031
+ }
1032
+ }
1033
+ pointerEnd(event) {
1034
+ const state = this.state;
1035
+ this.ctrl.setEventIds(event);
1036
+ try {
1037
+ event.target.releasePointerCapture(event.pointerId);
1038
+ } catch (_unused) {}
1039
+ if (state._pointerEvents.has(event.pointerId)) state._pointerEvents.delete(event.pointerId);
1040
+ if (!state._active) return;
1041
+ if (state._pointerEvents.size < 2) {
1042
+ state._active = false;
1043
+ this.compute(event);
1044
+ this.emit();
1045
+ }
1046
+ }
1047
+ gestureStart(event) {
1048
+ if (event.cancelable) event.preventDefault();
1049
+ const state = this.state;
1050
+ if (state._active) return;
1051
+ this.start(event);
1052
+ this.computeValues([event.scale, event.rotation]);
1053
+ state.origin = [event.clientX, event.clientY];
1054
+ this.compute(event);
1055
+ this.emit();
1056
+ }
1057
+ gestureMove(event) {
1058
+ if (event.cancelable) event.preventDefault();
1059
+ if (!this.state._active) return;
1060
+ const state = this.state;
1061
+ this.computeValues([event.scale, event.rotation]);
1062
+ state.origin = [event.clientX, event.clientY];
1063
+ const _previousMovement = state._movement;
1064
+ state._movement = [event.scale - 1, event.rotation];
1065
+ state._delta = V.sub(state._movement, _previousMovement);
1066
+ this.compute(event);
1067
+ this.emit();
1068
+ }
1069
+ gestureEnd(event) {
1070
+ if (!this.state._active) return;
1071
+ this.state._active = false;
1072
+ this.compute(event);
1073
+ this.emit();
1074
+ }
1075
+ wheel(event) {
1076
+ const modifierKey = this.config.modifierKey;
1077
+ if (modifierKey && (Array.isArray(modifierKey) ? !modifierKey.find((k) => event[k]) : !event[modifierKey])) return;
1078
+ if (!this.state._active) this.wheelStart(event);
1079
+ else this.wheelChange(event);
1080
+ this.timeoutStore.add("wheelEnd", this.wheelEnd.bind(this));
1081
+ }
1082
+ wheelStart(event) {
1083
+ this.start(event);
1084
+ this.wheelChange(event);
1085
+ }
1086
+ wheelChange(event) {
1087
+ if (!("uv" in event)) {
1088
+ if (event.cancelable) event.preventDefault();
1089
+ if (process.env.NODE_ENV === "development" && !event.defaultPrevented) console.warn(`[@use-gesture]: To properly support zoom on trackpads, try using the \`target\` option.\n\nThis message will only appear in development mode.`);
1090
+ }
1091
+ const state = this.state;
1092
+ state._delta = [-wheelValues(event)[1] / PINCH_WHEEL_RATIO * state.offset[0], 0];
1093
+ V.addTo(state._movement, state._delta);
1094
+ clampStateInternalMovementToBounds(state);
1095
+ this.state.origin = [event.clientX, event.clientY];
1096
+ this.compute(event);
1097
+ this.emit();
1098
+ }
1099
+ wheelEnd() {
1100
+ if (!this.state._active) return;
1101
+ this.state._active = false;
1102
+ this.compute();
1103
+ this.emit();
1104
+ }
1105
+ bind(bindFunction) {
1106
+ const device = this.config.device;
1107
+ if (!!device) {
1108
+ bindFunction(device, "start", this[device + "Start"].bind(this));
1109
+ bindFunction(device, "change", this[device + "Move"].bind(this));
1110
+ bindFunction(device, "end", this[device + "End"].bind(this));
1111
+ bindFunction(device, "cancel", this[device + "End"].bind(this));
1112
+ bindFunction("lostPointerCapture", "", this[device + "End"].bind(this));
1113
+ }
1114
+ if (this.config.pinchOnWheel) bindFunction("wheel", "", this.wheel.bind(this), { passive: false });
1115
+ }
1116
+ };
1117
+ pinchConfigResolver = _objectSpread2(_objectSpread2({}, commonConfigResolver), {}, {
1118
+ device(_v, _k, { shared, pointer: { touch = false } = {} }) {
1119
+ if (shared.target && !SUPPORT.touch && SUPPORT.gesture) return "gesture";
1120
+ if (SUPPORT.touch && touch) return "touch";
1121
+ if (SUPPORT.touchscreen) {
1122
+ if (SUPPORT.pointer) return "pointer";
1123
+ if (SUPPORT.touch) return "touch";
1124
+ }
1125
+ },
1126
+ bounds(_v, _k, { scaleBounds = {}, angleBounds = {} }) {
1127
+ const _scaleBounds = (state) => {
1128
+ const D = assignDefault(call(scaleBounds, state), {
1129
+ min: -Infinity,
1130
+ max: Infinity
1131
+ });
1132
+ return [D.min, D.max];
1133
+ };
1134
+ const _angleBounds = (state) => {
1135
+ const A = assignDefault(call(angleBounds, state), {
1136
+ min: -Infinity,
1137
+ max: Infinity
1138
+ });
1139
+ return [A.min, A.max];
1140
+ };
1141
+ if (typeof scaleBounds !== "function" && typeof angleBounds !== "function") return [_scaleBounds(), _angleBounds()];
1142
+ return (state) => [_scaleBounds(state), _angleBounds(state)];
1143
+ },
1144
+ threshold(value, _k, config) {
1145
+ this.lockDirection = config.axis === "lock";
1146
+ return V.toVector(value, this.lockDirection ? [.1, 3] : 0);
1147
+ },
1148
+ modifierKey(value) {
1149
+ if (value === void 0) return "ctrlKey";
1150
+ return value;
1151
+ },
1152
+ pinchOnWheel(value = true) {
1153
+ return value;
1154
+ }
1155
+ });
1156
+ MoveEngine = class extends CoordinatesEngine {
1157
+ constructor(...args) {
1158
+ super(...args);
1159
+ _defineProperty(this, "ingKey", "moving");
1160
+ }
1161
+ move(event) {
1162
+ if (this.config.mouseOnly && event.pointerType !== "mouse") return;
1163
+ if (!this.state._active) this.moveStart(event);
1164
+ else this.moveChange(event);
1165
+ this.timeoutStore.add("moveEnd", this.moveEnd.bind(this));
1166
+ }
1167
+ moveStart(event) {
1168
+ this.start(event);
1169
+ this.computeValues(pointerValues(event));
1170
+ this.compute(event);
1171
+ this.computeInitial();
1172
+ this.emit();
1173
+ }
1174
+ moveChange(event) {
1175
+ if (!this.state._active) return;
1176
+ const values = pointerValues(event);
1177
+ const state = this.state;
1178
+ state._delta = V.sub(values, state._values);
1179
+ V.addTo(state._movement, state._delta);
1180
+ this.computeValues(values);
1181
+ this.compute(event);
1182
+ this.emit();
1183
+ }
1184
+ moveEnd(event) {
1185
+ if (!this.state._active) return;
1186
+ this.state._active = false;
1187
+ this.compute(event);
1188
+ this.emit();
1189
+ }
1190
+ bind(bindFunction) {
1191
+ bindFunction("pointer", "change", this.move.bind(this));
1192
+ bindFunction("pointer", "leave", this.moveEnd.bind(this));
1193
+ }
1194
+ };
1195
+ moveConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, { mouseOnly: (value = true) => value });
1196
+ ScrollEngine = class extends CoordinatesEngine {
1197
+ constructor(...args) {
1198
+ super(...args);
1199
+ _defineProperty(this, "ingKey", "scrolling");
1200
+ }
1201
+ scroll(event) {
1202
+ if (!this.state._active) this.start(event);
1203
+ this.scrollChange(event);
1204
+ this.timeoutStore.add("scrollEnd", this.scrollEnd.bind(this));
1205
+ }
1206
+ scrollChange(event) {
1207
+ if (event.cancelable) event.preventDefault();
1208
+ const state = this.state;
1209
+ const values = scrollValues(event);
1210
+ state._delta = V.sub(values, state._values);
1211
+ V.addTo(state._movement, state._delta);
1212
+ this.computeValues(values);
1213
+ this.compute(event);
1214
+ this.emit();
1215
+ }
1216
+ scrollEnd() {
1217
+ if (!this.state._active) return;
1218
+ this.state._active = false;
1219
+ this.compute();
1220
+ this.emit();
1221
+ }
1222
+ bind(bindFunction) {
1223
+ bindFunction("scroll", "", this.scroll.bind(this));
1224
+ }
1225
+ };
1226
+ scrollConfigResolver = coordinatesConfigResolver;
1227
+ WheelEngine = class extends CoordinatesEngine {
1228
+ constructor(...args) {
1229
+ super(...args);
1230
+ _defineProperty(this, "ingKey", "wheeling");
1231
+ }
1232
+ wheel(event) {
1233
+ if (!this.state._active) this.start(event);
1234
+ this.wheelChange(event);
1235
+ this.timeoutStore.add("wheelEnd", this.wheelEnd.bind(this));
1236
+ }
1237
+ wheelChange(event) {
1238
+ const state = this.state;
1239
+ state._delta = wheelValues(event);
1240
+ V.addTo(state._movement, state._delta);
1241
+ clampStateInternalMovementToBounds(state);
1242
+ this.compute(event);
1243
+ this.emit();
1244
+ }
1245
+ wheelEnd() {
1246
+ if (!this.state._active) return;
1247
+ this.state._active = false;
1248
+ this.compute();
1249
+ this.emit();
1250
+ }
1251
+ bind(bindFunction) {
1252
+ bindFunction("wheel", "", this.wheel.bind(this));
1253
+ }
1254
+ };
1255
+ wheelConfigResolver = coordinatesConfigResolver;
1256
+ HoverEngine = class extends CoordinatesEngine {
1257
+ constructor(...args) {
1258
+ super(...args);
1259
+ _defineProperty(this, "ingKey", "hovering");
1260
+ }
1261
+ enter(event) {
1262
+ if (this.config.mouseOnly && event.pointerType !== "mouse") return;
1263
+ this.start(event);
1264
+ this.computeValues(pointerValues(event));
1265
+ this.compute(event);
1266
+ this.emit();
1267
+ }
1268
+ leave(event) {
1269
+ if (this.config.mouseOnly && event.pointerType !== "mouse") return;
1270
+ const state = this.state;
1271
+ if (!state._active) return;
1272
+ state._active = false;
1273
+ const values = pointerValues(event);
1274
+ state._movement = state._delta = V.sub(values, state._values);
1275
+ this.computeValues(values);
1276
+ this.compute(event);
1277
+ state.delta = state.movement;
1278
+ this.emit();
1279
+ }
1280
+ bind(bindFunction) {
1281
+ bindFunction("pointer", "enter", this.enter.bind(this));
1282
+ bindFunction("pointer", "leave", this.leave.bind(this));
1283
+ }
1284
+ };
1285
+ hoverConfigResolver = _objectSpread2(_objectSpread2({}, coordinatesConfigResolver), {}, { mouseOnly: (value = true) => value });
1286
+ EngineMap = /* @__PURE__ */ new Map();
1287
+ ConfigResolverMap = /* @__PURE__ */ new Map();
1288
+ dragAction = {
1289
+ key: "drag",
1290
+ engine: DragEngine,
1291
+ resolver: dragConfigResolver
1292
+ };
1293
+ hoverAction = {
1294
+ key: "hover",
1295
+ engine: HoverEngine,
1296
+ resolver: hoverConfigResolver
1297
+ };
1298
+ moveAction = {
1299
+ key: "move",
1300
+ engine: MoveEngine,
1301
+ resolver: moveConfigResolver
1302
+ };
1303
+ pinchAction = {
1304
+ key: "pinch",
1305
+ engine: PinchEngine,
1306
+ resolver: pinchConfigResolver
1307
+ };
1308
+ scrollAction = {
1309
+ key: "scroll",
1310
+ engine: ScrollEngine,
1311
+ resolver: scrollConfigResolver
1312
+ };
1313
+ wheelAction = {
1314
+ key: "wheel",
1315
+ engine: WheelEngine,
1316
+ resolver: wheelConfigResolver
1317
+ };
1318
+ }));
1319
+
1320
+ //#endregion
1321
+ //#region node_modules/@use-gesture/core/actions/dist/use-gesture-core-actions.esm.js
1322
+ var use_gesture_core_actions_esm_exports = /* @__PURE__ */ __export({
1323
+ ConfigResolverMap: () => ConfigResolverMap,
1324
+ EngineMap: () => EngineMap,
1325
+ dragAction: () => dragAction,
1326
+ hoverAction: () => hoverAction,
1327
+ moveAction: () => moveAction,
1328
+ pinchAction: () => pinchAction,
1329
+ registerAction: () => registerAction,
1330
+ scrollAction: () => scrollAction,
1331
+ wheelAction: () => wheelAction
1332
+ });
1333
+ var init_use_gesture_core_actions_esm = __esmMin((() => {
1334
+ init_actions_fe213e88_esm();
1335
+ }));
1336
+
1337
+ //#endregion
1338
+ //#region node_modules/@use-gesture/core/dist/use-gesture-core.esm.js
1339
+ var use_gesture_core_esm_exports = /* @__PURE__ */ __export({
1340
+ Controller: () => Controller,
1341
+ parseMergedHandlers: () => parseMergedHandlers
1342
+ });
1343
+ function _objectWithoutPropertiesLoose(source, excluded) {
1344
+ if (source == null) return {};
1345
+ var target = {};
1346
+ var sourceKeys = Object.keys(source);
1347
+ var key, i;
1348
+ for (i = 0; i < sourceKeys.length; i++) {
1349
+ key = sourceKeys[i];
1350
+ if (excluded.indexOf(key) >= 0) continue;
1351
+ target[key] = source[key];
1352
+ }
1353
+ return target;
1354
+ }
1355
+ function _objectWithoutProperties(source, excluded) {
1356
+ if (source == null) return {};
1357
+ var target = _objectWithoutPropertiesLoose(source, excluded);
1358
+ var key, i;
1359
+ if (Object.getOwnPropertySymbols) {
1360
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1361
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
1362
+ key = sourceSymbolKeys[i];
1363
+ if (excluded.indexOf(key) >= 0) continue;
1364
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
1365
+ target[key] = source[key];
1366
+ }
1367
+ }
1368
+ return target;
1369
+ }
1370
+ function resolveWith(config = {}, resolvers) {
1371
+ const result = {};
1372
+ for (const [key, resolver] of Object.entries(resolvers)) switch (typeof resolver) {
1373
+ case "function":
1374
+ if (process.env.NODE_ENV === "development") {
1375
+ const r = resolver.call(result, config[key], key, config);
1376
+ if (!Number.isNaN(r)) result[key] = r;
1377
+ } else result[key] = resolver.call(result, config[key], key, config);
1378
+ break;
1379
+ case "object":
1380
+ result[key] = resolveWith(config[key], resolver);
1381
+ break;
1382
+ case "boolean":
1383
+ if (resolver) result[key] = config[key];
1384
+ break;
1385
+ }
1386
+ return result;
1387
+ }
1388
+ function parse(newConfig, gestureKey, _config = {}) {
1389
+ const _ref = newConfig, { target, eventOptions, window: window$1, enabled, transform } = _ref, rest = _objectWithoutProperties(_ref, _excluded);
1390
+ _config.shared = resolveWith({
1391
+ target,
1392
+ eventOptions,
1393
+ window: window$1,
1394
+ enabled,
1395
+ transform
1396
+ }, sharedConfigResolver);
1397
+ if (gestureKey) {
1398
+ const resolver = ConfigResolverMap.get(gestureKey);
1399
+ _config[gestureKey] = resolveWith(_objectSpread2({ shared: _config.shared }, rest), resolver);
1400
+ } else for (const key in rest) {
1401
+ const resolver = ConfigResolverMap.get(key);
1402
+ if (resolver) _config[key] = resolveWith(_objectSpread2({ shared: _config.shared }, rest[key]), resolver);
1403
+ else if (process.env.NODE_ENV === "development") {
1404
+ if (![
1405
+ "drag",
1406
+ "pinch",
1407
+ "scroll",
1408
+ "wheel",
1409
+ "move",
1410
+ "hover"
1411
+ ].includes(key)) {
1412
+ if (key === "domTarget") throw Error(`[@use-gesture]: \`domTarget\` option has been renamed to \`target\`.`);
1413
+ console.warn(`[@use-gesture]: Unknown config key \`${key}\` was used. Please read the documentation for further information.`);
1414
+ }
1415
+ }
1416
+ }
1417
+ return _config;
1418
+ }
1419
+ function setupGesture(ctrl, gestureKey) {
1420
+ ctrl.gestures.add(gestureKey);
1421
+ ctrl.gestureEventStores[gestureKey] = new EventStore(ctrl, gestureKey);
1422
+ ctrl.gestureTimeoutStores[gestureKey] = new TimeoutStore();
1423
+ }
1424
+ function resolveGestures(ctrl, internalHandlers) {
1425
+ if (internalHandlers.drag) setupGesture(ctrl, "drag");
1426
+ if (internalHandlers.wheel) setupGesture(ctrl, "wheel");
1427
+ if (internalHandlers.scroll) setupGesture(ctrl, "scroll");
1428
+ if (internalHandlers.move) setupGesture(ctrl, "move");
1429
+ if (internalHandlers.pinch) setupGesture(ctrl, "pinch");
1430
+ if (internalHandlers.hover) setupGesture(ctrl, "hover");
1431
+ }
1432
+ function sortHandlers(_handlers) {
1433
+ const native = {};
1434
+ const handlers = {};
1435
+ const actions = /* @__PURE__ */ new Set();
1436
+ for (let key in _handlers) if (RE_NOT_NATIVE.test(key)) {
1437
+ actions.add(RegExp.lastMatch);
1438
+ handlers[key] = _handlers[key];
1439
+ } else native[key] = _handlers[key];
1440
+ return [
1441
+ handlers,
1442
+ native,
1443
+ actions
1444
+ ];
1445
+ }
1446
+ function registerGesture(actions, handlers, handlerKey, key, internalHandlers, config) {
1447
+ if (!actions.has(handlerKey)) return;
1448
+ if (!EngineMap.has(key)) {
1449
+ if (process.env.NODE_ENV === "development") console.warn(`[@use-gesture]: You've created a custom handler that that uses the \`${key}\` gesture but isn't properly configured.\n\nPlease add \`${key}Action\` when creating your handler.`);
1450
+ return;
1451
+ }
1452
+ const startKey = handlerKey + "Start";
1453
+ const endKey = handlerKey + "End";
1454
+ const fn = (state) => {
1455
+ let memo = void 0;
1456
+ if (state.first && startKey in handlers) handlers[startKey](state);
1457
+ if (handlerKey in handlers) memo = handlers[handlerKey](state);
1458
+ if (state.last && endKey in handlers) handlers[endKey](state);
1459
+ return memo;
1460
+ };
1461
+ internalHandlers[key] = fn;
1462
+ config[key] = config[key] || {};
1463
+ }
1464
+ function parseMergedHandlers(mergedHandlers, mergedConfig) {
1465
+ const [handlers, nativeHandlers, actions] = sortHandlers(mergedHandlers);
1466
+ const internalHandlers = {};
1467
+ registerGesture(actions, handlers, "onDrag", "drag", internalHandlers, mergedConfig);
1468
+ registerGesture(actions, handlers, "onWheel", "wheel", internalHandlers, mergedConfig);
1469
+ registerGesture(actions, handlers, "onScroll", "scroll", internalHandlers, mergedConfig);
1470
+ registerGesture(actions, handlers, "onPinch", "pinch", internalHandlers, mergedConfig);
1471
+ registerGesture(actions, handlers, "onMove", "move", internalHandlers, mergedConfig);
1472
+ registerGesture(actions, handlers, "onHover", "hover", internalHandlers, mergedConfig);
1473
+ return {
1474
+ handlers: internalHandlers,
1475
+ config: mergedConfig,
1476
+ nativeHandlers
1477
+ };
1478
+ }
1479
+ var sharedConfigResolver, _excluded, EventStore, TimeoutStore, Controller, bindToProps, RE_NOT_NATIVE;
1480
+ var init_use_gesture_core_esm = __esmMin((() => {
1481
+ init_actions_fe213e88_esm();
1482
+ sharedConfigResolver = {
1483
+ target(value) {
1484
+ if (value) return () => "current" in value ? value.current : value;
1485
+ },
1486
+ enabled(value = true) {
1487
+ return value;
1488
+ },
1489
+ window(value = SUPPORT.isBrowser ? window : void 0) {
1490
+ return value;
1491
+ },
1492
+ eventOptions({ passive = true, capture = false } = {}) {
1493
+ return {
1494
+ passive,
1495
+ capture
1496
+ };
1497
+ },
1498
+ transform(value) {
1499
+ return value;
1500
+ }
1501
+ };
1502
+ _excluded = [
1503
+ "target",
1504
+ "eventOptions",
1505
+ "window",
1506
+ "enabled",
1507
+ "transform"
1508
+ ];
1509
+ EventStore = class {
1510
+ constructor(ctrl, gestureKey) {
1511
+ _defineProperty(this, "_listeners", /* @__PURE__ */ new Set());
1512
+ this._ctrl = ctrl;
1513
+ this._gestureKey = gestureKey;
1514
+ }
1515
+ add(element, device, action, handler, options) {
1516
+ const listeners = this._listeners;
1517
+ const type = toDomEventType(device, action);
1518
+ const eventOptions = _objectSpread2(_objectSpread2({}, this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}), options);
1519
+ element.addEventListener(type, handler, eventOptions);
1520
+ const remove = () => {
1521
+ element.removeEventListener(type, handler, eventOptions);
1522
+ listeners.delete(remove);
1523
+ };
1524
+ listeners.add(remove);
1525
+ return remove;
1526
+ }
1527
+ clean() {
1528
+ this._listeners.forEach((remove) => remove());
1529
+ this._listeners.clear();
1530
+ }
1531
+ };
1532
+ TimeoutStore = class {
1533
+ constructor() {
1534
+ _defineProperty(this, "_timeouts", /* @__PURE__ */ new Map());
1535
+ }
1536
+ add(key, callback, ms = 140, ...args) {
1537
+ this.remove(key);
1538
+ this._timeouts.set(key, window.setTimeout(callback, ms, ...args));
1539
+ }
1540
+ remove(key) {
1541
+ const timeout = this._timeouts.get(key);
1542
+ if (timeout) window.clearTimeout(timeout);
1543
+ }
1544
+ clean() {
1545
+ this._timeouts.forEach((timeout) => void window.clearTimeout(timeout));
1546
+ this._timeouts.clear();
1547
+ }
1548
+ };
1549
+ Controller = class {
1550
+ constructor(handlers) {
1551
+ _defineProperty(this, "gestures", /* @__PURE__ */ new Set());
1552
+ _defineProperty(this, "_targetEventStore", new EventStore(this));
1553
+ _defineProperty(this, "gestureEventStores", {});
1554
+ _defineProperty(this, "gestureTimeoutStores", {});
1555
+ _defineProperty(this, "handlers", {});
1556
+ _defineProperty(this, "config", {});
1557
+ _defineProperty(this, "pointerIds", /* @__PURE__ */ new Set());
1558
+ _defineProperty(this, "touchIds", /* @__PURE__ */ new Set());
1559
+ _defineProperty(this, "state", { shared: {
1560
+ shiftKey: false,
1561
+ metaKey: false,
1562
+ ctrlKey: false,
1563
+ altKey: false
1564
+ } });
1565
+ resolveGestures(this, handlers);
1566
+ }
1567
+ setEventIds(event) {
1568
+ if (isTouch(event)) {
1569
+ this.touchIds = new Set(touchIds(event));
1570
+ return this.touchIds;
1571
+ } else if ("pointerId" in event) {
1572
+ if (event.type === "pointerup" || event.type === "pointercancel") this.pointerIds.delete(event.pointerId);
1573
+ else if (event.type === "pointerdown") this.pointerIds.add(event.pointerId);
1574
+ return this.pointerIds;
1575
+ }
1576
+ }
1577
+ applyHandlers(handlers, nativeHandlers) {
1578
+ this.handlers = handlers;
1579
+ this.nativeHandlers = nativeHandlers;
1580
+ }
1581
+ applyConfig(config, gestureKey) {
1582
+ this.config = parse(config, gestureKey, this.config);
1583
+ }
1584
+ clean() {
1585
+ this._targetEventStore.clean();
1586
+ for (const key of this.gestures) {
1587
+ this.gestureEventStores[key].clean();
1588
+ this.gestureTimeoutStores[key].clean();
1589
+ }
1590
+ }
1591
+ effect() {
1592
+ if (this.config.shared.target) this.bind();
1593
+ return () => this._targetEventStore.clean();
1594
+ }
1595
+ bind(...args) {
1596
+ const sharedConfig = this.config.shared;
1597
+ const props = {};
1598
+ let target;
1599
+ if (sharedConfig.target) {
1600
+ target = sharedConfig.target();
1601
+ if (!target) return;
1602
+ }
1603
+ if (sharedConfig.enabled) {
1604
+ for (const gestureKey of this.gestures) {
1605
+ const gestureConfig = this.config[gestureKey];
1606
+ const bindFunction = bindToProps(props, gestureConfig.eventOptions, !!target);
1607
+ if (gestureConfig.enabled) new (EngineMap.get(gestureKey))(this, args, gestureKey).bind(bindFunction);
1608
+ }
1609
+ const nativeBindFunction = bindToProps(props, sharedConfig.eventOptions, !!target);
1610
+ for (const eventKey in this.nativeHandlers) nativeBindFunction(eventKey, "", (event) => this.nativeHandlers[eventKey](_objectSpread2(_objectSpread2({}, this.state.shared), {}, {
1611
+ event,
1612
+ args
1613
+ })), void 0, true);
1614
+ }
1615
+ for (const handlerProp in props) props[handlerProp] = chain(...props[handlerProp]);
1616
+ if (!target) return props;
1617
+ for (const handlerProp in props) {
1618
+ const { device, capture, passive } = parseProp(handlerProp);
1619
+ this._targetEventStore.add(target, device, "", props[handlerProp], {
1620
+ capture,
1621
+ passive
1622
+ });
1623
+ }
1624
+ }
1625
+ };
1626
+ bindToProps = (props, eventOptions, withPassiveOption) => (device, action, handler, options = {}, isNative = false) => {
1627
+ var _options$capture, _options$passive;
1628
+ const capture = (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : eventOptions.capture;
1629
+ const passive = (_options$passive = options.passive) !== null && _options$passive !== void 0 ? _options$passive : eventOptions.passive;
1630
+ let handlerProp = isNative ? device : toHandlerProp(device, action, capture);
1631
+ if (withPassiveOption && passive) handlerProp += "Passive";
1632
+ props[handlerProp] = props[handlerProp] || [];
1633
+ props[handlerProp].push(handler);
1634
+ };
1635
+ RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;
1636
+ }));
1637
+
1638
+ //#endregion
1639
+ //#region node_modules/@use-gesture/core/utils/dist/use-gesture-core-utils.esm.js
1640
+ var use_gesture_core_utils_esm_exports = /* @__PURE__ */ __export({ rubberbandIfOutOfBounds: () => rubberbandIfOutOfBounds });
1641
+ var init_use_gesture_core_utils_esm = __esmMin((() => {
1642
+ init_maths_0ab39ae9_esm();
1643
+ }));
1644
+
1645
+ //#endregion
1646
+ //#region node_modules/@use-gesture/core/types/dist/use-gesture-core-types.esm.js
1647
+ var require_use_gesture_core_types_esm = /* @__PURE__ */ __commonJSMin((() => {}));
1648
+
1649
+ //#endregion
1650
+ export { use_gesture_core_esm_exports as a, init_use_gesture_core_esm as i, init_use_gesture_core_utils_esm as n, init_use_gesture_core_actions_esm as o, use_gesture_core_utils_esm_exports as r, use_gesture_core_actions_esm_exports as s, require_use_gesture_core_types_esm as t };