@nathanclaire/edge-telemetry-sdk 3.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.
Files changed (319) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +985 -185
  3. package/dist/appLifecycle-DS_fEclk.cjs +2 -0
  4. package/dist/appLifecycle-DS_fEclk.cjs.map +1 -0
  5. package/dist/appLifecycle-PffQ4vC1.js +24 -0
  6. package/dist/appLifecycle-PffQ4vC1.js.map +1 -0
  7. package/dist/autoTaps.native-By9I4Kr2.cjs +2 -0
  8. package/dist/autoTaps.native-By9I4Kr2.cjs.map +1 -0
  9. package/dist/autoTaps.native-DQCXevD7.js +66 -0
  10. package/dist/autoTaps.native-DQCXevD7.js.map +1 -0
  11. package/dist/crashHandler.web-6KvedEB-.cjs +2 -0
  12. package/dist/crashHandler.web-6KvedEB-.cjs.map +1 -0
  13. package/dist/crashHandler.web-BUlSXYoS.js +30 -0
  14. package/dist/crashHandler.web-BUlSXYoS.js.map +1 -0
  15. package/dist/crashHandlerNative.native-CFVQ5UcO.cjs +2 -0
  16. package/dist/crashHandlerNative.native-CFVQ5UcO.cjs.map +1 -0
  17. package/dist/crashHandlerNative.native-DsCRd-oN.js +39 -0
  18. package/dist/crashHandlerNative.native-DsCRd-oN.js.map +1 -0
  19. package/dist/deviceInfo.native-D5gNBG7m.cjs +2 -0
  20. package/dist/deviceInfo.native-D5gNBG7m.cjs.map +1 -0
  21. package/dist/deviceInfo.native-DiiHrnI3.js +53 -0
  22. package/dist/deviceInfo.native-DiiHrnI3.js.map +1 -0
  23. package/dist/deviceInfo.web-BHsjVveq.js +41 -0
  24. package/dist/deviceInfo.web-BHsjVveq.js.map +1 -0
  25. package/dist/deviceInfo.web-DGCUHAnv.cjs +2 -0
  26. package/dist/deviceInfo.web-DGCUHAnv.cjs.map +1 -0
  27. package/dist/deviceState.native-BEysbZ6O.js +58 -0
  28. package/dist/deviceState.native-BEysbZ6O.js.map +1 -0
  29. package/dist/deviceState.native-CrQMy11_.cjs +2 -0
  30. package/dist/deviceState.native-CrQMy11_.cjs.map +1 -0
  31. package/dist/deviceState.web-ByaQm9Ry.js +14 -0
  32. package/dist/deviceState.web-ByaQm9Ry.js.map +1 -0
  33. package/dist/deviceState.web-CSfUgHDU.cjs +2 -0
  34. package/dist/deviceState.web-CSfUgHDU.cjs.map +1 -0
  35. package/dist/frameTracker-9j0en6Zm.cjs +2 -0
  36. package/dist/frameTracker-9j0en6Zm.cjs.map +1 -0
  37. package/dist/frameTracker-BzXnxSkb.js +53 -0
  38. package/dist/frameTracker-BzXnxSkb.js.map +1 -0
  39. package/dist/httpAttributes-BWXOr4eP.js +70 -0
  40. package/dist/httpAttributes-BWXOr4eP.js.map +1 -0
  41. package/dist/httpAttributes-COY0_kiF.cjs +2 -0
  42. package/dist/httpAttributes-COY0_kiF.cjs.map +1 -0
  43. package/dist/index.native.cjs +1 -1
  44. package/dist/index.native.cjs.map +1 -1
  45. package/dist/index.native.d.ts +1 -1
  46. package/dist/index.native.js +173 -81
  47. package/dist/index.native.js.map +1 -1
  48. package/dist/index.web.cjs +1 -1
  49. package/dist/index.web.cjs.map +1 -1
  50. package/dist/index.web.d.ts +1 -1
  51. package/dist/index.web.js +107 -39
  52. package/dist/index.web.js.map +1 -1
  53. package/dist/interactionWeb.web-BWBjmovb.js +109 -0
  54. package/dist/interactionWeb.web-BWBjmovb.js.map +1 -0
  55. package/dist/interactionWeb.web-CKDJLD9r.cjs +2 -0
  56. package/dist/interactionWeb.web-CKDJLD9r.cjs.map +1 -0
  57. package/dist/interceptFetchWeb.web-DjSR_Rft.js +62 -0
  58. package/dist/interceptFetchWeb.web-DjSR_Rft.js.map +1 -0
  59. package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs +2 -0
  60. package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs.map +1 -0
  61. package/dist/interceptHttpNative.native-C5scIcgY.cjs +2 -0
  62. package/dist/interceptHttpNative.native-C5scIcgY.cjs.map +1 -0
  63. package/dist/interceptHttpNative.native-vF_Fksjk.js +18 -0
  64. package/dist/interceptHttpNative.native-vF_Fksjk.js.map +1 -0
  65. package/dist/loadingTime-Cj5Oh8lT.cjs +2 -0
  66. package/dist/loadingTime-Cj5Oh8lT.cjs.map +1 -0
  67. package/dist/loadingTime-DMc0zTY8.js +70 -0
  68. package/dist/loadingTime-DMc0zTY8.js.map +1 -0
  69. package/dist/memoryNative.native-CK3QFVjY.cjs +2 -0
  70. package/dist/memoryNative.native-CK3QFVjY.cjs.map +1 -0
  71. package/dist/memoryNative.native-DkA6f7id.js +54 -0
  72. package/dist/memoryNative.native-DkA6f7id.js.map +1 -0
  73. package/dist/nativeSender-Dt1HLaLi.js +37 -0
  74. package/dist/nativeSender-Dt1HLaLi.js.map +1 -0
  75. package/dist/nativeSender-hCgUa7Vz.cjs +2 -0
  76. package/dist/nativeSender-hCgUa7Vz.cjs.map +1 -0
  77. package/dist/navigationRef-CVIv0aIK.js +30 -0
  78. package/dist/navigationRef-CVIv0aIK.js.map +1 -0
  79. package/dist/navigationRef-CfIbeXX8.cjs +2 -0
  80. package/dist/navigationRef-CfIbeXX8.cjs.map +1 -0
  81. package/dist/navigationWeb.web-CRHpr5zl.js +51 -0
  82. package/dist/navigationWeb.web-CRHpr5zl.js.map +1 -0
  83. package/dist/navigationWeb.web-DwWjL80b.cjs +2 -0
  84. package/dist/navigationWeb.web-DwWjL80b.cjs.map +1 -0
  85. package/dist/{networkChange-CUO1hRLj.cjs → networkChange-2FGIQM-N.cjs} +2 -2
  86. package/dist/networkChange-2FGIQM-N.cjs.map +1 -0
  87. package/dist/{networkChange-D39hdSb0.js → networkChange-QA0893vW.js} +2 -2
  88. package/dist/networkChange-QA0893vW.js.map +1 -0
  89. package/dist/networkInfo.native-CcJ3JVRF.js +31 -0
  90. package/dist/networkInfo.native-CcJ3JVRF.js.map +1 -0
  91. package/dist/networkInfo.native-whB2wf6a.cjs +2 -0
  92. package/dist/networkInfo.native-whB2wf6a.cjs.map +1 -0
  93. package/dist/{networkInfo.web-twcNn_hc.js → networkInfo.web-CcUpXMUK.js} +4 -4
  94. package/dist/networkInfo.web-CcUpXMUK.js.map +1 -0
  95. package/dist/networkInfo.web-DfO-BUFx.cjs +2 -0
  96. package/dist/networkInfo.web-DfO-BUFx.cjs.map +1 -0
  97. package/dist/react-bqe7KPOf.cjs +4 -0
  98. package/dist/react-bqe7KPOf.cjs.map +1 -0
  99. package/dist/react-urNtDGTL.js +413 -0
  100. package/dist/react-urNtDGTL.js.map +1 -0
  101. package/dist/runtimeReady.native-CxFl1rQR.js +35 -0
  102. package/dist/runtimeReady.native-CxFl1rQR.js.map +1 -0
  103. package/dist/runtimeReady.native-zueSbsEv.cjs +2 -0
  104. package/dist/runtimeReady.native-zueSbsEv.cjs.map +1 -0
  105. package/dist/runtimeReady.web-JuE239Tg.js +25 -0
  106. package/dist/runtimeReady.web-JuE239Tg.js.map +1 -0
  107. package/dist/runtimeReady.web-vhAJFU61.cjs +2 -0
  108. package/dist/runtimeReady.web-vhAJFU61.cjs.map +1 -0
  109. package/dist/seedRuntimeReady-BlRdf3pR.js +10 -0
  110. package/dist/seedRuntimeReady-BlRdf3pR.js.map +1 -0
  111. package/dist/seedRuntimeReady-CbjqbWCd.cjs +2 -0
  112. package/dist/seedRuntimeReady-CbjqbWCd.cjs.map +1 -0
  113. package/dist/src/adapters/appLifecycle.d.ts +11 -4
  114. package/dist/src/adapters/batch.d.ts +46 -0
  115. package/dist/src/adapters/crashCapture.d.ts +42 -9
  116. package/dist/src/adapters/deviceState.d.ts +9 -0
  117. package/dist/src/adapters/failedEvents.d.ts +43 -0
  118. package/dist/src/adapters/frameAggregate.d.ts +19 -12
  119. package/dist/src/adapters/frameTracker.d.ts +30 -0
  120. package/dist/src/adapters/hangDetector.d.ts +41 -0
  121. package/dist/src/adapters/httpAttributes.d.ts +18 -0
  122. package/dist/src/adapters/loadingTime.d.ts +67 -0
  123. package/dist/src/adapters/manualSpans.d.ts +41 -0
  124. package/dist/src/adapters/native/autoTaps.native.d.ts +15 -0
  125. package/dist/src/adapters/native/deviceState.native.d.ts +15 -0
  126. package/dist/src/adapters/native/interceptHttpNative.native.d.ts +18 -0
  127. package/dist/src/adapters/native/memoryNative.native.d.ts +15 -11
  128. package/dist/src/adapters/native/networkInfo.native.d.ts +1 -1
  129. package/dist/src/adapters/native/runtimeReady.native.d.ts +17 -0
  130. package/dist/src/adapters/native/store.native.d.ts +10 -0
  131. package/dist/src/adapters/nativeSender.d.ts +2 -2
  132. package/dist/src/adapters/navigationRef.d.ts +29 -0
  133. package/dist/src/adapters/networkChange.d.ts +2 -2
  134. package/dist/src/adapters/seedRuntimeReady.d.ts +8 -0
  135. package/dist/src/adapters/traceHeader.d.ts +33 -0
  136. package/dist/src/adapters/traceManager.d.ts +144 -0
  137. package/dist/src/adapters/uiInteraction.d.ts +111 -0
  138. package/dist/src/adapters/viewManager.d.ts +177 -0
  139. package/dist/src/adapters/viewport.d.ts +15 -0
  140. package/dist/src/adapters/web/deviceState.web.d.ts +10 -0
  141. package/dist/src/adapters/web/interactionWeb.web.d.ts +36 -0
  142. package/dist/src/adapters/web/interceptFetchWeb.web.d.ts +3 -11
  143. package/dist/src/adapters/web/navigationWeb.web.d.ts +13 -7
  144. package/dist/src/adapters/web/runtimeReady.web.d.ts +5 -0
  145. package/dist/src/adapters/web/store.web.d.ts +12 -0
  146. package/dist/src/adapters/web/webVitals.web.d.ts +56 -0
  147. package/dist/src/adapters/webSender.d.ts +2 -2
  148. package/dist/src/adapters/webVitals.d.ts +25 -0
  149. package/dist/src/adapters/xhrIntercept.d.ts +55 -0
  150. package/dist/src/core/beforeSend.d.ts +20 -0
  151. package/dist/src/core/breadcrumbs.d.ts +10 -0
  152. package/dist/src/core/debug.d.ts +7 -0
  153. package/dist/src/core/memoryStore.d.ts +23 -0
  154. package/dist/src/core/store.d.ts +41 -0
  155. package/dist/src/core/telemetry.d.ts +422 -42
  156. package/dist/src/core/userProfile.d.ts +19 -0
  157. package/dist/src/core/utils/json.d.ts +7 -0
  158. package/dist/src/core/utils/uuid.d.ts +10 -1
  159. package/dist/src/createTelemetry.native.d.ts +10 -1
  160. package/dist/src/createTelemetry.web.d.ts +9 -1
  161. package/dist/src/golden.helper.d.ts +4 -0
  162. package/dist/src/index.base.d.ts +93 -3
  163. package/dist/src/index.native.d.ts +7 -27
  164. package/dist/src/index.web.d.ts +7 -23
  165. package/dist/src/react.d.ts +45 -0
  166. package/dist/src/telemetryNative.native.d.ts +79 -0
  167. package/dist/src/telemetryWeb.web.d.ts +59 -0
  168. package/dist/store.native-BbS76uWV.cjs +2 -0
  169. package/dist/store.native-BbS76uWV.cjs.map +1 -0
  170. package/dist/store.native-MlWyGgBp.js +32 -0
  171. package/dist/store.native-MlWyGgBp.js.map +1 -0
  172. package/dist/store.web-BzKaP57Z.cjs +2 -0
  173. package/dist/store.web-BzKaP57Z.cjs.map +1 -0
  174. package/dist/store.web-rhh0NOfs.js +31 -0
  175. package/dist/store.web-rhh0NOfs.js.map +1 -0
  176. package/dist/telemetry-60sfWkh0.js +1754 -0
  177. package/dist/telemetry-60sfWkh0.js.map +1 -0
  178. package/dist/telemetry-CW63glwb.cjs +2 -0
  179. package/dist/telemetry-CW63glwb.cjs.map +1 -0
  180. package/dist/uiInteraction-BIDOMcrL.js +109 -0
  181. package/dist/uiInteraction-BIDOMcrL.js.map +1 -0
  182. package/dist/uiInteraction-DxlwCVSn.cjs +2 -0
  183. package/dist/uiInteraction-DxlwCVSn.cjs.map +1 -0
  184. package/dist/viewport-9JcVIXYF.cjs +2 -0
  185. package/dist/viewport-9JcVIXYF.cjs.map +1 -0
  186. package/dist/viewport-GWTEBt2K.js +15 -0
  187. package/dist/viewport-GWTEBt2K.js.map +1 -0
  188. package/dist/web-vitals.attribution-DAvBvdng.cjs +2 -0
  189. package/dist/web-vitals.attribution-DAvBvdng.cjs.map +1 -0
  190. package/dist/web-vitals.attribution-DcoMtvlY.js +488 -0
  191. package/dist/web-vitals.attribution-DcoMtvlY.js.map +1 -0
  192. package/dist/webSender-DA087xb5.cjs +2 -0
  193. package/dist/webSender-DA087xb5.cjs.map +1 -0
  194. package/dist/webSender-g4rs5TIg.js +44 -0
  195. package/dist/webSender-g4rs5TIg.js.map +1 -0
  196. package/dist/webVitals.web-DRTDK6s5.js +100 -0
  197. package/dist/webVitals.web-DRTDK6s5.js.map +1 -0
  198. package/dist/webVitals.web-DvScDIjX.cjs +2 -0
  199. package/dist/webVitals.web-DvScDIjX.cjs.map +1 -0
  200. package/dist/xhrIntercept-9uAkQh3N.js +55 -0
  201. package/dist/xhrIntercept-9uAkQh3N.js.map +1 -0
  202. package/dist/xhrIntercept-xG1Yl5RI.cjs +2 -0
  203. package/dist/xhrIntercept-xG1Yl5RI.cjs.map +1 -0
  204. package/docs/migration-v4.md +190 -0
  205. package/docs/migration-v5.md +178 -0
  206. package/package.json +22 -6
  207. package/dist/appLifecycle-Cynw0kAv.js +0 -14
  208. package/dist/appLifecycle-Cynw0kAv.js.map +0 -1
  209. package/dist/appLifecycle-DvJIt7ym.cjs +0 -2
  210. package/dist/appLifecycle-DvJIt7ym.cjs.map +0 -1
  211. package/dist/batch-CLBFgYPC.cjs +0 -2
  212. package/dist/batch-CLBFgYPC.cjs.map +0 -1
  213. package/dist/batch-DLG_gtOm.js +0 -12
  214. package/dist/batch-DLG_gtOm.js.map +0 -1
  215. package/dist/crashCapture-BYTM4FLC.cjs +0 -2
  216. package/dist/crashCapture-BYTM4FLC.cjs.map +0 -1
  217. package/dist/crashCapture-D_rkkBVa.js +0 -31
  218. package/dist/crashCapture-D_rkkBVa.js.map +0 -1
  219. package/dist/crashHandler.web-BSxDpFTo.cjs +0 -2
  220. package/dist/crashHandler.web-BSxDpFTo.cjs.map +0 -1
  221. package/dist/crashHandler.web-D59bmhg9.js +0 -32
  222. package/dist/crashHandler.web-D59bmhg9.js.map +0 -1
  223. package/dist/crashHandlerNative.native-DeAFze4E.cjs +0 -2
  224. package/dist/crashHandlerNative.native-DeAFze4E.cjs.map +0 -1
  225. package/dist/crashHandlerNative.native-d7qJkzA6.js +0 -41
  226. package/dist/crashHandlerNative.native-d7qJkzA6.js.map +0 -1
  227. package/dist/debug-DsvQ9y3W.js +0 -68
  228. package/dist/debug-DsvQ9y3W.js.map +0 -1
  229. package/dist/debug-rnOOxFpN.cjs +0 -2
  230. package/dist/debug-rnOOxFpN.cjs.map +0 -1
  231. package/dist/deviceInfo.native-7hbRYixR.cjs +0 -2
  232. package/dist/deviceInfo.native-7hbRYixR.cjs.map +0 -1
  233. package/dist/deviceInfo.native-D2k0LDhI.js +0 -1171
  234. package/dist/deviceInfo.native-D2k0LDhI.js.map +0 -1
  235. package/dist/deviceInfo.web-ByNAlEJh.cjs +0 -2
  236. package/dist/deviceInfo.web-ByNAlEJh.cjs.map +0 -1
  237. package/dist/deviceInfo.web-DzQyEku6.js +0 -40
  238. package/dist/deviceInfo.web-DzQyEku6.js.map +0 -1
  239. package/dist/frameAggregate-C_HoVFcK.cjs +0 -2
  240. package/dist/frameAggregate-C_HoVFcK.cjs.map +0 -1
  241. package/dist/frameAggregate-Cwh1juw1.js +0 -17
  242. package/dist/frameAggregate-Cwh1juw1.js.map +0 -1
  243. package/dist/frameDropsNative.native-CP7zrXDf.js +0 -23
  244. package/dist/frameDropsNative.native-CP7zrXDf.js.map +0 -1
  245. package/dist/frameDropsNative.native-DKqEDqip.cjs +0 -2
  246. package/dist/frameDropsNative.native-DKqEDqip.cjs.map +0 -1
  247. package/dist/frameDropsWeb.web-C9Lt3Fuj.js +0 -22
  248. package/dist/frameDropsWeb.web-C9Lt3Fuj.js.map +0 -1
  249. package/dist/frameDropsWeb.web-azpwQCUz.cjs +0 -2
  250. package/dist/frameDropsWeb.web-azpwQCUz.cjs.map +0 -1
  251. package/dist/httpAttributes-BV50UKQU.js +0 -19
  252. package/dist/httpAttributes-BV50UKQU.js.map +0 -1
  253. package/dist/httpAttributes-xXOD9trQ.cjs +0 -2
  254. package/dist/httpAttributes-xXOD9trQ.cjs.map +0 -1
  255. package/dist/interaction-CH8yoY5-.js +0 -23
  256. package/dist/interaction-CH8yoY5-.js.map +0 -1
  257. package/dist/interaction-DcNFBW7a.cjs +0 -2
  258. package/dist/interaction-DcNFBW7a.cjs.map +0 -1
  259. package/dist/interceptFetchNative.native-VlhtMG-U.js +0 -49
  260. package/dist/interceptFetchNative.native-VlhtMG-U.js.map +0 -1
  261. package/dist/interceptFetchNative.native-jEAldH14.cjs +0 -2
  262. package/dist/interceptFetchNative.native-jEAldH14.cjs.map +0 -1
  263. package/dist/interceptFetchWeb.web-DFzZliik.cjs +0 -2
  264. package/dist/interceptFetchWeb.web-DFzZliik.cjs.map +0 -1
  265. package/dist/interceptFetchWeb.web-DfsMfoRP.js +0 -77
  266. package/dist/interceptFetchWeb.web-DfsMfoRP.js.map +0 -1
  267. package/dist/memoryNative.native-BWLh2S9L.js +0 -48
  268. package/dist/memoryNative.native-BWLh2S9L.js.map +0 -1
  269. package/dist/memoryNative.native-DCXSOd4Q.cjs +0 -2
  270. package/dist/memoryNative.native-DCXSOd4Q.cjs.map +0 -1
  271. package/dist/memoryWeb.web-B3YuV-cB.js +0 -48
  272. package/dist/memoryWeb.web-B3YuV-cB.js.map +0 -1
  273. package/dist/memoryWeb.web-CheXAcJn.cjs +0 -2
  274. package/dist/memoryWeb.web-CheXAcJn.cjs.map +0 -1
  275. package/dist/nativeSender-BE_mzw_S.js +0 -70
  276. package/dist/nativeSender-BE_mzw_S.js.map +0 -1
  277. package/dist/nativeSender-DyAUGY7c.cjs +0 -2
  278. package/dist/nativeSender-DyAUGY7c.cjs.map +0 -1
  279. package/dist/navigationNative.native-3tO5JxSd.cjs +0 -2
  280. package/dist/navigationNative.native-3tO5JxSd.cjs.map +0 -1
  281. package/dist/navigationNative.native-BUCGPQX2.js +0 -25
  282. package/dist/navigationNative.native-BUCGPQX2.js.map +0 -1
  283. package/dist/navigationTracker-B2GMwyKk.cjs +0 -2
  284. package/dist/navigationTracker-B2GMwyKk.cjs.map +0 -1
  285. package/dist/navigationTracker-Cts68dgG.js +0 -19
  286. package/dist/navigationTracker-Cts68dgG.js.map +0 -1
  287. package/dist/navigationWeb.web-B0necr5j.cjs +0 -2
  288. package/dist/navigationWeb.web-B0necr5j.cjs.map +0 -1
  289. package/dist/navigationWeb.web-CORzE_Id.js +0 -46
  290. package/dist/navigationWeb.web-CORzE_Id.js.map +0 -1
  291. package/dist/networkChange-CUO1hRLj.cjs.map +0 -1
  292. package/dist/networkChange-D39hdSb0.js.map +0 -1
  293. package/dist/networkInfo.native-BK5fpAOL.js +0 -343
  294. package/dist/networkInfo.native-BK5fpAOL.js.map +0 -1
  295. package/dist/networkInfo.native-cxuw93Uy.cjs +0 -2
  296. package/dist/networkInfo.native-cxuw93Uy.cjs.map +0 -1
  297. package/dist/networkInfo.web-DJmw1sNK.cjs +0 -2
  298. package/dist/networkInfo.web-DJmw1sNK.cjs.map +0 -1
  299. package/dist/networkInfo.web-twcNn_hc.js.map +0 -1
  300. package/dist/src/adapters/interaction.d.ts +0 -17
  301. package/dist/src/adapters/native/frameDropsNative.native.d.ts +0 -16
  302. package/dist/src/adapters/native/interceptFetchNative.native.d.ts +0 -23
  303. package/dist/src/adapters/native/navigationNative.native.d.ts +0 -12
  304. package/dist/src/adapters/navigationTracker.d.ts +0 -6
  305. package/dist/src/adapters/screenTiming.d.ts +0 -9
  306. package/dist/src/adapters/web/frameDropsWeb.web.d.ts +0 -16
  307. package/dist/src/adapters/web/memoryWeb.web.d.ts +0 -26
  308. package/dist/telemetry-Co4MYdwa.cjs +0 -2
  309. package/dist/telemetry-Co4MYdwa.cjs.map +0 -1
  310. package/dist/telemetry-KI0x4gzC.js +0 -389
  311. package/dist/telemetry-KI0x4gzC.js.map +0 -1
  312. package/dist/v4-BysszJq8.js +0 -31
  313. package/dist/v4-BysszJq8.js.map +0 -1
  314. package/dist/v4-CqdK_b8Y.cjs +0 -2
  315. package/dist/v4-CqdK_b8Y.cjs.map +0 -1
  316. package/dist/webSender-B27tmT1w.js +0 -42
  317. package/dist/webSender-B27tmT1w.js.map +0 -1
  318. package/dist/webSender-BWi4x1df.cjs +0 -2
  319. package/dist/webSender-BWi4x1df.cjs.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 c = 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, c, 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 o(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
- o(this, "_nativeEventSubscription", null), o(this, "_subscriptions", /* @__PURE__ */ new Set()), o(this, "_latestState", null), o(this, "_internetReachability", void 0), o(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
- }), o(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
- }), o(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
- }), o(this, "_convertState", (e) => typeof e.isInternetReachable == "boolean" ? e : {
233
- ...e,
234
- isInternetReachable: this._internetReachability.currentState()
235
- }), o(this, "latest", (e) => e ? this._fetchCurrentState(e) : this._latestState ? Promise.resolve(this._latestState) : this._fetchCurrentState()), o(this, "add", (e) => {
236
- this._subscriptions.add(e), this._latestState ? e(this._latestState) : this.latest().then(e);
237
- }), o(this, "remove", (e) => {
238
- this._subscriptions.delete(e);
239
- }), o(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 c = U(() => {
298
- e && !_ && (_ = !0, e._fetchCurrentState().finally(() => {
299
- _ = !1;
300
- }));
301
- }, [e]);
302
- return {
303
- netInfo: s,
304
- refresh: c
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
- isConnected: i.isConnected ?? void 0
324
- };
325
- } catch {
326
- return { type: "unknown", isConnected: 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-BK5fpAOL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"networkInfo.native-BK5fpAOL.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 isConnected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", isConnected: 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,0BAA0B,IAAI;AAAA;AAAA,EAE9B,yBAAyB,KAAK;AAAA;AAAA,EAE9B,4BAA4B,KAAK;AAAA;AAAA,EAEjC,uBAAuB,MAAM;AAAA,EAC7B,qBAAqB;AAAA,EACrB,uBAAuB;AACzB,GCNaC,IAA4B;ACAlC,IAAIC;AAAA,CAEV,SAAUA,GAAkB;AAC3B,EAAAA,EAAiB,UAAa,WAC9BA,EAAiB,OAAU,QAC3BA,EAAiB,WAAc,YAC/BA,EAAiB,OAAU,QAC3BA,EAAiB,YAAe,aAChCA,EAAiB,WAAc,YAC/BA,EAAiB,QAAW,SAC5BA,EAAiB,MAAS,OAC1BA,EAAiB,QAAW;AAC9B,GAAGA,MAAqBA,IAAmB,CAAA,EAAG;AAEvC,IAAIC;AAAA,CAEV,SAAUA,GAA2B;AACpC,EAAAA,EAA0B,IAAI,IAAI,MAClCA,EAA0B,IAAI,IAAI,MAClCA,EAA0B,IAAI,IAAI,MAClCA,EAA0B,IAAI,IAAI;AACpC,GAAGA,MAA8BA,IAA4B,CAAA,EA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(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},y="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 y:{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 y:{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(y,t=>{P.emit(y,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,v)=>{d=setTimeout(()=>v("timedout"),this._configuration.reachabilityRequestTimeout)});let w=()=>{};const m=new Promise((u,v)=>{w=()=>v("canceled")});return{promise:Promise.race([s,o,m]).then(u=>this._configuration.reachabilityTest(u)).then(u=>{this._setIsInternetReachable(u);const v=this._isInternetReachable?this._configuration.reachabilityLongTimeout:this._configuration.reachabilityShortTimeout;this._currentTimeoutHandle=setTimeout(this._checkInternetReachability,v)}).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(y,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 V(){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 z(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 W(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:V,addEventListener:O,useNetInfo:z,useNetInfoInstance:W};class ${constructor(){}async collect(){try{const i=await T.fetch();return{type:i.type,isConnected:i.isConnected??void 0}}catch{return{type:"unknown",isConnected: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=$;
2
- //# sourceMappingURL=networkInfo.native-cxuw93Uy.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"networkInfo.native-cxuw93Uy.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 isConnected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", isConnected: 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,EAAi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,EAAQ,SAASlC,EAAM,IAAI,CAAC,EACvDoC,CACX,CACJ","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 r=require("./networkChange-CUO1hRLj.cjs");async function e(){return typeof navigator<"u"&&"connection"in navigator?{type:navigator.connection.type||"unknown",isConnected:navigator.onLine}:{type:"unknown",isConnected:typeof navigator<"u"?navigator.onLine:void 0}}class c{constructor(){}async collect(){return e()}async start(t){this.telemetry=t;const o=new r.NetworkChangeEmitter(t),i=await this.collect();o.onSample(i.type);const n=async()=>o.onSample((await e()).type);return(typeof navigator<"u"?navigator.connection:void 0)?.addEventListener?.("change",n),typeof window<"u"&&(window.addEventListener("online",n),window.addEventListener("offline",n)),i}}exports.NetworkInfoTrackerWeb=c;exports.getNetworkInfo=e;
2
- //# sourceMappingURL=networkInfo.web-DJmw1sNK.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"networkInfo.web-DJmw1sNK.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 isConnected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n isConnected: 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,YAAa,UAAU,MAAA,EAOxB,CACH,KAAM,UACN,YAAa,OAAO,UAAc,IAAc,UAAU,OAAS,MAAA,CAE3E,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 +0,0 @@
1
- {"version":3,"file":"networkInfo.web-twcNn_hc.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 isConnected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n isConnected: 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,aAAa,UAAU;AAAA;AAAA;AAAA,EAAA,IAOxB;AAAA,IACH,MAAM;AAAA,IACN,aAAa,OAAO,YAAc,MAAc,UAAU,SAAS;AAAA,EAAA;AAE3E;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,17 +0,0 @@
1
- import { Telemetry } from '../core/telemetry';
2
- /**
3
- * Best-effort native tap capture → v3 `user.interaction` (#33). No DOM `target_tag`/
4
- * `target_class` — those are web-only; their absence on native is intentional, not an error.
5
- *
6
- * RN has no global tap stream, so `responderProps()` returns a top-level responder-capture
7
- * handler the consumer spreads onto their app root <View>. It records the tap and returns
8
- * false, so it observes the gesture without ever claiming it.
9
- */
10
- export declare class InteractionEmitter {
11
- private telemetry;
12
- constructor(telemetry: Telemetry);
13
- record(type?: string, extra?: Record<string, any>): Promise<void>;
14
- responderProps(): {
15
- onStartShouldSetResponderCapture: () => boolean;
16
- };
17
- }
@@ -1,16 +0,0 @@
1
- import { Telemetry } from '../../core/telemetry';
2
- /**
3
- * Samples frame deltas via requestAnimationFrame and emits an aggregated
4
- * `frame_render_time` metric (max/p95/dropped_count) once per window — instead of one event
5
- * per dropped frame. The metric shape matches the iOS contract (docs/edgerum-contract.md).
6
- */
7
- export declare class FrameDropTrackerNative {
8
- private telemetry;
9
- private targetFPS;
10
- private windowMs;
11
- private lastFrameTime;
12
- private windowStart;
13
- private deltas;
14
- constructor(telemetry: Telemetry, targetFPS?: number, windowMs?: number);
15
- start(): Promise<void>;
16
- }
@@ -1,23 +0,0 @@
1
- import { Telemetry } from '../../core/telemetry';
2
- /**
3
- * Intercepts global `fetch` calls in React Native to log detailed telemetry data
4
- * about network requests, including timing, method, status, payload sizes, and errors.
5
- *
6
- * Use the `start()` method to begin interception.
7
- */
8
- export declare class NetworkTrackerNative {
9
- private telemetry;
10
- private originalFetch;
11
- constructor(telemetry: Telemetry);
12
- /**
13
- * Starts intercepting global fetch requests.
14
- * Wraps `global.fetch` with telemetry logging.
15
- *
16
- * @returns Promise<void> resolves immediately after interception is set up.
17
- */
18
- start(): Promise<void>;
19
- /**
20
- * Restores the original fetch function, removing the interception.
21
- */
22
- stop(): void;
23
- }