@safaricom-mxl/web-sdk 0.0.12 → 0.0.14

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 (1092) hide show
  1. package/DATA_EXPORT.md +1 -1
  2. package/REACT.md +1 -1
  3. package/README.md +19 -28
  4. package/UPGRADING.md +2 -2
  5. package/dist/_virtual/_rolldown/runtime.cjs +7 -13
  6. package/dist/api-logs/api/LogAPI/LogAPI.cjs +6 -7
  7. package/dist/api-logs/api/LogAPI/LogAPI.cjs.map +1 -1
  8. package/dist/api-logs/api/LogAPI/LogAPI.d.cts +0 -1
  9. package/dist/api-logs/api/LogAPI/LogAPI.d.cts.map +1 -1
  10. package/dist/api-logs/api/LogAPI/LogAPI.d.ts +0 -2
  11. package/dist/api-logs/api/LogAPI/LogAPI.d.ts.map +1 -1
  12. package/dist/api-logs/api/LogAPI/LogAPI.js +1 -2
  13. package/dist/api-logs/api/LogAPI/LogAPI.js.map +1 -1
  14. package/dist/api-logs/api/LogAPI/index.cjs +3 -4
  15. package/dist/api-logs/api/LogAPI/index.js +1 -2
  16. package/dist/api-logs/api/LogAPI/types.d.cts +0 -1
  17. package/dist/api-logs/api/LogAPI/types.d.cts.map +1 -1
  18. package/dist/api-logs/api/LogAPI/types.d.ts +0 -2
  19. package/dist/api-logs/api/LogAPI/types.d.ts.map +1 -1
  20. package/dist/api-logs/api/index.cjs +3 -4
  21. package/dist/api-logs/api/index.d.ts +0 -1
  22. package/dist/api-logs/api/index.js +1 -2
  23. package/dist/api-logs/index.cjs +5 -6
  24. package/dist/api-logs/index.d.ts +0 -1
  25. package/dist/api-logs/index.js +1 -2
  26. package/dist/api-logs/logAPI.cjs +3 -5
  27. package/dist/api-logs/logAPI.cjs.map +1 -1
  28. package/dist/api-logs/logAPI.js +1 -2
  29. package/dist/api-logs/logAPI.js.map +1 -1
  30. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.cjs +2 -3
  31. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.cjs.map +1 -1
  32. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.d.cts +0 -1
  33. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.d.cts.map +1 -1
  34. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.d.ts +0 -2
  35. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.d.ts.map +1 -1
  36. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.js +1 -1
  37. package/dist/api-logs/manager/NoOpLogManager/NoOpLogManager.js.map +1 -1
  38. package/dist/api-logs/manager/NoOpLogManager/index.cjs +3 -4
  39. package/dist/api-logs/manager/NoOpLogManager/index.js +1 -2
  40. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.cjs +3 -5
  41. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.cjs.map +1 -1
  42. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.d.cts +0 -1
  43. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.d.cts.map +1 -1
  44. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.d.ts +0 -2
  45. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.d.ts.map +1 -1
  46. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.js +1 -2
  47. package/dist/api-logs/manager/ProxyLogManager/ProxyLogManager.js.map +1 -1
  48. package/dist/api-logs/manager/ProxyLogManager/index.cjs +3 -4
  49. package/dist/api-logs/manager/ProxyLogManager/index.js +1 -2
  50. package/dist/api-logs/manager/index.cjs +4 -5
  51. package/dist/api-logs/manager/index.js +1 -2
  52. package/dist/api-page/api/PageAPI/PageAPI.cjs +6 -7
  53. package/dist/api-page/api/PageAPI/PageAPI.cjs.map +1 -1
  54. package/dist/api-page/api/PageAPI/PageAPI.js +1 -2
  55. package/dist/api-page/api/PageAPI/PageAPI.js.map +1 -1
  56. package/dist/api-page/api/PageAPI/index.cjs +3 -4
  57. package/dist/api-page/api/PageAPI/index.js +1 -2
  58. package/dist/api-page/api/index.cjs +3 -4
  59. package/dist/api-page/api/index.js +1 -2
  60. package/dist/api-page/index.cjs +5 -6
  61. package/dist/api-page/index.js +1 -2
  62. package/dist/api-page/manager/NoOpPageManager/NoOpPageManager.cjs +2 -3
  63. package/dist/api-page/manager/NoOpPageManager/NoOpPageManager.cjs.map +1 -1
  64. package/dist/api-page/manager/NoOpPageManager/NoOpPageManager.js +1 -1
  65. package/dist/api-page/manager/NoOpPageManager/NoOpPageManager.js.map +1 -1
  66. package/dist/api-page/manager/NoOpPageManager/index.cjs +3 -4
  67. package/dist/api-page/manager/NoOpPageManager/index.js +1 -2
  68. package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.cjs +3 -5
  69. package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.cjs.map +1 -1
  70. package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.js +1 -2
  71. package/dist/api-page/manager/ProxyPageManager/ProxyPageManager.js.map +1 -1
  72. package/dist/api-page/manager/ProxyPageManager/index.cjs +3 -4
  73. package/dist/api-page/manager/ProxyPageManager/index.js +1 -2
  74. package/dist/api-page/manager/index.cjs +4 -5
  75. package/dist/api-page/manager/index.js +1 -2
  76. package/dist/api-page/pageAPI.cjs +3 -5
  77. package/dist/api-page/pageAPI.cjs.map +1 -1
  78. package/dist/api-page/pageAPI.js +1 -2
  79. package/dist/api-page/pageAPI.js.map +1 -1
  80. package/dist/api-sessions/api/SessionAPI/SessionAPI.cjs +6 -7
  81. package/dist/api-sessions/api/SessionAPI/SessionAPI.cjs.map +1 -1
  82. package/dist/api-sessions/api/SessionAPI/SessionAPI.d.cts +0 -1
  83. package/dist/api-sessions/api/SessionAPI/SessionAPI.d.cts.map +1 -1
  84. package/dist/api-sessions/api/SessionAPI/SessionAPI.d.ts +0 -2
  85. package/dist/api-sessions/api/SessionAPI/SessionAPI.d.ts.map +1 -1
  86. package/dist/api-sessions/api/SessionAPI/SessionAPI.js +1 -2
  87. package/dist/api-sessions/api/SessionAPI/SessionAPI.js.map +1 -1
  88. package/dist/api-sessions/api/SessionAPI/index.cjs +3 -4
  89. package/dist/api-sessions/api/SessionAPI/index.js +1 -2
  90. package/dist/api-sessions/api/SessionAPI/types.d.cts +0 -1
  91. package/dist/api-sessions/api/SessionAPI/types.d.cts.map +1 -1
  92. package/dist/api-sessions/api/SessionAPI/types.d.ts +0 -2
  93. package/dist/api-sessions/api/SessionAPI/types.d.ts.map +1 -1
  94. package/dist/api-sessions/api/index.cjs +3 -4
  95. package/dist/api-sessions/api/index.d.ts +0 -1
  96. package/dist/api-sessions/api/index.js +1 -2
  97. package/dist/api-sessions/index.cjs +5 -6
  98. package/dist/api-sessions/index.d.ts +0 -1
  99. package/dist/api-sessions/index.js +1 -2
  100. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.cjs +2 -3
  101. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.cjs.map +1 -1
  102. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.d.ts +0 -2
  103. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.d.ts.map +1 -1
  104. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.js +1 -1
  105. package/dist/api-sessions/manager/NoOpSpanSessionManager/NoOpSpanSessionManager.js.map +1 -1
  106. package/dist/api-sessions/manager/NoOpSpanSessionManager/index.cjs +3 -4
  107. package/dist/api-sessions/manager/NoOpSpanSessionManager/index.js +1 -2
  108. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.cjs +3 -5
  109. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.cjs.map +1 -1
  110. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.d.ts +0 -2
  111. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.d.ts.map +1 -1
  112. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.js +1 -2
  113. package/dist/api-sessions/manager/ProxySpanSessionManager/ProxySpanSessionManager.js.map +1 -1
  114. package/dist/api-sessions/manager/ProxySpanSessionManager/index.cjs +3 -4
  115. package/dist/api-sessions/manager/ProxySpanSessionManager/index.js +1 -2
  116. package/dist/api-sessions/manager/index.cjs +4 -5
  117. package/dist/api-sessions/manager/index.d.ts +0 -2
  118. package/dist/api-sessions/manager/index.js +1 -2
  119. package/dist/api-sessions/manager/types.d.cts +3 -0
  120. package/dist/api-sessions/manager/types.d.cts.map +1 -1
  121. package/dist/api-sessions/manager/types.d.ts +3 -1
  122. package/dist/api-sessions/manager/types.d.ts.map +1 -1
  123. package/dist/api-sessions/sessionAPI.cjs +3 -5
  124. package/dist/api-sessions/sessionAPI.cjs.map +1 -1
  125. package/dist/api-sessions/sessionAPI.js +1 -2
  126. package/dist/api-sessions/sessionAPI.js.map +1 -1
  127. package/dist/api-traces/api/TraceAPI/TraceAPI.cjs +6 -7
  128. package/dist/api-traces/api/TraceAPI/TraceAPI.cjs.map +1 -1
  129. package/dist/api-traces/api/TraceAPI/TraceAPI.d.cts +0 -1
  130. package/dist/api-traces/api/TraceAPI/TraceAPI.d.cts.map +1 -1
  131. package/dist/api-traces/api/TraceAPI/TraceAPI.d.ts +0 -2
  132. package/dist/api-traces/api/TraceAPI/TraceAPI.d.ts.map +1 -1
  133. package/dist/api-traces/api/TraceAPI/TraceAPI.js +1 -2
  134. package/dist/api-traces/api/TraceAPI/TraceAPI.js.map +1 -1
  135. package/dist/api-traces/api/TraceAPI/index.cjs +3 -4
  136. package/dist/api-traces/api/TraceAPI/index.js +1 -2
  137. package/dist/api-traces/api/TraceAPI/types.d.cts.map +1 -1
  138. package/dist/api-traces/api/TraceAPI/types.d.ts +0 -1
  139. package/dist/api-traces/api/TraceAPI/types.d.ts.map +1 -1
  140. package/dist/api-traces/api/index.cjs +3 -4
  141. package/dist/api-traces/api/index.d.ts +0 -1
  142. package/dist/api-traces/api/index.js +1 -2
  143. package/dist/api-traces/index.cjs +5 -6
  144. package/dist/api-traces/index.d.ts +0 -2
  145. package/dist/api-traces/index.js +1 -2
  146. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.cjs +4 -5
  147. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.cjs.map +1 -1
  148. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.d.ts +0 -2
  149. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.d.ts.map +1 -1
  150. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.js +1 -2
  151. package/dist/api-traces/manager/NoOpTraceManager/NoOpTraceManager.js.map +1 -1
  152. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.cjs +3 -4
  153. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.cjs.map +1 -1
  154. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.d.ts +0 -1
  155. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.d.ts.map +1 -1
  156. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.js +1 -2
  157. package/dist/api-traces/manager/NoOpTraceManager/NonRecordingExtendedSpan.js.map +1 -1
  158. package/dist/api-traces/manager/NoOpTraceManager/index.cjs +3 -4
  159. package/dist/api-traces/manager/NoOpTraceManager/index.js +1 -2
  160. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.cjs +3 -5
  161. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.cjs.map +1 -1
  162. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.d.ts +0 -2
  163. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.d.ts.map +1 -1
  164. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.js +1 -2
  165. package/dist/api-traces/manager/ProxyTraceManager/ProxyTraceManager.js.map +1 -1
  166. package/dist/api-traces/manager/ProxyTraceManager/index.cjs +3 -4
  167. package/dist/api-traces/manager/ProxyTraceManager/index.js +1 -2
  168. package/dist/api-traces/manager/index.cjs +4 -5
  169. package/dist/api-traces/manager/index.d.ts +0 -2
  170. package/dist/api-traces/manager/index.js +1 -2
  171. package/dist/api-traces/manager/types.d.ts +0 -1
  172. package/dist/api-traces/manager/types.d.ts.map +1 -1
  173. package/dist/api-traces/traceAPI.cjs +3 -5
  174. package/dist/api-traces/traceAPI.cjs.map +1 -1
  175. package/dist/api-traces/traceAPI.js +1 -2
  176. package/dist/api-traces/traceAPI.js.map +1 -1
  177. package/dist/api-users/api/UserAPI/UserAPI.cjs +6 -7
  178. package/dist/api-users/api/UserAPI/UserAPI.cjs.map +1 -1
  179. package/dist/api-users/api/UserAPI/UserAPI.js +1 -2
  180. package/dist/api-users/api/UserAPI/UserAPI.js.map +1 -1
  181. package/dist/api-users/api/UserAPI/index.cjs +3 -4
  182. package/dist/api-users/api/UserAPI/index.js +1 -2
  183. package/dist/api-users/api/index.cjs +3 -4
  184. package/dist/api-users/api/index.js +1 -2
  185. package/dist/api-users/index.cjs +6 -7
  186. package/dist/api-users/index.js +1 -2
  187. package/dist/api-users/manager/NoOpUserManager/NoOpUserManager.cjs +2 -3
  188. package/dist/api-users/manager/NoOpUserManager/NoOpUserManager.cjs.map +1 -1
  189. package/dist/api-users/manager/NoOpUserManager/NoOpUserManager.js +1 -1
  190. package/dist/api-users/manager/NoOpUserManager/NoOpUserManager.js.map +1 -1
  191. package/dist/api-users/manager/NoOpUserManager/index.cjs +3 -4
  192. package/dist/api-users/manager/NoOpUserManager/index.js +1 -2
  193. package/dist/api-users/manager/ProxyUserManager/ProxyUserManager.cjs +3 -5
  194. package/dist/api-users/manager/ProxyUserManager/ProxyUserManager.cjs.map +1 -1
  195. package/dist/api-users/manager/ProxyUserManager/ProxyUserManager.js +1 -2
  196. package/dist/api-users/manager/ProxyUserManager/ProxyUserManager.js.map +1 -1
  197. package/dist/api-users/manager/ProxyUserManager/index.cjs +3 -4
  198. package/dist/api-users/manager/ProxyUserManager/index.js +1 -2
  199. package/dist/api-users/manager/constants/index.cjs +2 -3
  200. package/dist/api-users/manager/constants/index.cjs.map +1 -1
  201. package/dist/api-users/manager/constants/index.js +1 -1
  202. package/dist/api-users/manager/index.cjs +5 -6
  203. package/dist/api-users/manager/index.js +1 -2
  204. package/dist/api-users/userAPI.cjs +3 -5
  205. package/dist/api-users/userAPI.cjs.map +1 -1
  206. package/dist/api-users/userAPI.js +1 -2
  207. package/dist/api-users/userAPI.js.map +1 -1
  208. package/dist/common/attributes.cjs +3 -5
  209. package/dist/common/attributes.cjs.map +1 -1
  210. package/dist/common/attributes.js +1 -2
  211. package/dist/common/attributes.js.map +1 -1
  212. package/dist/common/index.cjs +3 -4
  213. package/dist/common/index.js +1 -2
  214. package/dist/common/types.d.cts +1 -0
  215. package/dist/common/types.d.cts.map +1 -1
  216. package/dist/common/types.d.ts +1 -0
  217. package/dist/common/types.d.ts.map +1 -1
  218. package/dist/constants/attributes.cjs +11 -3
  219. package/dist/constants/attributes.cjs.map +1 -1
  220. package/dist/constants/attributes.d.cts +11 -4
  221. package/dist/constants/attributes.d.cts.map +1 -1
  222. package/dist/constants/attributes.d.ts +11 -4
  223. package/dist/constants/attributes.d.ts.map +1 -1
  224. package/dist/constants/attributes.js +10 -2
  225. package/dist/constants/attributes.js.map +1 -1
  226. package/dist/constants/index.cjs +4 -4
  227. package/dist/constants/index.d.cts +2 -2
  228. package/dist/constants/index.d.ts +2 -2
  229. package/dist/constants/index.js +2 -3
  230. package/dist/exporters/BaseFetchExporter/BaseFetchExporter.cjs +2 -3
  231. package/dist/exporters/BaseFetchExporter/BaseFetchExporter.cjs.map +1 -1
  232. package/dist/exporters/BaseFetchExporter/BaseFetchExporter.js +1 -1
  233. package/dist/exporters/BaseFetchExporter/BaseFetchExporter.js.map +1 -1
  234. package/dist/exporters/BaseFetchExporter/index.cjs +3 -4
  235. package/dist/exporters/BaseFetchExporter/index.js +1 -2
  236. package/dist/exporters/MXLLogExporter/MXLLogExporter.cjs +6 -7
  237. package/dist/exporters/MXLLogExporter/MXLLogExporter.cjs.map +1 -1
  238. package/dist/exporters/MXLLogExporter/MXLLogExporter.js +1 -2
  239. package/dist/exporters/MXLLogExporter/MXLLogExporter.js.map +1 -1
  240. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.cjs +5 -6
  241. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.cjs.map +1 -1
  242. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.d.cts.map +1 -1
  243. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.d.ts +0 -1
  244. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.d.ts.map +1 -1
  245. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.js +1 -2
  246. package/dist/exporters/MXLLogExporter/OTLPFetchLogExporter.js.map +1 -1
  247. package/dist/exporters/MXLLogExporter/index.cjs +3 -4
  248. package/dist/exporters/MXLLogExporter/index.js +1 -2
  249. package/dist/exporters/MXLLogExporter/utils.cjs +3 -4
  250. package/dist/exporters/MXLLogExporter/utils.cjs.map +1 -1
  251. package/dist/exporters/MXLLogExporter/utils.js +1 -2
  252. package/dist/exporters/MXLLogExporter/utils.js.map +1 -1
  253. package/dist/exporters/MXLTraceExporter/MXLTraceExporter.cjs +6 -7
  254. package/dist/exporters/MXLTraceExporter/MXLTraceExporter.cjs.map +1 -1
  255. package/dist/exporters/MXLTraceExporter/MXLTraceExporter.js +1 -2
  256. package/dist/exporters/MXLTraceExporter/MXLTraceExporter.js.map +1 -1
  257. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.cjs +5 -6
  258. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.cjs.map +1 -1
  259. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.d.ts +0 -1
  260. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.d.ts.map +1 -1
  261. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.js +1 -2
  262. package/dist/exporters/MXLTraceExporter/OTLPFetchTraceExporter.js.map +1 -1
  263. package/dist/exporters/MXLTraceExporter/index.cjs +3 -4
  264. package/dist/exporters/MXLTraceExporter/index.js +1 -2
  265. package/dist/exporters/MXLTraceExporter/utils.cjs +3 -4
  266. package/dist/exporters/MXLTraceExporter/utils.cjs.map +1 -1
  267. package/dist/exporters/MXLTraceExporter/utils.js +1 -2
  268. package/dist/exporters/MXLTraceExporter/utils.js.map +1 -1
  269. package/dist/exporters/constants.cjs +3 -6
  270. package/dist/exporters/constants.cjs.map +1 -1
  271. package/dist/exporters/constants.js +2 -4
  272. package/dist/exporters/constants.js.map +1 -1
  273. package/dist/exporters/index.cjs +7 -8
  274. package/dist/exporters/index.d.ts +0 -2
  275. package/dist/exporters/index.js +1 -2
  276. package/dist/exporters/otlpBrowserFetchExportDelegate.cjs +5 -6
  277. package/dist/exporters/otlpBrowserFetchExportDelegate.cjs.map +1 -1
  278. package/dist/exporters/otlpBrowserFetchExportDelegate.d.cts +2 -2
  279. package/dist/exporters/otlpBrowserFetchExportDelegate.d.cts.map +1 -1
  280. package/dist/exporters/otlpBrowserFetchExportDelegate.d.ts +2 -2
  281. package/dist/exporters/otlpBrowserFetchExportDelegate.d.ts.map +1 -1
  282. package/dist/exporters/otlpBrowserFetchExportDelegate.js +1 -2
  283. package/dist/exporters/otlpBrowserFetchExportDelegate.js.map +1 -1
  284. package/dist/exporters/utils.cjs +2 -3
  285. package/dist/exporters/utils.cjs.map +1 -1
  286. package/dist/exporters/utils.d.cts.map +1 -1
  287. package/dist/exporters/utils.d.ts.map +1 -1
  288. package/dist/exporters/utils.js +1 -1
  289. package/dist/exporters/utils.js.map +1 -1
  290. package/dist/index.cjs +17 -16
  291. package/dist/index.d.cts +3 -2
  292. package/dist/index.d.ts +3 -7
  293. package/dist/index.js +2 -2
  294. package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.cjs +3 -4
  295. package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.cjs.map +1 -1
  296. package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.js +1 -2
  297. package/dist/instrumentations/InstrumentationAbstract/InstrumentationAbstract.js.map +1 -1
  298. package/dist/instrumentations/InstrumentationAbstract/index.cjs +3 -4
  299. package/dist/instrumentations/InstrumentationAbstract/index.js +1 -2
  300. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.cjs +16 -8
  301. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.cjs.map +1 -1
  302. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.cts +7 -1
  303. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.cts.map +1 -1
  304. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.ts +7 -5
  305. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.d.ts.map +1 -1
  306. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.js +11 -3
  307. package/dist/instrumentations/MXLInstrumentationBase/MXLInstrumentationBase.js.map +1 -1
  308. package/dist/instrumentations/MXLInstrumentationBase/index.cjs +3 -4
  309. package/dist/instrumentations/MXLInstrumentationBase/index.js +1 -2
  310. package/dist/instrumentations/MXLInstrumentationBase/types.d.cts +3 -0
  311. package/dist/instrumentations/MXLInstrumentationBase/types.d.cts.map +1 -1
  312. package/dist/instrumentations/MXLInstrumentationBase/types.d.ts +3 -1
  313. package/dist/instrumentations/MXLInstrumentationBase/types.d.ts.map +1 -1
  314. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.cjs +4 -5
  315. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.cjs.map +1 -1
  316. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.d.ts +0 -1
  317. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.d.ts.map +1 -1
  318. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.js +1 -2
  319. package/dist/instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.js.map +1 -1
  320. package/dist/instrumentations/clicks/ClicksInstrumentation/index.cjs +3 -4
  321. package/dist/instrumentations/clicks/ClicksInstrumentation/index.js +1 -2
  322. package/dist/instrumentations/clicks/ClicksInstrumentation/types.d.cts +0 -1
  323. package/dist/instrumentations/clicks/ClicksInstrumentation/types.d.cts.map +1 -1
  324. package/dist/instrumentations/clicks/ClicksInstrumentation/types.d.ts +0 -2
  325. package/dist/instrumentations/clicks/ClicksInstrumentation/types.d.ts.map +1 -1
  326. package/dist/instrumentations/clicks/ClicksInstrumentation/utils.cjs +2 -3
  327. package/dist/instrumentations/clicks/ClicksInstrumentation/utils.cjs.map +1 -1
  328. package/dist/instrumentations/clicks/ClicksInstrumentation/utils.js +1 -1
  329. package/dist/instrumentations/clicks/index.cjs +3 -4
  330. package/dist/instrumentations/clicks/index.d.ts +0 -1
  331. package/dist/instrumentations/clicks/index.js +1 -2
  332. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.cjs +12 -13
  333. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.cjs.map +1 -1
  334. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.cts.map +1 -1
  335. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.ts +0 -1
  336. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.d.ts.map +1 -1
  337. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.js +8 -9
  338. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.js.map +1 -1
  339. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/AttributeNames.cjs +2 -3
  340. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/AttributeNames.cjs.map +1 -1
  341. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/AttributeNames.js +1 -1
  342. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/AttributeNames.js.map +1 -1
  343. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/EventNames.cjs +2 -3
  344. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/EventNames.cjs.map +1 -1
  345. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/EventNames.js +1 -1
  346. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/enums/EventNames.js.map +1 -1
  347. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/index.cjs +4 -5
  348. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/index.js +1 -2
  349. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/types.d.cts.map +1 -1
  350. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/types.d.ts +0 -1
  351. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/types.d.ts.map +1 -1
  352. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.cjs +6 -7
  353. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.cjs.map +1 -1
  354. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.js +4 -5
  355. package/dist/instrumentations/document-load/DocumentLoadInstrumentation/utils.js.map +1 -1
  356. package/dist/instrumentations/document-load/index.cjs +4 -5
  357. package/dist/instrumentations/document-load/index.d.ts +0 -1
  358. package/dist/instrumentations/document-load/index.js +1 -2
  359. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.cjs +67 -0
  360. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.cjs.map +1 -0
  361. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.d.cts +19 -0
  362. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.d.cts.map +1 -0
  363. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.d.ts +19 -0
  364. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.d.ts.map +1 -0
  365. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.js +66 -0
  366. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.js.map +1 -0
  367. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.cjs +21 -0
  368. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.cjs.map +1 -0
  369. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.d.cts +12 -0
  370. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.d.cts.map +1 -0
  371. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.d.ts +12 -0
  372. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.d.ts.map +1 -0
  373. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.js +13 -0
  374. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/constants.js.map +1 -0
  375. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/index.cjs +3 -0
  376. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/index.d.cts +3 -0
  377. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/index.d.ts +3 -0
  378. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/index.js +2 -0
  379. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/types.cjs +0 -0
  380. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/types.d.cts +16 -0
  381. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/types.d.cts.map +1 -0
  382. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/types.d.ts +16 -0
  383. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/types.d.ts.map +1 -0
  384. package/dist/instrumentations/element-timing/ElementTimingInstrumentation/types.js +0 -0
  385. package/dist/instrumentations/element-timing/index.cjs +3 -0
  386. package/dist/instrumentations/element-timing/index.d.cts +3 -0
  387. package/dist/instrumentations/element-timing/index.d.ts +3 -0
  388. package/dist/instrumentations/element-timing/index.js +2 -0
  389. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.cjs +3 -4
  390. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.cjs.map +1 -1
  391. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.d.ts +0 -1
  392. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.d.ts.map +1 -1
  393. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.js +1 -2
  394. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.js.map +1 -1
  395. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/index.cjs +3 -4
  396. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/index.js +1 -2
  397. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/types.d.cts +0 -1
  398. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/types.d.cts.map +1 -1
  399. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/types.d.ts +0 -2
  400. package/dist/instrumentations/empty-root/EmptyRootInstrumentation/types.d.ts.map +1 -1
  401. package/dist/instrumentations/empty-root/index.cjs +3 -4
  402. package/dist/instrumentations/empty-root/index.d.ts +0 -1
  403. package/dist/instrumentations/empty-root/index.js +1 -2
  404. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.cjs +3 -4
  405. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.cjs.map +1 -1
  406. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.d.ts +0 -1
  407. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.d.ts.map +1 -1
  408. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.js +1 -2
  409. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.js.map +1 -1
  410. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/index.cjs +3 -4
  411. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/index.js +1 -2
  412. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/types.d.cts +0 -1
  413. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/types.d.cts.map +1 -1
  414. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/types.d.ts +0 -2
  415. package/dist/instrumentations/exceptions/GlobalExceptionInstrumentation/types.d.ts.map +1 -1
  416. package/dist/instrumentations/exceptions/index.cjs +3 -4
  417. package/dist/instrumentations/exceptions/index.d.ts +0 -1
  418. package/dist/instrumentations/exceptions/index.js +1 -2
  419. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.cjs +7 -8
  420. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.cjs.map +1 -1
  421. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.js +3 -4
  422. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/MXLErrorBoundary.js.map +1 -1
  423. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/index.cjs +3 -4
  424. package/dist/instrumentations/exceptions/react/MXLErrorBoundary/index.js +1 -2
  425. package/dist/instrumentations/fetch/MXLFetchInstrumentation/MXLFetchInstrumentation.cjs +3 -4
  426. package/dist/instrumentations/fetch/MXLFetchInstrumentation/MXLFetchInstrumentation.cjs.map +1 -1
  427. package/dist/instrumentations/fetch/MXLFetchInstrumentation/MXLFetchInstrumentation.js +1 -2
  428. package/dist/instrumentations/fetch/MXLFetchInstrumentation/MXLFetchInstrumentation.js.map +1 -1
  429. package/dist/instrumentations/fetch/MXLFetchInstrumentation/index.cjs +3 -4
  430. package/dist/instrumentations/fetch/MXLFetchInstrumentation/index.js +1 -2
  431. package/dist/instrumentations/fetch/index.cjs +3 -4
  432. package/dist/instrumentations/fetch/index.d.ts +0 -1
  433. package/dist/instrumentations/fetch/index.js +1 -2
  434. package/dist/instrumentations/index.cjs +19 -20
  435. package/dist/instrumentations/index.d.cts +9 -9
  436. package/dist/instrumentations/index.d.ts +9 -19
  437. package/dist/instrumentations/index.js +5 -6
  438. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.cjs +168 -0
  439. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.cjs.map +1 -0
  440. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.d.cts +33 -0
  441. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.d.cts.map +1 -0
  442. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.d.ts +33 -0
  443. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.d.ts.map +1 -0
  444. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.js +166 -0
  445. package/dist/instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.js.map +1 -0
  446. package/dist/instrumentations/loaf/LoafInstrumentation/constants.cjs +29 -0
  447. package/dist/instrumentations/loaf/LoafInstrumentation/constants.cjs.map +1 -0
  448. package/dist/instrumentations/loaf/LoafInstrumentation/constants.d.cts +16 -0
  449. package/dist/instrumentations/loaf/LoafInstrumentation/constants.d.cts.map +1 -0
  450. package/dist/instrumentations/loaf/LoafInstrumentation/constants.d.ts +16 -0
  451. package/dist/instrumentations/loaf/LoafInstrumentation/constants.d.ts.map +1 -0
  452. package/dist/instrumentations/loaf/LoafInstrumentation/constants.js +17 -0
  453. package/dist/instrumentations/loaf/LoafInstrumentation/constants.js.map +1 -0
  454. package/dist/instrumentations/loaf/LoafInstrumentation/index.cjs +3 -0
  455. package/dist/instrumentations/loaf/LoafInstrumentation/index.d.cts +3 -0
  456. package/dist/instrumentations/loaf/LoafInstrumentation/index.d.ts +3 -0
  457. package/dist/instrumentations/loaf/LoafInstrumentation/index.js +2 -0
  458. package/dist/instrumentations/loaf/LoafInstrumentation/types.cjs +0 -0
  459. package/dist/instrumentations/loaf/LoafInstrumentation/types.d.cts +6 -0
  460. package/dist/instrumentations/loaf/LoafInstrumentation/types.d.cts.map +1 -0
  461. package/dist/instrumentations/loaf/LoafInstrumentation/types.d.ts +6 -0
  462. package/dist/instrumentations/loaf/LoafInstrumentation/types.d.ts.map +1 -0
  463. package/dist/instrumentations/loaf/LoafInstrumentation/types.js +0 -0
  464. package/dist/instrumentations/loaf/index.cjs +3 -0
  465. package/dist/instrumentations/loaf/index.d.cts +3 -0
  466. package/dist/instrumentations/loaf/index.d.ts +3 -0
  467. package/dist/instrumentations/loaf/index.js +2 -0
  468. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.cjs +7 -8
  469. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.cjs.map +1 -1
  470. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.d.ts +0 -1
  471. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.d.ts.map +1 -1
  472. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.js +4 -5
  473. package/dist/instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.js.map +1 -1
  474. package/dist/instrumentations/navigation/NavigationInstrumentation/index.cjs +4 -5
  475. package/dist/instrumentations/navigation/NavigationInstrumentation/index.js +1 -2
  476. package/dist/instrumentations/navigation/NavigationInstrumentation/instance.cjs +3 -4
  477. package/dist/instrumentations/navigation/NavigationInstrumentation/instance.cjs.map +1 -1
  478. package/dist/instrumentations/navigation/NavigationInstrumentation/instance.js +1 -2
  479. package/dist/instrumentations/navigation/NavigationInstrumentation/instance.js.map +1 -1
  480. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.cjs +3 -4
  481. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.cjs.map +1 -1
  482. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.d.cts +0 -1
  483. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.d.cts.map +1 -1
  484. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.d.ts +0 -2
  485. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.d.ts.map +1 -1
  486. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.js +1 -2
  487. package/dist/instrumentations/navigation/NavigationInstrumentation/react/createReactRouterNavigationInstrumentation.js.map +1 -1
  488. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/index.cjs +3 -4
  489. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/index.js +1 -2
  490. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.cjs +8 -9
  491. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.cjs.map +1 -1
  492. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.js +3 -4
  493. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withMXLRoutingLegacy.js.map +1 -1
  494. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/index.cjs +3 -4
  495. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/index.js +1 -2
  496. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.cjs +5 -6
  497. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.cjs.map +1 -1
  498. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.js +3 -4
  499. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Data/listenToRouterChanges.js.map +1 -1
  500. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/index.cjs +3 -4
  501. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/index.js +1 -2
  502. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.cjs +8 -9
  503. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.cjs.map +1 -1
  504. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.js +4 -5
  505. package/dist/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV6Declarative/withMXLRouting.js.map +1 -1
  506. package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.cts +0 -1
  507. package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.cts.map +1 -1
  508. package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.ts +0 -2
  509. package/dist/instrumentations/navigation/NavigationInstrumentation/types.d.ts.map +1 -1
  510. package/dist/instrumentations/navigation/index.cjs +4 -5
  511. package/dist/instrumentations/navigation/index.d.ts +0 -1
  512. package/dist/instrumentations/navigation/index.js +1 -2
  513. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.cjs +59 -0
  514. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.cjs.map +1 -0
  515. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.cts +19 -0
  516. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.cts.map +1 -0
  517. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.ts +19 -0
  518. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.d.ts.map +1 -0
  519. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.js +57 -0
  520. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.js.map +1 -0
  521. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.cjs +13 -0
  522. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.cjs.map +1 -0
  523. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.d.cts +8 -0
  524. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.d.cts.map +1 -0
  525. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.d.ts +8 -0
  526. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.d.ts.map +1 -0
  527. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.js +9 -0
  528. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/constants.js.map +1 -0
  529. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/index.cjs +3 -0
  530. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/index.d.cts +3 -0
  531. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/index.d.ts +3 -0
  532. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/index.js +2 -0
  533. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/types.cjs +0 -0
  534. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/types.d.cts +7 -0
  535. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/types.d.cts.map +1 -0
  536. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/types.d.ts +7 -0
  537. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/types.d.ts.map +1 -0
  538. package/dist/instrumentations/server-timing/ServerTimingInstrumentation/types.js +0 -0
  539. package/dist/instrumentations/server-timing/index.cjs +3 -0
  540. package/dist/instrumentations/server-timing/index.d.cts +3 -0
  541. package/dist/instrumentations/server-timing/index.d.ts +3 -0
  542. package/dist/instrumentations/server-timing/index.js +2 -0
  543. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.cjs +7 -8
  544. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.cjs.map +1 -1
  545. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.d.cts.map +1 -1
  546. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.d.ts +0 -1
  547. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.d.ts.map +1 -1
  548. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.js +1 -2
  549. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/SpanSessionBrowserActivityInstrumentation.js.map +1 -1
  550. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/constants.cjs +2 -3
  551. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/constants.cjs.map +1 -1
  552. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/constants.js +1 -1
  553. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/index.cjs +3 -4
  554. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/index.js +1 -2
  555. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/types.d.cts +0 -1
  556. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/types.d.cts.map +1 -1
  557. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/types.d.ts +0 -2
  558. package/dist/instrumentations/session/SpanSessionBrowserActivityInstrumentation/types.d.ts.map +1 -1
  559. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.cjs +3 -4
  560. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.cjs.map +1 -1
  561. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.d.ts +0 -1
  562. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.d.ts.map +1 -1
  563. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.js +1 -2
  564. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/SpanSessionOnLoadInstrumentation.js.map +1 -1
  565. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/index.cjs +3 -4
  566. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/index.js +1 -2
  567. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/types.d.cts +0 -1
  568. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/types.d.cts.map +1 -1
  569. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/types.d.ts +0 -2
  570. package/dist/instrumentations/session/SpanSessionOnLoadInstrumentation/types.d.ts.map +1 -1
  571. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.cjs +4 -5
  572. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.cjs.map +1 -1
  573. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.d.cts.map +1 -1
  574. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.d.ts +0 -1
  575. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.d.ts.map +1 -1
  576. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.js +1 -2
  577. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/SpanSessionTimeoutInstrumentation.js.map +1 -1
  578. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/constants.cjs +2 -3
  579. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/constants.cjs.map +1 -1
  580. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/constants.js +1 -1
  581. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/index.cjs +3 -4
  582. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/index.js +1 -2
  583. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/types.d.cts +0 -1
  584. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/types.d.cts.map +1 -1
  585. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/types.d.ts +0 -2
  586. package/dist/instrumentations/session/SpanSessionTimeoutInstrumentation/types.d.ts.map +1 -1
  587. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.cjs +10 -73
  588. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.cjs.map +1 -1
  589. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.d.cts +1 -14
  590. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.d.cts.map +1 -1
  591. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.d.ts +1 -17
  592. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.d.ts.map +1 -1
  593. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.js +8 -71
  594. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/SpanSessionVisibilityInstrumentation.js.map +1 -1
  595. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/index.cjs +3 -4
  596. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/index.js +1 -2
  597. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/types.d.cts +1 -6
  598. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/types.d.cts.map +1 -1
  599. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/types.d.ts +1 -7
  600. package/dist/instrumentations/session/SpanSessionVisibilityInstrumentation/types.d.ts.map +1 -1
  601. package/dist/instrumentations/session/index.cjs +6 -11
  602. package/dist/instrumentations/session/index.d.cts +1 -5
  603. package/dist/instrumentations/session/index.d.ts +1 -11
  604. package/dist/instrumentations/session/index.js +1 -4
  605. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.cjs +95 -0
  606. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.cjs.map +1 -0
  607. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.d.cts +23 -0
  608. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.d.cts.map +1 -0
  609. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.d.ts +23 -0
  610. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.d.ts.map +1 -0
  611. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.js +93 -0
  612. package/dist/instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.js.map +1 -0
  613. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.cjs +17 -0
  614. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.cjs.map +1 -0
  615. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.d.cts +10 -0
  616. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.d.cts.map +1 -0
  617. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.d.ts +10 -0
  618. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.d.ts.map +1 -0
  619. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.js +11 -0
  620. package/dist/instrumentations/user-timing/UserTimingInstrumentation/constants.js.map +1 -0
  621. package/dist/instrumentations/user-timing/UserTimingInstrumentation/index.cjs +3 -0
  622. package/dist/instrumentations/user-timing/UserTimingInstrumentation/index.d.cts +3 -0
  623. package/dist/instrumentations/user-timing/UserTimingInstrumentation/index.d.ts +3 -0
  624. package/dist/instrumentations/user-timing/UserTimingInstrumentation/index.js +2 -0
  625. package/dist/instrumentations/user-timing/UserTimingInstrumentation/types.cjs +0 -0
  626. package/dist/instrumentations/user-timing/UserTimingInstrumentation/types.d.cts +18 -0
  627. package/dist/instrumentations/user-timing/UserTimingInstrumentation/types.d.cts.map +1 -0
  628. package/dist/instrumentations/user-timing/UserTimingInstrumentation/types.d.ts +18 -0
  629. package/dist/instrumentations/user-timing/UserTimingInstrumentation/types.d.ts.map +1 -0
  630. package/dist/instrumentations/user-timing/UserTimingInstrumentation/types.js +0 -0
  631. package/dist/instrumentations/user-timing/index.cjs +3 -0
  632. package/dist/instrumentations/user-timing/index.d.cts +3 -0
  633. package/dist/instrumentations/user-timing/index.d.ts +3 -0
  634. package/dist/instrumentations/user-timing/index.js +2 -0
  635. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.cjs +79 -105
  636. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.cjs.map +1 -1
  637. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.cts.map +1 -1
  638. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.ts +0 -1
  639. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.d.ts.map +1 -1
  640. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.js +75 -101
  641. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.js.map +1 -1
  642. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.cjs +19 -0
  643. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.cjs.map +1 -0
  644. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.d.cts +11 -0
  645. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.d.cts.map +1 -0
  646. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.d.ts +11 -0
  647. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.d.ts.map +1 -0
  648. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.js +12 -0
  649. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/attributes.js.map +1 -0
  650. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.cjs +60 -4
  651. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.cjs.map +1 -1
  652. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.cts +9 -7
  653. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.cts.map +1 -1
  654. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.ts +9 -7
  655. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.ts.map +1 -1
  656. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.js +57 -3
  657. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/constants.js.map +1 -1
  658. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/index.cjs +3 -4
  659. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/index.js +1 -2
  660. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.cts +1 -1
  661. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.cts.map +1 -1
  662. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.ts +1 -2
  663. package/dist/instrumentations/web-vitals/WebVitalsInstrumentation/types.d.ts.map +1 -1
  664. package/dist/instrumentations/web-vitals/index.cjs +3 -4
  665. package/dist/instrumentations/web-vitals/index.d.ts +0 -1
  666. package/dist/instrumentations/web-vitals/index.js +1 -2
  667. package/dist/instrumentations/xhr/MXLXHRInstrumentation/MXLXHRInstrumentation.cjs +3 -4
  668. package/dist/instrumentations/xhr/MXLXHRInstrumentation/MXLXHRInstrumentation.cjs.map +1 -1
  669. package/dist/instrumentations/xhr/MXLXHRInstrumentation/MXLXHRInstrumentation.js +1 -2
  670. package/dist/instrumentations/xhr/MXLXHRInstrumentation/MXLXHRInstrumentation.js.map +1 -1
  671. package/dist/instrumentations/xhr/MXLXHRInstrumentation/index.cjs +3 -4
  672. package/dist/instrumentations/xhr/MXLXHRInstrumentation/index.js +1 -2
  673. package/dist/instrumentations/xhr/index.cjs +3 -4
  674. package/dist/instrumentations/xhr/index.d.ts +0 -1
  675. package/dist/instrumentations/xhr/index.js +1 -2
  676. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.cjs +43 -10
  677. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.cjs.map +1 -1
  678. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.cts +10 -0
  679. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.cts.map +1 -1
  680. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.ts +10 -1
  681. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.d.ts.map +1 -1
  682. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.js +39 -6
  683. package/dist/managers/MXLConfigManager/MXLDynamicConfigManager.js.map +1 -1
  684. package/dist/managers/MXLConfigManager/constants.cjs +2 -3
  685. package/dist/managers/MXLConfigManager/constants.cjs.map +1 -1
  686. package/dist/managers/MXLConfigManager/constants.d.cts +0 -1
  687. package/dist/managers/MXLConfigManager/constants.d.cts.map +1 -1
  688. package/dist/managers/MXLConfigManager/constants.d.ts +0 -2
  689. package/dist/managers/MXLConfigManager/constants.d.ts.map +1 -1
  690. package/dist/managers/MXLConfigManager/constants.js +1 -1
  691. package/dist/managers/MXLConfigManager/index.cjs +3 -4
  692. package/dist/managers/MXLConfigManager/index.js +1 -2
  693. package/dist/managers/MXLConfigManager/types.d.cts +2 -1
  694. package/dist/managers/MXLConfigManager/types.d.cts.map +1 -1
  695. package/dist/managers/MXLConfigManager/types.d.ts +2 -2
  696. package/dist/managers/MXLConfigManager/types.d.ts.map +1 -1
  697. package/dist/managers/MXLConfigManager/utils.cjs +2 -3
  698. package/dist/managers/MXLConfigManager/utils.cjs.map +1 -1
  699. package/dist/managers/MXLConfigManager/utils.js +1 -1
  700. package/dist/managers/MXLLimitManager/MXLLimitManager.cjs +24 -8
  701. package/dist/managers/MXLLimitManager/MXLLimitManager.cjs.map +1 -1
  702. package/dist/managers/MXLLimitManager/MXLLimitManager.d.cts +3 -0
  703. package/dist/managers/MXLLimitManager/MXLLimitManager.d.cts.map +1 -1
  704. package/dist/managers/MXLLimitManager/MXLLimitManager.d.ts +3 -1
  705. package/dist/managers/MXLLimitManager/MXLLimitManager.d.ts.map +1 -1
  706. package/dist/managers/MXLLimitManager/MXLLimitManager.js +22 -6
  707. package/dist/managers/MXLLimitManager/MXLLimitManager.js.map +1 -1
  708. package/dist/managers/MXLLimitManager/constants.cjs +11 -8
  709. package/dist/managers/MXLLimitManager/constants.cjs.map +1 -1
  710. package/dist/managers/MXLLimitManager/constants.js +10 -6
  711. package/dist/managers/MXLLimitManager/constants.js.map +1 -1
  712. package/dist/managers/MXLLimitManager/index.cjs +4 -5
  713. package/dist/managers/MXLLimitManager/index.js +1 -2
  714. package/dist/managers/MXLLimitManager/types.d.cts +7 -1
  715. package/dist/managers/MXLLimitManager/types.d.cts.map +1 -1
  716. package/dist/managers/MXLLimitManager/types.d.ts +7 -2
  717. package/dist/managers/MXLLimitManager/types.d.ts.map +1 -1
  718. package/dist/managers/MXLLogManager/MXLLogManager.cjs +11 -12
  719. package/dist/managers/MXLLogManager/MXLLogManager.cjs.map +1 -1
  720. package/dist/managers/MXLLogManager/MXLLogManager.d.cts.map +1 -1
  721. package/dist/managers/MXLLogManager/MXLLogManager.d.ts +0 -2
  722. package/dist/managers/MXLLogManager/MXLLogManager.d.ts.map +1 -1
  723. package/dist/managers/MXLLogManager/MXLLogManager.js +5 -6
  724. package/dist/managers/MXLLogManager/MXLLogManager.js.map +1 -1
  725. package/dist/managers/MXLLogManager/index.cjs +3 -4
  726. package/dist/managers/MXLLogManager/index.js +1 -2
  727. package/dist/managers/MXLLogManager/types.d.ts +0 -3
  728. package/dist/managers/MXLLogManager/types.d.ts.map +1 -1
  729. package/dist/managers/MXLPageManager/MXLPageManager.cjs +3 -4
  730. package/dist/managers/MXLPageManager/MXLPageManager.cjs.map +1 -1
  731. package/dist/managers/MXLPageManager/MXLPageManager.js +1 -2
  732. package/dist/managers/MXLPageManager/MXLPageManager.js.map +1 -1
  733. package/dist/managers/MXLPageManager/index.cjs +3 -4
  734. package/dist/managers/MXLPageManager/index.js +1 -2
  735. package/dist/managers/MXLSDKFeaturesManager/MXLSDKFeaturesManager.cjs +3 -4
  736. package/dist/managers/MXLSDKFeaturesManager/MXLSDKFeaturesManager.cjs.map +1 -1
  737. package/dist/managers/MXLSDKFeaturesManager/MXLSDKFeaturesManager.js +1 -2
  738. package/dist/managers/MXLSDKFeaturesManager/MXLSDKFeaturesManager.js.map +1 -1
  739. package/dist/managers/MXLSDKFeaturesManager/index.cjs +3 -4
  740. package/dist/managers/MXLSDKFeaturesManager/index.js +1 -2
  741. package/dist/managers/MXLSDKFeaturesManager/types.d.cts +0 -1
  742. package/dist/managers/MXLSDKFeaturesManager/types.d.cts.map +1 -1
  743. package/dist/managers/MXLSDKFeaturesManager/types.d.ts +0 -2
  744. package/dist/managers/MXLSDKFeaturesManager/types.d.ts.map +1 -1
  745. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.cjs +18 -17
  746. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.cjs.map +1 -1
  747. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.d.cts +3 -1
  748. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.d.cts.map +1 -1
  749. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.d.ts +3 -3
  750. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.d.ts.map +1 -1
  751. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.js +9 -8
  752. package/dist/managers/MXLSpanSessionManager/MXLSpanSessionManager.js.map +1 -1
  753. package/dist/managers/MXLSpanSessionManager/constants.cjs +2 -3
  754. package/dist/managers/MXLSpanSessionManager/constants.cjs.map +1 -1
  755. package/dist/managers/MXLSpanSessionManager/constants.js +1 -1
  756. package/dist/managers/MXLSpanSessionManager/index.cjs +3 -4
  757. package/dist/managers/MXLSpanSessionManager/index.js +1 -2
  758. package/dist/managers/MXLSpanSessionManager/types.d.cts +5 -0
  759. package/dist/managers/MXLSpanSessionManager/types.d.cts.map +1 -1
  760. package/dist/managers/MXLSpanSessionManager/types.d.ts +5 -3
  761. package/dist/managers/MXLSpanSessionManager/types.d.ts.map +1 -1
  762. package/dist/managers/MXLTraceManager/MXLExtendedSpan.cjs +3 -4
  763. package/dist/managers/MXLTraceManager/MXLExtendedSpan.cjs.map +1 -1
  764. package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.cts.map +1 -1
  765. package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.ts +0 -1
  766. package/dist/managers/MXLTraceManager/MXLExtendedSpan.d.ts.map +1 -1
  767. package/dist/managers/MXLTraceManager/MXLExtendedSpan.js +1 -2
  768. package/dist/managers/MXLTraceManager/MXLExtendedSpan.js.map +1 -1
  769. package/dist/managers/MXLTraceManager/MXLTraceManager.cjs +8 -8
  770. package/dist/managers/MXLTraceManager/MXLTraceManager.cjs.map +1 -1
  771. package/dist/managers/MXLTraceManager/MXLTraceManager.d.ts +0 -1
  772. package/dist/managers/MXLTraceManager/MXLTraceManager.d.ts.map +1 -1
  773. package/dist/managers/MXLTraceManager/MXLTraceManager.js +5 -5
  774. package/dist/managers/MXLTraceManager/MXLTraceManager.js.map +1 -1
  775. package/dist/managers/MXLTraceManager/index.cjs +4 -5
  776. package/dist/managers/MXLTraceManager/index.js +1 -2
  777. package/dist/managers/MXLUserManager/MXLUserManager.cjs +7 -8
  778. package/dist/managers/MXLUserManager/MXLUserManager.cjs.map +1 -1
  779. package/dist/managers/MXLUserManager/MXLUserManager.js +1 -2
  780. package/dist/managers/MXLUserManager/MXLUserManager.js.map +1 -1
  781. package/dist/managers/MXLUserManager/constants.cjs +2 -3
  782. package/dist/managers/MXLUserManager/constants.cjs.map +1 -1
  783. package/dist/managers/MXLUserManager/constants.js +1 -1
  784. package/dist/managers/MXLUserManager/index.cjs +3 -4
  785. package/dist/managers/MXLUserManager/index.js +1 -2
  786. package/dist/managers/MXLUserManager/types.cjs +4 -5
  787. package/dist/managers/MXLUserManager/types.cjs.map +1 -1
  788. package/dist/managers/MXLUserManager/types.js +3 -4
  789. package/dist/managers/MXLUserManager/types.js.map +1 -1
  790. package/dist/managers/index.cjs +12 -13
  791. package/dist/managers/index.d.cts +1 -1
  792. package/dist/managers/index.d.ts +1 -9
  793. package/dist/managers/index.js +1 -2
  794. package/dist/mxl-web-sdk.js +24 -4
  795. package/dist/mxl-web-sdk.js.map +1 -1
  796. package/dist/packages/otlp-transformer/dist/index.cjs +443 -274
  797. package/dist/packages/otlp-transformer/dist/index.cjs.map +1 -1
  798. package/dist/packages/otlp-transformer/dist/index.d.cts +14 -2
  799. package/dist/packages/otlp-transformer/dist/index.d.cts.map +1 -1
  800. package/dist/packages/otlp-transformer/dist/index.d.ts +14 -2
  801. package/dist/packages/otlp-transformer/dist/index.d.ts.map +1 -1
  802. package/dist/packages/otlp-transformer/dist/index.js +443 -273
  803. package/dist/packages/otlp-transformer/dist/index.js.map +1 -1
  804. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.cjs +4 -5
  805. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.cjs.map +1 -1
  806. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.d.cts.map +1 -1
  807. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.d.ts.map +1 -1
  808. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.js +2 -3
  809. package/dist/processors/BrowserLogRecordProcessor/BrowserLogRecordProcessor.js.map +1 -1
  810. package/dist/processors/BrowserLogRecordProcessor/index.cjs +3 -4
  811. package/dist/processors/BrowserLogRecordProcessor/index.js +1 -2
  812. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.cjs +4 -5
  813. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.cjs.map +1 -1
  814. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.d.cts.map +1 -1
  815. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.d.ts.map +1 -1
  816. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.js +2 -3
  817. package/dist/processors/BrowserSpanProcessor/BrowserSpanProcessor.js.map +1 -1
  818. package/dist/processors/BrowserSpanProcessor/index.cjs +3 -4
  819. package/dist/processors/BrowserSpanProcessor/index.js +1 -2
  820. package/dist/processors/IdentifiableSessionLogRecordProcessor/IdentifiableSessionLogRecordProcessor.cjs +4 -5
  821. package/dist/processors/IdentifiableSessionLogRecordProcessor/IdentifiableSessionLogRecordProcessor.cjs.map +1 -1
  822. package/dist/processors/IdentifiableSessionLogRecordProcessor/IdentifiableSessionLogRecordProcessor.js +1 -2
  823. package/dist/processors/IdentifiableSessionLogRecordProcessor/IdentifiableSessionLogRecordProcessor.js.map +1 -1
  824. package/dist/processors/IdentifiableSessionLogRecordProcessor/index.cjs +3 -4
  825. package/dist/processors/IdentifiableSessionLogRecordProcessor/index.js +1 -2
  826. package/dist/processors/IdentifiableSessionLogRecordProcessor/types.d.ts +0 -1
  827. package/dist/processors/IdentifiableSessionLogRecordProcessor/types.d.ts.map +1 -1
  828. package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.cjs +2 -3
  829. package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.cjs.map +1 -1
  830. package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.js +1 -1
  831. package/dist/processors/LogRecordScrubProcessor/LogRecordScrubProcessor.js.map +1 -1
  832. package/dist/processors/LogRecordScrubProcessor/index.cjs +3 -4
  833. package/dist/processors/LogRecordScrubProcessor/index.js +1 -2
  834. package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.cjs +5 -6
  835. package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.cjs.map +1 -1
  836. package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.js +3 -4
  837. package/dist/processors/MXLLogRecordProcessor/MXLLogRecordProcessor.js.map +1 -1
  838. package/dist/processors/MXLLogRecordProcessor/index.cjs +3 -4
  839. package/dist/processors/MXLLogRecordProcessor/index.js +1 -2
  840. package/dist/processors/MXLNetworkSpanProcessor/MXLNetworkSpanProcessor.cjs +6 -7
  841. package/dist/processors/MXLNetworkSpanProcessor/MXLNetworkSpanProcessor.cjs.map +1 -1
  842. package/dist/processors/MXLNetworkSpanProcessor/MXLNetworkSpanProcessor.js +3 -4
  843. package/dist/processors/MXLNetworkSpanProcessor/MXLNetworkSpanProcessor.js.map +1 -1
  844. package/dist/processors/MXLNetworkSpanProcessor/index.cjs +3 -4
  845. package/dist/processors/MXLNetworkSpanProcessor/index.js +1 -2
  846. package/dist/processors/MXLNetworkSpanProcessor/types.cjs +3 -4
  847. package/dist/processors/MXLNetworkSpanProcessor/types.cjs.map +1 -1
  848. package/dist/processors/MXLNetworkSpanProcessor/types.js +1 -2
  849. package/dist/processors/MXLNetworkSpanProcessor/types.js.map +1 -1
  850. package/dist/processors/MXLSessionBatchedSpanProcessor/MXLSessionBatchedSpanProcessor.cjs +6 -7
  851. package/dist/processors/MXLSessionBatchedSpanProcessor/MXLSessionBatchedSpanProcessor.cjs.map +1 -1
  852. package/dist/processors/MXLSessionBatchedSpanProcessor/MXLSessionBatchedSpanProcessor.js +3 -4
  853. package/dist/processors/MXLSessionBatchedSpanProcessor/MXLSessionBatchedSpanProcessor.js.map +1 -1
  854. package/dist/processors/MXLSessionBatchedSpanProcessor/index.cjs +3 -4
  855. package/dist/processors/MXLSessionBatchedSpanProcessor/index.js +1 -2
  856. package/dist/processors/MXLSessionBatchedSpanProcessor/types.d.ts +0 -1
  857. package/dist/processors/MXLSessionBatchedSpanProcessor/types.d.ts.map +1 -1
  858. package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.cjs +5 -6
  859. package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.cjs.map +1 -1
  860. package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.js +3 -4
  861. package/dist/processors/PageLogRecordProcessor/PageLogRecordProcessor.js.map +1 -1
  862. package/dist/processors/PageLogRecordProcessor/index.cjs +3 -4
  863. package/dist/processors/PageLogRecordProcessor/index.js +1 -2
  864. package/dist/processors/PageSpanProcessor/PageSpanProcessor.cjs +5 -6
  865. package/dist/processors/PageSpanProcessor/PageSpanProcessor.cjs.map +1 -1
  866. package/dist/processors/PageSpanProcessor/PageSpanProcessor.js +3 -4
  867. package/dist/processors/PageSpanProcessor/PageSpanProcessor.js.map +1 -1
  868. package/dist/processors/PageSpanProcessor/index.cjs +3 -4
  869. package/dist/processors/PageSpanProcessor/index.js +1 -2
  870. package/dist/processors/SpanScrubProcessor/SpanScrubProcessor.cjs +2 -3
  871. package/dist/processors/SpanScrubProcessor/SpanScrubProcessor.cjs.map +1 -1
  872. package/dist/processors/SpanScrubProcessor/SpanScrubProcessor.js +1 -1
  873. package/dist/processors/SpanScrubProcessor/SpanScrubProcessor.js.map +1 -1
  874. package/dist/processors/SpanScrubProcessor/index.cjs +3 -4
  875. package/dist/processors/SpanScrubProcessor/index.js +1 -2
  876. package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.cjs +3 -4
  877. package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.cjs.map +1 -1
  878. package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.js +1 -2
  879. package/dist/processors/UserLogRecordProcessor/UserLogRecordProcessor.js.map +1 -1
  880. package/dist/processors/UserLogRecordProcessor/index.cjs +3 -4
  881. package/dist/processors/UserLogRecordProcessor/index.js +1 -2
  882. package/dist/processors/UserSpanProcessor/UserSpanProcessor.cjs +3 -4
  883. package/dist/processors/UserSpanProcessor/UserSpanProcessor.cjs.map +1 -1
  884. package/dist/processors/UserSpanProcessor/UserSpanProcessor.js +1 -2
  885. package/dist/processors/UserSpanProcessor/UserSpanProcessor.js.map +1 -1
  886. package/dist/processors/UserSpanProcessor/index.cjs +3 -4
  887. package/dist/processors/UserSpanProcessor/index.js +1 -2
  888. package/dist/processors/index.cjs +14 -15
  889. package/dist/processors/index.d.ts +0 -12
  890. package/dist/processors/index.js +1 -2
  891. package/dist/propagators/MXLW3CTraceContextPropagator/MXLW3CTraceContextPropagator.cjs +4 -5
  892. package/dist/propagators/MXLW3CTraceContextPropagator/MXLW3CTraceContextPropagator.cjs.map +1 -1
  893. package/dist/propagators/MXLW3CTraceContextPropagator/MXLW3CTraceContextPropagator.js +1 -2
  894. package/dist/propagators/MXLW3CTraceContextPropagator/MXLW3CTraceContextPropagator.js.map +1 -1
  895. package/dist/propagators/MXLW3CTraceContextPropagator/index.cjs +3 -4
  896. package/dist/propagators/MXLW3CTraceContextPropagator/index.js +1 -2
  897. package/dist/propagators/index.cjs +3 -4
  898. package/dist/propagators/index.d.ts +0 -1
  899. package/dist/propagators/index.js +1 -2
  900. package/dist/react-instrumentation/index.cjs +7 -8
  901. package/dist/react-instrumentation/index.d.ts +0 -3
  902. package/dist/react-instrumentation/index.js +1 -2
  903. package/dist/resources/appInstanceId.cjs +4 -5
  904. package/dist/resources/appInstanceId.cjs.map +1 -1
  905. package/dist/resources/appInstanceId.js +1 -2
  906. package/dist/resources/appInstanceId.js.map +1 -1
  907. package/dist/resources/constants/index.cjs +3 -4
  908. package/dist/resources/constants/index.cjs.map +1 -1
  909. package/dist/resources/constants/index.d.cts +1 -1
  910. package/dist/resources/constants/index.d.ts +1 -1
  911. package/dist/resources/constants/index.js +2 -2
  912. package/dist/resources/constants/index.js.map +1 -1
  913. package/dist/resources/index.cjs +7 -6
  914. package/dist/resources/index.d.cts +2 -2
  915. package/dist/resources/index.d.ts +2 -2
  916. package/dist/resources/index.js +2 -3
  917. package/dist/resources/webSdkResource.cjs +22 -9
  918. package/dist/resources/webSdkResource.cjs.map +1 -1
  919. package/dist/resources/webSdkResource.d.cts +16 -1
  920. package/dist/resources/webSdkResource.d.cts.map +1 -1
  921. package/dist/resources/webSdkResource.d.ts +16 -1
  922. package/dist/resources/webSdkResource.d.ts.map +1 -1
  923. package/dist/resources/webSdkResource.js +17 -6
  924. package/dist/resources/webSdkResource.js.map +1 -1
  925. package/dist/sdk/defaultAttributeScrubbers.cjs +3 -4
  926. package/dist/sdk/defaultAttributeScrubbers.cjs.map +1 -1
  927. package/dist/sdk/defaultAttributeScrubbers.js +1 -2
  928. package/dist/sdk/defaultAttributeScrubbers.js.map +1 -1
  929. package/dist/sdk/index.cjs +3 -4
  930. package/dist/sdk/index.js +1 -2
  931. package/dist/sdk/initSDK.cjs +62 -58
  932. package/dist/sdk/initSDK.cjs.map +1 -1
  933. package/dist/sdk/initSDK.d.cts +2 -1
  934. package/dist/sdk/initSDK.d.cts.map +1 -1
  935. package/dist/sdk/initSDK.d.ts +2 -1
  936. package/dist/sdk/initSDK.d.ts.map +1 -1
  937. package/dist/sdk/initSDK.js +24 -20
  938. package/dist/sdk/initSDK.js.map +1 -1
  939. package/dist/sdk/registry.cjs +3 -4
  940. package/dist/sdk/registry.cjs.map +1 -1
  941. package/dist/sdk/registry.js +1 -2
  942. package/dist/sdk/registry.js.map +1 -1
  943. package/dist/sdk/setupDefaultInstrumentations.cjs +36 -28
  944. package/dist/sdk/setupDefaultInstrumentations.cjs.map +1 -1
  945. package/dist/sdk/setupDefaultInstrumentations.d.cts +2 -3
  946. package/dist/sdk/setupDefaultInstrumentations.d.cts.map +1 -1
  947. package/dist/sdk/setupDefaultInstrumentations.d.ts +2 -3
  948. package/dist/sdk/setupDefaultInstrumentations.d.ts.map +1 -1
  949. package/dist/sdk/setupDefaultInstrumentations.js +26 -19
  950. package/dist/sdk/setupDefaultInstrumentations.js.map +1 -1
  951. package/dist/sdk/setupSessionRecorder.cjs +5 -6
  952. package/dist/sdk/setupSessionRecorder.cjs.map +1 -1
  953. package/dist/sdk/setupSessionRecorder.js +1 -2
  954. package/dist/sdk/setupSessionRecorder.js.map +1 -1
  955. package/dist/sdk/types.d.cts +29 -16
  956. package/dist/sdk/types.d.cts.map +1 -1
  957. package/dist/sdk/types.d.ts +29 -22
  958. package/dist/sdk/types.d.ts.map +1 -1
  959. package/dist/sdk/utils.cjs +3 -4
  960. package/dist/sdk/utils.cjs.map +1 -1
  961. package/dist/sdk/utils.js +1 -2
  962. package/dist/sdk/utils.js.map +1 -1
  963. package/dist/transport/FetchTransport/FetchTransport.cjs +3 -4
  964. package/dist/transport/FetchTransport/FetchTransport.cjs.map +1 -1
  965. package/dist/transport/FetchTransport/FetchTransport.js +1 -2
  966. package/dist/transport/FetchTransport/FetchTransport.js.map +1 -1
  967. package/dist/transport/FetchTransport/createFetchTransport.cjs +3 -4
  968. package/dist/transport/FetchTransport/createFetchTransport.cjs.map +1 -1
  969. package/dist/transport/FetchTransport/createFetchTransport.js +1 -2
  970. package/dist/transport/FetchTransport/createFetchTransport.js.map +1 -1
  971. package/dist/transport/FetchTransport/index.cjs +3 -4
  972. package/dist/transport/FetchTransport/index.js +1 -2
  973. package/dist/transport/RetryingTransport/RetryingTransport.cjs +6 -7
  974. package/dist/transport/RetryingTransport/RetryingTransport.cjs.map +1 -1
  975. package/dist/transport/RetryingTransport/RetryingTransport.d.ts +0 -1
  976. package/dist/transport/RetryingTransport/RetryingTransport.d.ts.map +1 -1
  977. package/dist/transport/RetryingTransport/RetryingTransport.js +4 -5
  978. package/dist/transport/RetryingTransport/RetryingTransport.js.map +1 -1
  979. package/dist/transport/RetryingTransport/constants.cjs +2 -3
  980. package/dist/transport/RetryingTransport/constants.cjs.map +1 -1
  981. package/dist/transport/RetryingTransport/constants.js +1 -1
  982. package/dist/transport/RetryingTransport/createRetryingTransport.cjs +4 -5
  983. package/dist/transport/RetryingTransport/createRetryingTransport.cjs.map +1 -1
  984. package/dist/transport/RetryingTransport/createRetryingTransport.d.cts.map +1 -1
  985. package/dist/transport/RetryingTransport/createRetryingTransport.d.ts +0 -1
  986. package/dist/transport/RetryingTransport/createRetryingTransport.d.ts.map +1 -1
  987. package/dist/transport/RetryingTransport/createRetryingTransport.js +1 -2
  988. package/dist/transport/RetryingTransport/createRetryingTransport.js.map +1 -1
  989. package/dist/transport/RetryingTransport/index.cjs +3 -4
  990. package/dist/transport/RetryingTransport/index.js +1 -2
  991. package/dist/transport/index.cjs +4 -5
  992. package/dist/transport/index.d.ts +0 -2
  993. package/dist/transport/index.js +1 -2
  994. package/dist/utils/MXLSpanStorage/MXLSpanStorage.cjs +4 -5
  995. package/dist/utils/MXLSpanStorage/MXLSpanStorage.cjs.map +1 -1
  996. package/dist/utils/MXLSpanStorage/MXLSpanStorage.d.ts +0 -1
  997. package/dist/utils/MXLSpanStorage/MXLSpanStorage.d.ts.map +1 -1
  998. package/dist/utils/MXLSpanStorage/MXLSpanStorage.js +1 -2
  999. package/dist/utils/MXLSpanStorage/MXLSpanStorage.js.map +1 -1
  1000. package/dist/utils/MXLSpanStorage/index.cjs +3 -4
  1001. package/dist/utils/MXLSpanStorage/index.d.ts +0 -1
  1002. package/dist/utils/MXLSpanStorage/index.js +1 -2
  1003. package/dist/utils/NamespacedStorage/NamespacedStorage.cjs +12 -3
  1004. package/dist/utils/NamespacedStorage/NamespacedStorage.cjs.map +1 -1
  1005. package/dist/utils/NamespacedStorage/NamespacedStorage.d.cts +8 -0
  1006. package/dist/utils/NamespacedStorage/NamespacedStorage.d.cts.map +1 -1
  1007. package/dist/utils/NamespacedStorage/NamespacedStorage.d.ts +8 -0
  1008. package/dist/utils/NamespacedStorage/NamespacedStorage.d.ts.map +1 -1
  1009. package/dist/utils/NamespacedStorage/NamespacedStorage.js +11 -1
  1010. package/dist/utils/NamespacedStorage/NamespacedStorage.js.map +1 -1
  1011. package/dist/utils/NamespacedStorage/index.cjs +3 -4
  1012. package/dist/utils/NamespacedStorage/index.js +1 -2
  1013. package/dist/utils/PerformanceManager/OTelPerformanceManager.cjs +4 -4
  1014. package/dist/utils/PerformanceManager/OTelPerformanceManager.cjs.map +1 -1
  1015. package/dist/utils/PerformanceManager/OTelPerformanceManager.d.cts +1 -0
  1016. package/dist/utils/PerformanceManager/OTelPerformanceManager.d.cts.map +1 -1
  1017. package/dist/utils/PerformanceManager/OTelPerformanceManager.d.ts +1 -0
  1018. package/dist/utils/PerformanceManager/OTelPerformanceManager.d.ts.map +1 -1
  1019. package/dist/utils/PerformanceManager/OTelPerformanceManager.js +2 -2
  1020. package/dist/utils/PerformanceManager/OTelPerformanceManager.js.map +1 -1
  1021. package/dist/utils/PerformanceManager/index.cjs +3 -4
  1022. package/dist/utils/PerformanceManager/index.js +1 -2
  1023. package/dist/utils/PerformanceManager/types.d.cts +1 -0
  1024. package/dist/utils/PerformanceManager/types.d.cts.map +1 -1
  1025. package/dist/utils/PerformanceManager/types.d.ts +1 -0
  1026. package/dist/utils/PerformanceManager/types.d.ts.map +1 -1
  1027. package/dist/utils/bulkAddEventListener/bulkAddEventListener.cjs +2 -3
  1028. package/dist/utils/bulkAddEventListener/bulkAddEventListener.cjs.map +1 -1
  1029. package/dist/utils/bulkAddEventListener/bulkAddEventListener.js +1 -1
  1030. package/dist/utils/bulkAddEventListener/index.cjs +3 -4
  1031. package/dist/utils/bulkAddEventListener/index.js +1 -2
  1032. package/dist/utils/bulkRemoveEventListener/bulkRemoveEventListener.cjs +2 -3
  1033. package/dist/utils/bulkRemoveEventListener/bulkRemoveEventListener.cjs.map +1 -1
  1034. package/dist/utils/bulkRemoveEventListener/bulkRemoveEventListener.js +1 -1
  1035. package/dist/utils/bulkRemoveEventListener/index.cjs +3 -4
  1036. package/dist/utils/bulkRemoveEventListener/index.js +1 -2
  1037. package/dist/utils/createSafeProxy/createSafeProxy.cjs +2 -3
  1038. package/dist/utils/createSafeProxy/createSafeProxy.cjs.map +1 -1
  1039. package/dist/utils/createSafeProxy/createSafeProxy.js +1 -1
  1040. package/dist/utils/createSafeProxy/index.cjs +3 -4
  1041. package/dist/utils/createSafeProxy/index.js +1 -2
  1042. package/dist/utils/generateUUID.cjs +2 -3
  1043. package/dist/utils/generateUUID.cjs.map +1 -1
  1044. package/dist/utils/generateUUID.js +1 -1
  1045. package/dist/utils/generateWebVitalID.cjs +9 -0
  1046. package/dist/utils/generateWebVitalID.cjs.map +1 -0
  1047. package/dist/utils/generateWebVitalID.d.cts +5 -0
  1048. package/dist/utils/generateWebVitalID.d.cts.map +1 -0
  1049. package/dist/utils/generateWebVitalID.d.ts +5 -0
  1050. package/dist/utils/generateWebVitalID.d.ts.map +1 -0
  1051. package/dist/utils/generateWebVitalID.js +8 -0
  1052. package/dist/utils/generateWebVitalID.js.map +1 -0
  1053. package/dist/utils/getIncrementedCount.cjs +6 -3
  1054. package/dist/utils/getIncrementedCount.cjs.map +1 -1
  1055. package/dist/utils/getIncrementedCount.js +5 -1
  1056. package/dist/utils/getIncrementedCount.js.map +1 -1
  1057. package/dist/utils/getVisibilityState.cjs +4 -5
  1058. package/dist/utils/getVisibilityState.cjs.map +1 -1
  1059. package/dist/utils/getVisibilityState.js +3 -4
  1060. package/dist/utils/getVisibilityState.js.map +1 -1
  1061. package/dist/utils/globalConfig.cjs +2 -3
  1062. package/dist/utils/globalConfig.cjs.map +1 -1
  1063. package/dist/utils/globalConfig.js +1 -1
  1064. package/dist/utils/index.cjs +20 -16
  1065. package/dist/utils/index.d.cts +4 -2
  1066. package/dist/utils/index.d.ts +4 -5
  1067. package/dist/utils/index.js +3 -2
  1068. package/dist/utils/isDeviceIdEnabled.cjs +2 -3
  1069. package/dist/utils/isDeviceIdEnabled.cjs.map +1 -1
  1070. package/dist/utils/isDeviceIdEnabled.js +1 -1
  1071. package/dist/utils/isDeviceIdEnabled.js.map +1 -1
  1072. package/dist/utils/nsfConfigValidation.cjs +2 -3
  1073. package/dist/utils/nsfConfigValidation.cjs.map +1 -1
  1074. package/dist/utils/nsfConfigValidation.d.ts +0 -2
  1075. package/dist/utils/nsfConfigValidation.d.ts.map +1 -1
  1076. package/dist/utils/nsfConfigValidation.js +1 -1
  1077. package/dist/utils/performanceObserver/index.cjs +4 -0
  1078. package/dist/utils/performanceObserver/index.d.cts +2 -0
  1079. package/dist/utils/performanceObserver/index.d.ts +2 -0
  1080. package/dist/utils/performanceObserver/index.js +2 -0
  1081. package/dist/utils/performanceObserver/performanceObserver.cjs +47 -0
  1082. package/dist/utils/performanceObserver/performanceObserver.cjs.map +1 -0
  1083. package/dist/utils/performanceObserver/performanceObserver.d.cts +23 -0
  1084. package/dist/utils/performanceObserver/performanceObserver.d.cts.map +1 -0
  1085. package/dist/utils/performanceObserver/performanceObserver.d.ts +23 -0
  1086. package/dist/utils/performanceObserver/performanceObserver.d.ts.map +1 -0
  1087. package/dist/utils/performanceObserver/performanceObserver.js +45 -0
  1088. package/dist/utils/performanceObserver/performanceObserver.js.map +1 -0
  1089. package/dist/utils/throttle.cjs +2 -3
  1090. package/dist/utils/throttle.cjs.map +1 -1
  1091. package/dist/utils/throttle.js +1 -1
  1092. package/package.json +15 -14
@@ -1,4 +1,4 @@
1
- "use strict";window.MXLWebSdk=window.MXLWebSdk||(function(exports){Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJSMin=(z,G)=>()=>(G||z((G={exports:{}}).exports,G),G.exports),__copyProps=(z,G,K,J)=>{if(G&&typeof G==`object`||typeof G==`function`)for(var Y=__getOwnPropNames(G),X=0,Z=Y.length,Q;X<Z;X++)Q=Y[X],!__hasOwnProp.call(z,Q)&&Q!==K&&__defProp(z,Q,{get:(z=>G[z]).bind(null,Q),enumerable:!(J=__getOwnPropDesc(G,Q))||J.enumerable});return z},__toESM=(z,G,K)=>(K=z==null?{}:__create(__getProtoOf(z)),__copyProps(G||!z||!z.__esModule?__defProp(K,`default`,{value:z,enumerable:!0}):K,z));const VERSION$10=`1.9.1`,re$1=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function _makeCompatibilityCheck$1(z){let G=new Set([z]),K=new Set,J=z.match(re$1);if(!J)return()=>!1;let Y={major:+J[1],minor:+J[2],patch:+J[3],prerelease:J[4]};if(Y.prerelease!=null)return function(G){return G===z};function X(z){return K.add(z),!1}function Z(z){return G.add(z),!0}return function(z){if(G.has(z))return!0;if(K.has(z))return!1;let J=z.match(re$1);if(!J)return X(z);let Q={major:+J[1],minor:+J[2],patch:+J[3],prerelease:J[4]};return Q.prerelease!=null||Y.major!==Q.major?X(z):Y.major===0?Y.minor===Q.minor&&Y.patch<=Q.patch?Z(z):X(z):Y.minor<=Q.minor?Z(z):X(z)}}const isCompatible$1=_makeCompatibilityCheck$1(VERSION$10),major$1=VERSION$10.split(`.`)[0],GLOBAL_OPENTELEMETRY_API_KEY$1=Symbol.for(`opentelemetry.js.api.${major$1}`),_global$2=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function registerGlobal$1(z,G,K,J=!1){var Y;let X=_global$2[GLOBAL_OPENTELEMETRY_API_KEY$1]=(Y=_global$2[GLOBAL_OPENTELEMETRY_API_KEY$1])==null?{version:VERSION$10}:Y;if(!J&&X[z]){let G=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${z}`);return K.error(G.stack||G.message),!1}if(X.version!==VERSION$10){let G=Error(`@opentelemetry/api: Registration of version v${X.version} for ${z} does not match previously registered API v${VERSION$10}`);return K.error(G.stack||G.message),!1}return X[z]=G,K.debug(`@opentelemetry/api: Registered a global for ${z} v${VERSION$10}.`),!0}function getGlobal$1(z){var G,K;let J=(G=_global$2[GLOBAL_OPENTELEMETRY_API_KEY$1])==null?void 0:G.version;if(!(!J||!isCompatible$1(J)))return(K=_global$2[GLOBAL_OPENTELEMETRY_API_KEY$1])==null?void 0:K[z]}function unregisterGlobal$1(z,G){G.debug(`@opentelemetry/api: Unregistering a global for ${z} v${VERSION$10}.`);let K=_global$2[GLOBAL_OPENTELEMETRY_API_KEY$1];K&&delete K[z]}var DiagComponentLogger$1=class{constructor(z){this._namespace=z.namespace||`DiagComponentLogger`}debug(...z){return logProxy$1(`debug`,this._namespace,z)}error(...z){return logProxy$1(`error`,this._namespace,z)}info(...z){return logProxy$1(`info`,this._namespace,z)}warn(...z){return logProxy$1(`warn`,this._namespace,z)}verbose(...z){return logProxy$1(`verbose`,this._namespace,z)}};function logProxy$1(z,G,K){let J=getGlobal$1(`diag`);if(J)return J[z](G,...K)}var DiagLogLevel;(function(z){z[z.NONE=0]=`NONE`,z[z.ERROR=30]=`ERROR`,z[z.WARN=50]=`WARN`,z[z.INFO=60]=`INFO`,z[z.DEBUG=70]=`DEBUG`,z[z.VERBOSE=80]=`VERBOSE`,z[z.ALL=9999]=`ALL`})(DiagLogLevel||(DiagLogLevel={}));function createLogLevelDiagLogger$1(z,G){z<DiagLogLevel.NONE?z=DiagLogLevel.NONE:z>DiagLogLevel.ALL&&(z=DiagLogLevel.ALL),G=G||{};function K(K,J){let Y=G[K];return typeof Y==`function`&&z>=J?Y.bind(G):function(){}}return{error:K(`error`,DiagLogLevel.ERROR),warn:K(`warn`,DiagLogLevel.WARN),info:K(`info`,DiagLogLevel.INFO),debug:K(`debug`,DiagLogLevel.DEBUG),verbose:K(`verbose`,DiagLogLevel.VERBOSE)}}const API_NAME$4=`diag`;var DiagAPI=class z{static instance(){return this._instance||(this._instance=new z),this._instance}constructor(){function z(z){return function(...G){let K=getGlobal$1(`diag`);if(K)return K[z](...G)}}let G=this;G.setLogger=(z,K={logLevel:DiagLogLevel.INFO})=>{var J,Y,X;if(z===G){let z=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return G.error((J=z.stack)==null?z.message:J),!1}typeof K==`number`&&(K={logLevel:K});let Z=getGlobal$1(`diag`),Q=createLogLevelDiagLogger$1((Y=K.logLevel)==null?DiagLogLevel.INFO:Y,z);if(Z&&!K.suppressOverrideMessage){let z=(X=Error().stack)==null?`<failed to generate stacktrace>`:X;Z.warn(`Current logger will be overwritten from ${z}`),Q.warn(`Current logger will overwrite one already registered from ${z}`)}return registerGlobal$1(`diag`,Q,G,!0)},G.disable=()=>{unregisterGlobal$1(API_NAME$4,G)},G.createComponentLogger=z=>new DiagComponentLogger$1(z),G.verbose=z(`verbose`),G.debug=z(`debug`),G.info=z(`info`),G.warn=z(`warn`),G.error=z(`error`)}},BaggageImpl=class z{constructor(z){this._entries=z?new Map(z):new Map}getEntry(z){let G=this._entries.get(z);if(G)return Object.assign({},G)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(G,K){let J=new z(this._entries);return J._entries.set(G,K),J}removeEntry(G){let K=new z(this._entries);return K._entries.delete(G),K}removeEntries(...G){let K=new z(this._entries);for(let z of G)K._entries.delete(z);return K}clear(){return new z}};const baggageEntryMetadataSymbol=Symbol(`BaggageEntryMetadata`),diag$2=DiagAPI.instance();function createBaggage(z={}){return new BaggageImpl(new Map(Object.entries(z)))}function baggageEntryMetadataFromString(z){return typeof z!=`string`&&(diag$2.error(`Cannot create baggage metadata from unknown type: ${typeof z}`),z=``),{__TYPE__:baggageEntryMetadataSymbol,toString(){return z}}}function createContextKey(z){return Symbol.for(z)}var BaseContext=class z{constructor(G){let K=this;K._currentContext=G?new Map(G):new Map,K.getValue=z=>K._currentContext.get(z),K.setValue=(G,J)=>{let Y=new z(K._currentContext);return Y._currentContext.set(G,J),Y},K.deleteValue=G=>{let J=new z(K._currentContext);return J._currentContext.delete(G),J}}};const ROOT_CONTEXT=new BaseContext,consoleMap=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],_originalConsoleMethods={};if(typeof console<`u`)for(let z of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[z]==`function`&&(_originalConsoleMethods[z]=console[z]);var DiagConsoleLogger=class{constructor(){function z(z){return function(...G){let K=_originalConsoleMethods[z];if(typeof K!=`function`&&(K=_originalConsoleMethods.log),typeof K!=`function`&&console&&(K=console[z],typeof K!=`function`&&(K=console.log)),typeof K==`function`)return K.apply(console,G)}}for(let G=0;G<consoleMap.length;G++)this[consoleMap[G].n]=z(consoleMap[G].c)}},NoopMeter=class{constructor(){}createGauge(z,G){return NOOP_GAUGE_METRIC}createHistogram(z,G){return NOOP_HISTOGRAM_METRIC}createCounter(z,G){return NOOP_COUNTER_METRIC}createUpDownCounter(z,G){return NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(z,G){return NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(z,G){return NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(z,G){return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(z,G){}removeBatchObservableCallback(z){}},NoopMetric=class{},NoopCounterMetric=class extends NoopMetric{add(z,G){}},NoopUpDownCounterMetric=class extends NoopMetric{add(z,G){}},NoopGaugeMetric=class extends NoopMetric{record(z,G){}},NoopHistogramMetric=class extends NoopMetric{record(z,G){}},NoopObservableMetric=class{addCallback(z){}removeCallback(z){}},NoopObservableCounterMetric=class extends NoopObservableMetric{},NoopObservableGaugeMetric=class extends NoopObservableMetric{},NoopObservableUpDownCounterMetric=class extends NoopObservableMetric{};const NOOP_METER=new NoopMeter,NOOP_COUNTER_METRIC=new NoopCounterMetric,NOOP_GAUGE_METRIC=new NoopGaugeMetric,NOOP_HISTOGRAM_METRIC=new NoopHistogramMetric,NOOP_UP_DOWN_COUNTER_METRIC=new NoopUpDownCounterMetric,NOOP_OBSERVABLE_COUNTER_METRIC=new NoopObservableCounterMetric,NOOP_OBSERVABLE_GAUGE_METRIC=new NoopObservableGaugeMetric,NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new NoopObservableUpDownCounterMetric;function createNoopMeter(){return NOOP_METER}const defaultTextMapGetter={get(z,G){if(z!=null)return z[G]},keys(z){return z==null?[]:Object.keys(z)}},defaultTextMapSetter={set(z,G,K){z!=null&&(z[G]=K)}};var NoopContextManager=class{active(){return ROOT_CONTEXT}with(z,G,K,...J){return G.call(K,...J)}bind(z,G){return G}enable(){return this}disable(){return this}};const API_NAME$3=`context`,NOOP_CONTEXT_MANAGER=new NoopContextManager;var ContextAPI=class z{constructor(){}static getInstance(){return this._instance||(this._instance=new z),this._instance}setGlobalContextManager(z){return registerGlobal$1(API_NAME$3,z,DiagAPI.instance())}active(){return this._getContextManager().active()}with(z,G,K,...J){return this._getContextManager().with(z,G,K,...J)}bind(z,G){return this._getContextManager().bind(z,G)}_getContextManager(){return getGlobal$1(API_NAME$3)||NOOP_CONTEXT_MANAGER}disable(){this._getContextManager().disable(),unregisterGlobal$1(API_NAME$3,DiagAPI.instance())}},TraceFlags;(function(z){z[z.NONE=0]=`NONE`,z[z.SAMPLED=1]=`SAMPLED`})(TraceFlags||(TraceFlags={}));const INVALID_SPANID=`0000000000000000`,INVALID_TRACEID=`00000000000000000000000000000000`,INVALID_SPAN_CONTEXT={traceId:INVALID_TRACEID,spanId:INVALID_SPANID,traceFlags:TraceFlags.NONE};var NonRecordingSpan=class{constructor(z=INVALID_SPAN_CONTEXT){this._spanContext=z}spanContext(){return this._spanContext}setAttribute(z,G){return this}setAttributes(z){return this}addEvent(z,G){return this}addLink(z){return this}addLinks(z){return this}setStatus(z){return this}updateName(z){return this}end(z){}isRecording(){return!1}recordException(z,G){}};const SPAN_KEY=createContextKey(`OpenTelemetry Context Key SPAN`);function getSpan(z){return z.getValue(SPAN_KEY)||void 0}function getActiveSpan(){return getSpan(ContextAPI.getInstance().active())}function setSpan(z,G){return z.setValue(SPAN_KEY,G)}function deleteSpan(z){return z.deleteValue(SPAN_KEY)}function setSpanContext(z,G){return setSpan(z,new NonRecordingSpan(G))}function getSpanContext(z){var G;return(G=getSpan(z))==null?void 0:G.spanContext()}const isHex=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function isValidHex(z,G){if(typeof z!=`string`||z.length!==G)return!1;let K=0;for(let G=0;G<z.length;G+=4)K+=(isHex[z.charCodeAt(G)]|0)+(isHex[z.charCodeAt(G+1)]|0)+(isHex[z.charCodeAt(G+2)]|0)+(isHex[z.charCodeAt(G+3)]|0);return K===G}function isValidTraceId(z){return isValidHex(z,32)&&z!==INVALID_TRACEID}function isValidSpanId(z){return isValidHex(z,16)&&z!==INVALID_SPANID}function isSpanContextValid(z){return isValidTraceId(z.traceId)&&isValidSpanId(z.spanId)}function wrapSpanContext(z){return new NonRecordingSpan(z)}const contextApi=ContextAPI.getInstance();var NoopTracer=class{startSpan(z,G,K=contextApi.active()){if(G!=null&&G.root)return new NonRecordingSpan;let J=K&&getSpanContext(K);return isSpanContext(J)&&isSpanContextValid(J)?new NonRecordingSpan(J):new NonRecordingSpan}startActiveSpan(z,G,K,J){let Y,X,Z;if(arguments.length<2)return;arguments.length===2?Z=G:arguments.length===3?(Y=G,Z=K):(Y=G,X=K,Z=J);let Q=X==null?contextApi.active():X,ee=this.startSpan(z,Y,Q),te=setSpan(Q,ee);return contextApi.with(te,Z,void 0,ee)}};function isSpanContext(z){return typeof z==`object`&&!!z&&`spanId`in z&&typeof z.spanId==`string`&&`traceId`in z&&typeof z.traceId==`string`&&`traceFlags`in z&&typeof z.traceFlags==`number`}const NOOP_TRACER=new NoopTracer;var ProxyTracer=class{constructor(z,G,K,J){this._provider=z,this.name=G,this.version=K,this.options=J}startSpan(z,G,K){return this._getTracer().startSpan(z,G,K)}startActiveSpan(z,G,K,J){let Y=this._getTracer();return Reflect.apply(Y.startActiveSpan,Y,arguments)}_getTracer(){if(this._delegate)return this._delegate;let z=this._provider.getDelegateTracer(this.name,this.version,this.options);return z?(this._delegate=z,this._delegate):NOOP_TRACER}},NoopTracerProvider=class{getTracer(z,G,K){return new NoopTracer}};const NOOP_TRACER_PROVIDER=new NoopTracerProvider;var ProxyTracerProvider=class{getTracer(z,G,K){var J;return(J=this.getDelegateTracer(z,G,K))==null?new ProxyTracer(this,z,G,K):J}getDelegate(){var z;return(z=this._delegate)==null?NOOP_TRACER_PROVIDER:z}setDelegate(z){this._delegate=z}getDelegateTracer(z,G,K){var J;return(J=this._delegate)==null?void 0:J.getTracer(z,G,K)}},SamplingDecision$1;(function(z){z[z.NOT_RECORD=0]=`NOT_RECORD`,z[z.RECORD=1]=`RECORD`,z[z.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(SamplingDecision$1||(SamplingDecision$1={}));var SpanKind;(function(z){z[z.INTERNAL=0]=`INTERNAL`,z[z.SERVER=1]=`SERVER`,z[z.CLIENT=2]=`CLIENT`,z[z.PRODUCER=3]=`PRODUCER`,z[z.CONSUMER=4]=`CONSUMER`})(SpanKind||(SpanKind={}));var SpanStatusCode;(function(z){z[z.UNSET=0]=`UNSET`,z[z.OK=1]=`OK`,z[z.ERROR=2]=`ERROR`})(SpanStatusCode||(SpanStatusCode={}));const context=ContextAPI.getInstance(),diag$1=DiagAPI.instance();var NoopMeterProvider=class{getMeter(z,G,K){return NOOP_METER}};const NOOP_METER_PROVIDER=new NoopMeterProvider,API_NAME$2=`metrics`;var MetricsAPI=class z{constructor(){}static getInstance(){return this._instance||(this._instance=new z),this._instance}setGlobalMeterProvider(z){return registerGlobal$1(API_NAME$2,z,DiagAPI.instance())}getMeterProvider(){return getGlobal$1(API_NAME$2)||NOOP_METER_PROVIDER}getMeter(z,G,K){return this.getMeterProvider().getMeter(z,G,K)}disable(){unregisterGlobal$1(API_NAME$2,DiagAPI.instance())}};const metrics=MetricsAPI.getInstance();var NoopTextMapPropagator=class{inject(z,G){}extract(z,G){return z}fields(){return[]}};const BAGGAGE_KEY=createContextKey(`OpenTelemetry Baggage Key`);function getBaggage(z){return z.getValue(BAGGAGE_KEY)||void 0}function getActiveBaggage(){return getBaggage(ContextAPI.getInstance().active())}function setBaggage(z,G){return z.setValue(BAGGAGE_KEY,G)}function deleteBaggage(z){return z.deleteValue(BAGGAGE_KEY)}const API_NAME$1=`propagation`,NOOP_TEXT_MAP_PROPAGATOR=new NoopTextMapPropagator;var PropagationAPI=class z{constructor(){this.createBaggage=createBaggage,this.getBaggage=getBaggage,this.getActiveBaggage=getActiveBaggage,this.setBaggage=setBaggage,this.deleteBaggage=deleteBaggage}static getInstance(){return this._instance||(this._instance=new z),this._instance}setGlobalPropagator(z){return registerGlobal$1(API_NAME$1,z,DiagAPI.instance())}inject(z,G,K=defaultTextMapSetter){return this._getGlobalPropagator().inject(z,G,K)}extract(z,G,K=defaultTextMapGetter){return this._getGlobalPropagator().extract(z,G,K)}fields(){return this._getGlobalPropagator().fields()}disable(){unregisterGlobal$1(API_NAME$1,DiagAPI.instance())}_getGlobalPropagator(){return getGlobal$1(API_NAME$1)||NOOP_TEXT_MAP_PROPAGATOR}};const propagation=PropagationAPI.getInstance(),API_NAME=`trace`;var TraceAPI$1=class z{constructor(){this._proxyTracerProvider=new ProxyTracerProvider,this.wrapSpanContext=wrapSpanContext,this.isSpanContextValid=isSpanContextValid,this.deleteSpan=deleteSpan,this.getSpan=getSpan,this.getActiveSpan=getActiveSpan,this.getSpanContext=getSpanContext,this.setSpan=setSpan,this.setSpanContext=setSpanContext}static getInstance(){return this._instance||(this._instance=new z),this._instance}setGlobalTracerProvider(z){let G=registerGlobal$1(API_NAME,this._proxyTracerProvider,DiagAPI.instance());return G&&this._proxyTracerProvider.setDelegate(z),G}getTracerProvider(){return getGlobal$1(API_NAME)||this._proxyTracerProvider}getTracer(z,G){return this.getTracerProvider().getTracer(z,G)}disable(){unregisterGlobal$1(API_NAME,DiagAPI.instance()),this._proxyTracerProvider=new ProxyTracerProvider}};const trace$1=TraceAPI$1.getInstance(),bulkAddEventListener=({target:z,events:G,callback:K})=>{G.forEach(G=>{z.addEventListener(G,K)})},bulkRemoveEventListener=({target:z,events:G,callback:K})=>{G.forEach(G=>{z.removeEventListener(G,K)})};function createSafeProxy(z,G,K,J=new Set){return new Proxy(z,{get(z,Y,X){let Z=Reflect.get(z,Y,X);return typeof Z!=`function`||J.has(Y)?Z:(...J)=>{try{return Z.apply(z,J)}catch(z){let X=z instanceof Error?z.message:`Unknown error`;K.error(`${String(Y)}: ${X}`);let Z=G[Y];return typeof Z==`function`?Z.apply(G,J):void 0}}}})}const UUID_BYTES=16,BUFFER=new Uint8Array(UUID_BYTES),HEX$1=Array.from({length:256},(z,G)=>G.toString(16).padStart(2,`0`).toUpperCase()),generateUUID=()=>{crypto.getRandomValues(BUFFER);let z=``;for(let G=0;G<UUID_BYTES;G++)z+=HEX$1[BUFFER[G]];return z},getIncrementedCount=(z,G,K)=>{try{let K=z.getItem(G),J=K?parseInt(K,10):0;return J++,z.setItem(G,J.toString()),J}catch(z){return K.warn(`Failed to retrieve ${G} from storage: `,z),1}},KEY_MXL_TYPE=`mxl.type`,KEY_MXL_STATE=`mxl.state`,KEY_MXL_COLD_START=`mxl.cold_start`,KEY_MXL_SESSION_NUMBER=`mxl.session_number`,KEY_MXL_EXCEPTION_NUMBER=`mxl.exception_number`,KEY_MXL_SDK_STARTUP_DURATION=`mxl.sdk_startup_duration`,KEY_PREFIX_MXL_PROPERTIES=`mxl.properties.`,KEY_MXL_SESSION_REASON_ENDED=`mxl.session_end_type`,KEY_MXL_SESSION_REASON_STARTED=`mxl.session_start_type`,KEY_MXL_JS_EXCEPTION_STACKTRACE=`mxl.stacktrace.js`,KEY_MXL_EXCEPTION_HANDLING=`mxl.exception_handling`,KEY_MXL_EXCEPTION_CAUSE=`mxl.exception_cause`,KEY_MXL_ERROR_CODE=`mxl.error_code`,KEY_MXL_APP_INSTANCE_ID=`mxl.app_instance_id`,KEY_MXL_TAB_ID=`mxl.tab_id`,KEY_MXL_SOURCE_TAB_ID=`mxl.source_tab_id`,KEY_MXL_EXPERIENCE_ID=`mxl.experience_id`,KEY_MXL_ERROR_LOG_COUNT=`mxl.error_log_count`,KEY_MXL_INSTRUMENTATION=`mxl.instrumentation`,KEY_MXL_UNHANDLED_EXCEPTIONS_COUNT=`mxl.unhandled_exceptions_count`,KEY_MXL_FROM_STORAGE=`mxl.from_storage`,KEY_MXL_JS_FILE_BUNDLE_IDS=`mxl.js_file_bundle_ids`,KEY_MXL_W3C_TRACEPARENT=`mxl.w3c_traceparent`,KEY_MXL_NAVIGATION_SOURCE=`mxl.navigation_source`,KEY_MXL_REFERRER_URL=`mxl.referrer_url`,KEY_BROWSER_URL_FULL=`browser.url.full`,KEY_MXL_MAX_PENDING_SPANS_REACHED=`mxl.max_pending_spans_reached`,KEY_MXL_PAGE_PATH=`app.surface.name`,KEY_MXL_PAGE_ID=`app.surface.id`,KEY_APP_SURFACE_LABEL=`app.surface.label`;let MXL_TYPES=function(z){return z.Session=`ux.session`,z.Network=`perf.network_request`,z.Perf=`perf`,z.SystemLog=`sys.log`,z.SystemException=`sys.exception`,z.WebVital=`ux.web_vital`,z.ResourceFetch=`ux.resource_fetch`,z.DocumentLoad=`ux.document_load`,z.Surface=`ux.surface`,z}({}),MXL_STATES=function(z){return z.Foreground=`foreground`,z.Background=`background`,z}({}),MXL_NAVIGATION_INSTRUMENTATIONS=function(z){return z.DeclarativeLegacy=`react_router_declarative_legacy`,z.Declarative=`react_router_declarative`,z.Data=`react_router_data`,z.Manual=`manual`,z}({});const getVisibilityState=z=>z.visibilityState===`hidden`?MXL_STATES.Background:MXL_STATES.Foreground,GLOBAL_CONFIG=globalThis,DIGITS=6,isDeviceIdEnabled=(z,G)=>!G||G<=0||G>100?!1:G>=getNormalizedDeviceId(z),getNormalizedDeviceId=z=>{if(z.length<DIGITS)return 0;let G=z.slice(-DIGITS),K=16,J=Math.pow(16,DIGITS)-1;return parseInt(G,16)/J*100},SUPPRESS_TRACING_KEY$3=createContextKey(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function suppressTracing$3(z){return z.setValue(SUPPRESS_TRACING_KEY$3,!0)}function isTracingSuppressed$1(z){return z.getValue(SUPPRESS_TRACING_KEY$3)===!0}function _typeof(z){"@babel/helpers - typeof";return _typeof=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(z){return typeof z}:function(z){return z&&typeof Symbol==`function`&&z.constructor===Symbol&&z!==Symbol.prototype?`symbol`:typeof z},_typeof(z)}function toPrimitive(z,G){if(_typeof(z)!=`object`||!z)return z;var K=z[Symbol.toPrimitive];if(K!==void 0){var J=K.call(z,G||`default`);if(_typeof(J)!=`object`)return J;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(G===`string`?String:Number)(z)}function toPropertyKey(z){var G=toPrimitive(z,`string`);return _typeof(G)==`symbol`?G:G+``}function _defineProperty(z,G,K){return(G=toPropertyKey(G))in z?Object.defineProperty(z,G,{value:K,enumerable:!0,configurable:!0,writable:!0}):z[G]=K,z}const TMP_HTTP_METHOD=`http.method`,TMP_HTTP_URL=`http.url`,TMP_HTTP_STATUS_CODE=`http.status_code`,TMP_HTTP_REQUEST_CONTENT_LENGTH=`http.request_content_length`,TMP_HTTP_RESPONSE_CONTENT_LENGTH=`http.response_content_length`,SEMATTRS_HTTP_METHOD=TMP_HTTP_METHOD,SEMATTRS_HTTP_URL=TMP_HTTP_URL,SEMATTRS_HTTP_STATUS_CODE=TMP_HTTP_STATUS_CODE,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=TMP_HTTP_REQUEST_CONTENT_LENGTH,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=TMP_HTTP_RESPONSE_CONTENT_LENGTH,ATTR_ERROR_TYPE=`error.type`,ATTR_EXCEPTION_MESSAGE=`exception.message`,ATTR_EXCEPTION_STACKTRACE=`exception.stacktrace`,ATTR_EXCEPTION_TYPE=`exception.type`,ATTR_HTTP_REQUEST_METHOD=`http.request.method`,ATTR_HTTP_REQUEST_METHOD_ORIGINAL=`http.request.method_original`,ATTR_HTTP_RESPONSE_STATUS_CODE=`http.response.status_code`,ATTR_SERVER_ADDRESS=`server.address`,ATTR_SERVER_PORT=`server.port`,ATTR_SERVICE_NAME=`service.name`,ATTR_TELEMETRY_SDK_LANGUAGE=`telemetry.sdk.language`,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS=`webjs`,ATTR_TELEMETRY_SDK_NAME=`telemetry.sdk.name`,ATTR_TELEMETRY_SDK_VERSION=`telemetry.sdk.version`,ATTR_URL_FULL=`url.full`,ATTR_URL_PATH=`url.path`,ATTR_URL_QUERY=`url.query`,ATTR_USER_AGENT_ORIGINAL=`user_agent.original`,NANOSECOND_DIGITS$4=9,MILLISECONDS_TO_NANOSECONDS$4=Math.pow(10,6),SECOND_TO_NANOSECONDS$5=Math.pow(10,NANOSECOND_DIGITS$4);function millisToHrTime$4(z){let G=z/1e3;return[Math.trunc(G),Math.round(z%1e3*MILLISECONDS_TO_NANOSECONDS$4)]}function hrTimeToMilliseconds(z){return z[0]*1e3+z[1]/1e6}var ExportResultCode$3;(function(z){z[z.SUCCESS=0]=`SUCCESS`,z[z.FAILED=1]=`FAILED`})(ExportResultCode$3||(ExportResultCode$3={}));const VALID_KEY_CHAR_RANGE$1=`[_0-9a-z-*/]`,VALID_KEY$1=`[a-z]${VALID_KEY_CHAR_RANGE$1}{0,255}`,VALID_VENDOR_KEY$1=`[a-z0-9]${VALID_KEY_CHAR_RANGE$1}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE$1}{0,13}`,VALID_KEY_REGEX$1=RegExp(`^(?:${VALID_KEY$1}|${VALID_VENDOR_KEY$1})$`),VALID_VALUE_BASE_REGEX$1=/^[ -~]{0,255}[!-~]$/,INVALID_VALUE_COMMA_EQUAL_REGEX$1=/,|=/;function validateKey$1(z){return VALID_KEY_REGEX$1.test(z)}function validateValue$1(z){return VALID_VALUE_BASE_REGEX$1.test(z)&&!INVALID_VALUE_COMMA_EQUAL_REGEX$1.test(z)}const MAX_TRACE_STATE_ITEMS$1=32,MAX_TRACE_STATE_LEN$1=512,LIST_MEMBERS_SEPARATOR$1=`,`,LIST_MEMBER_KEY_VALUE_SPLITTER$1=`=`;var TraceState$1=class z{constructor(z){_defineProperty(this,`_internalState`,new Map),z&&this._parse(z)}set(z,G){let K=this._clone();return K._internalState.has(z)&&K._internalState.delete(z),K._internalState.set(z,G),K}unset(z){let G=this._clone();return G._internalState.delete(z),G}get(z){return this._internalState.get(z)}serialize(){return this._keys().reduce((z,G)=>(z.push(G+LIST_MEMBER_KEY_VALUE_SPLITTER$1+this.get(G)),z),[]).join(LIST_MEMBERS_SEPARATOR$1)}_parse(z){z.length>MAX_TRACE_STATE_LEN$1||(this._internalState=z.split(LIST_MEMBERS_SEPARATOR$1).reverse().reduce((z,G)=>{let K=G.trim(),J=K.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER$1);if(J!==-1){let Y=K.slice(0,J),X=K.slice(J+1,G.length);validateKey$1(Y)&&validateValue$1(X)&&z.set(Y,X)}return z},new Map),this._internalState.size>MAX_TRACE_STATE_ITEMS$1&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,MAX_TRACE_STATE_ITEMS$1))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let G=new z;return G._internalState=new Map(this._internalState),G}};const TRACE_PARENT_HEADER$1=`traceparent`,TRACE_STATE_HEADER$1=`tracestate`,VERSION$9=`00`,TRACE_PARENT_REGEX$1=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function parseTraceParent$1(z){let G=TRACE_PARENT_REGEX$1.exec(z);return!G||G[1]===`00`&&G[5]?null:{traceId:G[2],spanId:G[3],traceFlags:parseInt(G[4],16)}}var W3CTraceContextPropagator$1=class{inject(z,G,K){let J=trace$1.getSpanContext(z);if(!J||isTracingSuppressed$1(z)||!isSpanContextValid(J))return;let Y=`${VERSION$9}-${J.traceId}-${J.spanId}-0${Number(J.traceFlags||TraceFlags.NONE).toString(16)}`;K.set(G,TRACE_PARENT_HEADER$1,Y),J.traceState&&K.set(G,TRACE_STATE_HEADER$1,J.traceState.serialize())}extract(z,G,K){let J=K.get(G,TRACE_PARENT_HEADER$1);if(!J)return z;let Y=Array.isArray(J)?J[0]:J;if(typeof Y!=`string`)return z;let X=parseTraceParent$1(Y);if(!X)return z;X.isRemote=!0;let Z=K.get(G,TRACE_STATE_HEADER$1);if(Z){let z=Array.isArray(Z)?Z.join(`,`):Z;X.traceState=new TraceState$1(typeof z==`string`?z:void 0)}return trace$1.setSpanContext(z,X)}fields(){return[TRACE_PARENT_HEADER$1,TRACE_STATE_HEADER$1]}},Deferred$2=class{constructor(){_defineProperty(this,`_promise`,void 0),_defineProperty(this,`_resolve`,void 0),_defineProperty(this,`_reject`,void 0),this._promise=new Promise((z,G)=>{this._resolve=z,this._reject=G})}get promise(){return this._promise}resolve(z){this._resolve(z)}reject(z){this._reject(z)}},BindOnceFuture$2=class{constructor(z,G){_defineProperty(this,`_isCalled`,!1),_defineProperty(this,`_deferred`,new Deferred$2),_defineProperty(this,`_callback`,void 0),_defineProperty(this,`_that`,void 0),this._callback=z,this._that=G}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...z){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...z)).then(z=>this._deferred.resolve(z),z=>this._deferred.reject(z))}catch(z){this._deferred.reject(z)}}return this._deferred.promise}};function _export(z,G){return new Promise(K=>{context.with(suppressTracing$3(context.active()),()=>{z.export(G,K)})})}const internal={_export},isPromiseLike$2=z=>typeof z==`object`&&!!z&&typeof z.then==`function`;function asyncGeneratorStep(z,G,K,J,Y,X,Z){try{var Q=z[X](Z),ee=Q.value}catch(z){K(z);return}Q.done?G(ee):Promise.resolve(ee).then(J,Y)}function _asyncToGenerator(z){return function(){var G=this,K=arguments;return new Promise(function(J,Y){var X=z.apply(G,K);function Z(z){asyncGeneratorStep(X,J,Y,Z,Q,`next`,z)}function Q(z){asyncGeneratorStep(X,J,Y,Z,Q,`throw`,z)}Z(void 0)})}}var ResourceImpl$2=class z{static FromAttributeList(G,K){let J=new z({},K);return J._rawAttributes=guardedRawAttributes$2(G),J._asyncAttributesPending=G.filter(([z,G])=>isPromiseLike$2(G)).length>0,J}constructor(z,G){var K;_defineProperty(this,`_rawAttributes`,void 0),_defineProperty(this,`_asyncAttributesPending`,!1),_defineProperty(this,`_schemaUrl`,void 0),_defineProperty(this,`_memoizedAttributes`,void 0);let J=(K=z.attributes)==null?{}:K;this._rawAttributes=Object.entries(J).map(([z,G])=>(isPromiseLike$2(G)&&(this._asyncAttributesPending=!0),[z,G])),this._rawAttributes=guardedRawAttributes$2(this._rawAttributes),this._schemaUrl=validateSchemaUrl$2(G==null?void 0:G.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var z=this;return _asyncToGenerator(function*(){if(z.asyncAttributesPending){for(let G=0;G<z._rawAttributes.length;G++){let[K,J]=z._rawAttributes[G];z._rawAttributes[G]=[K,isPromiseLike$2(J)?yield J:J]}z._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&diag$1.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let z={};for(let[K,J]of this._rawAttributes){if(isPromiseLike$2(J)){diag$1.debug(`Unsettled resource attribute ${K} skipped`);continue}if(J!=null){var G;z[K]!=null||(z[K]=J)}}return this._asyncAttributesPending||(this._memoizedAttributes=z),z}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(G){if(G==null)return this;let K=mergeSchemaUrl$2(this,G),J=K?{schemaUrl:K}:void 0;return z.FromAttributeList([...G.getRawAttributes(),...this.getRawAttributes()],J)}};function resourceFromAttributes$2(z,G){return ResourceImpl$2.FromAttributeList(Object.entries(z),G)}function emptyResource(){return resourceFromAttributes$2({})}function guardedRawAttributes$2(z){return z.map(([z,G])=>isPromiseLike$2(G)?[z,G.catch(G=>{diag$1.debug(`promise rejection for resource attribute: %s - %s`,z,G)})]:[z,G])}function validateSchemaUrl$2(z){if(typeof z==`string`||z===void 0)return z;diag$1.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,z)}function mergeSchemaUrl$2(z,G){let K=z==null?void 0:z.schemaUrl,J=G==null?void 0:G.schemaUrl,Y=K===void 0||K===``,X=J===void 0||J===``;if(Y)return J;if(X||K===J)return K;diag$1.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,K,J)}const SUPPRESS_TRACING_KEY$2=createContextKey(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function suppressTracing$2(z){return z.setValue(SUPPRESS_TRACING_KEY$2,!0)}function isTracingSuppressed(z){return z.getValue(SUPPRESS_TRACING_KEY$2)===!0}const BAGGAGE_KEY_PAIR_SEPARATOR=`=`,BAGGAGE_PROPERTIES_SEPARATOR=`;`,BAGGAGE_ITEMS_SEPARATOR=`,`,BAGGAGE_HEADER=`baggage`,BAGGAGE_MAX_NAME_VALUE_PAIRS=180,BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096,BAGGAGE_MAX_TOTAL_LENGTH=8192;function serializeKeyPairs(z){return z.reduce((z,G)=>{let K=`${z}${z===``?``:BAGGAGE_ITEMS_SEPARATOR}${G}`;return K.length>BAGGAGE_MAX_TOTAL_LENGTH?z:K},``)}function getKeyPairs(z){return z.getAllEntries().map(([z,G])=>{let K=`${encodeURIComponent(z)}=${encodeURIComponent(G.value)}`;return G.metadata!==void 0&&(K+=BAGGAGE_PROPERTIES_SEPARATOR+G.metadata.toString()),K})}function parsePairKeyValue(z){if(!z)return;let G=z.indexOf(BAGGAGE_PROPERTIES_SEPARATOR),K=G===-1?z:z.substring(0,G),J=K.indexOf(BAGGAGE_KEY_PAIR_SEPARATOR);if(J<=0)return;let Y=K.substring(0,J).trim(),X=K.substring(J+1).trim();if(!Y||!X)return;let Z,Q;try{Z=decodeURIComponent(Y),Q=decodeURIComponent(X)}catch(z){return}let ee;return G!==-1&&G<z.length-1&&(ee=baggageEntryMetadataFromString(z.substring(G+1))),{key:Z,value:Q,metadata:ee}}var W3CBaggagePropagator=class{inject(z,G,K){let J=propagation.getBaggage(z);if(!J||isTracingSuppressed(z))return;let Y=serializeKeyPairs(getKeyPairs(J).filter(z=>z.length<=BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,BAGGAGE_MAX_NAME_VALUE_PAIRS));Y.length>0&&K.set(G,BAGGAGE_HEADER,Y)}extract(z,G,K){let J=K.get(G,BAGGAGE_HEADER),Y=Array.isArray(J)?J.join(BAGGAGE_ITEMS_SEPARATOR):J;if(!Y)return z;let X={};return Y.length===0||(Y.split(BAGGAGE_ITEMS_SEPARATOR).forEach(z=>{let G=parsePairKeyValue(z);if(G){let z={value:G.value};G.metadata&&(z.metadata=G.metadata),X[G.key]=z}}),Object.entries(X).length===0)?z:propagation.setBaggage(z,propagation.createBaggage(X))}fields(){return[BAGGAGE_HEADER]}};function sanitizeAttributes(z){let G={};if(typeof z!=`object`||!z)return G;for(let K in z){if(!Object.prototype.hasOwnProperty.call(z,K))continue;if(!isAttributeKey(K)){diag$1.warn(`Invalid attribute key: ${K}`);continue}let J=z[K];if(!isAttributeValue(J)){diag$1.warn(`Invalid attribute value set for key: ${K}`);continue}Array.isArray(J)?G[K]=J.slice():G[K]=J}return G}function isAttributeKey(z){return typeof z==`string`&&z!==``}function isAttributeValue(z){return z==null?!0:Array.isArray(z)?isHomogeneousAttributeValueArray(z):isValidPrimitiveAttributeValueType(typeof z)}function isHomogeneousAttributeValueArray(z){let G;for(let K of z){if(K==null)continue;let z=typeof K;if(z!==G){if(!G){if(isValidPrimitiveAttributeValueType(z)){G=z;continue}return!1}return!1}}return!0}function isValidPrimitiveAttributeValueType(z){switch(z){case`number`:case`boolean`:case`string`:return!0}return!1}function loggingErrorHandler$1(){return z=>{diag$1.error(stringifyException$1(z))}}function stringifyException$1(z){return typeof z==`string`?z:JSON.stringify(flattenException$1(z))}function flattenException$1(z){let G={},K=z;for(;K!==null;)Object.getOwnPropertyNames(K).forEach(z=>{if(G[z])return;let J=K[z];J&&(G[z]=String(J))}),K=Object.getPrototypeOf(K);return G}let delegateHandler$1=loggingErrorHandler$1();function globalErrorHandler$1(z){try{delegateHandler$1(z)}catch(z){}}function getStringFromEnv(z){}function getNumberFromEnv(z){}const VERSION$8=`2.7.0`,ATTR_PROCESS_RUNTIME_NAME$1=`process.runtime.name`,SDK_INFO$1={[ATTR_TELEMETRY_SDK_NAME]:`opentelemetry`,[ATTR_PROCESS_RUNTIME_NAME$1]:`browser`,[ATTR_TELEMETRY_SDK_LANGUAGE]:TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,[ATTR_TELEMETRY_SDK_VERSION]:VERSION$8},otperformance$3=performance,NANOSECOND_DIGITS$3=9,MILLISECONDS_TO_NANOSECONDS$3=Math.pow(10,6),SECOND_TO_NANOSECONDS$4=Math.pow(10,NANOSECOND_DIGITS$3);function millisToHrTime$3(z){let G=z/1e3;return[Math.trunc(G),Math.round(z%1e3*MILLISECONDS_TO_NANOSECONDS$3)]}function hrTime$3(z){return addHrTimes$3(millisToHrTime$3(otperformance$3.timeOrigin),millisToHrTime$3(typeof z==`number`?z:otperformance$3.now()))}function timeInputToHrTime$1(z){if(isTimeInputHrTime$1(z))return z;if(typeof z==`number`)return z<otperformance$3.timeOrigin?hrTime$3(z):millisToHrTime$3(z);if(z instanceof Date)return millisToHrTime$3(z.getTime());throw TypeError(`Invalid input type`)}function hrTimeDuration(z,G){let K=G[0]-z[0],J=G[1]-z[1];return J<0&&(--K,J+=SECOND_TO_NANOSECONDS$4),[K,J]}function hrTimeToNanoseconds$1(z){return z[0]*SECOND_TO_NANOSECONDS$4+z[1]}function isTimeInputHrTime$1(z){return Array.isArray(z)&&z.length===2&&typeof z[0]==`number`&&typeof z[1]==`number`}function isTimeInput(z){return isTimeInputHrTime$1(z)||typeof z==`number`||z instanceof Date}function addHrTimes$3(z,G){let K=[z[0]+G[0],z[1]+G[1]];return K[1]>=SECOND_TO_NANOSECONDS$4&&(K[1]-=SECOND_TO_NANOSECONDS$4,K[0]+=1),K}var ExportResultCode$2;(function(z){z[z.SUCCESS=0]=`SUCCESS`,z[z.FAILED=1]=`FAILED`})(ExportResultCode$2||(ExportResultCode$2={}));var CompositePropagator=class{constructor(z={}){var G;_defineProperty(this,`_propagators`,void 0),_defineProperty(this,`_fields`,void 0),this._propagators=(G=z.propagators)==null?[]:G,this._fields=Array.from(new Set(this._propagators.map(z=>typeof z.fields==`function`?z.fields():[]).reduce((z,G)=>z.concat(G),[])))}inject(z,G,K){for(let J of this._propagators)try{J.inject(z,G,K)}catch(z){diag$1.warn(`Failed to inject with ${J.constructor.name}. Err: ${z.message}`)}}extract(z,G,K){return this._propagators.reduce((z,J)=>{try{return J.extract(z,G,K)}catch(z){diag$1.warn(`Failed to extract with ${J.constructor.name}. Err: ${z.message}`)}return z},z)}fields(){return this._fields.slice()}};const VALID_KEY_CHAR_RANGE=`[_0-9a-z-*/]`,VALID_KEY=`[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`,VALID_VENDOR_KEY=`[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`,VALID_KEY_REGEX=RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`),VALID_VALUE_BASE_REGEX=/^[ -~]{0,255}[!-~]$/,INVALID_VALUE_COMMA_EQUAL_REGEX=/,|=/;function validateKey(z){return VALID_KEY_REGEX.test(z)}function validateValue(z){return VALID_VALUE_BASE_REGEX.test(z)&&!INVALID_VALUE_COMMA_EQUAL_REGEX.test(z)}const MAX_TRACE_STATE_ITEMS=32,MAX_TRACE_STATE_LEN=512,LIST_MEMBERS_SEPARATOR=`,`,LIST_MEMBER_KEY_VALUE_SPLITTER=`=`;var TraceState=class z{constructor(z){_defineProperty(this,`_internalState`,new Map),z&&this._parse(z)}set(z,G){let K=this._clone();return K._internalState.has(z)&&K._internalState.delete(z),K._internalState.set(z,G),K}unset(z){let G=this._clone();return G._internalState.delete(z),G}get(z){return this._internalState.get(z)}serialize(){return this._keys().reduce((z,G)=>(z.push(G+LIST_MEMBER_KEY_VALUE_SPLITTER+this.get(G)),z),[]).join(LIST_MEMBERS_SEPARATOR)}_parse(z){z.length>MAX_TRACE_STATE_LEN||(this._internalState=z.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((z,G)=>{let K=G.trim(),J=K.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);if(J!==-1){let Y=K.slice(0,J),X=K.slice(J+1,G.length);validateKey(Y)&&validateValue(X)&&z.set(Y,X)}return z},new Map),this._internalState.size>MAX_TRACE_STATE_ITEMS&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,MAX_TRACE_STATE_ITEMS))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let G=new z;return G._internalState=new Map(this._internalState),G}};const TRACE_PARENT_HEADER=`traceparent`,TRACE_STATE_HEADER=`tracestate`,VERSION$7=`00`,TRACE_PARENT_REGEX=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function parseTraceParent(z){let G=TRACE_PARENT_REGEX.exec(z);return!G||G[1]===`00`&&G[5]?null:{traceId:G[2],spanId:G[3],traceFlags:parseInt(G[4],16)}}var W3CTraceContextPropagator=class{inject(z,G,K){let J=trace$1.getSpanContext(z);if(!J||isTracingSuppressed(z)||!isSpanContextValid(J))return;let Y=`${VERSION$7}-${J.traceId}-${J.spanId}-0${Number(J.traceFlags||TraceFlags.NONE).toString(16)}`;K.set(G,TRACE_PARENT_HEADER,Y),J.traceState&&K.set(G,TRACE_STATE_HEADER,J.traceState.serialize())}extract(z,G,K){let J=K.get(G,TRACE_PARENT_HEADER);if(!J)return z;let Y=Array.isArray(J)?J[0]:J;if(typeof Y!=`string`)return z;let X=parseTraceParent(Y);if(!X)return z;X.isRemote=!0;let Z=K.get(G,TRACE_STATE_HEADER);if(Z){let z=Array.isArray(Z)?Z.join(`,`):Z;X.traceState=new TraceState(typeof z==`string`?z:void 0)}return trace$1.setSpanContext(z,X)}fields(){return[TRACE_PARENT_HEADER,TRACE_STATE_HEADER]}};const objectTag=`[object Object]`,nullTag=`[object Null]`,undefinedTag=`[object Undefined]`,funcToString=Function.prototype.toString,objectCtorString=funcToString.call(Object),getPrototypeOf=Object.getPrototypeOf,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,symToStringTag=Symbol?Symbol.toStringTag:void 0,nativeObjectToString=objectProto.toString;function isPlainObject(z){if(!isObjectLike(z)||baseGetTag(z)!==objectTag)return!1;let G=getPrototypeOf(z);if(G===null)return!0;let K=hasOwnProperty.call(G,`constructor`)&&G.constructor;return typeof K==`function`&&K instanceof K&&funcToString.call(K)===objectCtorString}function isObjectLike(z){return typeof z==`object`&&!!z}function baseGetTag(z){return z==null?z===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(z)?getRawTag(z):objectToString(z)}function getRawTag(z){let G=hasOwnProperty.call(z,symToStringTag),K=z[symToStringTag],J=!1;try{z[symToStringTag]=void 0,J=!0}catch(z){}let Y=nativeObjectToString.call(z);return J&&(G?z[symToStringTag]=K:delete z[symToStringTag]),Y}function objectToString(z){return nativeObjectToString.call(z)}const MAX_LEVEL=20;function merge(...z){let G=z.shift(),K=new WeakMap;for(;z.length>0;)G=mergeTwoObjects(G,z.shift(),0,K);return G}function takeValue(z){return isArray$1(z)?z.slice():z}function mergeTwoObjects(z,G,K=0,J){let Y;if(!(K>MAX_LEVEL)){if(K++,isPrimitive(z)||isPrimitive(G)||isFunction(G))Y=takeValue(G);else if(isArray$1(z)){if(Y=z.slice(),isArray$1(G))for(let z=0,K=G.length;z<K;z++)Y.push(takeValue(G[z]));else if(isObject$1(G)){let z=Object.keys(G);for(let K=0,J=z.length;K<J;K++){let J=z[K];J===`__proto__`||J===`constructor`||J===`prototype`||(Y[J]=takeValue(G[J]))}}}else if(isObject$1(z))if(isObject$1(G)){if(!shouldMerge(z,G))return G;Y=Object.assign({},z);let X=Object.keys(G);for(let Z=0,Q=X.length;Z<Q;Z++){let Q=X[Z];if(Q===`__proto__`||Q===`constructor`||Q===`prototype`)continue;let ee=G[Q];if(isPrimitive(ee))ee===void 0?delete Y[Q]:Y[Q]=ee;else{let X=Y[Q],Z=ee;if(wasObjectReferenced(z,Q,J)||wasObjectReferenced(G,Q,J))delete Y[Q];else{if(isObject$1(X)&&isObject$1(Z)){let K=J.get(X)||[],Y=J.get(Z)||[];K.push({obj:z,key:Q}),Y.push({obj:G,key:Q}),J.set(X,K),J.set(Z,Y)}Y[Q]=mergeTwoObjects(Y[Q],ee,K,J)}}}}else Y=G;return Y}}function wasObjectReferenced(z,G,K){let J=K.get(z[G])||[];for(let K=0,Y=J.length;K<Y;K++){let Y=J[K];if(Y.key===G&&Y.obj===z)return!0}return!1}function isArray$1(z){return Array.isArray(z)}function isFunction(z){return typeof z==`function`}function isObject$1(z){return!isPrimitive(z)&&!isArray$1(z)&&!isFunction(z)&&typeof z==`object`}function isPrimitive(z){return typeof z==`string`||typeof z==`number`||typeof z==`boolean`||z===void 0||z instanceof Date||z instanceof RegExp||z===null}function shouldMerge(z,G){return!(!isPlainObject(z)||!isPlainObject(G))}function urlMatches$2(z,G){return typeof G==`string`?z===G:!!z.match(G)}var Deferred$1=class{constructor(){_defineProperty(this,`_promise`,void 0),_defineProperty(this,`_resolve`,void 0),_defineProperty(this,`_reject`,void 0),this._promise=new Promise((z,G)=>{this._resolve=z,this._reject=G})}get promise(){return this._promise}resolve(z){this._resolve(z)}reject(z){this._reject(z)}},BindOnceFuture$1=class{constructor(z,G){_defineProperty(this,`_isCalled`,!1),_defineProperty(this,`_deferred`,new Deferred$1),_defineProperty(this,`_callback`,void 0),_defineProperty(this,`_that`,void 0),this._callback=z,this._that=G}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...z){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...z)).then(z=>this._deferred.resolve(z),z=>this._deferred.reject(z))}catch(z){this._deferred.reject(z)}}return this._deferred.promise}};let serviceName$1;function defaultServiceName$1(){if(serviceName$1===void 0)try{let z=globalThis.process.argv0;serviceName$1=z?`unknown_service:${z}`:`unknown_service`}catch(z){serviceName$1=`unknown_service`}return serviceName$1}const isPromiseLike$1=z=>typeof z==`object`&&!!z&&typeof z.then==`function`;var ResourceImpl$1=class z{static FromAttributeList(G,K){let J=new z({},K);return J._rawAttributes=guardedRawAttributes$1(G),J._asyncAttributesPending=G.filter(([z,G])=>isPromiseLike$1(G)).length>0,J}constructor(z,G){var K;_defineProperty(this,`_rawAttributes`,void 0),_defineProperty(this,`_asyncAttributesPending`,!1),_defineProperty(this,`_schemaUrl`,void 0),_defineProperty(this,`_memoizedAttributes`,void 0);let J=(K=z.attributes)==null?{}:K;this._rawAttributes=Object.entries(J).map(([z,G])=>(isPromiseLike$1(G)&&(this._asyncAttributesPending=!0),[z,G])),this._rawAttributes=guardedRawAttributes$1(this._rawAttributes),this._schemaUrl=validateSchemaUrl$1(G==null?void 0:G.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var z=this;return _asyncToGenerator(function*(){if(z.asyncAttributesPending){for(let G=0;G<z._rawAttributes.length;G++){let[K,J]=z._rawAttributes[G];z._rawAttributes[G]=[K,isPromiseLike$1(J)?yield J:J]}z._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&diag$1.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let z={};for(let[K,J]of this._rawAttributes){if(isPromiseLike$1(J)){diag$1.debug(`Unsettled resource attribute ${K} skipped`);continue}if(J!=null){var G;z[K]!=null||(z[K]=J)}}return this._asyncAttributesPending||(this._memoizedAttributes=z),z}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(G){if(G==null)return this;let K=mergeSchemaUrl$1(this,G),J=K?{schemaUrl:K}:void 0;return z.FromAttributeList([...G.getRawAttributes(),...this.getRawAttributes()],J)}};function resourceFromAttributes$1(z,G){return ResourceImpl$1.FromAttributeList(Object.entries(z),G)}function defaultResource$1(){return resourceFromAttributes$1({[ATTR_SERVICE_NAME]:defaultServiceName$1(),[ATTR_TELEMETRY_SDK_LANGUAGE]:SDK_INFO$1[ATTR_TELEMETRY_SDK_LANGUAGE],[ATTR_TELEMETRY_SDK_NAME]:SDK_INFO$1[ATTR_TELEMETRY_SDK_NAME],[ATTR_TELEMETRY_SDK_VERSION]:SDK_INFO$1[ATTR_TELEMETRY_SDK_VERSION]})}function guardedRawAttributes$1(z){return z.map(([z,G])=>isPromiseLike$1(G)?[z,G.catch(G=>{diag$1.debug(`promise rejection for resource attribute: %s - %s`,z,G)})]:[z,G])}function validateSchemaUrl$1(z){if(typeof z==`string`||z===void 0)return z;diag$1.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,z)}function mergeSchemaUrl$1(z,G){let K=z==null?void 0:z.schemaUrl,J=G==null?void 0:G.schemaUrl,Y=K===void 0||K===``,X=J===void 0||J===``;if(Y)return J;if(X||K===J)return K;diag$1.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,K,J)}const ExceptionEventName=`exception`;var SpanImpl=class{constructor(z){var G,K;_defineProperty(this,`_spanContext`,void 0),_defineProperty(this,`kind`,void 0),_defineProperty(this,`parentSpanContext`,void 0),_defineProperty(this,`attributes`,{}),_defineProperty(this,`links`,[]),_defineProperty(this,`events`,[]),_defineProperty(this,`startTime`,void 0),_defineProperty(this,`resource`,void 0),_defineProperty(this,`instrumentationScope`,void 0),_defineProperty(this,`_droppedAttributesCount`,0),_defineProperty(this,`_droppedEventsCount`,0),_defineProperty(this,`_droppedLinksCount`,0),_defineProperty(this,`_attributesCount`,0),_defineProperty(this,`name`,void 0),_defineProperty(this,`status`,{code:SpanStatusCode.UNSET}),_defineProperty(this,`endTime`,[0,0]),_defineProperty(this,`_ended`,!1),_defineProperty(this,`_duration`,[-1,-1]),_defineProperty(this,`_spanProcessor`,void 0),_defineProperty(this,`_spanLimits`,void 0),_defineProperty(this,`_attributeValueLengthLimit`,void 0),_defineProperty(this,`_recordEndMetrics`,void 0),_defineProperty(this,`_performanceStartTime`,void 0),_defineProperty(this,`_performanceOffset`,void 0),_defineProperty(this,`_startTimeProvided`,void 0);let J=Date.now();if(this._spanContext=z.spanContext,this._performanceStartTime=otperformance$3.now(),this._performanceOffset=J-(this._performanceStartTime+otperformance$3.timeOrigin),this._startTimeProvided=z.startTime!=null,this._spanLimits=z.spanLimits,this._attributeValueLengthLimit=(G=this._spanLimits.attributeValueLengthLimit)==null?0:G,this._spanProcessor=z.spanProcessor,this.name=z.name,this.parentSpanContext=z.parentSpanContext,this.kind=z.kind,z.links)for(let G of z.links)this.addLink(G);this.startTime=this._getTime((K=z.startTime)==null?J:K),this.resource=z.resource,this.instrumentationScope=z.scope,this._recordEndMetrics=z.recordEndMetrics,z.attributes!=null&&this.setAttributes(z.attributes),this._spanProcessor.onStart(this,z.context)}spanContext(){return this._spanContext}setAttribute(z,G){if(G==null||this._isSpanEnded())return this;if(z.length===0)return diag$1.warn(`Invalid attribute key: ${z}`),this;if(!isAttributeValue(G))return diag$1.warn(`Invalid attribute value set for key: ${z}`),this;let{attributeCountLimit:K}=this._spanLimits,J=!Object.prototype.hasOwnProperty.call(this.attributes,z);return K!==void 0&&this._attributesCount>=K&&J?(this._droppedAttributesCount++,this):(this.attributes[z]=this._truncateToSize(G),J&&this._attributesCount++,this)}setAttributes(z){for(let G in z)Object.prototype.hasOwnProperty.call(z,G)&&this.setAttribute(G,z[G]);return this}addEvent(z,G,K){if(this._isSpanEnded())return this;let{eventCountLimit:J}=this._spanLimits;if(J===0)return diag$1.warn(`No events allowed.`),this._droppedEventsCount++,this;J!==void 0&&this.events.length>=J&&(this._droppedEventsCount===0&&diag$1.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),isTimeInput(G)&&(isTimeInput(K)||(K=G),G=void 0);let Y=sanitizeAttributes(G),{attributePerEventCountLimit:X}=this._spanLimits,Z={},Q=0,ee=0;for(let z in Y){if(!Object.prototype.hasOwnProperty.call(Y,z))continue;let G=Y[z];if(X!==void 0&&ee>=X){Q++;continue}Z[z]=this._truncateToSize(G),ee++}return this.events.push({name:z,attributes:Z,time:this._getTime(K),droppedAttributesCount:Q}),this}addLink(z){if(this._isSpanEnded())return this;let{linkCountLimit:G}=this._spanLimits;if(G===0)return this._droppedLinksCount++,this;G!==void 0&&this.links.length>=G&&(this._droppedLinksCount===0&&diag$1.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:K}=this._spanLimits,J=sanitizeAttributes(z.attributes),Y={},X=0,Z=0;for(let z in J){if(!Object.prototype.hasOwnProperty.call(J,z))continue;let G=J[z];if(K!==void 0&&Z>=K){X++;continue}Y[z]=this._truncateToSize(G),Z++}let Q={context:z.context};return Z>0&&(Q.attributes=Y),X>0&&(Q.droppedAttributesCount=X),this.links.push(Q),this}addLinks(z){for(let G of z)this.addLink(G);return this}setStatus(z){if(this._isSpanEnded()||z.code===SpanStatusCode.UNSET||this.status.code===SpanStatusCode.OK)return this;let G={code:z.code};return z.code===SpanStatusCode.ERROR&&(typeof z.message==`string`?G.message=z.message:z.message!=null&&diag$1.warn(`Dropping invalid status.message of type '${typeof z.message}', expected 'string'`)),this.status=G,this}updateName(z){return this._isSpanEnded()||(this.name=z),this}end(z){var G;if(this._isSpanEnded()){diag$1.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(z),this._duration=hrTimeDuration(this.startTime,this.endTime),this._duration[0]<0&&(diag$1.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&diag$1.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&diag$1.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(G=this._recordEndMetrics)==null||G.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(z){if(typeof z==`number`&&z<=otperformance$3.now())return hrTime$3(z+this._performanceOffset);if(typeof z==`number`)return millisToHrTime$3(z);if(z instanceof Date)return millisToHrTime$3(z.getTime());if(isTimeInputHrTime$1(z))return z;if(this._startTimeProvided)return millisToHrTime$3(Date.now());let G=otperformance$3.now()-this._performanceStartTime;return addHrTimes$3(this.startTime,millisToHrTime$3(G))}isRecording(){return this._ended===!1}recordException(z,G){let K={};typeof z==`string`?K[ATTR_EXCEPTION_MESSAGE]=z:z&&(z.code?K[ATTR_EXCEPTION_TYPE]=z.code.toString():z.name&&(K[ATTR_EXCEPTION_TYPE]=z.name),z.message&&(K[ATTR_EXCEPTION_MESSAGE]=z.message),z.stack&&(K[ATTR_EXCEPTION_STACKTRACE]=z.stack)),K[ATTR_EXCEPTION_TYPE]||K[ATTR_EXCEPTION_MESSAGE]?this.addEvent(ExceptionEventName,K,G):diag$1.warn(`Failed to record an exception ${z}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let z=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);diag$1.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,z)}return this._ended}_truncateToLimitUtil(z,G){return z.length<=G?z:z.substring(0,G)}_truncateToSize(z){let G=this._attributeValueLengthLimit;return G<=0?(diag$1.warn(`Attribute value limit must be positive, got ${G}`),z):typeof z==`string`?this._truncateToLimitUtil(z,G):Array.isArray(z)?z.map(z=>typeof z==`string`?this._truncateToLimitUtil(z,G):z):z}},SamplingDecision;(function(z){z[z.NOT_RECORD=0]=`NOT_RECORD`,z[z.RECORD=1]=`RECORD`,z[z.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(SamplingDecision||(SamplingDecision={}));var AlwaysOffSampler=class{shouldSample(){return{decision:SamplingDecision.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},AlwaysOnSampler=class{shouldSample(){return{decision:SamplingDecision.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},ParentBasedSampler=class{constructor(z){var G,K,J,Y;_defineProperty(this,`_root`,void 0),_defineProperty(this,`_remoteParentSampled`,void 0),_defineProperty(this,`_remoteParentNotSampled`,void 0),_defineProperty(this,`_localParentSampled`,void 0),_defineProperty(this,`_localParentNotSampled`,void 0),this._root=z.root,this._root||(globalErrorHandler$1(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new AlwaysOnSampler),this._remoteParentSampled=(G=z.remoteParentSampled)==null?new AlwaysOnSampler:G,this._remoteParentNotSampled=(K=z.remoteParentNotSampled)==null?new AlwaysOffSampler:K,this._localParentSampled=(J=z.localParentSampled)==null?new AlwaysOnSampler:J,this._localParentNotSampled=(Y=z.localParentNotSampled)==null?new AlwaysOffSampler:Y}shouldSample(z,G,K,J,Y,X){let Z=trace$1.getSpanContext(z);return!Z||!isSpanContextValid(Z)?this._root.shouldSample(z,G,K,J,Y,X):Z.isRemote?Z.traceFlags&TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(z,G,K,J,Y,X):this._remoteParentNotSampled.shouldSample(z,G,K,J,Y,X):Z.traceFlags&TraceFlags.SAMPLED?this._localParentSampled.shouldSample(z,G,K,J,Y,X):this._localParentNotSampled.shouldSample(z,G,K,J,Y,X)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},TraceIdRatioBasedSampler=class{constructor(z=0){_defineProperty(this,`_ratio`,void 0),_defineProperty(this,`_upperBound`,void 0),this._ratio=this._normalize(z),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(z,G){return{decision:isValidTraceId(G)&&this._accumulate(G)<this._upperBound?SamplingDecision.RECORD_AND_SAMPLED:SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(z){return typeof z!=`number`||isNaN(z)?0:z>=1?1:z<=0?0:z}_accumulate(z){let G=0;for(let K=0;K<z.length/8;K++){let J=K*8,Y=parseInt(z.slice(J,J+8),16);G=(G^Y)>>>0}return G}},TracesSamplerValues;(function(z){z.AlwaysOff=`always_off`,z.AlwaysOn=`always_on`,z.ParentBasedAlwaysOff=`parentbased_always_off`,z.ParentBasedAlwaysOn=`parentbased_always_on`,z.ParentBasedTraceIdRatio=`parentbased_traceidratio`,z.TraceIdRatio=`traceidratio`})(TracesSamplerValues||(TracesSamplerValues={}));const DEFAULT_RATIO=1;function loadDefaultConfig(){var z,G,K,J,Y,X,Z,Q;return{sampler:buildSamplerFromEnv(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(z=void 0)==null?1/0:z,attributeCountLimit:(G=void 0)==null?128:G},spanLimits:{attributeValueLengthLimit:(K=void 0)==null?1/0:K,attributeCountLimit:(J=void 0)==null?128:J,linkCountLimit:(Y=void 0)==null?128:Y,eventCountLimit:(X=void 0)==null?128:X,attributePerEventCountLimit:(Z=void 0)==null?128:Z,attributePerLinkCountLimit:(Q=void 0)==null?128:Q}}}function buildSamplerFromEnv(){var z;let G=(z=void 0)==null?TracesSamplerValues.ParentBasedAlwaysOn:z;switch(G){case TracesSamplerValues.AlwaysOn:return new AlwaysOnSampler;case TracesSamplerValues.AlwaysOff:return new AlwaysOffSampler;case TracesSamplerValues.ParentBasedAlwaysOn:return new ParentBasedSampler({root:new AlwaysOnSampler});case TracesSamplerValues.ParentBasedAlwaysOff:return new ParentBasedSampler({root:new AlwaysOffSampler});case TracesSamplerValues.TraceIdRatio:return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv());case TracesSamplerValues.ParentBasedTraceIdRatio:return new ParentBasedSampler({root:new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv())});default:return diag$1.error(`OTEL_TRACES_SAMPLER value "${G}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`),new ParentBasedSampler({root:new AlwaysOnSampler})}}function getSamplerProbabilityFromEnv(){let z;return diag$1.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`),DEFAULT_RATIO}const DEFAULT_ATTRIBUTE_COUNT_LIMIT=128,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function mergeConfig(z){let G={sampler:buildSamplerFromEnv()},K=loadDefaultConfig(),J=Object.assign({},K,G,z);return J.generalLimits=Object.assign({},K.generalLimits,z.generalLimits||{}),J.spanLimits=Object.assign({},K.spanLimits,z.spanLimits||{}),J}function reconfigureLimits(z){var G,K,J,Y,X,Z,Q,ee,te,ne,ie,ae;let oe=Object.assign({},z.spanLimits);return oe.attributeCountLimit=(G=(K=(J=(Y=(X=z.spanLimits)==null?void 0:X.attributeCountLimit)==null?(Z=z.generalLimits)==null?void 0:Z.attributeCountLimit:Y)==null?void 0:J)==null?void 0:K)==null?DEFAULT_ATTRIBUTE_COUNT_LIMIT:G,oe.attributeValueLengthLimit=(Q=(ee=(te=(ne=(ie=z.spanLimits)==null?void 0:ie.attributeValueLengthLimit)==null?(ae=z.generalLimits)==null?void 0:ae.attributeValueLengthLimit:ne)==null?void 0:te)==null?void 0:ee)==null?DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:Q,Object.assign({},z,{spanLimits:oe})}var BatchSpanProcessorBase=class{constructor(z,G){var K,J,Y,X;_defineProperty(this,`_maxExportBatchSize`,void 0),_defineProperty(this,`_maxQueueSize`,void 0),_defineProperty(this,`_scheduledDelayMillis`,void 0),_defineProperty(this,`_exportTimeoutMillis`,void 0),_defineProperty(this,`_exporter`,void 0),_defineProperty(this,`_isExporting`,!1),_defineProperty(this,`_finishedSpans`,[]),_defineProperty(this,`_timer`,void 0),_defineProperty(this,`_shutdownOnce`,void 0),_defineProperty(this,`_droppedSpansCount`,0),this._exporter=z,this._maxExportBatchSize=typeof(G==null?void 0:G.maxExportBatchSize)==`number`?G.maxExportBatchSize:(K=void 0)==null?512:K,this._maxQueueSize=typeof(G==null?void 0:G.maxQueueSize)==`number`?G.maxQueueSize:(J=void 0)==null?2048:J,this._scheduledDelayMillis=typeof(G==null?void 0:G.scheduledDelayMillis)==`number`?G.scheduledDelayMillis:(Y=void 0)==null?5e3:Y,this._exportTimeoutMillis=typeof(G==null?void 0:G.exportTimeoutMillis)==`number`?G.exportTimeoutMillis:(X=void 0)==null?3e4:X,this._shutdownOnce=new BindOnceFuture$1(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(diag$1.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(z,G){}onEnd(z){this._shutdownOnce.isCalled||(z.spanContext().traceFlags&TraceFlags.SAMPLED)!==0&&this._addToBuffer(z)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(z){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&diag$1.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(diag$1.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(z),this._maybeStartTimer()}_flushAll(){return new Promise((z,G)=>{let K=[],J=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let z=0,G=J;z<G;z++)K.push(this._flushOneBatch());Promise.all(K).then(()=>{z()}).catch(G)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((z,G)=>{let K=setTimeout(()=>{G(Error(`Timeout`))},this._exportTimeoutMillis);context.with(suppressTracing$2(context.active()),()=>{let J;this._finishedSpans.length<=this._maxExportBatchSize?(J=this._finishedSpans,this._finishedSpans=[]):J=this._finishedSpans.splice(0,this._maxExportBatchSize);let Y=()=>this._exporter.export(J,J=>{if(clearTimeout(K),J.code===ExportResultCode$2.SUCCESS)z();else{var Y;G((Y=J.error)==null?Error(`BatchSpanProcessor: span export failed`):Y)}}),X=null;for(let z=0,G=J.length;z<G;z++){let G=J[z];if(G.resource.asyncAttributesPending&&G.resource.waitForAsyncAttributes){var Z;X!=null||(X=[]),X.push(G.resource.waitForAsyncAttributes())}}X===null?Y():Promise.all(X).then(Y,z=>{globalErrorHandler$1(z),G(z)})})})}_maybeStartTimer(){if(this._isExporting)return;let z=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(z=>{this._isExporting=!1,globalErrorHandler$1(z)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return z();this._timer===void 0&&(this._timer=setTimeout(()=>z(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},BatchSpanProcessor=class extends BatchSpanProcessorBase{constructor(z,G){super(z,G),_defineProperty(this,`_visibilityChangeListener`,void 0),_defineProperty(this,`_pageHideListener`,void 0),this.onInit(G)}onInit(z){(z==null?void 0:z.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(z=>{globalErrorHandler$1(z)})},this._pageHideListener=()=>{this.forceFlush().catch(z=>{globalErrorHandler$1(z)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}};const TRACE_ID_BYTES=16,SPAN_ID_BYTES=8,TRACE_BUFFER=new Uint8Array(TRACE_ID_BYTES),SPAN_BUFFER=new Uint8Array(SPAN_ID_BYTES),HEX=Array.from({length:256},(z,G)=>G.toString(16).padStart(2,`0`));function randomFill(z){for(let G=0;G<z.length;G++)z[G]=Math.random()*256>>>0;for(let G=0;G<z.length;G++)if(z[G]>0)return;z[z.length-1]=1}function toHex(z){let G=``;for(let K=0;K<z.length;K++)G+=HEX[z[K]];return G}var RandomIdGenerator=class{generateTraceId(){return randomFill(TRACE_BUFFER),toHex(TRACE_BUFFER)}generateSpanId(){return randomFill(SPAN_BUFFER),toHex(SPAN_BUFFER)}};const ATTR_OTEL_SPAN_PARENT_ORIGIN=`otel.span.parent.origin`,ATTR_OTEL_SPAN_SAMPLING_RESULT=`otel.span.sampling_result`,METRIC_OTEL_SDK_SPAN_LIVE=`otel.sdk.span.live`,METRIC_OTEL_SDK_SPAN_STARTED=`otel.sdk.span.started`;var TracerMetrics=class{constructor(z){_defineProperty(this,`startedSpans`,void 0),_defineProperty(this,`liveSpans`,void 0),this.startedSpans=z.createCounter(METRIC_OTEL_SDK_SPAN_STARTED,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=z.createUpDownCounter(METRIC_OTEL_SDK_SPAN_LIVE,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(z,G){let K=samplingDecisionToString(G);if(this.startedSpans.add(1,{[ATTR_OTEL_SPAN_PARENT_ORIGIN]:parentOrigin(z),[ATTR_OTEL_SPAN_SAMPLING_RESULT]:K}),G===SamplingDecision.NOT_RECORD)return()=>{};let J={[ATTR_OTEL_SPAN_SAMPLING_RESULT]:K};return this.liveSpans.add(1,J),()=>{this.liveSpans.add(-1,J)}}};function parentOrigin(z){return z?z.isRemote?`remote`:`local`:`none`}function samplingDecisionToString(z){switch(z){case SamplingDecision.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case SamplingDecision.RECORD:return`RECORD_ONLY`;case SamplingDecision.NOT_RECORD:return`DROP`}}const VERSION$6=`2.7.0`;var Tracer=class{constructor(z,G,K,J){_defineProperty(this,`_sampler`,void 0),_defineProperty(this,`_generalLimits`,void 0),_defineProperty(this,`_spanLimits`,void 0),_defineProperty(this,`_idGenerator`,void 0),_defineProperty(this,`instrumentationScope`,void 0),_defineProperty(this,`_resource`,void 0),_defineProperty(this,`_spanProcessor`,void 0),_defineProperty(this,`_tracerMetrics`,void 0);let Y=mergeConfig(G);this._sampler=Y.sampler,this._generalLimits=Y.generalLimits,this._spanLimits=Y.spanLimits,this._idGenerator=G.idGenerator||new RandomIdGenerator,this._resource=K,this._spanProcessor=J,this.instrumentationScope=z,this._tracerMetrics=new TracerMetrics(Y.meterProvider?Y.meterProvider.getMeter(`@opentelemetry/sdk-trace`,VERSION$6):createNoopMeter())}startSpan(z,G={},K=context.active()){var J,Y,X;G.root&&(K=trace$1.deleteSpan(K));let Z=trace$1.getSpan(K);if(isTracingSuppressed(K))return diag$1.debug(`Instrumentation suppressed, returning Noop Span`),trace$1.wrapSpanContext(INVALID_SPAN_CONTEXT);let Q=Z==null?void 0:Z.spanContext(),ee=this._idGenerator.generateSpanId(),te,ne,ie;!Q||!trace$1.isSpanContextValid(Q)?ne=this._idGenerator.generateTraceId():(ne=Q.traceId,ie=Q.traceState,te=Q);let ae=(J=G.kind)==null?SpanKind.INTERNAL:J,oe=((Y=G.links)==null?[]:Y).map(z=>({context:z.context,attributes:sanitizeAttributes(z.attributes)})),se=sanitizeAttributes(G.attributes),ce=this._sampler.shouldSample(K,ne,z,ae,se,oe),le=this._tracerMetrics.startSpan(Q,ce.decision);ie=(X=ce.traceState)==null?ie:X;let ue=ce.decision===SamplingDecision$1.RECORD_AND_SAMPLED?TraceFlags.SAMPLED:TraceFlags.NONE,de={traceId:ne,spanId:ee,traceFlags:ue,traceState:ie};if(ce.decision===SamplingDecision$1.NOT_RECORD)return diag$1.debug(`Recording is off, propagating context in a non-recording span`),trace$1.wrapSpanContext(de);let fe=sanitizeAttributes(Object.assign(se,ce.attributes));return new SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:K,spanContext:de,name:z,kind:ae,links:oe,parentSpanContext:te,attributes:fe,startTime:G.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:le})}startActiveSpan(z,G,K,J){var Y;let X,Z,Q;if(arguments.length<2)return;arguments.length===2?Q=G:arguments.length===3?(X=G,Q=K):(X=G,Z=K,Q=J);let ee=(Y=Z)==null?context.active():Y,te=this.startSpan(z,X,ee),ne=trace$1.setSpan(ee,te);return context.with(ne,Q,void 0,te)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},MultiSpanProcessor=class{constructor(z){_defineProperty(this,`_spanProcessors`,void 0),this._spanProcessors=z}forceFlush(){let z=[];for(let G of this._spanProcessors)z.push(G.forceFlush());return new Promise(G=>{Promise.all(z).then(()=>{G()}).catch(z=>{globalErrorHandler$1(z||Error(`MultiSpanProcessor: forceFlush failed`)),G()})})}onStart(z,G){for(let K of this._spanProcessors)K.onStart(z,G)}onEnding(z){for(let G of this._spanProcessors)G.onEnding&&G.onEnding(z)}onEnd(z){for(let G of this._spanProcessors)G.onEnd(z)}shutdown(){let z=[];for(let G of this._spanProcessors)z.push(G.shutdown());return new Promise((G,K)=>{Promise.all(z).then(()=>{G()},K)})}},ForceFlushState;(function(z){z[z.resolved=0]=`resolved`,z[z.timeout=1]=`timeout`,z[z.error=2]=`error`,z[z.unresolved=3]=`unresolved`})(ForceFlushState||(ForceFlushState={}));var BasicTracerProvider=class{constructor(z={}){var G,K;_defineProperty(this,`_config`,void 0),_defineProperty(this,`_tracers`,new Map),_defineProperty(this,`_resource`,void 0),_defineProperty(this,`_activeSpanProcessor`,void 0);let J=merge({},loadDefaultConfig(),reconfigureLimits(z));this._resource=(G=J.resource)==null?defaultResource$1():G,this._config=Object.assign({},J,{resource:this._resource});let Y=[];(K=z.spanProcessors)!=null&&K.length&&Y.push(...z.spanProcessors),this._activeSpanProcessor=new MultiSpanProcessor(Y)}getTracer(z,G,K){let J=`${z}@${G||``}:${(K==null?void 0:K.schemaUrl)||``}`;return this._tracers.has(J)||this._tracers.set(J,new Tracer({name:z,version:G,schemaUrl:K==null?void 0:K.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(J)}forceFlush(){let z=this._config.forceFlushTimeoutMillis,G=this._activeSpanProcessor._spanProcessors.map(G=>new Promise(K=>{let J,Y=setTimeout(()=>{K(Error(`Span processor did not completed within timeout period of ${z} ms`)),J=ForceFlushState.timeout},z);G.forceFlush().then(()=>{clearTimeout(Y),J!==ForceFlushState.timeout&&(J=ForceFlushState.resolved,K(J))}).catch(z=>{clearTimeout(Y),J=ForceFlushState.error,K(z)})}));return new Promise((z,K)=>{Promise.all(G).then(G=>{let J=G.filter(z=>z!==ForceFlushState.resolved);J.length>0?K(J):z()}).catch(z=>K([z]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},StackContextManager=class{constructor(){_defineProperty(this,`_enabled`,!1),_defineProperty(this,`_currentContext`,ROOT_CONTEXT)}_bindFunction(z=ROOT_CONTEXT,G){let K=this,J=function(...J){return K.with(z,()=>G.apply(this,J))};return Object.defineProperty(J,`length`,{enumerable:!1,configurable:!0,writable:!1,value:G.length}),J}active(){return this._currentContext}bind(z,G){return z===void 0&&(z=this.active()),typeof G==`function`?this._bindFunction(z,G):G}disable(){return this._currentContext=ROOT_CONTEXT,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=ROOT_CONTEXT,this)}with(z,G,K,...J){let Y=this._currentContext;this._currentContext=z||ROOT_CONTEXT;try{return G.call(K,...J)}finally{this._currentContext=Y}}};function setupContextManager(z){if(z!==null){if(z===void 0){let z=new StackContextManager;z.enable(),context.setGlobalContextManager(z);return}z.enable(),context.setGlobalContextManager(z)}}function setupPropagator(z){if(z!==null){if(z===void 0){propagation.setGlobalPropagator(new CompositePropagator({propagators:[new W3CTraceContextPropagator,new W3CBaggagePropagator]}));return}propagation.setGlobalPropagator(z)}}var WebTracerProvider=class extends BasicTracerProvider{constructor(z={}){super(z)}register(z={}){trace$1.setGlobalTracerProvider(this),setupPropagator(z.propagator),setupContextManager(z.contextManager)}},PerformanceTimingNames;(function(z){z.CONNECT_END=`connectEnd`,z.CONNECT_START=`connectStart`,z.DECODED_BODY_SIZE=`decodedBodySize`,z.DOM_COMPLETE=`domComplete`,z.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,z.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,z.DOM_INTERACTIVE=`domInteractive`,z.DOMAIN_LOOKUP_END=`domainLookupEnd`,z.DOMAIN_LOOKUP_START=`domainLookupStart`,z.ENCODED_BODY_SIZE=`encodedBodySize`,z.FETCH_START=`fetchStart`,z.LOAD_EVENT_END=`loadEventEnd`,z.LOAD_EVENT_START=`loadEventStart`,z.NAVIGATION_START=`navigationStart`,z.REDIRECT_END=`redirectEnd`,z.REDIRECT_START=`redirectStart`,z.REQUEST_START=`requestStart`,z.RESPONSE_END=`responseEnd`,z.RESPONSE_START=`responseStart`,z.SECURE_CONNECTION_START=`secureConnectionStart`,z.START_TIME=`startTime`,z.UNLOAD_EVENT_END=`unloadEventEnd`,z.UNLOAD_EVENT_START=`unloadEventStart`})(PerformanceTimingNames||(PerformanceTimingNames={}));const ATTR_HTTP_RESPONSE_CONTENT_LENGTH=`http.response_content_length`,ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=`http.response_content_length_uncompressed`;let urlNormalizingAnchor;function getUrlNormalizingAnchor(){return urlNormalizingAnchor||(urlNormalizingAnchor=document.createElement(`a`)),urlNormalizingAnchor}function hasKey(z,G){return G in z}function addSpanNetworkEvent(z,G,K,J=!0){if(hasKey(K,G)&&typeof K[G]==`number`&&!(J&&K[G]===0))return z.addEvent(G,K[G])}function addSpanNetworkEvents(z,G,K=!1,J,Y){if(J===void 0&&(J=G[PerformanceTimingNames.START_TIME]!==0),K||(addSpanNetworkEvent(z,PerformanceTimingNames.FETCH_START,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.DOMAIN_LOOKUP_START,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.DOMAIN_LOOKUP_END,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.CONNECT_START,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.SECURE_CONNECTION_START,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.CONNECT_END,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.REQUEST_START,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.RESPONSE_START,G,J),addSpanNetworkEvent(z,PerformanceTimingNames.RESPONSE_END,G,J)),!Y){let K=G[PerformanceTimingNames.ENCODED_BODY_SIZE];K!==void 0&&z.setAttribute(ATTR_HTTP_RESPONSE_CONTENT_LENGTH,K);let J=G[PerformanceTimingNames.DECODED_BODY_SIZE];J!==void 0&&K!==J&&z.setAttribute(ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED,J)}}function sortResources(z){return z.slice().sort((z,G)=>{let K=z[PerformanceTimingNames.FETCH_START],J=G[PerformanceTimingNames.FETCH_START];return K>J?1:K<J?-1:0})}function getOrigin(){return typeof location<`u`?location.origin:void 0}function getResource(z,G,K,J,Y=new WeakSet,X){let Z=parseUrl(z);z=Z.toString();let Q=filterResourcesForSpan(z,G,K,J,Y,X);if(Q.length===0)return{mainRequest:void 0};if(Q.length===1)return{mainRequest:Q[0]};let ee=sortResources(Q);if(Z.origin!==getOrigin()&&ee.length>1){let z=ee[0],G=findMainRequest(ee,z[PerformanceTimingNames.RESPONSE_END],K),J=z[PerformanceTimingNames.RESPONSE_END];return G[PerformanceTimingNames.FETCH_START]<J&&(G=z,z=void 0),{corsPreFlightRequest:z,mainRequest:G}}else return{mainRequest:Q[0]}}function findMainRequest(z,G,K){let J=hrTimeToNanoseconds$1(K),Y=hrTimeToNanoseconds$1(timeInputToHrTime$1(G)),X=z[1],Z,Q=z.length;for(let G=1;G<Q;G++){let K=z[G],Q=hrTimeToNanoseconds$1(timeInputToHrTime$1(K[PerformanceTimingNames.FETCH_START])),ee=J-hrTimeToNanoseconds$1(timeInputToHrTime$1(K[PerformanceTimingNames.RESPONSE_END]));Q>=Y&&(!Z||ee<Z)&&(Z=ee,X=K)}return X}function filterResourcesForSpan(z,G,K,J,Y,X){let Z=hrTimeToNanoseconds$1(G),Q=hrTimeToNanoseconds$1(K),ee=J.filter(G=>{let K=hrTimeToNanoseconds$1(timeInputToHrTime$1(G[PerformanceTimingNames.FETCH_START])),J=hrTimeToNanoseconds$1(timeInputToHrTime$1(G[PerformanceTimingNames.RESPONSE_END]));return G.initiatorType.toLowerCase()===(X||`xmlhttprequest`)&&G.name===z&&K>=Z&&J<=Q});return ee.length>0&&(ee=ee.filter(z=>!Y.has(z))),ee}function parseUrl(z){if(typeof URL==`function`)return new URL(z,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let G=getUrlNormalizingAnchor();return G.href=z,G}function shouldPropagateTraceHeaders(z,G){let K=G||[];return(typeof K==`string`||K instanceof RegExp)&&(K=[K]),parseUrl(z).origin===getOrigin()?!0:K.some(G=>urlMatches$2(z,G))}const PENDING_SPANS_STORAGE_KEY_PREFIX=`mxl_pending_`,MAX_PENDING_SPANS_ITEMS=10;var MXLSpanStorage=class{constructor({resource:z=emptyResource(),storage:G=window.localStorage,diag:K=diag$1.createComponentLogger({namespace:`MXLSpanStorage`}),storedSpansExpireTimeoutMS:J=3600*1e3,onExpiredSpansExport:Y,spanSessionManager:X}){_defineProperty(this,`_noExportTracer`,void 0),_defineProperty(this,`_storage`,void 0),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_onExpiredSpansExport`,void 0),_defineProperty(this,`_storedSpansExpireTimeoutMS`,void 0),_defineProperty(this,`_spanSessionManager`,void 0),_defineProperty(this,`_checkExpiredSpansInterval`,void 0),this._noExportTracer=new BasicTracerProvider({resource:z}).getTracer(`mxl-web-sdk-sessions`),this._storage=G,this._diag=K,this._storedSpansExpireTimeoutMS=J,this._onExpiredSpansExport=Y,this._spanSessionManager=X,this.startExpiredSpansCheck()}storePendingSpans(z,G,K){try{if(this.clearStoredSpans(z),this._getPendingSpansKeys().length>=MAX_PENDING_SPANS_ITEMS){this._spanSessionManager.incrSessionCountForKey(KEY_MXL_MAX_PENDING_SPANS_REACHED),this._diag.warn(`Not storing pending spans as the max number of items was reached`);return}let J=`${PENDING_SPANS_STORAGE_KEY_PREFIX}${z}_${Date.now()}`;this._storage.setItem(J,JSON.stringify([G,...K],(z,G)=>z.startsWith(`_`)?void 0:G)),this._diag.debug(`Stored pending span: ${J}`)}catch(z){this._diag.error(`Failed to store spans to storage:`,z)}}clearStoredSpans(z){try{let G=`${PENDING_SPANS_STORAGE_KEY_PREFIX}${z}_`;this._getPendingSpansKeys().forEach(z=>{z.startsWith(G)&&this._storage.removeItem(z)})}catch(z){this._diag.error(`Failed to clear stored spans from storage:`,z)}}startExpiredSpansCheck(){this._checkExpiredSpansInterval=setInterval(()=>{this.checkAndExportExpiredSpans()},300*1e3)}stopExpiredSpansCheck(){this._checkExpiredSpansInterval&&(clearInterval(this._checkExpiredSpansInterval),this._checkExpiredSpansInterval=void 0)}checkAndExportExpiredSpans(){try{let z=this._getPendingSpansKeys();if(z.length===0)return;let G=Date.now();z.forEach(z=>{let K=z.split(`_`),J=parseInt(K[K.length-1],10);if(Number.isNaN(J)&&(this._diag.error(`Found invalid timestamp in stored span:`,J),this._storage.removeItem(z)),G-J<=this._storedSpansExpireTimeoutMS)return;let Y=this._storage.getItem(z);if(Y){try{let z=[];for(let G of JSON.parse(Y)){let K=this._noExportTracer.startSpan(G.name,{kind:G.kind,attributes:G.attributes,links:G.links,startTime:G.startTime});K.setStatus(G.status),K.end(G.endTime),z.push(K)}this._onExpiredSpansExport&&z.length>0&&this._onExpiredSpansExport(z)}catch(z){this._diag.error(`Failed to process expired spans:`,z)}this._storage.removeItem(z)}})}catch(z){this._diag.error(`Failed to check and export expired spans:`,z)}}_getPendingSpansKeys(){let z=[];for(let G=0;G<this._storage.length;G++){let K=this._storage.key(G);K!=null&&K.startsWith(PENDING_SPANS_STORAGE_KEY_PREFIX)&&z.push(K)}return z}destroy(){this.stopExpiredSpansCheck()}},NamespacedStorage=class{constructor(z,G){_defineProperty(this,`_keyPrefix`,void 0),_defineProperty(this,`_storage`,void 0),this._keyPrefix=`${z}_`,this._storage=G}getNamespacedKeys(){let z=[];for(let G=0;G<this._storage.length;G++){let K=this._storage.key(G);K!=null&&K.startsWith(this._keyPrefix)&&z.push(K.substring(this._keyPrefix.length))}return z}get length(){return this.getNamespacedKeys().length}clear(){this.getNamespacedKeys().forEach(z=>{this._storage.removeItem(`${this._keyPrefix}${z}`)})}getItem(z){return this._storage.getItem(`${this._keyPrefix}${z}`)}key(z){return this.getNamespacedKeys()[z]||null}removeItem(z){this._storage.removeItem(`${this._keyPrefix}${z}`)}setItem(z,G){this._storage.setItem(`${this._keyPrefix}${z}`,G)}};const nsfConfigValidation=({diag:z,featureManager:G,registerGlobally:K,propagator:J,defaultInstrumentationConfig:Y})=>{var X;if(!G.isNetworkSpanForwardingEnabled())return!1;let Z=[];return K||Z.push("Network span forwarding cannot be used when `registerGlobally` is set to false. Turning off network span forwarding."),J&&Z.push("Network span forwarding cannot be used alongside a custom `propagator`. Turning off network span forwarding."),!(Y==null||(X=Y.omit)==null)&&X.has(`@opentelemetry/instrumentation-xml-http-request`)&&Y.omit.has(`@opentelemetry/instrumentation-fetch`)&&Z.push(`Network span forwarding cannot be used when both '@opentelemetry/instrumentation-xml-http-request' and '@opentelemetry/instrumentation-fetch' are omitted. Turning off network span forwarding.`),Z.forEach(G=>{z.warn(G)}),Z.length===0};var OTelPerformanceManager=class{constructor(z=window.performance){_defineProperty(this,`_clock`,void 0),_defineProperty(this,`epochMillisFromOriginOffset`,z=>this._clock.timeOrigin+z),_defineProperty(this,`getNowHRTime`,()=>millisToHrTime$4(this.getNowMillis())),_defineProperty(this,`getNowMillis`,()=>this.epochMillisFromOriginOffset(this._clock.now())),_defineProperty(this,`millisSinceHRTime`,z=>this.getNowMillis()-hrTimeToMilliseconds(z)),this._clock=z}};const throttle$1=(z,G=1e3)=>{let K=!1;return(...J)=>{K||(z(...J),setTimeout(()=>{K=!1},G),K=!0)}};var NoOpLogManager=class{logException(z,G){}message(z,G,K){}};const NOOP_LOG_MANAGER$1=new NoOpLogManager;var ProxyLogManager=class{constructor(){_defineProperty(this,`_delegate`,void 0)}getDelegate(){var z;return(z=this._delegate)==null?NOOP_LOG_MANAGER$1:z}setDelegate(z){this._delegate=z}logException(z,G){this.getDelegate().logException(z,G)}message(z,G,K){this.getDelegate().message(z,G,K)}};const NOOP_LOG_MANAGER=new NoOpLogManager,INTERNAL_METHODS$4=new Set([`setDelegate`,`getDelegate`]);var LogAPI=class z{static getInstance(){if(!z._instance){let G=new ProxyLogManager,K=createSafeProxy(G,NOOP_LOG_MANAGER,diag$1.createComponentLogger({namespace:`LogAPI`}),INTERNAL_METHODS$4);z._instance=Object.assign(K,{setGlobalLogManager(z){G.setDelegate(z)},getLogManager(){return G}})}return z._instance}static resetInstance(){z._instance=void 0}};_defineProperty(LogAPI,`_instance`,void 0);const log=LogAPI.getInstance();var NoOpPageManager=class{setCurrentRoute(z){}getCurrentRoute(){return null}getCurrentPageId(){return``}setPageLabel(z){}getPageLabel(){return null}clearCurrentRoute(){}};const NOOP_PAGE_MANAGER$1=new NoOpPageManager;var ProxyPageManager=class{constructor(){_defineProperty(this,`_delegate`,void 0)}getDelegate(){var z;return(z=this._delegate)==null?NOOP_PAGE_MANAGER$1:z}setDelegate(z){this._delegate=z}setCurrentRoute(z){this.getDelegate().setCurrentRoute(z)}getCurrentRoute(){return this.getDelegate().getCurrentRoute()}getCurrentPageId(){return this.getDelegate().getCurrentPageId()}setPageLabel(z){this.getDelegate().setPageLabel(z)}getPageLabel(){return this.getDelegate().getPageLabel()}clearCurrentRoute(){this.getDelegate().clearCurrentRoute()}};const NOOP_PAGE_MANAGER=new NoOpPageManager,INTERNAL_METHODS$3=new Set([`setDelegate`,`getDelegate`]);var PageAPI=class z{static getInstance(){if(!z._instance){let G=new ProxyPageManager,K=createSafeProxy(G,NOOP_PAGE_MANAGER,diag$1.createComponentLogger({namespace:`PageAPI`}),INTERNAL_METHODS$3);z._instance=Object.assign(K,{setGlobalPageManager(z){G.setDelegate(z)},getPageManager(){return G}})}return z._instance}static resetInstance(){z._instance=void 0}};_defineProperty(PageAPI,`_instance`,void 0);const page=PageAPI.getInstance();var NoOpSpanSessionManager=class{constructor(){_defineProperty(this,`getSessionId`,()=>null),_defineProperty(this,`getPreviousSessionId`,()=>null)}addBreadcrumb(z){}addProperty(z,G,K){}removeProperty(z){}endSessionSpan(){}endSessionSpanInternal(z){}currentSessionAsReadableSpan(z){return null}getSessionSpan(){return null}getSessionStartTime(){return null}startSessionSpan(){}addSessionStartedListener(z){return()=>{}}addSessionEndedListener(z){return()=>{}}};const NOOP_SPAN_SESSION_MANAGER$1=new NoOpSpanSessionManager;var ProxySpanSessionManager=class{constructor(){_defineProperty(this,`_delegate`,void 0)}getDelegate(){var z;return(z=this._delegate)==null?NOOP_SPAN_SESSION_MANAGER$1:z}setDelegate(z){this._delegate=z}addBreadcrumb(z){this.getDelegate().addBreadcrumb(z)}addProperty(z,G,K){this.getDelegate().addProperty(z,G,K)}removeProperty(z){this.getDelegate().removeProperty(z)}endSessionSpan(){this.getDelegate().endSessionSpan()}endSessionSpanInternal(z){this.getDelegate().endSessionSpanInternal(z)}currentSessionAsReadableSpan(z){return this.getDelegate().currentSessionAsReadableSpan(z)}getSessionId(){return this.getDelegate().getSessionId()}getPreviousSessionId(){return this.getDelegate().getPreviousSessionId()}getSessionSpan(){return this.getDelegate().getSessionSpan()}getSessionStartTime(){return this.getDelegate().getSessionStartTime()}startSessionSpan(z){this.getDelegate().startSessionSpan(z)}addSessionStartedListener(z){return this.getDelegate().addSessionStartedListener(z)}addSessionEndedListener(z){return this.getDelegate().addSessionEndedListener(z)}};const NOOP_SPAN_SESSION_MANAGER=new NoOpSpanSessionManager,INTERNAL_METHODS$2=new Set([`setDelegate`,`getDelegate`]);var SessionAPI=class z{static getInstance(){if(!z._instance){let G=new ProxySpanSessionManager,K=createSafeProxy(G,NOOP_SPAN_SESSION_MANAGER,diag$1.createComponentLogger({namespace:`SessionAPI`}),INTERNAL_METHODS$2);z._instance=Object.assign(K,{setGlobalSessionManager(z){G.setDelegate(z)},getSpanSessionManager(){return G}})}return z._instance}static resetInstance(){z._instance=void 0}};_defineProperty(SessionAPI,`_instance`,void 0);const session=SessionAPI.getInstance();var NonRecordingExtendedSpan=class{constructor(z=INVALID_SPAN_CONTEXT){_defineProperty(this,`_spanContext`,void 0),_defineProperty(this,`attributes`,{}),this._spanContext=z}fail(z){}spanContext(){return this._spanContext}setAttribute(z,G){return this}setAttributes(z){return this}removeAttribute(z){return this}addEvent(z,G,K){return this}addLink(z){return this}addLinks(z){return this}setStatus(z){return this}updateName(z){return this}end(z){}isRecording(){return!1}recordException(z,G){}},NoOpTraceManager=class{startSpan(z,G){return new NonRecordingExtendedSpan}setSpan(z,G){return ROOT_CONTEXT}getSpan(z){}};const NOOP_TRACE_MANAGER$1=new NoOpTraceManager;var ProxyTraceManager=class{constructor(){_defineProperty(this,`_delegate`,void 0)}getDelegate(){var z;return(z=this._delegate)==null?NOOP_TRACE_MANAGER$1:z}setDelegate(z){this._delegate=z}startSpan(z,G,K){return this.getDelegate().startSpan(z,G,K)}setSpan(z,G){return this.getDelegate().setSpan(z,G)}getSpan(z){return this.getDelegate().getSpan(z)}};const NOOP_TRACE_MANAGER=new NoOpTraceManager,INTERNAL_METHODS$1=new Set([`setDelegate`,`getDelegate`]);var TraceAPI=class z{static getInstance(){if(!z._instance){let G=new ProxyTraceManager,K=createSafeProxy(G,NOOP_TRACE_MANAGER,diag$1.createComponentLogger({namespace:`TraceAPI`}),INTERNAL_METHODS$1);z._instance=Object.assign(K,{setGlobalTraceManager(z){G.setDelegate(z)},getTraceManager(){return G}})}return z._instance}static resetInstance(){z._instance=void 0}};_defineProperty(TraceAPI,`_instance`,void 0);const trace=TraceAPI.getInstance(),KEY_ENDUSER_PSEUDO_ID=`enduser.pseudo.id`;var NoOpUserManager=class{getMXLUserId(){return``}getUserId(){return null}setUserId(){}clearUserId(){}};const NOOP_USER_MANAGER$1=new NoOpUserManager;var ProxyUserManager=class{constructor(){_defineProperty(this,`_delegate`,void 0)}getDelegate(){var z;return(z=this._delegate)==null?NOOP_USER_MANAGER$1:z}setDelegate(z){this._delegate=z}getMXLUserId(){return this.getDelegate().getMXLUserId()}getUserId(){return this.getDelegate().getUserId()}setUserId(z){this.getDelegate().setUserId(z)}clearUserId(){this.getDelegate().clearUserId()}};const NOOP_USER_MANAGER=new NoOpUserManager,INTERNAL_METHODS=new Set([`setDelegate`,`getDelegate`]);var UserAPI=class z{static getInstance(){if(!z._instance){let G=new ProxyUserManager,K=createSafeProxy(G,NOOP_USER_MANAGER,diag$1.createComponentLogger({namespace:`UserAPI`}),INTERNAL_METHODS);z._instance=Object.assign(K,{setGlobalUserManager(z){G.setDelegate(z)},getUserManager(){return G}})}return z._instance}static resetInstance(){z._instance=void 0}};_defineProperty(UserAPI,`_instance`,void 0);const user=UserAPI.getInstance();var SeverityNumber$1;(function(z){z[z.UNSPECIFIED=0]=`UNSPECIFIED`,z[z.TRACE=1]=`TRACE`,z[z.TRACE2=2]=`TRACE2`,z[z.TRACE3=3]=`TRACE3`,z[z.TRACE4=4]=`TRACE4`,z[z.DEBUG=5]=`DEBUG`,z[z.DEBUG2=6]=`DEBUG2`,z[z.DEBUG3=7]=`DEBUG3`,z[z.DEBUG4=8]=`DEBUG4`,z[z.INFO=9]=`INFO`,z[z.INFO2=10]=`INFO2`,z[z.INFO3=11]=`INFO3`,z[z.INFO4=12]=`INFO4`,z[z.WARN=13]=`WARN`,z[z.WARN2=14]=`WARN2`,z[z.WARN3=15]=`WARN3`,z[z.WARN4=16]=`WARN4`,z[z.ERROR=17]=`ERROR`,z[z.ERROR2=18]=`ERROR2`,z[z.ERROR3=19]=`ERROR3`,z[z.ERROR4=20]=`ERROR4`,z[z.FATAL=21]=`FATAL`,z[z.FATAL2=22]=`FATAL2`,z[z.FATAL3=23]=`FATAL3`,z[z.FATAL4=24]=`FATAL4`})(SeverityNumber$1||(SeverityNumber$1={}));var NoopLogger=class{emit(z){}enabled(){return!1}};const NOOP_LOGGER=new NoopLogger,GLOBAL_LOGS_API_KEY=Symbol.for(`io.opentelemetry.js.api.logs`),_global$1=globalThis;function makeGetter(z,G,K){return J=>J===z?G:K}const API_BACKWARDS_COMPATIBILITY_VERSION=1;var NoopLoggerProvider=class{getLogger(z,G,K){return new NoopLogger}};const NOOP_LOGGER_PROVIDER=new NoopLoggerProvider;var ProxyLogger=class{constructor(z,G,K,J){this._provider=z,this.name=G,this.version=K,this.options=J}emit(z){this._getLogger().emit(z)}enabled(z){return this._getLogger().enabled(z)}_getLogger(){if(this._delegate)return this._delegate;let z=this._provider._getDelegateLogger(this.name,this.version,this.options);return z?(this._delegate=z,this._delegate):NOOP_LOGGER}},ProxyLoggerProvider=class{getLogger(z,G,K){var J;return(J=this._getDelegateLogger(z,G,K))==null?new ProxyLogger(this,z,G,K):J}_getDelegate(){var z;return(z=this._delegate)==null?NOOP_LOGGER_PROVIDER:z}_setDelegate(z){this._delegate=z}_getDelegateLogger(z,G,K){var J;return(J=this._delegate)==null?void 0:J.getLogger(z,G,K)}},LogsAPI=class z{constructor(){this._proxyLoggerProvider=new ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new z),this._instance}setGlobalLoggerProvider(z){return _global$1[GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(_global$1[GLOBAL_LOGS_API_KEY]=makeGetter(API_BACKWARDS_COMPATIBILITY_VERSION,z,NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(z),z)}getLoggerProvider(){var z,G;return(G=(z=_global$1[GLOBAL_LOGS_API_KEY])==null?void 0:z.call(_global$1,API_BACKWARDS_COMPATIBILITY_VERSION))==null?this._proxyLoggerProvider:G}getLogger(z,G,K){return this.getLoggerProvider().getLogger(z,G,K)}disable(){delete _global$1[GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new ProxyLoggerProvider}};const logs=LogsAPI.getInstance();function enableInstrumentations(z,G,K,J){for(let Y=0,X=z.length;Y<X;Y++){let X=z[Y];G&&X.setTracerProvider(G),K&&X.setMeterProvider(K),J&&X.setLoggerProvider&&X.setLoggerProvider(J),X.getConfig().enabled||X.enable()}}function disableInstrumentations(z){z.forEach(z=>z.disable())}function registerInstrumentations(z){var G,K;let J=z.tracerProvider||trace$1.getTracerProvider(),Y=z.meterProvider||metrics.getMeterProvider(),X=z.loggerProvider||logs.getLoggerProvider(),Z=(G=(K=z.instrumentations)==null?void 0:K.flat())==null?[]:G;return enableInstrumentations(Z,J,Y,X),()=>{disableInstrumentations(Z)}}function ownKeys(z,G){var K=Object.keys(z);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(z);G&&(J=J.filter(function(G){return Object.getOwnPropertyDescriptor(z,G).enumerable})),K.push.apply(K,J)}return K}function _objectSpread2(z){for(var G=1;G<arguments.length;G++){var K=arguments[G]==null?{}:arguments[G];G%2?ownKeys(Object(K),!0).forEach(function(G){_defineProperty(z,G,K[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(z,Object.getOwnPropertyDescriptors(K)):ownKeys(Object(K)).forEach(function(G){Object.defineProperty(z,G,Object.getOwnPropertyDescriptor(K,G))})}return z}function safeExecuteInTheMiddle$2(z,G,K){let J,Y;try{Y=z()}catch(z){J=z}finally{if(G(J,Y),J&&!K)throw J;return Y}}function isWrapped$1(z){return typeof z==`function`&&typeof z.__original==`function`&&typeof z.__unwrap==`function`&&z.__wrapped===!0}const ATTR_HTTP_REQUEST_BODY_SIZE$2=`http.request.body.size`,ATTR_HTTP_RESPONSE_BODY_SIZE=`http.response.body.size`,ATTR_HTTP_RESPONSE_SIZE=`http.response.size`,ATTR_LOG_RECORD_UID=`log.record.uid`,ATTR_SESSION_ID$1=`session.id`,ATTR_SESSION_PREVIOUS_ID=`session.previous_id`,ATTR_USER_ID=`user.id`;var InstrumentationAbstract$2=class{constructor(z,G,K){this.instrumentationName=z,this.instrumentationVersion=G,_defineProperty(this,`_config`,{}),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_tracer`,void 0),_defineProperty(this,`_meter`,void 0),_defineProperty(this,`_logger`,void 0),this.setConfig(K),this._diag=diag$1.createComponentLogger({namespace:z}),this._tracer=trace$1.getTracer(z,G),this._meter=metrics.getMeter(z,G),this._logger=logs.getLogger(z,G),this._updateMetricInstruments()}get tracer(){return this._tracer}get meter(){return this._meter}get logger(){return this._logger}getModuleDefinitions(){var z;let G=(z=this.init())==null?[]:z;return Array.isArray(G)?G:[G]}getConfig(){return this._config}setConfig(z){this._config=_objectSpread2({enabled:!0},z)}setLoggerProvider(z){this._logger=z.getLogger(this.instrumentationName,this.instrumentationVersion)}setMeterProvider(z){this._meter=z.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}setTracerProvider(z){this._tracer=z.getTracer(this.instrumentationName,this.instrumentationVersion)}_updateMetricInstruments(){}_runSpanCustomizationHook(z,G,K,J){if(z)try{z(K,J)}catch(z){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:G},z)}}},MXLInstrumentationBase=class extends InstrumentationAbstract$2{constructor({instrumentationName:z,instrumentationVersion:G,config:K,diag:J,perf:Y}){super(z,G,K),_defineProperty(this,`_sessionManager`,void 0),_defineProperty(this,`_logManager`,void 0),_defineProperty(this,`_perf`,void 0),J&&(this._diag=J),this._perf=Y==null?new OTelPerformanceManager:Y,this._sessionManager=session.getSpanSessionManager(),this._logManager=log.getLogManager()}get sessionManager(){return this._sessionManager}get logManager(){return this._logManager}get perf(){return this._perf}init(){}setLogManager(z){this._logManager=z}setSessionManager(z){this._sessionManager=z}};let AttributeNames$2=function(z){return z.DOCUMENT_LOAD=`documentLoad`,z.DOCUMENT_FETCH=`documentFetch`,z.RESOURCE_FETCH=`resourceFetch`,z}({}),EventNames$1=function(z){return z.FIRST_PAINT=`firstPaint`,z.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`,z}({});const getPerformanceNavigationEntries=()=>{let z={},G=window.performance.getEntriesByType(`navigation`)[0];return Object.values(PerformanceTimingNames).forEach(K=>{if(hasKey(G,K)){let J=G[K];typeof J==`number`&&(z[K]=J)}}),z},performancePaintNames={"first-paint":EventNames$1.FIRST_PAINT,"first-contentful-paint":EventNames$1.FIRST_CONTENTFUL_PAINT},addSpanPerformancePaintEvents=z=>{window.performance.getEntriesByType(`paint`).forEach(({name:G,startTime:K})=>{hasKey(performancePaintNames,G)&&z.addEvent(performancePaintNames[G],K)})},ATTR_HTTP_RESPONSE_DELIVERY_TYPE=`http.response.delivery_type`,ATTR_HTTP_RESPONSE_DECODED_BODY_SIZE=`http.response.decoded_body_size`,ATTR_HTTP_REQUEST_INITIATOR_TYPE=`http.request.initiator_type`,ATTR_HTTP_REQUEST_RENDER_BLOCKING_STATUS=`http.request.render_blocking_status`,ATTR_HTTP_RESPONSE_CORS_OPAQUE=`http.response.cors_opaque`,ATTR_HTTP_RESPONSE_CACHE_REVALIDATED=`http.response.cache_revalidated`,ATTR_HTTP_REQUEST_INCOMPLETE=`http.request.incomplete`,ATTR_HTTP_REQUEST_PREVENTED=`http.request.prevented`;var DocumentLoadInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,perf:G,enabled:K,applyCustomAttributesOnSpan:J,ignorePerformancePaintEvents:Y=!1,ignoreNetworkEvents:X=!1}={}){super({instrumentationName:`DocumentLoadInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,perf:G,config:{enabled:K,applyCustomAttributesOnSpan:J,ignorePerformancePaintEvents:Y,ignoreNetworkEvents:X}}),_defineProperty(this,`_onDocumentLoaded`,void 0),_defineProperty(this,`_performanceCollected`,!1),this._onDocumentLoaded=()=>{window.setTimeout(()=>{this._collectPerformance()},0)},this._config.enabled&&this.enable()}init(){this._diag.debug(`Initializing document load instrumentation`)}_addResourcesSpans(z){performance.getEntriesByType(`resource`).forEach(G=>{this._initResourceSpan(G,z)})}_collectPerformance(){if(this._performanceCollected)return;this._performanceCollected=!0;let z=Array.from(document.getElementsByTagName(`meta`)).find(z=>z.getAttribute(`name`)===TRACE_PARENT_HEADER$1),G=getPerformanceNavigationEntries(),K=(z==null?void 0:z.content)||``;context.with(propagation.extract(ROOT_CONTEXT,{traceparent:K}),()=>{var z;let K=this._startSpan(AttributeNames$2.DOCUMENT_LOAD,PerformanceTimingNames.FETCH_START,G);K&&(context.with(trace$1.setSpan(context.active(),K),()=>{let z=this._startSpan(AttributeNames$2.DOCUMENT_FETCH,PerformanceTimingNames.FETCH_START,G);z&&(z.setAttribute(ATTR_URL_FULL,location.href),context.with(trace$1.setSpan(context.active(),z),()=>{var K;addSpanNetworkEvents(z,G,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(z,(K=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:K.documentFetch),this._endSpan(z,PerformanceTimingNames.RESPONSE_END,G)}))}),K.setAttribute(KEY_MXL_TYPE,MXL_TYPES.DocumentLoad),K.setAttribute(ATTR_URL_FULL,location.href),K.setAttribute(ATTR_USER_AGENT_ORIGINAL,navigator.userAgent),this._addResourcesSpans(K),this.getConfig().ignoreNetworkEvents||(addSpanNetworkEvent(K,PerformanceTimingNames.FETCH_START,G),addSpanNetworkEvent(K,PerformanceTimingNames.UNLOAD_EVENT_START,G),addSpanNetworkEvent(K,PerformanceTimingNames.UNLOAD_EVENT_END,G),addSpanNetworkEvent(K,PerformanceTimingNames.DOM_INTERACTIVE,G),addSpanNetworkEvent(K,PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_START,G),addSpanNetworkEvent(K,PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_END,G),addSpanNetworkEvent(K,PerformanceTimingNames.DOM_COMPLETE,G),addSpanNetworkEvent(K,PerformanceTimingNames.LOAD_EVENT_START,G),addSpanNetworkEvent(K,PerformanceTimingNames.LOAD_EVENT_END,G)),this.getConfig().ignorePerformancePaintEvents||addSpanPerformancePaintEvents(K),this._addCustomAttributesOnSpan(K,(z=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:z.documentLoad),this._endSpan(K,PerformanceTimingNames.LOAD_EVENT_END,G))})}_endSpan(z,G,K){z&&(hasKey(K,G)&&typeof K[G]==`number`?z.end(K[G]):z.end())}_initResourceSpan(z,G){var K;let J=this._startSpan(AttributeNames$2.RESOURCE_FETCH,PerformanceTimingNames.FETCH_START,z,G);J&&(J.setAttribute(KEY_MXL_TYPE,MXL_TYPES.ResourceFetch),J.setAttribute(ATTR_URL_FULL,z.name),addSpanNetworkEvents(J,z,this.getConfig().ignoreNetworkEvents),z.deliveryType&&J.setAttribute(ATTR_HTTP_RESPONSE_DELIVERY_TYPE,z.deliveryType),z.initiatorType&&J.setAttribute(ATTR_HTTP_REQUEST_INITIATOR_TYPE,z.initiatorType),z.renderBlockingStatus&&J.setAttribute(ATTR_HTTP_REQUEST_RENDER_BLOCKING_STATUS,z.renderBlockingStatus),z.responseStatus&&J.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE,z.responseStatus),typeof z.encodedBodySize==`number`&&z.encodedBodySize>=0&&J.setAttribute(ATTR_HTTP_RESPONSE_BODY_SIZE,z.encodedBodySize),typeof z.transferSize==`number`&&z.transferSize>=0&&J.setAttribute(ATTR_HTTP_RESPONSE_SIZE,z.transferSize),typeof z.decodedBodySize==`number`&&z.decodedBodySize>=0&&J.setAttribute(ATTR_HTTP_RESPONSE_DECODED_BODY_SIZE,z.decodedBodySize),this._addResourceDiagnosticAttributes(J,z),this._addCustomAttributesOnResourceSpan(J,z,(K=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:K.resourceFetch),this._endSpan(J,PerformanceTimingNames.RESPONSE_END,z))}_startSpan(z,G,K,J){if(hasKey(K,G)&&typeof K[G]==`number`)return this.tracer.startSpan(z,{startTime:K[G]},J?trace$1.setSpan(context.active(),J):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():window.addEventListener(`load`,this._onDocumentLoaded)}_addCustomAttributesOnSpan(z,G){G&&safeExecuteInTheMiddle$2(()=>{G(z)},z=>{z&&this._diag.error(`addCustomAttributesOnSpan`,z)},!0)}_addCustomAttributesOnResourceSpan(z,G,K){K&&safeExecuteInTheMiddle$2(()=>{K(z,G)},z=>{z&&this._diag.error(`addCustomAttributesOnResourceSpan`,z)},!0)}_hasNoSizeData(z){let G=typeof z.transferSize==`number`?z.transferSize:0,K=typeof z.decodedBodySize==`number`?z.decodedBodySize:0,J=typeof z.encodedBodySize==`number`?z.encodedBodySize:0;return G===0&&K===0&&J===0}_hasTimingData(z){let G=typeof z.fetchStart==`number`?z.fetchStart:0,K=typeof z.responseEnd==`number`?z.responseEnd:0;return G>0&&K>0}_isCorsRestricted(z){return this._hasNoSizeData(z)&&this._hasTimingData(z)}_isFetchIncomplete(z){let G=typeof z.fetchStart==`number`?z.fetchStart:0,K=typeof z.responseEnd==`number`?z.responseEnd:0;return this._hasNoSizeData(z)&&G>0&&K===0}_isFetchPrevented(z){let G=typeof z.fetchStart==`number`?z.fetchStart:0;return this._hasNoSizeData(z)&&G===0}_isCacheValidated(z){let G=typeof z.transferSize==`number`?z.transferSize:0,K=typeof z.deliveryType==`string`?z.deliveryType:``;return G===300&&K!==`cache`}_addResourceDiagnosticAttributes(z,G){this._isCorsRestricted(G)?z.setAttribute(ATTR_HTTP_RESPONSE_CORS_OPAQUE,!0):this._isFetchIncomplete(G)?z.setAttribute(ATTR_HTTP_REQUEST_INCOMPLETE,!0):this._isFetchPrevented(G)&&z.setAttribute(ATTR_HTTP_REQUEST_PREVENTED,!0),this._isCacheValidated(G)&&z.setAttribute(ATTR_HTTP_RESPONSE_CACHE_REVALIDATED,!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},EmptyRootInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,perf:G,rootNode:K,emptyCheckDelayMs:J=500}){super({instrumentationName:`EmptyRootInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,perf:G,config:{}}),_defineProperty(this,`_observer`,void 0),_defineProperty(this,`_emptyCheckDelayMs`,void 0),_defineProperty(this,`_rootNode`,void 0),this._rootNode=K,this._emptyCheckDelayMs=J,this._observer=new MutationObserver((z,G)=>{this._observerCallback(z)}),this._config.enabled&&this._rootNode?this.enable():this._rootNode||this._diag.warn(`supplied root node was null, this instrumentation won't be enabled`)}disable(){this._observer.disconnect()}enable(){this._rootNode&&this._observer.observe(this._rootNode,{childList:!0})}_observerCallback(z){let G=!1,K=!1;for(let J of z)J.target===this._rootNode&&(J.removedNodes.length>0&&(G=!0),J.addedNodes.length>0&&(K=!0));G&&!K&&(this._diag.debug(`root node had child nodes removed without new ones being added, checking if it's empty in ${this._emptyCheckDelayMs}ms`),window.setTimeout(()=>{this._checkForEmptyRootNode()},this._emptyCheckDelayMs))}_checkForEmptyRootNode(){var z;if(((z=this._rootNode)==null?void 0:z.childNodes.length)===0){this._diag.debug(`root node was found to be empty`);let z=this.sessionManager.getSessionSpan();z?z.addEvent(`empty-root-node`,{"mxl.type":`ux.empty_root_node`}):this._diag.debug(`no active session found to emit event on`)}}};const MAX_INNER_TEXT=30,getHTMLElementFriendlyName=(z,G)=>{let K=z.nodeName.toLowerCase(),J=G.substring(0,MAX_INNER_TEXT),Y=G.length>MAX_INNER_TEXT?`...`:``;return`<${K}${z.className?` class="${z.className}"`:``}>${J}${Y}</${K}>`};var ClicksInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,perf:G,shouldTrack:K,innerTextForElement:J}={}){super({instrumentationName:`ClicksInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,perf:G,config:{}}),_defineProperty(this,`_onClickHandler`,void 0),this._onClickHandler=z=>{let G=z.target;if(G instanceof HTMLElement&&!G.hasAttribute(`disabled`)&&!(K&&!K(G)))try{let K=this.sessionManager.getSessionSpan();K&&K.addEvent(`click`,{"mxl.type":`ux.tap`,"view.name":getHTMLElementFriendlyName(G,J?J(G):G.innerText),"tap.coords":`${z.x.toString()},${z.y.toString()}`},this.perf.epochMillisFromOriginOffset(z.timeStamp))}catch(z){this._diag.error(`failed to create new user interaction span event`,z)}},this._config.enabled&&this.enable()}disable(){document.removeEventListener(`click`,this._onClickHandler)}enable(){document.addEventListener(`click`,this._onClickHandler)}},GlobalExceptionInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,perf:G}={}){super({instrumentationName:`GlobalExceptionInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,perf:G,config:{}}),_defineProperty(this,`_onErrorHandler`,void 0),_defineProperty(this,`_onUnhandledRejectionHandler`,void 0),this._onErrorHandler=z=>{this.logManager.logException(z.error||z.message,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(z.timeStamp),handler:`global_exception`})},this._onUnhandledRejectionHandler=z=>{this.logManager.logException(z.reason,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(z.timeStamp),handler:`promise_rejection`})},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`error`,this._onErrorHandler),window.removeEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}enable(){window.addEventListener(`error`,this._onErrorHandler),window.addEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}};let logger$1=console.error.bind(console);function defineProperty$1(z,G,K){let J=!!z[G]&&Object.prototype.propertyIsEnumerable.call(z,G);Object.defineProperty(z,G,{configurable:!0,enumerable:J,writable:!0,value:K})}const wrap$1=(z,G,K)=>{if(!z||!z[G]){logger$1(`no original function `+String(G)+` to wrap`);return}if(!K){logger$1(`no wrapper function`),logger$1(Error().stack);return}let J=z[G];if(typeof J!=`function`||typeof K!=`function`){logger$1(`original object and wrapper must be functions`);return}let Y=K(J,G);return defineProperty$1(Y,`__original`,J),defineProperty$1(Y,`__unwrap`,()=>{z[G]===Y&&defineProperty$1(z,G,J)}),defineProperty$1(Y,`__wrapped`,!0),defineProperty$1(z,G,Y),Y},massWrap$1=(z,G,K)=>{if(z)Array.isArray(z)||(z=[z]);else{logger$1(`must provide one or more modules to patch`),logger$1(Error().stack);return}if(!(G&&Array.isArray(G))){logger$1(`must provide one or more functions to wrap on modules`);return}z.forEach(z=>{G.forEach(G=>{wrap$1(z,G,K)})})},unwrap$1=(z,G)=>{if(!z||!z[G]){logger$1(`no function to unwrap.`),logger$1(Error().stack);return}let K=z[G];if(!K.__unwrap)logger$1(`no original to unwrap to -- has `+String(G)+` already been unwrapped?`);else{K.__unwrap();return}},massUnwrap$1=(z,G)=>{if(z)Array.isArray(z)||(z=[z]);else{logger$1(`must provide one or more modules to patch`),logger$1(Error().stack);return}if(!(G&&Array.isArray(G))){logger$1(`must provide one or more functions to unwrap on modules`);return}z.forEach(z=>{G.forEach(G=>{unwrap$1(z,G)})})};function shimmer$1(z){z&&z.logger&&(typeof z.logger==`function`?logger$1=z.logger:logger$1(`new logger isn't a function, not replacing`))}shimmer$1.wrap=wrap$1,shimmer$1.massWrap=massWrap$1,shimmer$1.unwrap=unwrap$1,shimmer$1.massUnwrap=massUnwrap$1;var InstrumentationAbstract$1=class{constructor(z,G,K){_defineProperty(this,`_config`,{}),_defineProperty(this,`_tracer`,void 0),_defineProperty(this,`_meter`,void 0),_defineProperty(this,`_logger`,void 0),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`instrumentationName`,void 0),_defineProperty(this,`instrumentationVersion`,void 0),_defineProperty(this,`_wrap`,wrap$1),_defineProperty(this,`_unwrap`,unwrap$1),_defineProperty(this,`_massWrap`,massWrap$1),_defineProperty(this,`_massUnwrap`,massUnwrap$1),this.instrumentationName=z,this.instrumentationVersion=G,this.setConfig(K),this._diag=diag$1.createComponentLogger({namespace:z}),this._tracer=trace$1.getTracer(z,G),this._meter=metrics.getMeter(z,G),this._logger=logs.getLogger(z,G),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(z){this._meter=z.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(z){this._logger=z.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var z;let G=(z=this.init())==null?[]:z;return Array.isArray(G)?G:[G]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(z){this._config=_objectSpread2({enabled:!0},z)}setTracerProvider(z){this._tracer=z.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(z,G,K,J){if(z)try{z(K,J)}catch(z){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:G},z)}}},InstrumentationBase$1=class extends InstrumentationAbstract$1{constructor(z,G,K){super(z,G,K),this._config.enabled&&this.enable()}};function safeExecuteInTheMiddle$1(z,G,K){let J,Y;try{Y=z()}catch(z){J=z}finally{if(G(J,Y),J&&!K)throw J;return Y}}var SemconvStability$1;(function(z){z[z.STABLE=1]=`STABLE`,z[z.OLD=2]=`OLD`,z[z.DUPLICATE=3]=`DUPLICATE`})(SemconvStability$1||(SemconvStability$1={}));function semconvStabilityFromStr$1(z,G){let K=SemconvStability$1.OLD,J=G==null?void 0:G.split(`,`).map(z=>z.trim()).filter(z=>z!==``);for(let G of J==null?[]:J)if(G.toLowerCase()===z+`/dup`){K=SemconvStability$1.DUPLICATE;break}else G.toLowerCase()===z&&(K=SemconvStability$1.STABLE);return K}function getStringListFromEnv$1(z){}const otperformance$2=performance,NANOSECOND_DIGITS$2=9,MILLISECONDS_TO_NANOSECONDS$2=Math.pow(10,6),SECOND_TO_NANOSECONDS$3=Math.pow(10,NANOSECOND_DIGITS$2);function millisToHrTime$2(z){let G=z/1e3;return[Math.trunc(G),Math.round(z%1e3*MILLISECONDS_TO_NANOSECONDS$2)]}function hrTime$2(z){return addHrTimes$2(millisToHrTime$2(otperformance$2.timeOrigin),millisToHrTime$2(typeof z==`number`?z:otperformance$2.now()))}function addHrTimes$2(z,G){let K=[z[0]+G[0],z[1]+G[1]];return K[1]>=SECOND_TO_NANOSECONDS$3&&(K[1]-=SECOND_TO_NANOSECONDS$3,K[0]+=1),K}function urlMatches$1(z,G){return typeof G==`string`?z===G:!!z.match(G)}function isUrlIgnored$1(z,G){if(!G)return!1;for(let K of G)if(urlMatches$1(z,K))return!0;return!1}var AttributeNames$1;(function(z){z.COMPONENT=`component`,z.HTTP_STATUS_TEXT=`http.status_text`})(AttributeNames$1||(AttributeNames$1={}));const ATTR_HTTP_HOST$1=`http.host`,ATTR_HTTP_METHOD$1=`http.method`,ATTR_HTTP_REQUEST_BODY_SIZE$1=`http.request.body.size`,ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED$1=`http.request_content_length_uncompressed`,ATTR_HTTP_SCHEME$1=`http.scheme`,ATTR_HTTP_STATUS_CODE$1=`http.status_code`,ATTR_HTTP_URL$1=`http.url`,ATTR_HTTP_USER_AGENT$1=`http.user_agent`,DIAG_LOGGER$1=diag$1.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function getFetchBodyLength(...z){if(z[0]instanceof URL||typeof z[0]==`string`){let G=z[1];if(!(G!=null&&G.body))return Promise.resolve();if(G.body instanceof ReadableStream){let{body:z,length:K}=_getBodyNonDestructively(G.body);return G.body=z,K}else return Promise.resolve(getXHRBodyLength$1(G.body))}else{let G=z[0];return G!=null&&G.body?G.clone().text().then(z=>getByteLength$1(z)):Promise.resolve()}}function _getBodyNonDestructively(z){if(!z.pipeThrough)return DIAG_LOGGER$1.warn(`Platform has ReadableStream but not pipeThrough!`),{body:z,length:Promise.resolve(void 0)};let G=0,K,J=new Promise(z=>{K=z}),Y=new TransformStream({start(){},transform(z,K){return _asyncToGenerator(function*(){let J=yield z;G+=J.byteLength,K.enqueue(z)})()},flush(){K(G)}});return{body:z.pipeThrough(Y),length:J}}function isDocument$1(z){return typeof Document<`u`&&z instanceof Document}function getXHRBodyLength$1(z){if(isDocument$1(z))return new XMLSerializer().serializeToString(document).length;if(typeof z==`string`)return getByteLength$1(z);if(z instanceof Blob)return z.size;if(z instanceof FormData)return getFormDataSize$1(z);if(z instanceof URLSearchParams)return getByteLength$1(z.toString());if(z.byteLength!==void 0)return z.byteLength;DIAG_LOGGER$1.warn(`unknown body type`)}const TEXT_ENCODER$1=new TextEncoder;function getByteLength$1(z){return TEXT_ENCODER$1.encode(z).byteLength}function getFormDataSize$1(z){let G=0;for(let[K,J]of z.entries())G+=K.length,J instanceof Blob?G+=J.size:G+=J.length;return G}function normalizeHttpRequestMethod$1(z){let G=getKnownMethods$1(),K=z.toUpperCase();return K in G?K:`_OTHER`}const DEFAULT_KNOWN_METHODS$1={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let knownMethods$1;function getKnownMethods$1(){if(knownMethods$1===void 0){let z;knownMethods$1=DEFAULT_KNOWN_METHODS$1}return knownMethods$1}const HTTP_PORT_FROM_PROTOCOL$1={"https:":`443`,"http:":`80`};function serverPortFromUrl$1(z){let G=Number(z.port||HTTP_PORT_FROM_PROTOCOL$1[z.protocol]);if(G&&!isNaN(G))return G}const VERSION$5=`0.215.0`,OBSERVER_WAIT_TIME_MS$1=300,hasBrowserPerformanceAPI=typeof PerformanceObserver<`u`;var FetchInstrumentation=class extends InstrumentationBase$1{constructor(z={}){super(`@opentelemetry/instrumentation-fetch`,VERSION$5,z),_defineProperty(this,`component`,`fetch`),_defineProperty(this,`version`,VERSION$5),_defineProperty(this,`moduleName`,this.component),_defineProperty(this,`_usedResources`,new WeakSet),_defineProperty(this,`_tasksCount`,0),_defineProperty(this,`_semconvStability`,void 0),this._semconvStability=semconvStabilityFromStr$1(`http`,z==null?void 0:z.semconvStabilityOptIn)}init(){}_addChildSpan(z,G){let K=this.tracer.startSpan(`CORS Preflight`,{startTime:G[PerformanceTimingNames.FETCH_START]},trace$1.setSpan(context.active(),z)),J=!(this._semconvStability&SemconvStability$1.OLD);addSpanNetworkEvents(K,G,this.getConfig().ignoreNetworkEvents,void 0,J),K.end(G[PerformanceTimingNames.RESPONSE_END])}_addFinalSpanAttributes(z,G){let K=parseUrl(G.url);if(this._semconvStability&SemconvStability$1.OLD&&(z.setAttribute(ATTR_HTTP_STATUS_CODE$1,G.status),G.statusText!=null&&z.setAttribute(AttributeNames$1.HTTP_STATUS_TEXT,G.statusText),z.setAttribute(ATTR_HTTP_HOST$1,K.host),z.setAttribute(ATTR_HTTP_SCHEME$1,K.protocol.replace(`:`,``)),typeof navigator<`u`&&z.setAttribute(ATTR_HTTP_USER_AGENT$1,navigator.userAgent)),this._semconvStability&SemconvStability$1.STABLE){z.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE,G.status),z.setAttribute(ATTR_SERVER_ADDRESS,K.hostname);let J=serverPortFromUrl$1(K);J&&z.setAttribute(ATTR_SERVER_PORT,J)}}_addHeaders(z,G){if(!shouldPropagateTraceHeaders(G,this.getConfig().propagateTraceHeaderCorsUrls)){let z={};propagation.inject(context.active(),z),Object.keys(z).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(z instanceof Request)propagation.inject(context.active(),z.headers,{set:(z,G,K)=>z.set(G,typeof K==`string`?K:String(K))});else{let G=new Headers(z.headers);propagation.inject(context.active(),G,{set:(z,G,K)=>z.set(G,typeof K==`string`?K:String(K))}),z.headers=G}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(z,G={}){if(isUrlIgnored$1(z,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let K=``,J={};if(this._semconvStability&SemconvStability$1.OLD){let Y=(G.method||`GET`).toUpperCase();K=`HTTP ${Y}`,J[AttributeNames$1.COMPONENT]=this.moduleName,J[ATTR_HTTP_METHOD$1]=Y,J[ATTR_HTTP_URL$1]=z}if(this._semconvStability&SemconvStability$1.STABLE){let Y=G.method,X=normalizeHttpRequestMethod$1(G.method||`GET`);K||(K=X),J[ATTR_HTTP_REQUEST_METHOD]=X,X!==Y&&(J[ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=Y),J[ATTR_URL_FULL]=z}return this.tracer.startSpan(K,{kind:SpanKind.CLIENT,attributes:J})}_findResourceAndAddNetworkEvents(z,G,K){let J=G.entries;if(!J.length){if(!performance.getEntriesByType)return;J=performance.getEntriesByType(`resource`)}let Y=getResource(G.spanUrl,G.startTime,K,J,this._usedResources,`fetch`);if(Y.mainRequest){let G=Y.mainRequest;this._markResourceAsUsed(G);let K=Y.corsPreFlightRequest;K&&(this._addChildSpan(z,K),this._markResourceAsUsed(K));let J=!(this._semconvStability&SemconvStability$1.OLD);addSpanNetworkEvents(z,G,this.getConfig().ignoreNetworkEvents,void 0,J)}}_markResourceAsUsed(z){this._usedResources.add(z)}_endSpan(z,G,K){let J=millisToHrTime$2(Date.now()),Y=hrTime$2();this._addFinalSpanAttributes(z,K),this._semconvStability&SemconvStability$1.STABLE&&K.status>=400&&(z.setStatus({code:SpanStatusCode.ERROR}),z.setAttribute(ATTR_ERROR_TYPE,String(K.status))),setTimeout(()=>{var K;(K=G.observer)==null||K.disconnect(),this._findResourceAndAddNetworkEvents(z,G,Y),this._tasksCount--,this._clearResources(),z.end(J)},OBSERVER_WAIT_TIME_MS$1)}_patchConstructor(){return z=>{let G=this;return function(...K){if(!G._isEnabled)return z.apply(this,K);let J=this,Y=parseUrl(K[0]instanceof Request?K[0].url:String(K[0])).href,X;X=K[0]instanceof Request?K[1]==null?K[0]:new Request(K[0],K[1]):K[1]||{};let Z=G._createSpan(Y,X);if(!Z)return z.apply(this,K);let Q=G._prepareSpanData(Y);G.getConfig().measureRequestSize&&getFetchBodyLength(...K).then(z=>{z&&(G._semconvStability&SemconvStability$1.OLD&&Z.setAttribute(ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED$1,z),G._semconvStability&SemconvStability$1.STABLE&&Z.setAttribute(ATTR_HTTP_REQUEST_BODY_SIZE$1,z))}).catch(z=>{G._diag.warn(`getFetchBodyLength`,z)});function ee(z,K){G._applyAttributesAfterFetch(z,X,K),G._endSpan(z,Q,{status:K.status||0,statusText:K.message,url:Y})}function te(z,K){G._applyAttributesAfterFetch(z,X,K),K.status>=200&&K.status<400?G._endSpan(z,Q,K):G._endSpan(z,Q,{status:K.status,statusText:K.statusText,url:Y})}function ne(z,K){try{let G=K.clone().body;if(G){let J=G.getReader(),Y=()=>{J.read().then(({done:G})=>{G?te(z,K):Y()},G=>{ee(z,G)})};Y()}else te(z,K)}catch(K){G._diag.error(`Failed to read fetch response body`,K),G._endSpan(z,Q,{status:0,url:Y})}return K}function ie(z,K){try{ee(z,K)}catch(J){G._diag.error(`Failed to end span on fetch error`,J),G._endSpan(z,Q,{status:K.status||0,url:Y})}throw K}return context.with(trace$1.setSpan(context.active(),Z),()=>(G._callRequestHook(Z,X),G._addHeaders(X,Y),G._tasksCount++,z.apply(J,X instanceof Request?[X]:[Y,X]).then(ne.bind(J,Z),ie.bind(J,Z))))}}}_applyAttributesAfterFetch(z,G,K){let J=this.getConfig().applyCustomAttributesOnSpan;J&&safeExecuteInTheMiddle$1(()=>J(z,G,K),z=>{z&&this._diag.error(`applyCustomAttributesOnSpan`,z)},!0)}_callRequestHook(z,G){let K=this.getConfig().requestHook;K&&safeExecuteInTheMiddle$1(()=>K(z,G),z=>{z&&this._diag.error(`requestHook`,z)},!0)}_prepareSpanData(z){let G=hrTime$2(),K=[];if(typeof PerformanceObserver!=`function`)return{entries:K,startTime:G,spanUrl:z};let J=new PerformanceObserver(G=>{G.getEntries().forEach(G=>{G.initiatorType===`fetch`&&G.name===z&&K.push(G)})});return J.observe({entryTypes:[`resource`]}),{entries:K,observer:J,startTime:G,spanUrl:z}}enable(){if(!hasBrowserPerformanceAPI){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isEnabled=!0,this._isFetchPatched){this._diag.debug(`fetch constructor already patched`);return}this._isFetchPatched=!0,this._wrap(globalThis,`fetch`,this._patchConstructor())}}disable(){hasBrowserPerformanceAPI&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}};function _objectWithoutPropertiesLoose(z,G){if(z==null)return{};var K={};for(var J in z)if({}.hasOwnProperty.call(z,J)){if(G.includes(J))continue;K[J]=z[J]}return K}function _objectWithoutProperties(z,G){if(z==null)return{};var K,J,Y=_objectWithoutPropertiesLoose(z,G);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(z);for(J=0;J<X.length;J++)K=X[J],G.includes(K)||{}.propertyIsEnumerable.call(z,K)&&(Y[K]=z[K])}return Y}const _excluded$2=[`omitIfAlreadyPatched`];var MXLFetchInstrumentation=class extends FetchInstrumentation{constructor(z={}){let{omitIfAlreadyPatched:G}=z,K=_objectWithoutProperties(z,_excluded$2);super(_objectSpread2(_objectSpread2({},K),{},{enabled:!1})),_defineProperty(this,`_omitIfAlreadyPatched`,void 0),this._omitIfAlreadyPatched=G,K.enabled&&this.enable()}enable(){if(this._omitIfAlreadyPatched&&isWrapped$1(fetch)){this._diag.debug("fetch is already passed and `omitIfAlreadyPatched` is true, skipping enabling this instrumentation");return}super.enable()}};const PATH_OPTIONS_RE=/\([^()]+\)/g;var NavigationInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,shouldCleanupPathOptionsFromRouteName:G=!0}){super({instrumentationName:`NavigationInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,config:{}}),_defineProperty(this,`_shouldCleanupPathOptionsFromRouteName`,!0),_defineProperty(this,`_currentRouteSpan`,null),_defineProperty(this,`_instrumentationType`,MXL_NAVIGATION_INSTRUMENTATIONS.Manual),_defineProperty(this,`_removeSessionStartedFn`,null),_defineProperty(this,`_removeSessionEndedFn`,null),_defineProperty(this,`setInstrumentationType`,z=>{this._instrumentationType=z}),_defineProperty(this,`setCurrentRoute`,z=>{if(!this._config.enabled)return;let G=page.getCurrentRoute();z.url!==(G==null?void 0:G.url)&&(page.setCurrentRoute(z),this._endRouteSpan(G),this._startRouteSpan(z))}),_defineProperty(this,`_setupSessionListeners`,()=>{this._removeSessionStartedFn||(this._removeSessionStartedFn=this.sessionManager.addSessionStartedListener(()=>{let z=page.getCurrentRoute();z&&!this._currentRouteSpan&&(this._diag.debug(`Session started, starting route span.`),this._startRouteSpan(z))})),this._removeSessionEndedFn||(this._removeSessionEndedFn=this.sessionManager.addSessionEndedListener(()=>{this._currentRouteSpan&&(this._diag.debug(`Session ended, ending route span.`),this._endRouteSpan(page.getCurrentRoute()))}))}),_defineProperty(this,`_cleanUpSessionListeners`,()=>{this._removeSessionStartedFn&&(this._removeSessionStartedFn(),this._removeSessionStartedFn=null),this._removeSessionEndedFn&&(this._removeSessionEndedFn(),this._removeSessionEndedFn=null)}),_defineProperty(this,`_startRouteSpan`,z=>{this._diag.debug(`Starting route span for url: ${z.url}`),this._setupSessionListeners();let G=this._shouldCleanupPathOptionsFromRouteName?z.path.replace(PATH_OPTIONS_RE,``):z.path;return this._currentRouteSpan=this.tracer.startSpan(G,{attributes:{[KEY_MXL_TYPE]:MXL_TYPES.Surface,[KEY_MXL_PAGE_PATH]:G,[KEY_MXL_PAGE_ID]:page.getCurrentPageId()||void 0}}),this._currentRouteSpan.setAttribute(KEY_MXL_INSTRUMENTATION,this._instrumentationType),this._currentRouteSpan}),_defineProperty(this,`_endRouteSpan`,z=>{this._currentRouteSpan&&(z&&this._diag.debug(`Ending route span for url: ${z.url}`),this._currentRouteSpan.end(),this._currentRouteSpan=null)}),_defineProperty(this,`enable`,()=>{this.setConfig({enabled:!0}),this._diag.debug(`NavigationInstrumentation enabled, listening for navigation events.`)}),_defineProperty(this,`disable`,()=>{this._cleanUpSessionListeners(),this.setConfig({enabled:!1}),this._diag.debug(`NavigationInstrumentation disabled, stopped listening for navigation events.`)}),this._shouldCleanupPathOptionsFromRouteName=G,this._config.enabled&&this.enable()}};let navigationInstrumentation;const getNavigationInstrumentation=(z={})=>(navigationInstrumentation||(navigationInstrumentation=new NavigationInstrumentation(z)),navigationInstrumentation),DEFAULT_CONFIG={samplingPct:100,networkSpansForwardingThreshold:0},LOCAL_STORAGE_REMOTE_CONFIG_KEY=`mxl_remote_config`,getConfigURL=(z,{osVersion:G,appVersion:K,deviceId:J},Y)=>`${Y||`https://mxl-basket.apps.ocpthikadev01.safaricom.net`}/config?appId=${z}&osVersion=${G}&appVersion=${K}&deviceId=${J}`,parseRemoteConfig=z=>{let G={samplingPct:z.threshold};return z.network_span_forwarding!==void 0&&(G.networkSpansForwardingThreshold=z.network_span_forwarding.pct_enabled),z.empty_session_avoidance_enabled_pct!==void 0&&(G.emptySessionAvoidanceEnabledPct=z.empty_session_avoidance_enabled_pct),G};var MXLDynamicConfigManager=class{constructor({appID:z,appVersion:G,deviceId:K,diag:J=diag$1.createComponentLogger({namespace:`mxl-config-manager`}),storage:Y=window.localStorage,defaultConfig:X={},mxlConfigURL:Z}={}){_defineProperty(this,`_remoteConfigURL`,null),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_storage`,void 0),_defineProperty(this,`_sdkConfig`,void 0),_defineProperty(this,`_etag`,null),z&&G&&K&&(this._remoteConfigURL=getConfigURL(z,{appVersion:G,deviceId:K,osVersion:`1`},Z)),this._diag=J,this._storage=Y;let Q=this._getRemoteConfigFromStorage();Q&&(this._etag=Q.etag),this._sdkConfig=_objectSpread2(_objectSpread2(_objectSpread2({},DEFAULT_CONFIG),X),Q?parseRemoteConfig(Q.config):{})}setConfig(z){this._sdkConfig=_objectSpread2(_objectSpread2({},this._sdkConfig),z)}getConfig(){return this._sdkConfig}refreshRemoteConfig(){var z=this;return _asyncToGenerator(function*(){if(z._remoteConfigURL)try{let G=yield z._fetchRemoteConfig(z._remoteConfigURL);if(!G){z._diag.debug(`No changes in remote config, skipping update`);return}let[K,J]=G;z._storage.setItem(LOCAL_STORAGE_REMOTE_CONFIG_KEY,JSON.stringify({config:K,etag:J})),z._sdkConfig=parseRemoteConfig(K),z._etag=J}catch(G){z._diag.warn(`Failed to refresh remote config: ${G instanceof Error?G.message:String(G)}`)}})()}_getRemoteConfigFromStorage(){try{let z=this._storage.getItem(LOCAL_STORAGE_REMOTE_CONFIG_KEY);return z?JSON.parse(z):null}catch(z){return this._diag.warn(`Failed to parse remote config from storage: ${z instanceof Error?z.message:String(z)}`),null}}_fetchRemoteConfig(z){var G=this;return _asyncToGenerator(function*(){let K=yield fetch(z,{headers:G._etag?{"If-None-Match":G._etag}:{}}),J=K.headers.get(`etag`);return K.status===304?null:K.ok?[yield K.json(),J]:(G._diag.warn(`Failed to fetch remote config from ${z}: ${K.statusText}`),null)})()}};const DEFAULT_MAX_LOG_ATTRIBUTES=50,DEFAULT_LIMITS={maxAllowed:{error_log:500,warning_log:200,info_log:100,exception:500,breadcrumb:100,session_property:100,span:1e3,network_request:1e4},maxLength:{error_log:128,warning_log:128,info_log:128,exception:1024,breadcrumb:256,session_property_key:128,session_property_value:256,log_attribute_key:128,log_attribute_value:256,exception_attribute_key:128,exception_attribute_value:256},maxAttributes:{error_log:DEFAULT_MAX_LOG_ATTRIBUTES,warning_log:DEFAULT_MAX_LOG_ATTRIBUTES,info_log:DEFAULT_MAX_LOG_ATTRIBUTES,exception:DEFAULT_MAX_LOG_ATTRIBUTES}},LogSeverityToLimitType={info:`info_log`,warning:`warning_log`,error:`error_log`};var MXLLimitManager=class{constructor({diag:z,maxAllowed:G,maxLength:K,maxAttributes:J}){_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_diagnosticCounts`,{}),_defineProperty(this,`_currentCount`,{exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0}),_defineProperty(this,`_maxAllowed`,void 0),_defineProperty(this,`_maxLength`,void 0),_defineProperty(this,`_maxAttributes`,void 0),this._diag=z==null?diag$1.createComponentLogger({namespace:`MXLLimitManager`}):z,this._maxAllowed=G,this._maxLength=K,this._maxAttributes=J}_dropIfMaxReached(z){return this._currentCount[z]>=this._maxAllowed[z]?(this._diag.warn(`disallowing ${z} because the maximum number of ${this._maxAllowed[z].toString()} has already been reached for this session`),this._incrDiagnosticCount(z,`drop`),!0):(this._currentCount[z]=(this._currentCount[z]||0)+1,!1)}truncateString(z,G){return G.length>this._maxLength[z]?(this._diag.warn(`truncating ${z} because it is longer than ${this._maxLength[z].toString()} characters: "${G}"`),this._incrDiagnosticCount(z,`truncate_string`),G.substring(0,this._maxLength[z])):G}_truncateAttributes(z,G,K,J){let Y=Object.keys(G);Y.length>this._maxAttributes[z]&&(this._diag.warn(`truncating ${z} attributes because there are more than ${this._maxAttributes[z].toString()} set`),this._incrDiagnosticCount(z,`truncate_attributes`));let X={};for(let Q=0;Q<Math.min(Y.length,this._maxAttributes[z]);Q++){var Z;let z=this.truncateString(K,Y[Q]);X[z]=this.truncateString(J,((Z=G[Y[Q]])==null?void 0:Z.toString())||``)}return X}limitBreadcrumb(z){return this._dropIfMaxReached(`breadcrumb`)?`dropped`:{name:this.truncateString(`breadcrumb`,z)}}limitException(z,G){return this._dropIfMaxReached(`exception`)?`dropped`:{message:this.truncateString(`exception`,z),attributes:this._truncateAttributes(`exception`,G,`exception_attribute_key`,`exception_attribute_value`)}}limitLog(z,G,K){let J=LogSeverityToLimitType[G];return this._dropIfMaxReached(J)?`dropped`:{message:this.truncateString(J,z),attributes:this._truncateAttributes(J,K,`log_attribute_key`,`log_attribute_value`)}}limitSessionProperty(z,G){return this._dropIfMaxReached(`session_property`)?`dropped`:{key:this.truncateString(`session_property_key`,z),value:this.truncateString(`session_property_value`,G)}}dropReadableSpan(z){let G=z.attributes[KEY_MXL_TYPE]===MXL_TYPES.Network?`network_request`:`span`;return this._dropIfMaxReached(G)}reset(){this._diagnosticCounts={},this._currentCount={exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0}}_incrDiagnosticCount(z,G){let K=`mxl.app.applied_limit.${z}.${G}.count`;this._diagnosticCounts[K]=(this._diagnosticCounts[K]||0)+1}getDiagnosticCounts(){return this._diagnosticCounts}};const MXL_EXCEPTION_NUMBER_STORAGE_KEY=`mxl_exception_number`,getJSFileBundleIDs=()=>JSON.stringify(GLOBAL_CONFIG._MXLFileBundleIDs||{});var MXLLogManager=class z{constructor({diag:z,perf:G,spanSessionManager:K,limitManager:J,loggerProvider:Y,visibilityDoc:X=window.document,storage:Z=window.localStorage}){_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_perf`,void 0),_defineProperty(this,`_logger`,void 0),_defineProperty(this,`_spanSessionManager`,void 0),_defineProperty(this,`_limitManager`,void 0),_defineProperty(this,`_visibilityDoc`,void 0),_defineProperty(this,`_storage`,void 0);let Q=Y==null?logs:Y;this._diag=z==null?diag$1.createComponentLogger({namespace:`MXLLogManager`}):z,this._perf=G==null?new OTelPerformanceManager:G,this._logger=Q.getLogger(`mxl-web-sdk-logs`),this._spanSessionManager=K,this._limitManager=J,this._visibilityDoc=X,this._storage=Z}_validateAttributes(z){return Object.prototype.toString.call(z)===`[object Object]`?z:(this._diag.warn(`attributes must be a plain object`,z),{})}static _logSeverityToSeverityNumber(z){switch(z){case`info`:return SeverityNumber$1.INFO;case`warning`:return SeverityNumber$1.WARN;default:return SeverityNumber$1.ERROR}}logException(G,{handled:K=!0,attributes:J={},timestamp:Y=this._perf.getNowMillis(),handler:X=`manual`}={}){var Z;let Q=this._validateAttributes(J);K||this._spanSessionManager.incrSessionCountForKey(KEY_MXL_UNHANDLED_EXCEPTIONS_COUNT);let ee=(G==null||(Z=G.constructor)==null?void 0:Z.name)||typeof G,te=``,ne=ee,ie=``,ae=``;if(G instanceof Error)te=String(G.message||``).trim(),ne=G.name||``,ie=G.stack||``,ae=G.cause?`present`:``;else if(G&&typeof G==`object`)try{te=JSON.stringify(G)}catch(z){te=String(G).trim()}else te=String(G).trim();let oe=this._limitManager.limitException(te,Q);oe!==`dropped`&&this._logger.emit({timestamp:Y,severityNumber:SeverityNumber$1.ERROR,severityText:`ERROR`,body:oe.message,attributes:_objectSpread2(_objectSpread2({},oe.attributes),{},{[KEY_MXL_TYPE]:MXL_TYPES.SystemException,[KEY_MXL_EXCEPTION_HANDLING]:z._exceptionHandlingType(K,X),[KEY_MXL_EXCEPTION_CAUSE]:ae,[ATTR_EXCEPTION_TYPE]:ee,"exception.name":ne,[ATTR_EXCEPTION_MESSAGE]:oe.message,[ATTR_EXCEPTION_STACKTRACE]:ie,[KEY_MXL_JS_FILE_BUNDLE_IDS]:getJSFileBundleIDs(),[KEY_MXL_STATE]:getVisibilityState(this._visibilityDoc),[KEY_MXL_EXCEPTION_NUMBER]:getIncrementedCount(this._storage,MXL_EXCEPTION_NUMBER_STORAGE_KEY,this._diag)})})}message(z,G,{attributes:K={},includeStacktrace:J=!0,stacktrace:Y}={}){if(typeof z!=`string`||!z.trim()){this._diag.warn(`Message must be a non-empty string`);return}if(![`info`,`warning`,`error`].includes(G)){this._diag.warn(`Severity must be info, warning, or error`);return}let X=this._validateAttributes(K);G===`error`&&this._spanSessionManager.incrSessionCountForKey(KEY_MXL_ERROR_LOG_COUNT);let Z=``;G!==`info`&&(typeof Y==`string`?Z=Y:J&&(Z=Error().stack||``)),this._logMessage({message:z.trim(),severity:G,timestamp:this._perf.getNowMillis(),attributes:X,stack:Z})}_logMessage({message:G,severity:K,timestamp:J,attributes:Y={},stack:X}){let Z=this._limitManager.limitLog(G,K,Y);Z!==`dropped`&&this._logger.emit({timestamp:J,severityNumber:z._logSeverityToSeverityNumber(K),severityText:K.toUpperCase(),body:Z.message,attributes:_objectSpread2(_objectSpread2(_objectSpread2({},Z.attributes),{},{[KEY_MXL_TYPE]:MXL_TYPES.SystemLog},X?{[KEY_MXL_JS_EXCEPTION_STACKTRACE]:X,[KEY_MXL_JS_FILE_BUNDLE_IDS]:getJSFileBundleIDs()}:{}),{},{[KEY_MXL_STATE]:getVisibilityState(this._visibilityDoc)})})}static _exceptionHandlingType(z,G){return z?`handled`:G===`global_exception`?`unhandled_error`:G===`promise_rejection`?`unhandled_rejection`:`unhandled`}},MXLPageManager=class{constructor({useDocumentTitleAsPageLabel:z=!0,titleDocument:G=window.document}={}){_defineProperty(this,`_currentRoute`,null),_defineProperty(this,`_currentPageId`,null),_defineProperty(this,`_pageLabel`,null),_defineProperty(this,`_titleDocument`,void 0),_defineProperty(this,`_useDocumentTitleAsPageLabel`,void 0),_defineProperty(this,`getCurrentPageId`,()=>this._currentPageId),_defineProperty(this,`getCurrentRoute`,()=>this._currentRoute),_defineProperty(this,`setPageLabel`,z=>{this._pageLabel=z}),_defineProperty(this,`getPageLabel`,()=>this._pageLabel||(!this._useDocumentTitleAsPageLabel||!this._titleDocument?null:this._titleDocument.title)),_defineProperty(this,`setCurrentRoute`,z=>{(!this._currentRoute||this._currentRoute.url!==z.url)&&(this._currentPageId=generateUUID()),this._currentRoute=z,z.label?this._pageLabel=z.label:this._pageLabel=null}),_defineProperty(this,`clearCurrentRoute`,()=>{this._currentRoute=null,this._currentPageId=null,this._pageLabel=null}),this._useDocumentTitleAsPageLabel=z,this._titleDocument=G}},MXLSDKFeaturesManager=class{constructor({dynamicConfigManager:z,deviceId:G,blockNetworkSpanForwarding:K}){_defineProperty(this,`_dynamicConfigManager`,void 0),_defineProperty(this,`_deviceId`,void 0),_defineProperty(this,`_blockNetworkSpanForwarding`,void 0),this._dynamicConfigManager=z,this._deviceId=G,this._blockNetworkSpanForwarding=K}isSDKEnabled(){let z=this._dynamicConfigManager.getConfig();return isDeviceIdEnabled(this._deviceId,z.samplingPct)}isNetworkSpanForwardingEnabled(){if(this._blockNetworkSpanForwarding)return!1;let z=this._dynamicConfigManager.getConfig();return isDeviceIdEnabled(this._deviceId,z.networkSpansForwardingThreshold)}isEmptySessionAvoidanceEnabled(){let z=this._dynamicConfigManager.getConfig();return isDeviceIdEnabled(this._deviceId,z.emptySessionAvoidanceEnabledPct)}};const TEMPLATE_APP_VERSION=`MXLAppVersionX.X.X`,SDK_VERSION=`0.0.12`,MXL_SERVICE_NAME=`mxl-web-sdk`,NATIVE_FRAMEWORK=1,MXL_APP_INSTANCE_ID_STORAGE_KEY=`mxl_app_instance_id`,getAppInstanceId=(z,G)=>{let K=null;try{K=z.getItem(MXL_APP_INSTANCE_ID_STORAGE_KEY)}catch(z){G.warn(`Failed to retrieve app instance ID from session storage`,z)}if(!K){G.debug(`No existing app instance ID found in session storage, creating a new one`),K=generateUUID();try{z.setItem(MXL_APP_INSTANCE_ID_STORAGE_KEY,K)}catch(z){G.warn(`Failed to persist app instance ID to session storage`,z)}}return K},getWebSDKResource=({diagLogger:z,appVersion:G,pageSessionStorage:K})=>resourceFromAttributes$2({[ATTR_SERVICE_NAME]:MXL_SERVICE_NAME,[ATTR_TELEMETRY_SDK_NAME]:MXL_SERVICE_NAME,app_version:G,app_framework:NATIVE_FRAMEWORK,sdk_version:SDK_VERSION,[ATTR_TELEMETRY_SDK_VERSION]:SDK_VERSION,sdk_simple_version:1,sdk_platform:`web`,[ATTR_TELEMETRY_SDK_LANGUAGE]:`webjs`,[KEY_MXL_APP_INSTANCE_ID]:getAppInstanceId(K,z),[ATTR_USER_AGENT_ORIGINAL]:window.navigator.userAgent,screen_resolution:`${window.screen.width}x${window.screen.height}`});var MXLExtendedSpan=class{constructor(z){_defineProperty(this,`_span`,void 0),this._span=z}get attributes(){return this._span.attributes}addEvent(z,G,K){return this._span.addEvent(z,G,K),this}addLink(z){return this._span.addLink(z),this}addLinks(z){return this._span.addLinks(z),this}end(z){this._span.end(z)}isRecording(){return this._span.isRecording()}recordException(z,G){this._span.recordException(z,G)}setAttribute(z,G){return this._span.setAttribute(z,G),this}setAttributes(z){return this._span.setAttributes(z),this}removeAttribute(z){let G=this._span.attributes,{[z]:K}=G,J=_objectWithoutProperties(G,[z].map(toPropertyKey));return this._span.attributes=J,this}setStatus(z){return this._span.setStatus(z),this}spanContext(){return this._span.spanContext()}updateName(z){return this._span.updateName(z),this}fail(z={code:`failure`}){z.code&&this._span.setAttribute(KEY_MXL_ERROR_CODE,z.code.toUpperCase()),this._span.end(z.endTime)}};const MXL_SESSION_NUMBER_STORAGE_KEY=`mxl_session_number`,MXL_TAB_STORAGE_KEY=`mxl_tab`,MXL_TAB_ACTIVITY_STORAGE_KEY=`mxl_tab_activity`;var MXLSpanSessionManager=class{constructor({diag:z,perf:G,visibilityDoc:K=window.document,storage:J=window.localStorage,sessionStorage:Y=window.sessionStorage,limitManager:X,referrer:Z=document.referrer}){_defineProperty(this,`_previousSessionId`,null),_defineProperty(this,`_activeSessionId`,null),_defineProperty(this,`_activeSessionStartTime`,null),_defineProperty(this,`_sessionSpan`,null),_defineProperty(this,`_activeSessionCounts`,null),_defineProperty(this,`_nextSessionCounts`,{}),_defineProperty(this,`_coldStart`,!0),_defineProperty(this,`_sdkStartupDuration`,0),_defineProperty(this,`_sessionStartedListeners`,[]),_defineProperty(this,`_sessionEndedListeners`,[]),_defineProperty(this,`_tab`,void 0),_defineProperty(this,`_navigationSource`,void 0),_defineProperty(this,`_referrerInfo`,void 0),_defineProperty(this,`_tracer`,void 0),_defineProperty(this,`_noExportTracer`,void 0),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_perf`,void 0),_defineProperty(this,`_visibilityDoc`,void 0),_defineProperty(this,`_storage`,void 0),_defineProperty(this,`_sessionStorage`,void 0),_defineProperty(this,`_limitManager`,void 0),_defineProperty(this,`_referrer`,void 0),this._diag=z==null?diag$1.createComponentLogger({namespace:`MXLSpanSessionManager`}):z,this._perf=G==null?new OTelPerformanceManager:G,this._visibilityDoc=K,this._storage=J,this._sessionStorage=Y,this._limitManager=X,this._referrer=Z,this._tracer=trace$1.getTracer(`mxl-web-sdk-sessions`),this._noExportTracer=new BasicTracerProvider().getTracer(`mxl-web-sdk-sessions`),this._referrerInfo=this._processReferrer();let Q=this._initTab();this._tab=Q.tab,this._navigationSource=Q.navigationSource,this._setupNewTabClickListeners()}_getPermanentAttributes(){let z=new Map;try{for(let G=0;G<this._storage.length;G++){let K=this._storage.key(G);if(K!=null&&K.startsWith(KEY_PREFIX_MXL_PROPERTIES)){let G=this._storage.getItem(K);G&&z.set(K,G)}}}catch(z){this._diag.warn(`Error loading permanent session properties`,z)}return Object.fromEntries(z.entries())}addBreadcrumb(z){if(!this._sessionSpan){this._diag.debug(`trying to add breadcrumb to a session, but there is no session in progress. This is a no-op.`);return}let G=this._limitManager.limitBreadcrumb(z);G!==`dropped`&&this._sessionSpan.addEvent(`mxl-breadcrumb`,{message:G.name},this._perf.getNowMillis())}addProperty(z,G,K){if(!this._sessionSpan){this._diag.debug(`trying to add properties to a session, but there is no session in progress. This is a no-op.`);return}let J=this._limitManager.limitSessionProperty(z,G);if(J===`dropped`)return;let Y=KEY_PREFIX_MXL_PROPERTIES+J.key;if(this._sessionSpan.setAttribute(Y,J.value),(K==null?void 0:K.lifespan)===`permanent`)try{this._storage.setItem(Y,G)}catch(z){this._diag.warn(`Failed to set permanent session property`,z)}}removeProperty(z){if(!this._sessionSpan){this._diag.debug(`trying to remove a session property, but there is no session in progress. This is a no-op.`);return}let G=KEY_PREFIX_MXL_PROPERTIES+this._limitManager.truncateString(`session_property_key`,z);this._sessionSpan.removeAttribute(G);try{this._storage.getItem(G)&&this._storage.removeItem(G)}catch(z){this._diag.warn(`Error removing permanent session property`,z)}}endSessionSpan(){this.endSessionSpanInternal(`manual`)}endSessionSpanInternal(z){if(!this._sessionSpan){this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`);return}for(let z of this._sessionEndedListeners)try{z()}catch(z){this._diag.warn(`Error while executing session ended listener`,z)}this._sessionSpan.setAttributes(this._endSessionSpanAttributes(z)),this._sessionSpan.end(),this._sessionSpan=null,this._activeSessionStartTime=null,this._previousSessionId=this._activeSessionId,this._activeSessionId=null,this._activeSessionCounts=null,this._limitManager.reset()}_endSessionSpanAttributes(z){return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},this._getPermanentAttributes()),{},{[KEY_MXL_SESSION_REASON_ENDED]:z},this._activeSessionCounts),this._limitManager.getDiagnosticCounts()),{},{[KEY_MXL_SDK_STARTUP_DURATION]:this._sdkStartupDuration})}currentSessionAsReadableSpan(z){if(!this._sessionSpan||!this._activeSessionStartTime)return this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`),null;let G=this._noExportTracer.startSpan(`mxl-session`,{startTime:this._activeSessionStartTime,attributes:_objectSpread2(_objectSpread2(_objectSpread2({},this._sessionSpan.attributes),this._endSessionSpanAttributes(z)),{},{[KEY_MXL_FROM_STORAGE]:!0})});return G.end(),G}getSessionId(){return this._activeSessionId}getPreviousSessionId(){return this._previousSessionId}getSessionSpan(){return this._sessionSpan}getSessionStartTime(){return this._activeSessionStartTime}startSessionSpan(z){this._sessionSpan&&this.endSessionSpanInternal(`manual`),this._activeSessionId=generateUUID(),this._activeSessionStartTime=this._perf.getNowHRTime(),this._activeSessionCounts={};let G=this._nextSessionCounts;this._nextSessionCounts={};let K=_objectSpread2(_objectSpread2({},this._getPermanentAttributes()),{},{[KEY_MXL_TYPE]:MXL_TYPES.Session,[KEY_MXL_STATE]:getVisibilityState(this._visibilityDoc),[ATTR_SESSION_ID$1]:this._activeSessionId,[KEY_MXL_COLD_START]:this._coldStart,[KEY_MXL_SESSION_NUMBER]:getIncrementedCount(this._storage,MXL_SESSION_NUMBER_STORAGE_KEY,this._diag),[KEY_MXL_EXPERIENCE_ID]:this._tab.experienceId,[KEY_MXL_TAB_ID]:this._tab.tabId,[KEY_MXL_NAVIGATION_SOURCE]:this._navigationSource},G);this._referrerInfo.isValid&&this._referrerInfo.scrubbedUrl&&(K[KEY_MXL_REFERRER_URL]=this._referrerInfo.scrubbedUrl),this._tab.sourceTabId&&(K[KEY_MXL_SOURCE_TAB_ID]=this._tab.sourceTabId),z!=null&&z.reason&&(K[KEY_MXL_SESSION_REASON_STARTED]=z.reason),this._sessionSpan=new MXLExtendedSpan(this._tracer.startSpan(`mxl-session`,{attributes:K})),this._coldStart=!1;for(let z of this._sessionStartedListeners)try{z()}catch(z){this._diag.warn(`Error while executing session started listener`,z)}}incrSessionCountForKey(z){if(!this._sessionSpan||!this._activeSessionCounts){this._diag.debug(`trying to increment a count for the active session, but there is no session in progress. This is a no-op.`);return}this._activeSessionCounts[z]=(this._activeSessionCounts[z]||0)+1}incrNextSessionCountForKey(z){this._nextSessionCounts[z]=(this._nextSessionCounts[z]||0)+1}addSessionStartedListener(z){let G=this._sessionStartedListeners.push(z);return()=>{this._sessionStartedListeners.splice(G-1,1)}}addSessionEndedListener(z){let G=this._sessionEndedListeners.push(z);return()=>{this._sessionEndedListeners.splice(G-1,1)}}recordSDKStartupDuration(z){this._sdkStartupDuration=Math.ceil(z)}setTracerProvider(z){this._tracer=z.getTracer(`mxl-web-sdk-sessions`)}_determineNavigationSource(){try{let z=window.performance.getEntriesByType(`navigation`);if(z.length>0&&z[0]){let G=z[0];if(G.type===`reload`)return`reload`;if(G.type===`back_forward`)return`back_forward`}}catch(z){this._diag.warn(`Failed to get navigation type`,z)}return this._referrerInfo.isValid?this._referrerInfo.isSameOrigin?`same_origin`:`external`:`direct`}_processReferrer(){if(!this._referrer)return{isValid:!1,isSameOrigin:!1};try{let z=new URL(this._referrer),G=window.location.origin;return{isValid:!0,isSameOrigin:z.origin===G,scrubbedUrl:z.origin+z.pathname}}catch(z){return{isValid:!1,isSameOrigin:!1}}}_getTabContext(z){var G;let K=getAppInstanceId(this._sessionStorage,this._diag),J,Y;if(z===`same_origin`){let z=this._getTabActivity();z&&Date.now()-z.lastActivityMs<=1e4&&(J=z.tabId,Y=z.experienceId)}return Y!=null||(Y=generateUUID()),{sourceTabId:J,experienceId:Y,tabId:K}}_initTab(){let z=this._determineNavigationSource();try{let G=this._sessionStorage.getItem(MXL_TAB_STORAGE_KEY);if(G)return{tab:JSON.parse(G),navigationSource:z}}catch(z){this._diag.warn(`Failed to retrieve tab data`,z)}let G=this._getTabContext(z),K={experienceId:G.experienceId,sourceTabId:G.sourceTabId,tabId:G.tabId};try{this._sessionStorage.setItem(MXL_TAB_STORAGE_KEY,JSON.stringify(K))}catch(z){this._diag.warn(`Failed to store tab data`,z)}return{tab:K,navigationSource:z}}_getTabActivity(){try{let z=this._storage.getItem(MXL_TAB_ACTIVITY_STORAGE_KEY);return z?JSON.parse(z):null}catch(z){return this._diag.warn(`Failed to retrieve tab activity`,z),null}}_storeTabActivity(z){try{this._storage.setItem(MXL_TAB_ACTIVITY_STORAGE_KEY,JSON.stringify(z))}catch(z){this._diag.warn(`Failed to save tab activity`,z)}}_storeCurrentTabAsSource(){let z={tabId:this._tab.tabId,experienceId:this._tab.experienceId,lastActivityMs:Date.now()};this._storeTabActivity(z)}_setupNewTabClickListeners(){let z=z=>{var G;if(z.button===1||z.ctrlKey||z.metaKey||z.shiftKey){this._storeCurrentTabAsSource();return}(G=z.target)!=null&&G.closest(`a[target="_blank"], form[target="_blank"], a[rel*="noopener"], a[rel*="noreferrer"]`)&&this._storeCurrentTabAsSource()},G={capture:!0,passive:!0};document.addEventListener(`auxclick`,z,G),document.addEventListener(`click`,z,G)}},MXLTraceManager=class{constructor({tracerProvider:z}={}){_defineProperty(this,`_tracer`,void 0),_defineProperty(this,`setSpan`,trace$1.setSpan),this._tracer=(z==null?trace$1:z).getTracer(`mxl-web-sdk-traces`)}startSpan(z,G={},K){G.attributes=G.attributes?G.attributes:{},G.attributes[KEY_MXL_TYPE]=MXL_TYPES.Perf;let J=G.parentSpan?trace$1.setSpan(context.active(),G.parentSpan):K;return new MXLExtendedSpan(this._tracer.startSpan(z,G,J))}getSpan(z){let G=trace$1.getSpan(z);if(G)return new MXLExtendedSpan(G)}};const MXL_USER_STORAGE_KEY_DEPRECATED=`mxl_user`,MXL_USER_ID_STORAGE_KEY=`mxl_user_id`,MXL_EXTERNAL_USER_ID_KEY=`mxl_external_user_id`,isUser=z=>typeof z[KEY_ENDUSER_PSEUDO_ID]==`string`&&z[KEY_ENDUSER_PSEUDO_ID].length===32,isUserId=z=>typeof z==`string`&&z.length===32;var MXLUserManager=class{constructor({diag:z,storage:G=window.localStorage}={}){_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_storage`,void 0),_defineProperty(this,`_mxlUserId`,null),this._diag=z==null?diag$1.createComponentLogger({namespace:`MXLUserManager`}):z,this._storage=G,this._migrateOldLocalStorageKey(),this._initialSetup()}getMXLUserId(){return this._mxlUserId||this._generateNewMXLUserId()}setMXLUserId(z){this._mxlUserId=z;try{this._storage.setItem(MXL_USER_ID_STORAGE_KEY,z)}catch(z){this._diag.warn(`Failed to persist user object for storage, keeping it in-memory only`,z)}}clearMXLUserId(){this._mxlUserId=null;try{this._storage.removeItem(MXL_USER_ID_STORAGE_KEY)}catch(z){this._diag.warn(`Failed to remove mxl user in storage`,z)}}_migrateOldLocalStorageKey(){try{let z=this._storage.getItem(MXL_USER_STORAGE_KEY_DEPRECATED);if(z){let G=JSON.parse(z);isUser(G)?(this._diag.debug(`Migrating old user data from storage`),this._storage.setItem(MXL_USER_ID_STORAGE_KEY,G[KEY_ENDUSER_PSEUDO_ID]),this._storage.removeItem(MXL_USER_STORAGE_KEY_DEPRECATED)):(this._diag.warn(`Invalid user data found in storage, clearing old user data`),this._storage.removeItem(MXL_USER_STORAGE_KEY_DEPRECATED))}}catch(z){this._diag.warn(`Failed to get old user data from storage`,z)}}_initialSetup(){try{let z=this._storage.getItem(MXL_USER_ID_STORAGE_KEY);z?isUserId(z)?this._mxlUserId=z:(this._diag.warn(`Invalid mxl user id, generating a new one`),this.clearMXLUserId()):this._diag.debug(`No existing user found in storage, creating a new one`)}catch(z){this._diag.warn(`Failed to get mxl user id from storage, defaulting to a new one`,z)}this._mxlUserId||(this._mxlUserId=this._generateNewMXLUserId())}_generateNewMXLUserId(){let z=generateUUID();return this.setMXLUserId(z),z}getUserId(){try{return this._storage.getItem(MXL_EXTERNAL_USER_ID_KEY)}catch(z){return this._diag.warn(`Failed to retrieve user id from storage`,z),null}}setUserId(z){try{this._storage.setItem(MXL_EXTERNAL_USER_ID_KEY,z)}catch(z){this._diag.warn(`Failed to store user id`,z)}}clearUserId(){try{this._storage.removeItem(MXL_EXTERNAL_USER_ID_KEY)}catch(z){this._diag.warn(`Failed to clear user id`,z)}}};const TIMEOUT_TIME$1=1800*1e3,EVENT_THROTTLING_TIME_WINDOW=30*1e3,WINDOW_USER_EVENTS=[`keydown`,`mousedown`,`mousemove`,`scroll`];var SpanSessionBrowserActivityInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z}={}){super({instrumentationName:`SpanSessionBrowserActivityInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,config:{}}),_defineProperty(this,`_onActivityThrottled`,void 0),_defineProperty(this,`_activityTimeout`,void 0),_defineProperty(this,`disable`,()=>{bulkRemoveEventListener({target:window,events:WINDOW_USER_EVENTS,callback:this._onActivityThrottled}),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null}),_defineProperty(this,`enable`,()=>{bulkAddEventListener({target:window,events:WINDOW_USER_EVENTS,callback:this._onActivityThrottled})}),_defineProperty(this,`_onInactivity`,()=>{this._diag.debug(`Inactivity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null,this.sessionManager.endSessionSpanInternal(`inactivity`)}),_defineProperty(this,`_onActivity`,()=>{this._diag.debug(`Activity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this.sessionManager.getSessionId()||this.sessionManager.startSessionSpan({reason:`activity`}),this._activityTimeout=setTimeout(this._onInactivity,TIMEOUT_TIME$1)}),this._activityTimeout=null,this._onActivityThrottled=throttle$1(this._onActivity,EVENT_THROTTLING_TIME_WINDOW),this._config.enabled&&this.enable()}},SpanSessionOnLoadInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z}={}){super({instrumentationName:`SpanSessionOnLoadInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,config:{}}),this._config.enabled&&this.enable()}disable(){this.sessionManager.endSessionSpanInternal(`unknown`)}enable(){this.sessionManager.startSessionSpan({reason:`init`})}};const TIMEOUT_TIME=14400*1e3;var SpanSessionTimeoutInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,perf:G}={}){super({instrumentationName:`SpanSessionTimeoutInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,perf:G,config:{}}),_defineProperty(this,`_sessionTimeout`,void 0),_defineProperty(this,`disable`,()=>{this._sessionTimeout&&clearTimeout(this._sessionTimeout),this._sessionTimeout=null}),_defineProperty(this,`enable`,()=>{this._checkTimeout()}),_defineProperty(this,`_onTimeout`,()=>{this._diag.debug(`Timeout detected`),this._sessionTimeout&&clearTimeout(this._sessionTimeout),this.sessionManager.endSessionSpanInternal(`timer`),this.sessionManager.startSessionSpan({reason:`timer`}),this._sessionTimeout=setTimeout(this._checkTimeout,TIMEOUT_TIME)}),_defineProperty(this,`_checkTimeout`,()=>{let z=this.sessionManager.getSessionStartTime();if(z){let G=TIMEOUT_TIME-this.perf.millisSinceHRTime(z);if(G<=0){this._onTimeout();return}this._sessionTimeout&&clearTimeout(this._sessionTimeout),this._sessionTimeout=setTimeout(this._checkTimeout,G);return}this._sessionTimeout&&clearTimeout(this._sessionTimeout),this._sessionTimeout=setTimeout(this._checkTimeout,TIMEOUT_TIME)}),this._sessionTimeout=null,this._config.enabled&&this.enable()}};const SESSION_INTERACTION_EVENTS=[`mousedown`];var SpanSessionVisibilityInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,perf:G,visibilityWaitTimeMs:K=0,limitedSessionMaxDurationMs:J=5e3,backgroundSessions:Y=!1,maxPendingSpanCount:X=5,visibilityDoc:Z=window.document}={},Q,ee){super({instrumentationName:`SpanSessionVisibilityInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,perf:G,config:{}}),_defineProperty(this,`_currentVisibilityState`,void 0),_defineProperty(this,`_checkVisibilityTimeout`,void 0),_defineProperty(this,`_interactionSinceLastVisibilityChange`,void 0),_defineProperty(this,`_avoidEndingLimitedSessions`,void 0),_defineProperty(this,`_mxlSpanProcessor`,void 0),_defineProperty(this,`_checkVisibilityChange`,void 0),_defineProperty(this,`_onVisibilityChange`,void 0),_defineProperty(this,`_onInteractionThrottled`,void 0),this._currentVisibilityState=Z.visibilityState,this._checkVisibilityTimeout=null,this._interactionSinceLastVisibilityChange=!1,this._avoidEndingLimitedSessions=J>0&&Q.isEmptySessionAvoidanceEnabled(),this._mxlSpanProcessor=ee,this._checkVisibilityChange=()=>{if(K<=0){this._currentVisibilityState=Z.visibilityState,this._onVisibilityChange();return}if(this._checkVisibilityTimeout&&clearTimeout(this._checkVisibilityTimeout),Z.visibilityState===`visible`&&this._currentVisibilityState!==Z.visibilityState){this._currentVisibilityState=Z.visibilityState,this._onVisibilityChange();return}this._diag.debug(`Visibility changed to ${Z.visibilityState}. Will wait ${(K/1e3).toString()}s, and check if visibility changed`),this._checkVisibilityTimeout=setTimeout(()=>{this._currentVisibilityState===Z.visibilityState?this._diag.debug(`Visibility was not changed after timeout happened: ${Z.visibilityState}`):(this._currentVisibilityState=Z.visibilityState,this._onVisibilityChange())},K)},this._onVisibilityChange=()=>{this._diag.debug(`Visibility change detected: ${Z.visibilityState}`);let z=this.sessionManager.getSessionStartTime();if(this._avoidEndingLimitedSessions&&z!==null&&this.perf.millisSinceHRTime(z)<J&&!this._interactionSinceLastVisibilityChange&&this._mxlSpanProcessor&&this._mxlSpanProcessor.getPendingSpansCount()<X){this._diag.debug(`Not ending the session since it is considered limited`),this.sessionManager.addBreadcrumb(`Tab visibility changed to ${Z.visibilityState}`);let z=this.sessionManager.getSessionId();if(z){let G=this.sessionManager.currentSessionAsReadableSpan(`state_changed`);G&&this._mxlSpanProcessor.storePendingSpans(z,G)}}else{let z=this.sessionManager.getSessionId();this._mxlSpanProcessor&&z&&this._mxlSpanProcessor.clearStoredSpans(z),this.sessionManager.endSessionSpanInternal(`state_changed`),Z.visibilityState===`hidden`&&Y?(this._diag.debug("Starting a session since document visibility switched to hidden and `backgroundSessions` is enabled"),this.sessionManager.startSessionSpan({reason:`hidden`})):Z.visibilityState===`visible`&&(this._diag.debug(`Starting a session since document visibility switched to visible`),this.sessionManager.startSessionSpan({reason:`visible`}))}this._interactionSinceLastVisibilityChange=!1},this._onInteractionThrottled=throttle$1(()=>{this._interactionSinceLastVisibilityChange=!0},1e3),this._config.enabled&&this.enable()}disable(){window.removeEventListener(`visibilitychange`,this._checkVisibilityChange),this._avoidEndingLimitedSessions&&bulkRemoveEventListener({target:window,events:SESSION_INTERACTION_EVENTS,callback:this._onInteractionThrottled})}enable(){window.addEventListener(`visibilitychange`,this._checkVisibilityChange),this._avoidEndingLimitedSessions&&bulkAddEventListener({target:window,events:SESSION_INTERACTION_EVENTS,callback:this._onInteractionThrottled})}},t=class{constructor(){_defineProperty(this,`t`,void 0),_defineProperty(this,`o`,0),_defineProperty(this,`i`,[])}u(z){var G;if(z.hadRecentInput)return;let K=this.i[0],J=this.i.at(-1);this.o&&K&&J&&z.startTime-J.startTime<1e3&&z.startTime-K.startTime<5e3?(this.o+=z.value,this.i.push(z)):(this.o=z.value,this.i=[z]),(G=this.t)==null||G.call(this,z)}};const e=()=>{let z=performance.getEntriesByType(`navigation`)[0];if(z&&z.responseStart>0&&z.responseStart<performance.now())return z},n=z=>{if(document.readyState===`loading`)return`loading`;let G=e();if(G){if(z<G.domInteractive)return`loading`;if(G.domContentLoadedEventStart===0||z<G.domContentLoadedEventStart)return`dom-interactive`;if(G.domComplete===0||z<G.domComplete)return`dom-content-loaded`}return`complete`},o=z=>{let G=z.nodeName;return z.nodeType===1?G.toLowerCase():G.toUpperCase().replace(/^#/,``)},i$2=z=>{let G=``;try{for(;(z==null?void 0:z.nodeType)!==9;){let K=z,J=K.id?`#`+K.id:[o(K),...Array.from(K.classList).sort()].join(`.`);if(G.length+J.length>99)return G||J;if(G=G?J+`>`+G:J,K.id)break;z=K.parentNode}}catch(z){}return G},r=new WeakMap;function s(z,G){return r.get(z)||r.set(z,new G),r.get(z)}let a=-1;const c=()=>a,u=z=>{addEventListener(`pageshow`,G=>{G.persisted&&(a=G.timeStamp,z(G))},!0)},f=(z,G,K,J)=>{let Y,X;return Z=>{var Q;G.value>=0&&(Z||J)&&(X=G.value-((Q=Y)==null?0:Q),(X||Y===void 0)&&(Y=G.value,G.delta=X,G.rating=((z,G)=>z>G[1]?`poor`:z>G[0]?`needs-improvement`:`good`)(G.value,K),z(G)))}},d=z=>{requestAnimationFrame(()=>requestAnimationFrame(z))},l=()=>{var z,G;return(z=(G=e())==null?void 0:G.activationStart)==null?0:z},h=(z,G=-1)=>{let K=e(),J=`navigate`;return c()>=0?J=`back-forward-cache`:K&&(document.prerendering||l()>0?J=`prerender`:document.wasDiscarded?J=`restore`:K.type&&(J=K.type.replace(/_/g,`-`))),{name:z,value:G,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:J}},m=(z,G,K={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(z)){let J=new PerformanceObserver(z=>{queueMicrotask(()=>{G(z.getEntries())})});return J.observe(_objectSpread2({type:z,buffered:!0},K)),J}}catch(z){}},g=z=>{let G=!1;return()=>{G||(z(),G=!0)}};let p=-1;const y=new Set,v=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,b=z=>{if(document.visibilityState===`hidden`){if(z.type===`visibilitychange`)for(let z of y)z();isFinite(p)||(p=z.type===`visibilitychange`?z.timeStamp:0,removeEventListener(`prerenderingchange`,b,!0))}},M=()=>{if(p<0){var z;let G=l(),K=document.prerendering||(z=globalThis.performance.getEntriesByType(`visibility-state`).find(z=>z.name===`hidden`&&z.startTime>=G))==null?void 0:z.startTime;p=K==null?v():K,addEventListener(`visibilitychange`,b,!0),addEventListener(`prerenderingchange`,b,!0),u(()=>{setTimeout(()=>{p=v()})})}return{get firstHiddenTime(){return p},onHidden(z){y.add(z)}}},T=z=>{document.prerendering?addEventListener(`prerenderingchange`,z,!0):z()},E=[1800,3e3],D=(z,G={})=>{T(()=>{let K=M(),J,Y=h(`FCP`),X=m(`paint`,z=>{for(let G of z)G.name===`first-contentful-paint`&&(X.disconnect(),G.startTime<K.firstHiddenTime&&(Y.value=Math.max(G.startTime-l(),0),Y.entries.push(G),J(!0)))});X&&(J=f(z,Y,E,G.reportAllChanges),u(K=>{Y=h(`FCP`),J=f(z,Y,E,G.reportAllChanges),d(()=>{Y.value=performance.now()-K.timeStamp,J(!0)})}))})},L=[.1,.25],S=z=>z.find(z=>{var G;return((G=z.node)==null?void 0:G.nodeType)===1})||z[0],P=(z,G={})=>{let K=s(G=Object.assign({},G),t),J=new WeakMap;K.t=z=>{var K;if(!(z==null||(K=z.sources)==null)&&K.length){let K=S(z.sources),Z=K==null?void 0:K.node;if(Z){var Y,X;let z=(Y=(X=G.generateTarget)==null?void 0:X.call(G,Z))==null?i$2(Z):Y;J.set(K,z)}}},((z,G={})=>{let K=M();D(g(()=>{let J,Y=h(`CLS`,0),X=s(G,t),Z=z=>{for(let G of z)X.u(G);X.o>Y.value&&(Y.value=X.o,Y.entries=X.i,J())},Q=m(`layout-shift`,Z);Q&&(J=f(z,Y,L,G.reportAllChanges),K.onHidden(()=>{Z(Q.takeRecords()),J(!0)}),u(()=>{X.o=0,Y=h(`CLS`,0),J=f(z,Y,L,G.reportAllChanges),d(J)}),setTimeout(J))}))})(G=>{z((z=>{let G={};if(z.entries.length){var K;let Y=z.entries.reduce((z,G)=>z.value>G.value?z:G);if(!(Y==null||(K=Y.sources)==null)&&K.length){let z=S(Y.sources);z&&(G={largestShiftTarget:J.get(z),largestShiftTime:Y.startTime,largestShiftValue:Y.value,largestShiftSource:z,largestShiftEntry:Y,loadState:n(Y.startTime)})}}return Object.assign(z,{attribution:G})})(G))},G)},w=(z,G={})=>{D(G=>{z((z=>{let G={timeToFirstByte:0,firstByteToFCP:z.value,loadState:n(c())};if(z.entries.length){let K=e(),J=z.entries.at(-1);if(K){let Y=K.activationStart||0,X=Math.max(0,K.responseStart-Y);G={timeToFirstByte:X,firstByteToFCP:z.value-X,loadState:n(z.entries[0].startTime),navigationEntry:K,fcpEntry:J}}}return Object.assign(z,{attribution:G})})(G))},G)};let _=0,k=1/0,F=0;const B=z=>{for(let G of z)G.interactionId&&(k=Math.min(k,G.interactionId),F=Math.max(F,G.interactionId),_=F?(F-k)/7+1:0)};let C;const O=()=>{var z;return C?_:(z=performance.interactionCount)==null?0:z},j=()=>{`interactionCount`in performance||C||(C=m(`event`,B,{durationThreshold:0}))};let I=0;var A=class{constructor(){_defineProperty(this,`l`,[]),_defineProperty(this,`h`,new Map),_defineProperty(this,`m`,void 0),_defineProperty(this,`p`,void 0)}v(){I=O(),this.l.length=0,this.h.clear()}M(){let z=Math.min(this.l.length-1,Math.floor((O()-I)/50));return this.l[z]}u(z){var G;if((G=this.m)==null||G.call(this,z),!z.interactionId&&z.entryType!==`first-input`)return;let K=this.l.at(-1),J=this.h.get(z.interactionId);if(J||this.l.length<10||z.duration>K.T){var Y;if(J?z.duration>J.T?(J.entries=[z],J.T=z.duration):z.duration===J.T&&z.startTime===J.entries[0].startTime&&J.entries.push(z):(J={id:z.interactionId,entries:[z],T:z.duration},this.h.set(J.id,J),this.l.push(J)),this.l.sort((z,G)=>G.T-z.T),this.l.length>10){let z=this.l.splice(10);for(let G of z)this.h.delete(G.id)}(Y=this.p)==null||Y.call(this,J)}}};const q=z=>{let G=globalThis.requestIdleCallback||setTimeout,K=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)z();else{let J=g(z),Y=-1,X=()=>{K(Y),J()};addEventListener(`visibilitychange`,X,{once:!0,capture:!0}),Y=G(()=>{removeEventListener(`visibilitychange`,X,{capture:!0}),J()})}},W=[200,500],x$1=(z,G={})=>{let K=s(G=Object.assign({},G),A),J=[],Y=[],X=0,Z=new WeakMap,Q=new WeakMap,ee=!1,te=()=>{ee||(q(ne),ee=!0)},ne=()=>{let z=new Set(K.l.map(z=>Z.get(z.entries[0]))),G=Y.length-10;Y=Y.filter((K,J)=>J>=G||z.has(K));let Q=new Set;for(let z of Y){let G=ie(z.startTime,z.processingEnd);for(let z of G)Q.add(z)}J=J.filter(z=>z.startTime>X||Q.has(z)),ee=!1};K.m=z=>{let K=z.startTime+z.duration,J;X=Math.max(X,z.processingEnd);for(let X=Y.length-1;X>=0;X--){let Z=Y[X];if(Math.abs(K-Z.renderTime)<=8){J=Z,J.startTime=Math.min(z.startTime,J.startTime),J.processingStart=Math.min(z.processingStart,J.processingStart),J.processingEnd=Math.max(z.processingEnd,J.processingEnd),!1!==G.includeProcessedEventEntries&&J.entries.push(z);break}}J||(J={startTime:z.startTime,processingStart:z.processingStart,processingEnd:z.processingEnd,renderTime:K,entries:!1===G.includeProcessedEventEntries?[]:[z]},Y.push(J)),(z.interactionId||z.entryType===`first-input`)&&Z.set(z,J),te()},K.p=z=>{if(!Q.get(z)){let Y=z.entries[0].target;if(Y){var K,J;let X=(K=(J=G.generateTarget)==null?void 0:J.call(G,Y))==null?i$2(Y):K;Q.set(z,X)}}};let ie=(z,G)=>{let K=[];for(let Y of J)if(!(Y.startTime+Y.duration<z)){if(Y.startTime>G)break;K.push(Y)}return K},ae=z=>{let G=z.entries[0],J=Z.get(G),Y=G.processingStart,X=Math.max(G.startTime+G.duration,Y),ee=Math.min(J.processingEnd,X),te=J.entries.sort((z,G)=>z.processingStart-G.processingStart),ne=ie(G.startTime,ee),ae=K.h.get(G.interactionId),oe={interactionTarget:Q.get(ae),interactionType:G.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:G.startTime,nextPaintTime:X,processedEventEntries:te,longAnimationFrameEntries:ne,inputDelay:Y-G.startTime,processingDuration:ee-Y,presentationDelay:X-ee,loadState:n(G.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(z=>{var G;if(!((G=z.longAnimationFrameEntries)!=null&&G.length))return;let K=z.interactionTime,J=z.inputDelay,Y=z.processingDuration,X,Z,Q=0,ee=0,te=0,ne=0;for(let G of z.longAnimationFrameEntries){ee=ee+G.startTime+G.duration-G.styleAndLayoutStart;for(let z of G.scripts){let G=z.startTime+z.duration;if(G<K)continue;let te=G-Math.max(K,z.startTime),ie=z.duration?te/z.duration*z.forcedStyleAndLayoutDuration:0;Q+=te-ie,ee+=ie,te>ne&&(Z=z.startTime<K+J?`input-delay`:z.startTime>=K+J+Y?`presentation-delay`:`processing-duration`,X=z,ne=te)}}let ie=z.longAnimationFrameEntries.at(-1),ae=ie?ie.startTime+ie.duration:0;ae>=K+J+Y&&(te=z.nextPaintTime-ae),X&&Z&&(z.longestScript={entry:X,subpart:Z,intersectingDuration:ne}),z.totalScriptDuration=Q,z.totalStyleAndLayoutDuration=ee,z.totalPaintDuration=te,z.totalUnattributedDuration=z.nextPaintTime-K-Q-ee-te})(oe),Object.assign(z,{attribution:oe})};m(`long-animation-frame`,z=>{J=J.concat(z),te()}),((z,G={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let K=M();T(()=>{var J;j();let Y,X=h(`INP`),Z=s(G,A),Q=z=>{q(()=>{for(let G of z)Z.u(G);let G=Z.M();G&&G.T!==X.value&&(X.value=G.T,X.entries=G.entries,Y())})},ee=m(`event`,Q,{durationThreshold:(J=G.durationThreshold)==null?40:J});Y=f(z,X,W,G.reportAllChanges),ee&&(ee.observe({type:`first-input`,buffered:!0}),K.onHidden(()=>{Q(ee.takeRecords()),Y(!0)}),u(()=>{Z.v(),X=h(`INP`),Y=f(z,X,W,G.reportAllChanges)}))})})(G=>{z(ae(G))},G)};var N=class{constructor(){_defineProperty(this,`m`,void 0)}u(z){var G;(G=this.m)==null||G.call(this,z)}};const $=[2500,4e3],H=(z,G={})=>{let K=s(G=Object.assign({},G),N),J=new WeakMap;K.m=z=>{let K=z.element;if(K){var Y,X;let Z=(Y=(X=G.generateTarget)==null?void 0:X.call(G,K))==null?i$2(K):Y;J.set(z,Z)}else z.id&&J.set(z,`#${z.id}`)},((z,G={})=>{T(()=>{let K=M(),J,Y=h(`LCP`),X=s(G,N),Z=z=>{G.reportAllChanges||(z=z.slice(-1));for(let G of z)X.u(G),G.startTime<K.firstHiddenTime&&(Y.value=Math.max(G.startTime-l(),0),Y.entries=[G],J())},Q=m(`largest-contentful-paint`,Z);if(Q){J=f(z,Y,$,G.reportAllChanges);let K=g(()=>{Z(Q.takeRecords()),Q.disconnect(),J(!0)}),X=z=>{z.isTrusted&&(q(K),removeEventListener(z.type,X,{capture:!0}))};for(let z of[`keydown`,`click`,`visibilitychange`])addEventListener(z,X,{capture:!0});u(K=>{Y=h(`LCP`),J=f(z,Y,$,G.reportAllChanges),d(()=>{Y.value=performance.now()-K.timeStamp,J(!0)})})}})})(G=>{z((z=>{let G={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:z.value};if(z.entries.length){let K=z.entries.at(-1),Y=K.url&&performance.getEntriesByType(`resource`).find(z=>z.name===K.url);G.target=J.get(K),G.lcpEntry=K,K.url&&(G.url=K.url),Y&&(G.lcpResourceEntry=Y);let X=e();if(X){let K=X.activationStart||0,J=Math.max(0,X.responseStart-K),Z=Math.max(J,Y?(Y.requestStart||Y.startTime)-K:0),Q=Math.min(z.value,Math.max(Z,Y?Y.responseEnd-K:0));G=_objectSpread2(_objectSpread2({},G),{},{timeToFirstByte:J,resourceLoadDelay:Z-J,resourceLoadDuration:Q-Z,elementRenderDelay:z.value-Q,navigationEntry:X})}}return Object.assign(z,{attribution:G})})(G))},G)},R=[800,1800],U=z=>{document.prerendering?T(()=>U(z)):document.readyState===`complete`?setTimeout(z):addEventListener(`load`,()=>U(z),!0)},V=(z,G={})=>{((z,G={})=>{let K=h(`TTFB`),J=f(z,K,R,G.reportAllChanges);U(()=>{let Y=e();Y&&(K.value=Math.max(Y.responseStart-l(),0),K.entries=[Y],J(!0),u(()=>{K=h(`TTFB`,0),J=f(z,K,R,G.reportAllChanges),J(!0)}))})})(G=>{z((z=>{let G={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(z.entries.length){let K=z.entries[0],J=K.activationStart||0,Y=Math.max((K.workerStart||K.fetchStart)-J,0),X=Math.max(K.domainLookupStart-J,0),Z=Math.max(K.connectStart-J,0),Q=Math.max(K.connectEnd-J,0);G={waitingDuration:Y,cacheDuration:X-Y,dnsDuration:Z-X,connectionDuration:Q-Z,requestDuration:z.value-Q,navigationEntry:K}}return Object.assign(z,{attribution:G})})(G))},G)},MXL_WEB_VITALS_PREFIX=`mxl-web-vitals`,ALL_WEB_VITALS=[`CLS`,`INP`,`LCP`,`FCP`,`TTFB`],WEB_VITALS_ID_TO_LISTENER={CLS:P,FCP:w,LCP:H,INP:x$1,TTFB:V,FID:void 0},webVitalAttributionToReport=(z,G)=>{let K={},J=[];if(z===`CLS`){let z=G.attribution;J.push({key:`largestShiftTarget`,value:z.largestShiftTarget},{key:`largestShiftValue`,value:z.largestShiftValue})}else if(z===`INP`){let z=G.attribution;J.push({key:`interactionTarget`,value:z.interactionTarget},{key:`interactionType`,value:z.interactionType},{key:`nextPaintTime`,value:z.nextPaintTime},{key:`inputDelay`,value:z.inputDelay},{key:`processingDuration`,value:z.processingDuration},{key:`presentationDelay`,value:z.presentationDelay},{key:`totalScriptDuration`,value:z.totalScriptDuration},{key:`totalStyleAndLayoutDuration`,value:z.totalStyleAndLayoutDuration},{key:`totalPaintDuration`,value:z.totalPaintDuration},{key:`totalUnattributedDuration`,value:z.totalUnattributedDuration},{key:`loadState`,value:z.loadState})}else if(z===`LCP`){let z=G.attribution;J.push({key:`target`,value:z.target},{key:`url`,value:z.url},{key:`timeToFirstByte`,value:z.timeToFirstByte},{key:`resourceLoadDelay`,value:z.resourceLoadDelay},{key:`resourceLoadDuration`,value:z.resourceLoadDuration},{key:`elementRenderDelay`,value:z.elementRenderDelay})}return J.forEach(z=>{z.value!==void 0&&(K[`mxl.web_vital.attribution.${z.key}`]=z.value)}),K};var WebVitalsInstrumentation=class extends MXLInstrumentationBase{constructor({diag:z,perf:G,listeners:K=WEB_VITALS_ID_TO_LISTENER,urlDocument:J=window.document,urlAttribution:Y=!0,pageManager:X}={}){super({instrumentationName:`WebVitalsInstrumentation`,instrumentationVersion:`1.0.0`,diag:z,perf:G,config:{}}),_defineProperty(this,`_listeners`,void 0),_defineProperty(this,`_urlDocument`,void 0),_defineProperty(this,`_urlAttribution`,void 0),_defineProperty(this,`_pageManager`,void 0),_defineProperty(this,`_attributedPage`,{INP:void 0,LCP:void 0,CLS:void 0,FCP:void 0,TTFB:void 0}),_defineProperty(this,`_largestShiftTargetForCLS`,void 0),_defineProperty(this,`_listenersRegistered`,!1),_defineProperty(this,`_isEnabled`,!1),this._listeners=K,this._urlDocument=J,this._urlAttribution=Y,this._pageManager=X==null?page.getPageManager():X,this._config.enabled&&this.enable()}disable(){this._isEnabled=!1,this._diag.debug(`WebVitalsInstrumentation disabled, pausing emission`)}enable(){if(this._isEnabled=!0,this._listenersRegistered){this._diag.debug(`WebVitalsInstrumentation listeners already registered, resuming emission`);return}if(this._listenersRegistered=!0,ALL_WEB_VITALS.forEach(z=>{var G,K;(G=(K=this._listeners)[z])==null||G.call(K,G=>{if(!this._isEnabled)return;let K=this.sessionManager.getSessionSpan();if(!K)return;let J=this._getTimeForMetric(G),Y=this._getAttributedPageForMetric(G),X=_objectSpread2({[KEY_MXL_TYPE]:MXL_TYPES.WebVital,[ATTR_URL_FULL]:Y.fullURL,[KEY_BROWSER_URL_FULL]:Y.fullURL,"mxl.web_vital.navigation_type":G.navigationType,"mxl.web_vital.name":G.name,"mxl.web_vital.rating":G.rating,"mxl.web_vital.id":G.id,"mxl.web_vital.delta":G.delta,"mxl.web_vital.value":G.value},webVitalAttributionToReport(z,G));Y.path&&Y.pageID&&(X[KEY_MXL_PAGE_PATH]=Y.path,X[KEY_MXL_PAGE_ID]=Y.pageID),Y.label&&(X[KEY_APP_SURFACE_LABEL]=Y.label),K.addEvent(`${MXL_WEB_VITALS_PREFIX}-report-${z}`,X,J)})}),this._urlAttribution){var z,G,K,J,Y,X,Z,Q,ee,te;(z=(G=this._listeners).TTFB)==null||z.call(G,()=>{this._attributedPage.TTFB=this._currentAttributedPage()},{reportAllChanges:!0}),(K=(J=this._listeners).FCP)==null||K.call(J,()=>{this._attributedPage.FCP=this._currentAttributedPage()},{reportAllChanges:!0}),(Y=(X=this._listeners).INP)==null||Y.call(X,()=>{this._attributedPage.INP=this._currentAttributedPage()},{reportAllChanges:!0}),(Z=(Q=this._listeners).LCP)==null||Z.call(Q,()=>{this._attributedPage.LCP=this._currentAttributedPage()},{reportAllChanges:!0}),(ee=(te=this._listeners).CLS)==null||ee.call(te,z=>{let G=z;this._largestShiftTargetForCLS!==G.attribution.largestShiftTarget&&(this._largestShiftTargetForCLS=G.attribution.largestShiftTarget,this._attributedPage.CLS=this._currentAttributedPage())},{reportAllChanges:!0})}}_getTimeForMetric(z){return z.name===`CLS`&&z.attribution.largestShiftTime?this.perf.epochMillisFromOriginOffset(z.attribution.largestShiftTime):z.name===`INP`&&z.attribution.interactionTime?this.perf.epochMillisFromOriginOffset(z.attribution.interactionTime):this.perf.getNowMillis()}_currentAttributedPage(){let z={fullURL:this._urlDocument.URL},G=this._pageManager.getCurrentRoute(),K=this._pageManager.getCurrentPageId();G&&K&&(z.path=G.path,z.pageID=K);let J=this._pageManager.getPageLabel();return J&&(z.label=J),z}_getAttributedPageForMetric(z){return z.name===`FCP`&&this._attributedPage.FCP?this._attributedPage.FCP:z.name===`TTFB`&&this._attributedPage.TTFB?this._attributedPage.TTFB:z.name===`INP`&&this._attributedPage.INP?this._attributedPage.INP:z.name===`LCP`&&this._attributedPage.LCP?this._attributedPage.LCP:z.name===`CLS`&&this._attributedPage.CLS&&z.attribution.largestShiftTarget===this._largestShiftTargetForCLS?this._attributedPage.CLS:this._currentAttributedPage()}};let logger=console.error.bind(console);function defineProperty(z,G,K){let J=!!z[G]&&Object.prototype.propertyIsEnumerable.call(z,G);Object.defineProperty(z,G,{configurable:!0,enumerable:J,writable:!0,value:K})}const wrap=(z,G,K)=>{if(!z||!z[G]){logger(`no original function `+String(G)+` to wrap`);return}if(!K){logger(`no wrapper function`),logger(Error().stack);return}let J=z[G];if(typeof J!=`function`||typeof K!=`function`){logger(`original object and wrapper must be functions`);return}let Y=K(J,G);return defineProperty(Y,`__original`,J),defineProperty(Y,`__unwrap`,()=>{z[G]===Y&&defineProperty(z,G,J)}),defineProperty(Y,`__wrapped`,!0),defineProperty(z,G,Y),Y},massWrap=(z,G,K)=>{if(z)Array.isArray(z)||(z=[z]);else{logger(`must provide one or more modules to patch`),logger(Error().stack);return}if(!(G&&Array.isArray(G))){logger(`must provide one or more functions to wrap on modules`);return}z.forEach(z=>{G.forEach(G=>{wrap(z,G,K)})})},unwrap=(z,G)=>{if(!z||!z[G]){logger(`no function to unwrap.`),logger(Error().stack);return}let K=z[G];if(!K.__unwrap)logger(`no original to unwrap to -- has `+String(G)+` already been unwrapped?`);else{K.__unwrap();return}},massUnwrap=(z,G)=>{if(z)Array.isArray(z)||(z=[z]);else{logger(`must provide one or more modules to patch`),logger(Error().stack);return}if(!(G&&Array.isArray(G))){logger(`must provide one or more functions to unwrap on modules`);return}z.forEach(z=>{G.forEach(G=>{unwrap(z,G)})})};function shimmer(z){z&&z.logger&&(typeof z.logger==`function`?logger=z.logger:logger(`new logger isn't a function, not replacing`))}shimmer.wrap=wrap,shimmer.massWrap=massWrap,shimmer.unwrap=unwrap,shimmer.massUnwrap=massUnwrap;var InstrumentationAbstract=class{constructor(z,G,K){_defineProperty(this,`_config`,{}),_defineProperty(this,`_tracer`,void 0),_defineProperty(this,`_meter`,void 0),_defineProperty(this,`_logger`,void 0),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`instrumentationName`,void 0),_defineProperty(this,`instrumentationVersion`,void 0),_defineProperty(this,`_wrap`,wrap),_defineProperty(this,`_unwrap`,unwrap),_defineProperty(this,`_massWrap`,massWrap),_defineProperty(this,`_massUnwrap`,massUnwrap),this.instrumentationName=z,this.instrumentationVersion=G,this.setConfig(K),this._diag=diag$1.createComponentLogger({namespace:z}),this._tracer=trace$1.getTracer(z,G),this._meter=metrics.getMeter(z,G),this._logger=logs.getLogger(z,G),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(z){this._meter=z.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(z){this._logger=z.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var z;let G=(z=this.init())==null?[]:z;return Array.isArray(G)?G:[G]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(z){this._config=_objectSpread2({enabled:!0},z)}setTracerProvider(z){this._tracer=z.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(z,G,K,J){if(z)try{z(K,J)}catch(z){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:G},z)}}},InstrumentationBase=class extends InstrumentationAbstract{constructor(z,G,K){super(z,G,K),this._config.enabled&&this.enable()}};function safeExecuteInTheMiddle(z,G,K){let J,Y;try{Y=z()}catch(z){J=z}finally{if(G(J,Y),J&&!K)throw J;return Y}}function isWrapped(z){return typeof z==`function`&&typeof z.__original==`function`&&typeof z.__unwrap==`function`&&z.__wrapped===!0}var SemconvStability;(function(z){z[z.STABLE=1]=`STABLE`,z[z.OLD=2]=`OLD`,z[z.DUPLICATE=3]=`DUPLICATE`})(SemconvStability||(SemconvStability={}));function semconvStabilityFromStr(z,G){let K=SemconvStability.OLD,J=G==null?void 0:G.split(`,`).map(z=>z.trim()).filter(z=>z!==``);for(let G of J==null?[]:J)if(G.toLowerCase()===z+`/dup`){K=SemconvStability.DUPLICATE;break}else G.toLowerCase()===z&&(K=SemconvStability.STABLE);return K}function getStringListFromEnv(z){}const otperformance$1=performance,NANOSECOND_DIGITS$1=9,MILLISECONDS_TO_NANOSECONDS$1=Math.pow(10,6),SECOND_TO_NANOSECONDS$2=Math.pow(10,NANOSECOND_DIGITS$1);function millisToHrTime$1(z){let G=z/1e3;return[Math.trunc(G),Math.round(z%1e3*MILLISECONDS_TO_NANOSECONDS$1)]}function hrTime$1(z){return addHrTimes$1(millisToHrTime$1(otperformance$1.timeOrigin),millisToHrTime$1(typeof z==`number`?z:otperformance$1.now()))}function addHrTimes$1(z,G){let K=[z[0]+G[0],z[1]+G[1]];return K[1]>=SECOND_TO_NANOSECONDS$2&&(K[1]-=SECOND_TO_NANOSECONDS$2,K[0]+=1),K}function urlMatches(z,G){return typeof G==`string`?z===G:!!z.match(G)}function isUrlIgnored(z,G){if(!G)return!1;for(let K of G)if(urlMatches(z,K))return!0;return!1}const ATTR_HTTP_HOST=`http.host`,ATTR_HTTP_METHOD=`http.method`,ATTR_HTTP_REQUEST_BODY_SIZE=`http.request.body.size`,ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=`http.request_content_length_uncompressed`,ATTR_HTTP_SCHEME=`http.scheme`,ATTR_HTTP_STATUS_CODE=`http.status_code`,ATTR_HTTP_URL=`http.url`,ATTR_HTTP_USER_AGENT=`http.user_agent`;var EventNames;(function(z){z.METHOD_OPEN=`open`,z.METHOD_SEND=`send`,z.EVENT_ABORT=`abort`,z.EVENT_ERROR=`error`,z.EVENT_LOAD=`loaded`,z.EVENT_TIMEOUT=`timeout`})(EventNames||(EventNames={}));const DIAG_LOGGER=diag$1.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`});function isDocument(z){return typeof Document<`u`&&z instanceof Document}function getXHRBodyLength(z){if(isDocument(z))return new XMLSerializer().serializeToString(document).length;if(typeof z==`string`)return getByteLength(z);if(z instanceof Blob)return z.size;if(z instanceof FormData)return getFormDataSize(z);if(z instanceof URLSearchParams)return getByteLength(z.toString());if(z.byteLength!==void 0)return z.byteLength;DIAG_LOGGER.warn(`unknown body type`)}const TEXT_ENCODER=new TextEncoder;function getByteLength(z){return TEXT_ENCODER.encode(z).byteLength}function getFormDataSize(z){let G=0;for(let[K,J]of z.entries())G+=K.length,J instanceof Blob?G+=J.size:G+=J.length;return G}function normalizeHttpRequestMethod(z){let G=getKnownMethods(),K=z.toUpperCase();return K in G?K:`_OTHER`}const DEFAULT_KNOWN_METHODS={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let knownMethods;function getKnownMethods(){if(knownMethods===void 0){let z;knownMethods=DEFAULT_KNOWN_METHODS}return knownMethods}const HTTP_PORT_FROM_PROTOCOL={"https:":`443`,"http:":`80`};function serverPortFromUrl(z){let G=Number(z.port||HTTP_PORT_FROM_PROTOCOL[z.protocol]);if(G&&!isNaN(G))return G}const VERSION$4=`0.215.0`;var AttributeNames;(function(z){z.HTTP_STATUS_TEXT=`http.status_text`})(AttributeNames||(AttributeNames={}));const OBSERVER_WAIT_TIME_MS=300;var XMLHttpRequestInstrumentation=class extends InstrumentationBase{constructor(z={}){super(`@opentelemetry/instrumentation-xml-http-request`,VERSION$4,z),_defineProperty(this,`component`,`xml-http-request`),_defineProperty(this,`version`,VERSION$4),_defineProperty(this,`moduleName`,this.component),_defineProperty(this,`_tasksCount`,0),_defineProperty(this,`_xhrMem`,new WeakMap),_defineProperty(this,`_usedResources`,new WeakSet),_defineProperty(this,`_semconvStability`,void 0),this._semconvStability=semconvStabilityFromStr(`http`,z==null?void 0:z.semconvStabilityOptIn)}init(){}_addHeaders(z,G){let K=parseUrl(G).href;if(!shouldPropagateTraceHeaders(K,this.getConfig().propagateTraceHeaderCorsUrls)){let z={};propagation.inject(context.active(),z),Object.keys(z).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let J={};propagation.inject(context.active(),J),Object.keys(J).forEach(G=>{z.setRequestHeader(G,String(J[G]))})}_addChildSpan(z,G){context.with(trace$1.setSpan(context.active(),z),()=>{let z=this.tracer.startSpan(`CORS Preflight`,{startTime:G[PerformanceTimingNames.FETCH_START]}),K=!(this._semconvStability&SemconvStability.OLD);addSpanNetworkEvents(z,G,this.getConfig().ignoreNetworkEvents,void 0,K),z.end(G[PerformanceTimingNames.RESPONSE_END])})}_addFinalSpanAttributes(z,G,K){if(this._semconvStability&SemconvStability.OLD){if(G.status!==void 0&&z.setAttribute(ATTR_HTTP_STATUS_CODE,G.status),G.statusText!==void 0&&z.setAttribute(AttributeNames.HTTP_STATUS_TEXT,G.statusText),typeof K==`string`){let G=parseUrl(K);z.setAttribute(ATTR_HTTP_HOST,G.host),z.setAttribute(ATTR_HTTP_SCHEME,G.protocol.replace(`:`,``))}z.setAttribute(ATTR_HTTP_USER_AGENT,navigator.userAgent)}this._semconvStability&SemconvStability.STABLE&&G.status&&z.setAttribute(ATTR_HTTP_RESPONSE_STATUS_CODE,G.status)}_applyAttributesAfterXHR(z,G){let K=this.getConfig().applyCustomAttributesOnSpan;typeof K==`function`&&safeExecuteInTheMiddle(()=>K(z,G),z=>{z&&this._diag.error(`applyCustomAttributesOnSpan`,z)},!0)}_addResourceObserver(z,G){let K=this._xhrMem.get(z);!K||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(K.createdResources={observer:new PerformanceObserver(z=>{let J=z.getEntries(),Y=parseUrl(G);J.forEach(z=>{z.initiatorType===`xmlhttprequest`&&z.name===Y.href&&K.createdResources&&K.createdResources.entries.push(z)})}),entries:[]},K.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(otperformance$1.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(z,G,K,J,Y){if(!K||!J||!Y||!z.createdResources)return;let X=z.createdResources.entries;(!X||!X.length)&&(X=otperformance$1.getEntriesByType(`resource`));let Z=getResource(parseUrl(K).href,J,Y,X,this._usedResources);if(Z.mainRequest){let z=Z.mainRequest;this._markResourceAsUsed(z);let K=Z.corsPreFlightRequest;K&&(this._addChildSpan(G,K),this._markResourceAsUsed(K));let J=!(this._semconvStability&SemconvStability.OLD);addSpanNetworkEvents(G,z,this.getConfig().ignoreNetworkEvents,void 0,J)}}_cleanPreviousSpanInformation(z){let G=this._xhrMem.get(z);if(G){let K=G.callbackToRemoveEvents;K&&K(),this._xhrMem.delete(z)}}_createSpan(z,G,K){if(isUrlIgnored(G,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let J=``,Y=parseUrl(G),X={};if(this._semconvStability&SemconvStability.OLD&&(J=K.toUpperCase(),X[ATTR_HTTP_METHOD]=K,X[ATTR_HTTP_URL]=Y.toString()),this._semconvStability&SemconvStability.STABLE){let z=K,G=normalizeHttpRequestMethod(K);J||(J=G),X[ATTR_HTTP_REQUEST_METHOD]=G,G!==z&&(X[ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=z),X[ATTR_URL_FULL]=Y.toString(),X[ATTR_SERVER_ADDRESS]=Y.hostname;let Z=serverPortFromUrl(Y);Z&&(X[ATTR_SERVER_PORT]=Z)}let Z=this.tracer.startSpan(J,{kind:SpanKind.CLIENT,attributes:X});return Z.addEvent(EventNames.METHOD_OPEN),this._cleanPreviousSpanInformation(z),this._xhrMem.set(z,{span:Z,spanUrl:G}),Z}_markResourceAsUsed(z){this._usedResources.add(z)}_patchOpen(){return z=>{let G=this;return function(...K){let J=K[0],Y=K[1];return G._createSpan(this,Y,J),z.apply(this,K)}}}_patchSend(){let z=this;function G(G,K,J,Y){let X=K.callbackToRemoveEvents;typeof X==`function`&&X();let{span:Z,spanUrl:Q,sendStartTime:ee}=K;Z&&(z._findResourceAndAddNetworkEvents(K,Z,Q,ee,J),Z.addEvent(G,Y),z._addFinalSpanAttributes(Z,K,Q),Z.end(Y),z._tasksCount--),z._clearResources()}function K(K,J,Y,X){let Z=z._xhrMem.get(J);if(!Z)return;if(Z.status=J.status,Z.statusText=J.statusText,z._xhrMem.delete(J),Z.span){let G=Z.span;z._applyAttributesAfterXHR(G,J),z._semconvStability&SemconvStability.STABLE&&(Y?X&&(G.setStatus({code:SpanStatusCode.ERROR,message:X}),G.setAttribute(ATTR_ERROR_TYPE,X)):Z.status&&Z.status>=400&&(G.setStatus({code:SpanStatusCode.ERROR}),G.setAttribute(ATTR_ERROR_TYPE,String(Z.status))))}let Q=hrTime$1(),ee=Date.now();setTimeout(()=>{G(K,Z,Q,ee)},OBSERVER_WAIT_TIME_MS)}function J(){K(EventNames.EVENT_ERROR,this,!0,`error`)}function Y(){K(EventNames.EVENT_ABORT,this,!1)}function X(){K(EventNames.EVENT_TIMEOUT,this,!0,`timeout`)}function Z(){this.status<299?K(EventNames.EVENT_LOAD,this,!1):K(EventNames.EVENT_ERROR,this,!1)}function Q(G){G.removeEventListener(`abort`,Y),G.removeEventListener(`error`,J),G.removeEventListener(`load`,Z),G.removeEventListener(`timeout`,X);let K=z._xhrMem.get(G);K&&(K.callbackToRemoveEvents=void 0)}return G=>function(...K){let ee=z._xhrMem.get(this);if(!ee)return G.apply(this,K);let te=ee.span,ne=ee.spanUrl;if(te&&ne){if(z.getConfig().measureRequestSize&&K!=null&&K[0]){let G=K[0],J=getXHRBodyLength(G);J!==void 0&&(z._semconvStability&SemconvStability.OLD&&te.setAttribute(ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED,J),z._semconvStability&SemconvStability.STABLE&&te.setAttribute(ATTR_HTTP_REQUEST_BODY_SIZE,J))}context.with(trace$1.setSpan(context.active(),te),()=>{z._tasksCount++,ee.sendStartTime=hrTime$1(),te.addEvent(EventNames.METHOD_SEND),this.addEventListener(`abort`,Y),this.addEventListener(`error`,J),this.addEventListener(`load`,Z),this.addEventListener(`timeout`,X),ee.callbackToRemoveEvents=()=>{Q(this),ee.createdResources&&ee.createdResources.observer.disconnect()},z._addHeaders(this,ne),z._addResourceObserver(this,ne)})}return G.apply(this,K)}}enable(){this._diag.debug(`applying patch to`,this.moduleName,this.version),isWrapped(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,`open`),this._diag.debug(`removing previous patch from method open`)),isWrapped(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.debug(`removing previous patch from method send`)),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend())}disable(){this._diag.debug(`removing patch from`,this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}};const _excluded$1=[`omitIfAlreadyPatched`];var MXLXHRInstrumentation=class extends XMLHttpRequestInstrumentation{constructor(z={}){let{omitIfAlreadyPatched:G}=z,K=_objectWithoutProperties(z,_excluded$1);super(_objectSpread2(_objectSpread2({},K),{},{enabled:!1})),_defineProperty(this,`_omitIfAlreadyPatched`,void 0),this._omitIfAlreadyPatched=G,K.enabled&&this.enable()}enable(){if(this._omitIfAlreadyPatched&&(isWrapped$1(XMLHttpRequest.prototype.open)||isWrapped$1(XMLHttpRequest.prototype.send))){this._diag.debug("XMLHttpRequest is already passed and `omitIfAlreadyPatched` is true, skipping enabling this instrumentation");return}super.enable()}};const SUPPRESS_TRACING_KEY$1=createContextKey(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function suppressTracing$1(z){return z.setValue(SUPPRESS_TRACING_KEY$1,!0)}function loggingErrorHandler(){return z=>{diag$1.error(stringifyException(z))}}function stringifyException(z){return typeof z==`string`?z:JSON.stringify(flattenException(z))}function flattenException(z){let G={},K=z;for(;K!==null;)Object.getOwnPropertyNames(K).forEach(z=>{if(G[z])return;let J=K[z];J&&(G[z]=String(J))}),K=Object.getPrototypeOf(K);return G}let delegateHandler=loggingErrorHandler();function globalErrorHandler(z){try{delegateHandler(z)}catch(z){}}const VERSION$3=`2.7.0`,ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`,SDK_INFO={[ATTR_TELEMETRY_SDK_NAME]:`opentelemetry`,[ATTR_PROCESS_RUNTIME_NAME]:`browser`,[ATTR_TELEMETRY_SDK_LANGUAGE]:TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,[ATTR_TELEMETRY_SDK_VERSION]:VERSION$3},otperformance=performance,NANOSECOND_DIGITS=9,MILLISECONDS_TO_NANOSECONDS=Math.pow(10,6),SECOND_TO_NANOSECONDS$1=Math.pow(10,NANOSECOND_DIGITS);function millisToHrTime(z){let G=z/1e3;return[Math.trunc(G),Math.round(z%1e3*MILLISECONDS_TO_NANOSECONDS)]}function hrTime(z){return addHrTimes(millisToHrTime(otperformance.timeOrigin),millisToHrTime(typeof z==`number`?z:otperformance.now()))}function timeInputToHrTime(z){if(isTimeInputHrTime(z))return z;if(typeof z==`number`)return z<otperformance.timeOrigin?hrTime(z):millisToHrTime(z);if(z instanceof Date)return millisToHrTime(z.getTime());throw TypeError(`Invalid input type`)}function isTimeInputHrTime(z){return Array.isArray(z)&&z.length===2&&typeof z[0]==`number`&&typeof z[1]==`number`}function addHrTimes(z,G){let K=[z[0]+G[0],z[1]+G[1]];return K[1]>=SECOND_TO_NANOSECONDS$1&&(K[1]-=SECOND_TO_NANOSECONDS$1,K[0]+=1),K}var ExportResultCode$1;(function(z){z[z.SUCCESS=0]=`SUCCESS`,z[z.FAILED=1]=`FAILED`})(ExportResultCode$1||(ExportResultCode$1={}));var TimeoutError=class z extends Error{constructor(G){super(G),Object.setPrototypeOf(this,z.prototype)}};function callWithTimeout(z,G){let K,J=new Promise(function(z,J){K=setTimeout(function(){J(new TimeoutError(`Operation timed out.`))},G)});return Promise.race([z,J]).then(z=>(clearTimeout(K),z),z=>{throw clearTimeout(K),z})}var Deferred=class{constructor(){_defineProperty(this,`_promise`,void 0),_defineProperty(this,`_resolve`,void 0),_defineProperty(this,`_reject`,void 0),this._promise=new Promise((z,G)=>{this._resolve=z,this._reject=G})}get promise(){return this._promise}resolve(z){this._resolve(z)}reject(z){this._reject(z)}},BindOnceFuture=class{constructor(z,G){_defineProperty(this,`_isCalled`,!1),_defineProperty(this,`_deferred`,new Deferred),_defineProperty(this,`_callback`,void 0),_defineProperty(this,`_that`,void 0),this._callback=z,this._that=G}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...z){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...z)).then(z=>this._deferred.resolve(z),z=>this._deferred.reject(z))}catch(z){this._deferred.reject(z)}}return this._deferred.promise}};let serviceName;function defaultServiceName(){if(serviceName===void 0)try{let z=globalThis.process.argv0;serviceName=z?`unknown_service:${z}`:`unknown_service`}catch(z){serviceName=`unknown_service`}return serviceName}const isPromiseLike=z=>typeof z==`object`&&!!z&&typeof z.then==`function`;var ResourceImpl=class z{static FromAttributeList(G,K){let J=new z({},K);return J._rawAttributes=guardedRawAttributes(G),J._asyncAttributesPending=G.filter(([z,G])=>isPromiseLike(G)).length>0,J}constructor(z,G){var K;_defineProperty(this,`_rawAttributes`,void 0),_defineProperty(this,`_asyncAttributesPending`,!1),_defineProperty(this,`_schemaUrl`,void 0),_defineProperty(this,`_memoizedAttributes`,void 0);let J=(K=z.attributes)==null?{}:K;this._rawAttributes=Object.entries(J).map(([z,G])=>(isPromiseLike(G)&&(this._asyncAttributesPending=!0),[z,G])),this._rawAttributes=guardedRawAttributes(this._rawAttributes),this._schemaUrl=validateSchemaUrl(G==null?void 0:G.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var z=this;return _asyncToGenerator(function*(){if(z.asyncAttributesPending){for(let G=0;G<z._rawAttributes.length;G++){let[K,J]=z._rawAttributes[G];z._rawAttributes[G]=[K,isPromiseLike(J)?yield J:J]}z._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&diag$1.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let z={};for(let[K,J]of this._rawAttributes){if(isPromiseLike(J)){diag$1.debug(`Unsettled resource attribute ${K} skipped`);continue}if(J!=null){var G;z[K]!=null||(z[K]=J)}}return this._asyncAttributesPending||(this._memoizedAttributes=z),z}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(G){if(G==null)return this;let K=mergeSchemaUrl(this,G),J=K?{schemaUrl:K}:void 0;return z.FromAttributeList([...G.getRawAttributes(),...this.getRawAttributes()],J)}};function resourceFromAttributes(z,G){return ResourceImpl.FromAttributeList(Object.entries(z),G)}function defaultResource(){return resourceFromAttributes({[ATTR_SERVICE_NAME]:defaultServiceName(),[ATTR_TELEMETRY_SDK_LANGUAGE]:SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],[ATTR_TELEMETRY_SDK_NAME]:SDK_INFO[ATTR_TELEMETRY_SDK_NAME],[ATTR_TELEMETRY_SDK_VERSION]:SDK_INFO[ATTR_TELEMETRY_SDK_VERSION]})}function guardedRawAttributes(z){return z.map(([z,G])=>isPromiseLike(G)?[z,G.catch(G=>{diag$1.debug(`promise rejection for resource attribute: %s - %s`,z,G)})]:[z,G])}function validateSchemaUrl(z){if(typeof z==`string`||z===void 0)return z;diag$1.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,z)}function mergeSchemaUrl(z,G){let K=z==null?void 0:z.schemaUrl,J=G==null?void 0:G.schemaUrl,Y=K===void 0||K===``,X=J===void 0||J===``;if(Y)return J;if(X||K===J)return K;diag$1.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,K,J)}function isLogAttributeValue(z){return isLogAttributeValueInternal(z,new WeakSet)}function isLogAttributeValueInternal(z,G){if(z==null||typeof z==`string`||typeof z==`number`||typeof z==`boolean`||z instanceof Uint8Array)return!0;if(typeof z==`object`){if(G.has(z))return!1;if(G.add(z),Array.isArray(z))return z.every(z=>isLogAttributeValueInternal(z,G));let K=z;return K.constructor!==Object&&K.constructor!==void 0?!1:Object.values(K).every(z=>isLogAttributeValueInternal(z,G))}return!1}var LogRecordImpl=class{set severityText(z){this._isLogRecordReadonly()||(this._severityText=z)}get severityText(){return this._severityText}set severityNumber(z){this._isLogRecordReadonly()||(this._severityNumber=z)}get severityNumber(){return this._severityNumber}set body(z){this._isLogRecordReadonly()||(this._body=z)}get body(){return this._body}get eventName(){return this._eventName}set eventName(z){this._isLogRecordReadonly()||(this._eventName=z)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(z,G,K){_defineProperty(this,`hrTime`,void 0),_defineProperty(this,`hrTimeObserved`,void 0),_defineProperty(this,`spanContext`,void 0),_defineProperty(this,`resource`,void 0),_defineProperty(this,`instrumentationScope`,void 0),_defineProperty(this,`attributes`,{}),_defineProperty(this,`_severityText`,void 0),_defineProperty(this,`_severityNumber`,void 0),_defineProperty(this,`_body`,void 0),_defineProperty(this,`_eventName`,void 0),_defineProperty(this,`_attributesCount`,0),_defineProperty(this,`_droppedAttributesCount`,0),_defineProperty(this,`_isReadonly`,!1),_defineProperty(this,`_logRecordLimits`,void 0);let{timestamp:J,observedTimestamp:Y,eventName:X,severityNumber:Z,severityText:Q,body:ee,attributes:te={},exception:ne,context:ie}=K,ae=Date.now();if(this.hrTime=timeInputToHrTime(J==null?ae:J),this.hrTimeObserved=timeInputToHrTime(Y==null?ae:Y),ie){let z=trace$1.getSpanContext(ie);z&&isSpanContextValid(z)&&(this.spanContext=z)}this.severityNumber=Z,this.severityText=Q,this.body=ee,this.resource=z.resource,this.instrumentationScope=G,this._logRecordLimits=z.logRecordLimits,this._eventName=X,this.setAttributes(te),ne!=null&&this._setException(ne)}setAttribute(z,G){if(this._isLogRecordReadonly())return this;if(z.length===0)return diag$1.warn(`Invalid attribute key: ${z}`),this;if(!isLogAttributeValue(G))return diag$1.warn(`Invalid attribute value set for key: ${z}`),this;let K=!Object.prototype.hasOwnProperty.call(this.attributes,z);return K&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&diag$1.warn(`Dropping extra attributes.`),this):(this.attributes[z]=this._truncateToSize(G),K&&this._attributesCount++,this)}setAttributes(z){for(let[G,K]of Object.entries(z))this.setAttribute(G,K);return this}setBody(z){return this.body=z,this}setEventName(z){return this.eventName=z,this}setSeverityNumber(z){return this.severityNumber=z,this}setSeverityText(z){return this.severityText=z,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(z){let G=this._logRecordLimits.attributeValueLengthLimit;if(G<=0)return diag$1.warn(`Attribute value limit must be positive, got ${G}`),z;if(z==null)return z;if(typeof z==`string`)return this._truncateToLimitUtil(z,G);if(z instanceof Uint8Array)return z;if(Array.isArray(z))return z.map(z=>this._truncateToSize(z));if(typeof z==`object`){let G={};for(let[K,J]of Object.entries(z))G[K]=this._truncateToSize(J);return G}return z}_setException(z){let G=!1;if(typeof z==`string`||typeof z==`number`)Object.hasOwn(this.attributes,ATTR_EXCEPTION_MESSAGE)||this.setAttribute(ATTR_EXCEPTION_MESSAGE,String(z)),G=!0;else if(z&&typeof z==`object`){let K=z;K.code?(Object.hasOwn(this.attributes,ATTR_EXCEPTION_TYPE)||this.setAttribute(ATTR_EXCEPTION_TYPE,K.code.toString()),G=!0):K.name&&(Object.hasOwn(this.attributes,ATTR_EXCEPTION_TYPE)||this.setAttribute(ATTR_EXCEPTION_TYPE,K.name),G=!0),K.message&&(Object.hasOwn(this.attributes,ATTR_EXCEPTION_MESSAGE)||this.setAttribute(ATTR_EXCEPTION_MESSAGE,K.message),G=!0),K.stack&&(Object.hasOwn(this.attributes,ATTR_EXCEPTION_STACKTRACE)||this.setAttribute(ATTR_EXCEPTION_STACKTRACE,K.stack),G=!0)}G||diag$1.warn(`Failed to record an exception ${z}`)}_truncateToLimitUtil(z,G){return z.length<=G?z:z.substring(0,G)}_isLogRecordReadonly(){return this._isReadonly&&diag$1.warn(`Can not execute the operation on emitted log record`),this._isReadonly}},Logger=class{constructor(z,G){_defineProperty(this,`instrumentationScope`,void 0),_defineProperty(this,`_sharedState`,void 0),_defineProperty(this,`_loggerConfig`,void 0),this.instrumentationScope=z,this._sharedState=G,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(z){var G;let K=this._loggerConfig,J=z.context||context.active(),Y=(G=z.severityNumber)==null?SeverityNumber$1.UNSPECIFIED:G;if(Y!==SeverityNumber$1.UNSPECIFIED&&Y<K.minimumSeverity)return;if(K.traceBased){let z=trace$1.getSpanContext(J);if(z&&isSpanContextValid(z)&&(z.traceFlags&TraceFlags.SAMPLED)!==TraceFlags.SAMPLED)return}let X=new LogRecordImpl(this._sharedState,this.instrumentationScope,_objectSpread2({context:J},z));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(X,J),X._makeReadonly()}enabled(z){let G=this._loggerConfig;if(G.disabled)return!1;let K=z==null?void 0:z.severityNumber;if(typeof K==`number`&&K!==SeverityNumber$1.UNSPECIFIED&&K<G.minimumSeverity)return!1;let J=(z==null?void 0:z.context)||context.active();if(G.traceBased){let z=trace$1.getSpanContext(J);if(z&&isSpanContextValid(z)&&(z.traceFlags&TraceFlags.SAMPLED)!==TraceFlags.SAMPLED)return!1}let Y={context:J,instrumentationScope:this.instrumentationScope,severityNumber:z==null?void 0:z.severityNumber,eventName:z==null?void 0:z.eventName};for(let z of this._sharedState.processors)if(!z.enabled||z.enabled(Y))return!0;return!1}},NoopLogRecordProcessor=class{forceFlush(){return Promise.resolve()}onEmit(z,G){}shutdown(){return Promise.resolve()}enabled(z){return!1}},MultiLogRecordProcessor=class{constructor(z,G){_defineProperty(this,`processors`,void 0),_defineProperty(this,`forceFlushTimeoutMillis`,void 0),this.processors=z,this.forceFlushTimeoutMillis=G}forceFlush(){var z=this;return _asyncToGenerator(function*(){let G=z.forceFlushTimeoutMillis;yield Promise.all(z.processors.map(z=>callWithTimeout(z.forceFlush(),G)))})()}onEmit(z,G){this.processors.forEach(K=>K.onEmit(z,G))}shutdown(){var z=this;return _asyncToGenerator(function*(){yield Promise.all(z.processors.map(z=>z.shutdown()))})()}enabled(z){for(let G of this.processors)if(!G.enabled||G.enabled(z))return!0;return!1}};function getInstrumentationScopeKey(z){return`${z.name}@${z.version||``}:${z.schemaUrl||``}`}const METRIC_OTEL_SDK_LOG_CREATED=`otel.sdk.log.created`;var LoggerMetrics=class{constructor(z){_defineProperty(this,`createdLogs`,void 0),this.createdLogs=z.createCounter(METRIC_OTEL_SDK_LOG_CREATED,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}};const VERSION$2=`0.215.0`,DEFAULT_LOGGER_CONFIG={disabled:!1,minimumSeverity:SeverityNumber$1.UNSPECIFIED,traceBased:!1},DEFAULT_LOGGER_CONFIGURATOR=()=>_objectSpread2({},DEFAULT_LOGGER_CONFIG);var LoggerProviderSharedState=class{constructor(z,G,K,J,Y,X){_defineProperty(this,`loggers`,new Map),_defineProperty(this,`activeProcessor`,void 0),_defineProperty(this,`registeredLogRecordProcessors`,[]),_defineProperty(this,`resource`,void 0),_defineProperty(this,`forceFlushTimeoutMillis`,void 0),_defineProperty(this,`logRecordLimits`,void 0),_defineProperty(this,`processors`,void 0),_defineProperty(this,`loggerMetrics`,void 0),_defineProperty(this,`_loggerConfigurator`,void 0),_defineProperty(this,`_loggerConfigs`,new Map),this.resource=z,this.forceFlushTimeoutMillis=G,this.logRecordLimits=K,this.processors=J,J.length>0?(this.registeredLogRecordProcessors=J,this.activeProcessor=new MultiLogRecordProcessor(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new NoopLogRecordProcessor,this._loggerConfigurator=Y==null?DEFAULT_LOGGER_CONFIGURATOR:Y,this.loggerMetrics=new LoggerMetrics(X?X.getMeter(`@opentelemetry/sdk-logs`,VERSION$2):createNoopMeter())}getLoggerConfig(z){let G=getInstrumentationScopeKey(z),K=this._loggerConfigs.get(G);return K||(K=this._loggerConfigurator(z),this._loggerConfigs.set(G,K),K)}};const DEFAULT_LOGGER_NAME=`unknown`;var LoggerProvider=class{constructor(z={}){var G,K,J,Y,X,Z,Q,ee;_defineProperty(this,`_shutdownOnce`,void 0),_defineProperty(this,`_sharedState`,void 0);let te={resource:(G=z.resource)==null?defaultResource():G,forceFlushTimeoutMillis:(K=z.forceFlushTimeoutMillis)==null?3e4:K,logRecordLimits:{attributeCountLimit:(J=(Y=z.logRecordLimits)==null?void 0:Y.attributeCountLimit)==null?128:J,attributeValueLengthLimit:(X=(Z=z.logRecordLimits)==null?void 0:Z.attributeValueLengthLimit)==null?1/0:X},loggerConfigurator:(Q=z.loggerConfigurator)==null?DEFAULT_LOGGER_CONFIGURATOR:Q,processors:(ee=z.processors)==null?[]:ee,meterProvider:z.meterProvider};this._sharedState=new LoggerProviderSharedState(te.resource,te.forceFlushTimeoutMillis,te.logRecordLimits,te.processors,te.loggerConfigurator,te.meterProvider),this._shutdownOnce=new BindOnceFuture(this._shutdown,this)}getLogger(z,G,K){if(this._shutdownOnce.isCalled)return diag$1.warn(`A shutdown LoggerProvider cannot provide a Logger`),NOOP_LOGGER;z||diag$1.warn(`Logger requested without instrumentation scope name.`);let J=z||DEFAULT_LOGGER_NAME,Y=`${J}@${G||``}:${(K==null?void 0:K.schemaUrl)||``}`;return this._sharedState.loggers.has(Y)||this._sharedState.loggers.set(Y,new Logger({name:J,version:G,schemaUrl:K==null?void 0:K.schemaUrl},this._sharedState)),this._sharedState.loggers.get(Y)}forceFlush(){return this._shutdownOnce.isCalled?(diag$1.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(diag$1.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};function waitForResources(z){return _waitForResources.apply(this,arguments)}function _waitForResources(){return _waitForResources=_asyncToGenerator(function*(z){let G=[];for(let K=0,J=z.length;K<J;K++){let J=z[K];J.resource.asyncAttributesPending&&J.resource.waitForAsyncAttributes&&G.push(J.resource.waitForAsyncAttributes())}G!=null&&G.length>0&&(yield Promise.all(G))}),_waitForResources.apply(this,arguments)}var ExportOperation=class{constructor(z,G,K){_defineProperty(this,`_exportCompleted`,void 0),_defineProperty(this,`_exportScheduledPromise`,void 0),_defineProperty(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(z=>{this._exportScheduledResolve=z}),this._exportCompleted=this._executeExport(z,G,K)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(z,G,K){var J=this;return _asyncToGenerator(function*(){try{yield waitForResources(G),yield context.with(suppressTracing$1(context.active()),_asyncToGenerator(function*(){return J._exportWithTimeout(z,G,K)}))}catch(z){globalErrorHandler(z),J._exportScheduledResolve()}})()}_exportWithTimeout(z,G,K){var J=this;return _asyncToGenerator(function*(){return new Promise((Y,X)=>{let Z=setTimeout(()=>{X(Error(`Timeout`))},K);z.export(G,z=>{if(clearTimeout(Z),z.code===ExportResultCode$1.SUCCESS)Y();else{var G;X((G=z.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):G)}}),J._exportScheduledResolve()})})()}},BatchLogRecordProcessorBase=class{constructor(z,G){var K,J,Y,X;_defineProperty(this,`_maxExportBatchSize`,void 0),_defineProperty(this,`_maxQueueSize`,void 0),_defineProperty(this,`_scheduledDelayMillis`,void 0),_defineProperty(this,`_exportTimeoutMillis`,void 0),_defineProperty(this,`_exporter`,void 0),_defineProperty(this,`_currentExport`,null),_defineProperty(this,`_finishedLogRecords`,[]),_defineProperty(this,`_timer`,void 0),_defineProperty(this,`_shutdownOnce`,void 0),_defineProperty(this,`_flushing`,!1),this._exporter=z,this._maxExportBatchSize=(K=G==null?void 0:G.maxExportBatchSize)==null?512:K,this._maxQueueSize=(J=G==null?void 0:G.maxQueueSize)==null?2048:J,this._scheduledDelayMillis=(Y=G==null?void 0:G.scheduledDelayMillis)==null?5e3:Y,this._exportTimeoutMillis=(X=G==null?void 0:G.exportTimeoutMillis)==null?3e4:X,this._shutdownOnce=new BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(diag$1.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(z){this._shutdownOnce.isCalled||this._addToBuffer(z)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(z){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(z),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var z=this;return _asyncToGenerator(function*(){z.onShutdown(),yield z._flushAll(),yield z._exporter.shutdown()})()}_flushAll(){var z=this;return _asyncToGenerator(function*(){if(z._flushing)return;z._flushing=!0;let G=z._finishedLogRecords;for(z._finishedLogRecords=[],z._clearTimer(),z._currentExport!==null&&(yield z._exporter.forceFlush(),yield z._currentExport.exportCompleted,z._currentExport=null);G.length>0;){let K;G.length<=z._maxExportBatchSize?(K=G,G=[]):K=G.splice(0,z._maxExportBatchSize);let J=new ExportOperation(z._exporter,K,z._exportTimeoutMillis);z._currentExport=J;try{yield J.exportScheduled,yield z._exporter.forceFlush(),yield J.exportCompleted}catch(z){globalErrorHandler(z)}finally{z._currentExport=null}}z._flushing=!1,z._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let z=this._finishedLogRecords;return this._finishedLogRecords=[],z}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let z=this._extractBatch();if(z===null)return;let G=new ExportOperation(this._exporter,z,this._exportTimeoutMillis);this._currentExport=G,G.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(z=>{this._currentExport=null,globalErrorHandler(z),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},BatchLogRecordProcessor=class extends BatchLogRecordProcessorBase{constructor(z,G){super(z,G),_defineProperty(this,`_visibilityChangeListener`,void 0),_defineProperty(this,`_pageHideListener`,void 0),this._onInit(G)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(z){(z==null?void 0:z.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}};const ATTR_SESSION_ID=`session.id`;var SessionSpanProcessor=class{constructor(z){_defineProperty(this,`_sessionIdProvider`,void 0),this._sessionIdProvider=z}forceFlush(){return _asyncToGenerator(function*(){})()}onStart(z,G){var K;let J=(K=this._sessionIdProvider)==null?void 0:K.getSessionId();J&&z.setAttribute(ATTR_SESSION_ID,J)}onEnd(z){}shutdown(){return _asyncToGenerator(function*(){})()}};function createSessionSpanProcessor(z){return new SessionSpanProcessor(z)}const DEFAULT_CONCURRENCY=5,DEFAULT_MXL_EXPORTER_CONFIG={compression:`gzip`,keepalive:!0,concurrencyLimit:DEFAULT_CONCURRENCY,timeoutMillis:30*1e3},getMXLHeaders=(z,G)=>({"X-MXL-AID":z,"X-MXL-DID":G}),getDataURL=(z,G)=>G||`http://mxl-otelcol.service-availability.apps.ocpthikadev01.safaricom.net`,VERSION$1=`1.9.1`,re=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function _makeCompatibilityCheck(z){let G=new Set([z]),K=new Set,J=z.match(re);if(!J)return()=>!1;let Y={major:+J[1],minor:+J[2],patch:+J[3],prerelease:J[4]};if(Y.prerelease!=null)return function(G){return G===z};function X(z){return K.add(z),!1}function Z(z){return G.add(z),!0}return function(z){if(G.has(z))return!0;if(K.has(z))return!1;let J=z.match(re);if(!J)return X(z);let Q={major:+J[1],minor:+J[2],patch:+J[3],prerelease:J[4]};return Q.prerelease!=null||Y.major!==Q.major?X(z):Y.major===0?Y.minor===Q.minor&&Y.patch<=Q.patch?Z(z):X(z):Y.minor<=Q.minor?Z(z):X(z)}}const isCompatible=_makeCompatibilityCheck(VERSION$1),major=VERSION$1.split(`.`)[0],GLOBAL_OPENTELEMETRY_API_KEY=Symbol.for(`opentelemetry.js.api.${major}`),_global=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function registerGlobal(z,G,K,J=!1){var Y;let X=_global[GLOBAL_OPENTELEMETRY_API_KEY]=(Y=_global[GLOBAL_OPENTELEMETRY_API_KEY])==null?{version:VERSION$1}:Y;if(!J&&X[z]){let G=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${z}`);return K.error(G.stack||G.message),!1}if(X.version!==VERSION$1){let G=Error(`@opentelemetry/api: Registration of version v${X.version} for ${z} does not match previously registered API v${VERSION$1}`);return K.error(G.stack||G.message),!1}return X[z]=G,K.debug(`@opentelemetry/api: Registered a global for ${z} v${VERSION$1}.`),!0}function getGlobal(z){var G,K;let J=(G=_global[GLOBAL_OPENTELEMETRY_API_KEY])==null?void 0:G.version;if(!(!J||!isCompatible(J)))return(K=_global[GLOBAL_OPENTELEMETRY_API_KEY])==null?void 0:K[z]}function unregisterGlobal(z,G){G.debug(`@opentelemetry/api: Unregistering a global for ${z} v${VERSION$1}.`);let K=_global[GLOBAL_OPENTELEMETRY_API_KEY];K&&delete K[z]}var DiagComponentLogger=class{constructor(z){this._namespace=z.namespace||`DiagComponentLogger`}debug(...z){return logProxy(`debug`,this._namespace,z)}error(...z){return logProxy(`error`,this._namespace,z)}info(...z){return logProxy(`info`,this._namespace,z)}warn(...z){return logProxy(`warn`,this._namespace,z)}verbose(...z){return logProxy(`verbose`,this._namespace,z)}};function logProxy(z,G,K){let J=getGlobal(`diag`);if(J)return J[z](G,...K)}var DiagLogLevel$1;(function(z){z[z.NONE=0]=`NONE`,z[z.ERROR=30]=`ERROR`,z[z.WARN=50]=`WARN`,z[z.INFO=60]=`INFO`,z[z.DEBUG=70]=`DEBUG`,z[z.VERBOSE=80]=`VERBOSE`,z[z.ALL=9999]=`ALL`})(DiagLogLevel$1||(DiagLogLevel$1={}));function createLogLevelDiagLogger(z,G){z<DiagLogLevel$1.NONE?z=DiagLogLevel$1.NONE:z>DiagLogLevel$1.ALL&&(z=DiagLogLevel$1.ALL),G||(G={});function K(K,J){let Y=G[K];return typeof Y==`function`&&z>=J?Y.bind(G):function(){}}return{error:K(`error`,DiagLogLevel$1.ERROR),warn:K(`warn`,DiagLogLevel$1.WARN),info:K(`info`,DiagLogLevel$1.INFO),debug:K(`debug`,DiagLogLevel$1.DEBUG),verbose:K(`verbose`,DiagLogLevel$1.VERBOSE)}}const diag=class z{static instance(){return this._instance||(this._instance=new z),this._instance}constructor(){function z(z){return function(...G){let K=getGlobal(`diag`);if(K)return K[z](...G)}}let G=this;G.setLogger=(z,K={logLevel:DiagLogLevel$1.INFO})=>{var J;if(z===G){var Y;let z=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return G.error((Y=z.stack)==null?z.message:Y),!1}typeof K==`number`&&(K={logLevel:K});let X=getGlobal(`diag`),Z=createLogLevelDiagLogger((J=K.logLevel)==null?DiagLogLevel$1.INFO:J,z);if(X&&!K.suppressOverrideMessage){var Q;let z=(Q=Error().stack)==null?`<failed to generate stacktrace>`:Q;X.warn(`Current logger will be overwritten from ${z}`),Z.warn(`Current logger will overwrite one already registered from ${z}`)}return registerGlobal(`diag`,Z,G,!0)},G.disable=()=>{unregisterGlobal(`diag`,G)},G.createComponentLogger=z=>new DiagComponentLogger(z),G.verbose=z(`verbose`),G.debug=z(`debug`),G.info=z(`info`),G.warn=z(`warn`),G.error=z(`error`)}}.instance();function createResource(z,G){let K={attributes:toAttributes(z.attributes,G),droppedAttributesCount:0},J=z.schemaUrl;return J&&J!==``&&(K.schemaUrl=J),K}function createInstrumentationScope(z){return{name:z.name,version:z.version}}function toAttributes(z,G){return Object.keys(z).map(K=>toKeyValue(K,z[K],G))}function toKeyValue(z,G,K){return{key:z,value:toAnyValue(G,K)}}function toAnyValue(z,G){let K=typeof z;if(K===`string`)return{stringValue:z};if(K===`number`)return Number.isInteger(z)?{intValue:z}:{doubleValue:z};if(K===`boolean`)return{boolValue:z};if(z instanceof Uint8Array)return{bytesValue:G.encodeUint8Array(z)};if(Array.isArray(z)){let K=Array(z.length);for(let J=0;J<z.length;J++)K[J]=toAnyValue(z[J],G);return{arrayValue:{values:K}}}if(K===`object`&&z!=null){let K=Object.keys(z),J=Array(K.length);for(let Y=0;Y<K.length;Y++)J[Y]={key:K[Y],value:toAnyValue(z[K[Y]],G)};return{kvlistValue:{values:J}}}return{}}const SECOND_TO_NANOSECONDS=Math.pow(10,9);function hrTimeToNanoseconds(z){return z[0]*SECOND_TO_NANOSECONDS+z[1]}function hrTimeToNanos(z){let G=BigInt(1e9);return BigInt(Math.trunc(z[0]))*G+BigInt(Math.trunc(z[1]))}function encodeAsString(z){return hrTimeToNanos(z).toString()}const encodeTimestamp=typeof BigInt<`u`?encodeAsString:hrTimeToNanoseconds;function identity(z){return z}const JSON_ENCODER={encodeHrTime:encodeTimestamp,encodeSpanContext:identity,encodeOptionalSpanContext:identity,encodeUint8Array:z=>{if(typeof Buffer<`u`)return Buffer.from(z).toString(`base64`);let G=Array(z.length);for(let K=0;K<z.length;K++)G[K]=String.fromCharCode(z[K]);return btoa(G.join(``))}};function buildSpanFlagsFrom(z,G){let K=z&255|256;return G&&(K|=512),K}function sdkSpanToOtlpSpan(z,G){var K,J,Y,X;let Z=z.spanContext(),Q=z.status,ee=(K=z.parentSpanContext)!=null&&K.spanId?G.encodeSpanContext((J=z.parentSpanContext)==null?void 0:J.spanId):void 0;return{traceId:G.encodeSpanContext(Z.traceId),spanId:G.encodeSpanContext(Z.spanId),parentSpanId:ee,traceState:(Y=Z.traceState)==null?void 0:Y.serialize(),name:z.name,kind:z.kind==null?0:z.kind+1,startTimeUnixNano:G.encodeHrTime(z.startTime),endTimeUnixNano:G.encodeHrTime(z.endTime),attributes:toAttributes(z.attributes,G),droppedAttributesCount:z.droppedAttributesCount,events:z.events.map(z=>toOtlpSpanEvent(z,G)),droppedEventsCount:z.droppedEventsCount,status:{code:Q.code,message:Q.message},links:z.links.map(z=>toOtlpLink(z,G)),droppedLinksCount:z.droppedLinksCount,flags:buildSpanFlagsFrom(Z.traceFlags,(X=z.parentSpanContext)==null?void 0:X.isRemote)}}function toOtlpLink(z,G){var K;return{attributes:z.attributes?toAttributes(z.attributes,G):[],spanId:G.encodeSpanContext(z.context.spanId),traceId:G.encodeSpanContext(z.context.traceId),traceState:(K=z.context.traceState)==null?void 0:K.serialize(),droppedAttributesCount:z.droppedAttributesCount||0,flags:buildSpanFlagsFrom(z.context.traceFlags,z.context.isRemote)}}function toOtlpSpanEvent(z,G){return{attributes:z.attributes?toAttributes(z.attributes,G):[],name:z.name,timeUnixNano:G.encodeHrTime(z.time),droppedAttributesCount:z.droppedAttributesCount||0}}function createExportTraceServiceRequest(z,G){return{resourceSpans:spanRecordsToResourceSpans(z,G)}}function createResourceMap$1(z){let G=new Map;for(let K of z){let z=G.get(K.resource);z||(z=new Map,G.set(K.resource,z));let J=`${K.instrumentationScope.name}@${K.instrumentationScope.version||``}:${K.instrumentationScope.schemaUrl||``}`,Y=z.get(J);Y||(Y=[],z.set(J,Y)),Y.push(K)}return G}function spanRecordsToResourceSpans(z,G){let K=createResourceMap$1(z),J=[],Y=K.entries(),X=Y.next();for(;!X.done;){let[z,K]=X.value,Z=[],Q=K.values(),ee=Q.next();for(;!ee.done;){let z=ee.value;if(z.length>0){let K=z.map(z=>sdkSpanToOtlpSpan(z,G));Z.push({scope:createInstrumentationScope(z[0].instrumentationScope),spans:K,schemaUrl:z[0].instrumentationScope.schemaUrl})}ee=Q.next()}let te=createResource(z,G),ne={resource:te,scopeSpans:Z,schemaUrl:te.schemaUrl};J.push(ne),X=Y.next()}return J}function createExportLogsServiceRequest(z,G){return{resourceLogs:logRecordsToResourceLogs(z,G)}}function createResourceMap(z){let G=new Map;for(let K of z){let{resource:z,instrumentationScope:{name:J,version:Y=``,schemaUrl:X=``}}=K,Z=G.get(z);Z||(Z=new Map,G.set(z,Z));let Q=`${J}@${Y}:${X}`,ee=Z.get(Q);ee||(ee=[],Z.set(Q,ee)),ee.push(K)}return G}function logRecordsToResourceLogs(z,G){let K=createResourceMap(z);return Array.from(K,([z,K])=>{let J=createResource(z,G);return{resource:J,scopeLogs:Array.from(K,([,z])=>({scope:createInstrumentationScope(z[0].instrumentationScope),logRecords:z.map(z=>toLogRecord(z,G)),schemaUrl:z[0].instrumentationScope.schemaUrl})),schemaUrl:J.schemaUrl}})}function toLogRecord(z,G){var K,J,Y;return{timeUnixNano:G.encodeHrTime(z.hrTime),observedTimeUnixNano:G.encodeHrTime(z.hrTimeObserved),severityNumber:toSeverityNumber(z.severityNumber),severityText:z.severityText,body:toAnyValue(z.body,G),eventName:z.eventName,attributes:toLogAttributes(z.attributes,G),droppedAttributesCount:z.droppedAttributesCount,flags:(K=z.spanContext)==null?void 0:K.traceFlags,traceId:G.encodeOptionalSpanContext((J=z.spanContext)==null?void 0:J.traceId),spanId:G.encodeOptionalSpanContext((Y=z.spanContext)==null?void 0:Y.spanId)}}function toSeverityNumber(z){return z}function toLogAttributes(z,G){return Object.keys(z).map(K=>toKeyValue(K,z[K],G))}const JsonLogsSerializer={serializeRequest:z=>{let G=createExportLogsServiceRequest(z,JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(G))},deserializeResponse:z=>{if(z.length===0)return{};let G=new TextDecoder;try{return JSON.parse(G.decode(z))}catch(z){return diag.warn(`Failed to parse logs export response: ${z.message}. Returning empty response`),{}}}},JsonTraceSerializer={serializeRequest:z=>{let G=createExportTraceServiceRequest(z,JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(G))},deserializeResponse:z=>{if(z.length===0)return{};let G=new TextDecoder;try{return JSON.parse(G.decode(z))}catch(z){return diag.warn(`Failed to parse trace export response: ${z.message}. Returning empty response`),{}}}};var BaseFetchExporter=class{constructor(z){this._delegate=z}export(z,G){this._delegate.export(z,G)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},OTLPExporterError=class extends Error{constructor(z,G,K){super(z),_defineProperty(this,`code`,void 0),_defineProperty(this,`name`,`OTLPExporterError`),_defineProperty(this,`data`,void 0),this.data=K,this.code=G}},BoundedQueueExportPromiseHandler=class{constructor(z){_defineProperty(this,`_concurrencyLimit`,void 0),_defineProperty(this,`_sendingPromises`,[]),this._concurrencyLimit=z}pushPromise(z){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(z);let G=()=>{let G=this._sendingPromises.indexOf(z);this._sendingPromises.splice(G,1)};z.then(G,G)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var z=this;return _asyncToGenerator(function*(){yield Promise.all(z._sendingPromises)})()}};function createBoundedQueueExportPromiseHandler(z){return new BoundedQueueExportPromiseHandler(z.concurrencyLimit)}var ExportResultCode;(function(z){z[z.SUCCESS=0]=`SUCCESS`,z[z.FAILED=1]=`FAILED`})(ExportResultCode||(ExportResultCode={}));function isPartialSuccessResponse(z){return Object.prototype.hasOwnProperty.call(z,`partialSuccess`)}function createLoggingPartialSuccessResponseHandler(){return{handleResponse(z){z==null||!isPartialSuccessResponse(z)||z.partialSuccess==null||Object.keys(z.partialSuccess).length===0||diag$1.warn(`Received Partial Success response:`,JSON.stringify(z.partialSuccess))}}}var OTLPExportDelegate=class{constructor(z,G,K,J,Y){_defineProperty(this,`_diagLogger`,void 0),_defineProperty(this,`_transport`,void 0),_defineProperty(this,`_serializer`,void 0),_defineProperty(this,`_responseHandler`,void 0),_defineProperty(this,`_promiseQueue`,void 0),_defineProperty(this,`_timeout`,void 0),this._transport=z,this._serializer=G,this._responseHandler=K,this._promiseQueue=J,this._timeout=Y,this._diagLogger=diag$1.createComponentLogger({namespace:`OTLPExportDelegate`})}export(z,G){if(this._diagLogger.debug(`items to be sent`,z),this._promiseQueue.hasReachedLimit()){G({code:ExportResultCode.FAILED,error:Error(`Concurrent export limit reached`)});return}let K=this._serializer.serializeRequest(z);if(K==null){G({code:ExportResultCode.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(K,this._timeout).then(z=>{if(z.status===`success`){if(z.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(z.data))}catch(G){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,G,z.data)}G({code:ExportResultCode.SUCCESS});return}else if(z.status===`failure`&&z.error){G({code:ExportResultCode.FAILED,error:z.error});return}else if(z.status===`retryable`){var K;G({code:ExportResultCode.FAILED,error:(K=z.error)==null?new OTLPExporterError(`Export failed with retryable status`):K})}else G({code:ExportResultCode.FAILED,error:new OTLPExporterError(`Export failed with unknown error`)})},z=>G({code:ExportResultCode.FAILED,error:z})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var z=this;return _asyncToGenerator(function*(){z._diagLogger.debug(`shutdown started`),yield z.forceFlush(),z._transport.shutdown()})()}};function createOtlpExportDelegate(z,G){return new OTLPExportDelegate(z.transport,z.serializer,createLoggingPartialSuccessResponseHandler(),z.promiseHandler,G.timeout)}function createOtlpNetworkExportDelegate(z,G,K){return createOtlpExportDelegate({transport:K,serializer:G,promiseHandler:createBoundedQueueExportPromiseHandler(z)},{timeout:z.timeoutMillis})}const KEEPALIVE_BYTE_BUDGET=49152,MAX_KEEPALIVE_REQUESTS=9;let inflightKeepaliveBytes=0,inflightKeepaliveCount=0;var FetchTransport=class z{constructor(z){this._config=z}static _compressRequest(z){return _asyncToGenerator(function*(){let G=new CompressionStream(`gzip`),K=G.writable.getWriter();K.write(z),K.close();let J=[],Y=G.readable.getReader(),X=!1;for(;!X;){let z=yield Y.read();z.value&&J.push(z.value),X=z.done}let Z=new Uint8Array(J.reduce((z,G)=>z+G.length,0)),Q=0;for(let z of J)Z.set(z,Q),Q+=z.length;return Z})()}send(z,G){return this._asyncSend(z,G)}shutdown(){}_asyncSend(G,K){var J=this;return _asyncToGenerator(function*(){let Y=G,X=_objectSpread2({"Content-Type":`application/json`},J._config.headers),Z,Q;if(`timeout`in AbortSignal)Z=AbortSignal.timeout(K);else{let z=new AbortController;Z=z.signal,Q=setTimeout(()=>{z.abort(new DOMException(`TimeoutError`,`TimeoutError`))},K)}let ee=!1;try{if(J._config.compression===`gzip`){try{Y=yield z._compressRequest(G)}catch(z){let G=z instanceof Error?z:Error(String(z));return diag$1.warn(`Fetch transport gzip compression failed: ${G.message}`),{status:`failure`,error:G}}X[`Content-Encoding`]=`gzip`,X[`Content-Length`]=Y.length.toString()}let K=inflightKeepaliveBytes+Y.byteLength>KEEPALIVE_BYTE_BUDGET;if(ee=!K&&!(inflightKeepaliveCount>=MAX_KEEPALIVE_REQUESTS),ee)inflightKeepaliveBytes+=Y.byteLength,inflightKeepaliveCount++;else{let z=K?`inflight bytes (${inflightKeepaliveBytes} + ${Y.byteLength}) would exceed ${KEEPALIVE_BYTE_BUDGET}B budget`:`concurrent count (${inflightKeepaliveCount}) at limit of ${MAX_KEEPALIVE_REQUESTS}`;diag$1.debug(`Sending without keepalive: ${z}`)}let Q=yield fetch(J._config.url,{method:`POST`,keepalive:ee,headers:X,body:Y,signal:Z});if(Q.ok)return{status:`success`};let te=Error(`${Q.status} Fetch request failed`),ne=`Fetch transport received HTTP ${Q.status} (keepalive=${ee})`;return Q.status>=500?(diag$1.debug(ne),{status:`retryable`,error:te}):(diag$1.warn(ne),{status:`failure`,error:te})}catch(z){let G=z instanceof Error?z:Error(String(z)),K=G instanceof TypeError||G instanceof DOMException&&G.name===`TimeoutError`,J=`Fetch transport failed (keepalive=${ee}): ${G.message}`;return K?diag$1.debug(J):diag$1.warn(J),{status:K?`retryable`:`failure`,error:G}}finally{Q!==void 0&&clearTimeout(Q),ee&&(inflightKeepaliveBytes-=Y.byteLength,inflightKeepaliveCount--)}})()}};const createFetchTransport=z=>new FetchTransport(z),MAX_ATTEMPTS=5,INITIAL_BACKOFF=1e3,MAX_BACKOFF=5e3,BACKOFF_MULTIPLIER=1.5,JITTER=20,getJitter=()=>2*JITTER*Math.random()-JITTER;var RetryingTransport=class{constructor(z,G=new OTelPerformanceManager){this._transport=z,this._perf=G}send(z,G){var K=this;return _asyncToGenerator(function*(){let J=K._perf.getNowMillis()+G,Y=yield K._transport.send(z,G),X=MAX_ATTEMPTS,Z=INITIAL_BACKOFF;for(;Y.status===`retryable`&&X>0;){var Q;X--;let G=Math.max(Math.min(Z,MAX_BACKOFF)+getJitter(),0);Z*=BACKOFF_MULTIPLIER;let ee=(Q=Y.retryInMillis)==null?G:Q,te=J-K._perf.getNowMillis();if(ee>te)return Y;Y=yield K._retry(z,te,ee)}return Y})()}shutdown(){this._transport.shutdown()}_retry(z,G,K){return new Promise((J,Y)=>{setTimeout(()=>{this._transport.send(z,G).then(J,Y)},K)})}};const createRetryingTransport=z=>{var G;return new RetryingTransport(z.transport,(G=z.perf)==null?new OTelPerformanceManager:G)},createOtlpBrowserFetchExportDelegate=(z,G)=>createOtlpNetworkExportDelegate(z,G,createRetryingTransport({transport:createFetchTransport(z)}));var OTLPFetchLogExporter=class extends BaseFetchExporter{constructor(z){super(createOtlpBrowserFetchExportDelegate(z,JsonLogsSerializer))}};const getLogEndpoint=(z,G)=>`${getDataURL(z,G)}/v1/logs`;var MXLLogExporter=class extends OTLPFetchLogExporter{constructor({appID:z,userID:G,mxlDataURL:K}){super(_objectSpread2(_objectSpread2({},DEFAULT_MXL_EXPORTER_CONFIG),{},{headers:getMXLHeaders(z,G),url:getLogEndpoint(z,K)}))}},OTLPFetchTraceExporter=class extends BaseFetchExporter{constructor(z){super(createOtlpBrowserFetchExportDelegate(_objectSpread2(_objectSpread2({},z),{},{compression:`gzip`}),JsonTraceSerializer))}};const getTraceEndpoint=(z,G)=>`${getDataURL(z,G)}/v1/traces`;var MXLTraceExporter=class extends OTLPFetchTraceExporter{constructor({appID:z,userID:G,mxlDataURL:K}){super(_objectSpread2(_objectSpread2({},DEFAULT_MXL_EXPORTER_CONFIG),{},{headers:getMXLHeaders(z,G),url:getTraceEndpoint(z,K)}))}},BrowserLogRecordProcessor=class{constructor({urlDocument:z=window.document}={}){_defineProperty(this,`_urlDocument`,void 0),this._urlDocument=z}forceFlush(){return Promise.resolve(void 0)}onEmit(z){z.setAttribute(KEY_BROWSER_URL_FULL,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}},BrowserSpanProcessor=class{constructor({urlDocument:z=window.document}={}){_defineProperty(this,`_urlDocument`,void 0),this._urlDocument=z}forceFlush(){return Promise.resolve(void 0)}onEnd(z){z.attributes[KEY_BROWSER_URL_FULL]=this._urlDocument.URL}onStart(){}shutdown(){return Promise.resolve(void 0)}},IdentifiableSessionLogRecordProcessor=class{constructor({spanSessionManager:z}){_defineProperty(this,`_spanSessionManager`,void 0),this._spanSessionManager=z}forceFlush(){return Promise.resolve(void 0)}onEmit(z){z.setAttributes({[ATTR_LOG_RECORD_UID]:generateUUID(),[ATTR_SESSION_ID$1]:this._spanSessionManager.getSessionId(),[ATTR_SESSION_PREVIOUS_ID]:this._spanSessionManager.getPreviousSessionId()})}shutdown(){return Promise.resolve(void 0)}},LogRecordScrubProcessor=class{constructor({attributeScrubbers:z}){_defineProperty(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=z}forceFlush(){return Promise.resolve(void 0)}onEmit(z){this._attributeScrubbers.forEach(G=>{let K=z.attributes[G.key];K&&typeof K==`string`&&z.setAttribute(G.key,G.scrub(K))})}shutdown(){return Promise.resolve(void 0)}},MXLLogRecordProcessor=class{constructor({urlDocument:z=window.document}={}){_defineProperty(this,`_urlDocument`,void 0),this._urlDocument=z}forceFlush(){return Promise.resolve(void 0)}onEmit(z){z.attributes[KEY_MXL_TYPE]||z.setAttribute(KEY_MXL_TYPE,MXL_TYPES.SystemLog),z.setAttribute(ATTR_URL_FULL,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}};const isNetworkSpan=z=>{if((z.attributes[ATTR_HTTP_REQUEST_METHOD]||z.attributes[SEMATTRS_HTTP_METHOD])&&(typeof z.attributes[ATTR_HTTP_RESPONSE_STATUS_CODE]==`number`||typeof z.attributes[SEMATTRS_HTTP_STATUS_CODE]==`number`)){var G;let K=(G=z.attributes[ATTR_URL_FULL])==null?z.attributes[SEMATTRS_HTTP_URL]:G;return typeof K==`string`&&K.includes(`://`)}return!1};var MXLNetworkSpanProcessor=class{forceFlush(){return Promise.resolve(void 0)}onEnd(z){if(isNetworkSpan(z)){var G,K,J,Y,X,Z,Q,ee,te,ne;z.attributes[KEY_MXL_TYPE]=MXL_TYPES.Network,(G=z.attributes)[ATTR_URL_FULL]!=null||(G[ATTR_URL_FULL]=z.attributes[SEMATTRS_HTTP_URL]),(J=z.attributes)[ATTR_HTTP_RESPONSE_STATUS_CODE]!=null||(J[ATTR_HTTP_RESPONSE_STATUS_CODE]=z.attributes[SEMATTRS_HTTP_STATUS_CODE]),(X=z.attributes)[ATTR_HTTP_REQUEST_METHOD]!=null||(X[ATTR_HTTP_REQUEST_METHOD]=z.attributes[SEMATTRS_HTTP_METHOD]),(Q=z.attributes)[ATTR_HTTP_RESPONSE_BODY_SIZE]!=null||(Q[ATTR_HTTP_RESPONSE_BODY_SIZE]=z.attributes[SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH]),(te=z.attributes)[ATTR_HTTP_REQUEST_BODY_SIZE$2]!=null||(te[ATTR_HTTP_REQUEST_BODY_SIZE$2]=z.attributes[SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH])}}onStart(){}shutdown(){return Promise.resolve(void 0)}};const isSessionSpan=z=>z.attributes[KEY_MXL_TYPE]===MXL_TYPES.Session,exportFailureAttributeKey=(z,G)=>`mxl.${G===`current`?`export_failed`:`previous_export_failed`}.${z}`;var MXLSessionBatchedSpanProcessor=class{constructor({resource:z,exporter:G,limitManager:K,spanSessionManager:J,storage:Y=window.localStorage,storedSpansExpireTimeoutMS:X,diag:Z=diag$1.createComponentLogger({namespace:`MXLSessionBatchedSpanProcessor`})}){_defineProperty(this,`_shutdownOnce`,void 0),_defineProperty(this,`_pendingSpans`,[]),_defineProperty(this,`_exporter`,void 0),_defineProperty(this,`_limitManager`,void 0),_defineProperty(this,`_spanStorage`,void 0),_defineProperty(this,`_spanSessionManager`,void 0),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`_shutdown`,()=>(this._spanStorage.destroy(),this._exporter.shutdown())),this._diag=Z,this._exporter=G,this._shutdownOnce=new BindOnceFuture$2(this._shutdown,this),this._limitManager=K,this._spanSessionManager=J,this._spanStorage=new MXLSpanStorage({resource:z,storage:Y,diag:Z,onExpiredSpansExport:z=>{this._exportSpans(z)},storedSpansExpireTimeoutMS:X,spanSessionManager:J})}forceFlush(){return this._diag.debug(`forceFlush called for MXLSessionBatchedSpanProcessor. This is a no op`),Promise.resolve(void 0)}onEnd(z){if(this._shutdownOnce.isCalled){this._diag.debug(`span ended after processor shutdown. Ignoring span.`);return}if(isSessionSpan(z))this._diag.debug(`session span ended. Exporting all pending spans.`),this._exportSpans([z,...this._pendingSpans]),this._pendingSpans=[];else{if(this._diag.debug(`non-session span ended. Adding to pending spans queue.`),this._limitManager.dropReadableSpan(z))return;this._pendingSpans.push(z)}}_exportSpans(z){internal._export(this._exporter,z).then(z=>{if(z.code===ExportResultCode$3.FAILED){var G;let K=((G=z.error)==null?void 0:G.message)||`unknown error`,J=`unknown`;K===`Concurrent export limit reached`?J=`concurrent_limit`:K===`Fetch request errored`&&(J=`fetch_error`),this._spanSessionManager.incrSessionCountForKey(exportFailureAttributeKey(J,`current`)),this._spanSessionManager.incrNextSessionCountForKey(exportFailureAttributeKey(J,`previous`)),this._diag.error(`spans failed to export: ${K}`)}}).catch(z=>{let G=`unknown error`;z&&z instanceof Error?G=z.message:typeof z==`string`&&(G=z),this._spanSessionManager.incrSessionCountForKey(exportFailureAttributeKey(`unknown`,`current`)),this._spanSessionManager.incrNextSessionCountForKey(exportFailureAttributeKey(`unknown`,`previous`)),this._diag.error(`spans failed to export: ${G}`)})}onStart(){}getPendingSpansCount(){return this._pendingSpans.length}storePendingSpans(z,G){this._spanStorage.storePendingSpans(z,G,this._pendingSpans)}clearStoredSpans(z){this._spanStorage.clearStoredSpans(z)}shutdown(){return this._shutdownOnce.call()}},PageLogRecordProcessor=class{constructor({pageManager:z}){_defineProperty(this,`_pageManager`,void 0),this._pageManager=z}forceFlush(){return Promise.resolve(void 0)}onEmit(z){if(!z.attributes[KEY_MXL_PAGE_PATH]||!z.attributes[KEY_MXL_PAGE_ID]){let G=this._pageManager.getCurrentRoute();G&&(z.setAttribute(KEY_MXL_PAGE_PATH,G.path),z.setAttribute(KEY_MXL_PAGE_ID,this._pageManager.getCurrentPageId()))}let G=this._pageManager.getPageLabel();G&&!z.attributes[KEY_APP_SURFACE_LABEL]&&z.setAttribute(KEY_APP_SURFACE_LABEL,G)}shutdown(){return Promise.resolve(void 0)}},PageSpanProcessor=class{constructor({pageManager:z}){_defineProperty(this,`_pageManager`,void 0),this._pageManager=z}forceFlush(){return Promise.resolve(void 0)}onEnd(z){if(!z.attributes[KEY_MXL_PAGE_PATH]||!z.attributes[KEY_MXL_PAGE_ID]){let G=this._pageManager.getCurrentRoute(),K=this._pageManager.getCurrentPageId();G&&K&&(z.attributes[KEY_MXL_PAGE_PATH]=G.path,z.attributes[KEY_MXL_PAGE_ID]=K)}let G=this._pageManager.getPageLabel();G&&!z.attributes[KEY_APP_SURFACE_LABEL]&&(z.attributes[KEY_APP_SURFACE_LABEL]=G)}onStart(){}shutdown(){return Promise.resolve(void 0)}},SpanScrubProcessor=class{constructor({attributeScrubbers:z}){_defineProperty(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=z}forceFlush(){return Promise.resolve(void 0)}onEnd(z){this._attributeScrubbers.forEach(G=>{let K=z.attributes[G.key];K&&typeof K==`string`&&(z.attributes[G.key]=G.scrub(K))})}onStart(){}shutdown(){return Promise.resolve(void 0)}},UserLogRecordProcessor=class{constructor({userManager:z}){_defineProperty(this,`_userManager`,void 0),this._userManager=z}forceFlush(){return Promise.resolve(void 0)}onEmit(z){this._userManager.getUserId()&&z.setAttributes({[ATTR_USER_ID]:this._userManager.getUserId()})}shutdown(){return Promise.resolve(void 0)}},UserSpanProcessor=class{constructor({userManager:z}){_defineProperty(this,`_userManager`,void 0),this._userManager=z}forceFlush(){return Promise.resolve(void 0)}onEnd(z){let G=this._userManager.getUserId();G&&(z.attributes[ATTR_USER_ID]=G)}onStart(){}shutdown(){return Promise.resolve(void 0)}},MXLW3CTraceContextPropagator=class extends W3CTraceContextPropagator$1{inject(z,G,K){super.inject(z,G,K);let J=trace$1.getSpan(z);if(J){let z=G instanceof Headers?G.get(`traceparent`):defaultTextMapGetter.get(G,`traceparent`);z&&J.setAttribute(KEY_MXL_W3C_TRACEPARENT,z)}}};const HOST_CREDENTIALS_REGEX=/\/\/(.+):(.+)@(.+)\//,DEFAULT_SENSITIVE_TOKENS=[`AWSAccessKeyId`,`Signature`,`sig`,"`X-Goog-Signature",`password`,`auth`,`pw`,`token`],scrubURL=({value:z,queryParamRegex:G,scrubPath:K,scrubQuery:J})=>{let Y=z;return K&&(Y=Y.replace(HOST_CREDENTIALS_REGEX,`//REDACTED:REDACTED@$3/`)),J&&(Y=Y.replaceAll(G,`$1$2=REDACTED`)),Y},getDefaultAttributeScrubbers=z=>{let G=[...DEFAULT_SENSITIVE_TOKENS,...z||[]],K=RegExp(`(^|&|\\?)(${G.join(`|`)})=[^&]+`,`g`);return[{key:ATTR_URL_FULL,scrub:z=>scrubURL({value:z,queryParamRegex:K,scrubPath:!0,scrubQuery:!0})},{key:SEMATTRS_HTTP_URL,scrub:z=>scrubURL({value:z,queryParamRegex:K,scrubPath:!0,scrubQuery:!0})},{key:ATTR_URL_PATH,scrub:z=>scrubURL({value:z,queryParamRegex:K,scrubPath:!0,scrubQuery:!1})},{key:ATTR_URL_QUERY,scrub:z=>scrubURL({value:z,queryParamRegex:K,scrubPath:!1,scrubQuery:!0})}]};var Registry=class{constructor({diagLogger:z=diag$1.createComponentLogger({namespace:`mxl-registry`})}={}){_defineProperty(this,`_sdk`,null),_defineProperty(this,`_diag`,void 0),_defineProperty(this,`register`,z=>{this._sdk!==null&&this._diag.warn(`previously registered sdk will be overwritten`),this._sdk=z}),_defineProperty(this,`clear`,()=>{this._sdk===null&&this._diag.warn(`sdk already cleared, this is a no-op`),this._sdk=null}),_defineProperty(this,`registered`,()=>this._sdk),this._diag=z}};const registry=new Registry,setupDefaultInstrumentations=(z={},{featureManager:G,logManager:K,spanSessionManager:J,mxlSpanProcessor:Y,pageManager:X})=>{var Z,Q,ee,te,ne,ie;let ae=[new SpanSessionOnLoadInstrumentation(z[`session-on-load`]),new SpanSessionVisibilityInstrumentation(z[`session-visibility`],G,Y),new SpanSessionBrowserActivityInstrumentation(z[`session-activity`]),new SpanSessionTimeoutInstrumentation(z[`session-timeout`])];(Z=z.omit)!=null&&Z.has(`exception`)||ae.push(new GlobalExceptionInstrumentation(z.exception)),(Q=z.omit)!=null&&Q.has(`click`)||ae.push(new ClicksInstrumentation(z.click)),(ee=z.omit)!=null&&ee.has(`web-vital`)||ae.push(new WebVitalsInstrumentation(_objectSpread2(_objectSpread2({},z[`web-vital`]),{},{pageManager:X}))),(te=z.omit)!=null&&te.has(`document-load`)||ae.push(new DocumentLoadInstrumentation(z[`document-load`])),(ne=z.omit)!=null&&ne.has(`@opentelemetry/instrumentation-fetch`)||ae.push(new MXLFetchInstrumentation(_objectSpread2(_objectSpread2({},z.network),z[`@opentelemetry/instrumentation-fetch`]))),(ie=z.omit)!=null&&ie.has(`@opentelemetry/instrumentation-xml-http-request`)||ae.push(new MXLXHRInstrumentation(_objectSpread2(_objectSpread2({},z.network),z[`@opentelemetry/instrumentation-xml-http-request`]))),z[`empty-root`]&&ae.push(new EmptyRootInstrumentation(_objectSpread2({},z[`empty-root`])));for(let z of ae)z instanceof MXLInstrumentationBase&&(J&&z.setSessionManager(J),K&&z.setLogManager(K));return ae};
1
+ "use strict";window.MXLWebSdk=window.MXLWebSdk||(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let u=`1.9.1`,d=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function f(e){let t=new Set([e]),n=new Set,r=e.match(d);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(d);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}let p=f(u),m=u.split(`.`)[0],h=Symbol.for(`opentelemetry.js.api.${m}`),g=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function _(e,t,n,r=!1){var i;let a=g[h]=(i=g[h])==null?{version:u}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${u}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${u}.`),!0}function v(e){var t,n;let r=(t=g[h])==null?void 0:t.version;if(!(!r||!p(r)))return(n=g[h])==null?void 0:n[e]}function y(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${u}.`);let n=g[h];n&&delete n[e]}var b=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return x(`debug`,this._namespace,e)}error(...e){return x(`error`,this._namespace,e)}info(...e){return x(`info`,this._namespace,e)}warn(...e){return x(`warn`,this._namespace,e)}verbose(...e){return x(`verbose`,this._namespace,e)}};function x(e,t,n){let r=v(`diag`);if(r)return r[e](t,...n)}var S;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(S||(S={}));function C(e,t){e<S.NONE?e=S.NONE:e>S.ALL&&(e=S.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,S.ERROR),warn:n(`warn`,S.WARN),info:n(`info`,S.INFO),debug:n(`debug`,S.DEBUG),verbose:n(`verbose`,S.VERBOSE)}}var w=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=v(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:S.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=v(`diag`),s=C((i=n.logLevel)==null?S.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return _(`diag`,s,t,!0)},t.disable=()=>{y(`diag`,t)},t.createComponentLogger=e=>new b(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},ee=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}};let T=Symbol(`BaggageEntryMetadata`),E=w.instance();function D(e={}){return new ee(new Map(Object.entries(e)))}function te(e){return typeof e!=`string`&&(E.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:T,toString(){return e}}}function O(e){return Symbol.for(e)}let k=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},A=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],j={};if(typeof console<`u`)for(let e of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[e]==`function`&&(j[e]=console[e]);var ne=class{constructor(){function e(e){return function(...t){let n=j[e];if(typeof n!=`function`&&(n=j.log),typeof n!=`function`&&console&&(n=console[e],typeof n!=`function`&&(n=console.log)),typeof n==`function`)return n.apply(console,t)}}for(let t=0;t<A.length;t++)this[A[t].n]=e(A[t].c)}},re=class{constructor(){}createGauge(e,t){return de}createHistogram(e,t){return fe}createCounter(e,t){return ue}createUpDownCounter(e,t){return pe}createObservableGauge(e,t){return he}createObservableCounter(e,t){return me}createObservableUpDownCounter(e,t){return ge}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ie=class{},M=class extends ie{add(e,t){}},ae=class extends ie{add(e,t){}},N=class extends ie{record(e,t){}},P=class extends ie{record(e,t){}},F=class{addCallback(e){}removeCallback(e){}},oe=class extends F{},se=class extends F{},ce=class extends F{};let le=new re,ue=new M,de=new N,fe=new P,pe=new ae,me=new oe,he=new se,ge=new ce;function _e(){return le}let ve={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},ye={set(e,t,n){e!=null&&(e[t]=n)}};var be=class{active(){return k}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}};let xe=`context`,Se=new be;var Ce=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return _(xe,e,w.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return v(xe)||Se}disable(){this._getContextManager().disable(),y(xe,w.instance())}},we;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(we||(we={}));let Te={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:we.NONE};var Ee=class{constructor(e=Te){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}};let De=O(`OpenTelemetry Context Key SPAN`);function Oe(e){return e.getValue(De)||void 0}function ke(){return Oe(Ce.getInstance().active())}function Ae(e,t){return e.setValue(De,t)}function je(e){return e.deleteValue(De)}function Me(e,t){return Ae(e,new Ee(t))}function Ne(e){var t;return(t=Oe(e))==null?void 0:t.spanContext()}let Pe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Fe(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Pe[e.charCodeAt(t)]|0)+(Pe[e.charCodeAt(t+1)]|0)+(Pe[e.charCodeAt(t+2)]|0)+(Pe[e.charCodeAt(t+3)]|0);return n===t}function Ie(e){return Fe(e,32)&&e!==`00000000000000000000000000000000`}function Le(e){return Fe(e,16)&&e!==`0000000000000000`}function Re(e){return Ie(e.traceId)&&Le(e.spanId)}function ze(e){return new Ee(e)}let Be=Ce.getInstance();var Ve=class{startSpan(e,t,n=Be.active()){if(t!=null&&t.root)return new Ee;let r=n&&Ne(n);return He(r)&&Re(r)?new Ee(r):new Ee}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a==null?Be.active():a,c=this.startSpan(e,i,s),l=Ae(s,c);return Be.with(l,o,void 0,c)}};function He(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}let Ue=new Ve;var We=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ue}};let Ge=new class{getTracer(e,t,n){return new Ve}};var Ke=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new We(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Ge:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}},qe;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(qe||(qe={}));var Je;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(Je||(Je={}));var Ye;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Ye||(Ye={}));let I=Ce.getInstance(),L=w.instance(),Xe=new class{getMeter(e,t,n){return le}},Ze=`metrics`,Qe=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return _(Ze,e,w.instance())}getMeterProvider(){return v(Ze)||Xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){y(Ze,w.instance())}}.getInstance();var $e=class{inject(e,t){}extract(e,t){return e}fields(){return[]}};let et=O(`OpenTelemetry Baggage Key`);function tt(e){return e.getValue(et)||void 0}function nt(){return tt(Ce.getInstance().active())}function rt(e,t){return e.setValue(et,t)}function it(e){return e.deleteValue(et)}let at=`propagation`,ot=new $e,st=class e{constructor(){this.createBaggage=D,this.getBaggage=tt,this.getActiveBaggage=nt,this.setBaggage=rt,this.deleteBaggage=it}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return _(at,e,w.instance())}inject(e,t,n=ye){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=ve){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){y(at,w.instance())}_getGlobalPropagator(){return v(at)||ot}}.getInstance(),ct=`trace`,R=class e{constructor(){this._proxyTracerProvider=new Ke,this.wrapSpanContext=ze,this.isSpanContextValid=Re,this.deleteSpan=je,this.getSpan=Oe,this.getActiveSpan=ke,this.getSpanContext=Ne,this.setSpan=Ae,this.setSpanContext=Me}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=_(ct,this._proxyTracerProvider,w.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return v(ct)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){y(ct,w.instance()),this._proxyTracerProvider=new Ke}}.getInstance(),lt=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.addEventListener(t,n)})},ut=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.removeEventListener(t,n)})};function dt(e,t,n,r=new Set){return new Proxy(e,{get(e,i,a){let o=Reflect.get(e,i,a);return typeof o!=`function`||r.has(i)?o:(...r)=>{try{return o.apply(e,r)}catch(e){let a=e instanceof Error?e.message:`Unknown error`;n.error(`${String(i)}: ${a}`);let o=t[i];return typeof o==`function`?o.apply(t,r):void 0}}}})}let ft=new Uint8Array(16),pt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`).toUpperCase()),mt=()=>{crypto.getRandomValues(ft);let e=``;for(let t=0;t<16;t++)e+=pt[ft[t]];return e},ht=()=>`mxlv2-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,gt=(e,t,n)=>{try{let r=e.getItem(t),i=r?parseInt(r,10):0;return Number.isNaN(i)&&(n.warn(`Non-numeric value stored at ${t} (${String(r)}); resetting counter.`),i=0),i++,e.setItem(t,i.toString()),i}catch(e){return n.warn(`Failed to retrieve ${t} from storage: `,e),1}},_t=`mxl.type`,vt=`mxl.state`,yt=`mxl.properties.`,bt=`mxl.instrumentation`,xt=`mxl.js_file_bundle_ids`,St=`browser.url.full`,Ct=`app.surface.name`,wt=`app.surface.id`,Tt=`app.surface.label`,Et=e=>e.visibilityState===`hidden`?`background`:`foreground`,Dt=globalThis,Ot=(e,t)=>!t||t<=0||t>100?!1:t>=kt(e),kt=e=>{if(e.length<6)return 0;let t=e.slice(-6),n=Math.pow(16,6)-1;return parseInt(t,16)/n*100},At=O(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function jt(e){return e.setValue(At,!0)}function Mt(e){return e.getValue(At)===!0}let Nt=`baggage`;function Pt(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ft(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function It(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch(e){return}let c;return t!==-1&&t<e.length-1&&(c=te(e.substring(t+1))),{key:o,value:s,metadata:c}}var Lt=class{inject(e,t,n){let r=st.getBaggage(e);if(!r||Mt(e))return;let i=Pt(Ft(r).filter(e=>e.length<=4096).slice(0,180));i.length>0&&n.set(t,Nt,i)}extract(e,t,n){let r=n.get(t,Nt),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=It(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:st.setBaggage(e,st.createBaggage(a))}fields(){return[Nt]}};function Rt(e){"@babel/helpers - typeof";return Rt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Rt(e)}function zt(e,t){if(Rt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Rt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bt(e){var t=zt(e,`string`);return Rt(t)==`symbol`?t:t+``}function z(e,t,n){return(t=Bt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ht(n)){L.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ut(r)){L.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Ht(e){return typeof e==`string`&&e!==``}function Ut(e){return e==null?!0:Array.isArray(e)?Wt(e):Gt(typeof e)}function Wt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Gt(e)){t=e;continue}return!1}return!1}}return!0}function Gt(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Kt(){return e=>{L.error(qt(e))}}function qt(e){return typeof e==`string`?e:JSON.stringify(Jt(e))}function Jt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}let Yt=Kt();function Xt(e){try{Yt(e)}catch(e){}}let Zt=`http.url`,Qt=`error.type`,$t=`exception.message`,en=`exception.stacktrace`,tn=`exception.type`,nn=`http.request.method`,rn=`http.request.method_original`,an=`http.response.status_code`,on=`server.address`,sn=`server.port`,cn=`service.name`,ln=`telemetry.sdk.language`,un=`telemetry.sdk.name`,dn=`telemetry.sdk.version`,fn=`url.full`,pn=`user_agent.original`,mn={[un]:`opentelemetry`,"process.runtime.name":`browser`,[ln]:`webjs`,[dn]:`2.7.1`},hn=performance,gn=Math.pow(10,6),_n=Math.pow(10,9);function vn(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*gn)]}function yn(e){return En(vn(hn.timeOrigin),vn(typeof e==`number`?e:hn.now()))}function bn(e){if(wn(e))return e;if(typeof e==`number`)return e<hn.timeOrigin?yn(e):vn(e);if(e instanceof Date)return vn(e.getTime());throw TypeError(`Invalid input type`)}function xn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=_n),[n,r]}function Sn(e){return e[0]*_n+e[1]}function Cn(e){return e[0]*1e3+e[1]/1e6}function wn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Tn(e){return wn(e)||typeof e==`number`||e instanceof Date}function En(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=_n&&(n[1]-=_n,n[0]+=1),n}var Dn;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(Dn||(Dn={}));var On=class{constructor(e={}){var t;z(this,`_propagators`,void 0),z(this,`_fields`,void 0),this._propagators=(t=e.propagators)==null?[]:t;let n=new Set;for(let e of this._propagators){let t=typeof e.fields==`function`?e.fields():[];for(let e of t)n.add(e)}this._fields=Array.from(n)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){L.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){L.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}};let kn=`[_0-9a-z-*/]`,An=`[a-z]${kn}{0,255}`,jn=`[a-z0-9]${kn}{0,240}@[a-z]${kn}{0,13}`,Mn=RegExp(`^(?:${An}|${jn})$`),Nn=/^[ -~]{0,255}[!-~]$/,Pn=/,|=/;function Fn(e){return Mn.test(e)}function In(e){return Nn.test(e)&&!Pn.test(e)}var Ln=class e{constructor(e){z(this,`_length`,void 0),z(this,`_rawTraceState`,void 0),z(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Fn(e)||!In(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>512)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=`,`+e),e=`${n[0]}=${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(`,`),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(`=`);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Fn(a)||!In(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>512)&&(t.set(a,o),n=s,t.size>=32))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};let Rn=`traceparent`,zn=`tracestate`,Bn=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Vn(e){let t=Bn.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Hn=class{inject(e,t,n){let r=R.getSpanContext(e);if(!r||Mt(e)||!Re(r))return;let i=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||we.NONE).toString(16)}`;n.set(t,Rn,i),r.traceState&&n.set(t,zn,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,Rn);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Vn(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,zn);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Ln(typeof e==`string`?e:void 0)}return R.setSpanContext(e,a)}fields(){return[Rn,zn]}};let Un=Function.prototype.toString,Wn=Un.call(Object),Gn=Object.getPrototypeOf,Kn=Object.prototype,qn=Kn.hasOwnProperty,Jn=Symbol?Symbol.toStringTag:void 0,Yn=Kn.toString;function Xn(e){if(!Zn(e)||Qn(e)!==`[object Object]`)return!1;let t=Gn(e);if(t===null)return!0;let n=qn.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Un.call(n)===Wn}function Zn(e){return typeof e==`object`&&!!e}function Qn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Jn&&Jn in Object(e)?$n(e):er(e)}function $n(e){let t=qn.call(e,Jn),n=e[Jn],r=!1;try{e[Jn]=void 0,r=!0}catch(e){}let i=Yn.call(e);return r&&(t?e[Jn]=n:delete e[Jn]),i}function er(e){return Yn.call(e)}function tr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=rr(t,e.shift(),0,n);return t}function nr(e){return ar(e)?e.slice():e}function rr(e,t,n=0,r){let i;if(!(n>20)){if(n++,cr(e)||cr(t)||or(t))i=nr(t);else if(ar(e)){if(i=e.slice(),ar(t))for(let e=0,n=t.length;e<n;e++)i.push(nr(t[e]));else if(sr(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=nr(t[r]))}}}else if(sr(e))if(sr(t)){if(!lr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(cr(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(ir(e,s,r)||ir(t,s,r))delete i[s];else{if(sr(a)&&sr(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=rr(i[s],c,n,r)}}}}else i=t;return i}}function ir(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function ar(e){return Array.isArray(e)}function or(e){return typeof e==`function`}function sr(e){return!cr(e)&&!ar(e)&&!or(e)&&typeof e==`object`}function cr(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function lr(e,t){return!(!Xn(e)||!Xn(t))}var ur=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function dr(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new ur(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function fr(e,t){return typeof t==`string`?e===t:!!e.match(t)}function pr(e,t){if(!t)return!1;for(let n of t)if(fr(e,n))return!0;return!1}var mr=class{constructor(){z(this,`_promise`,void 0),z(this,`_resolve`,void 0),z(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},hr=class{constructor(e,t){z(this,`_isCalled`,!1),z(this,`_deferred`,new mr),z(this,`_callback`,void 0),z(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function gr(e,t){return new Promise(n=>{I.with(jt(I.active()),()=>{e.export(t,n)})})}let _r={_export:gr},vr;function yr(){if(vr===void 0)try{let e=globalThis.process.argv0;vr=e?`unknown_service:${e}`:`unknown_service`}catch(e){vr=`unknown_service`}return vr}let br=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;function xr(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function B(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){xr(a,r,i,o,s,`next`,e)}function s(e){xr(a,r,i,o,s,`throw`,e)}o(void 0)})}}var Sr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Er(t),r._asyncAttributesPending=t.filter(([e,t])=>br(t)).length>0,r}constructor(e,t){var n;z(this,`_rawAttributes`,void 0),z(this,`_asyncAttributesPending`,!1),z(this,`_schemaUrl`,void 0),z(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(br(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Er(this._rawAttributes),this._schemaUrl=Dr(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return B(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,br(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&L.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(br(n)){L.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]!=null||(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Or(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Cr(e,t){return Sr.FromAttributeList(Object.entries(e),t)}function wr(){return Cr({})}function Tr(){return Cr({[cn]:yr(),[ln]:mn[ln],[un]:mn[un],[dn]:mn[dn]})}function Er(e){return e.map(([e,t])=>br(t)?[e,t.catch(t=>{L.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Dr(e){if(typeof e==`string`||e===void 0)return e;L.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Or(e,t){let n=e==null?void 0:e.schemaUrl,r=t==null?void 0:t.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;L.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var kr=class{constructor(e){var t,n;z(this,`_spanContext`,void 0),z(this,`kind`,void 0),z(this,`parentSpanContext`,void 0),z(this,`attributes`,{}),z(this,`links`,[]),z(this,`events`,[]),z(this,`startTime`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_droppedAttributesCount`,0),z(this,`_droppedEventsCount`,0),z(this,`_droppedLinksCount`,0),z(this,`_attributesCount`,0),z(this,`name`,void 0),z(this,`status`,{code:Ye.UNSET}),z(this,`endTime`,[0,0]),z(this,`_ended`,!1),z(this,`_duration`,[-1,-1]),z(this,`_spanProcessor`,void 0),z(this,`_spanLimits`,void 0),z(this,`_attributeValueLengthLimit`,void 0),z(this,`_recordEndMetrics`,void 0),z(this,`_performanceStartTime`,void 0),z(this,`_performanceOffset`,void 0),z(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=hn.now(),this._performanceOffset=r-(this._performanceStartTime+hn.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=(t=this._spanLimits.attributeValueLengthLimit)==null?0:t,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime((n=e.startTime)==null?r:n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return L.warn(`Invalid attribute key: ${e}`),this;if(!Ut(t))return L.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return L.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&L.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),Tn(t)&&(Tn(n)||(n=t),t=void 0);let i=Vt(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&L.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Vt(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===Ye.UNSET||this.status.code===Ye.OK)return this;let t={code:e.code};return e.code===Ye.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&L.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t;if(this._isSpanEnded()){L.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=xn(this.startTime,this.endTime),this._duration[0]<0&&(L.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&L.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&L.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(t=this._recordEndMetrics)==null||t.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=hn.now())return yn(e+this._performanceOffset);if(typeof e==`number`)return vn(e);if(e instanceof Date)return vn(e.getTime());if(wn(e))return e;if(this._startTimeProvided)return vn(Date.now());let t=hn.now()-this._performanceStartTime;return En(this.startTime,vn(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[$t]=e:e&&(e.code?n[tn]=e.code.toString():e.name&&(n[tn]=e.name),e.message&&(n[$t]=e.message),e.stack&&(n[en]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(`exception`,n,t):L.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);L.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(L.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},Ar;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Ar||(Ar={}));var jr=class{shouldSample(){return{decision:Ar.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Mr=class{shouldSample(){return{decision:Ar.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},Nr=class{constructor(e){var t,n,r,i;z(this,`_root`,void 0),z(this,`_remoteParentSampled`,void 0),z(this,`_remoteParentNotSampled`,void 0),z(this,`_localParentSampled`,void 0),z(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(Xt(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Mr),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Mr:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new jr:n,this._localParentSampled=(r=e.localParentSampled)==null?new Mr:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new jr:i}shouldSample(e,t,n,r,i,a){let o=R.getSpanContext(e);return!o||!Re(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&we.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&we.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Pr=class{constructor(e=0){z(this,`_ratio`,void 0),z(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Ie(t)&&this._accumulate(t)<this._upperBound?Ar.RECORD_AND_SAMPLED:Ar.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},Fr;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Fr||(Fr={}));function Ir(){var e,t,n,r,i,a,o,s;return{sampler:Lr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(e=void 0)==null?1/0:e,attributeCountLimit:(t=void 0)==null?128:t},spanLimits:{attributeValueLengthLimit:(n=void 0)==null?1/0:n,attributeCountLimit:(r=void 0)==null?128:r,linkCountLimit:(i=void 0)==null?128:i,eventCountLimit:(a=void 0)==null?128:a,attributePerEventCountLimit:(o=void 0)==null?128:o,attributePerLinkCountLimit:(s=void 0)==null?128:s}}}function Lr(){var e;let t=(e=void 0)==null?Fr.ParentBasedAlwaysOn:e;switch(t){case Fr.AlwaysOn:return new Mr;case Fr.AlwaysOff:return new jr;case Fr.ParentBasedAlwaysOn:return new Nr({root:new Mr});case Fr.ParentBasedAlwaysOff:return new Nr({root:new jr});case Fr.TraceIdRatio:return new Pr(Rr());case Fr.ParentBasedTraceIdRatio:return new Nr({root:new Pr(Rr())});default:return L.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Fr.ParentBasedAlwaysOn}".`),new Nr({root:new Mr})}}function Rr(){return L.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1}function zr(e){let t={sampler:Lr()},n=Ir(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Br(e){var t,n,r,i,a,o,s,c,l,u,d,f;let p=Object.assign({},e.spanLimits);return p.attributeCountLimit=(t=(n=(r=(i=(a=e.spanLimits)==null?void 0:a.attributeCountLimit)==null?(o=e.generalLimits)==null?void 0:o.attributeCountLimit:i)==null?void 0:r)==null?void 0:n)==null?128:t,p.attributeValueLengthLimit=(s=(c=(l=(u=(d=e.spanLimits)==null?void 0:d.attributeValueLengthLimit)==null?(f=e.generalLimits)==null?void 0:f.attributeValueLengthLimit:u)==null?void 0:l)==null?void 0:c)==null?1/0:s,Object.assign({},e,{spanLimits:p})}var Vr=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_isExporting`,!1),z(this,`_finishedSpans`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_droppedSpansCount`,0),this._exporter=e,this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==`number`?t.maxExportBatchSize:(n=void 0)==null?512:n,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==`number`?t.maxQueueSize:(r=void 0)==null?2048:r,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==`number`?t.scheduledDelayMillis:(i=void 0)==null?5e3:i,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==`number`?t.exportTimeoutMillis:(a=void 0)==null?3e4:a,this._shutdownOnce=new hr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(L.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&we.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&L.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(L.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);I.with(jt(I.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{if(clearTimeout(n),r.code===Dn.SUCCESS)e();else{var i;t((i=r.error)==null?Error(`BatchSpanProcessor: span export failed`):i)}}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a!=null||(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{Xt(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,Xt(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Hr=class extends Vr{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this.onInit(t)}onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{Xt(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Xt(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}};let Ur=new Uint8Array(16),Wr=new Uint8Array(8),Gr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Kr(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function qr(e){let t=``;for(let n=0;n<e.length;n++)t+=Gr[e[n]];return t}var Jr=class{generateTraceId(){return Kr(Ur),qr(Ur)}generateSpanId(){return Kr(Wr),qr(Wr)}};let Yr=`otel.span.sampling_result`;var Xr=class{constructor(e){z(this,`startedSpans`,void 0),z(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(`otel.sdk.span.started`,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(`otel.sdk.span.live`,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Qr(t);if(this.startedSpans.add(1,{"otel.span.parent.origin":Zr(e),[Yr]:n}),t===Ar.NOT_RECORD)return()=>{};let r={[Yr]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Zr(e){return e?e.isRemote?`remote`:`local`:`none`}function Qr(e){switch(e){case Ar.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case Ar.RECORD:return`RECORD_ONLY`;case Ar.NOT_RECORD:return`DROP`}}var $r=class{constructor(e,t,n,r){z(this,`_sampler`,void 0),z(this,`_generalLimits`,void 0),z(this,`_spanLimits`,void 0),z(this,`_idGenerator`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_resource`,void 0),z(this,`_spanProcessor`,void 0),z(this,`_tracerMetrics`,void 0);let i=zr(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Jr,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,`2.7.1`):_e();this._tracerMetrics=new Xr(a)}startSpan(e,t={},n=I.active()){var r,i,a;t.root&&(n=R.deleteSpan(n));let o=R.getSpan(n);if(Mt(n))return L.debug(`Instrumentation suppressed, returning Noop Span`),R.wrapSpanContext(Te);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!R.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?Je.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:Vt(e.attributes)})),m=Vt(t.attributes),h=this._sampler.shouldSample(n,u,e,f,m,p),g=this._tracerMetrics.startSpan(s,h.decision);d=(a=h.traceState)==null?d:a;let _=h.decision===qe.RECORD_AND_SAMPLED?we.SAMPLED:we.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===qe.NOT_RECORD)return L.debug(`Recording is off, propagating context in a non-recording span`),R.wrapSpanContext(v);let y=Vt(Object.assign(m,h.attributes));return new kr({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:v,name:e,kind:f,links:p,parentSpanContext:l,attributes:y,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:g})}startActiveSpan(e,t,n,r){var i;let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=n):(a=t,o=n,s=r);let c=(i=o)==null?I.active():i,l=this.startSpan(e,a,c),u=R.setSpan(c,l);return I.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},ei=class{constructor(e){z(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Xt(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},ti;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(ti||(ti={}));var ni=class{constructor(e={}){var t,n;z(this,`_config`,void 0),z(this,`_tracers`,new Map),z(this,`_resource`,void 0),z(this,`_activeSpanProcessor`,void 0);let r=tr({},Ir(),Br(e));this._resource=(t=r.resource)==null?Tr():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new ei(i)}getTracer(e,t,n){let r=`${e}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._tracers.has(r)||this._tracers.set(r,new $r({name:e,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=ti.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==ti.timeout&&(r=ti.resolved,n(r))}).catch(e=>{clearTimeout(i),r=ti.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==ti.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},ri=class{constructor(){z(this,`_enabled`,!1),z(this,`_currentContext`,k)}_bindFunction(e=k,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=k,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=k,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||k;try{return t.call(n,...r)}finally{this._currentContext=i}}};function ii(e){if(e!==null){if(e===void 0){let e=new ri;e.enable(),I.setGlobalContextManager(e);return}e.enable(),I.setGlobalContextManager(e)}}function ai(e){if(e!==null){if(e===void 0){st.setGlobalPropagator(new On({propagators:[new Hn,new Lt]}));return}st.setGlobalPropagator(e)}}var oi=class extends ni{constructor(e={}){super(e)}register(e={}){R.setGlobalTracerProvider(this),ai(e.propagator),ii(e.contextManager)}},V;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(V||(V={}));let si;function ci(){return si||(si=document.createElement(`a`)),si}function li(e,t){return t in e}function ui(e,t,n,r=!0){if(li(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function di(e,t,n=!1,r,i){if(r===void 0&&(r=t[V.START_TIME]!==0),n||(ui(e,V.FETCH_START,t,r),ui(e,V.DOMAIN_LOOKUP_START,t,r),ui(e,V.DOMAIN_LOOKUP_END,t,r),ui(e,V.CONNECT_START,t,r),ui(e,V.SECURE_CONNECTION_START,t,r),ui(e,V.CONNECT_END,t,r),ui(e,V.REQUEST_START,t,r),ui(e,V.RESPONSE_START,t,r),ui(e,V.RESPONSE_END,t,r)),!i){let n=t[V.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(`http.response_content_length`,n);let r=t[V.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(`http.response_content_length_uncompressed`,r)}}function fi(e){return e.slice().sort((e,t)=>{let n=e[V.FETCH_START],r=t[V.FETCH_START];return n>r?1:n<r?-1:0})}function pi(){return typeof location<`u`?location.origin:void 0}function mi(e,t,n,r,i=new WeakSet,a){let o=_i(e);e=o.toString();let s=gi(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=fi(s);if(o.origin!==pi()&&c.length>1){let e=c[0],t=hi(c,e[V.RESPONSE_END],n),r=e[V.RESPONSE_END];return t[V.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function hi(e,t,n){let r=Sn(n),i=Sn(bn(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=Sn(bn(n[V.FETCH_START])),c=r-Sn(bn(n[V.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function gi(e,t,n,r,i,a){let o=Sn(t),s=Sn(n),c=r.filter(t=>{let n=Sn(bn(t[V.FETCH_START])),r=Sn(bn(t[V.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function _i(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ci();return t.href=e,t}function vi(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),_i(e).origin===pi()?!0:n.some(t=>fr(e,t))}let yi=`mxl_pending_`;var bi=class{constructor({resource:e=wr(),storage:t=window.localStorage,diag:n=L.createComponentLogger({namespace:`MXLSpanStorage`}),storedSpansExpireTimeoutMS:r=3600*1e3,onExpiredSpansExport:i,spanSessionManager:a}){z(this,`_noExportTracer`,void 0),z(this,`_storage`,void 0),z(this,`_diag`,void 0),z(this,`_onExpiredSpansExport`,void 0),z(this,`_storedSpansExpireTimeoutMS`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_checkExpiredSpansInterval`,void 0),this._noExportTracer=new ni({resource:e}).getTracer(`mxl-web-sdk-sessions`),this._storage=t,this._diag=n,this._storedSpansExpireTimeoutMS=r,this._onExpiredSpansExport=i,this._spanSessionManager=a,this.startExpiredSpansCheck()}storePendingSpans(e,t,n){try{if(this.clearStoredSpans(e),this._getPendingSpansKeys().length>=10){this._spanSessionManager.incrSessionCountForKey(`mxl.max_pending_spans_reached`),this._diag.warn(`Not storing pending spans as the max number of items was reached`);return}let r=`${yi}${e}_${Date.now()}`;this._storage.setItem(r,JSON.stringify([t,...n],(e,t)=>e.startsWith(`_`)?void 0:t)),this._diag.debug(`Stored pending span: ${r}`)}catch(e){this._diag.error(`Failed to store spans to storage:`,e)}}clearStoredSpans(e){try{let t=`${yi}${e}_`;this._getPendingSpansKeys().forEach(e=>{e.startsWith(t)&&this._storage.removeItem(e)})}catch(e){this._diag.error(`Failed to clear stored spans from storage:`,e)}}startExpiredSpansCheck(){this._checkExpiredSpansInterval=setInterval(()=>{this.checkAndExportExpiredSpans()},300*1e3)}stopExpiredSpansCheck(){this._checkExpiredSpansInterval&&(clearInterval(this._checkExpiredSpansInterval),this._checkExpiredSpansInterval=void 0)}checkAndExportExpiredSpans(){try{let e=this._getPendingSpansKeys();if(e.length===0)return;let t=Date.now();e.forEach(e=>{let n=e.split(`_`),r=parseInt(n[n.length-1],10);if(Number.isNaN(r)&&(this._diag.error(`Found invalid timestamp in stored span:`,r),this._storage.removeItem(e)),t-r<=this._storedSpansExpireTimeoutMS)return;let i=this._storage.getItem(e);if(i){try{let e=[];for(let t of JSON.parse(i)){let n=this._noExportTracer.startSpan(t.name,{kind:t.kind,attributes:t.attributes,links:t.links,startTime:t.startTime});n.setStatus(t.status),n.end(t.endTime),e.push(n)}this._onExpiredSpansExport&&e.length>0&&this._onExpiredSpansExport(e)}catch(e){this._diag.error(`Failed to process expired spans:`,e)}this._storage.removeItem(e)}})}catch(e){this._diag.error(`Failed to check and export expired spans:`,e)}}_getPendingSpansKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(yi)&&e.push(n)}return e}destroy(){this.stopExpiredSpansCheck()}},xi=class{constructor(e,t){z(this,`_keyPrefix`,void 0),z(this,`_storage`,void 0),this._keyPrefix=`${e}_`,this._storage=t}getNamespacedKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(this._keyPrefix)&&e.push(n.substring(this._keyPrefix.length))}return e}get length(){return this.getNamespacedKeys().length}clear(){this.getNamespacedKeys().forEach(e=>{this._storage.removeItem(`${this._keyPrefix}${e}`)})}getItem(e){return this._storage.getItem(`${this._keyPrefix}${e}`)}key(e){return this.getNamespacedKeys()[e]||null}removeItem(e){this._storage.removeItem(`${this._keyPrefix}${e}`)}setItem(e,t){this._storage.setItem(`${this._keyPrefix}${e}`,t)}getStorageEventKey(e){return`${this._keyPrefix}${e}`}};let Si=({diag:e,featureManager:t,registerGlobally:n,propagator:r,defaultInstrumentationConfig:i})=>{var a;if(!t.isNetworkSpanForwardingEnabled())return!1;let o=[];return n||o.push("Network span forwarding cannot be used when `registerGlobally` is set to false. Turning off network span forwarding."),r&&o.push("Network span forwarding cannot be used alongside a custom `propagator`. Turning off network span forwarding."),!(i==null||(a=i.omit)==null)&&a.has(`@opentelemetry/instrumentation-xml-http-request`)&&i.omit.has(`@opentelemetry/instrumentation-fetch`)&&o.push(`Network span forwarding cannot be used when both '@opentelemetry/instrumentation-xml-http-request' and '@opentelemetry/instrumentation-fetch' are omitted. Turning off network span forwarding.`),o.forEach(t=>{e.warn(t)}),o.length===0};var Ci=class{constructor(e=window.performance){z(this,`_clock`,void 0),z(this,`epochMillisFromOriginOffset`,e=>this._clock.timeOrigin+e),z(this,`getNowHRTime`,()=>vn(this.getNowMillis())),z(this,`getNowMillis`,()=>this.epochMillisFromOriginOffset(this._clock.now())),z(this,`millisSinceHRTime`,e=>this.getNowMillis()-Cn(e)),z(this,`millisFromZeroTime`,e=>e),this._clock=e}};function wi(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Ti(e,t){if(e==null)return{};var n,r,i=wi(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ei(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let Di=[`diag`];function Oi(e){var t,n;return typeof PerformanceObserver<`u`&&((t=(n=PerformanceObserver.supportedEntryTypes)==null?void 0:n.includes(e))==null?!1:t)}function ki(e,t,n){let r=n==null?{}:n,{diag:i}=r,a=Ti(r,Di);if(!Oi(e))return i==null||i.debug(`${e} not supported, skipping observer`),null;try{let n=new PerformanceObserver(n=>{for(let r of n.getEntries())try{t(r)}catch(t){i==null||i.error(`error processing ${e} entry`,t)}});return n.observe(H({type:e,buffered:!0},a)),n}catch(e){return null}}let Ai=(e,t=1e3)=>{let n=!1;return(...r)=>{n||(e(...r),setTimeout(()=>{n=!1},t),n=!0)}};var ji=class{logException(e,t){}message(e,t,n){}};let Mi=new ji;var Ni=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Mi:e}setDelegate(e){this._delegate=e}logException(e,t){this.getDelegate().logException(e,t)}message(e,t,n){this.getDelegate().message(e,t,n)}};let Pi=new ji,Fi=new Set([`setDelegate`,`getDelegate`]);var Ii=class e{static getInstance(){if(!e._instance){let t=new Ni,n=dt(t,Pi,L.createComponentLogger({namespace:`LogAPI`}),Fi);e._instance=Object.assign(n,{setGlobalLogManager(e){t.setDelegate(e)},getLogManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Ii,`_instance`,void 0);let Li=Ii.getInstance();var Ri=class{setCurrentRoute(e){}getCurrentRoute(){return null}getCurrentPageId(){return``}setPageLabel(e){}getPageLabel(){return null}clearCurrentRoute(){}};let zi=new Ri;var Bi=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?zi:e}setDelegate(e){this._delegate=e}setCurrentRoute(e){this.getDelegate().setCurrentRoute(e)}getCurrentRoute(){return this.getDelegate().getCurrentRoute()}getCurrentPageId(){return this.getDelegate().getCurrentPageId()}setPageLabel(e){this.getDelegate().setPageLabel(e)}getPageLabel(){return this.getDelegate().getPageLabel()}clearCurrentRoute(){this.getDelegate().clearCurrentRoute()}};let Vi=new Ri,Hi=new Set([`setDelegate`,`getDelegate`]);var Ui=class e{static getInstance(){if(!e._instance){let t=new Bi,n=dt(t,Vi,L.createComponentLogger({namespace:`PageAPI`}),Hi);e._instance=Object.assign(n,{setGlobalPageManager(e){t.setDelegate(e)},getPageManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Ui,`_instance`,void 0);let Wi=Ui.getInstance();var Gi=class{constructor(){z(this,`getSessionId`,()=>null),z(this,`getPreviousSessionId`,()=>null)}addBreadcrumb(e){}addProperty(e,t,n){}removeProperty(e){}endSessionSpan(){}endSessionSpanInternal(e){}currentSessionAsReadableSpan(e){return null}getSessionSpan(){return null}getSessionStartTime(){return null}startSessionSpan(){}addSessionStartedListener(e){return()=>{}}addSessionEndedListener(e){return()=>{}}};let Ki=new Gi;var qi=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Ki:e}setDelegate(e){this._delegate=e}addBreadcrumb(e){this.getDelegate().addBreadcrumb(e)}addProperty(e,t,n){this.getDelegate().addProperty(e,t,n)}removeProperty(e){this.getDelegate().removeProperty(e)}endSessionSpan(){this.getDelegate().endSessionSpan()}endSessionSpanInternal(e){this.getDelegate().endSessionSpanInternal(e)}currentSessionAsReadableSpan(e){return this.getDelegate().currentSessionAsReadableSpan(e)}getSessionId(){return this.getDelegate().getSessionId()}getPreviousSessionId(){return this.getDelegate().getPreviousSessionId()}getSessionSpan(){return this.getDelegate().getSessionSpan()}getSessionStartTime(){return this.getDelegate().getSessionStartTime()}startSessionSpan(e){this.getDelegate().startSessionSpan(e)}addSessionStartedListener(e){return this.getDelegate().addSessionStartedListener(e)}addSessionEndedListener(e){return this.getDelegate().addSessionEndedListener(e)}};let Ji=new Gi,Yi=new Set([`setDelegate`,`getDelegate`]);var Xi=class e{static getInstance(){if(!e._instance){let t=new qi,n=dt(t,Ji,L.createComponentLogger({namespace:`SessionAPI`}),Yi);e._instance=Object.assign(n,{setGlobalSessionManager(e){t.setDelegate(e)},getSpanSessionManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Xi,`_instance`,void 0);let Zi=Xi.getInstance();var Qi=class{constructor(e=Te){z(this,`_spanContext`,void 0),z(this,`attributes`,{}),this._spanContext=e}fail(e){}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}removeAttribute(e){return this}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},$i=class{startSpan(e,t){return new Qi}setSpan(e,t){return k}getSpan(e){}};let ea=new $i;var ta=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?ea:e}setDelegate(e){this._delegate=e}startSpan(e,t,n){return this.getDelegate().startSpan(e,t,n)}setSpan(e,t){return this.getDelegate().setSpan(e,t)}getSpan(e){return this.getDelegate().getSpan(e)}};let na=new $i,ra=new Set([`setDelegate`,`getDelegate`]);var ia=class e{static getInstance(){if(!e._instance){let t=new ta,n=dt(t,na,L.createComponentLogger({namespace:`TraceAPI`}),ra);e._instance=Object.assign(n,{setGlobalTraceManager(e){t.setDelegate(e)},getTraceManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(ia,`_instance`,void 0);let aa=ia.getInstance();var oa=class{getMXLUserId(){return``}getUserId(){return null}setUserId(){}clearUserId(){}};let sa=new oa;var ca=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?sa:e}setDelegate(e){this._delegate=e}getMXLUserId(){return this.getDelegate().getMXLUserId()}getUserId(){return this.getDelegate().getUserId()}setUserId(e){this.getDelegate().setUserId(e)}clearUserId(){this.getDelegate().clearUserId()}};let la=new oa,ua=new Set([`setDelegate`,`getDelegate`]);var da=class e{static getInstance(){if(!e._instance){let t=new ca,n=dt(t,la,L.createComponentLogger({namespace:`UserAPI`}),ua);e._instance=Object.assign(n,{setGlobalUserManager(e){t.setDelegate(e)},getUserManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(da,`_instance`,void 0);let fa=da.getInstance(),pa={pageLabel:Tt};var ma=class{emit(e){}enabled(){return!1}};let ha=new ma,ga=Symbol.for(`io.opentelemetry.js.api.logs`),_a=globalThis;function va(e,t,n){return r=>r===e?t:n}let ya=new class{getLogger(e,t,n){return new ma}};var ba=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ha}},xa=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new ba(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?ya:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Sa=class e{constructor(){this._proxyLoggerProvider=new xa}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return _a[ga]?this.getLoggerProvider():(_a[ga]=va(1,e,ya),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=_a[ga])==null?void 0:e.call(_a,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete _a[ga],this._proxyLoggerProvider=new xa}}.getInstance();function Ca(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function wa(e){e.forEach(e=>e.disable())}function Ta(e){var t,n;let r=e.tracerProvider||R.getTracerProvider(),i=e.meterProvider||Qe.getMeterProvider(),a=e.loggerProvider||Sa.getLoggerProvider(),o=(t=(n=e.instrumentations)==null?void 0:n.flat())==null?[]:t;return Ca(o,r,i,a),()=>{wa(o)}}let Ea=console.error.bind(console);function Da(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}let Oa=(e,t,n)=>{if(!e||!e[t]){Ea(`no original function `+String(t)+` to wrap`);return}if(!n){Ea(`no wrapper function`),Ea(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){Ea(`original object and wrapper must be functions`);return}let i=n(r,t);return Da(i,`__original`,r),Da(i,`__unwrap`,()=>{e[t]===i&&Da(e,t,r)}),Da(i,`__wrapped`,!0),Da(e,t,i),i},ka=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Oa(e,t,n)})})},Aa=(e,t)=>{if(!e||!e[t]){Ea(`no function to unwrap.`),Ea(Error().stack);return}let n=e[t];if(!n.__unwrap)Ea(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},ja=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Aa(e,t)})})};function Ma(e){e&&e.logger&&(typeof e.logger==`function`?Ea=e.logger:Ea(`new logger isn't a function, not replacing`))}Ma.wrap=Oa,Ma.massWrap=ka,Ma.unwrap=Aa,Ma.massUnwrap=ja;var Na=class{constructor(e,t,n){z(this,`_config`,{}),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),z(this,`_diag`,void 0),z(this,`instrumentationName`,void 0),z(this,`instrumentationVersion`,void 0),z(this,`_wrap`,Oa),z(this,`_unwrap`,Aa),z(this,`_massWrap`,ka),z(this,`_massUnwrap`,ja),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=L.createComponentLogger({namespace:e}),this._tracer=R.getTracer(e,t),this._meter=Qe.getMeter(e,t),this._logger=Sa.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=H({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Pa=class extends Na{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function Fa(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}var U;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(U||(U={}));function Ia(e,t){let n=U.OLD,r=t==null?void 0:t.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r==null?[]:r)if(t.toLowerCase()===e+`/dup`){n=U.DUPLICATE;break}else t.toLowerCase()===e&&(n=U.STABLE);return n}let La=`session.id`,Ra=`user.id`;var za;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(za||(za={}));var Ba=class{emit(e){}enabled(){return!1}};let Va=new Ba,Ha=Symbol.for(`io.opentelemetry.js.api.logs`),Ua=globalThis;function Wa(e,t,n){return r=>r===e?t:n}let Ga=new class{getLogger(e,t,n){return new Ba}};var Ka=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Va}},qa=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new Ka(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?Ga:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Ja=class e{constructor(){this._proxyLoggerProvider=new qa}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return Ua[Ha]?this.getLoggerProvider():(Ua[Ha]=Wa(1,e,Ga),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ua[Ha])==null?void 0:e.call(Ua,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete Ua[Ha],this._proxyLoggerProvider=new qa}}.getInstance();var Ya=class{constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,z(this,`_config`,{}),z(this,`_diag`,void 0),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),this.setConfig(n),this._diag=L.createComponentLogger({namespace:e}),this._tracer=R.getTracer(e,t),this._meter=Qe.getMeter(e,t),this._logger=Ja.getLogger(e,t),this._updateMetricInstruments()}get tracer(){return this._tracer}get meter(){return this._meter}get logger(){return this._logger}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}getConfig(){return this._config}setConfig(e){this._config=H({enabled:!0},e)}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}_updateMetricInstruments(){}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Xa=class extends Ya{constructor({instrumentationName:e,instrumentationVersion:t,config:n,diag:r,perf:i,limitManager:a}){super(e,t,n),z(this,`_sessionManager`,void 0),z(this,`_logManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_perf`,void 0),r&&(this._diag=r),this._perf=i==null?new Ci:i,this._sessionManager=Zi.getSpanSessionManager(),this._logManager=Li.getLogManager(),this._limitManager=a}get limitManager(){return this._limitManager}get sessionManager(){return this._sessionManager}get logManager(){return this._logManager}get perf(){return this._perf}init(){}setLimitManager(e){this._limitManager=e}setLogManager(e){this._logManager=e}setSessionManager(e){this._sessionManager=e}};let Za=()=>{let e={},t=window.performance.getEntriesByType(`navigation`)[0];return Object.values(V).forEach(n=>{if(li(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}}),e},Qa={"first-paint":`firstPaint`,"first-contentful-paint":`firstContentfulPaint`},$a=e=>{window.performance.getEntriesByType(`paint`).forEach(({name:t,startTime:n})=>{li(Qa,t)&&e.addEvent(Qa[t],n)})};var eo=class extends Xa{constructor({diag:e,perf:t,enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i=!1,ignoreNetworkEvents:a=!1}={}){super({instrumentationName:`DocumentLoadInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i,ignoreNetworkEvents:a}}),z(this,`_onDocumentLoaded`,void 0),z(this,`_performanceCollected`,!1),this._onDocumentLoaded=()=>{window.setTimeout(()=>{this._collectPerformance()},0)},this._config.enabled&&this.enable()}init(){this._diag.debug(`Initializing document load instrumentation`)}_addResourcesSpans(e){performance.getEntriesByType(`resource`).forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){if(this._performanceCollected)return;this._performanceCollected=!0;let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===Rn),t=Za(),n=(e==null?void 0:e.content)||``;I.with(st.extract(k,{traceparent:n}),()=>{var e;let n=this._startSpan(`documentLoad`,V.FETCH_START,t);n&&(I.with(R.setSpan(I.active(),n),()=>{let e=this._startSpan(`documentFetch`,V.FETCH_START,t);e&&(e.setAttribute(fn,location.href),I.with(R.setSpan(I.active(),e),()=>{var n;di(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.documentFetch),this._endSpan(e,V.RESPONSE_END,t)}))}),n.setAttribute(_t,`ux.document_load`),n.setAttribute(fn,location.href),n.setAttribute(pn,navigator.userAgent),this._addResourcesSpans(n),this.getConfig().ignoreNetworkEvents||(ui(n,V.FETCH_START,t),ui(n,V.UNLOAD_EVENT_START,t),ui(n,V.UNLOAD_EVENT_END,t),ui(n,V.DOM_INTERACTIVE,t),ui(n,V.DOM_CONTENT_LOADED_EVENT_START,t),ui(n,V.DOM_CONTENT_LOADED_EVENT_END,t),ui(n,V.DOM_COMPLETE,t),ui(n,V.LOAD_EVENT_START,t),ui(n,V.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||$a(n),this._addCustomAttributesOnSpan(n,(e=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:e.documentLoad),this._endSpan(n,V.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(li(n,t)&&typeof n[t]==`number`?e.end(n[t]):e.end())}_initResourceSpan(e,t){var n;let r=this._startSpan(`resourceFetch`,V.FETCH_START,e,t);r&&(r.setAttribute(_t,`ux.resource_fetch`),r.setAttribute(fn,e.name),di(r,e,this.getConfig().ignoreNetworkEvents),e.deliveryType&&r.setAttribute(`http.response.delivery_type`,e.deliveryType),e.initiatorType&&r.setAttribute(`http.request.initiator_type`,e.initiatorType),e.renderBlockingStatus&&r.setAttribute(`http.request.render_blocking_status`,e.renderBlockingStatus),e.responseStatus&&r.setAttribute(an,e.responseStatus),typeof e.encodedBodySize==`number`&&e.encodedBodySize>=0&&r.setAttribute(`http.response.body.size`,e.encodedBodySize),typeof e.transferSize==`number`&&e.transferSize>=0&&r.setAttribute(`http.response.size`,e.transferSize),typeof e.decodedBodySize==`number`&&e.decodedBodySize>=0&&r.setAttribute(`http.response.decoded_body_size`,e.decodedBodySize),this._addResourceDiagnosticAttributes(r,e),this._addCustomAttributesOnResourceSpan(r,e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.resourceFetch),this._endSpan(r,V.RESPONSE_END,e))}_startSpan(e,t,n,r){if(li(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?R.setSpan(I.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():window.addEventListener(`load`,this._onDocumentLoaded)}_addCustomAttributesOnSpan(e,t){t&&Fa(()=>{t(e)},e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&Fa(()=>{n(e,t)},e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}_hasNoSizeData(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.decodedBodySize==`number`?e.decodedBodySize:0,r=typeof e.encodedBodySize==`number`?e.encodedBodySize:0;return t===0&&n===0&&r===0}_hasTimingData(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return t>0&&n>0}_isCorsRestricted(e){return this._hasNoSizeData(e)&&this._hasTimingData(e)}_isFetchIncomplete(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return this._hasNoSizeData(e)&&t>0&&n===0}_isFetchPrevented(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0;return this._hasNoSizeData(e)&&t===0}_isCacheValidated(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.deliveryType==`string`?e.deliveryType:``;return t===300&&n!==`cache`}_addResourceDiagnosticAttributes(e,t){this._isCorsRestricted(t)?e.setAttribute(`http.response.cors_opaque`,!0):this._isFetchIncomplete(t)?e.setAttribute(`http.request.incomplete`,!0):this._isFetchPrevented(t)&&e.setAttribute(`http.request.prevented`,!0),this._isCacheValidated(t)&&e.setAttribute(`http.response.cache_revalidated`,!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},to=class extends Xa{constructor({diag:e,perf:t,rootNode:n,emptyCheckDelayMs:r=500}){super({instrumentationName:`EmptyRootInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,void 0),z(this,`_emptyCheckDelayMs`,void 0),z(this,`_rootNode`,void 0),this._rootNode=n,this._emptyCheckDelayMs=r,this._observer=new MutationObserver((e,t)=>{this._observerCallback(e)}),this._config.enabled&&this._rootNode?this.enable():this._rootNode||this._diag.warn(`supplied root node was null, this instrumentation won't be enabled`)}disable(){this._observer.disconnect()}enable(){this._rootNode&&this._observer.observe(this._rootNode,{childList:!0})}_observerCallback(e){let t=!1,n=!1;for(let r of e)r.target===this._rootNode&&(r.removedNodes.length>0&&(t=!0),r.addedNodes.length>0&&(n=!0));t&&!n&&(this._diag.debug(`root node had child nodes removed without new ones being added, checking if it's empty in ${this._emptyCheckDelayMs}ms`),window.setTimeout(()=>{this._checkForEmptyRootNode()},this._emptyCheckDelayMs))}_checkForEmptyRootNode(){var e;if(((e=this._rootNode)==null?void 0:e.childNodes.length)===0){this._diag.debug(`root node was found to be empty`);let e=this.sessionManager.getSessionSpan();e?e.addEvent(`empty-root-node`,{"mxl.type":`ux.empty_root_node`}):this._diag.debug(`no active session found to emit event on`)}}};let no=(e,t)=>{let n=e.nodeName.toLowerCase(),r=t.substring(0,30),i=t.length>30?`...`:``;return`<${n}${e.className?` class="${e.className}"`:``}>${r}${i}</${n}>`};var ro=class extends Xa{constructor({diag:e,perf:t,shouldTrack:n,innerTextForElement:r}={}){super({instrumentationName:`ClicksInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onClickHandler`,void 0),this._onClickHandler=e=>{let t=e.target;if(t instanceof HTMLElement&&!t.hasAttribute(`disabled`)&&!(n&&!n(t)))try{let n=this.sessionManager.getSessionSpan();n&&n.addEvent(`click`,{"mxl.type":`ux.tap`,"view.name":no(t,r?r(t):t.innerText),"tap.coords":`${e.x.toString()},${e.y.toString()}`},this.perf.epochMillisFromOriginOffset(e.timeStamp))}catch(e){this._diag.error(`failed to create new user interaction span event`,e)}},this._config.enabled&&this.enable()}disable(){document.removeEventListener(`click`,this._onClickHandler)}enable(){document.addEventListener(`click`,this._onClickHandler)}},io=class extends Xa{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ElementTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_observer`,null),z(this,`_isEnabled`,!1),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Oi(`element`)){this._diag.debug(`element not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=ki(`element`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}}}disable(){this._isEnabled=!1,this._observer&&(this._observer.disconnect(),this._observer=null)}_processEntry(e){var t,n;if(!this._isEnabled||(t=this.limitManager)!=null&&t.limitElementTimingEntry())return;let r=this.tracer.startSpan(e.identifier,{startTime:this.perf.epochMillisFromOriginOffset(0),attributes:{[_t]:`ux.element_timing`,"mxl.element_timing.identifier":e.identifier,"mxl.element_timing.element":(n=e.element)==null||(n=n.tagName)==null?void 0:n.toLowerCase(),"mxl.element_timing.render_time":e.renderTime,"mxl.element_timing.load_time":e.loadTime,"mxl.element_timing.start_time":e.startTime,"mxl.element_timing.url":e.url,"mxl.element_timing.natural_width":e.naturalWidth,"mxl.element_timing.natural_height":e.naturalHeight}});e.loadTime>0&&r.addEvent(`load`,this.perf.epochMillisFromOriginOffset(e.loadTime)),r.end(this.perf.epochMillisFromOriginOffset(e.startTime))}},ao=class extends Xa{constructor({diag:e,perf:t}={}){super({instrumentationName:`GlobalExceptionInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onErrorHandler`,void 0),z(this,`_onUnhandledRejectionHandler`,void 0),this._onErrorHandler=e=>{this.logManager.logException(e.error||e.message,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`global_exception`})},this._onUnhandledRejectionHandler=e=>{this.logManager.logException(e.reason,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`promise_rejection`})},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`error`,this._onErrorHandler),window.removeEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}enable(){window.addEventListener(`error`,this._onErrorHandler),window.addEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}},oo=class extends Xa{constructor({diag:e,perf:t}={}){super({instrumentationName:`LoafInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,null),z(this,`_isFirstEntry`,!0),z(this,`_removeSessionEndListener`,null),z(this,`_isEnabled`,!1),z(this,`_totalDuration`,0),z(this,`_workDuration`,0),z(this,`_styleLayoutDuration`,0),z(this,`_count`,0),z(this,`_longestDuration`,0),z(this,`_longestDurationExcludingFirst`,0),z(this,`_totalBlockingDuration`,0),z(this,`_scriptSummaries`,new Map),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Oi(`long-animation-frame`)){this._diag.debug(`long-animation-frame not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=ki(`long-animation-frame`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}this._registerSessionEndListener()}}_registerSessionEndListener(){this._isEnabled&&(this._removeSessionEndListener&&this._removeSessionEndListener(),this._removeSessionEndListener=this.sessionManager.addSessionEndedListener(()=>{try{this._flushReport()}catch(e){this._diag.error(`error flushing report`,e)}}))}setSessionManager(e){super.setSessionManager(e),this._registerSessionEndListener()}disable(){this._isEnabled=!1,this._resetAccumulators(),this._observer&&(this._observer.disconnect(),this._observer=null),this._removeSessionEndListener&&(this._removeSessionEndListener(),this._removeSessionEndListener=null)}_processEntry(e){if(this._isEnabled){this._count++,this._totalDuration+=e.duration,this._workDuration+=e.renderStart?e.renderStart-e.startTime:e.duration,e.styleAndLayoutStart&&(this._styleLayoutDuration+=Math.max(0,e.startTime+e.duration-e.styleAndLayoutStart)),this._longestDuration=Math.max(this._longestDuration,e.duration),this._isFirstEntry&&this._count===1?this._isFirstEntry=!1:(this._longestDurationExcludingFirst=Math.max(this._longestDurationExcludingFirst,e.duration),e.firstUIEventTimestamp===0&&(this._totalBlockingDuration+=e.blockingDuration));try{for(let t of e.scripts){let e=t.sourceURL||`(inline)`;e.length>2048&&(e=`${e.substring(0,2048)}...`);let n=this._scriptSummaries.get(e);n?(n.totalDuration+=t.duration,n.styleAndLayoutDuration+=t.forcedStyleAndLayoutDuration,n.count++):this._scriptSummaries.set(e,{totalDuration:t.duration,styleAndLayoutDuration:t.forcedStyleAndLayoutDuration,count:1})}}catch(e){this._diag.error(`error processing scripts for entry`,e)}}}_flushReport(){if(this._count===0)return;let e;e=this._totalBlockingDuration<=200?`good`:this._totalBlockingDuration<=600?`needs-improvement`:`poor`;let t={[_t]:`ux.web_vital`,"mxl.web_vital.id":ht(),"mxl.web_vital.name":`TBD`,"mxl.web_vital.value":Math.round(this._totalBlockingDuration),"mxl.web_vital.rating":e,"mxl.tbd.loaf_total_duration":Math.round(this._totalDuration),"mxl.tbd.loaf_work_duration":Math.round(this._workDuration),"mxl.tbd.loaf_style_and_layout_duration":Math.round(this._styleLayoutDuration),"mxl.tbd.loaf_count":this._count,"mxl.tbd.loaf_longest_duration":Math.round(this._longestDuration),"mxl.tbd.loaf_longest_duration_excluding_first":Math.round(this._longestDurationExcludingFirst)};try{this.logger.emit({eventName:`mxl-loaf-report`,severityNumber:za.INFO,attributes:t})}catch(e){this._diag.error(`error emitting loaf report`,e)}try{if(this._scriptSummaries.size>0){let e=[...this._scriptSummaries].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]);this.logger.emit({eventName:`mxl-loaf-scripts`,severityNumber:za.INFO,body:JSON.stringify(Object.fromEntries(e)),attributes:{[_t]:`ux.loaf_scripts`}})}}catch(e){this._diag.error(`error emitting loaf script summary`,e)}this._resetAccumulators()}_resetAccumulators(){this._totalDuration=0,this._workDuration=0,this._styleLayoutDuration=0,this._count=0,this._longestDuration=0,this._longestDurationExcludingFirst=0,this._totalBlockingDuration=0,this._scriptSummaries=new Map}};let so=/\([^()]+\)/g;var co=class extends Xa{constructor({diag:e,shouldCleanupPathOptionsFromRouteName:t=!0}){super({instrumentationName:`NavigationInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_shouldCleanupPathOptionsFromRouteName`,!0),z(this,`_currentRouteSpan`,null),z(this,`_instrumentationType`,`manual`),z(this,`_removeSessionStartedFn`,null),z(this,`_removeSessionEndedFn`,null),z(this,`setInstrumentationType`,e=>{this._instrumentationType=e}),z(this,`setCurrentRoute`,e=>{if(!this._config.enabled)return;let t=Wi.getCurrentRoute();e.url!==(t==null?void 0:t.url)&&(Wi.setCurrentRoute(e),this._endRouteSpan(t),this._startRouteSpan(e))}),z(this,`_setupSessionListeners`,()=>{this._removeSessionStartedFn||(this._removeSessionStartedFn=this.sessionManager.addSessionStartedListener(()=>{let e=Wi.getCurrentRoute();e&&!this._currentRouteSpan&&(this._diag.debug(`Session started, starting route span.`),this._startRouteSpan(e))})),this._removeSessionEndedFn||(this._removeSessionEndedFn=this.sessionManager.addSessionEndedListener(()=>{this._currentRouteSpan&&(this._diag.debug(`Session ended, ending route span.`),this._endRouteSpan(Wi.getCurrentRoute()))}))}),z(this,`_cleanUpSessionListeners`,()=>{this._removeSessionStartedFn&&(this._removeSessionStartedFn(),this._removeSessionStartedFn=null),this._removeSessionEndedFn&&(this._removeSessionEndedFn(),this._removeSessionEndedFn=null)}),z(this,`_startRouteSpan`,e=>{this._diag.debug(`Starting route span for url: ${e.url}`),this._setupSessionListeners();let t=this._shouldCleanupPathOptionsFromRouteName?e.path.replace(so,``):e.path;return this._currentRouteSpan=this.tracer.startSpan(t,{attributes:{[_t]:`ux.surface`,[Ct]:t,[wt]:Wi.getCurrentPageId()||void 0}}),this._currentRouteSpan.setAttribute(bt,this._instrumentationType),this._currentRouteSpan}),z(this,`_endRouteSpan`,e=>{this._currentRouteSpan&&(e&&this._diag.debug(`Ending route span for url: ${e.url}`),this._currentRouteSpan.end(),this._currentRouteSpan=null)}),z(this,`enable`,()=>{this.setConfig({enabled:!0}),this._diag.debug(`NavigationInstrumentation enabled, listening for navigation events.`)}),z(this,`disable`,()=>{this._cleanUpSessionListeners(),this.setConfig({enabled:!1}),this._diag.debug(`NavigationInstrumentation disabled, stopped listening for navigation events.`)}),this._shouldCleanupPathOptionsFromRouteName=t,this._config.enabled&&this.enable()}};let lo,uo=(e={})=>(lo||(lo=new co(e)),lo);var fo=class extends Xa{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ServerTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_onLoad`,void 0),z(this,`_performanceCollected`,!1),this._onLoad=()=>{this._readServerTiming()},this._config.enabled&&this.enable()}enable(){if(window.removeEventListener(`load`,this._onLoad),window.document.readyState===`complete`){this._readServerTiming();return}window.addEventListener(`load`,this._onLoad)}disable(){window.removeEventListener(`load`,this._onLoad)}_readServerTiming(){var e;if(this._performanceCollected)return;this._performanceCollected=!0;let t=(e=performance.getEntriesByType(`navigation`)[0])==null?void 0:e.serverTiming;if(t!=null&&t.length)for(let e of t){var n;if((n=this.limitManager)!=null&&n.limitServerTimingEntry())return;this.logger.emit({eventName:`mxl-server-timing`,severityNumber:za.INFO,attributes:{[_t]:`ux.server_timing`,"mxl.server_timing.name":e.name,"mxl.server_timing.duration":e.duration,"mxl.server_timing.description":e.description}})}}};let po={samplingPct:100,networkSpansForwardingThreshold:0},mo=`mxl_remote_config`,ho=`0.0.14`,go=`mxl_app_instance_id`,_o=(e,t)=>{let n=null;try{n=e.getItem(go)}catch(e){t.warn(`Failed to retrieve app instance ID from session storage`,e)}if(!n){t.debug(`No existing app instance ID found in session storage, creating a new one`),n=mt();try{e.setItem(go,n)}catch(e){t.warn(`Failed to persist app instance ID to session storage`,e)}}return n},vo=`unknown_service`,yo=({serviceName:e})=>Cr({[cn]:e}),bo=({diagLogger:e,appVersion:t,pageSessionStorage:n})=>Cr({[un]:`mxl-web-sdk`,app_version:t,app_framework:1,sdk_version:ho,[dn]:ho,sdk_simple_version:1,sdk_platform:`web`,[ln]:`webjs`,"mxl.app_instance_id":_o(n,e),[pn]:window.navigator.userAgent,screen_resolution:`${window.screen.width}x${window.screen.height}`}),xo=(e,{osVersion:t,appVersion:n,deviceId:r},i)=>`${i||`https://mxl-basket.apps.ocpthikadev01.safaricom.net`}/config?appId=${e}&osVersion=${t}&appVersion=${n}&deviceId=${r}`,So=e=>{let t={samplingPct:e.threshold};return e.network_span_forwarding!==void 0&&(t.networkSpansForwardingThreshold=e.network_span_forwarding.pct_enabled),e.empty_session_avoidance_enabled_pct!==void 0&&(t.emptySessionAvoidanceEnabledPct=e.empty_session_avoidance_enabled_pct),e.service_name!==void 0&&e.service_name!==``&&(t.serviceName=e.service_name),t};var Co=class{constructor({appID:e,appVersion:t,deviceId:n,diag:r=L.createComponentLogger({namespace:`mxl-config-manager`}),storage:i=window.localStorage,defaultConfig:a={},mxlConfigURL:o}={}){z(this,`_remoteConfigURL`,null),z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_baseConfig`,void 0),z(this,`_sdkConfig`,void 0),z(this,`_etag`,null),z(this,`_remoteSourceServiceName`,void 0),e&&t&&n&&(this._remoteConfigURL=xo(e,{appVersion:t,deviceId:n,osVersion:`1`},o)),this._diag=r,this._storage=i;let s=this._getRemoteConfigFromStorage();s&&(this._etag=s.etag,this._captureRemoteServiceName(s.config)),this._baseConfig=H(H({},po),a),this._sdkConfig=H(H({},this._baseConfig),s?So(s.config):{})}setConfig(e){this._sdkConfig=H(H({},this._sdkConfig),e)}getConfig(){return this._sdkConfig}resolveApplicationServiceName(e){var t,n;return((t=this._remoteSourceServiceName)==null?void 0:t.trim())||(e==null?void 0:e.trim())||((n=this._baseConfig.serviceName)==null?void 0:n.trim())||vo}_captureRemoteServiceName(e){if(e.service_name===void 0)return;let t=e.service_name.trim();this._remoteSourceServiceName=t.length>0?t:void 0}refreshRemoteConfig(){var e=this;return B(function*(){if(e._remoteConfigURL)try{let t=yield e._fetchRemoteConfig(e._remoteConfigURL);if(!t){e._diag.debug(`No changes in remote config, skipping update`);return}let[n,r]=t;e._captureRemoteServiceName(n),e._storage.setItem(mo,JSON.stringify({config:n,etag:r})),e._sdkConfig=H(H({},e._baseConfig),So(n)),e._etag=r}catch(t){e._diag.warn(`Failed to refresh remote config: ${t instanceof Error?t.message:String(t)}`)}})()}_getRemoteConfigFromStorage(){try{let e=this._storage.getItem(mo);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to parse remote config from storage: ${e instanceof Error?e.message:String(e)}`),null}}_fetchRemoteConfig(e){var t=this;return B(function*(){let n=yield fetch(e,{headers:t._etag?{"If-None-Match":t._etag}:{}}),r=n.headers.get(`etag`);return n.status===304?null:n.ok?[yield n.json(),r]:(t._diag.warn(`Failed to fetch remote config from ${e}: ${n.statusText}`),null)})()}};let wo={maxAllowed:{error_log:500,warning_log:200,info_log:100,exception:500,breadcrumb:100,session_property:100,span:1e3,network_request:1e4,element_timing:500,server_timing:500,user_timing_mark:500,user_timing_measure:500},maxLength:{error_log:128,warning_log:128,info_log:128,exception:1024,breadcrumb:256,session_property_key:128,session_property_value:256,log_attribute_key:128,log_attribute_value:256,exception_attribute_key:128,exception_attribute_value:256},maxAttributes:{error_log:50,warning_log:50,info_log:50,exception:50}},To={info:`info_log`,warning:`warning_log`,error:`error_log`};var Eo=class{constructor({diag:e,maxAllowed:t,maxLength:n,maxAttributes:r}){z(this,`_diag`,void 0),z(this,`_diagnosticCounts`,{}),z(this,`_currentCount`,{exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}),z(this,`_maxAllowed`,void 0),z(this,`_maxLength`,void 0),z(this,`_maxAttributes`,void 0),this._diag=e==null?L.createComponentLogger({namespace:`MXLLimitManager`}):e,this._maxAllowed=t,this._maxLength=n,this._maxAttributes=r}_dropIfMaxReached(e){return this._currentCount[e]>=this._maxAllowed[e]?(this._diag.warn(`disallowing ${e} because the maximum number of ${this._maxAllowed[e].toString()} has already been reached for this session`),this._incrDiagnosticCount(e,`drop`),!0):(this._currentCount[e]=(this._currentCount[e]||0)+1,!1)}truncateString(e,t){return t.length>this._maxLength[e]?(this._diag.warn(`truncating ${e} because it is longer than ${this._maxLength[e].toString()} characters: "${t}"`),this._incrDiagnosticCount(e,`truncate_string`),t.substring(0,this._maxLength[e])):t}_truncateAttributes(e,t,n,r){let i=Object.keys(t);i.length>this._maxAttributes[e]&&(this._diag.warn(`truncating ${e} attributes because there are more than ${this._maxAttributes[e].toString()} set`),this._incrDiagnosticCount(e,`truncate_attributes`));let a={};for(let s=0;s<Math.min(i.length,this._maxAttributes[e]);s++){var o;let e=this.truncateString(n,i[s]);a[e]=this.truncateString(r,((o=t[i[s]])==null?void 0:o.toString())||``)}return a}limitBreadcrumb(e){return this._dropIfMaxReached(`breadcrumb`)?`dropped`:{name:this.truncateString(`breadcrumb`,e)}}limitException(e,t){return this._dropIfMaxReached(`exception`)?`dropped`:{message:this.truncateString(`exception`,e),attributes:this._truncateAttributes(`exception`,t,`exception_attribute_key`,`exception_attribute_value`)}}limitLog(e,t,n){let r=To[t];return this._dropIfMaxReached(r)?`dropped`:{message:this.truncateString(r,e),attributes:this._truncateAttributes(r,n,`log_attribute_key`,`log_attribute_value`)}}limitSessionProperty(e,t){return this._dropIfMaxReached(`session_property`)?`dropped`:{key:this.truncateString(`session_property_key`,e),value:this.truncateString(`session_property_value`,t)}}limitElementTimingEntry(){return this._dropIfMaxReached(`element_timing`)}limitServerTimingEntry(){return this._dropIfMaxReached(`server_timing`)}limitUserTimingEntry(e){return this._dropIfMaxReached(e===`mark`?`user_timing_mark`:`user_timing_measure`)}dropReadableSpan(e){let t=e.attributes[`mxl.type`]===`perf.network_request`?`network_request`:`span`;return this._dropIfMaxReached(t)}reset(){this._diagnosticCounts={},this._currentCount={exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}}_incrDiagnosticCount(e,t){let n=`mxl.app.applied_limit.${e}.${t}.count`;this._diagnosticCounts[n]=(this._diagnosticCounts[n]||0)+1}getDiagnosticCounts(){return this._diagnosticCounts}};let Do=()=>JSON.stringify(Dt._MXLFileBundleIDs||Dt._MXLFileBundleIDs||{});var Oo=class e{constructor({diag:e,perf:t,spanSessionManager:n,limitManager:r,loggerProvider:i,visibilityDoc:a=window.document,storage:o=window.localStorage}){z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_logger`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0);let s=i==null?Ja:i;this._diag=e==null?L.createComponentLogger({namespace:`MXLLogManager`}):e,this._perf=t==null?new Ci:t,this._logger=s.getLogger(`mxl-web-sdk-logs`),this._spanSessionManager=n,this._limitManager=r,this._visibilityDoc=a,this._storage=o}_validateAttributes(e){return Object.prototype.toString.call(e)===`[object Object]`?e:(this._diag.warn(`attributes must be a plain object`,e),{})}static _logSeverityToSeverityNumber(e){switch(e){case`info`:return za.INFO;case`warning`:return za.WARN;default:return za.ERROR}}logException(t,{handled:n=!0,attributes:r={},timestamp:i=this._perf.getNowMillis(),handler:a=`manual`}={}){var o;let s=this._validateAttributes(r);n||this._spanSessionManager.incrSessionCountForKey(`mxl.unhandled_exceptions_count`);let c=(t==null||(o=t.constructor)==null?void 0:o.name)||typeof t,l=``,u=c,d=``,f=``;if(t instanceof Error)l=String(t.message||``).trim(),u=t.name||``,d=t.stack||``,f=t.cause?`present`:``;else if(t&&typeof t==`object`)try{l=JSON.stringify(t)}catch(e){l=String(t).trim()}else l=String(t).trim();let p=this._limitManager.limitException(l,s);p!==`dropped`&&this._logger.emit({timestamp:i,severityNumber:za.ERROR,severityText:`ERROR`,body:p.message,attributes:H(H({},p.attributes),{},{[_t]:`sys.exception`,"mxl.exception_handling":e._exceptionHandlingType(n,a),"mxl.exception_cause":f,[tn]:c,"exception.name":u,[$t]:p.message,[en]:d,[xt]:Do(),[vt]:Et(this._visibilityDoc),"mxl.exception_number":gt(this._storage,`mxl_exception_number`,this._diag)})})}message(e,t,{attributes:n={},includeStacktrace:r=!0,stacktrace:i}={}){if(typeof e!=`string`||!e.trim()){this._diag.warn(`Message must be a non-empty string`);return}if(![`info`,`warning`,`error`].includes(t)){this._diag.warn(`Severity must be info, warning, or error`);return}let a=this._validateAttributes(n);t===`error`&&this._spanSessionManager.incrSessionCountForKey(`mxl.error_log_count`);let o=``;t!==`info`&&(typeof i==`string`?o=i:r&&(o=Error().stack||``)),this._logMessage({message:e.trim(),severity:t,timestamp:this._perf.getNowMillis(),attributes:a,stack:o})}_logMessage({message:t,severity:n,timestamp:r,attributes:i={},stack:a}){let o=this._limitManager.limitLog(t,n,i);o!==`dropped`&&this._logger.emit({timestamp:r,severityNumber:e._logSeverityToSeverityNumber(n),severityText:n.toUpperCase(),body:o.message,attributes:H(H(H({},o.attributes),{},{[_t]:`sys.log`},a?{"mxl.stacktrace.js":a,[xt]:Do()}:{}),{},{[vt]:Et(this._visibilityDoc)})})}static _exceptionHandlingType(e,t){return e?`handled`:t===`global_exception`?`unhandled_error`:t===`promise_rejection`?`unhandled_rejection`:`unhandled`}},ko=class{constructor({useDocumentTitleAsPageLabel:e=!0,titleDocument:t=window.document}={}){z(this,`_currentRoute`,null),z(this,`_currentPageId`,null),z(this,`_pageLabel`,null),z(this,`_titleDocument`,void 0),z(this,`_useDocumentTitleAsPageLabel`,void 0),z(this,`getCurrentPageId`,()=>this._currentPageId),z(this,`getCurrentRoute`,()=>this._currentRoute),z(this,`setPageLabel`,e=>{this._pageLabel=e}),z(this,`getPageLabel`,()=>this._pageLabel||(!this._useDocumentTitleAsPageLabel||!this._titleDocument?null:this._titleDocument.title)),z(this,`setCurrentRoute`,e=>{(!this._currentRoute||this._currentRoute.url!==e.url)&&(this._currentPageId=mt()),this._currentRoute=e,e.label?this._pageLabel=e.label:this._pageLabel=null}),z(this,`clearCurrentRoute`,()=>{this._currentRoute=null,this._currentPageId=null,this._pageLabel=null}),this._useDocumentTitleAsPageLabel=e,this._titleDocument=t}},Ao=class{constructor({dynamicConfigManager:e,deviceId:t,blockNetworkSpanForwarding:n}){z(this,`_dynamicConfigManager`,void 0),z(this,`_deviceId`,void 0),z(this,`_blockNetworkSpanForwarding`,void 0),this._dynamicConfigManager=e,this._deviceId=t,this._blockNetworkSpanForwarding=n}isSDKEnabled(){let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.samplingPct)}isNetworkSpanForwardingEnabled(){if(this._blockNetworkSpanForwarding)return!1;let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.networkSpansForwardingThreshold)}isEmptySessionAvoidanceEnabled(){let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.emptySessionAvoidanceEnabledPct)}},jo=class{constructor(e){z(this,`_span`,void 0),this._span=e}get attributes(){return this._span.attributes}addEvent(e,t,n){return this._span.addEvent(e,t,n),this}addLink(e){return this._span.addLink(e),this}addLinks(e){return this._span.addLinks(e),this}end(e){this._span.end(e)}isRecording(){return this._span.isRecording()}recordException(e,t){this._span.recordException(e,t)}setAttribute(e,t){return this._span.setAttribute(e,t),this}setAttributes(e){return this._span.setAttributes(e),this}removeAttribute(e){let t=this._span.attributes,{[e]:n}=t,r=Ti(t,[e].map(Bt));return this._span.attributes=r,this}setStatus(e){return this._span.setStatus(e),this}spanContext(){return this._span.spanContext()}updateName(e){return this._span.updateName(e),this}fail(e={code:`failure`}){e.code&&this._span.setAttribute(`mxl.error_code`,e.code.toUpperCase()),this._span.end(e.endTime)}};let Mo=`mxl_tab`,No=`mxl_tab_activity`;var Po=class{constructor({diag:e,perf:t,visibilityDoc:n=window.document,storage:r=window.localStorage,sessionStorage:i=window.sessionStorage,limitManager:a,referrer:o=document.referrer,navigationPerformance:s=window.performance}){z(this,`_previousSessionId`,null),z(this,`_activeSessionId`,null),z(this,`_activeSessionStartTime`,null),z(this,`_sessionSpan`,null),z(this,`_activeSessionCounts`,null),z(this,`_nextSessionCounts`,{}),z(this,`_coldStart`,!0),z(this,`_sdkStartupDuration`,0),z(this,`_sessionStartedListeners`,[]),z(this,`_sessionEndedListeners`,[]),z(this,`_tab`,void 0),z(this,`_navigationSource`,void 0),z(this,`_referrerInfo`,void 0),z(this,`_tracer`,void 0),z(this,`_noExportTracer`,void 0),z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0),z(this,`_sessionStorage`,void 0),z(this,`_limitManager`,void 0),z(this,`_referrer`,void 0),z(this,`_navigationPerformance`,void 0),this._diag=e==null?L.createComponentLogger({namespace:`MXLSpanSessionManager`}):e,this._perf=t==null?new Ci:t,this._visibilityDoc=n,this._storage=r,this._sessionStorage=i,this._limitManager=a,this._referrer=o,this._navigationPerformance=s,this._tracer=R.getTracer(`mxl-web-sdk-sessions`),this._noExportTracer=new ni().getTracer(`mxl-web-sdk-sessions`),this._referrerInfo=this._processReferrer();let c=this._initTab();this._tab=c.tab,this._navigationSource=c.navigationSource,this._setupNewTabClickListeners()}_getPermanentAttributes(){let e=new Map;try{for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);if(n!=null&&n.startsWith(`mxl.properties.`)){let t=this._storage.getItem(n);t&&e.set(n,t)}}}catch(e){this._diag.warn(`Error loading permanent session properties`,e)}return Object.fromEntries(e.entries())}addBreadcrumb(e){if(!this._sessionSpan){this._diag.debug(`trying to add breadcrumb to a session, but there is no session in progress. This is a no-op.`);return}let t=this._limitManager.limitBreadcrumb(e);t!==`dropped`&&this._sessionSpan.addEvent(`mxl-breadcrumb`,{message:t.name},this._perf.getNowMillis())}addProperty(e,t,n){if(!this._sessionSpan){this._diag.debug(`trying to add properties to a session, but there is no session in progress. This is a no-op.`);return}let r=this._limitManager.limitSessionProperty(e,t);if(r===`dropped`)return;let i=yt+r.key;if(this._sessionSpan.setAttribute(i,r.value),(n==null?void 0:n.lifespan)===`permanent`)try{this._storage.setItem(i,t)}catch(e){this._diag.warn(`Failed to set permanent session property`,e)}}removeProperty(e){if(!this._sessionSpan){this._diag.debug(`trying to remove a session property, but there is no session in progress. This is a no-op.`);return}let t=yt+this._limitManager.truncateString(`session_property_key`,e);this._sessionSpan.removeAttribute(t);try{this._storage.getItem(t)&&this._storage.removeItem(t)}catch(e){this._diag.warn(`Error removing permanent session property`,e)}}endSessionSpan(){this.endSessionSpanInternal(`manual`)}endSessionSpanInternal(e){if(!this._sessionSpan){this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`);return}for(let e of this._sessionEndedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session ended listener`,e)}this._sessionSpan.setAttributes(this._endSessionSpanAttributes(e)),this._sessionSpan.end(),this._sessionSpan=null,this._activeSessionStartTime=null,this._previousSessionId=this._activeSessionId,this._activeSessionId=null,this._activeSessionCounts=null,this._limitManager.reset()}_endSessionSpanAttributes(e){return H(H(H(H({},this._getPermanentAttributes()),{},{"mxl.session_end_type":e},this._activeSessionCounts),this._limitManager.getDiagnosticCounts()),{},{"mxl.sdk_startup_duration":this._sdkStartupDuration})}currentSessionAsReadableSpan(e){if(!this._sessionSpan||!this._activeSessionStartTime)return this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`),null;let t=this._noExportTracer.startSpan(`mxl-session`,{startTime:this._activeSessionStartTime,attributes:H(H(H({},this._sessionSpan.attributes),this._endSessionSpanAttributes(e)),{},{"mxl.from_storage":!0})});return t.end(),t}getSessionId(){return this._activeSessionId}getPreviousSessionId(){return this._previousSessionId}getSessionSpan(){return this._sessionSpan}getSessionStartTime(){return this._activeSessionStartTime}startSessionSpan(e){var t;this._sessionSpan&&this.endSessionSpanInternal(`manual`),this._activeSessionId=mt(),this._activeSessionStartTime=this._perf.getNowHRTime(),this._activeSessionCounts={};let n=this._nextSessionCounts;this._nextSessionCounts={};let r=H(H({},this._getPermanentAttributes()),{},{[_t]:`ux.session`,[vt]:Et(this._visibilityDoc),[La]:this._activeSessionId,"mxl.cold_start":this._coldStart,"mxl.session_number":gt(this._storage,`mxl_session_number`,this._diag),"mxl.experience_id":this._tab.experienceId,"mxl.tab_id":this._tab.tabId,"mxl.navigation_source":this._navigationSource},n);this._referrerInfo.isValid&&this._referrerInfo.scrubbedUrl&&(r[`mxl.referrer_url`]=this._referrerInfo.scrubbedUrl),this._tab.sourceTabId&&(r[`mxl.source_tab_id`]=this._tab.sourceTabId),r[`mxl.session_start_type`]=(t=e==null?void 0:e.reason)==null?`manual`:t,this._sessionSpan=new jo(this._tracer.startSpan(`mxl-session`,{attributes:r})),this._coldStart=!1;for(let e of this._sessionStartedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session started listener`,e)}}incrSessionCountForKey(e){if(!this._sessionSpan||!this._activeSessionCounts){this._diag.debug(`trying to increment a count for the active session, but there is no session in progress. This is a no-op.`);return}this._activeSessionCounts[e]=(this._activeSessionCounts[e]||0)+1}incrNextSessionCountForKey(e){this._nextSessionCounts[e]=(this._nextSessionCounts[e]||0)+1}addSessionStartedListener(e){let t=this._sessionStartedListeners.push(e);return()=>{this._sessionStartedListeners.splice(t-1,1)}}addSessionEndedListener(e){let t=this._sessionEndedListeners.push(e);return()=>{this._sessionEndedListeners.splice(t-1,1)}}recordSDKStartupDuration(e){this._sdkStartupDuration=Math.ceil(e)}setTracerProvider(e){this._tracer=e.getTracer(`mxl-web-sdk-sessions`)}_determineNavigationSource(){try{let e=this._navigationPerformance.getEntriesByType(`navigation`);if(e.length>0&&e[0]){let t=e[0];if(t.type===`reload`)return`reload`;if(t.type===`back_forward`)return`back_forward`}}catch(e){this._diag.warn(`Failed to get navigation type`,e)}return this._referrerInfo.isValid?this._referrerInfo.isSameOrigin?`same_origin`:`external`:`direct`}_processReferrer(){if(!this._referrer)return{isValid:!1,isSameOrigin:!1};try{let e=new URL(this._referrer),t=window.location.origin;return{isValid:!0,isSameOrigin:e.origin===t,scrubbedUrl:e.origin+e.pathname}}catch(e){return{isValid:!1,isSameOrigin:!1}}}_getTabContext(e){let t=_o(this._sessionStorage,this._diag),n,r;if(e===`same_origin`){let e=this._getTabActivity();e&&Date.now()-e.lastActivityMs<=1e4&&(n=e.tabId,r=e.experienceId)}return r!=null||(r=mt()),{sourceTabId:n,experienceId:r,tabId:t}}_initTab(){let e=this._determineNavigationSource();try{let t=this._sessionStorage.getItem(Mo);if(t)return{tab:JSON.parse(t),navigationSource:e}}catch(e){this._diag.warn(`Failed to retrieve tab data`,e)}let t=this._getTabContext(e),n={experienceId:t.experienceId,sourceTabId:t.sourceTabId,tabId:t.tabId};try{this._sessionStorage.setItem(Mo,JSON.stringify(n))}catch(e){this._diag.warn(`Failed to store tab data`,e)}return{tab:n,navigationSource:e}}_getTabActivity(){try{let e=this._storage.getItem(No);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to retrieve tab activity`,e),null}}_storeTabActivity(e){try{this._storage.setItem(No,JSON.stringify(e))}catch(e){this._diag.warn(`Failed to save tab activity`,e)}}_storeCurrentTabAsSource(){let e={tabId:this._tab.tabId,experienceId:this._tab.experienceId,lastActivityMs:Date.now()};this._storeTabActivity(e)}_setupNewTabClickListeners(){let e=e=>{var t;if(e.button===1||e.ctrlKey||e.metaKey||e.shiftKey){this._storeCurrentTabAsSource();return}(t=e.target)!=null&&t.closest(`a[target="_blank"], form[target="_blank"], a[rel*="noopener"], a[rel*="noreferrer"]`)&&this._storeCurrentTabAsSource()},t={capture:!0,passive:!0};document.addEventListener(`auxclick`,e,t),document.addEventListener(`click`,e,t)}},Fo=class{constructor({tracerProvider:e}={}){z(this,`_tracer`,void 0),z(this,`setSpan`,R.setSpan);let t=e==null?R:e;this._tracer=t.getTracer(`mxl-web-sdk-traces`)}startSpan(e,t={},n){t.attributes=t.attributes?t.attributes:{},t.attributes[_t]=`perf`;let r=t.parentSpan?R.setSpan(I.active(),t.parentSpan):n;return new jo(this._tracer.startSpan(e,t,r))}getSpan(e){let t=R.getSpan(e);if(t)return new jo(t)}};let Io=`mxl_user`,Lo=`mxl_user_id`,Ro=`mxl_external_user_id`,zo=e=>typeof e[`enduser.pseudo.id`]==`string`&&e[`enduser.pseudo.id`].length===32,Bo=e=>typeof e==`string`&&e.length===32;var Vo=class{constructor({diag:e,storage:t=window.localStorage}={}){z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_mxlUserId`,null),this._diag=e==null?L.createComponentLogger({namespace:`MXLUserManager`}):e,this._storage=t,this._migrateOldLocalStorageKey(),this._initialSetup()}getMXLUserId(){return this._mxlUserId||this._generateNewMXLUserId()}setMXLUserId(e){this._mxlUserId=e;try{this._storage.setItem(Lo,e)}catch(e){this._diag.warn(`Failed to persist user object for storage, keeping it in-memory only`,e)}}clearMXLUserId(){this._mxlUserId=null;try{this._storage.removeItem(Lo)}catch(e){this._diag.warn(`Failed to remove mxl user in storage`,e)}}_migrateOldLocalStorageKey(){try{let e=this._storage.getItem(Io);if(e){let t=JSON.parse(e);zo(t)?(this._diag.debug(`Migrating old user data from storage`),this._storage.setItem(Lo,t[`enduser.pseudo.id`]),this._storage.removeItem(Io)):(this._diag.warn(`Invalid user data found in storage, clearing old user data`),this._storage.removeItem(Io))}}catch(e){this._diag.warn(`Failed to get old user data from storage`,e)}}_initialSetup(){try{let e=this._storage.getItem(Lo);e?Bo(e)?this._mxlUserId=e:(this._diag.warn(`Invalid mxl user id, generating a new one`),this.clearMXLUserId()):this._diag.debug(`No existing user found in storage, creating a new one`)}catch(e){this._diag.warn(`Failed to get mxl user id from storage, defaulting to a new one`,e)}this._mxlUserId||(this._mxlUserId=this._generateNewMXLUserId())}_generateNewMXLUserId(){let e=mt();return this.setMXLUserId(e),e}getUserId(){try{return this._storage.getItem(Ro)}catch(e){return this._diag.warn(`Failed to retrieve user id from storage`,e),null}}setUserId(e){try{this._storage.setItem(Ro,e)}catch(e){this._diag.warn(`Failed to store user id`,e)}}clearUserId(){try{this._storage.removeItem(Ro)}catch(e){this._diag.warn(`Failed to clear user id`,e)}}};let Ho=[`keydown`,`mousedown`,`mousemove`,`scroll`];var Uo=class extends Xa{constructor({diag:e}={}){super({instrumentationName:`SpanSessionBrowserActivityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_onActivityThrottled`,void 0),z(this,`_activityTimeout`,void 0),z(this,`disable`,()=>{ut({target:window,events:Ho,callback:this._onActivityThrottled}),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null}),z(this,`enable`,()=>{lt({target:window,events:Ho,callback:this._onActivityThrottled})}),z(this,`_onInactivity`,()=>{this._diag.debug(`Inactivity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null,this.sessionManager.endSessionSpanInternal(`inactivity`)}),z(this,`_onActivity`,()=>{this._diag.debug(`Activity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this.sessionManager.getSessionId()||this.sessionManager.startSessionSpan({reason:`activity`}),this._activityTimeout=setTimeout(this._onInactivity,18e5)}),this._activityTimeout=null,this._onActivityThrottled=Ai(this._onActivity,3e4),this._config.enabled&&this.enable()}},Wo=class extends Xa{constructor({diag:e,perf:t,visibilityDoc:n=window.document}={}){super({instrumentationName:`SpanSessionVisibilityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onVisibilityChange`,void 0),this._onVisibilityChange=()=>{this._diag.debug(`Visibility change detected: ${n.visibilityState}`);try{this.sessionManager.endSessionSpanInternal(`state_changed`),n.visibilityState===`visible`&&(this._diag.debug(`Starting a session since document visibility switched to visible`),this.sessionManager.startSessionSpan({reason:`visible`}))}catch(e){this._diag.error(`Failed to rotate session on visibility change to ${n.visibilityState}`,e)}},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`visibilitychange`,this._onVisibilityChange)}enable(){window.addEventListener(`visibilitychange`,this._onVisibilityChange)}};let Go=`mxl.user_timing.start_time`,Ko=`mxl.user_timing.duration`,qo=`mxl.user_timing.entry_type`;var Jo=class extends Xa{constructor({diag:e,perf:t,limitManager:n,allowedEntries:r}={}){super({instrumentationName:`UserTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_markObserver`,null),z(this,`_measureObserver`,null),z(this,`_seenEntries`,new Set),z(this,`_isEnabled`,!1),z(this,`_allowedEntries`,void 0),this._allowedEntries=r,this._config.enabled&&this.enable()}enable(){this._isEnabled||(this._isEnabled=!0,this._seenEntries=new Set,this._markObserver&&this._markObserver.disconnect(),this._measureObserver&&this._measureObserver.disconnect(),this._markObserver=ki(`mark`,this._processEntry.bind(this),{diag:this._diag}),this._markObserver||this._diag.error(`failed to enable mark observer`),this._measureObserver=ki(`measure`,e=>this._processEntry(e),{diag:this._diag}),this._measureObserver||this._diag.error(`failed to enable measure observer`),!this._markObserver&&!this._measureObserver&&(this._isEnabled=!1))}disable(){this._isEnabled=!1,this._markObserver&&(this._markObserver.disconnect(),this._markObserver=null),this._measureObserver&&(this._measureObserver.disconnect(),this._measureObserver=null),this._seenEntries=new Set}_processEntry(e){var t;if(!this._isEnabled||this._allowedEntries!==void 0&&!(Array.isArray(this._allowedEntries)?this._allowedEntries.includes(e.name):this._allowedEntries(e)))return;let n=`${location.href}::${e.name}`;if(this._seenEntries.has(n)||(this._seenEntries.add(n),(t=this.limitManager)!=null&&t.limitUserTimingEntry(e.entryType)))return;if(e.entryType===`measure`){let t=e.detail;this.tracer.startSpan(e.name,{startTime:this.perf.epochMillisFromOriginOffset(e.startTime),attributes:H({[_t]:`ux.user_timing`,[bt]:`user_timing`,[qo]:e.entryType,[Go]:this.perf.millisFromZeroTime(e.startTime),[Ko]:e.duration},t!=null&&{"mxl.user_timing.detail":JSON.stringify(t)})}).end(this.perf.epochMillisFromOriginOffset(e.startTime+e.duration));return}let r=e.detail,i=r==null?void 0:JSON.stringify(r);this.logger.emit({timestamp:this.perf.epochMillisFromOriginOffset(e.startTime),eventName:`mxl-user-timing`,severityNumber:za.INFO,attributes:{[_t]:`ux.user_timing`,"mxl.user_timing.name":e.name,[Go]:this.perf.millisFromZeroTime(e.startTime),[Ko]:e.duration,[qo]:e.entryType},body:i})}};let Yo=`mxl.web_vital.attribution.`;var Xo=class{constructor(){z(this,`t`,void 0),z(this,`o`,0),z(this,`i`,[])}u(e){var t;if(e.hadRecentInput)return;let n=this.i[0],r=this.i.at(-1);this.o&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),(t=this.t)==null||t.call(this,e)}};let Zo=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Qo=e=>{if(document.readyState===`loading`)return`loading`;let t=Zo();if(t){if(e<t.domInteractive)return`loading`;if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return`dom-interactive`;if(t.domComplete===0||e<t.domComplete)return`dom-content-loaded`}return`complete`},$o=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},es=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[$o(n),...Array.from(n.classList).sort()].join(`.`);if(t.length+r.length>99)return t||r;if(t=t?r+`>`+t:r,n.id)break;e=n.parentNode}}catch(e){}return t},ts=new WeakMap;function ns(e,t){return ts.get(e)||ts.set(e,new t),ts.get(e)}let rs=-1,is=()=>rs,as=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(rs=t.timeStamp,e(t))},!0)},os=(e,t,n,r)=>{let i,a;return o=>{var s;t.value>=0&&(o||r)&&(a=t.value-((s=i)==null?0:s),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`)(t.value,n),e(t)))}},ss=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},cs=()=>{var e,t;return(e=(t=Zo())==null?void 0:t.activationStart)==null?0:e},ls=(e,t=-1)=>{let n=Zo(),r=`navigate`;return is()>=0?r=`back-forward-cache`:n&&(document.prerendering||cs()>0?r=`prerender`:document.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:r}},us=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(H({type:e,buffered:!0},n)),r}}catch(e){}},ds=e=>{let t=!1;return()=>{t||(e(),t=!0)}},fs=-1,ps=new Set,ms=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,hs=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of ps)e();isFinite(fs)||(fs=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,hs,!0))}},gs=()=>{if(fs<0){var e;let t=cs(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;fs=n==null?ms():n,addEventListener(`visibilitychange`,hs,!0),addEventListener(`prerenderingchange`,hs,!0),as(()=>{setTimeout(()=>{fs=ms()})})}return{get firstHiddenTime(){return fs},onHidden(e){ps.add(e)}}},_s=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},vs=[1800,3e3],ys=(e,t={})=>{_s(()=>{let n=gs(),r,i=ls(`FCP`),a=us(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-cs(),0),i.entries.push(t),r(!0)))});a&&(r=os(e,i,vs,t.reportAllChanges),as(n=>{i=ls(`FCP`),r=os(e,i,vs,t.reportAllChanges),ss(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},bs=[.1,.25],xs=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],Ss=(e,t={})=>{let n=ns(t=Object.assign({},t),Xo),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=xs(e.sources),o=n==null?void 0:n.node;if(o){var i,a;let e=(i=(a=t.generateTarget)==null?void 0:a.call(t,o))==null?es(o):i;r.set(n,e)}}},((e,t={})=>{let n=gs();ys(ds(()=>{let r,i=ls(`CLS`,0),a=ns(t,Xo),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=us(`layout-shift`,o);s&&(r=os(e,i,bs,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),as(()=>{a.o=0,i=ls(`CLS`,0),r=os(e,i,bs,t.reportAllChanges),ss(r)}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){var n;let i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(!(i==null||(n=i.sources)==null)&&n.length){let e=xs(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:Qo(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},Cs=(e,t={})=>{ys(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Qo(is())};if(e.entries.length){let n=Zo(),r=e.entries.at(-1);if(n){let i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:Qo(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},ws=0,Ts=1/0,Es=0,Ds=e=>{for(let t of e)t.interactionId&&(Ts=Math.min(Ts,t.interactionId),Es=Math.max(Es,t.interactionId),ws=Es?(Es-Ts)/7+1:0)},Os,ks=()=>{var e;return Os?ws:(e=performance.interactionCount)==null?0:e},As=()=>{`interactionCount`in performance||Os||(Os=us(`event`,Ds,{durationThreshold:0}))},js=0;var Ms=class{constructor(){z(this,`l`,[]),z(this,`h`,new Map),z(this,`m`,void 0),z(this,`p`,void 0)}v(){js=ks(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((ks()-js)/50));return this.l[e]}u(e){var t;if((t=this.m)==null||t.call(this,e),!e.interactionId&&e.entryType!==`first-input`)return;let n=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>n.T){var i;if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){let e=this.l.splice(10);for(let t of e)this.h.delete(t.id)}(i=this.p)==null||i.call(this,r)}}};let Ns=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=ds(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},Ps=[200,500],Fs=(e,t={})=>{let n=ns(t=Object.assign({},t),Ms),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(Ns(u),c=!0)},u=()=>{let e=new Set(n.l.map(e=>o.get(e.entries[0]))),t=i.length-10;i=i.filter((n,r)=>r>=t||e.has(n));let s=new Set;for(let e of i){let t=d(e.startTime,e.processingEnd);for(let e of t)s.add(e)}r=r.filter(e=>e.startTime>a||s.has(e)),c=!1};n.m=e=>{let n=e.startTime+e.duration,r;a=Math.max(a,e.processingEnd);for(let a=i.length-1;a>=0;a--){let o=i[a];if(Math.abs(n-o.renderTime)<=8){r=o,r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:!1===t.includeProcessedEventEntries?[]:[e]},i.push(r)),(e.interactionId||e.entryType===`first-input`)&&o.set(e,r),l()},n.p=e=>{if(!s.get(e)){let i=e.entries[0].target;if(i){var n,r;let a=(n=(r=t.generateTarget)==null?void 0:r.call(t,i))==null?es(i):n;s.set(e,a)}}};let d=(e,t)=>{let n=[];for(let i of r)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;n.push(i)}return n},f=e=>{let t=e.entries[0],r=o.get(t),i=t.processingStart,a=Math.max(t.startTime+t.duration,i),c=Math.min(r.processingEnd,a),l=r.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,c),f=n.h.get(t.interactionId),p={interactionTarget:s.get(f),interactionType:t.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:u,inputDelay:i-t.startTime,processingDuration:c-i,presentationDelay:a-c,loadState:Qo(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{var t;if(!((t=e.longAnimationFrameEntries)!=null&&t.length))return;let n=e.interactionTime,r=e.inputDelay,i=e.processingDuration,a,o,s=0,c=0,l=0,u=0;for(let t of e.longAnimationFrameEntries){c=c+t.startTime+t.duration-t.styleAndLayoutStart;for(let e of t.scripts){let t=e.startTime+e.duration;if(t<n)continue;let l=t-Math.max(n,e.startTime),d=e.duration?l/e.duration*e.forcedStyleAndLayoutDuration:0;s+=l-d,c+=d,l>u&&(o=e.startTime<n+r?`input-delay`:e.startTime>=n+r+i?`presentation-delay`:`processing-duration`,a=e,u=l)}}let d=e.longAnimationFrameEntries.at(-1),f=d?d.startTime+d.duration:0;f>=n+r+i&&(l=e.nextPaintTime-f),a&&o&&(e.longestScript={entry:a,subpart:o,intersectingDuration:u}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=c,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-c-l})(p),Object.assign(e,{attribution:p})};us(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=gs();_s(()=>{var r;As();let i,a=ls(`INP`),o=ns(t,Ms),s=e=>{Ns(()=>{for(let t of e)o.u(t);let t=o.M();t&&t.T!==a.value&&(a.value=t.T,a.entries=t.entries,i())})},c=us(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=os(e,a,Ps,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),as(()=>{o.v(),a=ls(`INP`),i=os(e,a,Ps,t.reportAllChanges)}))})})(t=>{e(f(t))},t)};var Is=class{constructor(){z(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}};let Ls=[2500,4e3],Rs=(e,t={})=>{let n=ns(t=Object.assign({},t),Is),r=new WeakMap;n.m=e=>{let n=e.element;if(n){var i,a;let o=(i=(a=t.generateTarget)==null?void 0:a.call(t,n))==null?es(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{_s(()=>{let n=gs(),r,i=ls(`LCP`),a=ns(t,Is),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a.u(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-cs(),0),i.entries=[t],r())},s=us(`largest-contentful-paint`,o);if(s){r=os(e,i,Ls,t.reportAllChanges);let n=ds(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(Ns(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});as(n=>{i=ls(`LCP`),r=os(e,i,Ls,t.reportAllChanges),ss(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=e.entries.at(-1),i=n.url&&performance.getEntriesByType(`resource`).find(e=>e.name===n.url);t.target=r.get(n),t.lcpEntry=n,n.url&&(t.url=n.url),i&&(t.lcpResourceEntry=i);let a=Zo();if(a){let n=a.activationStart||0,r=Math.max(0,a.responseStart-n),o=Math.max(r,i?(i.requestStart||i.startTime)-n:0),s=Math.min(e.value,Math.max(o,i?i.responseEnd-n:0));t=H(H({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},zs=[800,1800],Bs=e=>{document.prerendering?_s(()=>Bs(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Bs(e),!0)},Vs=(e,t={})=>{((e,t={})=>{let n=ls(`TTFB`),r=os(e,n,zs,t.reportAllChanges);Bs(()=>{let i=Zo();i&&(n.value=Math.max(i.responseStart-cs(),0),n.entries=[i],r(!0),as(()=>{n=ls(`TTFB`,0),r=os(e,n,zs,t.reportAllChanges),r(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)},Hs=[`CLS`,`INP`,`LCP`,`FCP`,`TTFB`],Us={CLS:Ss,FCP:Cs,LCP:Rs,INP:Fs,TTFB:Vs,FID:void 0},Ws=e=>{let t=typeof e;return t===`number`||t===`string`||t===`boolean`},Gs=e=>Math.round(Math.max(0,e)),Ks=e=>{let t={},n=e.attribution;if(!n||typeof n!=`object`)return t;for(let[e,r]of Object.entries(n))Ws(r)&&(t[`${Yo}${e}`]=r);return t},qs=(e,t)=>{let n={},r=e.attribution;try{if(r.longAnimationFrameEntries.length>0){let e=new Map;for(let t of r.longAnimationFrameEntries)for(let n of t.scripts){let t=n.sourceURL||`(inline)`;t.length>2048&&(t=`${t.substring(0,2048)}...`);let r=e.get(t);r?(r.totalDuration+=n.duration,r.styleAndLayoutDuration+=n.forcedStyleAndLayoutDuration,r.count++):e.set(t,{totalDuration:n.duration,styleAndLayoutDuration:n.forcedStyleAndLayoutDuration,count:1})}e.size>0&&(n[`${Yo}loaf_scripts`]=JSON.stringify(Object.fromEntries([...e].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]))))}}catch(e){t.error(`error building loaf scripts for INP`,e)}return n},Js=(e,t)=>{let n={},r=e.attribution.navigationEntry;if(r)try{var i;let e=Gs(r.redirectEnd-r.redirectStart),t=Gs(r.domainLookupEnd-r.domainLookupStart),a=Gs(r.secureConnectionStart>0?r.secureConnectionStart-r.connectStart:r.connectEnd-r.connectStart),o=Gs(r.secureConnectionStart>0?r.connectEnd-r.secureConnectionStart:0),s=Gs(Math.max((i=r.finalResponseHeadersStart)==null?0:i,r.responseStart)-r.requestStart),c=Gs(Math.round(r.responseEnd-r.startTime)-e-t-a-o-s),l=Yo;n[`${l}redirect`]=e,n[`${l}domainLookup`]=t,n[`${l}tcpConnection`]=a,n[`${l}tlsNegotiation`]=o,n[`${l}serverResponse`]=s,n[`${l}unattributed`]=c}catch(e){t.error(`error computing TTFB timing breakdown`,e)}else t.debug(`TTFB navigationEntry unavailable, skipping timing breakdown`);return n};var Ys=class extends Xa{constructor({diag:e,perf:t,listeners:n=Us,urlDocument:r=window.document,urlAttribution:i=!0,pageManager:a}={}){super({instrumentationName:`WebVitalsInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_listeners`,void 0),z(this,`_urlDocument`,void 0),z(this,`_urlAttribution`,void 0),z(this,`_pageManager`,void 0),z(this,`_attributedPage`,{INP:void 0,LCP:void 0,CLS:void 0,FCP:void 0,TTFB:void 0}),z(this,`_largestShiftTargetForCLS`,void 0),z(this,`_listenersRegistered`,!1),z(this,`_isEnabled`,!1),this._listeners=n,this._urlDocument=r,this._urlAttribution=i,this._pageManager=a==null?Wi.getPageManager():a,this._config.enabled&&this.enable()}disable(){this._isEnabled=!1,this._diag.debug(`WebVitalsInstrumentation disabled, pausing emission`)}enable(){if(this._isEnabled=!0,this._listenersRegistered){this._diag.debug(`WebVitalsInstrumentation listeners already registered, resuming emission`);return}if(this._listenersRegistered=!0,Hs.forEach(e=>{var t,n;(t=(n=this._listeners)[e])==null||t.call(n,t=>{if(!this._isEnabled)return;let n=this.sessionManager.getSessionSpan();if(!n)return;let r=this._getTimeForMetric(t),i=this._getAttributedPageForMetric(t),a=H(H(H({"mxl.type":`ux.web_vital`,"url.full":i.fullURL,"browser.url.full":i.fullURL,"mxl.web_vital.navigation_type":t.navigationType,"mxl.web_vital.name":t.name,"mxl.web_vital.rating":t.rating,"mxl.web_vital.id":t.id,"mxl.web_vital.delta":t.delta,"mxl.web_vital.value":t.value},Ks(t)),e===`INP`?qs(t,this._diag):{}),e===`TTFB`?Js(t,this._diag):{});i.path&&i.pageID&&(a[`app.surface.name`]=i.path,a[`app.surface.id`]=i.pageID),i.label&&(a[`app.surface.label`]=i.label),n.addEvent(`mxl-web-vitals-report-${e}`,a,r)})}),this._urlAttribution){var e,t,n,r,i,a,o,s,c,l;(e=(t=this._listeners).TTFB)==null||e.call(t,()=>{this._attributedPage.TTFB=this._currentAttributedPage()},{reportAllChanges:!0}),(n=(r=this._listeners).FCP)==null||n.call(r,()=>{this._attributedPage.FCP=this._currentAttributedPage()},{reportAllChanges:!0}),(i=(a=this._listeners).INP)==null||i.call(a,()=>{this._attributedPage.INP=this._currentAttributedPage()},{reportAllChanges:!0}),(o=(s=this._listeners).LCP)==null||o.call(s,()=>{this._attributedPage.LCP=this._currentAttributedPage()},{reportAllChanges:!0}),(c=(l=this._listeners).CLS)==null||c.call(l,e=>{let t=e;this._largestShiftTargetForCLS!==t.attribution.largestShiftTarget&&(this._largestShiftTargetForCLS=t.attribution.largestShiftTarget,this._attributedPage.CLS=this._currentAttributedPage())},{reportAllChanges:!0})}}_getTimeForMetric(e){return e.name===`CLS`&&e.attribution.largestShiftTime?this.perf.epochMillisFromOriginOffset(e.attribution.largestShiftTime):e.name===`INP`&&e.attribution.interactionTime?this.perf.epochMillisFromOriginOffset(e.attribution.interactionTime):this.perf.getNowMillis()}_currentAttributedPage(){let e={fullURL:this._urlDocument.URL},t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.path=t.path,e.pageID=n);let r=this._pageManager.getPageLabel();return r&&(e.label=r),e}_getAttributedPageForMetric(e){return e.name===`FCP`&&this._attributedPage.FCP?this._attributedPage.FCP:e.name===`TTFB`&&this._attributedPage.TTFB?this._attributedPage.TTFB:e.name===`INP`&&this._attributedPage.INP?this._attributedPage.INP:e.name===`LCP`&&this._attributedPage.LCP?this._attributedPage.LCP:e.name===`CLS`&&this._attributedPage.CLS&&e.attribution.largestShiftTarget===this._largestShiftTargetForCLS?this._attributedPage.CLS:this._currentAttributedPage()}};function Xs(e){return Zs(e,new WeakSet)}function Zs(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Zs(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Zs(e,t))}return!1}var Qs=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){z(this,`hrTime`,void 0),z(this,`hrTimeObserved`,void 0),z(this,`spanContext`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`attributes`,{}),z(this,`_severityText`,void 0),z(this,`_severityNumber`,void 0),z(this,`_body`,void 0),z(this,`_eventName`,void 0),z(this,`_attributesCount`,0),z(this,`_droppedAttributesCount`,0),z(this,`_isReadonly`,!1),z(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=bn(r==null?f:r),this.hrTimeObserved=bn(i==null?f:i),d){let e=R.getSpanContext(d);e&&Re(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return L.warn(`Invalid attribute key: ${e}`),this;if(!Xs(t))return L.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&L.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return L.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute($t,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(tn,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(tn,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute($t,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(en,n.stack),t=!0)}t||L.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&L.warn(`Can not execute the operation on emitted log record`),this._isReadonly}},$s=class{constructor(e,t){z(this,`instrumentationScope`,void 0),z(this,`_sharedState`,void 0),z(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=e.context||I.active();if(!this.enabled(e))return;let n=new Qs(this._sharedState,this.instrumentationScope,H({context:t},e));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e==null?void 0:e.severityNumber;if(typeof n==`number`&&n!==za.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=(e==null?void 0:e.context)||I.active();if(t.traceBased){let e=R.getSpanContext(r);if(e&&Re(e)&&(e.traceFlags&we.SAMPLED)!==we.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e==null?void 0:e.severityNumber,eventName:e==null?void 0:e.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},ec=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}},tc=class{constructor(e,t){z(this,`processors`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return B(function*(){let t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map(e=>dr(e.forceFlush(),t)))})()}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}shutdown(){var e=this;return B(function*(){yield Promise.all(e.processors.map(e=>e.shutdown()))})()}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function nc(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var rc=class{constructor(e){z(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(`otel.sdk.log.created`,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}};let ic={disabled:!1,minimumSeverity:za.UNSPECIFIED,traceBased:!1},ac=()=>H({},ic);var oc=class{constructor(e,t,n,r,i,a){z(this,`loggers`,new Map),z(this,`activeProcessor`,void 0),z(this,`registeredLogRecordProcessors`,[]),z(this,`resource`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),z(this,`logRecordLimits`,void 0),z(this,`processors`,void 0),z(this,`loggerMetrics`,void 0),z(this,`_loggerConfigurator`,void 0),z(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new tc(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ec,this._loggerConfigurator=i==null?ac:i;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,`0.218.0`):_e();this.loggerMetrics=new rc(o)}getLoggerConfig(e){let t=nc(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}},sc=class{constructor(e={}){var t,n,r,i,a,o,s,c;z(this,`_shutdownOnce`,void 0),z(this,`_sharedState`,void 0);let l={resource:(t=e.resource)==null?Tr():t,forceFlushTimeoutMillis:(n=e.forceFlushTimeoutMillis)==null?3e4:n,logRecordLimits:{attributeCountLimit:(r=(i=e.logRecordLimits)==null?void 0:i.attributeCountLimit)==null?128:r,attributeValueLengthLimit:(a=(o=e.logRecordLimits)==null?void 0:o.attributeValueLengthLimit)==null?1/0:a},loggerConfigurator:(s=e.loggerConfigurator)==null?ac:s,processors:(c=e.processors)==null?[]:c,meterProvider:e.meterProvider};this._sharedState=new oc(l.resource,l.forceFlushTimeoutMillis,l.logRecordLimits,l.processors,l.loggerConfigurator,l.meterProvider),this._shutdownOnce=new hr(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return L.warn(`A shutdown LoggerProvider cannot provide a Logger`),Va;e||L.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new $s({name:r,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(L.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(L.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};function cc(e){return lc.apply(this,arguments)}function lc(){return lc=B(function*(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&(yield Promise.all(t))}),lc.apply(this,arguments)}var uc=class{constructor(e,t,n){z(this,`_exportCompleted`,void 0),z(this,`_exportScheduledPromise`,void 0),z(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(e,t,n){var r=this;return B(function*(){try{yield cc(t),yield I.with(jt(I.active()),B(function*(){return r._exportWithTimeout(e,t,n)}))}catch(e){Xt(e),r._exportScheduledResolve()}})()}_exportWithTimeout(e,t,n){var r=this;return B(function*(){return new Promise((i,a)=>{let o=setTimeout(()=>{a(Error(`Timeout`))},n);e.export(t,e=>{if(clearTimeout(o),e.code===Dn.SUCCESS)i();else{var t;a((t=e.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):t)}}),r._exportScheduledResolve()})})()}},dc=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_currentExport`,null),z(this,`_finishedLogRecords`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=(n=t==null?void 0:t.maxExportBatchSize)==null?512:n,this._maxQueueSize=(r=t==null?void 0:t.maxQueueSize)==null?2048:r,this._scheduledDelayMillis=(i=t==null?void 0:t.scheduledDelayMillis)==null?5e3:i,this._exportTimeoutMillis=(a=t==null?void 0:t.exportTimeoutMillis)==null?3e4:a,this._shutdownOnce=new hr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(L.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return B(function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()})()}_flushAll(){var e=this;return B(function*(){if(e._flushing)return;e._flushing=!0;let t=e._finishedLogRecords;for(e._finishedLogRecords=[],e._clearTimer(),e._currentExport!==null&&(yield e._exporter.forceFlush(),yield e._currentExport.exportCompleted,e._currentExport=null);t.length>0;){let n;t.length<=e._maxExportBatchSize?(n=t,t=[]):n=t.splice(0,e._maxExportBatchSize);let r=new uc(e._exporter,n,e._exportTimeoutMillis);e._currentExport=r;try{yield r.exportScheduled,yield e._exporter.forceFlush(),yield r.exportCompleted}catch(e){Xt(e)}finally{e._currentExport=null}}e._flushing=!1,e._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new uc(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,Xt(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},fc=class extends dc{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this._onInit(t)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}},pc=class{constructor(e){z(this,`_sessionIdProvider`,void 0),this._sessionIdProvider=e}forceFlush(){return B(function*(){})()}onStart(e,t){var n;let r=(n=this._sessionIdProvider)==null?void 0:n.getSessionId();r&&e.setAttribute(`session.id`,r)}onEnd(e){}shutdown(){return B(function*(){})()}};function mc(e){return new pc(e)}let hc={compression:`gzip`,keepalive:!0,concurrencyLimit:5,timeoutMillis:30*1e3},gc=(e,t)=>({"X-MXL-AID":e,"X-MXL-DID":t}),_c=(e,t)=>t||`http://mxl-otelcol.service-availability.apps.ocpthikadev01.safaricom.net`,vc=`1.9.1`,yc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function bc(e){let t=new Set([e]),n=new Set,r=e.match(yc);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(yc);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}let xc=bc(vc),Sc=vc.split(`.`)[0],Cc=Symbol.for(`opentelemetry.js.api.${Sc}`),wc=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function Tc(e,t,n,r=!1){var i;let a=wc[Cc]=(i=wc[Cc])==null?{version:vc}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${vc}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${vc}.`),!0}function Ec(e){var t,n;let r=(t=wc[Cc])==null?void 0:t.version;if(!(!r||!xc(r)))return(n=wc[Cc])==null?void 0:n[e]}function Dc(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${vc}.`);let n=wc[Cc];n&&delete n[e]}var Oc=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return kc(`debug`,this._namespace,e)}error(...e){return kc(`error`,this._namespace,e)}info(...e){return kc(`info`,this._namespace,e)}warn(...e){return kc(`warn`,this._namespace,e)}verbose(...e){return kc(`verbose`,this._namespace,e)}};function kc(e,t,n){let r=Ec(`diag`);if(r)return r[e](t,...n)}var Ac;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(Ac||(Ac={}));function jc(e,t){e<Ac.NONE?e=Ac.NONE:e>Ac.ALL&&(e=Ac.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,Ac.ERROR),warn:n(`warn`,Ac.WARN),info:n(`info`,Ac.INFO),debug:n(`debug`,Ac.DEBUG),verbose:n(`verbose`,Ac.VERBOSE)}}let Mc=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=Ec(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:Ac.INFO})=>{var r,i,a;if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=Ec(`diag`),s=jc((i=n.logLevel)==null?Ac.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return Tc(`diag`,s,t,!0)},t.disable=()=>{Dc(`diag`,t)},t.createComponentLogger=e=>new Oc(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}.instance(),Nc=Math.pow(10,9);function Pc(e){return e[0]*Nc+e[1]}function Fc(e,t){let n={attributes:Lc(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function Ic(e){return{name:e.name,version:e.version}}function Lc(e,t){return Object.keys(e).map(n=>Rc(n,e[n],t))}function Rc(e,t,n){return{key:e,value:zc(t,n)}}function zc(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=zc(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:zc(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}function Bc(e,t){return{resourceLogs:Hc(e,t)}}function Vc(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function Hc(e,t){let n=Vc(e);return Array.from(n,([e,n])=>{let r=Fc(e,t);return{resource:r,scopeLogs:Array.from(n,([,e])=>({scope:Ic(e[0].instrumentationScope),logRecords:e.map(e=>Uc(e,t)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function Uc(e,t){var n,r,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:Wc(e.severityNumber),severityText:e.severityText,body:zc(e.body,t),eventName:e.eventName,attributes:Gc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:(n=e.spanContext)==null?void 0:n.traceFlags,traceId:t.encodeOptionalSpanContext((r=e.spanContext)==null?void 0:r.traceId),spanId:t.encodeOptionalSpanContext((i=e.spanContext)==null?void 0:i.spanId)}}function Wc(e){return e}function Gc(e,t){return Object.keys(e).map(n=>Rc(n,e[n],t))}function Kc(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function qc(e){return Kc(e).toString()}let Jc=typeof BigInt<`u`?qc:Pc;function Yc(e){return e}let Xc={encodeHrTime:Jc,encodeSpanContext:Yc,encodeOptionalSpanContext:Yc,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},Zc={serializeRequest:e=>{let t=Bc(e,Xc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Mc.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}};function Qc(e,t){let n=e&255|256;return t&&(n|=512),n}function $c(e,t){var n,r,i,a;let o=e.spanContext(),s=e.status,c=(n=e.parentSpanContext)!=null&&n.spanId?t.encodeSpanContext((r=e.parentSpanContext)==null?void 0:r.spanId):void 0;return{traceId:t.encodeSpanContext(o.traceId),spanId:t.encodeSpanContext(o.spanId),parentSpanId:c,traceState:(i=o.traceState)==null?void 0:i.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Lc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>tl(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>el(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Qc(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function el(e,t){var n;return{attributes:e.attributes?Lc(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(n=e.context.traceState)==null?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Qc(e.context.traceFlags,e.context.isRemote)}}function tl(e,t){return{attributes:e.attributes?Lc(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function nl(e,t){return{resourceSpans:il(e,t)}}function rl(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function il(e,t){let n=rl(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>$c(e,t));o.push({scope:Ic(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Fc(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}let al={serializeRequest:e=>{let t=nl(e,Xc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Mc.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};var ol=class{constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},sl=class extends Error{constructor(e,t,n){super(e),z(this,`code`,void 0),z(this,`name`,`OTLPExporterError`),z(this,`data`,void 0),this.data=n,this.code=t}},cl=class{constructor(e){z(this,`_concurrencyLimit`,void 0),z(this,`_sendingPromises`,[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return B(function*(){yield Promise.all(e._sendingPromises)})()}};function ll(e){return new cl(e.concurrencyLimit)}function ul(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function dl(){return{handleResponse(e){e==null||!ul(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||L.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var fl=class{constructor(e,t,n,r,i){z(this,`_diagLogger`,void 0),z(this,`_transport`,void 0),z(this,`_serializer`,void 0),z(this,`_responseHandler`,void 0),z(this,`_promiseQueue`,void 0),z(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=L.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:Dn.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:Dn.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:Dn.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:Dn.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:Dn.FAILED,error:(n=e.error)==null?new sl(`Export failed with retryable status`):n})}else t({code:Dn.FAILED,error:new sl(`Export failed with unknown error`)})},e=>t({code:Dn.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return B(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function pl(e,t){return new fl(e.transport,e.serializer,dl(),e.promiseHandler,t.timeout)}function ml(e,t,n){return pl({transport:n,serializer:t,promiseHandler:ll(e)},{timeout:e.timeoutMillis})}let hl=49152,gl=0,_l=0;var vl=class e{constructor(e){this._config=e}static _compressRequest(e){return B(function*(){let t=new CompressionStream(`gzip`),n=t.writable.getWriter();n.write(e),n.close();let r=[],i=t.readable.getReader(),a=!1;for(;!a;){let e=yield i.read();e.value&&r.push(e.value),a=e.done}let o=new Uint8Array(r.reduce((e,t)=>e+t.length,0)),s=0;for(let e of r)o.set(e,s),s+=e.length;return o})()}send(e,t){return this._asyncSend(e,t)}shutdown(){}_asyncSend(t,n){var r=this;return B(function*(){let i=t,a=H({"Content-Type":`application/json`},r._config.headers),o,s;if(`timeout`in AbortSignal)o=AbortSignal.timeout(n);else{let e=new AbortController;o=e.signal,s=setTimeout(()=>{e.abort(new DOMException(`TimeoutError`,`TimeoutError`))},n)}let c=!1;try{if(r._config.compression===`gzip`){try{i=yield e._compressRequest(t)}catch(e){let t=e instanceof Error?e:Error(String(e));return L.warn(`Fetch transport gzip compression failed: ${t.message}`),{status:`failure`,error:t}}a[`Content-Encoding`]=`gzip`,a[`Content-Length`]=i.length.toString()}let n=gl+i.byteLength>hl;if(c=!n&&!(_l>=9),c)gl+=i.byteLength,_l++;else{let e=n?`inflight bytes (${gl} + ${i.byteLength}) would exceed ${hl}B budget`:`concurrent count (${_l}) at limit of 9`;L.debug(`Sending without keepalive: ${e}`)}let s=yield fetch(r._config.url,{method:`POST`,keepalive:c,headers:a,body:i,signal:o});if(s.ok)return{status:`success`};let l=Error(`${s.status} Fetch request failed`),u=`Fetch transport received HTTP ${s.status} (keepalive=${c})`;return s.status>=500?(L.debug(u),{status:`retryable`,error:l}):(L.warn(u),{status:`failure`,error:l})}catch(e){let t=e instanceof Error?e:Error(String(e)),n=t instanceof TypeError||t instanceof DOMException&&t.name===`TimeoutError`,r=`Fetch transport failed (keepalive=${c}): ${t.message}`;return n?L.debug(r):L.warn(r),{status:n?`retryable`:`failure`,error:t}}finally{s!==void 0&&clearTimeout(s),c&&(gl-=i.byteLength,_l--)}})()}};let yl=e=>new vl(e),bl=()=>Math.random()*40-20;var xl=class{constructor(e,t=new Ci){this._transport=e,this._perf=t}send(e,t){var n=this;return B(function*(){let r=n._perf.getNowMillis()+t,i=yield n._transport.send(e,t),a=5,o=1e3;for(;i.status===`retryable`&&a>0;){var s;a--;let t=Math.max(Math.min(o,5e3)+bl(),0);o*=1.5;let c=(s=i.retryInMillis)==null?t:s,l=r-n._perf.getNowMillis();if(c>l)return i;i=yield n._retry(e,l,c)}return i})()}shutdown(){this._transport.shutdown()}_retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}};let Sl=e=>{var t;return new xl(e.transport,(t=e.perf)==null?new Ci:t)},Cl=(e,t)=>ml(e,t,Sl({transport:yl(e)}));var wl=class extends ol{constructor(e){super(Cl(e,Zc))}};let Tl=(e,t)=>`${_c(e,t)}/v1/logs`;var El=class extends wl{constructor({appID:e,userID:t,mxlDataURL:n}){super(H(H({},hc),{},{headers:gc(e,t),url:Tl(e,n)}))}},Dl=class extends ol{constructor(e){super(Cl(H(H({},e),{},{compression:`gzip`}),al))}};let Ol=(e,t)=>`${_c(e,t)}/v1/traces`;var kl=class extends Dl{constructor({appID:e,userID:t,mxlDataURL:n}){super(H(H({},hc),{},{headers:gc(e,t),url:Ol(e,n)}))}},Al=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`browser.url.full`]||e.setAttribute(St,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}},jl=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){e.attributes[`browser.url.full`]||(e.attributes[St]=this._urlDocument.URL)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Ml=class{constructor({spanSessionManager:e}){z(this,`_spanSessionManager`,void 0),this._spanSessionManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.setAttributes({"log.record.uid":mt(),[La]:this._spanSessionManager.getSessionId(),"session.previous_id":this._spanSessionManager.getPreviousSessionId()})}shutdown(){return Promise.resolve(void 0)}},Nl=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&e.setAttribute(t.key,t.scrub(n))})}shutdown(){return Promise.resolve(void 0)}},Pl=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`mxl.type`]||e.setAttribute(_t,`sys.log`),e.setAttribute(fn,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}};let Fl=e=>{if((e.attributes[`http.request.method`]||e.attributes[`http.method`])&&(typeof e.attributes[`http.response.status_code`]==`number`||typeof e.attributes[`http.status_code`]==`number`)){var t;let n=(t=e.attributes[`url.full`])==null?e.attributes[Zt]:t;return typeof n==`string`&&n.includes(`://`)}return!1};var Il=class{forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(Fl(e)){var t,n,r,i,a;e.attributes[_t]=`perf.network_request`,(t=e.attributes)[`url.full`]!=null||(t[`url.full`]=e.attributes[`http.url`]),(n=e.attributes)[`http.response.status_code`]!=null||(n[`http.response.status_code`]=e.attributes[`http.status_code`]),(r=e.attributes)[`http.request.method`]!=null||(r[`http.request.method`]=e.attributes[`http.method`]),(i=e.attributes)[`http.response.body.size`]!=null||(i[`http.response.body.size`]=e.attributes[`http.response_content_length`]),(a=e.attributes)[`http.request.body.size`]!=null||(a[`http.request.body.size`]=e.attributes[`http.request_content_length`])}}onStart(){}shutdown(){return Promise.resolve(void 0)}};let Ll=e=>e.attributes[_t]===`ux.session`,Rl=(e,t)=>`mxl.${t===`current`?`export_failed`:`previous_export_failed`}.${e}`;var zl=class{constructor({resource:e,exporter:t,limitManager:n,spanSessionManager:r,storage:i=window.localStorage,storedSpansExpireTimeoutMS:a,diag:o=L.createComponentLogger({namespace:`MXLSessionBatchedSpanProcessor`})}){z(this,`_shutdownOnce`,void 0),z(this,`_pendingSpans`,[]),z(this,`_exporter`,void 0),z(this,`_limitManager`,void 0),z(this,`_spanStorage`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_diag`,void 0),z(this,`_shutdown`,()=>(this._spanStorage.destroy(),this._exporter.shutdown())),this._diag=o,this._exporter=t,this._shutdownOnce=new hr(this._shutdown,this),this._limitManager=n,this._spanSessionManager=r,this._spanStorage=new bi({resource:e,storage:i,diag:o,onExpiredSpansExport:e=>{this._exportSpans(e)},storedSpansExpireTimeoutMS:a,spanSessionManager:r})}forceFlush(){return this._diag.debug(`forceFlush called for MXLSessionBatchedSpanProcessor. This is a no op`),Promise.resolve(void 0)}onEnd(e){if(this._shutdownOnce.isCalled){this._diag.debug(`span ended after processor shutdown. Ignoring span.`);return}if(Ll(e))this._diag.debug(`session span ended. Exporting all pending spans.`),this._exportSpans([e,...this._pendingSpans]),this._pendingSpans=[];else{if(this._diag.debug(`non-session span ended. Adding to pending spans queue.`),this._limitManager.dropReadableSpan(e))return;this._pendingSpans.push(e)}}_exportSpans(e){_r._export(this._exporter,e).then(e=>{if(e.code===Dn.FAILED){var t;let n=((t=e.error)==null?void 0:t.message)||`unknown error`,r=`unknown`;n===`Concurrent export limit reached`?r=`concurrent_limit`:n===`Fetch request errored`&&(r=`fetch_error`),this._spanSessionManager.incrSessionCountForKey(Rl(r,`current`)),this._spanSessionManager.incrNextSessionCountForKey(Rl(r,`previous`)),this._diag.error(`spans failed to export: ${n}`)}}).catch(e=>{let t=`unknown error`;e&&e instanceof Error?t=e.message:typeof e==`string`&&(t=e),this._spanSessionManager.incrSessionCountForKey(Rl(`unknown`,`current`)),this._spanSessionManager.incrNextSessionCountForKey(Rl(`unknown`,`previous`)),this._diag.error(`spans failed to export: ${t}`)})}onStart(){}getPendingSpansCount(){return this._pendingSpans.length}storePendingSpans(e,t){this._spanStorage.storePendingSpans(e,t,this._pendingSpans)}clearStoredSpans(e){this._spanStorage.clearStoredSpans(e)}shutdown(){return this._shutdownOnce.call()}},Bl=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute();t&&(e.setAttribute(Ct,t.path),e.setAttribute(wt,this._pageManager.getCurrentPageId()))}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&e.setAttribute(Tt,t)}shutdown(){return Promise.resolve(void 0)}},Vl=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.attributes[Ct]=t.path,e.attributes[wt]=n)}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&(e.attributes[Tt]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Hl=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&(e.attributes[t.key]=t.scrub(n))})}onStart(){}shutdown(){return Promise.resolve(void 0)}},Ul=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._userManager.getUserId()&&e.setAttributes({[Ra]:this._userManager.getUserId()})}shutdown(){return Promise.resolve(void 0)}},Wl=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){let t=this._userManager.getUserId();t&&(e.attributes[Ra]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Gl=class extends Hn{inject(e,t,n){super.inject(e,t,n);let r=R.getSpan(e);if(r){let e=t instanceof Headers?t.get(`traceparent`):ve.get(t,`traceparent`);e&&r.setAttribute(`mxl.w3c_traceparent`,e)}}};let Kl=/\/\/(.+):(.+)@(.+)\//,ql=[`AWSAccessKeyId`,`Signature`,`sig`,"`X-Goog-Signature",`password`,`auth`,`pw`,`token`],Jl=({value:e,queryParamRegex:t,scrubPath:n,scrubQuery:r})=>{let i=e;return n&&(i=i.replace(Kl,`//REDACTED:REDACTED@$3/`)),r&&(i=i.replaceAll(t,`$1$2=REDACTED`)),i},Yl=e=>{let t=[...ql,...e||[]],n=RegExp(`(^|&|\\?)(${t.join(`|`)})=[^&]+`,`g`);return[{key:fn,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:Zt,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:`url.path`,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!1})},{key:`url.query`,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!1,scrubQuery:!0})}]},Xl=new class{constructor({diagLogger:e=L.createComponentLogger({namespace:`mxl-registry`})}={}){z(this,`_sdk`,null),z(this,`_diag`,void 0),z(this,`register`,e=>{this._sdk!==null&&this._diag.warn(`previously registered sdk will be overwritten`),this._sdk=e}),z(this,`clear`,()=>{this._sdk===null&&this._diag.warn(`sdk already cleared, this is a no-op`),this._sdk=null}),z(this,`registered`,()=>this._sdk),this._diag=e}};
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,9 +13,9 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var __assign=function(){return __assign=Object.assign||function(z){for(var G,K=1,J=arguments.length;K<J;K++)for(var Y in G=arguments[K],G)Object.prototype.hasOwnProperty.call(G,Y)&&(z[Y]=G[Y]);return z},__assign.apply(this,arguments)};function __rest(z,G){var K={};for(var J in z)Object.prototype.hasOwnProperty.call(z,J)&&G.indexOf(J)<0&&(K[J]=z[J]);if(z!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var Y=0,J=Object.getOwnPropertySymbols(z);Y<J.length;Y++)G.indexOf(J[Y])<0&&Object.prototype.propertyIsEnumerable.call(z,J[Y])&&(K[J[Y]]=z[J[Y]]);return K}function __values(z){var G=typeof Symbol==`function`&&Symbol.iterator,K=G&&z[G],J=0;if(K)return K.call(z);if(z&&typeof z.length==`number`)return{next:function(){return z&&J>=z.length&&(z=void 0),{value:z&&z[J++],done:!z}}};throw TypeError(G?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function __read(z,G){var K=typeof Symbol==`function`&&z[Symbol.iterator];if(!K)return z;var J=K.call(z),Y,X=[],Z;try{for(;(G===void 0||G-- >0)&&!(Y=J.next()).done;)X.push(Y.value)}catch(z){Z={error:z}}finally{try{Y&&!Y.done&&(K=J.return)&&K.call(J)}finally{if(Z)throw Z.error}}return X}function __spreadArray(z,G,K){if(K||arguments.length===2)for(var J=0,Y=G.length,X;J<Y;J++)(X||!(J in G))&&(X||(X=Array.prototype.slice.call(G,0,J)),X[J]=G[J]);return z.concat(X||Array.prototype.slice.call(G))}var NodeType;(function(z){z[z.Document=0]=`Document`,z[z.DocumentType=1]=`DocumentType`,z[z.Element=2]=`Element`,z[z.Text=3]=`Text`,z[z.CDATA=4]=`CDATA`,z[z.Comment=5]=`Comment`})(NodeType||(NodeType={}));function isElement(z){return z.nodeType===z.ELEMENT_NODE}function isShadowRoot(z){var G,K=(G=z)==null?void 0:G.host;return!!(K&&K.shadowRoot&&K.shadowRoot===z)}function maskInputValue(z){var G=z.maskInputOptions,K=z.tagName,J=z.type,Y=z.value,X=z.maskInputFn,Z=Y||``;return(G[K.toLowerCase()]||G[J])&&(Z=X?X(Z):`*`.repeat(Z.length)),Z}var ORIGINAL_ATTRIBUTE_NAME=`__rrweb_original__`;function is2DCanvasBlank(z){var G=z.getContext(`2d`);if(!G)return!0;for(var K=50,J=0;J<z.width;J+=K)for(var Y=0;Y<z.height;Y+=K){var X=G.getImageData,Z=ORIGINAL_ATTRIBUTE_NAME in X?X[ORIGINAL_ATTRIBUTE_NAME]:X;if(new Uint32Array(Z.call(G,J,Y,Math.min(K,z.width-J),Math.min(K,z.height-Y)).data.buffer).some(function(z){return z!==0}))return!1}return!0}var _id=1,tagNameRegex=RegExp(`[^a-z0-9-_:]`),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(z){if(z instanceof HTMLFormElement)return`form`;var G=z.tagName.toLowerCase().trim();return tagNameRegex.test(G)?`div`:G}function getCssRulesString(z){try{var G=z.rules||z.cssRules;return G?Array.from(G).map(getCssRuleString).join(``):null}catch(z){return null}}function getCssRuleString(z){var G=z.cssText;if(isCSSImportRule(z))try{G=getCssRulesString(z.styleSheet)||G}catch(z){}return G}function isCSSImportRule(z){return`styleSheet`in z}function stringifyStyleSheet(z){return z.cssRules?Array.from(z.cssRules).map(function(z){return z.cssText||``}).join(``):``}function extractOrigin(z){var G=``;return G=z.indexOf(`//`)>-1?z.split(`/`).slice(0,3).join(`/`):z.split(`/`)[0],G=G.split(`?`)[0],G}var canvasService,canvasCtx,URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(z,G){return(z||``).replace(URL_IN_CSS_REF,function(z,K,J,Y,X,Z){var Q=J||X||Z,ee=K||Y||``;if(!Q)return z;if(!RELATIVE_PATH.test(Q)||DATA_URI.test(Q))return`url(`+ee+Q+ee+`)`;if(Q[0]===`/`)return`url(`+ee+(extractOrigin(G)+Q)+ee+`)`;var te=G.split(`/`),ne=Q.split(`/`);te.pop();for(var ie=0,ae=ne;ie<ae.length;ie++){var oe=ae[ie];oe!==`.`&&(oe===`..`?te.pop():te.push(oe))}return`url(`+ee+te.join(`/`)+ee+`)`})}var SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(z,G){if(G.trim()===``)return G;var K=0;function J(z){var J,Y=z.exec(G.substring(K));return Y?(J=Y[0],K+=J.length,J):``}for(var Y=[];J(SRCSET_COMMAS_OR_SPACES),!(K>=G.length);){var X=J(SRCSET_NOT_SPACES);if(X.slice(-1)===`,`)X=absoluteToDoc(z,X.substring(0,X.length-1)),Y.push(X);else{var Z=``;X=absoluteToDoc(z,X);for(var Q=!1;;){var ee=G.charAt(K);if(ee===``){Y.push((X+Z).trim());break}else if(Q)ee===`)`&&(Q=!1);else if(ee===`,`){K+=1,Y.push((X+Z).trim());break}else ee===`(`&&(Q=!0);Z+=ee,K+=1}}}return Y.join(`, `)}function absoluteToDoc(z,G){if(!G||G.trim()===``)return G;var K=z.createElement(`a`);return K.href=G,K.href}function isSVGElement(z){return!!(z.tagName===`svg`||z.ownerSVGElement)}function getHref(){var z=document.createElement(`a`);return z.href=``,z.href}function transformAttribute(z,G,K,J){return K===`src`||K===`href`&&J||K===`xlink:href`&&J&&J[0]!==`#`||K===`background`&&J&&(G===`table`||G===`td`||G===`th`)?absoluteToDoc(z,J):K===`srcset`&&J?getAbsoluteSrcsetString(z,J):K===`style`&&J?absoluteToStylesheet(J,getHref()):G===`object`&&K===`data`&&J?absoluteToDoc(z,J):J}function _isBlockedElement(z,G,K){if(typeof G==`string`){if(z.classList.contains(G))return!0}else for(var J=0;J<z.classList.length;J++){var Y=z.classList[J];if(G.test(Y))return!0}return K?z.matches(K):!1}function needMaskingText(z,G,K){if(!z)return!1;if(z.nodeType===z.ELEMENT_NODE){if(typeof G==`string`){if(z.classList.contains(G))return!0}else for(var J=0;J<z.classList.length;J++){var Y=z.classList[J];if(G.test(Y))return!0}return K&&z.matches(K)?!0:needMaskingText(z.parentNode,G,K)}return z.nodeType,z.TEXT_NODE,needMaskingText(z.parentNode,G,K)}function onceIframeLoaded(z,G,K){var J=z.contentWindow;if(J){var Y=!1,X;try{X=J.document.readyState}catch(z){return}if(X!==`complete`){var Z=setTimeout(function(){Y||(G(),Y=!0)},K);z.addEventListener(`load`,function(){clearTimeout(Z),Y=!0,G()});return}var Q=`about:blank`;if(J.location.href!==Q||z.src===Q||z.src===``){setTimeout(G,0);return}z.addEventListener(`load`,G)}}function serializeNode(z,G){var K,J=G.doc,Y=G.blockClass,X=G.blockSelector,Z=G.maskTextClass,Q=G.maskTextSelector,ee=G.inlineStylesheet,te=G.maskInputOptions,ne=te===void 0?{}:te,ie=G.maskTextFn,ae=G.maskInputFn,oe=G.dataURLOptions,se=oe===void 0?{}:oe,ce=G.inlineImages,le=G.recordCanvas,ue=G.keepIframeSrcFn,de;if(J.__sn){var fe=J.__sn.id;de=fe===1?void 0:fe}switch(z.nodeType){case z.DOCUMENT_NODE:return z.compatMode===`CSS1Compat`?{type:NodeType.Document,childNodes:[],rootId:de}:{type:NodeType.Document,childNodes:[],compatMode:z.compatMode,rootId:de};case z.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:z.name,publicId:z.publicId,systemId:z.systemId,rootId:de};case z.ELEMENT_NODE:for(var pe=_isBlockedElement(z,Y,X),me=getValidTagName(z),he={},ge=0,_e=Array.from(z.attributes);ge<_e.length;ge++){var ve=_e[ge],ye=ve.name,be=ve.value;he[ye]=transformAttribute(J,me,ye,be)}if(me===`link`&&ee){var xe=Array.from(J.styleSheets).find(function(G){return G.href===z.href}),Se=null;xe&&(Se=getCssRulesString(xe)),Se&&(delete he.rel,delete he.href,he._cssText=absoluteToStylesheet(Se,xe.href))}if(me===`style`&&z.sheet&&!(z.innerText||z.textContent||``).trim().length){var Se=getCssRulesString(z.sheet);Se&&(he._cssText=absoluteToStylesheet(Se,getHref()))}if(me===`input`||me===`textarea`||me===`select`){var be=z.value;he.type!==`radio`&&he.type!==`checkbox`&&he.type!==`submit`&&he.type!==`button`&&be?he.value=maskInputValue({type:he.type,tagName:me,value:be,maskInputOptions:ne,maskInputFn:ae}):z.checked&&(he.checked=z.checked)}if(me===`option`&&(z.selected&&!ne.select?he.selected=!0:delete he.selected),me===`canvas`&&le){if(z.__context===`2d`)is2DCanvasBlank(z)||(he.rr_dataURL=z.toDataURL(se.type,se.quality));else if(!(`__context`in z)){var Ce=z.toDataURL(se.type,se.quality),we=document.createElement(`canvas`);we.width=z.width,we.height=z.height,Ce!==we.toDataURL(se.type,se.quality)&&(he.rr_dataURL=Ce)}}if(me===`img`&&ce){canvasService||(canvasService=J.createElement(`canvas`),canvasCtx=canvasService.getContext(`2d`));var Te=z,Ee=Te.crossOrigin;Te.crossOrigin=`anonymous`;var De=function(){try{canvasService.width=Te.naturalWidth,canvasService.height=Te.naturalHeight,canvasCtx.drawImage(Te,0,0),he.rr_dataURL=canvasService.toDataURL(se.type,se.quality)}catch(z){console.warn(`Cannot inline img src=`+Te.currentSrc+`! Error: `+z)}Ee?he.crossOrigin=Ee:delete he.crossOrigin};Te.complete&&Te.naturalWidth!==0?De():Te.onload=De}if((me===`audio`||me===`video`)&&(he.rr_mediaState=z.paused?`paused`:`played`,he.rr_mediaCurrentTime=z.currentTime),z.scrollLeft&&(he.rr_scrollLeft=z.scrollLeft),z.scrollTop&&(he.rr_scrollTop=z.scrollTop),pe){var Oe=z.getBoundingClientRect(),ke=Oe.width,Ae=Oe.height;he={class:he.class,rr_width:ke+`px`,rr_height:Ae+`px`}}return me===`iframe`&&!ue(he.src)&&(z.contentDocument||(he.rr_src=he.src),delete he.src),{type:NodeType.Element,tagName:me,attributes:he,childNodes:[],isSVG:isSVGElement(z)||void 0,needBlock:pe,rootId:de};case z.TEXT_NODE:var je=z.parentNode&&z.parentNode.tagName,Me=z.textContent,Ne=je===`STYLE`?!0:void 0,Pe=je===`SCRIPT`?!0:void 0;if(Ne&&Me){try{z.nextSibling||z.previousSibling||(K=z.parentNode.sheet)!=null&&K.cssRules&&(Me=stringifyStyleSheet(z.parentNode.sheet))}catch(G){console.warn(`Cannot get CSS styles from text's parentNode. Error: `+G,z)}Me=absoluteToStylesheet(Me,getHref())}return Pe&&(Me=`SCRIPT_PLACEHOLDER`),!Ne&&!Pe&&needMaskingText(z,Z,Q)&&Me&&(Me=ie?ie(Me):Me.replace(/[\S]/g,`*`)),{type:NodeType.Text,textContent:Me||``,isStyle:Ne,rootId:de};case z.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:``,rootId:de};case z.COMMENT_NODE:return{type:NodeType.Comment,textContent:z.textContent||``,rootId:de};default:return!1}}function lowerIfExists(z){return z===void 0?``:z.toLowerCase()}function slimDOMExcluded(z,G){return!!(G.comment&&z.type===NodeType.Comment||z.type===NodeType.Element&&(G.script&&(z.tagName===`script`||z.tagName===`link`&&z.attributes.rel===`preload`&&z.attributes.as===`script`||z.tagName===`link`&&z.attributes.rel===`prefetch`&&typeof z.attributes.href==`string`&&z.attributes.href.endsWith(`.js`))||G.headFavicon&&(z.tagName===`link`&&z.attributes.rel===`shortcut icon`||z.tagName===`meta`&&(lowerIfExists(z.attributes.name).match(/^msapplication-tile(image|color)$/)||lowerIfExists(z.attributes.name)===`application-name`||lowerIfExists(z.attributes.rel)===`icon`||lowerIfExists(z.attributes.rel)===`apple-touch-icon`||lowerIfExists(z.attributes.rel)===`shortcut icon`))||z.tagName===`meta`&&(G.headMetaDescKeywords&&lowerIfExists(z.attributes.name).match(/^description|keywords$/)||G.headMetaSocial&&(lowerIfExists(z.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(z.attributes.name).match(/^(og|twitter):/)||lowerIfExists(z.attributes.name)===`pinterest`)||G.headMetaRobots&&(lowerIfExists(z.attributes.name)===`robots`||lowerIfExists(z.attributes.name)===`googlebot`||lowerIfExists(z.attributes.name)===`bingbot`)||G.headMetaHttpEquiv&&z.attributes[`http-equiv`]!==void 0||G.headMetaAuthorship&&(lowerIfExists(z.attributes.name)===`author`||lowerIfExists(z.attributes.name)===`generator`||lowerIfExists(z.attributes.name)===`framework`||lowerIfExists(z.attributes.name)===`publisher`||lowerIfExists(z.attributes.name)===`progid`||lowerIfExists(z.attributes.property).match(/^article:/)||lowerIfExists(z.attributes.property).match(/^product:/))||G.headMetaVerification&&(lowerIfExists(z.attributes.name)===`google-site-verification`||lowerIfExists(z.attributes.name)===`yandex-verification`||lowerIfExists(z.attributes.name)===`csrf-token`||lowerIfExists(z.attributes.name)===`p:domain_verify`||lowerIfExists(z.attributes.name)===`verify-v1`||lowerIfExists(z.attributes.name)===`verification`||lowerIfExists(z.attributes.name)===`shopify-checkout-api-token`))))}function serializeNodeWithId(z,G){var K=G.doc,J=G.map,Y=G.blockClass,X=G.blockSelector,Z=G.maskTextClass,Q=G.maskTextSelector,ee=G.skipChild,te=ee===void 0?!1:ee,ne=G.inlineStylesheet,ie=ne===void 0?!0:ne,ae=G.maskInputOptions,oe=ae===void 0?{}:ae,se=G.maskTextFn,ce=G.maskInputFn,le=G.slimDOMOptions,ue=G.dataURLOptions,de=ue===void 0?{}:ue,fe=G.inlineImages,pe=fe===void 0?!1:fe,me=G.recordCanvas,he=me===void 0?!1:me,ge=G.onSerialize,_e=G.onIframeLoad,ve=G.iframeLoadTimeout,ye=ve===void 0?5e3:ve,be=G.keepIframeSrcFn,xe=be===void 0?function(){return!1}:be,Se=G.preserveWhiteSpace,Ce=Se===void 0?!0:Se,we=serializeNode(z,{doc:K,blockClass:Y,blockSelector:X,maskTextClass:Z,maskTextSelector:Q,inlineStylesheet:ie,maskInputOptions:oe,maskTextFn:se,maskInputFn:ce,dataURLOptions:de,inlineImages:pe,recordCanvas:he,keepIframeSrcFn:xe});if(!we)return console.warn(z,`not serialized`),null;var Te=`__sn`in z?z.__sn.id:slimDOMExcluded(we,le)||!Ce&&we.type===NodeType.Text&&!we.isStyle&&!we.textContent.replace(/^\s+|\s+$/gm,``).length?IGNORED_NODE:genId(),Ee=Object.assign(we,{id:Te});if(z.__sn=Ee,Te===IGNORED_NODE)return null;J[Te]=z,ge&&ge(z);var De=!te;if(Ee.type===NodeType.Element&&(De=De&&!Ee.needBlock,delete Ee.needBlock,z.shadowRoot&&(Ee.isShadowHost=!0)),(Ee.type===NodeType.Document||Ee.type===NodeType.Element)&&De){le.headWhitespace&&we.type===NodeType.Element&&we.tagName===`head`&&(Ce=!1);for(var Oe={doc:K,map:J,blockClass:Y,blockSelector:X,maskTextClass:Z,maskTextSelector:Q,skipChild:te,inlineStylesheet:ie,maskInputOptions:oe,maskTextFn:se,maskInputFn:ce,slimDOMOptions:le,dataURLOptions:de,inlineImages:pe,recordCanvas:he,preserveWhiteSpace:Ce,onSerialize:ge,onIframeLoad:_e,iframeLoadTimeout:ye,keepIframeSrcFn:xe},ke=0,Ae=Array.from(z.childNodes);ke<Ae.length;ke++){var je=Ae[ke],Me=serializeNodeWithId(je,Oe);Me&&Ee.childNodes.push(Me)}if(isElement(z)&&z.shadowRoot)for(var Ne=0,Pe=Array.from(z.shadowRoot.childNodes);Ne<Pe.length;Ne++){var je=Pe[Ne],Me=serializeNodeWithId(je,Oe);Me&&(Me.isShadow=!0,Ee.childNodes.push(Me))}}return z.parentNode&&isShadowRoot(z.parentNode)&&(Ee.isShadow=!0),Ee.type===NodeType.Element&&Ee.tagName===`iframe`&&onceIframeLoaded(z,function(){var G=z.contentDocument;if(G&&_e){var K=serializeNodeWithId(G,{doc:G,map:J,blockClass:Y,blockSelector:X,maskTextClass:Z,maskTextSelector:Q,skipChild:!1,inlineStylesheet:ie,maskInputOptions:oe,maskTextFn:se,maskInputFn:ce,slimDOMOptions:le,dataURLOptions:de,inlineImages:pe,recordCanvas:he,preserveWhiteSpace:Ce,onSerialize:ge,onIframeLoad:_e,iframeLoadTimeout:ye,keepIframeSrcFn:xe});K&&_e(z,K)}},ye),Ee}function snapshot(z,G){var K=G||{},J=K.blockClass,Y=J===void 0?`rr-block`:J,X=K.blockSelector,Z=X===void 0?null:X,Q=K.maskTextClass,ee=Q===void 0?`rr-mask`:Q,te=K.maskTextSelector,ne=te===void 0?null:te,ie=K.inlineStylesheet,ae=ie===void 0?!0:ie,oe=K.inlineImages,se=oe===void 0?!1:oe,ce=K.recordCanvas,le=ce===void 0?!1:ce,ue=K.maskAllInputs,de=ue===void 0?!1:ue,fe=K.maskTextFn,pe=K.maskInputFn,me=K.slimDOM,he=me===void 0?!1:me,ge=K.dataURLOptions,_e=K.preserveWhiteSpace,ve=K.onSerialize,ye=K.onIframeLoad,be=K.iframeLoadTimeout,xe=K.keepIframeSrcFn,Se=xe===void 0?function(){return!1}:xe,Ce={};return[serializeNodeWithId(z,{doc:z,map:Ce,blockClass:Y,blockSelector:Z,maskTextClass:ee,maskTextSelector:ne,skipChild:!1,inlineStylesheet:ae,maskInputOptions:de===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:de===!1?{password:!0}:de,maskTextFn:fe,maskInputFn:pe,slimDOMOptions:he===!0||he===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:he===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:he===!1?{}:he,dataURLOptions:ge,inlineImages:se,recordCanvas:le,preserveWhiteSpace:_e,onSerialize:ve,onIframeLoad:ye,iframeLoadTimeout:be,keepIframeSrcFn:Se}),Ce]}var HOVER_SELECTOR=/([^\\]):hover/,HOVER_SELECTOR_GLOBAL=new RegExp(HOVER_SELECTOR.source,`g`),EventType;(function(z){z[z.DomContentLoaded=0]=`DomContentLoaded`,z[z.Load=1]=`Load`,z[z.FullSnapshot=2]=`FullSnapshot`,z[z.IncrementalSnapshot=3]=`IncrementalSnapshot`,z[z.Meta=4]=`Meta`,z[z.Custom=5]=`Custom`,z[z.Plugin=6]=`Plugin`})(EventType||(EventType={}));var IncrementalSource;(function(z){z[z.Mutation=0]=`Mutation`,z[z.MouseMove=1]=`MouseMove`,z[z.MouseInteraction=2]=`MouseInteraction`,z[z.Scroll=3]=`Scroll`,z[z.ViewportResize=4]=`ViewportResize`,z[z.Input=5]=`Input`,z[z.TouchMove=6]=`TouchMove`,z[z.MediaInteraction=7]=`MediaInteraction`,z[z.StyleSheetRule=8]=`StyleSheetRule`,z[z.CanvasMutation=9]=`CanvasMutation`,z[z.Font=10]=`Font`,z[z.Log=11]=`Log`,z[z.Drag=12]=`Drag`,z[z.StyleDeclaration=13]=`StyleDeclaration`})(IncrementalSource||(IncrementalSource={}));var MouseInteractions;(function(z){z[z.MouseUp=0]=`MouseUp`,z[z.MouseDown=1]=`MouseDown`,z[z.Click=2]=`Click`,z[z.ContextMenu=3]=`ContextMenu`,z[z.DblClick=4]=`DblClick`,z[z.Focus=5]=`Focus`,z[z.Blur=6]=`Blur`,z[z.TouchStart=7]=`TouchStart`,z[z.TouchMove_Departed=8]=`TouchMove_Departed`,z[z.TouchEnd=9]=`TouchEnd`,z[z.TouchCancel=10]=`TouchCancel`})(MouseInteractions||(MouseInteractions={}));var CanvasContext;(function(z){z[z[`2D`]=0]=`2D`,z[z.WebGL=1]=`WebGL`,z[z.WebGL2=2]=`WebGL2`})(CanvasContext||(CanvasContext={}));var MediaInteractions;(function(z){z[z.Play=0]=`Play`,z[z.Pause=1]=`Pause`,z[z.Seeked=2]=`Seeked`,z[z.VolumeChange=3]=`VolumeChange`})(MediaInteractions||(MediaInteractions={}));var ReplayerEvents;(function(z){z.Start=`start`,z.Pause=`pause`,z.Resume=`resume`,z.Resize=`resize`,z.Finish=`finish`,z.FullsnapshotRebuilded=`fullsnapshot-rebuilded`,z.LoadStylesheetStart=`load-stylesheet-start`,z.LoadStylesheetEnd=`load-stylesheet-end`,z.SkipStart=`skip-start`,z.SkipEnd=`skip-end`,z.MouseInteraction=`mouse-interaction`,z.EventCast=`event-cast`,z.CustomEvent=`custom-event`,z.Flush=`flush`,z.StateChange=`state-change`,z.PlayBack=`play-back`})(ReplayerEvents||(ReplayerEvents={}));function on(z,G,K){K===void 0&&(K=document);var J={capture:!0,passive:!0};return K.addEventListener(z,G,J),function(){return K.removeEventListener(z,G,J)}}function createMirror(){return{map:{},getId:function(z){return!z||!z.__sn?-1:z.__sn.id},getNode:function(z){return this.map[z]||null},removeNodeFromMap:function(z){var G=this,K=z.__sn&&z.__sn.id;delete this.map[K],z.childNodes&&z.childNodes.forEach(function(z){return G.removeNodeFromMap(z)})},has:function(z){return this.map.hasOwnProperty(z)},reset:function(){this.map={}}}}var DEPARTED_MIRROR_ACCESS_WARNING=`Please stop import mirror directly. Instead of that,\r
16
+ var W=function(){return W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},W.apply(this,arguments)};function Zl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ql(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function G(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function K(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var $l;(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})($l||($l={}));function eu(e){return e.nodeType===e.ELEMENT_NODE}function tu(e){var t,n=(t=e)==null?void 0:t.host;return!!(n&&n.shadowRoot&&n.shadowRoot===e)}function nu(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,a=e.maskInputFn,o=i||``;return(t[n.toLowerCase()]||t[r])&&(o=a?a(o):`*`.repeat(o.length)),o}var ru=`__rrweb_original__`;function iu(e){var t=e.getContext(`2d`);if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var a=t.getImageData,o=ru in a?a[ru]:a;if(new Uint32Array(o.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(function(e){return e!==0}))return!1}return!0}var au=1,ou=RegExp(`[^a-z0-9-_:]`);function su(){return au++}function cu(e){if(e instanceof HTMLFormElement)return`form`;var t=e.tagName.toLowerCase().trim();return ou.test(t)?`div`:t}function lu(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(uu).join(``):null}catch(e){return null}}function uu(e){var t=e.cssText;if(du(e))try{t=lu(e.styleSheet)||t}catch(e){}return t}function du(e){return`styleSheet`in e}function fu(e){return e.cssRules?Array.from(e.cssRules).map(function(e){return e.cssText||``}).join(``):``}function pu(e){var t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var mu,hu,gu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,_u=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,vu=/^(data:)([^,]*),(.*)/i;function yu(e,t){return(e||``).replace(gu,function(e,n,r,i,a,o){var s=r||a||o,c=n||i||``;if(!s)return e;if(!_u.test(s)||vu.test(s))return`url(`+c+s+c+`)`;if(s[0]===`/`)return`url(`+c+(pu(t)+s)+c+`)`;var l=t.split(`/`),u=s.split(`/`);l.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];p!==`.`&&(p===`..`?l.pop():l.push(p))}return`url(`+c+l.join(`/`)+c+`)`})}var bu=/^[^ \t\n\r\u000c]+/,xu=/^[, \t\n\r\u000c]+/;function Su(e,t){if(t.trim()===``)return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}for(var i=[];r(xu),!(n>=t.length);){var a=r(bu);if(a.slice(-1)===`,`)a=Cu(e,a.substring(0,a.length-1)),i.push(a);else{var o=``;a=Cu(e,a);for(var s=!1;;){var c=t.charAt(n);if(c===``){i.push((a+o).trim());break}else if(s)c===`)`&&(s=!1);else if(c===`,`){n+=1,i.push((a+o).trim());break}else c===`(`&&(s=!0);o+=c,n+=1}}}return i.join(`, `)}function Cu(e,t){if(!t||t.trim()===``)return t;var n=e.createElement(`a`);return n.href=t,n.href}function wu(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Tu(){var e=document.createElement(`a`);return e.href=``,e.href}function Eu(e,t,n,r){return n===`src`||n===`href`&&r||n===`xlink:href`&&r&&r[0]!==`#`||n===`background`&&r&&(t===`table`||t===`td`||t===`th`)?Cu(e,r):n===`srcset`&&r?Su(e,r):n===`style`&&r?yu(r,Tu()):t===`object`&&n===`data`&&r?Cu(e,r):r}function Du(e,t,n){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n?e.matches(n):!1}function Ou(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n&&e.matches(n)?!0:Ou(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Ou(e.parentNode,t,n)}function ku(e,t,n){var r=e.contentWindow;if(r){var i=!1,a;try{a=r.document.readyState}catch(e){return}if(a!==`complete`){var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener(`load`,function(){clearTimeout(o),i=!0,t()});return}var s=`about:blank`;if(r.location.href!==s||e.src===s||e.src===``){setTimeout(t,0);return}e.addEventListener(`load`,t)}}function Au(e,t){var n,r=t.doc,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,p=t.dataURLOptions,m=p===void 0?{}:p,h=t.inlineImages,g=t.recordCanvas,_=t.keepIframeSrcFn,v;if(r.__sn){var y=r.__sn.id;v=y===1?void 0:y}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:$l.Document,childNodes:[],rootId:v}:{type:$l.Document,childNodes:[],compatMode:e.compatMode,rootId:v};case e.DOCUMENT_TYPE_NODE:return{type:$l.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:for(var b=Du(e,i,a),x=cu(e),S={},C=0,w=Array.from(e.attributes);C<w.length;C++){var ee=w[C],T=ee.name,E=ee.value;S[T]=Eu(r,x,T,E)}if(x===`link`&&c){var D=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),te=null;D&&(te=lu(D)),te&&(delete S.rel,delete S.href,S._cssText=yu(te,D.href))}if(x===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){var te=lu(e.sheet);te&&(S._cssText=yu(te,Tu()))}if(x===`input`||x===`textarea`||x===`select`){var E=e.value;S.type!==`radio`&&S.type!==`checkbox`&&S.type!==`submit`&&S.type!==`button`&&E?S.value=nu({type:S.type,tagName:x,value:E,maskInputOptions:u,maskInputFn:f}):e.checked&&(S.checked=e.checked)}if(x===`option`&&(e.selected&&!u.select?S.selected=!0:delete S.selected),x===`canvas`&&g){if(e.__context===`2d`)iu(e)||(S.rr_dataURL=e.toDataURL(m.type,m.quality));else if(!(`__context`in e)){var O=e.toDataURL(m.type,m.quality),k=document.createElement(`canvas`);k.width=e.width,k.height=e.height,O!==k.toDataURL(m.type,m.quality)&&(S.rr_dataURL=O)}}if(x===`img`&&h){mu||(mu=r.createElement(`canvas`),hu=mu.getContext(`2d`));var A=e,j=A.crossOrigin;A.crossOrigin=`anonymous`;var ne=function(){try{mu.width=A.naturalWidth,mu.height=A.naturalHeight,hu.drawImage(A,0,0),S.rr_dataURL=mu.toDataURL(m.type,m.quality)}catch(e){console.warn(`Cannot inline img src=`+A.currentSrc+`! Error: `+e)}j?S.crossOrigin=j:delete S.crossOrigin};A.complete&&A.naturalWidth!==0?ne():A.onload=ne}if((x===`audio`||x===`video`)&&(S.rr_mediaState=e.paused?`paused`:`played`,S.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop),b){var re=e.getBoundingClientRect(),ie=re.width,M=re.height;S={class:S.class,rr_width:ie+`px`,rr_height:M+`px`}}return x===`iframe`&&!_(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src),{type:$l.Element,tagName:x,attributes:S,childNodes:[],isSVG:wu(e)||void 0,needBlock:b,rootId:v};case e.TEXT_NODE:var ae=e.parentNode&&e.parentNode.tagName,N=e.textContent,P=ae===`STYLE`?!0:void 0,F=ae===`SCRIPT`?!0:void 0;if(P&&N){try{e.nextSibling||e.previousSibling||(n=e.parentNode.sheet)!=null&&n.cssRules&&(N=fu(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: `+t,e)}N=yu(N,Tu())}return F&&(N=`SCRIPT_PLACEHOLDER`),!P&&!F&&Ou(e,o,s)&&N&&(N=d?d(N):N.replace(/[\S]/g,`*`)),{type:$l.Text,textContent:N||``,isStyle:P,rootId:v};case e.CDATA_SECTION_NODE:return{type:$l.CDATA,textContent:``,rootId:v};case e.COMMENT_NODE:return{type:$l.Comment,textContent:e.textContent||``,rootId:v};default:return!1}}function q(e){return e===void 0?``:e.toLowerCase()}function ju(e,t){return!!(t.comment&&e.type===$l.Comment||e.type===$l.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&e.attributes.rel===`preload`&&e.attributes.as===`script`||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&e.attributes.href.endsWith(`.js`))||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||q(e.attributes.name)===`application-name`||q(e.attributes.rel)===`icon`||q(e.attributes.rel)===`apple-touch-icon`||q(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&q(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(q(e.attributes.property).match(/^(og|twitter|fb):/)||q(e.attributes.name).match(/^(og|twitter):/)||q(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(q(e.attributes.name)===`robots`||q(e.attributes.name)===`googlebot`||q(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(q(e.attributes.name)===`author`||q(e.attributes.name)===`generator`||q(e.attributes.name)===`framework`||q(e.attributes.name)===`publisher`||q(e.attributes.name)===`progid`||q(e.attributes.property).match(/^article:/)||q(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(q(e.attributes.name)===`google-site-verification`||q(e.attributes.name)===`yandex-verification`||q(e.attributes.name)===`csrf-token`||q(e.attributes.name)===`p:domain_verify`||q(e.attributes.name)===`verify-v1`||q(e.attributes.name)===`verification`||q(e.attributes.name)===`shopify-checkout-api-token`))))}function Mu(e,t){var n=t.doc,r=t.map,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,p=f===void 0?{}:f,m=t.maskTextFn,h=t.maskInputFn,g=t.slimDOMOptions,_=t.dataURLOptions,v=_===void 0?{}:_,y=t.inlineImages,b=y===void 0?!1:y,x=t.recordCanvas,S=x===void 0?!1:x,C=t.onSerialize,w=t.onIframeLoad,ee=t.iframeLoadTimeout,T=ee===void 0?5e3:ee,E=t.keepIframeSrcFn,D=E===void 0?function(){return!1}:E,te=t.preserveWhiteSpace,O=te===void 0?!0:te,k=Au(e,{doc:n,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,dataURLOptions:v,inlineImages:b,recordCanvas:S,keepIframeSrcFn:D});if(!k)return console.warn(e,`not serialized`),null;var A=`__sn`in e?e.__sn.id:ju(k,g)||!O&&k.type===$l.Text&&!k.isStyle&&!k.textContent.replace(/^\s+|\s+$/gm,``).length?-2:su(),j=Object.assign(k,{id:A});if(e.__sn=j,A===-2)return null;r[A]=e,C&&C(e);var ne=!l;if(j.type===$l.Element&&(ne=ne&&!j.needBlock,delete j.needBlock,e.shadowRoot&&(j.isShadowHost=!0)),(j.type===$l.Document||j.type===$l.Element)&&ne){g.headWhitespace&&k.type===$l.Element&&k.tagName===`head`&&(O=!1);for(var re={doc:n,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D},ie=0,M=Array.from(e.childNodes);ie<M.length;ie++){var ae=M[ie],N=Mu(ae,re);N&&j.childNodes.push(N)}if(eu(e)&&e.shadowRoot)for(var P=0,F=Array.from(e.shadowRoot.childNodes);P<F.length;P++){var ae=F[P],N=Mu(ae,re);N&&(N.isShadow=!0,j.childNodes.push(N))}}return e.parentNode&&tu(e.parentNode)&&(j.isShadow=!0),j.type===$l.Element&&j.tagName===`iframe`&&ku(e,function(){var t=e.contentDocument;if(t&&w){var n=Mu(t,{doc:t,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D});n&&w(e,n)}},T),j}function Nu(e,t){var n=t||{},r=n.blockClass,i=r===void 0?`rr-block`:r,a=n.blockSelector,o=a===void 0?null:a,s=n.maskTextClass,c=s===void 0?`rr-mask`:s,l=n.maskTextSelector,u=l===void 0?null:l,d=n.inlineStylesheet,f=d===void 0?!0:d,p=n.inlineImages,m=p===void 0?!1:p,h=n.recordCanvas,g=h===void 0?!1:h,_=n.maskAllInputs,v=_===void 0?!1:_,y=n.maskTextFn,b=n.maskInputFn,x=n.slimDOM,S=x===void 0?!1:x,C=n.dataURLOptions,w=n.preserveWhiteSpace,ee=n.onSerialize,T=n.onIframeLoad,E=n.iframeLoadTimeout,D=n.keepIframeSrcFn,te=D===void 0?function(){return!1}:D,O={};return[Mu(e,{doc:e,map:O,blockClass:i,blockSelector:o,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:v===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:v===!1?{password:!0}:v,maskTextFn:y,maskInputFn:b,slimDOMOptions:S===!0||S===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:C,inlineImages:m,recordCanvas:g,preserveWhiteSpace:w,onSerialize:ee,onIframeLoad:T,iframeLoadTimeout:E,keepIframeSrcFn:te}),O]}var J;(function(e){e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`})(J||(J={}));var Pu;(function(e){e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`})(Pu||(Pu={}));var Fu;(function(e){e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`})(Fu||(Fu={}));var Iu;(function(e){e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`})(Iu||(Iu={}));var Lu;(function(e){e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`})(Lu||(Lu={}));var Ru;(function(e){e.Start=`start`,e.Pause=`pause`,e.Resume=`resume`,e.Resize=`resize`,e.Finish=`finish`,e.FullsnapshotRebuilded=`fullsnapshot-rebuilded`,e.LoadStylesheetStart=`load-stylesheet-start`,e.LoadStylesheetEnd=`load-stylesheet-end`,e.SkipStart=`skip-start`,e.SkipEnd=`skip-end`,e.MouseInteraction=`mouse-interaction`,e.EventCast=`event-cast`,e.CustomEvent=`custom-event`,e.Flush=`flush`,e.StateChange=`state-change`,e.PlayBack=`play-back`})(Ru||(Ru={}));function zu(e,t,n){n===void 0&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}function Bu(){return{map:{},getId:function(e){return!e||!e.__sn?-1:e.__sn.id},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}var Vu=`Please stop import mirror directly. Instead of that,\r
17
17
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
18
- or you can use record.mirror to access the mirror instance during recording.`,_mirror={map:{},getId:function(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),-1},getNode:function(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),null},removeNodeFromMap:function(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)},has:function(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),!1},reset:function(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(_mirror=new Proxy(_mirror,{get:function(z,G,K){return G===`map`&&console.error(DEPARTED_MIRROR_ACCESS_WARNING),Reflect.get(z,G,K)}}));function throttle(z,G,K){K===void 0&&(K={});var J=null,Y=0;return function(X){var Z=Date.now();!Y&&K.leading===!1&&(Y=Z);var Q=G-(Z-Y),ee=this,te=arguments;Q<=0||Q>G?(J&&(clearTimeout(J),J=null),Y=Z,z.apply(ee,te)):!J&&K.trailing!==!1&&(J=setTimeout(function(){Y=K.leading===!1?0:Date.now(),J=null,z.apply(ee,te)},Q))}}function hookSetter(z,G,K,J,Y){Y===void 0&&(Y=window);var X=Y.Object.getOwnPropertyDescriptor(z,G);return Y.Object.defineProperty(z,G,J?K:{set:function(z){var G=this;setTimeout(function(){K.set.call(G,z)},0),X&&X.set&&X.set.call(this,z)}}),function(){return hookSetter(z,G,X||{},!0)}}function patch(z,G,K){try{if(!(G in z))return function(){};var J=z[G],Y=K(J);return typeof Y==`function`&&(Y.prototype=Y.prototype||{},Object.defineProperties(Y,{__rrweb_original__:{enumerable:!1,value:J}})),z[G]=Y,function(){z[G]=J}}catch(z){return function(){}}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(z,G){if(!z)return!1;if(z.nodeType===z.ELEMENT_NODE){var K=!1;if(typeof G==`string`){if(z.closest!==void 0)return z.closest(`.`+G)!==null;K=z.classList.contains(G)}else z.classList.forEach(function(z){G.test(z)&&(K=!0)});return K||isBlocked(z.parentNode,G)}return z.nodeType,z.TEXT_NODE,isBlocked(z.parentNode,G)}function isIgnored(z){return`__sn`in z?z.__sn.id===IGNORED_NODE:!1}function isAncestorRemoved(z,G){if(isShadowRoot(z))return!1;var K=G.getId(z);return G.has(K)?z.parentNode&&z.parentNode.nodeType===z.DOCUMENT_NODE?!1:z.parentNode?isAncestorRemoved(z.parentNode,G):!0:!0}function isTouchEvent(z){return!!z.changedTouches}function polyfill(z){z===void 0&&(z=window),`NodeList`in z&&!z.NodeList.prototype.forEach&&(z.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in z&&!z.DOMTokenList.prototype.forEach&&(z.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(z){if(!(0 in arguments))throw TypeError(`1 argument is required`);do if(this===z)return!0;while(z=z&&z.parentNode);return!1})}var TreeIndex=function(){function z(){this.reset()}return z.prototype.add=function(z){var G=this.indexes.get(z.parentId),K={id:z.node.id,mutation:z,children:[],texts:[],attributes:[]};G?(K.parent=G,G.children[K.id]=K):this.tree[K.id]=K,this.indexes.set(K.id,K)},z.prototype.remove=function(z,G){var K=this,J=this.indexes.get(z.parentId),Y=this.indexes.get(z.id),X=function(z){K.removeIdSet.add(z);var J=G.getNode(z);J==null||J.childNodes.forEach(function(z){`__sn`in z&&X(z.__sn.id)})},Z=function(G){K.removeIdSet.add(G.id),Object.values(G.children).forEach(function(z){return Z(z)});var J=K.indexes.get(G.id);if(J){var Y=J.parent;Y&&(delete J.parent,delete Y.children[J.id],K.indexes.delete(z.id))}};Y?J?(delete Y.parent,delete J.children[Y.id],this.indexes.delete(z.id),Z(Y)):(delete this.tree[Y.id],this.indexes.delete(Y.id),Z(Y)):(this.removeNodeMutations.push(z),X(z.id))},z.prototype.text=function(z){var G=this.indexes.get(z.id);G?G.texts.push(z):this.textMutations.push(z)},z.prototype.attribute=function(z){var G=this.indexes.get(z.id);G?G.attributes.push(z):this.attributeMutations.push(z)},z.prototype.scroll=function(z){this.scrollMap.set(z.id,z)},z.prototype.input=function(z){this.inputMap.set(z.id,z)},z.prototype.flush=function(){var z,G,K,J,Y=this,X=this,Z=X.tree,Q=X.removeNodeMutations,ee=X.textMutations,te=X.attributeMutations,ne={source:IncrementalSource.Mutation,removes:Q,texts:ee,attributes:te,adds:[]},ie=function(z,G){G&&Y.removeIdSet.add(z.id),ne.texts=ne.texts.concat(G?[]:z.texts).filter(function(z){return!Y.removeIdSet.has(z.id)}),ne.attributes=ne.attributes.concat(G?[]:z.attributes).filter(function(z){return!Y.removeIdSet.has(z.id)}),!Y.removeIdSet.has(z.id)&&!Y.removeIdSet.has(z.mutation.parentId)&&!G?(ne.adds.push(z.mutation),z.children&&Object.values(z.children).forEach(function(z){return ie(z,!1)})):Object.values(z.children).forEach(function(z){return ie(z,!0)})};Object.values(Z).forEach(function(z){return ie(z,!1)});try{for(var ae=__values(this.scrollMap.keys()),oe=ae.next();!oe.done;oe=ae.next()){var se=oe.value;this.removeIdSet.has(se)&&this.scrollMap.delete(se)}}catch(G){z={error:G}}finally{try{oe&&!oe.done&&(G=ae.return)&&G.call(ae)}finally{if(z)throw z.error}}try{for(var ce=__values(this.inputMap.keys()),le=ce.next();!le.done;le=ce.next()){var se=le.value;this.removeIdSet.has(se)&&this.inputMap.delete(se)}}catch(z){K={error:z}}finally{try{le&&!le.done&&(J=ce.return)&&J.call(ce)}finally{if(K)throw K.error}}var ue=new Map(this.scrollMap),de=new Map(this.inputMap);return this.reset(),{mutationData:ne,scrollMap:ue,inputMap:de}},z.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},z.prototype.idRemoved=function(z){return this.removeIdSet.has(z)},z}();function isIframeINode(z){return`__sn`in z?z.__sn.type===NodeType.Element&&z.__sn.tagName===`iframe`:!1}function hasShadowRoot(z){return!!(z!=null&&z.shadowRoot)}function isNodeInLinkedList(z){return`__ln`in z}var DoubleLinkedList=function(){function z(){this.length=0,this.head=null}return z.prototype.get=function(z){if(z>=this.length)throw Error(`Position outside of list range`);for(var G=this.head,K=0;K<z;K++)G=(G==null?void 0:G.next)||null;return G},z.prototype.addNode=function(z){var G={value:z,previous:null,next:null};if(z.__ln=G,z.previousSibling&&isNodeInLinkedList(z.previousSibling)){var K=z.previousSibling.__ln.next;G.next=K,G.previous=z.previousSibling.__ln,z.previousSibling.__ln.next=G,K&&(K.previous=G)}else if(z.nextSibling&&isNodeInLinkedList(z.nextSibling)&&z.nextSibling.__ln.previous){var K=z.nextSibling.__ln.previous;G.previous=K,G.next=z.nextSibling.__ln,z.nextSibling.__ln.previous=G,K&&(K.next=G)}else this.head&&(this.head.previous=G),G.next=this.head,this.head=G;this.length++},z.prototype.removeNode=function(z){var G=z.__ln;this.head&&(G.previous?(G.previous.next=G.next,G.next&&(G.next.previous=G.previous)):(this.head=G.next,this.head&&(this.head.previous=null)),z.__ln&&delete z.__ln,this.length--)},z}(),moveKey=function(z,G){return`${z}@${G}`};function isINode(z){return`__sn`in z}var MutationBuffer=function(){function z(){var z=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(G){G.forEach(z.processMutation),z.emit()},this.emit=function(){var G,K,J,Y;if(!(z.frozen||z.locked)){for(var X=[],Z=new DoubleLinkedList,Q=function(G){for(var K=G,J=IGNORED_NODE;J===IGNORED_NODE;)K=K&&K.nextSibling,J=K&&z.mirror.getId(K);return J},ee=function(G){for(var K,J,Y,ee,te,ne=G.getRootNode?(K=G.getRootNode())==null?void 0:K.host:null,ie=ne;(Y=(J=ie==null?void 0:ie.getRootNode)==null?void 0:J.call(ie))!=null&&Y.host;)ie=((te=(ee=ie==null?void 0:ie.getRootNode)==null?void 0:ee.call(ie))==null?void 0:te.host)||null;var ae=!z.doc.contains(G)&&(ie===null||!z.doc.contains(ie));if(!(!G.parentNode||ae)){var oe=isShadowRoot(G.parentNode)?z.mirror.getId(ne):z.mirror.getId(G.parentNode),se=Q(G);if(oe===-1||se===-1)return Z.addNode(G);var ce=serializeNodeWithId(G,{doc:z.doc,map:z.mirror.map,blockClass:z.blockClass,blockSelector:z.blockSelector,maskTextClass:z.maskTextClass,maskTextSelector:z.maskTextSelector,skipChild:!0,inlineStylesheet:z.inlineStylesheet,maskInputOptions:z.maskInputOptions,maskTextFn:z.maskTextFn,maskInputFn:z.maskInputFn,slimDOMOptions:z.slimDOMOptions,recordCanvas:z.recordCanvas,inlineImages:z.inlineImages,onSerialize:function(K){isIframeINode(K)&&z.iframeManager.addIframe(K),hasShadowRoot(G)&&z.shadowDomManager.addShadowRoot(G.shadowRoot,document)},onIframeLoad:function(G,K){z.iframeManager.attachIframe(G,K),z.shadowDomManager.observeAttachShadow(G)}});ce&&X.push({parentId:oe,nextId:se,node:ce})}};z.mapRemoves.length;)z.mirror.removeNodeFromMap(z.mapRemoves.shift());try{for(var te=__values(z.movedSet),ne=te.next();!ne.done;ne=te.next()){var ie=ne.value;isParentRemoved(z.removes,ie,z.mirror)&&!z.movedSet.has(ie.parentNode)||ee(ie)}}catch(z){G={error:z}}finally{try{ne&&!ne.done&&(K=te.return)&&K.call(te)}finally{if(G)throw G.error}}try{for(var ae=__values(z.addedSet),oe=ae.next();!oe.done;oe=ae.next()){var ie=oe.value;!isAncestorInSet(z.droppedSet,ie)&&!isParentRemoved(z.removes,ie,z.mirror)||isAncestorInSet(z.movedSet,ie)?ee(ie):z.droppedSet.add(ie)}}catch(z){J={error:z}}finally{try{oe&&!oe.done&&(Y=ae.return)&&Y.call(ae)}finally{if(J)throw J.error}}for(var se=null;Z.length;){var ce=null;if(se){var le=z.mirror.getId(se.value.parentNode),ue=Q(se.value);le!==-1&&ue!==-1&&(ce=se)}if(!ce)for(var de=Z.length-1;de>=0;de--){var fe=Z.get(de);if(fe){var le=z.mirror.getId(fe.value.parentNode),ue=Q(fe.value);if(le!==-1&&ue!==-1){ce=fe;break}}}if(!ce){for(;Z.head;)Z.removeNode(Z.head.value);break}se=ce.previous,Z.removeNode(ce.value),ee(ce.value)}var pe={texts:z.texts.map(function(G){return{id:z.mirror.getId(G.node),value:G.value}}).filter(function(G){return z.mirror.has(G.id)}),attributes:z.attributes.map(function(G){return{id:z.mirror.getId(G.node),attributes:G.attributes}}).filter(function(G){return z.mirror.has(G.id)}),removes:z.removes,adds:X};!pe.texts.length&&!pe.attributes.length&&!pe.removes.length&&!pe.adds.length||(z.texts=[],z.attributes=[],z.removes=[],z.addedSet=new Set,z.movedSet=new Set,z.droppedSet=new Set,z.movedMap={},z.mutationCb(pe))}},this.processMutation=function(G){var K,J,Y,X;if(!isIgnored(G.target))switch(G.type){case`characterData`:var Z=G.target.textContent;!isBlocked(G.target,z.blockClass)&&Z!==G.oldValue&&z.texts.push({value:needMaskingText(G.target,z.maskTextClass,z.maskTextSelector)&&Z?z.maskTextFn?z.maskTextFn(Z):Z.replace(/[\S]/g,`*`):Z,node:G.target});break;case`attributes`:var Q=G.target,Z=G.target.getAttribute(G.attributeName);if(G.attributeName===`value`&&(Z=maskInputValue({maskInputOptions:z.maskInputOptions,tagName:G.target.tagName,type:G.target.getAttribute(`type`),value:Z,maskInputFn:z.maskInputFn})),isBlocked(G.target,z.blockClass)||Z===G.oldValue)return;var ee=z.attributes.find(function(z){return z.node===G.target});if(ee||(ee={node:G.target,attributes:{}},z.attributes.push(ee)),G.attributeName===`style`){var te=z.doc.createElement(`span`);G.oldValue&&te.setAttribute(`style`,G.oldValue),(ee.attributes.style===void 0||ee.attributes.style===null)&&(ee.attributes.style={});var ne=ee.attributes.style;try{for(var ie=__values(Array.from(Q.style)),ae=ie.next();!ae.done;ae=ie.next()){var oe=ae.value,se=Q.style.getPropertyValue(oe),ce=Q.style.getPropertyPriority(oe);(se!==te.style.getPropertyValue(oe)||ce!==te.style.getPropertyPriority(oe))&&(ce===``?ne[oe]=se:ne[oe]=[se,ce])}}catch(z){K={error:z}}finally{try{ae&&!ae.done&&(J=ie.return)&&J.call(ie)}finally{if(K)throw K.error}}try{for(var le=__values(Array.from(te.style)),ue=le.next();!ue.done;ue=le.next()){var oe=ue.value;Q.style.getPropertyValue(oe)===``&&(ne[oe]=!1)}}catch(z){Y={error:z}}finally{try{ue&&!ue.done&&(X=le.return)&&X.call(le)}finally{if(Y)throw Y.error}}}else ee.attributes[G.attributeName]=transformAttribute(z.doc,G.target.tagName,G.attributeName,Z);break;case`childList`:G.addedNodes.forEach(function(K){return z.genAdds(K,G.target)}),G.removedNodes.forEach(function(K){var J=z.mirror.getId(K),Y=isShadowRoot(G.target)?z.mirror.getId(G.target.host):z.mirror.getId(G.target);isBlocked(G.target,z.blockClass)||isIgnored(K)||(z.addedSet.has(K)?(deepDelete(z.addedSet,K),z.droppedSet.add(K)):z.addedSet.has(G.target)&&J===-1||isAncestorRemoved(G.target,z.mirror)||(z.movedSet.has(K)&&z.movedMap[moveKey(J,Y)]?deepDelete(z.movedSet,K):z.removes.push({parentId:Y,id:J,isShadow:isShadowRoot(G.target)?!0:void 0})),z.mapRemoves.push(K))});break}},this.genAdds=function(G,K){if(!(K&&isBlocked(K,z.blockClass))){if(isINode(G)){if(isIgnored(G))return;z.movedSet.add(G);var J=null;K&&isINode(K)&&(J=K.__sn.id),J&&(z.movedMap[moveKey(G.__sn.id,J)]=!0)}else z.addedSet.add(G),z.droppedSet.delete(G);isBlocked(G,z.blockClass)||G.childNodes.forEach(function(G){return z.genAdds(G)})}}}return z.prototype.init=function(z){var G=this;[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`doc`,`mirror`,`iframeManager`,`shadowDomManager`,`canvasManager`].forEach(function(K){G[K]=z[K]})},z.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},z.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},z.prototype.isFrozen=function(){return this.frozen},z.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},z.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},z.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},z}();function deepDelete(z,G){z.delete(G),G.childNodes.forEach(function(G){return deepDelete(z,G)})}function isParentRemoved(z,G,K){var J=G.parentNode;if(!J)return!1;var Y=K.getId(J);return z.some(function(z){return z.id===Y})?!0:isParentRemoved(z,J,K)}function isAncestorInSet(z,G){var K=G.parentNode;return K?z.has(K)?!0:isAncestorInSet(z,K):!1}var mutationBuffers=[],isCSSGroupingRuleSupported=typeof CSSGroupingRule<`u`,isCSSMediaRuleSupported=typeof CSSMediaRule<`u`,isCSSSupportsRuleSupported=typeof CSSSupportsRule<`u`,isCSSConditionRuleSupported=typeof CSSConditionRule<`u`;function getEventTarget(z){try{if(`composedPath`in z){var G=z.composedPath();if(G.length)return G[0]}else if(`path`in z&&z.path.length)return z.path[0];return z.target}catch(G){return z.target}}function initMutationObserver(z,G){var K,J,Y=new MutationBuffer;mutationBuffers.push(Y),Y.init(z);var X=window.MutationObserver||window.__rrMutationObserver,Z=(J=(K=window==null?void 0:window.Zone)==null?void 0:K.__symbol__)==null?void 0:J.call(K,`MutationObserver`);Z&&window[Z]&&(X=window[Z]);var Q=new X(Y.processMutations.bind(Y));return Q.observe(G,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),Q}function initMoveObserver(z){var G=z.mousemoveCb,K=z.sampling,J=z.doc,Y=z.mirror;if(K.mousemove===!1)return function(){};var X=typeof K.mousemove==`number`?K.mousemove:50,Z=typeof K.mousemoveCallback==`number`?K.mousemoveCallback:500,Q=[],ee,te=throttle(function(z){var K=Date.now()-ee;G(Q.map(function(z){return z.timeOffset-=K,z}),z),Q=[],ee=null},Z),ne=throttle(function(z){var G=getEventTarget(z),K=isTouchEvent(z)?z.changedTouches[0]:z,J=K.clientX,X=K.clientY;ee||(ee=Date.now()),Q.push({x:J,y:X,id:Y.getId(G),timeOffset:Date.now()-ee}),te(typeof DragEvent<`u`&&z instanceof DragEvent?IncrementalSource.Drag:z instanceof MouseEvent?IncrementalSource.MouseMove:IncrementalSource.TouchMove)},X,{trailing:!1}),ie=[on(`mousemove`,ne,J),on(`touchmove`,ne,J),on(`drag`,ne,J)];return function(){ie.forEach(function(z){return z()})}}function initMouseInteractionObserver(z){var G=z.mouseInteractionCb,K=z.doc,J=z.mirror,Y=z.blockClass,X=z.sampling;if(X.mouseInteraction===!1)return function(){};var Z=X.mouseInteraction===!0||X.mouseInteraction===void 0?{}:X.mouseInteraction,Q=[],ee=function(z){return function(K){var X=getEventTarget(K);if(!isBlocked(X,Y)){var Z=isTouchEvent(K)?K.changedTouches[0]:K;if(Z){var Q=J.getId(X),ee=Z.clientX,te=Z.clientY;G({type:MouseInteractions[z],id:Q,x:ee,y:te})}}}};return Object.keys(MouseInteractions).filter(function(z){return Number.isNaN(Number(z))&&!z.endsWith(`_Departed`)&&Z[z]!==!1}).forEach(function(z){var G=z.toLowerCase(),J=ee(z);Q.push(on(G,J,K))}),function(){Q.forEach(function(z){return z()})}}function initScrollObserver(z){var G=z.scrollCb,K=z.doc,J=z.mirror,Y=z.blockClass,X=z.sampling;return on(`scroll`,throttle(function(z){var X=getEventTarget(z);if(!(!X||isBlocked(X,Y))){var Z=J.getId(X);if(X===K){var Q=K.scrollingElement||K.documentElement;G({id:Z,x:Q.scrollLeft,y:Q.scrollTop})}else G({id:Z,x:X.scrollLeft,y:X.scrollTop})}},X.scroll||100),K)}function initViewportResizeObserver(z){var G=z.viewportResizeCb,K=-1,J=-1;return on(`resize`,throttle(function(){var z=getWindowHeight(),Y=getWindowWidth();(K!==z||J!==Y)&&(G({width:Number(Y),height:Number(z)}),K=z,J=Y)},200),window)}function wrapEventWithUserTriggeredFlag(z,G){var K=__assign({},z);return G||delete K.userTriggered,K}var INPUT_TAGS=[`INPUT`,`TEXTAREA`,`SELECT`],lastInputValueMap=new WeakMap;function initInputObserver(z){var G=z.inputCb,K=z.doc,J=z.mirror,Y=z.blockClass,X=z.ignoreClass,Z=z.maskInputOptions,Q=z.maskInputFn,ee=z.sampling,te=z.userTriggeredOnInput;function ne(z){var G=getEventTarget(z),J=z.isTrusted;if(G&&G.tagName===`OPTION`&&(G=G.parentElement),!(!G||!G.tagName||INPUT_TAGS.indexOf(G.tagName)<0||isBlocked(G,Y))){var ee=G.type;if(!G.classList.contains(X)){var ne=G.value,ae=!1;ee===`radio`||ee===`checkbox`?ae=G.checked:(Z[G.tagName.toLowerCase()]||Z[ee])&&(ne=maskInputValue({maskInputOptions:Z,tagName:G.tagName,type:ee,value:ne,maskInputFn:Q})),ie(G,wrapEventWithUserTriggeredFlag({text:ne,isChecked:ae,userTriggered:J},te));var oe=G.name;ee===`radio`&&oe&&ae&&K.querySelectorAll(`input[type="radio"][name="${oe}"]`).forEach(function(z){z!==G&&ie(z,wrapEventWithUserTriggeredFlag({text:z.value,isChecked:!ae,userTriggered:!1},te))})}}}function ie(z,K){var Y=lastInputValueMap.get(z);if(!Y||Y.text!==K.text||Y.isChecked!==K.isChecked){lastInputValueMap.set(z,K);var X=J.getId(z);G(__assign(__assign({},K),{id:X}))}}var ae=(ee.input===`last`?[`change`]:[`input`,`change`]).map(function(z){return on(z,ne,K)}),oe=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`),se=[[HTMLInputElement.prototype,`value`],[HTMLInputElement.prototype,`checked`],[HTMLSelectElement.prototype,`value`],[HTMLTextAreaElement.prototype,`value`],[HTMLSelectElement.prototype,`selectedIndex`],[HTMLOptionElement.prototype,`selected`]];return oe&&oe.set&&ae.push.apply(ae,__spreadArray([],__read(se.map(function(z){return hookSetter(z[0],z[1],{set:function(){ne({target:this})}})})),!1)),function(){ae.forEach(function(z){return z()})}}function getNestedCSSRulePositions(z){var G=[];function K(z,G){if(isCSSGroupingRuleSupported&&z.parentRule instanceof CSSGroupingRule||isCSSMediaRuleSupported&&z.parentRule instanceof CSSMediaRule||isCSSSupportsRuleSupported&&z.parentRule instanceof CSSSupportsRule||isCSSConditionRuleSupported&&z.parentRule instanceof CSSConditionRule){var K=Array.from(z.parentRule.cssRules),J=K.indexOf(z);G.unshift(J)}else{var K=Array.from(z.parentStyleSheet.cssRules),J=K.indexOf(z);G.unshift(J)}return G}return K(z,G)}function initStyleSheetObserver(z,G){var K=z.styleSheetRuleCb,J=z.mirror,Y=G.win,X=Y.CSSStyleSheet.prototype.insertRule;Y.CSSStyleSheet.prototype.insertRule=function(z,G){var Y=J.getId(this.ownerNode);return Y!==-1&&K({id:Y,adds:[{rule:z,index:G}]}),X.apply(this,arguments)};var Z=Y.CSSStyleSheet.prototype.deleteRule;Y.CSSStyleSheet.prototype.deleteRule=function(z){var G=J.getId(this.ownerNode);return G!==-1&&K({id:G,removes:[{index:z}]}),Z.apply(this,arguments)};var Q={};isCSSGroupingRuleSupported?Q.CSSGroupingRule=Y.CSSGroupingRule:(isCSSMediaRuleSupported&&(Q.CSSMediaRule=Y.CSSMediaRule),isCSSConditionRuleSupported&&(Q.CSSConditionRule=Y.CSSConditionRule),isCSSSupportsRuleSupported&&(Q.CSSSupportsRule=Y.CSSSupportsRule));var ee={};return Object.entries(Q).forEach(function(z){var G=__read(z,2),Y=G[0],X=G[1];ee[Y]={insertRule:X.prototype.insertRule,deleteRule:X.prototype.deleteRule},X.prototype.insertRule=function(z,G){var X=J.getId(this.parentStyleSheet.ownerNode);return X!==-1&&K({id:X,adds:[{rule:z,index:__spreadArray(__spreadArray([],__read(getNestedCSSRulePositions(this)),!1),[G||0],!1)}]}),ee[Y].insertRule.apply(this,arguments)},X.prototype.deleteRule=function(z){var G=J.getId(this.parentStyleSheet.ownerNode);return G!==-1&&K({id:G,removes:[{index:__spreadArray(__spreadArray([],__read(getNestedCSSRulePositions(this)),!1),[z],!1)}]}),ee[Y].deleteRule.apply(this,arguments)}}),function(){Y.CSSStyleSheet.prototype.insertRule=X,Y.CSSStyleSheet.prototype.deleteRule=Z,Object.entries(Q).forEach(function(z){var G=__read(z,2),K=G[0],J=G[1];J.prototype.insertRule=ee[K].insertRule,J.prototype.deleteRule=ee[K].deleteRule})}}function initStyleDeclarationObserver(z,G){var K=z.styleDeclarationCb,J=z.mirror,Y=G.win,X=Y.CSSStyleDeclaration.prototype.setProperty;Y.CSSStyleDeclaration.prototype.setProperty=function(z,G,Y){var Z,Q,ee=J.getId((Q=(Z=this.parentRule)==null?void 0:Z.parentStyleSheet)==null?void 0:Q.ownerNode);return ee!==-1&&K({id:ee,set:{property:z,value:G,priority:Y},index:getNestedCSSRulePositions(this.parentRule)}),X.apply(this,arguments)};var Z=Y.CSSStyleDeclaration.prototype.removeProperty;return Y.CSSStyleDeclaration.prototype.removeProperty=function(z){var G,Y,X=J.getId((Y=(G=this.parentRule)==null?void 0:G.parentStyleSheet)==null?void 0:Y.ownerNode);return X!==-1&&K({id:X,remove:{property:z},index:getNestedCSSRulePositions(this.parentRule)}),Z.apply(this,arguments)},function(){Y.CSSStyleDeclaration.prototype.setProperty=X,Y.CSSStyleDeclaration.prototype.removeProperty=Z}}function initMediaInteractionObserver(z){var G=z.mediaInteractionCb,K=z.blockClass,J=z.mirror,Y=z.sampling,X=function(z){return throttle(function(Y){var X=getEventTarget(Y);if(!(!X||isBlocked(X,K))){var Z=X,Q=Z.currentTime,ee=Z.volume,te=Z.muted;G({type:z,id:J.getId(X),currentTime:Q,volume:ee,muted:te})}},Y.media||500)},Z=[on(`play`,X(0)),on(`pause`,X(1)),on(`seeked`,X(2)),on(`volumechange`,X(3))];return function(){Z.forEach(function(z){return z()})}}function initFontObserver(z){var G=z.fontCb,K=z.doc,J=K.defaultView;if(!J)return function(){};var Y=[],X=new WeakMap,Z=J.FontFace;J.FontFace=function(z,G,K){var J=new Z(z,G,K);return X.set(J,{family:z,buffer:typeof G!=`string`,descriptors:K,fontSource:typeof G==`string`?G:JSON.stringify(Array.from(new Uint8Array(G)))}),J};var Q=patch(K.fonts,`add`,function(z){return function(K){return setTimeout(function(){var z=X.get(K);z&&(G(z),X.delete(K))},0),z.apply(this,[K])}});return Y.push(function(){J.FontFace=Z}),Y.push(Q),function(){Y.forEach(function(z){return z()})}}function mergeHooks(z,G){var K=z.mutationCb,J=z.mousemoveCb,Y=z.mouseInteractionCb,X=z.scrollCb,Z=z.viewportResizeCb,Q=z.inputCb,ee=z.mediaInteractionCb,te=z.styleSheetRuleCb,ne=z.styleDeclarationCb,ie=z.canvasMutationCb,ae=z.fontCb;z.mutationCb=function(){var z=[...arguments];G.mutation&&G.mutation.apply(G,__spreadArray([],__read(z),!1)),K.apply(void 0,__spreadArray([],__read(z),!1))},z.mousemoveCb=function(){var z=[...arguments];G.mousemove&&G.mousemove.apply(G,__spreadArray([],__read(z),!1)),J.apply(void 0,__spreadArray([],__read(z),!1))},z.mouseInteractionCb=function(){var z=[...arguments];G.mouseInteraction&&G.mouseInteraction.apply(G,__spreadArray([],__read(z),!1)),Y.apply(void 0,__spreadArray([],__read(z),!1))},z.scrollCb=function(){var z=[...arguments];G.scroll&&G.scroll.apply(G,__spreadArray([],__read(z),!1)),X.apply(void 0,__spreadArray([],__read(z),!1))},z.viewportResizeCb=function(){var z=[...arguments];G.viewportResize&&G.viewportResize.apply(G,__spreadArray([],__read(z),!1)),Z.apply(void 0,__spreadArray([],__read(z),!1))},z.inputCb=function(){var z=[...arguments];G.input&&G.input.apply(G,__spreadArray([],__read(z),!1)),Q.apply(void 0,__spreadArray([],__read(z),!1))},z.mediaInteractionCb=function(){var z=[...arguments];G.mediaInteaction&&G.mediaInteaction.apply(G,__spreadArray([],__read(z),!1)),ee.apply(void 0,__spreadArray([],__read(z),!1))},z.styleSheetRuleCb=function(){var z=[...arguments];G.styleSheetRule&&G.styleSheetRule.apply(G,__spreadArray([],__read(z),!1)),te.apply(void 0,__spreadArray([],__read(z),!1))},z.styleDeclarationCb=function(){var z=[...arguments];G.styleDeclaration&&G.styleDeclaration.apply(G,__spreadArray([],__read(z),!1)),ne.apply(void 0,__spreadArray([],__read(z),!1))},z.canvasMutationCb=function(){var z=[...arguments];G.canvasMutation&&G.canvasMutation.apply(G,__spreadArray([],__read(z),!1)),ie.apply(void 0,__spreadArray([],__read(z),!1))},z.fontCb=function(){var z=[...arguments];G.font&&G.font.apply(G,__spreadArray([],__read(z),!1)),ae.apply(void 0,__spreadArray([],__read(z),!1))}}function initObservers(z,G){var K,J;G===void 0&&(G={});var Y=z.doc.defaultView;if(!Y)return function(){};mergeHooks(z,G);var X=initMutationObserver(z,z.doc),Z=initMoveObserver(z),Q=initMouseInteractionObserver(z),ee=initScrollObserver(z),te=initViewportResizeObserver(z),ne=initInputObserver(z),ie=initMediaInteractionObserver(z),ae=initStyleSheetObserver(z,{win:Y}),oe=initStyleDeclarationObserver(z,{win:Y}),se=z.collectFonts?initFontObserver(z):function(){},ce=[];try{for(var le=__values(z.plugins),ue=le.next();!ue.done;ue=le.next()){var de=ue.value;ce.push(de.observer(de.callback,Y,de.options))}}catch(z){K={error:z}}finally{try{ue&&!ue.done&&(J=le.return)&&J.call(le)}finally{if(K)throw K.error}}return function(){mutationBuffers.forEach(function(z){return z.reset()}),X.disconnect(),Z(),Q(),ee(),te(),ne(),ie(),ae(),oe(),se(),ce.forEach(function(z){return z()})}}var IframeManager=function(){function z(z){this.iframes=new WeakMap,this.mutationCb=z.mutationCb}return z.prototype.addIframe=function(z){this.iframes.set(z,!0)},z.prototype.addLoadListener=function(z){this.loadListener=z},z.prototype.attachIframe=function(z,G){var K;this.mutationCb({adds:[{parentId:z.__sn.id,nextId:null,node:G}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(K=this.loadListener)==null||K.call(this,z)},z}(),ShadowDomManager=function(){function z(z){this.restorePatches=[],this.mutationCb=z.mutationCb,this.scrollCb=z.scrollCb,this.bypassOptions=z.bypassOptions,this.mirror=z.mirror;var G=this;this.restorePatches.push(patch(HTMLElement.prototype,`attachShadow`,function(z){return function(){var K=z.apply(this,arguments);return this.shadowRoot&&G.addShadowRoot(this.shadowRoot,this.ownerDocument),K}}))}return z.prototype.addShadowRoot=function(z,G){initMutationObserver(__assign(__assign({},this.bypassOptions),{doc:G,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),z),initScrollObserver(__assign(__assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:z,mirror:this.mirror}))},z.prototype.observeAttachShadow=function(z){if(z.contentWindow){var G=this;this.restorePatches.push(patch(z.contentWindow.HTMLElement.prototype,`attachShadow`,function(K){return function(){var J=K.apply(this,arguments);return this.shadowRoot&&G.addShadowRoot(this.shadowRoot,z.contentDocument),J}}))}},z.prototype.reset=function(){this.restorePatches.forEach(function(z){return z()})},z}();function initCanvas2DMutationObserver(z,G,K,J){var Y,X,Z=[],Q=Object.getOwnPropertyNames(G.CanvasRenderingContext2D.prototype),ee=function(J){try{if(typeof G.CanvasRenderingContext2D.prototype[J]!=`function`)return`continue`;var Y=patch(G.CanvasRenderingContext2D.prototype,J,function(G){return function(){for(var Y=this,X=[],Z=0;Z<arguments.length;Z++)X[Z]=arguments[Z];return isBlocked(this.canvas,K)||setTimeout(function(){var G=__spreadArray([],__read(X),!1);if(J===`drawImage`&&G[0]&&G[0]instanceof HTMLCanvasElement){var K=G[0],Z=K.getContext(`2d`),Q=Z==null?void 0:Z.getImageData(0,0,K.width,K.height),ee=Q==null?void 0:Q.data;G[0]=JSON.stringify(ee)}z(Y.canvas,{type:CanvasContext[`2D`],property:J,args:G})},0),G.apply(this,X)}});Z.push(Y)}catch(K){var X=hookSetter(G.CanvasRenderingContext2D.prototype,J,{set:function(G){z(this.canvas,{type:CanvasContext[`2D`],property:J,args:[G],setter:!0})}});Z.push(X)}};try{for(var te=__values(Q),ne=te.next();!ne.done;ne=te.next()){var ie=ne.value;ee(ie)}}catch(z){Y={error:z}}finally{try{ne&&!ne.done&&(X=te.return)&&X.call(te)}finally{if(Y)throw Y.error}}return function(){Z.forEach(function(z){return z()})}}function initCanvasContextObserver(z,G){var K=[];try{var J=patch(z.HTMLCanvasElement.prototype,`getContext`,function(z){return function(K){var J=[...arguments].slice(1);return isBlocked(this,G)||`__context`in this||(this.__context=K),z.apply(this,__spreadArray([K],__read(J),!1))}});K.push(J)}catch(z){console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return function(){K.forEach(function(z){return z()})}}for(var chars=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,lookup=typeof Uint8Array>`u`?[]:new Uint8Array(256),i$1=0;i$1<chars.length;i$1++)lookup[chars.charCodeAt(i$1)]=i$1;var encode=function(z){var G=new Uint8Array(z),K,J=G.length,Y=``;for(K=0;K<J;K+=3)Y+=chars[G[K]>>2],Y+=chars[(G[K]&3)<<4|G[K+1]>>4],Y+=chars[(G[K+1]&15)<<2|G[K+2]>>6],Y+=chars[G[K+2]&63];return J%3==2?Y=Y.substring(0,Y.length-1)+`=`:J%3==1&&(Y=Y.substring(0,Y.length-2)+`==`),Y},webGLVarMap=new Map;function variableListFor(z,G){var K=webGLVarMap.get(z);return K||(K=new Map,webGLVarMap.set(z,K)),K.has(G)||K.set(G,[]),K.get(G)}var saveWebGLVar=function(z,G,K){if(!(!z||!(isInstanceOfWebGLObject(z,G)||typeof z==`object`))){var J=z.constructor.name,Y=variableListFor(K,J),X=Y.indexOf(z);return X===-1&&(X=Y.length,Y.push(z)),X}};function serializeArg(z,G,K){return z instanceof Array?z.map(function(z){return serializeArg(z,G,K)}):z===null?z:z instanceof Float32Array||z instanceof Float64Array||z instanceof Int32Array||z instanceof Uint32Array||z instanceof Uint8Array||z instanceof Uint16Array||z instanceof Int16Array||z instanceof Int8Array||z instanceof Uint8ClampedArray?{rr_type:z.constructor.name,args:[Object.values(z)]}:z instanceof ArrayBuffer?{rr_type:z.constructor.name,base64:encode(z)}:z instanceof DataView?{rr_type:z.constructor.name,args:[serializeArg(z.buffer,G,K),z.byteOffset,z.byteLength]}:z instanceof HTMLImageElement?{rr_type:z.constructor.name,src:z.src}:z instanceof ImageData?{rr_type:z.constructor.name,args:[serializeArg(z.data,G,K),z.width,z.height]}:isInstanceOfWebGLObject(z,G)||typeof z==`object`?{rr_type:z.constructor.name,index:saveWebGLVar(z,G,K)}:z}var serializeArgs=function(z,G,K){return __spreadArray([],__read(z),!1).map(function(z){return serializeArg(z,G,K)})},isInstanceOfWebGLObject=function(z,G){return!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(function(z){return typeof G[z]==`function`}).find(function(K){return z instanceof G[K]})};function patchGLPrototype(z,G,K,J,Y,X){var Z,Q,ee=[],te=Object.getOwnPropertyNames(z),ne=function(Z){try{if(typeof z[Z]!=`function`)return`continue`;var Q=patch(z,Z,function(Q){return function(){var ee=[...arguments],te=Q.apply(this,ee);if(saveWebGLVar(te,X,z),!isBlocked(this.canvas,J)){Y.getId(this.canvas);var ne={type:G,property:Z,args:serializeArgs(__spreadArray([],__read(ee),!1),X,z)};K(this.canvas,ne)}return te}});ee.push(Q)}catch(J){var te=hookSetter(z,Z,{set:function(z){K(this.canvas,{type:G,property:Z,args:[z],setter:!0})}});ee.push(te)}};try{for(var ie=__values(te),ae=ie.next();!ae.done;ae=ie.next()){var oe=ae.value;ne(oe)}}catch(z){Z={error:z}}finally{try{ae&&!ae.done&&(Q=ie.return)&&Q.call(ie)}finally{if(Z)throw Z.error}}return ee}function initCanvasWebGLMutationObserver(z,G,K,J){var Y=[];return Y.push.apply(Y,__spreadArray([],__read(patchGLPrototype(G.WebGLRenderingContext.prototype,CanvasContext.WebGL,z,K,J,G)),!1)),G.WebGL2RenderingContext!==void 0&&Y.push.apply(Y,__spreadArray([],__read(patchGLPrototype(G.WebGL2RenderingContext.prototype,CanvasContext.WebGL2,z,K,J,G)),!1)),function(){Y.forEach(function(z){return z()})}}var CanvasManager=function(){function z(z){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(z,G){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(z)||this.pendingCanvasMutations.set(z,[]),this.pendingCanvasMutations.get(z).push(G)},this.mutationCb=z.mutationCb,this.mirror=z.mirror,z.recordCanvas===!0&&this.initCanvasMutationObserver(z.win,z.blockClass)}return z.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},z.prototype.freeze=function(){this.frozen=!0},z.prototype.unfreeze=function(){this.frozen=!1},z.prototype.lock=function(){this.locked=!0},z.prototype.unlock=function(){this.locked=!1},z.prototype.initCanvasMutationObserver=function(z,G){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var K=initCanvasContextObserver(z,G),J=initCanvas2DMutationObserver(this.processMutation.bind(this),z,G,this.mirror),Y=initCanvasWebGLMutationObserver(this.processMutation.bind(this),z,G,this.mirror);this.resetObservers=function(){K(),J(),Y()}},z.prototype.startPendingCanvasMutationFlusher=function(){var z=this;requestAnimationFrame(function(){return z.flushPendingCanvasMutations()})},z.prototype.startRAFTimestamping=function(){var z=this,G=function(K){z.rafStamps.latestId=K,requestAnimationFrame(G)};requestAnimationFrame(G)},z.prototype.flushPendingCanvasMutations=function(){var z=this;this.pendingCanvasMutations.forEach(function(G,K){var J=z.mirror.getId(K);z.flushPendingCanvasMutationFor(K,J)}),requestAnimationFrame(function(){return z.flushPendingCanvasMutations()})},z.prototype.flushPendingCanvasMutationFor=function(z,G){if(!(this.frozen||this.locked)){var K=this.pendingCanvasMutations.get(z);if(!(!K||G===-1)){var J=K.map(function(z){return z.type,__rest(z,[`type`])}),Y=K[0].type;this.mutationCb({id:G,type:Y,commands:J}),this.pendingCanvasMutations.delete(z)}}},z}();function wrapEvent(z){return __assign(__assign({},z),{timestamp:Date.now()})}var wrappedEmit,takeFullSnapshot,mirror=createMirror();function record(z){z===void 0&&(z={});var G=z.emit,K=z.checkoutEveryNms,J=z.checkoutEveryNth,Y=z.blockClass,X=Y===void 0?`rr-block`:Y,Z=z.blockSelector,Q=Z===void 0?null:Z,ee=z.ignoreClass,te=ee===void 0?`rr-ignore`:ee,ne=z.maskTextClass,ie=ne===void 0?`rr-mask`:ne,ae=z.maskTextSelector,oe=ae===void 0?null:ae,se=z.inlineStylesheet,ce=se===void 0?!0:se,le=z.maskAllInputs,ue=z.maskInputOptions,de=z.slimDOMOptions,fe=z.maskInputFn,pe=z.maskTextFn,me=z.hooks,he=z.packFn,ge=z.sampling,_e=ge===void 0?{}:ge,ve=z.mousemoveWait,ye=z.recordCanvas,be=ye===void 0?!1:ye,xe=z.userTriggeredOnInput,Se=xe===void 0?!1:xe,Ce=z.collectFonts,we=Ce===void 0?!1:Ce,Te=z.inlineImages,Ee=Te===void 0?!1:Te,De=z.plugins,Oe=z.keepIframeSrcFn,ke=Oe===void 0?function(){return!1}:Oe;if(!G)throw Error(`emit function is required`);ve!==void 0&&_e.mousemove===void 0&&(_e.mousemove=ve);var Ae=le===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:ue===void 0?{password:!0}:ue,je=de===!0||de===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:de===`all`,headMetaDescKeywords:de===`all`}:de||{};polyfill();var Me,Ne=0,Pe=function(z){var G,K;try{for(var J=__values(De||[]),Y=J.next();!Y.done;Y=J.next()){var X=Y.value;X.eventProcessor&&(z=X.eventProcessor(z))}}catch(z){G={error:z}}finally{try{Y&&!Y.done&&(K=J.return)&&K.call(J)}finally{if(G)throw G.error}}return he&&(z=he(z)),z};wrappedEmit=function(z,Y){var X;if((X=mutationBuffers[0])!=null&&X.isFrozen()&&z.type!==EventType.FullSnapshot&&!(z.type===EventType.IncrementalSnapshot&&z.data.source===IncrementalSource.Mutation)&&mutationBuffers.forEach(function(z){return z.unfreeze()}),G(Pe(z),Y),z.type===EventType.FullSnapshot)Me=z,Ne=0;else if(z.type===EventType.IncrementalSnapshot){if(z.data.source===IncrementalSource.Mutation&&z.data.isAttachIframe)return;Ne++;var Z=J&&Ne>=J,Q=K&&z.timestamp-Me.timestamp>K;(Z||Q)&&takeFullSnapshot(!0)}};var Fe=function(z){wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},z)}))},Ie=function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},z)}))},Le=function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.CanvasMutation},z)}))},Re=new IframeManager({mutationCb:Fe}),ze=new CanvasManager({recordCanvas:be,mutationCb:Le,win:window,blockClass:X,mirror}),Be=new ShadowDomManager({mutationCb:Fe,scrollCb:Ie,bypassOptions:{blockClass:X,blockSelector:Q,maskTextClass:ie,maskTextSelector:oe,inlineStylesheet:ce,maskInputOptions:Ae,maskTextFn:pe,maskInputFn:fe,recordCanvas:be,inlineImages:Ee,sampling:_e,slimDOMOptions:je,iframeManager:Re,canvasManager:ze},mirror});takeFullSnapshot=function(z){var G,K,J,Y;z===void 0&&(z=!1),wrappedEmit(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),z),mutationBuffers.forEach(function(z){return z.lock()});var Z=__read(snapshot(document,{blockClass:X,blockSelector:Q,maskTextClass:ie,maskTextSelector:oe,inlineStylesheet:ce,maskAllInputs:Ae,maskTextFn:pe,slimDOM:je,recordCanvas:be,inlineImages:Ee,onSerialize:function(z){isIframeINode(z)&&Re.addIframe(z),hasShadowRoot(z)&&Be.addShadowRoot(z.shadowRoot,document)},onIframeLoad:function(z,G){Re.attachIframe(z,G),Be.observeAttachShadow(z)},keepIframeSrcFn:ke}),2),ee=Z[0],te=Z[1];if(!ee)return console.warn(`Failed to snapshot the document`);mirror.map=te,wrappedEmit(wrapEvent({type:EventType.FullSnapshot,data:{node:ee,initialOffset:{left:window.pageXOffset===void 0?(document==null?void 0:document.documentElement.scrollLeft)||((K=(G=document==null?void 0:document.body)==null?void 0:G.parentElement)==null?void 0:K.scrollLeft)||(document==null?void 0:document.body.scrollLeft)||0:window.pageXOffset,top:window.pageYOffset===void 0?(document==null?void 0:document.documentElement.scrollTop)||((Y=(J=document==null?void 0:document.body)==null?void 0:J.parentElement)==null?void 0:Y.scrollTop)||(document==null?void 0:document.body.scrollTop)||0:window.pageYOffset}}})),mutationBuffers.forEach(function(z){return z.unlock()})};try{var Ve=[];Ve.push(on(`DOMContentLoaded`,function(){wrappedEmit(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var He=function(z){var G;return initObservers({mutationCb:Fe,mousemoveCb:function(z,G){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:G,positions:z}}))},mouseInteractionCb:function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},z)}))},scrollCb:Ie,viewportResizeCb:function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},z)}))},inputCb:function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},z)}))},mediaInteractionCb:function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MediaInteraction},z)}))},styleSheetRuleCb:function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.StyleSheetRule},z)}))},styleDeclarationCb:function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.StyleDeclaration},z)}))},canvasMutationCb:Le,fontCb:function(z){return wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Font},z)}))},blockClass:X,ignoreClass:te,maskTextClass:ie,maskTextSelector:oe,maskInputOptions:Ae,inlineStylesheet:ce,sampling:_e,recordCanvas:be,inlineImages:Ee,userTriggeredOnInput:Se,collectFonts:we,doc:z,maskInputFn:fe,maskTextFn:pe,blockSelector:Q,slimDOMOptions:je,mirror,iframeManager:Re,shadowDomManager:Be,canvasManager:ze,plugins:((G=De==null?void 0:De.filter(function(z){return z.observer}))==null?void 0:G.map(function(z){return{observer:z.observer,options:z.options,callback:function(G){return wrappedEmit(wrapEvent({type:EventType.Plugin,data:{plugin:z.name,payload:G}}))}}}))||[]},me)};Re.addLoadListener(function(z){Ve.push(He(z.contentDocument))});var Ue=function(){takeFullSnapshot(),Ve.push(He(document))};return document.readyState===`interactive`||document.readyState===`complete`?Ue():Ve.push(on(`load`,function(){wrappedEmit(wrapEvent({type:EventType.Load,data:{}})),Ue()},window)),function(){Ve.forEach(function(z){return z()})}}catch(z){console.warn(z)}}record.addCustomEvent=function(z,G){if(!wrappedEmit)throw Error(`please add custom event after start recording`);wrappedEmit(wrapEvent({type:EventType.Custom,data:{tag:z,payload:G}}))},record.freezePage=function(){mutationBuffers.forEach(function(z){return z.freeze()})},record.takeFullSnapshot=function(z){if(!takeFullSnapshot)throw Error(`please take full snapshot after start recording`);takeFullSnapshot(z)},record.mirror=mirror;const SUPPRESS_TRACING_KEY=createContextKey(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function suppressTracing(z){return z.setValue(SUPPRESS_TRACING_KEY,!0)}var u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(z,G){for(var K=new u16(31),J=0;J<31;++J)K[J]=G+=1<<z[J-1];for(var Y=new u32(K[30]),J=1;J<30;++J)for(var X=K[J];X<K[J+1];++X)Y[X]=X-K[J]<<5|J;return[K,Y]},_a=freb(fleb,2),fl=_a[0],revfl=_a[1];fl[28]=258,revfl[258]=28;for(var _b=freb(fdeb,0),fd=_b[0],revfd=_b[1],rev=new u16(32768),i=0;i<32768;++i){var x=(i&43690)>>>1|(i&21845)<<1;x=(x&52428)>>>2|(x&13107)<<2,x=(x&61680)>>>4|(x&3855)<<4,rev[i]=((x&65280)>>>8|(x&255)<<8)>>>1}for(var hMap=(function(z,G,K){for(var J=z.length,Y=0,X=new u16(G);Y<J;++Y)z[Y]&&++X[z[Y]-1];var Z=new u16(G);for(Y=0;Y<G;++Y)Z[Y]=Z[Y-1]+X[Y-1]<<1;var Q;if(K){Q=new u16(1<<G);var ee=15-G;for(Y=0;Y<J;++Y)if(z[Y])for(var te=Y<<4|z[Y],ne=G-z[Y],ie=Z[z[Y]-1]++<<ne,ae=ie|(1<<ne)-1;ie<=ae;++ie)Q[rev[ie]>>>ee]=te}else for(Q=new u16(J),Y=0;Y<J;++Y)z[Y]&&(Q[Y]=rev[Z[z[Y]-1]++]>>>15-z[Y]);return Q}),flt=new u8(288),i=0;i<144;++i)flt[i]=8;for(var i=144;i<256;++i)flt[i]=9;for(var i=256;i<280;++i)flt[i]=7;for(var i=280;i<288;++i)flt[i]=8;for(var fdt=new u8(32),i=0;i<32;++i)fdt[i]=5;var flm=hMap(flt,9,0),flrm=hMap(flt,9,1),fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1),shft=function(z){return(z+7)/8|0},slc=function(z,G,K){(G==null||G<0)&&(G=0),(K==null||K>z.length)&&(K=z.length);var J=new(z.BYTES_PER_ELEMENT==2?u16:z.BYTES_PER_ELEMENT==4?u32:u8)(K-G);return J.set(z.subarray(G,K)),J},wbits=function(z,G,K){K<<=G&7;var J=G/8|0;z[J]|=K,z[J+1]|=K>>>8},wbits16=function(z,G,K){K<<=G&7;var J=G/8|0;z[J]|=K,z[J+1]|=K>>>8,z[J+2]|=K>>>16},hTree=function(z,G){for(var K=[],J=0;J<z.length;++J)z[J]&&K.push({s:J,f:z[J]});var Y=K.length,X=K.slice();if(!Y)return[et,0];if(Y==1){var Z=new u8(K[0].s+1);return Z[K[0].s]=1,[Z,1]}K.sort(function(z,G){return z.f-G.f}),K.push({s:-1,f:25001});var Q=K[0],ee=K[1],te=0,ne=1,ie=2;for(K[0]={s:-1,f:Q.f+ee.f,l:Q,r:ee};ne!=Y-1;)Q=K[K[te].f<K[ie].f?te++:ie++],ee=K[te!=ne&&K[te].f<K[ie].f?te++:ie++],K[ne++]={s:-1,f:Q.f+ee.f,l:Q,r:ee};for(var ae=X[0].s,J=1;J<Y;++J)X[J].s>ae&&(ae=X[J].s);var oe=new u16(ae+1),se=ln(K[ne-1],oe,0);if(se>G){var J=0,ce=0,le=se-G,ue=1<<le;for(X.sort(function(z,G){return oe[G.s]-oe[z.s]||z.f-G.f});J<Y;++J){var de=X[J].s;if(oe[de]>G)ce+=ue-(1<<se-oe[de]),oe[de]=G;else break}for(ce>>>=le;ce>0;){var fe=X[J].s;oe[fe]<G?ce-=1<<G-oe[fe]++-1:++J}for(;J>=0&&ce;--J){var pe=X[J].s;oe[pe]==G&&(--oe[pe],++ce)}se=G}return[new u8(oe),se]},ln=function(z,G,K){return z.s==-1?Math.max(ln(z.l,G,K+1),ln(z.r,G,K+1)):G[z.s]=K},lc=function(z){for(var G=z.length;G&&!z[--G];);for(var K=new u16(++G),J=0,Y=z[0],X=1,Z=function(z){K[J++]=z},Q=1;Q<=G;++Q)if(z[Q]==Y&&Q!=G)++X;else{if(!Y&&X>2){for(;X>138;X-=138)Z(32754);X>2&&(Z(X>10?X-11<<5|28690:X-3<<5|12305),X=0)}else if(X>3){for(Z(Y),--X;X>6;X-=6)Z(8304);X>2&&(Z(X-3<<5|8208),X=0)}for(;X--;)Z(Y);X=1,Y=z[Q]}return[K.subarray(0,J),G]},clen=function(z,G){for(var K=0,J=0;J<G.length;++J)K+=z[J]*G[J];return K},wfblk=function(z,G,K){var J=K.length,Y=shft(G+2);z[Y]=J&255,z[Y+1]=J>>>8,z[Y+2]=z[Y]^255,z[Y+3]=z[Y+1]^255;for(var X=0;X<J;++X)z[Y+X+4]=K[X];return(Y+4+J)*8},wblk=function(z,G,K,J,Y,X,Z,Q,ee,te,ne){wbits(G,ne++,K),++Y[256];for(var ie=hTree(Y,15),ae=ie[0],oe=ie[1],se=hTree(X,15),ce=se[0],le=se[1],ue=lc(ae),de=ue[0],fe=ue[1],pe=lc(ce),me=pe[0],he=pe[1],ge=new u16(19),_e=0;_e<de.length;++_e)ge[de[_e]&31]++;for(var _e=0;_e<me.length;++_e)ge[me[_e]&31]++;for(var ve=hTree(ge,7),ye=ve[0],be=ve[1],xe=19;xe>4&&!ye[clim[xe-1]];--xe);var Se=te+5<<3,Ce=clen(Y,flt)+clen(X,fdt)+Z,we=clen(Y,ae)+clen(X,ce)+Z+14+3*xe+clen(ge,ye)+(2*ge[16]+3*ge[17]+7*ge[18]);if(Se<=Ce&&Se<=we)return wfblk(G,ne,z.subarray(ee,ee+te));var Te,Ee,De,Oe;if(wbits(G,ne,1+(we<Ce)),ne+=2,we<Ce){Te=hMap(ae,oe,0),Ee=ae,De=hMap(ce,le,0),Oe=ce;var ke=hMap(ye,be,0);wbits(G,ne,fe-257),wbits(G,ne+5,he-1),wbits(G,ne+10,xe-4),ne+=14;for(var _e=0;_e<xe;++_e)wbits(G,ne+3*_e,ye[clim[_e]]);ne+=3*xe;for(var Ae=[de,me],je=0;je<2;++je)for(var Me=Ae[je],_e=0;_e<Me.length;++_e){var Ne=Me[_e]&31;wbits(G,ne,ke[Ne]),ne+=ye[Ne],Ne>15&&(wbits(G,ne,Me[_e]>>>5&127),ne+=Me[_e]>>>12)}}else Te=flm,Ee=flt,De=fdm,Oe=fdt;for(var _e=0;_e<Q;++_e)if(J[_e]>255){var Ne=J[_e]>>>18&31;wbits16(G,ne,Te[Ne+257]),ne+=Ee[Ne+257],Ne>7&&(wbits(G,ne,J[_e]>>>23&31),ne+=fleb[Ne]);var Pe=J[_e]&31;wbits16(G,ne,De[Pe]),ne+=Oe[Pe],Pe>3&&(wbits16(G,ne,J[_e]>>>5&8191),ne+=fdeb[Pe])}else wbits16(G,ne,Te[J[_e]]),ne+=Ee[J[_e]];return wbits16(G,ne,Te[256]),ne+Ee[256]},deo=new u32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et=new u8(0),dflt=function(z,G,K,J,Y,X){var Z=z.length,Q=new u8(J+Z+5*(1+Math.ceil(Z/7e3))+Y),ee=Q.subarray(J,Q.length-Y),te=0;if(!G||Z<8)for(var ne=0;ne<=Z;ne+=65535){var ie=ne+65535;ie>=Z&&(ee[te>>3]=X),te=wfblk(ee,te+1,z.subarray(ne,ie))}else{for(var ae=deo[G-1],oe=ae>>>13,se=ae&8191,ce=(1<<K)-1,le=new u16(32768),ue=new u16(ce+1),de=Math.ceil(K/3),fe=2*de,pe=function(G){return(z[G]^z[G+1]<<de^z[G+2]<<fe)&ce},me=new u32(25e3),he=new u16(288),ge=new u16(32),_e=0,ve=0,ne=0,ye=0,be=0,xe=0;ne<Z;++ne){var Se=pe(ne),Ce=ne&32767,we=ue[Se];if(le[Ce]=we,ue[Se]=Ce,be<=ne){var Te=Z-ne;if((_e>7e3||ye>24576)&&Te>423){te=wblk(z,ee,0,me,he,ge,ve,ye,xe,ne-xe,te),ye=_e=ve=0,xe=ne;for(var Ee=0;Ee<286;++Ee)he[Ee]=0;for(var Ee=0;Ee<30;++Ee)ge[Ee]=0}var De=2,Oe=0,ke=se,Ae=Ce-we&32767;if(Te>2&&Se==pe(ne-Ae))for(var je=Math.min(oe,Te)-1,Me=Math.min(32767,ne),Ne=Math.min(258,Te);Ae<=Me&&--ke&&Ce!=we;){if(z[ne+De]==z[ne+De-Ae]){for(var Pe=0;Pe<Ne&&z[ne+Pe]==z[ne+Pe-Ae];++Pe);if(Pe>De){if(De=Pe,Oe=Ae,Pe>je)break;for(var Fe=Math.min(Ae,Pe-2),Ie=0,Ee=0;Ee<Fe;++Ee){var Le=ne-Ae+Ee+32768&32767,Re=Le-le[Le]+32768&32767;Re>Ie&&(Ie=Re,we=Le)}}}Ce=we,we=le[Ce],Ae+=Ce-we+32768&32767}if(Oe){me[ye++]=268435456|revfl[De]<<18|revfd[Oe];var ze=revfl[De]&31,Be=revfd[Oe]&31;ve+=fleb[ze]+fdeb[Be],++he[257+ze],++ge[Be],be=ne+De,++_e}else me[ye++]=z[ne],++he[z[ne]]}}te=wblk(z,ee,X,me,he,ge,ve,ye,xe,ne-xe,te),!X&&te&7&&(te=wfblk(ee,te+1,et))}return slc(Q,0,J+shft(te)+Y)},crct=(function(){for(var z=new Int32Array(256),G=0;G<256;++G){for(var K=G,J=9;--J;)K=(K&1&&-306674912)^K>>>1;z[G]=K}return z})(),crc=function(){var z=-1;return{p:function(G){for(var K=z,J=0;J<G.length;++J)K=crct[K&255^G[J]]^K>>>8;z=K},d:function(){return~z}}},dopt=function(z,G,K,J,Y){return dflt(z,G.level==null?6:G.level,G.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(z.length)))*1.5):12+G.mem,K,J,!Y)},wbytes=function(z,G,K){for(;K;++G)z[G]=K,K>>>=8},gzh=function(z,G){var K=G.filename;if(z[0]=31,z[1]=139,z[2]=8,z[8]=G.level<2?4:G.level==9?2:0,z[9]=3,G.mtime!=0&&wbytes(z,4,Math.floor(new Date(G.mtime||Date.now())/1e3)),K){z[3]=8;for(var J=0;J<=K.length;++J)z[J+10]=K.charCodeAt(J)}},gzhl=function(z){return 10+(z.filename&&z.filename.length+1||0)};function gzipSync(z,G){G||(G={});var K=crc(),J=z.length;K.p(z);var Y=dopt(z,G,gzhl(G),8),X=Y.length;return gzh(Y,G),wbytes(Y,X-8,K.d()),wbytes(Y,X-4,J),Y}var td=typeof TextDecoder<`u`&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0})}catch(z){}
18
+ or you can use record.mirror to access the mirror instance during recording.`,Hu={map:{},getId:function(){return console.error(Vu),-1},getNode:function(){return console.error(Vu),null},removeNodeFromMap:function(){console.error(Vu)},has:function(){return console.error(Vu),!1},reset:function(){console.error(Vu)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Hu=new Proxy(Hu,{get:function(e,t,n){return t===`map`&&console.error(Vu),Reflect.get(e,t,n)}}));function Uu(e,t,n){n===void 0&&(n={});var r=null,i=0;return function(a){var o=Date.now();!i&&n.leading===!1&&(i=o);var s=t-(o-i),c=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=o,e.apply(c,l)):!r&&n.trailing!==!1&&(r=setTimeout(function(){i=n.leading===!1?0:Date.now(),r=null,e.apply(c,l)},s))}}function Wu(e,t,n,r,i){i===void 0&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),a&&a.set&&a.set.call(this,e)}}),function(){return Wu(e,t,a||{},!0)}}function Gu(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function Ku(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ju(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if(typeof t==`string`){if(e.closest!==void 0)return e.closest(`.`+t)!==null;n=e.classList.contains(t)}else e.classList.forEach(function(e){t.test(e)&&(n=!0)});return n||Ju(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,Ju(e.parentNode,t)}function Yu(e){return`__sn`in e?e.__sn.id===-2:!1}function Xu(e,t){if(tu(e))return!1;var n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Xu(e.parentNode,t):!0:!0}function Zu(e){return!!e.changedTouches}function Qu(e){e===void 0&&(e=window),`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw TypeError(`1 argument is required`);do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}(function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),a=function(e){n.removeIdSet.add(e);var r=t.getNode(e);r==null||r.childNodes.forEach(function(e){`__sn`in e&&a(e.__sn.id)})},o=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach(function(e){return o(e)});var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),o(i)):(delete this.tree[i.id],this.indexes.delete(i.id),o(i)):(this.removeNodeMutations.push(e),a(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,i=this,a=this,o=a.tree,s=a.removeNodeMutations,c=a.textMutations,l=a.attributeMutations,u={source:Pu.Mutation,removes:s,texts:c,attributes:l,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter(function(e){return!i.removeIdSet.has(e.id)}),u.attributes=u.attributes.concat(t?[]:e.attributes).filter(function(e){return!i.removeIdSet.has(e.id)}),!i.removeIdSet.has(e.id)&&!i.removeIdSet.has(e.mutation.parentId)&&!t?(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach(function(e){return d(e,!1)})):Object.values(e.children).forEach(function(e){return d(e,!0)})};Object.values(o).forEach(function(e){return d(e,!1)});try{for(var f=Ql(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var h=Ql(this.inputMap.keys()),g=h.next();!g.done;g=h.next()){var m=g.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var _=new Map(this.scrollMap),v=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:_,inputMap:v}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e})();function $u(e){return`__sn`in e?e.__sn.type===$l.Element&&e.__sn.tagName===`iframe`:!1}function ed(e){return!!(e!=null&&e.shadowRoot)}function td(e){return`__ln`in e}var nd=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw Error(`Position outside of list range`);for(var t=this.head,n=0;n<e;n++)t=(t==null?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&td(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&td(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),rd=function(e,t){return`${e}@${t}`};function id(e){return`__sn`in e}var ad=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,n,r,i;if(!(e.frozen||e.locked)){for(var a=[],o=new nd,s=function(t){for(var n=t,r=-2;r===-2;)n=n&&n.nextSibling,r=n&&e.mirror.getId(n);return r},c=function(t){for(var n,r,i,c,l,u=t.getRootNode?(n=t.getRootNode())==null?void 0:n.host:null,d=u;(i=(r=d==null?void 0:d.getRootNode)==null?void 0:r.call(d))!=null&&i.host;)d=((l=(c=d==null?void 0:d.getRootNode)==null?void 0:c.call(d))==null?void 0:l.host)||null;var f=!e.doc.contains(t)&&(d===null||!e.doc.contains(d));if(!(!t.parentNode||f)){var p=tu(t.parentNode)?e.mirror.getId(u):e.mirror.getId(t.parentNode),m=s(t);if(p===-1||m===-1)return o.addNode(t);var h=Mu(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){$u(n)&&e.iframeManager.addIframe(n),ed(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});h&&a.push({parentId:p,nextId:m,node:h})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=Ql(e.movedSet),u=l.next();!u.done;u=l.next()){var d=u.value;sd(e.removes,d,e.mirror)&&!e.movedSet.has(d.parentNode)||c(d)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}try{for(var f=Ql(e.addedSet),p=f.next();!p.done;p=f.next()){var d=p.value;!cd(e.droppedSet,d)&&!sd(e.removes,d,e.mirror)||cd(e.movedSet,d)?c(d):e.droppedSet.add(d)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}for(var m=null;o.length;){var h=null;if(m){var g=e.mirror.getId(m.value.parentNode),_=s(m.value);g!==-1&&_!==-1&&(h=m)}if(!h)for(var v=o.length-1;v>=0;v--){var y=o.get(v);if(y){var g=e.mirror.getId(y.value.parentNode),_=s(y.value);if(g!==-1&&_!==-1){h=y;break}}}if(!h){for(;o.head;)o.removeNode(o.head.value);break}m=h.previous,o.removeNode(h.value),c(h.value)}var b={texts:e.texts.map(function(t){return{id:e.mirror.getId(t.node),value:t.value}}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:a};!b.texts.length&&!b.attributes.length&&!b.removes.length&&!b.adds.length||(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(b))}},this.processMutation=function(t){var n,r,i,a;if(!Yu(t.target))switch(t.type){case`characterData`:var o=t.target.textContent;!Ju(t.target,e.blockClass)&&o!==t.oldValue&&e.texts.push({value:Ou(t.target,e.maskTextClass,e.maskTextSelector)&&o?e.maskTextFn?e.maskTextFn(o):o.replace(/[\S]/g,`*`):o,node:t.target});break;case`attributes`:var s=t.target,o=t.target.getAttribute(t.attributeName);if(t.attributeName===`value`&&(o=nu({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute(`type`),value:o,maskInputFn:e.maskInputFn})),Ju(t.target,e.blockClass)||o===t.oldValue)return;var c=e.attributes.find(function(e){return e.node===t.target});if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),t.attributeName===`style`){var l=e.doc.createElement(`span`);t.oldValue&&l.setAttribute(`style`,t.oldValue),(c.attributes.style===void 0||c.attributes.style===null)&&(c.attributes.style={});var u=c.attributes.style;try{for(var d=Ql(Array.from(s.style)),f=d.next();!f.done;f=d.next()){var p=f.value,m=s.style.getPropertyValue(p),h=s.style.getPropertyPriority(p);(m!==l.style.getPropertyValue(p)||h!==l.style.getPropertyPriority(p))&&(h===``?u[p]=m:u[p]=[m,h])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}try{for(var g=Ql(Array.from(l.style)),_=g.next();!_.done;_=g.next()){var p=_.value;s.style.getPropertyValue(p)===``&&(u[p]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=Eu(e.doc,t.target.tagName,t.attributeName,o);break;case`childList`:t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var r=e.mirror.getId(n),i=tu(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);Ju(t.target,e.blockClass)||Yu(n)||(e.addedSet.has(n)?(od(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&r===-1||Xu(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[rd(r,i)]?od(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:tu(t.target)?!0:void 0})),e.mapRemoves.push(n))});break}},this.genAdds=function(t,n){if(!(n&&Ju(n,e.blockClass))){if(id(t)){if(Yu(t))return;e.movedSet.add(t);var r=null;n&&id(n)&&(r=n.__sn.id),r&&(e.movedMap[rd(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);Ju(t,e.blockClass)||t.childNodes.forEach(function(t){return e.genAdds(t)})}}}return e.prototype.init=function(e){var t=this;[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`doc`,`mirror`,`iframeManager`,`shadowDomManager`,`canvasManager`].forEach(function(n){t[n]=e[n]})},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function od(e,t){e.delete(t),t.childNodes.forEach(function(t){return od(e,t)})}function sd(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return e.some(function(e){return e.id===i})?!0:sd(e,r,n)}function cd(e,t){var n=t.parentNode;return n?e.has(n)?!0:cd(e,n):!1}var ld=[],ud=typeof CSSGroupingRule<`u`,dd=typeof CSSMediaRule<`u`,fd=typeof CSSSupportsRule<`u`,pd=typeof CSSConditionRule<`u`;function md(e){try{if(`composedPath`in e){var t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function hd(e,t){var n,r,i=new ad;ld.push(i),i.init(e);var a=window.MutationObserver||window.__rrMutationObserver,o=(r=(n=window==null?void 0:window.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,`MutationObserver`);o&&window[o]&&(a=window[o]);var s=new a(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function gd(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(n.mousemove===!1)return function(){};var a=typeof n.mousemove==`number`?n.mousemove:50,o=typeof n.mousemoveCallback==`number`?n.mousemoveCallback:500,s=[],c,l=Uu(function(e){var n=Date.now()-c;t(s.map(function(e){return e.timeOffset-=n,e}),e),s=[],c=null},o),u=Uu(function(e){var t=md(e),n=Zu(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;c||(c=Date.now()),s.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-c}),l(typeof DragEvent<`u`&&e instanceof DragEvent?Pu.Drag:e instanceof MouseEvent?Pu.MouseMove:Pu.TouchMove)},a,{trailing:!1}),d=[zu(`mousemove`,u,r),zu(`touchmove`,u,r),zu(`drag`,u,r)];return function(){d.forEach(function(e){return e()})}}function _d(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;if(a.mouseInteraction===!1)return function(){};var o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=function(e){return function(n){var a=md(n);if(!Ju(a,i)){var o=Zu(n)?n.changedTouches[0]:n;if(o){var s=r.getId(a),c=o.clientX,l=o.clientY;t({type:Fu[e],id:s,x:c,y:l})}}}};return Object.keys(Fu).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1}).forEach(function(e){var t=e.toLowerCase(),r=c(e);s.push(zu(t,r,n))}),function(){s.forEach(function(e){return e()})}}function vd(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;return zu(`scroll`,Uu(function(e){var a=md(e);if(!(!a||Ju(a,i))){var o=r.getId(a);if(a===n){var s=n.scrollingElement||n.documentElement;t({id:o,x:s.scrollLeft,y:s.scrollTop})}else t({id:o,x:a.scrollLeft,y:a.scrollTop})}},a.scroll||100),n)}function yd(e){var t=e.viewportResizeCb,n=-1,r=-1;return zu(`resize`,Uu(function(){var e=Ku(),i=qu();(n!==e||r!==i)&&(t({width:Number(i),height:Number(e)}),n=e,r=i)},200),window)}function bd(e,t){var n=W({},e);return t||delete n.userTriggered,n}var xd=[`INPUT`,`TEXTAREA`,`SELECT`],Sd=new WeakMap;function Cd(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.ignoreClass,o=e.maskInputOptions,s=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function u(e){var t=md(e),r=e.isTrusted;if(t&&t.tagName===`OPTION`&&(t=t.parentElement),!(!t||!t.tagName||xd.indexOf(t.tagName)<0||Ju(t,i))){var c=t.type;if(!t.classList.contains(a)){var u=t.value,f=!1;c===`radio`||c===`checkbox`?f=t.checked:(o[t.tagName.toLowerCase()]||o[c])&&(u=nu({maskInputOptions:o,tagName:t.tagName,type:c,value:u,maskInputFn:s})),d(t,bd({text:u,isChecked:f,userTriggered:r},l));var p=t.name;c===`radio`&&p&&f&&n.querySelectorAll(`input[type="radio"][name="${p}"]`).forEach(function(e){e!==t&&d(e,bd({text:e.value,isChecked:!f,userTriggered:!1},l))})}}}function d(e,n){var i=Sd.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Sd.set(e,n);var a=r.getId(e);t(W(W({},n),{id:a}))}}var f=(c.input===`last`?[`change`]:[`input`,`change`]).map(function(e){return zu(e,u,n)}),p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`),m=[[HTMLInputElement.prototype,`value`],[HTMLInputElement.prototype,`checked`],[HTMLSelectElement.prototype,`value`],[HTMLTextAreaElement.prototype,`value`],[HTMLSelectElement.prototype,`selectedIndex`],[HTMLOptionElement.prototype,`selected`]];return p&&p.set&&f.push.apply(f,K([],G(m.map(function(e){return Wu(e[0],e[1],{set:function(){u({target:this})}})})),!1)),function(){f.forEach(function(e){return e()})}}function wd(e){var t=[];function n(e,t){if(ud&&e.parentRule instanceof CSSGroupingRule||dd&&e.parentRule instanceof CSSMediaRule||fd&&e.parentRule instanceof CSSSupportsRule||pd&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules),r=n.indexOf(e);t.unshift(r)}else{var n=Array.from(e.parentStyleSheet.cssRules),r=n.indexOf(e);t.unshift(r)}return t}return n(e,t)}function Td(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=t.win,a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(e,t){var i=r.getId(this.ownerNode);return i!==-1&&n({id:i,adds:[{rule:e,index:t}]}),a.apply(this,arguments)};var o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(e){var t=r.getId(this.ownerNode);return t!==-1&&n({id:t,removes:[{index:e}]}),o.apply(this,arguments)};var s={};ud?s.CSSGroupingRule=i.CSSGroupingRule:(dd&&(s.CSSMediaRule=i.CSSMediaRule),pd&&(s.CSSConditionRule=i.CSSConditionRule),fd&&(s.CSSSupportsRule=i.CSSSupportsRule));var c={};return Object.entries(s).forEach(function(e){var t=G(e,2),i=t[0],a=t[1];c[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(e,t){var a=r.getId(this.parentStyleSheet.ownerNode);return a!==-1&&n({id:a,adds:[{rule:e,index:K(K([],G(wd(this)),!1),[t||0],!1)}]}),c[i].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(e){var t=r.getId(this.parentStyleSheet.ownerNode);return t!==-1&&n({id:t,removes:[{index:K(K([],G(wd(this)),!1),[e],!1)}]}),c[i].deleteRule.apply(this,arguments)}}),function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(function(e){var t=G(e,2),n=t[0],r=t[1];r.prototype.insertRule=c[n].insertRule,r.prototype.deleteRule=c[n].deleteRule})}}function Ed(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var o,s,c=r.getId((s=(o=this.parentRule)==null?void 0:o.parentStyleSheet)==null?void 0:s.ownerNode);return c!==-1&&n({id:c,set:{property:e,value:t,priority:i},index:wd(this.parentRule)}),a.apply(this,arguments)};var o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,a=r.getId((i=(t=this.parentRule)==null?void 0:t.parentStyleSheet)==null?void 0:i.ownerNode);return a!==-1&&n({id:a,remove:{property:e},index:wd(this.parentRule)}),o.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o}}function Dd(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,a=function(e){return Uu(function(i){var a=md(i);if(!(!a||Ju(a,n))){var o=a,s=o.currentTime,c=o.volume,l=o.muted;t({type:e,id:r.getId(a),currentTime:s,volume:c,muted:l})}},i.media||500)},o=[zu(`play`,a(0)),zu(`pause`,a(1)),zu(`seeked`,a(2)),zu(`volumechange`,a(3))];return function(){o.forEach(function(e){return e()})}}function Od(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],a=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,n){var r=new o(e,t,n);return a.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=Gu(n.fonts,`add`,function(e){return function(n){return setTimeout(function(){var e=a.get(n);e&&(t(e),a.delete(n))},0),e.apply(this,[n])}});return i.push(function(){r.FontFace=o}),i.push(s),function(){i.forEach(function(e){return e()})}}function kd(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb;e.mutationCb=function(){var e=[...arguments];t.mutation&&t.mutation.apply(t,K([],G(e),!1)),n.apply(void 0,K([],G(e),!1))},e.mousemoveCb=function(){var e=[...arguments];t.mousemove&&t.mousemove.apply(t,K([],G(e),!1)),r.apply(void 0,K([],G(e),!1))},e.mouseInteractionCb=function(){var e=[...arguments];t.mouseInteraction&&t.mouseInteraction.apply(t,K([],G(e),!1)),i.apply(void 0,K([],G(e),!1))},e.scrollCb=function(){var e=[...arguments];t.scroll&&t.scroll.apply(t,K([],G(e),!1)),a.apply(void 0,K([],G(e),!1))},e.viewportResizeCb=function(){var e=[...arguments];t.viewportResize&&t.viewportResize.apply(t,K([],G(e),!1)),o.apply(void 0,K([],G(e),!1))},e.inputCb=function(){var e=[...arguments];t.input&&t.input.apply(t,K([],G(e),!1)),s.apply(void 0,K([],G(e),!1))},e.mediaInteractionCb=function(){var e=[...arguments];t.mediaInteaction&&t.mediaInteaction.apply(t,K([],G(e),!1)),c.apply(void 0,K([],G(e),!1))},e.styleSheetRuleCb=function(){var e=[...arguments];t.styleSheetRule&&t.styleSheetRule.apply(t,K([],G(e),!1)),l.apply(void 0,K([],G(e),!1))},e.styleDeclarationCb=function(){var e=[...arguments];t.styleDeclaration&&t.styleDeclaration.apply(t,K([],G(e),!1)),u.apply(void 0,K([],G(e),!1))},e.canvasMutationCb=function(){var e=[...arguments];t.canvasMutation&&t.canvasMutation.apply(t,K([],G(e),!1)),d.apply(void 0,K([],G(e),!1))},e.fontCb=function(){var e=[...arguments];t.font&&t.font.apply(t,K([],G(e),!1)),f.apply(void 0,K([],G(e),!1))}}function Ad(e,t){var n,r;t===void 0&&(t={});var i=e.doc.defaultView;if(!i)return function(){};kd(e,t);var a=hd(e,e.doc),o=gd(e),s=_d(e),c=vd(e),l=yd(e),u=Cd(e),d=Dd(e),f=Td(e,{win:i}),p=Ed(e,{win:i}),m=e.collectFonts?Od(e):function(){},h=[];try{for(var g=Ql(e.plugins),_=g.next();!_.done;_=g.next()){var v=_.value;h.push(v.observer(v.callback,i,v.options))}}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return function(){ld.forEach(function(e){return e.reset()}),a.disconnect(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h.forEach(function(e){return e()})}}var jd=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)==null||n.call(this,e)},e}(),Md=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(Gu(HTMLElement.prototype,`attachShadow`,function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}}))}return e.prototype.addShadowRoot=function(e,t){hd(W(W({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),vd(W(W({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(Gu(e.contentWindow.HTMLElement.prototype,`attachShadow`,function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}},e.prototype.reset=function(){this.restorePatches.forEach(function(e){return e()})},e}();function Nd(e,t,n,r){var i,a,o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),c=function(r){try{if(typeof t.CanvasRenderingContext2D.prototype[r]!=`function`)return`continue`;var i=Gu(t.CanvasRenderingContext2D.prototype,r,function(t){return function(){for(var i=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return Ju(this.canvas,n)||setTimeout(function(){var t=K([],G(a),!1);if(r===`drawImage`&&t[0]&&t[0]instanceof HTMLCanvasElement){var n=t[0],o=n.getContext(`2d`),s=o==null?void 0:o.getImageData(0,0,n.width,n.height),c=s==null?void 0:s.data;t[0]=JSON.stringify(c)}e(i.canvas,{type:Iu[`2D`],property:r,args:t})},0),t.apply(this,a)}});o.push(i)}catch(n){var a=Wu(t.CanvasRenderingContext2D.prototype,r,{set:function(t){e(this.canvas,{type:Iu[`2D`],property:r,args:[t],setter:!0})}});o.push(a)}};try{for(var l=Ql(s),u=l.next();!u.done;u=l.next()){var d=u.value;c(d)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return function(){o.forEach(function(e){return e()})}}function Pd(e,t){var n=[];try{var r=Gu(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(n){var r=[...arguments].slice(1);return Ju(this,t)||`__context`in this||(this.__context=n),e.apply(this,K([n],G(r),!1))}});n.push(r)}catch(e){console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return function(){n.forEach(function(e){return e()})}}for(var Fd=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Id=typeof Uint8Array>`u`?[]:new Uint8Array(256),Ld=0;Ld<Fd.length;Ld++)Id[Fd.charCodeAt(Ld)]=Ld;var Rd=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Fd[t[n]>>2],i+=Fd[(t[n]&3)<<4|t[n+1]>>4],i+=Fd[(t[n+1]&15)<<2|t[n+2]>>6],i+=Fd[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},zd=new Map;function Bd(e,t){var n=zd.get(e);return n||(n=new Map,zd.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Vd=function(e,t,n){if(!(!e||!(Wd(e,t)||typeof e==`object`))){var r=e.constructor.name,i=Bd(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a}};function Hd(e,t,n){return e instanceof Array?e.map(function(e){return Hd(e,t,n)}):e===null?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:Rd(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Hd(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Hd(e.data,t,n),e.width,e.height]}:Wd(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:Vd(e,t,n)}:e}var Ud=function(e,t,n){return K([],G(e),!1).map(function(e){return Hd(e,t,n)})},Wd=function(e,t){return!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(function(e){return typeof t[e]==`function`}).find(function(n){return e instanceof t[n]})};function Gd(e,t,n,r,i,a){var o,s,c=[],l=Object.getOwnPropertyNames(e),u=function(o){try{if(typeof e[o]!=`function`)return`continue`;var s=Gu(e,o,function(s){return function(){var c=[...arguments],l=s.apply(this,c);if(Vd(l,a,e),!Ju(this.canvas,r)){i.getId(this.canvas);var u={type:t,property:o,args:Ud(K([],G(c),!1),a,e)};n(this.canvas,u)}return l}});c.push(s)}catch(r){var l=Wu(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(l)}};try{for(var d=Ql(l),f=d.next();!f.done;f=d.next()){var p=f.value;u(p)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}return c}function Kd(e,t,n,r){var i=[];return i.push.apply(i,K([],G(Gd(t.WebGLRenderingContext.prototype,Iu.WebGL,e,n,r,t)),!1)),t.WebGL2RenderingContext!==void 0&&i.push.apply(i,K([],G(Gd(t.WebGL2RenderingContext.prototype,Iu.WebGL2,e,n,r,t)),!1)),function(){i.forEach(function(e){return e()})}}var qd=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,e.recordCanvas===!0&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Pd(e,t),r=Nd(this.processMutation.bind(this),e,t,this.mirror),i=Kd(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){n(),r(),i()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!(this.frozen||this.locked)){var n=this.pendingCanvasMutations.get(e);if(!(!n||t===-1)){var r=n.map(function(e){return e.type,Zl(e,[`type`])}),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Jd(e){return W(W({},e),{timestamp:Date.now()})}var Yd,Xd,Zd=Bu();function Qd(e){e===void 0&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,a=i===void 0?`rr-block`:i,o=e.blockSelector,s=o===void 0?null:o,c=e.ignoreClass,l=c===void 0?`rr-ignore`:c,u=e.maskTextClass,d=u===void 0?`rr-mask`:u,f=e.maskTextSelector,p=f===void 0?null:f,m=e.inlineStylesheet,h=m===void 0?!0:m,g=e.maskAllInputs,_=e.maskInputOptions,v=e.slimDOMOptions,y=e.maskInputFn,b=e.maskTextFn,x=e.hooks,S=e.packFn,C=e.sampling,w=C===void 0?{}:C,ee=e.mousemoveWait,T=e.recordCanvas,E=T===void 0?!1:T,D=e.userTriggeredOnInput,te=D===void 0?!1:D,O=e.collectFonts,k=O===void 0?!1:O,A=e.inlineImages,j=A===void 0?!1:A,ne=e.plugins,re=e.keepIframeSrcFn,ie=re===void 0?function(){return!1}:re;if(!t)throw Error(`emit function is required`);ee!==void 0&&w.mousemove===void 0&&(w.mousemove=ee);var M=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:_===void 0?{password:!0}:_,ae=v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:v===`all`,headMetaDescKeywords:v===`all`}:v||{};Qu();var N,P=0,F=function(e){var t,n;try{for(var r=Ql(ne||[]),i=r.next();!i.done;i=r.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return S&&(e=S(e)),e};Yd=function(e,i){var a;if((a=ld[0])!=null&&a.isFrozen()&&e.type!==J.FullSnapshot&&!(e.type===J.IncrementalSnapshot&&e.data.source===Pu.Mutation)&&ld.forEach(function(e){return e.unfreeze()}),t(F(e),i),e.type===J.FullSnapshot)N=e,P=0;else if(e.type===J.IncrementalSnapshot){if(e.data.source===Pu.Mutation&&e.data.isAttachIframe)return;P++;var o=r&&P>=r,s=n&&e.timestamp-N.timestamp>n;(o||s)&&Xd(!0)}};var oe=function(e){Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Mutation},e)}))},se=function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Scroll},e)}))},ce=function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.CanvasMutation},e)}))},le=new jd({mutationCb:oe}),ue=new qd({recordCanvas:E,mutationCb:ce,win:window,blockClass:a,mirror:Zd}),de=new Md({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskInputOptions:M,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:j,sampling:w,slimDOMOptions:ae,iframeManager:le,canvasManager:ue},mirror:Zd});Xd=function(e){var t,n,r,i;e===void 0&&(e=!1),Yd(Jd({type:J.Meta,data:{href:window.location.href,width:qu(),height:Ku()}}),e),ld.forEach(function(e){return e.lock()});var o=G(Nu(document,{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskAllInputs:M,maskTextFn:b,slimDOM:ae,recordCanvas:E,inlineImages:j,onSerialize:function(e){$u(e)&&le.addIframe(e),ed(e)&&de.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){le.attachIframe(e,t),de.observeAttachShadow(e)},keepIframeSrcFn:ie}),2),c=o[0],l=o[1];if(!c)return console.warn(`Failed to snapshot the document`);Zd.map=l,Yd(Jd({type:J.FullSnapshot,data:{node:c,initialOffset:{left:window.pageXOffset===void 0?(document==null?void 0:document.documentElement.scrollLeft)||((n=(t=document==null?void 0:document.body)==null?void 0:t.parentElement)==null?void 0:n.scrollLeft)||(document==null?void 0:document.body.scrollLeft)||0:window.pageXOffset,top:window.pageYOffset===void 0?(document==null?void 0:document.documentElement.scrollTop)||((i=(r=document==null?void 0:document.body)==null?void 0:r.parentElement)==null?void 0:i.scrollTop)||(document==null?void 0:document.body.scrollTop)||0:window.pageYOffset}}})),ld.forEach(function(e){return e.unlock()})};try{var fe=[];fe.push(zu(`DOMContentLoaded`,function(){Yd(Jd({type:J.DomContentLoaded,data:{}}))}));var pe=function(e){var t;return Ad({mutationCb:oe,mousemoveCb:function(e,t){return Yd(Jd({type:J.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.MouseInteraction},e)}))},scrollCb:se,viewportResizeCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.ViewportResize},e)}))},inputCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Input},e)}))},mediaInteractionCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.StyleDeclaration},e)}))},canvasMutationCb:ce,fontCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Font},e)}))},blockClass:a,ignoreClass:l,maskTextClass:d,maskTextSelector:p,maskInputOptions:M,inlineStylesheet:h,sampling:w,recordCanvas:E,inlineImages:j,userTriggeredOnInput:te,collectFonts:k,doc:e,maskInputFn:y,maskTextFn:b,blockSelector:s,slimDOMOptions:ae,mirror:Zd,iframeManager:le,shadowDomManager:de,canvasManager:ue,plugins:((t=ne==null?void 0:ne.filter(function(e){return e.observer}))==null?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return Yd(Jd({type:J.Plugin,data:{plugin:e.name,payload:t}}))}}}))||[]},x)};le.addLoadListener(function(e){fe.push(pe(e.contentDocument))});var me=function(){Xd(),fe.push(pe(document))};return document.readyState===`interactive`||document.readyState===`complete`?me():fe.push(zu(`load`,function(){Yd(Jd({type:J.Load,data:{}})),me()},window)),function(){fe.forEach(function(e){return e()})}}catch(e){console.warn(e)}}Qd.addCustomEvent=function(e,t){if(!Yd)throw Error(`please add custom event after start recording`);Yd(Jd({type:J.Custom,data:{tag:e,payload:t}}))},Qd.freezePage=function(){ld.forEach(function(e){return e.freeze()})},Qd.takeFullSnapshot=function(e){if(!Xd)throw Error(`please take full snapshot after start recording`);Xd(e)},Qd.mirror=Zd;var $d=Uint8Array,ef=Uint16Array,tf=Uint32Array,nf=new $d([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),rf=new $d([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),af=new $d([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),of=function(e,t){for(var n=new ef(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new tf(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},sf=of(nf,2),cf=sf[0],lf=sf[1];cf[28]=258,lf[258]=28;var uf=of(rf,0);uf[0];for(var df=uf[1],ff=new ef(32768),Y=0;Y<32768;++Y){var pf=(Y&43690)>>>1|(Y&21845)<<1;pf=(pf&52428)>>>2|(pf&13107)<<2,pf=(pf&61680)>>>4|(pf&3855)<<4,ff[Y]=((pf&65280)>>>8|(pf&255)<<8)>>>1}for(var mf=(function(e,t,n){for(var r=e.length,i=0,a=new ef(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new ef(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new ef(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[ff[d]>>>c]=l}else for(s=new ef(r),i=0;i<r;++i)e[i]&&(s[i]=ff[o[e[i]-1]++]>>>15-e[i]);return s}),hf=new $d(288),Y=0;Y<144;++Y)hf[Y]=8;for(var Y=144;Y<256;++Y)hf[Y]=9;for(var Y=256;Y<280;++Y)hf[Y]=7;for(var Y=280;Y<288;++Y)hf[Y]=8;for(var gf=new $d(32),Y=0;Y<32;++Y)gf[Y]=5;var _f=mf(hf,9,0),vf=mf(gf,5,0),yf=function(e){return(e+7)/8|0},bf=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?ef:e.BYTES_PER_ELEMENT==4?tf:$d)(n-t);return r.set(e.subarray(t,n)),r},xf=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Sf=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cf=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[Af,0];if(i==1){var o=new $d(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new ef(f+1),m=wf(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new $d(p),m]},wf=function(e,t,n){return e.s==-1?Math.max(wf(e.l,t,n+1),wf(e.r,t,n+1)):t[e.s]=n},Tf=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ef(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Ef=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Df=function(e,t,n){var r=n.length,i=yf(t+2);e[i]=r&255,e[i+1]=r>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},Of=function(e,t,n,r,i,a,o,s,c,l,u){xf(t,u++,n),++i[256];for(var d=Cf(i,15),f=d[0],p=d[1],m=Cf(a,15),h=m[0],g=m[1],_=Tf(f),v=_[0],y=_[1],b=Tf(h),x=b[0],S=b[1],C=new ef(19),w=0;w<v.length;++w)C[v[w]&31]++;for(var w=0;w<x.length;++w)C[x[w]&31]++;for(var ee=Cf(C,7),T=ee[0],E=ee[1],D=19;D>4&&!T[af[D-1]];--D);var te=l+5<<3,O=Ef(i,hf)+Ef(a,gf)+o,k=Ef(i,f)+Ef(a,h)+o+14+3*D+Ef(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(te<=O&&te<=k)return Df(t,u,e.subarray(c,c+l));var A,j,ne,re;if(xf(t,u,1+(k<O)),u+=2,k<O){A=mf(f,p,0),j=f,ne=mf(h,g,0),re=h;var ie=mf(T,E,0);xf(t,u,y-257),xf(t,u+5,S-1),xf(t,u+10,D-4),u+=14;for(var w=0;w<D;++w)xf(t,u+3*w,T[af[w]]);u+=3*D;for(var M=[v,x],ae=0;ae<2;++ae)for(var N=M[ae],w=0;w<N.length;++w){var P=N[w]&31;xf(t,u,ie[P]),u+=T[P],P>15&&(xf(t,u,N[w]>>>5&127),u+=N[w]>>>12)}}else A=_f,j=hf,ne=vf,re=gf;for(var w=0;w<s;++w)if(r[w]>255){var P=r[w]>>>18&31;Sf(t,u,A[P+257]),u+=j[P+257],P>7&&(xf(t,u,r[w]>>>23&31),u+=nf[P]);var F=r[w]&31;Sf(t,u,ne[F]),u+=re[F],F>3&&(Sf(t,u,r[w]>>>5&8191),u+=rf[F])}else Sf(t,u,A[r[w]]),u+=j[r[w]];return Sf(t,u,A[256]),u+j[256]},kf=new tf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Af=new $d(0),jf=function(e,t,n,r,i,a){var o=e.length,s=new $d(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d>=o&&(c[l>>3]=a),l=Df(c,l+1,e.subarray(u,d))}else{for(var f=kf[t-1],p=f>>>13,m=f&8191,h=(1<<n)-1,g=new ef(32768),_=new ef(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new tf(25e3),S=new ef(288),C=new ef(32),w=0,ee=0,u=0,T=0,E=0,D=0;u<o;++u){var te=b(u),O=u&32767,k=_[te];if(g[O]=k,_[te]=O,E<=u){var A=o-u;if((w>7e3||T>24576)&&A>423){l=Of(e,c,0,x,S,C,ee,T,D,u-D,l),T=w=ee=0,D=u;for(var j=0;j<286;++j)S[j]=0;for(var j=0;j<30;++j)C[j]=0}var ne=2,re=0,ie=m,M=O-k&32767;if(A>2&&te==b(u-M))for(var ae=Math.min(p,A)-1,N=Math.min(32767,u),P=Math.min(258,A);M<=N&&--ie&&O!=k;){if(e[u+ne]==e[u+ne-M]){for(var F=0;F<P&&e[u+F]==e[u+F-M];++F);if(F>ne){if(ne=F,re=M,F>ae)break;for(var oe=Math.min(M,F-2),se=0,j=0;j<oe;++j){var ce=u-M+j+32768&32767,le=ce-g[ce]+32768&32767;le>se&&(se=le,k=ce)}}}O=k,k=g[O],M+=O-k+32768&32767}if(re){x[T++]=268435456|lf[ne]<<18|df[re];var ue=lf[ne]&31,de=df[re]&31;ee+=nf[ue]+rf[de],++S[257+ue],++C[de],E=u+ne,++w}else x[T++]=e[u],++S[e[u]]}}l=Of(e,c,a,x,S,C,ee,T,D,u-D,l),!a&&l&7&&(l=Df(c,l+1,Af))}return bf(s,0,r+yf(l)+i)},Mf=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Nf=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Mf[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Pf=function(e,t,n,r,i){return jf(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)},Ff=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},If=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Ff(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Lf=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Rf(e,t){t||(t={});var n=Nf(),r=e.length;n.p(e);var i=Pf(e,t,Lf(t),8),a=i.length;return If(i,t),Ff(i,a-8,n.d()),Ff(i,a-4,r),i}var zf=typeof TextDecoder<`u`&&new TextDecoder;try{zf.decode(Af,{stream:!0})}catch(e){}
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2009 The Closure Library Authors
@@ -35,5 +35,25 @@ or you can use record.mirror to access the mirror instance during recording.`,_m
35
35
  *
36
36
  * SPDX-License-Identifier: Apache-2.0
37
37
  */
38
- var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(z){}function Long(z,G,K){this.low=z|0,this.high=G|0,this.unsigned=!!K}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,`__isLong__`,{value:!0});function isLong(z){return(z&&z.__isLong__)===!0}function ctz32(z){var G=Math.clz32(z&-z);return z?31-G:G}Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(z,G){var K,J,Y;return G?(z>>>=0,(Y=0<=z&&z<256)&&(J=UINT_CACHE[z],J)?J:(K=fromBits(z,0,!0),Y&&(UINT_CACHE[z]=K),K)):(z|=0,(Y=-128<=z&&z<128)&&(J=INT_CACHE[z],J)?J:(K=fromBits(z,z<0?-1:0,!1),Y&&(INT_CACHE[z]=K),K))}Long.fromInt=fromInt;function fromNumber(z,G){if(isNaN(z))return G?UZERO:ZERO;if(G){if(z<0)return UZERO;if(z>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(z<=-TWO_PWR_63_DBL)return MIN_VALUE;if(z+1>=TWO_PWR_63_DBL)return MAX_VALUE}return z<0?fromNumber(-z,G).neg():fromBits(z%TWO_PWR_32_DBL|0,z/TWO_PWR_32_DBL|0,G)}Long.fromNumber=fromNumber;function fromBits(z,G,K){return new Long(z,G,K)}Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(z,G,K){if(z.length===0)throw Error(`empty string`);if(typeof G==`number`?(K=G,G=!1):G=!!G,z===`NaN`||z===`Infinity`||z===`+Infinity`||z===`-Infinity`)return G?UZERO:ZERO;if(K=K||10,K<2||36<K)throw RangeError(`radix`);var J;if((J=z.indexOf(`-`))>0)throw Error(`interior hyphen`);if(J===0)return fromString(z.substring(1),G,K).neg();for(var Y=fromNumber(pow_dbl(K,8)),X=ZERO,Z=0;Z<z.length;Z+=8){var Q=Math.min(8,z.length-Z),ee=parseInt(z.substring(Z,Z+Q),K);if(Q<8){var te=fromNumber(pow_dbl(K,Q));X=X.mul(te).add(fromNumber(ee))}else X=X.mul(Y),X=X.add(fromNumber(ee))}return X.unsigned=G,X}Long.fromString=fromString;function fromValue(z,G){return typeof z==`number`?fromNumber(z,G):typeof z==`string`?fromString(z,G):fromBits(z.low,z.high,typeof G==`boolean`?G:z.unsigned)}Long.fromValue=fromValue;var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0);Long.ZERO=ZERO;var UZERO=fromInt(0,!0);Long.UZERO=UZERO;var ONE=fromInt(1);Long.ONE=ONE;var UONE=fromInt(1,!0);Long.UONE=UONE;var NEG_ONE=fromInt(-1);Long.NEG_ONE=NEG_ONE;var MAX_VALUE=fromBits(-1,2147483647,!1);Long.MAX_VALUE=MAX_VALUE;var MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=MAX_UNSIGNED_VALUE;var MIN_VALUE=fromBits(0,-2147483648,!1);Long.MIN_VALUE=MIN_VALUE;var LongPrototype=Long.prototype;LongPrototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},LongPrototype.toNumber=function(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL+(this.low>>>0):this.high*TWO_PWR_32_DBL+(this.low>>>0)},LongPrototype.toString=function(z){if(z=z||10,z<2||36<z)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(MIN_VALUE)){var G=fromNumber(z),K=this.div(G),J=K.mul(G).sub(this);return K.toString(z)+J.toInt().toString(z)}else return`-`+this.neg().toString(z);for(var Y=fromNumber(pow_dbl(z,6),this.unsigned),X=this,Z=``;;){var Q=X.div(Y),ee=(X.sub(Q.mul(Y)).toInt()>>>0).toString(z);if(X=Q,X.isZero())return ee+Z;for(;ee.length<6;)ee=`0`+ee;Z=``+ee+Z}},LongPrototype.getHighBits=function(){return this.high},LongPrototype.getHighBitsUnsigned=function(){return this.high>>>0},LongPrototype.getLowBits=function(){return this.low},LongPrototype.getLowBitsUnsigned=function(){return this.low>>>0},LongPrototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var z=this.high==0?this.low:this.high,G=31;G>0&&!(z&1<<G);G--);return this.high==0?G+1:G+33},LongPrototype.isSafeInteger=function(){var z=this.high>>21;return z?this.unsigned?!1:z===-1&&!(this.low===0&&this.high===-2097152):!0},LongPrototype.isZero=function(){return this.high===0&&this.low===0},LongPrototype.eqz=LongPrototype.isZero,LongPrototype.isNegative=function(){return!this.unsigned&&this.high<0},LongPrototype.isPositive=function(){return this.unsigned||this.high>=0},LongPrototype.isOdd=function(){return(this.low&1)==1},LongPrototype.isEven=function(){return(this.low&1)==0},LongPrototype.equals=function(z){return isLong(z)||(z=fromValue(z)),this.unsigned!==z.unsigned&&this.high>>>31==1&&z.high>>>31==1?!1:this.high===z.high&&this.low===z.low},LongPrototype.eq=LongPrototype.equals,LongPrototype.notEquals=function(z){return!this.eq(z)},LongPrototype.neq=LongPrototype.notEquals,LongPrototype.ne=LongPrototype.notEquals,LongPrototype.lessThan=function(z){return this.comp(z)<0},LongPrototype.lt=LongPrototype.lessThan,LongPrototype.lessThanOrEqual=function(z){return this.comp(z)<=0},LongPrototype.lte=LongPrototype.lessThanOrEqual,LongPrototype.le=LongPrototype.lessThanOrEqual,LongPrototype.greaterThan=function(z){return this.comp(z)>0},LongPrototype.gt=LongPrototype.greaterThan,LongPrototype.greaterThanOrEqual=function(z){return this.comp(z)>=0},LongPrototype.gte=LongPrototype.greaterThanOrEqual,LongPrototype.ge=LongPrototype.greaterThanOrEqual,LongPrototype.compare=function(z){if(isLong(z)||(z=fromValue(z)),this.eq(z))return 0;var G=this.isNegative(),K=z.isNegative();return G&&!K?-1:!G&&K?1:this.unsigned?z.high>>>0>this.high>>>0||z.high===this.high&&z.low>>>0>this.low>>>0?-1:1:this.sub(z).isNegative()?-1:1},LongPrototype.comp=LongPrototype.compare,LongPrototype.negate=function(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)},LongPrototype.neg=LongPrototype.negate,LongPrototype.add=function(z){isLong(z)||(z=fromValue(z));var G=this.high>>>16,K=this.high&65535,J=this.low>>>16,Y=this.low&65535,X=z.high>>>16,Z=z.high&65535,Q=z.low>>>16,ee=z.low&65535,te=0,ne=0,ie=0,ae=0;return ae+=Y+ee,ie+=ae>>>16,ae&=65535,ie+=J+Q,ne+=ie>>>16,ie&=65535,ne+=K+Z,te+=ne>>>16,ne&=65535,te+=G+X,te&=65535,fromBits(ie<<16|ae,te<<16|ne,this.unsigned)},LongPrototype.subtract=function(z){return isLong(z)||(z=fromValue(z)),this.add(z.neg())},LongPrototype.sub=LongPrototype.subtract,LongPrototype.multiply=function(z){if(this.isZero())return this;if(isLong(z)||(z=fromValue(z)),wasm)return fromBits(wasm.mul(this.low,this.high,z.low,z.high),wasm.get_high(),this.unsigned);if(z.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return z.isOdd()?MIN_VALUE:ZERO;if(z.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return z.isNegative()?this.neg().mul(z.neg()):this.neg().mul(z).neg();if(z.isNegative())return this.mul(z.neg()).neg();if(this.lt(TWO_PWR_24)&&z.lt(TWO_PWR_24))return fromNumber(this.toNumber()*z.toNumber(),this.unsigned);var G=this.high>>>16,K=this.high&65535,J=this.low>>>16,Y=this.low&65535,X=z.high>>>16,Z=z.high&65535,Q=z.low>>>16,ee=z.low&65535,te=0,ne=0,ie=0,ae=0;return ae+=Y*ee,ie+=ae>>>16,ae&=65535,ie+=J*ee,ne+=ie>>>16,ie&=65535,ie+=Y*Q,ne+=ie>>>16,ie&=65535,ne+=K*ee,te+=ne>>>16,ne&=65535,ne+=J*Q,te+=ne>>>16,ne&=65535,ne+=Y*Z,te+=ne>>>16,ne&=65535,te+=G*ee+K*Q+J*Z+Y*X,te&=65535,fromBits(ie<<16|ae,te<<16|ne,this.unsigned)},LongPrototype.mul=LongPrototype.multiply,LongPrototype.divide=function(z){if(isLong(z)||(z=fromValue(z)),z.isZero())throw Error(`division by zero`);if(wasm)return!this.unsigned&&this.high===-2147483648&&z.low===-1&&z.high===-1?this:fromBits((this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,z.low,z.high),wasm.get_high(),this.unsigned);if(this.isZero())return this.unsigned?UZERO:ZERO;var G,K,J;if(this.unsigned){if(z.unsigned||(z=z.toUnsigned()),z.gt(this))return UZERO;if(z.gt(this.shru(1)))return UONE;J=UZERO}else{if(this.eq(MIN_VALUE))return z.eq(ONE)||z.eq(NEG_ONE)?MIN_VALUE:z.eq(MIN_VALUE)?ONE:(G=this.shr(1).div(z).shl(1),G.eq(ZERO)?z.isNegative()?ONE:NEG_ONE:(K=this.sub(z.mul(G)),J=G.add(K.div(z)),J));if(z.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return z.isNegative()?this.neg().div(z.neg()):this.neg().div(z).neg();if(z.isNegative())return this.div(z.neg()).neg();J=ZERO}for(K=this;K.gte(z);){G=Math.max(1,Math.floor(K.toNumber()/z.toNumber()));for(var Y=Math.ceil(Math.log(G)/Math.LN2),X=Y<=48?1:pow_dbl(2,Y-48),Z=fromNumber(G),Q=Z.mul(z);Q.isNegative()||Q.gt(K);)G-=X,Z=fromNumber(G,this.unsigned),Q=Z.mul(z);Z.isZero()&&(Z=ONE),J=J.add(Z),K=K.sub(Q)}return J},LongPrototype.div=LongPrototype.divide,LongPrototype.modulo=function(z){return isLong(z)||(z=fromValue(z)),wasm?fromBits((this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,z.low,z.high),wasm.get_high(),this.unsigned):this.sub(this.div(z).mul(z))},LongPrototype.mod=LongPrototype.modulo,LongPrototype.rem=LongPrototype.modulo,LongPrototype.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},LongPrototype.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},LongPrototype.clz=LongPrototype.countLeadingZeros,LongPrototype.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},LongPrototype.ctz=LongPrototype.countTrailingZeros,LongPrototype.and=function(z){return isLong(z)||(z=fromValue(z)),fromBits(this.low&z.low,this.high&z.high,this.unsigned)},LongPrototype.or=function(z){return isLong(z)||(z=fromValue(z)),fromBits(this.low|z.low,this.high|z.high,this.unsigned)},LongPrototype.xor=function(z){return isLong(z)||(z=fromValue(z)),fromBits(this.low^z.low,this.high^z.high,this.unsigned)},LongPrototype.shiftLeft=function(z){return isLong(z)&&(z=z.toInt()),(z&=63)==0?this:z<32?fromBits(this.low<<z,this.high<<z|this.low>>>32-z,this.unsigned):fromBits(0,this.low<<z-32,this.unsigned)},LongPrototype.shl=LongPrototype.shiftLeft,LongPrototype.shiftRight=function(z){return isLong(z)&&(z=z.toInt()),(z&=63)==0?this:z<32?fromBits(this.low>>>z|this.high<<32-z,this.high>>z,this.unsigned):fromBits(this.high>>z-32,this.high>=0?0:-1,this.unsigned)},LongPrototype.shr=LongPrototype.shiftRight,LongPrototype.shiftRightUnsigned=function(z){return isLong(z)&&(z=z.toInt()),(z&=63)==0?this:z<32?fromBits(this.low>>>z|this.high<<32-z,this.high>>>z,this.unsigned):fromBits(z===32?this.high:this.high>>>z-32,0,this.unsigned)},LongPrototype.shru=LongPrototype.shiftRightUnsigned,LongPrototype.shr_u=LongPrototype.shiftRightUnsigned,LongPrototype.rotateLeft=function(z){var G;return isLong(z)&&(z=z.toInt()),(z&=63)==0?this:z===32?fromBits(this.high,this.low,this.unsigned):z<32?(G=32-z,fromBits(this.low<<z|this.high>>>G,this.high<<z|this.low>>>G,this.unsigned)):(z-=32,G=32-z,fromBits(this.high<<z|this.low>>>G,this.low<<z|this.high>>>G,this.unsigned))},LongPrototype.rotl=LongPrototype.rotateLeft,LongPrototype.rotateRight=function(z){var G;return isLong(z)&&(z=z.toInt()),(z&=63)==0?this:z===32?fromBits(this.high,this.low,this.unsigned):z<32?(G=32-z,fromBits(this.high<<G|this.low>>>z,this.low<<G|this.high>>>z,this.unsigned)):(z-=32,G=32-z,fromBits(this.low<<G|this.high>>>z,this.high<<G|this.low>>>z,this.unsigned))},LongPrototype.rotr=LongPrototype.rotateRight,LongPrototype.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},LongPrototype.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},LongPrototype.toBytes=function(z){return z?this.toBytesLE():this.toBytesBE()},LongPrototype.toBytesLE=function(){var z=this.high,G=this.low;return[G&255,G>>>8&255,G>>>16&255,G>>>24,z&255,z>>>8&255,z>>>16&255,z>>>24]},LongPrototype.toBytesBE=function(){var z=this.high,G=this.low;return[z>>>24,z>>>16&255,z>>>8&255,z&255,G>>>24,G>>>16&255,G>>>8&255,G&255]},Long.fromBytes=function(z,G,K){return K?Long.fromBytesLE(z,G):Long.fromBytesBE(z,G)},Long.fromBytesLE=function(z,G){return new Long(z[0]|z[1]<<8|z[2]<<16|z[3]<<24,z[4]|z[5]<<8|z[6]<<16|z[7]<<24,G)},Long.fromBytesBE=function(z,G){return new Long(z[4]<<24|z[5]<<16|z[6]<<8|z[7],z[0]<<24|z[1]<<16|z[2]<<8|z[3],G)},typeof BigInt==`function`&&(Long.fromBigInt=function(z,G){return fromBits(Number(BigInt.asIntN(32,z)),Number(BigInt.asIntN(32,z>>BigInt(32))),G)},Long.fromValue=function(z,G){return typeof z==`bigint`?Long.fromBigInt(z,G):fromValue(z,G)},LongPrototype.toBigInt=function(){var z=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|z});var require_aspromise=__commonJSMin(((z,G)=>{G.exports=K;function K(z,G){for(var K=Array(arguments.length-1),J=0,Y=2,X=!0;Y<arguments.length;)K[J++]=arguments[Y++];return new Promise(function(Y,Z){K[J]=function(z){if(X)if(X=!1,z)Z(z);else{for(var G=Array(arguments.length-1),K=0;K<G.length;)G[K++]=arguments[K];Y.apply(null,G)}};try{z.apply(G||null,K)}catch(z){X&&(X=!1,Z(z))}})}})),require_base64=__commonJSMin((z=>{var G=z;G.length=function(z){var G=z.length;if(!G)return 0;for(var K=0;--G%4>1&&z.charAt(G)===`=`;)++K;return Math.ceil(z.length*3)/4-K};for(var K=Array(64),J=Array(123),Y=0;Y<64;)J[K[Y]=Y<26?Y+65:Y<52?Y+71:Y<62?Y-4:Y-59|43]=Y++;G.encode=function(z,G,J){for(var Y=null,X=[],Z=0,Q=0,ee;G<J;){var te=z[G++];switch(Q){case 0:X[Z++]=K[te>>2],ee=(te&3)<<4,Q=1;break;case 1:X[Z++]=K[ee|te>>4],ee=(te&15)<<2,Q=2;break;case 2:X[Z++]=K[ee|te>>6],X[Z++]=K[te&63],Q=0;break}Z>8191&&((Y||(Y=[])).push(String.fromCharCode.apply(String,X)),Z=0)}return Q&&(X[Z++]=K[ee],X[Z++]=61,Q===1&&(X[Z++]=61)),Y?(Z&&Y.push(String.fromCharCode.apply(String,X.slice(0,Z))),Y.join(``)):String.fromCharCode.apply(String,X.slice(0,Z))};var X=`invalid encoding`;G.decode=function(z,G,K){for(var Y=K,Z=0,Q,ee=0;ee<z.length;){var te=z.charCodeAt(ee++);if(te===61&&Z>1)break;if((te=J[te])===void 0)throw Error(X);switch(Z){case 0:Q=te,Z=1;break;case 1:G[K++]=Q<<2|(te&48)>>4,Q=te,Z=2;break;case 2:G[K++]=(Q&15)<<4|(te&60)>>2,Q=te,Z=3;break;case 3:G[K++]=(Q&3)<<6|te,Z=0;break}}if(Z===1)throw Error(X);return K-Y},G.test=function(z){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(z)}})),require_eventemitter=__commonJSMin(((z,G)=>{G.exports=K;function K(){this._listeners={}}K.prototype.on=function(z,G,K){return(this._listeners[z]||(this._listeners[z]=[])).push({fn:G,ctx:K||this}),this},K.prototype.off=function(z,G){if(z===void 0)this._listeners={};else if(G===void 0)this._listeners[z]=[];else for(var K=this._listeners[z],J=0;J<K.length;)K[J].fn===G?K.splice(J,1):++J;return this},K.prototype.emit=function(z){var G=this._listeners[z];if(G){for(var K=[],J=1;J<arguments.length;)K.push(arguments[J++]);for(J=0;J<G.length;)G[J].fn.apply(G[J++].ctx,K)}return this}})),require_float=__commonJSMin(((z,G)=>{G.exports=K(K);function K(z){return typeof Float32Array<`u`?(function(){var G=new Float32Array([-0]),K=new Uint8Array(G.buffer),J=K[3]===128;function Y(z,J,Y){G[0]=z,J[Y]=K[0],J[Y+1]=K[1],J[Y+2]=K[2],J[Y+3]=K[3]}function X(z,J,Y){G[0]=z,J[Y]=K[3],J[Y+1]=K[2],J[Y+2]=K[1],J[Y+3]=K[0]}z.writeFloatLE=J?Y:X,z.writeFloatBE=J?X:Y;function Z(z,J){return K[0]=z[J],K[1]=z[J+1],K[2]=z[J+2],K[3]=z[J+3],G[0]}function Q(z,J){return K[3]=z[J],K[2]=z[J+1],K[1]=z[J+2],K[0]=z[J+3],G[0]}z.readFloatLE=J?Z:Q,z.readFloatBE=J?Q:Z})():(function(){function G(z,G,K,J){var Y=G<0?1:0;if(Y&&(G=-G),G===0)z(1/G>0?0:2147483648,K,J);else if(isNaN(G))z(2143289344,K,J);else if(G>34028234663852886e22)z((Y<<31|2139095040)>>>0,K,J);else if(G<11754943508222875e-54)z((Y<<31|Math.round(G/1401298464324817e-60))>>>0,K,J);else{var X=Math.floor(Math.log(G)/Math.LN2),Z=Math.round(G*Math.pow(2,-X)*8388608)&8388607;z((Y<<31|X+127<<23|Z)>>>0,K,J)}}z.writeFloatLE=G.bind(null,J),z.writeFloatBE=G.bind(null,Y);function K(z,G,K){var J=z(G,K),Y=(J>>31)*2+1,X=J>>>23&255,Z=J&8388607;return X===255?Z?NaN:Y*(1/0):X===0?Y*1401298464324817e-60*Z:Y*Math.pow(2,X-150)*(Z+8388608)}z.readFloatLE=K.bind(null,X),z.readFloatBE=K.bind(null,Z)})(),typeof Float64Array<`u`?(function(){var G=new Float64Array([-0]),K=new Uint8Array(G.buffer),J=K[7]===128;function Y(z,J,Y){G[0]=z,J[Y]=K[0],J[Y+1]=K[1],J[Y+2]=K[2],J[Y+3]=K[3],J[Y+4]=K[4],J[Y+5]=K[5],J[Y+6]=K[6],J[Y+7]=K[7]}function X(z,J,Y){G[0]=z,J[Y]=K[7],J[Y+1]=K[6],J[Y+2]=K[5],J[Y+3]=K[4],J[Y+4]=K[3],J[Y+5]=K[2],J[Y+6]=K[1],J[Y+7]=K[0]}z.writeDoubleLE=J?Y:X,z.writeDoubleBE=J?X:Y;function Z(z,J){return K[0]=z[J],K[1]=z[J+1],K[2]=z[J+2],K[3]=z[J+3],K[4]=z[J+4],K[5]=z[J+5],K[6]=z[J+6],K[7]=z[J+7],G[0]}function Q(z,J){return K[7]=z[J],K[6]=z[J+1],K[5]=z[J+2],K[4]=z[J+3],K[3]=z[J+4],K[2]=z[J+5],K[1]=z[J+6],K[0]=z[J+7],G[0]}z.readDoubleLE=J?Z:Q,z.readDoubleBE=J?Q:Z})():(function(){function G(z,G,K,J,Y,X){var Z=J<0?1:0;if(Z&&(J=-J),J===0)z(0,Y,X+G),z(1/J>0?0:2147483648,Y,X+K);else if(isNaN(J))z(0,Y,X+G),z(2146959360,Y,X+K);else if(J>17976931348623157e292)z(0,Y,X+G),z((Z<<31|2146435072)>>>0,Y,X+K);else{var Q;if(J<22250738585072014e-324)Q=J/5e-324,z(Q>>>0,Y,X+G),z((Z<<31|Q/4294967296)>>>0,Y,X+K);else{var ee=Math.floor(Math.log(J)/Math.LN2);ee===1024&&(ee=1023),Q=J*Math.pow(2,-ee),z(Q*4503599627370496>>>0,Y,X+G),z((Z<<31|ee+1023<<20|Q*1048576&1048575)>>>0,Y,X+K)}}}z.writeDoubleLE=G.bind(null,J,0,4),z.writeDoubleBE=G.bind(null,Y,4,0);function K(z,G,K,J,Y){var X=z(J,Y+G),Z=z(J,Y+K),Q=(Z>>31)*2+1,ee=Z>>>20&2047,te=4294967296*(Z&1048575)+X;return ee===2047?te?NaN:Q*(1/0):ee===0?Q*5e-324*te:Q*Math.pow(2,ee-1075)*(te+4503599627370496)}z.readDoubleLE=K.bind(null,X,0,4),z.readDoubleBE=K.bind(null,Z,4,0)})(),z}function J(z,G,K){G[K]=z&255,G[K+1]=z>>>8&255,G[K+2]=z>>>16&255,G[K+3]=z>>>24}function Y(z,G,K){G[K]=z>>>24,G[K+1]=z>>>16&255,G[K+2]=z>>>8&255,G[K+3]=z&255}function X(z,G){return(z[G]|z[G+1]<<8|z[G+2]<<16|z[G+3]<<24)>>>0}function Z(z,G){return(z[G]<<24|z[G+1]<<16|z[G+2]<<8|z[G+3])>>>0}})),require_inquire=__commonJSMin(((exports,module)=>{module.exports=inquire;function inquire(moduleName){try{var mod=eval(`quire`.replace(/^/,`re`))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(z){}return null}})),require_utf8=__commonJSMin((z=>{var G=z;G.length=function(z){for(var G=0,K=0,J=0;J<z.length;++J)K=z.charCodeAt(J),K<128?G+=1:K<2048?G+=2:(K&64512)==55296&&(z.charCodeAt(J+1)&64512)==56320?(++J,G+=4):G+=3;return G},G.read=function(z,G,K){if(K-G<1)return``;for(var J=null,Y=[],X=0,Z;G<K;)Z=z[G++],Z<128?Y[X++]=Z:Z>191&&Z<224?Y[X++]=(Z&31)<<6|z[G++]&63:Z>239&&Z<365?(Z=((Z&7)<<18|(z[G++]&63)<<12|(z[G++]&63)<<6|z[G++]&63)-65536,Y[X++]=55296+(Z>>10),Y[X++]=56320+(Z&1023)):Y[X++]=(Z&15)<<12|(z[G++]&63)<<6|z[G++]&63,X>8191&&((J||(J=[])).push(String.fromCharCode.apply(String,Y)),X=0);return J?(X&&J.push(String.fromCharCode.apply(String,Y.slice(0,X))),J.join(``)):String.fromCharCode.apply(String,Y.slice(0,X))},G.write=function(z,G,K){for(var J=K,Y,X,Z=0;Z<z.length;++Z)Y=z.charCodeAt(Z),Y<128?G[K++]=Y:Y<2048?(G[K++]=Y>>6|192,G[K++]=Y&63|128):(Y&64512)==55296&&((X=z.charCodeAt(Z+1))&64512)==56320?(Y=65536+((Y&1023)<<10)+(X&1023),++Z,G[K++]=Y>>18|240,G[K++]=Y>>12&63|128,G[K++]=Y>>6&63|128,G[K++]=Y&63|128):(G[K++]=Y>>12|224,G[K++]=Y>>6&63|128,G[K++]=Y&63|128);return K-J}})),require_pool=__commonJSMin(((z,G)=>{G.exports=K;function K(z,G,K){var J=K||8192,Y=J>>>1,X=null,Z=J;return function(K){if(K<1||K>Y)return z(K);Z+K>J&&(X=z(J),Z=0);var Q=G.call(X,Z,Z+=K);return Z&7&&(Z=(Z|7)+1),Q}}})),require_longbits=__commonJSMin(((z,G)=>{G.exports=J;var K=require_minimal$1();function J(z,G){this.lo=z>>>0,this.hi=G>>>0}var Y=J.zero=new J(0,0);Y.toNumber=function(){return 0},Y.zzEncode=Y.zzDecode=function(){return this},Y.length=function(){return 1};var X=J.zeroHash=`\0\0\0\0\0\0\0\0`;J.fromNumber=function(z){if(z===0)return Y;var G=z<0;G&&(z=-z);var K=z>>>0,X=(z-K)/4294967296>>>0;return G&&(X=~X>>>0,K=~K>>>0,++K>4294967295&&(K=0,++X>4294967295&&(X=0))),new J(K,X)},J.from=function(z){if(typeof z==`number`)return J.fromNumber(z);if(K.isString(z))if(K.Long)z=K.Long.fromString(z);else return J.fromNumber(parseInt(z,10));return z.low||z.high?new J(z.low>>>0,z.high>>>0):Y},J.prototype.toNumber=function(z){if(!z&&this.hi>>>31){var G=~this.lo+1>>>0,K=~this.hi>>>0;return G||(K=K+1>>>0),-(G+K*4294967296)}return this.lo+this.hi*4294967296},J.prototype.toLong=function(z){return K.Long?new K.Long(this.lo|0,this.hi|0,!!z):{low:this.lo|0,high:this.hi|0,unsigned:!!z}};var Z=String.prototype.charCodeAt;J.fromHash=function(z){return z===X?Y:new J((Z.call(z,0)|Z.call(z,1)<<8|Z.call(z,2)<<16|Z.call(z,3)<<24)>>>0,(Z.call(z,4)|Z.call(z,5)<<8|Z.call(z,6)<<16|Z.call(z,7)<<24)>>>0)},J.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},J.prototype.zzEncode=function(){var z=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^z)>>>0,this.lo=(this.lo<<1^z)>>>0,this},J.prototype.zzDecode=function(){var z=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^z)>>>0,this.hi=(this.hi>>>1^z)>>>0,this},J.prototype.length=function(){var z=this.lo,G=(this.lo>>>28|this.hi<<4)>>>0,K=this.hi>>>24;return K===0?G===0?z<16384?z<128?1:2:z<2097152?3:4:G<16384?G<128?5:6:G<2097152?7:8:K<128?9:10}})),require_minimal$1=__commonJSMin((z=>{var G=z;G.asPromise=require_aspromise(),G.base64=require_base64(),G.EventEmitter=require_eventemitter(),G.float=require_float(),G.inquire=require_inquire(),G.utf8=require_utf8(),G.pool=require_pool(),G.LongBits=require_longbits(),G.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),G.global=G.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||z,G.emptyArray=Object.freeze?Object.freeze([]):[],G.emptyObject=Object.freeze?Object.freeze({}):{},G.isInteger=Number.isInteger||function(z){return typeof z==`number`&&isFinite(z)&&Math.floor(z)===z},G.isString=function(z){return typeof z==`string`||z instanceof String},G.isObject=function(z){return z&&typeof z==`object`},G.isset=G.isSet=function(z,G){var K=z[G];return K!=null&&z.hasOwnProperty(G)?typeof K!=`object`||(Array.isArray(K)?K.length:Object.keys(K).length)>0:!1},G.Buffer=(function(){try{var z=G.inquire(`buffer`).Buffer;return z.prototype.utf8Write?z:null}catch(z){return null}})(),G._Buffer_from=null,G._Buffer_allocUnsafe=null,G.newBuffer=function(z){return typeof z==`number`?G.Buffer?G._Buffer_allocUnsafe(z):new G.Array(z):G.Buffer?G._Buffer_from(z):typeof Uint8Array>`u`?z:new Uint8Array(z)},G.Array=typeof Uint8Array<`u`?Uint8Array:Array,G.Long=G.global.dcodeIO&&G.global.dcodeIO.Long||G.global.Long||G.inquire(`long`),G.key2Re=/^true|false|0|1$/,G.key32Re=/^-?(?:0|[1-9][0-9]*)$/,G.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,G.longToHash=function(z){return z?G.LongBits.from(z).toHash():G.LongBits.zeroHash},G.longFromHash=function(z,K){var J=G.LongBits.fromHash(z);return G.Long?G.Long.fromBits(J.lo,J.hi,K):J.toNumber(!!K)};function K(z,G,K){for(var J=Object.keys(G),Y=0;Y<J.length;++Y)(z[J[Y]]===void 0||!K)&&(z[J[Y]]=G[J[Y]]);return z}G.merge=K,G.lcFirst=function(z){return z.charAt(0).toLowerCase()+z.substring(1)};function J(z){function G(z,J){if(!(this instanceof G))return new G(z,J);Object.defineProperty(this,`message`,{get:function(){return z}}),Error.captureStackTrace?Error.captureStackTrace(this,G):Object.defineProperty(this,`stack`,{value:Error().stack||``}),J&&K(this,J)}return G.prototype=Object.create(Error.prototype,{constructor:{value:G,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return z},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),G}G.newError=J,G.ProtocolError=J(`ProtocolError`),G.oneOfGetter=function(z){for(var G={},K=0;K<z.length;++K)G[z[K]]=1;return function(){for(var z=Object.keys(this),K=z.length-1;K>-1;--K)if(G[z[K]]===1&&this[z[K]]!==void 0&&this[z[K]]!==null)return z[K]}},G.oneOfSetter=function(z){return function(G){for(var K=0;K<z.length;++K)z[K]!==G&&delete this[z[K]]}},G.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},G._configure=function(){var z=G.Buffer;if(!z){G._Buffer_from=G._Buffer_allocUnsafe=null;return}G._Buffer_from=z.from!==Uint8Array.from&&z.from||function(G,K){return new z(G,K)},G._Buffer_allocUnsafe=z.allocUnsafe||function(G){return new z(G)}}})),require_writer=__commonJSMin(((z,G)=>{G.exports=ne;var K=require_minimal$1(),J,Y=K.LongBits,X=K.base64,Z=K.utf8;function Q(z,G,K){this.fn=z,this.len=G,this.next=void 0,this.val=K}function ee(){}function te(z){this.head=z.head,this.tail=z.tail,this.len=z.len,this.next=z.states}function ne(){this.len=0,this.head=new Q(ee,0,0),this.tail=this.head,this.states=null}var ie=function(){return K.Buffer?function(){return(ne.create=function(){return new J})()}:function(){return new ne}};ne.create=ie(),ne.alloc=function(z){return new K.Array(z)},K.Array!==Array&&(ne.alloc=K.pool(ne.alloc,K.Array.prototype.subarray)),ne.prototype._push=function(z,G,K){return this.tail=this.tail.next=new Q(z,G,K),this.len+=G,this};function ae(z,G,K){G[K]=z&255}function oe(z,G,K){for(;z>127;)G[K++]=z&127|128,z>>>=7;G[K]=z}function se(z,G){this.len=z,this.next=void 0,this.val=G}se.prototype=Object.create(Q.prototype),se.prototype.fn=oe,ne.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new se((z>>>=0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},ne.prototype.int32=function(z){return z<0?this._push(ce,10,Y.fromNumber(z)):this.uint32(z)},ne.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function ce(z,G,K){for(;z.hi;)G[K++]=z.lo&127|128,z.lo=(z.lo>>>7|z.hi<<25)>>>0,z.hi>>>=7;for(;z.lo>127;)G[K++]=z.lo&127|128,z.lo>>>=7;G[K++]=z.lo}ne.prototype.uint64=function(z){var G=Y.from(z);return this._push(ce,G.length(),G)},ne.prototype.int64=ne.prototype.uint64,ne.prototype.sint64=function(z){var G=Y.from(z).zzEncode();return this._push(ce,G.length(),G)},ne.prototype.bool=function(z){return this._push(ae,1,z?1:0)};function le(z,G,K){G[K]=z&255,G[K+1]=z>>>8&255,G[K+2]=z>>>16&255,G[K+3]=z>>>24}ne.prototype.fixed32=function(z){return this._push(le,4,z>>>0)},ne.prototype.sfixed32=ne.prototype.fixed32,ne.prototype.fixed64=function(z){var G=Y.from(z);return this._push(le,4,G.lo)._push(le,4,G.hi)},ne.prototype.sfixed64=ne.prototype.fixed64,ne.prototype.float=function(z){return this._push(K.float.writeFloatLE,4,z)},ne.prototype.double=function(z){return this._push(K.float.writeDoubleLE,8,z)};var ue=K.Array.prototype.set?function(z,G,K){G.set(z,K)}:function(z,G,K){for(var J=0;J<z.length;++J)G[K+J]=z[J]};ne.prototype.bytes=function(z){var G=z.length>>>0;if(!G)return this._push(ae,1,0);if(K.isString(z)){var J=ne.alloc(G=X.length(z));X.decode(z,J,0),z=J}return this.uint32(G)._push(ue,G,z)},ne.prototype.string=function(z){var G=Z.length(z);return G?this.uint32(G)._push(Z.write,G,z):this._push(ae,1,0)},ne.prototype.fork=function(){return this.states=new te(this),this.head=this.tail=new Q(ee,0,0),this.len=0,this},ne.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Q(ee,0,0),this.len=0),this},ne.prototype.ldelim=function(){var z=this.head,G=this.tail,K=this.len;return this.reset().uint32(K),K&&(this.tail.next=z.next,this.tail=G,this.len+=K),this},ne.prototype.finish=function(){for(var z=this.head.next,G=this.constructor.alloc(this.len),K=0;z;)z.fn(z.val,G,K),K+=z.len,z=z.next;return G},ne._configure=function(z){J=z,ne.create=ie(),J._configure()}})),require_writer_buffer=__commonJSMin(((z,G)=>{G.exports=Y;var K=require_writer();(Y.prototype=Object.create(K.prototype)).constructor=Y;var J=require_minimal$1();function Y(){K.call(this)}Y._configure=function(){Y.alloc=J._Buffer_allocUnsafe,Y.writeBytesBuffer=J.Buffer&&J.Buffer.prototype instanceof Uint8Array&&J.Buffer.prototype.set.name===`set`?function(z,G,K){G.set(z,K)}:function(z,G,K){if(z.copy)z.copy(G,K,0,z.length);else for(var J=0;J<z.length;)G[K++]=z[J++]}},Y.prototype.bytes=function(z){J.isString(z)&&(z=J._Buffer_from(z,`base64`));var G=z.length>>>0;return this.uint32(G),G&&this._push(Y.writeBytesBuffer,G,z),this};function X(z,G,K){z.length<40?J.utf8.write(z,G,K):G.utf8Write?G.utf8Write(z,K):G.write(z,K)}Y.prototype.string=function(z){var G=J.Buffer.byteLength(z);return this.uint32(G),G&&this._push(X,G,z),this},Y._configure()})),require_reader=__commonJSMin(((z,G)=>{G.exports=Q;var K=require_minimal$1(),J,Y=K.LongBits,X=K.utf8;function Z(z,G){return RangeError(`index out of range: `+z.pos+` + `+(G||1)+` > `+z.len)}function Q(z){this.buf=z,this.pos=0,this.len=z.length}var ee=typeof Uint8Array<`u`?function(z){if(z instanceof Uint8Array||Array.isArray(z))return new Q(z);throw Error(`illegal buffer`)}:function(z){if(Array.isArray(z))return new Q(z);throw Error(`illegal buffer`)},te=function(){return K.Buffer?function(z){return(Q.create=function(z){return K.Buffer.isBuffer(z)?new J(z):ee(z)})(z)}:ee};Q.create=te(),Q.prototype._slice=K.Array.prototype.subarray||K.Array.prototype.slice,Q.prototype.uint32=(function(){var z=4294967295;return function(){if(z=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(z=(z|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(z=(z|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(z=(z|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(z=(z|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return z;if((this.pos+=5)>this.len)throw this.pos=this.len,Z(this,10);return z}})(),Q.prototype.int32=function(){return this.uint32()|0},Q.prototype.sint32=function(){var z=this.uint32();return z>>>1^-(z&1)|0};function ne(){var z=new Y(0,0),G=0;if(this.len-this.pos>4){for(;G<4;++G)if(z.lo=(z.lo|(this.buf[this.pos]&127)<<G*7)>>>0,this.buf[this.pos++]<128)return z;if(z.lo=(z.lo|(this.buf[this.pos]&127)<<28)>>>0,z.hi=(z.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return z;G=0}else{for(;G<3;++G){if(this.pos>=this.len)throw Z(this);if(z.lo=(z.lo|(this.buf[this.pos]&127)<<G*7)>>>0,this.buf[this.pos++]<128)return z}return z.lo=(z.lo|(this.buf[this.pos++]&127)<<G*7)>>>0,z}if(this.len-this.pos>4){for(;G<5;++G)if(z.hi=(z.hi|(this.buf[this.pos]&127)<<G*7+3)>>>0,this.buf[this.pos++]<128)return z}else for(;G<5;++G){if(this.pos>=this.len)throw Z(this);if(z.hi=(z.hi|(this.buf[this.pos]&127)<<G*7+3)>>>0,this.buf[this.pos++]<128)return z}throw Error(`invalid varint encoding`)}Q.prototype.bool=function(){return this.uint32()!==0};function ie(z,G){return(z[G-4]|z[G-3]<<8|z[G-2]<<16|z[G-1]<<24)>>>0}Q.prototype.fixed32=function(){if(this.pos+4>this.len)throw Z(this,4);return ie(this.buf,this.pos+=4)},Q.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Z(this,4);return ie(this.buf,this.pos+=4)|0};function ae(){if(this.pos+8>this.len)throw Z(this,8);return new Y(ie(this.buf,this.pos+=4),ie(this.buf,this.pos+=4))}Q.prototype.float=function(){if(this.pos+4>this.len)throw Z(this,4);var z=K.float.readFloatLE(this.buf,this.pos);return this.pos+=4,z},Q.prototype.double=function(){if(this.pos+8>this.len)throw Z(this,4);var z=K.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,z},Q.prototype.bytes=function(){var z=this.uint32(),G=this.pos,J=this.pos+z;if(J>this.len)throw Z(this,z);if(this.pos+=z,Array.isArray(this.buf))return this.buf.slice(G,J);if(G===J){var Y=K.Buffer;return Y?Y.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,G,J)},Q.prototype.string=function(){var z=this.bytes();return X.read(z,0,z.length)},Q.prototype.skip=function(z){if(typeof z==`number`){if(this.pos+z>this.len)throw Z(this,z);this.pos+=z}else do if(this.pos>=this.len)throw Z(this);while(this.buf[this.pos++]&128);return this},Q.prototype.skipType=function(z){switch(z){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(z=this.uint32()&7)!=4;)this.skipType(z);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+z+` at offset `+this.pos)}return this},Q._configure=function(z){J=z,Q.create=te(),J._configure();var G=K.Long?`toLong`:`toNumber`;K.merge(Q.prototype,{int64:function(){return ne.call(this)[G](!1)},uint64:function(){return ne.call(this)[G](!0)},sint64:function(){return ne.call(this).zzDecode()[G](!1)},fixed64:function(){return ae.call(this)[G](!0)},sfixed64:function(){return ae.call(this)[G](!1)}})}})),require_reader_buffer=__commonJSMin(((z,G)=>{G.exports=Y;var K=require_reader();(Y.prototype=Object.create(K.prototype)).constructor=Y;var J=require_minimal$1();function Y(z){K.call(this,z)}Y._configure=function(){J.Buffer&&(Y.prototype._slice=J.Buffer.prototype.slice)},Y.prototype.string=function(){var z=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+z,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+z,this.len))},Y._configure()})),require_service=__commonJSMin(((z,G)=>{G.exports=J;var K=require_minimal$1();(J.prototype=Object.create(K.EventEmitter.prototype)).constructor=J;function J(z,G,J){if(typeof z!=`function`)throw TypeError(`rpcImpl must be a function`);K.EventEmitter.call(this),this.rpcImpl=z,this.requestDelimited=!!G,this.responseDelimited=!!J}J.prototype.rpcCall=function z(G,J,Y,X,Z){if(!X)throw TypeError(`request must be specified`);var Q=this;if(!Z)return K.asPromise(z,Q,G,J,Y,X);if(!Q.rpcImpl){setTimeout(function(){Z(Error(`already ended`))},0);return}try{return Q.rpcImpl(G,J[Q.requestDelimited?`encodeDelimited`:`encode`](X).finish(),function(z,K){if(z)return Q.emit(`error`,z,G),Z(z);if(K===null){Q.end(!0);return}if(!(K instanceof Y))try{K=Y[Q.responseDelimited?`decodeDelimited`:`decode`](K)}catch(z){return Q.emit(`error`,z,G),Z(z)}return Q.emit(`data`,K,G),Z(null,K)})}catch(z){Q.emit(`error`,z,G),setTimeout(function(){Z(z)},0);return}},J.prototype.end=function(z){return this.rpcImpl&&(z||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),require_rpc=__commonJSMin((z=>{var G=z;G.Service=require_service()})),require_roots=__commonJSMin(((z,G)=>{G.exports={}})),require_index_minimal=__commonJSMin((z=>{var G=z;G.build=`minimal`,G.Writer=require_writer(),G.BufferWriter=require_writer_buffer(),G.Reader=require_reader(),G.BufferReader=require_reader_buffer(),G.util=require_minimal$1(),G.rpc=require_rpc(),G.roots=require_roots(),G.configure=K;function K(){G.util._configure(),G.Writer._configure(G.BufferWriter),G.Reader._configure(G.BufferReader)}K()})),require_minimal=__commonJSMin(((z,G)=>{G.exports=require_index_minimal()})),import_minimal=__toESM(require_minimal(),1);const _excluded=[`resource`,`getSessionId`,`tracer`,`url`,`debug`,`apiKey`,`headers`];var BatchLogProcessor=class{constructor(z,G){_defineProperty(this,`logs`,[]),_defineProperty(this,`scheduledDelayMillis`,void 0),_defineProperty(this,`timeout`,void 0),_defineProperty(this,`exporter`,void 0),_defineProperty(this,`lastBatchSent`,0),this.scheduledDelayMillis=(G==null?void 0:G.scheduledDelayMillis)||5e3,this.exporter=z,typeof window<`u`&&window.addEventListener(`unload`,()=>{this._flushAll()})}onLog(z){this.logs.push(z),this.timeout===void 0&&(this.timeout=setTimeout(()=>{this.timeout=void 0,this._flushAll()},this.scheduledDelayMillis))}_flushAll(){this.lastBatchSent=Date.now(),context.with(suppressTracing(context.active()),()=>{let z=this.logs.splice(0,this.logs.length);this.exporter.export(z)})}};function convert(z,G,K){return{body:z,timeUnixNano:G,attributes:K}}function createBaseAnyValue(){return{stringValue:void 0,boolValue:void 0,intValue:void 0,doubleValue:void 0,arrayValue:void 0,kvlistValue:void 0,bytesValue:void 0}}const AnyValue={encode(z,G=import_minimal.default.Writer.create()){return z.stringValue!==void 0&&G.uint32(10).string(z.stringValue),z.boolValue!==void 0&&G.uint32(16).bool(z.boolValue),z.intValue!==void 0&&G.uint32(24).int64(z.intValue),z.doubleValue!==void 0&&G.uint32(33).double(z.doubleValue),z.arrayValue!==void 0&&ArrayValue.encode(z.arrayValue,G.uint32(42).fork()).ldelim(),z.kvlistValue!==void 0&&KeyValueList.encode(z.kvlistValue,G.uint32(50).fork()).ldelim(),z.bytesValue!==void 0&&G.uint32(58).bytes(z.bytesValue),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseAnyValue();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.stringValue=K.string();continue;case 2:if(z!==16)break;Y.boolValue=K.bool();continue;case 3:if(z!==24)break;Y.intValue=longToNumber$1(K.int64());continue;case 4:if(z!==33)break;Y.doubleValue=K.double();continue;case 5:if(z!==42)break;Y.arrayValue=ArrayValue.decode(K,K.uint32());continue;case 6:if(z!==50)break;Y.kvlistValue=KeyValueList.decode(K,K.uint32());continue;case 7:if(z!==58)break;Y.bytesValue=K.bytes();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{stringValue:isSet$2(z.stringValue)?globalThis.String(z.stringValue):void 0,boolValue:isSet$2(z.boolValue)?globalThis.Boolean(z.boolValue):void 0,intValue:isSet$2(z.intValue)?globalThis.Number(z.intValue):void 0,doubleValue:isSet$2(z.doubleValue)?globalThis.Number(z.doubleValue):void 0,arrayValue:isSet$2(z.arrayValue)?ArrayValue.fromJSON(z.arrayValue):void 0,kvlistValue:isSet$2(z.kvlistValue)?KeyValueList.fromJSON(z.kvlistValue):void 0,bytesValue:isSet$2(z.bytesValue)?bytesFromBase64$1(z.bytesValue):void 0}},toJSON(z){let G={};return z.stringValue!==void 0&&(G.stringValue=z.stringValue),z.boolValue!==void 0&&(G.boolValue=z.boolValue),z.intValue!==void 0&&(G.intValue=Math.round(z.intValue)),z.doubleValue!==void 0&&(G.doubleValue=z.doubleValue),z.arrayValue!==void 0&&(G.arrayValue=ArrayValue.toJSON(z.arrayValue)),z.kvlistValue!==void 0&&(G.kvlistValue=KeyValueList.toJSON(z.kvlistValue)),z.bytesValue!==void 0&&(G.bytesValue=base64FromBytes$1(z.bytesValue)),G},create(z){return AnyValue.fromPartial(z==null?{}:z)},fromPartial(z){var G,K,J,Y,X;let Z=createBaseAnyValue();return Z.stringValue=(G=z.stringValue)==null?void 0:G,Z.boolValue=(K=z.boolValue)==null?void 0:K,Z.intValue=(J=z.intValue)==null?void 0:J,Z.doubleValue=(Y=z.doubleValue)==null?void 0:Y,Z.arrayValue=z.arrayValue!==void 0&&z.arrayValue!==null?ArrayValue.fromPartial(z.arrayValue):void 0,Z.kvlistValue=z.kvlistValue!==void 0&&z.kvlistValue!==null?KeyValueList.fromPartial(z.kvlistValue):void 0,Z.bytesValue=(X=z.bytesValue)==null?void 0:X,Z}};function createBaseArrayValue(){return{values:[]}}const ArrayValue={encode(z,G=import_minimal.default.Writer.create()){if(z.values!==void 0&&z.values.length!==0)for(let K of z.values)AnyValue.encode(K,G.uint32(10).fork()).ldelim();return G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseArrayValue();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.values.push(AnyValue.decode(K,K.uint32()));continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{values:globalThis.Array.isArray(z==null?void 0:z.values)?z.values.map(z=>AnyValue.fromJSON(z)):[]}},toJSON(z){var G;let K={};return(G=z.values)!=null&&G.length&&(K.values=z.values.map(z=>AnyValue.toJSON(z))),K},create(z){return ArrayValue.fromPartial(z==null?{}:z)},fromPartial(z){var G;let K=createBaseArrayValue();return K.values=((G=z.values)==null?void 0:G.map(z=>AnyValue.fromPartial(z)))||[],K}};function createBaseKeyValueList(){return{values:[]}}const KeyValueList={encode(z,G=import_minimal.default.Writer.create()){if(z.values!==void 0&&z.values.length!==0)for(let K of z.values)KeyValue.encode(K,G.uint32(10).fork()).ldelim();return G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseKeyValueList();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.values.push(KeyValue.decode(K,K.uint32()));continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{values:globalThis.Array.isArray(z==null?void 0:z.values)?z.values.map(z=>KeyValue.fromJSON(z)):[]}},toJSON(z){var G;let K={};return(G=z.values)!=null&&G.length&&(K.values=z.values.map(z=>KeyValue.toJSON(z))),K},create(z){return KeyValueList.fromPartial(z==null?{}:z)},fromPartial(z){var G;let K=createBaseKeyValueList();return K.values=((G=z.values)==null?void 0:G.map(z=>KeyValue.fromPartial(z)))||[],K}};function createBaseKeyValue(){return{key:``,value:void 0}}const KeyValue={encode(z,G=import_minimal.default.Writer.create()){return z.key!==void 0&&z.key!==``&&G.uint32(10).string(z.key),z.value!==void 0&&AnyValue.encode(z.value,G.uint32(18).fork()).ldelim(),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseKeyValue();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.key=K.string();continue;case 2:if(z!==18)break;Y.value=AnyValue.decode(K,K.uint32());continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{key:isSet$2(z.key)?globalThis.String(z.key):``,value:isSet$2(z.value)?AnyValue.fromJSON(z.value):void 0}},toJSON(z){let G={};return z.key!==void 0&&z.key!==``&&(G.key=z.key),z.value!==void 0&&(G.value=AnyValue.toJSON(z.value)),G},create(z){return KeyValue.fromPartial(z==null?{}:z)},fromPartial(z){var G;let K=createBaseKeyValue();return K.key=(G=z.key)==null?``:G,K.value=z.value!==void 0&&z.value!==null?AnyValue.fromPartial(z.value):void 0,K}};function createBaseInstrumentationLibrary(){return{name:``,version:``}}const InstrumentationLibrary={encode(z,G=import_minimal.default.Writer.create()){return z.name!==void 0&&z.name!==``&&G.uint32(10).string(z.name),z.version!==void 0&&z.version!==``&&G.uint32(18).string(z.version),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseInstrumentationLibrary();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.name=K.string();continue;case 2:if(z!==18)break;Y.version=K.string();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{name:isSet$2(z.name)?globalThis.String(z.name):``,version:isSet$2(z.version)?globalThis.String(z.version):``}},toJSON(z){let G={};return z.name!==void 0&&z.name!==``&&(G.name=z.name),z.version!==void 0&&z.version!==``&&(G.version=z.version),G},create(z){return InstrumentationLibrary.fromPartial(z==null?{}:z)},fromPartial(z){var G,K;let J=createBaseInstrumentationLibrary();return J.name=(G=z.name)==null?``:G,J.version=(K=z.version)==null?``:K,J}};function createBaseInstrumentationScope(){return{name:``,version:``}}const InstrumentationScope={encode(z,G=import_minimal.default.Writer.create()){return z.name!==void 0&&z.name!==``&&G.uint32(10).string(z.name),z.version!==void 0&&z.version!==``&&G.uint32(18).string(z.version),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseInstrumentationScope();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.name=K.string();continue;case 2:if(z!==18)break;Y.version=K.string();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{name:isSet$2(z.name)?globalThis.String(z.name):``,version:isSet$2(z.version)?globalThis.String(z.version):``}},toJSON(z){let G={};return z.name!==void 0&&z.name!==``&&(G.name=z.name),z.version!==void 0&&z.version!==``&&(G.version=z.version),G},create(z){return InstrumentationScope.fromPartial(z==null?{}:z)},fromPartial(z){var G,K;let J=createBaseInstrumentationScope();return J.name=(G=z.name)==null?``:G,J.version=(K=z.version)==null?``:K,J}};function bytesFromBase64$1(z){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(z,`base64`));{let G=globalThis.atob(z),K=new Uint8Array(G.length);for(let z=0;z<G.length;++z)K[z]=G.charCodeAt(z);return K}}function base64FromBytes$1(z){if(globalThis.Buffer)return globalThis.Buffer.from(z).toString(`base64`);{let G=[];return z.forEach(z=>{G.push(globalThis.String.fromCharCode(z))}),globalThis.btoa(G.join(``))}}function longToNumber$1(z){if(z.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return z.toNumber()}import_minimal.default.util.Long!==Long&&(import_minimal.default.util.Long=Long,import_minimal.default.configure());function isSet$2(z){return z!=null}function createBaseResource(){return{attributes:[],droppedAttributesCount:0}}const Resource={encode(z,G=import_minimal.default.Writer.create()){if(z.attributes!==void 0&&z.attributes.length!==0)for(let K of z.attributes)KeyValue.encode(K,G.uint32(10).fork()).ldelim();return z.droppedAttributesCount!==void 0&&z.droppedAttributesCount!==0&&G.uint32(16).uint32(z.droppedAttributesCount),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseResource();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.attributes.push(KeyValue.decode(K,K.uint32()));continue;case 2:if(z!==16)break;Y.droppedAttributesCount=K.uint32();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{attributes:globalThis.Array.isArray(z==null?void 0:z.attributes)?z.attributes.map(z=>KeyValue.fromJSON(z)):[],droppedAttributesCount:isSet$1(z.droppedAttributesCount)?globalThis.Number(z.droppedAttributesCount):0}},toJSON(z){var G;let K={};return(G=z.attributes)!=null&&G.length&&(K.attributes=z.attributes.map(z=>KeyValue.toJSON(z))),z.droppedAttributesCount!==void 0&&z.droppedAttributesCount!==0&&(K.droppedAttributesCount=Math.round(z.droppedAttributesCount)),K},create(z){return Resource.fromPartial(z==null?{}:z)},fromPartial(z){var G,K;let J=createBaseResource();return J.attributes=((G=z.attributes)==null?void 0:G.map(z=>KeyValue.fromPartial(z)))||[],J.droppedAttributesCount=(K=z.droppedAttributesCount)==null?0:K,J}};function isSet$1(z){return z!=null}let SeverityNumber=function(z){return z[z.SEVERITY_NUMBER_UNSPECIFIED=0]=`SEVERITY_NUMBER_UNSPECIFIED`,z[z.SEVERITY_NUMBER_TRACE=1]=`SEVERITY_NUMBER_TRACE`,z[z.SEVERITY_NUMBER_TRACE2=2]=`SEVERITY_NUMBER_TRACE2`,z[z.SEVERITY_NUMBER_TRACE3=3]=`SEVERITY_NUMBER_TRACE3`,z[z.SEVERITY_NUMBER_TRACE4=4]=`SEVERITY_NUMBER_TRACE4`,z[z.SEVERITY_NUMBER_DEBUG=5]=`SEVERITY_NUMBER_DEBUG`,z[z.SEVERITY_NUMBER_DEBUG2=6]=`SEVERITY_NUMBER_DEBUG2`,z[z.SEVERITY_NUMBER_DEBUG3=7]=`SEVERITY_NUMBER_DEBUG3`,z[z.SEVERITY_NUMBER_DEBUG4=8]=`SEVERITY_NUMBER_DEBUG4`,z[z.SEVERITY_NUMBER_INFO=9]=`SEVERITY_NUMBER_INFO`,z[z.SEVERITY_NUMBER_INFO2=10]=`SEVERITY_NUMBER_INFO2`,z[z.SEVERITY_NUMBER_INFO3=11]=`SEVERITY_NUMBER_INFO3`,z[z.SEVERITY_NUMBER_INFO4=12]=`SEVERITY_NUMBER_INFO4`,z[z.SEVERITY_NUMBER_WARN=13]=`SEVERITY_NUMBER_WARN`,z[z.SEVERITY_NUMBER_WARN2=14]=`SEVERITY_NUMBER_WARN2`,z[z.SEVERITY_NUMBER_WARN3=15]=`SEVERITY_NUMBER_WARN3`,z[z.SEVERITY_NUMBER_WARN4=16]=`SEVERITY_NUMBER_WARN4`,z[z.SEVERITY_NUMBER_ERROR=17]=`SEVERITY_NUMBER_ERROR`,z[z.SEVERITY_NUMBER_ERROR2=18]=`SEVERITY_NUMBER_ERROR2`,z[z.SEVERITY_NUMBER_ERROR3=19]=`SEVERITY_NUMBER_ERROR3`,z[z.SEVERITY_NUMBER_ERROR4=20]=`SEVERITY_NUMBER_ERROR4`,z[z.SEVERITY_NUMBER_FATAL=21]=`SEVERITY_NUMBER_FATAL`,z[z.SEVERITY_NUMBER_FATAL2=22]=`SEVERITY_NUMBER_FATAL2`,z[z.SEVERITY_NUMBER_FATAL3=23]=`SEVERITY_NUMBER_FATAL3`,z[z.SEVERITY_NUMBER_FATAL4=24]=`SEVERITY_NUMBER_FATAL4`,z[z.UNRECOGNIZED=-1]=`UNRECOGNIZED`,z}({});function severityNumberFromJSON(z){switch(z){case 0:case`SEVERITY_NUMBER_UNSPECIFIED`:return SeverityNumber.SEVERITY_NUMBER_UNSPECIFIED;case 1:case`SEVERITY_NUMBER_TRACE`:return SeverityNumber.SEVERITY_NUMBER_TRACE;case 2:case`SEVERITY_NUMBER_TRACE2`:return SeverityNumber.SEVERITY_NUMBER_TRACE2;case 3:case`SEVERITY_NUMBER_TRACE3`:return SeverityNumber.SEVERITY_NUMBER_TRACE3;case 4:case`SEVERITY_NUMBER_TRACE4`:return SeverityNumber.SEVERITY_NUMBER_TRACE4;case 5:case`SEVERITY_NUMBER_DEBUG`:return SeverityNumber.SEVERITY_NUMBER_DEBUG;case 6:case`SEVERITY_NUMBER_DEBUG2`:return SeverityNumber.SEVERITY_NUMBER_DEBUG2;case 7:case`SEVERITY_NUMBER_DEBUG3`:return SeverityNumber.SEVERITY_NUMBER_DEBUG3;case 8:case`SEVERITY_NUMBER_DEBUG4`:return SeverityNumber.SEVERITY_NUMBER_DEBUG4;case 9:case`SEVERITY_NUMBER_INFO`:return SeverityNumber.SEVERITY_NUMBER_INFO;case 10:case`SEVERITY_NUMBER_INFO2`:return SeverityNumber.SEVERITY_NUMBER_INFO2;case 11:case`SEVERITY_NUMBER_INFO3`:return SeverityNumber.SEVERITY_NUMBER_INFO3;case 12:case`SEVERITY_NUMBER_INFO4`:return SeverityNumber.SEVERITY_NUMBER_INFO4;case 13:case`SEVERITY_NUMBER_WARN`:return SeverityNumber.SEVERITY_NUMBER_WARN;case 14:case`SEVERITY_NUMBER_WARN2`:return SeverityNumber.SEVERITY_NUMBER_WARN2;case 15:case`SEVERITY_NUMBER_WARN3`:return SeverityNumber.SEVERITY_NUMBER_WARN3;case 16:case`SEVERITY_NUMBER_WARN4`:return SeverityNumber.SEVERITY_NUMBER_WARN4;case 17:case`SEVERITY_NUMBER_ERROR`:return SeverityNumber.SEVERITY_NUMBER_ERROR;case 18:case`SEVERITY_NUMBER_ERROR2`:return SeverityNumber.SEVERITY_NUMBER_ERROR2;case 19:case`SEVERITY_NUMBER_ERROR3`:return SeverityNumber.SEVERITY_NUMBER_ERROR3;case 20:case`SEVERITY_NUMBER_ERROR4`:return SeverityNumber.SEVERITY_NUMBER_ERROR4;case 21:case`SEVERITY_NUMBER_FATAL`:return SeverityNumber.SEVERITY_NUMBER_FATAL;case 22:case`SEVERITY_NUMBER_FATAL2`:return SeverityNumber.SEVERITY_NUMBER_FATAL2;case 23:case`SEVERITY_NUMBER_FATAL3`:return SeverityNumber.SEVERITY_NUMBER_FATAL3;case 24:case`SEVERITY_NUMBER_FATAL4`:return SeverityNumber.SEVERITY_NUMBER_FATAL4;default:return SeverityNumber.UNRECOGNIZED}}function severityNumberToJSON(z){switch(z){case SeverityNumber.SEVERITY_NUMBER_UNSPECIFIED:return`SEVERITY_NUMBER_UNSPECIFIED`;case SeverityNumber.SEVERITY_NUMBER_TRACE:return`SEVERITY_NUMBER_TRACE`;case SeverityNumber.SEVERITY_NUMBER_TRACE2:return`SEVERITY_NUMBER_TRACE2`;case SeverityNumber.SEVERITY_NUMBER_TRACE3:return`SEVERITY_NUMBER_TRACE3`;case SeverityNumber.SEVERITY_NUMBER_TRACE4:return`SEVERITY_NUMBER_TRACE4`;case SeverityNumber.SEVERITY_NUMBER_DEBUG:return`SEVERITY_NUMBER_DEBUG`;case SeverityNumber.SEVERITY_NUMBER_DEBUG2:return`SEVERITY_NUMBER_DEBUG2`;case SeverityNumber.SEVERITY_NUMBER_DEBUG3:return`SEVERITY_NUMBER_DEBUG3`;case SeverityNumber.SEVERITY_NUMBER_DEBUG4:return`SEVERITY_NUMBER_DEBUG4`;case SeverityNumber.SEVERITY_NUMBER_INFO:return`SEVERITY_NUMBER_INFO`;case SeverityNumber.SEVERITY_NUMBER_INFO2:return`SEVERITY_NUMBER_INFO2`;case SeverityNumber.SEVERITY_NUMBER_INFO3:return`SEVERITY_NUMBER_INFO3`;case SeverityNumber.SEVERITY_NUMBER_INFO4:return`SEVERITY_NUMBER_INFO4`;case SeverityNumber.SEVERITY_NUMBER_WARN:return`SEVERITY_NUMBER_WARN`;case SeverityNumber.SEVERITY_NUMBER_WARN2:return`SEVERITY_NUMBER_WARN2`;case SeverityNumber.SEVERITY_NUMBER_WARN3:return`SEVERITY_NUMBER_WARN3`;case SeverityNumber.SEVERITY_NUMBER_WARN4:return`SEVERITY_NUMBER_WARN4`;case SeverityNumber.SEVERITY_NUMBER_ERROR:return`SEVERITY_NUMBER_ERROR`;case SeverityNumber.SEVERITY_NUMBER_ERROR2:return`SEVERITY_NUMBER_ERROR2`;case SeverityNumber.SEVERITY_NUMBER_ERROR3:return`SEVERITY_NUMBER_ERROR3`;case SeverityNumber.SEVERITY_NUMBER_ERROR4:return`SEVERITY_NUMBER_ERROR4`;case SeverityNumber.SEVERITY_NUMBER_FATAL:return`SEVERITY_NUMBER_FATAL`;case SeverityNumber.SEVERITY_NUMBER_FATAL2:return`SEVERITY_NUMBER_FATAL2`;case SeverityNumber.SEVERITY_NUMBER_FATAL3:return`SEVERITY_NUMBER_FATAL3`;case SeverityNumber.SEVERITY_NUMBER_FATAL4:return`SEVERITY_NUMBER_FATAL4`;case SeverityNumber.UNRECOGNIZED:default:return`UNRECOGNIZED`}}function createBaseLogsData(){return{resourceLogs:[]}}const LogsData$1={encode(z,G=import_minimal.default.Writer.create()){if(z.resourceLogs!==void 0&&z.resourceLogs.length!==0)for(let K of z.resourceLogs)ResourceLogs.encode(K,G.uint32(10).fork()).ldelim();return G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseLogsData();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.resourceLogs.push(ResourceLogs.decode(K,K.uint32()));continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{resourceLogs:globalThis.Array.isArray(z==null?void 0:z.resourceLogs)?z.resourceLogs.map(z=>ResourceLogs.fromJSON(z)):[]}},toJSON(z){var G;let K={};return(G=z.resourceLogs)!=null&&G.length&&(K.resourceLogs=z.resourceLogs.map(z=>ResourceLogs.toJSON(z))),K},create(z){return LogsData$1.fromPartial(z==null?{}:z)},fromPartial(z){var G;let K=createBaseLogsData();return K.resourceLogs=((G=z.resourceLogs)==null?void 0:G.map(z=>ResourceLogs.fromPartial(z)))||[],K}};function createBaseResourceLogs(){return{resource:void 0,scopeLogs:[],instrumentationLibraryLogs:[],schemaUrl:``}}const ResourceLogs={encode(z,G=import_minimal.default.Writer.create()){if(z.resource!==void 0&&Resource.encode(z.resource,G.uint32(10).fork()).ldelim(),z.scopeLogs!==void 0&&z.scopeLogs.length!==0)for(let K of z.scopeLogs)ScopeLogs.encode(K,G.uint32(18).fork()).ldelim();if(z.instrumentationLibraryLogs!==void 0&&z.instrumentationLibraryLogs.length!==0)for(let K of z.instrumentationLibraryLogs)InstrumentationLibraryLogs.encode(K,G.uint32(8002).fork()).ldelim();return z.schemaUrl!==void 0&&z.schemaUrl!==``&&G.uint32(26).string(z.schemaUrl),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseResourceLogs();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.resource=Resource.decode(K,K.uint32());continue;case 2:if(z!==18)break;Y.scopeLogs.push(ScopeLogs.decode(K,K.uint32()));continue;case 1e3:if(z!==8002)break;Y.instrumentationLibraryLogs.push(InstrumentationLibraryLogs.decode(K,K.uint32()));continue;case 3:if(z!==26)break;Y.schemaUrl=K.string();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{resource:isSet(z.resource)?Resource.fromJSON(z.resource):void 0,scopeLogs:globalThis.Array.isArray(z==null?void 0:z.scopeLogs)?z.scopeLogs.map(z=>ScopeLogs.fromJSON(z)):[],instrumentationLibraryLogs:globalThis.Array.isArray(z==null?void 0:z.instrumentationLibraryLogs)?z.instrumentationLibraryLogs.map(z=>InstrumentationLibraryLogs.fromJSON(z)):[],schemaUrl:isSet(z.schemaUrl)?globalThis.String(z.schemaUrl):``}},toJSON(z){var G,K;let J={};return z.resource!==void 0&&(J.resource=Resource.toJSON(z.resource)),(G=z.scopeLogs)!=null&&G.length&&(J.scopeLogs=z.scopeLogs.map(z=>ScopeLogs.toJSON(z))),(K=z.instrumentationLibraryLogs)!=null&&K.length&&(J.instrumentationLibraryLogs=z.instrumentationLibraryLogs.map(z=>InstrumentationLibraryLogs.toJSON(z))),z.schemaUrl!==void 0&&z.schemaUrl!==``&&(J.schemaUrl=z.schemaUrl),J},create(z){return ResourceLogs.fromPartial(z==null?{}:z)},fromPartial(z){var G,K,J;let Y=createBaseResourceLogs();return Y.resource=z.resource!==void 0&&z.resource!==null?Resource.fromPartial(z.resource):void 0,Y.scopeLogs=((G=z.scopeLogs)==null?void 0:G.map(z=>ScopeLogs.fromPartial(z)))||[],Y.instrumentationLibraryLogs=((K=z.instrumentationLibraryLogs)==null?void 0:K.map(z=>InstrumentationLibraryLogs.fromPartial(z)))||[],Y.schemaUrl=(J=z.schemaUrl)==null?``:J,Y}};function createBaseScopeLogs(){return{scope:void 0,logRecords:[],schemaUrl:``}}const ScopeLogs={encode(z,G=import_minimal.default.Writer.create()){if(z.scope!==void 0&&InstrumentationScope.encode(z.scope,G.uint32(10).fork()).ldelim(),z.logRecords!==void 0&&z.logRecords.length!==0)for(let K of z.logRecords)LogRecord.encode(K,G.uint32(18).fork()).ldelim();return z.schemaUrl!==void 0&&z.schemaUrl!==``&&G.uint32(26).string(z.schemaUrl),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseScopeLogs();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.scope=InstrumentationScope.decode(K,K.uint32());continue;case 2:if(z!==18)break;Y.logRecords.push(LogRecord.decode(K,K.uint32()));continue;case 3:if(z!==26)break;Y.schemaUrl=K.string();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{scope:isSet(z.scope)?InstrumentationScope.fromJSON(z.scope):void 0,logRecords:globalThis.Array.isArray(z==null?void 0:z.logRecords)?z.logRecords.map(z=>LogRecord.fromJSON(z)):[],schemaUrl:isSet(z.schemaUrl)?globalThis.String(z.schemaUrl):``}},toJSON(z){var G;let K={};return z.scope!==void 0&&(K.scope=InstrumentationScope.toJSON(z.scope)),(G=z.logRecords)!=null&&G.length&&(K.logRecords=z.logRecords.map(z=>LogRecord.toJSON(z))),z.schemaUrl!==void 0&&z.schemaUrl!==``&&(K.schemaUrl=z.schemaUrl),K},create(z){return ScopeLogs.fromPartial(z==null?{}:z)},fromPartial(z){var G,K;let J=createBaseScopeLogs();return J.scope=z.scope!==void 0&&z.scope!==null?InstrumentationScope.fromPartial(z.scope):void 0,J.logRecords=((G=z.logRecords)==null?void 0:G.map(z=>LogRecord.fromPartial(z)))||[],J.schemaUrl=(K=z.schemaUrl)==null?``:K,J}};function createBaseInstrumentationLibraryLogs(){return{instrumentationLibrary:void 0,logRecords:[],schemaUrl:``}}const InstrumentationLibraryLogs={encode(z,G=import_minimal.default.Writer.create()){if(z.instrumentationLibrary!==void 0&&InstrumentationLibrary.encode(z.instrumentationLibrary,G.uint32(10).fork()).ldelim(),z.logRecords!==void 0&&z.logRecords.length!==0)for(let K of z.logRecords)LogRecord.encode(K,G.uint32(18).fork()).ldelim();return z.schemaUrl!==void 0&&z.schemaUrl!==``&&G.uint32(26).string(z.schemaUrl),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseInstrumentationLibraryLogs();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==10)break;Y.instrumentationLibrary=InstrumentationLibrary.decode(K,K.uint32());continue;case 2:if(z!==18)break;Y.logRecords.push(LogRecord.decode(K,K.uint32()));continue;case 3:if(z!==26)break;Y.schemaUrl=K.string();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{instrumentationLibrary:isSet(z.instrumentationLibrary)?InstrumentationLibrary.fromJSON(z.instrumentationLibrary):void 0,logRecords:globalThis.Array.isArray(z==null?void 0:z.logRecords)?z.logRecords.map(z=>LogRecord.fromJSON(z)):[],schemaUrl:isSet(z.schemaUrl)?globalThis.String(z.schemaUrl):``}},toJSON(z){var G;let K={};return z.instrumentationLibrary!==void 0&&(K.instrumentationLibrary=InstrumentationLibrary.toJSON(z.instrumentationLibrary)),(G=z.logRecords)!=null&&G.length&&(K.logRecords=z.logRecords.map(z=>LogRecord.toJSON(z))),z.schemaUrl!==void 0&&z.schemaUrl!==``&&(K.schemaUrl=z.schemaUrl),K},create(z){return InstrumentationLibraryLogs.fromPartial(z==null?{}:z)},fromPartial(z){var G,K;let J=createBaseInstrumentationLibraryLogs();return J.instrumentationLibrary=z.instrumentationLibrary!==void 0&&z.instrumentationLibrary!==null?InstrumentationLibrary.fromPartial(z.instrumentationLibrary):void 0,J.logRecords=((G=z.logRecords)==null?void 0:G.map(z=>LogRecord.fromPartial(z)))||[],J.schemaUrl=(K=z.schemaUrl)==null?``:K,J}};function createBaseLogRecord(){return{timeUnixNano:0,observedTimeUnixNano:0,severityNumber:0,severityText:``,body:void 0,attributes:[],droppedAttributesCount:0,flags:0,traceId:new Uint8Array,spanId:new Uint8Array}}const LogRecord={encode(z,G=import_minimal.default.Writer.create()){if(z.timeUnixNano!==void 0&&z.timeUnixNano!==0&&G.uint32(9).fixed64(z.timeUnixNano),z.observedTimeUnixNano!==void 0&&z.observedTimeUnixNano!==0&&G.uint32(89).fixed64(z.observedTimeUnixNano),z.severityNumber!==void 0&&z.severityNumber!==0&&G.uint32(16).int32(z.severityNumber),z.severityText!==void 0&&z.severityText!==``&&G.uint32(26).string(z.severityText),z.body!==void 0&&AnyValue.encode(z.body,G.uint32(42).fork()).ldelim(),z.attributes!==void 0&&z.attributes.length!==0)for(let K of z.attributes)KeyValue.encode(K,G.uint32(50).fork()).ldelim();return z.droppedAttributesCount!==void 0&&z.droppedAttributesCount!==0&&G.uint32(56).uint32(z.droppedAttributesCount),z.flags!==void 0&&z.flags!==0&&G.uint32(69).fixed32(z.flags),z.traceId!==void 0&&z.traceId.length!==0&&G.uint32(74).bytes(z.traceId),z.spanId!==void 0&&z.spanId.length!==0&&G.uint32(82).bytes(z.spanId),G},decode(z,G){let K=z instanceof import_minimal.default.Reader?z:import_minimal.default.Reader.create(z),J=G===void 0?K.len:K.pos+G,Y=createBaseLogRecord();for(;K.pos<J;){let z=K.uint32();switch(z>>>3){case 1:if(z!==9)break;Y.timeUnixNano=longToNumber(K.fixed64());continue;case 11:if(z!==89)break;Y.observedTimeUnixNano=longToNumber(K.fixed64());continue;case 2:if(z!==16)break;Y.severityNumber=K.int32();continue;case 3:if(z!==26)break;Y.severityText=K.string();continue;case 5:if(z!==42)break;Y.body=AnyValue.decode(K,K.uint32());continue;case 6:if(z!==50)break;Y.attributes.push(KeyValue.decode(K,K.uint32()));continue;case 7:if(z!==56)break;Y.droppedAttributesCount=K.uint32();continue;case 8:if(z!==69)break;Y.flags=K.fixed32();continue;case 9:if(z!==74)break;Y.traceId=K.bytes();continue;case 10:if(z!==82)break;Y.spanId=K.bytes();continue}if((z&7)==4||z===0)break;K.skipType(z&7)}return Y},fromJSON(z){return{timeUnixNano:isSet(z.timeUnixNano)?globalThis.Number(z.timeUnixNano):0,observedTimeUnixNano:isSet(z.observedTimeUnixNano)?globalThis.Number(z.observedTimeUnixNano):0,severityNumber:isSet(z.severityNumber)?severityNumberFromJSON(z.severityNumber):0,severityText:isSet(z.severityText)?globalThis.String(z.severityText):``,body:isSet(z.body)?AnyValue.fromJSON(z.body):void 0,attributes:globalThis.Array.isArray(z==null?void 0:z.attributes)?z.attributes.map(z=>KeyValue.fromJSON(z)):[],droppedAttributesCount:isSet(z.droppedAttributesCount)?globalThis.Number(z.droppedAttributesCount):0,flags:isSet(z.flags)?globalThis.Number(z.flags):0,traceId:isSet(z.traceId)?bytesFromBase64(z.traceId):new Uint8Array,spanId:isSet(z.spanId)?bytesFromBase64(z.spanId):new Uint8Array}},toJSON(z){var G;let K={};return z.timeUnixNano!==void 0&&z.timeUnixNano!==0&&(K.timeUnixNano=Math.round(z.timeUnixNano)),z.observedTimeUnixNano!==void 0&&z.observedTimeUnixNano!==0&&(K.observedTimeUnixNano=Math.round(z.observedTimeUnixNano)),z.severityNumber!==void 0&&z.severityNumber!==0&&(K.severityNumber=severityNumberToJSON(z.severityNumber)),z.severityText!==void 0&&z.severityText!==``&&(K.severityText=z.severityText),z.body!==void 0&&(K.body=AnyValue.toJSON(z.body)),(G=z.attributes)!=null&&G.length&&(K.attributes=z.attributes.map(z=>KeyValue.toJSON(z))),z.droppedAttributesCount!==void 0&&z.droppedAttributesCount!==0&&(K.droppedAttributesCount=Math.round(z.droppedAttributesCount)),z.flags!==void 0&&z.flags!==0&&(K.flags=Math.round(z.flags)),z.traceId!==void 0&&z.traceId.length!==0&&(K.traceId=base64FromBytes(z.traceId)),z.spanId!==void 0&&z.spanId.length!==0&&(K.spanId=base64FromBytes(z.spanId)),K},create(z){return LogRecord.fromPartial(z==null?{}:z)},fromPartial(z){var G,K,J,Y,X,Z,Q,ee,te;let ne=createBaseLogRecord();return ne.timeUnixNano=(G=z.timeUnixNano)==null?0:G,ne.observedTimeUnixNano=(K=z.observedTimeUnixNano)==null?0:K,ne.severityNumber=(J=z.severityNumber)==null?0:J,ne.severityText=(Y=z.severityText)==null?``:Y,ne.body=z.body!==void 0&&z.body!==null?AnyValue.fromPartial(z.body):void 0,ne.attributes=((X=z.attributes)==null?void 0:X.map(z=>KeyValue.fromPartial(z)))||[],ne.droppedAttributesCount=(Z=z.droppedAttributesCount)==null?0:Z,ne.flags=(Q=z.flags)==null?0:Q,ne.traceId=(ee=z.traceId)==null?new Uint8Array:ee,ne.spanId=(te=z.spanId)==null?new Uint8Array:te,ne}};function bytesFromBase64(z){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(z,`base64`));{let G=globalThis.atob(z),K=new Uint8Array(G.length);for(let z=0;z<G.length;++z)K[z]=G.charCodeAt(z);return K}}function base64FromBytes(z){if(globalThis.Buffer)return globalThis.Buffer.from(z).toString(`base64`);{let G=[];return z.forEach(z=>{G.push(globalThis.String.fromCharCode(z))}),globalThis.btoa(G.join(``))}}function longToNumber(z){if(z.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return z.toNumber()}import_minimal.default.util.Long!==Long&&(import_minimal.default.util.Long=Long,import_minimal.default.configure());function isSet(z){return z!=null}const VERSION=`0.0.12`,defaultHeaders={"Content-Type":`application/x-protobuf`,"Content-Encoding":`gzip`},LogsData=LogsData$1;function isArray(z){return Array.isArray(z)}function isObject(z){return!!z&&typeof z==`object`&&!isArray(z)}function convertToAnyValue(z){return isObject(z)?{kvlistValue:{values:Object.entries(z).map(([z,G])=>({key:z,value:convertToAnyValue(G)}))}}:isArray(z)?{arrayValue:{values:z.map(z=>convertToAnyValue(z))}}:typeof z==`string`?{stringValue:z}:typeof z==`number`?{doubleValue:z}:typeof z==`boolean`?{boolValue:z}:{}}var OTLPLogExporter=class{constructor(z){_defineProperty(this,`config`,void 0),this.config=z}constructLogData(z){var G,K,J;return{resourceLogs:[{resource:{attributes:(G=convertToAnyValue(_objectSpread2({},Object.fromEntries(Object.entries((K=(J=this.config.resource)==null?void 0:J.attributes)==null?{}:K)))))==null||(G=G.kvlistValue)==null?void 0:G.values},scopeLogs:[{scope:{name:`rum.rr-web`,version:VERSION},logRecords:z.map(z=>{var G,K;return{body:convertToAnyValue((G=z.body)==null?null:G),timeUnixNano:z.timeUnixNano*1e6,attributes:(K=convertToAnyValue(z.attributes||{}).kvlistValue)==null?void 0:K.values}})}]}]}}export(z){if(z.length===0)return;let G=this.constructLogData(z);this.config.debug&&console.log(`otlp request`,G);let K=gzipSync(LogsData.encode(G).finish()),J=this.config.headers?Object.assign({},defaultHeaders,this.config.headers):defaultHeaders;fetch(this.config.beaconUrl,{method:`POST`,body:new Uint8Array(K),headers:J}).catch(()=>{})}};const replacementImageURI=`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==`,INCREMENTAL_SNAPSHOT_EVENT_TYPE=3,MUTATION_SOURCE_TYPE=0,MAX_MESSAGE_SIZE=5e6;function ensureStringifiedMaxMessageSize(z){if(z.length>MAX_MESSAGE_SIZE){let G=z.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim);for(let K of G)z=K[1].toLocaleLowerCase().slice(0,6)===`image/`?z.replace(K[0],replacementImageURI):z.replace(K[0],``)}return z}var MutationRateLimiter=class{constructor(z,G={}){var K,J;_defineProperty(this,`bucketSize`,100),_defineProperty(this,`refillRate`,10),_defineProperty(this,`mutationBuckets`,{}),_defineProperty(this,`loggedTracker`,{}),_defineProperty(this,`refillBuckets`,()=>{Object.keys(this.mutationBuckets).forEach(z=>{this.mutationBuckets[z]=this.mutationBuckets[z]+this.refillRate,this.mutationBuckets[z]>=this.bucketSize&&delete this.mutationBuckets[z]})}),_defineProperty(this,`getNodeOrRelevantParent`,z=>{let G=this.rrweb.mirror.getNode(z);if((G==null?void 0:G.nodeName)!==`svg`&&G instanceof Element){let z=G.closest(`svg`);if(z)return[this.rrweb.mirror.getId(z),z]}return[z,G]}),_defineProperty(this,`numberOfChanges`,z=>{var G,K,J,Y,X,Z,Q,ee;return((G=(K=z.removes)==null?void 0:K.length)==null?0:G)+((J=(Y=z.attributes)==null?void 0:Y.length)==null?0:J)+((X=(Z=z.texts)==null?void 0:Z.length)==null?0:X)+((Q=(ee=z.adds)==null?void 0:ee.length)==null?0:Q)}),_defineProperty(this,`throttleMutations`,z=>{if(z.type!==INCREMENTAL_SNAPSHOT_EVENT_TYPE||z.data.source!==MUTATION_SOURCE_TYPE)return z;let G=z.data,K=this.numberOfChanges(G);G.attributes&&(G.attributes=G.attributes.filter(z=>{var G;let[K,J]=this.getNodeOrRelevantParent(z.id);if(this.mutationBuckets[K]===0)return!1;if(this.mutationBuckets[K]=(G=this.mutationBuckets[K])==null?this.bucketSize:G,this.mutationBuckets[K]=Math.max(this.mutationBuckets[K]-1,0),this.mutationBuckets[K]===0&&!this.loggedTracker[K]){var Y,X;this.loggedTracker[K]=!0,(Y=(X=this.options).onBlockedNode)==null||Y.call(X,K,J)}return z}));let J=this.numberOfChanges(G);if(!(J===0&&K!==J))return z}),this.rrweb=z,this.options=G,this.refillRate=(K=this.options.refillRate)==null?this.refillRate:K,this.bucketSize=(J=this.options.bucketSize)==null?this.bucketSize:J,setInterval(()=>{this.refillBuckets()},1e3)}};const MAX_RECORDING_LENGTH=14460*1e3,MAX_CHUNK_SIZE=950*1024,encoder=new TextEncoder,decoder=new TextDecoder;let inited=!1,tracer,lastKnownSession,sessionStartTime=0,paused=!1,eventCounter=1,logCounter=1,mutationRateLimiter,getSessionIdImpl,queuedFullSnapshotTimeout;const SessionRecorder={get inited(){return!!inited},isRecording(){return!!inited&&!paused},setEnabled(z){z?SessionRecorder.resume():SessionRecorder.stop()},init(z){var G,K;if(inited)return;if(typeof window>`u`){console.error(`Session recorder can't be ran in non-browser environments`);return}let{resource:J,getSessionId:Y,tracer:X,url:Z,debug:Q,apiKey:ee,headers:te}=z,ne=_objectWithoutProperties(z,_excluded);getSessionIdImpl=Y,tracer=X;let ie=tracer.startSpan(`record init`);if(!ie.isRecording())return;ie.end();let ae=Z,oe=_objectSpread2({},te);ee&&(oe.authorization=ee);let se=new BatchLogProcessor(new OTLPLogExporter({beaconUrl:ae,debug:Q,headers:oe,resource:J}),{});lastKnownSession=(G=Y())==null?``:G,sessionStartTime=Date.now(),mutationRateLimiter=(K=mutationRateLimiter)==null?new MutationRateLimiter(record,{onBlockedNode:(z,G)=>{let K=`OpenTelemetry Session Recorder: Rate limiting recording mutations on node ${z}. This can be due to excessive animations.`,J=Date.now(),Y=tracer.startSpan(`console.warn`,{kind:SpanKind.INTERNAL,startTime:J});Y.setAttribute(`component`,`console`),Y.setAttribute(`level`,`warn`),Y.setAttribute(`message`,K),Y.end(J),Q&&console.warn(K,G),clearTimeout(queuedFullSnapshotTimeout),queuedFullSnapshotTimeout=setTimeout(()=>{record.takeFullSnapshot()},1e3)}}):K,inited=record(_objectSpread2(_objectSpread2({maskAllInputs:!0,maskTextSelector:`*`},ne),{},{emit(z){var G;if(paused)return;let K=(G=getSessionIdImpl==null?void 0:getSessionIdImpl())==null?``:G;if(K!==lastKnownSession){if(document.hidden)return;lastKnownSession=K,sessionStartTime=Date.now(),eventCounter=1,logCounter=1,record.takeFullSnapshot()}if(z.timestamp>sessionStartTime+MAX_RECORDING_LENGTH)return;let J=mutationRateLimiter?mutationRateLimiter.throttleMutations(z):z;if(!J)return;let Y=J.timestamp,X=eventCounter++,Z=encoder.encode(ensureStringifiedMaxMessageSize(JSON.stringify(J))),ee=Math.ceil(Z.byteLength/MAX_CHUNK_SIZE);for(let z=0;z<ee;z++){let G=z*MAX_CHUNK_SIZE,K=(z+1)*MAX_CHUNK_SIZE,J=convert(decoder.decode(Z.slice(G,K)),Y,{"rr-web.offset":logCounter++,"rr-web.event":X,"rr-web.chunk":z+1,"rr-web.total-chunks":ee});Q&&console.log(J),se.onLog(J)}}}))},resume(){if(!inited)return;let z=paused;paused=!1,z||(record.takeFullSnapshot(),tracer.startSpan(`record resume`).end())},stop(){inited&&(paused&&tracer.startSpan(`record stop`).end(),paused=!0)},deinit(){inited&&(inited(),inited=!1,getSessionIdImpl=void 0)}},noopSessionRecording={isRecording:()=>!1,setEnabled:()=>{}};function buildInitConfig({resource:z,spanSessionManager:G,tracerProvider:K,appID:J,userID:Y,mxlDataURL:X,sessionRecorder:Z}){return _objectSpread2({resource:z,getSessionId:()=>G.getSessionId(),tracer:K.getTracer(`mxl.session-recorder`,VERSION),url:getLogEndpoint(J,X),headers:getMXLHeaders(J,Y)},Z)}function createSessionRecordingControl(z){let G=()=>buildInitConfig(z);return z.recordUserSessions?(SessionRecorder.init(G()),{isRecording:()=>SessionRecorder.isRecording(),setEnabled:z=>{SessionRecorder.setEnabled(z)}}):{isRecording:()=>SessionRecorder.isRecording(),setEnabled:z=>{z?SessionRecorder.inited?SessionRecorder.resume():SessionRecorder.init(G()):SessionRecorder.inited&&SessionRecorder.stop()}}}const validateAppID=z=>{if(z!==void 0){if(typeof z!=`string`)throw Error(`appID must be a string, or omitted if not using MXL. Received ${String(z)}`);return z}},validateAppVersion=z=>{if(z===void 0){let z=TEMPLATE_APP_VERSION.trim();return z===``?`unspecified`:z}if(typeof z!=`string`)throw Error(`if appVersion is specified, it must be a string. Received ${String(z)}`);let G=z.trim();if(G===``)throw Error(`if appVersion is specified, it cannot be an empty string.`);return G},initSDK=({appID:z,appVersion:G,resource:K=emptyResource(),spanExporters:J=[],logExporters:Y=[],spanProcessors:X=[],propagator:Z=null,defaultInstrumentationConfig:Q,instrumentations:ee=[],contextManager:te=null,logProcessors:ne=[],attributeScrubbers:ie=[],enableDefaultAttributeScrubbing:ae=!0,additionalQueryParamsToScrub:oe=[],logLevel:se=DiagLogLevel.ERROR,mxlDataURL:ce,mxlConfigURL:le,diagLogger:ue=diag$1.createComponentLogger({namespace:`mxl-sdk`}),dynamicSDKConfigManager:de,dynamicSDKConfig:fe,registerGlobally:pe=!0,blockNetworkSpanForwarding:me=!1,restrictedProtocols:he=new Set([`file:`]),useDocumentTitleAsPageLabel:ge=!0,recordUserSessions:_e=!0,sessionRecorder:ve}={})=>{try{if(pe){let z=registry.registered();if(z!==null)return ue.warn(`SDK has already been successfully initialized, skipping this invocation of initSDK`),z}if(diag$1.setLogger(new DiagConsoleLogger,{logLevel:se}),typeof window>`u`)return ue.warn(`browser not detected, skipping initialization`),!1;let be=new OTelPerformanceManager,xe=be.getNowMillis(),Se=validateAppID(z),Ce=validateAppVersion(G),we=Se!==void 0;if(!we&&!Y.length&&!J.length)throw Error(`when appID is omitted, at least one logExporter or spanExporter must be set`);if(he.has(window.location.protocol))throw Error(`not initializing due to restricted protocol: ${window.location.protocol}`);if(we&&typeof CompressionStream>`u`)throw Error(`CompressionStream is not supported in this browser and required for data compression.`);let Te=!pe&&z,Ee=Te?new NamespacedStorage(z,window.localStorage):window.localStorage,De=Te?new NamespacedStorage(z,window.sessionStorage):window.sessionStorage,Oe=K.merge(getWebSDKResource({diagLogger:ue,appVersion:Ce,pageSessionStorage:De})),ke=setupUser({registerGlobally:pe,sdkLocalStorage:Ee}),Ae=ke.getMXLUserId();if(we&&!Ae)throw Error(`userID is required when using MXL exporter`);let je=de==null?new MXLDynamicConfigManager({appID:Se,appVersion:Ce,mxlConfigURL:le,defaultConfig:fe,deviceId:Ae,storage:Ee}):de;je.refreshRemoteConfig();let Me=new MXLSDKFeaturesManager({dynamicConfigManager:je,deviceId:Ae,blockNetworkSpanForwarding:me});if(!Me.isSDKEnabled())return ue.debug(`SDK is disabled, skipping initialization.`),!1;let Ne=nsfConfigValidation({featureManager:Me,diag:ue,registerGlobally:pe,defaultInstrumentationConfig:Q,propagator:Z}),Pe=new MXLLimitManager(DEFAULT_LIMITS),Fe=[...ae?getDefaultAttributeScrubbers(oe):[],...ie],Ie=setupSession({limitManager:Pe,registerGlobally:pe,sdkLocalStorage:Ee,sdkSessionStorage:De}),Le,Re;if(we){var ye;Le=new MXLSessionBatchedSpanProcessor({resource:Oe,exporter:new MXLTraceExporter({appID:Se,mxlDataURL:ce,userID:Ae}),limitManager:Pe,storedSpansExpireTimeoutMS:Q==null||(ye=Q[`session-visibility`])==null?void 0:ye.storedSpansExpireTimeoutMS,storage:Ee,spanSessionManager:Ie}),Re=new BatchLogRecordProcessor(new MXLLogExporter({appID:Se,mxlDataURL:ce,userID:Ae}))}let ze=setupPage({useDocumentTitleAsPageLabel:ge,registerGlobally:pe}),{tracerProvider:Be,mxlTraceManager:Ve}=setupTraces({resource:Oe,spanSessionManager:Ie,userManager:ke,spanExporters:J,spanProcessors:X,propagator:Ne?new MXLW3CTraceContextPropagator:Z,contextManager:te,attributeScrubbers:Fe,registerGlobally:pe,mxlSpanProcessor:Le,pageManager:ze});Ie.setTracerProvider(Be);let{loggerProvider:He,mxlLogManager:Ue}=setupLogs({resource:Oe,userManager:ke,logExporters:Y,logProcessors:ne,spanSessionManager:Ie,limitManager:Pe,attributeScrubbers:Fe,registerGlobally:pe,mxlLogProcessor:Re,sdkLocalStorage:Ee,pageManager:ze});registerInstrumentations(pe?{instrumentations:[setupDefaultInstrumentations(Q,{featureManager:Me,mxlSpanProcessor:Le,pageManager:ze}),...ee]}:{tracerProvider:Be,loggerProvider:He,instrumentations:[setupDefaultInstrumentations(Q,{featureManager:Me,logManager:Ue,spanSessionManager:Ie,mxlSpanProcessor:Le,pageManager:ze}),...ee]});let We=typeof window<`u`&&window.__MXL_DISABLE_SESSION_RECORDER===!0,Ge=we&&Se&&Ae&&!We?createSessionRecordingControl({resource:Oe,spanSessionManager:Ie,tracerProvider:Be,appID:Se,userID:Ae,mxlDataURL:ce,recordUserSessions:_e,sessionRecorder:ve}):noopSessionRecording;ue.info(`successfully initialized the SDK`);let Ke={setDynamicConfig:z=>{je.setConfig(z)},flush:function(){var z=_asyncToGenerator(function*(){yield Be.forceFlush(),yield He.forceFlush()});return function(){return z.apply(this,arguments)}}(),log:Ue,trace:Ve,session:Ie,user:ke,page:ze,sessionRecording:Ge};return pe&&registry.register(Ke),Ie.recordSDKStartupDuration(be.getNowMillis()-xe),Ke}catch(z){let G=z instanceof Error?z.message:`Unknown error.`;return ue.error(`failed to initialize the SDK: ${G}`),!1}},setupUser=({registerGlobally:z,sdkLocalStorage:G})=>{let K=new MXLUserManager({storage:G});return z&&user.setGlobalUserManager(K),K},setupSession=({limitManager:z,registerGlobally:G,sdkLocalStorage:K,sdkSessionStorage:J})=>{let Y=new MXLSpanSessionManager({limitManager:z,storage:K,sessionStorage:J});return G&&session.setGlobalSessionManager(Y),Y},setupTraces=({resource:z,spanSessionManager:G,userManager:K,spanExporters:J,spanProcessors:Y=[],propagator:X=null,contextManager:Z=null,attributeScrubbers:Q,registerGlobally:ee,mxlSpanProcessor:te,pageManager:ne})=>{let ie=[...Y,createSessionSpanProcessor(G),new BrowserSpanProcessor,new MXLNetworkSpanProcessor,new UserSpanProcessor({userManager:K}),new PageSpanProcessor({pageManager:ne}),new SpanScrubProcessor({attributeScrubbers:Q})];J==null||J.forEach(z=>{ie.push(new BatchSpanProcessor(z))}),te&&ie.push(te);let ae=new WebTracerProvider({resource:z,spanProcessors:ie,spanLimits:{attributeCountLimit:DEFAULT_LIMITS.maxAllowed.session_property*2,attributePerEventCountLimit:20,eventCountLimit:DEFAULT_LIMITS.maxAllowed.breadcrumb*2,attributeValueLengthLimit:1024}}),oe=new MXLTraceManager({tracerProvider:ee?void 0:ae});return ee&&(trace.setGlobalTraceManager(oe),ae.register({contextManager:Z||new StackContextManager,propagator:X})),{tracerProvider:ae,mxlTraceManager:oe}},setupLogs=({resource:z,userManager:G,logExporters:K,logProcessors:J,spanSessionManager:Y,limitManager:X,attributeScrubbers:Z,registerGlobally:Q,mxlLogProcessor:ee,sdkLocalStorage:te,pageManager:ne})=>{let ie=[...J,new IdentifiableSessionLogRecordProcessor({spanSessionManager:Y}),new BrowserLogRecordProcessor,new MXLLogRecordProcessor,new UserLogRecordProcessor({userManager:G}),new LogRecordScrubProcessor({attributeScrubbers:Z}),new PageLogRecordProcessor({pageManager:ne})];K==null||K.forEach(z=>{ie.push(new BatchLogRecordProcessor(z))}),ee&&ie.push(ee);let ae=new LoggerProvider({resource:z,processors:ie}),oe=new MXLLogManager({spanSessionManager:Y,limitManager:X,loggerProvider:Q?void 0:ae,storage:te});return Q&&(logs.setGlobalLoggerProvider(ae),log.setGlobalLogManager(oe)),{loggerProvider:ae,mxlLogManager:oe}},setupPage=({useDocumentTitleAsPageLabel:z,registerGlobally:G})=>{let K=new MXLPageManager({useDocumentTitleAsPageLabel:z});return G&&page.setGlobalPageManager(K),K};return Object.defineProperty(exports,`DiagLogLevel`,{enumerable:!0,get:function(){return DiagLogLevel}}),exports.getNavigationInstrumentation=getNavigationInstrumentation,exports.initSDK=initSDK,exports.log=log,exports.page=page,exports.session=session,exports.trace=trace,exports.user=user,exports})({});
38
+ var Bf=null;try{Bf=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function X(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}X.prototype.__isLong__,Object.defineProperty(X.prototype,`__isLong__`,{value:!0});function Vf(e){return(e&&e.__isLong__)===!0}function Hf(e){var t=Math.clz32(e&-e);return e?31-t:t}X.isLong=Vf;var Uf={},Wf={};function Gf(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=Wf[e],r)?r:(n=Z(e,0,!0),i&&(Wf[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=Uf[e],r)?r:(n=Z(e,e<0?-1:0,!1),i&&(Uf[e]=n),n))}X.fromInt=Gf;function Kf(e,t){if(isNaN(e))return t?rp:np;if(t){if(e<0)return rp;if(e>=$f)return cp}else{if(e<=-ep)return lp;if(e+1>=ep)return sp}return e<0?Kf(-e,t).neg():Z(e%Qf|0,e/Qf|0,t)}X.fromNumber=Kf;function Z(e,t,n){return new X(e,t,n)}X.fromBits=Z;var qf=Math.pow;function Jf(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?rp:np;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return Jf(e.substring(1),t,n).neg();for(var i=Kf(qf(n,8)),a=np,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+s),n);if(s<8){var l=Kf(qf(n,s));a=a.mul(l).add(Kf(c))}else a=a.mul(i),a=a.add(Kf(c))}return a.unsigned=t,a}X.fromString=Jf;function Yf(e,t){return typeof e==`number`?Kf(e,t):typeof e==`string`?Jf(e,t):Z(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}X.fromValue=Yf;var Xf=65536,Zf=1<<24,Qf=Xf*Xf,$f=Qf*Qf,ep=$f/2,tp=Gf(Zf),np=Gf(0);X.ZERO=np;var rp=Gf(0,!0);X.UZERO=rp;var ip=Gf(1);X.ONE=ip;var ap=Gf(1,!0);X.UONE=ap;var op=Gf(-1);X.NEG_ONE=op;var sp=Z(-1,2147483647,!1);X.MAX_VALUE=sp;var cp=Z(-1,-1,!0);X.MAX_UNSIGNED_VALUE=cp;var lp=Z(0,-2147483648,!1);X.MIN_VALUE=lp;var Q=X.prototype;Q.toInt=function(){return this.unsigned?this.low>>>0:this.low},Q.toNumber=function(){return this.unsigned?(this.high>>>0)*Qf+(this.low>>>0):this.high*Qf+(this.low>>>0)},Q.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(lp)){var t=Kf(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=Kf(qf(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),c=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return c+o;for(;c.length<6;)c=`0`+c;o=``+c+o}},Q.getHighBits=function(){return this.high},Q.getHighBitsUnsigned=function(){return this.high>>>0},Q.getLowBits=function(){return this.low},Q.getLowBitsUnsigned=function(){return this.low>>>0},Q.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lp)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},Q.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},Q.isZero=function(){return this.high===0&&this.low===0},Q.eqz=Q.isZero,Q.isNegative=function(){return!this.unsigned&&this.high<0},Q.isPositive=function(){return this.unsigned||this.high>=0},Q.isOdd=function(){return(this.low&1)==1},Q.isEven=function(){return(this.low&1)==0},Q.equals=function(e){return Vf(e)||(e=Yf(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},Q.eq=Q.equals,Q.notEquals=function(e){return!this.eq(e)},Q.neq=Q.notEquals,Q.ne=Q.notEquals,Q.lessThan=function(e){return this.comp(e)<0},Q.lt=Q.lessThan,Q.lessThanOrEqual=function(e){return this.comp(e)<=0},Q.lte=Q.lessThanOrEqual,Q.le=Q.lessThanOrEqual,Q.greaterThan=function(e){return this.comp(e)>0},Q.gt=Q.greaterThan,Q.greaterThanOrEqual=function(e){return this.comp(e)>=0},Q.gte=Q.greaterThanOrEqual,Q.ge=Q.greaterThanOrEqual,Q.compare=function(e){if(Vf(e)||(e=Yf(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Q.comp=Q.compare,Q.negate=function(){return!this.unsigned&&this.eq(lp)?lp:this.not().add(ip)},Q.neg=Q.negate,Q.add=function(e){Vf(e)||(e=Yf(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i+c,d+=f>>>16,f&=65535,d+=r+s,u+=d>>>16,d&=65535,u+=n+o,l+=u>>>16,u&=65535,l+=t+a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.subtract=function(e){return Vf(e)||(e=Yf(e)),this.add(e.neg())},Q.sub=Q.subtract,Q.multiply=function(e){if(this.isZero())return this;if(Vf(e)||(e=Yf(e)),Bf)return Z(Bf.mul(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned);if(e.isZero())return this.unsigned?rp:np;if(this.eq(lp))return e.isOdd()?lp:np;if(e.eq(lp))return this.isOdd()?lp:np;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(tp)&&e.lt(tp))return Kf(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i*c,d+=f>>>16,f&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=i*s,u+=d>>>16,d&=65535,u+=n*c,l+=u>>>16,u&=65535,u+=r*s,l+=u>>>16,u&=65535,u+=i*o,l+=u>>>16,u&=65535,l+=t*c+n*s+r*o+i*a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.mul=Q.multiply,Q.divide=function(e){if(Vf(e)||(e=Yf(e)),e.isZero())throw Error(`division by zero`);if(Bf)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:Z((this.unsigned?Bf.div_u:Bf.div_s)(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned);if(this.isZero())return this.unsigned?rp:np;var t,n,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return rp;if(e.gt(this.shru(1)))return ap;r=rp}else{if(this.eq(lp))return e.eq(ip)||e.eq(op)?lp:e.eq(lp)?ip:(t=this.shr(1).div(e).shl(1),t.eq(np)?e.isNegative()?ip:op:(n=this.sub(e.mul(t)),r=t.add(n.div(e)),r));if(e.eq(lp))return this.unsigned?rp:np;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=np}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(t)/Math.LN2),a=i<=48?1:qf(2,i-48),o=Kf(t),s=o.mul(e);s.isNegative()||s.gt(n);)t-=a,o=Kf(t,this.unsigned),s=o.mul(e);o.isZero()&&(o=ip),r=r.add(o),n=n.sub(s)}return r},Q.div=Q.divide,Q.modulo=function(e){return Vf(e)||(e=Yf(e)),Bf?Z((this.unsigned?Bf.rem_u:Bf.rem_s)(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Q.mod=Q.modulo,Q.rem=Q.modulo,Q.not=function(){return Z(~this.low,~this.high,this.unsigned)},Q.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Q.clz=Q.countLeadingZeros,Q.countTrailingZeros=function(){return this.low?Hf(this.low):Hf(this.high)+32},Q.ctz=Q.countTrailingZeros,Q.and=function(e){return Vf(e)||(e=Yf(e)),Z(this.low&e.low,this.high&e.high,this.unsigned)},Q.or=function(e){return Vf(e)||(e=Yf(e)),Z(this.low|e.low,this.high|e.high,this.unsigned)},Q.xor=function(e){return Vf(e)||(e=Yf(e)),Z(this.low^e.low,this.high^e.high,this.unsigned)},Q.shiftLeft=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Z(0,this.low<<e-32,this.unsigned)},Q.shl=Q.shiftLeft,Q.shiftRight=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Z(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Q.shr=Q.shiftRight,Q.shiftRightUnsigned=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):Z(e===32?this.high:this.high>>>e-32,0,this.unsigned)},Q.shru=Q.shiftRightUnsigned,Q.shr_u=Q.shiftRightUnsigned,Q.rotateLeft=function(e){var t;return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,Z(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},Q.rotl=Q.rotateLeft,Q.rotateRight=function(e){var t;return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,Z(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},Q.rotr=Q.rotateRight,Q.toSigned=function(){return this.unsigned?Z(this.low,this.high,!1):this},Q.toUnsigned=function(){return this.unsigned?this:Z(this.low,this.high,!0)},Q.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Q.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},Q.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},X.fromBytes=function(e,t,n){return n?X.fromBytesLE(e,t):X.fromBytesBE(e,t)},X.fromBytesLE=function(e,t){return new X(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},X.fromBytesBE=function(e,t){return new X(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(X.fromBigInt=function(e,t){return Z(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},X.fromValue=function(e,t){return typeof e==`bigint`?X.fromBigInt(e,t):Yf(e,t)},Q.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var up=s(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),dp=s((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(;t>0&&e.charAt(t-1)===`=`;)--t;return Math.floor(t*3/4)};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r[45]=62,r[95]=63,t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i};var o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,s=/[-_]/,c=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;t.test=function(e){return o.test(e)||s.test(e)&&c.test(e)}})),fp=s(((e,t)=>{t.exports=n;function n(){this._listeners=Object.create(null)}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners=Object.create(null);else if(t===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r}return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),pp=s(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*Math.pow(2,-a)*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*Math.pow(2,a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*Math.pow(2,-c),e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),mp=s(((e,t)=>{t.exports=n;function n(e){try{if(typeof require!=`function`)return null;var t=require(e);return t&&(t.length||Object.keys(t).length)?t:null}catch(e){return null}}})),hp=s((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t};function r(e,t,r,i){for(var a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i}t.read=function(e,t,n){if(n-t<1)return``;for(var i=``,a=t,o,s,c,l,u,d,f,p;a+7<n;a+=8){if(o=e[a],s=e[a+1],c=e[a+2],l=e[a+3],u=e[a+4],d=e[a+5],f=e[a+6],p=e[a+7],(o|s|c|l|u|d|f|p)&128)return r(e,a,n,i);i+=String.fromCharCode(o,s,c,l,u,d,f,p)}for(;a<n;++a){if(o=e[a],o&128)return r(e,a,n,i);i+=String.fromCharCode(o)}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),gp=s(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),_p=s(((e,t)=>{t.exports=r;var n=yp();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),vp=s(((e,t)=>{(function(n,r){function i(e){return e.default||e}typeof define==`function`&&define.amd?define([],function(){var e={};return r(e),i(e)}):typeof e==`object`?(r(e),typeof t==`object`&&(t.exports=i(e))):(function(){var e={};r(e),n.Long=i(e)})()})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:e,function(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;
39
+ /**
40
+ * @license
41
+ * Copyright 2009 The Closure Library Authors
42
+ * Copyright 2020 Daniel Wirtz / The long.js Authors.
43
+ *
44
+ * Licensed under the Apache License, Version 2.0 (the "License");
45
+ * you may not use this file except in compliance with the License.
46
+ * You may obtain a copy of the License at
47
+ *
48
+ * http://www.apache.org/licenses/LICENSE-2.0
49
+ *
50
+ * Unless required by applicable law or agreed to in writing, software
51
+ * distributed under the License is distributed on an "AS IS" BASIS,
52
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
+ * See the License for the specific language governing permissions and
54
+ * limitations under the License.
55
+ *
56
+ * SPDX-License-Identifier: Apache-2.0
57
+ */
58
+ var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,`__isLong__`,{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return ee}else{if(e<=-_)return T;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var ee=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=ee;var T=l(0,-2147483648,!1);n.MIN_VALUE=T;var E=n.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},E.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(T)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},E.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},E.isZero=function(){return this.high===0&&this.low===0},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return(this.low&1)==1},E.isEven=function(){return(this.low&1)==0},E.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(x)},E.neg=E.negate,E.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},E.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(T))return e.isOdd()?T:y;if(e.eq(T))return this.isOdd()?T:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(T))return e.eq(x)||e.eq(C)?T:e.eq(T)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(T))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},E.div=E.divide,E.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return l(~this.low,~this.high,this.unsigned)},E.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},E.clz=E.countLeadingZeros,E.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},E.ctz=E.countTrailingZeros,E.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},E.rotl=E.rotateLeft,E.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},E.rotr=E.rotateRight,E.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(n.fromBigInt=function(e,t){return l(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},n.fromValue=function(e,t){return typeof e==`bigint`?n.fromBigInt(e,t):f(e,t)},E.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=n})})),yp=s((e=>{var t=e;t.asPromise=up(),t.base64=dp(),t.EventEmitter=fp(),t.float=pp(),t.inquire=mp(),t.utf8=hp(),t.pool=gp(),t.LongBits=_p();function n(e){return e===`__proto__`||e===`prototype`||e===`constructor`}t.isUnsafeProperty=n,t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.global.Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||(function(){try{var e=vp();return e&&e.isLong?e:null}catch(e){return null}})(),t.key2Re=/^(?:true|false|0|1)$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)},t.longFromKey=function(e,n){return t.key64Re.test(e)&&!t.key32Re.test(e)?t.longFromHash(e,n):e},t.boolFromKey=function(e){return e===`true`||e===`1`};function r(e){var t=typeof arguments[arguments.length-1]==`boolean`,r=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var i=1;i<r;++i){var a=arguments[i];if(a)for(var o=Object.keys(a),s=0;s<o.length;++s)!n(o[s])&&(e[o[s]]===void 0||!t)&&(e[o[s]]=a[o[s]])}return e}t.merge=r,t.nestingLimit=32,t.recursionLimit=100,t.makeProp=function(e,t,n){Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:n===void 0?!0:n,configurable:!0,writable:!0})},t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),n&&r(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=i,t.ProtocolError=i(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),bp=s(((e,t)=>{t.exports=u;var n=yp(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function m(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function h(e,t){this.len=e,this.next=void 0,this.val=t}h.prototype=Object.create(s.prototype),h.prototype.fn=m,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return(e|=0)<0?this._push(g,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function g(e,t,n){for(var r=e.lo,i=e.hi;i;)t[n++]=r&127|128,r=(r>>>7|i<<25)>>>0,i>>>=7;for(;r>127;)t[n++]=r&127|128,r>>>=7;t[n++]=r}u.prototype.uint64=function(e){var t=i.from(e);return this._push(g,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(g,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function _(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(_,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(_,4,t.lo)._push(_,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var v=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},u.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(v,t,e):this},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(t===e.length?p:o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){return this.finishInto(this.constructor.alloc(this.len),0)},u.prototype.finishInto=function(e,t){t===void 0&&(t=0);for(var n=this.head.next,r=t;n;)n.fn(n.val,e,r),r+=n.len,n=n.next;return e},u._configure=function(e){r=e,u.create=d(),r._configure()}})),xp=s(((e,t)=>{t.exports=i;var n=bp();(i.prototype=Object.create(n.prototype)).constructor=i;var r=yp();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(i.writeBytesBuffer,t,e):this};function a(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function o(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(t===e.length&&t<40?a:o,t,e),this},i._configure()})),Sp=s(((e,t)=>{t.exports=s;var n=yp(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.raw=function(e,t){return Array.isArray(this.buf)?this.buf.slice(e,t):e===t?new this.buf.constructor(0):this._slice.call(this.buf,e,t)},s.prototype.uint32=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128)||(n=(n|(e[t]&15)<<28)>>>0,e[t++]<128))return this.pos=t,n;for(var r=0;r<5;++r){if(t>=this.len)throw this.pos=t,o(this);if(e[t++]<128)return this.pos=t,n}throw this.pos=t,Error(`invalid varint encoding`)},s.prototype.tag=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128))return this.pos=t,n;if(n=(n|(e[t]&15)<<28)>>>0,e[t]<128&&!(e[t]&112))return this.pos=t+1,n;throw this.pos=t+1,Error(`invalid tag encoding`)},s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){for(var e=!1,t,n=0;n<10;++n){if(this.pos>=this.len)throw o(this);if(t=this.buf[this.pos++],t&127&&(e=!0),t<128)return e}throw Error(`invalid varint encoding`)};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,this.raw(t,n)},s.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,a.read(this.buf,t,n)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.recursionLimit=n.recursionLimit,s.prototype.skipType=function(e,t,n){if(t===void 0&&(t=0),t>s.recursionLimit)throw Error(`max depth exceeded`);if(n===0)throw Error(`illegal tag: field number 0`);switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),i=r>>>3;if(e=r&7,!i)throw Error(`illegal tag: field number 0`);if(e===4){if(n!==void 0&&i!==n)throw Error(`invalid end group tag`);break}this.skipType(e,t+1,i)}break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Cp=s(((e,t)=>{t.exports=i;var n=Sp();(i.prototype=Object.create(n.prototype)).constructor=i;var r=yp();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.raw=function(e,t){return e===t?r.Buffer.alloc(0):this._slice.call(this.buf,e,t)},i.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw RangeError(`index out of range: `+this.pos+` + `+e+` > `+this.len);return this.pos=n,this.buf.utf8Slice?this.buf.utf8Slice(t,n):this.buf.toString(`utf-8`,t,n)},i._configure()})),wp=s(((e,t)=>{t.exports=r;var n=yp();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),Tp=s((e=>{var t=e;t.Service=wp()})),Ep=s(((e,t)=>{t.exports={}})),Dp=s((e=>{var t=e;t.build=`minimal`,t.Writer=bp(),t.BufferWriter=xp(),t.Reader=Sp(),t.BufferReader=Cp(),t.util=yp(),t.rpc=Tp(),t.roots=Ep(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),$=l(s(((e,t)=>{t.exports=Dp()}))(),1);let Op=[`resource`,`getSessionId`,`tracer`,`url`,`debug`,`apiKey`,`headers`];var kp=class{constructor(e,t){z(this,`logs`,[]),z(this,`scheduledDelayMillis`,void 0),z(this,`timeout`,void 0),z(this,`exporter`,void 0),z(this,`lastBatchSent`,0),this.scheduledDelayMillis=(t==null?void 0:t.scheduledDelayMillis)||5e3,this.exporter=e,typeof window<`u`&&window.addEventListener(`unload`,()=>{this._flushAll()})}onLog(e){this.logs.push(e),this.timeout===void 0&&(this.timeout=setTimeout(()=>{this.timeout=void 0,this._flushAll()},this.scheduledDelayMillis))}_flushAll(){this.lastBatchSent=Date.now(),I.with(jt(I.active()),()=>{let e=this.logs.splice(0,this.logs.length);this.exporter.export(e)})}};function Ap(e,t,n){return{body:e,timeUnixNano:t,attributes:n}}function jp(){return Reflect.get(globalThis,`Buffer`)||void 0}function Mp(e){let t=jp();if(t)return Uint8Array.from(t.from(e,`base64`));let n=globalThis.atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}function Np(e){let t=jp();if(t)return t.from(e).toString(`base64`);let n=[];return e.forEach(e=>{n.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(n.join(``))}function Pp(){return{stringValue:void 0,boolValue:void 0,intValue:void 0,doubleValue:void 0,arrayValue:void 0,kvlistValue:void 0,bytesValue:void 0}}let Fp={encode(e,t=$.default.Writer.create()){return e.stringValue!==void 0&&t.uint32(10).string(e.stringValue),e.boolValue!==void 0&&t.uint32(16).bool(e.boolValue),e.intValue!==void 0&&t.uint32(24).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(33).double(e.doubleValue),e.arrayValue!==void 0&&Lp.encode(e.arrayValue,t.uint32(42).fork()).ldelim(),e.kvlistValue!==void 0&&zp.encode(e.kvlistValue,t.uint32(50).fork()).ldelim(),e.bytesValue!==void 0&&t.uint32(58).bytes(e.bytesValue),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Pp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.stringValue=n.string();continue;case 2:if(e!==16)break;i.boolValue=n.bool();continue;case 3:if(e!==24)break;i.intValue=Kp(n.int64());continue;case 4:if(e!==33)break;i.doubleValue=n.double();continue;case 5:if(e!==42)break;i.arrayValue=Lp.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.kvlistValue=zp.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.bytesValue=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{stringValue:qp(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:qp(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,intValue:qp(e.intValue)?globalThis.Number(e.intValue):void 0,doubleValue:qp(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,arrayValue:qp(e.arrayValue)?Lp.fromJSON(e.arrayValue):void 0,kvlistValue:qp(e.kvlistValue)?zp.fromJSON(e.kvlistValue):void 0,bytesValue:qp(e.bytesValue)?Mp(e.bytesValue):void 0}},toJSON(e){let t={};return e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.arrayValue!==void 0&&(t.arrayValue=Lp.toJSON(e.arrayValue)),e.kvlistValue!==void 0&&(t.kvlistValue=zp.toJSON(e.kvlistValue)),e.bytesValue!==void 0&&(t.bytesValue=Np(e.bytesValue)),t},create(e){return Fp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a;let o=Pp();return o.stringValue=(t=e.stringValue)==null?void 0:t,o.boolValue=(n=e.boolValue)==null?void 0:n,o.intValue=(r=e.intValue)==null?void 0:r,o.doubleValue=(i=e.doubleValue)==null?void 0:i,o.arrayValue=e.arrayValue!==void 0&&e.arrayValue!==null?Lp.fromPartial(e.arrayValue):void 0,o.kvlistValue=e.kvlistValue!==void 0&&e.kvlistValue!==null?zp.fromPartial(e.kvlistValue):void 0,o.bytesValue=(a=e.bytesValue)==null?void 0:a,o}};function Ip(){return{values:[]}}let Lp={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Fp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Ip();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Fp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Fp.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Fp.toJSON(e))),n},create(e){return Lp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Ip();return n.values=((t=e.values)==null?void 0:t.map(e=>Fp.fromPartial(e)))||[],n}};function Rp(){return{values:[]}}let zp={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Vp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Rp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Vp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Vp.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Vp.toJSON(e))),n},create(e){return zp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Rp();return n.values=((t=e.values)==null?void 0:t.map(e=>Vp.fromPartial(e)))||[],n}};function Bp(){return{key:``,value:void 0}}let Vp={encode(e,t=$.default.Writer.create()){return e.key!==void 0&&e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Fp.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Bp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Fp.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{key:qp(e.key)?globalThis.String(e.key):``,value:qp(e.value)?Fp.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==void 0&&e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=Fp.toJSON(e.value)),t},create(e){return Vp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Bp();return n.key=(t=e.key)==null?``:t,n.value=e.value!==void 0&&e.value!==null?Fp.fromPartial(e.value):void 0,n}};function Hp(){return{name:``,version:``}}let Up={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Hp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:qp(e.name)?globalThis.String(e.name):``,version:qp(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Up.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Hp();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Wp(){return{name:``,version:``}}let Gp={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Wp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:qp(e.name)?globalThis.String(e.name):``,version:qp(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Gp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Wp();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Kp(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function qp(e){return e!=null}function Jp(){return{attributes:[],droppedAttributesCount:0}}let Yp={encode(e,t=$.default.Writer.create()){if(e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Vp.encode(n,t.uint32(10).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(16).uint32(e.droppedAttributesCount),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Jp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.attributes.push(Vp.decode(n,n.uint32()));continue;case 2:if(e!==16)break;i.droppedAttributesCount=n.uint32();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Vp.fromJSON(e)):[],droppedAttributesCount:Xp(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0}},toJSON(e){var t;let n={};return(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Vp.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),n},create(e){return Yp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Jp();return r.attributes=((t=e.attributes)==null?void 0:t.map(e=>Vp.fromPartial(e)))||[],r.droppedAttributesCount=(n=e.droppedAttributesCount)==null?0:n,r}};function Xp(e){return e!=null}function Zp(e){switch(e){case 0:case`SEVERITY_NUMBER_UNSPECIFIED`:return 0;case 1:case`SEVERITY_NUMBER_TRACE`:return 1;case 2:case`SEVERITY_NUMBER_TRACE2`:return 2;case 3:case`SEVERITY_NUMBER_TRACE3`:return 3;case 4:case`SEVERITY_NUMBER_TRACE4`:return 4;case 5:case`SEVERITY_NUMBER_DEBUG`:return 5;case 6:case`SEVERITY_NUMBER_DEBUG2`:return 6;case 7:case`SEVERITY_NUMBER_DEBUG3`:return 7;case 8:case`SEVERITY_NUMBER_DEBUG4`:return 8;case 9:case`SEVERITY_NUMBER_INFO`:return 9;case 10:case`SEVERITY_NUMBER_INFO2`:return 10;case 11:case`SEVERITY_NUMBER_INFO3`:return 11;case 12:case`SEVERITY_NUMBER_INFO4`:return 12;case 13:case`SEVERITY_NUMBER_WARN`:return 13;case 14:case`SEVERITY_NUMBER_WARN2`:return 14;case 15:case`SEVERITY_NUMBER_WARN3`:return 15;case 16:case`SEVERITY_NUMBER_WARN4`:return 16;case 17:case`SEVERITY_NUMBER_ERROR`:return 17;case 18:case`SEVERITY_NUMBER_ERROR2`:return 18;case 19:case`SEVERITY_NUMBER_ERROR3`:return 19;case 20:case`SEVERITY_NUMBER_ERROR4`:return 20;case 21:case`SEVERITY_NUMBER_FATAL`:return 21;case 22:case`SEVERITY_NUMBER_FATAL2`:return 22;case 23:case`SEVERITY_NUMBER_FATAL3`:return 23;case 24:case`SEVERITY_NUMBER_FATAL4`:return 24;default:return-1}}function Qp(e){switch(e){case 0:return`SEVERITY_NUMBER_UNSPECIFIED`;case 1:return`SEVERITY_NUMBER_TRACE`;case 2:return`SEVERITY_NUMBER_TRACE2`;case 3:return`SEVERITY_NUMBER_TRACE3`;case 4:return`SEVERITY_NUMBER_TRACE4`;case 5:return`SEVERITY_NUMBER_DEBUG`;case 6:return`SEVERITY_NUMBER_DEBUG2`;case 7:return`SEVERITY_NUMBER_DEBUG3`;case 8:return`SEVERITY_NUMBER_DEBUG4`;case 9:return`SEVERITY_NUMBER_INFO`;case 10:return`SEVERITY_NUMBER_INFO2`;case 11:return`SEVERITY_NUMBER_INFO3`;case 12:return`SEVERITY_NUMBER_INFO4`;case 13:return`SEVERITY_NUMBER_WARN`;case 14:return`SEVERITY_NUMBER_WARN2`;case 15:return`SEVERITY_NUMBER_WARN3`;case 16:return`SEVERITY_NUMBER_WARN4`;case 17:return`SEVERITY_NUMBER_ERROR`;case 18:return`SEVERITY_NUMBER_ERROR2`;case 19:return`SEVERITY_NUMBER_ERROR3`;case 20:return`SEVERITY_NUMBER_ERROR4`;case 21:return`SEVERITY_NUMBER_FATAL`;case 22:return`SEVERITY_NUMBER_FATAL2`;case 23:return`SEVERITY_NUMBER_FATAL3`;case 24:return`SEVERITY_NUMBER_FATAL4`;default:return`UNRECOGNIZED`}}function $p(){return{resourceLogs:[]}}let em={encode(e,t=$.default.Writer.create()){if(e.resourceLogs!==void 0&&e.resourceLogs.length!==0)for(let n of e.resourceLogs)nm.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$p();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resourceLogs.push(nm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resourceLogs:globalThis.Array.isArray(e==null?void 0:e.resourceLogs)?e.resourceLogs.map(e=>nm.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.resourceLogs)!=null&&t.length&&(n.resourceLogs=e.resourceLogs.map(e=>nm.toJSON(e))),n},create(e){return em.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=$p();return n.resourceLogs=((t=e.resourceLogs)==null?void 0:t.map(e=>nm.fromPartial(e)))||[],n}};function tm(){return{resource:void 0,scopeLogs:[],instrumentationLibraryLogs:[],schemaUrl:``}}let nm={encode(e,t=$.default.Writer.create()){if(e.resource!==void 0&&Yp.encode(e.resource,t.uint32(10).fork()).ldelim(),e.scopeLogs!==void 0&&e.scopeLogs.length!==0)for(let n of e.scopeLogs)im.encode(n,t.uint32(18).fork()).ldelim();if(e.instrumentationLibraryLogs!==void 0&&e.instrumentationLibraryLogs.length!==0)for(let n of e.instrumentationLibraryLogs)om.encode(n,t.uint32(8002).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resource=Yp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.scopeLogs.push(im.decode(n,n.uint32()));continue;case 1e3:if(e!==8002)break;i.instrumentationLibraryLogs.push(om.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resource:um(e.resource)?Yp.fromJSON(e.resource):void 0,scopeLogs:globalThis.Array.isArray(e==null?void 0:e.scopeLogs)?e.scopeLogs.map(e=>im.fromJSON(e)):[],instrumentationLibraryLogs:globalThis.Array.isArray(e==null?void 0:e.instrumentationLibraryLogs)?e.instrumentationLibraryLogs.map(e=>om.fromJSON(e)):[],schemaUrl:um(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t,n;let r={};return e.resource!==void 0&&(r.resource=Yp.toJSON(e.resource)),(t=e.scopeLogs)!=null&&t.length&&(r.scopeLogs=e.scopeLogs.map(e=>im.toJSON(e))),(n=e.instrumentationLibraryLogs)!=null&&n.length&&(r.instrumentationLibraryLogs=e.instrumentationLibraryLogs.map(e=>om.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(r.schemaUrl=e.schemaUrl),r},create(e){return nm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r;let i=tm();return i.resource=e.resource!==void 0&&e.resource!==null?Yp.fromPartial(e.resource):void 0,i.scopeLogs=((t=e.scopeLogs)==null?void 0:t.map(e=>im.fromPartial(e)))||[],i.instrumentationLibraryLogs=((n=e.instrumentationLibraryLogs)==null?void 0:n.map(e=>om.fromPartial(e)))||[],i.schemaUrl=(r=e.schemaUrl)==null?``:r,i}};function rm(){return{scope:void 0,logRecords:[],schemaUrl:``}}let im={encode(e,t=$.default.Writer.create()){if(e.scope!==void 0&&Gp.encode(e.scope,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)cm.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.scope=Gp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(cm.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{scope:um(e.scope)?Gp.fromJSON(e.scope):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>cm.fromJSON(e)):[],schemaUrl:um(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.scope!==void 0&&(n.scope=Gp.toJSON(e.scope)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>cm.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return im.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=rm();return r.scope=e.scope!==void 0&&e.scope!==null?Gp.fromPartial(e.scope):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>cm.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function am(){return{instrumentationLibrary:void 0,logRecords:[],schemaUrl:``}}let om={encode(e,t=$.default.Writer.create()){if(e.instrumentationLibrary!==void 0&&Up.encode(e.instrumentationLibrary,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)cm.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=am();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.instrumentationLibrary=Up.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(cm.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{instrumentationLibrary:um(e.instrumentationLibrary)?Up.fromJSON(e.instrumentationLibrary):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>cm.fromJSON(e)):[],schemaUrl:um(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.instrumentationLibrary!==void 0&&(n.instrumentationLibrary=Up.toJSON(e.instrumentationLibrary)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>cm.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return om.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=am();return r.instrumentationLibrary=e.instrumentationLibrary!==void 0&&e.instrumentationLibrary!==null?Up.fromPartial(e.instrumentationLibrary):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>cm.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function sm(){return{timeUnixNano:0,observedTimeUnixNano:0,severityNumber:0,severityText:``,body:void 0,attributes:[],droppedAttributesCount:0,flags:0,traceId:new Uint8Array,spanId:new Uint8Array}}let cm={encode(e,t=$.default.Writer.create()){if(e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&t.uint32(9).fixed64(e.timeUnixNano),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&t.uint32(89).fixed64(e.observedTimeUnixNano),e.severityNumber!==void 0&&e.severityNumber!==0&&t.uint32(16).int32(e.severityNumber),e.severityText!==void 0&&e.severityText!==``&&t.uint32(26).string(e.severityText),e.body!==void 0&&Fp.encode(e.body,t.uint32(42).fork()).ldelim(),e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Vp.encode(n,t.uint32(50).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(56).uint32(e.droppedAttributesCount),e.flags!==void 0&&e.flags!==0&&t.uint32(69).fixed32(e.flags),e.traceId!==void 0&&e.traceId.length!==0&&t.uint32(74).bytes(e.traceId),e.spanId!==void 0&&e.spanId.length!==0&&t.uint32(82).bytes(e.spanId),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==9)break;i.timeUnixNano=lm(n.fixed64());continue;case 11:if(e!==89)break;i.observedTimeUnixNano=lm(n.fixed64());continue;case 2:if(e!==16)break;i.severityNumber=n.int32();continue;case 3:if(e!==26)break;i.severityText=n.string();continue;case 5:if(e!==42)break;i.body=Fp.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.attributes.push(Vp.decode(n,n.uint32()));continue;case 7:if(e!==56)break;i.droppedAttributesCount=n.uint32();continue;case 8:if(e!==69)break;i.flags=n.fixed32();continue;case 9:if(e!==74)break;i.traceId=n.bytes();continue;case 10:if(e!==82)break;i.spanId=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{timeUnixNano:um(e.timeUnixNano)?globalThis.Number(e.timeUnixNano):0,observedTimeUnixNano:um(e.observedTimeUnixNano)?globalThis.Number(e.observedTimeUnixNano):0,severityNumber:um(e.severityNumber)?Zp(e.severityNumber):0,severityText:um(e.severityText)?globalThis.String(e.severityText):``,body:um(e.body)?Fp.fromJSON(e.body):void 0,attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Vp.fromJSON(e)):[],droppedAttributesCount:um(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0,flags:um(e.flags)?globalThis.Number(e.flags):0,traceId:um(e.traceId)?Mp(e.traceId):new Uint8Array,spanId:um(e.spanId)?Mp(e.spanId):new Uint8Array}},toJSON(e){var t;let n={};return e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&(n.timeUnixNano=Math.round(e.timeUnixNano)),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&(n.observedTimeUnixNano=Math.round(e.observedTimeUnixNano)),e.severityNumber!==void 0&&e.severityNumber!==0&&(n.severityNumber=Qp(e.severityNumber)),e.severityText!==void 0&&e.severityText!==``&&(n.severityText=e.severityText),e.body!==void 0&&(n.body=Fp.toJSON(e.body)),(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Vp.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),e.flags!==void 0&&e.flags!==0&&(n.flags=Math.round(e.flags)),e.traceId!==void 0&&e.traceId.length!==0&&(n.traceId=Np(e.traceId)),e.spanId!==void 0&&e.spanId.length!==0&&(n.spanId=Np(e.spanId)),n},create(e){return cm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a,o,s,c,l;let u=sm();return u.timeUnixNano=(t=e.timeUnixNano)==null?0:t,u.observedTimeUnixNano=(n=e.observedTimeUnixNano)==null?0:n,u.severityNumber=(r=e.severityNumber)==null?0:r,u.severityText=(i=e.severityText)==null?``:i,u.body=e.body!==void 0&&e.body!==null?Fp.fromPartial(e.body):void 0,u.attributes=((a=e.attributes)==null?void 0:a.map(e=>Vp.fromPartial(e)))||[],u.droppedAttributesCount=(o=e.droppedAttributesCount)==null?0:o,u.flags=(s=e.flags)==null?0:s,u.traceId=(c=e.traceId)==null?new Uint8Array:c,u.spanId=(l=e.spanId)==null?new Uint8Array:l,u}};function lm(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function um(e){return e!=null}let dm=`0.0.12`,fm={"Content-Type":`application/x-protobuf`,"Content-Encoding":`gzip`},pm=em;function mm(e){return Array.isArray(e)}function hm(e){return!!e&&typeof e==`object`&&!mm(e)}function gm(e){return hm(e)?{kvlistValue:{values:Object.entries(e).map(([e,t])=>({key:e,value:gm(t)}))}}:mm(e)?{arrayValue:{values:e.map(e=>gm(e))}}:typeof e==`string`?{stringValue:e}:typeof e==`number`?{doubleValue:e}:typeof e==`boolean`?{boolValue:e}:{}}var _m=class{constructor(e){z(this,`config`,void 0),this.config=e}constructLogData(e){var t,n,r;return{resourceLogs:[{resource:{attributes:(t=gm(H({},Object.fromEntries(Object.entries((n=(r=this.config.resource)==null?void 0:r.attributes)==null?{}:n)))))==null||(t=t.kvlistValue)==null?void 0:t.values},scopeLogs:[{scope:{name:`rum.rr-web`,version:dm},logRecords:e.map(e=>{var t,n;return{body:gm((t=e.body)==null?null:t),timeUnixNano:e.timeUnixNano*1e6,attributes:(n=gm(e.attributes||{}).kvlistValue)==null?void 0:n.values}})}]}]}}export(e){if(e.length===0)return;let t=this.constructLogData(e);this.config.debug&&console.log(`otlp request`,t);let n=Rf(pm.encode(t).finish()),r=this.config.headers?Object.assign({},fm,this.config.headers):fm;fetch(this.config.beaconUrl,{method:`POST`,body:new Uint8Array(n),headers:r}).catch(()=>{})}};function vm(e){if(e.length>5e6){let t=e.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim);for(let n of t)e=n[1].toLocaleLowerCase().slice(0,6)===`image/`?e.replace(n[0],`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==`):e.replace(n[0],``)}return e}var ym=class{constructor(e,t={}){var n,r;z(this,`bucketSize`,100),z(this,`refillRate`,10),z(this,`mutationBuckets`,{}),z(this,`loggedTracker`,{}),z(this,`refillBuckets`,()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})}),z(this,`getNodeOrRelevantParent`,e=>{let t=this.rrweb.mirror.getNode(e);if((t==null?void 0:t.nodeName)!==`svg`&&t instanceof Element){let e=t.closest(`svg`);if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]}),z(this,`numberOfChanges`,e=>{var t,n,r,i,a,o,s,c;return((t=(n=e.removes)==null?void 0:n.length)==null?0:t)+((r=(i=e.attributes)==null?void 0:i.length)==null?0:r)+((a=(o=e.texts)==null?void 0:o.length)==null?0:a)+((s=(c=e.adds)==null?void 0:c.length)==null?0:s)}),z(this,`throttleMutations`,e=>{if(e.type!==3||e.data.source!==0)return e;let t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t;let[n,r]=this.getNodeOrRelevantParent(e.id);if(this.mutationBuckets[n]===0)return!1;if(this.mutationBuckets[n]=(t=this.mutationBuckets[n])==null?this.bucketSize:t,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),this.mutationBuckets[n]===0&&!this.loggedTracker[n]){var i,a;this.loggedTracker[n]=!0,(i=(a=this.options).onBlockedNode)==null||i.call(a,n,r)}return e}));let r=this.numberOfChanges(t);if(!(r===0&&n!==r))return e}),this.rrweb=e,this.options=t,this.refillRate=(n=this.options.refillRate)==null?this.refillRate:n,this.bucketSize=(r=this.options.bucketSize)==null?this.bucketSize:r,setInterval(()=>{this.refillBuckets()},1e3)}};let bm=950*1024,xm=new TextEncoder,Sm=new TextDecoder,Cm=!1,wm,Tm,Em=0,Dm=!1,Om=1,km=1,Am,jm,Mm,Nm={get inited(){return!!Cm},isRecording(){return!!Cm&&!Dm},setEnabled(e){e?Nm.resume():Nm.stop()},init(e){var t,n;if(Cm)return;if(typeof window>`u`){console.error(`Session recorder can't be ran in non-browser environments`);return}let{resource:r,getSessionId:i,tracer:a,url:o,debug:s,apiKey:c,headers:l}=e,u=Ti(e,Op);jm=i,wm=a;let d=wm.startSpan(`record init`);if(!d.isRecording())return;d.end();let f=o,p=H({},l);c&&(p.authorization=c);let m=new kp(new _m({beaconUrl:f,debug:s,headers:p,resource:r}),{});Tm=(t=i())==null?``:t,Em=Date.now(),Am=(n=Am)==null?new ym(Qd,{onBlockedNode:(e,t)=>{let n=`OpenTelemetry Session Recorder: Rate limiting recording mutations on node ${e}. This can be due to excessive animations.`,r=Date.now(),i=wm.startSpan(`console.warn`,{kind:Je.INTERNAL,startTime:r});i.setAttribute(`component`,`console`),i.setAttribute(`level`,`warn`),i.setAttribute(`message`,n),i.end(r),s&&console.warn(n,t),clearTimeout(Mm),Mm=setTimeout(()=>{Qd.takeFullSnapshot()},1e3)}}):n,Cm=Qd(H(H({maskAllInputs:!0,maskTextSelector:`*`},u),{},{emit(e){var t;if(Dm)return;let n=(t=jm==null?void 0:jm())==null?``:t;if(n!==Tm){if(document.hidden)return;Tm=n,Em=Date.now(),Om=1,km=1,Qd.takeFullSnapshot()}if(e.timestamp>Em+1446e4)return;let r=Am?Am.throttleMutations(e):e;if(!r)return;let i=r.timestamp,a=Om++,o=xm.encode(vm(JSON.stringify(r))),c=Math.ceil(o.byteLength/bm);for(let e=0;e<c;e++){let t=e*bm,n=(e+1)*bm,r=Ap(Sm.decode(o.slice(t,n)),i,{"rr-web.offset":km++,"rr-web.event":a,"rr-web.chunk":e+1,"rr-web.total-chunks":c});s&&console.log(r),m.onLog(r)}}}))},resume(){if(!Cm)return;let e=Dm;Dm=!1,e||(Qd.takeFullSnapshot(),wm.startSpan(`record resume`).end())},stop(){Cm&&(Dm&&wm.startSpan(`record stop`).end(),Dm=!0)},deinit(){Cm&&(Cm(),Cm=!1,jm=void 0)}},Pm={isRecording:()=>!1,setEnabled:()=>{}};function Fm({resource:e,spanSessionManager:t,tracerProvider:n,appID:r,userID:i,mxlDataURL:a,sessionRecorder:o}){return H({resource:e,getSessionId:()=>t.getSessionId(),tracer:n.getTracer(`mxl.session-recorder`,dm),url:Tl(r,a),headers:gc(r,i)},o)}function Im(e){let t=()=>Fm(e);return e.recordUserSessions?(Nm.init(t()),{isRecording:()=>Nm.isRecording(),setEnabled:e=>{Nm.setEnabled(e)}}):{isRecording:()=>Nm.isRecording(),setEnabled:e=>{e?Nm.inited?Nm.resume():Nm.init(t()):Nm.inited&&Nm.stop()}}}var Lm;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Lm||(Lm={}));let Rm=L.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function zm(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Bm(t.body);return t.body=e,n}else return Promise.resolve(Hm(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>Wm(e)):Promise.resolve()}}function Bm(e){if(!e.pipeThrough)return Rm.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},transform(e,n){return B(function*(){let r=yield e;t+=r.byteLength,n.enqueue(e)})()},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Vm(e){return typeof Document<`u`&&e instanceof Document}function Hm(e){if(Vm(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Wm(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Gm(e);if(e instanceof URLSearchParams)return Wm(e.toString());if(e.byteLength!==void 0)return e.byteLength;Rm.warn(`unknown body type`)}let Um=new TextEncoder;function Wm(e){return Um.encode(e).byteLength}function Gm(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Km(e){let t=Ym(),n=e.toUpperCase();return n in t?n:`_OTHER`}let qm={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},Jm;function Ym(){return Jm===void 0&&(Jm=qm),Jm}let Xm={"https:":`443`,"http:":`80`};function Zm(e){let t=Number(e.port||Xm[e.protocol]);if(t&&!isNaN(t))return t}let Qm=`0.218.0`,$m=typeof PerformanceObserver<`u`;var eh=class extends Pa{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Qm,e),z(this,`component`,`fetch`),z(this,`version`,Qm),z(this,`moduleName`,this.component),z(this,`_usedResources`,new WeakSet),z(this,`_tasksCount`,0),z(this,`_semconvStability`,void 0),this._semconvStability=Ia(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[V.FETCH_START]},R.setSpan(I.active(),e)),r=!(this._semconvStability&U.OLD);di(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[V.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=_i(t.url);if(this._semconvStability&U.OLD&&(e.setAttribute(`http.status_code`,t.status),t.statusText!=null&&e.setAttribute(Lm.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(`http.host`,n.host),e.setAttribute(`http.scheme`,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(`http.user_agent`,navigator.userAgent)),this._semconvStability&U.STABLE){e.setAttribute(an,t.status),e.setAttribute(on,n.hostname);let r=Zm(n);r&&e.setAttribute(sn,r)}}_addHeaders(e,t){if(!vi(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};st.inject(I.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)st.inject(I.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t=new Headers(e.headers);st.inject(I.active(),t,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))}),e.headers=t}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(pr(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&U.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Lm.COMPONENT]=this.moduleName,r[`http.method`]=i,r[`http.url`]=e}if(this._semconvStability&U.STABLE){let i=t.method,a=Km(t.method||`GET`);n||(n=a),r[nn]=a,a!==i&&(r[rn]=i),r[fn]=e}return this.tracer.startSpan(n,{kind:Je.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=mi(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&U.OLD);di(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=vn(Date.now()),i=yn();this._addFinalSpanAttributes(e,n),this._semconvStability&U.STABLE&&n.status>=400&&(e.setStatus({code:Ye.ERROR}),e.setAttribute(Qt,String(n.status))),setTimeout(()=>{var n;(n=t.observer)==null||n.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=_i(n[0]instanceof Request?n[0].url:String(n[0])).href,a;a=n[0]instanceof Request?n[1]==null?n[0]:new Request(n[0],n[1]):n[1]||{};let o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&zm(...n).then(e=>{e&&(t._semconvStability&U.OLD&&o.setAttribute(`http.request_content_length_uncompressed`,e),t._semconvStability&U.STABLE&&o.setAttribute(`http.request.body.size`,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}catch(n){t._diag.error(`Failed to read fetch response body`,n),t._endSpan(e,s,{status:0,url:i})}return n}function d(e,n){try{c(e,n)}catch(r){t._diag.error(`Failed to end span on fetch error`,r),t._endSpan(e,s,{status:n.status||0,url:i})}throw n}return I.with(R.setSpan(I.active(),o),()=>(t._callRequestHook(o,a),t._addHeaders(a,i),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o),d.bind(r,o))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&Fa(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&Fa(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=yn(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(!$m){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug(`fetch constructor already patched`),this._isEnabled=!0;return}try{this._wrap(globalThis,`fetch`,this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(e){this._diag.warn(`Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.`,e)}}}disable(){$m&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}},th;(function(e){e.METHOD_OPEN=`open`,e.METHOD_SEND=`send`,e.EVENT_ABORT=`abort`,e.EVENT_ERROR=`error`,e.EVENT_LOAD=`loaded`,e.EVENT_TIMEOUT=`timeout`})(th||(th={}));let nh=L.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`});function rh(e){return typeof Document<`u`&&e instanceof Document}function ih(e){if(rh(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return oh(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return sh(e);if(e instanceof URLSearchParams)return oh(e.toString());if(e.byteLength!==void 0)return e.byteLength;nh.warn(`unknown body type`)}let ah=new TextEncoder;function oh(e){return ah.encode(e).byteLength}function sh(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function ch(e){let t=dh(),n=e.toUpperCase();return n in t?n:`_OTHER`}let lh={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},uh;function dh(){return uh===void 0&&(uh=lh),uh}let fh={"https:":`443`,"http:":`80`};function ph(e){let t=Number(e.port||fh[e.protocol]);if(t&&!isNaN(t))return t}let mh=`0.218.0`;var hh;(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(hh||(hh={}));var gh=class extends Pa{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,mh,e),z(this,`component`,`xml-http-request`),z(this,`version`,mh),z(this,`moduleName`,this.component),z(this,`_tasksCount`,0),z(this,`_xhrMem`,new WeakMap),z(this,`_usedResources`,new WeakSet),z(this,`_semconvStability`,void 0),this._semconvStability=Ia(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addHeaders(e,t){let n=_i(t).href;if(!vi(n,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};st.inject(I.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let r={};st.inject(I.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){I.with(R.setSpan(I.active(),e),()=>{let e=this.tracer.startSpan(`CORS Preflight`,{startTime:t[V.FETCH_START]}),n=!(this._semconvStability&U.OLD);di(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[V.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&U.OLD){if(t.status!==void 0&&e.setAttribute(`http.status_code`,t.status),t.statusText!==void 0&&e.setAttribute(hh.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=_i(n);e.setAttribute(`http.host`,t.host),e.setAttribute(`http.scheme`,t.protocol.replace(`:`,``))}e.setAttribute(`http.user_agent`,navigator.userAgent)}this._semconvStability&U.STABLE&&t.status&&e.setAttribute(an,t.status)}_applyAttributesAfterXHR(e,t){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n==`function`&&Fa(()=>n(e,t),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_addResourceObserver(e,t){let n=this._xhrMem.get(e);!n||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(n.createdResources={observer:new PerformanceObserver(e=>{let r=e.getEntries(),i=_i(t);r.forEach(e=>{e.initiatorType===`xmlhttprequest`&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(hn.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!n||!r||!i||!e.createdResources)return;let a=e.createdResources.entries;(!a||!a.length)&&(a=hn.getEntriesByType(`resource`));let o=mi(_i(n).href,r,i,a,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&U.OLD);di(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){let r=_i(t);if(pr(r.href,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let i=``,a={};if(this._semconvStability&U.OLD&&(i=n.toUpperCase(),a[`http.method`]=n,a[`http.url`]=r.toString()),this._semconvStability&U.STABLE){let e=n,t=ch(n);i||(i=t),a[nn]=t,t!==e&&(a[rn]=e),a[fn]=r.toString(),a[on]=r.hostname;let o=ph(r);o&&(a[sn]=o)}let o=this.tracer.startSpan(i,{kind:Je.CLIENT,attributes:a});return o.addEvent(th.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:o,spanUrl:t}),o}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){let e=this;function t(t,n,r,i){let a=n.callbackToRemoveEvents;typeof a==`function`&&a();let{span:o,spanUrl:s,sendStartTime:c}=n;o&&(e._findResourceAndAddNetworkEvents(n,o,s,c,r),o.addEvent(t,i),e._addFinalSpanAttributes(o,n,s),o.end(i),e._tasksCount--),e._clearResources()}function n(n,r,i,a){let o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){let t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&U.STABLE&&(i?a&&(t.setStatus({code:Ye.ERROR,message:a}),t.setAttribute(Qt,a)):o.status&&o.status>=400&&(t.setStatus({code:Ye.ERROR}),t.setAttribute(Qt,String(o.status))))}let s=yn(),c=Date.now();setTimeout(()=>{t(n,o,s,c)},300)}function r(){n(th.EVENT_ERROR,this,!0,`error`)}function i(){n(th.EVENT_ABORT,this,!1)}function a(){n(th.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(th.EVENT_LOAD,this,!1):n(th.EVENT_ERROR,this,!1)}function s(t){t.removeEventListener(`abort`,i),t.removeEventListener(`error`,r),t.removeEventListener(`load`,o),t.removeEventListener(`timeout`,a);let n=e._xhrMem.get(t);n&&(n.callbackToRemoveEvents=void 0)}return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let c=e._xhrMem.get(this);if(!c)return t.apply(this,n);let l=c.span,u=c.spanUrl;if(l&&u){if(e.getConfig().measureRequestSize&&n!=null&&n[0]){let t=n[0],r=ih(t);r!==void 0&&(e._semconvStability&U.OLD&&l.setAttribute(`http.request_content_length_uncompressed`,r),e._semconvStability&U.STABLE&&l.setAttribute(`http.request.body.size`,r))}I.with(R.setSpan(I.active(),l),()=>{e._tasksCount++,c.sendStartTime=yn(),l.addEvent(th.METHOD_SEND),this.addEventListener(`abort`,i),this.addEventListener(`error`,r),this.addEventListener(`load`,o),this.addEventListener(`timeout`,a),c.callbackToRemoveEvents=()=>{s(this),c.createdResources&&c.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,n)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug(`reactivating existing patch on`,this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug(`applying patch to`,this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(e){this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.warn(`Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.`,e)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}};let _h=(e={},{logManager:t,spanSessionManager:n,pageManager:r,limitManager:i})=>{var a,o,s,c,l,u,d,f,p,m;let h=[new Wo(e[`session-visibility`]),new Uo(e[`session-activity`])];if((a=e.omit)!=null&&a.has(`exception`)||h.push(new ao(e.exception)),(o=e.omit)!=null&&o.has(`click`)||h.push(new ro(e.click)),(s=e.omit)!=null&&s.has(`web-vital`)||h.push(new Ys(H(H({},e[`web-vital`]),{},{pageManager:r}))),(c=e.omit)!=null&&c.has(`loaf`)||h.push(new oo(H({},e.loaf))),(l=e.omit)!=null&&l.has(`user-timing`)||h.push(new Jo(e[`user-timing`])),(u=e.omit)!=null&&u.has(`element-timing`)||h.push(new io(H(H({},e[`element-timing`]),{},{limitManager:i}))),(d=e.omit)!=null&&d.has(`document-load`)||h.push(new eo(e[`document-load`])),(f=e.omit)!=null&&f.has(`server-timing`)||h.push(new fo(H(H({},e[`server-timing`]),{},{limitManager:i}))),!((p=e.omit)!=null&&p.has(`@opentelemetry/instrumentation-fetch`))){var g,_,v,y;h.push(new eh(H(H({},e[`@opentelemetry/instrumentation-fetch`]),{},{ignoreUrls:[...(g=(_=e.network)==null?void 0:_.ignoreUrls)==null?[]:g,...(v=(y=e[`@opentelemetry/instrumentation-fetch`])==null?void 0:y.ignoreUrls)==null?[]:v]})))}if(!((m=e.omit)!=null&&m.has(`@opentelemetry/instrumentation-xml-http-request`))){var b,x,S,C;h.push(new gh(H(H({},e[`@opentelemetry/instrumentation-xml-http-request`]),{},{ignoreUrls:[...(b=(x=e.network)==null?void 0:x.ignoreUrls)==null?[]:b,...(S=(C=e[`@opentelemetry/instrumentation-xml-http-request`])==null?void 0:C.ignoreUrls)==null?[]:S]})))}e[`empty-root`]&&h.push(new to(H({},e[`empty-root`])));for(let e of h)e instanceof Xa&&(n&&e.setSessionManager(n),t&&e.setLogManager(t),i&&e.setLimitManager(i));return h},vh=e=>{if(e!==void 0){if(typeof e!=`string`)throw Error(`appID must be a string, or omitted if not using MXL. Received ${String(e)}`);return e}},yh=e=>{if(e===void 0){let e=`MXLAppVersionX.X.X`;return e===``?`unspecified`:e}if(typeof e!=`string`)throw Error(`if appVersion is specified, it must be a string. Received ${String(e)}`);let t=e.trim();if(t===``)throw Error(`if appVersion is specified, it cannot be an empty string.`);return t},bh=({appID:e,appVersion:t,resource:n=wr(),spanExporters:r=[],logExporters:i=[],spanProcessors:a=[],propagator:o=null,defaultInstrumentationConfig:s,instrumentations:c=[],contextManager:l=null,logProcessors:u=[],attributeScrubbers:d=[],enableDefaultAttributeScrubbing:f=!0,additionalQueryParamsToScrub:p=[],logLevel:m=S.ERROR,mxlDataURL:h,mxlConfigURL:g,diagLogger:_=L.createComponentLogger({namespace:`mxl-sdk`}),dynamicSDKConfigManager:v,dynamicSDKConfig:y,registerGlobally:b=!0,blockNetworkSpanForwarding:x=!1,restrictedProtocols:C=new Set([`file:`]),useDocumentTitleAsPageLabel:w=!0,recordUserSessions:ee=!0,sessionRecorder:T,serviceName:E}={})=>{try{var D,te;if(b){let e=Xl.registered();if(e!==null)return _.warn(`SDK has already been successfully initialized, skipping this invocation of initSDK`),e}if(L.setLogger(new ne,{logLevel:m}),typeof window>`u`)return _.warn(`browser not detected, skipping initialization`),!1;let S=new Ci,k=S.getNowMillis(),A=vh(e),j=yh(t),re=A!==void 0;if(!re&&!i.length&&!r.length)throw Error(`when appID is omitted, at least one logExporter or spanExporter must be set`);if(C.has(window.location.protocol))throw Error(`not initializing due to restricted protocol: ${window.location.protocol}`);if(re&&typeof CompressionStream>`u`)throw Error(`CompressionStream is not supported in this browser and required for data compression.`);let ie=!b&&e,M=ie?new xi(e,window.localStorage):window.localStorage,ae=ie?new xi(e,window.sessionStorage):window.sessionStorage,N=xh({registerGlobally:b,sdkLocalStorage:M}),P=N.getMXLUserId();if(re&&!P)throw Error(`userID is required when using MXL exporter`);let F=H({},y),oe=v==null?new Co({appID:A,appVersion:j,mxlConfigURL:g,defaultConfig:F,deviceId:P,storage:M}):v;oe.refreshRemoteConfig();let se=yo({serviceName:(D=(te=oe.resolveApplicationServiceName)==null?void 0:te.call(oe,E))==null?(()=>{var e;return(E==null?void 0:E.trim())||((e=oe.getConfig().serviceName)==null?void 0:e.trim())||vo})():D}).merge(n).merge(bo({diagLogger:_,appVersion:j,pageSessionStorage:ae})),ce=new Ao({dynamicConfigManager:oe,deviceId:P,blockNetworkSpanForwarding:x});if(!ce.isSDKEnabled())return _.debug(`SDK is disabled, skipping initialization.`),!1;let le=Si({featureManager:ce,diag:_,registerGlobally:b,defaultInstrumentationConfig:s,propagator:o}),ue=new Eo(wo),de=[...f?Yl(p):[],...d],fe=Sh({limitManager:ue,registerGlobally:b,sdkLocalStorage:M,sdkSessionStorage:ae}),pe,me;if(re){var O;pe=new zl({resource:se,exporter:new kl({appID:A,mxlDataURL:h,userID:P}),limitManager:ue,storedSpansExpireTimeoutMS:s==null||(O=s[`session-visibility`])==null?void 0:O.storedSpansExpireTimeoutMS,storage:M,spanSessionManager:fe}),me=new fc(new El({appID:A,mxlDataURL:h,userID:P}))}let he=Th({useDocumentTitleAsPageLabel:w,registerGlobally:b}),{tracerProvider:ge,mxlTraceManager:_e}=Ch({resource:se,spanSessionManager:fe,userManager:N,spanExporters:r,spanProcessors:a,propagator:le?new Gl:o,contextManager:l,attributeScrubbers:de,registerGlobally:b,mxlSpanProcessor:pe,pageManager:he});fe.setTracerProvider(ge);let{loggerProvider:ve,mxlLogManager:ye}=wh({resource:se,userManager:N,logExporters:i,logProcessors:u,spanSessionManager:fe,limitManager:ue,attributeScrubbers:de,registerGlobally:b,mxlLogProcessor:me,sdkLocalStorage:M,pageManager:he});fe.startSessionSpan({reason:`init`}),Ta(b?{instrumentations:[_h(s,{spanSessionManager:fe,pageManager:he,limitManager:ue}),...c]}:{tracerProvider:ge,loggerProvider:ve,instrumentations:[_h(s,{logManager:ye,spanSessionManager:fe,pageManager:he,limitManager:ue}),...c]});let be=typeof window<`u`&&window.__MXL_DISABLE_SESSION_RECORDER===!0,xe=re&&A&&P&&!be?Im({resource:se,spanSessionManager:fe,tracerProvider:ge,appID:A,userID:P,mxlDataURL:h,recordUserSessions:ee,sessionRecorder:T}):Pm;_.info(`successfully initialized the SDK`);let Se={setDynamicConfig:e=>{oe.setConfig(e)},flush:function(){var e=B(function*(){yield ge.forceFlush(),yield ve.forceFlush()});return function(){return e.apply(this,arguments)}}(),log:ye,trace:_e,session:fe,user:N,page:he,sessionRecording:xe};return b&&Xl.register(Se),fe.recordSDKStartupDuration(S.getNowMillis()-k),Se}catch(e){let t=e instanceof Error?e.message:`Unknown error.`;return _.error(`failed to initialize the SDK: ${t}`),!1}},xh=({registerGlobally:e,sdkLocalStorage:t})=>{let n=new Vo({storage:t});return e&&fa.setGlobalUserManager(n),n},Sh=({limitManager:e,registerGlobally:t,sdkLocalStorage:n,sdkSessionStorage:r})=>{let i=new Po({limitManager:e,storage:n,sessionStorage:r});return t&&Zi.setGlobalSessionManager(i),i},Ch=({resource:e,spanSessionManager:t,userManager:n,spanExporters:r,spanProcessors:i=[],propagator:a=null,contextManager:o=null,attributeScrubbers:s,registerGlobally:c,mxlSpanProcessor:l,pageManager:u})=>{let d=[...i,mc(t),new jl,new Il,new Wl({userManager:n}),new Vl({pageManager:u}),new Hl({attributeScrubbers:s})];r==null||r.forEach(e=>{d.push(new Hr(e))}),l&&d.push(l);let f=new oi({resource:e,spanProcessors:d,spanLimits:{attributeCountLimit:wo.maxAllowed.session_property*2,eventCountLimit:wo.maxAllowed.breadcrumb*2}}),p=new Fo({tracerProvider:c?void 0:f});return c&&(aa.setGlobalTraceManager(p),f.register({contextManager:o||new ri,propagator:a})),{tracerProvider:f,mxlTraceManager:p}},wh=({resource:e,userManager:t,logExporters:n,logProcessors:r,spanSessionManager:i,limitManager:a,attributeScrubbers:o,registerGlobally:s,mxlLogProcessor:c,sdkLocalStorage:l,pageManager:u})=>{let d=[...r,new Ml({spanSessionManager:i}),new Al,new Pl,new Ul({userManager:t}),new Nl({attributeScrubbers:o}),new Bl({pageManager:u})];n==null||n.forEach(e=>{d.push(new fc(e))}),c&&d.push(c);let f=new sc({resource:e,processors:d}),p=new Oo({spanSessionManager:i,limitManager:a,loggerProvider:s?void 0:f,storage:l});return s&&(Ja.setGlobalLoggerProvider(f),Li.setGlobalLogManager(p)),{loggerProvider:f,mxlLogManager:p}},Th=({useDocumentTitleAsPageLabel:e,registerGlobally:t})=>{let n=new ko({useDocumentTitleAsPageLabel:e});return t&&Wi.setGlobalPageManager(n),n};return Object.defineProperty(e,`DiagLogLevel`,{enumerable:!0,get:function(){return S}}),e.attributes=pa,e.getNavigationInstrumentation=uo,e.initSDK=bh,e.log=Li,e.page=Wi,e.session=Zi,e.trace=aa,e.user=fa,e})({});
39
59
  //# sourceMappingURL=mxl-web-sdk.js.map