@echo off
setlocal

REM Build HyperTwist browser runtime bundle
REM Phase 1H, 1I, 1J: bundles all JS spatial/analytics/model-viewer repos

cd /d "%~dp0"

echo Installing browser runtime dependencies...
call npm install
if errorlevel 1 (
    echo npm install failed
    exit /b 1
)

echo Building browser runtime bundle...
call npm run build
if errorlevel 1 (
    echo Build failed
    exit /b 1
)

echo Browser runtime built successfully.
echo Output: dist\hypertwist-browser-runtime.umd.js
echo Copy to Content\Browser\ for UE embedded WebBrowser widget loading.
