# Project export: Echo

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 11.0
- Tagline: Real time Spatial Documentation & Data Visualization in AR - A new way to interact with spoken information
- Devpost: https://devpost.com/software/echo-qylpoe
- GitHub: https://github.com/wonhochoi1/snap-echo/
- Video: https://www.youtube.com/embed/aeboXKywKsc?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 2 GitHub contributor(s) — ishansheth-31 (1 commits), wonhochoi1 (1 commits)

## Devpost submission (written by the team)

### Inspiration

Communication generates vast amounts of information, yet much of it is lost or difficult to visualize in real-time. Inspired by the need for better ways to organize and interpret spoken interactions, Echo was born. We wanted to create a tool that not only captures conversations but also enhances the way we interact with them, using AR to display real-time data. By doing this, we aim to bridge the gap between spoken communication and actionable insights, ensuring that no key information is missed.

### What it does

Echo captures live conversations using Snap Spectacles and turns them into real-time transcription in augmented reality. As the conversation progresses, users can click on words/phrases to define them or bookmark important segments. At the end of the session, Echo generates a detailed report supercharged by Gemini, including a transcription, a summary, and action items, which can be accessed through our dashboard. This system is perfect for meetings, lectures, or just conversations you'd want to remember, offering a new way to interact with and organize spoken data.

### How we built it

We built Echo using Snap Spectacles for live video capture, integrated with Deepgram's speech recognition API to convert spoken words into transcriptions. The transcriptions are rendered in a 3D space using Lens Studio, allowing users to interact with the words in real-time. The backend is powered by Python and JavaScript, ensuring smooth communication between the AR environment, the dashboard, and Gemini. Reflex handles user interactions and backend connection for our dashboard, which summarizes the session and organizes the transcription, action steps, and definitions for future use.

### Challenges we ran into

We faced several challenges throughout the development process. Initially, we wanted to use Lens Studio’s built-in voice ML for speech-to-text, but quickly realized that it didn’t allow us to interact with third-party APIs. This limitation led us to utilize Deepgram’s API, which offered more flexibility for integrating real-time transcriptions and easier external data storage/comprehensive analysis. Additionally, we ran into difficulties with data retrieval. Since we couldn’t make direct calls to our MongoDB database from the front end, we had to build and deploy a Flask server that could fetch data in real-time. This server allowed us to store and retrieve live transcription data from MongoDB, which Deepgram alone couldn’t handle directly. These challenges pushed us to rethink our system architecture, but ultimately led to a more robust solution.

### Accomplishments we're proud of

We’re proud to have successfully integrated Snap Spectacles with 3D AR transcription, a feat that involved overcoming multiple technical hurdles. While sending and retreiving speech data and analysis took time and was tough to implement, the reward of bringing real-time definitions/analysis to the Snap Spectacles was well worth the effort. Another accomplishment is creating an intuitive dashboard that complements the AR experience, providing users with actionable insights like summaries and action steps, and allowing their actions in AR to carry impact even after they take off the Spectacles.

### What we learned

This project taught us the importance of creative problem solving when dealing with newer software. While our vision was straighforward, we dealt with numerous hurdles that we had to overcome by using our knowledge of backend development and API usage. We also learned how to use Lens Studio and create augmented reality environements that change in real time. We learned how to create smooth interactions and develop user friendly interfaces that can impact students, professionals, and anyone interested in organizing spoken information.

### What's next

We plan to introduce contextual summarization, where real-time bullet points and conversation prompts will appear to help guide discussions and highlight key topics as they emerge. We are also exploring the idea of categorizing conversations into specific topics to emphasize important points automatically. Real-time data visualization is another exciting prospect, making relevant graphs/data available on-demand as they come up in conversation. Collaborative AR environments allow multiple users to view and interact with the same data, create a real-time collaboration experience. Finally, we aim to implement multi-lingual support, enabling real-time translation for all types of conversations.

## README (from the GitHub repository)

No README available.

## Detected evidence (automated analysis)

Indexed codebase: 2098 recognized source files, 10172 KB.
- JavaScript (language) — detected in the code
- Python (language) — detected in the code
- TypeScript (language) — detected in the code
- Google Gemini (technology) — claimed on Devpost, not found in the code
- MongoDB (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 4343)

