@nathanclaire/edge-telemetry-sdk 4.0.0 → 5.0.1
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/LICENSE +21 -0
- package/README.md +185 -30
- package/dist/appLifecycle-DS_fEclk.cjs +2 -0
- package/dist/appLifecycle-DS_fEclk.cjs.map +1 -0
- package/dist/{appLifecycle-DQErzJIR.js → appLifecycle-PffQ4vC1.js} +5 -3
- package/dist/appLifecycle-PffQ4vC1.js.map +1 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs +2 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs.map +1 -0
- package/dist/autoTaps.native-DQCXevD7.js +66 -0
- package/dist/autoTaps.native-DQCXevD7.js.map +1 -0
- package/dist/crashHandler.web-6KvedEB-.cjs +2 -0
- package/dist/crashHandler.web-6KvedEB-.cjs.map +1 -0
- package/dist/crashHandler.web-BUlSXYoS.js +30 -0
- package/dist/crashHandler.web-BUlSXYoS.js.map +1 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs +2 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs.map +1 -0
- package/dist/{crashHandlerNative.native-FupMnr1U.js → crashHandlerNative.native-DsCRd-oN.js} +13 -13
- package/dist/crashHandlerNative.native-DsCRd-oN.js.map +1 -0
- package/dist/deviceInfo.native-D5gNBG7m.cjs +2 -0
- package/dist/{deviceInfo.native-BoeTZcD6.cjs.map → deviceInfo.native-D5gNBG7m.cjs.map} +1 -1
- package/dist/deviceInfo.native-DiiHrnI3.js +53 -0
- package/dist/{deviceInfo.native-BJ-3Jj1T.js.map → deviceInfo.native-DiiHrnI3.js.map} +1 -1
- package/dist/{deviceInfo.web-BFB1-pcA.js → deviceInfo.web-BHsjVveq.js} +3 -3
- package/dist/{deviceInfo.web-BFB1-pcA.js.map → deviceInfo.web-BHsjVveq.js.map} +1 -1
- package/dist/{deviceInfo.web-3L3IDQQA.cjs → deviceInfo.web-DGCUHAnv.cjs} +2 -2
- package/dist/{deviceInfo.web-3L3IDQQA.cjs.map → deviceInfo.web-DGCUHAnv.cjs.map} +1 -1
- package/dist/deviceState.native-BEysbZ6O.js +58 -0
- package/dist/deviceState.native-BEysbZ6O.js.map +1 -0
- package/dist/deviceState.native-CrQMy11_.cjs +2 -0
- package/dist/deviceState.native-CrQMy11_.cjs.map +1 -0
- package/dist/deviceState.web-ByaQm9Ry.js +14 -0
- package/dist/deviceState.web-ByaQm9Ry.js.map +1 -0
- package/dist/deviceState.web-CSfUgHDU.cjs +2 -0
- package/dist/deviceState.web-CSfUgHDU.cjs.map +1 -0
- package/dist/frameTracker-9j0en6Zm.cjs +2 -0
- package/dist/frameTracker-9j0en6Zm.cjs.map +1 -0
- package/dist/{frameTracker-DdB8W_kC.js → frameTracker-BzXnxSkb.js} +18 -19
- package/dist/frameTracker-BzXnxSkb.js.map +1 -0
- package/dist/{httpAttributes-BrrtM8zh.js → httpAttributes-BWXOr4eP.js} +1 -1
- package/dist/{httpAttributes-BrrtM8zh.js.map → httpAttributes-BWXOr4eP.js.map} +1 -1
- package/dist/{httpAttributes-D0m6UID7.cjs → httpAttributes-COY0_kiF.cjs} +1 -1
- package/dist/{httpAttributes-D0m6UID7.cjs.map → httpAttributes-COY0_kiF.cjs.map} +1 -1
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.cjs.map +1 -1
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.js +128 -71
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.cjs +1 -1
- package/dist/index.web.cjs.map +1 -1
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +51 -38
- package/dist/index.web.js.map +1 -1
- package/dist/{interactionWeb.web-CJAviVQ7.js → interactionWeb.web-BWBjmovb.js} +8 -8
- package/dist/{interactionWeb.web-CJAviVQ7.js.map → interactionWeb.web-BWBjmovb.js.map} +1 -1
- package/dist/interactionWeb.web-CKDJLD9r.cjs +2 -0
- package/dist/{interactionWeb.web-Bl_cZlgh.cjs.map → interactionWeb.web-CKDJLD9r.cjs.map} +1 -1
- package/dist/{interceptFetchWeb.web-UXC2Lb6X.js → interceptFetchWeb.web-DjSR_Rft.js} +18 -17
- package/dist/interceptFetchWeb.web-DjSR_Rft.js.map +1 -0
- package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs +2 -0
- package/dist/{interceptFetchWeb.web-UXC2Lb6X.js.map → interceptFetchWeb.web-ZHw6IQkU.cjs.map} +1 -1
- package/dist/{interceptHttpNative.native-BVpFuoNB.cjs → interceptHttpNative.native-C5scIcgY.cjs} +2 -2
- package/dist/{interceptHttpNative.native-BVpFuoNB.cjs.map → interceptHttpNative.native-C5scIcgY.cjs.map} +1 -1
- package/dist/{interceptHttpNative.native-rX-lPNST.js → interceptHttpNative.native-vF_Fksjk.js} +2 -2
- package/dist/{interceptHttpNative.native-rX-lPNST.js.map → interceptHttpNative.native-vF_Fksjk.js.map} +1 -1
- package/dist/{loadingTime-Bhomd9qq.cjs → loadingTime-Cj5Oh8lT.cjs} +1 -1
- package/dist/{loadingTime-Bhomd9qq.cjs.map → loadingTime-Cj5Oh8lT.cjs.map} +1 -1
- package/dist/{loadingTime-ZkYvFijA.js → loadingTime-DMc0zTY8.js} +1 -1
- package/dist/{loadingTime-ZkYvFijA.js.map → loadingTime-DMc0zTY8.js.map} +1 -1
- package/dist/memoryNative.native-CK3QFVjY.cjs +2 -0
- package/dist/memoryNative.native-CK3QFVjY.cjs.map +1 -0
- package/dist/{memoryNative.native-C42h9SjK.js → memoryNative.native-DkA6f7id.js} +12 -12
- package/dist/memoryNative.native-DkA6f7id.js.map +1 -0
- package/dist/nativeSender-Dt1HLaLi.js +37 -0
- package/dist/nativeSender-Dt1HLaLi.js.map +1 -0
- package/dist/nativeSender-hCgUa7Vz.cjs +2 -0
- package/dist/nativeSender-hCgUa7Vz.cjs.map +1 -0
- package/dist/navigationRef-CVIv0aIK.js +30 -0
- package/dist/navigationRef-CVIv0aIK.js.map +1 -0
- package/dist/navigationRef-CfIbeXX8.cjs +2 -0
- package/dist/navigationRef-CfIbeXX8.cjs.map +1 -0
- package/dist/navigationWeb.web-CRHpr5zl.js +51 -0
- package/dist/navigationWeb.web-CRHpr5zl.js.map +1 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs +2 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs.map +1 -0
- package/dist/{networkChange-CUO1hRLj.cjs → networkChange-2FGIQM-N.cjs} +2 -2
- package/dist/networkChange-2FGIQM-N.cjs.map +1 -0
- package/dist/{networkChange-D39hdSb0.js → networkChange-QA0893vW.js} +2 -2
- package/dist/networkChange-QA0893vW.js.map +1 -0
- package/dist/networkInfo.native-CcJ3JVRF.js +31 -0
- package/dist/networkInfo.native-CcJ3JVRF.js.map +1 -0
- package/dist/networkInfo.native-whB2wf6a.cjs +2 -0
- package/dist/networkInfo.native-whB2wf6a.cjs.map +1 -0
- package/dist/{networkInfo.web-B2YlLNsI.js → networkInfo.web-CcUpXMUK.js} +2 -2
- package/dist/networkInfo.web-CcUpXMUK.js.map +1 -0
- package/dist/{networkInfo.web-PltJTHsy.cjs → networkInfo.web-DfO-BUFx.cjs} +2 -2
- package/dist/networkInfo.web-DfO-BUFx.cjs.map +1 -0
- package/dist/react-bqe7KPOf.cjs +4 -0
- package/dist/react-bqe7KPOf.cjs.map +1 -0
- package/dist/react-urNtDGTL.js +413 -0
- package/dist/react-urNtDGTL.js.map +1 -0
- package/dist/runtimeReady.native-CxFl1rQR.js +35 -0
- package/dist/runtimeReady.native-CxFl1rQR.js.map +1 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs +2 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs.map +1 -0
- package/dist/{runtimeReady.web-C8fdIbVR.js → runtimeReady.web-JuE239Tg.js} +2 -2
- package/dist/{runtimeReady.web-C8fdIbVR.js.map → runtimeReady.web-JuE239Tg.js.map} +1 -1
- package/dist/{runtimeReady.web-DHW682RN.cjs → runtimeReady.web-vhAJFU61.cjs} +2 -2
- package/dist/{runtimeReady.web-DHW682RN.cjs.map → runtimeReady.web-vhAJFU61.cjs.map} +1 -1
- package/dist/{seedRuntimeReady-Cz8nOKoo.js → seedRuntimeReady-BlRdf3pR.js} +2 -2
- package/dist/{seedRuntimeReady-Cz8nOKoo.js.map → seedRuntimeReady-BlRdf3pR.js.map} +1 -1
- package/dist/seedRuntimeReady-CbjqbWCd.cjs +2 -0
- package/dist/{seedRuntimeReady-BKwkBEAF.cjs.map → seedRuntimeReady-CbjqbWCd.cjs.map} +1 -1
- package/dist/src/adapters/appLifecycle.d.ts +3 -3
- package/dist/src/adapters/batch.d.ts +44 -0
- package/dist/src/adapters/crashCapture.d.ts +5 -1
- package/dist/src/adapters/deviceState.d.ts +9 -0
- package/dist/src/adapters/frameAggregate.d.ts +15 -13
- package/dist/src/adapters/frameTracker.d.ts +1 -1
- package/dist/src/adapters/hangDetector.d.ts +41 -0
- package/dist/src/adapters/manualSpans.d.ts +41 -0
- package/dist/src/adapters/native/autoTaps.native.d.ts +15 -0
- package/dist/src/adapters/native/deviceState.native.d.ts +15 -0
- package/dist/src/adapters/native/memoryNative.native.d.ts +3 -3
- package/dist/src/adapters/native/networkInfo.native.d.ts +1 -1
- package/dist/src/adapters/native/runtimeReady.native.d.ts +16 -0
- package/dist/src/adapters/navigationRef.d.ts +17 -9
- package/dist/src/adapters/networkChange.d.ts +2 -2
- package/dist/src/adapters/traceManager.d.ts +18 -5
- package/dist/src/adapters/uiInteraction.d.ts +1 -1
- package/dist/src/adapters/viewManager.d.ts +24 -8
- package/dist/src/adapters/web/deviceState.web.d.ts +10 -0
- package/dist/src/adapters/web/navigationWeb.web.d.ts +6 -10
- package/dist/src/adapters/web/webVitals.web.d.ts +7 -0
- package/dist/src/adapters/xhrIntercept.d.ts +2 -0
- package/dist/src/core/breadcrumbs.d.ts +10 -0
- package/dist/src/core/telemetry.d.ts +139 -29
- package/dist/src/core/userProfile.d.ts +7 -0
- package/dist/src/createTelemetry.native.d.ts +3 -1
- package/dist/src/createTelemetry.web.d.ts +2 -1
- package/dist/src/golden.helper.d.ts +4 -0
- package/dist/src/index.base.d.ts +80 -6
- package/dist/src/index.native.d.ts +4 -61
- package/dist/src/index.web.d.ts +4 -51
- package/dist/src/react.d.ts +45 -0
- package/dist/src/telemetryNative.native.d.ts +79 -0
- package/dist/src/telemetryWeb.web.d.ts +59 -0
- package/dist/{store.native-TPqXngmF.cjs → store.native-BbS76uWV.cjs} +1 -1
- package/dist/{store.native-TPqXngmF.cjs.map → store.native-BbS76uWV.cjs.map} +1 -1
- package/dist/{store.native-BYBJcy6o.js → store.native-MlWyGgBp.js} +1 -1
- package/dist/{store.native-BYBJcy6o.js.map → store.native-MlWyGgBp.js.map} +1 -1
- package/dist/{store.web-CvqqN-_Z.cjs → store.web-BzKaP57Z.cjs} +1 -1
- package/dist/{store.web-CvqqN-_Z.cjs.map → store.web-BzKaP57Z.cjs.map} +1 -1
- package/dist/{store.web-DJAlN0nc.js → store.web-rhh0NOfs.js} +1 -1
- package/dist/{store.web-DJAlN0nc.js.map → store.web-rhh0NOfs.js.map} +1 -1
- package/dist/telemetry-60sfWkh0.js +1754 -0
- package/dist/telemetry-60sfWkh0.js.map +1 -0
- package/dist/telemetry-CW63glwb.cjs +2 -0
- package/dist/telemetry-CW63glwb.cjs.map +1 -0
- package/dist/{uiInteraction-DAqxxz0q.js → uiInteraction-BIDOMcrL.js} +39 -34
- package/dist/{uiInteraction-DAqxxz0q.js.map → uiInteraction-BIDOMcrL.js.map} +1 -1
- package/dist/uiInteraction-DxlwCVSn.cjs +2 -0
- package/dist/{uiInteraction-CdzvEI1p.cjs.map → uiInteraction-DxlwCVSn.cjs.map} +1 -1
- package/dist/{viewport-Dd85GUNO.cjs → viewport-9JcVIXYF.cjs} +1 -1
- package/dist/{viewport-Dd85GUNO.cjs.map → viewport-9JcVIXYF.cjs.map} +1 -1
- package/dist/{viewport-Dzmt5QwK.js → viewport-GWTEBt2K.js} +1 -1
- package/dist/{viewport-Dzmt5QwK.js.map → viewport-GWTEBt2K.js.map} +1 -1
- package/dist/{web-vitals.attribution-CVCPiX-h.cjs → web-vitals.attribution-DAvBvdng.cjs} +1 -1
- package/dist/{web-vitals.attribution-CVCPiX-h.cjs.map → web-vitals.attribution-DAvBvdng.cjs.map} +1 -1
- package/dist/{web-vitals.attribution-xw9N5MKQ.js → web-vitals.attribution-DcoMtvlY.js} +1 -1
- package/dist/{web-vitals.attribution-xw9N5MKQ.js.map → web-vitals.attribution-DcoMtvlY.js.map} +1 -1
- package/dist/webSender-DA087xb5.cjs +2 -0
- package/dist/webSender-DA087xb5.cjs.map +1 -0
- package/dist/webSender-g4rs5TIg.js +44 -0
- package/dist/webSender-g4rs5TIg.js.map +1 -0
- package/dist/{webVitals.web-CNIpsKlA.js → webVitals.web-DRTDK6s5.js} +39 -24
- package/dist/webVitals.web-DRTDK6s5.js.map +1 -0
- package/dist/webVitals.web-DvScDIjX.cjs +2 -0
- package/dist/webVitals.web-DvScDIjX.cjs.map +1 -0
- package/dist/{xhrIntercept-BNiA41Mj.js → xhrIntercept-9uAkQh3N.js} +16 -14
- package/dist/xhrIntercept-9uAkQh3N.js.map +1 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs +2 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs.map +1 -0
- package/docs/migration-v4.md +1 -1
- package/docs/migration-v5.md +178 -0
- package/package.json +12 -4
- package/dist/appLifecycle-CECgRVu_.cjs +0 -2
- package/dist/appLifecycle-CECgRVu_.cjs.map +0 -1
- package/dist/appLifecycle-DQErzJIR.js.map +0 -1
- package/dist/batch-CwoO7noL.js +0 -56
- package/dist/batch-CwoO7noL.js.map +0 -1
- package/dist/batch-DNu8Xr9T.cjs +0 -2
- package/dist/batch-DNu8Xr9T.cjs.map +0 -1
- package/dist/crashCapture-BOJ8nSAZ.cjs +0 -4
- package/dist/crashCapture-BOJ8nSAZ.cjs.map +0 -1
- package/dist/crashCapture-BW8WuyaU.js +0 -70
- package/dist/crashCapture-BW8WuyaU.js.map +0 -1
- package/dist/crashHandler.web-8F_k2veo.js +0 -29
- package/dist/crashHandler.web-8F_k2veo.js.map +0 -1
- package/dist/crashHandler.web-CWmF56mJ.cjs +0 -2
- package/dist/crashHandler.web-CWmF56mJ.cjs.map +0 -1
- package/dist/crashHandlerNative.native-C2kSikDt.cjs +0 -2
- package/dist/crashHandlerNative.native-C2kSikDt.cjs.map +0 -1
- package/dist/crashHandlerNative.native-FupMnr1U.js.map +0 -1
- package/dist/deviceInfo.native-BJ-3Jj1T.js +0 -53
- package/dist/deviceInfo.native-BoeTZcD6.cjs +0 -2
- package/dist/frameTracker-CHG6sIx9.cjs +0 -2
- package/dist/frameTracker-CHG6sIx9.cjs.map +0 -1
- package/dist/frameTracker-DdB8W_kC.js.map +0 -1
- package/dist/index-BtLlV1HA.js +0 -57
- package/dist/index-BtLlV1HA.js.map +0 -1
- package/dist/index-C2XQ-EYw.js +0 -1122
- package/dist/index-C2XQ-EYw.js.map +0 -1
- package/dist/index-CXsVZY35.cjs +0 -2
- package/dist/index-CXsVZY35.cjs.map +0 -1
- package/dist/index-DLquF88M.cjs +0 -2
- package/dist/index-DLquF88M.cjs.map +0 -1
- package/dist/interactionWeb.web-Bl_cZlgh.cjs +0 -2
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs +0 -2
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs.map +0 -1
- package/dist/memoryNative.native-C42h9SjK.js.map +0 -1
- package/dist/memoryNative.native-CA-7w9w1.cjs +0 -2
- package/dist/memoryNative.native-CA-7w9w1.cjs.map +0 -1
- package/dist/memoryStore-BIGZmmfD.cjs +0 -2
- package/dist/memoryStore-BIGZmmfD.cjs.map +0 -1
- package/dist/memoryStore-F5I-GQKM.js +0 -193
- package/dist/memoryStore-F5I-GQKM.js.map +0 -1
- package/dist/nativeSender-CfQaRuDK.cjs +0 -2
- package/dist/nativeSender-CfQaRuDK.cjs.map +0 -1
- package/dist/nativeSender-pgVSIv-X.js +0 -59
- package/dist/nativeSender-pgVSIv-X.js.map +0 -1
- package/dist/navigationRef-BzYbs8cm.js +0 -28
- package/dist/navigationRef-BzYbs8cm.js.map +0 -1
- package/dist/navigationRef-C-_qhb43.cjs +0 -2
- package/dist/navigationRef-C-_qhb43.cjs.map +0 -1
- package/dist/navigationTracker-BmywA_Bg.js +0 -19
- package/dist/navigationTracker-BmywA_Bg.js.map +0 -1
- package/dist/navigationTracker-HkwVyywz.cjs +0 -2
- package/dist/navigationTracker-HkwVyywz.cjs.map +0 -1
- package/dist/navigationWeb.web-CW_z7Ca4.cjs +0 -2
- package/dist/navigationWeb.web-CW_z7Ca4.cjs.map +0 -1
- package/dist/navigationWeb.web-CcwgKuIZ.js +0 -55
- package/dist/navigationWeb.web-CcwgKuIZ.js.map +0 -1
- package/dist/networkChange-CUO1hRLj.cjs.map +0 -1
- package/dist/networkChange-D39hdSb0.js.map +0 -1
- package/dist/networkInfo.native-CGrx9cnH.js +0 -343
- package/dist/networkInfo.native-CGrx9cnH.js.map +0 -1
- package/dist/networkInfo.native-YVySdv3S.cjs +0 -2
- package/dist/networkInfo.native-YVySdv3S.cjs.map +0 -1
- package/dist/networkInfo.web-B2YlLNsI.js.map +0 -1
- package/dist/networkInfo.web-PltJTHsy.cjs.map +0 -1
- package/dist/runtimeReady.native-Bh7EcYmK.js +0 -14
- package/dist/runtimeReady.native-Bh7EcYmK.js.map +0 -1
- package/dist/runtimeReady.native-jUmuE1lV.cjs +0 -2
- package/dist/runtimeReady.native-jUmuE1lV.cjs.map +0 -1
- package/dist/seedRuntimeReady-BKwkBEAF.cjs +0 -2
- package/dist/src/adapters/navigationTracker.d.ts +0 -6
- package/dist/src/adapters/screenTiming.d.ts +0 -15
- package/dist/telemetry-ByDJIz_9.js +0 -1280
- package/dist/telemetry-ByDJIz_9.js.map +0 -1
- package/dist/telemetry-CrU7i1Jc.cjs +0 -2
- package/dist/telemetry-CrU7i1Jc.cjs.map +0 -1
- package/dist/uiInteraction-CdzvEI1p.cjs +0 -2
- package/dist/webSender-BIwslfpT.js +0 -63
- package/dist/webSender-BIwslfpT.js.map +0 -1
- package/dist/webSender-CVtE4sOF.cjs +0 -2
- package/dist/webSender-CVtE4sOF.cjs.map +0 -1
- package/dist/webVitals.web-CNIpsKlA.js.map +0 -1
- package/dist/webVitals.web-DpWJ-iYp.cjs +0 -2
- package/dist/webVitals.web-DpWJ-iYp.cjs.map +0 -1
- package/dist/xhrIntercept-BADex6Cq.cjs +0 -2
- package/dist/xhrIntercept-BADex6Cq.cjs.map +0 -1
- package/dist/xhrIntercept-BNiA41Mj.js.map +0 -1
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { useState as S, useEffect as H, useCallback as U } from "react";
|
|
2
|
-
import { NativeEventEmitter as A, Platform as M } from "react-native";
|
|
3
|
-
import { N as q } from "./networkChange-D39hdSb0.js";
|
|
4
|
-
const E = {
|
|
5
|
-
reachabilityUrl: "/",
|
|
6
|
-
reachabilityMethod: "HEAD",
|
|
7
|
-
reachabilityHeaders: {},
|
|
8
|
-
reachabilityTest: (t) => Promise.resolve(t.status === 200),
|
|
9
|
-
reachabilityShortTimeout: 5 * 1e3,
|
|
10
|
-
// 5s
|
|
11
|
-
reachabilityLongTimeout: 60 * 1e3,
|
|
12
|
-
// 60s
|
|
13
|
-
reachabilityRequestTimeout: 15 * 1e3,
|
|
14
|
-
// 15s
|
|
15
|
-
reachabilityShouldRun: () => !0,
|
|
16
|
-
shouldFetchWiFiSSID: !0,
|
|
17
|
-
useNativeReachability: !0
|
|
18
|
-
}, p = "netInfo.networkStatusDidChange";
|
|
19
|
-
let r;
|
|
20
|
-
(function(t) {
|
|
21
|
-
t.unknown = "unknown", t.none = "none", t.cellular = "cellular", t.wifi = "wifi", t.bluetooth = "bluetooth", t.ethernet = "ethernet", t.wimax = "wimax", t.vpn = "vpn", t.other = "other";
|
|
22
|
-
})(r || (r = {}));
|
|
23
|
-
let f;
|
|
24
|
-
(function(t) {
|
|
25
|
-
t["2g"] = "2g", t["3g"] = "3g", t["4g"] = "4g", t["5g"] = "5g";
|
|
26
|
-
})(f || (f = {}));
|
|
27
|
-
const y = typeof window < "u", u = y && !window.hasOwnProperty("tizen") && !window.hasOwnProperty("webOS") ? window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection : void 0, F = {
|
|
28
|
-
bluetooth: r.bluetooth,
|
|
29
|
-
cellular: r.cellular,
|
|
30
|
-
ethernet: r.ethernet,
|
|
31
|
-
none: r.none,
|
|
32
|
-
other: r.other,
|
|
33
|
-
unknown: r.unknown,
|
|
34
|
-
wifi: r.wifi,
|
|
35
|
-
wimax: r.wimax,
|
|
36
|
-
mixed: r.other
|
|
37
|
-
}, V = {
|
|
38
|
-
"2g": f["2g"],
|
|
39
|
-
"3g": f["3g"],
|
|
40
|
-
"4g": f["4g"],
|
|
41
|
-
"slow-2g": f["2g"]
|
|
42
|
-
}, k = (t) => {
|
|
43
|
-
const i = y ? navigator.onLine : !1, e = {
|
|
44
|
-
isInternetReachable: null
|
|
45
|
-
};
|
|
46
|
-
if (!u)
|
|
47
|
-
return i ? {
|
|
48
|
-
...e,
|
|
49
|
-
isConnected: !0,
|
|
50
|
-
type: r.other,
|
|
51
|
-
details: {
|
|
52
|
-
isConnectionExpensive: !1
|
|
53
|
-
}
|
|
54
|
-
} : {
|
|
55
|
-
...e,
|
|
56
|
-
isConnected: !1,
|
|
57
|
-
isInternetReachable: !1,
|
|
58
|
-
type: r.none,
|
|
59
|
-
details: null
|
|
60
|
-
};
|
|
61
|
-
const n = u.saveData, s = u.type ? F[u.type] : i ? r.other : r.unknown;
|
|
62
|
-
return s === r.bluetooth ? {
|
|
63
|
-
...e,
|
|
64
|
-
isConnected: !0,
|
|
65
|
-
type: s,
|
|
66
|
-
details: {
|
|
67
|
-
isConnectionExpensive: n
|
|
68
|
-
}
|
|
69
|
-
} : s === r.cellular ? {
|
|
70
|
-
...e,
|
|
71
|
-
isConnected: !0,
|
|
72
|
-
type: s,
|
|
73
|
-
details: {
|
|
74
|
-
isConnectionExpensive: n,
|
|
75
|
-
cellularGeneration: V[u.effectiveType] || null,
|
|
76
|
-
carrier: null
|
|
77
|
-
}
|
|
78
|
-
} : s === r.ethernet ? {
|
|
79
|
-
...e,
|
|
80
|
-
isConnected: !0,
|
|
81
|
-
type: s,
|
|
82
|
-
details: {
|
|
83
|
-
isConnectionExpensive: n,
|
|
84
|
-
ipAddress: null,
|
|
85
|
-
subnet: null
|
|
86
|
-
}
|
|
87
|
-
} : s === r.wifi ? {
|
|
88
|
-
...e,
|
|
89
|
-
isConnected: !0,
|
|
90
|
-
type: s,
|
|
91
|
-
details: {
|
|
92
|
-
isConnectionExpensive: n,
|
|
93
|
-
ssid: null,
|
|
94
|
-
bssid: null,
|
|
95
|
-
strength: null,
|
|
96
|
-
ipAddress: null,
|
|
97
|
-
subnet: null,
|
|
98
|
-
frequency: null,
|
|
99
|
-
linkSpeed: null,
|
|
100
|
-
rxLinkSpeed: null,
|
|
101
|
-
txLinkSpeed: null
|
|
102
|
-
}
|
|
103
|
-
} : s === r.wimax ? {
|
|
104
|
-
...e,
|
|
105
|
-
isConnected: !0,
|
|
106
|
-
type: s,
|
|
107
|
-
details: {
|
|
108
|
-
isConnectionExpensive: n
|
|
109
|
-
}
|
|
110
|
-
} : s === r.none ? {
|
|
111
|
-
...e,
|
|
112
|
-
isConnected: !1,
|
|
113
|
-
isInternetReachable: !1,
|
|
114
|
-
type: s,
|
|
115
|
-
details: null
|
|
116
|
-
} : s === r.unknown ? {
|
|
117
|
-
...e,
|
|
118
|
-
isConnected: i,
|
|
119
|
-
isInternetReachable: null,
|
|
120
|
-
type: s,
|
|
121
|
-
details: null
|
|
122
|
-
} : {
|
|
123
|
-
...e,
|
|
124
|
-
isConnected: !0,
|
|
125
|
-
type: r.other,
|
|
126
|
-
details: {
|
|
127
|
-
isConnectionExpensive: n
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
}, I = [], g = [], L = {
|
|
131
|
-
addListener(t, i) {
|
|
132
|
-
switch (t) {
|
|
133
|
-
case p: {
|
|
134
|
-
const e = () => {
|
|
135
|
-
i(k());
|
|
136
|
-
};
|
|
137
|
-
u ? u.addEventListener("change", e) : y && (window.addEventListener("online", e, !1), window.addEventListener("offline", e, !1)), I.push(i), g.push(e);
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
removeListeners(t, i) {
|
|
143
|
-
switch (t) {
|
|
144
|
-
case p: {
|
|
145
|
-
const e = I.indexOf(i), n = g[e];
|
|
146
|
-
u ? u.removeEventListener("change", n) : y && (window.removeEventListener("online", n), window.removeEventListener("offline", n)), I.splice(e, 1), g.splice(e, 1);
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
async getCurrentState(t) {
|
|
152
|
-
return k();
|
|
153
|
-
},
|
|
154
|
-
configure() {
|
|
155
|
-
}
|
|
156
|
-
}, x = new A();
|
|
157
|
-
L.addListener(p, (t) => {
|
|
158
|
-
x.emit(p, t);
|
|
159
|
-
});
|
|
160
|
-
const C = {
|
|
161
|
-
...L,
|
|
162
|
-
eventEmitter: x
|
|
163
|
-
};
|
|
164
|
-
function l(t, i, e) {
|
|
165
|
-
return i in t ? Object.defineProperty(t, i, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : t[i] = e, t;
|
|
166
|
-
}
|
|
167
|
-
class z {
|
|
168
|
-
constructor(i, e) {
|
|
169
|
-
l(this, "_configuration", void 0), l(this, "_listener", void 0), l(this, "_isInternetReachable", void 0), l(this, "_currentInternetReachabilityCheckHandler", null), l(this, "_currentTimeoutHandle", null), l(this, "_setIsInternetReachable", (n) => {
|
|
170
|
-
this._isInternetReachable !== n && (this._isInternetReachable = n, this._listener(this._isInternetReachable));
|
|
171
|
-
}), l(this, "_setExpectsConnection", (n) => {
|
|
172
|
-
this._currentInternetReachabilityCheckHandler !== null && (this._currentInternetReachabilityCheckHandler.cancel(), this._currentInternetReachabilityCheckHandler = null), this._currentTimeoutHandle !== null && (clearTimeout(this._currentTimeoutHandle), this._currentTimeoutHandle = null), n && this._configuration.reachabilityShouldRun() ? (this._isInternetReachable || this._setIsInternetReachable(null), this._currentInternetReachabilityCheckHandler = this._checkInternetReachability()) : this._setIsInternetReachable(!1);
|
|
173
|
-
}), l(this, "_checkInternetReachability", () => {
|
|
174
|
-
const n = new AbortController(), s = fetch(this._configuration.reachabilityUrl, {
|
|
175
|
-
headers: this._configuration.reachabilityHeaders,
|
|
176
|
-
method: this._configuration.reachabilityMethod,
|
|
177
|
-
cache: "no-cache",
|
|
178
|
-
signal: n.signal
|
|
179
|
-
});
|
|
180
|
-
let d;
|
|
181
|
-
const o = new Promise((h, m) => {
|
|
182
|
-
d = setTimeout(() => m("timedout"), this._configuration.reachabilityRequestTimeout);
|
|
183
|
-
});
|
|
184
|
-
let b = () => {
|
|
185
|
-
};
|
|
186
|
-
const w = new Promise((h, m) => {
|
|
187
|
-
b = () => m("canceled");
|
|
188
|
-
});
|
|
189
|
-
return {
|
|
190
|
-
promise: Promise.race([s, o, w]).then((h) => this._configuration.reachabilityTest(h)).then((h) => {
|
|
191
|
-
this._setIsInternetReachable(h);
|
|
192
|
-
const m = this._isInternetReachable ? this._configuration.reachabilityLongTimeout : this._configuration.reachabilityShortTimeout;
|
|
193
|
-
this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, m);
|
|
194
|
-
}).catch((h) => {
|
|
195
|
-
h === "canceled" ? n.abort() : (h === "timedout" && n.abort(), this._setIsInternetReachable(!1), this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, this._configuration.reachabilityShortTimeout));
|
|
196
|
-
}).then(() => {
|
|
197
|
-
clearTimeout(d);
|
|
198
|
-
}, (h) => {
|
|
199
|
-
throw clearTimeout(d), h;
|
|
200
|
-
}),
|
|
201
|
-
cancel: b
|
|
202
|
-
};
|
|
203
|
-
}), l(this, "update", (n) => {
|
|
204
|
-
typeof n.isInternetReachable == "boolean" && this._configuration.useNativeReachability ? this._setIsInternetReachable(n.isInternetReachable) : this._setExpectsConnection(n.isConnected);
|
|
205
|
-
}), l(this, "currentState", () => this._isInternetReachable), l(this, "tearDown", () => {
|
|
206
|
-
this._currentInternetReachabilityCheckHandler !== null && (this._currentInternetReachabilityCheckHandler.cancel(), this._currentInternetReachabilityCheckHandler = null), this._currentTimeoutHandle !== null && (clearTimeout(this._currentTimeoutHandle), this._currentTimeoutHandle = null);
|
|
207
|
-
}), this._configuration = i, this._listener = e;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
function c(t, i, e) {
|
|
211
|
-
return i in t ? Object.defineProperty(t, i, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : t[i] = e, t;
|
|
212
|
-
}
|
|
213
|
-
class P {
|
|
214
|
-
constructor(i) {
|
|
215
|
-
c(this, "_nativeEventSubscription", null), c(this, "_subscriptions", /* @__PURE__ */ new Set()), c(this, "_latestState", null), c(this, "_internetReachability", void 0), c(this, "_handleNativeStateUpdate", (e) => {
|
|
216
|
-
this._internetReachability.update(e);
|
|
217
|
-
const n = this._convertState(e);
|
|
218
|
-
this._latestState = n, this._subscriptions.forEach((s) => s(n));
|
|
219
|
-
}), c(this, "_handleInternetReachabilityUpdate", (e) => {
|
|
220
|
-
if (!this._latestState)
|
|
221
|
-
return;
|
|
222
|
-
const n = {
|
|
223
|
-
...this._latestState,
|
|
224
|
-
isInternetReachable: e
|
|
225
|
-
};
|
|
226
|
-
this._latestState = n, this._subscriptions.forEach((s) => s(n));
|
|
227
|
-
}), c(this, "_fetchCurrentState", async (e) => {
|
|
228
|
-
const n = await C.getCurrentState(e);
|
|
229
|
-
this._internetReachability.update(n);
|
|
230
|
-
const s = this._convertState(n);
|
|
231
|
-
return e || (this._latestState = s, this._subscriptions.forEach((d) => d(s))), s;
|
|
232
|
-
}), c(this, "_convertState", (e) => typeof e.isInternetReachable == "boolean" ? e : {
|
|
233
|
-
...e,
|
|
234
|
-
isInternetReachable: this._internetReachability.currentState()
|
|
235
|
-
}), c(this, "latest", (e) => e ? this._fetchCurrentState(e) : this._latestState ? Promise.resolve(this._latestState) : this._fetchCurrentState()), c(this, "add", (e) => {
|
|
236
|
-
this._subscriptions.add(e), this._latestState ? e(this._latestState) : this.latest().then(e);
|
|
237
|
-
}), c(this, "remove", (e) => {
|
|
238
|
-
this._subscriptions.delete(e);
|
|
239
|
-
}), c(this, "tearDown", () => {
|
|
240
|
-
this._internetReachability && this._internetReachability.tearDown(), this._nativeEventSubscription && this._nativeEventSubscription.remove(), this._subscriptions.clear();
|
|
241
|
-
}), this._internetReachability = new z(i, this._handleInternetReachabilityUpdate), this._nativeEventSubscription = C.eventEmitter.addListener(p, this._handleNativeStateUpdate), this._fetchCurrentState();
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
let N = E, a = null;
|
|
245
|
-
const v = () => new P(N);
|
|
246
|
-
let _ = !1, R = [];
|
|
247
|
-
function D(t) {
|
|
248
|
-
N = {
|
|
249
|
-
...E,
|
|
250
|
-
...t
|
|
251
|
-
}, a && (a.tearDown(), a = v()), M.OS === "ios" && C.configure(t);
|
|
252
|
-
}
|
|
253
|
-
function W(t) {
|
|
254
|
-
return a || (a = v()), a.latest(t);
|
|
255
|
-
}
|
|
256
|
-
function $() {
|
|
257
|
-
return a || (a = v()), _ ? new Promise((t) => {
|
|
258
|
-
R.push(t);
|
|
259
|
-
}) : (_ = !0, a._fetchCurrentState().then((t) => (R.forEach((i) => i(t)), R = [], t)).finally(() => {
|
|
260
|
-
_ = !1;
|
|
261
|
-
}));
|
|
262
|
-
}
|
|
263
|
-
function O(t) {
|
|
264
|
-
return a || (a = v()), a.add(t), () => {
|
|
265
|
-
a && a.remove(t);
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
function Q(t) {
|
|
269
|
-
t && D(t);
|
|
270
|
-
const [i, e] = S({
|
|
271
|
-
type: r.unknown,
|
|
272
|
-
isConnected: null,
|
|
273
|
-
isInternetReachable: null,
|
|
274
|
-
details: null
|
|
275
|
-
});
|
|
276
|
-
return H(() => {
|
|
277
|
-
const n = O(e);
|
|
278
|
-
return () => n();
|
|
279
|
-
}, []), i;
|
|
280
|
-
}
|
|
281
|
-
function Y(t = !1, i) {
|
|
282
|
-
const [e, n] = S(), [s, d] = S({
|
|
283
|
-
type: r.unknown,
|
|
284
|
-
isConnected: null,
|
|
285
|
-
isInternetReachable: null,
|
|
286
|
-
details: null
|
|
287
|
-
});
|
|
288
|
-
H(() => {
|
|
289
|
-
if (t)
|
|
290
|
-
return;
|
|
291
|
-
const b = {
|
|
292
|
-
...E,
|
|
293
|
-
...i
|
|
294
|
-
}, w = new P(b);
|
|
295
|
-
return n(w), w.add(d), w.tearDown;
|
|
296
|
-
}, [t, i]);
|
|
297
|
-
const o = U(() => {
|
|
298
|
-
e && !_ && (_ = !0, e._fetchCurrentState().finally(() => {
|
|
299
|
-
_ = !1;
|
|
300
|
-
}));
|
|
301
|
-
}, [e]);
|
|
302
|
-
return {
|
|
303
|
-
netInfo: s,
|
|
304
|
-
refresh: o
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
const T = {
|
|
308
|
-
configure: D,
|
|
309
|
-
fetch: W,
|
|
310
|
-
refresh: $,
|
|
311
|
-
addEventListener: O,
|
|
312
|
-
useNetInfo: Q,
|
|
313
|
-
useNetInfoInstance: Y
|
|
314
|
-
};
|
|
315
|
-
class X {
|
|
316
|
-
constructor() {
|
|
317
|
-
}
|
|
318
|
-
async collect() {
|
|
319
|
-
try {
|
|
320
|
-
const i = await T.fetch();
|
|
321
|
-
return {
|
|
322
|
-
type: i.type,
|
|
323
|
-
is_connected: i.isConnected ?? void 0
|
|
324
|
-
};
|
|
325
|
-
} catch {
|
|
326
|
-
return { type: "unknown", is_connected: void 0 };
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* collect() feeds the steady-state Context block on every event (no standalone
|
|
331
|
-
* network_info event, ADR-0002). A connectivity *transition* is still its own
|
|
332
|
-
* v3 `network_change` event, emitted via the shared NetworkChangeEmitter.
|
|
333
|
-
*/
|
|
334
|
-
async start(i) {
|
|
335
|
-
this.telemetry = i;
|
|
336
|
-
const e = new q(i), n = await this.collect();
|
|
337
|
-
return e.onSample(n.type), T.addEventListener((s) => e.onSample(s.type)), n;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
export {
|
|
341
|
-
X as NetworkInfoTrackerNative
|
|
342
|
-
};
|
|
343
|
-
//# sourceMappingURL=networkInfo.native-CGrx9cnH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"networkInfo.native-CGrx9cnH.js","sources":["../node_modules/@react-native-community/netinfo/lib/module/internal/defaultConfiguration.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/privateTypes.js","../node_modules/@react-native-community/netinfo/lib/module/internal/types.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeModule.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeInterface.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/internetReachability.js","../node_modules/@react-native-community/netinfo/lib/module/internal/state.js","../node_modules/@react-native-community/netinfo/lib/module/index.js","../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["const DEFAULT_CONFIGURATION = {\n reachabilityUrl: '/',\n reachabilityMethod: \"HEAD\",\n reachabilityHeaders: {},\n reachabilityTest: response => Promise.resolve(response.status === 200),\n reachabilityShortTimeout: 5 * 1000,\n // 5s\n reachabilityLongTimeout: 60 * 1000,\n // 60s\n reachabilityRequestTimeout: 15 * 1000,\n // 15s\n reachabilityShouldRun: () => true,\n shouldFetchWiFiSSID: true,\n useNativeReachability: true\n};\nexport default DEFAULT_CONFIGURATION;\n//# sourceMappingURL=defaultConfiguration.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport const DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'; // Certain properties are optional when sent by the native module and are handled by the JS code\n//# sourceMappingURL=privateTypes.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport let NetInfoStateType;\n\n(function (NetInfoStateType) {\n NetInfoStateType[\"unknown\"] = \"unknown\";\n NetInfoStateType[\"none\"] = \"none\";\n NetInfoStateType[\"cellular\"] = \"cellular\";\n NetInfoStateType[\"wifi\"] = \"wifi\";\n NetInfoStateType[\"bluetooth\"] = \"bluetooth\";\n NetInfoStateType[\"ethernet\"] = \"ethernet\";\n NetInfoStateType[\"wimax\"] = \"wimax\";\n NetInfoStateType[\"vpn\"] = \"vpn\";\n NetInfoStateType[\"other\"] = \"other\";\n})(NetInfoStateType || (NetInfoStateType = {}));\n\nexport let NetInfoCellularGeneration;\n\n(function (NetInfoCellularGeneration) {\n NetInfoCellularGeneration[\"2g\"] = \"2g\";\n NetInfoCellularGeneration[\"3g\"] = \"3g\";\n NetInfoCellularGeneration[\"4g\"] = \"4g\";\n NetInfoCellularGeneration[\"5g\"] = \"5g\";\n})(NetInfoCellularGeneration || (NetInfoCellularGeneration = {}));\n//# sourceMappingURL=types.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nimport { NetInfoCellularGeneration, NetInfoStateType } from './types'; // See https://wicg.github.io/netinfo/#dom-connectiontype\n\n// Use a constant test of this form because in SSR on next.js, optional chaining is not sufficient,\n// but this test correctly detects that window is not available and allows for conditionals before access\nconst isWindowPresent = typeof window !== 'undefined'; // Check if window exists and if the browser supports the connection API\n\nconst connection = isWindowPresent && !window.hasOwnProperty('tizen') && !window.hasOwnProperty('webOS') ? window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection : undefined; // Map browser types to native types\n\nconst typeMapping = {\n bluetooth: NetInfoStateType.bluetooth,\n cellular: NetInfoStateType.cellular,\n ethernet: NetInfoStateType.ethernet,\n none: NetInfoStateType.none,\n other: NetInfoStateType.other,\n unknown: NetInfoStateType.unknown,\n wifi: NetInfoStateType.wifi,\n wimax: NetInfoStateType.wimax,\n mixed: NetInfoStateType.other\n};\nconst effectiveTypeMapping = {\n '2g': NetInfoCellularGeneration['2g'],\n '3g': NetInfoCellularGeneration['3g'],\n '4g': NetInfoCellularGeneration['4g'],\n 'slow-2g': NetInfoCellularGeneration['2g']\n}; // Determine current state of connection\n\nconst getCurrentState = _requestedInterface => {\n const isConnected = isWindowPresent ? navigator.onLine : false;\n const baseState = {\n isInternetReachable: null\n }; // If we don't have a connection object, we return minimal information\n\n if (!connection) {\n if (isConnected) {\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive: false\n }\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type: NetInfoStateType.none,\n details: null\n };\n return state;\n } // Otherwise try to return detailed information\n\n\n const isConnectionExpensive = connection.saveData;\n const type = connection.type ? typeMapping[connection.type] : isConnected ? NetInfoStateType.other : NetInfoStateType.unknown;\n\n if (type === NetInfoStateType.bluetooth) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.cellular) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n cellularGeneration: effectiveTypeMapping[connection.effectiveType] || null,\n carrier: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.ethernet) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ipAddress: null,\n subnet: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wifi) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ssid: null,\n bssid: null,\n strength: null,\n ipAddress: null,\n subnet: null,\n frequency: null,\n linkSpeed: null,\n rxLinkSpeed: null,\n txLinkSpeed: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wimax) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.none) {\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type,\n details: null\n };\n return state;\n } else if (type === NetInfoStateType.unknown) {\n const state = { ...baseState,\n isConnected,\n isInternetReachable: null,\n type,\n details: null\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n};\n\nconst handlers = [];\nconst nativeHandlers = [];\nconst RNCNetInfo = {\n addListener(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n const nativeHandler = () => {\n handler(getCurrentState());\n };\n\n if (connection) {\n connection.addEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.addEventListener('online', nativeHandler, false);\n window.addEventListener('offline', nativeHandler, false);\n }\n } // Remember handlers\n\n\n handlers.push(handler);\n nativeHandlers.push(nativeHandler);\n break;\n }\n }\n },\n\n removeListeners(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n // Get native handler\n const index = handlers.indexOf(handler);\n const nativeHandler = nativeHandlers[index];\n\n if (connection) {\n connection.removeEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.removeEventListener('online', nativeHandler);\n window.removeEventListener('offline', nativeHandler);\n }\n } // Remove handlers\n\n\n handlers.splice(index, 1);\n nativeHandlers.splice(index, 1);\n break;\n }\n }\n },\n\n async getCurrentState(requestedInterface) {\n return getCurrentState(requestedInterface);\n },\n\n configure() {\n return;\n }\n\n};\nexport default RNCNetInfo;\n//# sourceMappingURL=nativeModule.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { NativeEventEmitter } from 'react-native';\nimport RNCNetInfo from './nativeModule';\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nconst nativeEventEmitter = new NativeEventEmitter(); // Listen to connectivity events\n\nRNCNetInfo.addListener(DEVICE_CONNECTIVITY_EVENT, event => {\n nativeEventEmitter.emit(DEVICE_CONNECTIVITY_EVENT, event);\n});\nexport default { ...RNCNetInfo,\n eventEmitter: nativeEventEmitter\n};\n//# sourceMappingURL=nativeInterface.web.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport default class InternetReachability {\n constructor(configuration, listener) {\n _defineProperty(this, \"_configuration\", void 0);\n\n _defineProperty(this, \"_listener\", void 0);\n\n _defineProperty(this, \"_isInternetReachable\", undefined);\n\n _defineProperty(this, \"_currentInternetReachabilityCheckHandler\", null);\n\n _defineProperty(this, \"_currentTimeoutHandle\", null);\n\n _defineProperty(this, \"_setIsInternetReachable\", isInternetReachable => {\n if (this._isInternetReachable === isInternetReachable) {\n return;\n }\n\n this._isInternetReachable = isInternetReachable;\n\n this._listener(this._isInternetReachable);\n });\n\n _defineProperty(this, \"_setExpectsConnection\", expectsConnection => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n\n if (expectsConnection && this._configuration.reachabilityShouldRun()) {\n // If we expect a connection, start the process for finding if we have one\n // Set the state to \"null\" if it was previously false\n if (!this._isInternetReachable) {\n this._setIsInternetReachable(null);\n } // Start a network request to check for internet\n\n\n this._currentInternetReachabilityCheckHandler = this._checkInternetReachability();\n } else {\n // If we don't expect a connection or don't run reachability check, just change the state to \"false\"\n this._setIsInternetReachable(false);\n }\n });\n\n _defineProperty(this, \"_checkInternetReachability\", () => {\n const controller = new AbortController();\n const responsePromise = fetch(this._configuration.reachabilityUrl, {\n headers: this._configuration.reachabilityHeaders,\n method: this._configuration.reachabilityMethod,\n cache: 'no-cache',\n signal: controller.signal\n }); // Create promise that will reject after the request timeout has been reached\n\n let timeoutHandle;\n const timeoutPromise = new Promise((_, reject) => {\n timeoutHandle = setTimeout(() => reject('timedout'), this._configuration.reachabilityRequestTimeout);\n }); // Create promise that makes it possible to cancel a pending request through a reject\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n\n let cancel = () => {};\n\n const cancelPromise = new Promise((_, reject) => {\n cancel = () => reject('canceled');\n });\n const promise = Promise.race([responsePromise, timeoutPromise, cancelPromise]).then(response => {\n return this._configuration.reachabilityTest(response);\n }).then(result => {\n this._setIsInternetReachable(result);\n\n const nextTimeoutInterval = this._isInternetReachable ? this._configuration.reachabilityLongTimeout : this._configuration.reachabilityShortTimeout;\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, nextTimeoutInterval);\n }).catch(error => {\n if ('canceled' === error) {\n controller.abort();\n } else {\n if ('timedout' === error) {\n controller.abort();\n }\n\n this._setIsInternetReachable(false);\n\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, this._configuration.reachabilityShortTimeout);\n }\n }) // Clear request timeout and propagate any errors\n .then(() => {\n clearTimeout(timeoutHandle);\n }, error => {\n clearTimeout(timeoutHandle);\n throw error;\n });\n return {\n promise,\n cancel\n };\n });\n\n _defineProperty(this, \"update\", state => {\n if (typeof state.isInternetReachable === 'boolean' && this._configuration.useNativeReachability) {\n this._setIsInternetReachable(state.isInternetReachable);\n } else {\n this._setExpectsConnection(state.isConnected);\n }\n });\n\n _defineProperty(this, \"currentState\", () => {\n return this._isInternetReachable;\n });\n\n _defineProperty(this, \"tearDown\", () => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n });\n\n this._configuration = configuration;\n this._listener = listener;\n }\n\n}\n//# sourceMappingURL=internetReachability.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport NativeInterface from './nativeInterface';\nimport InternetReachability from './internetReachability';\nimport * as PrivateTypes from './privateTypes';\nexport default class State {\n constructor(configuration) {\n _defineProperty(this, \"_nativeEventSubscription\", null);\n\n _defineProperty(this, \"_subscriptions\", new Set());\n\n _defineProperty(this, \"_latestState\", null);\n\n _defineProperty(this, \"_internetReachability\", void 0);\n\n _defineProperty(this, \"_handleNativeStateUpdate\", state => {\n // Update the internet reachability module\n this._internetReachability.update(state); // Convert the state from native to JS shape\n\n\n const convertedState = this._convertState(state); // Update the listeners\n\n\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n });\n\n _defineProperty(this, \"_handleInternetReachabilityUpdate\", isInternetReachable => {\n if (!this._latestState) {\n return;\n }\n\n const nextState = { ...this._latestState,\n isInternetReachable\n };\n this._latestState = nextState;\n\n this._subscriptions.forEach(handler => handler(nextState));\n });\n\n _defineProperty(this, \"_fetchCurrentState\", async requestedInterface => {\n const state = await NativeInterface.getCurrentState(requestedInterface); // Update the internet reachability module\n\n this._internetReachability.update(state); // Convert and store the new state\n\n\n const convertedState = this._convertState(state);\n\n if (!requestedInterface) {\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n }\n\n return convertedState;\n });\n\n _defineProperty(this, \"_convertState\", input => {\n if (typeof input.isInternetReachable === 'boolean') {\n return input;\n } else {\n return { ...input,\n isInternetReachable: this._internetReachability.currentState()\n };\n }\n });\n\n _defineProperty(this, \"latest\", requestedInterface => {\n if (requestedInterface) {\n return this._fetchCurrentState(requestedInterface);\n } else if (this._latestState) {\n return Promise.resolve(this._latestState);\n } else {\n return this._fetchCurrentState();\n }\n });\n\n _defineProperty(this, \"add\", handler => {\n // Add the subscription handler to our set\n this._subscriptions.add(handler); // Send it the latest data we have\n\n\n if (this._latestState) {\n handler(this._latestState);\n } else {\n this.latest().then(handler);\n }\n });\n\n _defineProperty(this, \"remove\", handler => {\n this._subscriptions.delete(handler);\n });\n\n _defineProperty(this, \"tearDown\", () => {\n if (this._internetReachability) {\n this._internetReachability.tearDown();\n }\n\n if (this._nativeEventSubscription) {\n this._nativeEventSubscription.remove();\n }\n\n this._subscriptions.clear();\n });\n\n // Add the listener to the internet connectivity events\n this._internetReachability = new InternetReachability(configuration, this._handleInternetReachabilityUpdate); // Add the subscription to the native events\n\n this._nativeEventSubscription = NativeInterface.eventEmitter.addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, this._handleNativeStateUpdate); // Fetch the current state from the native module\n\n this._fetchCurrentState();\n }\n\n}\n//# sourceMappingURL=state.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { Platform } from 'react-native';\nimport DEFAULT_CONFIGURATION from './internal/defaultConfiguration';\nimport NativeInterface from './internal/nativeInterface';\nimport State from './internal/state';\nimport * as Types from './internal/types'; // Stores the currently used configuration\n\nlet _configuration = DEFAULT_CONFIGURATION; // Stores the singleton reference to the state manager\n\nlet _state = null;\n\nconst createState = () => {\n return new State(_configuration);\n}; // Track ongoing requests\n\n\nlet isRequestInProgress = false;\nlet requestQueue = [];\n/**\n * Configures the library with the given configuration. Note that calling this will stop all\n * previously added listeners from being called again. It is best to call this right when your\n * application is started to avoid issues. The configuration sets up a global singleton instance.\n *\n * @param configuration The new configuration to set.\n */\n\nexport function configure(configuration) {\n _configuration = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n\n if (_state) {\n _state.tearDown();\n\n _state = createState();\n }\n\n if (Platform.OS === 'ios') {\n NativeInterface.configure(configuration);\n }\n}\n/**\n * Returns a `Promise` that resolves to a `NetInfoState` object.\n * This function operates on the global singleton instance configured using `configure()`\n *\n * @param [requestedInterface] interface from which to obtain the information\n *\n * @returns A Promise which contains the current connection state.\n */\n\nexport function fetch(requestedInterface) {\n if (!_state) {\n _state = createState();\n }\n\n return _state.latest(requestedInterface);\n}\n/**\n * Force-refreshes the internal state of the global singleton managed by this library.\n *\n * @returns A Promise which contains the updated connection state.\n */\n\nexport function refresh() {\n if (!_state) {\n _state = createState();\n } // If a request is already in progress, return a promise that will resolve when the current request finishes\n\n\n if (isRequestInProgress) {\n return new Promise(resolve => {\n requestQueue.push(resolve);\n });\n }\n\n isRequestInProgress = true;\n return _state._fetchCurrentState().then(result => {\n requestQueue.forEach(resolve => resolve(result));\n requestQueue = [];\n return result;\n }).finally(() => {\n isRequestInProgress = false;\n });\n}\n/**\n * Subscribe to the global singleton's connection information. The callback is called with a parameter of type\n * [`NetInfoState`](README.md#netinfostate) whenever the connection state changes. Your listener\n * will be called with the latest information soon after you subscribe and then with any\n * subsequent changes afterwards. You should not assume that the listener is called in the same\n * way across devices or platforms.\n *\n * @param listener The listener which is called when the network state changes.\n *\n * @returns A function which can be called to unsubscribe.\n */\n\nexport function addEventListener(listener) {\n if (!_state) {\n _state = createState();\n }\n\n _state.add(listener);\n\n return () => {\n _state && _state.remove(listener);\n };\n}\n/**\n * A React Hook into this library's singleton which updates when the connection state changes.\n *\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns The connection state.\n */\n\nexport function useNetInfo(configuration) {\n if (configuration) {\n configure(configuration);\n }\n\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n const unsubscribe = addEventListener(setNetInfo);\n return () => unsubscribe();\n }, []);\n return netInfo;\n}\n/**\n * A React Hook which manages an isolated instance of the network info manager.\n * This is not a hook into a singleton shared state. NetInfo.configure, NetInfo.addEventListener,\n * NetInfo.fetch, NetInfo.refresh are performed on a global singleton and have no affect on this hook.\n * @param {boolean} isPaused - Pause the internal network checks.\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns the netInfo state and a refresh function\n */\n\nexport function useNetInfoInstance(isPaused = false, configuration) {\n const [networkInfoManager, setNetworkInfoManager] = useState();\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n if (isPaused) {\n return;\n }\n\n const config = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n const state = new State(config);\n setNetworkInfoManager(state);\n state.add(setNetInfo);\n return state.tearDown;\n }, [isPaused, configuration]);\n const refresh = useCallback(() => {\n if (networkInfoManager && !isRequestInProgress) {\n isRequestInProgress = true;\n\n networkInfoManager._fetchCurrentState().finally(() => {\n isRequestInProgress = false;\n });\n }\n }, [networkInfoManager]);\n return {\n netInfo,\n refresh\n };\n}\nexport * from './internal/types';\nexport default {\n configure,\n fetch,\n refresh,\n addEventListener,\n useNetInfo,\n useNetInfoInstance\n};\n//# sourceMappingURL=index.js.map","// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n is_connected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", is_connected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * v3 `network_change` event, emitted via the shared NetworkChangeEmitter.\n */\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n NetInfo.addEventListener(state => changes.onSample(state.type));\n return info;\n }\n}\n"],"names":["DEFAULT_CONFIGURATION","response","DEVICE_CONNECTIVITY_EVENT","NetInfoStateType","NetInfoCellularGeneration","isWindowPresent","connection","typeMapping","effectiveTypeMapping","getCurrentState","_requestedInterface","isConnected","baseState","isConnectionExpensive","type","handlers","nativeHandlers","RNCNetInfo","handler","nativeHandler","index","requestedInterface","nativeEventEmitter","NativeEventEmitter","event","NativeInterface","_defineProperty","obj","key","value","InternetReachability","configuration","listener","isInternetReachable","expectsConnection","controller","responsePromise","timeoutHandle","timeoutPromise","_","reject","cancel","cancelPromise","result","nextTimeoutInterval","error","state","State","convertedState","nextState","input","PrivateTypes.DEVICE_CONNECTIVITY_EVENT","_configuration","_state","createState","isRequestInProgress","requestQueue","configure","Platform","fetch","refresh","resolve","addEventListener","useNetInfo","netInfo","setNetInfo","useState","Types.NetInfoStateType","useEffect","unsubscribe","useNetInfoInstance","isPaused","networkInfoManager","setNetworkInfoManager","config","useCallback","NetInfo","NetworkInfoTrackerNative","netState","telemetry","changes","NetworkChangeEmitter","info"],"mappings":";;;AAAA,MAAMA,IAAwB;AAAA,EAC5B,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,qBAAqB,CAAA;AAAA,EACrB,kBAAkB,CAAAC,MAAY,QAAQ,QAAQA,EAAS,WAAW,GAAG;AAAA,EACrE,0B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O,EAAyB;AAAA,EAGlC,cAAc;AAAA,EAEd;AAAA,EAEA,MAAM,UAAgC;AAClC,QAAI;AACA,YAAMC,IAAW,MAAMF,EAAQ,MAAA;AAC/B,aAAO;AAAA,QACH,MAAME,EAAS;AAAA,QACf,cAAcA,EAAS,eAAe;AAAA,MAAA;AAAA,IAE9C,QAAQ;AACJ,aAAO,EAAE,MAAM,WAAW,cAAc,OAAA;AAAA,IAC5C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,MAAMC,GAA4C;AACpD,SAAK,YAAYA;AACjB,UAAMC,IAAU,IAAIC,EAAqBF,CAAS,GAC5CG,IAAO,MAAM,KAAK,QAAA;AACxB,WAAAF,EAAQ,SAASE,EAAK,IAAI,GAC1BN,EAAQ,iBAAiB,CAAA9B,MAASkC,EAAQ,SAASlC,EAAM,IAAI,CAAC,GACvDoC;AAAA,EACX;AACJ;","x_google_ignoreList":[0,1,2,3,4,5,6,7]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),H=require("react-native"),q=require("./networkChange-CUO1hRLj.cjs"),E={reachabilityUrl:"/",reachabilityMethod:"HEAD",reachabilityHeaders:{},reachabilityTest:t=>Promise.resolve(t.status===200),reachabilityShortTimeout:5*1e3,reachabilityLongTimeout:60*1e3,reachabilityRequestTimeout:15*1e3,reachabilityShouldRun:()=>!0,shouldFetchWiFiSSID:!0,useNativeReachability:!0},v="netInfo.networkStatusDidChange";let r;(function(t){t.unknown="unknown",t.none="none",t.cellular="cellular",t.wifi="wifi",t.bluetooth="bluetooth",t.ethernet="ethernet",t.wimax="wimax",t.vpn="vpn",t.other="other"})(r||(r={}));let _;(function(t){t["2g"]="2g",t["3g"]="3g",t["4g"]="4g",t["5g"]="5g"})(_||(_={}));const p=typeof window<"u",h=p&&!window.hasOwnProperty("tizen")&&!window.hasOwnProperty("webOS")?window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection:void 0,U={bluetooth:r.bluetooth,cellular:r.cellular,ethernet:r.ethernet,none:r.none,other:r.other,unknown:r.unknown,wifi:r.wifi,wimax:r.wimax,mixed:r.other},M={"2g":_["2g"],"3g":_["3g"],"4g":_["4g"],"slow-2g":_["2g"]},k=t=>{const i=p?navigator.onLine:!1,e={isInternetReachable:null};if(!h)return i?{...e,isConnected:!0,type:r.other,details:{isConnectionExpensive:!1}}:{...e,isConnected:!1,isInternetReachable:!1,type:r.none,details:null};const n=h.saveData,s=h.type?U[h.type]:i?r.other:r.unknown;return s===r.bluetooth?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n}}:s===r.cellular?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n,cellularGeneration:M[h.effectiveType]||null,carrier:null}}:s===r.ethernet?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n,ipAddress:null,subnet:null}}:s===r.wifi?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n,ssid:null,bssid:null,strength:null,ipAddress:null,subnet:null,frequency:null,linkSpeed:null,rxLinkSpeed:null,txLinkSpeed:null}}:s===r.wimax?{...e,isConnected:!0,type:s,details:{isConnectionExpensive:n}}:s===r.none?{...e,isConnected:!1,isInternetReachable:!1,type:s,details:null}:s===r.unknown?{...e,isConnected:i,isInternetReachable:null,type:s,details:null}:{...e,isConnected:!0,type:r.other,details:{isConnectionExpensive:n}}},I=[],R=[],L={addListener(t,i){switch(t){case v:{const e=()=>{i(k())};h?h.addEventListener("change",e):p&&(window.addEventListener("online",e,!1),window.addEventListener("offline",e,!1)),I.push(i),R.push(e);break}}},removeListeners(t,i){switch(t){case v:{const e=I.indexOf(i),n=R[e];h?h.removeEventListener("change",n):p&&(window.removeEventListener("online",n),window.removeEventListener("offline",n)),I.splice(e,1),R.splice(e,1);break}}},async getCurrentState(t){return k()},configure(){}},P=new H.NativeEventEmitter;L.addListener(v,t=>{P.emit(v,t)});const C={...L,eventEmitter:P};function l(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class A{constructor(i,e){l(this,"_configuration",void 0),l(this,"_listener",void 0),l(this,"_isInternetReachable",void 0),l(this,"_currentInternetReachabilityCheckHandler",null),l(this,"_currentTimeoutHandle",null),l(this,"_setIsInternetReachable",n=>{this._isInternetReachable!==n&&(this._isInternetReachable=n,this._listener(this._isInternetReachable))}),l(this,"_setExpectsConnection",n=>{this._currentInternetReachabilityCheckHandler!==null&&(this._currentInternetReachabilityCheckHandler.cancel(),this._currentInternetReachabilityCheckHandler=null),this._currentTimeoutHandle!==null&&(clearTimeout(this._currentTimeoutHandle),this._currentTimeoutHandle=null),n&&this._configuration.reachabilityShouldRun()?(this._isInternetReachable||this._setIsInternetReachable(null),this._currentInternetReachabilityCheckHandler=this._checkInternetReachability()):this._setIsInternetReachable(!1)}),l(this,"_checkInternetReachability",()=>{const n=new AbortController,s=fetch(this._configuration.reachabilityUrl,{headers:this._configuration.reachabilityHeaders,method:this._configuration.reachabilityMethod,cache:"no-cache",signal:n.signal});let d;const o=new Promise((u,y)=>{d=setTimeout(()=>y("timedout"),this._configuration.reachabilityRequestTimeout)});let w=()=>{};const m=new Promise((u,y)=>{w=()=>y("canceled")});return{promise:Promise.race([s,o,m]).then(u=>this._configuration.reachabilityTest(u)).then(u=>{this._setIsInternetReachable(u);const y=this._isInternetReachable?this._configuration.reachabilityLongTimeout:this._configuration.reachabilityShortTimeout;this._currentTimeoutHandle=setTimeout(this._checkInternetReachability,y)}).catch(u=>{u==="canceled"?n.abort():(u==="timedout"&&n.abort(),this._setIsInternetReachable(!1),this._currentTimeoutHandle=setTimeout(this._checkInternetReachability,this._configuration.reachabilityShortTimeout))}).then(()=>{clearTimeout(d)},u=>{throw clearTimeout(d),u}),cancel:w}}),l(this,"update",n=>{typeof n.isInternetReachable=="boolean"&&this._configuration.useNativeReachability?this._setIsInternetReachable(n.isInternetReachable):this._setExpectsConnection(n.isConnected)}),l(this,"currentState",()=>this._isInternetReachable),l(this,"tearDown",()=>{this._currentInternetReachabilityCheckHandler!==null&&(this._currentInternetReachabilityCheckHandler.cancel(),this._currentInternetReachabilityCheckHandler=null),this._currentTimeoutHandle!==null&&(clearTimeout(this._currentTimeoutHandle),this._currentTimeoutHandle=null)}),this._configuration=i,this._listener=e}}function c(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class x{constructor(i){c(this,"_nativeEventSubscription",null),c(this,"_subscriptions",new Set),c(this,"_latestState",null),c(this,"_internetReachability",void 0),c(this,"_handleNativeStateUpdate",e=>{this._internetReachability.update(e);const n=this._convertState(e);this._latestState=n,this._subscriptions.forEach(s=>s(n))}),c(this,"_handleInternetReachabilityUpdate",e=>{if(!this._latestState)return;const n={...this._latestState,isInternetReachable:e};this._latestState=n,this._subscriptions.forEach(s=>s(n))}),c(this,"_fetchCurrentState",async e=>{const n=await C.getCurrentState(e);this._internetReachability.update(n);const s=this._convertState(n);return e||(this._latestState=s,this._subscriptions.forEach(d=>d(s))),s}),c(this,"_convertState",e=>typeof e.isInternetReachable=="boolean"?e:{...e,isInternetReachable:this._internetReachability.currentState()}),c(this,"latest",e=>e?this._fetchCurrentState(e):this._latestState?Promise.resolve(this._latestState):this._fetchCurrentState()),c(this,"add",e=>{this._subscriptions.add(e),this._latestState?e(this._latestState):this.latest().then(e)}),c(this,"remove",e=>{this._subscriptions.delete(e)}),c(this,"tearDown",()=>{this._internetReachability&&this._internetReachability.tearDown(),this._nativeEventSubscription&&this._nativeEventSubscription.remove(),this._subscriptions.clear()}),this._internetReachability=new A(i,this._handleInternetReachabilityUpdate),this._nativeEventSubscription=C.eventEmitter.addListener(v,this._handleNativeStateUpdate),this._fetchCurrentState()}}let N=E,a=null;const g=()=>new x(N);let b=!1,S=[];function D(t){N={...E,...t},a&&(a.tearDown(),a=g()),H.Platform.OS==="ios"&&C.configure(t)}function F(t){return a||(a=g()),a.latest(t)}function $(){return a||(a=g()),b?new Promise(t=>{S.push(t)}):(b=!0,a._fetchCurrentState().then(t=>(S.forEach(i=>i(t)),S=[],t)).finally(()=>{b=!1}))}function O(t){return a||(a=g()),a.add(t),()=>{a&&a.remove(t)}}function V(t){t&&D(t);const[i,e]=f.useState({type:r.unknown,isConnected:null,isInternetReachable:null,details:null});return f.useEffect(()=>{const n=O(e);return()=>n()},[]),i}function z(t=!1,i){const[e,n]=f.useState(),[s,d]=f.useState({type:r.unknown,isConnected:null,isInternetReachable:null,details:null});f.useEffect(()=>{if(t)return;const w={...E,...i},m=new x(w);return n(m),m.add(d),m.tearDown},[t,i]);const o=f.useCallback(()=>{e&&!b&&(b=!0,e._fetchCurrentState().finally(()=>{b=!1}))},[e]);return{netInfo:s,refresh:o}}const T={configure:D,fetch:F,refresh:$,addEventListener:O,useNetInfo:V,useNetInfoInstance:z};class W{constructor(){}async collect(){try{const i=await T.fetch();return{type:i.type,is_connected:i.isConnected??void 0}}catch{return{type:"unknown",is_connected:void 0}}}async start(i){this.telemetry=i;const e=new q.NetworkChangeEmitter(i),n=await this.collect();return e.onSample(n.type),T.addEventListener(s=>e.onSample(s.type)),n}}exports.NetworkInfoTrackerNative=W;
|
|
2
|
-
//# sourceMappingURL=networkInfo.native-YVySdv3S.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"networkInfo.native-YVySdv3S.cjs","sources":["../node_modules/@react-native-community/netinfo/lib/module/internal/defaultConfiguration.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/privateTypes.js","../node_modules/@react-native-community/netinfo/lib/module/internal/types.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeModule.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeInterface.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/internetReachability.js","../node_modules/@react-native-community/netinfo/lib/module/internal/state.js","../node_modules/@react-native-community/netinfo/lib/module/index.js","../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["const DEFAULT_CONFIGURATION = {\n reachabilityUrl: '/',\n reachabilityMethod: \"HEAD\",\n reachabilityHeaders: {},\n reachabilityTest: response => Promise.resolve(response.status === 200),\n reachabilityShortTimeout: 5 * 1000,\n // 5s\n reachabilityLongTimeout: 60 * 1000,\n // 60s\n reachabilityRequestTimeout: 15 * 1000,\n // 15s\n reachabilityShouldRun: () => true,\n shouldFetchWiFiSSID: true,\n useNativeReachability: true\n};\nexport default DEFAULT_CONFIGURATION;\n//# sourceMappingURL=defaultConfiguration.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport const DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'; // Certain properties are optional when sent by the native module and are handled by the JS code\n//# sourceMappingURL=privateTypes.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport let NetInfoStateType;\n\n(function (NetInfoStateType) {\n NetInfoStateType[\"unknown\"] = \"unknown\";\n NetInfoStateType[\"none\"] = \"none\";\n NetInfoStateType[\"cellular\"] = \"cellular\";\n NetInfoStateType[\"wifi\"] = \"wifi\";\n NetInfoStateType[\"bluetooth\"] = \"bluetooth\";\n NetInfoStateType[\"ethernet\"] = \"ethernet\";\n NetInfoStateType[\"wimax\"] = \"wimax\";\n NetInfoStateType[\"vpn\"] = \"vpn\";\n NetInfoStateType[\"other\"] = \"other\";\n})(NetInfoStateType || (NetInfoStateType = {}));\n\nexport let NetInfoCellularGeneration;\n\n(function (NetInfoCellularGeneration) {\n NetInfoCellularGeneration[\"2g\"] = \"2g\";\n NetInfoCellularGeneration[\"3g\"] = \"3g\";\n NetInfoCellularGeneration[\"4g\"] = \"4g\";\n NetInfoCellularGeneration[\"5g\"] = \"5g\";\n})(NetInfoCellularGeneration || (NetInfoCellularGeneration = {}));\n//# sourceMappingURL=types.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nimport { NetInfoCellularGeneration, NetInfoStateType } from './types'; // See https://wicg.github.io/netinfo/#dom-connectiontype\n\n// Use a constant test of this form because in SSR on next.js, optional chaining is not sufficient,\n// but this test correctly detects that window is not available and allows for conditionals before access\nconst isWindowPresent = typeof window !== 'undefined'; // Check if window exists and if the browser supports the connection API\n\nconst connection = isWindowPresent && !window.hasOwnProperty('tizen') && !window.hasOwnProperty('webOS') ? window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection : undefined; // Map browser types to native types\n\nconst typeMapping = {\n bluetooth: NetInfoStateType.bluetooth,\n cellular: NetInfoStateType.cellular,\n ethernet: NetInfoStateType.ethernet,\n none: NetInfoStateType.none,\n other: NetInfoStateType.other,\n unknown: NetInfoStateType.unknown,\n wifi: NetInfoStateType.wifi,\n wimax: NetInfoStateType.wimax,\n mixed: NetInfoStateType.other\n};\nconst effectiveTypeMapping = {\n '2g': NetInfoCellularGeneration['2g'],\n '3g': NetInfoCellularGeneration['3g'],\n '4g': NetInfoCellularGeneration['4g'],\n 'slow-2g': NetInfoCellularGeneration['2g']\n}; // Determine current state of connection\n\nconst getCurrentState = _requestedInterface => {\n const isConnected = isWindowPresent ? navigator.onLine : false;\n const baseState = {\n isInternetReachable: null\n }; // If we don't have a connection object, we return minimal information\n\n if (!connection) {\n if (isConnected) {\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive: false\n }\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type: NetInfoStateType.none,\n details: null\n };\n return state;\n } // Otherwise try to return detailed information\n\n\n const isConnectionExpensive = connection.saveData;\n const type = connection.type ? typeMapping[connection.type] : isConnected ? NetInfoStateType.other : NetInfoStateType.unknown;\n\n if (type === NetInfoStateType.bluetooth) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.cellular) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n cellularGeneration: effectiveTypeMapping[connection.effectiveType] || null,\n carrier: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.ethernet) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ipAddress: null,\n subnet: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wifi) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ssid: null,\n bssid: null,\n strength: null,\n ipAddress: null,\n subnet: null,\n frequency: null,\n linkSpeed: null,\n rxLinkSpeed: null,\n txLinkSpeed: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wimax) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.none) {\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type,\n details: null\n };\n return state;\n } else if (type === NetInfoStateType.unknown) {\n const state = { ...baseState,\n isConnected,\n isInternetReachable: null,\n type,\n details: null\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n};\n\nconst handlers = [];\nconst nativeHandlers = [];\nconst RNCNetInfo = {\n addListener(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n const nativeHandler = () => {\n handler(getCurrentState());\n };\n\n if (connection) {\n connection.addEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.addEventListener('online', nativeHandler, false);\n window.addEventListener('offline', nativeHandler, false);\n }\n } // Remember handlers\n\n\n handlers.push(handler);\n nativeHandlers.push(nativeHandler);\n break;\n }\n }\n },\n\n removeListeners(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n // Get native handler\n const index = handlers.indexOf(handler);\n const nativeHandler = nativeHandlers[index];\n\n if (connection) {\n connection.removeEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.removeEventListener('online', nativeHandler);\n window.removeEventListener('offline', nativeHandler);\n }\n } // Remove handlers\n\n\n handlers.splice(index, 1);\n nativeHandlers.splice(index, 1);\n break;\n }\n }\n },\n\n async getCurrentState(requestedInterface) {\n return getCurrentState(requestedInterface);\n },\n\n configure() {\n return;\n }\n\n};\nexport default RNCNetInfo;\n//# sourceMappingURL=nativeModule.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { NativeEventEmitter } from 'react-native';\nimport RNCNetInfo from './nativeModule';\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nconst nativeEventEmitter = new NativeEventEmitter(); // Listen to connectivity events\n\nRNCNetInfo.addListener(DEVICE_CONNECTIVITY_EVENT, event => {\n nativeEventEmitter.emit(DEVICE_CONNECTIVITY_EVENT, event);\n});\nexport default { ...RNCNetInfo,\n eventEmitter: nativeEventEmitter\n};\n//# sourceMappingURL=nativeInterface.web.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport default class InternetReachability {\n constructor(configuration, listener) {\n _defineProperty(this, \"_configuration\", void 0);\n\n _defineProperty(this, \"_listener\", void 0);\n\n _defineProperty(this, \"_isInternetReachable\", undefined);\n\n _defineProperty(this, \"_currentInternetReachabilityCheckHandler\", null);\n\n _defineProperty(this, \"_currentTimeoutHandle\", null);\n\n _defineProperty(this, \"_setIsInternetReachable\", isInternetReachable => {\n if (this._isInternetReachable === isInternetReachable) {\n return;\n }\n\n this._isInternetReachable = isInternetReachable;\n\n this._listener(this._isInternetReachable);\n });\n\n _defineProperty(this, \"_setExpectsConnection\", expectsConnection => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n\n if (expectsConnection && this._configuration.reachabilityShouldRun()) {\n // If we expect a connection, start the process for finding if we have one\n // Set the state to \"null\" if it was previously false\n if (!this._isInternetReachable) {\n this._setIsInternetReachable(null);\n } // Start a network request to check for internet\n\n\n this._currentInternetReachabilityCheckHandler = this._checkInternetReachability();\n } else {\n // If we don't expect a connection or don't run reachability check, just change the state to \"false\"\n this._setIsInternetReachable(false);\n }\n });\n\n _defineProperty(this, \"_checkInternetReachability\", () => {\n const controller = new AbortController();\n const responsePromise = fetch(this._configuration.reachabilityUrl, {\n headers: this._configuration.reachabilityHeaders,\n method: this._configuration.reachabilityMethod,\n cache: 'no-cache',\n signal: controller.signal\n }); // Create promise that will reject after the request timeout has been reached\n\n let timeoutHandle;\n const timeoutPromise = new Promise((_, reject) => {\n timeoutHandle = setTimeout(() => reject('timedout'), this._configuration.reachabilityRequestTimeout);\n }); // Create promise that makes it possible to cancel a pending request through a reject\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n\n let cancel = () => {};\n\n const cancelPromise = new Promise((_, reject) => {\n cancel = () => reject('canceled');\n });\n const promise = Promise.race([responsePromise, timeoutPromise, cancelPromise]).then(response => {\n return this._configuration.reachabilityTest(response);\n }).then(result => {\n this._setIsInternetReachable(result);\n\n const nextTimeoutInterval = this._isInternetReachable ? this._configuration.reachabilityLongTimeout : this._configuration.reachabilityShortTimeout;\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, nextTimeoutInterval);\n }).catch(error => {\n if ('canceled' === error) {\n controller.abort();\n } else {\n if ('timedout' === error) {\n controller.abort();\n }\n\n this._setIsInternetReachable(false);\n\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, this._configuration.reachabilityShortTimeout);\n }\n }) // Clear request timeout and propagate any errors\n .then(() => {\n clearTimeout(timeoutHandle);\n }, error => {\n clearTimeout(timeoutHandle);\n throw error;\n });\n return {\n promise,\n cancel\n };\n });\n\n _defineProperty(this, \"update\", state => {\n if (typeof state.isInternetReachable === 'boolean' && this._configuration.useNativeReachability) {\n this._setIsInternetReachable(state.isInternetReachable);\n } else {\n this._setExpectsConnection(state.isConnected);\n }\n });\n\n _defineProperty(this, \"currentState\", () => {\n return this._isInternetReachable;\n });\n\n _defineProperty(this, \"tearDown\", () => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n });\n\n this._configuration = configuration;\n this._listener = listener;\n }\n\n}\n//# sourceMappingURL=internetReachability.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport NativeInterface from './nativeInterface';\nimport InternetReachability from './internetReachability';\nimport * as PrivateTypes from './privateTypes';\nexport default class State {\n constructor(configuration) {\n _defineProperty(this, \"_nativeEventSubscription\", null);\n\n _defineProperty(this, \"_subscriptions\", new Set());\n\n _defineProperty(this, \"_latestState\", null);\n\n _defineProperty(this, \"_internetReachability\", void 0);\n\n _defineProperty(this, \"_handleNativeStateUpdate\", state => {\n // Update the internet reachability module\n this._internetReachability.update(state); // Convert the state from native to JS shape\n\n\n const convertedState = this._convertState(state); // Update the listeners\n\n\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n });\n\n _defineProperty(this, \"_handleInternetReachabilityUpdate\", isInternetReachable => {\n if (!this._latestState) {\n return;\n }\n\n const nextState = { ...this._latestState,\n isInternetReachable\n };\n this._latestState = nextState;\n\n this._subscriptions.forEach(handler => handler(nextState));\n });\n\n _defineProperty(this, \"_fetchCurrentState\", async requestedInterface => {\n const state = await NativeInterface.getCurrentState(requestedInterface); // Update the internet reachability module\n\n this._internetReachability.update(state); // Convert and store the new state\n\n\n const convertedState = this._convertState(state);\n\n if (!requestedInterface) {\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n }\n\n return convertedState;\n });\n\n _defineProperty(this, \"_convertState\", input => {\n if (typeof input.isInternetReachable === 'boolean') {\n return input;\n } else {\n return { ...input,\n isInternetReachable: this._internetReachability.currentState()\n };\n }\n });\n\n _defineProperty(this, \"latest\", requestedInterface => {\n if (requestedInterface) {\n return this._fetchCurrentState(requestedInterface);\n } else if (this._latestState) {\n return Promise.resolve(this._latestState);\n } else {\n return this._fetchCurrentState();\n }\n });\n\n _defineProperty(this, \"add\", handler => {\n // Add the subscription handler to our set\n this._subscriptions.add(handler); // Send it the latest data we have\n\n\n if (this._latestState) {\n handler(this._latestState);\n } else {\n this.latest().then(handler);\n }\n });\n\n _defineProperty(this, \"remove\", handler => {\n this._subscriptions.delete(handler);\n });\n\n _defineProperty(this, \"tearDown\", () => {\n if (this._internetReachability) {\n this._internetReachability.tearDown();\n }\n\n if (this._nativeEventSubscription) {\n this._nativeEventSubscription.remove();\n }\n\n this._subscriptions.clear();\n });\n\n // Add the listener to the internet connectivity events\n this._internetReachability = new InternetReachability(configuration, this._handleInternetReachabilityUpdate); // Add the subscription to the native events\n\n this._nativeEventSubscription = NativeInterface.eventEmitter.addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, this._handleNativeStateUpdate); // Fetch the current state from the native module\n\n this._fetchCurrentState();\n }\n\n}\n//# sourceMappingURL=state.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { Platform } from 'react-native';\nimport DEFAULT_CONFIGURATION from './internal/defaultConfiguration';\nimport NativeInterface from './internal/nativeInterface';\nimport State from './internal/state';\nimport * as Types from './internal/types'; // Stores the currently used configuration\n\nlet _configuration = DEFAULT_CONFIGURATION; // Stores the singleton reference to the state manager\n\nlet _state = null;\n\nconst createState = () => {\n return new State(_configuration);\n}; // Track ongoing requests\n\n\nlet isRequestInProgress = false;\nlet requestQueue = [];\n/**\n * Configures the library with the given configuration. Note that calling this will stop all\n * previously added listeners from being called again. It is best to call this right when your\n * application is started to avoid issues. The configuration sets up a global singleton instance.\n *\n * @param configuration The new configuration to set.\n */\n\nexport function configure(configuration) {\n _configuration = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n\n if (_state) {\n _state.tearDown();\n\n _state = createState();\n }\n\n if (Platform.OS === 'ios') {\n NativeInterface.configure(configuration);\n }\n}\n/**\n * Returns a `Promise` that resolves to a `NetInfoState` object.\n * This function operates on the global singleton instance configured using `configure()`\n *\n * @param [requestedInterface] interface from which to obtain the information\n *\n * @returns A Promise which contains the current connection state.\n */\n\nexport function fetch(requestedInterface) {\n if (!_state) {\n _state = createState();\n }\n\n return _state.latest(requestedInterface);\n}\n/**\n * Force-refreshes the internal state of the global singleton managed by this library.\n *\n * @returns A Promise which contains the updated connection state.\n */\n\nexport function refresh() {\n if (!_state) {\n _state = createState();\n } // If a request is already in progress, return a promise that will resolve when the current request finishes\n\n\n if (isRequestInProgress) {\n return new Promise(resolve => {\n requestQueue.push(resolve);\n });\n }\n\n isRequestInProgress = true;\n return _state._fetchCurrentState().then(result => {\n requestQueue.forEach(resolve => resolve(result));\n requestQueue = [];\n return result;\n }).finally(() => {\n isRequestInProgress = false;\n });\n}\n/**\n * Subscribe to the global singleton's connection information. The callback is called with a parameter of type\n * [`NetInfoState`](README.md#netinfostate) whenever the connection state changes. Your listener\n * will be called with the latest information soon after you subscribe and then with any\n * subsequent changes afterwards. You should not assume that the listener is called in the same\n * way across devices or platforms.\n *\n * @param listener The listener which is called when the network state changes.\n *\n * @returns A function which can be called to unsubscribe.\n */\n\nexport function addEventListener(listener) {\n if (!_state) {\n _state = createState();\n }\n\n _state.add(listener);\n\n return () => {\n _state && _state.remove(listener);\n };\n}\n/**\n * A React Hook into this library's singleton which updates when the connection state changes.\n *\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns The connection state.\n */\n\nexport function useNetInfo(configuration) {\n if (configuration) {\n configure(configuration);\n }\n\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n const unsubscribe = addEventListener(setNetInfo);\n return () => unsubscribe();\n }, []);\n return netInfo;\n}\n/**\n * A React Hook which manages an isolated instance of the network info manager.\n * This is not a hook into a singleton shared state. NetInfo.configure, NetInfo.addEventListener,\n * NetInfo.fetch, NetInfo.refresh are performed on a global singleton and have no affect on this hook.\n * @param {boolean} isPaused - Pause the internal network checks.\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns the netInfo state and a refresh function\n */\n\nexport function useNetInfoInstance(isPaused = false, configuration) {\n const [networkInfoManager, setNetworkInfoManager] = useState();\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n if (isPaused) {\n return;\n }\n\n const config = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n const state = new State(config);\n setNetworkInfoManager(state);\n state.add(setNetInfo);\n return state.tearDown;\n }, [isPaused, configuration]);\n const refresh = useCallback(() => {\n if (networkInfoManager && !isRequestInProgress) {\n isRequestInProgress = true;\n\n networkInfoManager._fetchCurrentState().finally(() => {\n isRequestInProgress = false;\n });\n }\n }, [networkInfoManager]);\n return {\n netInfo,\n refresh\n };\n}\nexport * from './internal/types';\nexport default {\n configure,\n fetch,\n refresh,\n addEventListener,\n useNetInfo,\n useNetInfoInstance\n};\n//# sourceMappingURL=index.js.map","// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n is_connected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", is_connected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * v3 `network_change` event, emitted via the shared NetworkChangeEmitter.\n */\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n NetInfo.addEventListener(state => changes.onSample(state.type));\n return info;\n }\n}\n"],"names":["DEFAULT_CONFIGURATION","response","DEVICE_CONNECTIVITY_EVENT","NetInfoStateType","NetInfoCellularGeneration","isWindowPresent","connection","typeMapping","effectiveTypeMapping","getCurrentState","_requestedInterface","isConnected","baseState","isConnectionExpensive","type","handlers","nativeHandlers","RNCNetInfo","handler","nativeHandler","index","requestedInterface","nativeEventEmitter","NativeEventEmitter","event","NativeInterface","_defineProperty","obj","key","value","InternetReachability","configuration","listener","isInternetReachable","expectsConnection","controller","responsePromise","timeoutHandle","timeoutPromise","_","reject","cancel","cancelPromise","result","nextTimeoutInterval","error","state","State","convertedState","nextState","input","PrivateTypes.DEVICE_CONNECTIVITY_EVENT","_configuration","_state","createState","isRequestInProgress","requestQueue","configure","Platform","fetch","refresh","resolve","addEventListener","useNetInfo","netInfo","setNetInfo","useState","Types.NetInfoStateType","useEffect","unsubscribe","useNetInfoInstance","isPaused","networkInfoManager","setNetworkInfoManager","config","useCallback","NetInfo","NetworkInfoTrackerNative","netState","telemetry","changes","NetworkChangeEmitter","info"],"mappings":"6KAAMA,EAAwB,CAC5B,gBAAiB,IACjB,mBAAoB,OACpB,oBAAqB,CAAA,EACrB,iBAAkBC,GAAY,QAAQ,QAAQA,EAAS,SAAW,GAAG,EACrE,yBAA0B,EAAI,IAE9B,wBAAyB,GAAK,IAE9B,2BAA4B,GAAK,IAEjC,sBAAuB,IAAM,GAC7B,oBAAqB,GACrB,sBAAuB,EACzB,ECNaC,EAA4B,iCCAlC,IAAIC,GAEV,SAAUA,EAAkB,CAC3BA,EAAiB,QAAa,UAC9BA,EAAiB,KAAU,OAC3BA,EAAiB,SAAc,WAC/BA,EAAiB,KAAU,OAC3BA,EAAiB,UAAe,YAChCA,EAAiB,SAAc,WAC/BA,EAAiB,MAAW,QAC5BA,EAAiB,IAAS,MAC1BA,EAAiB,MAAW,OAC9B,GAAGA,IAAqBA,EAAmB,CAAA,EAAG,EAEvC,IAAIC,GAEV,SAAUA,EAA2B,CACpCA,EAA0B,IAAI,EAAI,KAClCA,EAA0B,IAAI,EAAI,KAClCA,EAA0B,IAAI,EAAI,KAClCA,EAA0B,IAAI,EAAI,IACpC,GAAGA,IAA8BA,EAA4B,CAAA,EAAG,EChBhE,MAAMC,EAAkB,OAAO,OAAW,IAEpCC,EAAaD,GAAmB,CAAC,OAAO,eAAe,OAAO,GAAK,CAAC,OAAO,eAAe,OAAO,EAAI,OAAO,UAAU,YAAc,OAAO,UAAU,eAAiB,OAAO,UAAU,iBAAmB,OAE1ME,EAAc,CAClB,UAAWJ,EAAiB,UAC5B,SAAUA,EAA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AEtBiB,EAAmB,qBAAqB,QAAQ,IAAM,CACpDjB,EAAsB,EACxB,CAAC,EAEL,EAAG,CAACiB,CAAkB,CAAC,EACvB,MAAO,CACL,QAAAR,EACA,QAAAJ,CACJ,CACA,CAEA,MAAAgB,EAAe,CACb,UAAAnB,EACF,MAAEE,EACA,QAAAC,EACA,iBAAAE,EACA,WAAAC,EACA,mBAAAO,CACF,EC3LO,MAAMO,CAAyB,CAGlC,aAAc,CAEd,CAEA,MAAM,SAAgC,CAClC,GAAI,CACA,MAAMC,EAAW,MAAMF,EAAQ,MAAA,EAC/B,MAAO,CACH,KAAME,EAAS,KACf,aAAcA,EAAS,aAAe,MAAA,CAE9C,MAAQ,CACJ,MAAO,CAAE,KAAM,UAAW,aAAc,MAAA,CAC5C,CACJ,CAOA,MAAM,MAAMC,EAA4C,CACpD,KAAK,UAAYA,EACjB,MAAMC,EAAU,IAAIC,EAAAA,qBAAqBF,CAAS,EAC5CG,EAAO,MAAM,KAAK,QAAA,EACxB,OAAAF,EAAQ,SAASE,EAAK,IAAI,EAC1BN,EAAQ,iBAAiB9B,GAASkC,EAAQ,SAASlC,EAAM,IAAI,CAAC,EACvDoC,CACX,CACJ","x_google_ignoreList":[0,1,2,3,4,5,6,7]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"networkInfo.web-B2YlLNsI.js","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n is_connected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n is_connected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own v3 `network_change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":";AAOA,eAAsBA,IAAuC;AACzD,SAAI,OAAO,YAAc,OAAe,gBAAgB,YAE7C;AAAA,IACH,MAFU,UAAkB,WAEjB,QAAQ;AAAA,IACnB,cAAc,UAAU;AAAA;AAAA;AAAA,EAAA,IAOzB;AAAA,IACH,MAAM;AAAA,IACN,cAAc,OAAO,YAAc,MAAc,UAAU,SAAS;AAAA,EAAA;AAE5E;AAEO,MAAMC,EAAsB;AAAA;AAAA,EAE/B,cAAc;AAAA,EAAE;AAAA,EAEhB,MAAM,UAAgC;AAClC,WAAOD,EAAA;AAAA,EACX;AAAA,EAIA,MAAM,MAAME,GAA4C;AAIpD,SAAK,YAAYA;AACjB,UAAMC,IAAU,IAAIC,EAAqBF,CAAS,GAC5CG,IAAO,MAAM,KAAK,QAAA;AACxB,IAAAF,EAAQ,SAASE,EAAK,IAAI;AAC1B,UAAMC,IAAS,YAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI;AAGzE,YADa,OAAO,YAAc,MAAe,UAAkB,aAAa,SAC1E,mBAAmB,UAAUM,CAAM,GACrC,OAAO,SAAW,QAClB,OAAO,iBAAiB,UAAUA,CAAM,GACxC,OAAO,iBAAiB,WAAWA,CAAM,IAEtCD;AAAA,EACX;AACJ;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"networkInfo.web-PltJTHsy.cjs","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n is_connected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n is_connected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own v3 `network_change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":"gIAOA,eAAsBA,GAAuC,CACzD,OAAI,OAAO,UAAc,KAAe,eAAgB,UAE7C,CACH,KAFU,UAAkB,WAEjB,MAAQ,UACnB,aAAc,UAAU,MAAA,EAOzB,CACH,KAAM,UACN,aAAc,OAAO,UAAc,IAAc,UAAU,OAAS,MAAA,CAE5E,CAEO,MAAMC,CAAsB,CAE/B,aAAc,CAAE,CAEhB,MAAM,SAAgC,CAClC,OAAOD,EAAA,CACX,CAIA,MAAM,MAAME,EAA4C,CAIpD,KAAK,UAAYA,EACjB,MAAMC,EAAU,IAAIC,EAAAA,qBAAqBF,CAAS,EAC5CG,EAAO,MAAM,KAAK,QAAA,EACxBF,EAAQ,SAASE,EAAK,IAAI,EAC1B,MAAMC,EAAS,SAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI,EAGzE,OADa,OAAO,UAAc,IAAe,UAAkB,WAAa,SAC1E,mBAAmB,SAAUM,CAAM,EACrC,OAAO,OAAW,MAClB,OAAO,iBAAiB,SAAUA,CAAM,EACxC,OAAO,iBAAiB,UAAWA,CAAM,GAEtCD,CACX,CACJ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function t() {
|
|
2
|
-
const e = globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;
|
|
3
|
-
return typeof e == "number" && e > 0 ? e : void 0;
|
|
4
|
-
}
|
|
5
|
-
async function i() {
|
|
6
|
-
const n = t();
|
|
7
|
-
return n !== void 0 ? n : (await new Promise((e) => {
|
|
8
|
-
setTimeout(e, 0)?.unref?.();
|
|
9
|
-
}), t());
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
i as runtimeReadyAt
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=runtimeReady.native-Bh7EcYmK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeReady.native-Bh7EcYmK.js","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\n/** Epoch ms of \"bundle evaluated\", or undefined where the runtime does not publish it. */\ntype StartupTiming = { executeJavaScriptBundleEntryPointEnd?: unknown };\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n const perf = (globalThis as { performance?: { rnStartupTiming?: StartupTiming } }).performance;\n const end = perf?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;\n return typeof end === \"number\" && end > 0 ? end : undefined;\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n"],"names":["read","end","runtimeReadyAt","early","resolve"],"mappings":"AAYA,SAASA,IAA2B;AAIhC,QAAMC,IADQ,WAAqE,aACjE,iBAAiB;AACnC,SAAO,OAAOA,KAAQ,YAAYA,IAAM,IAAIA,IAAM;AACtD;AAEA,eAAsBC,IAA8C;AAChE,QAAMC,IAAQH,EAAA;AACd,SAAIG,MAAU,SAAkBA,KAMhC,MAAM,IAAI,QAAc,CAACC,MAAY;AAEhC,IADa,WAAWA,GAAS,CAAC,GACA,QAAA;AAAA,EACvC,CAAC,GACMJ,EAAA;AACX;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(){const e=globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;return typeof e=="number"&&e>0?e:void 0}async function r(){const t=n();return t!==void 0?t:(await new Promise(e=>{setTimeout(e,0)?.unref?.()}),n())}exports.runtimeReadyAt=r;
|
|
2
|
-
//# sourceMappingURL=runtimeReady.native-jUmuE1lV.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeReady.native-jUmuE1lV.cjs","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\n/** Epoch ms of \"bundle evaluated\", or undefined where the runtime does not publish it. */\ntype StartupTiming = { executeJavaScriptBundleEntryPointEnd?: unknown };\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n const perf = (globalThis as { performance?: { rnStartupTiming?: StartupTiming } }).performance;\n const end = perf?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;\n return typeof end === \"number\" && end > 0 ? end : undefined;\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n"],"names":["read","end","runtimeReadyAt","early","resolve"],"mappings":"gFAYA,SAASA,GAA2B,CAIhC,MAAMC,EADQ,WAAqE,aACjE,iBAAiB,qCACnC,OAAO,OAAOA,GAAQ,UAAYA,EAAM,EAAIA,EAAM,MACtD,CAEA,eAAsBC,GAA8C,CAChE,MAAMC,EAAQH,EAAA,EACd,OAAIG,IAAU,OAAkBA,GAMhC,MAAM,IAAI,QAAeC,GAAY,CACnB,WAAWA,EAAS,CAAC,GACA,QAAA,CACvC,CAAC,EACMJ,EAAA,EACX"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./memoryStore-BIGZmmfD.cjs");function a(t,r,d){Promise.resolve().then(r).then(e=>t.seedRuntimeReady(e)).catch(e=>{n.debug.warn(`${d} runtime-ready marker unavailable:`,e),t.seedRuntimeReady(void 0)})}exports.seedRuntimeReady=a;
|
|
2
|
-
//# sourceMappingURL=seedRuntimeReady-BKwkBEAF.cjs.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Telemetry } from '../core/telemetry';
|
|
2
|
-
export declare class ScreenTimingTracker {
|
|
3
|
-
private telemetry;
|
|
4
|
-
private startTimes;
|
|
5
|
-
private lastScreen?;
|
|
6
|
-
constructor(telemetry: Telemetry);
|
|
7
|
-
startScreen(screen: string): Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
* Arm the dwell clock without emitting `navigation`. The route-change path (§4.11) has
|
|
10
|
-
* already emitted its own `navigation` with `method: "push"`, and emitting a second one
|
|
11
|
-
* with `method: "screen_start"` for the same transition would double the table.
|
|
12
|
-
*/
|
|
13
|
-
markStart(screen: string): void;
|
|
14
|
-
endScreen(screen: string): Promise<void>;
|
|
15
|
-
}
|