{ "version": 3, "sources": ["../../../lib.web.lazy_load/suspense.tsx"], "sourcesContent": ["/**\n * Support for lazy loading using React.lazy and React.Suspense.\n */\nimport React from \"react\"\nimport {LoadingIndicator} from \"./loading_indicator\"\n\n/**\n * @param mode if `eager_load` is given then the module will start loading in a few seconds. This\n * helps preventing flickering and short delays on first render.\n */\nexport function React_lazy(mod: () => Promise<{default: any}>, mode?: \"eager_load\") {\n if (mode === \"eager_load\") {\n let m: any = undefined\n setTimeout(() => (m = mod()), 8000 + Math.ceil(Math.random() * 8000))\n return React.lazy(() => m ?? mod())\n }\n return React.lazy(mod)\n}\n\nexport const React_suspense = ({children}: {children: any}) => {\n return <React.Suspense fallback={<LoadingIndicator delay={1000} />}>{children}</React.Suspense>\n}\n"], "mappings": "+HAGAA,IAOO,SAASC,EAAWC,EAAoCC,EAAqB,CAChF,GAAIA,IAAS,aAAc,CACvB,IAAIC,EACJ,kBAAW,IAAOA,EAAIF,EAAI,EAAI,IAAO,KAAK,KAAK,KAAK,OAAO,EAAI,GAAI,CAAC,EAC7DG,EAAM,KAAK,IAAMD,GAAKF,EAAI,CAAC,CACtC,CACA,OAAOG,EAAM,KAAKH,CAAG,CACzB,CAPgBI,EAAAL,EAAA,cAST,IAAMM,EAAiBD,EAAA,CAAC,CAAC,SAAAE,CAAQ,IAC7BH,EAAA,cAACA,EAAM,SAAN,CAAe,SAAUA,EAAA,cAACI,EAAA,CAAiB,MAAO,IAAM,GAAKD,CAAS,EADpD", "names": ["init_compat_module", "React_lazy", "mod", "mode", "m", "Rn", "__name", "React_suspense", "children", "LoadingIndicator"] }