```
app.py
Assets/Device Camera Texture.deviceCameraTexture
Assets/Device Camera Texture.deviceCameraTexture.meta
Assets/Echopark.hdr
Assets/Echopark.hdr.meta
Assets/Remote Service Module.remoteServiceModule
Assets/Remote Service Module.remoteServiceModule.meta
Assets/Render Target.renderTarget
Assets/Render Target.renderTarget.meta
Assets/Scene.scene
Assets/Scene.scene.meta
Assets/SpectaclesInteractionKit/Assets/Audio/HoverAudioTrack.wav.meta
Assets/SpectaclesInteractionKit/Assets/Audio/TriggerEndAudioTrack.wav.meta
Assets/SpectaclesInteractionKit/Assets/Audio/TriggerStartAudioTrack.wav.meta
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/PaintedGlow_Left.mat
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/PaintedGlow_Left.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/PaintedGlow_Right.mat
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/PaintedGlow_Right.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/RadialGradientOcclusion.mat
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/RadialGradientOcclusion.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/TipGlowMaterial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/BaseHandVisualsMaterials/TipGlowMaterial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/BitmojiMaterial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/BitmojiMaterial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/ContainerImageMaterial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/ContainerImageMaterial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/LogoMaterial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/LogoMaterial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/NormalBasedTargetOutline.mat
Assets/SpectaclesInteractionKit/Assets/Materials/NormalBasedTargetOutline.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonDarkInactive.mat
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonDarkInactive.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonDarkRadial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonDarkRadial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOffIcon.mat
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOffIcon.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOnDefault.mat
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOnDefault.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOnIcon.mat
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOnIcon.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOnSelect.mat
Assets/SpectaclesInteractionKit/Assets/Materials/PinchButtonToggleOnSelect.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/ScaleBasedTargetOutline.mat
Assets/SpectaclesInteractionKit/Assets/Materials/ScaleBasedTargetOutline.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/ScrollBarButton.mat
Assets/SpectaclesInteractionKit/Assets/Materials/ScrollBarButton.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/ScrollBarSlider.mat
Assets/SpectaclesInteractionKit/Assets/Materials/ScrollBarSlider.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/SimplePBRMaterial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/SimplePBRMaterial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/PinchButtonDarkDefault.mat
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/PinchButtonDarkDefault.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/PinchButtonOnSelect.mat
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/PinchButtonOnSelect.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/SliderMat.mat
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/SliderMat.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/TargetOutlineMaterial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/SliderMat/TargetOutlineMaterial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/SpritePreset.mat
Assets/SpectaclesInteractionKit/Assets/Materials/SpritePreset.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/TargetOutlineMaterial.mat
Assets/SpectaclesInteractionKit/Assets/Materials/TargetOutlineMaterial.mat.meta
Assets/SpectaclesInteractionKit/Assets/Materials/Text3DDefault.mat
Assets/SpectaclesInteractionKit/Assets/Materials/Text3DDefault.mat.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/BoxMesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/BoxMesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/ButtonCapsuleMesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/ButtonCapsuleMesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/ButtonSphereMesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/ButtonSphereMesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/Check.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/Check.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/LeftHandMesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/LeftHandMesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/PlaneMesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/PlaneMesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/RightHandMesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/RightHandMesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/ScrollBarSlider.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/ScrollBarSlider.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/SliderSphereKnob.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/SliderSphereKnob.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/SliderTrack.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/SliderTrack.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/SnapGhost_Mesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/SnapGhost_Mesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/SphereMesh.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/SphereMesh.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Meshes/Uncheck.mesh
Assets/SpectaclesInteractionKit/Assets/Meshes/Uncheck.mesh.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/PaintedGlow_Left.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/PaintedGlow_Left.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/PaintedGlow_Right.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/PaintedGlow_Right.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/RadialGradientOcclusion.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/RadialGradientOcclusion.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/TipGlowMaterial.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/BaseHandVisualsShaders/TipGlowMaterial.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/NormalBasedTargetOutline.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/NormalBasedTargetOutline.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/PinchButton-ActiveOrInActive.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/PinchButton-ActiveOrInActive.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/PinchDarkRadial.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/PinchDarkRadial.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/ScaleBasedTargetOutline.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/ScaleBasedTargetOutline.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/ScrollBarSlider.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/ScrollBarSlider.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/simple_pbr.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/simple_pbr.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/SliderShaders/PinchButton-Default.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/SliderShaders/PinchButton-Default.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/SliderShaders/Slider.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/SliderShaders/Slider.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/SpritePreset.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/SpritePreset.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/TargetOutline.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/TargetOutline.ss_graph.meta
Assets/SpectaclesInteractionKit/Assets/Shaders/Text3DDefault.ss_graph
Assets/SpectaclesInteractionKit/Assets/Shaders/Text3DDefault.ss_graph.meta
[4223 more files omitted for size]
```

