@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.
- package/GROUNDING.md +5651 -82
- package/README.md +1 -0
- package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
- package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
- package/dist/DebuggerUI-7ngnJsBe.js +275 -0
- package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
- package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
- package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
- package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -0
- package/dist/assets/cache.d.ts +99 -0
- package/dist/assets/estimate.d.ts +11 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/loaders.d.ts +43 -0
- package/dist/assets/react.d.ts +33 -0
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/calibration/calibration.d.ts +75 -0
- package/dist/calibration/index.d.ts +6 -0
- package/dist/calibration/storage.d.ts +13 -0
- package/dist/calibration/types.d.ts +53 -0
- package/dist/calibration/useXRCalibration.d.ts +46 -0
- package/dist/camera/CameraPermissionGate.d.ts +26 -0
- package/dist/camera/devices.d.ts +26 -0
- package/dist/camera/index.d.ts +8 -0
- package/dist/camera/permission.d.ts +86 -0
- package/dist/camera/useCameraPermission.d.ts +35 -0
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/capabilities/detect.d.ts +45 -0
- package/dist/capabilities/index.d.ts +5 -0
- package/dist/capabilities/types.d.ts +120 -0
- package/dist/capabilities/useXRCapabilities.d.ts +18 -0
- package/dist/compat/environment.d.ts +5 -0
- package/dist/compat/index.d.ts +4 -0
- package/dist/compat/run.d.ts +18 -0
- package/dist/compat/scenarios.d.ts +10 -0
- package/dist/compat/types.d.ts +101 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +69 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
- package/dist/components/BodyTracker/index.d.ts +17 -0
- package/dist/components/BodyTrigger/index.d.ts +49 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +37 -5
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +2 -2
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/GestureListener/index.d.ts +11 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandOccluder.d.ts +55 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +101 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +69 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HandTracker/index.d.ts +10 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/HolisticTracker/index.d.ts +69 -0
- package/dist/components/HolisticTracker/settings.d.ts +58 -0
- package/dist/components/HolisticTracker/signals.d.ts +49 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
- package/dist/components/IrisEffect/index.d.ts +51 -0
- package/dist/components/IrisEffect/settings.d.ts +117 -0
- package/dist/components/LipEffect/LipEffect.d.ts +27 -1
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +95 -7
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +46 -4
- package/dist/components/LipEffect/index.d.ts +11 -3
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +375 -0
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +128 -9
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
- package/dist/components/LipEffect/uvGuide.d.ts +74 -0
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/PersonCutout/index.d.ts +50 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/source.d.ts +6 -0
- package/dist/components/ScreenImage/types.d.ts +18 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
- package/dist/components/SegmentationOverlay/index.d.ts +9 -0
- package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
- package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
- package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
- package/dist/components/ShoulderOccluder/index.d.ts +43 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
- package/dist/components/index.d.ts +11 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/constants/index.d.ts +4 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-BH7PdKFS.cjs +1 -0
- package/dist/contexts-jak8-tND.js +667 -0
- package/dist/coordinates/feed.d.ts +52 -0
- package/dist/coordinates/index.d.ts +7 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/coordinates/spaces.d.ts +49 -0
- package/dist/coordinates/viewport.d.ts +22 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +18 -3
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/index.d.ts +1 -1
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2695 -2547
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +20 -2
- package/dist/entries/face-effects.d.ts +123 -9
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +49 -3
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +60 -2
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2324 -1
- package/dist/face-effects.js +14208 -2268
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/gestures/definitions.d.ts +98 -0
- package/dist/gestures/detector.d.ts +87 -0
- package/dist/gestures/index.d.ts +8 -0
- package/dist/gestures/measures.d.ts +114 -0
- package/dist/gestures/settings.d.ts +49 -0
- package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
- package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +178 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +76 -1
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceInfo.d.ts +13 -1
- package/dist/hooks/useFaceInfos.d.ts +1 -1
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useGesture.d.ts +32 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +7 -0
- package/dist/hooks/useXRSession/facade.d.ts +42 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +3 -1
- package/dist/hooks/useXRSession/registry.d.ts +14 -0
- package/dist/hooks/useXRSession/store.d.ts +52 -3
- package/dist/index-B1_TzJaI.js +1104 -0
- package/dist/index-BavF06C6.js +190 -0
- package/dist/index-BfFmpddl.cjs +21 -0
- package/dist/index-BuBzneeW.cjs +46 -0
- package/dist/index-CGsQWodV.cjs +1 -0
- package/dist/index-CIe7eCMH.js +3200 -0
- package/dist/index-CfSF8LXa.cjs +1 -0
- package/dist/index-D5GTzOzD.cjs +1 -0
- package/dist/index-DBhQzvVa.js +314 -0
- package/dist/index-DE17y0ZI.cjs +1 -0
- package/dist/index-JII7huPk.js +442 -0
- package/dist/index-tpCr9CLj.cjs +1 -0
- package/dist/index-w1S7fI2B.js +1432 -0
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-Dmk1cTXq.js → internal-B90P-clC.js} +138 -119
- package/dist/internal-Cjinca64.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +15 -10
- package/dist/iris/compute.d.ts +27 -0
- package/dist/iris/index.d.ts +4 -0
- package/dist/iris/lead.d.ts +19 -0
- package/dist/iris/types.d.ts +89 -0
- package/dist/landmarkMask-BFDyBnKM.js +224 -0
- package/dist/landmarkMask-u7es2k4X.cjs +1 -0
- package/dist/landmarks-BlUqf5MZ.cjs +1 -0
- package/dist/landmarks-bftdwq6Z.js +76 -0
- package/dist/loaders-BGAUACsd.js +363 -0
- package/dist/loaders-BJ1_QCHt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1190 -675
- package/dist/main.cjs +1 -1
- package/dist/main.js +1190 -452
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +3 -1
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +4 -12
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Holistic/index.d.ts +49 -0
- package/dist/models/Holistic/result.d.ts +68 -0
- package/dist/models/Segmentation/index.d.ts +2 -0
- package/dist/models/SemanticSegmentation/index.d.ts +31 -0
- package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +60 -0
- package/dist/particles/system.d.ts +64 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +774 -0
- package/dist/product/ProductDimensions.d.ts +16 -0
- package/dist/product/ProductHotspot.d.ts +16 -0
- package/dist/product/ProductViewer.d.ts +9 -0
- package/dist/product/details.d.ts +53 -0
- package/dist/product/index.d.ts +14 -0
- package/dist/product/loadModelViewer.d.ts +4 -0
- package/dist/product/types.d.ts +71 -0
- package/dist/product/useProductAr.d.ts +37 -0
- package/dist/product/useProductDetails.d.ts +60 -0
- package/dist/product.cjs +1 -0
- package/dist/product.js +414 -0
- package/dist/providers-C8rE26Uf.js +366 -0
- package/dist/providers-DHsrhDI2.cjs +62 -0
- package/dist/quality/XRQualityController.d.ts +25 -0
- package/dist/quality/controller.d.ts +33 -0
- package/dist/quality/index.d.ts +6 -0
- package/dist/quality/types.d.ts +100 -0
- package/dist/quality/useXRQuality.d.ts +28 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-KZk6eRiY.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
- package/dist/renderPasses-B6l8IpJv.js +1290 -0
- package/dist/renderPasses-dqmkft4P.cjs +158 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/segmentation-Cb3ouK6Z.js +1758 -0
- package/dist/segmentation-D9pYO6aR.cjs +1 -0
- package/dist/segmentation2d/faceMemory.d.ts +28 -0
- package/dist/segmentation2d/faceRegions.d.ts +24 -0
- package/dist/segmentation2d/index.d.ts +9 -0
- package/dist/segmentation2d/maskUv.d.ts +23 -0
- package/dist/segmentation2d/rasterize.d.ts +14 -0
- package/dist/segmentation2d/types.d.ts +52 -0
- package/dist/select-Ck5LGz-J.cjs +1 -0
- package/dist/select-pYRo_win.js +233 -0
- package/dist/selectors-C4X71aoD.cjs +1 -0
- package/dist/selectors-DmNaKIwE.js +196 -0
- package/dist/session-BrH8G7iJ.cjs +31 -0
- package/dist/session-DgA_z6O1.js +418 -0
- package/dist/settings-BJ7FMBsO.js +111 -0
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/subjects/index.d.ts +2 -0
- package/dist/subjects/select.d.ts +62 -0
- package/dist/subjects/types.d.ts +55 -0
- package/dist/tracking-config/apply.d.ts +57 -0
- package/dist/tracking-config/index.d.ts +7 -0
- package/dist/tracking-config/resolve.d.ts +25 -0
- package/dist/tracking-config/storage.d.ts +8 -0
- package/dist/tracking-config/types.d.ts +106 -0
- package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1326 -506
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +47 -3
- package/dist/types/segmentation.d.ts +24 -0
- package/dist/types/session.d.ts +41 -3
- package/dist/updateThrottle-BseecYag.js +4 -0
- package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
- package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
- package/dist/useFaceInfo-J4x7LsqL.js +76 -0
- package/dist/useFaceResultReader-BvEo5REG.js +61 -0
- package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-Cr3RzuAW.cjs +1 -0
- package/dist/useXRCapabilities-Cxmlmpbd.js +30 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +21 -1
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/utils/updateThrottle.d.ts +2 -0
- package/dist/utils/useStableUniforms.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-ByoNj0QP.js → uv-DJU_XfmN.js} +15 -247
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/coordinate-spaces.mdx +168 -0
- package/docs/api/cross-camera.mdx +89 -0
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +9 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +17 -11
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +8 -9
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +209 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +535 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +164 -0
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +247 -0
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/multi-subject.mdx +98 -0
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +136 -0
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +114 -0
- package/docs/api/product-details.mdx +78 -0
- package/docs/api/screen-space-coordinates.mdx +4 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/trackers.mdx +5 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +51 -1
- package/docs/examples/lip-shaders.mdx +273 -0
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +4 -4
- package/docs/guides/lip-effect-textures.mdx +368 -0
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -0
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/package.json +23 -1
- package/dist/DebuggerUI-B6bP6P9r.cjs +0 -1
- package/dist/DebuggerUI-BjOMr8q_.js +0 -269
- package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
- package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
- package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
- package/dist/FaceRetouch-DwbKQJAN.js +0 -551
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-ByhzppYl.js +0 -663
- package/dist/contexts-Dr62It_K.cjs +0 -1
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-C4QpCQIY.js +0 -118
- package/dist/getFaceInfo-fA1bFBub.cjs +0 -1
- package/dist/index-9dlAQAhy.js +0 -1462
- package/dist/index-BjmTe9eM.cjs +0 -1
- package/dist/index-BpEf2BBb.cjs +0 -1
- package/dist/index-CyUUurQT.cjs +0 -1
- package/dist/index-DCiMbxC3.cjs +0 -1
- package/dist/index-DXT3WccE.js +0 -2089
- package/dist/index-DpI-qo5X.cjs +0 -17
- package/dist/index-DyVF4vEW.js +0 -111
- package/dist/index-VJ0SJwmG.js +0 -214
- package/dist/internal-Cq-TEQ5Y.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-BOoBSr8z.cjs +0 -21
- package/dist/renderPasses-BcquyVtu.js +0 -1500
- package/dist/selectors-B8H97CKA.js +0 -59
- package/dist/selectors-CZLKT2Iv.cjs +0 -1
- package/dist/session-CpkiK5YA.cjs +0 -31
- package/dist/session-DLFN_VII.js +0 -363
- package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
- package/dist/useFaceInfo-Dk426LTu.js +0 -62
- package/dist/useFaceResults-CtetsO9M.js +0 -19
- package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
package/dist/main.js
CHANGED
|
@@ -1,146 +1,154 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { X as
|
|
5
|
-
import { c as
|
|
6
|
-
import { S as
|
|
7
|
-
import { X as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { u as
|
|
18
|
-
import {
|
|
19
|
-
import { a as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { M as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var Ie = (e, t, s) => t in e ? Pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var N = (e, t, s) => Ie(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { X as v, u as Le, G as Oe, I as Ge, J as qe, K as Be, L as Ke, M as We } from "./index-CIe7eCMH.js";
|
|
5
|
+
import { a2 as Gs, a3 as qs, z as Bs, N as Ks, a4 as Ws, _ as Xs, $ as Hs, c as zs, v as $s, B as js, d as Vs, f as Zs, O as Ys, k as Js, P as Qs, i as er, Q as tr, R as sr, T as rr, Y as ar, p as nr, q as ir, a0 as or, r as cr, a1 as lr, U as ur, Z as dr, t as mr, V as pr, W as fr } from "./index-CIe7eCMH.js";
|
|
6
|
+
import { S as Xe } from "./contexts-jak8-tND.js";
|
|
7
|
+
import { X as gr } from "./contexts-jak8-tND.js";
|
|
8
|
+
import { S as yr, T as Mr } from "./TextLabel-c9BCucOI.js";
|
|
9
|
+
import { jsxs as L, jsx as M, Fragment as re } from "react/jsx-runtime";
|
|
10
|
+
import { useRef as F, useMemo as Z, useEffect as x, useState as k, Suspense as He, useCallback as R, forwardRef as ze, useImperativeHandle as $e, useContext as je, createContext as Ve, useId as Ze, useSyncExternalStore as Ye } from "react";
|
|
11
|
+
import * as Je from "three";
|
|
12
|
+
import { MathUtils as Qe, Vector2 as et, Vector3 as tt, DoubleSide as te, RepeatWrapping as Se, LinearFilter as ye } from "three";
|
|
13
|
+
import { D as Er, H as Rr, G as br, E as Ar, J as Fr, K as Cr, P as vr, S as kr, C as _r, I as xr, L as wr, M as Nr, F as Ur, B as Dr } from "./index-w1S7fI2B.js";
|
|
14
|
+
import { useThree as st, useFrame as Fe } from "@react-three/fiber";
|
|
15
|
+
import { R as rt } from "./uv-DJU_XfmN.js";
|
|
16
|
+
import { c as Ce, b as ve } from "./selectors-DmNaKIwE.js";
|
|
17
|
+
import { u as at } from "./landmarks-bftdwq6Z.js";
|
|
18
|
+
import { S as nt, c as it } from "./index-B1_TzJaI.js";
|
|
19
|
+
import { L as Ir, d as Lr, R as Or, a as Gr, e as qr, b as Br, f as Kr } from "./index-B1_TzJaI.js";
|
|
20
|
+
import { useTexture as ot } from "@react-three/drei";
|
|
21
|
+
import { a as ct } from "./context-DTxSQvp4.js";
|
|
22
|
+
import { k as Xr, D as Hr, j as zr, E as $r, M as jr, h as Vr, S as Zr, T as Yr, l as Jr, g as Qr, n as ea, r as ta } from "./renderPasses-B6l8IpJv.js";
|
|
23
|
+
import { D as ra, a as aa, M as na, n as ia } from "./index-zGaqrz_K.js";
|
|
24
|
+
import { d as ca, r as la } from "./drawNormalizedCrop-CRdIDyl1.js";
|
|
25
|
+
import { M as da } from "./index-BavF06C6.js";
|
|
26
|
+
import { k as pa, a as fa, b as ha, D as ga, m as Sa, r as ya } from "./index-DBhQzvVa.js";
|
|
27
|
+
import { c as Ta, j as Ea, k as Ra, l as ba, m as Aa, n as Fa, b as Ca, o as va, d as ka, e as _a, f as xa, a as wa, g as Na, h as Ua, i as Da, t as Pa, p as Ia, v as La, w as Oa } from "./select-pYRo_win.js";
|
|
28
|
+
import { u as qa } from "./useXRCapabilities-Cxmlmpbd.js";
|
|
29
|
+
import { g as ke } from "./loaders-BGAUACsd.js";
|
|
30
|
+
import { D as Ka, X as Wa, c as Xa, d as Ha, a as za, b as $a, e as ja, f as Va, h as Za, i as Ya, u as Ja } from "./loaders-BGAUACsd.js";
|
|
31
|
+
import { S as lt } from "./segmentation-Cb3ouK6Z.js";
|
|
32
|
+
const V = (e, t, s, r) => Qe.damp(e, t, Math.max(0, s), Math.max(0, r)), os = (e, t, s, r, a = new et()) => a.set(
|
|
33
|
+
V(e.x, t.x, s, r),
|
|
34
|
+
V(e.y, t.y, s, r)
|
|
35
|
+
), cs = (e, t, s, r, a = new tt()) => a.set(
|
|
36
|
+
V(e.x, t.x, s, r),
|
|
37
|
+
V(e.y, t.y, s, r),
|
|
38
|
+
V(e.z, t.z, s, r)
|
|
39
|
+
), ut = "rgba(20,40,110,0.88)", dt = 24, mt = 512;
|
|
40
|
+
function ls({
|
|
41
|
+
color: e = ut,
|
|
42
|
+
borderColor: t,
|
|
35
43
|
borderWidth: s = 0,
|
|
36
|
-
borderRadius: r =
|
|
37
|
-
resolution: a =
|
|
38
|
-
aspect:
|
|
39
|
-
opacity:
|
|
44
|
+
borderRadius: r = dt,
|
|
45
|
+
resolution: a = mt,
|
|
46
|
+
aspect: n = 1,
|
|
47
|
+
opacity: i = 1,
|
|
40
48
|
name: c,
|
|
41
|
-
overlay:
|
|
42
|
-
position:
|
|
43
|
-
rotation:
|
|
49
|
+
overlay: o = !0,
|
|
50
|
+
position: l,
|
|
51
|
+
rotation: h,
|
|
44
52
|
scale: d,
|
|
45
53
|
visible: m
|
|
46
54
|
}) {
|
|
47
|
-
const
|
|
48
|
-
width: Math.round(a * Math.max(
|
|
55
|
+
const u = F(null), p = F(null), S = Z(() => pt({
|
|
56
|
+
width: Math.round(a * Math.max(n, 0.05)),
|
|
49
57
|
height: Math.round(a),
|
|
50
|
-
color:
|
|
51
|
-
borderColor:
|
|
58
|
+
color: e,
|
|
59
|
+
borderColor: t,
|
|
52
60
|
borderWidth: s,
|
|
53
61
|
borderRadius: r
|
|
54
|
-
}), [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
return
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
63
|
-
|
|
62
|
+
}), [e, t, s, r, a, n]);
|
|
63
|
+
x(() => () => {
|
|
64
|
+
S.dispose();
|
|
65
|
+
}, [S]);
|
|
66
|
+
const E = F(null), f = F(i);
|
|
67
|
+
return f.current !== i && (f.current = i, E.current = null, p.current && (p.current.opacity = i)), x(() => {
|
|
68
|
+
const g = u.current;
|
|
69
|
+
if (g)
|
|
70
|
+
return g.userData.setOpacity = (b) => {
|
|
71
|
+
E.current = b, p.current && (p.current.opacity = b);
|
|
64
72
|
}, () => {
|
|
65
|
-
delete
|
|
73
|
+
delete g.userData.setOpacity;
|
|
66
74
|
};
|
|
67
|
-
}, []), /* @__PURE__ */
|
|
75
|
+
}, []), /* @__PURE__ */ L(
|
|
68
76
|
"mesh",
|
|
69
77
|
{
|
|
70
|
-
ref:
|
|
78
|
+
ref: u,
|
|
71
79
|
name: c,
|
|
72
|
-
position:
|
|
73
|
-
rotation:
|
|
80
|
+
position: l,
|
|
81
|
+
rotation: h,
|
|
74
82
|
scale: d,
|
|
75
83
|
visible: m,
|
|
76
84
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ M("planeGeometry", { args: [1, 1] }),
|
|
86
|
+
/* @__PURE__ */ M(
|
|
79
87
|
"meshBasicMaterial",
|
|
80
88
|
{
|
|
81
|
-
ref:
|
|
82
|
-
map:
|
|
89
|
+
ref: p,
|
|
90
|
+
map: S,
|
|
83
91
|
transparent: !0,
|
|
84
|
-
opacity:
|
|
85
|
-
depthTest: !
|
|
86
|
-
depthWrite: !
|
|
92
|
+
opacity: i,
|
|
93
|
+
depthTest: !o,
|
|
94
|
+
depthWrite: !o
|
|
87
95
|
}
|
|
88
96
|
)
|
|
89
97
|
]
|
|
90
98
|
}
|
|
91
99
|
);
|
|
92
100
|
}
|
|
93
|
-
function
|
|
94
|
-
const { width:
|
|
101
|
+
function pt(e) {
|
|
102
|
+
const { width: t, height: s, color: r, borderColor: a, borderWidth: n, borderRadius: i } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, s) : (() => {
|
|
95
103
|
const d = document.createElement("canvas");
|
|
96
|
-
return d.width =
|
|
97
|
-
})(),
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
return
|
|
104
|
+
return d.width = t, d.height = s, d;
|
|
105
|
+
})(), o = c.getContext("2d");
|
|
106
|
+
o.clearRect(0, 0, t, s);
|
|
107
|
+
const l = Math.min(i, Math.min(t, s) / 2);
|
|
108
|
+
o.beginPath(), o.moveTo(l, 0), o.lineTo(t - l, 0), o.quadraticCurveTo(t, 0, t, l), o.lineTo(t, s - l), o.quadraticCurveTo(t, s, t - l, s), o.lineTo(l, s), o.quadraticCurveTo(0, s, 0, s - l), o.lineTo(0, l), o.quadraticCurveTo(0, 0, l, 0), o.closePath(), o.fillStyle = r, o.fill(), a && n > 0 && (o.lineWidth = n, o.strokeStyle = a, o.stroke());
|
|
109
|
+
const h = new Je.CanvasTexture(c);
|
|
110
|
+
return h.needsUpdate = !0, h;
|
|
103
111
|
}
|
|
104
|
-
const
|
|
105
|
-
segmentationMask:
|
|
106
|
-
segmentation:
|
|
112
|
+
const us = ({
|
|
113
|
+
segmentationMask: e,
|
|
114
|
+
segmentation: t,
|
|
107
115
|
invert: s = !1,
|
|
108
116
|
customBackground: r,
|
|
109
|
-
renderOrder: a =
|
|
117
|
+
renderOrder: a = rt.BACKGROUND
|
|
110
118
|
}) => {
|
|
111
|
-
const { camera:
|
|
112
|
-
|
|
113
|
-
if (!
|
|
114
|
-
|
|
119
|
+
const { camera: n, size: i } = st(), c = Ce(), o = ve(v.BACKGROUND_SEGMENTATION), l = t ? o == null ? void 0 : o.backgroundSegmentationMask : void 0, h = F(!1);
|
|
120
|
+
x(() => {
|
|
121
|
+
if (!t) {
|
|
122
|
+
h.current = !1;
|
|
115
123
|
return;
|
|
116
124
|
}
|
|
117
|
-
|
|
118
|
-
`[VideoBackground] segmentation="${
|
|
119
|
-
),
|
|
120
|
-
}, [
|
|
121
|
-
const d =
|
|
122
|
-
if (!
|
|
125
|
+
o === null && !h.current && (console.warn(
|
|
126
|
+
`[VideoBackground] segmentation="${t}" set but no matching <Segmentation> component is mounted; rendering unmasked.`
|
|
127
|
+
), h.current = !0);
|
|
128
|
+
}, [t, o]);
|
|
129
|
+
const d = t ? l : e, m = Z(() => {
|
|
130
|
+
if (!n.isPerspectiveCamera)
|
|
123
131
|
return [10, 10];
|
|
124
|
-
const
|
|
125
|
-
return [
|
|
126
|
-
}, [
|
|
127
|
-
return c ? /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
132
|
+
const u = n, E = (u.position.z || 5) - -1, f = u.fov * Math.PI / 180, g = 2 * Math.tan(f / 2) * E;
|
|
133
|
+
return [g * (i.width / i.height), g];
|
|
134
|
+
}, [n, i]);
|
|
135
|
+
return c ? /* @__PURE__ */ M("group", { position: [0, 0, -1], children: s ? /* @__PURE__ */ L(re, { children: [
|
|
136
|
+
/* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
137
|
+
/* @__PURE__ */ M("planeGeometry", { args: m }),
|
|
138
|
+
/* @__PURE__ */ M(
|
|
131
139
|
"meshBasicMaterial",
|
|
132
140
|
{
|
|
133
141
|
map: c,
|
|
134
142
|
depthTest: !1,
|
|
135
143
|
depthWrite: !1,
|
|
136
144
|
toneMapped: !1,
|
|
137
|
-
side:
|
|
145
|
+
side: te
|
|
138
146
|
}
|
|
139
147
|
)
|
|
140
148
|
] }),
|
|
141
|
-
r && d && /* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
149
|
+
r && d && /* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
150
|
+
/* @__PURE__ */ M("planeGeometry", { args: m }),
|
|
151
|
+
/* @__PURE__ */ M(
|
|
144
152
|
"meshBasicMaterial",
|
|
145
153
|
{
|
|
146
154
|
map: typeof r == "string" ? void 0 : r,
|
|
@@ -151,15 +159,15 @@ const tt = ({
|
|
|
151
159
|
depthTest: !1,
|
|
152
160
|
depthWrite: !1,
|
|
153
161
|
toneMapped: !1,
|
|
154
|
-
side:
|
|
162
|
+
side: te
|
|
155
163
|
},
|
|
156
164
|
"inverted-mask"
|
|
157
165
|
)
|
|
158
166
|
] })
|
|
159
|
-
] }) : /* @__PURE__ */
|
|
160
|
-
r && d && /* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
167
|
+
] }) : /* @__PURE__ */ L(re, { children: [
|
|
168
|
+
r && d && /* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
169
|
+
/* @__PURE__ */ M("planeGeometry", { args: m }),
|
|
170
|
+
/* @__PURE__ */ M(
|
|
163
171
|
"meshBasicMaterial",
|
|
164
172
|
{
|
|
165
173
|
map: typeof r == "string" ? void 0 : r,
|
|
@@ -167,13 +175,13 @@ const tt = ({
|
|
|
167
175
|
depthTest: !1,
|
|
168
176
|
depthWrite: !1,
|
|
169
177
|
toneMapped: !1,
|
|
170
|
-
side:
|
|
178
|
+
side: te
|
|
171
179
|
}
|
|
172
180
|
)
|
|
173
181
|
] }),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
183
|
+
/* @__PURE__ */ M("planeGeometry", { args: m }),
|
|
184
|
+
/* @__PURE__ */ M(
|
|
177
185
|
"meshBasicMaterial",
|
|
178
186
|
{
|
|
179
187
|
map: c,
|
|
@@ -183,22 +191,74 @@ const tt = ({
|
|
|
183
191
|
depthTest: !1,
|
|
184
192
|
depthWrite: !1,
|
|
185
193
|
toneMapped: !1,
|
|
186
|
-
side:
|
|
194
|
+
side: te
|
|
187
195
|
},
|
|
188
196
|
d ? "with-mask" : "no-mask"
|
|
189
197
|
)
|
|
190
198
|
] })
|
|
191
199
|
] }) }) : null;
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
}, ft = { left: -1, right: 1, top: 1, bottom: -1 }, ht = ({
|
|
201
|
+
ready: e,
|
|
202
|
+
error: t,
|
|
203
|
+
hasMask: s
|
|
204
|
+
}) => t ? "error" : e && s ? "ready" : "loading", gt = (e, t) => e === "ready" || t === "camera", St = (e = !0) => {
|
|
205
|
+
const { ready: t, error: s } = at(
|
|
206
|
+
v.BACKGROUND_SEGMENTATION,
|
|
207
|
+
{ type: "portrait" },
|
|
208
|
+
e
|
|
209
|
+
), r = ve(v.BACKGROUND_SEGMENTATION), [a, n] = k(null);
|
|
210
|
+
return Fe(() => {
|
|
211
|
+
const i = (r == null ? void 0 : r.backgroundSegmentationMask) ?? null;
|
|
212
|
+
i !== a && n(i);
|
|
213
|
+
}), {
|
|
214
|
+
texture: a,
|
|
215
|
+
status: ht({ ready: t, error: s, hasMask: !!a }),
|
|
216
|
+
error: s
|
|
217
|
+
};
|
|
218
|
+
}, ds = ({
|
|
219
|
+
invert: e = !1,
|
|
220
|
+
fallback: t = "camera",
|
|
221
|
+
active: s = !0,
|
|
222
|
+
onStatusChange: r,
|
|
223
|
+
fit: a = "cover",
|
|
224
|
+
anchors: n = ft,
|
|
225
|
+
renderOrder: i = 100,
|
|
226
|
+
visible: c = !0,
|
|
227
|
+
maskFeather: o = 4,
|
|
228
|
+
maskErode: l = 0.7,
|
|
229
|
+
...h
|
|
230
|
+
}) => {
|
|
231
|
+
const d = Ce(), { texture: m, status: u, error: p } = St(s);
|
|
232
|
+
if (x(() => {
|
|
233
|
+
r == null || r(u, p);
|
|
234
|
+
}, [u, p, r]), !d) return null;
|
|
235
|
+
const S = u === "ready" && m;
|
|
236
|
+
return !S && !gt(u, t) ? null : /* @__PURE__ */ M(
|
|
237
|
+
nt,
|
|
238
|
+
{
|
|
239
|
+
...h,
|
|
240
|
+
source: { kind: "texture", texture: d },
|
|
241
|
+
fit: a,
|
|
242
|
+
anchors: n,
|
|
243
|
+
renderOrder: i,
|
|
244
|
+
visible: c,
|
|
245
|
+
maskTexture: S ? m : null,
|
|
246
|
+
maskChannel: "green",
|
|
247
|
+
maskInvert: e,
|
|
248
|
+
maskFeather: o,
|
|
249
|
+
maskErode: l
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}, ie = 9, oe = 16, ms = ({ children: e }) => {
|
|
253
|
+
const [t, s] = k({ width: 0, height: 0 });
|
|
254
|
+
return x(() => {
|
|
195
255
|
const r = () => {
|
|
196
|
-
const a = document.documentElement.clientWidth,
|
|
197
|
-
let
|
|
198
|
-
|
|
256
|
+
const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight, i = a / n, c = ie / oe;
|
|
257
|
+
let o, l;
|
|
258
|
+
i > c ? (l = n, o = l * ie / oe) : (o = a, l = o * oe / ie), s({ width: o, height: l });
|
|
199
259
|
};
|
|
200
260
|
return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
201
|
-
}, []), /* @__PURE__ */
|
|
261
|
+
}, []), /* @__PURE__ */ M(
|
|
202
262
|
"div",
|
|
203
263
|
{
|
|
204
264
|
style: {
|
|
@@ -209,38 +269,38 @@ const tt = ({
|
|
|
209
269
|
justifyContent: "center",
|
|
210
270
|
backgroundColor: "#0d0d0d"
|
|
211
271
|
},
|
|
212
|
-
children: /* @__PURE__ */
|
|
272
|
+
children: /* @__PURE__ */ M("div", { style: { width: t.width, height: t.height, position: "relative" }, children: e })
|
|
213
273
|
}
|
|
214
274
|
);
|
|
215
|
-
},
|
|
216
|
-
const r =
|
|
217
|
-
return { x: r /
|
|
218
|
-
},
|
|
219
|
-
sheet:
|
|
220
|
-
contentAspect:
|
|
275
|
+
}, ps = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ M("axesHelper", { args: [e], ...t }), yt = { left: -1, right: 1, top: 1, bottom: -1 }, Mt = (e, t, s) => {
|
|
276
|
+
const r = e % t, a = Math.floor(e / t);
|
|
277
|
+
return { x: r / t, y: (s - 1 - a) / s };
|
|
278
|
+
}, Tt = ({
|
|
279
|
+
sheet: e,
|
|
280
|
+
contentAspect: t,
|
|
221
281
|
renderOrder: s,
|
|
222
282
|
name: r
|
|
223
283
|
}) => {
|
|
224
|
-
const a =
|
|
225
|
-
return
|
|
226
|
-
a.wrapS =
|
|
227
|
-
const m = Math.floor(
|
|
228
|
-
if (m ===
|
|
229
|
-
|
|
230
|
-
const { x:
|
|
231
|
-
a.offset.set(
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
284
|
+
const a = ot(e.url), n = F(0), i = F(-1), c = ct(), [o, l] = t != null ? it(c, t) : [1, 1];
|
|
285
|
+
return Fe((h, d) => {
|
|
286
|
+
a.wrapS = Se, a.wrapT = Se, a.magFilter = ye, a.minFilter = ye, a.generateMipmaps = !1, a.repeat.set(1 / e.cols, 1 / e.rows), n.current += d;
|
|
287
|
+
const m = Math.floor(n.current * e.fps) % e.frames;
|
|
288
|
+
if (m === i.current) return;
|
|
289
|
+
i.current = m;
|
|
290
|
+
const { x: u, y: p } = Mt(m, e.cols, e.rows);
|
|
291
|
+
a.offset.set(u, p);
|
|
292
|
+
}), /* @__PURE__ */ L("mesh", { name: r, renderOrder: s, scale: [o, l, 1], children: [
|
|
293
|
+
/* @__PURE__ */ M("planeGeometry", { args: [1, 1] }),
|
|
294
|
+
/* @__PURE__ */ M("meshBasicMaterial", { map: a, transparent: !0, toneMapped: !1, depthWrite: !1 })
|
|
235
295
|
] });
|
|
236
|
-
},
|
|
237
|
-
sheet:
|
|
238
|
-
anchors:
|
|
296
|
+
}, fs = ({
|
|
297
|
+
sheet: e,
|
|
298
|
+
anchors: t = yt,
|
|
239
299
|
contentAspect: s,
|
|
240
300
|
renderOrder: r = 10,
|
|
241
301
|
name: a = "spriteAnimation"
|
|
242
|
-
}) => /* @__PURE__ */
|
|
243
|
-
switch (
|
|
302
|
+
}) => /* @__PURE__ */ M(He, { fallback: null, children: /* @__PURE__ */ M(Xe, { anchors: t, children: /* @__PURE__ */ M(Tt, { sheet: e, contentAspect: s, renderOrder: r, name: a }) }) }), q = (e) => {
|
|
303
|
+
switch (e) {
|
|
244
304
|
case "start":
|
|
245
305
|
return "starting";
|
|
246
306
|
case "started":
|
|
@@ -257,207 +317,207 @@ const tt = ({
|
|
|
257
317
|
case "clear":
|
|
258
318
|
return "idle";
|
|
259
319
|
}
|
|
260
|
-
},
|
|
320
|
+
}, Et = [
|
|
261
321
|
"video/mp4",
|
|
262
322
|
"video/webm;codecs=vp9",
|
|
263
323
|
"video/webm;codecs=vp8",
|
|
264
324
|
"video/webm"
|
|
265
325
|
];
|
|
266
|
-
function
|
|
326
|
+
function hs(e = {}) {
|
|
267
327
|
const {
|
|
268
|
-
audio:
|
|
328
|
+
audio: t = !1,
|
|
269
329
|
mimeType: s,
|
|
270
330
|
bitsPerSecond: r,
|
|
271
331
|
onData: a,
|
|
272
|
-
onStop:
|
|
273
|
-
onRecordingStart:
|
|
332
|
+
onStop: n,
|
|
333
|
+
onRecordingStart: i,
|
|
274
334
|
onRecordingPause: c,
|
|
275
|
-
onRecordingResume:
|
|
276
|
-
onRecordingStop:
|
|
277
|
-
onRecordingComplete:
|
|
335
|
+
onRecordingResume: o,
|
|
336
|
+
onRecordingStop: l,
|
|
337
|
+
onRecordingComplete: h,
|
|
278
338
|
onError: d,
|
|
279
339
|
passThroughStream: m
|
|
280
|
-
} =
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
for (const
|
|
284
|
-
if ((
|
|
285
|
-
}, [s]),
|
|
286
|
-
async (
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
let
|
|
290
|
-
if (
|
|
291
|
-
|
|
340
|
+
} = e, u = F(null), p = F(null), S = F([]), [E, f] = k("idle"), [g, b] = k(null), [X, A] = k(null), w = R(() => {
|
|
341
|
+
var C;
|
|
342
|
+
const y = [s, ...Et].filter(Boolean);
|
|
343
|
+
for (const T of y)
|
|
344
|
+
if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder, T)) return T;
|
|
345
|
+
}, [s]), G = R(
|
|
346
|
+
async (y) => {
|
|
347
|
+
const C = new MediaStream();
|
|
348
|
+
if (y.getTracks().forEach((T) => C.addTrack(T)), t) {
|
|
349
|
+
let T;
|
|
350
|
+
if (t instanceof MediaStream)
|
|
351
|
+
T = t;
|
|
292
352
|
else {
|
|
293
|
-
const
|
|
294
|
-
|
|
353
|
+
const _ = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
|
|
354
|
+
T = await navigator.mediaDevices.getUserMedia(_);
|
|
295
355
|
}
|
|
296
|
-
|
|
356
|
+
T.getAudioTracks().forEach((_) => C.addTrack(_));
|
|
297
357
|
}
|
|
298
|
-
if (!
|
|
358
|
+
if (!C.getTracks().length)
|
|
299
359
|
throw new Error("No tracks available in combined stream.");
|
|
300
|
-
return
|
|
360
|
+
return p.current = C, C;
|
|
301
361
|
},
|
|
302
|
-
[
|
|
303
|
-
),
|
|
304
|
-
async (
|
|
305
|
-
|
|
362
|
+
[t]
|
|
363
|
+
), Y = R(
|
|
364
|
+
async (y, C) => {
|
|
365
|
+
f(q("start")), A(null), b(null);
|
|
306
366
|
try {
|
|
307
|
-
let
|
|
367
|
+
let T;
|
|
308
368
|
if (m)
|
|
309
|
-
|
|
369
|
+
T = m, p.current = T;
|
|
310
370
|
else {
|
|
311
|
-
if (!
|
|
312
|
-
|
|
371
|
+
if (!y) throw new Error("start(stream) requires a MediaStream.");
|
|
372
|
+
T = await G(y);
|
|
313
373
|
}
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
var
|
|
319
|
-
((
|
|
320
|
-
},
|
|
321
|
-
const
|
|
322
|
-
type:
|
|
374
|
+
const _ = w(), H = {};
|
|
375
|
+
_ && (H.mimeType = _), r && (H.bitsPerSecond = r);
|
|
376
|
+
const W = new MediaRecorder(T, H);
|
|
377
|
+
W.ondataavailable = (P) => {
|
|
378
|
+
var $;
|
|
379
|
+
(($ = P.data) == null ? void 0 : $.size) > 0 && (S.current.push(P.data), a == null || a(P.data));
|
|
380
|
+
}, W.onstop = () => {
|
|
381
|
+
const P = new Blob(S.current, {
|
|
382
|
+
type: _ ?? "video/webm"
|
|
323
383
|
});
|
|
324
|
-
P
|
|
325
|
-
},
|
|
326
|
-
} catch (
|
|
327
|
-
const
|
|
328
|
-
console.error("start(stream) failed",
|
|
384
|
+
b(P), n == null || n(P), h == null || h(P), S.current = [], f(q("complete"));
|
|
385
|
+
}, u.current = W, W.start(C), f(q("started")), i == null || i();
|
|
386
|
+
} catch (T) {
|
|
387
|
+
const _ = T instanceof Error ? T : new Error(String(T));
|
|
388
|
+
console.error("start(stream) failed", _), A(_), f(q("fail")), d == null || d(_);
|
|
329
389
|
}
|
|
330
390
|
},
|
|
331
391
|
[
|
|
332
|
-
|
|
333
|
-
|
|
392
|
+
G,
|
|
393
|
+
w,
|
|
334
394
|
r,
|
|
335
395
|
a,
|
|
396
|
+
n,
|
|
397
|
+
h,
|
|
336
398
|
i,
|
|
337
|
-
S,
|
|
338
|
-
o,
|
|
339
399
|
d,
|
|
340
400
|
m
|
|
341
401
|
]
|
|
342
|
-
),
|
|
343
|
-
const
|
|
344
|
-
!
|
|
345
|
-
}, [
|
|
346
|
-
const
|
|
347
|
-
(
|
|
348
|
-
}, [c]),
|
|
349
|
-
const
|
|
350
|
-
(
|
|
351
|
-
}, [
|
|
352
|
-
var
|
|
402
|
+
), J = R(() => {
|
|
403
|
+
const y = u.current;
|
|
404
|
+
!y || y.state === "inactive" || (f(q("stop")), y.stop(), l == null || l());
|
|
405
|
+
}, [l]), Q = R(() => {
|
|
406
|
+
const y = u.current;
|
|
407
|
+
(y == null ? void 0 : y.state) === "recording" && (y.pause(), f(q("pause")), c == null || c());
|
|
408
|
+
}, [c]), ee = R(() => {
|
|
409
|
+
const y = u.current;
|
|
410
|
+
(y == null ? void 0 : y.state) === "paused" && (y.resume(), f(q("resume")), o == null || o());
|
|
411
|
+
}, [o]), z = R(() => {
|
|
412
|
+
var y;
|
|
353
413
|
try {
|
|
354
|
-
|
|
355
|
-
} catch (
|
|
356
|
-
console.error("clear failed",
|
|
414
|
+
u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (y = p.current) == null || y.getTracks().forEach((C) => C.stop()), p.current = null, b(null), f(q("clear")), S.current = [], A(null);
|
|
415
|
+
} catch (C) {
|
|
416
|
+
console.error("clear failed", C);
|
|
357
417
|
}
|
|
358
418
|
}, []);
|
|
359
|
-
return
|
|
360
|
-
status:
|
|
361
|
-
start:
|
|
362
|
-
stop:
|
|
363
|
-
pause:
|
|
364
|
-
resume:
|
|
365
|
-
clear:
|
|
366
|
-
isRecording:
|
|
367
|
-
isPaused:
|
|
368
|
-
recordedBlob:
|
|
369
|
-
error:
|
|
370
|
-
getActiveStream: () =>
|
|
419
|
+
return x(() => () => z(), []), {
|
|
420
|
+
status: E,
|
|
421
|
+
start: Y,
|
|
422
|
+
stop: J,
|
|
423
|
+
pause: Q,
|
|
424
|
+
resume: ee,
|
|
425
|
+
clear: z,
|
|
426
|
+
isRecording: E === "recording" || E === "paused",
|
|
427
|
+
isPaused: E === "paused",
|
|
428
|
+
recordedBlob: g,
|
|
429
|
+
error: X,
|
|
430
|
+
getActiveStream: () => p.current
|
|
371
431
|
};
|
|
372
432
|
}
|
|
373
|
-
const
|
|
433
|
+
const Rt = async (e, t = {}) => {
|
|
374
434
|
var s, r, a;
|
|
375
|
-
(s =
|
|
435
|
+
(s = t.onCaptureStart) == null || s.call(t), await Promise.resolve();
|
|
376
436
|
try {
|
|
377
|
-
const
|
|
378
|
-
return (r =
|
|
379
|
-
} catch (
|
|
380
|
-
const
|
|
381
|
-
throw (a =
|
|
437
|
+
const n = e();
|
|
438
|
+
return (r = t.onCaptureComplete) == null || r.call(t, n), n;
|
|
439
|
+
} catch (n) {
|
|
440
|
+
const i = n instanceof Error ? n : new Error(String(n));
|
|
441
|
+
throw (a = t.onError) == null || a.call(t, i), i;
|
|
382
442
|
}
|
|
383
|
-
},
|
|
384
|
-
const { session:
|
|
385
|
-
captureFrame: s =
|
|
443
|
+
}, gs = (e = {}) => {
|
|
444
|
+
const { session: t } = Le(), {
|
|
445
|
+
captureFrame: s = t.captureFrame,
|
|
386
446
|
onCaptureStart: r,
|
|
387
447
|
onCaptureComplete: a,
|
|
388
|
-
onError:
|
|
389
|
-
} =
|
|
390
|
-
c("capturing"),
|
|
448
|
+
onError: n
|
|
449
|
+
} = e, [i, c] = k("idle"), [o, l] = k(null), [h, d] = k(null), m = R(async () => {
|
|
450
|
+
c("capturing"), l(null), d(null);
|
|
391
451
|
try {
|
|
392
|
-
const
|
|
452
|
+
const p = await Rt(s, {
|
|
393
453
|
onCaptureStart: r,
|
|
394
454
|
onCaptureComplete: a,
|
|
395
|
-
onError:
|
|
455
|
+
onError: n
|
|
396
456
|
});
|
|
397
|
-
return
|
|
398
|
-
} catch (
|
|
399
|
-
const
|
|
400
|
-
return d(
|
|
457
|
+
return l(p), c("completed"), p;
|
|
458
|
+
} catch (p) {
|
|
459
|
+
const S = p instanceof Error ? p : new Error(String(p));
|
|
460
|
+
return d(S), c("error"), null;
|
|
401
461
|
}
|
|
402
|
-
}, [s, r, a,
|
|
403
|
-
c("idle"),
|
|
462
|
+
}, [s, r, a, n]), u = R(() => {
|
|
463
|
+
c("idle"), l(null), d(null);
|
|
404
464
|
}, []);
|
|
405
|
-
return { status:
|
|
406
|
-
},
|
|
407
|
-
const s =
|
|
408
|
-
let
|
|
409
|
-
const c = new Uint8Array(
|
|
410
|
-
for (;
|
|
411
|
-
c[
|
|
412
|
-
return new File([c],
|
|
413
|
-
},
|
|
414
|
-
if (
|
|
415
|
-
|
|
465
|
+
return { status: i, capturePhoto: m, clear: u, dataUrl: o, error: h };
|
|
466
|
+
}, Ss = (e, t) => {
|
|
467
|
+
const s = e.split(","), r = s[0].match(/:(.*?);/), a = r ? r[1] : "application/octet-stream", n = atob(s[s.length - 1]);
|
|
468
|
+
let i = n.length;
|
|
469
|
+
const c = new Uint8Array(i);
|
|
470
|
+
for (; i--; )
|
|
471
|
+
c[i] = n.charCodeAt(i);
|
|
472
|
+
return new File([c], t, { type: a });
|
|
473
|
+
}, bt = 4, At = 50, Ft = 5e3, se = (e) => Math.min(1, Math.max(0, e)), Me = (e) => new Promise((t) => {
|
|
474
|
+
if (e.readyState >= 4) {
|
|
475
|
+
t();
|
|
416
476
|
return;
|
|
417
477
|
}
|
|
418
478
|
let s = !1;
|
|
419
479
|
const r = () => {
|
|
420
|
-
s || (s = !0,
|
|
480
|
+
s || (s = !0, t());
|
|
421
481
|
};
|
|
422
|
-
|
|
423
|
-
}),
|
|
482
|
+
e.addEventListener("canplaythrough", r, { once: !0 }), e.addEventListener("error", r, { once: !0 }), setTimeout(r, Ft);
|
|
483
|
+
}), Te = (e, t) => {
|
|
424
484
|
const s = document.createElement("audio");
|
|
425
|
-
return s.src =
|
|
426
|
-
},
|
|
427
|
-
|
|
428
|
-
|
|
485
|
+
return s.src = e, s.loop = t, s.preload = "auto", s.setAttribute("playsinline", ""), s.setAttribute("webkit-playsinline", ""), s.load(), s;
|
|
486
|
+
}, Ct = (e) => {
|
|
487
|
+
e.muted = !0, e.play().then(() => {
|
|
488
|
+
e.pause(), e.currentTime = 0, e.muted = !1;
|
|
429
489
|
}).catch(() => {
|
|
430
|
-
|
|
490
|
+
e.muted = !1;
|
|
431
491
|
});
|
|
432
492
|
};
|
|
433
|
-
class
|
|
434
|
-
constructor(
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
493
|
+
class vt {
|
|
494
|
+
constructor(t = {}) {
|
|
495
|
+
N(this, "sfxPoolSize");
|
|
496
|
+
N(this, "coalesceMs");
|
|
497
|
+
N(this, "muted", !0);
|
|
498
|
+
N(this, "listeners", /* @__PURE__ */ new Set());
|
|
499
|
+
N(this, "music", null);
|
|
500
|
+
N(this, "musicUrl", null);
|
|
501
|
+
N(this, "musicReady", null);
|
|
502
|
+
N(this, "musicWanted", null);
|
|
503
|
+
N(this, "pools", /* @__PURE__ */ new Map());
|
|
444
504
|
/** Last play time per SFX URL, for the coalesce window. */
|
|
445
|
-
|
|
505
|
+
N(this, "lastPlayed", /* @__PURE__ */ new Map());
|
|
446
506
|
/** Readiness promises so a loading gate can await decode/buffer. */
|
|
447
|
-
|
|
448
|
-
this.sfxPoolSize =
|
|
507
|
+
N(this, "ready", /* @__PURE__ */ new Map());
|
|
508
|
+
this.sfxPoolSize = t.sfxPoolSize ?? bt, this.coalesceMs = t.coalesceMs ?? At;
|
|
449
509
|
}
|
|
450
510
|
/**
|
|
451
511
|
* Create + buffer the looping music element. Await in the loading gate so the
|
|
452
512
|
* unmute tap is instant. Idempotent per URL (re-requesting the same track is
|
|
453
513
|
* a no-op that returns the in-flight promise).
|
|
454
514
|
*/
|
|
455
|
-
prefetchMusic(
|
|
456
|
-
const r =
|
|
457
|
-
if (this.musicWanted = { url:
|
|
515
|
+
prefetchMusic(t, s = 0.4) {
|
|
516
|
+
const r = se(s);
|
|
517
|
+
if (this.musicWanted = { url: t, volume: r }, this.musicUrl === t && this.musicReady)
|
|
458
518
|
return this.music && (this.music.volume = r), this.musicReady;
|
|
459
|
-
this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music =
|
|
460
|
-
const a =
|
|
519
|
+
this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = Te(t, !0), this.musicUrl = t, this.music.volume = r;
|
|
520
|
+
const a = Me(this.music);
|
|
461
521
|
return this.musicReady = a, a;
|
|
462
522
|
}
|
|
463
523
|
/**
|
|
@@ -465,24 +525,24 @@ class Oe {
|
|
|
465
525
|
* cut each other off). Returns a promise that resolves when the first element
|
|
466
526
|
* buffers. Idempotent per URL.
|
|
467
527
|
*/
|
|
468
|
-
registerSound(
|
|
469
|
-
const r = this.ready.get(
|
|
528
|
+
registerSound(t, s = 1) {
|
|
529
|
+
const r = this.ready.get(t);
|
|
470
530
|
if (r) return r;
|
|
471
|
-
const a =
|
|
531
|
+
const a = se(s), n = [];
|
|
472
532
|
for (let c = 0; c < this.sfxPoolSize; c += 1) {
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}),
|
|
533
|
+
const o = Te(t, !1);
|
|
534
|
+
o.volume = a, o.addEventListener("ended", () => {
|
|
535
|
+
o.currentTime = 0;
|
|
536
|
+
}), n.push(o);
|
|
477
537
|
}
|
|
478
|
-
this.pools.set(
|
|
479
|
-
const
|
|
480
|
-
return this.ready.set(
|
|
538
|
+
this.pools.set(t, { els: n, next: 0, volume: a });
|
|
539
|
+
const i = Me(n[0]);
|
|
540
|
+
return this.ready.set(t, i), i;
|
|
481
541
|
}
|
|
482
542
|
/** Subscribe to mute-state changes (for a toggle UI). Fires immediately with
|
|
483
543
|
* the current state. Returns an unsubscribe. */
|
|
484
|
-
onMuteChange(
|
|
485
|
-
return this.listeners.add(
|
|
544
|
+
onMuteChange(t) {
|
|
545
|
+
return this.listeners.add(t), t(this.muted), () => this.listeners.delete(t);
|
|
486
546
|
}
|
|
487
547
|
isMuted() {
|
|
488
548
|
return this.muted;
|
|
@@ -493,8 +553,8 @@ class Oe {
|
|
|
493
553
|
* element with a muted play/pause so later `playOneShot` calls are allowed,
|
|
494
554
|
* then start the music. All elements are already buffered, so this is instant.
|
|
495
555
|
*/
|
|
496
|
-
setMuted(
|
|
497
|
-
|
|
556
|
+
setMuted(t) {
|
|
557
|
+
t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((s) => s.els.forEach(Ct)), this.applyMusic(), this.listeners.forEach((s) => s(this.muted)));
|
|
498
558
|
}
|
|
499
559
|
toggleMuted() {
|
|
500
560
|
this.setMuted(!this.muted);
|
|
@@ -505,30 +565,30 @@ class Oe {
|
|
|
505
565
|
* same sound into one play, and does NO synchronous `currentTime` seek on a
|
|
506
566
|
* ready element (the pool rewinds on `ended`, off the hot path).
|
|
507
567
|
*/
|
|
508
|
-
playOneShot(
|
|
568
|
+
playOneShot(t, s) {
|
|
509
569
|
if (this.muted) return;
|
|
510
|
-
const r = this.pools.get(
|
|
570
|
+
const r = this.pools.get(t);
|
|
511
571
|
if (!r) return;
|
|
512
572
|
const a = performance.now();
|
|
513
|
-
if (a - (this.lastPlayed.get(
|
|
514
|
-
this.lastPlayed.set(
|
|
515
|
-
const
|
|
516
|
-
let
|
|
517
|
-
for (let c = 0; c <
|
|
518
|
-
const
|
|
519
|
-
if (
|
|
520
|
-
|
|
573
|
+
if (a - (this.lastPlayed.get(t) ?? -1 / 0) < this.coalesceMs) return;
|
|
574
|
+
this.lastPlayed.set(t, a);
|
|
575
|
+
const n = r.els.length;
|
|
576
|
+
let i;
|
|
577
|
+
for (let c = 0; c < n; c += 1) {
|
|
578
|
+
const o = r.els[(r.next + c) % n];
|
|
579
|
+
if (o.paused) {
|
|
580
|
+
i = o, r.next = (r.next + c + 1) % n;
|
|
521
581
|
break;
|
|
522
582
|
}
|
|
523
583
|
}
|
|
524
|
-
|
|
584
|
+
i || (i = r.els[r.next], r.next = (r.next + 1) % n), i.muted = !1, i.volume = se(s ?? r.volume), i.currentTime !== 0 && (i.currentTime = 0), i.play().catch(() => {
|
|
525
585
|
});
|
|
526
586
|
}
|
|
527
587
|
/** Request the looping background track (buffer it with prefetchMusic, which
|
|
528
588
|
* a loading gate awaits). Remembered while muted; starts on unmute. */
|
|
529
|
-
startMusic(
|
|
530
|
-
const r =
|
|
531
|
-
this.musicUrl !==
|
|
589
|
+
startMusic(t, s = 0.4) {
|
|
590
|
+
const r = se(s);
|
|
591
|
+
this.musicUrl !== t && this.prefetchMusic(t, r), this.musicWanted = { url: t, volume: r }, this.applyMusic();
|
|
532
592
|
}
|
|
533
593
|
stopMusic() {
|
|
534
594
|
this.musicWanted = null, this.music && (this.music.pause(), this.music.currentTime = 0);
|
|
@@ -538,179 +598,857 @@ class Oe {
|
|
|
538
598
|
}), this.muted && !this.music.paused && this.music.pause());
|
|
539
599
|
}
|
|
540
600
|
}
|
|
541
|
-
const
|
|
542
|
-
src:
|
|
601
|
+
const kt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(s)) ? "replay" : "ended", _t = (e, t, s) => e && t !== s, xt = (e) => Math.min(100, Math.max(0, e)) / 100, ys = ze(function({
|
|
602
|
+
src: t,
|
|
543
603
|
playMode: s = "once",
|
|
544
604
|
loopCount: r = 1,
|
|
545
605
|
autoplay: a = !1,
|
|
546
|
-
muted:
|
|
547
|
-
volume:
|
|
606
|
+
muted: n = !1,
|
|
607
|
+
volume: i = 100,
|
|
548
608
|
preload: c = "auto",
|
|
549
|
-
onReady:
|
|
550
|
-
onPlay:
|
|
551
|
-
onPause:
|
|
609
|
+
onReady: o,
|
|
610
|
+
onPlay: l,
|
|
611
|
+
onPause: h,
|
|
552
612
|
onEnded: d,
|
|
553
613
|
onError: m
|
|
554
|
-
},
|
|
555
|
-
const
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
614
|
+
}, u) {
|
|
615
|
+
const p = F(null), S = F(0), E = F(null), f = R(async () => {
|
|
616
|
+
const A = p.current;
|
|
617
|
+
if (A)
|
|
558
618
|
try {
|
|
559
|
-
await
|
|
560
|
-
} catch (
|
|
561
|
-
const
|
|
562
|
-
throw m == null || m(
|
|
619
|
+
await A.play();
|
|
620
|
+
} catch (w) {
|
|
621
|
+
const G = w instanceof Error ? w : new Error(String(w));
|
|
622
|
+
throw m == null || m(G), G;
|
|
563
623
|
}
|
|
564
|
-
}, [m]),
|
|
565
|
-
var
|
|
566
|
-
return (
|
|
567
|
-
}, []),
|
|
568
|
-
const
|
|
569
|
-
|
|
624
|
+
}, [m]), g = R(() => {
|
|
625
|
+
var A;
|
|
626
|
+
return (A = p.current) == null ? void 0 : A.pause();
|
|
627
|
+
}, []), b = R(() => {
|
|
628
|
+
const A = p.current;
|
|
629
|
+
A && (A.pause(), A.currentTime = 0, S.current = 0);
|
|
570
630
|
}, []);
|
|
571
|
-
|
|
572
|
-
|
|
631
|
+
$e(
|
|
632
|
+
u,
|
|
573
633
|
() => ({
|
|
574
|
-
play:
|
|
575
|
-
pause:
|
|
576
|
-
stop:
|
|
634
|
+
play: f,
|
|
635
|
+
pause: g,
|
|
636
|
+
stop: b,
|
|
577
637
|
get current() {
|
|
578
|
-
return
|
|
638
|
+
return p.current;
|
|
579
639
|
}
|
|
580
640
|
}),
|
|
581
|
-
[
|
|
582
|
-
),
|
|
583
|
-
|
|
584
|
-
}, [
|
|
585
|
-
|
|
586
|
-
}, [
|
|
587
|
-
|
|
641
|
+
[g, f, b]
|
|
642
|
+
), x(() => {
|
|
643
|
+
S.current = 0, E.current = null;
|
|
644
|
+
}, [t]), x(() => {
|
|
645
|
+
p.current && (p.current.volume = xt(i));
|
|
646
|
+
}, [i]), x(() => {
|
|
647
|
+
_t(a, E.current, t) && (E.current = t, f().catch(() => {
|
|
588
648
|
}));
|
|
589
|
-
}, [a,
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
const
|
|
593
|
-
if (
|
|
594
|
-
const
|
|
595
|
-
|
|
649
|
+
}, [a, t]);
|
|
650
|
+
const X = R(() => {
|
|
651
|
+
S.current += 1;
|
|
652
|
+
const A = Math.max(1, Math.floor(r));
|
|
653
|
+
if (kt(s, S.current, A) === "replay") {
|
|
654
|
+
const w = p.current;
|
|
655
|
+
w && (w.currentTime = 0, f().catch(() => {
|
|
596
656
|
}));
|
|
597
657
|
return;
|
|
598
658
|
}
|
|
599
|
-
|
|
600
|
-
}, [r, d,
|
|
601
|
-
return /* @__PURE__ */
|
|
659
|
+
S.current = 0, d == null || d();
|
|
660
|
+
}, [r, d, f, s]);
|
|
661
|
+
return /* @__PURE__ */ M(
|
|
602
662
|
"audio",
|
|
603
663
|
{
|
|
604
|
-
ref:
|
|
605
|
-
src:
|
|
664
|
+
ref: p,
|
|
665
|
+
src: t,
|
|
606
666
|
preload: c,
|
|
607
667
|
autoPlay: !1,
|
|
608
|
-
muted:
|
|
668
|
+
muted: n,
|
|
609
669
|
loop: !1,
|
|
610
670
|
playsInline: !0,
|
|
611
671
|
style: { display: "none" },
|
|
612
|
-
onCanPlayThrough:
|
|
613
|
-
onPlay:
|
|
614
|
-
onPause:
|
|
615
|
-
onEnded:
|
|
616
|
-
onError: () => m == null ? void 0 : m(new Error(`Unable to load audio: ${
|
|
672
|
+
onCanPlayThrough: o,
|
|
673
|
+
onPlay: l,
|
|
674
|
+
onPause: h,
|
|
675
|
+
onEnded: X,
|
|
676
|
+
onError: () => m == null ? void 0 : m(new Error(`Unable to load audio: ${t}`))
|
|
677
|
+
}
|
|
678
|
+
);
|
|
679
|
+
}), D = new vt(), Ms = (e, t) => D.prefetchMusic(e, t), Ts = (e, t) => D.registerSound(e, t), Es = (e, t) => D.startMusic(e, t), Rs = () => D.stopMusic(), bs = (e, t) => D.playOneShot(e, t), As = (e) => D.setMuted(e), Fs = () => D.toggleMuted(), Cs = () => D.isMuted(), vs = (e) => D.onMuteChange(e), ks = () => {
|
|
680
|
+
const [e, t] = k(D.isMuted());
|
|
681
|
+
return x(() => D.onMuteChange(t), []), e;
|
|
682
|
+
}, wt = (e = {}) => {
|
|
683
|
+
const { auto: t = !1 } = e, s = F(e.env ?? Oe()), r = F(e.constraints);
|
|
684
|
+
r.current = e.constraints;
|
|
685
|
+
const [a, n] = k("unknown"), [i, c] = k(null), o = F(0), l = R(async () => {
|
|
686
|
+
const d = ++o.current, m = await Ge(s.current);
|
|
687
|
+
if (d !== o.current) return a;
|
|
688
|
+
const u = m.state === "unknown" ? "unknown" : m.state;
|
|
689
|
+
return n((p) => p === "requesting" ? p : u), u !== "blocked" && c(null), u;
|
|
690
|
+
}, []), h = R(
|
|
691
|
+
async (d) => {
|
|
692
|
+
const m = ++o.current;
|
|
693
|
+
n("requesting"), c(null);
|
|
694
|
+
const u = await qe(
|
|
695
|
+
{ constraints: (d == null ? void 0 : d.constraints) ?? r.current, keepStream: !1 },
|
|
696
|
+
s.current
|
|
697
|
+
);
|
|
698
|
+
return m !== o.current || (n(u.state), c(u.reason)), u.state;
|
|
699
|
+
},
|
|
700
|
+
[]
|
|
701
|
+
);
|
|
702
|
+
return x(() => {
|
|
703
|
+
let d = () => {
|
|
704
|
+
}, m = !0;
|
|
705
|
+
return t ? h() : l(), Be((u) => {
|
|
706
|
+
m && (n((p) => p === "requesting" ? p : u.state === "unknown" ? "unknown" : u.state), u.state !== "blocked" && c(null));
|
|
707
|
+
}, s.current).then((u) => {
|
|
708
|
+
m ? d = u : u();
|
|
709
|
+
}), () => {
|
|
710
|
+
m = !1, o.current += 1, d();
|
|
711
|
+
};
|
|
712
|
+
}, [t, l, h]), Z(
|
|
713
|
+
() => ({
|
|
714
|
+
state: a,
|
|
715
|
+
reason: i,
|
|
716
|
+
canPrompt: Ke(a),
|
|
717
|
+
usable: a === "granted",
|
|
718
|
+
request: h,
|
|
719
|
+
refresh: l
|
|
720
|
+
}),
|
|
721
|
+
[a, i, h, l]
|
|
722
|
+
);
|
|
723
|
+
}, Nt = {
|
|
724
|
+
display: "flex",
|
|
725
|
+
flexDirection: "column",
|
|
726
|
+
alignItems: "center",
|
|
727
|
+
justifyContent: "center",
|
|
728
|
+
gap: 12,
|
|
729
|
+
height: "100%",
|
|
730
|
+
minHeight: 160,
|
|
731
|
+
padding: 24,
|
|
732
|
+
textAlign: "center",
|
|
733
|
+
background: "#111827",
|
|
734
|
+
color: "#f9fafb",
|
|
735
|
+
fontFamily: "system-ui, sans-serif"
|
|
736
|
+
}, Ut = {
|
|
737
|
+
font: "inherit",
|
|
738
|
+
padding: "10px 18px",
|
|
739
|
+
borderRadius: 8,
|
|
740
|
+
border: "1px solid rgba(255,255,255,0.3)",
|
|
741
|
+
background: "#2563eb",
|
|
742
|
+
color: "#fff",
|
|
743
|
+
cursor: "pointer"
|
|
744
|
+
}, _s = ({
|
|
745
|
+
children: e,
|
|
746
|
+
fallback: t,
|
|
747
|
+
auto: s = !1,
|
|
748
|
+
constraints: r,
|
|
749
|
+
requestLabel: a = "Allow camera"
|
|
750
|
+
}) => {
|
|
751
|
+
const n = wt({ auto: s, constraints: r });
|
|
752
|
+
if (n.usable) return /* @__PURE__ */ M(re, { children: e });
|
|
753
|
+
if (t) return /* @__PURE__ */ M(re, { children: t(n) });
|
|
754
|
+
const { state: i, reason: c, canPrompt: o, request: l } = n;
|
|
755
|
+
return /* @__PURE__ */ L("div", { style: Nt, role: "region", "aria-label": "Camera access", children: [
|
|
756
|
+
/* @__PURE__ */ M("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? We[i] }),
|
|
757
|
+
/* @__PURE__ */ M(
|
|
758
|
+
"button",
|
|
759
|
+
{
|
|
760
|
+
type: "button",
|
|
761
|
+
onClick: () => void l(),
|
|
762
|
+
disabled: !o || i === "requesting",
|
|
763
|
+
"aria-disabled": !o || i === "requesting",
|
|
764
|
+
style: { ...Ut, opacity: o && i !== "requesting" ? 1 : 0.5 },
|
|
765
|
+
children: i === "requesting" ? "Waiting…" : i === "denied" ? "Try again" : a
|
|
766
|
+
}
|
|
767
|
+
)
|
|
768
|
+
] });
|
|
769
|
+
}, Dt = () => {
|
|
770
|
+
var e;
|
|
771
|
+
return {
|
|
772
|
+
enumerateDevices: typeof navigator < "u" && ((e = navigator.mediaDevices) != null && e.enumerateDevices) ? () => navigator.mediaDevices.enumerateDevices() : void 0
|
|
773
|
+
};
|
|
774
|
+
}, Pt = /\b(back|rear|environment|world)\b/i, It = /\b(front|user|facetime|selfie)\b/i, Lt = (e) => Pt.test(e) ? "environment" : It.test(e) ? "user" : null, xs = async (e = Dt()) => {
|
|
775
|
+
if (!e.enumerateDevices) return [];
|
|
776
|
+
try {
|
|
777
|
+
return (await e.enumerateDevices()).filter((s) => s.kind === "videoinput").map((s) => ({
|
|
778
|
+
deviceId: s.deviceId,
|
|
779
|
+
label: s.label,
|
|
780
|
+
facing: Lt(s.label)
|
|
781
|
+
}));
|
|
782
|
+
} catch {
|
|
783
|
+
return [];
|
|
784
|
+
}
|
|
785
|
+
}, ws = (e, t) => e.find((s) => s.facing === t) ?? null, _e = Ve(null), Ns = ({
|
|
786
|
+
cache: e,
|
|
787
|
+
disposeUnreferencedOnUnmount: t = !0,
|
|
788
|
+
children: s
|
|
789
|
+
}) => {
|
|
790
|
+
const r = e ?? ke();
|
|
791
|
+
return x(() => () => {
|
|
792
|
+
t && r.disposeUnreferenced();
|
|
793
|
+
}, [r, t]), /* @__PURE__ */ M(_e.Provider, { value: r, children: s });
|
|
794
|
+
}, xe = () => je(_e) ?? ke(), Us = (e, t = {}) => {
|
|
795
|
+
const { enabled: s = !0 } = t, r = xe(), a = Ze(), n = (e == null ? void 0 : e.key) ?? null, [i, c] = k({
|
|
796
|
+
value: null,
|
|
797
|
+
status: "idle",
|
|
798
|
+
error: null
|
|
799
|
+
});
|
|
800
|
+
return x(() => {
|
|
801
|
+
if (!e || !s) {
|
|
802
|
+
c({ value: null, status: "idle", error: null });
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
let o = !0;
|
|
806
|
+
const l = r.get(e.key);
|
|
807
|
+
return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), r.acquire(e, a).then((h) => {
|
|
808
|
+
o && c({ value: h, status: "ready", error: null });
|
|
809
|
+
}).catch((h) => {
|
|
810
|
+
o && c({ value: null, status: "error", error: h });
|
|
811
|
+
}), () => {
|
|
812
|
+
o = !1, r.release(e.key, a);
|
|
813
|
+
};
|
|
814
|
+
}, [r, n, s, a]), i;
|
|
815
|
+
}, Ds = (e) => {
|
|
816
|
+
const t = xe(), s = e ?? t;
|
|
817
|
+
return Ye(
|
|
818
|
+
(r) => s.subscribe(r),
|
|
819
|
+
() => s.getStats(),
|
|
820
|
+
() => s.getStats()
|
|
821
|
+
);
|
|
822
|
+
}, ae = 1, we = Object.freeze({
|
|
823
|
+
version: ae,
|
|
824
|
+
trackers: {
|
|
825
|
+
face: { enabled: !0, numFaces: 1, targetFps: null, holdMs: 250, predictMs: 0, smoothing: 0 },
|
|
826
|
+
hand: { enabled: !1, targetFps: null },
|
|
827
|
+
gesture: { enabled: !1, targetFps: null },
|
|
828
|
+
body: { enabled: !1, targetFps: null },
|
|
829
|
+
holistic: {
|
|
830
|
+
enabled: !1,
|
|
831
|
+
targetFps: null,
|
|
832
|
+
hands: "both",
|
|
833
|
+
holdMs: 250,
|
|
834
|
+
predictMs: 0,
|
|
835
|
+
analysisMaxDimension: 768,
|
|
836
|
+
outputFaceBlendshapes: !0,
|
|
837
|
+
confidence: 0.5,
|
|
838
|
+
delegate: "auto"
|
|
839
|
+
},
|
|
840
|
+
segmentation: { enabled: !1, quality: "low" },
|
|
841
|
+
semanticSegmentation: { enabled: !1, preset: "multiclass", quality: "medium" }
|
|
842
|
+
},
|
|
843
|
+
perf: { targetFps: 24, camRes: 720, cameraZoom: 1.2, analysisScale: 1 },
|
|
844
|
+
lifecycle: { pauseWhenHidden: !1 },
|
|
845
|
+
quality: {},
|
|
846
|
+
camera: { facingMode: "user", deviceId: null, mirrored: "auto" },
|
|
847
|
+
fallbacks: { onUnsupported: "degrade", delegate: "auto" },
|
|
848
|
+
assets: { holisticModelUrl: null, semanticSegmentationModelUrl: null },
|
|
849
|
+
updatedAt: 0
|
|
850
|
+
}), U = (e, t, s, r, a, n) => {
|
|
851
|
+
if (e === void 0) return t;
|
|
852
|
+
if (typeof e != "number" || !Number.isFinite(e))
|
|
853
|
+
return n(`${a}: not a number, kept ${t}`), t;
|
|
854
|
+
const i = Math.min(r, Math.max(s, e));
|
|
855
|
+
return i !== e && n(`${a}: ${e} clamped to ${i}`), i;
|
|
856
|
+
}, j = (e, t, s, r) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (r(`${s}: invalid fps, kept ${t}`), t) : (e > 120 && r(`${s}: ${e} clamped to 120`), Math.min(120, e)), Ot = [
|
|
857
|
+
"tiers",
|
|
858
|
+
"budget",
|
|
859
|
+
"initialTier",
|
|
860
|
+
"minTier",
|
|
861
|
+
"maxTier",
|
|
862
|
+
"adaptive",
|
|
863
|
+
"historySize"
|
|
864
|
+
], Ee = (e) => {
|
|
865
|
+
const t = {};
|
|
866
|
+
for (const s of Ot) e[s] !== void 0 && (t[s] = e[s]);
|
|
867
|
+
return t;
|
|
868
|
+
}, I = (e, t, s, r) => e === void 0 ? t : typeof e != "boolean" ? (r(`${s}: not a boolean, kept ${t}`), t) : e, B = (e, t, s, r, a) => e === void 0 ? s : t.includes(e) ? e : (a(`${r}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${s}`), s), Re = (e, t, s, r) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (r(`${s}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, K = (e = {}, t = we, s = []) => {
|
|
869
|
+
var c, o, l, h, d, m, u, p, S, E, f, g, b, X, A, w, G, Y, J, Q, ee, z, y, C, T, _, H, W, P, $, le, ue, de, me, pe, fe, he, ge;
|
|
870
|
+
const r = (De) => s.push(De), a = e.trackers ?? {}, n = t.trackers, i = e.quality === void 0 ? t.quality === !1 ? !1 : Ee(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? Ee(e.quality) : (r("quality: must be an object or false, kept base"), t.quality);
|
|
871
|
+
return {
|
|
872
|
+
version: ae,
|
|
873
|
+
trackers: {
|
|
874
|
+
face: {
|
|
875
|
+
enabled: I((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled", r),
|
|
876
|
+
numFaces: Math.round(
|
|
877
|
+
U((o = a.face) == null ? void 0 : o.numFaces, n.face.numFaces, 1, 10, "trackers.face.numFaces", r)
|
|
878
|
+
),
|
|
879
|
+
targetFps: j((l = a.face) == null ? void 0 : l.targetFps, n.face.targetFps, "trackers.face.targetFps", r),
|
|
880
|
+
holdMs: U((h = a.face) == null ? void 0 : h.holdMs, n.face.holdMs, 0, 5e3, "trackers.face.holdMs", r),
|
|
881
|
+
predictMs: U(
|
|
882
|
+
(d = a.face) == null ? void 0 : d.predictMs,
|
|
883
|
+
n.face.predictMs,
|
|
884
|
+
0,
|
|
885
|
+
1e3,
|
|
886
|
+
"trackers.face.predictMs",
|
|
887
|
+
r
|
|
888
|
+
),
|
|
889
|
+
smoothing: U(
|
|
890
|
+
(m = a.face) == null ? void 0 : m.smoothing,
|
|
891
|
+
n.face.smoothing,
|
|
892
|
+
0,
|
|
893
|
+
100,
|
|
894
|
+
"trackers.face.smoothing",
|
|
895
|
+
r
|
|
896
|
+
)
|
|
897
|
+
},
|
|
898
|
+
hand: {
|
|
899
|
+
enabled: I((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled", r),
|
|
900
|
+
targetFps: j((p = a.hand) == null ? void 0 : p.targetFps, n.hand.targetFps, "trackers.hand.targetFps", r)
|
|
901
|
+
},
|
|
902
|
+
gesture: {
|
|
903
|
+
enabled: I((S = a.gesture) == null ? void 0 : S.enabled, n.gesture.enabled, "trackers.gesture.enabled", r),
|
|
904
|
+
targetFps: j(
|
|
905
|
+
(E = a.gesture) == null ? void 0 : E.targetFps,
|
|
906
|
+
n.gesture.targetFps,
|
|
907
|
+
"trackers.gesture.targetFps",
|
|
908
|
+
r
|
|
909
|
+
)
|
|
910
|
+
},
|
|
911
|
+
body: {
|
|
912
|
+
enabled: I((f = a.body) == null ? void 0 : f.enabled, n.body.enabled, "trackers.body.enabled", r),
|
|
913
|
+
targetFps: j((g = a.body) == null ? void 0 : g.targetFps, n.body.targetFps, "trackers.body.targetFps", r)
|
|
914
|
+
},
|
|
915
|
+
holistic: {
|
|
916
|
+
enabled: I((b = a.holistic) == null ? void 0 : b.enabled, n.holistic.enabled, "trackers.holistic.enabled", r),
|
|
917
|
+
targetFps: j(
|
|
918
|
+
(X = a.holistic) == null ? void 0 : X.targetFps,
|
|
919
|
+
n.holistic.targetFps,
|
|
920
|
+
"trackers.holistic.targetFps",
|
|
921
|
+
r
|
|
922
|
+
),
|
|
923
|
+
hands: B(
|
|
924
|
+
(A = a.holistic) == null ? void 0 : A.hands,
|
|
925
|
+
["both", "left", "right", "none"],
|
|
926
|
+
n.holistic.hands,
|
|
927
|
+
"trackers.holistic.hands",
|
|
928
|
+
r
|
|
929
|
+
),
|
|
930
|
+
holdMs: U(
|
|
931
|
+
(w = a.holistic) == null ? void 0 : w.holdMs,
|
|
932
|
+
n.holistic.holdMs,
|
|
933
|
+
0,
|
|
934
|
+
5e3,
|
|
935
|
+
"trackers.holistic.holdMs",
|
|
936
|
+
r
|
|
937
|
+
),
|
|
938
|
+
predictMs: U(
|
|
939
|
+
(G = a.holistic) == null ? void 0 : G.predictMs,
|
|
940
|
+
n.holistic.predictMs,
|
|
941
|
+
0,
|
|
942
|
+
1e3,
|
|
943
|
+
"trackers.holistic.predictMs",
|
|
944
|
+
r
|
|
945
|
+
),
|
|
946
|
+
analysisMaxDimension: Math.round(
|
|
947
|
+
U(
|
|
948
|
+
(Y = a.holistic) == null ? void 0 : Y.analysisMaxDimension,
|
|
949
|
+
n.holistic.analysisMaxDimension,
|
|
950
|
+
128,
|
|
951
|
+
2048,
|
|
952
|
+
"trackers.holistic.analysisMaxDimension",
|
|
953
|
+
r
|
|
954
|
+
)
|
|
955
|
+
),
|
|
956
|
+
outputFaceBlendshapes: I(
|
|
957
|
+
(J = a.holistic) == null ? void 0 : J.outputFaceBlendshapes,
|
|
958
|
+
n.holistic.outputFaceBlendshapes,
|
|
959
|
+
"trackers.holistic.outputFaceBlendshapes",
|
|
960
|
+
r
|
|
961
|
+
),
|
|
962
|
+
confidence: U(
|
|
963
|
+
(Q = a.holistic) == null ? void 0 : Q.confidence,
|
|
964
|
+
n.holistic.confidence,
|
|
965
|
+
0,
|
|
966
|
+
1,
|
|
967
|
+
"trackers.holistic.confidence",
|
|
968
|
+
r
|
|
969
|
+
),
|
|
970
|
+
delegate: B(
|
|
971
|
+
(ee = a.holistic) == null ? void 0 : ee.delegate,
|
|
972
|
+
["auto", "GPU", "CPU"],
|
|
973
|
+
n.holistic.delegate,
|
|
974
|
+
"trackers.holistic.delegate",
|
|
975
|
+
r
|
|
976
|
+
)
|
|
977
|
+
},
|
|
978
|
+
segmentation: {
|
|
979
|
+
enabled: I(
|
|
980
|
+
(z = a.segmentation) == null ? void 0 : z.enabled,
|
|
981
|
+
n.segmentation.enabled,
|
|
982
|
+
"trackers.segmentation.enabled",
|
|
983
|
+
r
|
|
984
|
+
),
|
|
985
|
+
quality: B(
|
|
986
|
+
(y = a.segmentation) == null ? void 0 : y.quality,
|
|
987
|
+
["low", "medium", "high"],
|
|
988
|
+
n.segmentation.quality,
|
|
989
|
+
"trackers.segmentation.quality",
|
|
990
|
+
r
|
|
991
|
+
)
|
|
992
|
+
},
|
|
993
|
+
semanticSegmentation: {
|
|
994
|
+
enabled: I(
|
|
995
|
+
(C = a.semanticSegmentation) == null ? void 0 : C.enabled,
|
|
996
|
+
n.semanticSegmentation.enabled,
|
|
997
|
+
"trackers.semanticSegmentation.enabled",
|
|
998
|
+
r
|
|
999
|
+
),
|
|
1000
|
+
preset: B(
|
|
1001
|
+
(T = a.semanticSegmentation) == null ? void 0 : T.preset,
|
|
1002
|
+
lt,
|
|
1003
|
+
n.semanticSegmentation.preset,
|
|
1004
|
+
"trackers.semanticSegmentation.preset",
|
|
1005
|
+
r
|
|
1006
|
+
),
|
|
1007
|
+
quality: B(
|
|
1008
|
+
(_ = a.semanticSegmentation) == null ? void 0 : _.quality,
|
|
1009
|
+
["low", "medium", "high"],
|
|
1010
|
+
n.semanticSegmentation.quality,
|
|
1011
|
+
"trackers.semanticSegmentation.quality",
|
|
1012
|
+
r
|
|
1013
|
+
)
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
perf: {
|
|
1017
|
+
targetFps: U((H = e.perf) == null ? void 0 : H.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", r),
|
|
1018
|
+
camRes: Math.round(U((W = e.perf) == null ? void 0 : W.camRes, t.perf.camRes, 160, 3840, "perf.camRes", r)),
|
|
1019
|
+
cameraZoom: U((P = e.perf) == null ? void 0 : P.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", r),
|
|
1020
|
+
analysisScale: U(
|
|
1021
|
+
($ = e.perf) == null ? void 0 : $.analysisScale,
|
|
1022
|
+
t.perf.analysisScale,
|
|
1023
|
+
0.25,
|
|
1024
|
+
1,
|
|
1025
|
+
"perf.analysisScale",
|
|
1026
|
+
r
|
|
1027
|
+
)
|
|
1028
|
+
},
|
|
1029
|
+
lifecycle: {
|
|
1030
|
+
pauseWhenHidden: I(
|
|
1031
|
+
(le = e.lifecycle) == null ? void 0 : le.pauseWhenHidden,
|
|
1032
|
+
t.lifecycle.pauseWhenHidden,
|
|
1033
|
+
"lifecycle.pauseWhenHidden",
|
|
1034
|
+
r
|
|
1035
|
+
)
|
|
1036
|
+
},
|
|
1037
|
+
quality: i,
|
|
1038
|
+
camera: {
|
|
1039
|
+
facingMode: B(
|
|
1040
|
+
(ue = e.camera) == null ? void 0 : ue.facingMode,
|
|
1041
|
+
["user", "environment"],
|
|
1042
|
+
t.camera.facingMode,
|
|
1043
|
+
"camera.facingMode",
|
|
1044
|
+
r
|
|
1045
|
+
),
|
|
1046
|
+
deviceId: ((de = e.camera) == null ? void 0 : de.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (r("camera.deviceId: not a string, kept base"), t.camera.deviceId),
|
|
1047
|
+
mirrored: ((me = e.camera) == null ? void 0 : me.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (r('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
|
|
1048
|
+
},
|
|
1049
|
+
fallbacks: {
|
|
1050
|
+
onUnsupported: B(
|
|
1051
|
+
(pe = e.fallbacks) == null ? void 0 : pe.onUnsupported,
|
|
1052
|
+
["block", "degrade"],
|
|
1053
|
+
t.fallbacks.onUnsupported,
|
|
1054
|
+
"fallbacks.onUnsupported",
|
|
1055
|
+
r
|
|
1056
|
+
),
|
|
1057
|
+
delegate: B(
|
|
1058
|
+
(fe = e.fallbacks) == null ? void 0 : fe.delegate,
|
|
1059
|
+
["auto", "GPU", "CPU"],
|
|
1060
|
+
t.fallbacks.delegate,
|
|
1061
|
+
"fallbacks.delegate",
|
|
1062
|
+
r
|
|
1063
|
+
)
|
|
1064
|
+
},
|
|
1065
|
+
assets: {
|
|
1066
|
+
holisticModelUrl: Re(
|
|
1067
|
+
(he = e.assets) == null ? void 0 : he.holisticModelUrl,
|
|
1068
|
+
t.assets.holisticModelUrl,
|
|
1069
|
+
"assets.holisticModelUrl",
|
|
1070
|
+
r
|
|
1071
|
+
),
|
|
1072
|
+
semanticSegmentationModelUrl: Re(
|
|
1073
|
+
(ge = e.assets) == null ? void 0 : ge.semanticSegmentationModelUrl,
|
|
1074
|
+
t.assets.semanticSegmentationModelUrl,
|
|
1075
|
+
"assets.semanticSegmentationModelUrl",
|
|
1076
|
+
r
|
|
1077
|
+
)
|
|
1078
|
+
},
|
|
1079
|
+
updatedAt: typeof e.updatedAt == "number" && Number.isFinite(e.updatedAt) ? e.updatedAt : t.updatedAt
|
|
1080
|
+
};
|
|
1081
|
+
}, be = (e, t, s = Date.now()) => K({ ...t, updatedAt: s }, e), Ne = (e) => JSON.stringify(K({}, e)), Ue = (e) => {
|
|
1082
|
+
const t = [];
|
|
1083
|
+
let s = e;
|
|
1084
|
+
if (typeof e == "string")
|
|
1085
|
+
try {
|
|
1086
|
+
s = JSON.parse(e);
|
|
1087
|
+
} catch {
|
|
1088
|
+
return {
|
|
1089
|
+
config: K(),
|
|
1090
|
+
migrated: !0,
|
|
1091
|
+
warnings: ["not valid JSON; defaults used"]
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
if (!s || typeof s != "object")
|
|
1095
|
+
return {
|
|
1096
|
+
config: K(),
|
|
1097
|
+
migrated: !0,
|
|
1098
|
+
warnings: ["not an object; defaults used"]
|
|
1099
|
+
};
|
|
1100
|
+
const r = s, a = r.version !== ae;
|
|
1101
|
+
return a && t.push(
|
|
1102
|
+
`migrated from version ${String(r.version ?? "none")} to ${ae}`
|
|
1103
|
+
), { config: K(r, we, t), migrated: a, warnings: t };
|
|
1104
|
+
}, Ps = [
|
|
1105
|
+
"face",
|
|
1106
|
+
"hand",
|
|
1107
|
+
"gesture",
|
|
1108
|
+
"body",
|
|
1109
|
+
"holistic",
|
|
1110
|
+
"segmentation",
|
|
1111
|
+
"semanticSegmentation"
|
|
1112
|
+
], Gt = (e) => ({
|
|
1113
|
+
perf: {
|
|
1114
|
+
targetFps: e.perf.targetFps > 0 ? e.perf.targetFps : void 0,
|
|
1115
|
+
camRes: e.perf.camRes,
|
|
1116
|
+
cameraZoom: e.perf.cameraZoom,
|
|
1117
|
+
analysisScale: e.perf.analysisScale
|
|
1118
|
+
},
|
|
1119
|
+
lifecycle: { pauseWhenHidden: e.lifecycle.pauseWhenHidden },
|
|
1120
|
+
quality: e.quality
|
|
1121
|
+
}), qt = (e) => ({
|
|
1122
|
+
facingMode: e.camera.facingMode,
|
|
1123
|
+
...e.camera.deviceId ? { deviceId: e.camera.deviceId } : {},
|
|
1124
|
+
...e.camera.mirrored === "auto" ? {} : { mirrored: e.camera.mirrored }
|
|
1125
|
+
}), O = (e) => e === null ? {} : { targetFps: e }, Bt = (e, t) => {
|
|
1126
|
+
const s = e.trackers;
|
|
1127
|
+
return {
|
|
1128
|
+
face: {
|
|
1129
|
+
numFaces: s.face.numFaces,
|
|
1130
|
+
...O(s.face.targetFps),
|
|
1131
|
+
holdMs: s.face.holdMs,
|
|
1132
|
+
predictMs: s.face.predictMs,
|
|
1133
|
+
active: s.face.enabled
|
|
1134
|
+
},
|
|
1135
|
+
hand: { ...O(s.hand.targetFps), active: s.hand.enabled },
|
|
1136
|
+
gesture: { ...O(s.gesture.targetFps), active: s.gesture.enabled },
|
|
1137
|
+
body: { active: s.body.enabled },
|
|
1138
|
+
holistic: {
|
|
1139
|
+
...O(s.holistic.targetFps),
|
|
1140
|
+
hands: s.holistic.hands,
|
|
1141
|
+
holdMs: s.holistic.holdMs,
|
|
1142
|
+
predictMs: s.holistic.predictMs,
|
|
1143
|
+
analysisMaxDimension: s.holistic.analysisMaxDimension,
|
|
1144
|
+
outputFaceBlendshapes: s.holistic.outputFaceBlendshapes,
|
|
1145
|
+
delegate: s.holistic.delegate === "auto" ? e.fallbacks.delegate : s.holistic.delegate,
|
|
1146
|
+
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {},
|
|
1147
|
+
active: s.holistic.enabled
|
|
1148
|
+
},
|
|
1149
|
+
segmentation: { quality: s.segmentation.quality, active: s.segmentation.enabled },
|
|
1150
|
+
semanticSegmentation: {
|
|
1151
|
+
preset: s.semanticSegmentation.preset,
|
|
1152
|
+
quality: s.semanticSegmentation.quality,
|
|
1153
|
+
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {},
|
|
1154
|
+
active: s.semanticSegmentation.enabled
|
|
1155
|
+
}
|
|
1156
|
+
}[t];
|
|
1157
|
+
}, Kt = (e, t) => {
|
|
1158
|
+
const s = e.trackers;
|
|
1159
|
+
switch (t) {
|
|
1160
|
+
case v.FACE_TRACKER:
|
|
1161
|
+
return { numFaces: s.face.numFaces, ...O(s.face.targetFps) };
|
|
1162
|
+
case v.HAND_TRACKER:
|
|
1163
|
+
return { ...O(s.hand.targetFps) };
|
|
1164
|
+
case v.GESTURE_TRACKER:
|
|
1165
|
+
return { ...O(s.gesture.targetFps) };
|
|
1166
|
+
case v.BODY_TRACKER:
|
|
1167
|
+
return { ...O(s.body.targetFps) };
|
|
1168
|
+
case v.HOLISTIC_TRACKER: {
|
|
1169
|
+
const r = s.holistic;
|
|
1170
|
+
return {
|
|
1171
|
+
...O(r.targetFps),
|
|
1172
|
+
hands: r.hands,
|
|
1173
|
+
holdMs: r.holdMs,
|
|
1174
|
+
predictMs: r.predictMs,
|
|
1175
|
+
analysisMaxDimension: r.analysisMaxDimension,
|
|
1176
|
+
outputFaceBlendshapes: r.outputFaceBlendshapes,
|
|
1177
|
+
minFaceDetectionConfidence: r.confidence,
|
|
1178
|
+
minFacePresenceConfidence: r.confidence,
|
|
1179
|
+
minPoseDetectionConfidence: r.confidence,
|
|
1180
|
+
minPosePresenceConfidence: r.confidence,
|
|
1181
|
+
minHandLandmarksConfidence: r.confidence,
|
|
1182
|
+
delegate: r.delegate === "auto" ? e.fallbacks.delegate : r.delegate,
|
|
1183
|
+
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {}
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
case v.BACKGROUND_SEGMENTATION:
|
|
1187
|
+
return { quality: s.segmentation.quality };
|
|
1188
|
+
case v.SEMANTIC_SEGMENTATION:
|
|
1189
|
+
return {
|
|
1190
|
+
preset: s.semanticSegmentation.preset,
|
|
1191
|
+
quality: s.semanticSegmentation.quality,
|
|
1192
|
+
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {}
|
|
1193
|
+
};
|
|
1194
|
+
default:
|
|
1195
|
+
return {};
|
|
1196
|
+
}
|
|
1197
|
+
}, Wt = (e) => {
|
|
1198
|
+
const t = e.trackers, s = [];
|
|
1199
|
+
return t.face.enabled && s.push(v.FACE_TRACKER), t.hand.enabled && s.push(v.HAND_TRACKER), t.gesture.enabled && s.push(v.GESTURE_TRACKER), t.body.enabled && s.push(v.BODY_TRACKER), t.holistic.enabled && s.push(v.HOLISTIC_TRACKER), t.segmentation.enabled && s.push(v.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && s.push(v.SEMANTIC_SEGMENTATION), s;
|
|
1200
|
+
}, ne = "vincentt.xr.tracking-config", ce = () => {
|
|
1201
|
+
try {
|
|
1202
|
+
return typeof localStorage < "u" ? localStorage : null;
|
|
1203
|
+
} catch {
|
|
1204
|
+
return null;
|
|
1205
|
+
}
|
|
1206
|
+
}, Xt = (e = ne, t = ce()) => {
|
|
1207
|
+
if (!t) return null;
|
|
1208
|
+
try {
|
|
1209
|
+
const s = t.getItem(e);
|
|
1210
|
+
return s ? Ue(s) : null;
|
|
1211
|
+
} catch {
|
|
1212
|
+
return null;
|
|
1213
|
+
}
|
|
1214
|
+
}, Ae = (e, t = ne, s = ce()) => {
|
|
1215
|
+
if (!s) return !1;
|
|
1216
|
+
try {
|
|
1217
|
+
return s.setItem(t, Ne(e)), !0;
|
|
1218
|
+
} catch {
|
|
1219
|
+
return !1;
|
|
1220
|
+
}
|
|
1221
|
+
}, Ht = (e = ne, t = ce()) => {
|
|
1222
|
+
if (t)
|
|
1223
|
+
try {
|
|
1224
|
+
t.removeItem(e);
|
|
1225
|
+
} catch {
|
|
1226
|
+
}
|
|
1227
|
+
}, Is = (e = {}) => {
|
|
1228
|
+
const { storageKey: t = ne, persist: s = !0 } = e, r = e.storage, a = F(e.initial), n = Z(() => K(a.current ?? {}), []), [i, c] = k(n), [o, l] = k([]), [h, d] = k(!s), m = F(i);
|
|
1229
|
+
m.current = i, x(() => {
|
|
1230
|
+
if (!s) {
|
|
1231
|
+
d(!0);
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1234
|
+
const f = Xt(t, r);
|
|
1235
|
+
if (f) {
|
|
1236
|
+
const g = K(f.config, n);
|
|
1237
|
+
m.current = g, c(g), l(f.warnings), f.migrated && Ae(g, t, r);
|
|
617
1238
|
}
|
|
1239
|
+
d(!0);
|
|
1240
|
+
}, [s, t, r, n]);
|
|
1241
|
+
const u = R(
|
|
1242
|
+
(f, g) => (m.current = f, c(f), l(g), s && Ae(f, t, r), f),
|
|
1243
|
+
[s, t, r]
|
|
1244
|
+
), p = R(
|
|
1245
|
+
(f) => {
|
|
1246
|
+
const g = [], b = K({ ...f, updatedAt: Date.now() }, m.current, g);
|
|
1247
|
+
return u(b, g);
|
|
1248
|
+
},
|
|
1249
|
+
[u]
|
|
1250
|
+
), S = R(() => {
|
|
1251
|
+
const f = be(n, {}, 0);
|
|
1252
|
+
return m.current = f, c(f), l([]), s && Ht(t, r), f;
|
|
1253
|
+
}, [n, s, t, r]), E = R(
|
|
1254
|
+
(f) => {
|
|
1255
|
+
const g = Ue(f);
|
|
1256
|
+
return g.warnings.some((b) => b.startsWith("not valid JSON") || b.startsWith("not an object")) ? (l([`import: ${g.warnings[0]}; config unchanged`]), m.current) : u(be(g.config, {}, Date.now()), g.warnings);
|
|
1257
|
+
},
|
|
1258
|
+
[u]
|
|
1259
|
+
);
|
|
1260
|
+
return Z(
|
|
1261
|
+
() => ({
|
|
1262
|
+
config: i,
|
|
1263
|
+
hydrated: h,
|
|
1264
|
+
warnings: o,
|
|
1265
|
+
update: p,
|
|
1266
|
+
reset: S,
|
|
1267
|
+
importJson: E,
|
|
1268
|
+
json: Ne(i),
|
|
1269
|
+
providerProps: Gt(i),
|
|
1270
|
+
cameraRequest: qt(i),
|
|
1271
|
+
trackerProps: (f) => Bt(i, f),
|
|
1272
|
+
modelOptions: (f) => Kt(i, f),
|
|
1273
|
+
enabledModels: Wt(i)
|
|
1274
|
+
}),
|
|
1275
|
+
[i, h, o, p, S, E]
|
|
618
1276
|
);
|
|
619
|
-
}), C = new Oe(), ut = (t, e) => C.prefetchMusic(t, e), lt = (t, e) => C.registerSound(t, e), dt = (t, e) => C.startMusic(t, e), mt = () => C.stopMusic(), pt = (t, e) => C.playOneShot(t, e), ht = (t) => C.setMuted(t), ft = () => C.toggleMuted(), Et = () => C.isMuted(), St = (t) => C.onMuteChange(t), Tt = () => {
|
|
620
|
-
const [t, e] = F(C.isMuted());
|
|
621
|
-
return U(() => C.onMuteChange(e), []), t;
|
|
622
1277
|
};
|
|
623
1278
|
export {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
1279
|
+
ms as AspectRatioContainer,
|
|
1280
|
+
vt as AudioEngine,
|
|
1281
|
+
ys as AudioPlayer,
|
|
1282
|
+
ps as Axes,
|
|
1283
|
+
We as CAMERA_PERMISSION_MESSAGES,
|
|
1284
|
+
_s as CameraPermissionGate,
|
|
1285
|
+
Ka as DEFAULT_ASSET_BUDGET_BYTES,
|
|
1286
|
+
Xr as DEFAULT_MATERIAL_FILL,
|
|
1287
|
+
ra as DEFAULT_MESH_RENDERER,
|
|
1288
|
+
aa as DEFAULT_MESH_RENDERER_RENDER_STATE,
|
|
1289
|
+
Gs as DEFAULT_PERFORMANCE_BUDGET,
|
|
1290
|
+
pa as DEFAULT_PIXEL_SNAP_INCREMENT,
|
|
1291
|
+
qs as DEFAULT_QUALITY_TIERS,
|
|
1292
|
+
fa as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
|
|
1293
|
+
Er as DEFAULT_SCREEN_GLASS,
|
|
1294
|
+
Hr as DEFAULT_SCREEN_GRADIENT,
|
|
1295
|
+
Rr as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
|
|
1296
|
+
br as DEFAULT_SCREEN_IMAGE_SETTINGS,
|
|
1297
|
+
Ar as DEFAULT_SCREEN_SHAPE_SETTINGS,
|
|
1298
|
+
Fr as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
|
|
1299
|
+
Cr as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
|
|
1300
|
+
ha as DEFAULT_SCREEN_TRANSFORM_2D,
|
|
1301
|
+
ga as DEFAULT_SCREEN_TRANSFORM_ROOT,
|
|
1302
|
+
we as DEFAULT_TRACKING_CONFIG,
|
|
1303
|
+
zr as DEFAULT_TRANSFORM_3D,
|
|
1304
|
+
$r as EXTERNAL_BACKGROUND_RENDER_LAYER,
|
|
1305
|
+
ft as FULL_SCREEN_ANCHORS,
|
|
1306
|
+
Ir as LightObject,
|
|
1307
|
+
Lr as LookAt,
|
|
1308
|
+
jr as MAX_RENDER_GROUP_PASSES,
|
|
1309
|
+
Vr as MaterialFill,
|
|
1310
|
+
da as MeshMaterial,
|
|
1311
|
+
na as MeshRenderer,
|
|
1312
|
+
ls as Panel,
|
|
1313
|
+
ds as PersonCutout,
|
|
1314
|
+
vr as PinToMesh,
|
|
1315
|
+
Or as RenderGroupLayer,
|
|
1316
|
+
Gr as SCREEN_IMAGE_MASK_CHANNELS,
|
|
1317
|
+
qr as SceneObjectRenderer,
|
|
1318
|
+
kr as ScreenGlassMaterial,
|
|
1319
|
+
Zr as ScreenGradientMaterial,
|
|
1320
|
+
nt as ScreenImage,
|
|
1321
|
+
_r as ScreenShape,
|
|
1322
|
+
yr as ScreenSpaceUI,
|
|
1323
|
+
Br as ScreenText,
|
|
1324
|
+
Xe as ScreenTransform,
|
|
1325
|
+
Kr as SequentialRenderPasses,
|
|
1326
|
+
fs as SpriteAnimation,
|
|
1327
|
+
Ps as TRACKER_KINDS,
|
|
1328
|
+
ne as TRACKING_CONFIG_STORAGE_KEY,
|
|
1329
|
+
ae as TRACKING_CONFIG_VERSION,
|
|
1330
|
+
Mr as TextLabel,
|
|
1331
|
+
Yr as Transform3D,
|
|
1332
|
+
us as VideoBackground,
|
|
1333
|
+
Wa as XRAssetCache,
|
|
1334
|
+
Ns as XRAssetCacheProvider,
|
|
1335
|
+
Bs as XRMediaSource,
|
|
1336
|
+
v as XRModel,
|
|
1337
|
+
Ks as XRProvider,
|
|
1338
|
+
Ws as XRQualityController,
|
|
1339
|
+
gr as XRScene,
|
|
1340
|
+
Xs as XR_FALLBACK_MESSAGES,
|
|
1341
|
+
Hs as XR_MODEL_ASSET_URLS,
|
|
1342
|
+
D as audio,
|
|
1343
|
+
Ke as canPromptForCamera,
|
|
1344
|
+
Ht as clearTrackingConfig,
|
|
1345
|
+
Ta as clientToScreenPixels,
|
|
1346
|
+
it as computeContainScale,
|
|
1347
|
+
zs as computeFeedCrop,
|
|
1348
|
+
$s as computeFitLayout,
|
|
1349
|
+
Xa as createAssetCache,
|
|
1350
|
+
js as createFallbackReason,
|
|
1351
|
+
Jr as createTwoStopGradient,
|
|
1352
|
+
Ss as dataURLtoFile,
|
|
1353
|
+
Ha as defineGltfAsset,
|
|
1354
|
+
za as defineTextureAsset,
|
|
1355
|
+
$a as defineVideoAsset,
|
|
1356
|
+
Vs as detectXRCapabilities,
|
|
1357
|
+
ja as disposeObject3D,
|
|
1358
|
+
ca as drawNormalizedCrop,
|
|
1359
|
+
Wt as enabledModels,
|
|
1360
|
+
Va as estimateGeometryBytes,
|
|
1361
|
+
Za as estimateObjectBytes,
|
|
1362
|
+
Ya as estimateTextureBytes,
|
|
1363
|
+
Zs as feedSidedName,
|
|
1364
|
+
Ea as feedToScreenPixels,
|
|
1365
|
+
Ys as feedToSource,
|
|
1366
|
+
Ra as feedToTracker,
|
|
1367
|
+
ba as feedToViewport,
|
|
1368
|
+
Js as feedToWorld,
|
|
1369
|
+
ws as findCameraByFacing,
|
|
1370
|
+
ke as getDefaultAssetCache,
|
|
1371
|
+
Qr as getRenderGroupLayer,
|
|
1372
|
+
Qs as isFeedPointInSource,
|
|
1373
|
+
er as isMirroredSourceKind,
|
|
1374
|
+
Cs as isMuted,
|
|
1375
|
+
xs as listCameras,
|
|
1376
|
+
Xt as loadTrackingConfig,
|
|
1377
|
+
xr as mapScreenImageSettingsToProps,
|
|
1378
|
+
wr as mapScreenTextInnerShadowToProps,
|
|
1379
|
+
Nr as mapScreenTextSettingsToProps,
|
|
1380
|
+
Aa as mediaToScreenPixels,
|
|
1381
|
+
Ur as mergeScreenShapeSettings,
|
|
1382
|
+
Sa as mergeScreenTransform2D,
|
|
1383
|
+
be as mergeTrackingConfig,
|
|
1384
|
+
tr as mirrorFeedX,
|
|
1385
|
+
ia as normalizeMeshRendererRenderState,
|
|
1386
|
+
Dr as normalizeScreenGlass,
|
|
1387
|
+
ea as normalizeScreenGradient,
|
|
1388
|
+
Fa as normalizedToScreenPixels,
|
|
1389
|
+
vs as onMuteChange,
|
|
1390
|
+
sr as orientSourcePoint,
|
|
1391
|
+
rr as orientedSize,
|
|
1392
|
+
ar as otherSide,
|
|
1393
|
+
Ue as parseTrackingConfig,
|
|
1394
|
+
nr as personLeftSign,
|
|
1395
|
+
ir as personSide,
|
|
1396
|
+
bs as playOneShot,
|
|
1397
|
+
Ms as prefetchMusic,
|
|
1398
|
+
Ge as queryCameraPermission,
|
|
1399
|
+
Ts as registerSound,
|
|
1400
|
+
ta as renderSequentialPasses,
|
|
1401
|
+
qe as requestCameraAccess,
|
|
1402
|
+
or as resolveModelAssetUrl,
|
|
1403
|
+
la as resolveNormalizedCrop,
|
|
1404
|
+
ht as resolvePersonCutoutStatus,
|
|
1405
|
+
cr as resolveQualityConfig,
|
|
1406
|
+
ya as resolveScreenTransform2D,
|
|
1407
|
+
lr as resolveTrackerSupport,
|
|
1408
|
+
K as resolveTrackingConfig,
|
|
1409
|
+
Ae as saveTrackingConfig,
|
|
1410
|
+
Ca as screenPixelsToClient,
|
|
1411
|
+
va as screenPixelsToFeed,
|
|
1412
|
+
ka as screenPixelsToMedia,
|
|
1413
|
+
_a as screenPixelsToNormalized,
|
|
1414
|
+
xa as screenPixelsToScreenSpace,
|
|
1415
|
+
wa as screenPixelsToUnits,
|
|
1416
|
+
Na as screenPointToRay,
|
|
1417
|
+
Ua as screenSpaceToScreenPixels,
|
|
1418
|
+
Da as screenUnitsToPixels,
|
|
1419
|
+
Ne as serializeTrackingConfig,
|
|
1420
|
+
As as setMuted,
|
|
1421
|
+
gt as shouldDrawFallback,
|
|
1422
|
+
V as smoothNumber,
|
|
1423
|
+
os as smoothVector2,
|
|
1424
|
+
cs as smoothVector3,
|
|
1425
|
+
ur as sourceToFeed,
|
|
1426
|
+
Es as startMusic,
|
|
1427
|
+
Rs as stopMusic,
|
|
1428
|
+
Be as subscribeCameraPermission,
|
|
1429
|
+
dr as swapSidedName,
|
|
1430
|
+
qt as toCameraRequest,
|
|
1431
|
+
Kt as toModelOptions,
|
|
1432
|
+
Gt as toProviderProps,
|
|
1433
|
+
Bt as toTrackerProps,
|
|
1434
|
+
Fs as toggleMuted,
|
|
1435
|
+
Pa as trackerPointToScreenPixels,
|
|
1436
|
+
Ia as trackerToFeed,
|
|
1437
|
+
mr as trackerToWorld,
|
|
1438
|
+
wt as useCameraPermission,
|
|
1439
|
+
gs as useFrameCapture,
|
|
1440
|
+
hs as useMediaRecorder,
|
|
1441
|
+
ks as useMuted,
|
|
1442
|
+
St as usePersonMaskTexture,
|
|
1443
|
+
ct as useScreenRectAspect,
|
|
1444
|
+
Us as useXRAsset,
|
|
1445
|
+
xe as useXRAssetCache,
|
|
1446
|
+
Ds as useXRAssetStats,
|
|
1447
|
+
qa as useXRCapabilities,
|
|
1448
|
+
Ja as useXRQuality,
|
|
1449
|
+
Is as useXRTrackingConfig,
|
|
1450
|
+
La as viewportToFeed,
|
|
1451
|
+
pr as worldToFeed,
|
|
1452
|
+
Oa as worldToScreenPixels,
|
|
1453
|
+
fr as worldToTracker
|
|
716
1454
|
};
|