@vincentt-xr/sdk 2.0.0-alpha.7 → 2.0.0-alpha.9

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 (639) hide show
  1. package/GROUNDING.md +5651 -82
  2. package/README.md +1 -0
  3. package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
  4. package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
  5. package/dist/DebuggerUI-7ngnJsBe.js +275 -0
  6. package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
  7. package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
  8. package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
  9. package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
  10. package/dist/FaceSurface-DmP9AEeC.js +27 -0
  11. package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
  12. package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
  13. package/dist/SkeletonUtils-C2r90MtN.js +21 -0
  14. package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
  15. package/dist/TextLabel-XE0rQSDn.cjs +2 -0
  16. package/dist/TextLabel-c9BCucOI.js +961 -0
  17. package/dist/assets/cache.d.ts +99 -0
  18. package/dist/assets/estimate.d.ts +11 -0
  19. package/dist/assets/gltfLoader.d.ts +16 -0
  20. package/dist/assets/index.d.ts +7 -0
  21. package/dist/assets/loaders.d.ts +43 -0
  22. package/dist/assets/react.d.ts +33 -0
  23. package/dist/body-pose/index.d.ts +521 -0
  24. package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
  25. package/dist/body-trigger/frame.d.ts +88 -0
  26. package/dist/body-trigger/index.d.ts +6 -0
  27. package/dist/body-trigger/moves.d.ts +235 -0
  28. package/dist/body-trigger/trigger.d.ts +75 -0
  29. package/dist/calibration/calibration.d.ts +75 -0
  30. package/dist/calibration/index.d.ts +6 -0
  31. package/dist/calibration/storage.d.ts +13 -0
  32. package/dist/calibration/types.d.ts +53 -0
  33. package/dist/calibration/useXRCalibration.d.ts +46 -0
  34. package/dist/camera/CameraPermissionGate.d.ts +26 -0
  35. package/dist/camera/devices.d.ts +26 -0
  36. package/dist/camera/index.d.ts +8 -0
  37. package/dist/camera/permission.d.ts +86 -0
  38. package/dist/camera/useCameraPermission.d.ts +35 -0
  39. package/dist/canonicalFace-BHwyCx1c.js +9 -0
  40. package/dist/canonicalFace-C83I225R.cjs +1 -0
  41. package/dist/capabilities/detect.d.ts +45 -0
  42. package/dist/capabilities/index.d.ts +5 -0
  43. package/dist/capabilities/types.d.ts +120 -0
  44. package/dist/capabilities/useXRCapabilities.d.ts +18 -0
  45. package/dist/compat/environment.d.ts +5 -0
  46. package/dist/compat/index.d.ts +4 -0
  47. package/dist/compat/run.d.ts +18 -0
  48. package/dist/compat/scenarios.d.ts +10 -0
  49. package/dist/compat/types.d.ts +101 -0
  50. package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
  51. package/dist/components/BodyInstruction/index.d.ts +69 -0
  52. package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
  53. package/dist/components/BodyTracker/index.d.ts +17 -0
  54. package/dist/components/BodyTrigger/index.d.ts +49 -0
  55. package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
  56. package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
  57. package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
  58. package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
  59. package/dist/components/FaceAtlas/constants.d.ts +8 -0
  60. package/dist/components/FaceAtlas/index.d.ts +7 -0
  61. package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
  62. package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
  63. package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
  64. package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
  65. package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
  66. package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
  67. package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
  68. package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
  69. package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
  70. package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
  71. package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
  72. package/dist/components/FaceCharacter/index.d.ts +18 -0
  73. package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
  74. package/dist/components/FaceInset/FaceInset.d.ts +68 -0
  75. package/dist/components/FaceInset/frame.d.ts +94 -0
  76. package/dist/components/FaceInset/index.d.ts +6 -0
  77. package/dist/components/FaceInset/material.d.ts +40 -0
  78. package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
  79. package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
  80. package/dist/components/FaceInstruction/index.d.ts +56 -0
  81. package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
  82. package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
  83. package/dist/components/FaceLiquify/debug.d.ts +37 -0
  84. package/dist/components/FaceLiquify/frame.d.ts +55 -0
  85. package/dist/components/FaceLiquify/index.d.ts +10 -0
  86. package/dist/components/FaceLiquify/material.d.ts +39 -0
  87. package/dist/components/FaceLiquify/pass.d.ts +49 -0
  88. package/dist/components/FaceLiquify/presence.d.ts +25 -0
  89. package/dist/components/FaceLiquify/presets.d.ts +82 -0
  90. package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
  91. package/dist/components/FaceLiquify/target.d.ts +85 -0
  92. package/dist/components/FaceLiquify/warp.d.ts +72 -0
  93. package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +37 -5
  94. package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
  95. package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +21 -0
  96. package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
  97. package/dist/components/FaceMesh/index.d.ts +2 -2
  98. package/dist/components/FaceRetouch/Background.d.ts +3 -1
  99. package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
  100. package/dist/components/FaceRetouch/renderState.d.ts +19 -0
  101. package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
  102. package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
  103. package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
  104. package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
  105. package/dist/components/FaceSwap/index.d.ts +13 -0
  106. package/dist/components/FaceSwap/settings.d.ts +300 -0
  107. package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
  108. package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
  109. package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
  110. package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
  111. package/dist/components/FaceWarp3D/index.d.ts +2 -3
  112. package/dist/components/Faceless/Faceless.d.ts +51 -0
  113. package/dist/components/Faceless/index.d.ts +2 -0
  114. package/dist/components/GestureListener/index.d.ts +11 -0
  115. package/dist/components/HairLock/HairLock.d.ts +39 -0
  116. package/dist/components/HairLock/index.d.ts +2 -0
  117. package/dist/components/HairLock/lockGeometry.d.ts +15 -0
  118. package/dist/components/HandCutout/index.d.ts +35 -0
  119. package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
  120. package/dist/components/HandInstruction/index.d.ts +74 -0
  121. package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
  122. package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
  123. package/dist/components/HandRig/HandAttachment.d.ts +34 -0
  124. package/dist/components/HandRig/HandOccluder.d.ts +55 -0
  125. package/dist/components/HandRig/HandTattoo.d.ts +61 -0
  126. package/dist/components/HandRig/WristAttachment.d.ts +34 -0
  127. package/dist/components/HandRig/index.d.ts +101 -0
  128. package/dist/components/HandRig/useArmMask.d.ts +29 -0
  129. package/dist/components/HandRig/wristSolve.d.ts +69 -0
  130. package/dist/components/HandTouch/HandTouch.d.ts +62 -0
  131. package/dist/components/HandTouch/Touchable.d.ts +36 -0
  132. package/dist/components/HandTouch/index.d.ts +2 -0
  133. package/dist/components/HandTracker/index.d.ts +10 -0
  134. package/dist/components/HeadBinding/index.d.ts +14 -0
  135. package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
  136. package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
  137. package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
  138. package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
  139. package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
  140. package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
  141. package/dist/components/HeadOccluder/index.d.ts +57 -3
  142. package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
  143. package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
  144. package/dist/components/HolisticTracker/index.d.ts +69 -0
  145. package/dist/components/HolisticTracker/settings.d.ts +58 -0
  146. package/dist/components/HolisticTracker/signals.d.ts +49 -0
  147. package/dist/components/Instruction/HintStage.d.ts +29 -0
  148. package/dist/components/Instruction/InstructionCue.d.ts +126 -0
  149. package/dist/components/Instruction/gestureHold.d.ts +20 -0
  150. package/dist/components/Instruction/ghost.d.ts +129 -0
  151. package/dist/components/Instruction/hintBlend.d.ts +19 -0
  152. package/dist/components/Instruction/hintLook.d.ts +81 -0
  153. package/dist/components/Instruction/hintLoop.d.ts +36 -0
  154. package/dist/components/Instruction/index.d.ts +41 -0
  155. package/dist/components/Instruction/useGhostModel.d.ts +33 -0
  156. package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
  157. package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
  158. package/dist/components/IrisEffect/index.d.ts +51 -0
  159. package/dist/components/IrisEffect/settings.d.ts +117 -0
  160. package/dist/components/LipEffect/LipEffect.d.ts +27 -1
  161. package/dist/components/LipEffect/LipEffectMaterial.d.ts +95 -7
  162. package/dist/components/LipEffect/LipEffects.d.ts +12 -0
  163. package/dist/components/LipEffect/defaults.d.ts +46 -4
  164. package/dist/components/LipEffect/index.d.ts +11 -3
  165. package/dist/components/LipEffect/lipShading.d.ts +73 -0
  166. package/dist/components/LipEffect/settings.d.ts +375 -0
  167. package/dist/components/LipEffect/shader.d.ts +39 -0
  168. package/dist/components/LipEffect/types.d.ts +128 -9
  169. package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
  170. package/dist/components/LipEffect/uvGuide.d.ts +74 -0
  171. package/dist/components/Makeup/Blush.d.ts +18 -0
  172. package/dist/components/Makeup/Brows.d.ts +20 -0
  173. package/dist/components/Makeup/Contour.d.ts +17 -0
  174. package/dist/components/Makeup/Eyeliner.d.ts +20 -0
  175. package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
  176. package/dist/components/Makeup/Highlighter.d.ts +18 -0
  177. package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
  178. package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
  179. package/dist/components/Makeup/constants.d.ts +44 -0
  180. package/dist/components/Makeup/design.d.ts +106 -0
  181. package/dist/components/Makeup/designSamples.d.ts +42 -0
  182. package/dist/components/Makeup/eyes.d.ts +114 -0
  183. package/dist/components/Makeup/fields.d.ts +10 -0
  184. package/dist/components/Makeup/geometry.d.ts +106 -0
  185. package/dist/components/Makeup/index.d.ts +26 -0
  186. package/dist/components/Makeup/looks.d.ts +28 -0
  187. package/dist/components/Makeup/material.d.ts +239 -0
  188. package/dist/components/Makeup/settings.d.ts +54 -0
  189. package/dist/components/Makeup/shades.d.ts +143 -0
  190. package/dist/components/Makeup/shapes.d.ts +27 -0
  191. package/dist/components/Makeup/skinTone.d.ts +135 -0
  192. package/dist/components/Makeup/types.d.ts +110 -0
  193. package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
  194. package/dist/components/Necklace/Necklace.d.ts +44 -0
  195. package/dist/components/Necklace/index.d.ts +1 -0
  196. package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
  197. package/dist/components/ParticleEmitter/index.d.ts +1 -0
  198. package/dist/components/PersonCutout/index.d.ts +50 -0
  199. package/dist/components/PersonCutout/personCutout.d.ts +16 -0
  200. package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
  201. package/dist/components/ScreenImage/index.d.ts +3 -1
  202. package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
  203. package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
  204. package/dist/components/ScreenImage/source.d.ts +6 -0
  205. package/dist/components/ScreenImage/types.d.ts +18 -0
  206. package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
  207. package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
  208. package/dist/components/SegmentationOverlay/index.d.ts +9 -0
  209. package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
  210. package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
  211. package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
  212. package/dist/components/ShoulderOccluder/index.d.ts +43 -0
  213. package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
  214. package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
  215. package/dist/components/SpringSwing/index.d.ts +1 -0
  216. package/dist/components/XRProvider/index.d.ts +16 -2
  217. package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
  218. package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
  219. package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
  220. package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
  221. package/dist/components/index.d.ts +11 -0
  222. package/dist/config/index.d.ts +0 -1
  223. package/dist/constants/index.d.ts +4 -1
  224. package/dist/context-DTxSQvp4.js +13 -0
  225. package/dist/context-hA0Rb2Xa.cjs +1 -0
  226. package/dist/contexts-BH7PdKFS.cjs +1 -0
  227. package/dist/contexts-jak8-tND.js +667 -0
  228. package/dist/coordinates/feed.d.ts +52 -0
  229. package/dist/coordinates/index.d.ts +7 -0
  230. package/dist/coordinates/side.d.ts +40 -0
  231. package/dist/coordinates/spaces.d.ts +49 -0
  232. package/dist/coordinates/viewport.d.ts +22 -0
  233. package/dist/coordinates/world.d.ts +15 -0
  234. package/dist/debug-ui/default-setting.cjs +2 -2
  235. package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
  236. package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
  237. package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
  238. package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
  239. package/dist/debug-ui/index.d.ts +18 -3
  240. package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
  241. package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
  242. package/dist/debug-ui/media-source/index.d.ts +1 -1
  243. package/dist/debug-ui/media-source/session.d.ts +30 -2
  244. package/dist/debug-ui/media-source.cjs +1 -1
  245. package/dist/debug-ui/media-source.js +1 -1
  246. package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
  247. package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
  248. package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
  249. package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
  250. package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
  251. package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
  252. package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
  253. package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
  254. package/dist/debug-ui/settings-panel/index.d.ts +6 -1
  255. package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
  256. package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
  257. package/dist/debug-ui.cjs +3 -3
  258. package/dist/debug-ui.js +2695 -2547
  259. package/dist/detector-K8aej4MB.js +59 -0
  260. package/dist/detector-ijypGtse.cjs +1 -0
  261. package/dist/entries/all.d.ts +3 -1
  262. package/dist/entries/core.d.ts +20 -2
  263. package/dist/entries/face-effects.d.ts +123 -9
  264. package/dist/entries/instructions.d.ts +48 -0
  265. package/dist/entries/internal.d.ts +2 -1
  266. package/dist/entries/low-level.d.ts +49 -3
  267. package/dist/entries/particles.d.ts +11 -0
  268. package/dist/entries/product.d.ts +11 -0
  269. package/dist/entries/tracking.d.ts +60 -2
  270. package/dist/face-atlas/attributes.d.ts +30 -0
  271. package/dist/face-atlas/eyes.d.ts +272 -0
  272. package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
  273. package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
  274. package/dist/face-atlas/glsl/common.d.ts +55 -0
  275. package/dist/face-atlas/glsl/design.d.ts +49 -0
  276. package/dist/face-atlas/glsl/eyes.d.ts +73 -0
  277. package/dist/face-atlas/glsl/finish.d.ts +24 -0
  278. package/dist/face-atlas/glsl/format.d.ts +4 -0
  279. package/dist/face-atlas/glsl/index.d.ts +59 -0
  280. package/dist/face-atlas/glsl/shading.d.ts +15 -0
  281. package/dist/face-atlas/glsl/shapes.d.ts +66 -0
  282. package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
  283. package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
  284. package/dist/face-atlas/guide.d.ts +51 -0
  285. package/dist/face-atlas/index.d.ts +25 -0
  286. package/dist/face-atlas/lead.d.ts +117 -0
  287. package/dist/face-atlas/madeUpCamera.d.ts +125 -0
  288. package/dist/face-atlas/masks.d.ts +53 -0
  289. package/dist/face-atlas/obj.d.ts +69 -0
  290. package/dist/face-atlas/polylines.d.ts +63 -0
  291. package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
  292. package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
  293. package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
  294. package/dist/face-atlas/probe/constants.d.ts +137 -0
  295. package/dist/face-atlas/probe/glsl.d.ts +43 -0
  296. package/dist/face-atlas/probe/lightFit.d.ts +108 -0
  297. package/dist/face-atlas/probe/schedule.d.ts +44 -0
  298. package/dist/face-atlas/probe/selfTest.d.ts +87 -0
  299. package/dist/face-atlas/probe/stats.d.ts +143 -0
  300. package/dist/face-atlas/probe/targets.d.ts +70 -0
  301. package/dist/face-atlas/probe/unwrap.d.ts +76 -0
  302. package/dist/face-atlas/quality.d.ts +28 -0
  303. package/dist/face-atlas/regions.d.ts +31 -0
  304. package/dist/face-atlas/registry.d.ts +252 -0
  305. package/dist/face-atlas/renderState.d.ts +86 -0
  306. package/dist/face-atlas/selfOcclusion.d.ts +62 -0
  307. package/dist/face-atlas/shading.d.ts +406 -0
  308. package/dist/face-atlas/shapes.d.ts +86 -0
  309. package/dist/face-atlas/sides.d.ts +41 -0
  310. package/dist/face-atlas/skinMask.d.ts +35 -0
  311. package/dist/face-atlas/surface.d.ts +155 -0
  312. package/dist/face-atlas/topology.d.ts +44 -0
  313. package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
  314. package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
  315. package/dist/face-character/bindFaceModel.d.ts +106 -0
  316. package/dist/face-character/canonicalFace.d.ts +17 -0
  317. package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
  318. package/dist/face-character/canonicalFacePositions.d.ts +7 -0
  319. package/dist/face-character/driveFaceModel.d.ts +57 -0
  320. package/dist/face-character/expressionOutputs.d.ts +45 -0
  321. package/dist/face-character/faceExpressions.d.ts +104 -0
  322. package/dist/face-character/faceImageLandmarker.d.ts +93 -0
  323. package/dist/face-character/faceMeshBinding.d.ts +62 -0
  324. package/dist/face-character/faceMorph.d.ts +77 -0
  325. package/dist/face-character/faceMorphs.d.ts +46 -0
  326. package/dist/face-character/facePhoto.d.ts +138 -0
  327. package/dist/face-character/facePiercings.d.ts +116 -0
  328. package/dist/face-character/facePin.d.ts +131 -0
  329. package/dist/face-character/faceReprojection.d.ts +273 -0
  330. package/dist/face-character/faceReprojector.d.ts +171 -0
  331. package/dist/face-character/faceRig.d.ts +176 -0
  332. package/dist/face-character/faceSwapPresence.d.ts +85 -0
  333. package/dist/face-character/faceTexture.d.ts +169 -0
  334. package/dist/face-character/faceTextureBaker.d.ts +86 -0
  335. package/dist/face-character/faceTextureGuide.d.ts +106 -0
  336. package/dist/face-character/faceTextureStats.d.ts +298 -0
  337. package/dist/face-character/faceTransfer.d.ts +396 -0
  338. package/dist/face-character/faceTransferGeometry.d.ts +109 -0
  339. package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
  340. package/dist/face-character/faceWarp3D.d.ts +101 -0
  341. package/dist/face-character/faceless.d.ts +79 -0
  342. package/dist/face-character/featureWarp.d.ts +28 -0
  343. package/dist/face-character/liveFaceRegistry.d.ts +370 -0
  344. package/dist/face-character/liveValue.d.ts +12 -0
  345. package/dist/face-character/memo.d.ts +15 -0
  346. package/dist/face-effects.cjs +2324 -1
  347. package/dist/face-effects.js +14208 -2268
  348. package/dist/face-expression/index.d.ts +182 -0
  349. package/dist/face-info/landmarks.d.ts +17 -3
  350. package/dist/face-info/types.d.ts +20 -3
  351. package/dist/gestures/definitions.d.ts +98 -0
  352. package/dist/gestures/detector.d.ts +87 -0
  353. package/dist/gestures/index.d.ts +8 -0
  354. package/dist/gestures/measures.d.ts +114 -0
  355. package/dist/gestures/settings.d.ts +49 -0
  356. package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
  357. package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
  358. package/dist/hand/armFit.d.ts +46 -0
  359. package/dist/hand/armMask.d.ts +178 -0
  360. package/dist/hand/handCutout.d.ts +23 -0
  361. package/dist/hand/handCutoutRegistry.d.ts +7 -0
  362. package/dist/hand/handGestures.d.ts +524 -0
  363. package/dist/hand/handPose.d.ts +98 -0
  364. package/dist/hand/handRigSolver.d.ts +159 -0
  365. package/dist/hand/handTattoo.d.ts +81 -0
  366. package/dist/hand/handTouch.d.ts +240 -0
  367. package/dist/hand/wrist.d.ts +44 -0
  368. package/dist/hand/wristFilter.d.ts +44 -0
  369. package/dist/hooks/selectors.d.ts +76 -1
  370. package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
  371. package/dist/hooks/useFaceInfo.d.ts +13 -1
  372. package/dist/hooks/useFaceInfos.d.ts +1 -1
  373. package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
  374. package/dist/hooks/useGesture.d.ts +32 -0
  375. package/dist/hooks/useIrisTracking.d.ts +45 -0
  376. package/dist/hooks/useTrackerContext.d.ts +6 -0
  377. package/dist/hooks/useXRDiagnostics.d.ts +81 -0
  378. package/dist/hooks/useXRModel.d.ts +7 -0
  379. package/dist/hooks/useXRSession/facade.d.ts +42 -2
  380. package/dist/hooks/useXRSession/index.d.ts +2 -2
  381. package/dist/hooks/useXRSession/reason.d.ts +3 -1
  382. package/dist/hooks/useXRSession/registry.d.ts +14 -0
  383. package/dist/hooks/useXRSession/store.d.ts +52 -3
  384. package/dist/index-B1_TzJaI.js +1104 -0
  385. package/dist/index-BavF06C6.js +190 -0
  386. package/dist/index-BfFmpddl.cjs +21 -0
  387. package/dist/index-BuBzneeW.cjs +46 -0
  388. package/dist/index-CGsQWodV.cjs +1 -0
  389. package/dist/index-CIe7eCMH.js +3200 -0
  390. package/dist/index-CfSF8LXa.cjs +1 -0
  391. package/dist/index-D5GTzOzD.cjs +1 -0
  392. package/dist/index-DBhQzvVa.js +314 -0
  393. package/dist/index-DE17y0ZI.cjs +1 -0
  394. package/dist/index-JII7huPk.js +442 -0
  395. package/dist/index-tpCr9CLj.cjs +1 -0
  396. package/dist/index-w1S7fI2B.js +1432 -0
  397. package/dist/index-zGaqrz_K.js +188 -0
  398. package/dist/instructions.cjs +30 -0
  399. package/dist/instructions.js +1507 -0
  400. package/dist/{internal-Dmk1cTXq.js → internal-B90P-clC.js} +138 -119
  401. package/dist/internal-Cjinca64.cjs +1 -0
  402. package/dist/internal.cjs +1 -1
  403. package/dist/internal.js +15 -10
  404. package/dist/iris/compute.d.ts +27 -0
  405. package/dist/iris/index.d.ts +4 -0
  406. package/dist/iris/lead.d.ts +19 -0
  407. package/dist/iris/types.d.ts +89 -0
  408. package/dist/landmarkMask-BFDyBnKM.js +224 -0
  409. package/dist/landmarkMask-u7es2k4X.cjs +1 -0
  410. package/dist/landmarks-BlUqf5MZ.cjs +1 -0
  411. package/dist/landmarks-bftdwq6Z.js +76 -0
  412. package/dist/loaders-BGAUACsd.js +363 -0
  413. package/dist/loaders-BJ1_QCHt.cjs +1 -0
  414. package/dist/low-level.cjs +1 -1
  415. package/dist/low-level.js +1190 -675
  416. package/dist/main.cjs +1 -1
  417. package/dist/main.js +1190 -452
  418. package/dist/models/Base/index.d.ts +49 -0
  419. package/dist/models/Body/index.d.ts +3 -1
  420. package/dist/models/Face/constants.d.ts +8 -0
  421. package/dist/models/Face/index.d.ts +4 -12
  422. package/dist/models/Face/rotation.d.ts +18 -3
  423. package/dist/models/Hand/GestureTracking.d.ts +1 -1
  424. package/dist/models/Hand/HandTracking.d.ts +17 -1
  425. package/dist/models/Holistic/index.d.ts +49 -0
  426. package/dist/models/Holistic/result.d.ts +68 -0
  427. package/dist/models/Segmentation/index.d.ts +2 -0
  428. package/dist/models/SemanticSegmentation/index.d.ts +31 -0
  429. package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
  430. package/dist/models/index.d.ts +2 -0
  431. package/dist/models/nodeSource.d.ts +9 -0
  432. package/dist/particles/emission.d.ts +24 -0
  433. package/dist/particles/eyes.d.ts +24 -0
  434. package/dist/particles/glsl.d.ts +14 -0
  435. package/dist/particles/index.d.ts +10 -0
  436. package/dist/particles/motion.d.ts +42 -0
  437. package/dist/particles/presets.d.ts +12 -0
  438. package/dist/particles/ring.d.ts +58 -0
  439. package/dist/particles/selfTest.d.ts +53 -0
  440. package/dist/particles/settings.d.ts +127 -0
  441. package/dist/particles/shapes.d.ts +29 -0
  442. package/dist/particles/spawner.d.ts +60 -0
  443. package/dist/particles/system.d.ts +64 -0
  444. package/dist/particles.cjs +122 -0
  445. package/dist/particles.js +774 -0
  446. package/dist/product/ProductDimensions.d.ts +16 -0
  447. package/dist/product/ProductHotspot.d.ts +16 -0
  448. package/dist/product/ProductViewer.d.ts +9 -0
  449. package/dist/product/details.d.ts +53 -0
  450. package/dist/product/index.d.ts +14 -0
  451. package/dist/product/loadModelViewer.d.ts +4 -0
  452. package/dist/product/types.d.ts +71 -0
  453. package/dist/product/useProductAr.d.ts +37 -0
  454. package/dist/product/useProductDetails.d.ts +60 -0
  455. package/dist/product.cjs +1 -0
  456. package/dist/product.js +414 -0
  457. package/dist/providers-C8rE26Uf.js +366 -0
  458. package/dist/providers-DHsrhDI2.cjs +62 -0
  459. package/dist/quality/XRQualityController.d.ts +25 -0
  460. package/dist/quality/controller.d.ts +33 -0
  461. package/dist/quality/index.d.ts +6 -0
  462. package/dist/quality/types.d.ts +100 -0
  463. package/dist/quality/useXRQuality.d.ts +28 -0
  464. package/dist/render/renderPasses.d.ts +8 -0
  465. package/dist/render/sceneBeforeRender.d.ts +12 -0
  466. package/dist/{renderGroups-KZk6eRiY.js → renderGroups-B38pUaX2.js} +1 -1
  467. package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
  468. package/dist/renderPasses-B6l8IpJv.js +1290 -0
  469. package/dist/renderPasses-dqmkft4P.cjs +158 -0
  470. package/dist/renderState-CJNmj5jz.js +39 -0
  471. package/dist/renderState-apSfg4eR.cjs +1 -0
  472. package/dist/scene-object.cjs +1 -1
  473. package/dist/scene-object.js +2 -2
  474. package/dist/segmentation-Cb3ouK6Z.js +1758 -0
  475. package/dist/segmentation-D9pYO6aR.cjs +1 -0
  476. package/dist/segmentation2d/faceMemory.d.ts +28 -0
  477. package/dist/segmentation2d/faceRegions.d.ts +24 -0
  478. package/dist/segmentation2d/index.d.ts +9 -0
  479. package/dist/segmentation2d/maskUv.d.ts +23 -0
  480. package/dist/segmentation2d/rasterize.d.ts +14 -0
  481. package/dist/segmentation2d/types.d.ts +52 -0
  482. package/dist/select-Ck5LGz-J.cjs +1 -0
  483. package/dist/select-pYRo_win.js +233 -0
  484. package/dist/selectors-C4X71aoD.cjs +1 -0
  485. package/dist/selectors-DmNaKIwE.js +196 -0
  486. package/dist/session-BrH8G7iJ.cjs +31 -0
  487. package/dist/session-DgA_z6O1.js +418 -0
  488. package/dist/settings-BJ7FMBsO.js +111 -0
  489. package/dist/settings-C63FMBlF.cjs +1 -0
  490. package/dist/similarityFit-BFqHND2e.cjs +1 -0
  491. package/dist/similarityFit-Bbz-R8AY.js +91 -0
  492. package/dist/spring/index.d.ts +2 -0
  493. package/dist/spring/spring.d.ts +69 -0
  494. package/dist/spring/swing.d.ts +54 -0
  495. package/dist/subjects/index.d.ts +2 -0
  496. package/dist/subjects/select.d.ts +62 -0
  497. package/dist/subjects/types.d.ts +55 -0
  498. package/dist/tracking-config/apply.d.ts +57 -0
  499. package/dist/tracking-config/index.d.ts +7 -0
  500. package/dist/tracking-config/resolve.d.ts +25 -0
  501. package/dist/tracking-config/storage.d.ts +8 -0
  502. package/dist/tracking-config/types.d.ts +106 -0
  503. package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
  504. package/dist/tracking.cjs +10 -1
  505. package/dist/tracking.js +1326 -506
  506. package/dist/trigger-D0Pm9noT.cjs +49 -0
  507. package/dist/trigger-IQeys0oS.js +2128 -0
  508. package/dist/types/compositor.d.ts +21 -0
  509. package/dist/types/face.d.ts +20 -1
  510. package/dist/types/hand-tracking.d.ts +9 -0
  511. package/dist/types/holistic.d.ts +121 -0
  512. package/dist/types/index.d.ts +1 -0
  513. package/dist/types/model.d.ts +22 -2
  514. package/dist/types/nodes.d.ts +47 -3
  515. package/dist/types/segmentation.d.ts +24 -0
  516. package/dist/types/session.d.ts +41 -3
  517. package/dist/updateThrottle-BseecYag.js +4 -0
  518. package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
  519. package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
  520. package/dist/useFaceInfo-J4x7LsqL.js +76 -0
  521. package/dist/useFaceResultReader-BvEo5REG.js +61 -0
  522. package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
  523. package/dist/useInstructionHold-DOu-RpCM.js +53 -0
  524. package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
  525. package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
  526. package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
  527. package/dist/useXRCapabilities-Cr3RzuAW.cjs +1 -0
  528. package/dist/useXRCapabilities-Cxmlmpbd.js +30 -0
  529. package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
  530. package/dist/utils/fns.d.ts +6 -3
  531. package/dist/utils/headOccluderFit.d.ts +42 -0
  532. package/dist/utils/integrity.d.ts +21 -1
  533. package/dist/utils/resolveNumFaces.d.ts +13 -0
  534. package/dist/utils/shoulderOccluderFit.d.ts +38 -0
  535. package/dist/utils/similarityFit.d.ts +23 -0
  536. package/dist/utils/updateThrottle.d.ts +2 -0
  537. package/dist/utils/useStableUniforms.d.ts +18 -0
  538. package/dist/uv-BMFt19bg.cjs +1 -0
  539. package/dist/{index-ByoNj0QP.js → uv-DJU_XfmN.js} +15 -247
  540. package/docs/SDK_DOCUMENTATION.md +1 -2
  541. package/docs/api/adaptive-quality.mdx +104 -0
  542. package/docs/api/asset-lifecycle.mdx +78 -0
  543. package/docs/api/body-instructions.mdx +285 -0
  544. package/docs/api/body-triggers.mdx +234 -0
  545. package/docs/api/camera-permission.mdx +142 -0
  546. package/docs/api/coordinate-spaces.mdx +168 -0
  547. package/docs/api/cross-camera.mdx +89 -0
  548. package/docs/api/debug-ui-scene-editor.mdx +23 -2
  549. package/docs/api/diagnostics-calibration.mdx +97 -0
  550. package/docs/api/external-face-mesh.mdx +231 -0
  551. package/docs/api/face-actions.mdx +20 -16
  552. package/docs/api/face-attribute-expression.mdx +1 -1
  553. package/docs/api/face-binding-anchors.mdx +4 -2
  554. package/docs/api/face-character.mdx +157 -0
  555. package/docs/api/face-effects.mdx +9 -0
  556. package/docs/api/face-expression-controller.mdx +153 -0
  557. package/docs/api/face-info.mdx +17 -11
  558. package/docs/api/face-inset.mdx +204 -0
  559. package/docs/api/face-instructions.mdx +183 -0
  560. package/docs/api/face-liquify.mdx +196 -0
  561. package/docs/api/face-mesh.mdx +8 -9
  562. package/docs/api/face-morph.mdx +117 -0
  563. package/docs/api/face-painting.mdx +7 -0
  564. package/docs/api/face-reprojection.mdx +154 -0
  565. package/docs/api/face-retouching.mdx +18 -10
  566. package/docs/api/face-swap.mdx +350 -0
  567. package/docs/api/face-warp-3d.mdx +166 -0
  568. package/docs/api/faceless.mdx +143 -0
  569. package/docs/api/gestures.mdx +209 -0
  570. package/docs/api/hair.mdx +97 -0
  571. package/docs/api/hand-instructions.mdx +222 -0
  572. package/docs/api/hand-rig.mdx +535 -0
  573. package/docs/api/hand-touch.mdx +162 -0
  574. package/docs/api/head-occluder.mdx +563 -0
  575. package/docs/api/holistic-tracker.mdx +164 -0
  576. package/docs/api/instructions.mdx +323 -0
  577. package/docs/api/iris-tracking.mdx +247 -0
  578. package/docs/api/made-up-camera.mdx +131 -0
  579. package/docs/api/makeup-skin-tone.mdx +135 -0
  580. package/docs/api/makeup.mdx +353 -0
  581. package/docs/api/multi-subject.mdx +98 -0
  582. package/docs/api/particles.mdx +155 -0
  583. package/docs/api/person-cutout.mdx +136 -0
  584. package/docs/api/pin-to-face-mesh.mdx +274 -0
  585. package/docs/api/product-ar.mdx +114 -0
  586. package/docs/api/product-details.mdx +78 -0
  587. package/docs/api/screen-space-coordinates.mdx +4 -1
  588. package/docs/api/segmentation-overlay.mdx +301 -0
  589. package/docs/api/session-lifecycle.mdx +136 -0
  590. package/docs/api/trackers.mdx +5 -0
  591. package/docs/api/tracking-config.mdx +108 -0
  592. package/docs/docs.json +51 -1
  593. package/docs/examples/lip-shaders.mdx +273 -0
  594. package/docs/guides/face-atlas-template.svg +1 -0
  595. package/docs/guides/face-atlas-textures.mdx +186 -0
  596. package/docs/guides/face-texture-template.svg +1 -0
  597. package/docs/guides/harness-debug-ui.mdx +4 -4
  598. package/docs/guides/lip-effect-textures.mdx +368 -0
  599. package/docs/guides/lip-uv-template.png +0 -0
  600. package/docs/guides/lip-uv-template.svg +1 -0
  601. package/docs/guides/makeup-design-textures.mdx +109 -0
  602. package/docs/introduction.mdx +1 -2
  603. package/package.json +23 -1
  604. package/dist/DebuggerUI-B6bP6P9r.cjs +0 -1
  605. package/dist/DebuggerUI-BjOMr8q_.js +0 -269
  606. package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
  607. package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
  608. package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
  609. package/dist/FaceRetouch-DwbKQJAN.js +0 -551
  610. package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
  611. package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
  612. package/dist/components/FaceWarp3D/warp.d.ts +0 -13
  613. package/dist/contexts-ByhzppYl.js +0 -663
  614. package/dist/contexts-Dr62It_K.cjs +0 -1
  615. package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
  616. package/dist/getFaceInfo-C4QpCQIY.js +0 -118
  617. package/dist/getFaceInfo-fA1bFBub.cjs +0 -1
  618. package/dist/index-9dlAQAhy.js +0 -1462
  619. package/dist/index-BjmTe9eM.cjs +0 -1
  620. package/dist/index-BpEf2BBb.cjs +0 -1
  621. package/dist/index-CyUUurQT.cjs +0 -1
  622. package/dist/index-DCiMbxC3.cjs +0 -1
  623. package/dist/index-DXT3WccE.js +0 -2089
  624. package/dist/index-DpI-qo5X.cjs +0 -17
  625. package/dist/index-DyVF4vEW.js +0 -111
  626. package/dist/index-VJ0SJwmG.js +0 -214
  627. package/dist/internal-Cq-TEQ5Y.cjs +0 -1
  628. package/dist/renderLayers-lDtL0_43.cjs +0 -1
  629. package/dist/renderLayers-zrK2pv5O.js +0 -13
  630. package/dist/renderPasses-BOoBSr8z.cjs +0 -21
  631. package/dist/renderPasses-BcquyVtu.js +0 -1500
  632. package/dist/selectors-B8H97CKA.js +0 -59
  633. package/dist/selectors-CZLKT2Iv.cjs +0 -1
  634. package/dist/session-CpkiK5YA.cjs +0 -31
  635. package/dist/session-DLFN_VII.js +0 -363
  636. package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
  637. package/dist/useFaceInfo-Dk426LTu.js +0 -62
  638. package/dist/useFaceResults-CtetsO9M.js +0 -19
  639. package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