### Dependencies

- requirements.txt: reflex@>=0.5.5
- test/requirements.txt: reflex@==0.6.3

### Recent commits (newest first)

- key changes & security
- Add files via upload
- initial commit

## Key source files (fetched from GitHub, selected and truncated for size)

### requirements.txt

```
reflex>=0.5.5
```

### test/requirements.txt

```
reflex==0.6.3

```

### server.py

```python
from flask import Flask, jsonify
from pymongo import MongoClient

app = Flask(__name__)

# MongoDB connection
client = MongoClient('')
# client = MongoClient('mongodb+srv://your_mongo_uri')
db = client['textstorage']  
collection = db['test1']  

@app.route('/getData', methods=['GET'])
def get_data():
    try:
        data = list(collection.find({}, {'_id': False}))  # Exclude _id from the result
        return jsonify(data), 200
    except Exception as e:
        return jsonify({"error": str(e)}), 500

if __name__ == '__main__':
    app.run(debug=True)

```

### app.py

```python
from dotenv import load_dotenv
from time import sleep
import logging
from deepgram.utils import verboselogs
from deepgram import (
    DeepgramClient,
    DeepgramClientOptions,
    LiveTranscriptionEvents,
    LiveOptions,
    Microphone,
)
from pymongo import MongoClient

load_dotenv()


MONGO_KEY = ""      #insert Mongo Key
client = MongoClient(MONGO_KEY)
db = client['textstorage']  
collection = db['test1']  

is_finals = []

def main():
    try:
        API_KEY = ""    
        deepgram: DeepgramClient = DeepgramClient(API_KEY)

        dg_connection = deepgram.listen.live.v("1")

        def on_open(self, open, **kwargs):
            print("Connection Open")

        def on_message(self, result, **kwargs):
            global is_finals
            sentence = result.channel.alternatives[0].transcript
            if len(sentence) == 0:
                return
            if result.is_final:
                print(f"Message: {result.to_json()}")
                is_finals.append(sentence)

                if result.speech_final:
                    utterance = " ".join(is_finals)
                    print(f"Speech Final: {utterance}")      
                    
                    collection.insert_one({"utterance": utterance})

                    is_finals = []
                else:
                    print(f"Is Final: {sentence}")
            else:
                print(f"Interim Results: {sentence}")

        def on_metadata(self, metadata, **kwargs):
            print(f"Metadata: {metadata}")

        def on_speech_started(self, speech_started, **kwargs):
            print("Speech Started")

        def on_utterance_end(self, utterance_end, **kwargs):
            print("Utterance End")
            global is_finals
            if len(is_finals) > 0:
                utterance = " ".join(is_finals)
                print(f"Utterance End: {utterance}")

                # Insert utterance into MongoDB
                collection.insert_one({"utterance": utterance})

                is_finals = []

        def on_close(self, close, **kwargs):
            print("Connection Closed")

        def on_error(self, error, **kwargs):
            print(f"Handled Error: {error}")

        def on_unhandled(self, unhandled, **kwargs):
            print(f"Unhandled Websocket Message: {unhandled}")

        dg_connection.on(LiveTranscriptionEvents.Open, on_open)
        dg_connection.on(LiveTranscriptionEvents.Transcript, on_message)
        dg_connection.on(LiveTranscriptionEvents.Metadata, on_metadata)
        dg_connection.on(LiveTranscriptionEvents.SpeechStarted, on_speech_started)
        dg_connection.on(LiveTranscriptionEvents.UtteranceEnd, on_utterance_end)
        dg_connection.on(LiveTranscriptionEvents.Close, on_close)
        dg_connection.on(LiveTranscriptionEvents.Error, on_error)
        dg_connection.on(LiveTranscriptionEvents.Unhandled, on_unhandled)

        options: LiveOptions = LiveOptions(
            model="nova-2",
            language="en-US",
            smart_format=True,
            encoding="linear16",
            channels=1,
            sample_rate=16000,
            interim_results=True,
            utterance_end_ms="1000",
            vad_events=True,
            endpointing=300,
        )

        addons = {
            "no_delay": "true"
        }

        print("\n\nPress Enter to stop recording...\n\n")
        if dg_connection.start(options, addons=addons) is False:
            print("Failed to connect to Deepgram")
            return

        microphone = Microphone(dg_connection.send)
        microphone.start()

        input("")

        microphone.finish()
        dg_connection.finish()

        print("Finished")

    except Exception as e:
        print(f"Could not open socket: {e}")
        return

if __name__ == "__main__":
    main()


```

