@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,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r{constructor(e){this.telemetry=e}async onState(e){this.telemetry.hangs?.setActive(e),e&&this.telemetry.deviceState?.refresh?.().catch(()=>{});const t=this.active;this.active=e,!(t===void 0||t===e)&&(await this.telemetry.log("app.lifecycle",{"lifecycle.state":e?"foreground":"background"}),e?this.telemetry.views.foreground():(await this.telemetry.views.background(),this.telemetry.trace.clear()))}}exports.AppLifecycleEmitter=r;
2
+ //# sourceMappingURL=appLifecycle-DS_fEclk.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appLifecycle-DS_fEclk.cjs","sources":["../src/adapters/appLifecycle.ts"],"sourcesContent":["import { Telemetry } from \"../core/telemetry\";\n\n/**\n * Shared foreground/background emitter — the single source of truth so the native\n * (RN AppState) and web (visibilitychange) lifecycle adapters stay in lockstep on the\n * `app.lifecycle` catalogue event (#30, #179).\n *\n * Feed it the current active state via `onState(isActive)`. It emits `app.lifecycle` only\n * on a transition, carrying the direction as `lifecycle.state` (foreground|background).\n */\nexport class AppLifecycleEmitter {\n private active?: boolean;\n\n constructor(private telemetry: Telemetry) {}\n\n /**\n * Returns once the transition's rows are enqueued — **await it before flushing**. The\n * background boundary's `view` row is the one most likely to be lost to an OS kill, and\n * the whole point of §4.5's background boundary is that it flushes while the app is still\n * reliably alive. A caller that fires the flush on the next line instead sends the batch\n * before the row exists.\n */\n async onState(isActive: boolean): Promise<void> {\n // Every call, the seed included and not only transitions: the stall detector must tick\n // from the first foreground, and stop the moment the app leaves it (#165).\n this.telemetry.hangs?.setActive(isActive);\n // #173: a foreground is a fresh chance the battery moved; the cache is never awaited.\n if (isActive) this.telemetry.deviceState?.refresh?.().catch(() => {});\n const previous = this.active;\n this.active = isActive;\n if (previous === undefined || previous === isActive) return;\n\n // Chained, not fired alongside, so the `app.lifecycle` row lands in the view it happened\n // in — awaited because a consumer-supplied double may return a plain value.\n await this.telemetry.log(\"app.lifecycle\", {\n \"lifecycle.state\": isActive ? \"foreground\" : \"background\",\n });\n // The view ends and emits, and the successor's clock starts paused so a night spent\n // backgrounded is not charged as dwell to the screen the user left open.\n if (isActive) this.telemetry.views.foreground();\n else {\n await this.telemetry.views.background();\n // Background clears the live root on both builds (§6.2), so a resumed app's first\n // fetch mints its own root rather than joining an action from before the user left.\n // *After* the view boundary, not before: the successor view is minted in there, and\n // clearing first would leave its freshly-minted `navigation` root as the carrier the\n // resumed app then joins.\n this.telemetry.trace.clear();\n }\n }\n}\n"],"names":["AppLifecycleEmitter","telemetry","isActive","previous"],"mappings":"gFAUO,MAAMA,CAAoB,CAG/B,YAAoBC,EAAsB,CAAtB,KAAA,UAAAA,CAAuB,CAS3C,MAAM,QAAQC,EAAkC,CAG9C,KAAK,UAAU,OAAO,UAAUA,CAAQ,EAEpCA,GAAU,KAAK,UAAU,aAAa,UAAA,EAAY,MAAM,IAAM,CAAC,CAAC,EACpE,MAAMC,EAAW,KAAK,OACtB,KAAK,OAASD,EACV,EAAAC,IAAa,QAAaA,IAAaD,KAI3C,MAAM,KAAK,UAAU,IAAI,gBAAiB,CACxC,kBAAmBA,EAAW,aAAe,YAAA,CAC9C,EAGGA,EAAU,KAAK,UAAU,MAAM,WAAA,GAEjC,MAAM,KAAK,UAAU,MAAM,WAAA,EAM3B,KAAK,UAAU,MAAM,MAAA,GAEzB,CACF"}
@@ -0,0 +1,24 @@
1
+ class a {
2
+ constructor(e) {
3
+ this.telemetry = e;
4
+ }
5
+ /**
6
+ * Returns once the transition's rows are enqueued — **await it before flushing**. The
7
+ * background boundary's `view` row is the one most likely to be lost to an OS kill, and
8
+ * the whole point of §4.5's background boundary is that it flushes while the app is still
9
+ * reliably alive. A caller that fires the flush on the next line instead sends the batch
10
+ * before the row exists.
11
+ */
12
+ async onState(e) {
13
+ this.telemetry.hangs?.setActive(e), e && this.telemetry.deviceState?.refresh?.().catch(() => {
14
+ });
15
+ const t = this.active;
16
+ this.active = e, !(t === void 0 || t === e) && (await this.telemetry.log("app.lifecycle", {
17
+ "lifecycle.state": e ? "foreground" : "background"
18
+ }), e ? this.telemetry.views.foreground() : (await this.telemetry.views.background(), this.telemetry.trace.clear()));
19
+ }
20
+ }
21
+ export {
22
+ a as AppLifecycleEmitter
23
+ };
24
+ //# sourceMappingURL=appLifecycle-PffQ4vC1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appLifecycle-PffQ4vC1.js","sources":["../src/adapters/appLifecycle.ts"],"sourcesContent":["import { Telemetry } from \"../core/telemetry\";\n\n/**\n * Shared foreground/background emitter — the single source of truth so the native\n * (RN AppState) and web (visibilitychange) lifecycle adapters stay in lockstep on the\n * `app.lifecycle` catalogue event (#30, #179).\n *\n * Feed it the current active state via `onState(isActive)`. It emits `app.lifecycle` only\n * on a transition, carrying the direction as `lifecycle.state` (foreground|background).\n */\nexport class AppLifecycleEmitter {\n private active?: boolean;\n\n constructor(private telemetry: Telemetry) {}\n\n /**\n * Returns once the transition's rows are enqueued — **await it before flushing**. The\n * background boundary's `view` row is the one most likely to be lost to an OS kill, and\n * the whole point of §4.5's background boundary is that it flushes while the app is still\n * reliably alive. A caller that fires the flush on the next line instead sends the batch\n * before the row exists.\n */\n async onState(isActive: boolean): Promise<void> {\n // Every call, the seed included and not only transitions: the stall detector must tick\n // from the first foreground, and stop the moment the app leaves it (#165).\n this.telemetry.hangs?.setActive(isActive);\n // #173: a foreground is a fresh chance the battery moved; the cache is never awaited.\n if (isActive) this.telemetry.deviceState?.refresh?.().catch(() => {});\n const previous = this.active;\n this.active = isActive;\n if (previous === undefined || previous === isActive) return;\n\n // Chained, not fired alongside, so the `app.lifecycle` row lands in the view it happened\n // in — awaited because a consumer-supplied double may return a plain value.\n await this.telemetry.log(\"app.lifecycle\", {\n \"lifecycle.state\": isActive ? \"foreground\" : \"background\",\n });\n // The view ends and emits, and the successor's clock starts paused so a night spent\n // backgrounded is not charged as dwell to the screen the user left open.\n if (isActive) this.telemetry.views.foreground();\n else {\n await this.telemetry.views.background();\n // Background clears the live root on both builds (§6.2), so a resumed app's first\n // fetch mints its own root rather than joining an action from before the user left.\n // *After* the view boundary, not before: the successor view is minted in there, and\n // clearing first would leave its freshly-minted `navigation` root as the carrier the\n // resumed app then joins.\n this.telemetry.trace.clear();\n }\n }\n}\n"],"names":["AppLifecycleEmitter","telemetry","isActive","previous"],"mappings":"AAUO,MAAMA,EAAoB;AAAA,EAG/B,YAAoBC,GAAsB;AAAtB,SAAA,YAAAA;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS3C,MAAM,QAAQC,GAAkC;AAG9C,SAAK,UAAU,OAAO,UAAUA,CAAQ,GAEpCA,KAAU,KAAK,UAAU,aAAa,UAAA,EAAY,MAAM,MAAM;AAAA,IAAC,CAAC;AACpE,UAAMC,IAAW,KAAK;AAEtB,IADA,KAAK,SAASD,GACV,EAAAC,MAAa,UAAaA,MAAaD,OAI3C,MAAM,KAAK,UAAU,IAAI,iBAAiB;AAAA,MACxC,mBAAmBA,IAAW,eAAe;AAAA,IAAA,CAC9C,GAGGA,IAAU,KAAK,UAAU,MAAM,WAAA,KAEjC,MAAM,KAAK,UAAU,MAAM,WAAA,GAM3B,KAAK,UAAU,MAAM,MAAA;AAAA,EAEzB;AACF;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./react-bqe7KPOf.cjs"),l={onPress:"tap",onLongPress:"long_press"},p=Symbol.for("edge-telemetry.autoTaps"),y=new WeakSet;let d;const m=new WeakMap;function f(t){if(!t||typeof t!="object")return t;let c=t;for(const r in l){const e=t[r];if(typeof e!="function")continue;let n=m.get(e);n||m.set(e,n=new Map);let a=n.get(t.testID);a||(a=g(e,l[r],t.testID),n.set(t.testID,a)),c===t&&(c={...t}),c[r]=a}return c}function g(t,c,r){return function(e){const n=d;if(!n)return t.apply(this,arguments);const a=e!==null&&typeof e=="object";if(a&&y.has(e))return t.apply(this,arguments);a&&y.add(e);let o,s=0;try{o=n.prepare(c,r),s=n.explicitCount()}catch(i){u.debug.warn("autoTrackTaps: prepare failed:",i)}try{return t.apply(this,arguments)}finally{if(o&&n.explicitCount()===s)try{o()}catch(i){u.debug.warn("autoTrackTaps: emit failed:",i)}}}}function h(t,c){d=c;for(const r of t)if(!(!r||r[p]))try{for(const n of["jsx","jsxs","jsxDEV"]){const a=r[n];typeof a=="function"&&(r[n]=function(o,s,...i){return a.call(this,o,f(s),...i)})}const e=r.createElement;typeof e=="function"&&(r.createElement=function(n,a,...o){return e.call(this,n,f(a),...o)}),r[p]=!0}catch(e){u.debug.warn("autoTrackTaps: could not patch a JSX factory:",e)}}exports.patchElementFactories=h;exports.wrapProps=f;
2
+ //# sourceMappingURL=autoTaps.native-By9I4Kr2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoTaps.native-By9I4Kr2.cjs","sources":["../src/adapters/native/autoTaps.native.ts"],"sourcesContent":["// `autoTrackTaps` (#174, decisions #150/#154) — opt-in, native-only automatic capture of every\n// `onPress` (`ui.type: tap`) and `onLongPress` (`long_press`). It patches the JSX runtime's\n// `jsx`/`jsxs`/`jsxDEV` and `React.createElement` at init: Babel's automatic runtime reads\n// `(0, _jsxRuntime.jsx)(…)` at call time, so patching the module's exports object reaches\n// modules that were already loaded.\n//\n// Actionability *is* the prop — so there is still no `surface` on native — and the wrapper\n// fires on Pressable **activation**, never on touch, so a scroll drag emits nothing.\n\nimport { debug } from \"../../core/debug\";\n\nexport type AutoTapKind = \"tap\" | \"long_press\";\n\n/** What the entry hands in: called synchronously at activation, *before* the host handler. */\nexport type AutoTapSink = {\n /** Snapshot identity and mint the root now; returns the emit to run after the handler, or nothing. */\n prepare(kind: AutoTapKind, testID: unknown): (() => void) | undefined;\n /** Increments on every explicit `trackTap()` — an explicit call inside the handler wins. */\n explicitCount(): number;\n};\n\nconst PROPS: Record<string, AutoTapKind> = { onPress: \"tap\", onLongPress: \"long_press\" };\nconst PATCHED = Symbol.for(\"edge-telemetry.autoTaps\");\n\n/**\n * One activation is one row however many wrapped handlers it passes through — `AppButton →\n * Pressable` nests two, and the innermost element's wrapper is the first one called, so it\n * claims the event and the outer ones pass straight through. Shared across both props.\n */\nconst claimed = new WeakSet<object>();\n\n/**\n * The instance the wrappers report to. Module-level because the factories are patched once per\n * process: a second opted-in `Telemetry` takes over rather than stacking a second wrapper.\n */\nlet sink: AutoTapSink | undefined;\nconst cache = new WeakMap<Function, Map<unknown, Function>>();\n\nexport function wrapProps(props: any): any {\n if (!props || typeof props !== \"object\") return props;\n let out = props;\n for (const prop in PROPS) {\n const handler = props[prop];\n if (typeof handler !== \"function\") continue;\n // Keyed on (handler, testID): `onPress` keeps its identity across renders (no\n // `React.memo` breakage), and a handler shared by list rows keeps each row's name.\n let byId = cache.get(handler);\n if (!byId) cache.set(handler, (byId = new Map()));\n let wrapped = byId.get(props.testID);\n if (!wrapped) {\n wrapped = wrap(handler, PROPS[prop], props.testID);\n byId.set(props.testID, wrapped);\n }\n if (out === props) out = { ...props };\n out[prop] = wrapped;\n }\n return out;\n}\n\nfunction wrap(handler: Function, kind: AutoTapKind, testID: unknown): Function {\n return function (this: unknown, event?: unknown) {\n const s = sink;\n if (!s) return handler.apply(this, arguments as any);\n const claimable = event !== null && typeof event === \"object\";\n if (claimable && claimed.has(event as object)) return handler.apply(this, arguments as any);\n if (claimable) claimed.add(event as object);\n let emit: (() => void) | undefined;\n let before = 0;\n try {\n // Before the handler — it navigates on its first line, and the requests it fires\n // must be children of this tap's root, not of whatever was live before.\n emit = s.prepare(kind, testID);\n before = s.explicitCount();\n } catch (err) { debug.warn(\"autoTrackTaps: prepare failed:\", err); }\n try {\n return handler.apply(this, arguments as any);\n } finally {\n if (emit && s.explicitCount() === before) {\n try { emit(); } catch (err) { debug.warn(\"autoTrackTaps: emit failed:\", err); }\n }\n }\n };\n}\n\n/**\n * Patch the element factories on the given module exports objects (`react/jsx-runtime`,\n * `react/jsx-dev-runtime`, `react`). Idempotent per module. Never throws: a frozen exports\n * object just stays unpatched.\n */\nexport function patchElementFactories(modules: unknown[], next: AutoTapSink): void {\n sink = next;\n for (const mod of modules as any[]) {\n if (!mod || mod[PATCHED]) continue;\n try {\n for (const fn of [\"jsx\", \"jsxs\", \"jsxDEV\"]) {\n const orig = mod[fn];\n if (typeof orig !== \"function\") continue;\n mod[fn] = function (type: unknown, props: unknown, ...rest: unknown[]) {\n return orig.call(this, type, wrapProps(props), ...rest);\n };\n }\n const create = mod.createElement;\n if (typeof create === \"function\") {\n mod.createElement = function (type: unknown, props: unknown, ...children: unknown[]) {\n return create.call(this, type, wrapProps(props), ...children);\n };\n }\n mod[PATCHED] = true;\n } catch (err) {\n debug.warn(\"autoTrackTaps: could not patch a JSX factory:\", err);\n }\n }\n}\n"],"names":["PROPS","PATCHED","claimed","sink","cache","wrapProps","props","out","prop","handler","byId","wrapped","wrap","kind","testID","event","s","claimable","emit","before","err","debug","patchElementFactories","modules","next","mod","fn","orig","type","rest","create","children"],"mappings":"wHAqBMA,EAAqC,CAAE,QAAS,MAAO,YAAa,YAAA,EACpEC,EAAU,OAAO,IAAI,yBAAyB,EAO9CC,MAAc,QAMpB,IAAIC,EACJ,MAAMC,MAAY,QAEX,SAASC,EAAUC,EAAiB,CACvC,GAAI,CAACA,GAAS,OAAOA,GAAU,SAAU,OAAOA,EAChD,IAAIC,EAAMD,EACV,UAAWE,KAAQR,EAAO,CACtB,MAAMS,EAAUH,EAAME,CAAI,EAC1B,GAAI,OAAOC,GAAY,WAAY,SAGnC,IAAIC,EAAON,EAAM,IAAIK,CAAO,EACvBC,GAAMN,EAAM,IAAIK,EAAUC,EAAO,IAAI,GAAM,EAChD,IAAIC,EAAUD,EAAK,IAAIJ,EAAM,MAAM,EAC9BK,IACDA,EAAUC,EAAKH,EAAST,EAAMQ,CAAI,EAAGF,EAAM,MAAM,EACjDI,EAAK,IAAIJ,EAAM,OAAQK,CAAO,GAE9BJ,IAAQD,IAAOC,EAAM,CAAE,GAAGD,CAAA,GAC9BC,EAAIC,CAAI,EAAIG,CAChB,CACA,OAAOJ,CACX,CAEA,SAASK,EAAKH,EAAmBI,EAAmBC,EAA2B,CAC3E,OAAO,SAAyBC,EAAiB,CAC7C,MAAMC,EAAIb,EACV,GAAI,CAACa,EAAG,OAAOP,EAAQ,MAAM,KAAM,SAAgB,EACnD,MAAMQ,EAAYF,IAAU,MAAQ,OAAOA,GAAU,SACrD,GAAIE,GAAaf,EAAQ,IAAIa,CAAe,EAAG,OAAON,EAAQ,MAAM,KAAM,SAAgB,EACtFQ,GAAWf,EAAQ,IAAIa,CAAe,EAC1C,IAAIG,EACAC,EAAS,EACb,GAAI,CAGAD,EAAOF,EAAE,QAAQH,EAAMC,CAAM,EAC7BK,EAASH,EAAE,cAAA,CACf,OAASI,EAAK,CAAEC,QAAM,KAAK,iCAAkCD,CAAG,CAAG,CACnE,GAAI,CACA,OAAOX,EAAQ,MAAM,KAAM,SAAgB,CAC/C,QAAA,CACI,GAAIS,GAAQF,EAAE,cAAA,IAAoBG,EAC9B,GAAI,CAAED,EAAA,CAAQ,OAASE,EAAK,CAAEC,QAAM,KAAK,8BAA+BD,CAAG,CAAG,CAEtF,CACJ,CACJ,CAOO,SAASE,EAAsBC,EAAoBC,EAAyB,CAC/ErB,EAAOqB,EACP,UAAWC,KAAOF,EACd,GAAI,GAACE,GAAOA,EAAIxB,CAAO,GACvB,GAAI,CACA,UAAWyB,IAAM,CAAC,MAAO,OAAQ,QAAQ,EAAG,CACxC,MAAMC,EAAOF,EAAIC,CAAE,EACf,OAAOC,GAAS,aACpBF,EAAIC,CAAE,EAAI,SAAUE,EAAetB,KAAmBuB,EAAiB,CACnE,OAAOF,EAAK,KAAK,KAAMC,EAAMvB,EAAUC,CAAK,EAAG,GAAGuB,CAAI,CAC1D,EACJ,CACA,MAAMC,EAASL,EAAI,cACf,OAAOK,GAAW,aAClBL,EAAI,cAAgB,SAAUG,EAAetB,KAAmByB,EAAqB,CACjF,OAAOD,EAAO,KAAK,KAAMF,EAAMvB,EAAUC,CAAK,EAAG,GAAGyB,CAAQ,CAChE,GAEJN,EAAIxB,CAAO,EAAI,EACnB,OAASmB,EAAK,CACVC,QAAM,KAAK,gDAAiDD,CAAG,CACnE,CAER"}
@@ -0,0 +1,66 @@
1
+ import { d as s } from "./react-urNtDGTL.js";
2
+ const u = { onPress: "tap", onLongPress: "long_press" }, l = /* @__PURE__ */ Symbol.for("edge-telemetry.autoTaps"), p = /* @__PURE__ */ new WeakSet();
3
+ let d;
4
+ const y = /* @__PURE__ */ new WeakMap();
5
+ function m(t) {
6
+ if (!t || typeof t != "object") return t;
7
+ let o = t;
8
+ for (const r in u) {
9
+ const e = t[r];
10
+ if (typeof e != "function") continue;
11
+ let n = y.get(e);
12
+ n || y.set(e, n = /* @__PURE__ */ new Map());
13
+ let a = n.get(t.testID);
14
+ a || (a = h(e, u[r], t.testID), n.set(t.testID, a)), o === t && (o = { ...t }), o[r] = a;
15
+ }
16
+ return o;
17
+ }
18
+ function h(t, o, r) {
19
+ return function(e) {
20
+ const n = d;
21
+ if (!n) return t.apply(this, arguments);
22
+ const a = e !== null && typeof e == "object";
23
+ if (a && p.has(e)) return t.apply(this, arguments);
24
+ a && p.add(e);
25
+ let c, f = 0;
26
+ try {
27
+ c = n.prepare(o, r), f = n.explicitCount();
28
+ } catch (i) {
29
+ s.warn("autoTrackTaps: prepare failed:", i);
30
+ }
31
+ try {
32
+ return t.apply(this, arguments);
33
+ } finally {
34
+ if (c && n.explicitCount() === f)
35
+ try {
36
+ c();
37
+ } catch (i) {
38
+ s.warn("autoTrackTaps: emit failed:", i);
39
+ }
40
+ }
41
+ };
42
+ }
43
+ function w(t, o) {
44
+ d = o;
45
+ for (const r of t)
46
+ if (!(!r || r[l]))
47
+ try {
48
+ for (const n of ["jsx", "jsxs", "jsxDEV"]) {
49
+ const a = r[n];
50
+ typeof a == "function" && (r[n] = function(c, f, ...i) {
51
+ return a.call(this, c, m(f), ...i);
52
+ });
53
+ }
54
+ const e = r.createElement;
55
+ typeof e == "function" && (r.createElement = function(n, a, ...c) {
56
+ return e.call(this, n, m(a), ...c);
57
+ }), r[l] = !0;
58
+ } catch (e) {
59
+ s.warn("autoTrackTaps: could not patch a JSX factory:", e);
60
+ }
61
+ }
62
+ export {
63
+ w as patchElementFactories,
64
+ m as wrapProps
65
+ };
66
+ //# sourceMappingURL=autoTaps.native-DQCXevD7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoTaps.native-DQCXevD7.js","sources":["../src/adapters/native/autoTaps.native.ts"],"sourcesContent":["// `autoTrackTaps` (#174, decisions #150/#154) — opt-in, native-only automatic capture of every\n// `onPress` (`ui.type: tap`) and `onLongPress` (`long_press`). It patches the JSX runtime's\n// `jsx`/`jsxs`/`jsxDEV` and `React.createElement` at init: Babel's automatic runtime reads\n// `(0, _jsxRuntime.jsx)(…)` at call time, so patching the module's exports object reaches\n// modules that were already loaded.\n//\n// Actionability *is* the prop — so there is still no `surface` on native — and the wrapper\n// fires on Pressable **activation**, never on touch, so a scroll drag emits nothing.\n\nimport { debug } from \"../../core/debug\";\n\nexport type AutoTapKind = \"tap\" | \"long_press\";\n\n/** What the entry hands in: called synchronously at activation, *before* the host handler. */\nexport type AutoTapSink = {\n /** Snapshot identity and mint the root now; returns the emit to run after the handler, or nothing. */\n prepare(kind: AutoTapKind, testID: unknown): (() => void) | undefined;\n /** Increments on every explicit `trackTap()` — an explicit call inside the handler wins. */\n explicitCount(): number;\n};\n\nconst PROPS: Record<string, AutoTapKind> = { onPress: \"tap\", onLongPress: \"long_press\" };\nconst PATCHED = Symbol.for(\"edge-telemetry.autoTaps\");\n\n/**\n * One activation is one row however many wrapped handlers it passes through — `AppButton →\n * Pressable` nests two, and the innermost element's wrapper is the first one called, so it\n * claims the event and the outer ones pass straight through. Shared across both props.\n */\nconst claimed = new WeakSet<object>();\n\n/**\n * The instance the wrappers report to. Module-level because the factories are patched once per\n * process: a second opted-in `Telemetry` takes over rather than stacking a second wrapper.\n */\nlet sink: AutoTapSink | undefined;\nconst cache = new WeakMap<Function, Map<unknown, Function>>();\n\nexport function wrapProps(props: any): any {\n if (!props || typeof props !== \"object\") return props;\n let out = props;\n for (const prop in PROPS) {\n const handler = props[prop];\n if (typeof handler !== \"function\") continue;\n // Keyed on (handler, testID): `onPress` keeps its identity across renders (no\n // `React.memo` breakage), and a handler shared by list rows keeps each row's name.\n let byId = cache.get(handler);\n if (!byId) cache.set(handler, (byId = new Map()));\n let wrapped = byId.get(props.testID);\n if (!wrapped) {\n wrapped = wrap(handler, PROPS[prop], props.testID);\n byId.set(props.testID, wrapped);\n }\n if (out === props) out = { ...props };\n out[prop] = wrapped;\n }\n return out;\n}\n\nfunction wrap(handler: Function, kind: AutoTapKind, testID: unknown): Function {\n return function (this: unknown, event?: unknown) {\n const s = sink;\n if (!s) return handler.apply(this, arguments as any);\n const claimable = event !== null && typeof event === \"object\";\n if (claimable && claimed.has(event as object)) return handler.apply(this, arguments as any);\n if (claimable) claimed.add(event as object);\n let emit: (() => void) | undefined;\n let before = 0;\n try {\n // Before the handler — it navigates on its first line, and the requests it fires\n // must be children of this tap's root, not of whatever was live before.\n emit = s.prepare(kind, testID);\n before = s.explicitCount();\n } catch (err) { debug.warn(\"autoTrackTaps: prepare failed:\", err); }\n try {\n return handler.apply(this, arguments as any);\n } finally {\n if (emit && s.explicitCount() === before) {\n try { emit(); } catch (err) { debug.warn(\"autoTrackTaps: emit failed:\", err); }\n }\n }\n };\n}\n\n/**\n * Patch the element factories on the given module exports objects (`react/jsx-runtime`,\n * `react/jsx-dev-runtime`, `react`). Idempotent per module. Never throws: a frozen exports\n * object just stays unpatched.\n */\nexport function patchElementFactories(modules: unknown[], next: AutoTapSink): void {\n sink = next;\n for (const mod of modules as any[]) {\n if (!mod || mod[PATCHED]) continue;\n try {\n for (const fn of [\"jsx\", \"jsxs\", \"jsxDEV\"]) {\n const orig = mod[fn];\n if (typeof orig !== \"function\") continue;\n mod[fn] = function (type: unknown, props: unknown, ...rest: unknown[]) {\n return orig.call(this, type, wrapProps(props), ...rest);\n };\n }\n const create = mod.createElement;\n if (typeof create === \"function\") {\n mod.createElement = function (type: unknown, props: unknown, ...children: unknown[]) {\n return create.call(this, type, wrapProps(props), ...children);\n };\n }\n mod[PATCHED] = true;\n } catch (err) {\n debug.warn(\"autoTrackTaps: could not patch a JSX factory:\", err);\n }\n }\n}\n"],"names":["PROPS","PATCHED","claimed","sink","cache","wrapProps","props","out","prop","handler","byId","wrapped","wrap","kind","testID","event","s","claimable","emit","before","err","debug","patchElementFactories","modules","next","mod","fn","orig","type","rest","create","children"],"mappings":";AAqBA,MAAMA,IAAqC,EAAE,SAAS,OAAO,aAAa,aAAA,GACpEC,IAAU,uBAAO,IAAI,yBAAyB,GAO9CC,wBAAc,QAAA;AAMpB,IAAIC;AACJ,MAAMC,wBAAY,QAAA;AAEX,SAASC,EAAUC,GAAiB;AACvC,MAAI,CAACA,KAAS,OAAOA,KAAU,SAAU,QAAOA;AAChD,MAAIC,IAAMD;AACV,aAAWE,KAAQR,GAAO;AACtB,UAAMS,IAAUH,EAAME,CAAI;AAC1B,QAAI,OAAOC,KAAY,WAAY;AAGnC,QAAIC,IAAON,EAAM,IAAIK,CAAO;AAC5B,IAAKC,KAAMN,EAAM,IAAIK,GAAUC,IAAO,oBAAI,KAAM;AAChD,QAAIC,IAAUD,EAAK,IAAIJ,EAAM,MAAM;AACnC,IAAKK,MACDA,IAAUC,EAAKH,GAAST,EAAMQ,CAAI,GAAGF,EAAM,MAAM,GACjDI,EAAK,IAAIJ,EAAM,QAAQK,CAAO,IAE9BJ,MAAQD,MAAOC,IAAM,EAAE,GAAGD,EAAA,IAC9BC,EAAIC,CAAI,IAAIG;AAAA,EAChB;AACA,SAAOJ;AACX;AAEA,SAASK,EAAKH,GAAmBI,GAAmBC,GAA2B;AAC3E,SAAO,SAAyBC,GAAiB;AAC7C,UAAMC,IAAIb;AACV,QAAI,CAACa,EAAG,QAAOP,EAAQ,MAAM,MAAM,SAAgB;AACnD,UAAMQ,IAAYF,MAAU,QAAQ,OAAOA,KAAU;AACrD,QAAIE,KAAaf,EAAQ,IAAIa,CAAe,EAAG,QAAON,EAAQ,MAAM,MAAM,SAAgB;AAC1F,IAAIQ,KAAWf,EAAQ,IAAIa,CAAe;AAC1C,QAAIG,GACAC,IAAS;AACb,QAAI;AAGA,MAAAD,IAAOF,EAAE,QAAQH,GAAMC,CAAM,GAC7BK,IAASH,EAAE,cAAA;AAAA,IACf,SAASI,GAAK;AAAE,MAAAC,EAAM,KAAK,kCAAkCD,CAAG;AAAA,IAAG;AACnE,QAAI;AACA,aAAOX,EAAQ,MAAM,MAAM,SAAgB;AAAA,IAC/C,UAAA;AACI,UAAIS,KAAQF,EAAE,cAAA,MAAoBG;AAC9B,YAAI;AAAE,UAAAD,EAAA;AAAA,QAAQ,SAASE,GAAK;AAAE,UAAAC,EAAM,KAAK,+BAA+BD,CAAG;AAAA,QAAG;AAAA,IAEtF;AAAA,EACJ;AACJ;AAOO,SAASE,EAAsBC,GAAoBC,GAAyB;AAC/E,EAAArB,IAAOqB;AACP,aAAWC,KAAOF;AACd,QAAI,GAACE,KAAOA,EAAIxB,CAAO;AACvB,UAAI;AACA,mBAAWyB,KAAM,CAAC,OAAO,QAAQ,QAAQ,GAAG;AACxC,gBAAMC,IAAOF,EAAIC,CAAE;AACnB,UAAI,OAAOC,KAAS,eACpBF,EAAIC,CAAE,IAAI,SAAUE,GAAetB,MAAmBuB,GAAiB;AACnE,mBAAOF,EAAK,KAAK,MAAMC,GAAMvB,EAAUC,CAAK,GAAG,GAAGuB,CAAI;AAAA,UAC1D;AAAA,QACJ;AACA,cAAMC,IAASL,EAAI;AACnB,QAAI,OAAOK,KAAW,eAClBL,EAAI,gBAAgB,SAAUG,GAAetB,MAAmByB,GAAqB;AACjF,iBAAOD,EAAO,KAAK,MAAMF,GAAMvB,EAAUC,CAAK,GAAG,GAAGyB,CAAQ;AAAA,QAChE,IAEJN,EAAIxB,CAAO,IAAI;AAAA,MACnB,SAASmB,GAAK;AACV,QAAAC,EAAM,KAAK,iDAAiDD,CAAG;AAAA,MACnE;AAER;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./react-bqe7KPOf.cjs");class i{constructor(t){this.telemetry=t}attach(t={}){const{captureConsole:a=!1}=t;return new Promise((n,s)=>{try{window.onerror=(e,u,d,h,o)=>{if(r.isBoundaryCaught(o))return;const l=o?"global_handler":"cross_origin";this.telemetry.log("app.crash",r.buildErrorAttributes(l,o,{fallbackMessage:e}))},window.onunhandledrejection=e=>{r.isBoundaryCaught(e.reason)||this.telemetry.log("app.crash",r.buildErrorAttributes("unhandled_rejection",e.reason,{fallbackMessage:"Unhandled Promise Rejection"}))},a&&r.captureConsole(this.telemetry),n()}catch(e){s(e)}})}}exports.CrashHandler=i;
2
+ //# sourceMappingURL=crashHandler.web-6KvedEB-.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crashHandler.web-6KvedEB-.cjs","sources":["../src/adapters/web/crashHandler.web.ts"],"sourcesContent":["import { Telemetry } from \"../../core/telemetry\";\nimport { buildErrorAttributes, captureConsole, isBoundaryCaught } from \"../crashCapture\";\n\nexport type CrashHandlerOptions = { captureConsole?: boolean };\n\nexport class CrashHandler {\n constructor(private telemetry: Telemetry) { }\n\n // Lockstep with native: JS errors and unhandled rejections become `app.crash`;\n // console.error becomes `app.error` and console.warn a breadcrumb, both opt-in. §4.7, #100\n attach(options: CrashHandlerOptions = {}): Promise<void> {\n const { captureConsole: consoleEnabled = false } = options;\n return new Promise((resolve, reject) => {\n try {\n window.onerror = (msg, _url, _line, _col, error) => {\n // React's dev build rethrows a boundary-caught error here; it is already a row (#166).\n if (isBoundaryCaught(error)) return;\n // ⚠ `error === undefined` is the cross-origin instrumentation gap, not a\n // mystery Error: a bundle served from a CDN without CORS headers yields the\n // classic \"Script error.\" with no stack. Naming it beats collapsing it.\n const source = error ? \"global_handler\" : \"cross_origin\";\n // No `fatal` on web — nothing here is fatal, the page keeps running (§4.7).\n this.telemetry.log(\"app.crash\", buildErrorAttributes(source, error, { fallbackMessage: msg }));\n };\n\n window.onunhandledrejection = (event) => {\n if (isBoundaryCaught(event.reason)) return;\n this.telemetry.log(\"app.crash\", buildErrorAttributes(\"unhandled_rejection\", event.reason, {\n fallbackMessage: \"Unhandled Promise Rejection\",\n }));\n };\n\n if (consoleEnabled) captureConsole(this.telemetry);\n\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n }\n}\n"],"names":["CrashHandler","telemetry","options","consoleEnabled","resolve","reject","msg","_url","_line","_col","error","isBoundaryCaught","source","buildErrorAttributes","event","captureConsole"],"mappings":"wHAKO,MAAMA,CAAa,CACtB,YAAoBC,EAAsB,CAAtB,KAAA,UAAAA,CAAwB,CAI5C,OAAOC,EAA+B,GAAmB,CACrD,KAAM,CAAE,eAAgBC,EAAiB,EAAA,EAAUD,EACnD,OAAO,IAAI,QAAQ,CAACE,EAASC,IAAW,CACpC,GAAI,CACA,OAAO,QAAU,CAACC,EAAKC,EAAMC,EAAOC,EAAMC,IAAU,CAEhD,GAAIC,EAAAA,iBAAiBD,CAAK,EAAG,OAI7B,MAAME,EAASF,EAAQ,iBAAmB,eAE1C,KAAK,UAAU,IAAI,YAAaG,EAAAA,qBAAqBD,EAAQF,EAAO,CAAE,gBAAiBJ,CAAA,CAAK,CAAC,CACjG,EAEA,OAAO,qBAAwBQ,GAAU,CACjCH,EAAAA,iBAAiBG,EAAM,MAAM,GACjC,KAAK,UAAU,IAAI,YAAaD,EAAAA,qBAAqB,sBAAuBC,EAAM,OAAQ,CACtF,gBAAiB,6BAAA,CACpB,CAAC,CACN,EAEIX,GAAgBY,EAAAA,eAAe,KAAK,SAAS,EAEjDX,EAAA,CACJ,OAASM,EAAO,CACZL,EAAOK,CAAK,CAChB,CACJ,CAAC,CACL,CACJ"}
@@ -0,0 +1,30 @@
1
+ import { i as t, b as a, c as i } from "./react-urNtDGTL.js";
2
+ class b {
3
+ constructor(r) {
4
+ this.telemetry = r;
5
+ }
6
+ // Lockstep with native: JS errors and unhandled rejections become `app.crash`;
7
+ // console.error becomes `app.error` and console.warn a breadcrumb, both opt-in. §4.7, #100
8
+ attach(r = {}) {
9
+ const { captureConsole: s = !1 } = r;
10
+ return new Promise((n, l) => {
11
+ try {
12
+ window.onerror = (e, u, d, m, o) => {
13
+ if (t(o)) return;
14
+ const c = o ? "global_handler" : "cross_origin";
15
+ this.telemetry.log("app.crash", a(c, o, { fallbackMessage: e }));
16
+ }, window.onunhandledrejection = (e) => {
17
+ t(e.reason) || this.telemetry.log("app.crash", a("unhandled_rejection", e.reason, {
18
+ fallbackMessage: "Unhandled Promise Rejection"
19
+ }));
20
+ }, s && i(this.telemetry), n();
21
+ } catch (e) {
22
+ l(e);
23
+ }
24
+ });
25
+ }
26
+ }
27
+ export {
28
+ b as CrashHandler
29
+ };
30
+ //# sourceMappingURL=crashHandler.web-BUlSXYoS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crashHandler.web-BUlSXYoS.js","sources":["../src/adapters/web/crashHandler.web.ts"],"sourcesContent":["import { Telemetry } from \"../../core/telemetry\";\nimport { buildErrorAttributes, captureConsole, isBoundaryCaught } from \"../crashCapture\";\n\nexport type CrashHandlerOptions = { captureConsole?: boolean };\n\nexport class CrashHandler {\n constructor(private telemetry: Telemetry) { }\n\n // Lockstep with native: JS errors and unhandled rejections become `app.crash`;\n // console.error becomes `app.error` and console.warn a breadcrumb, both opt-in. §4.7, #100\n attach(options: CrashHandlerOptions = {}): Promise<void> {\n const { captureConsole: consoleEnabled = false } = options;\n return new Promise((resolve, reject) => {\n try {\n window.onerror = (msg, _url, _line, _col, error) => {\n // React's dev build rethrows a boundary-caught error here; it is already a row (#166).\n if (isBoundaryCaught(error)) return;\n // ⚠ `error === undefined` is the cross-origin instrumentation gap, not a\n // mystery Error: a bundle served from a CDN without CORS headers yields the\n // classic \"Script error.\" with no stack. Naming it beats collapsing it.\n const source = error ? \"global_handler\" : \"cross_origin\";\n // No `fatal` on web — nothing here is fatal, the page keeps running (§4.7).\n this.telemetry.log(\"app.crash\", buildErrorAttributes(source, error, { fallbackMessage: msg }));\n };\n\n window.onunhandledrejection = (event) => {\n if (isBoundaryCaught(event.reason)) return;\n this.telemetry.log(\"app.crash\", buildErrorAttributes(\"unhandled_rejection\", event.reason, {\n fallbackMessage: \"Unhandled Promise Rejection\",\n }));\n };\n\n if (consoleEnabled) captureConsole(this.telemetry);\n\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n }\n}\n"],"names":["CrashHandler","telemetry","options","consoleEnabled","resolve","reject","msg","_url","_line","_col","error","isBoundaryCaught","source","buildErrorAttributes","event","captureConsole"],"mappings":";AAKO,MAAMA,EAAa;AAAA,EACtB,YAAoBC,GAAsB;AAAtB,SAAA,YAAAA;AAAA,EAAwB;AAAA;AAAA;AAAA,EAI5C,OAAOC,IAA+B,IAAmB;AACrD,UAAM,EAAE,gBAAgBC,IAAiB,GAAA,IAAUD;AACnD,WAAO,IAAI,QAAQ,CAACE,GAASC,MAAW;AACpC,UAAI;AACA,eAAO,UAAU,CAACC,GAAKC,GAAMC,GAAOC,GAAMC,MAAU;AAEhD,cAAIC,EAAiBD,CAAK,EAAG;AAI7B,gBAAME,IAASF,IAAQ,mBAAmB;AAE1C,eAAK,UAAU,IAAI,aAAaG,EAAqBD,GAAQF,GAAO,EAAE,iBAAiBJ,EAAA,CAAK,CAAC;AAAA,QACjG,GAEA,OAAO,uBAAuB,CAACQ,MAAU;AACrC,UAAIH,EAAiBG,EAAM,MAAM,KACjC,KAAK,UAAU,IAAI,aAAaD,EAAqB,uBAAuBC,EAAM,QAAQ;AAAA,YACtF,iBAAiB;AAAA,UAAA,CACpB,CAAC;AAAA,QACN,GAEIX,KAAgBY,EAAe,KAAK,SAAS,GAEjDX,EAAA;AAAA,MACJ,SAASM,GAAO;AACZ,QAAAL,EAAOK,CAAK;AAAA,MAChB;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./react-bqe7KPOf.cjs");class d{constructor(n){this.telemetry=n}attach(n={}){const{captureConsole:o=!1}=n;return new Promise((s,i)=>{try{if(typeof ErrorUtils<"u"&&ErrorUtils.setGlobalHandler){const e=ErrorUtils.getGlobalHandler?.();ErrorUtils.setGlobalHandler((a,l)=>{t.isBoundaryCaught(a)||this.telemetry.log("app.crash",t.buildErrorAttributes("global_handler",a,{fatal:!!l})),e&&e(a,l)})}const r=e=>{t.isBoundaryCaught(e?.reason)||this.telemetry.log("app.crash",t.buildErrorAttributes("unhandled_rejection",e?.reason,{fallbackMessage:"Unhandled Promise Rejection",fatal:!1}))};globalThis.addEventListener?globalThis.addEventListener("unhandledrejection",r):require("promise/setimmediate/rejection-tracking").enable({allRejections:!0,onUnhandled:(a,l)=>r({reason:l})}),o&&t.captureConsole(this.telemetry),s()}catch(r){i(r)}})}}exports.CrashHandlerNative=d;
2
+ //# sourceMappingURL=crashHandlerNative.native-CFVQ5UcO.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crashHandlerNative.native-CFVQ5UcO.cjs","sources":["../src/adapters/native/crashHandlerNative.native.ts"],"sourcesContent":["import { Telemetry } from \"../../core/telemetry\";\nimport { buildErrorAttributes, captureConsole, isBoundaryCaught } from \"../crashCapture\";\n\nexport type CrashHandlerOptions = { captureConsole?: boolean };\n\nexport class CrashHandlerNative {\n constructor(private telemetry: Telemetry) { }\n\n // JS errors and unhandled rejections become `app.crash`; console.error becomes\n // `app.error` and console.warn a breadcrumb, both opt-in (default off). §4.7, #100\n attach(options: CrashHandlerOptions = {}): Promise<void> {\n const { captureConsole: consoleEnabled = false } = options;\n return new Promise((resolve, reject) => {\n try {\n if (typeof ErrorUtils !== \"undefined\" && ErrorUtils.setGlobalHandler) {\n const defaultHandler = ErrorUtils.getGlobalHandler?.();\n ErrorUtils.setGlobalHandler((error: any, isFatal?: boolean) => {\n // `error.fatal` is native-only — the web build never passes it (§4.7).\n // A boundary-caught error is already a row (#166); RN's handler still runs.\n if (!isBoundaryCaught(error)) this.telemetry.log(\"app.crash\", buildErrorAttributes(\"global_handler\", error, {\n fatal: !!isFatal,\n }));\n if (defaultHandler) defaultHandler(error, isFatal); // keep RN red screen in dev\n });\n }\n\n const onRejection = (event: any) => {\n if (isBoundaryCaught(event?.reason)) return;\n this.telemetry.log(\"app.crash\", buildErrorAttributes(\"unhandled_rejection\", event?.reason, {\n fallbackMessage: \"Unhandled Promise Rejection\",\n fatal: false,\n }));\n };\n\n if (globalThis.addEventListener) {\n globalThis.addEventListener(\"unhandledrejection\", onRejection);\n } else {\n const tracking = require(\"promise/setimmediate/rejection-tracking\");\n tracking.enable({\n allRejections: true,\n onUnhandled: (_id: any, error: any) =>\n onRejection({ reason: error }),\n });\n }\n\n if (consoleEnabled) captureConsole(this.telemetry);\n\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n }\n}\n"],"names":["CrashHandlerNative","telemetry","options","consoleEnabled","resolve","reject","defaultHandler","error","isFatal","isBoundaryCaught","buildErrorAttributes","onRejection","event","_id","captureConsole"],"mappings":"wHAKO,MAAMA,CAAmB,CAC5B,YAAoBC,EAAsB,CAAtB,KAAA,UAAAA,CAAwB,CAI5C,OAAOC,EAA+B,GAAmB,CACrD,KAAM,CAAE,eAAgBC,EAAiB,EAAA,EAAUD,EACnD,OAAO,IAAI,QAAQ,CAACE,EAASC,IAAW,CACpC,GAAI,CACA,GAAI,OAAO,WAAe,KAAe,WAAW,iBAAkB,CAClE,MAAMC,EAAiB,WAAW,mBAAA,EAClC,WAAW,iBAAiB,CAACC,EAAYC,IAAsB,CAGtDC,EAAAA,iBAAiBF,CAAK,GAAG,KAAK,UAAU,IAAI,YAAaG,EAAAA,qBAAqB,iBAAkBH,EAAO,CACxG,MAAO,CAAC,CAACC,CAAA,CACZ,CAAC,EACEF,GAAgBA,EAAeC,EAAOC,CAAO,CACrD,CAAC,CACL,CAEA,MAAMG,EAAeC,GAAe,CAC5BH,EAAAA,iBAAiBG,GAAO,MAAM,GAClC,KAAK,UAAU,IAAI,YAAaF,EAAAA,qBAAqB,sBAAuBE,GAAO,OAAQ,CACvF,gBAAiB,8BACjB,MAAO,EAAA,CACV,CAAC,CACN,EAEI,WAAW,iBACX,WAAW,iBAAiB,qBAAsBD,CAAW,EAE5C,QAAQ,yCAAyC,EACzD,OAAO,CACZ,cAAe,GACf,YAAa,CAACE,EAAUN,IACpBI,EAAY,CAAE,OAAQJ,EAAO,CAAA,CACpC,EAGDJ,GAAgBW,EAAAA,eAAe,KAAK,SAAS,EAEjDV,EAAA,CACJ,OAASG,EAAO,CACZF,EAAOE,CAAK,CAChB,CACJ,CAAC,CACL,CACJ"}
@@ -0,0 +1,39 @@
1
+ import { i as n, b as s, c } from "./react-urNtDGTL.js";
2
+ class u {
3
+ constructor(l) {
4
+ this.telemetry = l;
5
+ }
6
+ // JS errors and unhandled rejections become `app.crash`; console.error becomes
7
+ // `app.error` and console.warn a breadcrumb, both opt-in (default off). §4.7, #100
8
+ attach(l = {}) {
9
+ const { captureConsole: o = !1 } = l;
10
+ return new Promise((i, d) => {
11
+ try {
12
+ if (typeof ErrorUtils < "u" && ErrorUtils.setGlobalHandler) {
13
+ const e = ErrorUtils.getGlobalHandler?.();
14
+ ErrorUtils.setGlobalHandler((r, a) => {
15
+ n(r) || this.telemetry.log("app.crash", s("global_handler", r, {
16
+ fatal: !!a
17
+ })), e && e(r, a);
18
+ });
19
+ }
20
+ const t = (e) => {
21
+ n(e?.reason) || this.telemetry.log("app.crash", s("unhandled_rejection", e?.reason, {
22
+ fallbackMessage: "Unhandled Promise Rejection",
23
+ fatal: !1
24
+ }));
25
+ };
26
+ globalThis.addEventListener ? globalThis.addEventListener("unhandledrejection", t) : require("promise/setimmediate/rejection-tracking").enable({
27
+ allRejections: !0,
28
+ onUnhandled: (r, a) => t({ reason: a })
29
+ }), o && c(this.telemetry), i();
30
+ } catch (t) {
31
+ d(t);
32
+ }
33
+ });
34
+ }
35
+ }
36
+ export {
37
+ u as CrashHandlerNative
38
+ };
39
+ //# sourceMappingURL=crashHandlerNative.native-DsCRd-oN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crashHandlerNative.native-DsCRd-oN.js","sources":["../src/adapters/native/crashHandlerNative.native.ts"],"sourcesContent":["import { Telemetry } from \"../../core/telemetry\";\nimport { buildErrorAttributes, captureConsole, isBoundaryCaught } from \"../crashCapture\";\n\nexport type CrashHandlerOptions = { captureConsole?: boolean };\n\nexport class CrashHandlerNative {\n constructor(private telemetry: Telemetry) { }\n\n // JS errors and unhandled rejections become `app.crash`; console.error becomes\n // `app.error` and console.warn a breadcrumb, both opt-in (default off). §4.7, #100\n attach(options: CrashHandlerOptions = {}): Promise<void> {\n const { captureConsole: consoleEnabled = false } = options;\n return new Promise((resolve, reject) => {\n try {\n if (typeof ErrorUtils !== \"undefined\" && ErrorUtils.setGlobalHandler) {\n const defaultHandler = ErrorUtils.getGlobalHandler?.();\n ErrorUtils.setGlobalHandler((error: any, isFatal?: boolean) => {\n // `error.fatal` is native-only — the web build never passes it (§4.7).\n // A boundary-caught error is already a row (#166); RN's handler still runs.\n if (!isBoundaryCaught(error)) this.telemetry.log(\"app.crash\", buildErrorAttributes(\"global_handler\", error, {\n fatal: !!isFatal,\n }));\n if (defaultHandler) defaultHandler(error, isFatal); // keep RN red screen in dev\n });\n }\n\n const onRejection = (event: any) => {\n if (isBoundaryCaught(event?.reason)) return;\n this.telemetry.log(\"app.crash\", buildErrorAttributes(\"unhandled_rejection\", event?.reason, {\n fallbackMessage: \"Unhandled Promise Rejection\",\n fatal: false,\n }));\n };\n\n if (globalThis.addEventListener) {\n globalThis.addEventListener(\"unhandledrejection\", onRejection);\n } else {\n const tracking = require(\"promise/setimmediate/rejection-tracking\");\n tracking.enable({\n allRejections: true,\n onUnhandled: (_id: any, error: any) =>\n onRejection({ reason: error }),\n });\n }\n\n if (consoleEnabled) captureConsole(this.telemetry);\n\n resolve();\n } catch (error) {\n reject(error);\n }\n });\n }\n}\n"],"names":["CrashHandlerNative","telemetry","options","consoleEnabled","resolve","reject","defaultHandler","error","isFatal","isBoundaryCaught","buildErrorAttributes","onRejection","event","_id","captureConsole"],"mappings":";AAKO,MAAMA,EAAmB;AAAA,EAC5B,YAAoBC,GAAsB;AAAtB,SAAA,YAAAA;AAAA,EAAwB;AAAA;AAAA;AAAA,EAI5C,OAAOC,IAA+B,IAAmB;AACrD,UAAM,EAAE,gBAAgBC,IAAiB,GAAA,IAAUD;AACnD,WAAO,IAAI,QAAQ,CAACE,GAASC,MAAW;AACpC,UAAI;AACA,YAAI,OAAO,aAAe,OAAe,WAAW,kBAAkB;AAClE,gBAAMC,IAAiB,WAAW,mBAAA;AAClC,qBAAW,iBAAiB,CAACC,GAAYC,MAAsB;AAG3D,YAAKC,EAAiBF,CAAK,KAAG,KAAK,UAAU,IAAI,aAAaG,EAAqB,kBAAkBH,GAAO;AAAA,cACxG,OAAO,CAAC,CAACC;AAAA,YAAA,CACZ,CAAC,GACEF,KAAgBA,EAAeC,GAAOC,CAAO;AAAA,UACrD,CAAC;AAAA,QACL;AAEA,cAAMG,IAAc,CAACC,MAAe;AAChC,UAAIH,EAAiBG,GAAO,MAAM,KAClC,KAAK,UAAU,IAAI,aAAaF,EAAqB,uBAAuBE,GAAO,QAAQ;AAAA,YACvF,iBAAiB;AAAA,YACjB,OAAO;AAAA,UAAA,CACV,CAAC;AAAA,QACN;AAEA,QAAI,WAAW,mBACX,WAAW,iBAAiB,sBAAsBD,CAAW,IAE5C,QAAQ,yCAAyC,EACzD,OAAO;AAAA,UACZ,eAAe;AAAA,UACf,aAAa,CAACE,GAAUN,MACpBI,EAAY,EAAE,QAAQJ,GAAO;AAAA,QAAA,CACpC,GAGDJ,KAAgBW,EAAe,KAAK,SAAS,GAEjDV,EAAA;AAAA,MACJ,SAASG,GAAO;AACZ,QAAAF,EAAOE,CAAK;AAAA,MAChB;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react-native"),e=require("react-native-device-info"),N=require("./viewport-9JcVIXYF.cjs");class S{constructor(){}async collect(){const o=await e.getApplicationName()||"UnknownApp",n=await e.getVersion()||"0.0.0",r=await e.getBuildNumber()||"0",s=await e.getBundleId()||"unknown.package",c=await e.getBrand(),d=await e.getManufacturer()||"",m=await e.getModel()||"",i=await e.getSystemVersion()||"",l=await e.getSystemName()||"",a=t.Platform.OS==="android"?await e.getApiLevel():void 0,w=t.Platform.OS==="android"?await e.getHardware?.():void 0,p=t.Platform.OS==="android"?await e.getProduct?.():void 0,u=t.Platform.OS==="ios"?l:void 0,v=(await e.supportedAbis?.())?.[0],g=await e.isLowRamDevice?.(),{width:f,height:b}=t.Dimensions.get("window"),y=N.viewportKeys(f,b,t.PixelRatio.get());return{app:{name:o,version:n,build_number:r,package_name:s},device:{platform:t.Platform.OS,platform_version:i,model:m,manufacturer:d,brand:c,android_sdk:typeof a=="number"&&a>0?a:void 0,android_release:t.Platform.OS==="android"?i:void 0,hardware:w,product:p,cpu_abi:v,low_ram:g,system_name:u,...y}}}async start(o){}}exports.DeviceInfoTrackerNative=S;
2
+ //# sourceMappingURL=deviceInfo.native-D5gNBG7m.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceInfo.native-D5gNBG7m.cjs","sources":["../src/adapters/native/deviceInfo.native.ts"],"sourcesContent":["// adapters/native/deviceInfoNative.native.ts\nimport { Dimensions, PixelRatio, Platform } from \"react-native\";\nimport DeviceInfoLib from \"react-native-device-info\";\nimport { Telemetry } from \"../../core/telemetry\";\nimport { DeviceInfo } from \"../../core/telemetry\";\nimport { viewportKeys } from \"../viewport\";\n\nexport class DeviceInfoTrackerNative {\n // private telemetry: Telemetry;\n\n // constructor(telemetry?: Telemetry) {\n // this.telemetry = telemetry || new Telemetry();\n // }\n\n constructor() {\n }\n\n // device.id is NOT collected here (#91): it is self-minted and persisted by core.\n // getUniqueId() carries two lifetimes on RN alone — ANDROID_ID survives reinstall,\n // identifierForVendor does not — so one identity column would mean two things.\n async collect(): Promise<DeviceInfo> {\n // 🔹 App metadata\n const appName = (await DeviceInfoLib.getApplicationName()) || \"UnknownApp\";\n const appVersion = (await DeviceInfoLib.getVersion()) || \"0.0.0\";\n const buildNumber = (await DeviceInfoLib.getBuildNumber()) || \"0\";\n const packageName = (await DeviceInfoLib.getBundleId()) || \"unknown.package\";\n\n // 🔹 Common Device metadata\n const brand = await DeviceInfoLib.getBrand();\n const manufacturer = (await DeviceInfoLib.getManufacturer()) || \"\";\n const model = (await DeviceInfoLib.getModel()) || \"\";\n const systemVersion = (await DeviceInfoLib.getSystemVersion()) || \"\";\n const systemName = (await DeviceInfoLib.getSystemName()) || \"\"; // iOS: \"iOS\", Android: \"Android\"\n\n // 🔹 Android-only fields\n const sdk = Platform.OS === \"android\" ? await DeviceInfoLib.getApiLevel() : undefined;\n const hardware = Platform.OS === \"android\" ? await DeviceInfoLib.getHardware?.() : undefined;\n const product = Platform.OS === \"android\" ? await DeviceInfoLib.getProduct?.() : undefined;\n\n // 🔹 iOS-only fields\n // ⚠ `getDeviceName()` — the user's own name for their phone — is deliberately NOT\n // read any more (§3.4): real PII, no column, no reader. `getFingerprint()` went with\n // it — a build string that merges handsets, which *repairs* device identity (§1.2).\n const iosSystemName = Platform.OS === \"ios\" ? systemName : undefined;\n\n // 🔹 §3.3 ✱ — device capability (native only) and viewport (both builds).\n const cpuAbi = (await DeviceInfoLib.supportedAbis?.())?.[0];\n const lowRam = await DeviceInfoLib.isLowRamDevice?.();\n\n // Read on every collect(), not cached: a device rotates mid-session, and §3.1 puts\n // `device.orientation` and device state on the log-time side of the freeze. The\n // *shaping* is shared with web (`adapters/viewport.ts`) so one column cannot come to\n // mean physical pixels on one build and dp on the other.\n const { width, height } = Dimensions.get(\"window\");\n const viewport = viewportKeys(width, height, PixelRatio.get());\n\n const info: DeviceInfo = {\n app: {\n name: appName,\n version: appVersion,\n build_number: buildNumber,\n package_name: packageName,\n },\n device: {\n platform: Platform.OS,\n platform_version: systemVersion,\n model,\n manufacturer,\n brand,\n\n // Android fields\n android_sdk: typeof sdk === \"number\" && sdk > 0 ? sdk : undefined,\n android_release: Platform.OS === \"android\" ? systemVersion : undefined,\n hardware,\n product,\n cpu_abi: cpuAbi,\n low_ram: lowRam,\n\n // iOS fields\n system_name: iosSystemName,\n\n // Viewport — both builds, never null (§3.3)\n ...viewport,\n },\n };\n\n return info;\n }\n\n /**\n * Context-only adapter. collect() feeds the Context block on every event;\n * start() emits no standalone device_info event (ADR-0002).\n */\n async start(_telemetry: Telemetry): Promise<void> {\n // no-op: device metadata rides as attributes on every event\n }\n}\n"],"names":["DeviceInfoTrackerNative","appName","DeviceInfoLib","appVersion","buildNumber","packageName","brand","manufacturer","model","systemVersion","systemName","sdk","Platform","hardware","product","iosSystemName","cpuAbi","lowRam","width","height","Dimensions","viewport","viewportKeys","PixelRatio","_telemetry"],"mappings":"2LAOO,MAAMA,CAAwB,CAOjC,aAAc,CACd,CAKA,MAAM,SAA+B,CAEjC,MAAMC,EAAW,MAAMC,EAAc,mBAAA,GAAyB,aACxDC,EAAc,MAAMD,EAAc,WAAA,GAAiB,QACnDE,EAAe,MAAMF,EAAc,eAAA,GAAqB,IACxDG,EAAe,MAAMH,EAAc,YAAA,GAAkB,kBAGrDI,EAAQ,MAAMJ,EAAc,SAAA,EAC5BK,EAAgB,MAAML,EAAc,gBAAA,GAAsB,GAC1DM,EAAS,MAAMN,EAAc,SAAA,GAAe,GAC5CO,EAAiB,MAAMP,EAAc,iBAAA,GAAuB,GAC5DQ,EAAc,MAAMR,EAAc,cAAA,GAAoB,GAGtDS,EAAMC,EAAAA,SAAS,KAAO,UAAY,MAAMV,EAAc,cAAgB,OACtEW,EAAWD,EAAAA,SAAS,KAAO,UAAY,MAAMV,EAAc,gBAAkB,OAC7EY,EAAUF,EAAAA,SAAS,KAAO,UAAY,MAAMV,EAAc,eAAiB,OAM3Ea,EAAgBH,EAAAA,SAAS,KAAO,MAAQF,EAAa,OAGrDM,GAAU,MAAMd,EAAc,gBAAA,KAAqB,CAAC,EACpDe,EAAS,MAAMf,EAAc,iBAAA,EAM7B,CAAE,MAAAgB,EAAO,OAAAC,CAAA,EAAWC,EAAAA,WAAW,IAAI,QAAQ,EAC3CC,EAAWC,EAAAA,aAAaJ,EAAOC,EAAQI,EAAAA,WAAW,KAAK,EAgC7D,MA9ByB,CACrB,IAAK,CACD,KAAMtB,EACN,QAASE,EACT,aAAcC,EACd,aAAcC,CAAA,EAElB,OAAQ,CACJ,SAAUO,EAAAA,SAAS,GACnB,iBAAkBH,EAClB,MAAAD,EACA,aAAAD,EACA,MAAAD,EAGA,YAAa,OAAOK,GAAQ,UAAYA,EAAM,EAAIA,EAAM,OACxD,gBAAiBC,EAAAA,SAAS,KAAO,UAAYH,EAAgB,OAC7D,SAAAI,EACA,QAAAC,EACA,QAASE,EACT,QAASC,EAGT,YAAaF,EAGb,GAAGM,CAAA,CACP,CAIR,CAMA,MAAM,MAAMG,EAAsC,CAElD,CACJ"}
@@ -0,0 +1,53 @@
1
+ import { Platform as a, Dimensions as N, PixelRatio as S } from "react-native";
2
+ import t from "react-native-device-info";
3
+ import { v as _ } from "./viewport-GWTEBt2K.js";
4
+ class V {
5
+ // private telemetry: Telemetry;
6
+ // constructor(telemetry?: Telemetry) {
7
+ // this.telemetry = telemetry || new Telemetry();
8
+ // }
9
+ constructor() {
10
+ }
11
+ // device.id is NOT collected here (#91): it is self-minted and persisted by core.
12
+ // getUniqueId() carries two lifetimes on RN alone — ANDROID_ID survives reinstall,
13
+ // identifierForVendor does not — so one identity column would mean two things.
14
+ async collect() {
15
+ const o = await t.getApplicationName() || "UnknownApp", n = await t.getVersion() || "0.0.0", r = await t.getBuildNumber() || "0", s = await t.getBundleId() || "unknown.package", c = await t.getBrand(), d = await t.getManufacturer() || "", m = await t.getModel() || "", i = await t.getSystemVersion() || "", p = await t.getSystemName() || "", e = a.OS === "android" ? await t.getApiLevel() : void 0, w = a.OS === "android" ? await t.getHardware?.() : void 0, u = a.OS === "android" ? await t.getProduct?.() : void 0, l = a.OS === "ios" ? p : void 0, g = (await t.supportedAbis?.())?.[0], v = await t.isLowRamDevice?.(), { width: f, height: b } = N.get("window"), y = _(f, b, S.get());
16
+ return {
17
+ app: {
18
+ name: o,
19
+ version: n,
20
+ build_number: r,
21
+ package_name: s
22
+ },
23
+ device: {
24
+ platform: a.OS,
25
+ platform_version: i,
26
+ model: m,
27
+ manufacturer: d,
28
+ brand: c,
29
+ // Android fields
30
+ android_sdk: typeof e == "number" && e > 0 ? e : void 0,
31
+ android_release: a.OS === "android" ? i : void 0,
32
+ hardware: w,
33
+ product: u,
34
+ cpu_abi: g,
35
+ low_ram: v,
36
+ // iOS fields
37
+ system_name: l,
38
+ // Viewport — both builds, never null (§3.3)
39
+ ...y
40
+ }
41
+ };
42
+ }
43
+ /**
44
+ * Context-only adapter. collect() feeds the Context block on every event;
45
+ * start() emits no standalone device_info event (ADR-0002).
46
+ */
47
+ async start(o) {
48
+ }
49
+ }
50
+ export {
51
+ V as DeviceInfoTrackerNative
52
+ };
53
+ //# sourceMappingURL=deviceInfo.native-DiiHrnI3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceInfo.native-DiiHrnI3.js","sources":["../src/adapters/native/deviceInfo.native.ts"],"sourcesContent":["// adapters/native/deviceInfoNative.native.ts\nimport { Dimensions, PixelRatio, Platform } from \"react-native\";\nimport DeviceInfoLib from \"react-native-device-info\";\nimport { Telemetry } from \"../../core/telemetry\";\nimport { DeviceInfo } from \"../../core/telemetry\";\nimport { viewportKeys } from \"../viewport\";\n\nexport class DeviceInfoTrackerNative {\n // private telemetry: Telemetry;\n\n // constructor(telemetry?: Telemetry) {\n // this.telemetry = telemetry || new Telemetry();\n // }\n\n constructor() {\n }\n\n // device.id is NOT collected here (#91): it is self-minted and persisted by core.\n // getUniqueId() carries two lifetimes on RN alone — ANDROID_ID survives reinstall,\n // identifierForVendor does not — so one identity column would mean two things.\n async collect(): Promise<DeviceInfo> {\n // 🔹 App metadata\n const appName = (await DeviceInfoLib.getApplicationName()) || \"UnknownApp\";\n const appVersion = (await DeviceInfoLib.getVersion()) || \"0.0.0\";\n const buildNumber = (await DeviceInfoLib.getBuildNumber()) || \"0\";\n const packageName = (await DeviceInfoLib.getBundleId()) || \"unknown.package\";\n\n // 🔹 Common Device metadata\n const brand = await DeviceInfoLib.getBrand();\n const manufacturer = (await DeviceInfoLib.getManufacturer()) || \"\";\n const model = (await DeviceInfoLib.getModel()) || \"\";\n const systemVersion = (await DeviceInfoLib.getSystemVersion()) || \"\";\n const systemName = (await DeviceInfoLib.getSystemName()) || \"\"; // iOS: \"iOS\", Android: \"Android\"\n\n // 🔹 Android-only fields\n const sdk = Platform.OS === \"android\" ? await DeviceInfoLib.getApiLevel() : undefined;\n const hardware = Platform.OS === \"android\" ? await DeviceInfoLib.getHardware?.() : undefined;\n const product = Platform.OS === \"android\" ? await DeviceInfoLib.getProduct?.() : undefined;\n\n // 🔹 iOS-only fields\n // ⚠ `getDeviceName()` — the user's own name for their phone — is deliberately NOT\n // read any more (§3.4): real PII, no column, no reader. `getFingerprint()` went with\n // it — a build string that merges handsets, which *repairs* device identity (§1.2).\n const iosSystemName = Platform.OS === \"ios\" ? systemName : undefined;\n\n // 🔹 §3.3 ✱ — device capability (native only) and viewport (both builds).\n const cpuAbi = (await DeviceInfoLib.supportedAbis?.())?.[0];\n const lowRam = await DeviceInfoLib.isLowRamDevice?.();\n\n // Read on every collect(), not cached: a device rotates mid-session, and §3.1 puts\n // `device.orientation` and device state on the log-time side of the freeze. The\n // *shaping* is shared with web (`adapters/viewport.ts`) so one column cannot come to\n // mean physical pixels on one build and dp on the other.\n const { width, height } = Dimensions.get(\"window\");\n const viewport = viewportKeys(width, height, PixelRatio.get());\n\n const info: DeviceInfo = {\n app: {\n name: appName,\n version: appVersion,\n build_number: buildNumber,\n package_name: packageName,\n },\n device: {\n platform: Platform.OS,\n platform_version: systemVersion,\n model,\n manufacturer,\n brand,\n\n // Android fields\n android_sdk: typeof sdk === \"number\" && sdk > 0 ? sdk : undefined,\n android_release: Platform.OS === \"android\" ? systemVersion : undefined,\n hardware,\n product,\n cpu_abi: cpuAbi,\n low_ram: lowRam,\n\n // iOS fields\n system_name: iosSystemName,\n\n // Viewport — both builds, never null (§3.3)\n ...viewport,\n },\n };\n\n return info;\n }\n\n /**\n * Context-only adapter. collect() feeds the Context block on every event;\n * start() emits no standalone device_info event (ADR-0002).\n */\n async start(_telemetry: Telemetry): Promise<void> {\n // no-op: device metadata rides as attributes on every event\n }\n}\n"],"names":["DeviceInfoTrackerNative","appName","DeviceInfoLib","appVersion","buildNumber","packageName","brand","manufacturer","model","systemVersion","systemName","sdk","Platform","hardware","product","iosSystemName","cpuAbi","lowRam","width","height","Dimensions","viewport","viewportKeys","PixelRatio","_telemetry"],"mappings":";;;AAOO,MAAMA,EAAwB;AAAA;AAAA;AAAA;AAAA;AAAA,EAOjC,cAAc;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,UAA+B;AAEjC,UAAMC,IAAW,MAAMC,EAAc,mBAAA,KAAyB,cACxDC,IAAc,MAAMD,EAAc,WAAA,KAAiB,SACnDE,IAAe,MAAMF,EAAc,eAAA,KAAqB,KACxDG,IAAe,MAAMH,EAAc,YAAA,KAAkB,mBAGrDI,IAAQ,MAAMJ,EAAc,SAAA,GAC5BK,IAAgB,MAAML,EAAc,gBAAA,KAAsB,IAC1DM,IAAS,MAAMN,EAAc,SAAA,KAAe,IAC5CO,IAAiB,MAAMP,EAAc,iBAAA,KAAuB,IAC5DQ,IAAc,MAAMR,EAAc,cAAA,KAAoB,IAGtDS,IAAMC,EAAS,OAAO,YAAY,MAAMV,EAAc,gBAAgB,QACtEW,IAAWD,EAAS,OAAO,YAAY,MAAMV,EAAc,kBAAkB,QAC7EY,IAAUF,EAAS,OAAO,YAAY,MAAMV,EAAc,iBAAiB,QAM3Ea,IAAgBH,EAAS,OAAO,QAAQF,IAAa,QAGrDM,KAAU,MAAMd,EAAc,gBAAA,KAAqB,CAAC,GACpDe,IAAS,MAAMf,EAAc,iBAAA,GAM7B,EAAE,OAAAgB,GAAO,QAAAC,EAAA,IAAWC,EAAW,IAAI,QAAQ,GAC3CC,IAAWC,EAAaJ,GAAOC,GAAQI,EAAW,KAAK;AAgC7D,WA9ByB;AAAA,MACrB,KAAK;AAAA,QACD,MAAMtB;AAAA,QACN,SAASE;AAAA,QACT,cAAcC;AAAA,QACd,cAAcC;AAAA,MAAA;AAAA,MAElB,QAAQ;AAAA,QACJ,UAAUO,EAAS;AAAA,QACnB,kBAAkBH;AAAA,QAClB,OAAAD;AAAA,QACA,cAAAD;AAAA,QACA,OAAAD;AAAA;AAAA,QAGA,aAAa,OAAOK,KAAQ,YAAYA,IAAM,IAAIA,IAAM;AAAA,QACxD,iBAAiBC,EAAS,OAAO,YAAYH,IAAgB;AAAA,QAC7D,UAAAI;AAAA,QACA,SAAAC;AAAA,QACA,SAASE;AAAA,QACT,SAASC;AAAA;AAAA,QAGT,aAAaF;AAAA;AAAA,QAGb,GAAGM;AAAA,MAAA;AAAA,IACP;AAAA,EAIR;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAMG,GAAsC;AAAA,EAElD;AACJ;"}
@@ -0,0 +1,41 @@
1
+ import { v as n } from "./viewport-GWTEBt2K.js";
2
+ class a {
3
+ constructor() {
4
+ }
5
+ // device.id is NOT collected here (#91): core self-mints and persists it via the Store.
6
+ async collect() {
7
+ const e = navigator.userAgent, o = typeof devicePixelRatio == "number" ? devicePixelRatio : 1, r = n(window.innerWidth ?? 0, window.innerHeight ?? 0, o);
8
+ return {
9
+ app: {
10
+ name: document.title || "WebApp",
11
+ version: process.env.APP_VERSION || "1.0.0",
12
+ build_number: process.env.BUILD_NUMBER,
13
+ package_name: window.location.hostname
14
+ },
15
+ device: {
16
+ platform: "web",
17
+ platform_version: navigator.appVersion,
18
+ model: e,
19
+ manufacturer: "browser",
20
+ brand: navigator.vendor || "unknown",
21
+ // Android placeholders
22
+ android_sdk: void 0,
23
+ android_release: void 0,
24
+ hardware: void 0,
25
+ product: void 0,
26
+ // iOS placeholders
27
+ system_name: void 0,
28
+ // `cpu_abi` / `low_ram` are native-only (§3.3's `N`) — a browser exposes
29
+ // neither, and a fabricated value is worse than an absent key.
30
+ ...r
31
+ }
32
+ };
33
+ }
34
+ async start(e) {
35
+ this.telemetry = e;
36
+ }
37
+ }
38
+ export {
39
+ a as DeviceInfoTrackerWeb
40
+ };
41
+ //# sourceMappingURL=deviceInfo.web-BHsjVveq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceInfo.web-BHsjVveq.js","sources":["../src/adapters/web/deviceInfo.web.ts"],"sourcesContent":["// adapters/web/deviceInfoWeb.web.ts\nimport { DeviceInfo, Telemetry } from \"../../core/telemetry\";\nimport { viewportKeys } from \"../viewport\";\n\nexport class DeviceInfoTrackerWeb {\n private telemetry?: Telemetry;\n\n\n constructor() {\n }\n // device.id is NOT collected here (#91): core self-mints and persists it via the Store.\n async collect(): Promise<DeviceInfo> {\n const ua = navigator.userAgent;\n\n // §3.3 ✱ — viewport, read on every collect() because a browser window resizes and a\n // phone rotates; §3.1 keeps device state on the log-time side of the freeze. The\n // *viewport*, not `screen.*`: that is the quantity CLS and LCP scale with. Shaped by\n // the shared `adapters/viewport.ts`, so the key means the same thing native ships.\n const dpr = typeof devicePixelRatio === \"number\" ? devicePixelRatio : 1;\n const viewport = viewportKeys(window.innerWidth ?? 0, window.innerHeight ?? 0, dpr);\n\n return {\n app: {\n name: document.title || \"WebApp\",\n version: process.env.APP_VERSION || \"1.0.0\",\n build_number: process.env.BUILD_NUMBER,\n package_name: window.location.hostname,\n },\n device: {\n platform: \"web\",\n platform_version: navigator.appVersion,\n model: ua,\n manufacturer: \"browser\",\n brand: navigator.vendor || \"unknown\",\n\n // Android placeholders\n android_sdk: undefined,\n android_release: undefined,\n hardware: undefined,\n product: undefined,\n\n // iOS placeholders\n system_name: undefined,\n\n // `cpu_abi` / `low_ram` are native-only (§3.3's `N`) — a browser exposes\n // neither, and a fabricated value is worse than an absent key.\n ...viewport,\n },\n };\n }\n\n async start(telemetry: Telemetry): Promise<void> {\n // context-only adapter — collect() feeds the Context block on every event;\n // no standalone device_info event (ADR-0002)\n this.telemetry = telemetry;\n }\n}\n"],"names":["DeviceInfoTrackerWeb","ua","dpr","viewport","viewportKeys","telemetry"],"mappings":";AAIO,MAAMA,EAAqB;AAAA,EAI9B,cAAc;AAAA,EACd;AAAA;AAAA,EAEA,MAAM,UAA+B;AACjC,UAAMC,IAAK,UAAU,WAMfC,IAAM,OAAO,oBAAqB,WAAW,mBAAmB,GAChEC,IAAWC,EAAa,OAAO,cAAc,GAAG,OAAO,eAAe,GAAGF,CAAG;AAElF,WAAO;AAAA,MACH,KAAK;AAAA,QACD,MAAM,SAAS,SAAS;AAAA,QACxB,SAAS,QAAQ,IAAI,eAAe;AAAA,QACpC,cAAc,QAAQ,IAAI;AAAA,QAC1B,cAAc,OAAO,SAAS;AAAA,MAAA;AAAA,MAElC,QAAQ;AAAA,QACJ,UAAU;AAAA,QACV,kBAAkB,UAAU;AAAA,QAC5B,OAAOD;AAAA,QACP,cAAc;AAAA,QACd,OAAO,UAAU,UAAU;AAAA;AAAA,QAG3B,aAAa;AAAA,QACb,iBAAiB;AAAA,QACjB,UAAU;AAAA,QACV,SAAS;AAAA;AAAA,QAGT,aAAa;AAAA;AAAA;AAAA,QAIb,GAAGE;AAAA,MAAA;AAAA,IACP;AAAA,EAER;AAAA,EAEA,MAAM,MAAME,GAAqC;AAG7C,SAAK,YAAYA;AAAA,EACrB;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./viewport-9JcVIXYF.cjs");class t{constructor(){}async collect(){const e=navigator.userAgent,o=typeof devicePixelRatio=="number"?devicePixelRatio:1,r=n.viewportKeys(window.innerWidth??0,window.innerHeight??0,o);return{app:{name:document.title||"WebApp",version:process.env.APP_VERSION||"1.0.0",build_number:process.env.BUILD_NUMBER,package_name:window.location.hostname},device:{platform:"web",platform_version:navigator.appVersion,model:e,manufacturer:"browser",brand:navigator.vendor||"unknown",android_sdk:void 0,android_release:void 0,hardware:void 0,product:void 0,system_name:void 0,...r}}}async start(e){this.telemetry=e}}exports.DeviceInfoTrackerWeb=t;
2
+ //# sourceMappingURL=deviceInfo.web-DGCUHAnv.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceInfo.web-DGCUHAnv.cjs","sources":["../src/adapters/web/deviceInfo.web.ts"],"sourcesContent":["// adapters/web/deviceInfoWeb.web.ts\nimport { DeviceInfo, Telemetry } from \"../../core/telemetry\";\nimport { viewportKeys } from \"../viewport\";\n\nexport class DeviceInfoTrackerWeb {\n private telemetry?: Telemetry;\n\n\n constructor() {\n }\n // device.id is NOT collected here (#91): core self-mints and persists it via the Store.\n async collect(): Promise<DeviceInfo> {\n const ua = navigator.userAgent;\n\n // §3.3 ✱ — viewport, read on every collect() because a browser window resizes and a\n // phone rotates; §3.1 keeps device state on the log-time side of the freeze. The\n // *viewport*, not `screen.*`: that is the quantity CLS and LCP scale with. Shaped by\n // the shared `adapters/viewport.ts`, so the key means the same thing native ships.\n const dpr = typeof devicePixelRatio === \"number\" ? devicePixelRatio : 1;\n const viewport = viewportKeys(window.innerWidth ?? 0, window.innerHeight ?? 0, dpr);\n\n return {\n app: {\n name: document.title || \"WebApp\",\n version: process.env.APP_VERSION || \"1.0.0\",\n build_number: process.env.BUILD_NUMBER,\n package_name: window.location.hostname,\n },\n device: {\n platform: \"web\",\n platform_version: navigator.appVersion,\n model: ua,\n manufacturer: \"browser\",\n brand: navigator.vendor || \"unknown\",\n\n // Android placeholders\n android_sdk: undefined,\n android_release: undefined,\n hardware: undefined,\n product: undefined,\n\n // iOS placeholders\n system_name: undefined,\n\n // `cpu_abi` / `low_ram` are native-only (§3.3's `N`) — a browser exposes\n // neither, and a fabricated value is worse than an absent key.\n ...viewport,\n },\n };\n }\n\n async start(telemetry: Telemetry): Promise<void> {\n // context-only adapter — collect() feeds the Context block on every event;\n // no standalone device_info event (ADR-0002)\n this.telemetry = telemetry;\n }\n}\n"],"names":["DeviceInfoTrackerWeb","ua","dpr","viewport","viewportKeys","telemetry"],"mappings":"2HAIO,MAAMA,CAAqB,CAI9B,aAAc,CACd,CAEA,MAAM,SAA+B,CACjC,MAAMC,EAAK,UAAU,UAMfC,EAAM,OAAO,kBAAqB,SAAW,iBAAmB,EAChEC,EAAWC,eAAa,OAAO,YAAc,EAAG,OAAO,aAAe,EAAGF,CAAG,EAElF,MAAO,CACH,IAAK,CACD,KAAM,SAAS,OAAS,SACxB,QAAS,QAAQ,IAAI,aAAe,QACpC,aAAc,QAAQ,IAAI,aAC1B,aAAc,OAAO,SAAS,QAAA,EAElC,OAAQ,CACJ,SAAU,MACV,iBAAkB,UAAU,WAC5B,MAAOD,EACP,aAAc,UACd,MAAO,UAAU,QAAU,UAG3B,YAAa,OACb,gBAAiB,OACjB,SAAU,OACV,QAAS,OAGT,YAAa,OAIb,GAAGE,CAAA,CACP,CAER,CAEA,MAAM,MAAME,EAAqC,CAG7C,KAAK,UAAYA,CACrB,CACJ"}
@@ -0,0 +1,58 @@
1
+ import { AccessibilityInfo as l, PixelRatio as d } from "react-native";
2
+ import u from "react-native-device-info";
3
+ import { d as f } from "./react-urNtDGTL.js";
4
+ function b(t, e, i) {
5
+ const r = {};
6
+ return typeof t == "number" && Number.isFinite(t) && t >= 0 && t <= 1 && (r["device.battery_level"] = Math.round(t * 100)), typeof e == "boolean" && (r["device.battery_charging"] = e), typeof i == "boolean" && (r["device.power_save"] = i), r;
7
+ }
8
+ async function o(t, e) {
9
+ try {
10
+ const i = await t();
11
+ return e(i) ? i : void 0;
12
+ } catch {
13
+ return;
14
+ }
15
+ }
16
+ const a = (t) => typeof t == "boolean", s = (t) => typeof t == "number" && Number.isFinite(t), h = 6e4;
17
+ class p {
18
+ constructor() {
19
+ this.cached = {}, this.timer = null;
20
+ }
21
+ battery() {
22
+ return this.cached;
23
+ }
24
+ async refresh() {
25
+ const e = u, [i, r, n] = await Promise.all([
26
+ o(() => e?.getBatteryLevel?.(), s),
27
+ o(() => e?.isBatteryCharging?.(), a),
28
+ o(() => e?.getPowerState?.(), (c) => typeof c == "object" && c !== null)
29
+ ]);
30
+ this.cached = b(i, r, n?.lowPowerMode);
31
+ }
32
+ start() {
33
+ if (this.timer !== null) return;
34
+ const e = () => {
35
+ this.refresh().catch((i) => f.warn("battery refresh failed:", i));
36
+ };
37
+ e(), this.timer = setInterval(e, h);
38
+ }
39
+ stop() {
40
+ this.timer !== null && clearInterval(this.timer), this.timer = null;
41
+ }
42
+ async accessibility() {
43
+ const e = l, [i, r, n] = await Promise.all([
44
+ o(() => e?.isScreenReaderEnabled?.(), a),
45
+ o(() => e?.isReduceMotionEnabled?.(), a),
46
+ o(() => d?.getFontScale?.(), s)
47
+ ]);
48
+ return {
49
+ ...i === void 0 ? {} : { "device.screen_reader": i },
50
+ ...r === void 0 ? {} : { "device.reduce_motion": r },
51
+ ...n === void 0 ? {} : { "device.font_scale": n }
52
+ };
53
+ }
54
+ }
55
+ export {
56
+ p as DeviceStateNative
57
+ };
58
+ //# sourceMappingURL=deviceState.native-BEysbZ6O.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceState.native-BEysbZ6O.js","sources":["../src/adapters/deviceState.ts","../src/adapters/native/deviceState.native.ts"],"sourcesContent":["// #173's device state (decision #149) — the pure half, shared by both builds: what counts as a\n// real reading. Each build's adapter only does the platform reads.\n\n/** A failure row's battery keys, or none. `-1` (simulator), non-finite or out of range → omitted. */\nexport function batteryAttributes(level: unknown, charging: unknown, powerSave: unknown): Record<string, number | boolean> {\n const out: Record<string, number | boolean> = {};\n if (typeof level === \"number\" && Number.isFinite(level) && level >= 0 && level <= 1) {\n out[\"device.battery_level\"] = Math.round(level * 100);\n }\n if (typeof charging === \"boolean\") out[\"device.battery_charging\"] = charging;\n if (typeof powerSave === \"boolean\") out[\"device.power_save\"] = powerSave;\n return out;\n}\n\n/**\n * One read, settled to a value or `undefined` — a throw, a rejection, a missing method or a\n * non-boolean/non-finite answer all omit that one key, never the others.\n */\nexport async function readOr<T>(read: () => T | Promise<T>, valid: (v: unknown) => boolean): Promise<T | undefined> {\n try {\n const v = await read();\n return valid(v) ? v : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport const isBool = (v: unknown) => typeof v === \"boolean\";\nexport const isFiniteNumber = (v: unknown) => typeof v === \"number\" && Number.isFinite(v);\n","import { AccessibilityInfo, PixelRatio } from \"react-native\";\nimport DeviceInfoLib from \"react-native-device-info\";\nimport { debug } from \"../../core/debug\";\nimport type { DeviceStateHandler } from \"../../core/telemetry\";\nimport { batteryAttributes, isBool, isFiniteNumber, readOr } from \"../deviceState\";\n\n/** Refresh cadence of the cached battery read (#173). Internal. */\nconst BATTERY_REFRESH_MS = 60000;\n\n/**\n * #173, native. Battery is a **cached** read — refreshed at start, on foreground and every 60 s —\n * so a failure row never awaits a native call. `react-native-device-info` is an optional peer and\n * an older one lacks these methods, so every read is optional-chained and guarded.\n */\nexport class DeviceStateNative implements DeviceStateHandler {\n private cached: Record<string, number | boolean> = {};\n private timer: ReturnType<typeof setInterval> | null = null;\n\n battery(): Record<string, number | boolean> {\n return this.cached;\n }\n\n async refresh(): Promise<void> {\n const lib = DeviceInfoLib as any;\n const [level, charging, power] = await Promise.all([\n readOr(() => lib?.getBatteryLevel?.(), isFiniteNumber),\n readOr(() => lib?.isBatteryCharging?.(), isBool),\n readOr(() => lib?.getPowerState?.(), (v) => typeof v === \"object\" && v !== null),\n ]);\n this.cached = batteryAttributes(level, charging, (power as any)?.lowPowerMode);\n }\n\n start(): void {\n if (this.timer !== null) return;\n const refresh = () => { this.refresh().catch((err) => debug.warn(\"battery refresh failed:\", err)); };\n refresh();\n this.timer = setInterval(refresh, BATTERY_REFRESH_MS);\n }\n\n stop(): void {\n if (this.timer !== null) clearInterval(this.timer);\n this.timer = null;\n }\n\n async accessibility(): Promise<Record<string, number | boolean>> {\n const a11y = AccessibilityInfo as any;\n const [screenReader, reduceMotion, fontScale] = await Promise.all([\n readOr(() => a11y?.isScreenReaderEnabled?.(), isBool),\n readOr(() => a11y?.isReduceMotionEnabled?.(), isBool),\n readOr(() => (PixelRatio as any)?.getFontScale?.(), isFiniteNumber),\n ]);\n return {\n ...(screenReader === undefined ? {} : { \"device.screen_reader\": screenReader as boolean }),\n ...(reduceMotion === undefined ? {} : { \"device.reduce_motion\": reduceMotion as boolean }),\n ...(fontScale === undefined ? {} : { \"device.font_scale\": fontScale as number }),\n };\n }\n}\n"],"names":["batteryAttributes","level","charging","powerSave","out","readOr","read","valid","v","isBool","isFiniteNumber","BATTERY_REFRESH_MS","DeviceStateNative","lib","DeviceInfoLib","power","refresh","err","debug","a11y","AccessibilityInfo","screenReader","reduceMotion","fontScale","PixelRatio"],"mappings":";;;AAIO,SAASA,EAAkBC,GAAgBC,GAAmBC,GAAsD;AACvH,QAAMC,IAAwC,CAAA;AAC9C,SAAI,OAAOH,KAAU,YAAY,OAAO,SAASA,CAAK,KAAKA,KAAS,KAAKA,KAAS,MAC9EG,EAAI,sBAAsB,IAAI,KAAK,MAAMH,IAAQ,GAAG,IAEpD,OAAOC,KAAa,cAAWE,EAAI,yBAAyB,IAAIF,IAChE,OAAOC,KAAc,cAAWC,EAAI,mBAAmB,IAAID,IACxDC;AACX;AAMA,eAAsBC,EAAUC,GAA4BC,GAAwD;AAChH,MAAI;AACA,UAAMC,IAAI,MAAMF,EAAA;AAChB,WAAOC,EAAMC,CAAC,IAAIA,IAAI;AAAA,EAC1B,QAAQ;AACJ;AAAA,EACJ;AACJ;AAEO,MAAMC,IAAS,CAACD,MAAe,OAAOA,KAAM,WACtCE,IAAiB,CAACF,MAAe,OAAOA,KAAM,YAAY,OAAO,SAASA,CAAC,GCrBlFG,IAAqB;AAOpB,MAAMC,EAAgD;AAAA,EAAtD,cAAA;AACH,SAAQ,SAA2C,CAAA,GACnD,KAAQ,QAA+C;AAAA,EAAA;AAAA,EAEvD,UAA4C;AACxC,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,MAAM,UAAyB;AAC3B,UAAMC,IAAMC,GACN,CAACb,GAAOC,GAAUa,CAAK,IAAI,MAAM,QAAQ,IAAI;AAAA,MAC/CV,EAAO,MAAMQ,GAAK,kBAAA,GAAqBH,CAAc;AAAA,MACrDL,EAAO,MAAMQ,GAAK,oBAAA,GAAuBJ,CAAM;AAAA,MAC/CJ,EAAO,MAAMQ,GAAK,mBAAmB,CAACL,MAAM,OAAOA,KAAM,YAAYA,MAAM,IAAI;AAAA,IAAA,CAClF;AACD,SAAK,SAASR,EAAkBC,GAAOC,GAAWa,GAAe,YAAY;AAAA,EACjF;AAAA,EAEA,QAAc;AACV,QAAI,KAAK,UAAU,KAAM;AACzB,UAAMC,IAAU,MAAM;AAAE,WAAK,UAAU,MAAM,CAACC,MAAQC,EAAM,KAAK,2BAA2BD,CAAG,CAAC;AAAA,IAAG;AACnG,IAAAD,EAAA,GACA,KAAK,QAAQ,YAAYA,GAASL,CAAkB;AAAA,EACxD;AAAA,EAEA,OAAa;AACT,IAAI,KAAK,UAAU,QAAM,cAAc,KAAK,KAAK,GACjD,KAAK,QAAQ;AAAA,EACjB;AAAA,EAEA,MAAM,gBAA2D;AAC7D,UAAMQ,IAAOC,GACP,CAACC,GAAcC,GAAcC,CAAS,IAAI,MAAM,QAAQ,IAAI;AAAA,MAC9DlB,EAAO,MAAMc,GAAM,wBAAA,GAA2BV,CAAM;AAAA,MACpDJ,EAAO,MAAMc,GAAM,wBAAA,GAA2BV,CAAM;AAAA,MACpDJ,EAAO,MAAOmB,GAAoB,eAAA,GAAkBd,CAAc;AAAA,IAAA,CACrE;AACD,WAAO;AAAA,MACH,GAAIW,MAAiB,SAAY,CAAA,IAAK,EAAE,wBAAwBA,EAAA;AAAA,MAChE,GAAIC,MAAiB,SAAY,CAAA,IAAK,EAAE,wBAAwBA,EAAA;AAAA,MAChE,GAAIC,MAAc,SAAY,KAAK,EAAE,qBAAqBA,EAAA;AAAA,IAAoB;AAAA,EAEtF;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react-native"),u=require("react-native-device-info"),d=require("./react-bqe7KPOf.cjs");function b(t,e,i){const r={};return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=1&&(r["device.battery_level"]=Math.round(t*100)),typeof e=="boolean"&&(r["device.battery_charging"]=e),typeof i=="boolean"&&(r["device.power_save"]=i),r}async function o(t,e){try{const i=await t();return e(i)?i:void 0}catch{return}}const c=t=>typeof t=="boolean",l=t=>typeof t=="number"&&Number.isFinite(t),f=6e4;class h{constructor(){this.cached={},this.timer=null}battery(){return this.cached}async refresh(){const e=u,[i,r,n]=await Promise.all([o(()=>e?.getBatteryLevel?.(),l),o(()=>e?.isBatteryCharging?.(),c),o(()=>e?.getPowerState?.(),a=>typeof a=="object"&&a!==null)]);this.cached=b(i,r,n?.lowPowerMode)}start(){if(this.timer!==null)return;const e=()=>{this.refresh().catch(i=>d.debug.warn("battery refresh failed:",i))};e(),this.timer=setInterval(e,f)}stop(){this.timer!==null&&clearInterval(this.timer),this.timer=null}async accessibility(){const e=s.AccessibilityInfo,[i,r,n]=await Promise.all([o(()=>e?.isScreenReaderEnabled?.(),c),o(()=>e?.isReduceMotionEnabled?.(),c),o(()=>s.PixelRatio?.getFontScale?.(),l)]);return{...i===void 0?{}:{"device.screen_reader":i},...r===void 0?{}:{"device.reduce_motion":r},...n===void 0?{}:{"device.font_scale":n}}}}exports.DeviceStateNative=h;
2
+ //# sourceMappingURL=deviceState.native-CrQMy11_.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceState.native-CrQMy11_.cjs","sources":["../src/adapters/deviceState.ts","../src/adapters/native/deviceState.native.ts"],"sourcesContent":["// #173's device state (decision #149) — the pure half, shared by both builds: what counts as a\n// real reading. Each build's adapter only does the platform reads.\n\n/** A failure row's battery keys, or none. `-1` (simulator), non-finite or out of range → omitted. */\nexport function batteryAttributes(level: unknown, charging: unknown, powerSave: unknown): Record<string, number | boolean> {\n const out: Record<string, number | boolean> = {};\n if (typeof level === \"number\" && Number.isFinite(level) && level >= 0 && level <= 1) {\n out[\"device.battery_level\"] = Math.round(level * 100);\n }\n if (typeof charging === \"boolean\") out[\"device.battery_charging\"] = charging;\n if (typeof powerSave === \"boolean\") out[\"device.power_save\"] = powerSave;\n return out;\n}\n\n/**\n * One read, settled to a value or `undefined` — a throw, a rejection, a missing method or a\n * non-boolean/non-finite answer all omit that one key, never the others.\n */\nexport async function readOr<T>(read: () => T | Promise<T>, valid: (v: unknown) => boolean): Promise<T | undefined> {\n try {\n const v = await read();\n return valid(v) ? v : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport const isBool = (v: unknown) => typeof v === \"boolean\";\nexport const isFiniteNumber = (v: unknown) => typeof v === \"number\" && Number.isFinite(v);\n","import { AccessibilityInfo, PixelRatio } from \"react-native\";\nimport DeviceInfoLib from \"react-native-device-info\";\nimport { debug } from \"../../core/debug\";\nimport type { DeviceStateHandler } from \"../../core/telemetry\";\nimport { batteryAttributes, isBool, isFiniteNumber, readOr } from \"../deviceState\";\n\n/** Refresh cadence of the cached battery read (#173). Internal. */\nconst BATTERY_REFRESH_MS = 60000;\n\n/**\n * #173, native. Battery is a **cached** read — refreshed at start, on foreground and every 60 s —\n * so a failure row never awaits a native call. `react-native-device-info` is an optional peer and\n * an older one lacks these methods, so every read is optional-chained and guarded.\n */\nexport class DeviceStateNative implements DeviceStateHandler {\n private cached: Record<string, number | boolean> = {};\n private timer: ReturnType<typeof setInterval> | null = null;\n\n battery(): Record<string, number | boolean> {\n return this.cached;\n }\n\n async refresh(): Promise<void> {\n const lib = DeviceInfoLib as any;\n const [level, charging, power] = await Promise.all([\n readOr(() => lib?.getBatteryLevel?.(), isFiniteNumber),\n readOr(() => lib?.isBatteryCharging?.(), isBool),\n readOr(() => lib?.getPowerState?.(), (v) => typeof v === \"object\" && v !== null),\n ]);\n this.cached = batteryAttributes(level, charging, (power as any)?.lowPowerMode);\n }\n\n start(): void {\n if (this.timer !== null) return;\n const refresh = () => { this.refresh().catch((err) => debug.warn(\"battery refresh failed:\", err)); };\n refresh();\n this.timer = setInterval(refresh, BATTERY_REFRESH_MS);\n }\n\n stop(): void {\n if (this.timer !== null) clearInterval(this.timer);\n this.timer = null;\n }\n\n async accessibility(): Promise<Record<string, number | boolean>> {\n const a11y = AccessibilityInfo as any;\n const [screenReader, reduceMotion, fontScale] = await Promise.all([\n readOr(() => a11y?.isScreenReaderEnabled?.(), isBool),\n readOr(() => a11y?.isReduceMotionEnabled?.(), isBool),\n readOr(() => (PixelRatio as any)?.getFontScale?.(), isFiniteNumber),\n ]);\n return {\n ...(screenReader === undefined ? {} : { \"device.screen_reader\": screenReader as boolean }),\n ...(reduceMotion === undefined ? {} : { \"device.reduce_motion\": reduceMotion as boolean }),\n ...(fontScale === undefined ? {} : { \"device.font_scale\": fontScale as number }),\n };\n }\n}\n"],"names":["batteryAttributes","level","charging","powerSave","out","readOr","read","valid","v","isBool","isFiniteNumber","BATTERY_REFRESH_MS","DeviceStateNative","lib","DeviceInfoLib","power","refresh","err","debug","a11y","AccessibilityInfo","screenReader","reduceMotion","fontScale","PixelRatio"],"mappings":"wLAIO,SAASA,EAAkBC,EAAgBC,EAAmBC,EAAsD,CACvH,MAAMC,EAAwC,CAAA,EAC9C,OAAI,OAAOH,GAAU,UAAY,OAAO,SAASA,CAAK,GAAKA,GAAS,GAAKA,GAAS,IAC9EG,EAAI,sBAAsB,EAAI,KAAK,MAAMH,EAAQ,GAAG,GAEpD,OAAOC,GAAa,YAAWE,EAAI,yBAAyB,EAAIF,GAChE,OAAOC,GAAc,YAAWC,EAAI,mBAAmB,EAAID,GACxDC,CACX,CAMA,eAAsBC,EAAUC,EAA4BC,EAAwD,CAChH,GAAI,CACA,MAAMC,EAAI,MAAMF,EAAA,EAChB,OAAOC,EAAMC,CAAC,EAAIA,EAAI,MAC1B,MAAQ,CACJ,MACJ,CACJ,CAEO,MAAMC,EAAUD,GAAe,OAAOA,GAAM,UACtCE,EAAkBF,GAAe,OAAOA,GAAM,UAAY,OAAO,SAASA,CAAC,ECrBlFG,EAAqB,IAOpB,MAAMC,CAAgD,CAAtD,aAAA,CACH,KAAQ,OAA2C,CAAA,EACnD,KAAQ,MAA+C,IAAA,CAEvD,SAA4C,CACxC,OAAO,KAAK,MAChB,CAEA,MAAM,SAAyB,CAC3B,MAAMC,EAAMC,EACN,CAACb,EAAOC,EAAUa,CAAK,EAAI,MAAM,QAAQ,IAAI,CAC/CV,EAAO,IAAMQ,GAAK,kBAAA,EAAqBH,CAAc,EACrDL,EAAO,IAAMQ,GAAK,oBAAA,EAAuBJ,CAAM,EAC/CJ,EAAO,IAAMQ,GAAK,kBAAoBL,GAAM,OAAOA,GAAM,UAAYA,IAAM,IAAI,CAAA,CAClF,EACD,KAAK,OAASR,EAAkBC,EAAOC,EAAWa,GAAe,YAAY,CACjF,CAEA,OAAc,CACV,GAAI,KAAK,QAAU,KAAM,OACzB,MAAMC,EAAU,IAAM,CAAE,KAAK,UAAU,MAAOC,GAAQC,EAAAA,MAAM,KAAK,0BAA2BD,CAAG,CAAC,CAAG,EACnGD,EAAA,EACA,KAAK,MAAQ,YAAYA,EAASL,CAAkB,CACxD,CAEA,MAAa,CACL,KAAK,QAAU,MAAM,cAAc,KAAK,KAAK,EACjD,KAAK,MAAQ,IACjB,CAEA,MAAM,eAA2D,CAC7D,MAAMQ,EAAOC,EAAAA,kBACP,CAACC,EAAcC,EAAcC,CAAS,EAAI,MAAM,QAAQ,IAAI,CAC9DlB,EAAO,IAAMc,GAAM,wBAAA,EAA2BV,CAAM,EACpDJ,EAAO,IAAMc,GAAM,wBAAA,EAA2BV,CAAM,EACpDJ,EAAO,IAAOmB,EAAAA,YAAoB,eAAA,EAAkBd,CAAc,CAAA,CACrE,EACD,MAAO,CACH,GAAIW,IAAiB,OAAY,CAAA,EAAK,CAAE,uBAAwBA,CAAA,EAChE,GAAIC,IAAiB,OAAY,CAAA,EAAK,CAAE,uBAAwBA,CAAA,EAChE,GAAIC,IAAc,OAAY,GAAK,CAAE,oBAAqBA,CAAA,CAAoB,CAEtF,CACJ"}
@@ -0,0 +1,14 @@
1
+ class c {
2
+ async accessibility() {
3
+ try {
4
+ const e = typeof matchMedia == "function" ? matchMedia("(prefers-reduced-motion: reduce)") : void 0;
5
+ return typeof e?.matches == "boolean" ? { "device.reduce_motion": e.matches } : {};
6
+ } catch {
7
+ return {};
8
+ }
9
+ }
10
+ }
11
+ export {
12
+ c as DeviceStateWeb
13
+ };
14
+ //# sourceMappingURL=deviceState.web-ByaQm9Ry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceState.web-ByaQm9Ry.js","sources":["../src/adapters/web/deviceState.web.ts"],"sourcesContent":["import type { DeviceStateHandler } from \"../../core/telemetry\";\n\n/**\n * #173, web. Only `device.reduce_motion`, via `matchMedia`. No battery — `navigator.getBattery`\n * is Chromium-only, a browser-detection signal wearing a battery label (§5.2's defect) — and no\n * screen reader or font scale: RN-Web answers both with constants, and a fake value is worse\n * than none.\n */\nexport class DeviceStateWeb implements DeviceStateHandler {\n async accessibility(): Promise<Record<string, boolean>> {\n try {\n const mq = typeof matchMedia === \"function\" ? matchMedia(\"(prefers-reduced-motion: reduce)\") : undefined;\n return typeof mq?.matches === \"boolean\" ? { \"device.reduce_motion\": mq.matches } : {};\n } catch {\n return {};\n }\n }\n}\n"],"names":["DeviceStateWeb","mq"],"mappings":"AAQO,MAAMA,EAA6C;AAAA,EACtD,MAAM,gBAAkD;AACpD,QAAI;AACA,YAAMC,IAAK,OAAO,cAAe,aAAa,WAAW,kCAAkC,IAAI;AAC/F,aAAO,OAAOA,GAAI,WAAY,YAAY,EAAE,wBAAwBA,EAAG,QAAA,IAAY,CAAA;AAAA,IACvF,QAAQ;AACJ,aAAO,CAAA;AAAA,IACX;AAAA,EACJ;AACJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class t{async accessibility(){try{const e=typeof matchMedia=="function"?matchMedia("(prefers-reduced-motion: reduce)"):void 0;return typeof e?.matches=="boolean"?{"device.reduce_motion":e.matches}:{}}catch{return{}}}}exports.DeviceStateWeb=t;
2
+ //# sourceMappingURL=deviceState.web-CSfUgHDU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceState.web-CSfUgHDU.cjs","sources":["../src/adapters/web/deviceState.web.ts"],"sourcesContent":["import type { DeviceStateHandler } from \"../../core/telemetry\";\n\n/**\n * #173, web. Only `device.reduce_motion`, via `matchMedia`. No battery — `navigator.getBattery`\n * is Chromium-only, a browser-detection signal wearing a battery label (§5.2's defect) — and no\n * screen reader or font scale: RN-Web answers both with constants, and a fake value is worse\n * than none.\n */\nexport class DeviceStateWeb implements DeviceStateHandler {\n async accessibility(): Promise<Record<string, boolean>> {\n try {\n const mq = typeof matchMedia === \"function\" ? matchMedia(\"(prefers-reduced-motion: reduce)\") : undefined;\n return typeof mq?.matches === \"boolean\" ? { \"device.reduce_motion\": mq.matches } : {};\n } catch {\n return {};\n }\n }\n}\n"],"names":["DeviceStateWeb","mq"],"mappings":"gFAQO,MAAMA,CAA6C,CACtD,MAAM,eAAkD,CACpD,GAAI,CACA,MAAMC,EAAK,OAAO,YAAe,WAAa,WAAW,kCAAkC,EAAI,OAC/F,OAAO,OAAOA,GAAI,SAAY,UAAY,CAAE,uBAAwBA,EAAG,OAAA,EAAY,CAAA,CACvF,MAAQ,CACJ,MAAO,CAAA,CACX,CACJ,CACJ"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=700,h=[60,90,120];function l(s){const t=s.filter(a=>a>0);if(t.length===0)return 60;const r=1e3/(t[Math.ceil(.05*t.length)-1]??t[0]);return h.reduce((a,o)=>Math.abs(o-r)<Math.abs(a-r)?o:a)}function f(s,t,e){const r=[...s].sort((i,n)=>i-n),a=l(r),o=1e3/a;return{"frame.total_frames":s.length,"frame.slow_frames":s.filter(i=>i>o*2).length,"frame.frozen_frames":s.filter(i=>i>=m).length,"frame.max_total_duration_ms":r[r.length-1],"frame.p95_ms":r[Math.ceil(.95*r.length)-1],"display.refresh_rate":a,"frame.window_duration_ms":Math.round(Math.max(0,t)),"frame.source":e}}class c{constructor(t,e=1e4){this.telemetry=t,this.windowMs=e,this.lastFrameTime=performance.now(),this.windowStart=this.lastFrameTime,this.deltas=[],this.started=!1}start(){if(this.started)return Promise.resolve();this.started=!0,this.telemetry.views.onBoundary(()=>this.emitWindow(performance.now()));const t=()=>{const e=performance.now();this.deltas.push(e-this.lastFrameTime),this.lastFrameTime=e,e-this.windowStart>=this.windowMs&&this.emitWindow(e),requestAnimationFrame(t)};return requestAnimationFrame(t),Promise.resolve()}async emitWindow(t){const e=t-this.windowStart;if(this.windowStart=t,this.deltas.length===0)return;const r=f(this.deltas,e,"requestAnimationFrame");this.deltas=[],await this.telemetry.log("frame.summary",r)}}exports.FrameDropTracker=c;
2
+ //# sourceMappingURL=frameTracker-9j0en6Zm.cjs.map