import React, { Ref, useCallback, useEffect, useLayoutEffect, useRef } from 'react'; import { launchSplash } from '../../plugins/launchSplash'; import { attachMascotVideo, detachMascotVideo, mascotVideoReady, } from './mascotSingleton'; import * as css from './styles.css'; type AuthMascotProps = { mascotRef?: Ref; // True for the splash-gate variant (cold start, sync wait): mascot is // centered both axes to mirror the Android 12+ system splash icon, so the // native → WebView → web-splash handoff reads as one continuous splash. // False (default) keeps the auth-page positioning (top-anchored) used by // login / register / reset-password. centered?: boolean; }; export function AuthMascot({ mascotRef, centered }: AuthMascotProps) { const containerRef = useRef(null); const didSignalLaunchReadyRef = useRef(false); // Singleton