package/dist/debug-ui.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const De=require("./session-CpkiK5YA.cjs"),On=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),u=require("react"),We=require("./renderGroups-80H3DpTl.cjs"),$=require("./renderPasses-BOoBSr8z.cjs"),pe=require("react-dom"),$n=require("three"),X=require("./FaceMeshRenderer-C5l6VLdO.cjs"),Z=require("./FaceRetouch-BkJzoA79.cjs"),An=require("./index-BjmTe9eM.cjs"),Dn=require("./index-BpEf2BBb.cjs"),At=require("@react-three/drei"),Bn=require("@react-three/fiber"),Dt=require("./index-DpI-qo5X.cjs"),Pn=require("./contexts-Dr62It_K.cjs"),Vn=require("./selectors-CZLKT2Iv.cjs"),Hn={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Kn={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},_n=306,Gn=()=>({x:typeof window>"u"?14:window.innerWidth-(_n+20),y:30}),Un={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Xn={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},Zn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},Yn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},qn={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},Jn={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Qn={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},es={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},ts={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},ns=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),ss={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},ls={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},is=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),os=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),rs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),as=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),ds=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),cs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),ps=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)},ut=({children:t,copyConfig:n,initialPosition:l,layer:s="Default Layer",objectId:a,objectName:d,onObjectNameChange:o,onPositionChange:r,onVisibleChange:y,position:p,title:x,visible:c})=>{const[g,h]=u.useState(l??Gn),i=p??g,[b,j]=u.useState(!1),[k,C]=u.useState(!0),L=d??x??a??"Scene Object",[S,w]=u.useState(!1),[O,T]=u.useState(L),B=u.useRef(null);u.useEffect(()=>{S||T(L)},[L,S]),u.useEffect(()=>{const M=ye=>{if(!B.current)return;const N={x:Math.max(8,ye.clientX-B.current.x),y:Math.max(8,ye.clientY-B.current.y)};h(N),r==null||r(N)},I=()=>{B.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",M),window.addEventListener("pointerup",I),()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",I)}},[r]);const _=M=>{const I=M.currentTarget.getBoundingClientRect();B.current={x:M.clientX-I.left,y:M.clientY-I.top},document.body.classList.add("select-none"),M.currentTarget.setPointerCapture(M.pointerId)},he=async()=>{try{await ps(JSON.stringify(n,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},te=()=>{const M=O.trim();if(w(!1),!o||!M||M===L){T(L);return}o(M)},xe=()=>{T(L),w(!1)};return typeof document>"u"?null:pe.createPortal(e.jsx("div",{style:{...Hn,left:i.x,top:i.y},children:e.jsxs("div",{style:Kn,children:[e.jsxs("div",{style:Un,children:[e.jsxs("div",{style:Xn,children:[e.jsx("div",{onPointerDown:_,style:Jn,children:e.jsx(is,{})}),e.jsx("span",{style:qn,children:e.jsx(os,{})}),S?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:Yn,value:O,onBlur:te,onChange:M=>T(M.currentTarget.value),onKeyDown:M=>{M.key==="Enter"&&te(),M.key==="Escape"&&xe()}}):e.jsx("button",{type:"button",style:{...Zn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&w(!0)},children:L}),e.jsx("button",{type:"button","aria-label":k?"Fold Inspector":"Expand Inspector",title:k?"Fold Inspector":"Expand Inspector",style:ss,onClick:()=>C(M=>!M),children:k?e.jsx(ds,{}):e.jsx(cs,{})})]}),k?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:ls,children:s}),e.jsxs("div",{style:es,children:[e.jsx("button",{type:"button",style:ts,onClick:he,children:b?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:ns(c),onClick:()=>y(!c),children:c?e.jsx(rs,{}):e.jsx(as,{})})]})]}):null]}),k?e.jsx("div",{style:Qn,children:t}):null]})}),document.body)},hs={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},xs=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],ys=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],us={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},gs=()=>({color:"#000000",opacity:1,width:30}),zt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),hn=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),xn=()=>({preset:"arc",strength:100}),bs=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],fs=(t,n)=>{const l=hs[n],s=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:n,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:s,shadowLayers:a}}},yn=(t,n)=>({enabled:(n==null?void 0:n.enabled)??t.enabled,showGuides:(n==null?void 0:n.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(n==null?void 0:n.position)??t.position,size:(n==null?void 0:n.size)??t.size,rotation:(n==null?void 0:n.rotation)??t.rotation,scale2D:n==null?void 0:n.scale2D,referencePixelsPerUnit:n==null?void 0:n.referencePixelsPerUnit,pivot:(n==null?void 0:n.pivot)??t.pivot,renderOrder:(n==null?void 0:n.renderOrder)??t.renderOrder,overlay:(n==null?void 0:n.overlay)??t.overlay,visible:(n==null?void 0:n.visible)??t.visible}),js=(t,n)=>({...n,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),un=(t,n)=>({...$.DEFAULT_SCREEN_TRANSFORM_2D,...n,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(n==null?void 0:n.scale2D)??$.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(n==null?void 0:n.referencePixelsPerUnit)??$.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ms={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Ss={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},ws={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ks={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},vs={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Cs=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Rs={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},R={display:"flex",flexDirection:"column",gap:4},q={...R,gridColumn:"1 / -1"},Es={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},Is={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},zs={display:"flex",alignItems:"center",gap:6,minWidth:0},Ts={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},m={fontSize:9,color:"rgba(226,232,240,0.72)"},Wt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ms={...Wt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Wt,padding:2,cursor:"pointer"},de={...Wt,appearance:"none"},Ws={opacity:.45,cursor:"not-allowed"},ce={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},it={width:16,height:16},Fs={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},He=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),yt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Ls({label:t,icon:n,open:l,onToggle:s,children:a}){return e.jsxs("div",{style:Ss,children:[e.jsxs("div",{style:ws,children:[e.jsx("button",{type:"button",onClick:s,style:vs,children:e.jsx("div",{style:Cs(l)})}),e.jsxs("div",{style:ks,children:[e.jsx("span",{style:ms,children:n}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Rs,children:a}):null]})}const Bt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),Pt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Ns=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Os=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function $s({value:t,onChange:n}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Text"}),e.jsx("textarea",{style:Ms,value:t.content.text,onChange:l=>n(s=>({...s,content:{...s.content,text:l.target.value}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Text Art"}),e.jsx("select",{style:de,value:t.textArtPreset,onChange:l=>n(s=>fs(s,l.target.value)),children:ys.map(l=>e.jsx("option",{value:l,children:us[l]},l))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Font"}),e.jsx("select",{style:de,value:t.style.fontFamily,onChange:l=>n(s=>({...s,style:{...s.style,fontFamily:l.target.value}})),children:xs.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const As={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},Ds=t=>/^-?\d*(\.\d*)?$/.test(t),F=({value:t,onChange:n,step:l=1,min:s,max:a,disabled:d=!1})=>{const[o,r]=u.useState(String(t));u.useEffect(()=>r(String(t)),[t]);const y=p=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof s=="number"?s:-1/0,p));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...As,...d?{cursor:"not-allowed",opacity:.45}:{}},value:o,disabled:d,onChange:p=>{if(d)return;const x=p.target.value;if(!Ds(x)||(r(x),["","-",".","-."].includes(x)))return;const c=Number(x);Number.isNaN(c)||n(y(c))},onBlur:()=>{if(d)return;const p=Number(o);if(Number.isNaN(p))return r(String(t));const x=y(p);r(String(x)),n(x)},onKeyDown:p=>{if(d||p.key!=="ArrowUp"&&p.key!=="ArrowDown")return;p.preventDefault();const x=p.shiftKey?l*10:p.altKey?l/10:l,c=p.key==="ArrowUp"?t+x:t-x;n(y(Number.isInteger(c)?c:Number(c.toFixed(6))))}})};function Bs({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Fill Mode"}),e.jsxs("select",{style:de,value:t.fillMode,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Fill Area"}),e.jsxs("select",{style:de,value:t.fit,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,s)=>e.jsxs("label",{style:R,children:[e.jsxs("span",{style:m,children:["Gradient ",s+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>n(d=>{const o=[...d.style.background.gradientStops];return o[s]={...o[s],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:o}}}})}),e.jsx(F,{value:l.position,min:0,max:1,step:.05,onChange:a=>n(d=>{const o=[...d.style.background.gradientStops];return o[s]={...o[s],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:o}}}})})]})]},s))}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Background Opacity"}),e.jsx(F,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Corner Radius"}),e.jsx(F,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderRadius:l}}}))})]})]})}function Ps({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:it,checked:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Width"}),e.jsx(F,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,width:l}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Height"}),e.jsx(F,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,height:l}}}))})]})]})}function Vs({background:t,onChange:n}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:it,checked:t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&s.style.background.borderColor==="transparent"?"#ffffff":s.style.background.borderColor,borderWidth:l.target.checked?Math.max(s.style.background.borderWidth,2):s.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Ws},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Stroke Width"}),e.jsx(F,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>n(s=>({...s,style:{...s.style,background:{...s.style.background,borderWidth:l}}}))})]})]})}const gn={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function ot({checked:t,label:n,onChange:l}){return e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:n}),e.jsx("input",{type:"checkbox",style:it,checked:t,onChange:s=>l(s.target.checked)})]})})}function Be({children:t,label:n,open:l,setOpen:s}){return e.jsxs("div",{style:Es,children:[e.jsxs("button",{type:"button",style:Is,onClick:()=>s(a=>!a),children:[e.jsxs("span",{style:zs,children:[e.jsx(Os,{}),e.jsx("span",{children:n})]}),e.jsx("span",{style:Ts,children:l?"−":"+"})]}),l?t:null]})}function Hs({value:t,onChange:n,open:l,setOpen:s}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:it,checked:a.enabled,onChange:d=>n(o=>({...o,style:{...o.style,background:{...o.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Be,{label:"Background Settings",open:l,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsx(Bs,{background:a,onChange:n}),e.jsx(Vs,{background:a,onChange:n}),e.jsx(Ps,{background:a,onChange:n})]})}):null]})}function Ks({bend:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,bend:{...r.style.bend??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,bendEnabled:o,bend:r.style.bend??xn()}}))}),a.style.bendEnabled===!0?e.jsx(Be,{label:"Bend",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Bend Preset"}),e.jsx("select",{style:de,value:t.preset,onChange:o=>d({preset:o.target.value}),children:bs.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Bend Strength"}),e.jsx(F,{value:t.strength,min:-100,max:100,step:1,onChange:o=>d({strength:o})})]})]})}):null]})}function _s({glow:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,glow:{...r.style.glow??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,glowEnabled:o,glow:r.style.glow??hn()}}))}),a.style.glowEnabled===!0?e.jsx(Be,{label:"Glow",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:o=>d({color:o.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Style"}),e.jsxs("select",{style:de,value:t.style,onChange:o=>d({style:o.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Intensity"}),e.jsx(F,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:o=>d({intensity:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Range"}),e.jsx(F,{value:t.range??.5,min:0,max:1,step:.05,onChange:o=>d({range:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Horizontal Angle"}),e.jsx(F,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:o=>d({horizontalAngle:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Vertical Angle"}),e.jsx(F,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:o=>d({verticalAngle:o})})]})]})}):null]})}const Gs={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function Us({innerShadow:t,open:n,onChange:l,setOpen:s,value:a}){const d=o=>l(r=>({...r,style:{...r.style,innerShadow:{...r.style.innerShadow??t,...o}}}));return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:o=>l(r=>({...r,style:{...r.style,innerShadowEnabled:o,innerShadow:r.style.innerShadow??Gs}}))}),a.style.innerShadowEnabled===!0?e.jsx(Be,{label:"Inner Shadow",open:n,setOpen:s,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:o=>d({color:o.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Opacity"}),e.jsx(F,{value:t.opacity??1,min:0,max:1,step:.05,onChange:o=>d({opacity:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Offset"}),e.jsx(F,{value:t.offset??10,min:0,max:100,step:1,onChange:o=>d({offset:o})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Angle"}),e.jsx(F,{value:t.angle??-45,min:-180,max:180,step:1,onChange:o=>d({angle:o})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Shadow Feather"}),e.jsx(F,{value:t.feather??0,min:0,max:1,step:.05,onChange:o=>d({feather:o})})]})]})}):null]})}function Xs({layers:t,open:n,onChange:l,setOpen:s,value:a}){const d=(o,r)=>l(y=>{const p=[...y.style.strokeLayers??[]];return p[o]={...p[o],...r},{...y,style:{...y.style,strokeLayers:p}}});return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:o=>l(r=>({...r,style:{...r.style,outlineEnabled:o}}))}),a.style.outlineEnabled!==!1?e.jsx(Be,{label:"Outline Editor",open:n,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ce,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:m,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(o=>({...o,style:{...o.style,strokeLayers:[...o.style.strokeLayers??[],gs()]}})),children:"+"})]}),t.length>0?t.map((o,r)=>e.jsxs("div",{style:gn,children:[e.jsxs("div",{style:ce,children:[e.jsxs("span",{style:m,children:["Outline ",r+1]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(y=>({...y,style:{...y.style,strokeLayers:(y.style.strokeLayers??[]).filter((p,x)=>x!==r)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:o.color,onChange:y=>d(r,{color:y.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Outline Opacity"}),e.jsx(F,{value:o.opacity??1,min:0,max:1,step:.05,onChange:y=>d(r,{opacity:y})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Outline Size"}),e.jsx(F,{value:o.width,min:0,max:100,step:1,onChange:y=>d(r,{width:y})})]})]})]},r)):e.jsx("div",{style:{...m,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function Zs({layers:t,open:n,onChange:l,setOpen:s,value:a}){const d=(o,r)=>l(y=>{const p=[...y.style.shadowLayers??[]];return p[o]={...p[o],...r},{...y,style:{...y.style,shadowLayers:p}}});return e.jsxs(e.Fragment,{children:[e.jsx(ot,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:o=>l(r=>{var y;return{...r,style:{...r.style,shadowEnabled:o,shadowLayers:o&&(((y=r.style.shadowLayers)==null?void 0:y.length)??0)===0?[zt()]:r.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Be,{label:"Shadow Editor",open:n,setOpen:s,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ce,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:m,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(o=>({...o,style:{...o.style,shadowLayers:[...o.style.shadowLayers??[],zt()]}})),children:"+"})]}),t.length>0?t.map((o,r)=>e.jsxs("div",{style:gn,children:[e.jsxs("div",{style:ce,children:[e.jsxs("span",{style:m,children:["Shadow ",r+1]}),e.jsx("button",{type:"button",style:yt,onClick:()=>l(y=>({...y,style:{...y.style,shadowLayers:(y.style.shadowLayers??[]).filter((p,x)=>x!==r)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:o.color,onChange:y=>d(r,{color:y.target.value})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Opacity"}),e.jsx(F,{value:o.opacity??1,min:0,max:1,step:.05,onChange:y=>d(r,{opacity:y})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Offset"}),e.jsx(F,{value:o.offset??10,min:0,max:100,step:1,onChange:y=>d(r,{offset:y})})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Shadow Angle"}),e.jsx(F,{value:o.angle??-45,min:-180,max:180,step:1,onChange:y=>d(r,{angle:y})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:m,children:"Shadow Feather"}),e.jsx(F,{value:o.feather??0,min:0,max:1,step:.05,onChange:y=>d(r,{feather:y})})]})]})]},r)):e.jsx("div",{style:{...m,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function Ys({backgroundSettingsOpen:t,bend:n,bendSettingsOpen:l,glow:s,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:o,onChange:r,outlineLayers:y,outlineSettingsOpen:p,setBackgroundSettingsOpen:x,setBendSettingsOpen:c,setGlowSettingsOpen:g,setInnerShadowSettingsOpen:h,setOutlineSettingsOpen:i,setShadowSettingsOpen:b,shadowLayers:j,shadowSettingsOpen:k,value:C}){return e.jsxs("div",{style:me,children:[e.jsx(Xs,{value:C,onChange:r,layers:y,open:p,setOpen:i}),e.jsx(Zs,{value:C,onChange:r,layers:j,open:k,setOpen:b}),e.jsx(Us,{value:C,onChange:r,innerShadow:d,open:a,setOpen:g}),e.jsx(_s,{value:C,onChange:r,glow:s,open:o,setOpen:h}),e.jsx(Ks,{value:C,onChange:r,bend:n,open:l,setOpen:c}),e.jsx(Hs,{value:C,onChange:r,open:t,setOpen:x})]})}function qs({value:t,onChange:n}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:s=>n(a=>({...a,style:{...a.style,color:s.target.value}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Font Size"}),e.jsx(F,{value:t.style.fontSize,min:16,max:180,step:4,onChange:s=>n(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??s,s)},style:{...a.style,fontSize:s}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Letter Spacing"}),e.jsx(F,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:s=>n(a=>({...a,style:{...a.style,letterSpacing:s}}))})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Line Spacing"}),e.jsx(F,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:s=>n(a=>({...a,style:{...a.style,lineSpacing:s}}))})]}),e.jsxs("div",{style:q,children:[e.jsx("span",{style:m,children:"Text Style"}),e.jsxs("div",{style:Fs,children:[e.jsx("button",{type:"button",style:He(!l),onClick:()=>n(s=>({...s,style:{...s.style,bold:!1,fontWeight:s.style.fontWeight==="bold"?"normal":s.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:He(t.style.bold===!0),onClick:()=>n(s=>({...s,style:{...s.style,bold:s.style.bold!==!0,fontWeight:s.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:He(t.style.fontStyle==="italic"),onClick:()=>n(s=>({...s,style:{...s.style,fontStyle:s.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:He(t.style.underline===!0),onClick:()=>n(s=>({...s,style:{...s.style,underline:s.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:He(t.style.strikethrough===!0),onClick:()=>n(s=>({...s,style:{...s.style,strikethrough:s.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Horizontal Alignment"}),e.jsxs("select",{style:de,value:t.layout.textAlign??"center",onChange:s=>n(a=>({...a,layout:{...a.layout,textAlign:s.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Vertical Alignment"}),e.jsxs("select",{style:de,value:t.layout.verticalAlign??"center",onChange:s=>n(a=>({...a,layout:{...a.layout,verticalAlign:s.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:R,children:[e.jsx("span",{style:m,children:"Overflow"}),e.jsxs("select",{style:de,value:t.layout.overflow,onChange:s=>n(a=>({...a,layout:{...a.layout,overflow:s.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:q,children:e.jsxs("div",{style:ce,children:[e.jsx("span",{style:m,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:it,checked:t.layout.resizeToFit===!0,onChange:s=>n(a=>({...a,layout:{...a.layout,resizeToFit:s.target.checked}}))})]})})]})}const Js={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},le={display:"flex",flexDirection:"column",gap:4},bt={...le,gridColumn:"1 / -1"},G={fontSize:9,color:"rgba(226,232,240,0.72)"},Qs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},el={...Qs,fontVariantNumeric:"tabular-nums"},tl={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},nl={width:16,height:16},sl=t=>/^-?\d*(\.\d*)?$/.test(t),Q=({value:t,onChange:n,step:l=1,min:s,max:a,disabled:d=!1})=>{const[o,r]=u.useState(String(t));u.useEffect(()=>r(String(t)),[t]);const y=p=>{let x=p;return typeof s=="number"&&(x=Math.max(s,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:el,value:o,disabled:d,onChange:p=>{const x=p.target.value;if(!sl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||n(y(c))},onBlur:()=>{const p=Number(o);if(Number.isNaN(p)){r(String(t));return}const x=y(p);r(String(x)),n(x)},onKeyDown:p=>{if(p.key!=="ArrowUp"&&p.key!=="ArrowDown")return;p.preventDefault();const x=p.shiftKey?l*10:p.altKey?l/10:l,c=p.key==="ArrowUp"?t+x:t-x;n(y(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},Ft=({value:t,onChange:n,guideLabel:l,showRenderOrder:s=!0})=>{var a,d;return e.jsxs("div",{style:Js,children:[e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Position X"}),e.jsx(Q,{value:t.position.x,min:-4096,max:4096,step:1,onChange:o=>n({...t,position:{...t.position,x:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Position Y"}),e.jsx(Q,{value:t.position.y,min:-4096,max:4096,step:1,onChange:o=>n({...t,position:{...t.position,y:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Size X"}),e.jsx(Q,{value:t.size.width,min:0,max:8192,step:1,onChange:o=>n({...t,size:{...t.size,width:o}})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Size Y"}),e.jsx(Q,{value:t.size.height,min:0,max:8192,step:1,onChange:o=>n({...t,size:{...t.size,height:o}})})]}),e.jsxs("label",{style:bt,children:[e.jsx("span",{style:G,children:"Rotation"}),e.jsx(Q,{value:t.rotation,min:-360,max:360,step:1,onChange:o=>n({...t,rotation:o})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Scale 2D X"}),e.jsx(Q,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:o=>{var r;return n({...t,scale2D:{x:o,y:((r=t.scale2D)==null?void 0:r.y)??1}})}})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Scale 2D Y"}),e.jsx(Q,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:o=>{var r;return n({...t,scale2D:{x:((r=t.scale2D)==null?void 0:r.x)??1,y:o}})}})]}),e.jsxs("label",{style:bt,children:[e.jsx("span",{style:G,children:"Reference Pixels Per Unit"}),e.jsx(Q,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:o=>n({...t,referencePixelsPerUnit:o})})]}),s?e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Render Order"}),e.jsx(Q,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:o=>n({...t,renderOrder:o})})]}):null,e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Pivot X"}),e.jsx(Q,{value:t.pivot[0],min:0,max:1,step:.01,onChange:o=>n({...t,pivot:[o,t.pivot[1]]})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:G,children:"Pivot Y"}),e.jsx(Q,{value:t.pivot[1],min:0,max:1,step:.01,onChange:o=>n({...t,pivot:[t.pivot[0],o]})})]}),e.jsx("label",{style:bt,children:e.jsxs("div",{style:tl,children:[e.jsx("span",{style:G,children:l}),e.jsx("input",{type:"checkbox",style:nl,checked:t.showGuides,onChange:o=>n({...t,showGuides:o.target.checked})})]})})]})};function ll({value:t,onChange:n}){return e.jsx(Ft,{value:yn(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>n(s=>({...s,transformation:js(l,s.transformation),screenTransform:un(l,s.screenTransform)}))})}const il=({value:t,onChange:n,copyLabel:l,inspector:s})=>{var ye;const[a,d]=u.useState(()=>$.createSceneObject({name:l??"Screen Text",renderGroupId:We.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=u.useState(()=>{const N=a.id,f=$.createDefaultComponent("ScreenTransform",N),v=$.createDefaultComponent("ScreenText",N),A=$.createDefaultComponent("Material",N),z=$.createDefaultComponent("Texture",N);return{screenTransform:f,screenText:v,material:A,texture:z}}),[r,y]=u.useState(!0),[p,x]=u.useState(!0),[c,g]=u.useState(!0),[h,i]=u.useState(!0),[b,j]=u.useState(!0),[k,C]=u.useState(!0),[L,S]=u.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),w=yn(t.screenText.transformation,t.screenText.screenTransform),O={object:{...a,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??un(w)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},T=N=>{n({...t,screenText:N(t.screenText)})},B=t.screenText.style.strokeLayers??[],_=t.screenText.style.shadowEnabled!==!1&&(((ye=t.screenText.style.shadowLayers)==null?void 0:ye.length)??0)===0?[zt()]:t.screenText.style.shadowLayers??[],he=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},te=t.screenText.style.glow??hn(),xe=t.screenText.style.bend??xn(),M=N=>S(f=>({...f,[N]:!f[N]})),I=(N,f,v,A)=>e.jsx(Ls,{label:f,icon:v,open:L[N],onToggle:()=>M(N),children:A},N);return e.jsxs(ut,{objectId:(s==null?void 0:s.objectId)??a.id,objectName:(s==null?void 0:s.objectName)??a.name,onObjectNameChange:(s==null?void 0:s.onObjectNameChange)??(N=>d(f=>({...f,name:N}))),layer:(s==null?void 0:s.layer)??"Default Layer",visible:(s==null?void 0:s.visible)??t.screenText.enabled,onVisibleChange:(s==null?void 0:s.onVisibleChange)??(N=>T(f=>({...f,enabled:N}))),copyConfig:(s==null?void 0:s.copyConfig)??O,initialPosition:s==null?void 0:s.initialPosition,position:s==null?void 0:s.position,onPositionChange:s==null?void 0:s.onPositionChange,title:s==null?void 0:s.title,children:[I("transformation","Transformation",e.jsx(Ns,{}),e.jsx(ll,{value:t.screenText,onChange:T})),I("text2d","2D Text",e.jsx(Bt,{}),e.jsxs(e.Fragment,{children:[I("content","Content",e.jsx(Bt,{}),e.jsx($s,{value:t.screenText,onChange:T})),I("style","Style",e.jsx(Pt,{}),e.jsx(qs,{value:t.screenText,onChange:T})),I("textEffect","Text Effect",e.jsx(Pt,{}),e.jsx(Ys,{value:t.screenText,onChange:T,outlineLayers:B,shadowLayers:_,innerShadow:he,glow:te,bend:xe,outlineSettingsOpen:r,setOutlineSettingsOpen:y,shadowSettingsOpen:p,setShadowSettingsOpen:x,innerShadowSettingsOpen:c,setInnerShadowSettingsOpen:g,glowSettingsOpen:h,setGlowSettingsOpen:i,bendSettingsOpen:b,setBendSettingsOpen:j,backgroundSettingsOpen:k,setBackgroundSettingsOpen:C}))]}))]})},ol="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",rl={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},al=Object.entries(rl).map(([t,n])=>({value:t,label:n})),dl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:ol,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},cl=(t,n)=>{const l=dl[n];return{...t,preset:n,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},pl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},et={display:"flex",flexDirection:"column",gap:4},hl={...et,gridColumn:"1 / -1"},Ke={fontSize:9,color:"rgba(226,232,240,0.72)"},Lt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Vt={...Lt,appearance:"none"},xl={...Lt,fontVariantNumeric:"tabular-nums"},yl={...Lt,padding:2,cursor:"pointer"},ul=t=>/^-?\d*(\.\d*)?$/.test(t),Ht=({value:t,onChange:n,step:l=1,min:s,max:a})=>{const[d,o]=u.useState(String(t));u.useEffect(()=>o(String(t)),[t]);const r=y=>{let p=y;return typeof s=="number"&&(p=Math.max(s,p)),typeof a=="number"&&(p=Math.min(a,p)),p};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:xl,value:d,onChange:y=>{const p=y.target.value;if(!ul(p)||(o(p),p===""||p==="-"||p==="."||p==="-."))return;const x=Number(p);Number.isNaN(x)||n(r(x))},onBlur:()=>{const y=Number(d);if(Number.isNaN(y)){o(String(t));return}const p=r(y);o(String(p)),n(p)},onKeyDown:y=>{if(y.key!=="ArrowUp"&&y.key!=="ArrowDown")return;y.preventDefault();const p=y.shiftKey?l*10:y.altKey?l/10:l,x=y.key==="ArrowUp"?t+p:t-p;n(r(Number.isInteger(x)?x:Number(x.toFixed(6))))}})},gl=({value:t,onChange:n})=>e.jsxs("div",{style:pl,children:[e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Material Type"}),e.jsxs("select",{style:Vt,value:t.materialType,onChange:l=>n({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Blend Mode"}),e.jsxs("select",{style:Vt,value:t.blendMode,onChange:l=>n({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Opacity"}),e.jsx(Ht,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>n({...t,opacity:l})})]}),e.jsxs("label",{style:et,children:[e.jsx("span",{style:Ke,children:"Tint"}),e.jsx("input",{type:"color",style:yl,value:t.color,onChange:l=>n({...t,color:l.target.value})})]}),e.jsxs("label",{style:hl,children:[e.jsx("span",{style:Ke,children:"Alpha Test"}),e.jsx(Ht,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>n({...t,alphaTest:l})})]})]}),bl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},fl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},jl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ml={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Sl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},wl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),kl={display:"grid",gap:7,padding:"0 7px 7px"},vl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},tt={display:"flex",flexDirection:"column",gap:4},ft={...tt,gridColumn:"1 / -1"},Se={fontSize:9,color:"rgba(226,232,240,0.72)"},bn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},jt={...bn,appearance:"none"},mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},St={width:16,height:16},Cl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Rl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),El=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),Il=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),Kt=(t,n)=>({enabled:(n==null?void 0:n.enabled)??t.enabled,showGuides:(n==null?void 0:n.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(n==null?void 0:n.position)??t.position,size:(n==null?void 0:n.size)??t.size,rotation:(n==null?void 0:n.rotation)??t.rotation,scale2D:n==null?void 0:n.scale2D,referencePixelsPerUnit:n==null?void 0:n.referencePixelsPerUnit,pivot:(n==null?void 0:n.pivot)??t.pivot,renderOrder:(n==null?void 0:n.renderOrder)??t.renderOrder,overlay:(n==null?void 0:n.overlay)??t.overlay,visible:(n==null?void 0:n.visible)??t.visible}),zl=(t,n)=>({...n,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),_t=(t,n)=>({...$.DEFAULT_SCREEN_TRANSFORM_2D,...n,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(n==null?void 0:n.scale2D)??$.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(n==null?void 0:n.referencePixelsPerUnit)??$.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Tl=({value:t,onChange:n,copyLabel:l,inspector:s})=>{const[a,d]=u.useState(()=>$.createSceneObject({name:l??"Screen Image",renderGroupId:We.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=u.useState(()=>{const h=a.id,i=$.createDefaultComponent("ScreenTransform",h),b=$.createDefaultComponent("ScreenImage",h),j=$.createDefaultComponent("Material",h),k=$.createDefaultComponent("Texture",h);return{screenTransform:i,screenImage:b,material:j,texture:k}}),[r,y]=u.useState({transformation:!0,image:!0,material:!0}),p=Kt(t.screenImage.transformation,t.screenImage.screenTransform),x={object:{...a,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??_t(p)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},c=h=>{n({...t,screenImage:h(t.screenImage)})},g=(h,i,b,j)=>e.jsxs("div",{style:fl,children:[e.jsxs("div",{style:jl,children:[e.jsx("button",{type:"button",onClick:()=>y(k=>({...k,[h]:!k[h]})),style:Sl,children:e.jsx("div",{style:wl(r[h])})}),e.jsxs("div",{style:ml,children:[e.jsx("span",{style:bl,children:b}),e.jsx("span",{children:i})]})]}),r[h]?e.jsx("div",{style:kl,children:j}):null]},h);return e.jsxs(ut,{objectId:(s==null?void 0:s.objectId)??a.id,objectName:(s==null?void 0:s.objectName)??a.name,onObjectNameChange:(s==null?void 0:s.onObjectNameChange)??(h=>d(i=>({...i,name:h}))),layer:(s==null?void 0:s.layer)??"Default Layer",visible:(s==null?void 0:s.visible)??t.screenImage.enabled,onVisibleChange:(s==null?void 0:s.onVisibleChange)??(h=>c(i=>({...i,enabled:h}))),copyConfig:(s==null?void 0:s.copyConfig)??x,initialPosition:s==null?void 0:s.initialPosition,position:s==null?void 0:s.position,onPositionChange:s==null?void 0:s.onPositionChange,title:s==null?void 0:s.title,children:[g("transformation","Transformation",e.jsx(El,{}),e.jsx(Ft,{value:Kt(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:h=>c(i=>({...i,transformation:zl(h,i.transformation),screenTransform:_t(h,i.screenTransform)}))})),g("image","Image",e.jsx(Rl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Preset"}),e.jsx("select",{style:jt,value:t.screenImage.preset,onChange:h=>c(i=>cl(i,h.target.value)),children:al.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))})]}),e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Source Kind"}),e.jsx("select",{style:jt,value:t.screenImage.image.sourceKind,onChange:h=>c(i=>({...i,image:{...i.image,sourceKind:h.target.value}})),children:Cl.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Source URL"}),e.jsx("input",{style:bn,value:t.screenImage.image.src,onChange:h=>c(i=>({...i,image:{...i.image,src:h.target.value}}))})]}):null,e.jsxs("label",{style:tt,children:[e.jsx("span",{style:Se,children:"Stretch Mode"}),e.jsxs("select",{style:jt,value:t.screenImage.image.stretchMode,onChange:h=>c(i=>({...i,image:{...i.image,stretchMode:h.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.flipX,onChange:h=>c(i=>({...i,image:{...i.image,flipX:h.target.checked}}))})]})}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.flipY,onChange:h=>c(i=>({...i,image:{...i.image,flipY:h.target.checked}}))})]})})]})),g("material","Material",e.jsx(Il,{}),e.jsxs("div",{style:vl,children:[e.jsx(gl,{value:t.screenImage.image,onChange:h=>c(i=>({...i,image:{...i.image,materialType:h.materialType,blendMode:h.blendMode,opacity:h.opacity,color:h.color,alphaTest:h.alphaTest}}))}),e.jsx("label",{style:ft,children:e.jsxs("div",{style:mt,children:[e.jsx("span",{style:Se,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:St,checked:t.screenImage.image.transparent,onChange:h=>c(i=>({...i,image:{...i.image,transparent:h.target.checked}}))})]})})]}))]})},$e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},Me={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Ml=({onChange:t,value:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[n.map((l,s)=>e.jsxs("div",{style:$e,children:[e.jsx("input",{"aria-label":`Gradient stop ${s+1} color`,type:"color",style:{...Me,padding:2},value:l.color,onChange:a=>t(n.map((d,o)=>o===s?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${s+1} position`,type:"number",min:0,max:1,step:.05,style:Me,value:l.offset,onChange:a=>t(n.map((d,o)=>o===s?{...d,offset:Number(a.currentTarget.value)}:d))}),n.length>2?e.jsx("button",{type:"button",onClick:()=>t(n.filter((a,d)=>d!==s)),children:"−"}):null]})]},`${s}-${l.color}`)),n.length<X.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...n,{offset:.5,color:((l=n[n.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),fn=({onChange:t,value:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:Me,value:n.type,onChange:l=>t({...n,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Ml,{value:n.stops,onChange:l=>t({...n,stops:l})}),n.type!=="radial"?e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:Me,step:5,value:n.angle,onChange:l=>t({...n,angle:Number(l.currentTarget.value)})})]}):null,n.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:Me,min:0,max:1,step:.05,value:n.center.x,onChange:l=>t({...n,center:{...n.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:Me,min:0,max:1,step:.05,value:n.center.y,onChange:l=>t({...n,center:{...n.center,y:Number(l.currentTarget.value)}})})]})]}):null,n.type==="radial"?e.jsxs("label",{style:$e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:Me,min:.01,step:.05,value:n.radius,onChange:l=>t({...n,radius:Number(l.currentTarget.value)})})]}):null]}),Gt={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},Ut={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},jn=({value:t,onChange:n})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:Gt,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...Ut,padding:2},value:t.tint,onChange:l=>n({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:Gt,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:Ut,min:0,max:1,step:.05,value:t[l],onChange:s=>n({...t,[l]:Number(s.currentTarget.value)})})]},l))]}),Wl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ae={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},nt={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ne=({label:t,onValue:n,...l})=>e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:nt,onChange:s=>n(Number(s.currentTarget.value))})]}),mn=({value:t,onChange:n})=>e.jsxs("section",{style:Wl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:nt,value:t.kind,onChange:l=>n({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:nt,value:t.fillMode,onChange:l=>n({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(fn,{value:t.gradient,onChange:l=>n({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(jn,{value:t.glass,onChange:l=>n({...t,glass:l})}):e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...nt,padding:2},value:t.fillColor,onChange:l=>n({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ne,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>n({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...nt,padding:2},value:t.strokeColor,onChange:l=>n({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ne,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>n({...t,strokeWidth:l})}),e.jsx(ne,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>n({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ae,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>n({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ne,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>n({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ne,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>n({...t,sides:l})}):null,t.kind==="star"?e.jsx(ne,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>n({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ne,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>n({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ne,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>n({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ne,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>n({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ne,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>n({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Fl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Ll={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Sn={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Nl={...Sn,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Ol={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},$l={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Al={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},Xt={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Dl={display:"grid",gap:6,padding:7},Bl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Pl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Vl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Hl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Kl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),_l={display:"grid",gap:7,padding:"0 7px 7px"},Gl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Te={display:"flex",flexDirection:"column",gap:4},_e={...Te,gridColumn:"1 / -1"},ee={fontSize:9,color:"rgba(226,232,240,0.72)"},Le={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ge={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ue={width:16,height:16},Zt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Ul=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),Xl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Zl=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),Yl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),ql=({value:t,onChange:n})=>{const[l,s]=u.useState(!0),[a,d]=u.useState({x:14,y:104}),[o,r]=u.useState(typeof window>"u"?0:window.innerHeight),[y,p]=u.useState({overlay:!0,visibility:!1}),x=u.useRef(null),c=Math.max(240,o-a.y-16);u.useEffect(()=>{const i=j=>{x.current&&d({x:Math.max(8,j.clientX-x.current.x),y:Math.max(8,j.clientY-x.current.y)})},b=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",b)}},[]),u.useEffect(()=>{const i=()=>r(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const g=i=>{const b=i.currentTarget.getBoundingClientRect();x.current={x:i.clientX-b.left,y:i.clientY-b.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},h=(i,b,j,k)=>e.jsxs("div",{style:Bl,children:[e.jsxs("div",{style:Pl,children:[e.jsx("button",{type:"button",onClick:()=>p(C=>({...C,[i]:!C[i]})),style:Hl,children:e.jsx("div",{style:Kl(y[i])})}),e.jsxs("div",{style:Vl,children:[e.jsx("span",{style:Xt,children:j}),e.jsx("span",{children:b})]})]}),y[i]?e.jsx("div",{style:_l,children:k}):null]},i);return typeof document>"u"?null:pe.createPortal(e.jsxs("div",{style:{...Ll,left:a.x,top:a.y},children:[e.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ue=require("./session-BrH8G7iJ.cjs"),Hs=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),y=require("react"),Le=require("./renderGroups-Cb_4Ar1Q.cjs"),K=require("./index-BfFmpddl.cjs"),Oe=require("react-dom"),$e=require("./index-D5GTzOzD.cjs"),Gs=require("three"),J=require("./renderPasses-dqmkft4P.cjs"),Ne=require("./settings-C63FMBlF.cjs"),N=require("./FaceRetouch-J1lC1WbS.cjs"),_s=require("./index-CfSF8LXa.cjs"),It=require("./landmarkMask-u7es2k4X.cjs"),Us=require("./index-tpCr9CLj.cjs"),Zt=require("@react-three/drei"),Xs=require("@react-three/fiber"),Yt=require("./index-BuBzneeW.cjs"),Zs=require("./contexts-BH7PdKFS.cjs"),Ys=require("./selectors-C4X71aoD.cjs"),qs={position:"fixed",zIndex:2e4,pointerEvents:"none"},kt={width:"100%",maxHeight:"none",border:"none",borderRadius:0,background:"transparent",boxShadow:"none",backdropFilter:"none",WebkitBackdropFilter:"none",overflow:"visible"},js=({docked:t=!1,initialPosition:s,position:l,onPositionChange:n})=>{const[a,d]=y.useState(s),r=l??a,o=y.useRef(null),h=y.useRef(n);return h.current=n,y.useEffect(()=>{if(t)return;const p=g=>{var j;const i=o.current;if(!i)return;const u={x:Math.max(8,g.clientX-i.x),y:Math.max(8,g.clientY-i.y)};d(u),(j=h.current)==null||j.call(h,u)},f=()=>{const g=o.current;g&&(o.current=null,g.selectNone&&document.body.classList.remove("select-none"))};return window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f)}},[t]),{docked:t,position:r,startDrag:(p,{capture:f=!0,selectNone:g=!0}={})=>{if(t)return;const i=p.currentTarget.getBoundingClientRect();o.current={x:p.clientX-i.left,y:p.clientY-i.top,selectNone:g},g&&document.body.classList.add("select-none"),f&&p.currentTarget.setPointerCapture(p.pointerId)},place:p=>t?p:typeof document>"u"?null:Oe.createPortal(e.jsx("div",{style:{...qs,left:r.x,top:r.y},children:p}),document.body)}},qt={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Js=306,Qs=()=>({x:typeof window>"u"?14:window.innerWidth-(Js+20),y:30}),en={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},ms={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},tn={...ms,gridTemplateColumns:"22px minmax(0, 1fr) 28px"},sn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},nn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},ln={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},on={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Jt={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},rn={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},an={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},dn=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),cn={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},pn={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},hn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xn=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),un=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),gn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),yn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),bn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),fn=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ct=({children:t,copyConfig:s,docked:l=!1,initialPosition:n,layer:a="Default Layer",objectId:d,objectName:r,onObjectNameChange:o,onPositionChange:h,onVisibleChange:x,position:c,title:p,visible:f})=>{const{startDrag:g,place:i}=js({docked:l,initialPosition:n??Qs,position:c,onPositionChange:h}),[u,j]=y.useState(!1),[w,v]=y.useState(!0),M=r??p??d??"Scene Object",[U,b]=y.useState(!1),[F,E]=y.useState(M);y.useEffect(()=>{U||E(M)},[M,U]);const P=async()=>{try{await fn(JSON.stringify(s,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},le=()=>{const L=F.trim();if(b(!1),!o||!L||L===M){E(M);return}o(L)},ae=()=>{E(M),b(!1)};return i(e.jsxs("div",{style:l?{...qt,...kt}:qt,children:[e.jsxs("div",{style:en,children:[e.jsxs("div",{style:l?tn:ms,children:[!l&&e.jsx("div",{onPointerDown:g,style:on,children:e.jsx(hn,{})}),e.jsx("span",{style:ln,children:e.jsx(xn,{})}),U?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:nn,value:F,onBlur:le,onChange:L=>E(L.currentTarget.value),onKeyDown:L=>{L.key==="Enter"&&le(),L.key==="Escape"&&ae()}}):e.jsx("button",{type:"button",style:{...sn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&b(!0)},children:M}),e.jsx("button",{type:"button","aria-label":w?"Fold Inspector":"Expand Inspector",title:w?"Fold Inspector":"Expand Inspector",style:cn,onClick:()=>v(L=>!L),children:w?e.jsx(yn,{}):e.jsx(bn,{})})]}),w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:pn,children:a}),e.jsxs("div",{style:rn,children:[e.jsx("button",{type:"button",style:an,onClick:P,children:u?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:dn(f),onClick:()=>x(!f),children:f?e.jsx(un,{}):e.jsx(gn,{})})]})]}):null]}),w?e.jsx("div",{style:l?{...Jt,maxHeight:"none"}:Jt,children:t}):null]}))},jn={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},mn=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],Sn=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],vn={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},wn=()=>({color:"#000000",opacity:1,width:30}),Bt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),Ss=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),vs=()=>({preset:"arc",strength:100}),kn=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],Cn=(t,s)=>{const l=jn[s],n=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:s,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:n,shadowLayers:a}}},ws=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Rn=(t,s)=>({...s,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ks=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),In={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},En={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Tn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wn={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},k={display:"flex",flexDirection:"column",gap:4},ee={...k,gridColumn:"1 / -1"},Ln={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},$n={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},Nn={display:"flex",alignItems:"center",gap:6,minWidth:0},On={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},S={fontSize:9,color:"rgba(226,232,240,0.72)"},Kt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},An={...Kt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Kt,padding:2,cursor:"pointer"},xe={...Kt,appearance:"none"},Pn={opacity:.45,cursor:"not-allowed"},ue={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},gt={width:16,height:16},Dn={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},Je=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),wt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Bn({label:t,icon:s,open:l,onToggle:n,children:a}){return e.jsxs("div",{style:En,children:[e.jsxs("div",{style:Tn,children:[e.jsx("button",{type:"button",onClick:n,style:Mn,children:e.jsx("div",{style:Fn(l)})}),e.jsxs("div",{style:zn,children:[e.jsx("span",{style:In,children:s}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Wn,children:a}):null]})}const Qt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),es=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Vn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Kn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function Hn({value:t,onChange:s}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Text"}),e.jsx("textarea",{style:An,value:t.content.text,onChange:l=>s(n=>({...n,content:{...n.content,text:l.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Art"}),e.jsx("select",{style:xe,value:t.textArtPreset,onChange:l=>s(n=>Cn(n,l.target.value)),children:Sn.map(l=>e.jsx("option",{value:l,children:vn[l]},l))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font"}),e.jsx("select",{style:xe,value:t.style.fontFamily,onChange:l=>s(n=>({...n,style:{...n.style,fontFamily:l.target.value}})),children:mn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const Gn={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},_n=t=>/^-?\d*(\.\d*)?$/.test(t),z=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof n=="number"?n:-1/0,x));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...Gn,...d?{cursor:"not-allowed",opacity:.45}:{}},value:r,disabled:d,onChange:x=>{if(d)return;const c=x.target.value;if(!_n(c)||(o(c),["","-",".","-."].includes(c)))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{if(d)return;const x=Number(r);if(Number.isNaN(x))return o(String(t));const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(d||x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})};function Un({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Mode"}),e.jsxs("select",{style:xe,value:t.fillMode,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Area"}),e.jsxs("select",{style:xe,value:t.fit,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,n)=>e.jsxs("label",{style:k,children:[e.jsxs("span",{style:S,children:["Gradient ",n+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})}),e.jsx(z,{value:l.position,min:0,max:1,step:.05,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})})]})]},n))}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Opacity"}),e.jsx(z,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Corner Radius"}),e.jsx(z,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderRadius:l}}}))})]})]})}function Xn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Width"}),e.jsx(z,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,width:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Height"}),e.jsx(z,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,height:l}}}))})]})]})}function Zn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&n.style.background.borderColor==="transparent"?"#ffffff":n.style.background.borderColor,borderWidth:l.target.checked?Math.max(n.style.background.borderWidth,2):n.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Pn},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Width"}),e.jsx(z,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderWidth:l}}}))})]})]})}const Cs={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function yt({checked:t,label:s,onChange:l}){return e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:s}),e.jsx("input",{type:"checkbox",style:gt,checked:t,onChange:n=>l(n.target.checked)})]})})}function Xe({children:t,label:s,open:l,setOpen:n}){return e.jsxs("div",{style:Ln,children:[e.jsxs("button",{type:"button",style:$n,onClick:()=>n(a=>!a),children:[e.jsxs("span",{style:Nn,children:[e.jsx(Kn,{}),e.jsx("span",{children:s})]}),e.jsx("span",{style:On,children:l?"−":"+"})]}),l?t:null]})}function Yn({value:t,onChange:s,open:l,setOpen:n}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:gt,checked:a.enabled,onChange:d=>s(r=>({...r,style:{...r.style,background:{...r.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Xe,{label:"Background Settings",open:l,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsx(Un,{background:a,onChange:s}),e.jsx(Zn,{background:a,onChange:s}),e.jsx(Xn,{background:a,onChange:s})]})}):null]})}function qn({bend:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,bend:{...o.style.bend??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,bendEnabled:r,bend:o.style.bend??vs()}}))}),a.style.bendEnabled===!0?e.jsx(Xe,{label:"Bend",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Preset"}),e.jsx("select",{style:xe,value:t.preset,onChange:r=>d({preset:r.target.value}),children:kn.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Strength"}),e.jsx(z,{value:t.strength,min:-100,max:100,step:1,onChange:r=>d({strength:r})})]})]})}):null]})}function Jn({glow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,glow:{...o.style.glow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,glowEnabled:r,glow:o.style.glow??Ss()}}))}),a.style.glowEnabled===!0?e.jsx(Xe,{label:"Glow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Style"}),e.jsxs("select",{style:xe,value:t.style,onChange:r=>d({style:r.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Intensity"}),e.jsx(z,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:r=>d({intensity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Range"}),e.jsx(z,{value:t.range??.5,min:0,max:1,step:.05,onChange:r=>d({range:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Angle"}),e.jsx(z,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({horizontalAngle:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Angle"}),e.jsx(z,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({verticalAngle:r})})]})]})}):null]})}const Qn={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function el({innerShadow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,innerShadow:{...o.style.innerShadow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,innerShadowEnabled:r,innerShadow:o.style.innerShadow??Qn}}))}),a.style.innerShadowEnabled===!0?e.jsx(Xe,{label:"Inner Shadow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:t.opacity??1,min:0,max:1,step:.05,onChange:r=>d({opacity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:t.offset??10,min:0,max:100,step:1,onChange:r=>d({offset:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:t.angle??-45,min:-180,max:180,step:1,onChange:r=>d({angle:r})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:t.feather??0,min:0,max:1,step:.05,onChange:r=>d({feather:r})})]})]})}):null]})}function tl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.strokeLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,strokeLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:r=>l(o=>({...o,style:{...o.style,outlineEnabled:r}}))}),a.style.outlineEnabled!==!1?e.jsx(Xe,{label:"Outline Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,strokeLayers:[...r.style.strokeLayers??[],wn()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Outline ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,strokeLayers:(h.style.strokeLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Outline Size"}),e.jsx(z,{value:r.width,min:0,max:100,step:1,onChange:h=>d(o,{width:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function sl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.shadowLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,shadowLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:r=>l(o=>{var h;return{...o,style:{...o.style,shadowEnabled:r,shadowLayers:r&&(((h=o.style.shadowLayers)==null?void 0:h.length)??0)===0?[Bt()]:o.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Xe,{label:"Shadow Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,shadowLayers:[...r.style.shadowLayers??[],Bt()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Shadow ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,shadowLayers:(h.style.shadowLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:r.offset??10,min:0,max:100,step:1,onChange:h=>d(o,{offset:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:r.angle??-45,min:-180,max:180,step:1,onChange:h=>d(o,{angle:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:r.feather??0,min:0,max:1,step:.05,onChange:h=>d(o,{feather:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function nl({backgroundSettingsOpen:t,bend:s,bendSettingsOpen:l,glow:n,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:r,onChange:o,outlineLayers:h,outlineSettingsOpen:x,setBackgroundSettingsOpen:c,setBendSettingsOpen:p,setGlowSettingsOpen:f,setInnerShadowSettingsOpen:g,setOutlineSettingsOpen:i,setShadowSettingsOpen:u,shadowLayers:j,shadowSettingsOpen:w,value:v}){return e.jsxs("div",{style:me,children:[e.jsx(tl,{value:v,onChange:o,layers:h,open:x,setOpen:i}),e.jsx(sl,{value:v,onChange:o,layers:j,open:w,setOpen:u}),e.jsx(el,{value:v,onChange:o,innerShadow:d,open:a,setOpen:f}),e.jsx(Jn,{value:v,onChange:o,glow:n,open:r,setOpen:g}),e.jsx(qn,{value:v,onChange:o,bend:s,open:l,setOpen:p}),e.jsx(Yn,{value:v,onChange:o,open:t,setOpen:c})]})}function ll({value:t,onChange:s}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:n=>s(a=>({...a,style:{...a.style,color:n.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font Size"}),e.jsx(z,{value:t.style.fontSize,min:16,max:180,step:4,onChange:n=>s(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??n,n)},style:{...a.style,fontSize:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Letter Spacing"}),e.jsx(z,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,letterSpacing:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Line Spacing"}),e.jsx(z,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,lineSpacing:n}}))})]}),e.jsxs("div",{style:ee,children:[e.jsx("span",{style:S,children:"Text Style"}),e.jsxs("div",{style:Dn,children:[e.jsx("button",{type:"button",style:Je(!l),onClick:()=>s(n=>({...n,style:{...n.style,bold:!1,fontWeight:n.style.fontWeight==="bold"?"normal":n.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:Je(t.style.bold===!0),onClick:()=>s(n=>({...n,style:{...n.style,bold:n.style.bold!==!0,fontWeight:n.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:Je(t.style.fontStyle==="italic"),onClick:()=>s(n=>({...n,style:{...n.style,fontStyle:n.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:Je(t.style.underline===!0),onClick:()=>s(n=>({...n,style:{...n.style,underline:n.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:Je(t.style.strikethrough===!0),onClick:()=>s(n=>({...n,style:{...n.style,strikethrough:n.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Alignment"}),e.jsxs("select",{style:xe,value:t.layout.textAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,textAlign:n.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Alignment"}),e.jsxs("select",{style:xe,value:t.layout.verticalAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,verticalAlign:n.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Overflow"}),e.jsxs("select",{style:xe,value:t.layout.overflow,onChange:n=>s(a=>({...a,layout:{...a.layout,overflow:n.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.layout.resizeToFit===!0,onChange:n=>s(a=>({...a,layout:{...a.layout,resizeToFit:n.target.checked}}))})]})})]})}const il={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},re={display:"flex",flexDirection:"column",gap:4},Et={...re,gridColumn:"1 / -1"},Y={fontSize:9,color:"rgba(226,232,240,0.72)"},ol={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},rl={...ol,fontVariantNumeric:"tabular-nums"},al={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},dl={width:16,height:16},cl=t=>/^-?\d*(\.\d*)?$/.test(t),se=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>{let c=x;return typeof n=="number"&&(c=Math.max(n,c)),typeof a=="number"&&(c=Math.min(a,c)),c};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:rl,value:r,disabled:d,onChange:x=>{const c=x.target.value;if(!cl(c)||(o(c),c===""||c==="-"||c==="."||c==="-."))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{const x=Number(r);if(Number.isNaN(x)){o(String(t));return}const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})},Ht=({value:t,onChange:s,guideLabel:l,showRenderOrder:n=!0})=>{var a,d;return e.jsxs("div",{style:il,children:[e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position X"}),e.jsx(se,{value:t.position.x,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,x:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position Y"}),e.jsx(se,{value:t.position.y,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,y:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size X"}),e.jsx(se,{value:t.size.width,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,width:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size Y"}),e.jsx(se,{value:t.size.height,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,height:r}})})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Rotation"}),e.jsx(se,{value:t.rotation,min:-360,max:360,step:1,onChange:r=>s({...t,rotation:r})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D X"}),e.jsx(se,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:r,y:((o=t.scale2D)==null?void 0:o.y)??1}})}})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D Y"}),e.jsx(se,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:((o=t.scale2D)==null?void 0:o.x)??1,y:r}})}})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Reference Pixels Per Unit"}),e.jsx(se,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:r=>s({...t,referencePixelsPerUnit:r})})]}),n?e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Render Order"}),e.jsx(se,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:r=>s({...t,renderOrder:r})})]}):null,e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot X"}),e.jsx(se,{value:t.pivot[0],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[r,t.pivot[1]]})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot Y"}),e.jsx(se,{value:t.pivot[1],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[t.pivot[0],r]})})]}),e.jsx("label",{style:Et,children:e.jsxs("div",{style:al,children:[e.jsx("span",{style:Y,children:l}),e.jsx("input",{type:"checkbox",style:dl,checked:t.showGuides,onChange:r=>s({...t,showGuides:r.target.checked})})]})})]})};function pl({value:t,onChange:s}){return e.jsx(Ht,{value:ws(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>s(n=>({...n,transformation:Rn(l,n.transformation),screenTransform:ks(l,n.screenTransform)}))})}const hl=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{var Ze;const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Text",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const $=d.id,Z=K.createDefaultComponent("ScreenTransform",$),m=K.createDefaultComponent("ScreenText",$),R=K.createDefaultComponent("Material",$),D=K.createDefaultComponent("Texture",$);return{screenTransform:Z,screenText:m,material:R,texture:D}}),[h,x]=y.useState(!0),[c,p]=y.useState(!0),[f,g]=y.useState(!0),[i,u]=y.useState(!0),[j,w]=y.useState(!0),[v,M]=y.useState(!0),[U,b]=y.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),F=ws(t.screenText.transformation,t.screenText.screenTransform),E={object:{...d,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??ks(F)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},P=$=>{s({...t,screenText:$(t.screenText)})},le=t.screenText.style.strokeLayers??[],ae=t.screenText.style.shadowEnabled!==!1&&(((Ze=t.screenText.style.shadowLayers)==null?void 0:Ze.length)??0)===0?[Bt()]:t.screenText.style.shadowLayers??[],L=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},Ae=t.screenText.style.glow??Ss(),Pe=t.screenText.style.bend??vs(),W=$=>b(Z=>({...Z,[$]:!Z[$]})),ve=($,Z,m,R)=>e.jsx(Bn,{label:Z,icon:m,open:U[$],onToggle:()=>W($),children:R},$);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??($=>r(Z=>({...Z,name:$}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenText.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??($=>P(Z=>({...Z,enabled:$}))),copyConfig:(n==null?void 0:n.copyConfig)??E,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[ve("transformation","Transformation",e.jsx(Vn,{}),e.jsx(pl,{value:t.screenText,onChange:P})),ve("text2d","2D Text",e.jsx(Qt,{}),e.jsxs(e.Fragment,{children:[ve("content","Content",e.jsx(Qt,{}),e.jsx(Hn,{value:t.screenText,onChange:P})),ve("style","Style",e.jsx(es,{}),e.jsx(ll,{value:t.screenText,onChange:P})),ve("textEffect","Text Effect",e.jsx(es,{}),e.jsx(nl,{value:t.screenText,onChange:P,outlineLayers:le,shadowLayers:ae,innerShadow:L,glow:Ae,bend:Pe,outlineSettingsOpen:h,setOutlineSettingsOpen:x,shadowSettingsOpen:c,setShadowSettingsOpen:p,innerShadowSettingsOpen:f,setInnerShadowSettingsOpen:g,glowSettingsOpen:i,setGlowSettingsOpen:u,bendSettingsOpen:j,setBendSettingsOpen:w,backgroundSettingsOpen:v,setBackgroundSettingsOpen:M}))]}))]})},xl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",ul={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},gl=Object.entries(ul).map(([t,s])=>({value:t,label:s})),yl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:xl,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},bl=(t,s)=>{const l=yl[s];return{...t,preset:s,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},fl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},ct={display:"flex",flexDirection:"column",gap:4},jl={...ct,gridColumn:"1 / -1"},Qe={fontSize:9,color:"rgba(226,232,240,0.72)"},Gt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ts={...Gt,appearance:"none"},ml={...Gt,fontVariantNumeric:"tabular-nums"},Sl={...Gt,padding:2,cursor:"pointer"},vl=t=>/^-?\d*(\.\d*)?$/.test(t),ss=({value:t,onChange:s,step:l=1,min:n,max:a})=>{const[d,r]=y.useState(String(t));y.useEffect(()=>r(String(t)),[t]);const o=h=>{let x=h;return typeof n=="number"&&(x=Math.max(n,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:ml,value:d,onChange:h=>{const x=h.target.value;if(!vl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||s(o(c))},onBlur:()=>{const h=Number(d);if(Number.isNaN(h)){r(String(t));return}const x=o(h);r(String(x)),s(x)},onKeyDown:h=>{if(h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const x=h.shiftKey?l*10:h.altKey?l/10:l,c=h.key==="ArrowUp"?t+x:t-x;s(o(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},wl=({value:t,onChange:s})=>e.jsxs("div",{style:fl,children:[e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Material Type"}),e.jsxs("select",{style:ts,value:t.materialType,onChange:l=>s({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Blend Mode"}),e.jsxs("select",{style:ts,value:t.blendMode,onChange:l=>s({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Opacity"}),e.jsx(ss,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>s({...t,opacity:l})})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Tint"}),e.jsx("input",{type:"color",style:Sl,value:t.color,onChange:l=>s({...t,color:l.target.value})})]}),e.jsxs("label",{style:jl,children:[e.jsx("span",{style:Qe,children:"Alpha Test"}),e.jsx(ss,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>s({...t,alphaTest:l})})]})]}),kl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Cl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Rl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Il={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},El={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Tl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),zl={display:"grid",gap:7,padding:"0 7px 7px"},Ml={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pt={display:"flex",flexDirection:"column",gap:4},Tt={...pt,gridColumn:"1 / -1"},we={fontSize:9,color:"rgba(226,232,240,0.72)"},Rs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},zt={...Rs,appearance:"none"},Mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ft={width:16,height:16},Fl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Wl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ll=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),$l=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),ns=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Nl=(t,s)=>({...s,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ls=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Ol=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Image",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const i=d.id,u=K.createDefaultComponent("ScreenTransform",i),j=K.createDefaultComponent("ScreenImage",i),w=K.createDefaultComponent("Material",i),v=K.createDefaultComponent("Texture",i);return{screenTransform:u,screenImage:j,material:w,texture:v}}),[h,x]=y.useState({transformation:!0,image:!0,material:!0}),c=ns(t.screenImage.transformation,t.screenImage.screenTransform),p={object:{...d,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??ls(c)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},f=i=>{s({...t,screenImage:i(t.screenImage)})},g=(i,u,j,w)=>e.jsxs("div",{style:Cl,children:[e.jsxs("div",{style:Rl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:El,children:e.jsx("div",{style:Tl(h[i])})}),e.jsxs("div",{style:Il,children:[e.jsx("span",{style:kl,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:zl,children:w}):null]},i);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??(i=>r(u=>({...u,name:i}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenImage.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??(i=>f(u=>({...u,enabled:i}))),copyConfig:(n==null?void 0:n.copyConfig)??p,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[g("transformation","Transformation",e.jsx(Ll,{}),e.jsx(Ht,{value:ns(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:i=>f(u=>({...u,transformation:Nl(i,u.transformation),screenTransform:ls(i,u.screenTransform)}))})),g("image","Image",e.jsx(Wl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Preset"}),e.jsx("select",{style:zt,value:t.screenImage.preset,onChange:i=>f(u=>bl(u,i.target.value)),children:gl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source Kind"}),e.jsx("select",{style:zt,value:t.screenImage.image.sourceKind,onChange:i=>f(u=>({...u,image:{...u.image,sourceKind:i.target.value}})),children:Fl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source URL"}),e.jsx("input",{style:Rs,value:t.screenImage.image.src,onChange:i=>f(u=>({...u,image:{...u.image,src:i.target.value}}))})]}):null,e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Stretch Mode"}),e.jsxs("select",{style:zt,value:t.screenImage.image.stretchMode,onChange:i=>f(u=>({...u,image:{...u.image,stretchMode:i.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipX,onChange:i=>f(u=>({...u,image:{...u.image,flipX:i.target.checked}}))})]})}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipY,onChange:i=>f(u=>({...u,image:{...u.image,flipY:i.target.checked}}))})]})})]})),g("material","Material",e.jsx($l,{}),e.jsxs("div",{style:Ml,children:[e.jsx(wl,{value:t.screenImage.image,onChange:i=>f(u=>({...u,image:{...u.image,materialType:i.materialType,blendMode:i.blendMode,opacity:i.opacity,color:i.color,alphaTest:i.alphaTest}}))}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.transparent,onChange:i=>f(u=>({...u,image:{...u.image,transparent:i.target.checked}}))})]})})]}))]})},Ge={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},We={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Al=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[s.map((l,n)=>e.jsxs("div",{style:Ge,children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} color`,type:"color",style:{...We,padding:2},value:l.color,onChange:a=>t(s.map((d,r)=>r===n?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} position`,type:"number",min:0,max:1,step:.05,style:We,value:l.offset,onChange:a=>t(s.map((d,r)=>r===n?{...d,offset:Number(a.currentTarget.value)}:d))}),s.length>2?e.jsx("button",{type:"button",onClick:()=>t(s.filter((a,d)=>d!==n)),children:"−"}):null]})]},`${n}-${l.color}`)),s.length<J.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...s,{offset:.5,color:((l=s[s.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),Is=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:Ge,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:We,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Al,{value:s.stops,onChange:l=>t({...s,stops:l})}),s.type!=="radial"?e.jsxs("label",{style:Ge,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:We,step:5,value:s.angle,onChange:l=>t({...s,angle:Number(l.currentTarget.value)})})]}):null,s.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ge,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.x,onChange:l=>t({...s,center:{...s.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:Ge,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.y,onChange:l=>t({...s,center:{...s.center,y:Number(l.currentTarget.value)}})})]})]}):null,s.type==="radial"?e.jsxs("label",{style:Ge,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:We,min:.01,step:.05,value:s.radius,onChange:l=>t({...s,radius:Number(l.currentTarget.value)})})]}):null]}),is={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},os={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Es=({value:t,onChange:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:is,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...os,padding:2},value:t.tint,onChange:l=>s({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:is,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:os,min:0,max:1,step:.05,value:t[l],onChange:n=>s({...t,[l]:Number(n.currentTarget.value)})})]},l))]}),Pl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},_e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},ht={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ie=({label:t,onValue:s,...l})=>e.jsxs("label",{style:_e,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:ht,onChange:n=>s(Number(n.currentTarget.value))})]}),Ts=({value:t,onChange:s})=>e.jsxs("section",{style:Pl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:ht,value:t.kind,onChange:l=>s({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:ht,value:t.fillMode,onChange:l=>s({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(Is,{value:t.gradient,onChange:l=>s({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(Es,{value:t.glass,onChange:l=>s({...t,glass:l})}):e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.fillColor,onChange:l=>s({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>s({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.strokeColor,onChange:l=>s({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>s({...t,strokeWidth:l})}),e.jsx(ie,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>s({...t,strokeOpacity:l})}),e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>s({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ie,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>s({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ie,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>s({...t,sides:l})}):null,t.kind==="star"?e.jsx(ie,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>s({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>s({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ie,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>s({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ie,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>s({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ie,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>s({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Dl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Bl={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},zs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vl={...zs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Kl={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Hl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Gl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},rs={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},_l={display:"grid",gap:6,padding:7},Ul={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Xl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Zl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Yl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},ql=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Jl={display:"grid",gap:7,padding:"0 7px 7px"},Ql={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Fe={display:"flex",flexDirection:"column",gap:4},et={...Fe,gridColumn:"1 / -1"},ne={fontSize:9,color:"rgba(226,232,240,0.72)"},Be={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},tt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},st={width:16,height:16},as={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ei=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),ti=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),ni=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),li=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:14,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({overlay:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ul,children:[e.jsxs("div",{style:Xl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Yl,children:e.jsx("div",{style:ql(h[i])})}),e.jsxs("div",{style:Zl,children:[e.jsx("span",{style:rs,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Jl,children:w}):null]},i);return typeof document>"u"?null:Oe.createPortal(e.jsxs("div",{style:{...Bl,left:a.x,top:a.y},children:[e.jsx("style",{children:`
2
2
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar { width: 10px; }
3
3
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
4
4
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
5
5
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-thumb:hover { background: rgba(226,232,240,0.68); background-clip: padding-box; }
6
- `}),l?e.jsxs("div",{className:"xr-hand-tracking-2d-scroll",style:{...Sn,height:c},children:[e.jsxs("div",{style:Ol,children:[e.jsx("div",{onPointerDown:g,style:$l,children:e.jsx(Zl,{})}),e.jsxs("div",{style:Al,children:[e.jsx("span",{style:Xt,children:e.jsx(wt,{})}),e.jsx("span",{children:"HandTracking2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>n(Fl),style:Zt,children:e.jsx(Yl,{})}),e.jsx("button",{type:"button",onClick:()=>s(!1),style:Zt,children:e.jsx(Xl,{})})]}),e.jsxs("div",{style:Dl,children:[h("overlay","Overlay",e.jsx(wt,{}),e.jsxs("div",{style:Gl,children:[e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ee,children:"Hand Size"}),e.jsx("input",{style:Le,type:"number",min:.25,max:1.8,step:.05,value:t.visualScale,onChange:i=>n({...t,visualScale:Number(i.target.value)})})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ee,children:"Opacity"}),e.jsx("input",{style:Le,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>n({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ee,children:"Joint Radius"}),e.jsx("input",{style:Le,type:"number",min:1,max:20,step:1,value:t.pointRadius,onChange:i=>n({...t,pointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ee,children:"Stroke"}),e.jsx("input",{style:Le,type:"number",min:.01,max:100,step:.01,value:t.lineWidth,onChange:i=>n({...t,lineWidth:Number(i.target.value)})})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ee,children:"Smoothing"}),e.jsx("input",{style:Le,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>n({...t,smoothing:Number(i.target.value)})})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ee,children:"Label Size"}),e.jsx("input",{style:Le,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:i=>n({...t,labelScale:Number(i.target.value)})})]}),e.jsx("label",{style:_e,children:e.jsxs("div",{style:Ge,children:[e.jsx("span",{style:ee,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:Ue,checked:t.showBoundingBox,onChange:i=>n({...t,showBoundingBox:i.target.checked})})]})})]})),h("visibility","Visibility",e.jsx(wt,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:_e,children:e.jsxs("div",{style:Ge,children:[e.jsx("span",{style:ee,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:Ue,checked:t.enabled,onChange:i=>n({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:_e,children:e.jsxs("div",{style:Ge,children:[e.jsx("span",{style:ee,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:Ue,checked:t.bothHands,onChange:i=>n({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:_e,children:e.jsxs("div",{style:Ge,children:[e.jsx("span",{style:ee,children:"Show Labels"}),e.jsx("input",{type:"checkbox",style:Ue,checked:t.showLabels,onChange:i=>n({...t,showLabels:i.target.checked})})]})}),e.jsx("label",{style:_e,children:e.jsxs("div",{style:Ge,children:[e.jsx("span",{style:ee,children:"Log to Console"}),e.jsx("input",{type:"checkbox",style:Ue,checked:t.logToConsole,onChange:i=>n({...t,logToConsole:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>s(!0),style:Nl,children:e.jsx(Ul,{})})]}),document.body)},Jl={enabled:!0,attachImageEnabled:!0,showBoundingBox:!1,verticalAlign:"middle",horizontalAlign:"center",sizeResponsiveToHandBoundingBox:!1,size:1,offsetX:0,offsetY:.02,rotation:0,alpha:1,smoothFollowing:!0,smoothing:.35},Ql=[{label:"Top",value:"top"},{label:"Middle",value:"middle"},{label:"Bottom",value:"bottom"}],ei=[{label:"Left",value:"left"},{label:"Middle",value:"center"},{label:"Right",value:"right"}],ti={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},wn={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},ni={...wn,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},si={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},li={display:"grid",gap:6,padding:7},ii={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},oi={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ri={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},ai={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},di=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),ci={display:"grid",gap:7,padding:"0 7px 7px"},pi={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},re={display:"flex",flexDirection:"column",gap:4},we={...re,gridColumn:"1 / -1"},P={fontSize:9,color:"rgba(226,232,240,0.72)"},ue={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ke={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},ve={width:16,height:16},Yt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},hi=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),xi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),yi=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),kt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),ui=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),gi=({value:t,onChange:n})=>{const[l,s]=u.useState(!0),[a,d]=u.useState({x:320,y:104}),[o,r]=u.useState(typeof window>"u"?0:window.innerHeight),[y,p]=u.useState({controller:!0,visibility:!1}),x=u.useRef(null),c=Math.max(240,o-a.y-16);u.useEffect(()=>{const i=j=>{x.current&&d({x:Math.max(8,j.clientX-x.current.x),y:Math.max(8,j.clientY-x.current.y)})},b=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",b)}},[]),u.useEffect(()=>{const i=()=>r(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const g=i=>{const b=i.currentTarget.getBoundingClientRect();x.current={x:i.clientX-b.left,y:i.clientY-b.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},h=(i,b,j,k)=>e.jsxs("div",{style:ii,children:[e.jsxs("div",{style:oi,children:[e.jsx("button",{type:"button",onClick:()=>p(C=>({...C,[i]:!C[i]})),style:ai,children:e.jsx("div",{style:di(y[i])})}),e.jsxs("div",{style:ri,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:b})]})]}),y[i]?e.jsx("div",{style:ci,children:k}):null]},i);return typeof document>"u"?null:pe.createPortal(e.jsxs("div",{style:{...ti,left:a.x,top:a.y},children:[e.jsx("style",{children:`
6
+ `}),l?e.jsxs("div",{className:"xr-hand-tracking-2d-scroll",style:{...zs,height:p},children:[e.jsxs("div",{style:Kl,children:[e.jsx("div",{onPointerDown:f,style:Hl,children:e.jsx(si,{})}),e.jsxs("div",{style:Gl,children:[e.jsx("span",{style:rs,children:e.jsx(Wt,{})}),e.jsx("span",{children:"HandTracking2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(Dl),style:as,children:e.jsx(ni,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:as,children:e.jsx(ti,{})})]}),e.jsxs("div",{style:_l,children:[g("overlay","Overlay",e.jsx(Wt,{}),e.jsxs("div",{style:Ql,children:[e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Hand Size"}),e.jsx("input",{style:Be,type:"number",min:.25,max:1.8,step:.05,value:t.visualScale,onChange:i=>s({...t,visualScale:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Opacity"}),e.jsx("input",{style:Be,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>s({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Joint Radius"}),e.jsx("input",{style:Be,type:"number",min:1,max:20,step:1,value:t.pointRadius,onChange:i=>s({...t,pointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Stroke"}),e.jsx("input",{style:Be,type:"number",min:.01,max:100,step:.01,value:t.lineWidth,onChange:i=>s({...t,lineWidth:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Smoothing"}),e.jsx("input",{style:Be,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Label Size"}),e.jsx("input",{style:Be,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:i=>s({...t,labelScale:Number(i.target.value)})})]}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:st,checked:t.showBoundingBox,onChange:i=>s({...t,showBoundingBox:i.target.checked})})]})})]})),g("visibility","Visibility",e.jsx(Wt,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:st,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:st,checked:t.bothHands,onChange:i=>s({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Show Labels"}),e.jsx("input",{type:"checkbox",style:st,checked:t.showLabels,onChange:i=>s({...t,showLabels:i.target.checked})})]})}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Log to Console"}),e.jsx("input",{type:"checkbox",style:st,checked:t.logToConsole,onChange:i=>s({...t,logToConsole:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:Vl,children:e.jsx(ei,{})})]}),document.body)},ii={enabled:!0,attachImageEnabled:!0,showBoundingBox:!1,verticalAlign:"middle",horizontalAlign:"center",sizeResponsiveToHandBoundingBox:!1,size:1,offsetX:0,offsetY:.02,rotation:0,alpha:1,smoothFollowing:!0,smoothing:.35},oi=[{label:"Top",value:"top"},{label:"Middle",value:"middle"},{label:"Bottom",value:"bottom"}],ri=[{label:"Left",value:"left"},{label:"Middle",value:"center"},{label:"Right",value:"right"}],ai={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Ms={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},di={...Ms,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},ci={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},pi={display:"grid",gap:6,padding:7},hi={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},xi={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ui={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},gi={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},yi=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),bi={display:"grid",gap:7,padding:"0 7px 7px"},fi={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pe={display:"flex",flexDirection:"column",gap:4},ke={...pe,gridColumn:"1 / -1"},B={fontSize:9,color:"rgba(226,232,240,0.72)"},ge={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ce={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Re={width:16,height:16},ds={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ji=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),mi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Lt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),vi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),wi=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:320,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({controller:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:hi,children:[e.jsxs("div",{style:xi,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:gi,children:e.jsx("div",{style:yi(h[i])})}),e.jsxs("div",{style:ui,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:bi,children:w}):null]},i);return typeof document>"u"?null:Oe.createPortal(e.jsxs("div",{style:{...ai,left:a.x,top:a.y},children:[e.jsx("style",{children:`
7
7
  .xr-hand-tracking-2d-controller-scroll::-webkit-scrollbar { width: 10px; }
8
8
  .xr-hand-tracking-2d-controller-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
9
9
  .xr-hand-tracking-2d-controller-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
10
- `}),l?e.jsxs("div",{className:"xr-hand-tracking-2d-controller-scroll",style:{...wn,height:c},children:[e.jsxs("div",{style:si,children:[e.jsx("div",{onPointerDown:g,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(yi,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(kt,{})}),e.jsx("span",{children:"HandTracking2DController"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>n(Jl),style:Yt,children:e.jsx(ui,{})}),e.jsx("button",{type:"button",onClick:()=>s(!1),style:Yt,children:e.jsx(xi,{})})]}),e.jsxs("div",{style:li,children:[h("controller","Controller",e.jsx(kt,{}),e.jsxs("div",{style:pi,children:[e.jsx("label",{style:we,children:e.jsxs("div",{style:ke,children:[e.jsx("span",{style:P,children:"Enabled"}),e.jsx("input",{type:"checkbox",style:ve,checked:t.enabled,onChange:i=>n({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:ke,children:[e.jsx("span",{style:P,children:"Attach Image"}),e.jsx("input",{type:"checkbox",style:ve,checked:t.attachImageEnabled,onChange:i=>n({...t,attachImageEnabled:i.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:ke,children:[e.jsx("span",{style:P,children:"Size Responsive to Hand Bounding Box"}),e.jsx("input",{type:"checkbox",style:ve,checked:t.sizeResponsiveToHandBoundingBox,onChange:i=>n({...t,sizeResponsiveToHandBoundingBox:i.target.checked})})]})}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Size"}),e.jsx("input",{style:ue,type:"number",min:.1,max:3,step:.01,value:t.size,onChange:i=>n({...t,size:Number(i.target.value)})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Vertical Align"}),e.jsx("select",{style:ue,value:t.verticalAlign,onChange:i=>n({...t,verticalAlign:i.target.value}),children:Ql.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Horizontal Align"}),e.jsx("select",{style:ue,value:t.horizontalAlign,onChange:i=>n({...t,horizontalAlign:i.target.value}),children:ei.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Offset X"}),e.jsx("input",{style:ue,type:"number",min:-1,max:1,step:.01,value:t.offsetX,onChange:i=>n({...t,offsetX:Number(i.target.value)})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Offset Y"}),e.jsx("input",{style:ue,type:"number",min:-1,max:1,step:.01,value:t.offsetY,onChange:i=>n({...t,offsetY:Number(i.target.value)})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Rotation"}),e.jsx("input",{style:ue,type:"number",min:-180,max:180,step:.1,value:t.rotation,onChange:i=>n({...t,rotation:Number(i.target.value)})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Alpha"}),e.jsx("input",{style:ue,type:"number",min:0,max:1,step:.01,value:t.alpha,onChange:i=>n({...t,alpha:Number(i.target.value)})})]}),e.jsx("label",{style:we,children:e.jsxs("div",{style:ke,children:[e.jsx("span",{style:P,children:"Smooth Following"}),e.jsx("input",{type:"checkbox",style:ve,checked:t.smoothFollowing,onChange:i=>n({...t,smoothFollowing:i.target.checked})})]})}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:P,children:"Smoothing"}),e.jsx("input",{style:ue,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>n({...t,smoothing:Number(i.target.value)})})]})]})),h("visibility","Visibility",e.jsx(kt,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:we,children:e.jsxs("div",{style:ke,children:[e.jsx("span",{style:P,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:ve,checked:t.enabled,onChange:i=>n({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:ke,children:[e.jsx("span",{style:P,children:"Show Attach Image"}),e.jsx("input",{type:"checkbox",style:ve,checked:t.attachImageEnabled,onChange:i=>n({...t,attachImageEnabled:i.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:ke,children:[e.jsx("span",{style:P,children:"Show Bounding Box"}),e.jsx("input",{type:"checkbox",style:ve,checked:t.showBoundingBox,onChange:i=>n({...t,showBoundingBox:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>s(!0),style:ni,children:e.jsx(hi,{})})]}),document.body)},bi={enabled:!0,bothHands:!0,countEnabled:!0,minCountConfidence:.35,showBones:!0,showJoints:!0,showBoundingBox:!0,showLabels:!1,visualScale:1,opacity:.9,jointRadius:3,lineWidth:1.5,labelScale:1,smoothing:.35},fi={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},kn={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},ji={...kn,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},mi={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Si={display:"grid",gap:6,padding:7},wi={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},ki={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},vi={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Ci={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Ri=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Ei={display:"grid",gap:7,padding:"0 7px 7px"},qt={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},be={display:"flex",flexDirection:"column",gap:4},Ce={...be,gridColumn:"1 / -1"},V={fontSize:9,color:"rgba(226,232,240,0.72)"},Re={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ee={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ie={width:16,height:16},Jt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Ii=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),zi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Ti=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),vt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 5a3 3 0 1 1-3-3 3 3 0 0 1 3 3zm11 11a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 7.1l9.8 9.8 1.4-1.4-9.8-9.8-1.4 1.4zM19 2a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 16.9l9.8-9.8-1.4-1.4-9.8 9.8 1.4 1.4zM5 16a3 3 0 1 0 3 3 3 3 0 0 0-3-3z"})}),Mi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),Wi=({value:t,onChange:n})=>{const[l,s]=u.useState(!0),[a,d]=u.useState({x:320,y:104}),[o,r]=u.useState(typeof window>"u"?0:window.innerHeight),[y,p]=u.useState({joints:!0,visibility:!0}),x=u.useRef(null),c=Math.max(240,o-a.y-16);u.useEffect(()=>{const i=j=>{x.current&&d({x:Math.max(8,j.clientX-x.current.x),y:Math.max(8,j.clientY-x.current.y)})},b=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",b)}},[]),u.useEffect(()=>{const i=()=>r(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const g=i=>{const b=i.currentTarget.getBoundingClientRect();x.current={x:i.clientX-b.left,y:i.clientY-b.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},h=(i,b,j,k)=>e.jsxs("div",{style:wi,children:[e.jsxs("div",{style:ki,children:[e.jsx("button",{type:"button",onClick:()=>p(C=>({...C,[i]:!C[i]})),style:Ci,children:e.jsx("div",{style:Ri(y[i])})}),e.jsxs("div",{style:vi,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:b})]})]}),y[i]?e.jsx("div",{style:Ei,children:k}):null]},i);return typeof document>"u"?null:pe.createPortal(e.jsx("div",{style:{...fi,left:a.x,top:a.y},children:l?e.jsxs("div",{style:{...kn,height:c},children:[e.jsxs("div",{style:mi,children:[e.jsx("div",{onPointerDown:g,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Ti,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(vt,{})}),e.jsx("span",{children:"HandJoints2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>n(bi),style:Jt,children:e.jsx(Mi,{})}),e.jsx("button",{type:"button",onClick:()=>s(!1),style:Jt,children:e.jsx(zi,{})})]}),e.jsxs("div",{style:Si,children:[h("joints","Joints",e.jsx(vt,{}),e.jsxs("div",{style:qt,children:[e.jsxs("label",{style:be,children:[e.jsx("span",{style:V,children:"Visual Scale"}),e.jsx("input",{style:Re,type:"number",min:.25,max:2,step:.01,value:t.visualScale,onChange:i=>n({...t,visualScale:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:V,children:"Opacity"}),e.jsx("input",{style:Re,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>n({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:V,children:"Joint Radius"}),e.jsx("input",{style:Re,type:"number",min:.5,max:24,step:.5,value:t.jointRadius,onChange:i=>n({...t,jointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:V,children:"Line Width"}),e.jsx("input",{style:Re,type:"number",min:.01,max:100,step:.1,value:t.lineWidth,onChange:i=>n({...t,lineWidth:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:V,children:"Label Size"}),e.jsx("input",{style:Re,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:i=>n({...t,labelScale:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:V,children:"Smoothing"}),e.jsx("input",{style:Re,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>n({...t,smoothing:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:V,children:"Min Count Confidence"}),e.jsx("input",{style:Re,type:"number",min:0,max:1,step:.01,value:t.minCountConfidence,onChange:i=>n({...t,minCountConfidence:Number(i.target.value)})})]})]})),h("visibility","Visibility",e.jsx(vt,{}),e.jsxs("div",{style:qt,children:[e.jsx("label",{style:Ce,children:e.jsxs("div",{style:Ee,children:[e.jsx("span",{style:V,children:"Show Joints"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.enabled,onChange:i=>n({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:Ee,children:[e.jsx("span",{style:V,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.bothHands,onChange:i=>n({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:Ee,children:[e.jsx("span",{style:V,children:"Count Fingers"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.countEnabled,onChange:i=>n({...t,countEnabled:i.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:Ee,children:[e.jsx("span",{style:V,children:"Joint Dots"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.showJoints,onChange:i=>n({...t,showJoints:i.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:Ee,children:[e.jsx("span",{style:V,children:"Bone Lines"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.showBones,onChange:i=>n({...t,showBones:i.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:Ee,children:[e.jsx("span",{style:V,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.showBoundingBox,onChange:i=>n({...t,showBoundingBox:i.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:Ee,children:[e.jsx("span",{style:V,children:"Labels"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.showLabels,onChange:i=>n({...t,showLabels:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>s(!0),style:ji,children:e.jsx(Ii,{})})}),document.body)},Fi={enabled:!0,bothHands:!0,space:"scene",showJoints:!0,showBones:!0,showLabels:!1,handScale:1,depthScale:1,trackingDistanceM:.6096,projectionDistanceM:2,fitX:1,fitY:.9,offsetX:0,offsetY:0,offsetZ:0,jointRadius:.012,boneRadius:.012,opacity:.88,smoothing:.35},Li={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},vn={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Ni={...vn,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Oi={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},$i={display:"grid",gap:6,padding:7},Ai={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Di={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Bi={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Pi={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Vi=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Hi={display:"grid",gap:7,padding:"0 7px 7px"},Ct={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},K={display:"flex",flexDirection:"column",gap:4},Ne={...K,gridColumn:"1 / -1"},D={fontSize:9,color:"rgba(226,232,240,0.72)"},H={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Xe={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ze={width:16,height:16},Qt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Ki=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),_i=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Gi=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),dt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),Ui=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),Xi=({value:t,onChange:n})=>{const[l,s]=u.useState(!0),[a,d]=u.useState({x:320,y:104}),[o,r]=u.useState(typeof window>"u"?0:window.innerHeight),[y,p]=u.useState({visual:!0,calibration:!0,visibility:!0}),x=u.useRef(null),c=Math.max(240,o-a.y-16);u.useEffect(()=>{const i=j=>{x.current&&d({x:Math.max(8,j.clientX-x.current.x),y:Math.max(8,j.clientY-x.current.y)})},b=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",b)}},[]),u.useEffect(()=>{const i=()=>r(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const g=i=>{const b=i.currentTarget.getBoundingClientRect();x.current={x:i.clientX-b.left,y:i.clientY-b.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},h=(i,b,j,k)=>e.jsxs("div",{style:Ai,children:[e.jsxs("div",{style:Di,children:[e.jsx("button",{type:"button",onClick:()=>p(C=>({...C,[i]:!C[i]})),style:Pi,children:e.jsx("div",{style:Vi(y[i])})}),e.jsxs("div",{style:Bi,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:b})]})]}),y[i]?e.jsx("div",{style:Hi,children:k}):null]},i);return typeof document>"u"?null:pe.createPortal(e.jsx("div",{style:{...Li,left:a.x,top:a.y},children:l?e.jsxs("div",{style:{...vn,height:c},children:[e.jsxs("div",{style:Oi,children:[e.jsx("div",{onPointerDown:g,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Gi,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(dt,{})}),e.jsx("span",{children:"HandTracking3D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>n(Fi),style:Qt,children:e.jsx(Ui,{})}),e.jsx("button",{type:"button",onClick:()=>s(!1),style:Qt,children:e.jsx(_i,{})})]}),e.jsxs("div",{style:$i,children:[h("visual","Visual",e.jsx(dt,{}),e.jsxs("div",{style:Ct,children:[e.jsxs("label",{style:Ne,children:[e.jsx("span",{style:D,children:"Space"}),e.jsxs("select",{style:H,value:t.space,onChange:i=>n({...t,space:i.target.value}),children:[e.jsx("option",{value:"scene",children:"Scene"}),e.jsx("option",{value:"screen",children:"Screen Fit"})]})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Joint Size"}),e.jsx("input",{style:H,type:"number",min:5e-4,max:.08,step:5e-4,value:t.jointRadius,onChange:i=>n({...t,jointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Bone Radius"}),e.jsx("input",{style:H,type:"number",min:.001,max:.12,step:.001,value:t.boneRadius,onChange:i=>n({...t,boneRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Opacity"}),e.jsx("input",{style:H,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>n({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Smoothing"}),e.jsx("input",{style:H,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>n({...t,smoothing:Number(i.target.value)})})]})]})),h("calibration","Calibration",e.jsx(dt,{}),e.jsxs("div",{style:Ct,children:[e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Hand Distance Ref (m)"}),e.jsx("input",{style:H,type:"number",min:.05,max:5,step:.01,value:t.trackingDistanceM,onChange:i=>n({...t,trackingDistanceM:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Projection Distance"}),e.jsx("input",{style:H,type:"number",min:.05,max:10,step:.01,value:t.projectionDistanceM,onChange:i=>n({...t,projectionDistanceM:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Hand Scale"}),e.jsx("input",{style:H,type:"number",min:.1,max:8,step:.01,value:t.handScale,onChange:i=>n({...t,handScale:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Fit X"}),e.jsx("input",{style:H,type:"number",min:.1,max:4,step:.01,value:t.fitX,onChange:i=>n({...t,fitX:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Fit Y"}),e.jsx("input",{style:H,type:"number",min:.1,max:4,step:.01,value:t.fitY,onChange:i=>n({...t,fitY:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Offset X"}),e.jsx("input",{style:H,type:"number",min:-5,max:5,step:.01,value:t.offsetX,onChange:i=>n({...t,offsetX:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Offset Y"}),e.jsx("input",{style:H,type:"number",min:-5,max:5,step:.01,value:t.offsetY,onChange:i=>n({...t,offsetY:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Offset Z"}),e.jsx("input",{style:H,type:"number",min:-5,max:5,step:.01,value:t.offsetZ,onChange:i=>n({...t,offsetZ:Number(i.target.value)})})]}),e.jsxs("label",{style:K,children:[e.jsx("span",{style:D,children:"Depth Scale"}),e.jsx("input",{style:H,type:"number",min:0,max:10,step:.1,value:t.depthScale,onChange:i=>n({...t,depthScale:Number(i.target.value)})})]})]})),h("visibility","Visibility",e.jsx(dt,{}),e.jsxs("div",{style:Ct,children:[e.jsx("label",{style:Ne,children:e.jsxs("div",{style:Xe,children:[e.jsx("span",{style:D,children:"Show 3D Hand"}),e.jsx("input",{type:"checkbox",style:Ze,checked:t.enabled,onChange:i=>n({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:Ne,children:e.jsxs("div",{style:Xe,children:[e.jsx("span",{style:D,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:Ze,checked:t.bothHands,onChange:i=>n({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:Ne,children:e.jsxs("div",{style:Xe,children:[e.jsx("span",{style:D,children:"Joint Spheres"}),e.jsx("input",{type:"checkbox",style:Ze,checked:t.showJoints,onChange:i=>n({...t,showJoints:i.target.checked})})]})}),e.jsx("label",{style:Ne,children:e.jsxs("div",{style:Xe,children:[e.jsx("span",{style:D,children:"Bone Cylinders"}),e.jsx("input",{type:"checkbox",style:Ze,checked:t.showBones,onChange:i=>n({...t,showBones:i.target.checked})})]})}),e.jsx("label",{style:Ne,children:e.jsxs("div",{style:Xe,children:[e.jsx("span",{style:D,children:"Labels"}),e.jsx("input",{type:"checkbox",style:Ze,checked:t.showLabels,onChange:i=>n({...t,showLabels:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>s(!0),style:Ni,children:e.jsx(Ki,{})})}),document.body)},Zi=1e3;function Yi(t,n=Zi){return t.map((l,s)=>({...l,renderOrder:n+(t.length-s)}))}function qi(t,n,l){const s=t.findIndex(r=>r.id===n),a=t.findIndex(r=>r.id===l);if(s<0||a<0||s===a)return t;const d=[...t],[o]=d.splice(s,1);return d.splice(a,0,o),Yi(d)}const Ji={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},en={pointerEvents:"auto",width:284,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Tt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Qi={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},eo={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},to={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},no={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},so={display:"grid",gap:6,padding:7},lo=t=>({display:"grid",gridTemplateColumns:"20px 20px 20px minmax(0, 1fr)",alignItems:"center",gap:6,minHeight:34,padding:"6px 7px",borderRadius:10,border:t?"1px solid rgba(56,189,248,0.5)":"1px solid rgba(255,255,255,0.08)",background:t?"rgba(56,189,248,0.10)":"rgba(255,255,255,0.03)",cursor:"pointer",opacity:1}),io={display:"flex",flexDirection:"column",gap:2,minWidth:0},oo={fontSize:10,fontWeight:600,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},ro={fontSize:9,color:"rgba(226,232,240,0.6)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Rt={...Tt,width:20,height:20,borderRadius:7,fontSize:11,lineHeight:1},ao=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M2 2l20 20-1.4 1.4-3.2-3.2C15.9 21 14.1 21.5 12 21.5 6.5 21.5 2 16 1 12c.4-1.8 1.1-3.4 2.2-4.8L.6 4.6 2 2zm10 4c3.9 0 7.4 2.8 9.2 6-1 1.8-2.6 3.5-4.4 4.6l-2-2c.1-.3.2-.7.2-1.1a3 3 0 0 0-3-3c-.4 0-.8.1-1.1.2l-1.9-1.9C10.2 6.8 11.1 6 12 6z"}):e.jsx("path",{d:"M12 5c5.5 0 10 5 11 7-.9 2-5.5 7-11 7S2 14 1 12c1-2 5.5-7 11-7zm0 3.2A3.8 3.8 0 1 0 12 16.8 3.8 3.8 0 0 0 12 8.2z"})}),co=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M18 8h-1V6a5 5 0 0 0-9.1-2.9l1.5 1.5A3 3 0 0 1 16 6v2H8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h9.2l1.8 1.8 1.4-1.4L2.6 3.4 1.2 4.8 5 8.6V20h14a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2z"}):e.jsx("path",{d:"M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1zm2 0h6V8a3 3 0 0 0-6 0v2z"})}),po=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),tn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3 1 9l11 6 11-6-11-6zm0 8L1 5v4l11 6 11-6V5l-11 6zm0 6L1 11v4l11 6 11-6v-4l-11 6z"})}),ho=({layers:t,selectedLayerId:n,onSelectLayer:l,onToggleVisible:s,onToggleEnabled:a,onReorder:d,onToggleLocked:o,initialPosition:r,title:y="Layers"})=>{const[p,x]=u.useState(!0),[c,g]=u.useState(r??{x:644,y:104}),[h,i]=u.useState(typeof window>"u"?0:window.innerHeight),b=u.useRef(null),[j,k]=u.useState(null),C=Math.max(240,h-c.y-16);if(u.useEffect(()=>{const w=T=>{b.current&&g({x:Math.max(8,T.clientX-b.current.x),y:Math.max(8,T.clientY-b.current.y)})},O=()=>{b.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",w),window.addEventListener("pointerup",O),()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",O)}},[]),u.useEffect(()=>{const w=()=>i(window.innerHeight);return window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]),typeof document>"u")return null;const L=w=>{const O=w.currentTarget.getBoundingClientRect();b.current={x:w.clientX-O.left,y:w.clientY-O.top},document.body.classList.add("select-none"),w.currentTarget.setPointerCapture(w.pointerId)},S=w=>{if(!j||j===w){k(null);return}const O=t.findIndex(B=>B.id===j),T=t.findIndex(B=>B.id===w);if(O<0||T<0){k(null);return}d(qi(t,j,w)),k(null)};return pe.createPortal(e.jsx("div",{style:{...Ji,left:c.x,top:c.y},children:p?e.jsxs("div",{style:{...en,height:C},children:[e.jsxs("div",{style:Qi,children:[e.jsx("div",{onPointerDown:L,style:eo,children:e.jsx(po,{})}),e.jsxs("div",{style:to,children:[e.jsx("span",{style:no,children:e.jsx(tn,{})}),e.jsx("span",{children:y})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>x(!1),style:Tt,children:"−"})]}),e.jsx("div",{style:so,children:t.map((w,O)=>e.jsxs("div",{style:lo(n===w.id),draggable:!0,onDragStart:()=>k(w.id),onDragOver:T=>T.preventDefault(),onDrop:()=>S(w.id),onClick:()=>l(w.id),title:w.label,children:[e.jsx("button",{type:"button",style:Rt,onClick:T=>{T.stopPropagation(),s(w.id,!w.visible)},children:e.jsx(ao,{off:!w.visible})}),e.jsx("button",{type:"button",style:Rt,onClick:T=>{T.stopPropagation(),a(w.id,!w.enabled)},children:w.enabled?"●":"○"}),e.jsx("button",{type:"button",style:Rt,onClick:T=>{T.stopPropagation(),o==null||o(w.id,!w.locked)},children:e.jsx(co,{off:!w.locked})}),e.jsxs("div",{style:io,children:[e.jsx("div",{style:oo,children:w.label}),e.jsxs("div",{style:ro,children:[w.domain," / ",w.type," • #",t.length-O]})]})]},w.id))})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>x(!0),style:{...en,...Tt,width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(tn,{})})}),document.body)},xo={position:"fixed",zIndex:2e4,pointerEvents:"none"},nn={pointerEvents:"auto",width:300,borderRadius:16,border:"1px solid rgba(255,255,255,.12)",background:"rgba(8,15,28,.78)",boxShadow:"0 16px 36px rgba(0,0,0,.28)",backdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"auto"},Ye={display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,padding:0,borderRadius:7,border:"1px solid rgba(255,255,255,.1)",background:"rgba(255,255,255,.05)",color:"#e2e8f0",cursor:"pointer"},sn=t=>{try{return JSON.parse(t.dataTransfer.getData("application/x-xr-hierarchy"))}catch{return null}},yo=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)},Cn=({groups:t,objects:n,selectedObjectId:l,onSelectObject:s,onReorderGroup:a,onReorderObject:d,onMoveObject:o,onSetObjectParent:r,onToggleGroupEnabled:y,onToggleObjectVisible:p,copyConfig:x,initialPosition:c={x:10,y:30},title:g="Hierarchy"})=>{const[h,i]=u.useState(!0),[b,j]=u.useState(c),[k,C]=u.useState(new Set),[L,S]=u.useState(new Set),[w,O]=u.useState(!1),[T,B]=u.useState(null),_=u.useRef(null),he=t.filter(f=>f.objectIds.some(v=>!!n[v]));if(u.useEffect(()=>{const f=A=>{_.current&&j({x:Math.max(8,A.clientX-_.current.x),y:Math.max(8,A.clientY-_.current.y)})},v=()=>{_.current=null};return window.addEventListener("pointermove",f),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",v)}},[]),typeof document>"u")return null;const te=(f,v)=>{f.stopPropagation(),f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("application/x-xr-hierarchy",JSON.stringify(v)),B(null)},xe=(f,v,A)=>{var E;f.preventDefault(),f.stopPropagation();const z=sn(f);if(z){if(z.kind==="group"){a(z.groupId,A);return}if(!(r!=null&&r(z.objectId,null,v.objectIds.length,v.id))){if(z.groupId===v.id){d(v.id,z.objectId,v.objectIds.length-1);return}o(z.objectId,v.id,v.objectIds.length)||B(`${((E=n[z.objectId])==null?void 0:E.name)??"Object"} is not compatible with ${v.name}.`)}}},M=(f,v,A,z)=>{var Pe;f.preventDefault(),f.stopPropagation();const E=sn(f);if(!(!E||E.kind!=="object")&&E.objectId!==A){if(r!=null&&r(E.objectId,A,I(A).length,v.id)){S(Fe=>{const Ve=new Set(Fe);return Ve.delete(A),Ve});return}E.groupId===v.id?d(v.id,E.objectId,z):o(E.objectId,v.id,z)||B(`${((Pe=n[E.objectId])==null?void 0:Pe.name)??"Object"} is not compatible with ${v.name}.`)}},I=f=>{const v=n[f],A=(v==null?void 0:v.childObjectIds)??[],z=Object.values(n).filter(E=>E.parentObjectId===f).map(E=>E.id);return[...new Set([...A,...z])].filter(E=>!!n[E])},ye=(f,v,A,z)=>{const E=n[f];if(!E)return null;const Pe=l===f,Fe=I(f),Ve=L.has(f);return e.jsxs("div",{style:{display:"grid",gap:4},children:[e.jsxs("div",{draggable:!0,onDragStart:J=>te(J,{kind:"object",groupId:v.id,objectId:f}),onDragOver:J=>J.preventDefault(),onDrop:J=>M(J,v,f,A),onClick:()=>s(f),style:{display:"grid",gridTemplateColumns:`${Fe.length?22:0}px ${p?"22px ":""}minmax(0,1fr)`,alignItems:"center",gap:Fe.length||p?6:0,minHeight:30,padding:`4px 7px 4px ${Math.max(10,24+z*16)}px`,border:Pe?"1px solid rgba(56,189,248,.55)":"1px solid transparent",borderRadius:8,background:Pe?"rgba(56,189,248,.12)":"rgba(255,255,255,.025)",cursor:"grab",opacity:E.enabled?1:.5},children:[Fe.length?e.jsx("button",{type:"button",style:Ye,onClick:J=>{J.stopPropagation(),S(gt=>{const at=new Set(gt);return at.has(f)?at.delete(f):at.add(f),at})},children:Ve?"▸":"▾"}):e.jsx("span",{}),p?e.jsx("button",{type:"button",style:Ye,onClick:J=>{J.stopPropagation(),p(f,!E.enabled)},children:E.enabled?"●":"○"}):null,e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",fontSize:10},children:E.name})]}),Ve?null:Fe.map((J,gt)=>ye(J,v,gt,z+1))]},f)},N=async()=>{if(x!==void 0)try{await yo(JSON.stringify(x,null,2)),O(!0),window.setTimeout(()=>O(!1),1400)}catch{B("Unable to copy the scene configuration.")}};return pe.createPortal(e.jsx("div",{style:{...xo,left:b.x,top:b.y},children:h?e.jsxs("section",{style:{...nn,maxHeight:`calc(100vh - ${b.y+16}px)`},children:[e.jsx("header",{onPointerDown:f=>{const v=f.currentTarget.getBoundingClientRect();_.current={x:f.clientX-v.left,y:f.clientY-v.top}},style:{position:"sticky",top:0,zIndex:2,padding:"10px 12px",borderBottom:"1px solid rgba(255,255,255,.08)",background:"rgba(8,15,28,.94)",cursor:"grab"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},children:[e.jsx("strong",{children:g}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button","aria-label":`Fold ${g}`,"aria-expanded":"true",onPointerDown:f=>f.stopPropagation(),onClick:()=>i(!1),style:Ye,children:"−"})]})}),e.jsxs("div",{style:{display:"grid",gap:7,padding:7},children:[x!==void 0&&e.jsx("button",{type:"button",onClick:N,style:{width:"100%",height:28,borderRadius:8,border:"1px solid rgba(56,189,248,.28)",background:"rgba(56,189,248,.14)",color:"#e0f2fe",cursor:"pointer",fontSize:10,fontWeight:700},children:w?"Copied Config":"Copy Config"}),he.map(f=>{const v=t.findIndex(z=>z.id===f.id),A=k.has(f.id);return e.jsxs("section",{onDragOver:z=>z.preventDefault(),onDrop:z=>xe(z,f,v),style:{border:"1px solid rgba(255,255,255,.1)",borderRadius:10,overflow:"hidden",opacity:f.enabled?1:.55},children:[e.jsxs("div",{draggable:!0,onDragStart:z=>te(z,{kind:"group",groupId:f.id}),style:{display:"grid",gridTemplateColumns:"22px 22px minmax(0,1fr)",gap:5,alignItems:"center",padding:"6px",background:"rgba(255,255,255,.06)",cursor:"grab"},children:[e.jsx("button",{type:"button",style:Ye,onClick:()=>C(z=>{const E=new Set(z);return E.has(f.id)?E.delete(f.id):E.add(f.id),E}),children:A?"▸":"▾"}),e.jsx("button",{type:"button",style:Ye,title:"Toggle group visibility",onClick:()=>y(f.id,!f.enabled),children:f.enabled?"◉":"○"}),e.jsx("div",{style:{minWidth:0},children:e.jsx("div",{style:{fontSize:10,fontWeight:700},children:f.name})})]}),!A&&e.jsx("div",{style:{display:"grid",gap:4,padding:f.objectIds.length?5:0},children:f.objectIds.filter(z=>{var E;return!((E=n[z])!=null&&E.parentObjectId)}).map((z,E)=>ye(z,f,E,0))})]},f.id)}),T&&e.jsx("div",{role:"alert",style:{color:"#fca5a5",fontSize:9,padding:"2px 5px 5px"},children:T})]})]}):e.jsx("button",{type:"button","aria-expanded":"false",onClick:()=>i(!0),style:{...nn,width:"auto",padding:"9px 12px",cursor:"pointer",fontSize:11,fontWeight:700},children:g})}),document.body)},ct={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},uo=t=>({display:"grid",gridTemplateColumns:`92px repeat(${t}, minmax(0, 1fr))`,alignItems:"center",gap:6,margin:"8px 0"}),go={fontSize:12,color:"#cbd5e1"},Et={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},bo={width:"100%",minWidth:0,height:24,boxSizing:"border-box",borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",padding:"0 7px",outline:0,color:"#f8fafc",fontSize:10.5,fontVariantNumeric:"tabular-nums"},fo=t=>/^-?\d*(\.\d*)?$/.test(t),pt=t=>Number.isFinite(t)?String(t):"0",jo=({onChange:t,value:n})=>{const[l,s]=u.useState(pt(n));return u.useEffect(()=>{s(pt(n))},[n]),e.jsx("input",{style:bo,type:"text",inputMode:"decimal",value:l,placeholder:"0",onBlur:()=>{if(l.trim()===""){s(pt(n));return}const a=Number(l);if(Number.isNaN(a)){s(pt(n));return}t(a)},onChange:a=>{const d=a.currentTarget.value;if(!fo(d)||(s(d),d===""||d==="-"||d==="."||d==="-."))return;const o=Number(d);Number.isNaN(o)||t(o)},onKeyDown:a=>{if(a.key!=="ArrowUp"&&a.key!=="ArrowDown")return;a.preventDefault();const d=a.shiftKey?1:a.altKey?.01:.1,o=a.key==="ArrowUp"?n+d:n-d;t(Number(o.toFixed(6)))}})},It=({axes:t=["x","y","z"],label:n,onChange:l,value:s})=>e.jsxs("div",{style:uo(t.length),children:[e.jsx("div",{style:go,children:n}),t.map(a=>e.jsx(jo,{value:s[a],onChange:d=>l({...s,[a]:d})},a))]}),Rn=({value:t,onChange:n,targets:l=[]})=>e.jsxs("section",{style:{padding:10,borderRadius:10,background:"rgba(255,255,255,.04)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontWeight:700,color:"#f8fafc"},children:[e.jsx("span",{children:"Pin to Mesh"}),e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:s=>n({...t,enabled:s.target.checked})})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{children:"Target"}),e.jsxs("select",{style:Et,value:t.targetObjectId??"",onChange:s=>n({...t,targetObjectId:s.target.value||null}),children:[e.jsx("option",{value:"",children:"None (Transform)"}),l.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{children:"Orientation"}),e.jsxs("select",{style:Et,value:t.orientation,onChange:s=>n({...t,orientation:s.target.value}),children:[e.jsx("option",{value:"none",children:"None"}),e.jsx("option",{value:"position",children:"Position"}),e.jsx("option",{value:"positionAndDirection",children:"Position and Direction"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{children:"Offset Space"}),e.jsxs("select",{style:Et,value:t.offsetSpace,onChange:s=>n({...t,offsetSpace:s.target.value}),children:[e.jsx("option",{value:"local",children:"Local"}),e.jsx("option",{value:"world",children:"World"})]})]}),e.jsx(It,{axes:["x","y"],label:"UV",value:{x:t.uv.x,y:t.uv.y,z:0},onChange:s=>n({...t,uv:{x:s.x,y:s.y}})}),e.jsxs("label",{style:ct,children:[e.jsx("span",{children:"Vertex Normal"}),e.jsx("input",{type:"checkbox",checked:t.vertexNormal,onChange:s=>n({...t,vertexNormal:s.target.checked})})]}),e.jsx(It,{label:"Offset Position",value:t.offsetPosition,onChange:s=>n({...t,offsetPosition:s})}),e.jsx(It,{label:"Offset Rotation",value:t.offsetRotation,onChange:s=>n({...t,offsetRotation:s})})]}),mo={position:"fixed",zIndex:2e4,pointerEvents:"none"},So={pointerEvents:"auto",width:284,maxHeight:"min(620px, calc(100vh - 32px))",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.62)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden",fontFamily:"Inter, ui-sans-serif, system-ui, sans-serif"},wo={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},ko={display:"flex",alignItems:"center",gap:6,minWidth:0,fontSize:11,fontWeight:700},vo={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Co={display:"grid",gap:8,padding:10,maxHeight:"min(548px, calc(100vh - 104px))",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},qe={display:"grid",gap:4,fontSize:10,color:"rgba(226,232,240,0.78)"},ht={width:"100%",minWidth:0,height:28,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.8)",color:"#f8fafc",padding:"0 8px",boxSizing:"border-box"},Ro={height:24,borderRadius:8,border:"1px solid rgba(56,189,248,0.25)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",cursor:"pointer",fontSize:10,fontWeight:700,padding:"0 8px"},Eo={display:"grid",gridTemplateColumns:"1fr 74px",alignItems:"center",gap:8},Io=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),zo=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2.1-1.6-2-3.5-2.5 1a8 8 0 0 0-2.6-1.5L14 2h-4l-.4 2.9A8 8 0 0 0 7 6.4l-2.5-1-2 3.5 2.1 1.6A10 10 0 0 0 4.5 12c0 .5 0 1 .1 1.5l-2.1 1.6 2 3.5 2.5-1a8 8 0 0 0 2.6 1.5L10 22h4l.4-2.9a8 8 0 0 0 2.6-1.5l2.5 1 2-3.5-2.1-1.6zM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5z"})}),To=(t,n)=>{const l=t.find(s=>String(s.value)===n);return(l==null?void 0:l.value)??n};function En({title:t,value:n,fields:l,onChange:s,copyLabel:a,copyPayload:d,initialPosition:o}){const[r,y]=u.useState(o??{x:14,y:452}),p=u.useRef(null);u.useEffect(()=>{const h=b=>{p.current&&y({x:Math.max(8,b.clientX-p.current.x),y:Math.max(8,b.clientY-p.current.y)})},i=()=>{p.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",h),window.addEventListener("pointerup",i),()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",i)}},[]);const x=(h,i)=>{s({...n,[h]:i})},c=async()=>{var i;const h=(d==null?void 0:d(n))??{name:a??t,kind:"settings",settings:n};await((i=navigator.clipboard)==null?void 0:i.writeText(JSON.stringify(h,null,2)))},g=h=>{var b;const i=(b=h.currentTarget.parentElement)==null?void 0:b.parentElement;i&&(p.current={x:h.clientX-i.getBoundingClientRect().left,y:h.clientY-i.getBoundingClientRect().top},document.body.classList.add("select-none"))};return e.jsx("div",{style:{...mo,left:r.x,top:r.y},children:e.jsxs("div",{style:So,children:[e.jsxs("div",{style:wo,children:[e.jsxs("div",{style:ko,children:[e.jsx("span",{style:vo,onPointerDown:g,children:e.jsx(Io,{})}),e.jsx(zo,{}),e.jsx("span",{children:t})]}),e.jsx("button",{style:Ro,type:"button",onClick:c,children:"Copy"})]}),e.jsx("div",{style:Co,children:l.map(h=>{const i=n[h.key];if(h.type==="boolean")return e.jsxs("label",{style:qe,children:[e.jsx("span",{children:h.label}),e.jsx("input",{type:"checkbox",checked:!!i,onChange:b=>x(h.key,b.target.checked)})]},h.key);if(h.type==="number"){const b=Number(i),j=h.min??0,k=h.max??1,C=h.step??.01;return e.jsxs("label",{style:qe,children:[e.jsx("span",{children:h.label}),e.jsxs("div",{style:Eo,children:[e.jsx("input",{type:"range",min:j,max:k,step:C,value:b,onChange:L=>x(h.key,Number(L.target.value))}),e.jsx("input",{style:ht,type:"number",min:j,max:k,step:C,value:b,onChange:L=>x(h.key,Number(L.target.value))})]})]},h.key)}return h.type==="color"?e.jsxs("label",{style:qe,children:[e.jsx("span",{children:h.label}),e.jsx("input",{style:{...ht,padding:2},type:"color",value:String(i),onChange:b=>x(h.key,b.target.value)})]},h.key):h.type==="select"?e.jsxs("label",{style:qe,children:[e.jsx("span",{children:h.label}),e.jsx("select",{style:ht,value:String(i),onChange:b=>x(h.key,To(h.options,b.target.value)),children:h.options.map(b=>e.jsx("option",{value:String(b.value),children:b.label},`${h.key}-${String(b.value)}`))})]},h.key):e.jsxs("label",{style:qe,children:[e.jsx("span",{children:h.label}),e.jsx("input",{style:ht,type:"text",value:String(i),onChange:b=>x(h.key,b.target.value)})]},h.key)})})]})})}var Mt,xt=pe;if(process.env.NODE_ENV==="production")Mt=xt.createRoot,xt.hydrateRoot;else{var ln=xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Mt=function(t,n){ln.usingClientEntryPoint=!0;try{return xt.createRoot(t,n)}finally{ln.usingClientEntryPoint=!1}}}const on=[{title:"Head and Face",controls:[{key:"strength",label:"Overall Strength",min:0},{key:"faceWidth",label:"Face Width"},{key:"faceHeight",label:"Face Height"},{key:"faceRoundness",label:"Face Roundness"},{key:"midfaceHeight",label:"Midface Height"},{key:"foreheadHeight",label:"Forehead Height"},{key:"foreheadWidth",label:"Forehead Width"},{key:"cheekboneWidth",label:"Cheekbone Width"},{key:"cheekWidth",label:"Cheek Width"},{key:"cheekHollowness",label:"Cheek Hollowness"},{key:"midfaceDepth",label:"Midface Depth"},{key:"scalpHeight",label:"Scalp Height"},{key:"headCurve",label:"Head Curve"},{key:"faceTwist",label:"Face Twist"},{key:"faceSwirl",label:"Face Swirl"}]},{title:"Eyebrows",controls:[{key:"browDistance",label:"Brow Distance"},{key:"browHeight",label:"Brow Height"},{key:"browDepth",label:"Brow Depth"}]},{title:"Eyes",controls:[{key:"leftEyeSize",label:"Left Eye Size"},{key:"rightEyeSize",label:"Right Eye Size"},{key:"eyeDistance",label:"Eye Distance"},{key:"leftEyeX",label:"Left Eye X Offset"},{key:"rightEyeX",label:"Right Eye X Offset"},{key:"leftEyeY",label:"Left Eye Y Offset"},{key:"rightEyeY",label:"Right Eye Y Offset"}]},{title:"Nose, Mouth and Jaw",controls:[{key:"noseSize",label:"Nose Size"},{key:"noseLength",label:"Nose Length"},{key:"mouthWidth",label:"Mouth Width"},{key:"mouthHeight",label:"Mouth Height"},{key:"jawWidth",label:"Jaw Width"},{key:"chinHeight",label:"Chin Height"}]}],rn={pointerEvents:"auto",width:300,maxHeight:"calc(100vh - 32px)",overflow:"auto",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8,15,28,0.72)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},an={width:26,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.06)",color:"#e2e8f0",cursor:"pointer"},Mo=({value:t,onChange:n})=>{const[l,s]=u.useState(!0),[a,d]=u.useState({x:16,y:96}),[o,r]=u.useState(Object.fromEntries(on.map(({title:g})=>[g,!0]))),y=u.useRef(null),p=u.useRef(null);u.useEffect(()=>{const g=i=>{y.current&&d({x:Math.max(8,i.clientX-y.current.x),y:Math.max(8,i.clientY-y.current.y)})},h=()=>{y.current=null};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",h),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",h)}},[]);const x=g=>{const h=g.currentTarget.getBoundingClientRect();y.current={x:g.clientX-h.left,y:g.clientY-h.top},g.currentTarget.setPointerCapture(g.pointerId)},c=e.jsx("div",{style:{position:"fixed",left:a.x,top:a.y,zIndex:2e4},children:l?e.jsxs("div",{style:rn,children:[e.jsxs("div",{onPointerDown:x,style:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:8,padding:8,background:"rgba(8,15,28,0.94)",borderBottom:"1px solid rgba(255,255,255,0.08)",cursor:"grab"},children:[e.jsx("span",{style:{fontSize:11,fontWeight:650,flex:1},children:"3D Face Warp"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:5,fontSize:9},children:[e.jsx("span",{children:"Enabled"}),e.jsx("input",{type:"checkbox",checked:t.enabled,onPointerDown:g=>g.stopPropagation(),onChange:g=>n({...t,enabled:g.target.checked})})]}),e.jsx("button",{type:"button",style:an,title:"Reset",onPointerDown:g=>g.stopPropagation(),onClick:()=>n({...Z.DEFAULT_FACE_WARP_3D_SETTINGS,enabled:!0}),children:"↺"}),e.jsx("button",{type:"button",style:an,title:"Close",onPointerDown:g=>g.stopPropagation(),onClick:()=>s(!1),children:"×"})]}),e.jsx("div",{style:{display:"grid",gap:6,padding:7},children:on.map(({title:g,controls:h})=>e.jsxs("section",{style:{border:"1px solid rgba(255,255,255,0.08)",borderRadius:12,overflow:"hidden"},children:[e.jsxs("button",{type:"button",onClick:()=>r(i=>({...i,[g]:!i[g]})),style:{width:"100%",padding:"8px",border:0,background:"rgba(255,255,255,0.03)",color:"#e2e8f0",display:"flex",justifyContent:"space-between",cursor:"pointer",fontSize:10.5},children:[e.jsx("span",{children:g}),e.jsx("span",{children:o[g]?"−":"+"})]}),o[g]?e.jsx("div",{style:{display:"grid",gap:6,padding:8},children:h.map(({key:i,label:b,min:j=-100,max:k=100})=>{const C=Math.round(t[i]*100);return e.jsxs("label",{style:{display:"grid",gridTemplateColumns:"105px 32px 1fr",gap:7,alignItems:"center",fontSize:9},children:[e.jsx("span",{style:{color:"rgba(226,232,240,0.76)"},children:b}),e.jsx("output",{style:{textAlign:"right",fontVariantNumeric:"tabular-nums"},children:C}),e.jsx("input",{type:"range",min:j,max:k,value:C,onChange:L=>n({...t,[i]:Number(L.target.value)/100}),style:{width:"100%",accentColor:"#e2e8f0"}})]},i)})}):null]},g))})]}):e.jsx("button",{type:"button",style:{...rn,width:38,height:38,cursor:"pointer"},onClick:()=>s(!0),title:"Open 3D Face Warp settings",children:"3D"})});return u.useEffect(()=>{const g=document.createElement("div");return g.dataset.xrDebugUi="face-warp-3d",document.body.appendChild(g),p.current=Mt(g),()=>{var h;(h=p.current)==null||h.unmount(),p.current=null,g.remove()}},[]),u.useEffect(()=>{var g;(g=p.current)==null||g.render(c)},[c]),null},Wo=({title:t="Face Retouch",value:n,onChange:l,initialPosition:s})=>{const a=Z.resolveFaceRetouchControls(n);return e.jsx(En,{title:t,value:a,fields:Z.FACE_RETOUCH_SETTINGS_FIELDS,onChange:d=>l(Z.patchFaceRetouchControls(a,d)),initialPosition:s})},Fo={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Lo={pointerEvents:"auto",width:298,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},No={display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Oo={display:"grid",gap:8,padding:8},In={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:700},zn={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},$o={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Ao={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},Do={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},Bo={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},Po=t=>({...Bo,width:30,height:26,color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)"}),Vo={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},Ho={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Ko={display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:6},_o={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,marginBottom:7},Go={display:"grid",gridTemplateColumns:"62px repeat(3, minmax(0, 1fr)) 24px",alignItems:"center",gap:6,marginTop:6},Uo={fontSize:10,color:"rgba(226,232,240,0.82)"},Xo=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:22,borderRadius:7,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#e0f2fe":"rgba(226,232,240,0.75)",cursor:"pointer"}),dn={display:"flex",flexDirection:"column",gap:4,fontSize:9,color:"rgba(226,232,240,0.72)"},Zo={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box",fontVariantNumeric:"tabular-nums"},Yo={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,fontSize:9,color:"rgba(226,232,240,0.72)"},Tn={width:15,height:15,accentColor:"#38bdf8",cursor:"pointer"},cn=t=>({height:25,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#e0f2fe":"rgba(226,232,240,0.82)",fontSize:10,fontWeight:700,cursor:"pointer"}),qo=t=>/^-?\d*(\.\d*)?$/.test(t),Jo=({value:t,onChange:n,step:l=.1})=>{const[s,a]=u.useState(String(t));return u.useEffect(()=>a(String(t)),[t]),e.jsx("input",{type:"text",inputMode:"decimal",style:Zo,value:s,onChange:d=>{const o=d.target.value;if(!qo(o)||(a(o),o===""||o==="-"||o==="."||o==="-."))return;const r=Number(o);Number.isNaN(r)||n(r)},onBlur:()=>{const d=Number(s);if(Number.isNaN(d)){a(String(t));return}n(d)},onKeyDown:d=>{if(d.key!=="ArrowUp"&&d.key!=="ArrowDown")return;d.preventDefault();const o=d.shiftKey?l*10:d.altKey?l/10:l,r=d.key==="ArrowUp"?t+o:t-o;n(Number(r.toFixed(6)))}})},Mn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Qo=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 12a5 5 0 0 1 5-5h3v2h-3a3 3 0 0 0 0 6h3v2h-3a5 5 0 0 1-5-5zm4-1h2v2h-2v-2zm-2 6H6a5 5 0 0 1 0-10h3v2H6a3 3 0 0 0 0 6h3v2zm6-10h3a5 5 0 0 1 0 10h-3v-2h3a3 3 0 0 0 0-6h-3V7z"})}),er=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),tr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),nr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),sr=({value:t,onChange:n})=>{const l=t.transformControlMode??"translate",s=t.transformControlSpace??"local",a=t.showTransformControls??!1;return e.jsxs("div",{style:{marginTop:8},children:[e.jsxs("label",{style:Yo,children:[e.jsx("span",{children:"Show Transform On"}),e.jsx("input",{type:"checkbox",checked:a,style:Tn,onChange:d=>n({...t,showTransformControls:d.currentTarget.checked})})]}),e.jsxs("div",{style:{...dn,marginTop:8},children:["Mode",e.jsx("div",{style:Ko,children:["translate","rotate","scale"].map(d=>e.jsx("button",{type:"button",style:cn(l===d),onClick:()=>n({...t,transformControlMode:d}),children:d==="translate"?"Move":d==="rotate"?"Rotate":"Scale"},d))})]}),e.jsxs("div",{style:{...dn,marginTop:8},children:["Space",e.jsx("div",{style:Ho,children:["local","world"].map(d=>e.jsx("button",{type:"button",style:cn(s===d),onClick:()=>n({...t,transformControlSpace:d}),children:d==="local"?"Local":"World"},d))})]})]})},Nt=({value:t,onChange:n})=>{var d,o,r;const l={position:((d=t.linked)==null?void 0:d.position)??!1,rotation:((o=t.linked)==null?void 0:o.rotation)??!1,scale:((r=t.linked)==null?void 0:r.scale)??!1},s=(y,p)=>{const x=t[y];n({...t,linked:{...l,[y]:p},[y]:p?{x:x.x,y:x.x,z:x.x}:x})},a=(y,p,x,c)=>e.jsxs("div",{style:Go,children:[e.jsx("div",{style:Uo,children:p}),["x","y","z"].map(g=>e.jsx(Jo,{value:x[g],step:c,onChange:h=>l[y]?n({...t,[y]:{x:h,y:h,z:h}}):n({...t,[y]:{...x,[g]:h}})},g)),e.jsx("button",{type:"button","aria-label":l[y]?`Unlink ${p}`:`Link ${p}`,title:l[y]?`Unlink ${p}`:`Link ${p}`,style:Xo(l[y]),onClick:()=>s(y,!l[y]),children:e.jsx(Qo,{})})]});return e.jsxs("div",{style:Vo,children:[e.jsxs("div",{style:_o,children:[e.jsxs("div",{style:In,children:[e.jsx("span",{style:zn,children:e.jsx(Mn,{})}),e.jsx("span",{children:"Transform"})]}),e.jsx("input",{type:"checkbox",checked:t.enabled,style:Tn,onChange:y=>n({...t,enabled:y.currentTarget.checked})})]}),a("position","Position",t.position,.001),a("rotation","Rotation",t.rotation,1),a("scale","Scale",t.scale),e.jsx(sr,{value:t,onChange:n})]})},lr=({value:t,onChange:n,copyLabel:l="Selected transform"})=>{const[s,a]=u.useState({x:14,y:104}),[d,o]=u.useState(!1),r=u.useRef(null);u.useEffect(()=>{const x=g=>{r.current&&a({x:Math.max(8,g.clientX-r.current.x),y:Math.max(8,g.clientY-r.current.y)})},c=()=>{r.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",x),window.addEventListener("pointerup",c),()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",c)}},[]);const y=x=>{const c=x.currentTarget.getBoundingClientRect();r.current={x:x.clientX-c.left,y:x.clientY-c.top},document.body.classList.add("select-none"),x.currentTarget.setPointerCapture(x.pointerId)},p=async()=>{await navigator.clipboard.writeText(JSON.stringify({name:l,kind:"transform3D",transform:t},null,2)),o(!0),window.setTimeout(()=>o(!1),1200)};return typeof document>"u"?null:pe.createPortal(e.jsx("div",{style:{...Fo,left:s.x,top:s.y},children:e.jsxs("div",{style:Lo,children:[e.jsxs("div",{style:No,children:[e.jsx("div",{onPointerDown:y,style:$o,children:e.jsx(er,{})}),e.jsxs("div",{style:In,children:[e.jsx("span",{style:zn,children:e.jsx(Mn,{})}),e.jsx("span",{children:"Transform"})]})]}),e.jsxs("div",{style:Oo,children:[e.jsxs("div",{style:Ao,children:[e.jsx("button",{type:"button",style:Do,onClick:p,children:d?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button","aria-label":t.visible?"Hide Transform":"Show Transform",title:t.visible?"Hide Transform":"Show Transform",style:Po(t.visible),onClick:()=>n({...t,visible:!t.visible}),children:t.visible?e.jsx(tr,{}):e.jsx(nr,{})})]}),e.jsx(Nt,{value:t,onChange:n})]})]})}),document.body)},ir={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},or={display:"flex",alignItems:"center",gap:6,marginBottom:7,fontSize:11,fontWeight:700},rr={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},pn={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},U={display:"flex",flexDirection:"column",gap:4,fontSize:9,color:"rgba(226,232,240,0.72)"},Ot={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Oe={...Ot,cursor:"pointer"},ie={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:24,fontSize:9,color:"rgba(226,232,240,0.72)"},oe={width:15,height:15,accentColor:"#38bdf8",cursor:"pointer"},ar={marginTop:10,paddingTop:10,borderTop:"1px solid rgba(255,255,255,0.08)"},dr={marginBottom:7,fontSize:10,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(226,232,240,0.74)"},cr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),pr=(t,n,l)=>Math.min(l,Math.max(n,t)),Je=({max:t,min:n,onChange:l,step:s,value:a})=>e.jsx("input",{type:"number",min:n,max:t,step:s??.01,style:Ot,value:a,onChange:d=>{const o=Number(d.currentTarget.value);Number.isNaN(o)||l(pr(o,n??Number.NEGATIVE_INFINITY,t??Number.POSITIVE_INFINITY))}}),Wn=({value:t,onChange:n})=>{const l=r=>{n({...t,material:{...t.material,...r}})},s=An.normalizeMeshRendererRenderState(t.material.renderState),a=r=>{l({renderState:{...s,...r,colorMask:{...s.colorMask,...r.colorMask},polygonOffset:{...s.polygonOffset,...r.polygonOffset}}})},d=r=>{a({polygonOffset:{...s.polygonOffset,...r}})},o=r=>{a({colorMask:{...s.colorMask,...r}})};return e.jsxs("div",{style:ir,children:[e.jsxs("div",{style:or,children:[e.jsx("span",{style:rr,children:e.jsx(cr,{})}),e.jsx("span",{children:"Mesh Renderer"})]}),e.jsxs("div",{style:pn,children:[e.jsxs("label",{style:U,children:["Mesh",e.jsxs("select",{style:Oe,value:t.mesh,onChange:r=>n({...t,mesh:r.currentTarget.value}),children:[e.jsx("option",{value:"cube",children:"Cube"}),e.jsx("option",{value:"sphere",children:"Sphere"}),e.jsx("option",{value:"plane",children:"Plane"})]})]}),e.jsxs("label",{style:U,children:["Material",e.jsxs("select",{style:Oe,value:t.material.type,onChange:r=>l({type:r.currentTarget.value}),children:[e.jsx("option",{value:"standard",children:"Standard"}),e.jsx("option",{value:"basic",children:"Basic"})]})]}),e.jsxs("label",{style:U,children:["Color",e.jsx("input",{type:"color",style:{...Ot,padding:2},value:t.material.color,onChange:r=>l({color:r.currentTarget.value})})]}),e.jsxs("label",{style:U,children:["Opacity",e.jsx(Je,{min:0,max:1,step:.01,value:t.material.opacity,onChange:r=>l({opacity:r})})]}),e.jsxs("label",{style:U,children:["Roughness",e.jsx(Je,{min:0,max:1,step:.01,value:t.material.roughness,onChange:r=>l({roughness:r})})]}),e.jsxs("label",{style:U,children:["Metalness",e.jsx(Je,{min:0,max:1,step:.01,value:t.material.metalness,onChange:r=>l({metalness:r})})]}),e.jsxs("label",{style:U,children:["Shadow Mode",e.jsxs("select",{style:Oe,value:t.shadowMode,onChange:r=>n({...t,shadowMode:r.currentTarget.value}),children:[e.jsx("option",{value:"off",children:"Off"}),e.jsx("option",{value:"cast",children:"Cast"}),e.jsx("option",{value:"receive",children:"Receive"}),e.jsx("option",{value:"castReceive",children:"Cast + Receive"})]})]}),e.jsxs("label",{style:ie,children:["Wireframe",e.jsx("input",{type:"checkbox",checked:t.material.wireframe,style:oe,onChange:r=>l({wireframe:r.currentTarget.checked})})]})]}),e.jsxs("div",{style:ar,children:[e.jsx("div",{style:dr,children:"Render State"}),e.jsxs("div",{style:pn,children:[e.jsxs("label",{style:ie,children:["Depth Test",e.jsx("input",{type:"checkbox",checked:s.depthTest,style:oe,onChange:r=>a({depthTest:r.currentTarget.checked})})]}),e.jsxs("label",{style:ie,children:["Depth Write",e.jsx("input",{type:"checkbox",checked:s.depthWrite,style:oe,onChange:r=>a({depthWrite:r.currentTarget.checked})})]}),e.jsxs("label",{style:U,children:["Depth Function",e.jsxs("select",{style:Oe,value:s.depthFunc,onChange:r=>a({depthFunc:r.currentTarget.value}),children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"less",children:"Less"}),e.jsx("option",{value:"equal",children:"Equal"}),e.jsx("option",{value:"lessEqual",children:"Less Equal"}),e.jsx("option",{value:"greater",children:"Greater"}),e.jsx("option",{value:"notEqual",children:"Not Equal"}),e.jsx("option",{value:"greaterEqual",children:"Greater Equal"}),e.jsx("option",{value:"always",children:"Always"})]})]}),e.jsxs("label",{style:ie,children:["Color Write",e.jsx("input",{type:"checkbox",checked:s.colorWrite,style:oe,onChange:r=>a({colorWrite:r.currentTarget.checked})})]}),e.jsxs("label",{style:ie,children:["Mask R",e.jsx("input",{type:"checkbox",checked:s.colorMask.r,style:oe,onChange:r=>o({r:r.currentTarget.checked})})]}),e.jsxs("label",{style:ie,children:["Mask G",e.jsx("input",{type:"checkbox",checked:s.colorMask.g,style:oe,onChange:r=>o({g:r.currentTarget.checked})})]}),e.jsxs("label",{style:ie,children:["Mask B",e.jsx("input",{type:"checkbox",checked:s.colorMask.b,style:oe,onChange:r=>o({b:r.currentTarget.checked})})]}),e.jsxs("label",{style:ie,children:["Mask A",e.jsx("input",{type:"checkbox",checked:s.colorMask.a,style:oe,onChange:r=>o({a:r.currentTarget.checked})})]}),e.jsxs("label",{style:U,children:["Cull Mode",e.jsxs("select",{style:Oe,value:s.cullMode,onChange:r=>a({cullMode:r.currentTarget.value}),children:[e.jsx("option",{value:"back",children:"Back"}),e.jsx("option",{value:"front",children:"Front"}),e.jsx("option",{value:"off",children:"Off"})]})]}),e.jsxs("label",{style:U,children:["Blend Mode",e.jsxs("select",{style:Oe,value:s.blendMode,onChange:r=>a({blendMode:r.currentTarget.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"additive",children:"Additive"}),e.jsx("option",{value:"subtractive",children:"Subtractive"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"none",children:"None"})]})]}),e.jsxs("label",{style:ie,children:["Polygon Offset",e.jsx("input",{type:"checkbox",checked:s.polygonOffset.enabled,style:oe,onChange:r=>d({enabled:r.currentTarget.checked})})]}),e.jsxs("label",{style:U,children:["Offset Factor",e.jsx(Je,{step:.1,value:s.polygonOffset.factor,onChange:r=>d({factor:r})})]}),e.jsxs("label",{style:U,children:["Offset Units",e.jsx(Je,{step:.1,value:s.polygonOffset.units,onChange:r=>d({units:r})})]})]})]})]})},hr={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:"8px 8px 56px"},xr={marginBottom:7,fontSize:11,fontWeight:700},yr={marginTop:10,paddingTop:10,borderTop:"1px solid rgba(255,255,255,0.08)"},ur={marginBottom:7,fontSize:10,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(226,232,240,0.74)"},W={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},ae={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},gr={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6,marginTop:8,color:"#cbd5e1",fontSize:11},ge=({max:t,min:n,onChange:l,step:s,value:a})=>e.jsx("input",{type:"number",min:n,max:t,step:s??1,style:ae,value:a,onChange:d=>{const o=Number(d.currentTarget.value);Number.isNaN(o)||l(o)}}),ze=({onChange:t,options:n,value:l})=>e.jsx("select",{style:ae,value:l,onChange:s=>t(s.currentTarget.value),children:n.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),Qe=({children:t,title:n})=>e.jsxs("div",{style:yr,children:[e.jsx("div",{style:ur,children:n}),t]}),$t=({onChange:t,value:n})=>{const l=c=>t(X.resolveFaceMeshRendererSettings(n,c)),s=X.supportsTexturePanel(n.materialType,n.shaderPreset),a=X.supportsBlendMode(n.materialType,n.shaderPreset,n.textureMap),d=n.materialType===X.FACE_MESH_MATERIAL_TYPES.shader&&n.shaderPreset===X.FACE_MESH_SHADER_PRESETS.composite?Z.textureMapOptions.filter(c=>c.value!==X.FACE_MESH_TEXTURE_MAPS.none):Z.textureMapOptions,o=X.usesMaskColor(n.maskTextureSource),r=X.usesMaskSourceUrl(n.maskTextureSource),y=c=>{l({shaderPreset:c})},p=c=>{l({materialType:c})},x=e.jsxs(Qe,{title:"Geometry",children:[e.jsxs("div",{style:gr,children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:n.showLeftEyeGeometry,onChange:c=>l({showLeftEyeGeometry:c.currentTarget.checked})})," ","Left Eye"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:n.showRightEyeGeometry,onChange:c=>l({showRightEyeGeometry:c.currentTarget.checked})})," ","Right Eye"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:n.showNoseGeometry,onChange:c=>l({showNoseGeometry:c.currentTarget.checked})})," ","Nose"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:n.showMouthGeometry,onChange:c=>l({showMouthGeometry:c.currentTarget.checked})})," ","Mouth"]})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Show Overlay Mask"}),e.jsx("input",{type:"checkbox",checked:n.showOverlayMask,onChange:c=>l({showOverlayMask:c.currentTarget.checked})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Source"}),e.jsx(ze,{value:n.maskTextureSource,options:Z.maskTextureSourceOptions,onChange:c=>l({maskTextureSource:c})})]}),r?e.jsxs("label",{style:W,children:[e.jsx("span",{children:"URL"}),e.jsx("input",{type:"url",style:ae,value:n.maskSourceUrl,onChange:c=>l({maskSourceUrl:c.currentTarget.value})})]}):null,o?e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...ae,padding:2},value:n.maskColor,onChange:c=>l({maskColor:c.currentTarget.value})})]}):null,e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Overlay Opacity"}),e.jsx(ge,{min:0,max:1,step:.1,value:n.maskOpacity,onChange:c=>l({maskOpacity:c})})]})]});return e.jsxs("section",{style:hr,children:[e.jsxs("label",{style:{...xr,display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{children:"Face Mesh Renderer"}),e.jsx("input",{type:"checkbox",checked:n.enabled,onChange:c=>l({enabled:c.currentTarget.checked})})]}),e.jsxs(Qe,{title:"Renderer",children:[e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Face Index"}),e.jsx(ge,{min:0,step:1,value:n.faceIndex,onChange:c=>l({faceIndex:c})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Target FPS"}),e.jsx(ge,{min:1,step:1,value:n.targetFps??24,onChange:c=>l({targetFps:c})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Render Order"}),e.jsx(ge,{step:1,value:n.renderOrder,onChange:c=>l({renderOrder:c})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"External Mesh"}),e.jsx("input",{type:"url",style:ae,value:n.externalMeshUrl??"",onChange:c=>l({externalMeshUrl:c.currentTarget.value||void 0})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Mesh Scale"}),e.jsx(ge,{min:.01,step:.01,value:n.externalScale,onChange:c=>l({externalScale:c})})]})]}),x,e.jsxs(Qe,{title:"Material",children:[e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Type"}),e.jsx(ze,{value:n.materialType,options:Z.materialTypeOptions,onChange:p})]}),n.materialType===X.FACE_MESH_MATERIAL_TYPES.shader?e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Shader"}),e.jsx(ze,{value:n.shaderPreset,options:Z.shaderPresetOptions,onChange:y})]}):null,e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Base Color"}),e.jsx("input",{type:"color",style:{...ae,padding:2},value:n.baseColor,onChange:c=>l({baseColor:c.currentTarget.value})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Material Opacity"}),e.jsx(ge,{min:0,max:1,step:.01,value:n.opacity,onChange:c=>l({opacity:c})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Side"}),e.jsx(ze,{value:n.side,options:Z.sideOptions,onChange:c=>l({side:c})})]})]}),s?e.jsxs(Qe,{title:"Texture",children:[e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Map"}),e.jsx(ze,{value:n.textureMap,options:d,onChange:c=>l({textureMap:c})})]}),n.textureMap===X.FACE_MESH_TEXTURE_MAPS.canonical?e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Face URL"}),e.jsx("input",{type:"url",style:ae,value:n.faceTextureUrl,onChange:c=>l({faceTextureUrl:c.currentTarget.value})})]}):null,n.textureMap===X.FACE_MESH_TEXTURE_MAPS.style2?e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Style URL"}),e.jsx("input",{type:"url",style:ae,value:n.faceTextureStyle2Url,onChange:c=>l({faceTextureStyle2Url:c.currentTarget.value})})]}):null,e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Material Alpha"}),e.jsx(ze,{value:n.alphaMap,options:Z.alphaMapOptions,onChange:c=>l({alphaMap:c})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Alpha Texture URL"}),e.jsx("input",{type:"url",style:ae,value:n.faceAlphaMaskUrl,onChange:c=>l({faceAlphaMaskUrl:c.currentTarget.value})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Alpha Strength"}),e.jsx(ge,{min:0,max:1,step:.01,value:n.alphaOpacity,onChange:c=>l({alphaOpacity:c})})]})]}):null,a?e.jsxs(Qe,{title:"Blend",children:[e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Mode"}),e.jsx(ze,{value:n.blendMode,options:Z.blendModeOptions,onChange:c=>l({blendMode:c})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Blend Strength"}),e.jsx(ge,{min:0,max:1,step:.01,value:n.blendOpacity,onChange:c=>l({blendOpacity:c})})]}),e.jsxs("label",{style:W,children:[e.jsx("span",{children:"Composite"}),e.jsx("input",{type:"checkbox",checked:n.compositeShading,onChange:c=>l({compositeShading:c.currentTarget.checked})})]})]}):null]})},br=({component:t,onChange:n})=>e.jsx($t,{value:t.settings,onChange:l=>n==null?void 0:n({...t,settings:l})}),Fn=u.createContext(null),fr=({children:t,defaultOrbitEnabled:n=!0,defaultSelectedObjectId:l=null,defaultShowGrid:s=!0,defaultShowVideoBackground:a=!0,onComponentChange:d,onObjectChange:o,onOrbitEnabledChange:r,onSelectObject:y,onShowGridChange:p,onShowVideoBackgroundChange:x,onStoreChange:c,orbitEnabled:g,selectedObjectId:h,showGrid:i,showVideoBackground:b,store:j})=>{const[k,C]=u.useState(l),[L,S]=u.useState(n),[w,O]=u.useState(s),[T,B]=u.useState(a),_=h??k,he=g??L,te=i??w,xe=b??T,M=u.useMemo(()=>({store:j,selectedObjectId:_,orbitEnabled:he,showGrid:te,showVideoBackground:xe,onStoreChange:c,onSelectObject:I=>{C(I),y==null||y(I)},onComponentChange:d??(I=>{c({...j,components:{...j.components,[I.id]:I}})}),onObjectChange:o??(I=>{c({...j,objects:{...j.objects,[I.id]:I}})}),onOrbitEnabledChange:I=>{S(I),r==null||r(I)},onShowGridChange:I=>{O(I),p==null||p(I)},onShowVideoBackgroundChange:I=>{B(I),x==null||x(I)}}),[d,o,r,y,p,x,c,he,_,te,xe,j]);return e.jsx(Fn.Provider,{value:M,children:t})},rt=()=>{const t=u.useContext(Fn);if(!t)throw new Error("useXRSceneEditor must be used inside XRSceneEditorProvider.");return t},Ln=t=>t.renderGroupOrder.map(n=>t.renderGroups[n]).filter(Boolean),jr=({initialPosition:t,rootOnly:n=!1,title:l})=>{const{onSelectObject:s,onStoreChange:a,selectedObjectId:d,store:o}=rt(),r=Ln(o),y=n?Object.fromEntries(Object.entries(o.objects).filter(([,p])=>!p.parentObjectId)):o.objects;return e.jsx(Cn,{title:l,initialPosition:t,groups:r,objects:y,selectedObjectId:d??void 0,onSelectObject:p=>s(p),onReorderGroup:(p,x)=>a(We.reorderRenderGroup(o,p,x)),onReorderObject:(p,x,c)=>a(We.reorderObjectWithinGroup(o,p,x,c)),onMoveObject:(p,x,c)=>{const g=We.moveObjectToGroup(o,p,x,c);return g===o?!1:(a(g),!0)},onSetObjectParent:(p,x,c,g)=>{let h=o;const i=h.objects[p];if(!i||g&&i.renderGroupId!==g&&(h=We.moveObjectToGroup(h,p,g,c),h===o))return!1;const b=$.setSceneObjectParentPreserveWorldTransform(h,p,x,c);return b===o?!1:(a(b),!0)},onToggleGroupEnabled:(p,x)=>{const c=o.renderGroups[p];c&&a({...o,renderGroups:{...o.renderGroups,[p]:{...c,enabled:x}}})},onToggleObjectVisible:(p,x)=>a($.setSceneObjectVisible(o,p,x)),copyConfig:{kind:"scene",version:1,renderGroupOrder:o.renderGroupOrder,renderGroups:o.renderGroups,objects:o.objects,components:o.components}})},Y={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},fe={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},st={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},lt={display:"flex",alignItems:"center",gap:6,marginBottom:7,fontSize:11,fontWeight:700},se=(t,n)=>t.find(l=>l.type===n),mr=({onChange:t,value:n})=>e.jsxs("section",{style:st,children:[e.jsx("div",{style:lt,children:"Light"}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Type"}),e.jsxs("select",{style:fe,value:n.type,onChange:l=>t({...n,type:l.currentTarget.value}),children:[e.jsx("option",{value:"ambient",children:"Ambient"}),e.jsx("option",{value:"directional",children:"Directional"}),e.jsx("option",{value:"point",children:"Point"}),e.jsx("option",{value:"spot",children:"Spot"})]})]}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...fe,padding:2},value:n.color,onChange:l=>t({...n,color:l.currentTarget.value})})]}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Intensity"}),e.jsx("input",{type:"number",min:0,step:.1,style:fe,value:n.intensity,onChange:l=>t({...n,intensity:Number(l.currentTarget.value)})})]}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Cast Shadow"}),e.jsx("input",{type:"checkbox",checked:n.castShadow,onChange:l=>t({...n,castShadow:l.currentTarget.checked})})]}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Show Helper"}),e.jsx("input",{type:"checkbox",checked:n.showHelper,onChange:l=>t({...n,showHelper:l.currentTarget.checked})})]})]}),Sr=({onChange:t,value:n})=>e.jsxs("section",{style:st,children:[e.jsxs("label",{style:{...lt,justifyContent:"space-between"},children:[e.jsx("span",{children:"Look At"}),e.jsx("input",{type:"checkbox",checked:n.enabled,onChange:l=>t({...n,enabled:l.currentTarget.checked})})]}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Mode"}),e.jsxs("select",{style:fe,value:n.mode,onChange:l=>t({...n,mode:l.currentTarget.value}),children:[e.jsx("option",{value:"point",children:"Point"}),e.jsx("option",{value:"direction",children:"Direction"})]})]}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Children Inherit"}),e.jsx("input",{type:"checkbox",checked:n.inheritChildren,onChange:l=>t({...n,inheritChildren:l.currentTarget.checked})})]})]}),wr=({onChange:t,value:n})=>{const l=(s,a,d)=>["x","y","z"].map(o=>e.jsxs("label",{style:Y,children:[e.jsx("span",{children:`${s} ${o.toUpperCase()}`}),e.jsx("input",{type:"number",step:.05,style:fe,value:a[o],onChange:r=>d({...a,[o]:Number(r.currentTarget.value)})})]},`${s}-${o}`));return e.jsxs("section",{style:st,children:[e.jsx("div",{style:lt,children:"Face Binding"}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Target"}),e.jsx("select",{style:fe,value:n.target,onChange:s=>t({...n,target:s.currentTarget.value}),children:Dn.FACE_TARGETS.map(s=>e.jsx("option",{value:s,children:s.replace("face.","")},s))})]}),n.target==="face.custom"?l("Custom",n.customAnchorPoint,s=>t({...n,customAnchorPoint:s})):null,l("Offset",n.offset,s=>t({...n,offset:s})),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Smoothing"}),e.jsx("input",{type:"number",min:0,step:1,style:fe,value:n.smoothing,onChange:s=>t({...n,smoothing:Number(s.currentTarget.value)})})]}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Follow Face Roll"}),e.jsx("input",{type:"checkbox",checked:n.followFaceRoll,onChange:s=>t({...n,followFaceRoll:s.currentTarget.checked})})]})]})},kr=({initialPosition:t})=>{const{onComponentChange:n,onObjectChange:l,onStoreChange:s,selectedObjectId:a,store:d}=rt(),o=a?d.objects[a]:null,r=o?$.getOrderedComponents(d,o.id):[],y=se(r,"Transform"),p=se(r,"ScreenTransform"),x=se(r,"ScreenShape"),c=se(r,"MeshRenderer"),g=se(r,"FaceMeshRenderer"),h=se(r,"Light"),i=se(r,"LookAt"),b=se(r,"PinToMesh"),j=se(r,"TrackingAnchor"),k=o!=null&&o.renderGroupId?d.renderGroups[o.renderGroupId]:void 0;if(!o)return null;const C=Object.values(d.objects).filter(S=>S.id!==o.id).filter(S=>{const w=$.getOrderedComponents(d,S.id);return!!se(w,"MeshRenderer")}).map(S=>({id:S.id,name:S.name})),L=Object.values(d.objects).filter(S=>S.id!==o.id);return e.jsxs(ut,{objectId:o.id,objectName:o.name,onObjectNameChange:S=>l({...o,name:S}),visible:o.enabled,onVisibleChange:S=>l({...o,enabled:S}),layer:(k==null?void 0:k.name)??"3D Scene",initialPosition:t,copyConfig:{object:o,components:r},children:[e.jsxs("section",{style:st,children:[e.jsx("div",{style:lt,children:"Hierarchy"}),e.jsxs("label",{style:Y,children:[e.jsx("span",{children:"Parent"}),e.jsxs("select",{style:fe,value:o.parentObjectId??"",onChange:S=>s($.setSceneObjectParentPreserveWorldTransform(d,o.id,S.currentTarget.value||null)),children:[e.jsx("option",{value:"",children:"None"}),L.map(S=>e.jsx("option",{value:S.id,children:S.name},S.id))]})]})]}),y?e.jsx(Nt,{value:y.settings,onChange:S=>n({...y,settings:S})}):null,p?e.jsxs("section",{style:st,children:[e.jsx("div",{style:lt,children:"Screen Transform"}),e.jsx(Ft,{guideLabel:"Screen Transform",value:{...p.settings,showGuides:p.settings.showTransformGuides},onChange:S=>{const{showGuides:w,...O}=S;n({...p,settings:{...p.settings,...O,showTransformGuides:w}})}})]}):null,c?e.jsx(Wn,{value:c.settings,onChange:S=>n({...c,settings:S})}):null,g?e.jsx($t,{value:g.settings,onChange:S=>n({...g,settings:S})}):null,x?e.jsx(mn,{value:x.settings,onChange:S=>n({...x,settings:S})}):null,h?e.jsx(mr,{value:h.settings,onChange:S=>n({...h,settings:S})}):null,i?e.jsx(Sr,{value:i.settings,onChange:S=>n({...i,settings:S})}):null,b?e.jsx(Rn,{value:b.settings,onChange:S=>n({...b,settings:S}),targets:C}):null,j?e.jsx(wr,{value:j.settings,onChange:S=>n({...j,settings:S})}):null]})},vr=({renderOrder:t=-999})=>{const{camera:n,size:l}=Bn.useThree(),s=Vn.useXRCameraTexture(),a=u.useMemo(()=>{if(!n.isPerspectiveCamera)return[10,10];const d=n,y=(d.position.z||5)- -1,p=d.fov*Math.PI/180,x=2*Math.tan(p/2)*y;return[x*(l.width/l.height),x]},[n,l]);return s?e.jsxs("mesh",{position:[0,0,-1],renderOrder:t,children:[e.jsx("planeGeometry",{args:a}),e.jsx("meshBasicMaterial",{map:s,depthTest:!0,depthWrite:!0,toneMapped:!1,side:$n.DoubleSide})]}):null},Cr=({camera:t={position:{x:0,y:.2,z:5.5},fov:42},grid:n={size:12,divisions:12,position:{x:0,y:-2.5,z:0}},style:l})=>{const{onComponentChange:s,orbitEnabled:a,showGrid:d,showVideoBackground:o,store:r}=rt(),y=We.createRenderPlan(r),p=Array.from(new Set(y.map(g=>g.renderLayer))),x=t.position??{x:0,y:.2,z:5.5},c=n.position??{x:0,y:-2.5,z:0};return e.jsxs(Pn.XRScene,{style:{width:"100%",height:"100%",...l},canvasProps:{shadows:!0},children:[o?e.jsx(vr,{renderOrder:-999}):null,e.jsx("color",{attach:"background",args:["#18212b"]}),e.jsx(At.PerspectiveCamera,{makeDefault:!0,position:[x.x,x.y,x.z],fov:t.fov??42}),e.jsx("ambientLight",{intensity:1.1}),d?e.jsx("gridHelper",{args:[n.size??12,n.divisions??12,"#344454","#263544"],position:[c.x,c.y,c.z]}):null,y.map(g=>e.jsx(Dt.SceneObjectRenderer,{objectId:g.objectId,store:r,editorMode:!0,renderOrder:g.renderOrder,renderLayer:g.renderLayer,onComponentChange:s},g.objectId)),e.jsx(Dt.SequentialRenderPasses,{layers:p}),e.jsx(At.OrbitControls,{enabled:a,enablePan:!1,minDistance:.05,maxDistance:1/0})]})},Rr=t=>({position:"absolute",top:12,left:t==="top-left"?12:t==="top-right"?"auto":"50%",right:t==="top-right"?12:"auto",transform:t==="top-center"||!t?"translateX(-50%)":"none",zIndex:5,display:"flex",alignItems:"center",gap:12,padding:"7px 10px",border:"1px solid rgba(148,163,184,.24)",borderRadius:9,background:"rgba(15,23,42,.78)",color:"#d8e2ec",backdropFilter:"blur(12px)",fontSize:11}),Er=({position:t="top-center"})=>{const{onOrbitEnabledChange:n,orbitEnabled:l}=rt();return e.jsxs("div",{style:Rr(t),children:[e.jsx("span",{style:{color:"#7e95aa",fontSize:9,fontWeight:800,letterSpacing:"0.14em"},children:"VIEWPORT"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:l,onChange:s=>n(s.currentTarget.checked)}),"Orbit Controls"]})]})},Ir={borderRadius:12,border:"1px solid rgba(251,191,36,0.30)",background:"rgba(251,191,36,0.08)",color:"#fde68a",padding:8,fontSize:10.5,lineHeight:1.45},zr={display:"block",marginTop:6,overflow:"auto",maxHeight:160,borderRadius:8,background:"rgba(15,23,42,0.55)",color:"#f8fafc",padding:8,fontSize:10},Nn=({component:t})=>e.jsxs("div",{style:Ir,children:[e.jsxs("div",{children:["Missing editor for component type: ",t.type]}),e.jsxs("div",{children:["Component ID: ",t.id]}),e.jsx("pre",{style:zr,children:JSON.stringify(t,null,2)})]}),Tr=({component:t,editors:n={},onChange:l})=>{const s=n[t.type];return s?e.jsx(s,{component:t,onChange:l}):e.jsx(Nn,{component:t})},Mr=t=>t.slice(0,12);exports.MediaSourceSwitcher=De.MediaSourceSwitcher;exports.defaultMediaSources=De.defaultMediaSources;exports.sdkImageMediaSources=De.sdkImageMediaSources;exports.sdkVideoMediaSources=De.sdkVideoMediaSources;exports.useFaceTrackingMediaSourceSession=De.useFaceTrackingMediaSourceSession;exports.useMediaSourceSession=De.useMediaSourceSession;exports.DefaultSettingPanel=On.DefaultSettingPanel;exports.ComponentEditor=Tr;exports.ComponentEditorFallback=Nn;exports.FaceMeshRendererComponentEditor=br;exports.FaceMeshRendererSettingsPanel=$t;exports.FaceRetouchSettingsPanel=Wo;exports.FaceWarp3DSettingsPanel=Mo;exports.HandJoints2DSettingsPanel=Wi;exports.HandTracking2DControllerSettingsPanel=gi;exports.HandTracking2DSettingsPanel=ql;exports.HandTracking3DSettingsPanel=Xi;exports.HierarchyPanel=Cn;exports.LayerPanel=ho;exports.MeshRendererSettingsPanel=Wn;exports.ObjectInspectorPanel=ut;exports.PinToMeshSettingsPanel=Rn;exports.SceneHierarchyPanel=jr;exports.SceneInspectorPanel=kr;exports.ScreenGlassSettingsPanel=jn;exports.ScreenGradientSettingsPanel=fn;exports.ScreenImageSettingsPanel=Tl;exports.ScreenShapeSettingsPanel=mn;exports.ScreenTextSettingsPanel=il;exports.SettingsPanel=En;exports.Transform3DSettingsPanel=lr;exports.Transform3DSettingsSection=Nt;exports.ViewportToolbar=Er;exports.XRSceneEditorProvider=fr;exports.XRSceneViewport=Cr;exports.createComponentIdLabel=Mr;exports.getSceneEditorGroups=Ln;exports.useXRSceneEditor=rt;
10
+ `}),l?e.jsxs("div",{className:"xr-hand-tracking-2d-controller-scroll",style:{...Ms,height:p},children:[e.jsxs("div",{style:ci,children:[e.jsx("div",{onPointerDown:f,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Si,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(Lt,{})}),e.jsx("span",{children:"HandTracking2DController"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(ii),style:ds,children:e.jsx(vi,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:ds,children:e.jsx(mi,{})})]}),e.jsxs("div",{style:pi,children:[g("controller","Controller",e.jsx(Lt,{}),e.jsxs("div",{style:fi,children:[e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Enabled"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Attach Image"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.attachImageEnabled,onChange:i=>s({...t,attachImageEnabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Size Responsive to Hand Bounding Box"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.sizeResponsiveToHandBoundingBox,onChange:i=>s({...t,sizeResponsiveToHandBoundingBox:i.target.checked})})]})}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Size"}),e.jsx("input",{style:ge,type:"number",min:.1,max:3,step:.01,value:t.size,onChange:i=>s({...t,size:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Vertical Align"}),e.jsx("select",{style:ge,value:t.verticalAlign,onChange:i=>s({...t,verticalAlign:i.target.value}),children:oi.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Horizontal Align"}),e.jsx("select",{style:ge,value:t.horizontalAlign,onChange:i=>s({...t,horizontalAlign:i.target.value}),children:ri.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Offset X"}),e.jsx("input",{style:ge,type:"number",min:-1,max:1,step:.01,value:t.offsetX,onChange:i=>s({...t,offsetX:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Offset Y"}),e.jsx("input",{style:ge,type:"number",min:-1,max:1,step:.01,value:t.offsetY,onChange:i=>s({...t,offsetY:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Rotation"}),e.jsx("input",{style:ge,type:"number",min:-180,max:180,step:.1,value:t.rotation,onChange:i=>s({...t,rotation:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Alpha"}),e.jsx("input",{style:ge,type:"number",min:0,max:1,step:.01,value:t.alpha,onChange:i=>s({...t,alpha:Number(i.target.value)})})]}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Smooth Following"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.smoothFollowing,onChange:i=>s({...t,smoothFollowing:i.target.checked})})]})}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Smoothing"}),e.jsx("input",{style:ge,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]})]})),g("visibility","Visibility",e.jsx(Lt,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Show Attach Image"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.attachImageEnabled,onChange:i=>s({...t,attachImageEnabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Show Bounding Box"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.showBoundingBox,onChange:i=>s({...t,showBoundingBox:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:di,children:e.jsx(ji,{})})]}),document.body)},ki={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Fs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Ci={...Fs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Ri={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Ii={display:"grid",gap:6,padding:7},Ei={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Ti={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zi={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mi={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fi=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wi={display:"grid",gap:7,padding:"0 7px 7px"},cs={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},be={display:"flex",flexDirection:"column",gap:4},Ie={...be,gridColumn:"1 / -1"},H={fontSize:9,color:"rgba(226,232,240,0.72)"},Ee={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Te={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},ze={width:16,height:16},ps={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Li=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),$i=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Ni=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),$t=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 5a3 3 0 1 1-3-3 3 3 0 0 1 3 3zm11 11a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 7.1l9.8 9.8 1.4-1.4-9.8-9.8-1.4 1.4zM19 2a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 16.9l9.8-9.8-1.4-1.4-9.8 9.8 1.4 1.4zM5 16a3 3 0 1 0 3 3 3 3 0 0 0-3-3z"})}),Oi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),Ai=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:320,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({joints:!0,visibility:!0}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ei,children:[e.jsxs("div",{style:Ti,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Mi,children:e.jsx("div",{style:Fi(h[i])})}),e.jsxs("div",{style:zi,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Wi,children:w}):null]},i);return typeof document>"u"?null:Oe.createPortal(e.jsx("div",{style:{...ki,left:a.x,top:a.y},children:l?e.jsxs("div",{style:{...Fs,height:p},children:[e.jsxs("div",{style:Ri,children:[e.jsx("div",{onPointerDown:f,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Ni,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx($t,{})}),e.jsx("span",{children:"HandJoints2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(Ne.DEFAULT_HAND_JOINTS_2D_SETTINGS),style:ps,children:e.jsx(Oi,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:ps,children:e.jsx($i,{})})]}),e.jsxs("div",{style:Ii,children:[g("joints","Joints",e.jsx($t,{}),e.jsxs("div",{style:cs,children:[e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Visual Scale"}),e.jsx("input",{style:Ee,type:"number",min:.25,max:2,step:.01,value:t.visualScale,onChange:i=>s({...t,visualScale:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Opacity"}),e.jsx("input",{style:Ee,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>s({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Joint Radius"}),e.jsx("input",{style:Ee,type:"number",min:.5,max:24,step:.5,value:t.jointRadius,onChange:i=>s({...t,jointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Line Width"}),e.jsx("input",{style:Ee,type:"number",min:.01,max:100,step:.1,value:t.lineWidth,onChange:i=>s({...t,lineWidth:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Label Size"}),e.jsx("input",{style:Ee,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:i=>s({...t,labelScale:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Smoothing"}),e.jsx("input",{style:Ee,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Min Count Confidence"}),e.jsx("input",{style:Ee,type:"number",min:0,max:1,step:.01,value:t.minCountConfidence,onChange:i=>s({...t,minCountConfidence:Number(i.target.value)})})]})]})),g("visibility","Visibility",e.jsx($t,{}),e.jsxs("div",{style:cs,children:[e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Show Joints"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.bothHands,onChange:i=>s({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Count Fingers"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.countEnabled,onChange:i=>s({...t,countEnabled:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Joint Dots"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showJoints,onChange:i=>s({...t,showJoints:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Bone Lines"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showBones,onChange:i=>s({...t,showBones:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showBoundingBox,onChange:i=>s({...t,showBoundingBox:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Labels"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showLabels,onChange:i=>s({...t,showLabels:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:Ci,children:e.jsx(Li,{})})}),document.body)},Pi={enabled:!0,bothHands:!0,space:"scene",showJoints:!0,showBones:!0,showLabels:!1,handScale:1,depthScale:1,trackingDistanceM:.6096,projectionDistanceM:2,fitX:1,fitY:.9,offsetX:0,offsetY:0,offsetZ:0,jointRadius:.012,boneRadius:.012,opacity:.88,smoothing:.35},Di={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Ws={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Bi={...Ws,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Vi={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Ki={display:"grid",gap:6,padding:7},Hi={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Gi={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},_i={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Ui={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Xi=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Zi={display:"grid",gap:7,padding:"0 7px 7px"},Nt={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},_={display:"flex",flexDirection:"column",gap:4},Ve={..._,gridColumn:"1 / -1"},O={fontSize:9,color:"rgba(226,232,240,0.72)"},G={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},nt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},lt={width:16,height:16},hs={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Yi=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),qi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Ji=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),jt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),Qi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),eo=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:320,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({visual:!0,calibration:!0,visibility:!0}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Hi,children:[e.jsxs("div",{style:Gi,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Ui,children:e.jsx("div",{style:Xi(h[i])})}),e.jsxs("div",{style:_i,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Zi,children:w}):null]},i);return typeof document>"u"?null:Oe.createPortal(e.jsx("div",{style:{...Di,left:a.x,top:a.y},children:l?e.jsxs("div",{style:{...Ws,height:p},children:[e.jsxs("div",{style:Vi,children:[e.jsx("div",{onPointerDown:f,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Ji,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(jt,{})}),e.jsx("span",{children:"HandTracking3D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(Pi),style:hs,children:e.jsx(Qi,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:hs,children:e.jsx(qi,{})})]}),e.jsxs("div",{style:Ki,children:[g("visual","Visual",e.jsx(jt,{}),e.jsxs("div",{style:Nt,children:[e.jsxs("label",{style:Ve,children:[e.jsx("span",{style:O,children:"Space"}),e.jsxs("select",{style:G,value:t.space,onChange:i=>s({...t,space:i.target.value}),children:[e.jsx("option",{value:"scene",children:"Scene"}),e.jsx("option",{value:"screen",children:"Screen Fit"})]})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Joint Size"}),e.jsx("input",{style:G,type:"number",min:5e-4,max:.08,step:5e-4,value:t.jointRadius,onChange:i=>s({...t,jointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Bone Radius"}),e.jsx("input",{style:G,type:"number",min:.001,max:.12,step:.001,value:t.boneRadius,onChange:i=>s({...t,boneRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Opacity"}),e.jsx("input",{style:G,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>s({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Smoothing"}),e.jsx("input",{style:G,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]})]})),g("calibration","Calibration",e.jsx(jt,{}),e.jsxs("div",{style:Nt,children:[e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Hand Distance Ref (m)"}),e.jsx("input",{style:G,type:"number",min:.05,max:5,step:.01,value:t.trackingDistanceM,onChange:i=>s({...t,trackingDistanceM:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Projection Distance"}),e.jsx("input",{style:G,type:"number",min:.05,max:10,step:.01,value:t.projectionDistanceM,onChange:i=>s({...t,projectionDistanceM:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Hand Scale"}),e.jsx("input",{style:G,type:"number",min:.1,max:8,step:.01,value:t.handScale,onChange:i=>s({...t,handScale:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Fit X"}),e.jsx("input",{style:G,type:"number",min:.1,max:4,step:.01,value:t.fitX,onChange:i=>s({...t,fitX:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Fit Y"}),e.jsx("input",{style:G,type:"number",min:.1,max:4,step:.01,value:t.fitY,onChange:i=>s({...t,fitY:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Offset X"}),e.jsx("input",{style:G,type:"number",min:-5,max:5,step:.01,value:t.offsetX,onChange:i=>s({...t,offsetX:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Offset Y"}),e.jsx("input",{style:G,type:"number",min:-5,max:5,step:.01,value:t.offsetY,onChange:i=>s({...t,offsetY:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Offset Z"}),e.jsx("input",{style:G,type:"number",min:-5,max:5,step:.01,value:t.offsetZ,onChange:i=>s({...t,offsetZ:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Depth Scale"}),e.jsx("input",{style:G,type:"number",min:0,max:10,step:.1,value:t.depthScale,onChange:i=>s({...t,depthScale:Number(i.target.value)})})]})]})),g("visibility","Visibility",e.jsx(jt,{}),e.jsxs("div",{style:Nt,children:[e.jsx("label",{style:Ve,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Show 3D Hand"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:Ve,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.bothHands,onChange:i=>s({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:Ve,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Joint Spheres"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.showJoints,onChange:i=>s({...t,showJoints:i.target.checked})})]})}),e.jsx("label",{style:Ve,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Bone Cylinders"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.showBones,onChange:i=>s({...t,showBones:i.target.checked})})]})}),e.jsx("label",{style:Ve,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Labels"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.showLabels,onChange:i=>s({...t,showLabels:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:Bi,children:e.jsx(Yi,{})})}),document.body)},to=1e3;function so(t,s=to){return t.map((l,n)=>({...l,renderOrder:s+(t.length-n)}))}function no(t,s,l){const n=t.findIndex(o=>o.id===s),a=t.findIndex(o=>o.id===l);if(n<0||a<0||n===a)return t;const d=[...t],[r]=d.splice(n,1);return d.splice(a,0,r),so(d)}const lo={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},xs={pointerEvents:"auto",width:284,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},io={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},oo={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},ro={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},ao={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},co={display:"grid",gap:6,padding:7},po=t=>({display:"grid",gridTemplateColumns:"20px 20px 20px minmax(0, 1fr)",alignItems:"center",gap:6,minHeight:34,padding:"6px 7px",borderRadius:10,border:t?"1px solid rgba(56,189,248,0.5)":"1px solid rgba(255,255,255,0.08)",background:t?"rgba(56,189,248,0.10)":"rgba(255,255,255,0.03)",cursor:"pointer",opacity:1}),ho={display:"flex",flexDirection:"column",gap:2,minWidth:0},xo={fontSize:10,fontWeight:600,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},uo={fontSize:9,color:"rgba(226,232,240,0.6)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Ot={...Vt,width:20,height:20,borderRadius:7,fontSize:11,lineHeight:1},go=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M2 2l20 20-1.4 1.4-3.2-3.2C15.9 21 14.1 21.5 12 21.5 6.5 21.5 2 16 1 12c.4-1.8 1.1-3.4 2.2-4.8L.6 4.6 2 2zm10 4c3.9 0 7.4 2.8 9.2 6-1 1.8-2.6 3.5-4.4 4.6l-2-2c.1-.3.2-.7.2-1.1a3 3 0 0 0-3-3c-.4 0-.8.1-1.1.2l-1.9-1.9C10.2 6.8 11.1 6 12 6z"}):e.jsx("path",{d:"M12 5c5.5 0 10 5 11 7-.9 2-5.5 7-11 7S2 14 1 12c1-2 5.5-7 11-7zm0 3.2A3.8 3.8 0 1 0 12 16.8 3.8 3.8 0 0 0 12 8.2z"})}),yo=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M18 8h-1V6a5 5 0 0 0-9.1-2.9l1.5 1.5A3 3 0 0 1 16 6v2H8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h9.2l1.8 1.8 1.4-1.4L2.6 3.4 1.2 4.8 5 8.6V20h14a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2z"}):e.jsx("path",{d:"M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1zm2 0h6V8a3 3 0 0 0-6 0v2z"})}),bo=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),us=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3 1 9l11 6 11-6-11-6zm0 8L1 5v4l11 6 11-6V5l-11 6zm0 6L1 11v4l11 6 11-6v-4l-11 6z"})}),fo=({layers:t,selectedLayerId:s,onSelectLayer:l,onToggleVisible:n,onToggleEnabled:a,onReorder:d,onToggleLocked:r,initialPosition:o,title:h="Layers"})=>{const[x,c]=y.useState(!0),[p,f]=y.useState(o??{x:644,y:104}),[g,i]=y.useState(typeof window>"u"?0:window.innerHeight),u=y.useRef(null),[j,w]=y.useState(null),v=Math.max(240,g-p.y-16);if(y.useEffect(()=>{const b=E=>{u.current&&f({x:Math.max(8,E.clientX-u.current.x),y:Math.max(8,E.clientY-u.current.y)})},F=()=>{u.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",b),window.addEventListener("pointerup",F),()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",F)}},[]),y.useEffect(()=>{const b=()=>i(window.innerHeight);return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),typeof document>"u")return null;const M=b=>{const F=b.currentTarget.getBoundingClientRect();u.current={x:b.clientX-F.left,y:b.clientY-F.top},document.body.classList.add("select-none"),b.currentTarget.setPointerCapture(b.pointerId)},U=b=>{if(!j||j===b){w(null);return}const F=t.findIndex(P=>P.id===j),E=t.findIndex(P=>P.id===b);if(F<0||E<0){w(null);return}d(no(t,j,b)),w(null)};return Oe.createPortal(e.jsx("div",{style:{...lo,left:p.x,top:p.y},children:x?e.jsxs("div",{style:{...xs,height:v},children:[e.jsxs("div",{style:io,children:[e.jsx("div",{onPointerDown:M,style:oo,children:e.jsx(bo,{})}),e.jsxs("div",{style:ro,children:[e.jsx("span",{style:ao,children:e.jsx(us,{})}),e.jsx("span",{children:h})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>c(!1),style:Vt,children:"−"})]}),e.jsx("div",{style:co,children:t.map((b,F)=>e.jsxs("div",{style:po(s===b.id),draggable:!0,onDragStart:()=>w(b.id),onDragOver:E=>E.preventDefault(),onDrop:()=>U(b.id),onClick:()=>l(b.id),title:b.label,children:[e.jsx("button",{type:"button",style:Ot,onClick:E=>{E.stopPropagation(),n(b.id,!b.visible)},children:e.jsx(go,{off:!b.visible})}),e.jsx("button",{type:"button",style:Ot,onClick:E=>{E.stopPropagation(),a(b.id,!b.enabled)},children:b.enabled?"●":"○"}),e.jsx("button",{type:"button",style:Ot,onClick:E=>{E.stopPropagation(),r==null||r(b.id,!b.locked)},children:e.jsx(yo,{off:!b.locked})}),e.jsxs("div",{style:ho,children:[e.jsx("div",{style:xo,children:b.label}),e.jsxs("div",{style:uo,children:[b.domain," / ",b.type," • #",t.length-F]})]})]},b.id))})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>c(!0),style:{...xs,...Vt,width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(us,{})})}),document.body)},At={pointerEvents:"auto",width:300,borderRadius:16,border:"1px solid rgba(255,255,255,.12)",background:"rgba(8,15,28,.78)",boxShadow:"0 16px 36px rgba(0,0,0,.28)",backdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"auto"},it={display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,padding:0,borderRadius:7,border:"1px solid rgba(255,255,255,.1)",background:"rgba(255,255,255,.05)",color:"#e2e8f0",cursor:"pointer"},gs=t=>{try{return JSON.parse(t.dataTransfer.getData("application/x-xr-hierarchy"))}catch{return null}},jo=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ls=({groups:t,objects:s,selectedObjectId:l,onSelectObject:n,onReorderGroup:a,onReorderObject:d,onMoveObject:r,onSetObjectParent:o,onToggleGroupEnabled:h,onToggleObjectVisible:x,copyConfig:c,docked:p=!1,initialPosition:f={x:10,y:30},title:g="Hierarchy"})=>{const[i,u]=y.useState(!0),{position:j,startDrag:w,place:v}=js({docked:p,initialPosition:f}),M=p?{...At,...kt}:At,[U,b]=y.useState(new Set),[F,E]=y.useState(new Set),[P,le]=y.useState(!1),[ae,L]=y.useState(null),Ae=t.filter(m=>m.objectIds.some(R=>!!s[R])),Pe=(m,R)=>{m.stopPropagation(),m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("application/x-xr-hierarchy",JSON.stringify(R)),L(null)},W=(m,R,D)=>{var C;m.preventDefault(),m.stopPropagation();const I=gs(m);if(I){if(I.kind==="group"){a(I.groupId,D);return}if(!(o!=null&&o(I.objectId,null,R.objectIds.length,R.id))){if(I.groupId===R.id){d(R.id,I.objectId,R.objectIds.length-1);return}r(I.objectId,R.id,R.objectIds.length)||L(`${((C=s[I.objectId])==null?void 0:C.name)??"Object"} is not compatible with ${R.name}.`)}}},ve=(m,R,D,I)=>{var Ye;m.preventDefault(),m.stopPropagation();const C=gs(m);if(!(!C||C.kind!=="object")&&C.objectId!==D){if(o!=null&&o(C.objectId,D,Ze(D).length,R.id)){E(De=>{const qe=new Set(De);return qe.delete(D),qe});return}C.groupId===R.id?d(R.id,C.objectId,I):r(C.objectId,R.id,I)||L(`${((Ye=s[C.objectId])==null?void 0:Ye.name)??"Object"} is not compatible with ${R.name}.`)}},Ze=m=>{const R=s[m],D=(R==null?void 0:R.childObjectIds)??[],I=Object.values(s).filter(C=>C.parentObjectId===m).map(C=>C.id);return[...new Set([...D,...I])].filter(C=>!!s[C])},$=(m,R,D,I)=>{const C=s[m];if(!C)return null;const Ye=l===m,De=Ze(m),qe=F.has(m);return e.jsxs("div",{style:{display:"grid",gap:4},children:[e.jsxs("div",{draggable:!0,onDragStart:te=>Pe(te,{kind:"object",groupId:R.id,objectId:m}),onDragOver:te=>te.preventDefault(),onDrop:te=>ve(te,R,m,D),onClick:()=>n(m),style:{display:"grid",gridTemplateColumns:`${De.length?22:0}px ${x?"22px ":""}minmax(0,1fr)`,alignItems:"center",gap:De.length||x?6:0,minHeight:30,padding:`4px 7px 4px ${Math.max(10,24+I*16)}px`,border:Ye?"1px solid rgba(56,189,248,.55)":"1px solid transparent",borderRadius:8,background:Ye?"rgba(56,189,248,.12)":"rgba(255,255,255,.025)",cursor:"grab",opacity:C.enabled?1:.5},children:[De.length?e.jsx("button",{type:"button",style:it,onClick:te=>{te.stopPropagation(),E(Rt=>{const ft=new Set(Rt);return ft.has(m)?ft.delete(m):ft.add(m),ft})},children:qe?"▸":"▾"}):e.jsx("span",{}),x?e.jsx("button",{type:"button",style:it,onClick:te=>{te.stopPropagation(),x(m,!C.enabled)},children:C.enabled?"●":"○"}):null,e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",fontSize:10},children:C.name})]}),qe?null:De.map((te,Rt)=>$(te,R,Rt,I+1))]},m)},Z=async()=>{if(c!==void 0)try{await jo(JSON.stringify(c,null,2)),le(!0),window.setTimeout(()=>le(!1),1400)}catch{L("Unable to copy the scene configuration.")}};return v(e.jsx(e.Fragment,{children:i?e.jsxs("section",{style:p?M:{...At,maxHeight:`calc(100vh - ${j.y+16}px)`},children:[e.jsx("header",{onPointerDown:m=>w(m,{capture:!1,selectNone:!1}),style:{position:"sticky",top:0,zIndex:2,padding:"10px 12px",borderBottom:"1px solid rgba(255,255,255,.08)",background:"rgba(8,15,28,.94)",cursor:p?"default":"grab"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},children:[e.jsx("strong",{children:g}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button","aria-label":`Fold ${g}`,"aria-expanded":"true",onPointerDown:m=>m.stopPropagation(),onClick:()=>u(!1),style:it,children:"−"})]})}),e.jsxs("div",{style:{display:"grid",gap:7,padding:7},children:[c!==void 0&&e.jsx("button",{type:"button",onClick:Z,style:{width:"100%",height:28,borderRadius:8,border:"1px solid rgba(56,189,248,.28)",background:"rgba(56,189,248,.14)",color:"#e0f2fe",cursor:"pointer",fontSize:10,fontWeight:700},children:P?"Copied Config":"Copy Config"}),Ae.map(m=>{const R=t.findIndex(I=>I.id===m.id),D=U.has(m.id);return e.jsxs("section",{onDragOver:I=>I.preventDefault(),onDrop:I=>W(I,m,R),style:{border:"1px solid rgba(255,255,255,.1)",borderRadius:10,overflow:"hidden",opacity:m.enabled?1:.55},children:[e.jsxs("div",{draggable:!0,onDragStart:I=>Pe(I,{kind:"group",groupId:m.id}),style:{display:"grid",gridTemplateColumns:"22px 22px minmax(0,1fr)",gap:5,alignItems:"center",padding:"6px",background:"rgba(255,255,255,.06)",cursor:"grab"},children:[e.jsx("button",{type:"button",style:it,onClick:()=>b(I=>{const C=new Set(I);return C.has(m.id)?C.delete(m.id):C.add(m.id),C}),children:D?"▸":"▾"}),e.jsx("button",{type:"button",style:it,title:"Toggle group visibility",onClick:()=>h(m.id,!m.enabled),children:m.enabled?"◉":"○"}),e.jsx("div",{style:{minWidth:0},children:e.jsx("div",{style:{fontSize:10,fontWeight:700},children:m.name})})]}),!D&&e.jsx("div",{style:{display:"grid",gap:4,padding:m.objectIds.length?5:0},children:m.objectIds.filter(I=>{var C;return!((C=s[I])!=null&&C.parentObjectId)}).map((I,C)=>$(I,m,C,0))})]},m.id)}),ae&&e.jsx("div",{role:"alert",style:{color:"#fca5a5",fontSize:9,padding:"2px 5px 5px"},children:ae})]})]}):e.jsx("button",{type:"button","aria-expanded":"false",onClick:()=>u(!0),style:{...M,width:"auto",padding:"9px 12px",cursor:"pointer",fontSize:11,fontWeight:700},children:g})}))},mt={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},mo=t=>({display:"grid",gridTemplateColumns:`92px repeat(${t}, minmax(0, 1fr))`,alignItems:"center",gap:6,margin:"8px 0"}),So={fontSize:12,color:"#cbd5e1"},Pt={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},vo={width:"100%",minWidth:0,height:24,boxSizing:"border-box",borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",padding:"0 7px",outline:0,color:"#f8fafc",fontSize:10.5,fontVariantNumeric:"tabular-nums"},wo=t=>/^-?\d*(\.\d*)?$/.test(t),St=t=>Number.isFinite(t)?String(t):"0",ko=({onChange:t,value:s})=>{const[l,n]=y.useState(St(s));return y.useEffect(()=>{n(St(s))},[s]),e.jsx("input",{style:vo,type:"text",inputMode:"decimal",value:l,placeholder:"0",onBlur:()=>{if(l.trim()===""){n(St(s));return}const a=Number(l);if(Number.isNaN(a)){n(St(s));return}t(a)},onChange:a=>{const d=a.currentTarget.value;if(!wo(d)||(n(d),d===""||d==="-"||d==="."||d==="-."))return;const r=Number(d);Number.isNaN(r)||t(r)},onKeyDown:a=>{if(a.key!=="ArrowUp"&&a.key!=="ArrowDown")return;a.preventDefault();const d=a.shiftKey?1:a.altKey?.01:.1,r=a.key==="ArrowUp"?s+d:s-d;t(Number(r.toFixed(6)))}})},Dt=({axes:t=["x","y","z"],label:s,onChange:l,value:n})=>e.jsxs("div",{style:mo(t.length),children:[e.jsx("div",{style:So,children:s}),t.map(a=>e.jsx(ko,{value:n[a],onChange:d=>l({...n,[a]:d})},a))]}),$s=({value:t,onChange:s,targets:l=[]})=>e.jsxs("section",{style:{padding:10,borderRadius:10,background:"rgba(255,255,255,.04)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontWeight:700,color:"#f8fafc"},children:[e.jsx("span",{children:"Pin to Mesh"}),e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:n=>s({...t,enabled:n.target.checked})})]}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Target"}),e.jsxs("select",{style:Pt,value:t.targetObjectId??"",onChange:n=>s({...t,targetObjectId:n.target.value||null}),children:[e.jsx("option",{value:"",children:"None (Transform)"}),l.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Orientation"}),e.jsxs("select",{style:Pt,value:t.orientation,onChange:n=>s({...t,orientation:n.target.value}),children:[e.jsx("option",{value:"none",children:"None"}),e.jsx("option",{value:"position",children:"Position"}),e.jsx("option",{value:"positionAndDirection",children:"Position and Direction"})]})]}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Offset Space"}),e.jsxs("select",{style:Pt,value:t.offsetSpace,onChange:n=>s({...t,offsetSpace:n.target.value}),children:[e.jsx("option",{value:"local",children:"Local"}),e.jsx("option",{value:"world",children:"World"})]})]}),e.jsx(Dt,{axes:["x","y"],label:"UV",value:{x:t.uv.x,y:t.uv.y,z:0},onChange:n=>s({...t,uv:{x:n.x,y:n.y}})}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Vertex Normal"}),e.jsx("input",{type:"checkbox",checked:t.vertexNormal,onChange:n=>s({...t,vertexNormal:n.target.checked})})]}),e.jsx(Dt,{label:"Offset Position",value:t.offsetPosition,onChange:n=>s({...t,offsetPosition:n})}),e.jsx(Dt,{label:"Offset Rotation",value:t.offsetRotation,onChange:n=>s({...t,offsetRotation:n})})]}),Co={position:"fixed",zIndex:2e4,pointerEvents:"none"},Ro={pointerEvents:"auto",width:284,maxHeight:"min(620px, calc(100vh - 32px))",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.62)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden",fontFamily:"Inter, ui-sans-serif, system-ui, sans-serif"},Io={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Eo={display:"flex",alignItems:"center",gap:6,minWidth:0,fontSize:11,fontWeight:700},To={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},zo={display:"grid",gap:8,padding:10,maxHeight:"min(548px, calc(100vh - 104px))",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},ot={display:"grid",gap:4,fontSize:10,color:"rgba(226,232,240,0.78)"},vt={width:"100%",minWidth:0,height:28,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.8)",color:"#f8fafc",padding:"0 8px",boxSizing:"border-box"},Mo={height:24,borderRadius:8,border:"1px solid rgba(56,189,248,0.25)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",cursor:"pointer",fontSize:10,fontWeight:700,padding:"0 8px"},Fo={display:"grid",gridTemplateColumns:"1fr 74px",alignItems:"center",gap:8},Wo=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),Lo=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2.1-1.6-2-3.5-2.5 1a8 8 0 0 0-2.6-1.5L14 2h-4l-.4 2.9A8 8 0 0 0 7 6.4l-2.5-1-2 3.5 2.1 1.6A10 10 0 0 0 4.5 12c0 .5 0 1 .1 1.5l-2.1 1.6 2 3.5 2.5-1a8 8 0 0 0 2.6 1.5L10 22h4l.4-2.9a8 8 0 0 0 2.6-1.5l2.5 1 2-3.5-2.1-1.6zM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5z"})}),$o=(t,s)=>{const l=t.find(n=>String(n.value)===s);return(l==null?void 0:l.value)??s};function Se({title:t,value:s,fields:l,onChange:n,copyLabel:a,copyPayload:d,initialPosition:r}){const[o,h]=y.useState(r??{x:14,y:452}),x=y.useRef(null);y.useEffect(()=>{const g=u=>{x.current&&h({x:Math.max(8,u.clientX-x.current.x),y:Math.max(8,u.clientY-x.current.y)})},i=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",i),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",i)}},[]);const c=(g,i)=>{n({...s,[g]:i})},p=async()=>{var i;const g=(d==null?void 0:d(s))??{name:a??t,kind:"settings",settings:s};await((i=navigator.clipboard)==null?void 0:i.writeText(JSON.stringify(g,null,2)))},f=g=>{var u;const i=(u=g.currentTarget.parentElement)==null?void 0:u.parentElement;i&&(x.current={x:g.clientX-i.getBoundingClientRect().left,y:g.clientY-i.getBoundingClientRect().top},document.body.classList.add("select-none"))};return e.jsx("div",{style:{...Co,left:o.x,top:o.y},children:e.jsxs("div",{style:Ro,children:[e.jsxs("div",{style:Io,children:[e.jsxs("div",{style:Eo,children:[e.jsx("span",{style:To,onPointerDown:f,children:e.jsx(Wo,{})}),e.jsx(Lo,{}),e.jsx("span",{children:t})]}),e.jsx("button",{style:Mo,type:"button",onClick:p,children:"Copy"})]}),e.jsx("div",{style:zo,children:l.map(g=>{const i=s[g.key];if(g.type==="boolean")return e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("input",{type:"checkbox",checked:!!i,onChange:u=>c(g.key,u.target.checked)})]},g.key);if(g.type==="number"){const u=Number(i),j=g.min??0,w=g.max??1,v=g.step??.01;return e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsxs("div",{style:Fo,children:[e.jsx("input",{type:"range",min:j,max:w,step:v,value:u,onChange:M=>c(g.key,Number(M.target.value))}),e.jsx("input",{style:vt,type:"number",min:j,max:w,step:v,value:u,onChange:M=>c(g.key,Number(M.target.value))})]})]},g.key)}return g.type==="color"?e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("input",{style:{...vt,padding:2},type:"color",value:String(i),onChange:u=>c(g.key,u.target.value)})]},g.key):g.type==="select"?e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("select",{style:vt,value:String(i),onChange:u=>c(g.key,$o(g.options,u.target.value)),children:g.options.map(u=>e.jsx("option",{value:String(u.value),children:u.label},`${g.key}-${String(u.value)}`))})]},g.key):e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("input",{style:vt,type:"text",value:String(i),onChange:u=>c(g.key,u.target.value)})]},g.key)})})]})})}const No=({title:t="Face Retouch",value:s,onChange:l,initialPosition:n})=>{const a=N.resolveFaceRetouchControls(s);return e.jsx(Se,{title:t,value:a,fields:N.FACE_RETOUCH_SETTINGS_FIELDS,onChange:d=>l(N.patchFaceRetouchControls(a,d)),initialPosition:n})},Oo=({title:t="Face Swap",value:s,onChange:l,source:n,initialPosition:a})=>{const d=N.resolveFaceSwapSettings(s,{source:n});return e.jsx(Se,{title:t,value:d,fields:N.FACE_SWAP_SETTINGS_FIELDS,onChange:r=>l(N.patchFaceSwapSettings(d,r)),initialPosition:a})},Ao=({title:t="Gesture",value:s,defaults:l,onChange:n,initialPosition:a})=>{const d=Ne.resolveGestureSettings(s,l);return e.jsx(Se,{title:t,value:d,fields:Ne.GESTURE_SETTINGS_FIELDS,onChange:r=>n(Ne.patchGestureSettings(d,r)),initialPosition:a})},Po=({title:t="Iris Effect",value:s,onChange:l,initialPosition:n})=>{const a=N.resolveIrisEffectSettings(s);return e.jsx(Se,{title:t,value:a,fields:N.IRIS_EFFECT_SETTINGS_FIELDS,onChange:d=>l(N.patchIrisEffectSettings(a,d)),initialPosition:n})},Do=({title:t="Lip Effect",value:s,onChange:l,initialPosition:n})=>{const a=N.resolveLipEffectSettings(s);return e.jsx(Se,{title:t,value:a,fields:N.LIP_EFFECT_SETTINGS_FIELDS,onChange:d=>l(N.patchLipEffectSettings(a,d)),initialPosition:n})},Bo=({title:t="Product hotspots",hotspots:s,placing:l,onPlacingChange:n,variants:a,initialPosition:d={x:16,y:16},docked:r=!1})=>{const[o,h]=y.useState(!1),x=async()=>{try{await navigator.clipboard.writeText(s.json),h(!0),setTimeout(()=>h(!1),1200)}catch{h(!1)}};return e.jsxs("div",{style:r?{...A.shell,...kt,position:"static"}:{...A.shell,left:d.x,top:d.y},children:[e.jsx("div",{style:A.header,children:t}),e.jsxs("div",{style:A.body,children:[a&&a.variants.length>0&&e.jsxs("label",{style:A.row,children:[e.jsx("span",{style:A.label,children:"variant"}),e.jsxs("select",{style:A.input,value:a.variant??"",onChange:c=>a.setVariant(c.target.value||null),children:[e.jsx("option",{value:"",children:"default"}),a.variants.map(c=>e.jsx("option",{value:c,children:c},c))]})]}),e.jsxs("div",{style:A.row,children:[e.jsx("button",{type:"button",style:{...A.button,...l?A.active:null},onClick:()=>n(!l),children:l?"placing: click the model":"place hotspot"}),e.jsx("button",{type:"button",style:A.button,onClick:()=>void x(),children:o?"copied":"copy JSON"}),e.jsx("button",{type:"button",style:A.button,onClick:s.clear,children:"clear"})]}),s.hotspots.length===0?e.jsx("div",{style:A.hint,children:"no hotspots yet"}):s.hotspots.map(c=>e.jsxs("div",{style:A.item,children:[e.jsx("input",{style:{...A.input,flex:1},value:c.label??"",placeholder:c.id,onChange:p=>s.update(c.id,{label:p.target.value})}),e.jsx("span",{style:A.coord,children:c.position.map(p=>p.toFixed(2)).join(", ")}),e.jsx("button",{type:"button",style:A.button,onClick:()=>s.remove(c.id),children:"×"})]},c.id))]})]})},A={shell:{position:"fixed",zIndex:2e4,width:300,maxHeight:"min(560px, calc(100vh - 32px))",overflow:"auto",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.72)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11},header:{padding:"8px 10px",fontWeight:700,borderBottom:"1px solid rgba(255,255,255,0.08)"},body:{padding:"6px 10px 10px"},row:{display:"flex",gap:6,alignItems:"center",margin:"4px 0",flexWrap:"wrap"},label:{color:"#94a3b8"},input:{font:"inherit",background:"#0b1220",color:"#f8fafc",border:"1px solid #334155",borderRadius:4,padding:"3px 6px"},button:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.18)",color:"#f8fafc",borderRadius:6,padding:"4px 8px",cursor:"pointer",font:"inherit"},active:{borderColor:"#22d3ee",color:"#22d3ee"},hint:{color:"#94a3b8"},item:{display:"flex",gap:6,alignItems:"center",margin:"4px 0"},coord:{color:"#94a3b8",whiteSpace:"nowrap"}},rt={ready:"#4ade80",loading:"#facc15",paused:"#93c5fd",unavailable:"#64748b",error:"#f87171"},Ke=(t,s=0,l="")=>t==null||Number.isNaN(t)?"–":`${t.toFixed(s)}${l}`,X=({label:t,value:s,color:l})=>e.jsxs("div",{style:V.row,children:[e.jsx("span",{style:V.rowLabel,children:t}),e.jsx("span",{style:{...V.rowValue,color:l??V.rowValue.color},children:s})]}),Vo=({title:t="XR Diagnostics",intervalMs:s=250,models:l,initialPosition:n={x:16,y:16},docked:a=!1,defaultCollapsed:d=!1,onSample:r})=>{const o=_s.useXRDiagnostics({intervalMs:s,models:l}),[h,x]=y.useState(d);r==null||r(o);const{session:c}=o;return e.jsxs("div",{style:a?{...V.shell,...kt,position:"static"}:{...V.shell,left:n.x,top:n.y},"data-testid":"xr-diagnostics-panel",children:[e.jsxs("div",{style:V.header,children:[e.jsx("span",{style:V.title,children:t}),e.jsx("button",{type:"button",onClick:()=>x(p=>!p),style:V.toggle,"aria-label":h?"Expand diagnostics":"Collapse diagnostics",children:h?"+":"–"})]}),!h&&e.jsxs("div",{style:V.body,children:[e.jsx("div",{style:V.section,children:"session"}),e.jsx(X,{label:"lifecycle",value:c.lifecycle,color:c.lifecycle==="running"?rt.ready:rt.paused}),e.jsx(X,{label:"ready",value:c.ready?"yes":"no"}),e.jsx(X,{label:"source",value:`${c.source??"–"} / ${c.sourceKind??"–"}`}),e.jsx(X,{label:"camera",value:c.sourceWidth?`${c.sourceWidth}×${c.sourceHeight}`:"unbound"}),e.jsx(X,{label:"feed",value:c.renderWidth?`${c.renderWidth}×${c.renderHeight} @ ${Ke(c.feedFps,0)} fps`:"–"}),e.jsx(X,{label:"inference",value:Ke(o.inferenceMsTotal,1," ms / frame")}),o.quality&&e.jsx(X,{label:"quality",value:`${o.quality.tier} (${o.quality.reason})${o.quality.locked?" · locked":""}`}),c.error&&e.jsx(X,{label:"error",value:`${c.error.reason}`,color:rt.error}),o.models.map(p=>e.jsxs("div",{style:V.model,children:[e.jsxs("div",{style:V.modelHeader,children:[e.jsx("span",{style:V.modelName,children:p.label}),e.jsx("span",{style:{...V.badge,color:rt[p.state]},children:p.state})]}),p.state!=="unavailable"&&e.jsxs(e.Fragment,{children:[e.jsx(X,{label:"inference",value:`${Ke(p.inferenceMs,1," ms")} · ${Ke(p.inferenceFps,0)} fps${p.targetFps?` (cap ${p.targetFps})`:""}`}),e.jsx(X,{label:"frames",value:`${p.inferences} run · ${p.skippedFrames} skipped`}),e.jsx(X,{label:"detections",value:`${Ke(p.detections)} · conf ${Ke(p.confidence,2)}`}),e.jsx(X,{label:"owners",value:`${p.owners.refs.length} (${p.owners.active.length} active)`})]}),p.error&&e.jsx(X,{label:"error",value:p.error.message,color:rt.error})]},p.model))]})]})},V={shell:{position:"fixed",zIndex:2e4,width:284,maxHeight:"min(640px, calc(100vh - 32px))",overflow:"auto",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.72)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 10px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",position:"sticky",top:0},title:{fontWeight:700},toggle:{background:"transparent",border:"1px solid rgba(255,255,255,0.2)",color:"#f8fafc",borderRadius:6,width:22,height:22,cursor:"pointer"},body:{padding:"6px 10px 10px"},section:{color:"#94a3b8",textTransform:"uppercase",fontSize:9,letterSpacing:1,margin:"6px 0 2px"},row:{display:"flex",justifyContent:"space-between",gap:8,padding:"2px 0"},rowLabel:{color:"#94a3b8"},rowValue:{color:"#e2e8f0",textAlign:"right",overflowWrap:"anywhere"},model:{marginTop:8,paddingTop:6,borderTop:"1px solid rgba(255,255,255,0.08)"},modelHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"},modelName:{fontWeight:700},badge:{fontSize:10,textTransform:"uppercase",letterSpacing:.5}},Ko=({title:t="Holistic Tracker",value:s,onChange:l,initialPosition:n})=>{const a=Ne.resolveHolisticTrackerSettings(s);return e.jsx(Se,{title:t,value:a,fields:Ne.HOLISTIC_TRACKER_SETTINGS_FIELDS,onChange:d=>l(Ne.patchHolisticTrackerSettings(a,d)),initialPosition:n})},Ho=({title:t="Segmentation Overlay",value:s,onChange:l,initialPosition:n})=>{const a=It.resolveSegmentationOverlaySettings(s);return e.jsx(Se,{title:t,value:a,fields:It.SEGMENTATION_OVERLAY_SETTINGS_FIELDS,onChange:d=>l(It.patchSegmentationOverlaySettings(a,d)),initialPosition:n})},Go={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},_o={pointerEvents:"auto",width:298,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Uo={display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Xo={display:"grid",gap:8,padding:8},Ns={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:700},Os={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},Zo={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Yo={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},qo={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},Jo={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},Qo=t=>({...Jo,width:30,height:26,color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)"}),er={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},tr={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},sr={display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:6},nr={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,marginBottom:7},lr={display:"grid",gridTemplateColumns:"62px repeat(3, minmax(0, 1fr)) 24px",alignItems:"center",gap:6,marginTop:6},ir={fontSize:10,color:"rgba(226,232,240,0.82)"},or=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:22,borderRadius:7,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#e0f2fe":"rgba(226,232,240,0.75)",cursor:"pointer"}),ys={display:"flex",flexDirection:"column",gap:4,fontSize:9,color:"rgba(226,232,240,0.72)"},rr={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box",fontVariantNumeric:"tabular-nums"},ar={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,fontSize:9,color:"rgba(226,232,240,0.72)"},As={width:15,height:15,accentColor:"#38bdf8",cursor:"pointer"},bs=t=>({height:25,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#e0f2fe":"rgba(226,232,240,0.82)",fontSize:10,fontWeight:700,cursor:"pointer"}),dr=t=>/^-?\d*(\.\d*)?$/.test(t),cr=({value:t,onChange:s,step:l=.1})=>{const[n,a]=y.useState(String(t));return y.useEffect(()=>a(String(t)),[t]),e.jsx("input",{type:"text",inputMode:"decimal",style:rr,value:n,onChange:d=>{const r=d.target.value;if(!dr(r)||(a(r),r===""||r==="-"||r==="."||r==="-."))return;const o=Number(r);Number.isNaN(o)||s(o)},onBlur:()=>{const d=Number(n);if(Number.isNaN(d)){a(String(t));return}s(d)},onKeyDown:d=>{if(d.key!=="ArrowUp"&&d.key!=="ArrowDown")return;d.preventDefault();const r=d.shiftKey?l*10:d.altKey?l/10:l,o=d.key==="ArrowUp"?t+r:t-r;s(Number(o.toFixed(6)))}})},Ps=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),pr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 12a5 5 0 0 1 5-5h3v2h-3a3 3 0 0 0 0 6h3v2h-3a5 5 0 0 1-5-5zm4-1h2v2h-2v-2zm-2 6H6a5 5 0 0 1 0-10h3v2H6a3 3 0 0 0 0 6h3v2zm6-10h3a5 5 0 0 1 0 10h-3v-2h3a3 3 0 0 0 0-6h-3V7z"})}),hr=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),ur=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),gr=({value:t,onChange:s})=>{const l=t.transformControlMode??"translate",n=t.transformControlSpace??"local",a=t.showTransformControls??!1;return e.jsxs("div",{style:{marginTop:8},children:[e.jsxs("label",{style:ar,children:[e.jsx("span",{children:"Show Transform On"}),e.jsx("input",{type:"checkbox",checked:a,style:As,onChange:d=>s({...t,showTransformControls:d.currentTarget.checked})})]}),e.jsxs("div",{style:{...ys,marginTop:8},children:["Mode",e.jsx("div",{style:sr,children:["translate","rotate","scale"].map(d=>e.jsx("button",{type:"button",style:bs(l===d),onClick:()=>s({...t,transformControlMode:d}),children:d==="translate"?"Move":d==="rotate"?"Rotate":"Scale"},d))})]}),e.jsxs("div",{style:{...ys,marginTop:8},children:["Space",e.jsx("div",{style:tr,children:["local","world"].map(d=>e.jsx("button",{type:"button",style:bs(n===d),onClick:()=>s({...t,transformControlSpace:d}),children:d==="local"?"Local":"World"},d))})]})]})},_t=({value:t,onChange:s})=>{var d,r,o;const l={position:((d=t.linked)==null?void 0:d.position)??!1,rotation:((r=t.linked)==null?void 0:r.rotation)??!1,scale:((o=t.linked)==null?void 0:o.scale)??!1},n=(h,x)=>{const c=t[h];s({...t,linked:{...l,[h]:x},[h]:x?{x:c.x,y:c.x,z:c.x}:c})},a=(h,x,c,p)=>e.jsxs("div",{style:lr,children:[e.jsx("div",{style:ir,children:x}),["x","y","z"].map(f=>e.jsx(cr,{value:c[f],step:p,onChange:g=>l[h]?s({...t,[h]:{x:g,y:g,z:g}}):s({...t,[h]:{...c,[f]:g}})},f)),e.jsx("button",{type:"button","aria-label":l[h]?`Unlink ${x}`:`Link ${x}`,title:l[h]?`Unlink ${x}`:`Link ${x}`,style:or(l[h]),onClick:()=>n(h,!l[h]),children:e.jsx(pr,{})})]});return e.jsxs("div",{style:er,children:[e.jsxs("div",{style:nr,children:[e.jsxs("div",{style:Ns,children:[e.jsx("span",{style:Os,children:e.jsx(Ps,{})}),e.jsx("span",{children:"Transform"})]}),e.jsx("input",{type:"checkbox",checked:t.enabled,style:As,onChange:h=>s({...t,enabled:h.currentTarget.checked})})]}),a("position","Position",t.position,.001),a("rotation","Rotation",t.rotation,1),a("scale","Scale",t.scale),e.jsx(gr,{value:t,onChange:s})]})},yr=({value:t,onChange:s,copyLabel:l="Selected transform"})=>{const[n,a]=y.useState({x:14,y:104}),[d,r]=y.useState(!1),o=y.useRef(null);y.useEffect(()=>{const c=f=>{o.current&&a({x:Math.max(8,f.clientX-o.current.x),y:Math.max(8,f.clientY-o.current.y)})},p=()=>{o.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",p),()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",p)}},[]);const h=c=>{const p=c.currentTarget.getBoundingClientRect();o.current={x:c.clientX-p.left,y:c.clientY-p.top},document.body.classList.add("select-none"),c.currentTarget.setPointerCapture(c.pointerId)},x=async()=>{await navigator.clipboard.writeText(JSON.stringify({name:l,kind:"transform3D",transform:t},null,2)),r(!0),window.setTimeout(()=>r(!1),1200)};return typeof document>"u"?null:Oe.createPortal(e.jsx("div",{style:{...Go,left:n.x,top:n.y},children:e.jsxs("div",{style:_o,children:[e.jsxs("div",{style:Uo,children:[e.jsx("div",{onPointerDown:h,style:Zo,children:e.jsx(hr,{})}),e.jsxs("div",{style:Ns,children:[e.jsx("span",{style:Os,children:e.jsx(Ps,{})}),e.jsx("span",{children:"Transform"})]})]}),e.jsxs("div",{style:Xo,children:[e.jsxs("div",{style:Yo,children:[e.jsx("button",{type:"button",style:qo,onClick:x,children:d?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button","aria-label":t.visible?"Hide Transform":"Show Transform",title:t.visible?"Hide Transform":"Show Transform",style:Qo(t.visible),onClick:()=>s({...t,visible:!t.visible}),children:t.visible?e.jsx(xr,{}):e.jsx(ur,{})})]}),e.jsx(_t,{value:t,onChange:s})]})]})}),document.body)},br={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},fr={display:"flex",alignItems:"center",gap:6,marginBottom:7,fontSize:11,fontWeight:700},jr={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},fs={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},q={display:"flex",flexDirection:"column",gap:4,fontSize:9,color:"rgba(226,232,240,0.72)"},Ut={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},He={...Ut,cursor:"pointer"},de={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:24,fontSize:9,color:"rgba(226,232,240,0.72)"},ce={width:15,height:15,accentColor:"#38bdf8",cursor:"pointer"},mr={marginTop:10,paddingTop:10,borderTop:"1px solid rgba(255,255,255,0.08)"},Sr={marginBottom:7,fontSize:10,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(226,232,240,0.74)"},vr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),wr=(t,s,l)=>Math.min(l,Math.max(s,t)),at=({max:t,min:s,onChange:l,step:n,value:a})=>e.jsx("input",{type:"number",min:s,max:t,step:n??.01,style:Ut,value:a,onChange:d=>{const r=Number(d.currentTarget.value);Number.isNaN(r)||l(wr(r,s??Number.NEGATIVE_INFINITY,t??Number.POSITIVE_INFINITY))}}),Ds=({value:t,onChange:s})=>{const l=o=>{s({...t,material:{...t.material,...o}})},n=Us.normalizeMeshRendererRenderState(t.material.renderState),a=o=>{l({renderState:{...n,...o,colorMask:{...n.colorMask,...o.colorMask},polygonOffset:{...n.polygonOffset,...o.polygonOffset}}})},d=o=>{a({polygonOffset:{...n.polygonOffset,...o}})},r=o=>{a({colorMask:{...n.colorMask,...o}})};return e.jsxs("div",{style:br,children:[e.jsxs("div",{style:fr,children:[e.jsx("span",{style:jr,children:e.jsx(vr,{})}),e.jsx("span",{children:"Mesh Renderer"})]}),e.jsxs("div",{style:fs,children:[e.jsxs("label",{style:q,children:["Mesh",e.jsxs("select",{style:He,value:t.mesh,onChange:o=>s({...t,mesh:o.currentTarget.value}),children:[e.jsx("option",{value:"cube",children:"Cube"}),e.jsx("option",{value:"sphere",children:"Sphere"}),e.jsx("option",{value:"plane",children:"Plane"})]})]}),e.jsxs("label",{style:q,children:["Material",e.jsxs("select",{style:He,value:t.material.type,onChange:o=>l({type:o.currentTarget.value}),children:[e.jsx("option",{value:"standard",children:"Standard"}),e.jsx("option",{value:"basic",children:"Basic"})]})]}),e.jsxs("label",{style:q,children:["Color",e.jsx("input",{type:"color",style:{...Ut,padding:2},value:t.material.color,onChange:o=>l({color:o.currentTarget.value})})]}),e.jsxs("label",{style:q,children:["Opacity",e.jsx(at,{min:0,max:1,step:.01,value:t.material.opacity,onChange:o=>l({opacity:o})})]}),e.jsxs("label",{style:q,children:["Roughness",e.jsx(at,{min:0,max:1,step:.01,value:t.material.roughness,onChange:o=>l({roughness:o})})]}),e.jsxs("label",{style:q,children:["Metalness",e.jsx(at,{min:0,max:1,step:.01,value:t.material.metalness,onChange:o=>l({metalness:o})})]}),e.jsxs("label",{style:q,children:["Shadow Mode",e.jsxs("select",{style:He,value:t.shadowMode,onChange:o=>s({...t,shadowMode:o.currentTarget.value}),children:[e.jsx("option",{value:"off",children:"Off"}),e.jsx("option",{value:"cast",children:"Cast"}),e.jsx("option",{value:"receive",children:"Receive"}),e.jsx("option",{value:"castReceive",children:"Cast + Receive"})]})]}),e.jsxs("label",{style:de,children:["Wireframe",e.jsx("input",{type:"checkbox",checked:t.material.wireframe,style:ce,onChange:o=>l({wireframe:o.currentTarget.checked})})]})]}),e.jsxs("div",{style:mr,children:[e.jsx("div",{style:Sr,children:"Render State"}),e.jsxs("div",{style:fs,children:[e.jsxs("label",{style:de,children:["Depth Test",e.jsx("input",{type:"checkbox",checked:n.depthTest,style:ce,onChange:o=>a({depthTest:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Depth Write",e.jsx("input",{type:"checkbox",checked:n.depthWrite,style:ce,onChange:o=>a({depthWrite:o.currentTarget.checked})})]}),e.jsxs("label",{style:q,children:["Depth Function",e.jsxs("select",{style:He,value:n.depthFunc,onChange:o=>a({depthFunc:o.currentTarget.value}),children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"less",children:"Less"}),e.jsx("option",{value:"equal",children:"Equal"}),e.jsx("option",{value:"lessEqual",children:"Less Equal"}),e.jsx("option",{value:"greater",children:"Greater"}),e.jsx("option",{value:"notEqual",children:"Not Equal"}),e.jsx("option",{value:"greaterEqual",children:"Greater Equal"}),e.jsx("option",{value:"always",children:"Always"})]})]}),e.jsxs("label",{style:de,children:["Color Write",e.jsx("input",{type:"checkbox",checked:n.colorWrite,style:ce,onChange:o=>a({colorWrite:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask R",e.jsx("input",{type:"checkbox",checked:n.colorMask.r,style:ce,onChange:o=>r({r:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask G",e.jsx("input",{type:"checkbox",checked:n.colorMask.g,style:ce,onChange:o=>r({g:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask B",e.jsx("input",{type:"checkbox",checked:n.colorMask.b,style:ce,onChange:o=>r({b:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask A",e.jsx("input",{type:"checkbox",checked:n.colorMask.a,style:ce,onChange:o=>r({a:o.currentTarget.checked})})]}),e.jsxs("label",{style:q,children:["Cull Mode",e.jsxs("select",{style:He,value:n.cullMode,onChange:o=>a({cullMode:o.currentTarget.value}),children:[e.jsx("option",{value:"back",children:"Back"}),e.jsx("option",{value:"front",children:"Front"}),e.jsx("option",{value:"off",children:"Off"})]})]}),e.jsxs("label",{style:q,children:["Blend Mode",e.jsxs("select",{style:He,value:n.blendMode,onChange:o=>a({blendMode:o.currentTarget.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"additive",children:"Additive"}),e.jsx("option",{value:"subtractive",children:"Subtractive"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"none",children:"None"})]})]}),e.jsxs("label",{style:de,children:["Polygon Offset",e.jsx("input",{type:"checkbox",checked:n.polygonOffset.enabled,style:ce,onChange:o=>d({enabled:o.currentTarget.checked})})]}),e.jsxs("label",{style:q,children:["Offset Factor",e.jsx(at,{step:.1,value:n.polygonOffset.factor,onChange:o=>d({factor:o})})]}),e.jsxs("label",{style:q,children:["Offset Units",e.jsx(at,{step:.1,value:n.polygonOffset.units,onChange:o=>d({units:o})})]})]})]})]})},kr={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:"8px 8px 56px"},Cr={marginBottom:7,fontSize:11,fontWeight:700},Rr={marginTop:10,paddingTop:10,borderTop:"1px solid rgba(255,255,255,0.08)"},Ir={marginBottom:7,fontSize:10,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(226,232,240,0.74)"},T={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},he={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Er={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6,marginTop:8,color:"#cbd5e1",fontSize:11},ye=({max:t,min:s,onChange:l,step:n,value:a})=>e.jsx("input",{type:"number",min:s,max:t,step:n??1,style:he,value:a,onChange:d=>{const r=Number(d.currentTarget.value);Number.isNaN(r)||l(r)}}),Me=({onChange:t,options:s,value:l})=>e.jsx("select",{style:he,value:l,onChange:n=>t(n.currentTarget.value),children:s.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),dt=({children:t,title:s})=>e.jsxs("div",{style:Rr,children:[e.jsx("div",{style:Ir,children:s}),t]}),Xt=({onChange:t,value:s})=>{const l=p=>t(J.resolveFaceMeshRendererSettings(s,p)),n=J.supportsTexturePanel(s.materialType,s.shaderPreset),a=J.supportsBlendMode(s.materialType,s.shaderPreset,s.textureMap),d=s.materialType===J.FACE_MESH_MATERIAL_TYPES.shader&&s.shaderPreset===J.FACE_MESH_SHADER_PRESETS.composite?N.textureMapOptions.filter(p=>p.value!==J.FACE_MESH_TEXTURE_MAPS.none):N.textureMapOptions,r=J.usesMaskColor(s.maskTextureSource),o=J.usesMaskSourceUrl(s.maskTextureSource),h=p=>{l({shaderPreset:p})},x=p=>{l({materialType:p})},c=e.jsxs(dt,{title:"Geometry",children:[e.jsxs("div",{style:Er,children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showLeftEyeGeometry,onChange:p=>l({showLeftEyeGeometry:p.currentTarget.checked})})," ","Left Eye"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showRightEyeGeometry,onChange:p=>l({showRightEyeGeometry:p.currentTarget.checked})})," ","Right Eye"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showNoseGeometry,onChange:p=>l({showNoseGeometry:p.currentTarget.checked})})," ","Nose"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showMouthGeometry,onChange:p=>l({showMouthGeometry:p.currentTarget.checked})})," ","Mouth"]})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Show Overlay Mask"}),e.jsx("input",{type:"checkbox",checked:s.showOverlayMask,onChange:p=>l({showOverlayMask:p.currentTarget.checked})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Source"}),e.jsx(Me,{value:s.maskTextureSource,options:N.maskTextureSourceOptions,onChange:p=>l({maskTextureSource:p})})]}),o?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"URL"}),e.jsx("input",{type:"url",style:he,value:s.maskSourceUrl,onChange:p=>l({maskSourceUrl:p.currentTarget.value})})]}):null,r?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...he,padding:2},value:s.maskColor,onChange:p=>l({maskColor:p.currentTarget.value})})]}):null,e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Overlay Opacity"}),e.jsx(ye,{min:0,max:1,step:.1,value:s.maskOpacity,onChange:p=>l({maskOpacity:p})})]})]});return e.jsxs("section",{style:kr,children:[e.jsxs("label",{style:{...Cr,display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{children:"Face Mesh Renderer"}),e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:p=>l({enabled:p.currentTarget.checked})})]}),e.jsxs(dt,{title:"Renderer",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Face Index"}),e.jsx(ye,{min:0,step:1,value:s.faceIndex,onChange:p=>l({faceIndex:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Target FPS"}),e.jsx(ye,{min:1,step:1,value:s.targetFps??24,onChange:p=>l({targetFps:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Render Order"}),e.jsx(ye,{step:1,value:s.renderOrder,onChange:p=>l({renderOrder:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"External Mesh"}),e.jsx("input",{type:"url",style:he,value:s.externalMeshUrl??"",onChange:p=>l({externalMeshUrl:p.currentTarget.value||void 0})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Mesh Scale"}),e.jsx(ye,{min:.01,step:.01,value:s.externalScale,onChange:p=>l({externalScale:p})})]})]}),c,e.jsxs(dt,{title:"Material",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Type"}),e.jsx(Me,{value:s.materialType,options:N.materialTypeOptions,onChange:x})]}),s.materialType===J.FACE_MESH_MATERIAL_TYPES.shader?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Shader"}),e.jsx(Me,{value:s.shaderPreset,options:N.shaderPresetOptions,onChange:h})]}):null,e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Base Color"}),e.jsx("input",{type:"color",style:{...he,padding:2},value:s.baseColor,onChange:p=>l({baseColor:p.currentTarget.value})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Material Opacity"}),e.jsx(ye,{min:0,max:1,step:.01,value:s.opacity,onChange:p=>l({opacity:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Side"}),e.jsx(Me,{value:s.side,options:N.sideOptions,onChange:p=>l({side:p})})]})]}),n?e.jsxs(dt,{title:"Texture",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Map"}),e.jsx(Me,{value:s.textureMap,options:d,onChange:p=>l({textureMap:p})})]}),s.textureMap===J.FACE_MESH_TEXTURE_MAPS.canonical?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Face URL"}),e.jsx("input",{type:"url",style:he,value:s.faceTextureUrl,onChange:p=>l({faceTextureUrl:p.currentTarget.value})})]}):null,s.textureMap===J.FACE_MESH_TEXTURE_MAPS.style2?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Style URL"}),e.jsx("input",{type:"url",style:he,value:s.faceTextureStyle2Url,onChange:p=>l({faceTextureStyle2Url:p.currentTarget.value})})]}):null,e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Material Alpha"}),e.jsx(Me,{value:s.alphaMap,options:N.alphaMapOptions,onChange:p=>l({alphaMap:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Alpha Texture URL"}),e.jsx("input",{type:"url",style:he,value:s.faceAlphaMaskUrl,onChange:p=>l({faceAlphaMaskUrl:p.currentTarget.value})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Alpha Strength"}),e.jsx(ye,{min:0,max:1,step:.01,value:s.alphaOpacity,onChange:p=>l({alphaOpacity:p})})]})]}):null,a?e.jsxs(dt,{title:"Blend",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Mode"}),e.jsx(Me,{value:s.blendMode,options:N.blendModeOptions,onChange:p=>l({blendMode:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Blend Strength"}),e.jsx(ye,{min:0,max:1,step:.01,value:s.blendOpacity,onChange:p=>l({blendOpacity:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Composite"}),e.jsx("input",{type:"checkbox",checked:s.compositeShading,onChange:p=>l({compositeShading:p.currentTarget.checked})})]})]}):null]})},Tr=({component:t,onChange:s})=>e.jsx(Xt,{value:t.settings,onChange:l=>s==null?void 0:s({...t,settings:l})}),Bs=y.createContext(null),zr=({children:t,defaultOrbitEnabled:s=!0,defaultSelectedObjectId:l=null,defaultShowGrid:n=!0,defaultShowVideoBackground:a=!0,onComponentChange:d,onObjectChange:r,onOrbitEnabledChange:o,onSelectObject:h,onShowGridChange:x,onShowVideoBackgroundChange:c,onStoreChange:p,orbitEnabled:f,selectedObjectId:g,showGrid:i,showVideoBackground:u,store:j})=>{const[w,v]=y.useState(l),[M,U]=y.useState(s),[b,F]=y.useState(n),[E,P]=y.useState(a),le=g??w,ae=f??M,L=i??b,Ae=u??E,Pe=y.useMemo(()=>({store:j,selectedObjectId:le,orbitEnabled:ae,showGrid:L,showVideoBackground:Ae,onStoreChange:p,onSelectObject:W=>{v(W),h==null||h(W)},onComponentChange:d??(W=>{p({...j,components:{...j.components,[W.id]:W}})}),onObjectChange:r??(W=>{p({...j,objects:{...j.objects,[W.id]:W}})}),onOrbitEnabledChange:W=>{U(W),o==null||o(W)},onShowGridChange:W=>{F(W),x==null||x(W)},onShowVideoBackgroundChange:W=>{P(W),c==null||c(W)}}),[d,r,o,h,x,c,p,ae,le,L,Ae,j]);return e.jsx(Bs.Provider,{value:Pe,children:t})},bt=()=>{const t=y.useContext(Bs);if(!t)throw new Error("useXRSceneEditor must be used inside XRSceneEditorProvider.");return t},Vs=t=>t.renderGroupOrder.map(s=>t.renderGroups[s]).filter(Boolean),Mr=({initialPosition:t,rootOnly:s=!1,title:l,docked:n})=>{const{onSelectObject:a,onStoreChange:d,selectedObjectId:r,store:o}=bt(),h=Vs(o),x=s?Object.fromEntries(Object.entries(o.objects).filter(([,c])=>!c.parentObjectId)):o.objects;return e.jsx(Ls,{title:l,initialPosition:t,docked:n,groups:h,objects:x,selectedObjectId:r??void 0,onSelectObject:c=>a(c),onReorderGroup:(c,p)=>d(Le.reorderRenderGroup(o,c,p)),onReorderObject:(c,p,f)=>d(Le.reorderObjectWithinGroup(o,c,p,f)),onMoveObject:(c,p,f)=>{const g=Le.moveObjectToGroup(o,c,p,f);return g===o?!1:(d(g),!0)},onSetObjectParent:(c,p,f,g)=>{let i=o;const u=i.objects[c];if(!u||g&&u.renderGroupId!==g&&(i=Le.moveObjectToGroup(i,c,g,f),i===o))return!1;const j=K.setSceneObjectParentPreserveWorldTransform(i,c,p,f);return j===o?!1:(d(j),!0)},onToggleGroupEnabled:(c,p)=>{const f=o.renderGroups[c];f&&d({...o,renderGroups:{...o.renderGroups,[c]:{...f,enabled:p}}})},onToggleObjectVisible:(c,p)=>d(K.setSceneObjectVisible(o,c,p)),copyConfig:{kind:"scene",version:1,renderGroupOrder:o.renderGroupOrder,renderGroups:o.renderGroups,objects:o.objects,components:o.components}})},Q={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},fe={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},xt={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},ut={display:"flex",alignItems:"center",gap:6,marginBottom:7,fontSize:11,fontWeight:700},oe=(t,s)=>t.find(l=>l.type===s),Fr=({onChange:t,value:s})=>e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Light"}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Type"}),e.jsxs("select",{style:fe,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"ambient",children:"Ambient"}),e.jsx("option",{value:"directional",children:"Directional"}),e.jsx("option",{value:"point",children:"Point"}),e.jsx("option",{value:"spot",children:"Spot"})]})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...fe,padding:2},value:s.color,onChange:l=>t({...s,color:l.currentTarget.value})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Intensity"}),e.jsx("input",{type:"number",min:0,step:.1,style:fe,value:s.intensity,onChange:l=>t({...s,intensity:Number(l.currentTarget.value)})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Cast Shadow"}),e.jsx("input",{type:"checkbox",checked:s.castShadow,onChange:l=>t({...s,castShadow:l.currentTarget.checked})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Show Helper"}),e.jsx("input",{type:"checkbox",checked:s.showHelper,onChange:l=>t({...s,showHelper:l.currentTarget.checked})})]})]}),Wr=({onChange:t,value:s})=>e.jsxs("section",{style:xt,children:[e.jsxs("label",{style:{...ut,justifyContent:"space-between"},children:[e.jsx("span",{children:"Look At"}),e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:l=>t({...s,enabled:l.currentTarget.checked})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Mode"}),e.jsxs("select",{style:fe,value:s.mode,onChange:l=>t({...s,mode:l.currentTarget.value}),children:[e.jsx("option",{value:"point",children:"Point"}),e.jsx("option",{value:"direction",children:"Direction"})]})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Children Inherit"}),e.jsx("input",{type:"checkbox",checked:s.inheritChildren,onChange:l=>t({...s,inheritChildren:l.currentTarget.checked})})]})]}),Lr=({onChange:t,value:s})=>{const l=(n,a,d)=>["x","y","z"].map(r=>e.jsxs("label",{style:Q,children:[e.jsx("span",{children:`${n} ${r.toUpperCase()}`}),e.jsx("input",{type:"number",step:.05,style:fe,value:a[r],onChange:o=>d({...a,[r]:Number(o.currentTarget.value)})})]},`${n}-${r}`));return e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Face Binding"}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Target"}),e.jsx("select",{style:fe,value:s.target,onChange:n=>t({...s,target:n.currentTarget.value}),children:$e.FACE_TARGETS.map(n=>e.jsx("option",{value:n,children:n.replace("face.","")},n))})]}),s.target==="face.custom"?l("Custom",s.customAnchorPoint,n=>t({...s,customAnchorPoint:n})):null,l("Offset",s.offset,n=>t({...s,offset:n})),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Smoothing"}),e.jsx("input",{type:"number",min:0,step:1,style:fe,value:s.smoothing,onChange:n=>t({...s,smoothing:Number(n.currentTarget.value)})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Follow Face Roll"}),e.jsx("input",{type:"checkbox",checked:s.followFaceRoll,onChange:n=>t({...s,followFaceRoll:n.currentTarget.checked})})]})]})},$r=({initialPosition:t,docked:s})=>{const{onComponentChange:l,onObjectChange:n,onStoreChange:a,selectedObjectId:d,store:r}=bt(),o=d?r.objects[d]:null,h=o?K.getOrderedComponents(r,o.id):[],x=oe(h,"Transform"),c=oe(h,"ScreenTransform"),p=oe(h,"ScreenShape"),f=oe(h,"MeshRenderer"),g=oe(h,"FaceMeshRenderer"),i=oe(h,"Light"),u=oe(h,"LookAt"),j=oe(h,"PinToMesh"),w=oe(h,"TrackingAnchor"),v=o!=null&&o.renderGroupId?r.renderGroups[o.renderGroupId]:void 0;if(!o)return null;const M=Object.values(r.objects).filter(b=>b.id!==o.id).filter(b=>{const F=K.getOrderedComponents(r,b.id);return!!oe(F,"MeshRenderer")}).map(b=>({id:b.id,name:b.name})),U=Object.values(r.objects).filter(b=>b.id!==o.id);return e.jsxs(Ct,{objectId:o.id,objectName:o.name,onObjectNameChange:b=>n({...o,name:b}),visible:o.enabled,onVisibleChange:b=>n({...o,enabled:b}),layer:(v==null?void 0:v.name)??"3D Scene",initialPosition:t,docked:s,copyConfig:{object:o,components:h},children:[e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Hierarchy"}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Parent"}),e.jsxs("select",{style:fe,value:o.parentObjectId??"",onChange:b=>a(K.setSceneObjectParentPreserveWorldTransform(r,o.id,b.currentTarget.value||null)),children:[e.jsx("option",{value:"",children:"None"}),U.map(b=>e.jsx("option",{value:b.id,children:b.name},b.id))]})]})]}),x?e.jsx(_t,{value:x.settings,onChange:b=>l({...x,settings:b})}):null,c?e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Screen Transform"}),e.jsx(Ht,{guideLabel:"Screen Transform",value:{...c.settings,showGuides:c.settings.showTransformGuides},onChange:b=>{const{showGuides:F,...E}=b;l({...c,settings:{...c.settings,...E,showTransformGuides:F}})}})]}):null,f?e.jsx(Ds,{value:f.settings,onChange:b=>l({...f,settings:b})}):null,g?e.jsx(Xt,{value:g.settings,onChange:b=>l({...g,settings:b})}):null,p?e.jsx(Ts,{value:p.settings,onChange:b=>l({...p,settings:b})}):null,i?e.jsx(Fr,{value:i.settings,onChange:b=>l({...i,settings:b})}):null,u?e.jsx(Wr,{value:u.settings,onChange:b=>l({...u,settings:b})}):null,j?e.jsx($s,{value:j.settings,onChange:b=>l({...j,settings:b}),targets:M}):null,w?e.jsx(Lr,{value:w.settings,onChange:b=>l({...w,settings:b})}):null]})},Nr=({renderOrder:t=-999})=>{const{camera:s,size:l}=Xs.useThree(),n=Ys.useXRCameraTexture(),a=y.useMemo(()=>{if(!s.isPerspectiveCamera)return[10,10];const d=s,h=(d.position.z||5)- -1,x=d.fov*Math.PI/180,c=2*Math.tan(x/2)*h;return[c*(l.width/l.height),c]},[s,l]);return n?e.jsxs("mesh",{position:[0,0,-1],renderOrder:t,children:[e.jsx("planeGeometry",{args:a}),e.jsx("meshBasicMaterial",{map:n,depthTest:!0,depthWrite:!0,toneMapped:!1,side:Gs.DoubleSide})]}):null},Or=({camera:t={position:{x:0,y:.2,z:5.5},fov:42},grid:s={size:12,divisions:12,position:{x:0,y:-2.5,z:0}},style:l})=>{const{onComponentChange:n,orbitEnabled:a,showGrid:d,showVideoBackground:r,store:o}=bt(),h=Le.createRenderPlan(o),x=Array.from(new Set(h.map(f=>f.renderLayer))),c=t.position??{x:0,y:.2,z:5.5},p=s.position??{x:0,y:-2.5,z:0};return e.jsxs(Zs.XRScene,{style:{width:"100%",height:"100%",...l},canvasProps:{shadows:!0},children:[r?e.jsx(Nr,{renderOrder:-999}):null,e.jsx("color",{attach:"background",args:["#18212b"]}),e.jsx(Zt.PerspectiveCamera,{makeDefault:!0,position:[c.x,c.y,c.z],fov:t.fov??42}),e.jsx("ambientLight",{intensity:1.1}),d?e.jsx("gridHelper",{args:[s.size??12,s.divisions??12,"#344454","#263544"],position:[p.x,p.y,p.z]}):null,h.map(f=>e.jsx(Yt.SceneObjectRenderer,{objectId:f.objectId,store:o,editorMode:!0,renderOrder:f.renderOrder,renderLayer:f.renderLayer,onComponentChange:n},f.objectId)),e.jsx(Yt.SequentialRenderPasses,{layers:x}),e.jsx(Zt.OrbitControls,{enabled:a,enablePan:!1,minDistance:.05,maxDistance:1/0})]})},Ar=t=>({position:"absolute",top:12,left:t==="top-left"?12:t==="top-right"?"auto":"50%",right:t==="top-right"?12:"auto",transform:t==="top-center"||!t?"translateX(-50%)":"none",zIndex:5,display:"flex",alignItems:"center",gap:12,padding:"7px 10px",border:"1px solid rgba(148,163,184,.24)",borderRadius:9,background:"rgba(15,23,42,.78)",color:"#d8e2ec",backdropFilter:"blur(12px)",fontSize:11}),Pr=({position:t="top-center"})=>{const{onOrbitEnabledChange:s,orbitEnabled:l}=bt();return e.jsxs("div",{style:Ar(t),children:[e.jsx("span",{style:{color:"#7e95aa",fontSize:9,fontWeight:800,letterSpacing:"0.14em"},children:"VIEWPORT"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:l,onChange:n=>s(n.currentTarget.checked)}),"Orbit Controls"]})]})},Dr={borderRadius:12,border:"1px solid rgba(251,191,36,0.30)",background:"rgba(251,191,36,0.08)",color:"#fde68a",padding:8,fontSize:10.5,lineHeight:1.45},Br={display:"block",marginTop:6,overflow:"auto",maxHeight:160,borderRadius:8,background:"rgba(15,23,42,0.55)",color:"#f8fafc",padding:8,fontSize:10},Ks=({component:t})=>e.jsxs("div",{style:Dr,children:[e.jsxs("div",{children:["Missing editor for component type: ",t.type]}),e.jsxs("div",{children:["Component ID: ",t.id]}),e.jsx("pre",{style:Br,children:JSON.stringify(t,null,2)})]}),Vr=({component:t,editors:s={},onChange:l})=>{const n=s[t.type];return n?e.jsx(n,{component:t,onChange:l}):e.jsx(Ks,{component:t})},Kr=t=>t.slice(0,12);exports.MediaSourceSwitcher=Ue.MediaSourceSwitcher;exports.defaultMediaSources=Ue.defaultMediaSources;exports.sdkImageMediaSources=Ue.sdkImageMediaSources;exports.sdkVideoMediaSources=Ue.sdkVideoMediaSources;exports.useFaceTrackingMediaSourceSession=Ue.useFaceTrackingMediaSourceSession;exports.useMediaSourceSession=Ue.useMediaSourceSession;exports.DefaultSettingPanel=Hs.DefaultSettingPanel;exports.ComponentEditor=Vr;exports.ComponentEditorFallback=Ks;exports.FaceMeshRendererComponentEditor=Tr;exports.FaceMeshRendererSettingsPanel=Xt;exports.FaceRetouchSettingsPanel=No;exports.FaceSwapSettingsPanel=Oo;exports.GestureSettingsPanel=Ao;exports.HandJoints2DSettingsPanel=Ai;exports.HandTracking2DControllerSettingsPanel=wi;exports.HandTracking2DSettingsPanel=li;exports.HandTracking3DSettingsPanel=eo;exports.HierarchyPanel=Ls;exports.HolisticTrackerSettingsPanel=Ko;exports.IrisEffectSettingsPanel=Po;exports.LayerPanel=fo;exports.LipEffectSettingsPanel=Do;exports.MeshRendererSettingsPanel=Ds;exports.ObjectInspectorPanel=Ct;exports.PinToMeshSettingsPanel=$s;exports.ProductHotspotPanel=Bo;exports.SceneHierarchyPanel=Mr;exports.SceneInspectorPanel=$r;exports.ScreenGlassSettingsPanel=Es;exports.ScreenGradientSettingsPanel=Is;exports.ScreenImageSettingsPanel=Ol;exports.ScreenShapeSettingsPanel=Ts;exports.ScreenTextSettingsPanel=hl;exports.SegmentationOverlaySettingsPanel=Ho;exports.SettingsPanel=Se;exports.Transform3DSettingsPanel=yr;exports.Transform3DSettingsSection=_t;exports.ViewportToolbar=Pr;exports.XRDiagnosticsPanel=Vo;exports.XRSceneEditorProvider=zr;exports.XRSceneViewport=Or;exports.createComponentIdLabel=Kr;exports.getSceneEditorGroups=Vs;exports.useXRSceneEditor=bt;