@vincentt-xr/sdk 2.0.0-alpha.1 → 2.0.0-alpha.2
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 +1588 -20
- package/dist/{DebuggerUI-CatYc-RG.cjs → DebuggerUI-B45_Gb9d.cjs} +1 -1
- package/dist/{DebuggerUI-gLMKiVwJ.js → DebuggerUI-Cq28c18s.js} +1 -1
- package/dist/FaceMeshRenderer-6t8OsQhK.js +1195 -0
- package/dist/FaceMeshRenderer-lQLhYIW-.cjs +155 -0
- package/dist/FaceRetouch-CDrL0pXg.js +551 -0
- package/dist/FaceRetouch-DtNl8-4e.cjs +134 -0
- package/dist/audio/AudioEngine.d.ts +3 -1
- package/dist/audio/AudioPlayer.d.ts +29 -0
- package/dist/audio/AudioPlayerLogic.d.ts +4 -0
- package/dist/audio/index.d.ts +2 -0
- package/dist/components/Axes/index.d.ts +6 -0
- package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +17 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +17 -1
- package/dist/components/FaceMesh/canonical/FaceMeshMaterial.d.ts +25 -0
- package/dist/components/FaceMesh/canonical/assets.d.ts +3 -0
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +9 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +2 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +2 -0
- package/dist/components/FaceMesh/deform.d.ts +3 -0
- package/dist/components/FaceMesh/index.d.ts +5 -0
- package/dist/components/FaceMesh/material/defaults.d.ts +70 -0
- package/dist/components/FaceMesh/material/index.d.ts +1 -0
- package/dist/components/FaceMesh/material/options.d.ts +5 -1
- package/dist/components/FaceMesh/material/support.d.ts +7 -2
- package/dist/components/FaceMesh/material/textures.d.ts +4 -0
- package/dist/components/FaceMesh/material/types.d.ts +2 -2
- package/dist/components/FaceRetouch/Background.d.ts +5 -6
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +47 -0
- package/dist/components/FaceRetouch/index.d.ts +2 -8
- package/dist/components/FaceRetouch/landmarkMask.d.ts +0 -5
- package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +3 -7
- package/dist/components/FaceTracker/index.d.ts +5 -3
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +1 -1
- package/dist/components/HandJoints2D/index.d.ts +1 -1
- package/dist/components/HandTracking2D/HandVisual.d.ts +1 -1
- package/dist/components/HandTracking2D/index.d.ts +1 -1
- package/dist/components/HandTracking2DController/index.d.ts +1 -1
- package/dist/components/HandTracking3D/index.d.ts +1 -1
- package/dist/components/LightObject/index.d.ts +20 -0
- package/dist/components/LookAt/index.d.ts +23 -0
- package/dist/components/MeshRenderer/index.d.ts +58 -0
- package/dist/components/PerspectiveCamera/index.d.ts +2 -8
- package/dist/components/PinToMesh/index.d.ts +47 -0
- package/dist/components/RenderGroupLayer/index.d.ts +6 -0
- package/dist/components/SceneObjectRenderer/index.d.ts +16 -0
- package/dist/components/Screen2D/ScreenTransformFrame.d.ts +11 -0
- package/dist/components/Screen2D/ScreenTransformHelpers.d.ts +19 -0
- package/dist/components/Screen2D/ScreenTransformInteraction.d.ts +18 -0
- package/dist/components/Screen2D/index.d.ts +5 -0
- package/dist/components/ScreenGlass/defaults.d.ts +3 -0
- package/dist/components/ScreenGlass/index.d.ts +5 -0
- package/dist/components/ScreenGlass/shaders.d.ts +2 -0
- package/dist/components/ScreenGlass/types.d.ts +10 -0
- package/dist/components/ScreenGradient/defaults.d.ts +5 -0
- package/dist/components/ScreenGradient/index.d.ts +5 -0
- package/dist/components/ScreenGradient/shaders.d.ts +2 -0
- package/dist/components/ScreenGradient/types.d.ts +19 -0
- package/dist/components/ScreenImage/ScreenImage.d.ts +4 -0
- package/dist/components/ScreenImage/components/DynamicTextureSync.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageFrame.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageTransformFrame.d.ts +9 -0
- package/dist/components/ScreenImage/fit.d.ts +52 -0
- package/dist/components/ScreenImage/index.d.ts +8 -87
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
- package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
- package/dist/components/ScreenImage/source.d.ts +16 -0
- package/dist/components/ScreenImage/types.d.ts +37 -0
- package/dist/components/ScreenImage/utils/ScreenImageConstants.d.ts +9 -0
- package/dist/components/ScreenImage/utils/ScreenImageHelpers.d.ts +4 -0
- package/dist/components/ScreenShape/geometry.d.ts +5 -0
- package/dist/components/ScreenShape/index.d.ts +5 -0
- package/dist/components/ScreenShape/types.d.ts +41 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformGuide.d.ts +15 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformOverlayGuide.d.ts +9 -0
- package/dist/components/ScreenSpaceUI/index.d.ts +2 -0
- package/dist/components/ScreenText/components/ScreenTextBody.d.ts +2 -0
- package/dist/components/ScreenText/components/ScreenTextTransformFrame.d.ts +9 -0
- package/dist/components/ScreenText/constants.d.ts +5 -0
- package/dist/components/ScreenText/index.d.ts +6 -20
- package/dist/components/ScreenText/types.d.ts +31 -0
- package/dist/components/ScreenText/utils/ScreenTextHelpers.d.ts +14 -0
- package/dist/components/ScreenText/utils/ScreenTextMappings.d.ts +17 -0
- package/dist/components/SequentialRenderPasses/index.d.ts +6 -0
- package/dist/components/TextLabel/TextLabel.d.ts +5 -0
- package/dist/components/TextLabel/alignment.d.ts +4 -0
- package/dist/components/TextLabel/bend.d.ts +9 -0
- package/dist/components/TextLabel/canvas/buildTextLabelTexture.d.ts +4 -0
- package/dist/components/TextLabel/canvas/canvasTypography.d.ts +13 -0
- package/dist/components/TextLabel/canvas/drawBackground.d.ts +21 -0
- package/dist/components/TextLabel/canvas/drawEffects.d.ts +34 -0
- package/dist/components/TextLabel/canvas/drawText.d.ts +19 -0
- package/dist/components/TextLabel/components/TextLabelMesh.d.ts +13 -0
- package/dist/components/TextLabel/constants.d.ts +2 -0
- package/dist/components/TextLabel/hooks/useTextLabelTexture.d.ts +7 -0
- package/dist/components/TextLabel/index.d.ts +2 -161
- package/dist/components/TextLabel/layout/measurement.d.ts +8 -0
- package/dist/components/TextLabel/layout/resolveTextLayout.d.ts +25 -0
- package/dist/components/TextLabel/layout/wrapText.d.ts +6 -0
- package/dist/components/TextLabel/types.d.ts +227 -0
- package/dist/components/TrackingAnchor/index.d.ts +18 -2
- package/dist/components/Transform3D/index.d.ts +30 -0
- package/dist/components/XRMediaSurface/index.d.ts +6 -6
- package/dist/components/XRViewport/XRViewport.d.ts +11 -0
- package/dist/components/XRViewport/components/HiddenMedia.d.ts +7 -0
- package/dist/components/XRViewport/components/MediaAssetPicker.d.ts +8 -0
- package/dist/components/XRViewport/components/MediaControlStack.d.ts +13 -0
- package/dist/components/XRViewport/components/XRViewportLayers.d.ts +30 -0
- package/dist/components/XRViewport/constants.d.ts +24 -0
- package/dist/components/XRViewport/contexts.d.ts +6 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +13 -0
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +16 -0
- package/dist/components/XRViewport/hooks/useViewportMediaTexture.d.ts +10 -0
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +41 -0
- package/dist/components/XRViewport/hooks/useViewportRenderState.d.ts +47 -0
- package/dist/components/XRViewport/index.d.ts +3 -118
- package/dist/components/XRViewport/layout.d.ts +16 -0
- package/dist/components/XRViewport/slots.d.ts +16 -0
- package/dist/components/XRViewport/types.d.ts +89 -0
- package/dist/components/XRViewport/useViewportSize.d.ts +3 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/contexts-BKvTIayr.cjs +1 -0
- package/dist/contexts-Bk5zz_VR.js +214 -0
- package/dist/debug-ui/component-editor/index.d.ts +19 -0
- package/dist/debug-ui/face-mesh-renderer-settings/index.d.ts +8 -0
- package/dist/debug-ui/face-retouch/index.d.ts +11 -0
- package/dist/debug-ui/hand-joints-2d/index.d.ts +1 -1
- package/dist/debug-ui/hand-tracking-2d/index.d.ts +1 -1
- package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +1 -1
- package/dist/debug-ui/hand-tracking-3d/index.d.ts +1 -1
- package/dist/debug-ui/hierarchy-panel/index.d.ts +29 -0
- package/dist/debug-ui/index.d.ts +25 -2
- package/dist/debug-ui/layer-panel/index.d.ts +3 -2
- package/dist/debug-ui/media-source/index.d.ts +2 -0
- package/dist/debug-ui/media-source/session.d.ts +12 -0
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +6 -4
- package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
- package/dist/debug-ui/object-inspector-panel/index.d.ts +25 -0
- package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
- package/dist/debug-ui/scene-editor/context.d.ts +38 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +9 -0
- package/dist/debug-ui/scene-editor/index.d.ts +11 -0
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +7 -0
- package/dist/debug-ui/scene-editor/store-utils.d.ts +2 -0
- package/dist/debug-ui/scene-editor/viewport-toolbar.d.ts +4 -0
- package/dist/debug-ui/scene-editor/viewport.d.ts +21 -0
- package/dist/debug-ui/screen-glass-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/GradientStopsEditor.d.ts +5 -0
- package/dist/debug-ui/screen-gradient-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/styles.d.ts +3 -0
- package/dist/debug-ui/screen-image-settings/index.d.ts +4 -2
- package/dist/debug-ui/screen-shape-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/NumberField.d.ts +9 -0
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +3 -0
- package/dist/debug-ui/screen-text-settings/controls/NestedSection.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/controls/Section.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/controls/icons.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/index.d.ts +2 -122
- package/dist/debug-ui/screen-text-settings/sections/BackgroundSection.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/sections/ContentSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/EffectsSection.d.ts +25 -0
- package/dist/debug-ui/screen-text-settings/sections/StyleSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/TransformSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundFillControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundSizeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundStrokeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/types.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/BendEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/EffectChrome.d.ts +21 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/GlowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/InnerShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/OutlineEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/ShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/types.d.ts +14 -0
- package/dist/debug-ui/screen-text-settings/settings.d.ts +90 -0
- package/dist/debug-ui/screen-text-settings/styles.d.ts +26 -0
- package/dist/debug-ui/screen-text-settings/transform.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/types.d.ts +9 -0
- package/dist/debug-ui/shared/ScreenTransformSection.d.ts +6 -3
- package/dist/debug-ui/transform-3d-settings/index.d.ts +11 -0
- package/dist/debug-ui.cjs +3 -13
- package/dist/debug-ui.js +7896 -5098
- package/dist/drawNormalizedCrop-B-7zU-Xw.cjs +1 -0
- package/dist/drawNormalizedCrop-CRdIDyl1.js +44 -0
- package/dist/entries/all.d.ts +1 -0
- package/dist/entries/core.d.ts +53 -6
- package/dist/entries/face-effects.d.ts +10 -8
- package/dist/entries/internal.d.ts +1 -1
- package/dist/entries/low-level.d.ts +18 -4
- package/dist/entries/scene-object.d.ts +10 -0
- package/dist/entries/tracking.d.ts +25 -2
- package/dist/face-action/index.d.ts +34 -0
- package/dist/face-attribute-expression/index.d.ts +10 -0
- package/dist/face-effects.cjs +1 -342
- package/dist/face-effects.js +1391 -2767
- package/dist/face-info/blendshapes.d.ts +3 -0
- package/dist/face-info/derive.d.ts +8 -0
- package/dist/face-info/drawFaceCrop.d.ts +10 -0
- package/dist/face-info/getFaceInfo.d.ts +8 -0
- package/dist/face-info/index.d.ts +8 -0
- package/dist/face-info/landmarks.d.ts +21 -0
- package/dist/face-info/types.d.ts +52 -0
- package/dist/getFaceInfo-CyPAKh3h.cjs +1 -0
- package/dist/getFaceInfo-hUKMLFcr.js +118 -0
- package/dist/{handJoints2d.d.ts → hand/handJoints2d.d.ts} +1 -1
- package/dist/{handTracking2d.d.ts → hand/handTracking2d.d.ts} +1 -1
- package/dist/{handTracking2dController.d.ts → hand/handTracking2dController.d.ts} +1 -1
- package/dist/{handTracking3d.d.ts → hand/handTracking3d.d.ts} +1 -1
- package/dist/hooks/faceResults.d.ts +1 -1
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceAction.d.ts +3 -0
- package/dist/hooks/useFaceAttributeExpression.d.ts +16 -0
- package/dist/hooks/useFaceDetection.d.ts +18 -0
- package/dist/hooks/useFaceInfo.d.ts +7 -0
- package/dist/hooks/useFaceInfos.d.ts +15 -0
- package/dist/hooks/useFaceResultReader.d.ts +10 -0
- package/dist/hooks/useFrameCapture.d.ts +18 -0
- package/dist/hooks/useMediaRecorder.d.ts +14 -2
- package/dist/hooks/useOwnedTexture.d.ts +6 -0
- package/dist/hooks/useTrackerContext.d.ts +2 -2
- package/dist/hooks/useXRSession/facade.d.ts +3 -0
- package/dist/hooks/useXRSession/registry.d.ts +9 -0
- package/dist/index-82aENaRq.cjs +1 -0
- package/dist/{index-BGNbrc4C.js → index-BgQAX8rs.js} +213 -125
- package/dist/index-CEc1CAmB.cjs +1 -0
- package/dist/index-CTHeBQOs.js +178 -0
- package/dist/index-D4bLzBr6.cjs +1 -0
- package/dist/index-DSpzjuqd.cjs +1 -0
- package/dist/index-Di70KWuY.js +2049 -0
- package/dist/index-DzEzkBIH.cjs +17 -0
- package/dist/{index-safCs_af.js → index-JygePOwo.js} +565 -508
- package/dist/index-UC0Ux38E.js +111 -0
- package/dist/{internal-Cae1ps15.js → internal-DuMPpcbp.js} +86 -80
- package/dist/internal-i2JkM85N.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1229 -86
- package/dist/main.cjs +1 -73
- package/dist/main.js +545 -1693
- package/dist/material/MaterialFill.d.ts +20 -0
- package/dist/material/MeshMaterial.d.ts +14 -0
- package/dist/material/index.d.ts +2 -0
- package/dist/models/Body/index.d.ts +1 -1
- package/dist/models/Face/index.d.ts +1 -0
- package/dist/models/Face/rotation.d.ts +3 -0
- package/dist/render/renderGroups.d.ts +47 -0
- package/dist/render/renderPasses.d.ts +18 -0
- package/dist/renderGroups-C9QJrAXu.js +152 -0
- package/dist/renderGroups-Dvm1J4lW.cjs +1 -0
- package/dist/renderLayers-lDtL0_43.cjs +1 -0
- package/dist/renderLayers-zrK2pv5O.js +13 -0
- package/dist/renderPasses-CT5iBwtg.cjs +21 -0
- package/dist/renderPasses-CjgG_6kQ.js +1500 -0
- package/dist/scene-object/index.d.ts +146 -0
- package/dist/scene-object/runtimeRegistry.d.ts +14 -0
- package/dist/scene-object.cjs +1 -0
- package/dist/scene-object.js +40 -0
- package/dist/{screenImageSettings.d.ts → screen-image/screenImageSettings.d.ts} +9 -2
- package/dist/{screenTextSettings.d.ts → screen-text/screenTextSettings.d.ts} +18 -2
- package/dist/screen2d/coordinates.d.ts +87 -0
- package/dist/screen2d/index.d.ts +3 -0
- package/dist/screen2d/screenTransform.d.ts +47 -0
- package/dist/screen2d/smoothing.d.ts +5 -0
- package/dist/{selectors-BLl2JUWW.cjs → selectors-2QvO5RYY.cjs} +1 -1
- package/dist/{selectors-CXd_x-6t.js → selectors-Dw3C-gSk.js} +3 -3
- package/dist/services/MetricsCollector/index.d.ts +7 -1
- package/dist/services/MetricsCollector/utils.d.ts +1 -1
- package/dist/session-BChR4TgK.cjs +31 -0
- package/dist/session-C1StwN0f.js +363 -0
- package/dist/texture/animatedTexture.d.ts +61 -0
- package/dist/texture/animationMath.d.ts +8 -0
- package/dist/texture/sourceResolver.d.ts +30 -0
- package/dist/tracking.cjs +1 -1
- package/dist/tracking.js +580 -321
- package/dist/types/face.d.ts +1 -13
- package/dist/types/index.d.ts +0 -1
- package/dist/types/nodes.d.ts +2 -1
- package/dist/types/session.d.ts +2 -0
- package/dist/types/tracking.d.ts +8 -2
- package/dist/types/util-types.d.ts +1 -1
- package/dist/useFaceInfo-C-WfMlYp.cjs +1 -0
- package/dist/useFaceInfo-CwsHZedC.js +62 -0
- package/dist/useFaceResults-CkFc1egZ.js +19 -0
- package/dist/useFaceResults-VcFdOUFV.cjs +1 -0
- package/dist/utils/drawNormalizedCrop.d.ts +22 -0
- package/dist/utils/integrity.d.ts +4 -25
- package/dist/utils/landmarkBounds.d.ts +1 -1
- package/dist/utils/logger.d.ts +2 -2
- package/docs/MIGRATION_GUIDE.md +589 -0
- package/docs/SDK_DOCUMENTATION.md +1155 -0
- package/docs/api/audio.mdx +36 -0
- package/docs/api/behavior-components.mdx +164 -0
- package/docs/api/capture-recording.mdx +103 -0
- package/docs/api/debug-ui-scene-editor.mdx +249 -0
- package/docs/api/face-actions.mdx +104 -0
- package/docs/api/face-attribute-expression.mdx +87 -0
- package/docs/api/face-binding-anchors.mdx +53 -0
- package/docs/api/face-effects.mdx +19 -0
- package/docs/api/face-info.mdx +112 -0
- package/docs/api/face-mesh.mdx +98 -0
- package/docs/api/face-painting.mdx +33 -0
- package/docs/api/face-retouching.mdx +73 -0
- package/docs/api/material-render-state.mdx +132 -0
- package/docs/api/runtime-3d.mdx +311 -0
- package/docs/api/scene-object-store.mdx +213 -0
- package/docs/api/screen-image.mdx +41 -0
- package/docs/api/screen-shape.mdx +64 -0
- package/docs/api/screen-space-coordinates.mdx +41 -0
- package/docs/api/screen-text.mdx +39 -0
- package/docs/api/texture-sources.mdx +55 -0
- package/docs/api/trackers.mdx +46 -0
- package/docs/docs.json +70 -0
- package/docs/examples/scene-object-recipes.mdx +194 -0
- package/docs/guides/harness-debug-ui.mdx +139 -0
- package/docs/inspector/hierarchy-panel.mdx +51 -0
- package/docs/inspector/object-inspector-panel.mdx +51 -0
- package/docs/introduction.mdx +121 -0
- package/docs/scene-objects/overview.mdx +127 -0
- package/docs/scene-objects/render-groups.mdx +77 -0
- package/docs/scene-objects/runtime-rendering.mdx +75 -0
- package/docs/texture-api-consumer.md +58 -0
- package/package.json +37 -7
- package/dist/MediaSourceSwitcher-C-xYg0nQ.js +0 -317
- package/dist/MediaSourceSwitcher-Cq3g4IKw.cjs +0 -31
- package/dist/components/FaceRetouch/defaults.d.ts +0 -13
- package/dist/components/FaceRetouch/retouchRegions.d.ts +0 -23
- package/dist/components/FaceRetouch/useFaceRetouchRegions.d.ts +0 -12
- package/dist/defaults-BLpcN3pG.cjs +0 -1
- package/dist/defaults-LtY4M7dg.js +0 -55
- package/dist/index-BXyObVHF.cjs +0 -1
- package/dist/index-CY3bUAcW.js +0 -12
- package/dist/index-C_Duh13c.cjs +0 -1
- package/dist/index-D8fpPQkC.cjs +0 -1
- package/dist/index-DxshgBu0.cjs +0 -1
- package/dist/index-O-2crZ3M.js +0 -1102
- package/dist/internal-BjyhBP8i.cjs +0 -1
- package/dist/modules/XRClient/index.d.ts +0 -9
- package/dist/modules/index.d.ts +0 -1
- package/dist/screenImageSettings-6NRg4cx9.js +0 -39
- package/dist/screenImageSettings-y_B4_767.cjs +0 -1
- package/dist/services/ApiService.d.ts +0 -12
- package/dist/types/client.d.ts +0 -3
- package/dist/useFaceResults-cpsSmKKc.js +0 -81
- package/dist/useFaceResults-hVUJYSEY.cjs +0 -1
- package/dist/useXRModel-3DcUa28n.cjs +0 -1
- package/dist/useXRModel-BMJE1hrk.js +0 -28
- /package/dist/{layerStack.d.ts → render/layerStack.d.ts} +0 -0
- /package/dist/{screenImagePresets.d.ts → screen-image/screenImagePresets.d.ts} +0 -0
- /package/dist/{screenTextPresets.d.ts → screen-text/screenTextPresets.d.ts} +0 -0
package/dist/index-O-2crZ3M.js
DELETED
|
@@ -1,1102 +0,0 @@
|
|
|
1
|
-
import { jsx as m, jsxs as k, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as K, useContext as G, useMemo as W, useEffect as T, useRef as M, useState as E, useCallback as Ie, useLayoutEffect as Me, Children as De, isValidElement as Ae } from "react";
|
|
3
|
-
import { R as de, u as ue, X as he } from "./index-safCs_af.js";
|
|
4
|
-
import * as I from "three";
|
|
5
|
-
import { u as fe } from "./useFaceResults-cpsSmKKc.js";
|
|
6
|
-
import { u as ke } from "./useXRModel-BMJE1hrk.js";
|
|
7
|
-
import { u as Le, a as Xe, d as _e } from "./selectors-CXd_x-6t.js";
|
|
8
|
-
import { Canvas as ze, useThree as We, useFrame as Ne } from "@react-three/fiber";
|
|
9
|
-
const Ve = K(null), Be = () => {
|
|
10
|
-
const e = G(Ve);
|
|
11
|
-
if (!e)
|
|
12
|
-
throw new Error("useScreenSpace must be used within ScreenSpaceUI");
|
|
13
|
-
return e;
|
|
14
|
-
}, me = K(null), St = () => G(me) ?? 1, He = (e, t, o, l, n) => {
|
|
15
|
-
const i = e / 2, s = t / 2, r = o.left * i + l.left, c = o.right * i - l.right, d = o.bottom * s + l.bottom, u = o.top * s - l.top, a = c - r, g = u - d, h = (r + c) / 2, p = (d + u) / 2, w = n[0] * a / 2, F = n[1] * g / 2;
|
|
16
|
-
return { centerX: h, centerY: p, width: a, height: g, pivotX: w, pivotY: F };
|
|
17
|
-
}, Ue = { left: 0, right: 0, top: 0, bottom: 0 }, qe = { left: 0, right: 0, top: 0, bottom: 0 }, $e = [0, 0], Rt = ({
|
|
18
|
-
anchors: e,
|
|
19
|
-
offsets: t,
|
|
20
|
-
pivot: o = $e,
|
|
21
|
-
children: l
|
|
22
|
-
}) => {
|
|
23
|
-
const { width: n, height: i } = Be(), s = W(
|
|
24
|
-
() => ({
|
|
25
|
-
anchors: { ...Ue, ...e ?? {} },
|
|
26
|
-
offsets: { ...qe, ...t ?? {} }
|
|
27
|
-
}),
|
|
28
|
-
[e, t]
|
|
29
|
-
), r = W(
|
|
30
|
-
() => He(n, i, s.anchors, s.offsets, o),
|
|
31
|
-
[n, i, s, o]
|
|
32
|
-
);
|
|
33
|
-
T(() => {
|
|
34
|
-
const a = s.anchors;
|
|
35
|
-
a.left > a.right && console.warn(
|
|
36
|
-
`[ScreenTransform] inverted X axis: anchors.left (${a.left}) > anchors.right (${a.right})`
|
|
37
|
-
), a.bottom > a.top && console.warn(
|
|
38
|
-
`[ScreenTransform] inverted Y axis: anchors.bottom (${a.bottom}) > anchors.top (${a.top})`
|
|
39
|
-
), r.width <= 0 && console.warn(
|
|
40
|
-
`[ScreenTransform] zero or negative width (${r.width.toFixed(3)}) — anchors + offsets collapse the X extent`
|
|
41
|
-
), r.height <= 0 && console.warn(
|
|
42
|
-
`[ScreenTransform] zero or negative height (${r.height.toFixed(3)}) — anchors + offsets collapse the Y extent`
|
|
43
|
-
);
|
|
44
|
-
}, [s, r.width, r.height]);
|
|
45
|
-
const c = o[0] !== 0 || o[1] !== 0, d = c ? [1, 1, 1] : [r.width, r.height, 1], u = !c && r.width > 0 && r.height > 0 ? r.width / r.height : null;
|
|
46
|
-
return /* @__PURE__ */ m(
|
|
47
|
-
"group",
|
|
48
|
-
{
|
|
49
|
-
position: [r.centerX - r.pivotX, r.centerY - r.pivotY, 0],
|
|
50
|
-
scale: d,
|
|
51
|
-
renderOrder: de.SCREEN_UI,
|
|
52
|
-
children: /* @__PURE__ */ m(me.Provider, { value: u, children: l })
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}, ee = ({
|
|
56
|
-
canvas: e,
|
|
57
|
-
layout: t,
|
|
58
|
-
media: o,
|
|
59
|
-
mirrored: l,
|
|
60
|
-
filter: n
|
|
61
|
-
}) => {
|
|
62
|
-
const i = Math.round(t.destination.width), s = Math.round(t.destination.height);
|
|
63
|
-
e.width !== i && (e.width = i), e.height !== s && (e.height = s);
|
|
64
|
-
const r = e.getContext("2d");
|
|
65
|
-
r && (r.setTransform(1, 0, 0, 1, 0, 0), r.clearRect(0, 0, i, s), l && (r.translate(i, 0), r.scale(-1, 1)), n && (r.filter = n), r.drawImage(o, t.offsetX, t.offsetY, t.drawWidth, t.drawHeight), n && (r.filter = "none"), r.setTransform(1, 0, 0, 1, 0, 0));
|
|
66
|
-
}, Ye = 5, je = 1, Ke = (e, t) => t, Ge = "brightness(2.2) contrast(1.5) saturate(1.25)", Pe = ({
|
|
67
|
-
enabled: e,
|
|
68
|
-
displayMirrored: t,
|
|
69
|
-
imageRef: o,
|
|
70
|
-
layout: l,
|
|
71
|
-
mode: n,
|
|
72
|
-
numFaces: i,
|
|
73
|
-
selectedSource: s,
|
|
74
|
-
sourceStream: r,
|
|
75
|
-
videoRef: c
|
|
76
|
-
}) => {
|
|
77
|
-
const { session: d } = ue(), u = M(null), a = M(!1), g = M(document.createElement("canvas")), {
|
|
78
|
-
ready: h,
|
|
79
|
-
node: p,
|
|
80
|
-
error: w
|
|
81
|
-
} = ke(he.FACE_TRACKER, {
|
|
82
|
-
numFaces: i ?? (n === "head-binding" ? je : Ye)
|
|
83
|
-
}), [F, C] = E("idle"), [S, y] = E(null), D = e && h && !!p, L = fe({
|
|
84
|
-
node: D ? p : null,
|
|
85
|
-
enabled: D,
|
|
86
|
-
selectedSource: s,
|
|
87
|
-
onFrame: Ie(() => {
|
|
88
|
-
y(null), C("ready");
|
|
89
|
-
}, [])
|
|
90
|
-
});
|
|
91
|
-
return T(() => {
|
|
92
|
-
if (!e || !l) return;
|
|
93
|
-
const b = () => {
|
|
94
|
-
const v = s === "image" ? o.current : c.current;
|
|
95
|
-
if (v) {
|
|
96
|
-
if (v instanceof HTMLImageElement) {
|
|
97
|
-
if (!v.complete || v.naturalWidth <= 0 || v.naturalHeight <= 0) return;
|
|
98
|
-
} else if (v.readyState < 2 || v.videoWidth <= 0 || v.videoHeight <= 0)
|
|
99
|
-
return;
|
|
100
|
-
ee({
|
|
101
|
-
canvas: g.current,
|
|
102
|
-
layout: l,
|
|
103
|
-
media: v,
|
|
104
|
-
mirrored: t,
|
|
105
|
-
filter: s === "webcam" ? Ge : void 0
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
if (s === "image") {
|
|
110
|
-
b();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
let f = 0;
|
|
114
|
-
const x = () => {
|
|
115
|
-
f = requestAnimationFrame(x), b();
|
|
116
|
-
};
|
|
117
|
-
return f = requestAnimationFrame(x), () => cancelAnimationFrame(f);
|
|
118
|
-
}, [t, e, o, l, s, c]), T(() => {
|
|
119
|
-
var _;
|
|
120
|
-
if (!e) {
|
|
121
|
-
C("idle"), y(null), a.current = !1, u.current = null;
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (!l) {
|
|
125
|
-
C("initializing");
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const b = (r == null ? void 0 : r.id) ?? (((_ = c.current) == null ? void 0 : _.srcObject) instanceof MediaStream ? c.current.srcObject.id : "none"), x = s === "webcam" ? `webcam:${b}` : s;
|
|
129
|
-
u.current !== x && (a.current = !1, u.current = x);
|
|
130
|
-
let v = !1;
|
|
131
|
-
return (async () => {
|
|
132
|
-
try {
|
|
133
|
-
if (C("initializing"), a.current || (await d.setFrameSource({
|
|
134
|
-
canvas: g.current,
|
|
135
|
-
sourceKind: s
|
|
136
|
-
}), await d.start(), a.current = !0), v) return;
|
|
137
|
-
y(null), C("initializing");
|
|
138
|
-
} catch (z) {
|
|
139
|
-
if (v) return;
|
|
140
|
-
C("error"), y(z instanceof Error ? z.message : "Failed to initialize SDK face tracking");
|
|
141
|
-
}
|
|
142
|
-
})(), () => {
|
|
143
|
-
v = !0;
|
|
144
|
-
};
|
|
145
|
-
}, [e, l, s, d, r, c]), T(() => {
|
|
146
|
-
!D && e && !w && C("initializing");
|
|
147
|
-
}, [D, e, w]), T(() => {
|
|
148
|
-
w && (C("error"), y(w.message));
|
|
149
|
-
}, [w]), T(() => () => {
|
|
150
|
-
a.current = !1, d.stop();
|
|
151
|
-
}, [d]), {
|
|
152
|
-
activeDelegate: "GPU",
|
|
153
|
-
faces: L,
|
|
154
|
-
status: F,
|
|
155
|
-
error: S
|
|
156
|
-
};
|
|
157
|
-
}, Y = ({
|
|
158
|
-
children: e,
|
|
159
|
-
config: t,
|
|
160
|
-
style: o
|
|
161
|
-
}) => /* @__PURE__ */ m(
|
|
162
|
-
"div",
|
|
163
|
-
{
|
|
164
|
-
"data-render-target": t.name,
|
|
165
|
-
style: {
|
|
166
|
-
position: "absolute",
|
|
167
|
-
inset: 0,
|
|
168
|
-
overflow: "hidden",
|
|
169
|
-
background: t.clearColor,
|
|
170
|
-
pointerEvents: t.pointerEvents ?? "none",
|
|
171
|
-
zIndex: t.zIndex,
|
|
172
|
-
opacity: t.hidden ? 0 : 1,
|
|
173
|
-
...o
|
|
174
|
-
},
|
|
175
|
-
children: e
|
|
176
|
-
}
|
|
177
|
-
), ge = ({
|
|
178
|
-
canvasRef: e,
|
|
179
|
-
enabled: t = !0,
|
|
180
|
-
fps: o = 30,
|
|
181
|
-
imageRef: l,
|
|
182
|
-
layout: n,
|
|
183
|
-
mirrored: i,
|
|
184
|
-
sourceKind: s,
|
|
185
|
-
videoRef: r
|
|
186
|
-
}) => {
|
|
187
|
-
T(() => {
|
|
188
|
-
if (!t) {
|
|
189
|
-
const g = e.current, h = g == null ? void 0 : g.getContext("2d");
|
|
190
|
-
g && h && h.clearRect(0, 0, g.width, g.height);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
let c = 0, d = 0;
|
|
194
|
-
const u = o > 0 ? 1e3 / o : 0, a = (g) => {
|
|
195
|
-
if (c = requestAnimationFrame(a), u > 0 && g - d < u) return;
|
|
196
|
-
d = g;
|
|
197
|
-
const h = e.current;
|
|
198
|
-
if (!h || !n) return;
|
|
199
|
-
if (s === "image") {
|
|
200
|
-
const w = l.current;
|
|
201
|
-
if (!w || !w.complete || w.naturalWidth <= 0 || w.naturalHeight <= 0)
|
|
202
|
-
return;
|
|
203
|
-
ee({
|
|
204
|
-
canvas: h,
|
|
205
|
-
layout: n,
|
|
206
|
-
media: w,
|
|
207
|
-
mirrored: i
|
|
208
|
-
});
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
const p = r.current;
|
|
212
|
-
!p || p.readyState < 2 || p.videoWidth <= 0 || p.videoHeight <= 0 || ee({
|
|
213
|
-
canvas: h,
|
|
214
|
-
layout: n,
|
|
215
|
-
media: p,
|
|
216
|
-
mirrored: i
|
|
217
|
-
});
|
|
218
|
-
};
|
|
219
|
-
return c = requestAnimationFrame(a), () => {
|
|
220
|
-
cancelAnimationFrame(c);
|
|
221
|
-
};
|
|
222
|
-
}, [e, t, o, l, n, i, s, r]);
|
|
223
|
-
}, Je = ({
|
|
224
|
-
canvasRef: e,
|
|
225
|
-
imageRef: t,
|
|
226
|
-
layer: o,
|
|
227
|
-
layout: l,
|
|
228
|
-
mirrored: n,
|
|
229
|
-
sourceKind: i,
|
|
230
|
-
videoRef: s
|
|
231
|
-
}) => (ge({
|
|
232
|
-
canvasRef: e,
|
|
233
|
-
imageRef: t,
|
|
234
|
-
layout: l,
|
|
235
|
-
mirrored: n,
|
|
236
|
-
sourceKind: i,
|
|
237
|
-
videoRef: s
|
|
238
|
-
}), /* @__PURE__ */ m(Y, { config: o, children: /* @__PURE__ */ m(
|
|
239
|
-
"canvas",
|
|
240
|
-
{
|
|
241
|
-
ref: e,
|
|
242
|
-
style: {
|
|
243
|
-
position: "absolute",
|
|
244
|
-
inset: 0,
|
|
245
|
-
width: "100%",
|
|
246
|
-
height: "100%",
|
|
247
|
-
display: "block",
|
|
248
|
-
background: "#000"
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
) })), Et = ({
|
|
252
|
-
canvasRef: e,
|
|
253
|
-
controlInsetTop: t,
|
|
254
|
-
debugVisible: o,
|
|
255
|
-
fps: l = 15,
|
|
256
|
-
imageRef: n,
|
|
257
|
-
layer: i,
|
|
258
|
-
layout: s,
|
|
259
|
-
mirrored: r,
|
|
260
|
-
sourceKind: c,
|
|
261
|
-
videoRef: d,
|
|
262
|
-
viewportSize: u
|
|
263
|
-
}) => {
|
|
264
|
-
ge({
|
|
265
|
-
canvasRef: e,
|
|
266
|
-
enabled: o,
|
|
267
|
-
fps: l,
|
|
268
|
-
imageRef: n,
|
|
269
|
-
layout: s,
|
|
270
|
-
mirrored: r,
|
|
271
|
-
sourceKind: c,
|
|
272
|
-
videoRef: d
|
|
273
|
-
});
|
|
274
|
-
const a = Math.min(220, Math.max(120, u.width * 0.22)), g = u.width > 0 && u.height > 0 ? u.width / u.height : 1, h = Math.min(u.height - 24, Math.max(t ?? 16, 16));
|
|
275
|
-
return /* @__PURE__ */ m(Y, { config: i, children: /* @__PURE__ */ m(
|
|
276
|
-
"canvas",
|
|
277
|
-
{
|
|
278
|
-
ref: e,
|
|
279
|
-
style: {
|
|
280
|
-
position: "absolute",
|
|
281
|
-
left: 16,
|
|
282
|
-
top: h,
|
|
283
|
-
width: o ? a : 1,
|
|
284
|
-
height: o ? "auto" : 1,
|
|
285
|
-
aspectRatio: `${g}`,
|
|
286
|
-
opacity: o ? 0.85 : 0,
|
|
287
|
-
borderRadius: 10,
|
|
288
|
-
border: o ? "1px solid rgba(255,255,255,0.16)" : "none",
|
|
289
|
-
pointerEvents: "none",
|
|
290
|
-
objectFit: "contain",
|
|
291
|
-
background: "#000"
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
) });
|
|
295
|
-
}, pe = {
|
|
296
|
-
display: "flex",
|
|
297
|
-
alignItems: "center",
|
|
298
|
-
justifyContent: "center",
|
|
299
|
-
height: "100%",
|
|
300
|
-
background: "#363636",
|
|
301
|
-
color: "white",
|
|
302
|
-
fontFamily: "monospace"
|
|
303
|
-
}, Qe = () => /* @__PURE__ */ m("div", { style: pe, children: "Loading..." }), Ze = (e) => /* @__PURE__ */ m("div", { style: pe, children: e.error }), oe = {
|
|
304
|
-
position: "absolute",
|
|
305
|
-
top: 0,
|
|
306
|
-
left: 0,
|
|
307
|
-
width: "100%",
|
|
308
|
-
height: "100%",
|
|
309
|
-
zIndex: 10
|
|
310
|
-
}, ie = {
|
|
311
|
-
sceneColorTexture: null,
|
|
312
|
-
sceneDepthTexture: null
|
|
313
|
-
}, Oe = ({
|
|
314
|
-
onRenderOutputs: e,
|
|
315
|
-
renderOutputs: t,
|
|
316
|
-
size: o
|
|
317
|
-
}) => {
|
|
318
|
-
const { camera: l, gl: n, scene: i, size: s } = We(), r = Math.max(1, Math.round((o == null ? void 0 : o.width) ?? s.width)), c = Math.max(1, Math.round((o == null ? void 0 : o.height) ?? s.height)), d = !!(t.sceneColor || t.sceneDepth), u = W(() => {
|
|
319
|
-
if (!d) return null;
|
|
320
|
-
const a = new I.WebGLRenderTarget(r, c, {
|
|
321
|
-
colorSpace: I.SRGBColorSpace,
|
|
322
|
-
depthBuffer: !0,
|
|
323
|
-
stencilBuffer: !1
|
|
324
|
-
});
|
|
325
|
-
return t.sceneDepth && (a.depthTexture = new I.DepthTexture(r, c), a.depthTexture.format = I.DepthFormat, a.depthTexture.type = I.UnsignedShortType), a;
|
|
326
|
-
}, [d, c, t.sceneDepth, r]);
|
|
327
|
-
return T(() => {
|
|
328
|
-
if (!u) {
|
|
329
|
-
e == null || e(ie);
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
return e == null || e({
|
|
333
|
-
sceneColorTexture: t.sceneColor ? u.texture : null,
|
|
334
|
-
sceneDepthTexture: t.sceneDepth && u.depthTexture ? u.depthTexture : null
|
|
335
|
-
}), () => {
|
|
336
|
-
var a;
|
|
337
|
-
u.dispose(), (a = u.depthTexture) == null || a.dispose(), e == null || e(ie);
|
|
338
|
-
};
|
|
339
|
-
}, [e, t.sceneColor, t.sceneDepth, u]), Ne(() => {
|
|
340
|
-
if (!u) return;
|
|
341
|
-
const a = [];
|
|
342
|
-
t.excludeScreenUI !== !1 && i.traverse((p) => {
|
|
343
|
-
p.visible && p.renderOrder >= de.SCREEN_UI && (a.push(p), p.visible = !1);
|
|
344
|
-
});
|
|
345
|
-
const g = n.getRenderTarget(), h = n.xr.enabled;
|
|
346
|
-
n.xr.enabled = !1, n.setRenderTarget(u), n.clear(), n.render(i, l), n.setRenderTarget(g), n.xr.enabled = h, a.forEach((p) => {
|
|
347
|
-
p.visible = !0;
|
|
348
|
-
});
|
|
349
|
-
}, -100), null;
|
|
350
|
-
}, et = ({
|
|
351
|
-
style: e,
|
|
352
|
-
canvasProps: t,
|
|
353
|
-
children: o,
|
|
354
|
-
loadingComponent: l,
|
|
355
|
-
loadingTransitionDuration: n,
|
|
356
|
-
errorComponent: i,
|
|
357
|
-
renderTargetSize: s,
|
|
358
|
-
renderOutputs: r = {},
|
|
359
|
-
onRenderOutputs: c
|
|
360
|
-
}) => {
|
|
361
|
-
const d = M(null), u = M(null), a = M(null), g = M(!1), { session: h } = ue(), p = Le(), w = Xe(), [F, C] = E(!0);
|
|
362
|
-
return T(() => {
|
|
363
|
-
if (s) {
|
|
364
|
-
h._setRenderSize(
|
|
365
|
-
Math.round(s.width),
|
|
366
|
-
Math.round(s.height)
|
|
367
|
-
);
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
const S = (b, f) => {
|
|
371
|
-
b <= 0 || f <= 0 || h._setRenderSize(Math.round(b), Math.round(f));
|
|
372
|
-
}, y = () => {
|
|
373
|
-
!u.current || g.current || (g.current = !0, h._setRenderTarget(u.current));
|
|
374
|
-
}, D = (b, f) => {
|
|
375
|
-
a.current !== null && cancelAnimationFrame(a.current), a.current = requestAnimationFrame(() => {
|
|
376
|
-
a.current = null, S(b, f);
|
|
377
|
-
});
|
|
378
|
-
}, L = new ResizeObserver((b) => {
|
|
379
|
-
const f = b[0];
|
|
380
|
-
if (!f) return;
|
|
381
|
-
const { width: x, height: v } = f.contentRect;
|
|
382
|
-
y(), D(x, v);
|
|
383
|
-
});
|
|
384
|
-
return d.current && L.observe(d.current), y(), () => {
|
|
385
|
-
L.disconnect(), a.current !== null && (cancelAnimationFrame(a.current), a.current = null), g.current = !1;
|
|
386
|
-
};
|
|
387
|
-
}, [s, h]), T(() => {
|
|
388
|
-
p && (n ? setTimeout(() => {
|
|
389
|
-
C(!1);
|
|
390
|
-
}, n) : C(!1));
|
|
391
|
-
}, [p, n]), /* @__PURE__ */ k(
|
|
392
|
-
"div",
|
|
393
|
-
{
|
|
394
|
-
id: "vincentt-xr-container",
|
|
395
|
-
ref: d,
|
|
396
|
-
style: {
|
|
397
|
-
width: "100%",
|
|
398
|
-
height: "100%",
|
|
399
|
-
...e,
|
|
400
|
-
position: "relative"
|
|
401
|
-
},
|
|
402
|
-
children: [
|
|
403
|
-
F && /* @__PURE__ */ m("div", { style: oe, children: l || /* @__PURE__ */ m(Qe, {}) }),
|
|
404
|
-
w && /* @__PURE__ */ m("div", { style: oe, children: i || /* @__PURE__ */ m(Ze, { error: w.message }) }),
|
|
405
|
-
/* @__PURE__ */ k(
|
|
406
|
-
ze,
|
|
407
|
-
{
|
|
408
|
-
id: "vincentt-xr-canvas",
|
|
409
|
-
ref: u,
|
|
410
|
-
dpr: [1, 3],
|
|
411
|
-
gl: {
|
|
412
|
-
alpha: !0,
|
|
413
|
-
// Keep the framebuffer transient by default so resize/layout changes
|
|
414
|
-
// do not leave an old frame hanging around. Apps that need capture
|
|
415
|
-
// can opt back in via `canvasProps.gl`.
|
|
416
|
-
preserveDrawingBuffer: !1,
|
|
417
|
-
antialias: !0,
|
|
418
|
-
premultipliedAlpha: !1,
|
|
419
|
-
// Disable alpha premultiplication
|
|
420
|
-
toneMapping: I.NoToneMapping
|
|
421
|
-
// Disable tone mapping for accurate video colors
|
|
422
|
-
},
|
|
423
|
-
...t,
|
|
424
|
-
onCreated: (S) => {
|
|
425
|
-
s ? h._setRenderSize(
|
|
426
|
-
Math.round(s.width),
|
|
427
|
-
Math.round(s.height)
|
|
428
|
-
) : h._setRenderTarget(u.current), h._setR3FState({
|
|
429
|
-
renderer: S.gl,
|
|
430
|
-
scene: S.scene,
|
|
431
|
-
camera: S.camera
|
|
432
|
-
}), S.gl.outputColorSpace = I.SRGBColorSpace, t != null && t.onCreated && t.onCreated(S);
|
|
433
|
-
},
|
|
434
|
-
children: [
|
|
435
|
-
/* @__PURE__ */ m(
|
|
436
|
-
Oe,
|
|
437
|
-
{
|
|
438
|
-
onRenderOutputs: c,
|
|
439
|
-
renderOutputs: r,
|
|
440
|
-
size: s
|
|
441
|
-
}
|
|
442
|
-
),
|
|
443
|
-
o
|
|
444
|
-
]
|
|
445
|
-
}
|
|
446
|
-
)
|
|
447
|
-
]
|
|
448
|
-
}
|
|
449
|
-
);
|
|
450
|
-
}, be = K(null), we = K(null), tt = {
|
|
451
|
-
audio: !1,
|
|
452
|
-
video: {
|
|
453
|
-
facingMode: "user",
|
|
454
|
-
frameRate: { ideal: 30, max: 60 }
|
|
455
|
-
}
|
|
456
|
-
}, rt = {
|
|
457
|
-
name: "viewport-live",
|
|
458
|
-
clearColor: "#000000",
|
|
459
|
-
pointerEvents: "none",
|
|
460
|
-
zIndex: 0
|
|
461
|
-
}, nt = {
|
|
462
|
-
name: "viewport-ui",
|
|
463
|
-
clearColor: "transparent",
|
|
464
|
-
pointerEvents: "auto",
|
|
465
|
-
zIndex: 5
|
|
466
|
-
}, ot = {
|
|
467
|
-
name: "viewport-scene",
|
|
468
|
-
clearColor: "transparent",
|
|
469
|
-
pointerEvents: "auto",
|
|
470
|
-
zIndex: 1
|
|
471
|
-
}, N = {
|
|
472
|
-
webcam: { icon: "◉", label: "Webcam" },
|
|
473
|
-
image: { icon: "▣", label: "Images" },
|
|
474
|
-
video: { icon: "▶", label: "Videos" }
|
|
475
|
-
}, te = ({ children: e }) => /* @__PURE__ */ m(j, { children: e });
|
|
476
|
-
te.displayName = "XRViewport.Scene";
|
|
477
|
-
const re = ({ children: e }) => /* @__PURE__ */ m(j, { children: e });
|
|
478
|
-
re.displayName = "XRViewport.Overlay";
|
|
479
|
-
const it = (e) => {
|
|
480
|
-
if (!e)
|
|
481
|
-
return { width: 0, height: 0 };
|
|
482
|
-
const t = e.getBoundingClientRect();
|
|
483
|
-
return {
|
|
484
|
-
width: t.width || e.clientWidth,
|
|
485
|
-
height: t.height || e.clientHeight
|
|
486
|
-
};
|
|
487
|
-
}, at = (e) => {
|
|
488
|
-
const [t, o] = E({ width: 0, height: 0 });
|
|
489
|
-
return Me(() => {
|
|
490
|
-
const l = e.current;
|
|
491
|
-
if (!l) return;
|
|
492
|
-
let n = 0;
|
|
493
|
-
const i = () => {
|
|
494
|
-
const d = it(l);
|
|
495
|
-
o(
|
|
496
|
-
(u) => u.width === d.width && u.height === d.height ? u : d
|
|
497
|
-
);
|
|
498
|
-
};
|
|
499
|
-
i(), n = requestAnimationFrame(i);
|
|
500
|
-
const s = new ResizeObserver(() => {
|
|
501
|
-
i(), n && cancelAnimationFrame(n), n = requestAnimationFrame(i);
|
|
502
|
-
});
|
|
503
|
-
s.observe(l);
|
|
504
|
-
const r = window.visualViewport, c = () => {
|
|
505
|
-
i(), n && cancelAnimationFrame(n), n = requestAnimationFrame(i);
|
|
506
|
-
};
|
|
507
|
-
return window.addEventListener("resize", c), window.addEventListener("orientationchange", c), r == null || r.addEventListener("resize", c), r == null || r.addEventListener("scroll", c), () => {
|
|
508
|
-
n && cancelAnimationFrame(n), s.disconnect(), window.removeEventListener("resize", c), window.removeEventListener("orientationchange", c), r == null || r.removeEventListener("resize", c), r == null || r.removeEventListener("scroll", c);
|
|
509
|
-
};
|
|
510
|
-
}, [e]), t;
|
|
511
|
-
}, ae = (e) => {
|
|
512
|
-
e && (e.pause(), e.removeAttribute("src"), e.srcObject = null, e.load());
|
|
513
|
-
}, se = (e) => {
|
|
514
|
-
e && e.removeAttribute("src");
|
|
515
|
-
}, st = ({
|
|
516
|
-
enabled: e,
|
|
517
|
-
imageAsset: t,
|
|
518
|
-
selectedSource: o,
|
|
519
|
-
videoAsset: l
|
|
520
|
-
}) => {
|
|
521
|
-
const n = M(null), i = M(null), [s, r] = E(null), [c, d] = E({ width: 0, height: 0 }), [u, a] = E("idle"), [g, h] = E(null);
|
|
522
|
-
return T(() => {
|
|
523
|
-
if (!e) {
|
|
524
|
-
ae(n.current), se(i.current), r(null), d({ width: 0, height: 0 }), a("idle"), h(null);
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
let p = !1, w = null;
|
|
528
|
-
const F = (b, f) => {
|
|
529
|
-
p || (d({ width: b, height: f }), a("ready"), h(null));
|
|
530
|
-
}, C = () => {
|
|
531
|
-
ae(n.current), se(i.current), w == null || w.getTracks().forEach((b) => b.stop()), w = null, r(null);
|
|
532
|
-
}, S = async () => {
|
|
533
|
-
a("requesting");
|
|
534
|
-
const b = await navigator.mediaDevices.getUserMedia(tt);
|
|
535
|
-
if (p) {
|
|
536
|
-
b.getTracks().forEach((x) => x.stop());
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
w = b, r(b);
|
|
540
|
-
const f = n.current;
|
|
541
|
-
f && (f.srcObject = b, f.muted = !0, f.playsInline = !0, f.autoplay = !0, await f.play(), F(f.videoWidth, f.videoHeight));
|
|
542
|
-
}, y = async (b) => {
|
|
543
|
-
a("requesting"), r(null);
|
|
544
|
-
const f = n.current;
|
|
545
|
-
f && (f.src = b, f.muted = !0, f.loop = !0, f.playsInline = !0, f.autoplay = !0, f.crossOrigin = "anonymous", await f.play(), F(f.videoWidth, f.videoHeight));
|
|
546
|
-
}, D = async (b) => {
|
|
547
|
-
a("requesting"), r(null);
|
|
548
|
-
const f = i.current;
|
|
549
|
-
f && (await new Promise((x, v) => {
|
|
550
|
-
f.onload = () => x(), f.onerror = () => v(new Error("Unable to load image")), f.src = b;
|
|
551
|
-
}), F(f.naturalWidth, f.naturalHeight));
|
|
552
|
-
};
|
|
553
|
-
return C(), (async () => {
|
|
554
|
-
try {
|
|
555
|
-
if (o === "webcam") {
|
|
556
|
-
await S();
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
if (o === "video") {
|
|
560
|
-
if (!(l != null && l.src))
|
|
561
|
-
throw new Error("Missing video source");
|
|
562
|
-
await y(l.src);
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
if (!(t != null && t.src))
|
|
566
|
-
throw new Error("Missing image source");
|
|
567
|
-
await D(t.src);
|
|
568
|
-
} catch (b) {
|
|
569
|
-
if (p) return;
|
|
570
|
-
a("error"), h(b instanceof Error ? b.message : `Unable to initialize ${o}`);
|
|
571
|
-
}
|
|
572
|
-
})(), () => {
|
|
573
|
-
p = !0, C();
|
|
574
|
-
};
|
|
575
|
-
}, [e, t, o, l]), {
|
|
576
|
-
videoRef: n,
|
|
577
|
-
imageRef: i,
|
|
578
|
-
stream: s,
|
|
579
|
-
mediaSize: c,
|
|
580
|
-
status: u,
|
|
581
|
-
error: g
|
|
582
|
-
};
|
|
583
|
-
}, lt = ({
|
|
584
|
-
enabled: e,
|
|
585
|
-
imageRef: t,
|
|
586
|
-
selectedSource: o,
|
|
587
|
-
status: l,
|
|
588
|
-
videoRef: n
|
|
589
|
-
}) => {
|
|
590
|
-
const [i, s] = E(null);
|
|
591
|
-
return T(() => {
|
|
592
|
-
if (!e || l !== "ready") {
|
|
593
|
-
s((d) => (d == null || d.dispose(), null));
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
const r = o === "image" ? t.current : n.current;
|
|
597
|
-
if (!r) return;
|
|
598
|
-
const c = o === "image" ? new I.Texture(r) : new I.VideoTexture(r);
|
|
599
|
-
return c.colorSpace = I.SRGBColorSpace, c.minFilter = I.LinearFilter, c.magFilter = I.LinearFilter, c.generateMipmaps = !1, c.needsUpdate = !0, s((d) => (d == null || d.dispose(), c)), () => {
|
|
600
|
-
c.dispose();
|
|
601
|
-
};
|
|
602
|
-
}, [e, t, o, l, n]), i;
|
|
603
|
-
}, ct = (e, t) => e === "auto" ? t === "webcam" ? "cover" : "contain" : e, dt = ({
|
|
604
|
-
imageOptions: e,
|
|
605
|
-
initialImageId: t,
|
|
606
|
-
initialSource: o,
|
|
607
|
-
initialVideoId: l,
|
|
608
|
-
source: n,
|
|
609
|
-
videoOptions: i
|
|
610
|
-
}) => {
|
|
611
|
-
var u, a, g, h;
|
|
612
|
-
const s = (n == null ? void 0 : n.kind) ?? o ?? "webcam", r = s === "image" && e.length === 0 || s === "video" && i.length === 0 ? "webcam" : s, c = (n == null ? void 0 : n.kind) === "image" ? n.assetId ?? ((u = e[0]) == null ? void 0 : u.id) ?? "" : t ?? ((a = e[0]) == null ? void 0 : a.id) ?? "", d = (n == null ? void 0 : n.kind) === "video" ? n.assetId ?? ((g = i[0]) == null ? void 0 : g.id) ?? "" : l ?? ((h = i[0]) == null ? void 0 : h.id) ?? "";
|
|
613
|
-
return {
|
|
614
|
-
selectedSource: r,
|
|
615
|
-
selectedImageId: c,
|
|
616
|
-
selectedVideoId: d
|
|
617
|
-
};
|
|
618
|
-
}, ut = (e, t, o) => {
|
|
619
|
-
if (e.width <= 0 || e.height <= 0 || t.width <= 0 || t.height <= 0)
|
|
620
|
-
return null;
|
|
621
|
-
const l = o === "contain" ? Math.min(t.width / e.width, t.height / e.height) : Math.max(t.width / e.width, t.height / e.height), n = e.width * l, i = e.height * l, s = (t.width - n) * 0.5, r = (t.height - i) * 0.5;
|
|
622
|
-
return {
|
|
623
|
-
source: e,
|
|
624
|
-
destination: t,
|
|
625
|
-
drawWidth: n,
|
|
626
|
-
drawHeight: i,
|
|
627
|
-
offsetX: s,
|
|
628
|
-
offsetY: r,
|
|
629
|
-
scale: l
|
|
630
|
-
};
|
|
631
|
-
}, ht = (e, t) => {
|
|
632
|
-
if (e === "dom")
|
|
633
|
-
return {
|
|
634
|
-
sceneContent: null,
|
|
635
|
-
overlayContent: t
|
|
636
|
-
};
|
|
637
|
-
let o = null, l = null;
|
|
638
|
-
const n = [];
|
|
639
|
-
return De.forEach(t, (i) => {
|
|
640
|
-
var r;
|
|
641
|
-
if (!Ae(i)) {
|
|
642
|
-
i != null && n.push(i);
|
|
643
|
-
return;
|
|
644
|
-
}
|
|
645
|
-
const s = (r = i.type) == null ? void 0 : r.displayName;
|
|
646
|
-
if (s === te.displayName) {
|
|
647
|
-
o = i.props.children;
|
|
648
|
-
return;
|
|
649
|
-
}
|
|
650
|
-
if (s === re.displayName) {
|
|
651
|
-
l = i.props.children;
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
n.push(i);
|
|
655
|
-
}), !l && n.length > 0 && (l = n), {
|
|
656
|
-
sceneContent: o,
|
|
657
|
-
overlayContent: l
|
|
658
|
-
};
|
|
659
|
-
}, le = (e, t) => typeof e == "function" ? e(t) : e, Tt = () => G(be), Ft = () => G(we), ft = ({
|
|
660
|
-
imageRef: e,
|
|
661
|
-
selectedSource: t,
|
|
662
|
-
videoRef: o
|
|
663
|
-
}) => /* @__PURE__ */ k(j, { children: [
|
|
664
|
-
/* @__PURE__ */ m(
|
|
665
|
-
"video",
|
|
666
|
-
{
|
|
667
|
-
ref: o,
|
|
668
|
-
style: {
|
|
669
|
-
position: "absolute",
|
|
670
|
-
width: 1,
|
|
671
|
-
height: 1,
|
|
672
|
-
opacity: t === "image" ? 0 : 1e-3,
|
|
673
|
-
pointerEvents: "none"
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
),
|
|
677
|
-
/* @__PURE__ */ m(
|
|
678
|
-
"img",
|
|
679
|
-
{
|
|
680
|
-
ref: e,
|
|
681
|
-
alt: "",
|
|
682
|
-
style: {
|
|
683
|
-
position: "absolute",
|
|
684
|
-
width: 1,
|
|
685
|
-
height: 1,
|
|
686
|
-
opacity: t === "image" ? 1e-3 : 0,
|
|
687
|
-
pointerEvents: "none"
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
)
|
|
691
|
-
] }), ce = ({
|
|
692
|
-
dock: e,
|
|
693
|
-
label: t,
|
|
694
|
-
onChange: o,
|
|
695
|
-
options: l,
|
|
696
|
-
value: n
|
|
697
|
-
}) => /* @__PURE__ */ m(
|
|
698
|
-
"div",
|
|
699
|
-
{
|
|
700
|
-
style: {
|
|
701
|
-
position: "absolute",
|
|
702
|
-
top: e === "top-left" ? 74 : void 0,
|
|
703
|
-
bottom: e === "bottom-left" ? 74 : void 0,
|
|
704
|
-
left: 16,
|
|
705
|
-
zIndex: 5,
|
|
706
|
-
maxWidth: "calc(100vw - 32px)",
|
|
707
|
-
padding: 10,
|
|
708
|
-
borderRadius: 14,
|
|
709
|
-
background: "rgba(15, 23, 42, 0.72)",
|
|
710
|
-
border: "1px solid rgba(255,255,255,0.12)",
|
|
711
|
-
boxShadow: "0 12px 30px rgba(0,0,0,0.18)",
|
|
712
|
-
backdropFilter: "blur(10px)"
|
|
713
|
-
},
|
|
714
|
-
children: /* @__PURE__ */ k(
|
|
715
|
-
"label",
|
|
716
|
-
{
|
|
717
|
-
style: {
|
|
718
|
-
display: "grid",
|
|
719
|
-
gap: 6,
|
|
720
|
-
color: "#e5eefb",
|
|
721
|
-
fontSize: 12,
|
|
722
|
-
fontWeight: 700
|
|
723
|
-
},
|
|
724
|
-
children: [
|
|
725
|
-
/* @__PURE__ */ m("span", { children: t }),
|
|
726
|
-
/* @__PURE__ */ m(
|
|
727
|
-
"select",
|
|
728
|
-
{
|
|
729
|
-
value: n,
|
|
730
|
-
onChange: (i) => o(i.target.value),
|
|
731
|
-
style: {
|
|
732
|
-
minWidth: 180,
|
|
733
|
-
maxWidth: "calc(100vw - 52px)",
|
|
734
|
-
height: 36,
|
|
735
|
-
borderRadius: 10,
|
|
736
|
-
border: "1px solid rgba(255,255,255,0.12)",
|
|
737
|
-
background: "rgba(255,255,255,0.06)",
|
|
738
|
-
color: "#e5eefb",
|
|
739
|
-
padding: "0 10px"
|
|
740
|
-
},
|
|
741
|
-
children: l.map((i) => /* @__PURE__ */ m("option", { value: i.id, style: { color: "#111827" }, children: i.label }, i.id))
|
|
742
|
-
}
|
|
743
|
-
)
|
|
744
|
-
]
|
|
745
|
-
}
|
|
746
|
-
)
|
|
747
|
-
}
|
|
748
|
-
), mt = ({
|
|
749
|
-
dock: e,
|
|
750
|
-
imageOptions: t,
|
|
751
|
-
selectedImageId: o,
|
|
752
|
-
selectedSource: l,
|
|
753
|
-
selectedVideoId: n,
|
|
754
|
-
setSelectedImageId: i,
|
|
755
|
-
setSelectedSource: s,
|
|
756
|
-
setSelectedVideoId: r,
|
|
757
|
-
showMediaControls: c,
|
|
758
|
-
videoOptions: d
|
|
759
|
-
}) => {
|
|
760
|
-
const [u, a] = E(!1), g = ["webcam", "image", "video"].filter((h) => h === "image" ? t.length > 0 : h === "video" ? d.length > 0 : !0);
|
|
761
|
-
return c ? u ? /* @__PURE__ */ m(
|
|
762
|
-
"button",
|
|
763
|
-
{
|
|
764
|
-
type: "button",
|
|
765
|
-
onClick: () => a(!1),
|
|
766
|
-
"aria-label": "Open media controls",
|
|
767
|
-
title: "Open media controls",
|
|
768
|
-
style: {
|
|
769
|
-
position: "absolute",
|
|
770
|
-
top: e === "top-left" ? 16 : void 0,
|
|
771
|
-
bottom: e === "bottom-left" ? 16 : void 0,
|
|
772
|
-
left: 16,
|
|
773
|
-
zIndex: 5,
|
|
774
|
-
width: 40,
|
|
775
|
-
height: 40,
|
|
776
|
-
border: "1px solid rgba(255,255,255,0.12)",
|
|
777
|
-
borderRadius: 999,
|
|
778
|
-
background: "rgba(15, 23, 42, 0.72)",
|
|
779
|
-
color: "#e5eefb",
|
|
780
|
-
boxShadow: "0 12px 30px rgba(0,0,0,0.18)",
|
|
781
|
-
backdropFilter: "blur(10px)",
|
|
782
|
-
cursor: "pointer"
|
|
783
|
-
},
|
|
784
|
-
children: "≡"
|
|
785
|
-
}
|
|
786
|
-
) : /* @__PURE__ */ k(j, { children: [
|
|
787
|
-
/* @__PURE__ */ k(
|
|
788
|
-
"div",
|
|
789
|
-
{
|
|
790
|
-
style: {
|
|
791
|
-
position: "absolute",
|
|
792
|
-
top: e === "top-left" ? 16 : void 0,
|
|
793
|
-
bottom: e === "bottom-left" ? 16 : void 0,
|
|
794
|
-
left: 16,
|
|
795
|
-
zIndex: 5,
|
|
796
|
-
display: "inline-flex",
|
|
797
|
-
alignItems: "center",
|
|
798
|
-
gap: 8,
|
|
799
|
-
maxWidth: "calc(100vw - 32px)"
|
|
800
|
-
},
|
|
801
|
-
children: [
|
|
802
|
-
/* @__PURE__ */ m(
|
|
803
|
-
"div",
|
|
804
|
-
{
|
|
805
|
-
style: {
|
|
806
|
-
display: "inline-flex",
|
|
807
|
-
alignItems: "center",
|
|
808
|
-
gap: 8,
|
|
809
|
-
padding: 8,
|
|
810
|
-
borderRadius: 999,
|
|
811
|
-
background: "rgba(15, 23, 42, 0.72)",
|
|
812
|
-
border: "1px solid rgba(255,255,255,0.12)",
|
|
813
|
-
boxShadow: "0 12px 30px rgba(0,0,0,0.18)",
|
|
814
|
-
backdropFilter: "blur(10px)",
|
|
815
|
-
overflowX: "auto"
|
|
816
|
-
},
|
|
817
|
-
children: g.map((h) => {
|
|
818
|
-
const p = h === l;
|
|
819
|
-
return /* @__PURE__ */ k(
|
|
820
|
-
"button",
|
|
821
|
-
{
|
|
822
|
-
type: "button",
|
|
823
|
-
onClick: () => s(h),
|
|
824
|
-
"aria-pressed": p,
|
|
825
|
-
title: N[h].label,
|
|
826
|
-
style: {
|
|
827
|
-
border: "none",
|
|
828
|
-
borderRadius: 999,
|
|
829
|
-
minWidth: 42,
|
|
830
|
-
height: 42,
|
|
831
|
-
padding: "0 12px",
|
|
832
|
-
display: "inline-flex",
|
|
833
|
-
alignItems: "center",
|
|
834
|
-
justifyContent: "center",
|
|
835
|
-
gap: 8,
|
|
836
|
-
background: p ? "rgba(56, 189, 248, 0.18)" : "rgba(255,255,255,0.04)",
|
|
837
|
-
color: p ? "#e0f2fe" : "rgba(229,238,251,0.82)",
|
|
838
|
-
cursor: "pointer",
|
|
839
|
-
flex: "0 0 auto"
|
|
840
|
-
},
|
|
841
|
-
children: [
|
|
842
|
-
/* @__PURE__ */ m("span", { style: { fontSize: 14, lineHeight: 1 }, children: N[h].icon }),
|
|
843
|
-
/* @__PURE__ */ m("span", { style: { fontSize: 12, fontWeight: 700, letterSpacing: "0.01em" }, children: N[h].label })
|
|
844
|
-
]
|
|
845
|
-
},
|
|
846
|
-
h
|
|
847
|
-
);
|
|
848
|
-
})
|
|
849
|
-
}
|
|
850
|
-
),
|
|
851
|
-
/* @__PURE__ */ m(
|
|
852
|
-
"button",
|
|
853
|
-
{
|
|
854
|
-
type: "button",
|
|
855
|
-
onClick: () => a(!0),
|
|
856
|
-
"aria-label": "Close media controls",
|
|
857
|
-
title: "Close media controls",
|
|
858
|
-
style: {
|
|
859
|
-
width: 40,
|
|
860
|
-
height: 40,
|
|
861
|
-
border: "1px solid rgba(255,255,255,0.12)",
|
|
862
|
-
borderRadius: 999,
|
|
863
|
-
background: "rgba(15, 23, 42, 0.72)",
|
|
864
|
-
color: "#e5eefb",
|
|
865
|
-
boxShadow: "0 12px 30px rgba(0,0,0,0.18)",
|
|
866
|
-
backdropFilter: "blur(10px)",
|
|
867
|
-
cursor: "pointer",
|
|
868
|
-
flex: "0 0 auto"
|
|
869
|
-
},
|
|
870
|
-
children: "×"
|
|
871
|
-
}
|
|
872
|
-
)
|
|
873
|
-
]
|
|
874
|
-
}
|
|
875
|
-
),
|
|
876
|
-
l === "image" && t.length > 0 && /* @__PURE__ */ m(
|
|
877
|
-
ce,
|
|
878
|
-
{
|
|
879
|
-
dock: e,
|
|
880
|
-
label: "Image Asset",
|
|
881
|
-
options: t,
|
|
882
|
-
value: o,
|
|
883
|
-
onChange: i
|
|
884
|
-
}
|
|
885
|
-
),
|
|
886
|
-
l === "video" && d.length > 0 && /* @__PURE__ */ m(
|
|
887
|
-
ce,
|
|
888
|
-
{
|
|
889
|
-
dock: e,
|
|
890
|
-
label: "Video Asset",
|
|
891
|
-
options: d,
|
|
892
|
-
value: n,
|
|
893
|
-
onChange: r
|
|
894
|
-
}
|
|
895
|
-
)
|
|
896
|
-
] }) : null;
|
|
897
|
-
}, gt = ({
|
|
898
|
-
enabled: e,
|
|
899
|
-
selectedSource: t
|
|
900
|
-
}) => {
|
|
901
|
-
const o = _e(he.FACE_TRACKER);
|
|
902
|
-
return {
|
|
903
|
-
faces: fe({ node: o, enabled: e, selectedSource: t }),
|
|
904
|
-
trackerStatus: o ? "ready" : "idle"
|
|
905
|
-
};
|
|
906
|
-
}, xe = ({
|
|
907
|
-
children: e,
|
|
908
|
-
fitMode: t = "auto",
|
|
909
|
-
imageOptions: o = [],
|
|
910
|
-
initialImageId: l,
|
|
911
|
-
initialMirrored: n = !0,
|
|
912
|
-
initialSource: i = "webcam",
|
|
913
|
-
initialVideoId: s,
|
|
914
|
-
mediaStrategy: r = "internal",
|
|
915
|
-
mediaDock: c = "bottom-left",
|
|
916
|
-
mode: d = "dom",
|
|
917
|
-
previewMode: u = "finalColor",
|
|
918
|
-
renderOutputs: a = {},
|
|
919
|
-
showMediaControlsByDefault: g = !0,
|
|
920
|
-
source: h,
|
|
921
|
-
style: p,
|
|
922
|
-
videoOptions: w = []
|
|
923
|
-
}) => {
|
|
924
|
-
const F = M(null), C = M(null), S = at(F), y = W(
|
|
925
|
-
() => dt({
|
|
926
|
-
imageOptions: o,
|
|
927
|
-
initialImageId: l,
|
|
928
|
-
initialSource: i,
|
|
929
|
-
initialVideoId: s,
|
|
930
|
-
source: h,
|
|
931
|
-
videoOptions: w
|
|
932
|
-
}),
|
|
933
|
-
[o, l, i, s, h, w]
|
|
934
|
-
), [D, L] = E(n), [b, f] = E(g), [x, v] = E(
|
|
935
|
-
y.selectedSource
|
|
936
|
-
), [V, _] = E(y.selectedImageId), [z, P] = E(y.selectedVideoId), [X, ve] = E({
|
|
937
|
-
sceneColorTexture: null,
|
|
938
|
-
sceneDepthTexture: null
|
|
939
|
-
}), A = r === "internal";
|
|
940
|
-
T(() => {
|
|
941
|
-
h && (v(y.selectedSource), _(y.selectedImageId), P(y.selectedVideoId));
|
|
942
|
-
}, [y, h]);
|
|
943
|
-
const B = o.find((O) => O.id === V) ?? o[0], H = w.find((O) => O.id === z) ?? w[0], R = st({
|
|
944
|
-
enabled: A,
|
|
945
|
-
imageAsset: B,
|
|
946
|
-
selectedSource: x,
|
|
947
|
-
videoAsset: H
|
|
948
|
-
}), J = ct(t, x), U = W(
|
|
949
|
-
() => ut(R.mediaSize, S, J),
|
|
950
|
-
[R.mediaSize, J, S]
|
|
951
|
-
), Q = lt({
|
|
952
|
-
enabled: !!(a.mediaColor || a.finalColor),
|
|
953
|
-
imageRef: R.imageRef,
|
|
954
|
-
selectedSource: x,
|
|
955
|
-
status: R.status,
|
|
956
|
-
videoRef: R.videoRef
|
|
957
|
-
}), Z = Ke(x, D), q = Pe({
|
|
958
|
-
displayMirrored: Z,
|
|
959
|
-
enabled: A && R.status === "ready" && U !== null,
|
|
960
|
-
imageRef: R.imageRef,
|
|
961
|
-
layout: U,
|
|
962
|
-
selectedSource: x,
|
|
963
|
-
sourceStream: R.stream,
|
|
964
|
-
videoRef: R.videoRef
|
|
965
|
-
}), ne = gt({
|
|
966
|
-
enabled: !A,
|
|
967
|
-
selectedSource: x
|
|
968
|
-
}), ye = x === "image" ? `${N.image.label}: ${(B == null ? void 0 : B.label) ?? ""}` : x === "video" ? `${N.video.label}: ${(H == null ? void 0 : H.label) ?? ""}` : N.webcam.label, $ = {
|
|
969
|
-
activeDelegate: A ? q.activeDelegate : null,
|
|
970
|
-
faces: A ? q.faces : ne.faces,
|
|
971
|
-
imageOptions: o,
|
|
972
|
-
layout: U,
|
|
973
|
-
mediaError: R.error,
|
|
974
|
-
mediaFitMode: J,
|
|
975
|
-
mediaLabel: ye,
|
|
976
|
-
mediaStatus: R.status,
|
|
977
|
-
mirrored: Z,
|
|
978
|
-
selectedImageId: V,
|
|
979
|
-
selectedSource: x,
|
|
980
|
-
selectedVideoId: z,
|
|
981
|
-
setMirrored: L,
|
|
982
|
-
setSelectedImageId: _,
|
|
983
|
-
setSelectedSource: v,
|
|
984
|
-
setSelectedVideoId: P,
|
|
985
|
-
setShowMediaControls: f,
|
|
986
|
-
showMediaControls: b,
|
|
987
|
-
trackerError: A ? q.error : null,
|
|
988
|
-
trackerStatus: A ? q.status : ne.trackerStatus,
|
|
989
|
-
videoOptions: w,
|
|
990
|
-
viewportSize: S,
|
|
991
|
-
mediaSize: R.mediaSize
|
|
992
|
-
}, Ce = W(
|
|
993
|
-
() => ({
|
|
994
|
-
requested: a,
|
|
995
|
-
previewMode: u,
|
|
996
|
-
mediaColorTexture: Q,
|
|
997
|
-
sceneColorTexture: X.sceneColorTexture,
|
|
998
|
-
finalColorTexture: a.finalColor ? X.sceneColorTexture : null,
|
|
999
|
-
sceneDepthTexture: X.sceneDepthTexture,
|
|
1000
|
-
estimatedDepthTexture: null,
|
|
1001
|
-
available: {
|
|
1002
|
-
mediaColor: Q !== null,
|
|
1003
|
-
sceneColor: X.sceneColorTexture !== null,
|
|
1004
|
-
finalColor: !!(a.finalColor && X.sceneColorTexture),
|
|
1005
|
-
sceneDepth: X.sceneDepthTexture !== null,
|
|
1006
|
-
estimatedDepth: !1
|
|
1007
|
-
}
|
|
1008
|
-
}),
|
|
1009
|
-
[Q, u, a, X]
|
|
1010
|
-
), Se = typeof e == "function" ? e($) : e, { sceneContent: Re, overlayContent: Ee } = ht(d, Se), Te = le(
|
|
1011
|
-
Re,
|
|
1012
|
-
$
|
|
1013
|
-
), Fe = le(
|
|
1014
|
-
Ee,
|
|
1015
|
-
$
|
|
1016
|
-
);
|
|
1017
|
-
return /* @__PURE__ */ m(be.Provider, { value: $, children: /* @__PURE__ */ m(we.Provider, { value: Ce, children: /* @__PURE__ */ k(
|
|
1018
|
-
"div",
|
|
1019
|
-
{
|
|
1020
|
-
ref: F,
|
|
1021
|
-
style: {
|
|
1022
|
-
position: "fixed",
|
|
1023
|
-
inset: 0,
|
|
1024
|
-
overflow: "hidden",
|
|
1025
|
-
background: "#000",
|
|
1026
|
-
...p
|
|
1027
|
-
},
|
|
1028
|
-
children: [
|
|
1029
|
-
/* @__PURE__ */ m(
|
|
1030
|
-
ft,
|
|
1031
|
-
{
|
|
1032
|
-
imageRef: R.imageRef,
|
|
1033
|
-
selectedSource: x,
|
|
1034
|
-
videoRef: R.videoRef
|
|
1035
|
-
}
|
|
1036
|
-
),
|
|
1037
|
-
d === "dom" && A && /* @__PURE__ */ m(
|
|
1038
|
-
Je,
|
|
1039
|
-
{
|
|
1040
|
-
canvasRef: C,
|
|
1041
|
-
imageRef: R.imageRef,
|
|
1042
|
-
videoRef: R.videoRef,
|
|
1043
|
-
layer: rt,
|
|
1044
|
-
layout: U,
|
|
1045
|
-
mirrored: Z,
|
|
1046
|
-
sourceKind: x === "image" ? "image" : "video"
|
|
1047
|
-
}
|
|
1048
|
-
),
|
|
1049
|
-
(d === "r3f" || d === "hybrid") && /* @__PURE__ */ m(Y, { config: ot, children: /* @__PURE__ */ m(
|
|
1050
|
-
et,
|
|
1051
|
-
{
|
|
1052
|
-
onRenderOutputs: ve,
|
|
1053
|
-
renderOutputs: {
|
|
1054
|
-
sceneColor: a.sceneColor || a.finalColor,
|
|
1055
|
-
sceneDepth: a.sceneDepth
|
|
1056
|
-
},
|
|
1057
|
-
renderTargetSize: S,
|
|
1058
|
-
style: { width: "100%", height: "100%" },
|
|
1059
|
-
children: Te
|
|
1060
|
-
}
|
|
1061
|
-
) }),
|
|
1062
|
-
/* @__PURE__ */ k(Y, { config: nt, children: [
|
|
1063
|
-
A && /* @__PURE__ */ m(
|
|
1064
|
-
mt,
|
|
1065
|
-
{
|
|
1066
|
-
dock: c,
|
|
1067
|
-
imageOptions: o,
|
|
1068
|
-
selectedImageId: V,
|
|
1069
|
-
selectedSource: x,
|
|
1070
|
-
selectedVideoId: z,
|
|
1071
|
-
setSelectedImageId: _,
|
|
1072
|
-
setSelectedSource: v,
|
|
1073
|
-
setSelectedVideoId: P,
|
|
1074
|
-
showMediaControls: b,
|
|
1075
|
-
videoOptions: w
|
|
1076
|
-
}
|
|
1077
|
-
),
|
|
1078
|
-
Fe
|
|
1079
|
-
] })
|
|
1080
|
-
]
|
|
1081
|
-
}
|
|
1082
|
-
) }) });
|
|
1083
|
-
};
|
|
1084
|
-
xe.Scene = te;
|
|
1085
|
-
xe.Overlay = re;
|
|
1086
|
-
export {
|
|
1087
|
-
me as S,
|
|
1088
|
-
Y as X,
|
|
1089
|
-
Je as a,
|
|
1090
|
-
xe as b,
|
|
1091
|
-
He as c,
|
|
1092
|
-
Et as d,
|
|
1093
|
-
Tt as e,
|
|
1094
|
-
Ft as f,
|
|
1095
|
-
Pe as g,
|
|
1096
|
-
Ve as h,
|
|
1097
|
-
St as i,
|
|
1098
|
-
Rt as j,
|
|
1099
|
-
et as k,
|
|
1100
|
-
Ke as r,
|
|
1101
|
-
Be as u
|
|
1102
|
-
};
|