@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadingTime-Cj5Oh8lT.cjs","sources":["../src/adapters/loadingTime.ts"],"sourcesContent":["// `view.loading_time` — network settle, one definition, both builds (§4.5.2, #97).\n//\n// Scoped to exactly one job: p75 route-change responsiveness by `view.name`, compared across\n// releases. That framing licenses a crude stable heuristic over a clever one, and makes a\n// **null strictly better than a plausible guess** — a wrong-but-believable 300 ms poisons a\n// release comparison silently, and a `0` makes p75 track the cache-hit rate, so a backend\n// caching win renders as a frontend regression, reversed.\n//\n// Network-only, because in-flight fetch/XHR is the one settle signal both builds genuinely\n// have. DOM-mutation quiet is meaningless under React's routine re-rendering; rAF quiet never\n// settles against RN's animation driver. So this module is shared and neither build gets its\n// own definition of the same column.\n\n/**\n * The quiet window, and **the same constant as §4.6's dead-click window** — one constant, not\n * two. `ui.dead` (web only, not built yet) must import this rather than declare a second 1000.\n */\nexport const QUIET_WINDOW_MS = 1000;\n\n/** Hard cap (§4.5.2). A capped view emits **null, not the cap**: at 30 s, 30 s and 90 s are the same row. */\nexport const LOADING_TIME_CAP_MS = 30_000;\n\n/** §4.5's `view.loading_time_outcome` domain — never null, exactly four values. */\nexport type LoadingTimeOutcome = \"settled\" | \"no_activity\" | \"capped\" | \"abandoned\";\n\nexport type LoadingTimeResult = {\n /** Milliseconds, or null — and null has three causes, which is why the outcome ships beside it. */\n loadingTime: number | null;\n outcome: LoadingTimeOutcome;\n};\n\nexport type NetworkSettleOpts = {\n /**\n * `initial_load` only: the view starts **busy** until the platform's own runtime-ready\n * marker (`loadEventEnd` on web, `performance.rnStartupTiming` on native), then settles.\n * Every other `load_type` runs the same column with no seed.\n */\n awaitRuntimeReady?: boolean;\n};\n\n/**\n * One view's settle state. Constructed per view and handed the requests that **started** in\n * it — a request in flight across a view boundary belongs to the old view and does not hold\n * the new one open (§4.5.2), which is why the completion callback is bound to this instance\n * rather than looked up on whatever view is live when the response lands.\n */\nexport class NetworkSettle {\n private started = 0;\n private inFlight = 0;\n private lastEnd?: number;\n /** Frozen the first time quiet is *observed*, so a later request cannot un-settle the view. */\n private settledAt?: number;\n private awaitingRuntimeReady: boolean;\n private runtimeReadyAt?: number;\n\n constructor(private readonly viewStart: number, opts?: NetworkSettleOpts) {\n this.awaitingRuntimeReady = opts?.awaitRuntimeReady ?? false;\n }\n\n /** `view.request_count` — requests **started** in this view, failures included (§4.5). */\n get requestCount(): number {\n return this.started;\n }\n\n /**\n * The platform's runtime-ready marker, or `undefined` where the platform has none —\n * Old Architecture, or a runtime that omits it (§4.3). Either way this releases the gate:\n * a marker that never arrives must not make every launch report `abandoned`.\n */\n seedRuntimeReady(at?: number): void {\n // A successor was never gated on the marker, and on web the `load` event routinely\n // arrives *after* the first route change — flooring that view's settle at the page's\n // load time would inflate a route-change measurement with the launch's cost.\n if (!this.awaitingRuntimeReady) return;\n this.awaitingRuntimeReady = false;\n this.runtimeReadyAt = at;\n }\n\n /**\n * A request started in this view. Returns its completion callback — idempotent, because an\n * XHR `loadend` can fire more than once for a reused instance and an unbalanced in-flight\n * count would hold the view open forever.\n */\n requestStarted(now: number = Date.now()): (endedAt?: number) => void {\n this.started++;\n this.freezeIfQuiet(now);\n // Already settled: it counts toward `request_count` but must not re-arm the view, or a\n // 30-second poller keeps one screen \"loading\" for as long as the user stays on it.\n if (this.settledAt !== undefined) return () => { };\n\n this.inFlight++;\n let done = false;\n return (endedAt: number = Date.now()) => {\n if (done) return;\n done = true;\n this.inFlight--;\n if (this.lastEnd === undefined || endedAt > this.lastEnd) this.lastEnd = endedAt;\n };\n }\n\n /**\n * The view's verdict at exit. Idempotent, not pure: it may freeze the settle timestamp as\n * a side effect, which is deliberate — once quiet has been *observed* it cannot be undone\n * by a later call, and calling this twice must not produce two different answers.\n */\n resolve(now: number = Date.now()): LoadingTimeResult {\n // The contract's free invariant, and the branch that establishes it: `no_activity` ⇔\n // `view.request_count = 0`. It is checked before the runtime-ready seed on purpose —\n // the seed is a *floor* on when settle may happen, not a source of activity, so a\n // launch that fetched nothing has no loading time to report rather than one measuring\n // the platform's own startup.\n if (this.started === 0) return { loadingTime: null, outcome: \"no_activity\" };\n\n this.freezeIfQuiet(now);\n // The view is exiting, so no further request can *start* in it — quiet is confirmed by\n // construction and the rest of the window is pure detection delay, which §4.5.2 says is\n // free. Charging it as `abandoned` would drop the fastest views out of the `settled`\n // population and bias the p75 this column exists to serve, in the wrong direction.\n // `abandoned` is left meaning what it says: the user left while it was still loading.\n const settledAt = this.settledAt ?? this.quietSince();\n if (settledAt === undefined) {\n // Capped and abandoned are different populations, read as different series, and\n // must not be merged.\n return {\n loadingTime: null,\n outcome: now - this.viewStart >= LOADING_TIME_CAP_MS ? \"capped\" : \"abandoned\",\n };\n }\n\n const settleAt = Math.max(settledAt, this.runtimeReadyAt ?? 0);\n const value = settleAt - this.viewStart;\n if (value >= LOADING_TIME_CAP_MS) return { loadingTime: null, outcome: \"capped\" };\n return { loadingTime: Math.max(0, value), outcome: \"settled\" };\n }\n\n /**\n * Settle is the *completion* timestamp, not the moment we noticed it — the quiet window is\n * detection delay and is subtracted back out. That is free precisely because the `view`\n * event emits at view exit rather than at settle, so nothing waits on the window.\n */\n private freezeIfQuiet(now: number): void {\n if (this.settledAt !== undefined) return;\n const quiet = this.quietSince();\n if (quiet !== undefined && now - quiet >= QUIET_WINDOW_MS) this.settledAt = quiet;\n }\n\n /** When the network last went quiet, or undefined while the view is still busy. */\n private quietSince(): number | undefined {\n if (this.awaitingRuntimeReady) return undefined; // initial_load is busy until the marker\n if (this.inFlight > 0) return undefined;\n return this.lastEnd;\n }\n}\n"],"names":["NetworkSettle","viewStart","opts","at","now","done","endedAt","settledAt","value","quiet"],"mappings":"aA8CO,MAAMA,CAAc,CASvB,YAA6BC,EAAmBC,EAA0B,CAA7C,KAAA,UAAAD,EAR7B,KAAQ,QAAU,EAClB,KAAQ,SAAW,EAQf,KAAK,qBAAuBC,GAAM,mBAAqB,EAC3D,CAGA,IAAI,cAAuB,CACvB,OAAO,KAAK,OAChB,CAOA,iBAAiBC,EAAmB,CAI3B,KAAK,uBACV,KAAK,qBAAuB,GAC5B,KAAK,eAAiBA,EAC1B,CAOA,eAAeC,EAAc,KAAK,MAAmC,CAKjE,GAJA,KAAK,UACL,KAAK,cAAcA,CAAG,EAGlB,KAAK,YAAc,OAAW,MAAO,IAAM,CAAE,EAEjD,KAAK,WACL,IAAIC,EAAO,GACX,MAAO,CAACC,EAAkB,KAAK,QAAU,CACjCD,IACJA,EAAO,GACP,KAAK,YACD,KAAK,UAAY,QAAaC,EAAU,KAAK,gBAAc,QAAUA,GAC7E,CACJ,CAOA,QAAQF,EAAc,KAAK,MAA0B,CAMjD,GAAI,KAAK,UAAY,EAAG,MAAO,CAAE,YAAa,KAAM,QAAS,aAAA,EAE7D,KAAK,cAAcA,CAAG,EAMtB,MAAMG,EAAY,KAAK,WAAa,KAAK,WAAA,EACzC,GAAIA,IAAc,OAGd,MAAO,CACH,YAAa,KACb,QAASH,EAAM,KAAK,WAAa,IAAsB,SAAW,WAAA,EAK1E,MAAMI,EADW,KAAK,IAAID,EAAW,KAAK,gBAAkB,CAAC,EACpC,KAAK,UAC9B,OAAIC,GAAS,IAA4B,CAAE,YAAa,KAAM,QAAS,QAAA,EAChE,CAAE,YAAa,KAAK,IAAI,EAAGA,CAAK,EAAG,QAAS,SAAA,CACvD,CAOQ,cAAcJ,EAAmB,CACrC,GAAI,KAAK,YAAc,OAAW,OAClC,MAAMK,EAAQ,KAAK,WAAA,EACfA,IAAU,QAAaL,EAAMK,GAAS,WAAsB,UAAYA,EAChF,CAGQ,YAAiC,CACrC,GAAI,MAAK,sBACL,OAAK,SAAW,GACpB,OAAO,KAAK,OAChB,CACJ"}
@@ -0,0 +1,70 @@
1
+ const a = 1e3, r = 3e4;
2
+ class u {
3
+ constructor(e, t) {
4
+ this.viewStart = e, this.started = 0, this.inFlight = 0, this.awaitingRuntimeReady = t?.awaitRuntimeReady ?? !1;
5
+ }
6
+ /** `view.request_count` — requests **started** in this view, failures included (§4.5). */
7
+ get requestCount() {
8
+ return this.started;
9
+ }
10
+ /**
11
+ * The platform's runtime-ready marker, or `undefined` where the platform has none —
12
+ * Old Architecture, or a runtime that omits it (§4.3). Either way this releases the gate:
13
+ * a marker that never arrives must not make every launch report `abandoned`.
14
+ */
15
+ seedRuntimeReady(e) {
16
+ this.awaitingRuntimeReady && (this.awaitingRuntimeReady = !1, this.runtimeReadyAt = e);
17
+ }
18
+ /**
19
+ * A request started in this view. Returns its completion callback — idempotent, because an
20
+ * XHR `loadend` can fire more than once for a reused instance and an unbalanced in-flight
21
+ * count would hold the view open forever.
22
+ */
23
+ requestStarted(e = Date.now()) {
24
+ if (this.started++, this.freezeIfQuiet(e), this.settledAt !== void 0) return () => {
25
+ };
26
+ this.inFlight++;
27
+ let t = !1;
28
+ return (i = Date.now()) => {
29
+ t || (t = !0, this.inFlight--, (this.lastEnd === void 0 || i > this.lastEnd) && (this.lastEnd = i));
30
+ };
31
+ }
32
+ /**
33
+ * The view's verdict at exit. Idempotent, not pure: it may freeze the settle timestamp as
34
+ * a side effect, which is deliberate — once quiet has been *observed* it cannot be undone
35
+ * by a later call, and calling this twice must not produce two different answers.
36
+ */
37
+ resolve(e = Date.now()) {
38
+ if (this.started === 0) return { loadingTime: null, outcome: "no_activity" };
39
+ this.freezeIfQuiet(e);
40
+ const t = this.settledAt ?? this.quietSince();
41
+ if (t === void 0)
42
+ return {
43
+ loadingTime: null,
44
+ outcome: e - this.viewStart >= 3e4 ? "capped" : "abandoned"
45
+ };
46
+ const s = Math.max(t, this.runtimeReadyAt ?? 0) - this.viewStart;
47
+ return s >= 3e4 ? { loadingTime: null, outcome: "capped" } : { loadingTime: Math.max(0, s), outcome: "settled" };
48
+ }
49
+ /**
50
+ * Settle is the *completion* timestamp, not the moment we noticed it — the quiet window is
51
+ * detection delay and is subtracted back out. That is free precisely because the `view`
52
+ * event emits at view exit rather than at settle, so nothing waits on the window.
53
+ */
54
+ freezeIfQuiet(e) {
55
+ if (this.settledAt !== void 0) return;
56
+ const t = this.quietSince();
57
+ t !== void 0 && e - t >= 1e3 && (this.settledAt = t);
58
+ }
59
+ /** When the network last went quiet, or undefined while the view is still busy. */
60
+ quietSince() {
61
+ if (!this.awaitingRuntimeReady && !(this.inFlight > 0))
62
+ return this.lastEnd;
63
+ }
64
+ }
65
+ export {
66
+ r as L,
67
+ u as N,
68
+ a as Q
69
+ };
70
+ //# sourceMappingURL=loadingTime-DMc0zTY8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadingTime-DMc0zTY8.js","sources":["../src/adapters/loadingTime.ts"],"sourcesContent":["// `view.loading_time` — network settle, one definition, both builds (§4.5.2, #97).\n//\n// Scoped to exactly one job: p75 route-change responsiveness by `view.name`, compared across\n// releases. That framing licenses a crude stable heuristic over a clever one, and makes a\n// **null strictly better than a plausible guess** — a wrong-but-believable 300 ms poisons a\n// release comparison silently, and a `0` makes p75 track the cache-hit rate, so a backend\n// caching win renders as a frontend regression, reversed.\n//\n// Network-only, because in-flight fetch/XHR is the one settle signal both builds genuinely\n// have. DOM-mutation quiet is meaningless under React's routine re-rendering; rAF quiet never\n// settles against RN's animation driver. So this module is shared and neither build gets its\n// own definition of the same column.\n\n/**\n * The quiet window, and **the same constant as §4.6's dead-click window** — one constant, not\n * two. `ui.dead` (web only, not built yet) must import this rather than declare a second 1000.\n */\nexport const QUIET_WINDOW_MS = 1000;\n\n/** Hard cap (§4.5.2). A capped view emits **null, not the cap**: at 30 s, 30 s and 90 s are the same row. */\nexport const LOADING_TIME_CAP_MS = 30_000;\n\n/** §4.5's `view.loading_time_outcome` domain — never null, exactly four values. */\nexport type LoadingTimeOutcome = \"settled\" | \"no_activity\" | \"capped\" | \"abandoned\";\n\nexport type LoadingTimeResult = {\n /** Milliseconds, or null — and null has three causes, which is why the outcome ships beside it. */\n loadingTime: number | null;\n outcome: LoadingTimeOutcome;\n};\n\nexport type NetworkSettleOpts = {\n /**\n * `initial_load` only: the view starts **busy** until the platform's own runtime-ready\n * marker (`loadEventEnd` on web, `performance.rnStartupTiming` on native), then settles.\n * Every other `load_type` runs the same column with no seed.\n */\n awaitRuntimeReady?: boolean;\n};\n\n/**\n * One view's settle state. Constructed per view and handed the requests that **started** in\n * it — a request in flight across a view boundary belongs to the old view and does not hold\n * the new one open (§4.5.2), which is why the completion callback is bound to this instance\n * rather than looked up on whatever view is live when the response lands.\n */\nexport class NetworkSettle {\n private started = 0;\n private inFlight = 0;\n private lastEnd?: number;\n /** Frozen the first time quiet is *observed*, so a later request cannot un-settle the view. */\n private settledAt?: number;\n private awaitingRuntimeReady: boolean;\n private runtimeReadyAt?: number;\n\n constructor(private readonly viewStart: number, opts?: NetworkSettleOpts) {\n this.awaitingRuntimeReady = opts?.awaitRuntimeReady ?? false;\n }\n\n /** `view.request_count` — requests **started** in this view, failures included (§4.5). */\n get requestCount(): number {\n return this.started;\n }\n\n /**\n * The platform's runtime-ready marker, or `undefined` where the platform has none —\n * Old Architecture, or a runtime that omits it (§4.3). Either way this releases the gate:\n * a marker that never arrives must not make every launch report `abandoned`.\n */\n seedRuntimeReady(at?: number): void {\n // A successor was never gated on the marker, and on web the `load` event routinely\n // arrives *after* the first route change — flooring that view's settle at the page's\n // load time would inflate a route-change measurement with the launch's cost.\n if (!this.awaitingRuntimeReady) return;\n this.awaitingRuntimeReady = false;\n this.runtimeReadyAt = at;\n }\n\n /**\n * A request started in this view. Returns its completion callback — idempotent, because an\n * XHR `loadend` can fire more than once for a reused instance and an unbalanced in-flight\n * count would hold the view open forever.\n */\n requestStarted(now: number = Date.now()): (endedAt?: number) => void {\n this.started++;\n this.freezeIfQuiet(now);\n // Already settled: it counts toward `request_count` but must not re-arm the view, or a\n // 30-second poller keeps one screen \"loading\" for as long as the user stays on it.\n if (this.settledAt !== undefined) return () => { };\n\n this.inFlight++;\n let done = false;\n return (endedAt: number = Date.now()) => {\n if (done) return;\n done = true;\n this.inFlight--;\n if (this.lastEnd === undefined || endedAt > this.lastEnd) this.lastEnd = endedAt;\n };\n }\n\n /**\n * The view's verdict at exit. Idempotent, not pure: it may freeze the settle timestamp as\n * a side effect, which is deliberate — once quiet has been *observed* it cannot be undone\n * by a later call, and calling this twice must not produce two different answers.\n */\n resolve(now: number = Date.now()): LoadingTimeResult {\n // The contract's free invariant, and the branch that establishes it: `no_activity` ⇔\n // `view.request_count = 0`. It is checked before the runtime-ready seed on purpose —\n // the seed is a *floor* on when settle may happen, not a source of activity, so a\n // launch that fetched nothing has no loading time to report rather than one measuring\n // the platform's own startup.\n if (this.started === 0) return { loadingTime: null, outcome: \"no_activity\" };\n\n this.freezeIfQuiet(now);\n // The view is exiting, so no further request can *start* in it — quiet is confirmed by\n // construction and the rest of the window is pure detection delay, which §4.5.2 says is\n // free. Charging it as `abandoned` would drop the fastest views out of the `settled`\n // population and bias the p75 this column exists to serve, in the wrong direction.\n // `abandoned` is left meaning what it says: the user left while it was still loading.\n const settledAt = this.settledAt ?? this.quietSince();\n if (settledAt === undefined) {\n // Capped and abandoned are different populations, read as different series, and\n // must not be merged.\n return {\n loadingTime: null,\n outcome: now - this.viewStart >= LOADING_TIME_CAP_MS ? \"capped\" : \"abandoned\",\n };\n }\n\n const settleAt = Math.max(settledAt, this.runtimeReadyAt ?? 0);\n const value = settleAt - this.viewStart;\n if (value >= LOADING_TIME_CAP_MS) return { loadingTime: null, outcome: \"capped\" };\n return { loadingTime: Math.max(0, value), outcome: \"settled\" };\n }\n\n /**\n * Settle is the *completion* timestamp, not the moment we noticed it — the quiet window is\n * detection delay and is subtracted back out. That is free precisely because the `view`\n * event emits at view exit rather than at settle, so nothing waits on the window.\n */\n private freezeIfQuiet(now: number): void {\n if (this.settledAt !== undefined) return;\n const quiet = this.quietSince();\n if (quiet !== undefined && now - quiet >= QUIET_WINDOW_MS) this.settledAt = quiet;\n }\n\n /** When the network last went quiet, or undefined while the view is still busy. */\n private quietSince(): number | undefined {\n if (this.awaitingRuntimeReady) return undefined; // initial_load is busy until the marker\n if (this.inFlight > 0) return undefined;\n return this.lastEnd;\n }\n}\n"],"names":["QUIET_WINDOW_MS","LOADING_TIME_CAP_MS","NetworkSettle","viewStart","opts","at","now","done","endedAt","settledAt","value","quiet"],"mappings":"AAiBO,MAAMA,IAAkB,KAGlBC,IAAsB;AA0B5B,MAAMC,EAAc;AAAA,EASvB,YAA6BC,GAAmBC,GAA0B;AAA7C,SAAA,YAAAD,GAR7B,KAAQ,UAAU,GAClB,KAAQ,WAAW,GAQf,KAAK,uBAAuBC,GAAM,qBAAqB;AAAA,EAC3D;AAAA;AAAA,EAGA,IAAI,eAAuB;AACvB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,iBAAiBC,GAAmB;AAIhC,IAAK,KAAK,yBACV,KAAK,uBAAuB,IAC5B,KAAK,iBAAiBA;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,eAAeC,IAAc,KAAK,OAAmC;AAKjE,QAJA,KAAK,WACL,KAAK,cAAcA,CAAG,GAGlB,KAAK,cAAc,OAAW,QAAO,MAAM;AAAA,IAAE;AAEjD,SAAK;AACL,QAAIC,IAAO;AACX,WAAO,CAACC,IAAkB,KAAK,UAAU;AACrC,MAAID,MACJA,IAAO,IACP,KAAK,aACD,KAAK,YAAY,UAAaC,IAAU,KAAK,kBAAc,UAAUA;AAAA,IAC7E;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAQF,IAAc,KAAK,OAA0B;AAMjD,QAAI,KAAK,YAAY,EAAG,QAAO,EAAE,aAAa,MAAM,SAAS,cAAA;AAE7D,SAAK,cAAcA,CAAG;AAMtB,UAAMG,IAAY,KAAK,aAAa,KAAK,WAAA;AACzC,QAAIA,MAAc;AAGd,aAAO;AAAA,QACH,aAAa;AAAA,QACb,SAASH,IAAM,KAAK,aAAa,MAAsB,WAAW;AAAA,MAAA;AAK1E,UAAMI,IADW,KAAK,IAAID,GAAW,KAAK,kBAAkB,CAAC,IACpC,KAAK;AAC9B,WAAIC,KAAS,MAA4B,EAAE,aAAa,MAAM,SAAS,SAAA,IAChE,EAAE,aAAa,KAAK,IAAI,GAAGA,CAAK,GAAG,SAAS,UAAA;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ,cAAcJ,GAAmB;AACrC,QAAI,KAAK,cAAc,OAAW;AAClC,UAAMK,IAAQ,KAAK,WAAA;AACnB,IAAIA,MAAU,UAAaL,IAAMK,KAAS,aAAsB,YAAYA;AAAA,EAChF;AAAA;AAAA,EAGQ,aAAiC;AACrC,QAAI,MAAK,wBACL,OAAK,WAAW;AACpB,aAAO,KAAK;AAAA,EAChB;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react-native"),s=require("react-native-device-info"),l=require("./react-bqe7KPOf.cjs"),c=3e4,i=1024*1024;class m{constructor(e){this.telemetry=e,this.intervalId=null}async recordMemoryUsage(){const e=await o(()=>s.getUsedMemory());if(e===void 0)return;const a={"memory.type":"rss","memory.source":n.Platform.OS},t=await o(()=>s.getTotalMemory());t!==void 0&&t>0&&(a["memory.total_mb"]=t/i),await this.telemetry.log("memory.usage",{...a,"memory.usage_mb":e/i})}async start(){this.intervalId===null&&(this.intervalId=setInterval(()=>{this.recordMemoryUsage()},c),await this.recordMemoryUsage())}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null)}}async function o(r){try{const e=await r();return Number.isFinite(e)&&e>=0?e:void 0}catch(e){l.debug.warn("memory.usage read failed:",e);return}}exports.TelemetryMemoryUsageNative=m;
2
+ //# sourceMappingURL=memoryNative.native-CK3QFVjY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryNative.native-CK3QFVjY.cjs","sources":["../src/adapters/native/memoryNative.native.ts"],"sourcesContent":["import { Platform } from \"react-native\";\nimport DeviceInfoLib from \"react-native-device-info\";\nimport { Telemetry } from \"../../core/telemetry\";\nimport { debug } from \"../../core/debug\";\n\n/** §5.2 default sampling interval. */\nconst SAMPLE_INTERVAL_MS = 30000;\n\nconst BYTES_PER_MB = 1024 * 1024;\n\n/**\n * §5.2 / #105 — `memory.usage`: RSS, **native only**, sampled every 30 s. The rationale for\n * every part of that sentence lives in CLAUDE.md's `memory.usage` section; this file is the\n * mechanism.\n */\nexport class TelemetryMemoryUsageNative {\n private intervalId: ReturnType<typeof setInterval> | null = null;\n\n constructor(private telemetry: Telemetry) { }\n\n /**\n * One sample: `memory.usage_mb` = resident MB, with the device total alongside so headroom is\n * readable without a second join. An unusable read emits nothing — a fabricated 0 would\n * drag every percentile down and read as a memory *win*.\n *\n * The two reads are guarded separately on purpose: `value` is what §5.2 makes primary,\n * so a device-info build whose `getTotalMemory()` throws must still ship the resident\n * figure with `memory.total_mb` simply absent.\n */\n async recordMemoryUsage(): Promise<void> {\n const usedBytes = await readBytes(() => DeviceInfoLib.getUsedMemory());\n if (usedBytes === undefined) return;\n\n const attrs: Record<string, string | number> = {\n \"memory.type\": \"rss\",\n \"memory.source\": Platform.OS,\n };\n const totalBytes = await readBytes(() => DeviceInfoLib.getTotalMemory());\n if (totalBytes !== undefined && totalBytes > 0) {\n attrs[\"memory.total_mb\"] = totalBytes / BYTES_PER_MB;\n }\n\n // `memory.usage` is a catalogue *event* (#179): the MB figure rides `memory.usage_mb`.\n await this.telemetry.log(\"memory.usage\", { ...attrs, \"memory.usage_mb\": usedBytes / BYTES_PER_MB });\n }\n\n /**\n * Starts the periodic sampler. v3 never called this — `trackMemoryUsage()` fired the\n * one-shot read and applied `.catch` to its `void` return — so the metric was\n * single-shot at best.\n */\n async start(): Promise<void> {\n if (this.intervalId !== null) return; // idempotent: one loop per instance\n this.intervalId = setInterval(() => {\n void this.recordMemoryUsage();\n }, SAMPLE_INTERVAL_MS);\n await this.recordMemoryUsage();\n }\n\n /** Stops the periodic sampler. Called by `Telemetry.shutdown()`. */\n stop(): void {\n if (this.intervalId !== null) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n }\n}\n\n/**\n * One device-info read, reduced to `number | undefined`. Both a throw (the package is a\n * peer dep — a consumer can be on a build without the native module) and a non-finite or\n * negative reading mean \"nothing to report\", and the caller treats them the same.\n */\nasync function readBytes(read: () => Promise<number>): Promise<number | undefined> {\n try {\n const bytes = await read();\n return Number.isFinite(bytes) && bytes >= 0 ? bytes : undefined;\n } catch (err) {\n debug.warn(\"memory.usage read failed:\", err);\n return undefined;\n }\n}\n"],"names":["SAMPLE_INTERVAL_MS","BYTES_PER_MB","TelemetryMemoryUsageNative","telemetry","usedBytes","readBytes","DeviceInfoLib","attrs","Platform","totalBytes","read","bytes","err","debug"],"mappings":"wLAMMA,EAAqB,IAErBC,EAAe,KAAO,KAOrB,MAAMC,CAA2B,CAGpC,YAAoBC,EAAsB,CAAtB,KAAA,UAAAA,EAFpB,KAAQ,WAAoD,IAEhB,CAW5C,MAAM,mBAAmC,CACrC,MAAMC,EAAY,MAAMC,EAAU,IAAMC,EAAc,eAAe,EACrE,GAAIF,IAAc,OAAW,OAE7B,MAAMG,EAAyC,CAC3C,cAAe,MACf,gBAAiBC,EAAAA,SAAS,EAAA,EAExBC,EAAa,MAAMJ,EAAU,IAAMC,EAAc,gBAAgB,EACnEG,IAAe,QAAaA,EAAa,IACzCF,EAAM,iBAAiB,EAAIE,EAAaR,GAI5C,MAAM,KAAK,UAAU,IAAI,eAAgB,CAAE,GAAGM,EAAO,kBAAmBH,EAAYH,EAAc,CACtG,CAOA,MAAM,OAAuB,CACrB,KAAK,aAAe,OACxB,KAAK,WAAa,YAAY,IAAM,CAC3B,KAAK,kBAAA,CACd,EAAGD,CAAkB,EACrB,MAAM,KAAK,kBAAA,EACf,CAGA,MAAa,CACL,KAAK,aAAe,OACpB,cAAc,KAAK,UAAU,EAC7B,KAAK,WAAa,KAE1B,CACJ,CAOA,eAAeK,EAAUK,EAA0D,CAC/E,GAAI,CACA,MAAMC,EAAQ,MAAMD,EAAA,EACpB,OAAO,OAAO,SAASC,CAAK,GAAKA,GAAS,EAAIA,EAAQ,MAC1D,OAASC,EAAK,CACVC,QAAM,KAAK,4BAA6BD,CAAG,EAC3C,MACJ,CACJ"}
@@ -0,0 +1,54 @@
1
+ import { Platform as m } from "react-native";
2
+ import s from "react-native-device-info";
3
+ import { d as n } from "./react-urNtDGTL.js";
4
+ const l = 3e4, a = 1024 * 1024;
5
+ class u {
6
+ constructor(t) {
7
+ this.telemetry = t, this.intervalId = null;
8
+ }
9
+ /**
10
+ * One sample: `memory.usage_mb` = resident MB, with the device total alongside so headroom is
11
+ * readable without a second join. An unusable read emits nothing — a fabricated 0 would
12
+ * drag every percentile down and read as a memory *win*.
13
+ *
14
+ * The two reads are guarded separately on purpose: `value` is what §5.2 makes primary,
15
+ * so a device-info build whose `getTotalMemory()` throws must still ship the resident
16
+ * figure with `memory.total_mb` simply absent.
17
+ */
18
+ async recordMemoryUsage() {
19
+ const t = await i(() => s.getUsedMemory());
20
+ if (t === void 0) return;
21
+ const o = {
22
+ "memory.type": "rss",
23
+ "memory.source": m.OS
24
+ }, e = await i(() => s.getTotalMemory());
25
+ e !== void 0 && e > 0 && (o["memory.total_mb"] = e / a), await this.telemetry.log("memory.usage", { ...o, "memory.usage_mb": t / a });
26
+ }
27
+ /**
28
+ * Starts the periodic sampler. v3 never called this — `trackMemoryUsage()` fired the
29
+ * one-shot read and applied `.catch` to its `void` return — so the metric was
30
+ * single-shot at best.
31
+ */
32
+ async start() {
33
+ this.intervalId === null && (this.intervalId = setInterval(() => {
34
+ this.recordMemoryUsage();
35
+ }, l), await this.recordMemoryUsage());
36
+ }
37
+ /** Stops the periodic sampler. Called by `Telemetry.shutdown()`. */
38
+ stop() {
39
+ this.intervalId !== null && (clearInterval(this.intervalId), this.intervalId = null);
40
+ }
41
+ }
42
+ async function i(r) {
43
+ try {
44
+ const t = await r();
45
+ return Number.isFinite(t) && t >= 0 ? t : void 0;
46
+ } catch (t) {
47
+ n.warn("memory.usage read failed:", t);
48
+ return;
49
+ }
50
+ }
51
+ export {
52
+ u as TelemetryMemoryUsageNative
53
+ };
54
+ //# sourceMappingURL=memoryNative.native-DkA6f7id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryNative.native-DkA6f7id.js","sources":["../src/adapters/native/memoryNative.native.ts"],"sourcesContent":["import { Platform } from \"react-native\";\nimport DeviceInfoLib from \"react-native-device-info\";\nimport { Telemetry } from \"../../core/telemetry\";\nimport { debug } from \"../../core/debug\";\n\n/** §5.2 default sampling interval. */\nconst SAMPLE_INTERVAL_MS = 30000;\n\nconst BYTES_PER_MB = 1024 * 1024;\n\n/**\n * §5.2 / #105 — `memory.usage`: RSS, **native only**, sampled every 30 s. The rationale for\n * every part of that sentence lives in CLAUDE.md's `memory.usage` section; this file is the\n * mechanism.\n */\nexport class TelemetryMemoryUsageNative {\n private intervalId: ReturnType<typeof setInterval> | null = null;\n\n constructor(private telemetry: Telemetry) { }\n\n /**\n * One sample: `memory.usage_mb` = resident MB, with the device total alongside so headroom is\n * readable without a second join. An unusable read emits nothing — a fabricated 0 would\n * drag every percentile down and read as a memory *win*.\n *\n * The two reads are guarded separately on purpose: `value` is what §5.2 makes primary,\n * so a device-info build whose `getTotalMemory()` throws must still ship the resident\n * figure with `memory.total_mb` simply absent.\n */\n async recordMemoryUsage(): Promise<void> {\n const usedBytes = await readBytes(() => DeviceInfoLib.getUsedMemory());\n if (usedBytes === undefined) return;\n\n const attrs: Record<string, string | number> = {\n \"memory.type\": \"rss\",\n \"memory.source\": Platform.OS,\n };\n const totalBytes = await readBytes(() => DeviceInfoLib.getTotalMemory());\n if (totalBytes !== undefined && totalBytes > 0) {\n attrs[\"memory.total_mb\"] = totalBytes / BYTES_PER_MB;\n }\n\n // `memory.usage` is a catalogue *event* (#179): the MB figure rides `memory.usage_mb`.\n await this.telemetry.log(\"memory.usage\", { ...attrs, \"memory.usage_mb\": usedBytes / BYTES_PER_MB });\n }\n\n /**\n * Starts the periodic sampler. v3 never called this — `trackMemoryUsage()` fired the\n * one-shot read and applied `.catch` to its `void` return — so the metric was\n * single-shot at best.\n */\n async start(): Promise<void> {\n if (this.intervalId !== null) return; // idempotent: one loop per instance\n this.intervalId = setInterval(() => {\n void this.recordMemoryUsage();\n }, SAMPLE_INTERVAL_MS);\n await this.recordMemoryUsage();\n }\n\n /** Stops the periodic sampler. Called by `Telemetry.shutdown()`. */\n stop(): void {\n if (this.intervalId !== null) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n }\n}\n\n/**\n * One device-info read, reduced to `number | undefined`. Both a throw (the package is a\n * peer dep — a consumer can be on a build without the native module) and a non-finite or\n * negative reading mean \"nothing to report\", and the caller treats them the same.\n */\nasync function readBytes(read: () => Promise<number>): Promise<number | undefined> {\n try {\n const bytes = await read();\n return Number.isFinite(bytes) && bytes >= 0 ? bytes : undefined;\n } catch (err) {\n debug.warn(\"memory.usage read failed:\", err);\n return undefined;\n }\n}\n"],"names":["SAMPLE_INTERVAL_MS","BYTES_PER_MB","TelemetryMemoryUsageNative","telemetry","usedBytes","readBytes","DeviceInfoLib","attrs","Platform","totalBytes","read","bytes","err","debug"],"mappings":";;;AAMA,MAAMA,IAAqB,KAErBC,IAAe,OAAO;AAOrB,MAAMC,EAA2B;AAAA,EAGpC,YAAoBC,GAAsB;AAAtB,SAAA,YAAAA,GAFpB,KAAQ,aAAoD;AAAA,EAEhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW5C,MAAM,oBAAmC;AACrC,UAAMC,IAAY,MAAMC,EAAU,MAAMC,EAAc,eAAe;AACrE,QAAIF,MAAc,OAAW;AAE7B,UAAMG,IAAyC;AAAA,MAC3C,eAAe;AAAA,MACf,iBAAiBC,EAAS;AAAA,IAAA,GAExBC,IAAa,MAAMJ,EAAU,MAAMC,EAAc,gBAAgB;AACvE,IAAIG,MAAe,UAAaA,IAAa,MACzCF,EAAM,iBAAiB,IAAIE,IAAaR,IAI5C,MAAM,KAAK,UAAU,IAAI,gBAAgB,EAAE,GAAGM,GAAO,mBAAmBH,IAAYH,GAAc;AAAA,EACtG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,QAAuB;AACzB,IAAI,KAAK,eAAe,SACxB,KAAK,aAAa,YAAY,MAAM;AAChC,MAAK,KAAK,kBAAA;AAAA,IACd,GAAGD,CAAkB,GACrB,MAAM,KAAK,kBAAA;AAAA,EACf;AAAA;AAAA,EAGA,OAAa;AACT,IAAI,KAAK,eAAe,SACpB,cAAc,KAAK,UAAU,GAC7B,KAAK,aAAa;AAAA,EAE1B;AACJ;AAOA,eAAeK,EAAUK,GAA0D;AAC/E,MAAI;AACA,UAAMC,IAAQ,MAAMD,EAAA;AACpB,WAAO,OAAO,SAASC,CAAK,KAAKA,KAAS,IAAIA,IAAQ;AAAA,EAC1D,SAASC,GAAK;AACV,IAAAC,EAAM,KAAK,6BAA6BD,CAAG;AAC3C;AAAA,EACJ;AACJ;"}
@@ -0,0 +1,37 @@
1
+ import { d as o } from "./react-urNtDGTL.js";
2
+ import { nativeStore as c } from "./store.native-MlWyGgBp.js";
3
+ import { D as u, g as f, d as l, F as i, e as g, s as p, b as m, a as w, r as y } from "./telemetry-60sfWkh0.js";
4
+ async function r(e, t) {
5
+ const n = l(await e.get(i)), { json: a, dropped: s } = g(n, t);
6
+ return (await e.set(i, a)).status === "unavailable" && o.warn("Telemetry could not persist failed events: storage unavailable"), s;
7
+ }
8
+ async function h(e) {
9
+ const t = await e.get(i);
10
+ return t.status === "hit" && await e.remove(i), l(t);
11
+ }
12
+ const d = (e, t, n) => p(() => fetch(e, {
13
+ method: "POST",
14
+ headers: w(t),
15
+ body: m(n)
16
+ }), 3, (a) => 500 * 2 ** a + Math.random() * 200);
17
+ function D(e = u, t, n = c()) {
18
+ return {
19
+ async send(a) {
20
+ await d(e, t, a);
21
+ },
22
+ async onFailure(a) {
23
+ return r(n, a);
24
+ },
25
+ // The single replay path on this build (#113). Core calls it once per launch from
26
+ // its constructor; the entry no longer calls a standalone twin, which is what sent
27
+ // every recovered batch twice.
28
+ replayFailed: f(async () => {
29
+ const a = await h(n);
30
+ a.length !== 0 && (o.log("Replaying failed events, count:", a.length), await y(a, (s) => d(e, t, s), (s) => r(n, s)));
31
+ })
32
+ };
33
+ }
34
+ export {
35
+ D as nativeSender
36
+ };
37
+ //# sourceMappingURL=nativeSender-Dt1HLaLi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeSender-Dt1HLaLi.js","sources":["../src/adapters/nativeSender.ts"],"sourcesContent":["import { debug } from \"../core/debug\";\nimport type { TelemetryEvent, Sender } from \"../core/telemetry\";\nimport type { Store } from \"../core/store\";\nimport { nativeStore } from \"./native/store.native\";\nimport { decodeFailed, encodeFailed, guardedDrain, FAILED_EVENTS_KEY } from \"./failedEvents\";\nimport { buildBatch, buildHeaders, DEFAULT_ENDPOINT, replayGroups, sendWithRetry } from \"./batch\";\n\n// The offline queue goes through the Store port (#89). Unlike web, these await: on the\n// native build a write is not guaranteed to have landed when the app is killed, so the\n// crash-loss window narrows here rather than closing. That asymmetry is the port's point.\n//\n// They take the `Store` union, not `AsyncStore`. Awaiting a synchronous store is a no-op,\n// so nothing breaks if a consumer injects one — the reverse is what the types must forbid,\n// and webSender below is where that matters.\n// Returns how many rows the §9.4 cap evicted, for core's `sdk.events_dropped`.\nasync function persistFailed(store: Store, events: TelemetryEvent[]): Promise<number> {\n const existing = decodeFailed(await store.get(FAILED_EVENTS_KEY));\n const { json, dropped } = encodeFailed(existing, events);\n const written = await store.set(FAILED_EVENTS_KEY, json);\n // Storage refusing (no native module linked, full disk) is an outcome, not an error:\n // the batch is already lost, and throwing here would only lose the next one too.\n if (written.status === \"unavailable\") {\n debug.warn(\"Telemetry could not persist failed events: storage unavailable\");\n }\n return dropped;\n}\n\n// Read the queue and clear it in one step, so a replay that fails again re-persists\n// rather than double-sending on the next launch.\nasync function takeFailed(store: Store): Promise<TelemetryEvent[]> {\n const read = await store.get(FAILED_EVENTS_KEY);\n // Clear on any hit, including a payload that decoded to nothing: a half-written queue\n // is unreplayable, and keying the removal off the decoded length would make it\n // permanent as well — re-read and re-dropped on every launch, forever.\n if (read.status === \"hit\") await store.remove(FAILED_EVENTS_KEY);\n return decodeFailed(read);\n}\n\n// Exponential backoff with jitter.\nconst post = (endpoint: string, apiKey: string | undefined, events: TelemetryEvent[]) =>\n sendWithRetry(() => fetch(endpoint, {\n method: \"POST\",\n headers: buildHeaders(apiKey),\n body: buildBatch(events),\n }), 3, attempt => 500 * 2 ** attempt + Math.random() * 200);\n\nexport function nativeSender(\n endpoint: string = DEFAULT_ENDPOINT,\n apiKey?: string,\n store: Store = nativeStore(),\n): Sender {\n return {\n async send(events) {\n // Retry + backoff here; persistence on final failure is the core flush()'s\n // job via onFailure() — kept single, so a failed batch isn't persisted twice.\n await post(endpoint, apiKey, events);\n },\n async onFailure(events) {\n return persistFailed(store, events);\n },\n // The single replay path on this build (#113). Core calls it once per launch from\n // its constructor; the entry no longer calls a standalone twin, which is what sent\n // every recovered batch twice.\n replayFailed: guardedDrain(async () => {\n const stored = await takeFailed(store);\n if (stored.length === 0) return;\n debug.log(\"Replaying failed events, count:\", stored.length);\n // One POST per identity, so a prior launch's rows ride that launch's `app` block.\n // A failure re-stores exactly one copy of what is unsent: this path never goes\n // through core's flush(), so onFailure() does not also persist it. A 4xx group is\n // dropped, never kept (§2.5).\n await replayGroups(stored, events => post(endpoint, apiKey, events), events => persistFailed(store, events));\n }),\n };\n}\n"],"names":["persistFailed","store","events","existing","decodeFailed","FAILED_EVENTS_KEY","json","dropped","encodeFailed","debug","takeFailed","read","post","endpoint","apiKey","sendWithRetry","buildHeaders","buildBatch","attempt","nativeSender","DEFAULT_ENDPOINT","nativeStore","guardedDrain","stored","replayGroups"],"mappings":";;;AAeA,eAAeA,EAAcC,GAAcC,GAA2C;AAClF,QAAMC,IAAWC,EAAa,MAAMH,EAAM,IAAII,CAAiB,CAAC,GAC1D,EAAE,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAaL,GAAUD,CAAM;AAIvD,UAHgB,MAAMD,EAAM,IAAII,GAAmBC,CAAI,GAG3C,WAAW,iBACnBG,EAAM,KAAK,gEAAgE,GAExEF;AACX;AAIA,eAAeG,EAAWT,GAAyC;AAC/D,QAAMU,IAAO,MAAMV,EAAM,IAAII,CAAiB;AAI9C,SAAIM,EAAK,WAAW,SAAO,MAAMV,EAAM,OAAOI,CAAiB,GACxDD,EAAaO,CAAI;AAC5B;AAGA,MAAMC,IAAO,CAACC,GAAkBC,GAA4BZ,MACxDa,EAAc,MAAM,MAAMF,GAAU;AAAA,EAChC,QAAQ;AAAA,EACR,SAASG,EAAaF,CAAM;AAAA,EAC5B,MAAMG,EAAWf,CAAM;AAC3B,CAAC,GAAG,GAAG,CAAAgB,MAAW,MAAM,KAAKA,IAAU,KAAK,OAAA,IAAW,GAAG;AAEvD,SAASC,EACZN,IAAmBO,GACnBN,GACAb,IAAeoB,KACT;AACN,SAAO;AAAA,IACH,MAAM,KAAKnB,GAAQ;AAGf,YAAMU,EAAKC,GAAUC,GAAQZ,CAAM;AAAA,IACvC;AAAA,IACA,MAAM,UAAUA,GAAQ;AACpB,aAAOF,EAAcC,GAAOC,CAAM;AAAA,IACtC;AAAA;AAAA;AAAA;AAAA,IAIA,cAAcoB,EAAa,YAAY;AACnC,YAAMC,IAAS,MAAMb,EAAWT,CAAK;AACrC,MAAIsB,EAAO,WAAW,MACtBd,EAAM,IAAI,mCAAmCc,EAAO,MAAM,GAK1D,MAAMC,EAAaD,GAAQ,CAAArB,MAAUU,EAAKC,GAAUC,GAAQZ,CAAM,GAAG,CAAAA,MAAUF,EAAcC,GAAOC,CAAM,CAAC;AAAA,IAC/G,CAAC;AAAA,EAAA;AAET;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./react-bqe7KPOf.cjs"),c=require("./store.native-BbS76uWV.cjs"),e=require("./telemetry-CW63glwb.cjs");async function d(a,n){const i=e.decodeFailed(await a.get(e.FAILED_EVENTS_KEY)),{json:t,dropped:r}=e.encodeFailed(i,n);return(await a.set(e.FAILED_EVENTS_KEY,t)).status==="unavailable"&&o.debug.warn("Telemetry could not persist failed events: storage unavailable"),r}async function l(a){const n=await a.get(e.FAILED_EVENTS_KEY);return n.status==="hit"&&await a.remove(e.FAILED_EVENTS_KEY),e.decodeFailed(n)}const s=(a,n,i)=>e.sendWithRetry(()=>fetch(a,{method:"POST",headers:e.buildHeaders(n),body:e.buildBatch(i)}),3,t=>500*2**t+Math.random()*200);function u(a=e.DEFAULT_ENDPOINT,n,i=c.nativeStore()){return{async send(t){await s(a,n,t)},async onFailure(t){return d(i,t)},replayFailed:e.guardedDrain(async()=>{const t=await l(i);t.length!==0&&(o.debug.log("Replaying failed events, count:",t.length),await e.replayGroups(t,r=>s(a,n,r),r=>d(i,r)))})}}exports.nativeSender=u;
2
+ //# sourceMappingURL=nativeSender-hCgUa7Vz.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeSender-hCgUa7Vz.cjs","sources":["../src/adapters/nativeSender.ts"],"sourcesContent":["import { debug } from \"../core/debug\";\nimport type { TelemetryEvent, Sender } from \"../core/telemetry\";\nimport type { Store } from \"../core/store\";\nimport { nativeStore } from \"./native/store.native\";\nimport { decodeFailed, encodeFailed, guardedDrain, FAILED_EVENTS_KEY } from \"./failedEvents\";\nimport { buildBatch, buildHeaders, DEFAULT_ENDPOINT, replayGroups, sendWithRetry } from \"./batch\";\n\n// The offline queue goes through the Store port (#89). Unlike web, these await: on the\n// native build a write is not guaranteed to have landed when the app is killed, so the\n// crash-loss window narrows here rather than closing. That asymmetry is the port's point.\n//\n// They take the `Store` union, not `AsyncStore`. Awaiting a synchronous store is a no-op,\n// so nothing breaks if a consumer injects one — the reverse is what the types must forbid,\n// and webSender below is where that matters.\n// Returns how many rows the §9.4 cap evicted, for core's `sdk.events_dropped`.\nasync function persistFailed(store: Store, events: TelemetryEvent[]): Promise<number> {\n const existing = decodeFailed(await store.get(FAILED_EVENTS_KEY));\n const { json, dropped } = encodeFailed(existing, events);\n const written = await store.set(FAILED_EVENTS_KEY, json);\n // Storage refusing (no native module linked, full disk) is an outcome, not an error:\n // the batch is already lost, and throwing here would only lose the next one too.\n if (written.status === \"unavailable\") {\n debug.warn(\"Telemetry could not persist failed events: storage unavailable\");\n }\n return dropped;\n}\n\n// Read the queue and clear it in one step, so a replay that fails again re-persists\n// rather than double-sending on the next launch.\nasync function takeFailed(store: Store): Promise<TelemetryEvent[]> {\n const read = await store.get(FAILED_EVENTS_KEY);\n // Clear on any hit, including a payload that decoded to nothing: a half-written queue\n // is unreplayable, and keying the removal off the decoded length would make it\n // permanent as well — re-read and re-dropped on every launch, forever.\n if (read.status === \"hit\") await store.remove(FAILED_EVENTS_KEY);\n return decodeFailed(read);\n}\n\n// Exponential backoff with jitter.\nconst post = (endpoint: string, apiKey: string | undefined, events: TelemetryEvent[]) =>\n sendWithRetry(() => fetch(endpoint, {\n method: \"POST\",\n headers: buildHeaders(apiKey),\n body: buildBatch(events),\n }), 3, attempt => 500 * 2 ** attempt + Math.random() * 200);\n\nexport function nativeSender(\n endpoint: string = DEFAULT_ENDPOINT,\n apiKey?: string,\n store: Store = nativeStore(),\n): Sender {\n return {\n async send(events) {\n // Retry + backoff here; persistence on final failure is the core flush()'s\n // job via onFailure() — kept single, so a failed batch isn't persisted twice.\n await post(endpoint, apiKey, events);\n },\n async onFailure(events) {\n return persistFailed(store, events);\n },\n // The single replay path on this build (#113). Core calls it once per launch from\n // its constructor; the entry no longer calls a standalone twin, which is what sent\n // every recovered batch twice.\n replayFailed: guardedDrain(async () => {\n const stored = await takeFailed(store);\n if (stored.length === 0) return;\n debug.log(\"Replaying failed events, count:\", stored.length);\n // One POST per identity, so a prior launch's rows ride that launch's `app` block.\n // A failure re-stores exactly one copy of what is unsent: this path never goes\n // through core's flush(), so onFailure() does not also persist it. A 4xx group is\n // dropped, never kept (§2.5).\n await replayGroups(stored, events => post(endpoint, apiKey, events), events => persistFailed(store, events));\n }),\n };\n}\n"],"names":["persistFailed","store","events","existing","decodeFailed","FAILED_EVENTS_KEY","json","dropped","encodeFailed","debug","takeFailed","read","post","endpoint","apiKey","sendWithRetry","buildHeaders","buildBatch","attempt","nativeSender","DEFAULT_ENDPOINT","nativeStore","guardedDrain","stored","replayGroups"],"mappings":"uMAeA,eAAeA,EAAcC,EAAcC,EAA2C,CAClF,MAAMC,EAAWC,EAAAA,aAAa,MAAMH,EAAM,IAAII,EAAAA,iBAAiB,CAAC,EAC1D,CAAE,KAAAC,EAAM,QAAAC,CAAA,EAAYC,EAAAA,aAAaL,EAAUD,CAAM,EAIvD,OAHgB,MAAMD,EAAM,IAAII,EAAAA,kBAAmBC,CAAI,GAG3C,SAAW,eACnBG,EAAAA,MAAM,KAAK,gEAAgE,EAExEF,CACX,CAIA,eAAeG,EAAWT,EAAyC,CAC/D,MAAMU,EAAO,MAAMV,EAAM,IAAII,EAAAA,iBAAiB,EAI9C,OAAIM,EAAK,SAAW,OAAO,MAAMV,EAAM,OAAOI,mBAAiB,EACxDD,EAAAA,aAAaO,CAAI,CAC5B,CAGA,MAAMC,EAAO,CAACC,EAAkBC,EAA4BZ,IACxDa,gBAAc,IAAM,MAAMF,EAAU,CAChC,OAAQ,OACR,QAASG,EAAAA,aAAaF,CAAM,EAC5B,KAAMG,EAAAA,WAAWf,CAAM,CAC3B,CAAC,EAAG,EAAGgB,GAAW,IAAM,GAAKA,EAAU,KAAK,OAAA,EAAW,GAAG,EAEvD,SAASC,EACZN,EAAmBO,EAAAA,iBACnBN,EACAb,EAAeoB,EAAAA,cACT,CACN,MAAO,CACH,MAAM,KAAKnB,EAAQ,CAGf,MAAMU,EAAKC,EAAUC,EAAQZ,CAAM,CACvC,EACA,MAAM,UAAUA,EAAQ,CACpB,OAAOF,EAAcC,EAAOC,CAAM,CACtC,EAIA,aAAcoB,EAAAA,aAAa,SAAY,CACnC,MAAMC,EAAS,MAAMb,EAAWT,CAAK,EACjCsB,EAAO,SAAW,IACtBd,EAAAA,MAAM,IAAI,kCAAmCc,EAAO,MAAM,EAK1D,MAAMC,EAAAA,aAAaD,EAAQrB,GAAUU,EAAKC,EAAUC,EAAQZ,CAAM,EAAGA,GAAUF,EAAcC,EAAOC,CAAM,CAAC,EAC/G,CAAC,CAAA,CAET"}
@@ -0,0 +1,30 @@
1
+ import { d as o } from "./react-urNtDGTL.js";
2
+ class u {
3
+ constructor(e) {
4
+ this.telemetry = e;
5
+ }
6
+ attach(e) {
7
+ if (!e) return;
8
+ o.log("NavigationRefTracker: attaching to navigationRef");
9
+ const t = () => this.onRoute(n(e));
10
+ e.addListener("state", t), e.isReady?.() ? t() : e.addListener("ready", t);
11
+ }
12
+ onRoute(e) {
13
+ e !== this.currentRoute && (o.log(`NavigationRefTracker: route changed to ${e}`), this.currentRoute = e, this.telemetry.recordRouteChange(e).catch((t) => o.warn("NavigationRefTracker: route change failed:", t)));
14
+ }
15
+ }
16
+ function n(r) {
17
+ const e = [];
18
+ let t = r.getRootState?.();
19
+ for (; t?.routes?.length; ) {
20
+ const a = t.routes[t.index ?? t.routes.length - 1];
21
+ if (!a) break;
22
+ e.push(a.name), t = a.state;
23
+ }
24
+ return e.length ? e.join("/") : r.getCurrentRoute?.()?.name ?? "unknown";
25
+ }
26
+ export {
27
+ u as NavigationRefTracker,
28
+ n as routePath
29
+ };
30
+ //# sourceMappingURL=navigationRef-CVIv0aIK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationRef-CVIv0aIK.js","sources":["../src/adapters/navigationRef.ts"],"sourcesContent":["import { debug } from \"../core/debug\";\nimport { Telemetry } from \"../core/telemetry\";\n\n/**\n * React Navigation route tracking, **shared by both builds** (§4.5.1, #96).\n *\n * The navigation tree is a JS API, not a native one — it works identically on RN-Web — so\n * wiring it once means one `GROUP BY view.name` spans web and native.\n *\n * `view.name` is the focused route names **joined root to leaf with `/`** (#170): nested\n * screens sharing a leaf name (`HomeTab/Details`, `SearchTab/Details`) stay distinguishable,\n * and under Expo Router the route names *are* the file-path template, so the join yields\n * `(tabs)/settings/index` with no Expo dependency and no Expo API. Rung 2: **never\n * normalized**, and route **params are never read** — the template is the name, the value\n * is not.\n *\n * Usage: pass your navigation container ref — under Expo Router,\n * `attachNavigation(useNavigationContainerRef())` in the root `_layout`.\n */\nexport class NavigationRefTracker {\n private currentRoute?: string;\n\n constructor(private telemetry: Pick<Telemetry, \"recordRouteChange\">) {}\n\n attach(navigationRef: any) {\n if (!navigationRef) return;\n\n debug.log(\"NavigationRefTracker: attaching to navigationRef\");\n const read = () => this.onRoute(routePath(navigationRef));\n navigationRef.addListener(\"state\", read);\n // The first screen never fires `state` — it is the initial state. Read it now when the\n // container is ready, and otherwise once on the ref's own `ready` event.\n if (navigationRef.isReady?.()) read();\n else navigationRef.addListener(\"ready\", read);\n }\n\n private onRoute(route: string) {\n if (route === this.currentRoute) return;\n debug.log(`NavigationRefTracker: route changed to ${route}`);\n this.currentRoute = route;\n this.telemetry.recordRouteChange(route)\n .catch((err) => debug.warn(\"NavigationRefTracker: route change failed:\", err));\n }\n}\n\n/**\n * The focused route's name path, root to leaf. Reads `getRootState()` — `getCurrentRoute()`\n * returns only the leaf — and falls back to the leaf's name on a ref that lacks it.\n */\nexport function routePath(navigationRef: any): string {\n const names: string[] = [];\n let state = navigationRef.getRootState?.();\n while (state?.routes?.length) {\n const route = state.routes[state.index ?? state.routes.length - 1];\n if (!route) break;\n names.push(route.name);\n state = route.state;\n }\n if (names.length) return names.join(\"/\");\n return navigationRef.getCurrentRoute?.()?.name ?? \"unknown\";\n}\n"],"names":["NavigationRefTracker","telemetry","navigationRef","debug","read","routePath","route","err","names","state"],"mappings":";AAmBO,MAAMA,EAAqB;AAAA,EAG9B,YAAoBC,GAAiD;AAAjD,SAAA,YAAAA;AAAA,EAAkD;AAAA,EAEtE,OAAOC,GAAoB;AACvB,QAAI,CAACA,EAAe;AAEpB,IAAAC,EAAM,IAAI,kDAAkD;AAC5D,UAAMC,IAAO,MAAM,KAAK,QAAQC,EAAUH,CAAa,CAAC;AACxD,IAAAA,EAAc,YAAY,SAASE,CAAI,GAGnCF,EAAc,UAAA,IAAaE,EAAA,IAC1BF,EAAc,YAAY,SAASE,CAAI;AAAA,EAChD;AAAA,EAEQ,QAAQE,GAAe;AAC3B,IAAIA,MAAU,KAAK,iBACnBH,EAAM,IAAI,0CAA0CG,CAAK,EAAE,GAC3D,KAAK,eAAeA,GACpB,KAAK,UAAU,kBAAkBA,CAAK,EACjC,MAAM,CAACC,MAAQJ,EAAM,KAAK,8CAA8CI,CAAG,CAAC;AAAA,EACrF;AACJ;AAMO,SAASF,EAAUH,GAA4B;AAClD,QAAMM,IAAkB,CAAA;AACxB,MAAIC,IAAQP,EAAc,eAAA;AAC1B,SAAOO,GAAO,QAAQ,UAAQ;AAC1B,UAAMH,IAAQG,EAAM,OAAOA,EAAM,SAASA,EAAM,OAAO,SAAS,CAAC;AACjE,QAAI,CAACH,EAAO;AACZ,IAAAE,EAAM,KAAKF,EAAM,IAAI,GACrBG,IAAQH,EAAM;AAAA,EAClB;AACA,SAAIE,EAAM,SAAeA,EAAM,KAAK,GAAG,IAChCN,EAAc,qBAAqB,QAAQ;AACtD;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./react-bqe7KPOf.cjs");class u{constructor(e){this.telemetry=e}attach(e){if(!e)return;o.debug.log("NavigationRefTracker: attaching to navigationRef");const t=()=>this.onRoute(n(e));e.addListener("state",t),e.isReady?.()?t():e.addListener("ready",t)}onRoute(e){e!==this.currentRoute&&(o.debug.log(`NavigationRefTracker: route changed to ${e}`),this.currentRoute=e,this.telemetry.recordRouteChange(e).catch(t=>o.debug.warn("NavigationRefTracker: route change failed:",t)))}}function n(r){const e=[];let t=r.getRootState?.();for(;t?.routes?.length;){const a=t.routes[t.index??t.routes.length-1];if(!a)break;e.push(a.name),t=a.state}return e.length?e.join("/"):r.getCurrentRoute?.()?.name??"unknown"}exports.NavigationRefTracker=u;exports.routePath=n;
2
+ //# sourceMappingURL=navigationRef-CfIbeXX8.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationRef-CfIbeXX8.cjs","sources":["../src/adapters/navigationRef.ts"],"sourcesContent":["import { debug } from \"../core/debug\";\nimport { Telemetry } from \"../core/telemetry\";\n\n/**\n * React Navigation route tracking, **shared by both builds** (§4.5.1, #96).\n *\n * The navigation tree is a JS API, not a native one — it works identically on RN-Web — so\n * wiring it once means one `GROUP BY view.name` spans web and native.\n *\n * `view.name` is the focused route names **joined root to leaf with `/`** (#170): nested\n * screens sharing a leaf name (`HomeTab/Details`, `SearchTab/Details`) stay distinguishable,\n * and under Expo Router the route names *are* the file-path template, so the join yields\n * `(tabs)/settings/index` with no Expo dependency and no Expo API. Rung 2: **never\n * normalized**, and route **params are never read** — the template is the name, the value\n * is not.\n *\n * Usage: pass your navigation container ref — under Expo Router,\n * `attachNavigation(useNavigationContainerRef())` in the root `_layout`.\n */\nexport class NavigationRefTracker {\n private currentRoute?: string;\n\n constructor(private telemetry: Pick<Telemetry, \"recordRouteChange\">) {}\n\n attach(navigationRef: any) {\n if (!navigationRef) return;\n\n debug.log(\"NavigationRefTracker: attaching to navigationRef\");\n const read = () => this.onRoute(routePath(navigationRef));\n navigationRef.addListener(\"state\", read);\n // The first screen never fires `state` — it is the initial state. Read it now when the\n // container is ready, and otherwise once on the ref's own `ready` event.\n if (navigationRef.isReady?.()) read();\n else navigationRef.addListener(\"ready\", read);\n }\n\n private onRoute(route: string) {\n if (route === this.currentRoute) return;\n debug.log(`NavigationRefTracker: route changed to ${route}`);\n this.currentRoute = route;\n this.telemetry.recordRouteChange(route)\n .catch((err) => debug.warn(\"NavigationRefTracker: route change failed:\", err));\n }\n}\n\n/**\n * The focused route's name path, root to leaf. Reads `getRootState()` — `getCurrentRoute()`\n * returns only the leaf — and falls back to the leaf's name on a ref that lacks it.\n */\nexport function routePath(navigationRef: any): string {\n const names: string[] = [];\n let state = navigationRef.getRootState?.();\n while (state?.routes?.length) {\n const route = state.routes[state.index ?? state.routes.length - 1];\n if (!route) break;\n names.push(route.name);\n state = route.state;\n }\n if (names.length) return names.join(\"/\");\n return navigationRef.getCurrentRoute?.()?.name ?? \"unknown\";\n}\n"],"names":["NavigationRefTracker","telemetry","navigationRef","debug","read","routePath","route","err","names","state"],"mappings":"wHAmBO,MAAMA,CAAqB,CAG9B,YAAoBC,EAAiD,CAAjD,KAAA,UAAAA,CAAkD,CAEtE,OAAOC,EAAoB,CACvB,GAAI,CAACA,EAAe,OAEpBC,EAAAA,MAAM,IAAI,kDAAkD,EAC5D,MAAMC,EAAO,IAAM,KAAK,QAAQC,EAAUH,CAAa,CAAC,EACxDA,EAAc,YAAY,QAASE,CAAI,EAGnCF,EAAc,UAAA,EAAaE,EAAA,EAC1BF,EAAc,YAAY,QAASE,CAAI,CAChD,CAEQ,QAAQE,EAAe,CACvBA,IAAU,KAAK,eACnBH,EAAAA,MAAM,IAAI,0CAA0CG,CAAK,EAAE,EAC3D,KAAK,aAAeA,EACpB,KAAK,UAAU,kBAAkBA,CAAK,EACjC,MAAOC,GAAQJ,QAAM,KAAK,6CAA8CI,CAAG,CAAC,EACrF,CACJ,CAMO,SAASF,EAAUH,EAA4B,CAClD,MAAMM,EAAkB,CAAA,EACxB,IAAIC,EAAQP,EAAc,eAAA,EAC1B,KAAOO,GAAO,QAAQ,QAAQ,CAC1B,MAAMH,EAAQG,EAAM,OAAOA,EAAM,OAASA,EAAM,OAAO,OAAS,CAAC,EACjE,GAAI,CAACH,EAAO,MACZE,EAAM,KAAKF,EAAM,IAAI,EACrBG,EAAQH,EAAM,KAClB,CACA,OAAIE,EAAM,OAAeA,EAAM,KAAK,GAAG,EAChCN,EAAc,qBAAqB,MAAQ,SACtD"}
@@ -0,0 +1,51 @@
1
+ import { d as n } from "./react-urNtDGTL.js";
2
+ import { n as s } from "./httpAttributes-BWXOr4eP.js";
3
+ class p {
4
+ constructor(t) {
5
+ this.telemetry = t;
6
+ }
7
+ /**
8
+ * Initializes tracking by patching history methods and listening
9
+ * to popstate events. Should be called once after instantiation.
10
+ *
11
+ * @returns Promise<void> resolves immediately after setup
12
+ */
13
+ start() {
14
+ return new Promise((t) => {
15
+ this.patchHistory(), this.listenPopState(), t();
16
+ });
17
+ }
18
+ /**
19
+ * Patches history.pushState and history.replaceState to intercept route changes.
20
+ */
21
+ patchHistory() {
22
+ const t = history.pushState.bind(history), o = history.replaceState.bind(history), i = () => this.handleChange();
23
+ history.pushState = ((e, a, r) => {
24
+ t(e, a, r), i();
25
+ }), history.replaceState = ((e, a, r) => {
26
+ o(e, a, r), i();
27
+ });
28
+ }
29
+ /**
30
+ * Sets up an event listener for popstate events (back/forward navigation)
31
+ * to detect route changes triggered by browser controls.
32
+ */
33
+ listenPopState() {
34
+ window.addEventListener("popstate", () => this.handleChange());
35
+ }
36
+ /**
37
+ * One route change: rung 3 of the name ladder (§4.5.1) — the *last* rung, so an
38
+ * `attachNavigation` consumer's `route.name` outranks it whichever arrives first.
39
+ *
40
+ * Normalized by §4.4.1's rule, and the query string is dropped: there is no `view.url`
41
+ * and no raw path on the wire, because the identifier lives in the path
42
+ * (`/accounts/GB29-NWBK-…`) and query-stripping alone would not have addressed that.
43
+ */
44
+ handleChange() {
45
+ this.telemetry.enterView(s(window.location.pathname), "url").catch((t) => n.warn("NavigationTrackerWeb: route change failed:", t));
46
+ }
47
+ }
48
+ export {
49
+ p as NavigationTrackerWeb
50
+ };
51
+ //# sourceMappingURL=navigationWeb.web-CRHpr5zl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationWeb.web-CRHpr5zl.js","sources":["../src/adapters/web/navigationWeb.web.ts"],"sourcesContent":["import { Telemetry } from \"../../core/telemetry\";\nimport { debug } from \"../../core/debug\";\nimport { normalizeRoute } from \"../httpAttributes\";\n\n/**\n * Tracks route changes in web environments by patching the history API methods and listening\n * to popstate events, feeding rung 3 (`url`) of the view-name ladder. Emits no `navigation`\n * row: that feed is removed in v5 (#163), which also closes its raw query-string leak.\n */\nexport class NavigationTrackerWeb {\n constructor(private telemetry: Telemetry) { }\n\n /**\n * Initializes tracking by patching history methods and listening\n * to popstate events. Should be called once after instantiation.\n *\n * @returns Promise<void> resolves immediately after setup\n */\n start(): Promise<void> {\n return new Promise((resolve) => {\n this.patchHistory();\n this.listenPopState();\n resolve();\n });\n }\n\n /**\n * Patches history.pushState and history.replaceState to intercept route changes.\n */\n private patchHistory(): void {\n const origPush = history.pushState.bind(history);\n const origReplace = history.replaceState.bind(history);\n\n const handleChange = () => this.handleChange();\n\n history.pushState = (\n (data: any, unused: string, url?: string | URL | null) => {\n origPush(data, unused, url);\n handleChange();\n }\n ) as typeof history.pushState;\n\n history.replaceState = (\n (data: any, unused: string, url?: string | URL | null) => {\n origReplace(data, unused, url);\n handleChange();\n }\n ) as typeof history.replaceState;\n }\n\n /**\n * Sets up an event listener for popstate events (back/forward navigation)\n * to detect route changes triggered by browser controls.\n */\n private listenPopState(): void {\n window.addEventListener(\"popstate\", () => this.handleChange());\n }\n\n /**\n * One route change: rung 3 of the name ladder (§4.5.1) — the *last* rung, so an\n * `attachNavigation` consumer's `route.name` outranks it whichever arrives first.\n *\n * Normalized by §4.4.1's rule, and the query string is dropped: there is no `view.url`\n * and no raw path on the wire, because the identifier lives in the path\n * (`/accounts/GB29-NWBK-…`) and query-stripping alone would not have addressed that.\n */\n private handleChange(): void {\n this.telemetry.enterView(normalizeRoute(window.location.pathname), \"url\")\n .catch((err) => debug.warn(\"NavigationTrackerWeb: route change failed:\", err));\n }\n}\n"],"names":["NavigationTrackerWeb","telemetry","resolve","origPush","origReplace","handleChange","data","unused","url","normalizeRoute","err","debug"],"mappings":";;AASO,MAAMA,EAAqB;AAAA,EAC9B,YAAoBC,GAAsB;AAAtB,SAAA,YAAAA;AAAA,EAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ5C,QAAuB;AACnB,WAAO,IAAI,QAAQ,CAACC,MAAY;AAC5B,WAAK,aAAA,GACL,KAAK,eAAA,GACLA,EAAA;AAAA,IACJ,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA,EAKQ,eAAqB;AACzB,UAAMC,IAAW,QAAQ,UAAU,KAAK,OAAO,GACzCC,IAAc,QAAQ,aAAa,KAAK,OAAO,GAE/CC,IAAe,MAAM,KAAK,aAAA;AAEhC,YAAQ,aACJ,CAACC,GAAWC,GAAgBC,MAA8B;AACtD,MAAAL,EAASG,GAAMC,GAAQC,CAAG,GAC1BH,EAAA;AAAA,IACJ,IAGJ,QAAQ,gBACJ,CAACC,GAAWC,GAAgBC,MAA8B;AACtD,MAAAJ,EAAYE,GAAMC,GAAQC,CAAG,GAC7BH,EAAA;AAAA,IACJ;AAAA,EAER;AAAA;AAAA;AAAA;AAAA;AAAA,EAMQ,iBAAuB;AAC3B,WAAO,iBAAiB,YAAY,MAAM,KAAK,cAAc;AAAA,EACjE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUQ,eAAqB;AACzB,SAAK,UAAU,UAAUI,EAAe,OAAO,SAAS,QAAQ,GAAG,KAAK,EACnE,MAAM,CAACC,MAAQC,EAAM,KAAK,8CAA8CD,CAAG,CAAC;AAAA,EACrF;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./react-bqe7KPOf.cjs"),s=require("./httpAttributes-COY0_kiF.cjs");class h{constructor(t){this.telemetry=t}start(){return new Promise(t=>{this.patchHistory(),this.listenPopState(),t()})}patchHistory(){const t=history.pushState.bind(history),n=history.replaceState.bind(history),i=()=>this.handleChange();history.pushState=((e,a,r)=>{t(e,a,r),i()}),history.replaceState=((e,a,r)=>{n(e,a,r),i()})}listenPopState(){window.addEventListener("popstate",()=>this.handleChange())}handleChange(){this.telemetry.enterView(s.normalizeRoute(window.location.pathname),"url").catch(t=>o.debug.warn("NavigationTrackerWeb: route change failed:",t))}}exports.NavigationTrackerWeb=h;
2
+ //# sourceMappingURL=navigationWeb.web-DwWjL80b.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationWeb.web-DwWjL80b.cjs","sources":["../src/adapters/web/navigationWeb.web.ts"],"sourcesContent":["import { Telemetry } from \"../../core/telemetry\";\nimport { debug } from \"../../core/debug\";\nimport { normalizeRoute } from \"../httpAttributes\";\n\n/**\n * Tracks route changes in web environments by patching the history API methods and listening\n * to popstate events, feeding rung 3 (`url`) of the view-name ladder. Emits no `navigation`\n * row: that feed is removed in v5 (#163), which also closes its raw query-string leak.\n */\nexport class NavigationTrackerWeb {\n constructor(private telemetry: Telemetry) { }\n\n /**\n * Initializes tracking by patching history methods and listening\n * to popstate events. Should be called once after instantiation.\n *\n * @returns Promise<void> resolves immediately after setup\n */\n start(): Promise<void> {\n return new Promise((resolve) => {\n this.patchHistory();\n this.listenPopState();\n resolve();\n });\n }\n\n /**\n * Patches history.pushState and history.replaceState to intercept route changes.\n */\n private patchHistory(): void {\n const origPush = history.pushState.bind(history);\n const origReplace = history.replaceState.bind(history);\n\n const handleChange = () => this.handleChange();\n\n history.pushState = (\n (data: any, unused: string, url?: string | URL | null) => {\n origPush(data, unused, url);\n handleChange();\n }\n ) as typeof history.pushState;\n\n history.replaceState = (\n (data: any, unused: string, url?: string | URL | null) => {\n origReplace(data, unused, url);\n handleChange();\n }\n ) as typeof history.replaceState;\n }\n\n /**\n * Sets up an event listener for popstate events (back/forward navigation)\n * to detect route changes triggered by browser controls.\n */\n private listenPopState(): void {\n window.addEventListener(\"popstate\", () => this.handleChange());\n }\n\n /**\n * One route change: rung 3 of the name ladder (§4.5.1) — the *last* rung, so an\n * `attachNavigation` consumer's `route.name` outranks it whichever arrives first.\n *\n * Normalized by §4.4.1's rule, and the query string is dropped: there is no `view.url`\n * and no raw path on the wire, because the identifier lives in the path\n * (`/accounts/GB29-NWBK-…`) and query-stripping alone would not have addressed that.\n */\n private handleChange(): void {\n this.telemetry.enterView(normalizeRoute(window.location.pathname), \"url\")\n .catch((err) => debug.warn(\"NavigationTrackerWeb: route change failed:\", err));\n }\n}\n"],"names":["NavigationTrackerWeb","telemetry","resolve","origPush","origReplace","handleChange","data","unused","url","normalizeRoute","err","debug"],"mappings":"mKASO,MAAMA,CAAqB,CAC9B,YAAoBC,EAAsB,CAAtB,KAAA,UAAAA,CAAwB,CAQ5C,OAAuB,CACnB,OAAO,IAAI,QAASC,GAAY,CAC5B,KAAK,aAAA,EACL,KAAK,eAAA,EACLA,EAAA,CACJ,CAAC,CACL,CAKQ,cAAqB,CACzB,MAAMC,EAAW,QAAQ,UAAU,KAAK,OAAO,EACzCC,EAAc,QAAQ,aAAa,KAAK,OAAO,EAE/CC,EAAe,IAAM,KAAK,aAAA,EAEhC,QAAQ,WACJ,CAACC,EAAWC,EAAgBC,IAA8B,CACtDL,EAASG,EAAMC,EAAQC,CAAG,EAC1BH,EAAA,CACJ,GAGJ,QAAQ,cACJ,CAACC,EAAWC,EAAgBC,IAA8B,CACtDJ,EAAYE,EAAMC,EAAQC,CAAG,EAC7BH,EAAA,CACJ,EAER,CAMQ,gBAAuB,CAC3B,OAAO,iBAAiB,WAAY,IAAM,KAAK,cAAc,CACjE,CAUQ,cAAqB,CACzB,KAAK,UAAU,UAAUI,EAAAA,eAAe,OAAO,SAAS,QAAQ,EAAG,KAAK,EACnE,MAAOC,GAAQC,EAAAA,MAAM,KAAK,6CAA8CD,CAAG,CAAC,CACrF,CACJ"}
@@ -1,2 +1,2 @@
1
- "use strict";class o{constructor(e){this.telemetry=e}onSample(e){const t=this.previousType;t!==void 0&&t!==e&&this.telemetry.log("network_change",{"network.previous_type":t,"network.type":e}),this.previousType=e}}exports.NetworkChangeEmitter=o;
2
- //# sourceMappingURL=networkChange-CUO1hRLj.cjs.map
1
+ "use strict";class o{constructor(e){this.telemetry=e}onSample(e){const t=this.previousType;t!==void 0&&t!==e&&this.telemetry.log("network.change",{"network.previous_type":t,"network.type":e}),this.previousType=e}}exports.NetworkChangeEmitter=o;
2
+ //# sourceMappingURL=networkChange-2FGIQM-N.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkChange-2FGIQM-N.cjs","sources":["../src/adapters/networkChange.ts"],"sourcesContent":["import { Telemetry } from \"../core/telemetry\";\n\n/**\n * Shared connectivity-transition emitter — the single source of truth so the web and\n * native network adapters stay in lockstep on the `network.change` catalogue event (#27, #179).\n *\n * Feed it every connectivity sample via `onSample`. It emits `network.change` only on an\n * actual type transition, carrying `network.previous_type`; the current `network.*` context\n * rides on the event via the Context block (and is echoed here for an explicit at-emit value).\n */\nexport class NetworkChangeEmitter {\n private previousType?: string;\n\n constructor(private telemetry: Telemetry) {}\n\n onSample(currentType: string | undefined): void {\n const prev = this.previousType;\n if (prev !== undefined && prev !== currentType) {\n this.telemetry.log(\"network.change\", {\n \"network.previous_type\": prev,\n \"network.type\": currentType,\n });\n }\n this.previousType = currentType;\n }\n}\n"],"names":["NetworkChangeEmitter","telemetry","currentType","prev"],"mappings":"aAUO,MAAMA,CAAqB,CAGhC,YAAoBC,EAAsB,CAAtB,KAAA,UAAAA,CAAuB,CAE3C,SAASC,EAAuC,CAC9C,MAAMC,EAAO,KAAK,aACdA,IAAS,QAAaA,IAASD,GACjC,KAAK,UAAU,IAAI,iBAAkB,CACnC,wBAAyBC,EACzB,eAAgBD,CAAA,CACjB,EAEH,KAAK,aAAeA,CACtB,CACF"}
@@ -4,7 +4,7 @@ class s {
4
4
  }