### Cache/Asset Preview/Assets/Scripts/Main.js

```javascript
//@input Component.ScriptComponent texturePreviewController
//@input Component.ScriptComponent materialPreviewController
//@input Component.ScriptComponent meshPreviewController
//@input Component.ScriptComponent vfxPreviewController
//@input Component.ScriptComponent otherObjectsPreviewController
//@input Component.ScriptComponent gridController
//@input Component.ScriptComponent placementScript

const updateEvent = script.createEvent('LateUpdateEvent');
updateEvent.bind(update);

function update() {

    if (global.scene.getRootObjectsCount() <= 1) {
        return;
    }

    let newObject = null;
    for (let i = global.scene.getRootObjectsCount() - 1; i >= 0; --i) {
        const root = global.scene.getRootObject(i);
        if (root.name === '[ROOT]') {
            continue;
        }

        newObject = root;
    }
    
    script.gridController.show();

    newObject.enabled = true;
    var hasChild = (newObject.getChildrenCount() != 0);

    if (!hasChild && (newObject.name == "Texture" || newObject.name == "Video Texture")){
        var image = newObject.getComponent("Component.Image");
        if (image) {
            var mainPass = image.mainPass;
            if (mainPass){
                hide();
                var texture = mainPass.baseTex;
                script.texturePreviewController.show(texture)
                newObject.destroy();
            }

            return;
        }
    }

    if (!hasChild && newObject.name == 'Material') {
        var renderMeshVisual = newObject.getComponent("Component.RenderMeshVisual");
        if (renderMeshVisual){
            hide();
            script.placementScript.reparentNew();
            script.materialPreviewController.show(newObject);
            return;
        }
    }

    if (!hasChild && newObject.name == 'Mesh') {
        var renderMeshVisual = newObject.getComponent("Component.RenderMeshVisual");
        if (renderMeshVisual){        
            hide();
            script.placementScript.reparentNew();
            script.meshPreviewController.show(newObject);
            return;
        }
    }

    if (newObject.name == 'VFX Graph') {
        hide();
        script.vfxPreviewController.show(newObject);
        return;
    }

    if (newObject.name == '_ngsVfxManager') {
        script.vfxPreviewController.setVfxManager(newObject);
        return;
    }

    hide();
    script.placementScript.reparentNew();
    script.otherObjectsPreviewController.show();
}

function hide() {
    script.texturePreviewController.hide();
    script.materialPreviewController.hide();
    script.meshPreviewController.hide();
    script.vfxPreviewController.hide();
    script.otherObjectsPreviewController.hide();
}

```

### Cache/c9a24731-bc37-4eee-b4d6-98c50d72248c/70a379fe60ae45e635a532826ebc03ef/Data/Main.js

```javascript
//@input Component.ScriptComponent texturePreviewController
//@input Component.ScriptComponent materialPreviewController
//@input Component.ScriptComponent meshPreviewController
//@input Component.ScriptComponent vfxPreviewController
//@input Component.ScriptComponent otherObjectsPreviewController
//@input Component.ScriptComponent gridController
//@input Component.ScriptComponent placementScript

const updateEvent = script.createEvent('LateUpdateEvent');
updateEvent.bind(update);

function update() {

    if (global.scene.getRootObjectsCount() <= 1) {
        return;
    }

    let newObject = null;
    for (let i = global.scene.getRootObjectsCount() - 1; i >= 0; --i) {
        const root = global.scene.getRootObject(i);
        if (root.name === '[ROOT]') {
            continue;
        }

        newObject = root;
    }
    
    script.gridController.show();

    newObject.enabled = true;
    var hasChild = (newObject.getChildrenCount() != 0);

    if (!hasChild && (newObject.name == "Texture" || newObject.name == "Video Texture")){
        var image = newObject.getComponent("Component.Image");
        if (image) {
            var mainPass = image.mainPass;
            if (mainPass){
                hide();
                var texture = mainPass.baseTex;
                script.texturePreviewController.show(texture)
                newObject.destroy();
            }

            return;
        }
    }

    if (!hasChild && newObject.name == 'Material') {
        var renderMeshVisual = newObject.getComponent("Component.RenderMeshVisual");
        if (renderMeshVisual){
            hide();
            script.placementScript.reparentNew();
            script.materialPreviewController.show(newObject);
            return;
        }
    }

    if (!hasChild && newObject.name == 'Mesh') {
        var renderMeshVisual = newObject.getComponent("Component.RenderMeshVisual");
        if (renderMeshVisual){        
            hide();
            script.placementScript.reparentNew();
            script.meshPreviewController.show(newObject);
            return;
        }
    }

    if (newObject.name == 'VFX Graph') {
        hide();
        script.vfxPreviewController.show(newObject);
        return;
    }

    if (newObject.name == '_ngsVfxManager') {
        script.vfxPreviewController.setVfxManager(newObject);
        return;
    }

    hide();
    script.placementScript.reparentNew();
    script.otherObjectsPreviewController.show();
}

function hide() {
    script.texturePreviewController.hide();
    script.materialPreviewController.hide();
    script.meshPreviewController.hide();
    script.vfxPreviewController.hide();
    script.otherObjectsPreviewController.hide();
}

```

### Cache/Asset Preview/Cache/c9a24731-bc37-4eee-b4d6-98c50d72248c/70a379fe60ae45e635a532826ebc03ef/Data/Main.js

```javascript
//@input Component.ScriptComponent texturePreviewController
//@input Component.ScriptComponent materialPreviewController
//@input Component.ScriptComponent meshPreviewController
//@input Component.ScriptComponent vfxPreviewController
//@input Component.ScriptComponent otherObjectsPreviewController
//@input Component.ScriptComponent gridController
//@input Component.ScriptComponent placementScript

const updateEvent = script.createEvent('LateUpdateEvent');
updateEvent.bind(update);

function update() {

    if (global.scene.getRootObjectsCount() <= 1) {
        return;
    }

    let newObject = null;
    for (let i = global.scene.getRootObjectsCount() - 1; i >= 0; --i) {
        const root = global.scene.getRootObject(i);
        if (root.name === '[ROOT]') {
            continue;
        }

        newObject = root;
    }
    
    script.gridController.show();

    newObject.enabled = true;
    var hasChild = (newObject.getChildrenCount() != 0);

    if (!hasChild && (newObject.name == "Texture" || newObject.name == "Video Texture")){
        var image = newObject.getComponent("Component.Image");
        if (image) {
            var mainPass = image.mainPass;
            if (mainPass){
                hide();
                var texture = mainPass.baseTex;
                script.texturePreviewController.show(texture)
                newObject.destroy();
            }

            return;
        }
    }

    if (!hasChild && newObject.name == 'Material') {
        var renderMeshVisual = newObject.getComponent("Component.RenderMeshVisual");
        if (renderMeshVisual){
            hide();
            script.placementScript.reparentNew();
            script.materialPreviewController.show(newObject);
            return;
        }
    }

    if (!hasChild && newObject.name == 'Mesh') {
        var renderMeshVisual = newObject.getComponent("Component.RenderMeshVisual");
        if (renderMeshVisual){        
            hide();
            script.placementScript.reparentNew();
            script.meshPreviewController.show(newObject);
            return;
        }
    }

    if (newObject.name == 'VFX Graph') {
        hide();
        script.vfxPreviewController.show(newObject);
        return;
    }

    if (newObject.name == '_ngsVfxManager') {
        script.vfxPreviewController.setVfxManager(newObject);
        return;
    }

    hide();
    script.placementScript.reparentNew();
    script.otherObjectsPreviewController.show();
}

function hide() {
    script.texturePreviewController.hide();
    script.materialPreviewController.hide();
    script.meshPreviewController.hide();
    script.vfxPreviewController.hide();
    script.otherObjectsPreviewController.hide();
}

```

### getData.js

```javascript
//@input Asset.RemoteServiceModule remoteServiceModule
/** @type {RemoteServiceModule} */
var remoteServiceModule = script.remoteServiceModule;

var httpRequest = RemoteServiceHttpRequest.create();

// Update the URL to point to your Flask server
httpRequest.url = 'http://localhost:5000/getData';  
httpRequest.method = RemoteServiceHttpRequest.HttpRequestMethod.Get;

print('Sending request!');

remoteServiceModule.performHttpRequest(httpRequest, function (response) {
  print('Request response received');
  print('Status code: ' + response.statusCode);
  print('Content type: ' + response.contentType);
  print('Body: ' + response.body);
  print('Headers: ' + response.headers);
});

```

### test/rxconfig.py

```python
import reflex as rx

config = rx.Config(
    app_name="test",
)
```

### PluginsUserPreferences/Snap_Plugin_Gui_InspectorPanel_780d9164-e681-4de1-b586-5213ed5523b9.yaml

```yaml
PinnedEntities:
  type: "std::vector<Es::Uuid>"
  value:
    size: 0
  options: 4

```

[2073 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]