5
5
  onSample(e) {
6
6
  const t = this.previousType;
7
- t !== void 0 && t !== e && this.telemetry.log("network_change", {
7
+ t !== void 0 && t !== e && this.telemetry.log("network.change", {
8
8
  "network.previous_type": t,
9
9
  "network.type": e
10
10
  }), this.previousType = e;
@@ -13,4 +13,4 @@ class s {
13
13
  export {
14
14
  s as N
15
15
  };
16
- //# sourceMappingURL=networkChange-D39hdSb0.js.map
16
+ //# sourceMappingURL=networkChange-QA0893vW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkChange-QA0893vW.js","sources":["../src/adapters/networkChange.ts"],"sourcesContent":["import { Telemetry } from \"../core/telemetry\";\n\n/**\n * Shared connectivity-transition emitter — the single source of truth so the web and\n * native network adapters stay in lockstep on the `network.change` catalogue event (#27, #179).\n *\n * Feed it every connectivity sample via `onSample`. It emits `network.change` only on an\n * actual type transition, carrying `network.previous_type`; the current `network.*` context\n * rides on the event via the Context block (and is echoed here for an explicit at-emit value).\n */\nexport class NetworkChangeEmitter {\n private previousType?: string;\n\n constructor(private telemetry: Telemetry) {}\n\n onSample(currentType: string | undefined): void {\n const prev = this.previousType;\n if (prev !== undefined && prev !== currentType) {\n this.telemetry.log(\"network.change\", {\n \"network.previous_type\": prev,\n \"network.type\": currentType,\n });\n }\n this.previousType = currentType;\n }\n}\n"],"names":["NetworkChangeEmitter","telemetry","currentType","prev"],"mappings":"AAUO,MAAMA,EAAqB;AAAA,EAGhC,YAAoBC,GAAsB;AAAtB,SAAA,YAAAA;AAAA,EAAuB;AAAA,EAE3C,SAASC,GAAuC;AAC9C,UAAMC,IAAO,KAAK;AAClB,IAAIA,MAAS,UAAaA,MAASD,KACjC,KAAK,UAAU,IAAI,kBAAkB;AAAA,MACnC,yBAAyBC;AAAA,MACzB,gBAAgBD;AAAA,IAAA,CACjB,GAEH,KAAK,eAAeA;AAAA,EACtB;AACF;"}
@@ -0,0 +1,31 @@
1
+ import o from "@react-native-community/netinfo";
2
+ import { N as r } from "./networkChange-QA0893vW.js";
3
+ class p {
4
+ constructor() {
5
+ }
6
+ async collect() {
7
+ try {
8
+ const t = await o.fetch();
9
+ return {
10
+ type: t.type,
11
+ is_connected: t.isConnected ?? void 0
12
+ };
13
+ } catch {
14
+ return { type: "unknown", is_connected: void 0 };
15
+ }
16
+ }
17
+ /**
18
+ * collect() feeds the steady-state Context block on every event (no standalone
19
+ * network_info event, ADR-0002). A connectivity *transition* is still its own
20
+ * `network.change` event, emitted via the shared NetworkChangeEmitter.
21
+ */
22
+ async start(t) {
23
+ this.telemetry = t;
24
+ const e = new r(t), n = await this.collect();
25
+ return e.onSample(n.type), o.addEventListener((c) => e.onSample(c.type)), n;
26
+ }
27
+ }
28
+ export {
29
+ p as NetworkInfoTrackerNative
30
+ };
31
+ //# sourceMappingURL=networkInfo.native-CcJ3JVRF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.native-CcJ3JVRF.js","sources":["../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n is_connected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", is_connected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * `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":["NetworkInfoTrackerNative","netState","NetInfo","telemetry","changes","NetworkChangeEmitter","info","state"],"mappings":";;AAMO,MAAMA,EAAyB;AAAA,EAGlC,cAAc;AAAA,EAEd;AAAA,EAEA,MAAM,UAAgC;AAClC,QAAI;AACA,YAAMC,IAAW,MAAMC,EAAQ,MAAA;AAC/B,aAAO;AAAA,QACH,MAAMD,EAAS;AAAA,QACf,cAAcA,EAAS,eAAe;AAAA,MAAA;AAAA,IAE9C,QAAQ;AACJ,aAAO,EAAE,MAAM,WAAW,cAAc,OAAA;AAAA,IAC5C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,MAAME,GAA4C;AACpD,SAAK,YAAYA;AACjB,UAAMC,IAAU,IAAIC,EAAqBF,CAAS,GAC5CG,IAAO,MAAM,KAAK,QAAA;AACxB,WAAAF,EAAQ,SAASE,EAAK,IAAI,GAC1BJ,EAAQ,iBAAiB,CAAAK,MAASH,EAAQ,SAASG,EAAM,IAAI,CAAC,GACvDD;AAAA,EACX;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@react-native-community/netinfo"),c=require("./networkChange-2FGIQM-N.cjs");class a{constructor(){}async collect(){try{const e=await o.fetch();return{type:e.type,is_connected:e.isConnected??void 0}}catch{return{type:"unknown",is_connected:void 0}}}async start(e){this.telemetry=e;const t=new c.NetworkChangeEmitter(e),n=await this.collect();return t.onSample(n.type),o.addEventListener(r=>t.onSample(r.type)),n}}exports.NetworkInfoTrackerNative=a;
2
+ //# sourceMappingURL=networkInfo.native-whB2wf6a.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.native-whB2wf6a.cjs","sources":["../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n is_connected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", is_connected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * `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":["NetworkInfoTrackerNative","netState","NetInfo","telemetry","changes","NetworkChangeEmitter","info","state"],"mappings":"6KAMO,MAAMA,CAAyB,CAGlC,aAAc,CAEd,CAEA,MAAM,SAAgC,CAClC,GAAI,CACA,MAAMC,EAAW,MAAMC,EAAQ,MAAA,EAC/B,MAAO,CACH,KAAMD,EAAS,KACf,aAAcA,EAAS,aAAe,MAAA,CAE9C,MAAQ,CACJ,MAAO,CAAE,KAAM,UAAW,aAAc,MAAA,CAC5C,CACJ,CAOA,MAAM,MAAME,EAA4C,CACpD,KAAK,UAAYA,EACjB,MAAMC,EAAU,IAAIC,EAAAA,qBAAqBF,CAAS,EAC5CG,EAAO,MAAM,KAAK,QAAA,EACxB,OAAAF,EAAQ,SAASE,EAAK,IAAI,EAC1BJ,EAAQ,iBAAiBK,GAASH,EAAQ,SAASG,EAAM,IAAI,CAAC,EACvDD,CACX,CACJ"}
@@ -1,13 +1,13 @@
1
- import { N as c } from "./networkChange-D39hdSb0.js";
1
+ import { N as c } from "./networkChange-QA0893vW.js";
2
2
  async function i() {
3
3
  return typeof navigator < "u" && "connection" in navigator ? {
4
4
  type: navigator.connection.type || "unknown",
5
- isConnected: navigator.onLine
5
+ is_connected: navigator.onLine
6
6
  // downlink: conn.downlink,
7
7
  // effectiveType: conn.effectiveType,
8
8
  } : {
9
9
  type: "unknown",
10
- isConnected: typeof navigator < "u" ? navigator.onLine : void 0
10
+ is_connected: typeof navigator < "u" ? navigator.onLine : void 0
11
11
  };
12
12
  }
13
13
  class d {
@@ -29,4 +29,4 @@ export {
29
29
  d as NetworkInfoTrackerWeb,
30
30
  i as getNetworkInfo
31
31
  };
32
- //# sourceMappingURL=networkInfo.web-twcNn_hc.js.map
32
+ //# sourceMappingURL=networkInfo.web-CcUpXMUK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.web-CcUpXMUK.js","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n is_connected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n is_connected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own `network.change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":";AAOA,eAAsBA,IAAuC;AACzD,SAAI,OAAO,YAAc,OAAe,gBAAgB,YAE7C;AAAA,IACH,MAFU,UAAkB,WAEjB,QAAQ;AAAA,IACnB,cAAc,UAAU;AAAA;AAAA;AAAA,EAAA,IAOzB;AAAA,IACH,MAAM;AAAA,IACN,cAAc,OAAO,YAAc,MAAc,UAAU,SAAS;AAAA,EAAA;AAE5E;AAEO,MAAMC,EAAsB;AAAA;AAAA,EAE/B,cAAc;AAAA,EAAE;AAAA,EAEhB,MAAM,UAAgC;AAClC,WAAOD,EAAA;AAAA,EACX;AAAA,EAIA,MAAM,MAAME,GAA4C;AAIpD,SAAK,YAAYA;AACjB,UAAMC,IAAU,IAAIC,EAAqBF,CAAS,GAC5CG,IAAO,MAAM,KAAK,QAAA;AACxB,IAAAF,EAAQ,SAASE,EAAK,IAAI;AAC1B,UAAMC,IAAS,YAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI;AAGzE,YADa,OAAO,YAAc,MAAe,UAAkB,aAAa,SAC1E,mBAAmB,UAAUM,CAAM,GACrC,OAAO,SAAW,QAClB,OAAO,iBAAiB,UAAUA,CAAM,GACxC,OAAO,iBAAiB,WAAWA,CAAM,IAEtCD;AAAA,EACX;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./networkChange-2FGIQM-N.cjs");async function e(){return typeof navigator<"u"&&"connection"in navigator?{type:navigator.connection.type||"unknown",is_connected:navigator.onLine}:{type:"unknown",is_connected: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-DfO-BUFx.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkInfo.web-DfO-BUFx.cjs","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n is_connected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n is_connected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own `network.change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":"gIAOA,eAAsBA,GAAuC,CACzD,OAAI,OAAO,UAAc,KAAe,eAAgB,UAE7C,CACH,KAFU,UAAkB,WAEjB,MAAQ,UACnB,aAAc,UAAU,MAAA,EAOzB,CACH,KAAM,UACN,aAAc,OAAO,UAAc,IAAc,UAAU,OAAS,MAAA,CAE5E,CAEO,MAAMC,CAAsB,CAE/B,aAAc,CAAE,CAEhB,MAAM,SAAgC,CAClC,OAAOD,EAAA,CACX,CAIA,MAAM,MAAME,EAA4C,CAIpD,KAAK,UAAYA,EACjB,MAAMC,EAAU,IAAIC,EAAAA,qBAAqBF,CAAS,EAC5CG,EAAO,MAAM,KAAK,QAAA,EACxBF,EAAQ,SAASE,EAAK,IAAI,EAC1B,MAAMC,EAAS,SAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI,EAGzE,OADa,OAAO,UAAc,IAAe,UAAkB,WAAa,SAC1E,mBAAmB,SAAUM,CAAM,EACrC,OAAO,OAAW,MAClB,OAAO,iBAAiB,SAAUA,CAAM,EACxC,OAAO,iBAAiB,UAAWA,CAAM,GAEtCD,CACX,CACJ"}
@@ -0,0 +1,4 @@
1
+ "use strict";const w=require("react");let f=!1;function U(r){f=r}const u={log:(...r)=>{f&&console.log(...r)},warn:(...r)=>{f&&console.warn(...r)},error:(...r)=>{f&&console.error(...r)}};function d(){const r=globalThis.__DEV__;if(typeof r=="boolean")return r;const t=globalThis.process?.env?.NODE_ENV;return t!==void 0&&t!=="production"}class C{now(t,e){const n=s=>{u.warn(`${e} failed:`,s)};try{return(this.resolved?Promise.resolve(t(this.resolved)):this.instancePromise.then(t)).then(()=>{},n)}catch(s){return n(s),Promise.resolve()}}markScreenReady(){const t=Date.now();this.now(e=>{setTimeout(()=>e.views.markReady(t),0)},"markScreenReady")}disable(){this.now(t=>t.disable(),"disable")}enable(){this.now(t=>t.enable(),"enable")}async recordMetric(t,e,n,s){return(await this.instancePromise).recordMetric(t,e,n,s)}async addBreadcrumb(t,e){(await this.instancePromise).addBreadcrumb(t,e)}async startNewSession(){return(await this.instancePromise).startNewSession()}startSpan(t,e){const n=Date.now();let s,a=!1,o=!1;const i=this.now(c=>{s=c.startSpan(t,e,n),o=!0},"startSpan");return{end:c=>{if(a)return;a=!0;const A=Date.now(),p=()=>this.now(k=>s&&k.endSpan(t,c?.outcome??"completed",c?.attributes,A,s,c?.reason),"span.end");o?p():i.then(p)}}}withSpan(t,e,n){const s=this.startSpan(t,n);let a;try{a=e()}catch(o){throw s.end({outcome:"failed"}),o}return a&&typeof a.then=="function"?a.then(o=>(s.end(),o),o=>{throw s.end({outcome:"failed"}),o}):(s.end(),a)}endSpan(t,e="completed",n,s){const a=Date.now();this.now(o=>o.endSpan(t,e,n,a,void 0,s),"endSpan")}async log(t,e){const n=await this.instancePromise;if(t==="app.crash"){u.warn("app.crash is SDK-owned (§4.7); routing to app.error — use captureError()");const s=e?.["error.message"]??e?.message??e?.["crash.message"];return n.captureError(s,e)}return n.log(t,e)}async flush(){return(await this.instancePromise).flush()}async shutdown(){return(await this.instancePromise).shutdown()}async attachNavigation(t){if(u.log("Attaching navigation tracker"),!t){u.warn("Navigation reference is undefined. Cannot attach navigation tracker.");return}const e=await this.instancePromise,{NavigationRefTracker:n}=await Promise.resolve().then(()=>require("./navigationRef-CfIbeXX8.cjs"));new n(e).attach(t)}async captureError(t,e){return(await this.instancePromise).captureError(t,e)}async captureBoundaryError(t,e){const n=await this.instancePromise,{capComponentStack:s}=await Promise.resolve().then(()=>x),a=e?{"error.component_stack":s(e)}:void 0;return n.captureError(t,a,"boundary")}async setUserId(t){(await this.instancePromise).setUserId(t)}async setUserProfile(t){(await this.instancePromise).setUserProfile(t)}async setUserDetails(t){(await this.instancePromise).setUserDetails(t)}async updateUserProfile(t){(await this.instancePromise).updateUserProfile(t)}async getUserProfile(){return(await this.instancePromise).getUserProfile()}async clearUserProfile(){(await this.instancePromise).clearUserProfile()}async setUserName(t,e,n){(await this.instancePromise).setUserName(t,e,n)}async setUserContact(t,e){(await this.instancePromise).setUserContact(t,e)}async identify(t){return(await this.instancePromise).identify(t)}}const D="traceparent";function R(r){if(typeof r!="string")return;const t=r.trim();if(!(!t||/[\s/?#@*:]/.test(t)))try{return new URL(`http://${t}`).hostname||void 0}catch{return}}function B(r){const t=new Set;if(r==null)return t;if(!Array.isArray(r)){if(d())throw new Error("traceHostAllowlist must be an array of bare hosts");return u.warn("Telemetry: traceHostAllowlist must be an array of bare hosts — ignored"),t}for(const e of r){const n=R(e);if(n){t.add(n);continue}if(d())throw new Error(`traceHostAllowlist: "${String(e)}" is not a bare host (no scheme, path, port or wildcard)`);u.warn(`Telemetry: traceHostAllowlist entry "${String(e)}" is not a bare host — dropped`)}return t}function _(r,t){if(r.size===0)return!1;const e=globalThis.location?.href;try{return r.has((e?new URL(t,e):new URL(t)).hostname)}catch{return!1}}function H(r){if(typeof r!="string")return;const t=/^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(r.trim());if(!(!t||/^0+$/.test(t[1])||/^0+$/.test(t[2])))return{traceId:t[1],spanId:t[2]}}function N(r,t){return`00-${r}-${t}-01`}function g(r,t){if(r){if(Array.isArray(r))for(const e of r)e&&t(String(e[0]),String(e[1]));else if(typeof r.forEach=="function")r.forEach((e,n)=>t(String(n),String(e)));else if(typeof r=="object")for(const[e,n]of Object.entries(r))t(e,String(n))}}function M(r,t){let e;return g(r,(n,s)=>{n.toLowerCase()===t&&(e=s)}),e}function $(r,t,e){const n=[];return g(r,(s,a)=>n.push([s,a])),n.push([t,e]),n}function j(r={}){const t=new Map(Object.entries(r.seed??{})),e=r.unavailable===!0,n=o=>{if(e)return{status:"unavailable"};const i=t.get(o);return i===void 0?{status:"miss"}:{status:"hit",value:i}},s=(o,i)=>e?{status:"unavailable"}:(t.set(o,i),{status:"ok"}),a=o=>e?{status:"unavailable"}:(t.delete(o),{status:"ok"});return r.async?{sync:!1,get:async o=>n(o),set:async(o,i)=>s(o,i),remove:async o=>a(o)}:{sync:!0,get:n,set:s,remove:a}}const L=255,O=1e3,b=2e3,z=200,m=`
2
+ … [truncated]`;function l(r,t,e=!1){if(r.length<=t)return r;let n=r.slice(0,t-m.length);if(e){const s=n.lastIndexOf(`
3
+ `);s>0&&(n=n.slice(0,s))}return n+m}const I=r=>l(r,b,!0),v=new WeakSet;function E(r){r!==null&&(typeof r=="object"||typeof r=="function")&&v.add(r)}function h(r){return r!==null&&(typeof r=="object"||typeof r=="function")&&v.has(r)}function S(r){const t=r?.name;return typeof t=="string"&&t!==""?t:"Error"}function K(r,t){if(typeof r=="string"&&r!=="")return r;const e=r?.message;if(typeof e=="string"&&e!=="")return e;if(!(t==null||t===""))return String(t)}let y=!1;function X(){y||!d()||(y=!0,console.warn("[edge-telemetry] Error.stackTraceLimit is the engine default (10 frames on V8), which truncates crash stacks well before the SDK's 2000-char cap. Set `Error.stackTraceLimit = 50` in your app's entry file — the SDK will not set it for you."))}function P(r,t,e={}){const n={"error.type":l(S(t),L),"error.source":r},s=K(t,e.fallbackMessage);s!==void 0&&(n["error.message"]=l(s,O));const a=t?.stack;return typeof a=="string"&&a!==""&&(n["error.stacktrace"]=l(a,b,!0),X()),e.fatal!==void 0&&(n["error.fatal"]=e.fatal),n}function T(r,t=console){const e=t.error.bind(t),n=t.warn.bind(t);let s=!1;const a=(o,i)=>(...c)=>{if(!s&&!c.some(h)){s=!0;try{o(c.map(String).join(" "))}finally{s=!1}}i(...c)};return t.error=a(o=>r.captureError(o,void 0,"console"),e),t.warn=a(o=>r.addBreadcrumb("console.warn",{message:l(o,z)}),n),()=>{t.error=e,t.warn=n}}const x=Object.freeze(Object.defineProperty({__proto__:null,buildErrorAttributes:P,capComponentStack:I,captureConsole:T,errorType:S,isBoundaryCaught:h,markBoundaryCaught:E},Symbol.toStringTag,{value:"Module"}));class V extends w.Component{constructor(){super(...arguments),this.state={error:void 0,failed:!1},this.resetError=()=>this.setState({error:void 0,failed:!1})}static getDerivedStateFromError(t){return E(t),{error:t,failed:!0}}componentDidCatch(t,e){this.props.telemetry.captureBoundaryError(t,e?.componentStack).catch(n=>u.warn("EdgeErrorBoundary: report failed:",n));try{this.props.onError?.(t,e)}catch(n){u.warn("EdgeErrorBoundary: onError threw:",n)}}render(){if(!this.state.failed)return this.props.children??null;const{fallback:t}=this.props;return typeof t=="function"?t({error:this.state.error,resetError:this.resetError}):t??null}}function q(r,t=!0){w.useEffect(()=>{t&&r.markScreenReady()},[r,t])}exports.EdgeErrorBoundary=V;exports.TRACEPARENT=D;exports.TelemetryBase=C;exports.allowsHost=_;exports.buildErrorAttributes=P;exports.captureConsole=T;exports.debug=u;exports.formatTraceparent=N;exports.isBoundaryCaught=h;exports.isDev=d;exports.memoryStore=j;exports.normalizeAllowlist=B;exports.parseTraceparent=H;exports.readHeader=M;exports.setDebug=U;exports.useScreenReady=q;exports.withHeader=$;
4
+ //# sourceMappingURL=react-bqe7KPOf.cjs.map