@incodetech/core 2.4.1-agentic.5 → 2.4.1-agentic.6

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 (199) hide show
  1. package/dist/DateFormattingProvider-DPq9zco-.esm.js +25 -0
  2. package/dist/{FaceDetectionProvider-ZiDiL_hY.esm.js → FaceDetectionProvider-DjXSD4uI.esm.js} +7 -7
  3. package/dist/addressSearch-D6cKPWmk.esm.js +72 -0
  4. package/dist/ae-signature.esm.js +1 -1
  5. package/dist/antifraud.esm.js +2 -2
  6. package/dist/{antifraudManager-BObuHBjn.esm.js → antifraudManager-CbIwM35x.esm.js} +2 -2
  7. package/dist/{antifraudStateMachine-Dfrd2-26.esm.js → antifraudStateMachine-qNNXrlsP.esm.js} +1 -1
  8. package/dist/{api-CpP4PS4S.esm.js → api-C_P9YXbL.esm.js} +1 -0
  9. package/dist/{apiError-CeyLcwt3.esm.js → apiError-DzZ5OriE.esm.js} +1 -1
  10. package/dist/{attemptCarry-WOkfvFMw.esm.js → attemptCarry-BaAXPR_w.esm.js} +1 -1
  11. package/dist/authentication.d.ts +3 -3
  12. package/dist/authentication.esm.js +2 -2
  13. package/dist/{authenticationManager-ffZXiENz.esm.js → authenticationManager-B-l8_8tH.esm.js} +4 -4
  14. package/dist/{authenticationManager-CWmh7aSY.d.ts → authenticationManager-DKLRA91K.d.ts} +1 -1
  15. package/dist/{authenticationStateMachine-ebqsPLXI.esm.js → authenticationStateMachine-Cg00UH7p.esm.js} +3 -3
  16. package/dist/{browser-pQZA35G2-Bu4in9gN.esm.js → browser-pQZA35G2-DJEJnmCd.esm.js} +1 -1
  17. package/dist/certificate-issuance.esm.js +2 -2
  18. package/dist/{certificateIssuanceManager-IRO_1Ug6.esm.js → certificateIssuanceManager-CrF3wjCH.esm.js} +2 -2
  19. package/dist/{certificateIssuanceStateMachine-CjxTBZuH.esm.js → certificateIssuanceStateMachine-uSD9IkcV.esm.js} +1 -1
  20. package/dist/consent.esm.js +2 -2
  21. package/dist/{consentManager-DMlSL6Ax.esm.js → consentManager-BD7wwgat.esm.js} +2 -2
  22. package/dist/{consentStateMachine-DIYSMxKQ.esm.js → consentStateMachine-BAiLDE3D.esm.js} +1 -1
  23. package/dist/{cpf-uAZTPUBy.esm.js → cpf-BIADjddF.esm.js} +1 -25
  24. package/dist/cross-document-data-match.esm.js +1 -1
  25. package/dist/{crossDocumentDataMatchManager-BFTdiEDB.esm.js → crossDocumentDataMatchManager-CUc1uACE.esm.js} +2 -2
  26. package/dist/curp-validation.d.ts +1 -1
  27. package/dist/curp-validation.esm.js +2 -2
  28. package/dist/{curpValidationManager-z8428oCM.d.ts → curpValidationManager-Crz3bnCo.d.ts} +1 -1
  29. package/dist/{curpValidationManager-DNpC3wyf.esm.js → curpValidationManager-DBfZSQbu.esm.js} +2 -2
  30. package/dist/{curpValidationStateMachine-B3iVsDyt.esm.js → curpValidationStateMachine-DyAEyScb.esm.js} +2 -2
  31. package/dist/custom-fields.esm.js +1 -1
  32. package/dist/custom-watchlist.esm.js +2 -2
  33. package/dist/{customFieldsManager-CvI-pDT3.esm.js → customFieldsManager-BZhIPyaY.esm.js} +2 -2
  34. package/dist/{customWatchlistManager-BuHtUb0y.esm.js → customWatchlistManager-B4cmxi__.esm.js} +2 -2
  35. package/dist/{customWatchlistStateMachine-CiVD9wyF.esm.js → customWatchlistStateMachine-ZZoDGRAZ.esm.js} +1 -1
  36. package/dist/{deepsightLoader-CJbBiTpq.esm.js → deepsightLoader-S0ktD2dZ.esm.js} +3 -3
  37. package/dist/{addressSearch-DzbE9Ogt.esm.js → definitionSource-1vPLtuXE.esm.js} +1 -72
  38. package/dist/{desktopCameraElection-BGMtYwk3.esm.js → desktopCameraElection-m2dAj6Zu.esm.js} +1 -1
  39. package/dist/document-capture.d.ts +1 -1
  40. package/dist/document-capture.esm.js +2 -2
  41. package/dist/{documentCaptureManager-CD5iQiUI.d.ts → documentCaptureManager-DDfviFg0.d.ts} +1 -1
  42. package/dist/{documentCaptureManager-DLPqruXJ.esm.js → documentCaptureManager-v57klTso.esm.js} +2 -2
  43. package/dist/{documentCaptureStateMachine-DCvWQhFG.esm.js → documentCaptureStateMachine-CgCtimSa.esm.js} +2 -2
  44. package/dist/dynamic-forms.esm.js +2 -2
  45. package/dist/{dynamicFormsManager-C1pBbCWs.esm.js → dynamicFormsManager-BKAlol5I.esm.js} +2 -2
  46. package/dist/{dynamicFormsStateMachine-iVdrXC1r.esm.js → dynamicFormsStateMachine-DTyEVRIb.esm.js} +2 -2
  47. package/dist/ekyb.d.ts +1 -1
  48. package/dist/ekyb.esm.js +2 -2
  49. package/dist/{ekybManager-OZ0SeXvq.esm.js → ekybManager-BYFWVBTW.esm.js} +2 -2
  50. package/dist/{ekybStateMachine-BDh-yJkS.esm.js → ekybStateMachine-CxSx0HNz.esm.js} +6 -4
  51. package/dist/ekyc-prefill.d.ts +17 -0
  52. package/dist/ekyc-prefill.esm.js +3 -0
  53. package/dist/ekyc.d.ts +2 -2
  54. package/dist/ekyc.esm.js +3 -3
  55. package/dist/{ekycManager-DymCvmVB.esm.js → ekycManager-Bwv-qYAZ.esm.js} +2 -2
  56. package/dist/{ekycManager-DlGIn9wA.d.ts → ekycManager-CERRvIfg.d.ts} +1 -1
  57. package/dist/ekycPrefillManager-CbI1rTKP.esm.js +102 -0
  58. package/dist/ekycPrefillManager-DHfC1T9s.d.ts +565 -0
  59. package/dist/ekycPrefillStateMachine-ClGEAsOy.esm.js +686 -0
  60. package/dist/ekycRules-B7vXnbdg.esm.js +319 -0
  61. package/dist/{ekycStateMachine-CoFCUJ2z.esm.js → ekycStateMachine-DlN1RCob.esm.js} +418 -533
  62. package/dist/{ekycUtils-GRuMELYr.esm.js → ekycUtils-K6VJXnOg.esm.js} +18 -6
  63. package/dist/electronic-signature.esm.js +1 -1
  64. package/dist/{electronicSignatureManager-CHe4KM2h.esm.js → electronicSignatureManager-Co_sso4-.esm.js} +3 -3
  65. package/dist/email.esm.js +2 -2
  66. package/dist/{emailManager-CGoE3CUe.esm.js → emailManager-BSaGg1Gl.esm.js} +2 -2
  67. package/dist/{emailStateMachine-KgHfDNvM.esm.js → emailStateMachine-CaoPZtZN.esm.js} +2 -2
  68. package/dist/{events-ggpBBaZ8.esm.js → events-kU5WJU4B.esm.js} +1 -1
  69. package/dist/events.esm.js +1 -1
  70. package/dist/extensibility.d.ts +14 -13
  71. package/dist/extensibility.esm.js +36 -35
  72. package/dist/face-match.esm.js +2 -2
  73. package/dist/{faceCaptureManagerFactory-GmZMp6TR.esm.js → faceCaptureManagerFactory-ErFltb83.esm.js} +2 -2
  74. package/dist/{faceCaptureManagerFactory-DV2ULUYS.d.ts → faceCaptureManagerFactory-ZudYP6Qp.d.ts} +3 -3
  75. package/dist/{faceCaptureSetup--MEv7wIJ.esm.js → faceCaptureSetup-D9VsC504.esm.js} +9 -9
  76. package/dist/{faceMatchManager-D2xKPjjQ.esm.js → faceMatchManager-qPJsa5Ac.esm.js} +2 -2
  77. package/dist/{faceMatchStateMachine-CUvwiQi9.esm.js → faceMatchStateMachine-D90ZHY1r.esm.js} +2 -2
  78. package/dist/{feature-management-hZhfjdAu.esm.js → feature-management-TNTHwnkm.esm.js} +1 -1
  79. package/dist/feature-management.esm.js +1 -1
  80. package/dist/field-comparison.esm.js +1 -1
  81. package/dist/{fieldComparisonManager-DgDbEeFZ.esm.js → fieldComparisonManager-BLLj_Ey1.esm.js} +2 -2
  82. package/dist/fiscal-qr.esm.js +1 -1
  83. package/dist/{fiscalQrManager-BZeklojR.esm.js → fiscalQrManager-Bh3rxb7Y.esm.js} +2 -2
  84. package/dist/flow-events.d.ts +1 -1
  85. package/dist/flow.d.ts +9 -8
  86. package/dist/flow.esm.js +46 -10
  87. package/dist/{flowCompletionService-E8ipjpAG.esm.js → flowCompletionService-BvoiqVJA.esm.js} +2 -2
  88. package/dist/{flowServices-Co77kn9L.esm.js → flowServices-BkrZ4ZU5.esm.js} +8 -8
  89. package/dist/geolocation.esm.js +2 -2
  90. package/dist/{geolocationManager-C8DY8c1D.esm.js → geolocationManager-hU9kxsr8.esm.js} +2 -2
  91. package/dist/{geolocationStateMachine-BluJR9Ew.esm.js → geolocationStateMachine-DyYMzzIb.esm.js} +3 -3
  92. package/dist/government-validation.esm.js +2 -2
  93. package/dist/{governmentValidationManager-CjChjZ3C.esm.js → governmentValidationManager-D5HkBqfr.esm.js} +2 -2
  94. package/dist/{governmentValidationStateMachine-AEbn3Afi.esm.js → governmentValidationStateMachine-BwMClTqC.esm.js} +1 -1
  95. package/dist/home.d.ts +1 -1
  96. package/dist/home.esm.js +1 -1
  97. package/dist/http.esm.js +1 -1
  98. package/dist/id-ocr.d.ts +2 -2
  99. package/dist/id-ocr.esm.js +3 -19
  100. package/dist/id-selfie-flow.d.ts +1 -1
  101. package/dist/id-selfie-flow.esm.js +6 -6
  102. package/dist/id-verification.esm.js +2 -2
  103. package/dist/id.d.ts +2 -2
  104. package/dist/id.esm.js +3 -3
  105. package/dist/{idCaptureManager-CCA2D1Ah.d.ts → idCaptureManager-NRGuCVv2.d.ts} +2 -2
  106. package/dist/{idCaptureManager-6amWi8Ko.esm.js → idCaptureManager-Xxlpem7N.esm.js} +6 -6
  107. package/dist/{idCaptureServices-Bpa4MmVC.esm.js → idCaptureServices-199UFURA.esm.js} +4 -4
  108. package/dist/{idCaptureStateMachine-BzBA2B4_.esm.js → idCaptureStateMachine-Bv-dhwgK.esm.js} +42 -14
  109. package/dist/idOcrCpfUtils-Nfln1Psb.esm.js +18 -0
  110. package/dist/{idOcrManager-BTdHlJ9D.d.ts → idOcrManager-B5xeI2lg.d.ts} +2 -2
  111. package/dist/{idOcrManager-xyEZNOBa.esm.js → idOcrManager-BMK2oou0.esm.js} +2 -2
  112. package/dist/{idOcrStateMachine-DNKXh4Rn.esm.js → idOcrStateMachine-RjNycN07.esm.js} +8 -7
  113. package/dist/{idVerificationManager-DdnvYfgN.esm.js → idVerificationManager-4wY-Ee4j.esm.js} +2 -2
  114. package/dist/{idVerificationStateMachine-DtIBCa32.esm.js → idVerificationStateMachine-Bj00uWvh.esm.js} +1 -1
  115. package/dist/identity-reuse.d.ts +1 -1
  116. package/dist/identity-reuse.esm.js +2 -2
  117. package/dist/{identityReuseManager-CcpovlfD.esm.js → identityReuseManager-CCZ-ES2E.esm.js} +2 -2
  118. package/dist/{identityReuseManager-B1birg5X.d.ts → identityReuseManager-ooAbp6Kc.d.ts} +4 -4
  119. package/dist/{identityReuseStateMachine-DxZFWy47.esm.js → identityReuseStateMachine-BtpkGpYZ.esm.js} +1 -1
  120. package/dist/{index-DC0P2Vzw.d.ts → index-BGnYn_4J.d.ts} +1 -1
  121. package/dist/{index-bD4-zpjs.d.ts → index-DlVDVTcf.d.ts} +31 -16
  122. package/dist/index.d.ts +1 -1
  123. package/dist/index.esm.js +1 -1
  124. package/dist/{invokeOnCaptureCallback-BJ0GVHGr.esm.js → invokeOnCaptureCallback-BkvXSZfa.esm.js} +1 -1
  125. package/dist/kyb-checks.esm.js +2 -2
  126. package/dist/{kybChecksManager-CbqLrEox.esm.js → kybChecksManager-CEEih5pC.esm.js} +1 -1
  127. package/dist/{kybChecksStateMachine-B_GS-KmL.esm.js → kybChecksStateMachine-DOE71Lv7.esm.js} +5 -4
  128. package/dist/mandatory-consent.d.ts +2 -2
  129. package/dist/mandatory-consent.esm.js +2 -2
  130. package/dist/{mandatoryConsentManager-B4vCYslr.esm.js → mandatoryConsentManager-BBeOo3Sz.esm.js} +2 -2
  131. package/dist/{mandatoryConsentManager-CEn59Ytw.d.ts → mandatoryConsentManager-MhZYQg10.d.ts} +1 -1
  132. package/dist/{mandatoryConsentStateMachine-DWslYPA3.esm.js → mandatoryConsentStateMachine-BJEyS63E.esm.js} +1 -1
  133. package/dist/{multipartRecordingService-BTqkHGG9.esm.js → multipartRecordingService-2iVLb-2Y.esm.js} +1 -1
  134. package/dist/phone.esm.js +2 -2
  135. package/dist/{phoneFormat-JJNaWthV.esm.js → phoneFormat-DEpESpz2.esm.js} +13 -1
  136. package/dist/{phoneManager-Dy5tODCU.esm.js → phoneManager-BylOWecM.esm.js} +2 -2
  137. package/dist/{phoneServices-DJgyOzU2.esm.js → phoneServices-Crge7uSV.esm.js} +1 -1
  138. package/dist/{phoneStateMachine-DnlPhnw7.esm.js → phoneStateMachine-CHnhCS-4.esm.js} +2 -2
  139. package/dist/{processFaceMatch-Bst83HaS.esm.js → processFaceMatch-BveUAHts.esm.js} +1 -1
  140. package/dist/qe-signature.esm.js +1 -1
  141. package/dist/{recordingService-CTko6Cjn.esm.js → recordingService-DKXaaOHO.esm.js} +2 -2
  142. package/dist/redirect-to-mobile.esm.js +2 -2
  143. package/dist/{redirectToMobileManager-CCSNyi19.esm.js → redirectToMobileManager-DUpLyXsq.esm.js} +2 -2
  144. package/dist/{redirectToMobileStateMachine-BKyOdAUe.esm.js → redirectToMobileStateMachine-D0DW4y-f.esm.js} +1 -1
  145. package/dist/{resolveForm-O7-r79VA.esm.js → resolveForm-f9PhUo9j.esm.js} +1 -209
  146. package/dist/{runChildModule-DHDczcGZ.esm.js → runChildModule-CDixuH1W.esm.js} +2 -2
  147. package/dist/{sdkVersion-CxaRTa9r.esm.js → sdkVersion-BNA7_9wn.esm.js} +1 -1
  148. package/dist/selfie.d.ts +3 -3
  149. package/dist/selfie.esm.js +9 -9
  150. package/dist/{selfieErrorUtils-Dk0ofKio.esm.js → selfieErrorUtils-Geee35WF.esm.js} +1 -1
  151. package/dist/{selfieManager-DmZFzs1-.d.ts → selfieManager-BPOlD-UN.d.ts} +1 -1
  152. package/dist/{selfieManager-EgnSX_Hu.esm.js → selfieManager-DVWFz5tv.esm.js} +4 -4
  153. package/dist/{selfieStateMachine-B8pBvum8.esm.js → selfieStateMachine-D9KQUtMs.esm.js} +3 -3
  154. package/dist/{session-CaliXPVw.esm.js → session-DoFzV1FT.esm.js} +4 -4
  155. package/dist/session.d.ts +1 -1
  156. package/dist/session.esm.js +5 -5
  157. package/dist/{sessionInitializer-Tr_ZkaSs.esm.js → sessionInitializer-DOZzSzqm.esm.js} +7 -7
  158. package/dist/{setup-Bz4l-E3R.esm.js → setup-B6WhRfCS.esm.js} +10 -13
  159. package/dist/{setup-Dyv1tJFj.d.ts → setup-prV5HQCQ.d.ts} +1 -1
  160. package/dist/signature.esm.js +2 -2
  161. package/dist/{signatureManager-CwqjcxPg.esm.js → signatureManager-QlegdTo3.esm.js} +2 -2
  162. package/dist/{signatureStateMachine-DBVDd1Eu.esm.js → signatureStateMachine-DFbbbFwg.esm.js} +1 -1
  163. package/dist/{stats-CatA2dea.esm.js → stats-Bv5PiWvo.esm.js} +1 -1
  164. package/dist/stats.esm.js +1 -1
  165. package/dist/step-up.d.ts +3 -5
  166. package/dist/step-up.esm.js +5 -11
  167. package/dist/{tri-CKUbuky5.esm.js → tri-B9aoyV2Z.esm.js} +3 -32
  168. package/dist/tri.d.ts +1 -1
  169. package/dist/tri.esm-DgtAka_v.esm.js +2145 -0
  170. package/dist/tri.esm.js +1 -1
  171. package/dist/{trueSightService-DDdJ8TrY.esm.js → trueSightService-nGcZHLsZ.esm.js} +3 -3
  172. package/dist/trust-graph.esm.js +1 -1
  173. package/dist/{types-Csh8vzPo.d.ts → types-0Rr7etmf.d.ts} +1 -1
  174. package/dist/types-B2M1IPZn.d.ts +6 -0
  175. package/dist/{types-BEVHQbbC.d.ts → types-BD9sV5oG.d.ts} +1 -1
  176. package/dist/{types-CuMJ2M7D.d.ts → types-BaDx6utW.d.ts} +4 -1
  177. package/dist/{types-BPm1JSu7.d.ts → types-BpJ21a4T.d.ts} +1 -1
  178. package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
  179. package/dist/{types-CRaFu6wS.d.ts → types-CquDWYfv.d.ts} +6 -2
  180. package/dist/types-D9vIGFbl.d.ts +115 -0
  181. package/dist/{types-Cd0J0F9D.d.ts → types-NMBsvLIN.d.ts} +1 -1
  182. package/dist/usStates-CwOQ2kAx.esm.js +209 -0
  183. package/dist/video-selfie.d.ts +1 -1
  184. package/dist/video-selfie.esm.js +6 -6
  185. package/dist/{videoSelfieCameraWarmer-Dsk8JQNy.esm.js → videoSelfieCameraWarmer-BH8HH2Yo.esm.js} +4 -4
  186. package/dist/{videoSelfieStepDetector-Dv3Mgws-.d.ts → videoSelfieStepDetector-B78BE_x9.d.ts} +2 -2
  187. package/dist/wasm.d.ts +1 -1
  188. package/dist/wasm.esm.js +1 -1
  189. package/dist/watchlist-for-business.esm.js +2 -2
  190. package/dist/watchlist.esm.js +2 -2
  191. package/dist/{watchlistForBusinessManager-DqUpAEj_.esm.js → watchlistForBusinessManager-DOYmIiaj.esm.js} +2 -2
  192. package/dist/{watchlistForBusinessStateMachine-DdaPl2PS.esm.js → watchlistForBusinessStateMachine-D8qIyL8w.esm.js} +1 -1
  193. package/dist/{watchlistManager-CdpXzT4B.esm.js → watchlistManager-BJGLRv-x.esm.js} +2 -2
  194. package/dist/{watchlistStateMachine-ofHW_lPk.esm.js → watchlistStateMachine-DeLfuGSl.esm.js} +1 -1
  195. package/dist/workflow.d.ts +1 -1
  196. package/dist/workflow.esm.js +42 -36
  197. package/package.json +6 -1
  198. package/dist/tri.esm-DvgaFxHR.esm.js +0 -3838
  199. package/dist/types-J6g6iKe_.d.ts +0 -6
@@ -1,3838 +0,0 @@
1
- const e = class t {
2
- constructor() {
3
- this.i = !1;
4
- }
5
- static get instance() {
6
- return t.o || (t.o = new t()), t.o;
7
- }
8
- get DEBUG() {
9
- return this.i;
10
- }
11
- set DEBUG(t) {
12
- this.i = t;
13
- }
14
- warn(t, e, ...n) {
15
- this.i && this.u("warn", t, e, ...n);
16
- }
17
- error(t, e, ...n) {
18
- this.i && this.u("error", t, e, ...n);
19
- }
20
- info(t, e, ...n) {
21
- this.i && this.u("info", t, e, ...n);
22
- }
23
- fatal(t, e, n, ...i) {
24
- this.u(t, e, n, ...i);
25
- }
26
- u(t, e, n, ...i) {
27
- const o = e ? `[${e}]` : "", r = console?.[t];
28
- r && r(`[IncodeTRI]${o} ${n}`, ...i);
29
- }
30
- }.instance;
31
- const i = {
32
- "fpSignalsLib.js": "4f34fe7685ddf14e1214fff0cfcd368655f3e3c6c5da3e4e0abae34def75c133",
33
- "fpSignalsLib.wasm": "4acba14359630961502ae35296ccccb2b97be8b3ef1bfc4182109bd0213cd77d",
34
- "fpSignalsLibSimd.js": "d98037b6db12cb014dc7220df92a95eb4f2ff1e81acea53903054f8106d872c6",
35
- "fpSignalsLibSimd.wasm": "ba478e2ef6b62e345c2adf5a931f6032a0a6307bfeaae25309cfee3b68cef36d"
36
- };
37
- async function o(t) {
38
- const e = new URL(t).pathname.split("/").pop() ?? "", n = i[e];
39
- if (!n) throw new Error(`fpSignals: no digest for ${e}`);
40
- const o = globalThis.crypto?.subtle;
41
- if (!o) throw new Error("fpSignals: crypto.subtle is unavailable, so the files cannot be verified. Serve the page over HTTPS.");
42
- const r = await fetch(t), s = new Uint8Array(await r.arrayBuffer());
43
- if (function(t) {
44
- let e = "";
45
- for (const n of new Uint8Array(t)) e += n.toString(16).padStart(2, "0");
46
- return e;
47
- }(await o.digest("SHA-256", s)) !== n) throw new Error(`fpSignals: ${e} does not match the pinned build`);
48
- return s;
49
- }
50
- var r;
51
- async function s(t) {
52
- const e = t.replace(/\.wasm($|\?)/, ".js$1"), n = await async function(t) {
53
- const e = await o(t), n = URL.createObjectURL(new Blob([e], { type: "text/javascript" }));
54
- try {
55
- return await import(
56
- /* @vite-ignore */
57
- /* webpackIgnore: true */
58
- n
59
- );
60
- } finally {
61
- URL.revokeObjectURL(n);
62
- }
63
- }(e), i = n.Module ?? n.default;
64
- if (!i) throw new Error(`Failed to import Module from ${e}`);
65
- const r = await o(t), s = window.wasmArrayBuffer;
66
- window.wasmArrayBuffer = r;
67
- try {
68
- return await i({ wasmBinary: r });
69
- } finally {
70
- window.wasmArrayBuffer = s;
71
- }
72
- }
73
- (function(t) {
74
- t[t.Device = 1] = "Device", t[t.Behaviour = 2] = "Behaviour", t[t.PID = 3] = "PID";
75
- })(r || (r = {}));
76
- var a = class {
77
- constructor() {
78
- this.wasmModule = null, this.signalsApi = null, this.usedSimd_ = !1;
79
- }
80
- async initialize(t, n, i = !0) {
81
- if (this.signalsApi) return;
82
- const o = i && !!n;
83
- try {
84
- this.wasmModule = await s(o ? n : t), this.usedSimd_ = o;
85
- } catch (n) {
86
- if (!o) throw n;
87
- e.warn("FpSignals", "SIMD init error:", n), this.wasmModule = await s(t), this.usedSimd_ = !1;
88
- }
89
- this.signalsApi = new this.wasmModule.FpSignals();
90
- }
91
- get usedSimd() {
92
- return this.usedSimd_;
93
- }
94
- isReady() {
95
- return null !== this.signalsApi;
96
- }
97
- setHostInfo(t, e) {
98
- this.api().shi(t, e);
99
- }
100
- async collect() {
101
- const t = this.api();
102
- for (; !t.ppf();) await new Promise((t) => setTimeout(t, 0));
103
- }
104
- setBehaviourCollectionEnabled(t) {
105
- this.api().sbc(t);
106
- }
107
- getSignals(t) {
108
- return this.api().gsd(t);
109
- }
110
- freeResources() {
111
- this.signalsApi && (this.signalsApi.delete(), this.signalsApi = null), this.wasmModule = null;
112
- }
113
- api() {
114
- if (!this.signalsApi) throw new Error("FpSignals has not been initialized");
115
- return this.signalsApi;
116
- }
117
- };
118
- function c(t) {
119
- return !!t && t.nodeType === Node.TEXT_NODE;
120
- }
121
- function u(t, e) {
122
- return t.tagName?.toLowerCase() === e.toLowerCase();
123
- }
124
- function l(t) {
125
- return !!t && t.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
126
- }
127
- function d(t) {
128
- return !!t && t.hasAttribute("data-tri-ignore");
129
- }
130
- function f(t) {
131
- return !!t && t.hasAttribute("data-tri-redact");
132
- }
133
- function h(t, e) {
134
- return e?.includes(t.toLowerCase()) ?? !1;
135
- }
136
- function m(t) {
137
- try {
138
- return new URL(t).origin !== window.location.origin;
139
- } catch {
140
- return !1;
141
- }
142
- }
143
- function p(t, e) {
144
- return !t || (t[e]?.enabled ?? !1);
145
- }
146
- function w() {
147
- const t = document.activeElement;
148
- if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {
149
- const e = t.selectionStart, n = t.selectionEnd;
150
- return null == e || null == n || e === n ? null : t.value.substring(e, n);
151
- }
152
- const e = window.getSelection();
153
- return !e || e.isCollapsed ? null : e.toString() || null;
154
- }
155
- function y(t, e) {
156
- return "off" !== e && !d(t) && !f(t);
157
- }
158
- function v(t) {
159
- const e = document.activeElement;
160
- if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) return e;
161
- const n = window.getSelection();
162
- return (i = ("start" === t ? n?.anchorNode : n?.focusNode) ?? null) ? c(i) ? i.parentElement : i instanceof Element ? i : null : null;
163
- var i;
164
- }
165
- const g = /* @__PURE__ */ new Set([
166
- "hidden",
167
- "submit",
168
- "button",
169
- "reset",
170
- "image"
171
- ]);
172
- const b = "[data-tri-flush]";
173
- const k = "[data-tri-ignore]";
174
- function T(t, e, n) {
175
- let i = t, o = e;
176
- if ("devicepixelratiochange" === e) {
177
- const t = window.devicePixelRatio;
178
- i = window.matchMedia(`(resolution: ${t}dppx)`), o = "change";
179
- }
180
- i.addEventListener(o, n, {
181
- capture: !0,
182
- passive: !0
183
- });
184
- }
185
- function x(t, e, n) {
186
- let i = t, o = e;
187
- if ("devicepixelratiochange" === e) {
188
- const t = window.devicePixelRatio;
189
- i = window.matchMedia(`(resolution: ${t}dppx)`), o = "change";
190
- }
191
- i.removeEventListener(o, n, { capture: !0 });
192
- }
193
- const S = globalThis.setTimeout.bind(globalThis);
194
- const M = globalThis.clearTimeout.bind(globalThis);
195
- function I(t, n) {
196
- try {
197
- return t();
198
- } catch (t) {
199
- e.warn("utils", "safeSync swallowed error:", t);
200
- }
201
- }
202
- async function A(t) {
203
- try {
204
- return await t();
205
- } catch (t) {
206
- e.warn("utils", "safeAsync swallowed error:", t);
207
- }
208
- }
209
- function E(t) {
210
- return (e) => I(() => t(e));
211
- }
212
- function _(t) {
213
- return (...n) => {
214
- try {
215
- t(...n);
216
- } catch (t) {
217
- e.warn("utils", "safeTimer swallowed error:", t);
218
- }
219
- };
220
- }
221
- function D(t, e) {
222
- return S(_(t), e);
223
- }
224
- function C(t) {
225
- if (null !== t) try {
226
- M(t);
227
- } catch (t) {
228
- e.warn("utils", "safeClearTimeout swallowed error:", t);
229
- }
230
- }
231
- let L = null;
232
- const R = /* @__PURE__ */ new Set([
233
- "xmlhttprequest",
234
- "fetch",
235
- "beacon",
236
- "navigation",
237
- "script",
238
- "link",
239
- "css",
240
- "img",
241
- "iframe",
242
- "video",
243
- "audio"
244
- ]);
245
- const z = /* @__PURE__ */ new Set([
246
- "xmlhttprequest",
247
- "fetch",
248
- "beacon"
249
- ]);
250
- function P(t, e) {
251
- return e ? t : null;
252
- }
253
- function $(t, e) {
254
- const n = t, i = t.responseStart > 0, o = P(t.domainLookupEnd - t.domainLookupStart, i), r = P(t.connectEnd - t.connectStart, i), s = P(t.connectEnd > 0 && t.secureConnectionStart > 0 ? t.connectEnd - t.secureConnectionStart : 0, i), a = P(t.responseStart - t.requestStart, i), c = P(t.responseEnd - t.responseStart, i), u = i ? t.transferSize : null, l = i ? t.encodedBodySize : null, d = i ? t.decodedBodySize : null, f = i && t.nextHopProtocol || null, h = i && void 0 !== n.deliveryType ? n.deliveryType : null, m = n.responseStatus, p = void 0 !== m && 0 !== m ? m : null;
255
- return {
256
- name: "network_request",
257
- timestamp: Date.now(),
258
- performanceTime: t.startTime + t.duration,
259
- url: e(t.name),
260
- initiatorType: (w = t.initiatorType, R.has(w) ? w : "other"),
261
- startTime: t.startTime,
262
- durationMs: t.duration,
263
- dnsLookupMs: o,
264
- tcpConnectMs: r,
265
- tlsHandshakeMs: s,
266
- ttfbMs: a,
267
- responseDownloadMs: c,
268
- transferSize: u,
269
- encodedBodySize: l,
270
- decodedBodySize: d,
271
- nextHopProtocol: f,
272
- deliveryType: h,
273
- responseStatus: p
274
- };
275
- var w;
276
- }
277
- function H() {}
278
- const F = 2e3;
279
- const U = /* @__PURE__ */ new WeakMap();
280
- let O = 0;
281
- function B(t) {
282
- let e = U.get(t);
283
- return void 0 === e && (e = ++O, U.set(t, e)), e;
284
- }
285
- const j = {
286
- focusin: "in",
287
- focusout: "out"
288
- };
289
- function N(t) {
290
- const e = t instanceof HTMLInputElement && ("checkbox" === t.type || "radio" === t.type);
291
- return {
292
- elementId: B(t),
293
- tagName: t.tagName.toLowerCase(),
294
- type: t.type,
295
- valueLength: t.value.length,
296
- checked: e ? t.checked : null,
297
- visible: X(t)
298
- };
299
- }
300
- function q(t) {
301
- return t instanceof HTMLInputElement || t instanceof HTMLSelectElement || t instanceof HTMLTextAreaElement;
302
- }
303
- function W(t) {
304
- return t instanceof HTMLInputElement ? !g.has(t.type) : q(t);
305
- }
306
- function X(t) {
307
- return t.getClientRects().length > 0 && "hidden" !== getComputedStyle(t).visibility;
308
- }
309
- function Y(t) {
310
- return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement;
311
- }
312
- const J = /* @__PURE__ */ new Set([
313
- "Escape",
314
- "Shift",
315
- "Control",
316
- "Alt",
317
- "Meta",
318
- "Backspace",
319
- "Delete",
320
- "Enter",
321
- "Tab",
322
- "CapsLock",
323
- "ArrowUp",
324
- "ArrowDown",
325
- "ArrowLeft",
326
- "ArrowRight"
327
- ]);
328
- const G = {
329
- mouse: "mouse",
330
- touch: "touch",
331
- pen: "pen"
332
- };
333
- const V = {
334
- pointerdown: "down",
335
- pointerup: "up",
336
- click: "click",
337
- dblclick: "dblclick",
338
- contextmenu: "contextmenu"
339
- };
340
- function Z(t, e, n, i, o) {
341
- return {
342
- name: "navigation",
343
- timestamp: Date.now(),
344
- ts: performance.now(),
345
- phase: t,
346
- type: e,
347
- from: n.from,
348
- to: n.to,
349
- timeOrigin: i,
350
- timing: o
351
- };
352
- }
353
- function K(t) {
354
- return t instanceof Element ? t.closest("button, a, input, select, textarea, label") : null;
355
- }
356
- const Q = /* @__PURE__ */ new Set([
357
- "button",
358
- "a",
359
- "input",
360
- "select",
361
- "textarea",
362
- "label"
363
- ]);
364
- let tt = 0;
365
- let et = 0;
366
- let nt = 0;
367
- let it = 0;
368
- let ot = 0;
369
- let rt = 0;
370
- let st = 0;
371
- let at = 0;
372
- const ct = [];
373
- let ut = 0;
374
- let lt = 0;
375
- let dt = 0;
376
- let ft = 0;
377
- let ht = !1;
378
- const mt = [];
379
- let pt = null;
380
- let wt = 0;
381
- function yt(t) {
382
- const e = performance.now(), n = e - nt, i = n > 0 ? (t.clientX - tt) / n : 0, o = n > 0 ? (t.clientY - et) / n : 0;
383
- if (Math.sqrt((t.clientX - tt) ** 2 + (t.clientY - et) ** 2), tt = t.clientX, et = t.clientY, nt = e, ut = t.clientX, lt = t.clientY, mt.push({
384
- x: t.clientX,
385
- y: t.clientY
386
- }), ot++, void 0 !== t.movementX && (rt += Math.abs(t.movementX), st += Math.abs(t.movementY), at++), e - it < 50) return;
387
- it = e;
388
- const r = t.clientX % 1 != 0 || t.clientY % 1 != 0, s = ot;
389
- ot = 0;
390
- const a = at, c = a > 0 ? rt / a : 0, u = a > 0 ? st / a : 0;
391
- rt = 0, st = 0, at = 0, ct.push({
392
- type: "mouse",
393
- t: e,
394
- data: {
395
- x: t.clientX,
396
- y: t.clientY,
397
- vx: i,
398
- vy: o,
399
- ...r && { subpixel: r },
400
- rawCount: s,
401
- ...a > 0 && {
402
- movementX: t.movementX,
403
- movementY: t.movementY,
404
- mvXAvg: c,
405
- mvYAvg: u
406
- }
407
- }
408
- });
409
- }
410
- function vt(t) {
411
- ct.push({
412
- type: "mouse",
413
- t: performance.now(),
414
- data: (() => {
415
- let e, n, i, o, r;
416
- try {
417
- const s = t.target;
418
- if (s && "function" == typeof s.getBoundingClientRect) {
419
- const a = s.getBoundingClientRect();
420
- a.width > 0 && a.height > 0 && (e = t.clientX - (a.left + a.width / 2), n = t.clientY - (a.top + a.height / 2), o = a.width, r = a.height), i = a.top + window.scrollY;
421
- }
422
- } catch {}
423
- const s = t.clientX % 1 != 0 || t.clientY % 1 != 0, a = Math.sqrt((t.clientX - ut) ** 2 + (t.clientY - lt) ** 2);
424
- let c, u, l;
425
- if (ht && mt.length >= 2) {
426
- const e = Math.sqrt((t.clientX - dt) ** 2 + (t.clientY - ft) ** 2);
427
- if (e > 5) {
428
- let n = 0, i = mt[0];
429
- for (let t = 1; t < mt.length; t++) n += Math.sqrt((mt[t].x - i.x) ** 2 + (mt[t].y - i.y) ** 2), i = mt[t];
430
- c = n / e;
431
- let o = 0;
432
- for (let t = 2; t < mt.length; t++) {
433
- const e = mt[t - 1].x - mt[t - 2].x, n = mt[t - 1].y - mt[t - 2].y, i = mt[t].x - mt[t - 1].x, r = mt[t].y - mt[t - 1].y, s = e * i + n * r, a = Math.sqrt(e * e + n * n), c = Math.sqrt(i * i + r * r);
434
- if (a > 0 && c > 0) {
435
- const t = Math.max(-1, Math.min(1, s / (a * c)));
436
- Math.acos(t) > .5 && o++;
437
- }
438
- }
439
- u = o;
440
- const r = t.clientX - dt, s = t.clientY - ft;
441
- let a = 0;
442
- for (const n of mt) a += Math.abs(s * n.x - r * n.y + t.clientX * ft - t.clientY * dt) / e;
443
- l = a / mt.length;
444
- }
445
- }
446
- return dt = t.clientX, ft = t.clientY, ht = !0, mt.length = 0, {
447
- x: t.clientX,
448
- y: t.clientY,
449
- vx: 0,
450
- vy: 0,
451
- click: !0,
452
- isTrusted: t.isTrusted,
453
- targetType: t.target?.tagName?.toLowerCase() ?? "unknown",
454
- ...void 0 !== e && {
455
- clickOffsetX: e,
456
- clickOffsetY: n
457
- },
458
- ...void 0 !== i && { elementY: i },
459
- ...void 0 !== o && {
460
- elementW: o,
461
- elementH: r
462
- },
463
- ...s && { subpixel: s },
464
- teleportDist: a,
465
- ...void 0 !== c && { straightness: c },
466
- ...void 0 !== u && { directionChanges: u },
467
- ...void 0 !== l && { jitter: l }
468
- };
469
- })()
470
- });
471
- }
472
- function gt(t) {
473
- ct.push({
474
- type: "mouse",
475
- t: performance.now(),
476
- data: {
477
- x: t.clientX,
478
- y: t.clientY,
479
- vx: 0,
480
- vy: 0,
481
- contextmenu: !0,
482
- isTrusted: t.isTrusted
483
- }
484
- });
485
- }
486
- function bt(t) {
487
- const e = t.target;
488
- Q.has(e.tagName?.toLowerCase()) && (pt = e, wt = performance.now());
489
- }
490
- function kt(t) {
491
- const e = t.target;
492
- if (e !== pt || 0 === wt) return;
493
- const n = performance.now() - wt;
494
- pt = null, wt = 0, n < 20 || ct.push({
495
- type: "mouse",
496
- t: performance.now(),
497
- data: {
498
- x: 0,
499
- y: 0,
500
- vx: 0,
501
- vy: 0,
502
- dwell: !0,
503
- dwellMs: n,
504
- targetType: e.tagName?.toLowerCase() ?? "unknown"
505
- }
506
- });
507
- }
508
- function Tt() {
509
- return ct.splice(0);
510
- }
511
- const xt = [];
512
- const St = /* @__PURE__ */ new Map();
513
- let Mt = 0;
514
- let It = 0;
515
- const At = [];
516
- let Et = !1;
517
- function _t(t) {
518
- const e = performance.now(), n = Mt > 0 ? e - Mt : 0;
519
- (n > 500 || 0 === Mt) && It++, Mt = e, St.set(t.code, e);
520
- const i = "Backspace" === t.key || "Delete" === t.key, o = (/* @__PURE__ */ new Set([
521
- "Tab",
522
- "Enter",
523
- "Escape",
524
- "ArrowUp",
525
- "ArrowDown",
526
- "ArrowLeft",
527
- "ArrowRight"
528
- ])).has(t.key) ? t.key : void 0, r = t.shiftKey || t.ctrlKey || t.altKey || t.metaKey ? {
529
- shift: t.shiftKey,
530
- ctrl: t.ctrlKey,
531
- alt: t.altKey,
532
- meta: t.metaKey
533
- } : void 0;
534
- xt.push({
535
- type: "keyboard",
536
- t: e,
537
- data: {
538
- interKeyDelay: n,
539
- holdDuration: 0,
540
- isRepeat: t.repeat,
541
- targetType: t.target?.tagName?.toLowerCase() ?? "unknown",
542
- isTrusted: t.isTrusted,
543
- isCorrection: i,
544
- burstId: It,
545
- ...void 0 !== o && { navKey: o },
546
- ...void 0 !== r && { modifiers: r }
547
- }
548
- });
549
- }
550
- function Dt(t) {
551
- const e = performance.now(), n = St.get(t.code);
552
- if (void 0 === n) return;
553
- const i = e - n;
554
- St.delete(t.code);
555
- for (let t = xt.length - 1; t >= 0; t--) {
556
- const e = xt[t];
557
- if ("keyboard" === e.type && 0 === e.data.holdDuration) {
558
- e.data.holdDuration = i;
559
- break;
560
- }
561
- }
562
- if (!Et && i > 0 && i < 300 && !(/* @__PURE__ */ new Set([
563
- "Tab",
564
- "Enter",
565
- "Escape",
566
- "ArrowUp",
567
- "ArrowDown",
568
- "ArrowLeft",
569
- "ArrowRight"
570
- ])).has(t.key) && (At.push(i), At.length >= 8)) {
571
- const t = At.reduce((t, e) => t + e, 0) / At.length, n = At.reduce((e, n) => e + (n - t) ** 2, 0) / At.length, i = Math.sqrt(n);
572
- i < 2.5 && (Et = !0, xt.push({
573
- type: "keyboard",
574
- t: e,
575
- data: {
576
- action: "hold-uniform",
577
- sampleCount: At.length,
578
- stddevMs: Math.round(10 * i) / 10,
579
- meanMs: Math.round(10 * t) / 10
580
- }
581
- }));
582
- }
583
- }
584
- function Ct(t) {
585
- xt.push({
586
- type: "clipboard",
587
- t: performance.now(),
588
- data: {
589
- action: "paste",
590
- targetType: t.target?.tagName?.toLowerCase() ?? "unknown",
591
- isTrusted: t.isTrusted
592
- }
593
- });
594
- }
595
- function Lt() {
596
- return xt.splice(0);
597
- }
598
- const Rt = [];
599
- let zt = 0;
600
- let Pt = 0;
601
- let $t = 0;
602
- function Ht() {
603
- const t = performance.now(), e = window.scrollY, n = t - Pt, i = n > 0 ? (e - zt) / n : 0;
604
- zt = e, Pt = t, t - $t < 100 || ($t = t, Rt.push({
605
- type: "scroll",
606
- t,
607
- data: {
608
- x: window.scrollX,
609
- y: e,
610
- vy: i
611
- }
612
- }));
613
- }
614
- function Ft(t) {
615
- const e = t.deltaY % 1 != 0;
616
- Rt.push({
617
- type: "scroll",
618
- t: performance.now(),
619
- data: {
620
- x: window.scrollX,
621
- y: window.scrollY,
622
- vy: 0,
623
- deltaY: t.deltaY,
624
- deltaFractional: e
625
- }
626
- });
627
- }
628
- function Ut() {
629
- return Rt.splice(0);
630
- }
631
- const Ot = [];
632
- let Bt = 0;
633
- let jt = !1;
634
- let Nt = null;
635
- let qt = [];
636
- let Wt = 0;
637
- let Xt = 0;
638
- function Yt() {
639
- Ot.push({
640
- type: "page",
641
- t: performance.now(),
642
- data: { event: document.hidden ? "hidden" : "visible" }
643
- });
644
- }
645
- function Jt() {
646
- Zt(), Ot.push({
647
- type: "page",
648
- t: performance.now(),
649
- data: { event: "focus" }
650
- });
651
- }
652
- function Gt() {
653
- Ot.push({
654
- type: "page",
655
- t: performance.now(),
656
- data: { event: "blur" }
657
- });
658
- }
659
- function Vt() {
660
- Nt && (clearInterval(Nt), Nt = null), qt = [];
661
- }
662
- function Zt() {
663
- const t = performance.now();
664
- jt && (jt = !1, Vt(), Ot.push({
665
- type: "page",
666
- t,
667
- data: { event: "idle-end" }
668
- })), Bt = t;
669
- }
670
- function Kt() {
671
- Zt();
672
- }
673
- function Qt() {
674
- try {
675
- const t = (document.body?.innerText || "").length, e = document.querySelectorAll("input,button,a,select,textarea").length, n = document.documentElement.scrollHeight > 0 ? document.documentElement.scrollHeight / window.innerHeight : 1;
676
- Ot.push({
677
- type: "page",
678
- t: performance.now(),
679
- data: {
680
- event: "page-complexity",
681
- textLength: t,
682
- interactiveCount: e,
683
- scrollRatio: Math.round(100 * n) / 100,
684
- url: location.pathname
685
- }
686
- });
687
- } catch {}
688
- }
689
- function te() {
690
- return function() {
691
- const t = performance.now();
692
- !jt && Bt > 0 && t - Bt >= 5e3 && (jt = !0, Ot.push({
693
- type: "page",
694
- t: Bt + 5e3,
695
- data: { event: "idle-start" }
696
- }), function() {
697
- if (Nt) return;
698
- qt = [], Wt = 0, Xt = 0;
699
- const t = (t) => {
700
- Wt = t.clientX, Xt = t.clientY;
701
- };
702
- document.addEventListener("mousemove", t, { passive: !0 });
703
- let e = 0;
704
- Nt = setInterval(() => {
705
- if (e += 100, 0 === Wt && 0 === Xt || qt.push({
706
- x: Wt,
707
- y: Xt,
708
- t: performance.now()
709
- }), e >= 2e3) {
710
- if (document.removeEventListener("mousemove", t), Nt && (clearInterval(Nt), Nt = null), qt.length >= 2) {
711
- let t = 0;
712
- const e = [];
713
- for (let n = 1; n < qt.length; n++) {
714
- const i = qt[n].x - qt[n - 1].x, o = qt[n].y - qt[n - 1].y, r = Math.sqrt(i * i + o * o);
715
- t += r, e.push(r);
716
- }
717
- const n = e.filter((t) => t > 0).length;
718
- Ot.push({
719
- type: "page",
720
- t: performance.now(),
721
- data: {
722
- event: "idle-movement",
723
- samples: qt.length,
724
- totalDistance: Math.round(100 * t) / 100,
725
- nonZeroDeltas: n,
726
- maxDelta: Math.round(100 * Math.max(...e)) / 100
727
- }
728
- });
729
- } else Ot.push({
730
- type: "page",
731
- t: performance.now(),
732
- data: {
733
- event: "idle-movement",
734
- samples: qt.length,
735
- totalDistance: 0,
736
- nonZeroDeltas: 0,
737
- maxDelta: 0
738
- }
739
- });
740
- qt = [];
741
- }
742
- }, 100);
743
- }());
744
- }(), Ot.splice(0);
745
- }
746
- const ee = [];
747
- const ne = /* @__PURE__ */ new WeakSet();
748
- function ie(t) {
749
- const e = t.target;
750
- if (!e || !e.tagName) return;
751
- const n = e.tagName.toLowerCase();
752
- if (![
753
- "input",
754
- "textarea",
755
- "select",
756
- "button",
757
- "a"
758
- ].includes(n)) return;
759
- if (ne.has(e)) return;
760
- let i = function(t) {
761
- window.getComputedStyle(t);
762
- let e = t;
763
- for (; e && e !== document.documentElement;) {
764
- const t = window.getComputedStyle(e);
765
- if ("none" === t.display) return "display-none";
766
- if ("hidden" === t.visibility) return "visibility-hidden";
767
- if (0 === parseFloat(t.opacity)) return "opacity-zero";
768
- const n = e.getBoundingClientRect();
769
- if ((n.right < 0 || n.bottom < 0 || n.left > window.innerWidth || n.top > window.innerHeight) && ("absolute" === t.position || "fixed" === t.position)) return "off-screen";
770
- if (!(0 !== n.width && 0 !== n.height || "hidden" !== t.overflow || "absolute" !== t.position && "fixed" !== t.position)) return "zero-size";
771
- if (t.clipPath && "none" !== t.clipPath && t.clipPath.includes("inset(100%)")) return "clip-path";
772
- const i = t.clip;
773
- if (i && "auto" !== i && i.includes("rect(0")) return "clip-rect";
774
- e = e.parentElement;
775
- }
776
- return "true" === t.getAttribute("aria-hidden") ? "aria-hidden" : null;
777
- }(e);
778
- if (!i) {
779
- let t = e;
780
- for (; t && t !== document.documentElement;) {
781
- const e = t.getAttribute("data-hp");
782
- if (e) {
783
- i = e;
784
- break;
785
- }
786
- t = t.parentElement;
787
- }
788
- }
789
- if (!i) return;
790
- ne.add(e);
791
- const o = e.name || e.id || e.getAttribute("aria-label") || "unknown";
792
- ee.push({
793
- type: "honeypot",
794
- t: performance.now(),
795
- data: {
796
- action: t.type,
797
- tagName: n,
798
- fieldName: o,
799
- hidingMethod: i
800
- }
801
- });
802
- }
803
- function oe() {
804
- return ee.splice(0);
805
- }
806
- const re = [];
807
- const se = /* @__PURE__ */ new Map();
808
- const ae = /* @__PURE__ */ new Set();
809
- const ce = /* @__PURE__ */ new WeakSet();
810
- let ue = 0;
811
- let le = 0;
812
- const de = /* @__PURE__ */ new WeakSet();
813
- const fe = /* @__PURE__ */ new WeakSet();
814
- let he = 0;
815
- let me = 0;
816
- const pe = [];
817
- let we = null;
818
- const ye = /* @__PURE__ */ new Map();
819
- let ve = 0;
820
- let ge = 0;
821
- const be = /* @__PURE__ */ new WeakSet();
822
- let ke = 0;
823
- let Te = 0;
824
- let xe = 0;
825
- const Se = /* @__PURE__ */ new WeakSet();
826
- function Me(t) {
827
- const e = t.target;
828
- e && (ae.add(e), ce.add(e));
829
- }
830
- function Ie() {
831
- const t = Array.from(document.querySelectorAll("input:not([type=\"hidden\"]):not([type=\"submit\"]):not([type=\"button\"]):not([type=\"reset\"]), textarea")).filter((t) => {
832
- const e = getComputedStyle(t);
833
- return "none" !== e.display && "hidden" !== e.visibility && parseFloat(e.opacity) > 0;
834
- }), e = t.filter((t) => "" !== Re(t)).length, n = t.some((t) => He(t));
835
- e >= 2 && !n && re.push({
836
- type: "form",
837
- t: performance.now(),
838
- data: { action: "form-submit-no-keyboard" }
839
- });
840
- }
841
- function Ae(t) {
842
- const e = t.target;
843
- if (e && Le(e) && !ye.has(e)) {
844
- const t = 0 === ke, n = e.hasAttribute("autofocus"), i = performance.now() - ke;
845
- ye.set(e, t || n || i <= 300 ? "tab" : "programmatic");
846
- }
847
- }
848
- function Ee(t) {
849
- ke = performance.now();
850
- const e = t.target;
851
- e && Le(e) && ye.set(e, "mouse");
852
- }
853
- function _e(t) {
854
- "Tab" === t.key && (ke = performance.now());
855
- }
856
- function De() {
857
- ke = performance.now();
858
- }
859
- function Ce(t) {
860
- const e = t, n = t.target;
861
- n && Le(n) && "insertReplacementText" !== e.inputType && (e.inputType ? pe.push({
862
- type: "form",
863
- t: performance.now(),
864
- data: {
865
- action: "input-method",
866
- fieldName: ze(n),
867
- inputType: e.inputType
868
- }
869
- }) : He(n) || Ue(n));
870
- }
871
- function Le(t) {
872
- const e = t.tagName;
873
- return "INPUT" === e || "TEXTAREA" === e || "SELECT" === e;
874
- }
875
- function Re(t) {
876
- return t.value;
877
- }
878
- function ze(t) {
879
- return t.getAttribute("name") || t.getAttribute("id") || t.tagName.toLowerCase();
880
- }
881
- function Pe() {
882
- return Array.from(document.querySelectorAll("input, textarea, select"));
883
- }
884
- const $e = /* @__PURE__ */ new Set([
885
- "text",
886
- "password",
887
- "email",
888
- "search",
889
- "tel",
890
- "url",
891
- "number"
892
- ]);
893
- function He(t) {
894
- return ce.has(t);
895
- }
896
- function Fe(t) {
897
- return "TEXTAREA" === t.tagName || $e.has(t.type);
898
- }
899
- function Ue(t) {
900
- var e;
901
- Fe(t) && (fe.has(t) || (fe.add(t), le++, de.has(t) || (de.add(t), ue++), re.push({
902
- type: "form",
903
- t: performance.now(),
904
- data: {
905
- action: "programmatic-fill",
906
- fieldName: ze(t),
907
- fieldType: (e = t, e.type || e.tagName.toLowerCase())
908
- }
909
- })));
910
- }
911
- function Oe(t) {
912
- for (const e of t) Le(e) && (se.has(e) || se.set(e, Re(e)), Be(e));
913
- }
914
- function Be(t) {
915
- if (!Fe(t)) return;
916
- if (t.l) return;
917
- const e = t instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "value");
918
- if (n && !n.configurable) return;
919
- const i = n?.get && n?.set ? n : Object.getOwnPropertyDescriptor(e, "value");
920
- if (!i?.get || !i?.set) return;
921
- t.l = !0;
922
- const o = i.get, r = i.set;
923
- Object.defineProperty(t, "value", {
924
- get() {
925
- return o.call(this);
926
- },
927
- set(e) {
928
- const n = o.call(this);
929
- r.call(this, e), He(t) || ("" === n || "" !== e && e === n || Ue(t), "" === n && "" !== e && Ue(t));
930
- },
931
- configurable: !0
932
- });
933
- }
934
- function je() {
935
- const t = Pe();
936
- for (const e of t) {
937
- if (!Le(e)) continue;
938
- const t = e.type;
939
- if ("submit" === t || "button" === t || "reset" === t) continue;
940
- const n = Re(e);
941
- n !== (se.get(e) ?? "") && "" !== n && (de.has(e) || (de.add(e), ue++), He(e) || Ue(e)), se.set(e, n);
942
- }
943
- for (const e of t) Le(e) && (be.has(e) || "tab" === ye.get(e) && ae.has(e) && Re(e) && (be.add(e), ve++));
944
- for (const e of t) Le(e) && (Se.has(e) || "programmatic" === ye.get(e) && ae.has(e) && Re(e) && (Se.add(e), Te++));
945
- for (const [t] of se) t.isConnected || se.delete(t);
946
- for (const [t] of ye) t.isConnected || ye.delete(t);
947
- ae.clear();
948
- const e = function() {
949
- const t = document.querySelectorAll("input:not([type=\"hidden\"]):not([type=\"submit\"]):not([type=\"button\"]):not([type=\"reset\"]), textarea, select");
950
- let e = 0;
951
- for (let n = 0; n < t.length; n++) {
952
- const i = t[n], o = getComputedStyle(i);
953
- "none" !== o.display && "hidden" !== o.visibility && parseFloat(o.opacity) > 0 && i.offsetWidth > 0 && i.offsetHeight > 0 && e++;
954
- }
955
- return e;
956
- }();
957
- ue === he && le === me && ve === ge && Te === xe || (he = ue, me = le, ge = ve, xe = Te, re.push({
958
- type: "form",
959
- t: performance.now(),
960
- data: {
961
- action: "field-count",
962
- visibleFieldCount: e,
963
- filledFieldCount: ue,
964
- programmaticFillCount: le,
965
- tabNavFillCount: ve,
966
- unfocusedFieldFillCount: Te
967
- }
968
- }));
969
- const n = re.splice(0);
970
- return n.push(...pe.splice(0)), n;
971
- }
972
- function Ne() {
973
- try {
974
- const t = [
975
- navigator.userAgent,
976
- screen.width,
977
- screen.height,
978
- navigator.hardwareConcurrency ?? 0,
979
- navigator.language,
980
- Intl.DateTimeFormat().resolvedOptions().timeZone
981
- ].join("|");
982
- return btoa(t).slice(0, 32);
983
- } catch {
984
- return "unknown";
985
- }
986
- }
987
- const qe = "_ad_batch_seq";
988
- let We = null;
989
- let Xe = 0;
990
- let Ye = "";
991
- let Je = null;
992
- let Ge = null;
993
- let Ve = [];
994
- let Ze = null;
995
- function Ke(t, e) {
996
- try {
997
- sessionStorage.setItem(qe, JSON.stringify({
998
- sid: t,
999
- seq: e
1000
- }));
1001
- } catch {}
1002
- }
1003
- function Qe() {
1004
- const t = Je?.() ?? "";
1005
- t && t !== Ye && (Ye = t, Xe = function(t) {
1006
- try {
1007
- const e = sessionStorage.getItem(qe);
1008
- if (e) {
1009
- const n = JSON.parse(e);
1010
- if (n.sid === t) return n.seq;
1011
- }
1012
- } catch {}
1013
- return 0;
1014
- }(t));
1015
- }
1016
- function tn(t, e, n, i) {
1017
- We = t, Je = e, Ye = "", Ve = n, Ze = i, Qe(), Ge = setInterval(() => {
1018
- (async function() {
1019
- const t = Ve.flatMap((t) => t());
1020
- if (0 === t.length) return;
1021
- Qe();
1022
- const e = Xe, n = {
1023
- sessionId: Ye,
1024
- pageUrl: location.href,
1025
- batchSequence: e,
1026
- timestamp: Date.now(),
1027
- events: t,
1028
- browserFp: Ne()
1029
- };
1030
- 0 === e && Ze && (n.device = await Ze()), Xe++, Ke(Ye, Xe);
1031
- try {
1032
- We?.send(n);
1033
- } catch {}
1034
- })();
1035
- }, 2e3), document.addEventListener("visibilitychange", en), window.addEventListener("beforeunload", nn);
1036
- }
1037
- function en() {
1038
- document.hidden && on();
1039
- }
1040
- function nn() {
1041
- on();
1042
- }
1043
- function on() {
1044
- const t = Ve.flatMap((t) => t());
1045
- if (0 === t.length) return;
1046
- Qe();
1047
- const e = Xe++;
1048
- Ke(Ye, Xe);
1049
- const n = {
1050
- sessionId: Ye,
1051
- pageUrl: location.href,
1052
- batchSequence: e,
1053
- timestamp: Date.now(),
1054
- events: t,
1055
- browserFp: Ne()
1056
- };
1057
- We?.beacon(n);
1058
- }
1059
- function rn(t) {
1060
- let e = 2166136261;
1061
- for (let n = 0; n < t.length; n++) e ^= t.charCodeAt(n), e = 16777619 * e >>> 0;
1062
- return e.toString(16).padStart(8, "0");
1063
- }
1064
- function sn() {
1065
- try {
1066
- const t = document.createElement("canvas");
1067
- t.width = 200, t.height = 50;
1068
- const e = t.getContext("2d");
1069
- if (!e) return "no-ctx";
1070
- e.textBaseline = "top", e.font = "14px 'Arial'", e.fillStyle = "#f60", e.fillRect(125, 1, 62, 20), e.fillStyle = "#069", e.fillText("Cwm fjordbank glyphs vext quiz!", 2, 15), e.fillStyle = "rgba(102, 204, 0, 0.7)", e.fillRect(100, 5, 80, 40), e.beginPath(), e.arc(50, 25, 20, 0, 2 * Math.PI), e.strokeStyle = "#333", e.stroke();
1071
- const n = t.toDataURL(), i = document.createElement("canvas");
1072
- i.width = 200, i.height = 50;
1073
- const o = i.getContext("2d");
1074
- return o && (o.textBaseline = "top", o.font = "14px 'Arial'", o.fillStyle = "#f60", o.fillRect(125, 1, 62, 20), o.fillStyle = "#069", o.fillText("Cwm fjordbank glyphs vext quiz!", 2, 15), o.fillStyle = "rgba(102, 204, 0, 0.7)", o.fillRect(100, 5, 80, 40), o.beginPath(), o.arc(50, 25, 20, 0, 2 * Math.PI), o.strokeStyle = "#333", o.stroke(), i.toDataURL() !== n) ? "safari-noise-" + rn(n) : rn(n);
1075
- } catch {
1076
- return "error";
1077
- }
1078
- }
1079
- async function an() {
1080
- try {
1081
- const t = window.AudioContext || window.webkitAudioContext;
1082
- if (!t) return "no-audio-ctx";
1083
- const e = new t(), n = e.createOscillator();
1084
- n.type = "triangle", n.frequency.value = 1e4;
1085
- const i = e.createDynamicsCompressor();
1086
- i.threshold.value = -50, i.knee.value = 40, i.ratio.value = 12, i.attack.value = 0, i.release.value = .25;
1087
- const o = e.createAnalyser();
1088
- o.fftSize = 256, n.connect(i), i.connect(o), n.start(0), await new Promise((t) => setTimeout(t, 100));
1089
- const r = new Float32Array(o.frequencyBinCount);
1090
- return o.getFloatFrequencyData(r), n.stop(), await e.close(), function(t) {
1091
- let e = 2166136261;
1092
- for (let n = 0; n < Math.min(t.length, 100); n++) e ^= 255 & Math.floor(1e8 * t[n]), e = 16777619 * e >>> 0;
1093
- return e.toString(16).padStart(8, "0");
1094
- }(r);
1095
- } catch {
1096
- return "error";
1097
- }
1098
- }
1099
- function cn() {
1100
- return {
1101
- screenWidth: screen.width,
1102
- screenHeight: screen.height,
1103
- availWidth: screen.availWidth,
1104
- availHeight: screen.availHeight,
1105
- devicePixelRatio: window.devicePixelRatio ?? 1,
1106
- colorDepth: screen.colorDepth,
1107
- browserChromeWidth: window.outerWidth - window.innerWidth,
1108
- browserChromeHeight: window.outerHeight - window.innerHeight
1109
- };
1110
- }
1111
- let un = !1;
1112
- async function ln() {
1113
- const t = function() {
1114
- const t = navigator;
1115
- return {
1116
- userAgent: t.userAgent,
1117
- platform: t.platform,
1118
- languages: Array.from(t.languages ?? [t.language]),
1119
- hardwareConcurrency: t.hardwareConcurrency ?? 0,
1120
- deviceMemory: t.deviceMemory,
1121
- maxTouchPoints: t.maxTouchPoints ?? 0,
1122
- webdriver: !!t.webdriver,
1123
- pluginsCount: t.plugins?.length ?? 0
1124
- };
1125
- }(), e = cn(), n = function() {
1126
- const t = {
1127
- renderer: "unavailable",
1128
- vendor: "unavailable",
1129
- maxTextureSize: 0,
1130
- extensionCount: 0,
1131
- renderHash: "none"
1132
- };
1133
- try {
1134
- const e = document.createElement("canvas"), n = e.getContext("webgl") || e.getContext("experimental-webgl");
1135
- if (!n) return {
1136
- ...t,
1137
- renderer: "no-webgl"
1138
- };
1139
- const i = n.getExtension("WEBGL_debug_renderer_info"), o = i ? n.getParameter(i.UNMASKED_RENDERER_WEBGL) : "masked", r = i ? n.getParameter(i.UNMASKED_VENDOR_WEBGL) : "masked", s = n.getParameter(n.MAX_TEXTURE_SIZE), a = n.getSupportedExtensions() ?? [];
1140
- e.width = 32, e.height = 32, n.createProgram() && (n.clearColor(.1, .2, .3, 1), n.clear(n.COLOR_BUFFER_BIT));
1141
- const c = /* @__PURE__ */ new Uint8Array(4096);
1142
- n.readPixels(0, 0, 32, 32, n.RGBA, n.UNSIGNED_BYTE, c);
1143
- const u = function(t) {
1144
- let e = 2166136261;
1145
- for (let n = 0; n < t.length; n++) e ^= t.charCodeAt(n), e = 16777619 * e >>> 0;
1146
- return e.toString(16).padStart(8, "0");
1147
- }(c.join(","));
1148
- return {
1149
- renderer: o,
1150
- vendor: r,
1151
- maxTextureSize: s,
1152
- extensionCount: a.length,
1153
- renderHash: u
1154
- };
1155
- } catch {
1156
- return t;
1157
- }
1158
- }(), [i, o] = await Promise.all([Promise.resolve(sn()), an()]), r = function(t, e, n) {
1159
- const i = [], o = /iphone|ipad/i.test(t.userAgent), r = /iphone|ipad/i.test(t.platform), s = !o && /mac/i.test(t.userAgent), a = /windows/i.test(t.userAgent), c = /linux/i.test(t.userAgent) && !/android/i.test(t.userAgent), u = /mac/i.test(t.platform), l = /win/i.test(t.platform), d = /linux/i.test(t.platform), f = o && r || s && u || a && l || c && d || !o && !s && !a && !c;
1160
- i.push({
1161
- check: "ua-platform",
1162
- pass: f,
1163
- detail: f ? void 0 : `UA suggests ${o ? "iOS" : s ? "Mac" : a ? "Win" : "Linux"} but platform=${t.platform}`
1164
- });
1165
- const h = d && t.maxTouchPoints > 1;
1166
- i.push({
1167
- check: "touch-platform",
1168
- pass: !h,
1169
- detail: h ? `Linux desktop with maxTouchPoints=${t.maxTouchPoints}` : void 0
1170
- });
1171
- const m = /intel|llvm|swiftshader|software/i.test(n.renderer) && t.hardwareConcurrency > 16;
1172
- i.push({
1173
- check: "gpu-cores",
1174
- pass: !m,
1175
- detail: m ? `Integrated GPU (${n.renderer}) with ${t.hardwareConcurrency} cores` : void 0
1176
- });
1177
- const p = window.innerWidth > e.screenWidth + 10;
1178
- return i.push({
1179
- check: "screen-viewport",
1180
- pass: !p,
1181
- detail: p ? `innerWidth=${window.innerWidth} > screen.width=${e.screenWidth}` : void 0
1182
- }), i;
1183
- }(t, e, n);
1184
- return {
1185
- canvasHash: i,
1186
- webglRenderer: n.renderer,
1187
- webglVendor: n.vendor,
1188
- audioHash: o,
1189
- userAgent: t.userAgent,
1190
- platform: t.platform,
1191
- languages: t.languages,
1192
- hardwareConcurrency: t.hardwareConcurrency,
1193
- deviceMemory: t.deviceMemory,
1194
- maxTouchPoints: t.maxTouchPoints,
1195
- webdriver: t.webdriver,
1196
- screenWidth: e.screenWidth,
1197
- screenHeight: e.screenHeight,
1198
- devicePixelRatio: e.devicePixelRatio,
1199
- colorDepth: e.colorDepth,
1200
- availWidth: e.availWidth,
1201
- availHeight: e.availHeight,
1202
- browserChromeWidth: e.browserChromeWidth,
1203
- browserChromeHeight: e.browserChromeHeight,
1204
- pluginsCount: t.pluginsCount,
1205
- consistency: r
1206
- };
1207
- }
1208
- const dn = {
1209
- pointer: {
1210
- create: function(t, e, n) {
1211
- const i = E((e) => {
1212
- const n = function(e) {
1213
- const n = e, i = function(t) {
1214
- if ("mouse" === t.pointerType) return {
1215
- button: t.button,
1216
- buttons: t.buttons
1217
- };
1218
- const e = {
1219
- force: t.pressure,
1220
- contact: Math.min(t.width, t.height)
1221
- };
1222
- return "pen" === t.pointerType && (e.tiltX = t.tiltX, e.tiltY = t.tiltY, e.twist = t.twist), e;
1223
- }(n);
1224
- return {
1225
- id: n.pointerId,
1226
- name: "pointer",
1227
- timestamp: Date.now(),
1228
- ts: n.timeStamp,
1229
- type: G[n.pointerType] ?? "unknown",
1230
- phase: V[e.type],
1231
- isTrusted: n.isTrusted,
1232
- element: t.resolveElement(n.target, { freshGeometry: !0 }),
1233
- isPrimary: n.isPrimary,
1234
- modifiers: {
1235
- shift: n.shiftKey,
1236
- ctrl: n.ctrlKey,
1237
- alt: n.altKey,
1238
- meta: n.metaKey
1239
- },
1240
- coordinates: {
1241
- x: n.clientX,
1242
- y: n.clientY
1243
- },
1244
- ...i
1245
- };
1246
- }(e);
1247
- t.push(n);
1248
- });
1249
- return p(n, "pointer") && (T(document, "pointerdown", i), T(document, "pointerup", i)), p(n, "click") && T(document, "click", i), p(n, "dblclick") && T(document, "dblclick", i), p(n, "contextmenu") && T(document, "contextmenu", i), () => {
1250
- x(document, "pointerdown", i), x(document, "pointerup", i), x(document, "click", i), x(document, "dblclick", i), x(document, "contextmenu", i);
1251
- };
1252
- },
1253
- layer: "behavioral",
1254
- events: [
1255
- "pointer",
1256
- "click",
1257
- "dblclick",
1258
- "contextmenu"
1259
- ]
1260
- },
1261
- pointermove: {
1262
- create: function(t) {
1263
- let e = null, n = null;
1264
- const i = E((n) => {
1265
- const i = n;
1266
- e && e.id !== i.pointerId && (t.push(e), e = null), e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(i), r(t)) : (e.samples.x.push(i.clientX), e.samples.y.push(i.clientY), e.samples.ts.push(i.timeStamp), e.samples.movementX.push(i.movementX), e.samples.movementY.push(i.movementY), e.samples.buttons.push(i.buttons), e.samples.isTrusted.push(i.isTrusted), "pen" === i.pointerType && (e.samples.tiltX?.push(i.tiltX), e.samples.tiltY?.push(i.tiltY)), "mouse" !== i.pointerType && (e.samples.force?.push(i.pressure), e.samples.radius?.push(Math.max(i.width, i.height))), r(t)) : (e = o(i), r(t));
1267
- });
1268
- function o(t) {
1269
- const e = function(t) {
1270
- if ("mouse" === t.pointerType) return null;
1271
- const e = {
1272
- force: [t.pressure],
1273
- radius: [Math.max(t.width, t.height)]
1274
- };
1275
- return "pen" === t.pointerType && (e.tiltX = [t.tiltX], e.tiltY = [t.tiltY]), e;
1276
- }(t);
1277
- return {
1278
- name: "pointer",
1279
- timestamp: Date.now(),
1280
- id: t.pointerId,
1281
- type: t.pointerType,
1282
- phase: "move",
1283
- isTrusted: t.isTrusted,
1284
- isPrimary: t.isPrimary,
1285
- samples: {
1286
- x: [t.clientX],
1287
- y: [t.clientY],
1288
- ts: [t.timeStamp],
1289
- movementX: [t.movementX],
1290
- movementY: [t.movementY],
1291
- buttons: [t.buttons],
1292
- isTrusted: [t.isTrusted],
1293
- ...e ?? {}
1294
- }
1295
- };
1296
- }
1297
- function r(t) {
1298
- n && clearTimeout(n), n = setTimeout(() => {
1299
- e && (t.push(e), e = null), n = null;
1300
- }, F);
1301
- }
1302
- return T(document, "pointermove", i), () => {
1303
- x(document, "pointermove", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
1304
- };
1305
- },
1306
- layer: "behavioral"
1307
- },
1308
- focus: {
1309
- create: function(t) {
1310
- const e = E((e) => {
1311
- const n = function(e) {
1312
- const n = e;
1313
- return {
1314
- name: "focus",
1315
- type: j[e.type] ?? "unknown",
1316
- timestamp: Date.now(),
1317
- ts: n.timeStamp,
1318
- isTrusted: n.isTrusted,
1319
- element: t.resolveElement(n.target),
1320
- relatedTarget: t.resolveElement(n.relatedTarget)
1321
- };
1322
- }(e);
1323
- t.push(n);
1324
- });
1325
- return T(document, "focusin", e), T(document, "focusout", e), () => {
1326
- x(document, "focusin", e), x(document, "focusout", e);
1327
- };
1328
- },
1329
- layer: "behavioral"
1330
- },
1331
- input: {
1332
- create: function(t) {
1333
- const e = E((e) => {
1334
- const n = e;
1335
- t.push(function(e) {
1336
- return {
1337
- name: "keystroke",
1338
- type: "input",
1339
- timestamp: Date.now(),
1340
- ts: e.timeStamp,
1341
- isTrusted: e.isTrusted,
1342
- element: t.resolveElement(e.target),
1343
- inputType: e.inputType ?? "",
1344
- isComposing: e.isComposing ?? !1,
1345
- length: (n = e.target, n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement ? n.value.length : 0)
1346
- };
1347
- var n;
1348
- }(n)), function(t) {
1349
- if ("insertReplacementText" === t.inputType) return !0;
1350
- const e = t.target;
1351
- return !!Y(e) && function(t) {
1352
- try {
1353
- return t.matches(":-webkit-autofill");
1354
- } catch {
1355
- return !1;
1356
- }
1357
- }(e);
1358
- }(n) && t.push(function(t, e) {
1359
- const n = t.target;
1360
- let i = 0;
1361
- return Y(n) && (i = n.value.length), {
1362
- name: "autofill",
1363
- timestamp: Date.now(),
1364
- ts: t.timeStamp,
1365
- element: e.resolveElement(n),
1366
- length: i
1367
- };
1368
- }(n, t));
1369
- });
1370
- return T(document, "input", e), function() {
1371
- x(document, "input", e);
1372
- };
1373
- },
1374
- layer: "behavioral"
1375
- },
1376
- keystroke: {
1377
- create: function(t) {
1378
- const { resolve: e, reset: n } = function() {
1379
- let t = 0;
1380
- const e = /* @__PURE__ */ new Map();
1381
- return {
1382
- resolve: function(n, i) {
1383
- if ("keydown" === i) {
1384
- const i = e.get(n);
1385
- if (void 0 !== i) return i;
1386
- const o = ++t;
1387
- if (e.size >= 32) {
1388
- const t = e.keys().next().value;
1389
- void 0 !== t && e.delete(t);
1390
- }
1391
- return e.set(n, o), o;
1392
- }
1393
- const o = e.get(n);
1394
- return void 0 !== o ? (e.delete(n), o) : ++t;
1395
- },
1396
- reset: function() {
1397
- e.clear();
1398
- }
1399
- };
1400
- }(), i = E((n) => {
1401
- const i = function(n) {
1402
- const i = n, o = n.type, r = J.has(i.key);
1403
- return {
1404
- name: "keystroke",
1405
- type: o,
1406
- id: e(i.code, o),
1407
- timestamp: Date.now(),
1408
- ts: i.timeStamp,
1409
- isTrusted: i.isTrusted,
1410
- keys: r ? [i.key] : [],
1411
- repeat: i.repeat,
1412
- location: r ? i.location : null,
1413
- element: t.resolveElement(i.target)
1414
- };
1415
- }(n);
1416
- t.push(i);
1417
- }), o = E(() => {
1418
- n();
1419
- });
1420
- return T(document, "keydown", i), T(document, "keyup", i), T(window, "blur", o), () => {
1421
- x(document, "keydown", i), x(document, "keyup", i), x(window, "blur", o);
1422
- };
1423
- },
1424
- layer: "behavioral"
1425
- },
1426
- clipboard: {
1427
- create: function(t, e = "on", n) {
1428
- const i = E((n) => {
1429
- const i = function(n) {
1430
- const i = n, o = n.type, r = ("paste" === n.type ? i.clipboardData?.getData("text/plain") : w()) ?? null, s = y(i.target, e);
1431
- return {
1432
- name: "clipboard",
1433
- type: o,
1434
- timestamp: Date.now(),
1435
- ts: i.timeStamp,
1436
- isTrusted: i.isTrusted,
1437
- element: t.resolveElement(i.target),
1438
- length: r?.length ?? 0,
1439
- ...s && r ? { content: r } : {}
1440
- };
1441
- }(n);
1442
- t.push(i);
1443
- });
1444
- return p(n, "paste") && T(document, "paste", i), p(n, "cut") && T(document, "cut", i), p(n, "copy") && T(document, "copy", i), () => {
1445
- x(document, "paste", i), x(document, "cut", i), x(document, "copy", i);
1446
- };
1447
- },
1448
- layer: "behavioral",
1449
- events: [
1450
- "paste",
1451
- "cut",
1452
- "copy"
1453
- ]
1454
- },
1455
- form: {
1456
- create: function(t, e, n) {
1457
- const i = p(n, "submit"), o = p(n, "snapshot"), r = E((e) => {
1458
- const n = {
1459
- name: "form",
1460
- type: (i = e).type,
1461
- timestamp: Date.now(),
1462
- ts: i.timeStamp,
1463
- isTrusted: i.isTrusted,
1464
- element: t.resolveElement(i.target)
1465
- };
1466
- var i;
1467
- t.push(n);
1468
- }), s = E((e) => {
1469
- o && e.target instanceof Element && u(e, "submit", e.target), t.flush();
1470
- }), a = E((e) => {
1471
- if (!(e.target instanceof Element)) return;
1472
- const n = e.target.closest(b);
1473
- n && (o && u(e, "flush", n), t.flush());
1474
- }), c = E((t) => {
1475
- q(t.target) && u(t, "change", t.target);
1476
- });
1477
- function u(e, n, i) {
1478
- i.closest(k) || t.push(function(t, e, n) {
1479
- const i = function(t) {
1480
- return t instanceof HTMLFormElement ? t : q(t) ? t.form : t.closest("form");
1481
- }(n), o = i ? i.elements : document.querySelectorAll("input, select, textarea"), r = [];
1482
- let s = !1;
1483
- for (let t = 0; t < o.length; t++) {
1484
- const e = o[t];
1485
- if (W(e) && !e.closest(k)) {
1486
- if (r.length >= 50) {
1487
- s = !0;
1488
- break;
1489
- }
1490
- r.push(N(e));
1491
- }
1492
- }
1493
- return {
1494
- name: "form_snapshot",
1495
- trigger: e,
1496
- timestamp: Date.now(),
1497
- ts: t.timeStamp,
1498
- isTrusted: t.isTrusted,
1499
- targetId: B(n),
1500
- formId: i ? B(i) : null,
1501
- fields: r,
1502
- truncated: s
1503
- };
1504
- }(e, n, i));
1505
- }
1506
- return i && T(document, "submit", r), p(n, "invalid") && T(document, "invalid", r), (i || o) && T(document, "submit", s), T(document, "click", a), o && T(document, "change", c), () => {
1507
- x(document, "submit", r), x(document, "invalid", r), x(document, "submit", s), x(document, "click", a), x(document, "change", c);
1508
- };
1509
- },
1510
- layer: "behavioral",
1511
- events: [
1512
- "submit",
1513
- "invalid",
1514
- "snapshot"
1515
- ]
1516
- },
1517
- change: {
1518
- create: function(t) {
1519
- const e = E((e) => {
1520
- const n = (i = e, {
1521
- name: "change",
1522
- timestamp: Date.now(),
1523
- ts: i.timeStamp,
1524
- isTrusted: i.isTrusted,
1525
- element: t.resolveElement(i.target)
1526
- });
1527
- var i;
1528
- t.push(n);
1529
- });
1530
- return T(document, "change", e), () => {
1531
- x(document, "change", e);
1532
- };
1533
- },
1534
- layer: "behavioral"
1535
- },
1536
- selection: {
1537
- create: function(t, e) {
1538
- let n = !1, i = 0, o = null, r = !1, s = !1;
1539
- function a() {
1540
- o && (clearTimeout(o), o = null);
1541
- }
1542
- function c() {
1543
- a(), r || s || (o = setTimeout(() => {
1544
- o = null, n && u("timeout", performance.now());
1545
- }, 250));
1546
- }
1547
- function u(i, o) {
1548
- n && (n = !1, a(), function(n, i) {
1549
- const o = v("end"), r = o && y(o, e), s = w();
1550
- t.push({
1551
- name: "selection",
1552
- phase: "end",
1553
- timestamp: Date.now(),
1554
- ts: i,
1555
- trigger: n,
1556
- isTrusted: !0,
1557
- element: t.resolveElement(o),
1558
- length: s?.length ?? 0,
1559
- ...r && s ? { content: s } : {}
1560
- });
1561
- }(i, o));
1562
- }
1563
- const l = E((e) => {
1564
- const o = function() {
1565
- const t = document.getSelection();
1566
- return !t || t.isCollapsed || 0 === t.rangeCount;
1567
- }();
1568
- if (!n && !o) return n = !0, r = e.timeStamp, i = Date.now(), t.push({
1569
- name: "selection",
1570
- phase: "start",
1571
- timestamp: i,
1572
- ts: r,
1573
- element: t.resolveElement(v("start"))
1574
- }), void c();
1575
- var r;
1576
- n && o ? u("collapse", e.timeStamp) : n && c();
1577
- }), d = E((t) => {
1578
- 0 === t.button && (r = !0, a());
1579
- }), f = E((t) => {
1580
- 0 === t.button && (r = !1, n && u("pointer", t.timeStamp));
1581
- }), h = E((t) => {
1582
- "Shift" === t.key && (s = !0, a());
1583
- }), m = E((t) => {
1584
- "Shift" === t.key && (s = !1, n && u("keyboard", t.timeStamp));
1585
- }), p = E(() => {
1586
- r = !1;
1587
- }), g = E((t) => {
1588
- "hidden" === document.visibilityState && (r = !1, s = !1, n && u("timeout", t.timeStamp));
1589
- }), b = E((t) => {
1590
- r = !1, n && u("pointer", t.timeStamp);
1591
- });
1592
- return T(document, "selectionchange", l), T(document, "pointerdown", d), T(document, "pointerup", f), T(document, "keydown", h), T(document, "keyup", m), T(document, "contextmenu", p), T(document, "visibilitychange", g), T(document, "dragend", b), () => {
1593
- a(), x(document, "selectionchange", l), x(document, "pointerdown", d), x(document, "pointerup", f), x(document, "keydown", h), x(document, "keyup", m), x(document, "contextmenu", p), x(document, "visibilitychange", g), x(document, "dragend", b);
1594
- };
1595
- },
1596
- layer: "behavioral"
1597
- },
1598
- tab: {
1599
- create: () => () => {},
1600
- layer: "session",
1601
- events: ["state", "count"]
1602
- },
1603
- visibility: {
1604
- create: function(t) {
1605
- const e = E((e) => {
1606
- const n = document.visibilityState;
1607
- if ("visible" !== n && "hidden" !== n) return;
1608
- const i = {
1609
- name: "visibility",
1610
- type: n,
1611
- timestamp: Date.now(),
1612
- ts: e.timeStamp,
1613
- isTrusted: e.isTrusted
1614
- };
1615
- t.push(i);
1616
- });
1617
- return T(document, "visibilitychange", e), () => {
1618
- x(document, "visibilitychange", e);
1619
- };
1620
- },
1621
- layer: "session"
1622
- },
1623
- navigation: {
1624
- create: function(t) {
1625
- let e = t.sanitizeUrl(document.referrer || "");
1626
- function n(n) {
1627
- t.push(n), e = n.to ?? "";
1628
- }
1629
- const i = E(() => {
1630
- const [e] = performance.getEntriesByType("navigation");
1631
- var i;
1632
- n(Z("load", e?.type ?? "navigate", {
1633
- from: document.referrer ? t.sanitizeUrl(document.referrer) : null,
1634
- to: t.sanitizeUrl(location.href)
1635
- }, performance.timeOrigin, e ? {
1636
- fetchStart: (i = e).fetchStart,
1637
- domainLookupStart: i.domainLookupStart,
1638
- domainLookupEnd: i.domainLookupEnd,
1639
- connectStart: i.connectStart,
1640
- connectEnd: i.connectEnd,
1641
- requestStart: i.requestStart,
1642
- responseStart: i.responseStart,
1643
- responseEnd: i.responseEnd,
1644
- domInteractive: i.domInteractive,
1645
- domContentLoadedEventStart: i.domContentLoadedEventStart,
1646
- domContentLoadedEventEnd: i.domContentLoadedEventEnd,
1647
- domComplete: i.domComplete,
1648
- loadEventStart: i.loadEventStart,
1649
- loadEventEnd: i.loadEventEnd,
1650
- redirectCount: i.redirectCount,
1651
- transferSize: i.transferSize,
1652
- encodedBodySize: i.encodedBodySize,
1653
- decodedBodySize: i.decodedBodySize
1654
- } : void 0));
1655
- }), o = E((i) => {
1656
- const o = i;
1657
- if (null === o.navigationType) return;
1658
- const r = t.sanitizeUrl(location.href);
1659
- r !== e && n(Z("change", o.navigationType, {
1660
- from: e,
1661
- to: r
1662
- }, performance.timeOrigin));
1663
- }), r = E(() => a("traverse")), s = E(() => a("hashchange"));
1664
- function a(i) {
1665
- const o = t.sanitizeUrl(location.href);
1666
- "hashchange" === i && o === e || n(Z("change", i, {
1667
- from: e,
1668
- to: o
1669
- }, performance.timeOrigin));
1670
- }
1671
- const c = history.pushState, u = history.replaceState, l = function(...t) {
1672
- const e = c.apply(this, t);
1673
- return I(() => a("push")), e;
1674
- }, d = function(...t) {
1675
- const e = u.apply(this, t);
1676
- return I(() => a("replace")), e;
1677
- };
1678
- return window.navigation ? T(window.navigation, "currententrychange", o) : (history.pushState = l, history.replaceState = d, T(window, "popstate", r), T(window, "hashchange", s)), "complete" === document.readyState ? i(new Event("load")) : T(window, "load", i), () => {
1679
- window.navigation ? x(window.navigation, "currententrychange", o) : (history.pushState === l && (history.pushState = c), history.replaceState === d && (history.replaceState = u), x(window, "popstate", r), x(window, "hashchange", s)), x(window, "load", i);
1680
- };
1681
- },
1682
- layer: "session"
1683
- },
1684
- networkconnection: {
1685
- create: function(t) {
1686
- const e = E((e) => {
1687
- const n = {
1688
- name: "network",
1689
- type: "connection",
1690
- state: navigator.onLine ? "online" : "offline",
1691
- timestamp: Date.now(),
1692
- ts: e.timeStamp
1693
- };
1694
- t.push(n);
1695
- });
1696
- return T(window, "online", e), T(window, "offline", e), () => {
1697
- x(window, "online", e), x(window, "offline", e);
1698
- };
1699
- },
1700
- layer: "session"
1701
- },
1702
- scroll: {
1703
- create: function(t) {
1704
- let e = null, n = null;
1705
- const i = E((n) => {
1706
- const i = (s = n.target) instanceof Element ? s.closest("[data-tri-ignore]") ? null : s : "window";
1707
- var s;
1708
- if (null === i) return;
1709
- const a = "window" === i ? "window" : B(i), c = "window" === i ? null : i;
1710
- e && e.target !== a && (t.push(e), e = null), e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(n, a, c), r(t)) : (e.samples.x.push(window.scrollX), e.samples.y.push(window.scrollY), e.samples.ts.push(n.timeStamp), e.samples.isTrusted.push(n.isTrusted), c && (e.samples.elementX?.push(c.scrollLeft), e.samples.elementY?.push(c.scrollTop)), r(t)) : (e = o(n, a, c), r(t));
1711
- });
1712
- function o(t, e, n) {
1713
- return {
1714
- name: "scroll",
1715
- timestamp: Date.now(),
1716
- target: e,
1717
- isTrusted: t.isTrusted,
1718
- samples: {
1719
- x: [window.scrollX],
1720
- y: [window.scrollY],
1721
- ts: [t.timeStamp],
1722
- isTrusted: [t.isTrusted],
1723
- ...n ? {
1724
- elementX: [n.scrollLeft],
1725
- elementY: [n.scrollTop]
1726
- } : {}
1727
- },
1728
- height: window.innerHeight,
1729
- width: window.innerWidth,
1730
- scrollX: window.scrollX,
1731
- scrollY: window.scrollY,
1732
- pageX: window.pageXOffset,
1733
- pageY: window.pageYOffset
1734
- };
1735
- }
1736
- function r(t) {
1737
- n && clearTimeout(n), n = setTimeout(() => {
1738
- e && (t.push(e), e = null), n = null;
1739
- }, F);
1740
- }
1741
- return T(window, "scroll", i), () => {
1742
- x(window, "scroll", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
1743
- };
1744
- },
1745
- layer: "behavioral"
1746
- },
1747
- viewportresize: {
1748
- create: function(t) {
1749
- let e = null, n = null;
1750
- const i = E((n) => e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(n), void r(t)) : (e.samples.height.push(window.innerHeight), e.samples.width.push(window.innerWidth), e.samples.ts.push(n.timeStamp), e.samples.scrollX.push(window.scrollX), e.samples.scrollY.push(window.scrollY), e.samples.dpr.push(window.devicePixelRatio), e.samples.outerWidth.push(window.outerWidth), e.samples.outerHeight.push(window.outerHeight), void r(t)) : (e = o(n), void r(t)));
1751
- function o(t) {
1752
- return {
1753
- name: "viewport",
1754
- type: "resize",
1755
- timestamp: Date.now(),
1756
- samples: {
1757
- height: [window.innerHeight],
1758
- width: [window.innerWidth],
1759
- ts: [t.timeStamp],
1760
- scrollX: [window.scrollX],
1761
- scrollY: [window.scrollY],
1762
- dpr: [window.devicePixelRatio],
1763
- outerWidth: [window.outerWidth],
1764
- outerHeight: [window.outerHeight]
1765
- }
1766
- };
1767
- }
1768
- function r(t) {
1769
- n && clearTimeout(n), n = setTimeout(() => {
1770
- e && (t.push(e), e = null), n = null;
1771
- }, F);
1772
- }
1773
- return T(window, "resize", i), () => {
1774
- x(window, "resize", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
1775
- };
1776
- },
1777
- layer: "behavioral"
1778
- },
1779
- viewport: {
1780
- create: function(t, e, n) {
1781
- const i = E((e) => {
1782
- const n = r(e, "orientation");
1783
- t.push(n);
1784
- }), o = E((e) => {
1785
- const n = r(e, "ratiochange");
1786
- t.push(n);
1787
- });
1788
- function r(t, e) {
1789
- return {
1790
- name: "viewport",
1791
- type: e,
1792
- timestamp: Date.now(),
1793
- ts: t.timeStamp,
1794
- isTrusted: t.isTrusted,
1795
- height: window.innerHeight,
1796
- width: window.innerWidth,
1797
- scrollX: window.scrollX,
1798
- scrollY: window.scrollY,
1799
- dpr: window.devicePixelRatio
1800
- };
1801
- }
1802
- return p(n, "orientationchange") && T(window, "orientationchange", i), p(n, "devicepixelratiochange") && T(window, "devicepixelratiochange", o), () => {
1803
- x(window, "orientationchange", i), x(window, "devicepixelratiochange", o);
1804
- };
1805
- },
1806
- layer: "behavioral",
1807
- events: ["orientationchange", "devicepixelratiochange"]
1808
- },
1809
- sensors: {
1810
- create: function(t, e, n) {
1811
- let i = null, o = null, r = null, s = null, a = !1;
1812
- function c() {
1813
- s && C(s), s = setTimeout(_(() => {
1814
- u(), s = null;
1815
- }), F);
1816
- }
1817
- function u() {
1818
- i && (t.push(i), i = null), o && (t.push(o), o = null), r && (t.push(r), r = null);
1819
- }
1820
- const l = E((e) => {
1821
- const n = e, o = n.timeStamp, r = n.acceleration, s = n.accelerationIncludingGravity, a = n.rotationRate;
1822
- if (!r && !s && !a || null === r?.x && null === r?.y && null === r?.z && null === s?.x && null === s?.y && null === s?.z && null === a?.alpha && null === a?.beta && null === a?.gamma) return;
1823
- if (!i) return i = {
1824
- name: "sensors",
1825
- type: "motion",
1826
- timestamp: Date.now(),
1827
- interval: n.interval ?? null,
1828
- samples: {
1829
- ax: [r?.x ?? 0],
1830
- ay: [r?.y ?? 0],
1831
- az: [r?.z ?? 0],
1832
- agx: [s?.x ?? 0],
1833
- agy: [s?.y ?? 0],
1834
- agz: [s?.z ?? 0],
1835
- rrAlpha: [a?.alpha ?? 0],
1836
- rrBeta: [a?.beta ?? 0],
1837
- rrGamma: [a?.gamma ?? 0],
1838
- ts: [o]
1839
- }
1840
- }, void c();
1841
- if (i.samples.ts.length >= 50) return t.push(i), i = {
1842
- name: "sensors",
1843
- type: "motion",
1844
- timestamp: Date.now(),
1845
- interval: n.interval ?? null,
1846
- samples: {
1847
- ax: [r?.x ?? 0],
1848
- ay: [r?.y ?? 0],
1849
- az: [r?.z ?? 0],
1850
- agx: [s?.x ?? 0],
1851
- agy: [s?.y ?? 0],
1852
- agz: [s?.z ?? 0],
1853
- rrAlpha: [a?.alpha ?? 0],
1854
- rrBeta: [a?.beta ?? 0],
1855
- rrGamma: [a?.gamma ?? 0],
1856
- ts: [o]
1857
- }
1858
- }, void c();
1859
- const u = i.samples;
1860
- u.ax.push(r?.x ?? 0), u.ay.push(r?.y ?? 0), u.az.push(r?.z ?? 0), u.agx.push(s?.x ?? 0), u.agy.push(s?.y ?? 0), u.agz.push(s?.z ?? 0), u.rrAlpha.push(a?.alpha ?? 0), u.rrBeta.push(a?.beta ?? 0), u.rrGamma.push(a?.gamma ?? 0), u.ts.push(o), c();
1861
- }), d = E((e) => {
1862
- const n = e;
1863
- if (null == n.alpha && null == n.beta && null == n.gamma) return;
1864
- const i = n.timeStamp, r = n.webkitCompassHeading ?? 0;
1865
- if (!o) return o = {
1866
- name: "sensors",
1867
- type: "orientation",
1868
- timestamp: Date.now(),
1869
- absolute: a || n.absolute,
1870
- samples: {
1871
- alpha: [n.alpha ?? 0],
1872
- beta: [n.beta ?? 0],
1873
- gamma: [n.gamma ?? 0],
1874
- compassHeading: [r],
1875
- ts: [i]
1876
- }
1877
- }, void c();
1878
- if (o.samples.ts.length >= 50) return t.push(o), o = {
1879
- name: "sensors",
1880
- type: "orientation",
1881
- timestamp: Date.now(),
1882
- absolute: a || n.absolute,
1883
- samples: {
1884
- alpha: [n.alpha ?? 0],
1885
- beta: [n.beta ?? 0],
1886
- gamma: [n.gamma ?? 0],
1887
- compassHeading: [r],
1888
- ts: [i]
1889
- }
1890
- }, void c();
1891
- const s = o.samples;
1892
- s.alpha.push(n.alpha ?? 0), s.beta.push(n.beta ?? 0), s.gamma.push(n.gamma ?? 0), s.compassHeading.push(r), s.ts.push(i), c();
1893
- }), f = E((e) => {
1894
- const n = e.value;
1895
- if (null == n) return;
1896
- const i = e.timeStamp;
1897
- r ? r.samples.ts.length >= 50 ? (t.push(r), r = {
1898
- name: "sensors",
1899
- type: "light",
1900
- timestamp: Date.now(),
1901
- samples: {
1902
- lux: [n],
1903
- ts: [i]
1904
- }
1905
- }, c()) : (r.samples.lux.push(n), r.samples.ts.push(i), c()) : (r = {
1906
- name: "sensors",
1907
- type: "light",
1908
- timestamp: Date.now(),
1909
- samples: {
1910
- lux: [n],
1911
- ts: [i]
1912
- }
1913
- }, c());
1914
- });
1915
- return p(n, "motion") && T(window, "devicemotion", l), p(n, "orientation") && ("ondeviceorientationabsolute" in window ? (a = !0, T(window, "deviceorientationabsolute", d)) : T(window, "deviceorientation", d)), p(n, "light") && T(window, "devicelight", f), function() {
1916
- x(window, "devicemotion", l), x(window, a ? "deviceorientationabsolute" : "deviceorientation", d), x(window, "devicelight", f), s && (C(s), s = null), u();
1917
- };
1918
- },
1919
- layer: "behavioral",
1920
- events: [
1921
- "motion",
1922
- "orientation",
1923
- "light"
1924
- ]
1925
- },
1926
- "network-request": {
1927
- create: function(t) {
1928
- var n;
1929
- const i = function(t, n, i, o = z) {
1930
- if ("undefined" == typeof PerformanceObserver) return H;
1931
- let r = null;
1932
- try {
1933
- r = new PerformanceObserver((e) => {
1934
- for (const r of e.getEntries()) {
1935
- const e = r;
1936
- o.has(e.initiatorType) && (n(e.name) || t($(e, i)));
1937
- }
1938
- }), r.observe({
1939
- type: "resource",
1940
- buffered: !0
1941
- });
1942
- } catch {
1943
- return e.warn("network-request", "PerformanceObserver failed to start"), H;
1944
- }
1945
- return function() {
1946
- r?.disconnect(), r = null;
1947
- };
1948
- }(function(e) {
1949
- I(() => t.push(e));
1950
- }, (n = t.ignoredOrigins, function(t) {
1951
- try {
1952
- return n.has(new URL(t).origin);
1953
- } catch {
1954
- return !1;
1955
- }
1956
- }), t.sanitizeUrl);
1957
- return function() {
1958
- i();
1959
- };
1960
- },
1961
- layer: "session"
1962
- },
1963
- screen: {
1964
- create: function(t) {
1965
- const e = I(() => function() {
1966
- const t = window.screen;
1967
- return {
1968
- name: "screen",
1969
- timestamp: Date.now(),
1970
- ts: performance.now(),
1971
- availWidth: t.availWidth,
1972
- availHeight: t.availHeight,
1973
- width: t.width,
1974
- height: t.height,
1975
- colorDepth: t.colorDepth,
1976
- pixelDepth: t.pixelDepth,
1977
- availLeft: t.availLeft ?? 0,
1978
- availTop: t.availTop ?? 0,
1979
- orientation: t.orientation ? {
1980
- type: t.orientation.type,
1981
- angle: t.orientation.angle
1982
- } : null,
1983
- isExtended: t.isExtended ?? !1,
1984
- viewport: {
1985
- height: window.innerHeight,
1986
- width: window.innerWidth,
1987
- scrollX: window.scrollX,
1988
- scrollY: window.scrollY,
1989
- dpr: window.devicePixelRatio
1990
- },
1991
- outerWidth: window.outerWidth,
1992
- outerHeight: window.outerHeight
1993
- };
1994
- }());
1995
- return e && t.push(e), () => {};
1996
- },
1997
- layer: "session"
1998
- },
1999
- wheel: {
2000
- create: function(t) {
2001
- let e = null, n = null;
2002
- const i = E((n) => {
2003
- const i = n;
2004
- e ? e.samples.ts.length >= 50 ? (t.push(e), e = o(i), r(t)) : (e.samples.deltaX.push(i.deltaX), e.samples.deltaY.push(i.deltaY), e.samples.deltaZ.push(i.deltaZ), e.samples.deltaMode.push(i.deltaMode), e.samples.isTrusted.push(i.isTrusted), e.samples.ts.push(i.timeStamp), r(t)) : (e = o(i), r(t));
2005
- });
2006
- function o(t) {
2007
- return {
2008
- name: "wheel",
2009
- timestamp: Date.now(),
2010
- samples: {
2011
- deltaX: [t.deltaX],
2012
- deltaY: [t.deltaY],
2013
- deltaZ: [t.deltaZ],
2014
- deltaMode: [t.deltaMode],
2015
- isTrusted: [t.isTrusted],
2016
- ts: [t.timeStamp]
2017
- }
2018
- };
2019
- }
2020
- function r(t) {
2021
- n && clearTimeout(n), n = setTimeout(() => {
2022
- e && (t.push(e), e = null), n = null;
2023
- }, F);
2024
- }
2025
- return T(window, "wheel", i), () => {
2026
- x(window, "wheel", i), n && (clearTimeout(n), n = null), e && (t.push(e), e = null);
2027
- };
2028
- },
2029
- layer: "behavioral"
2030
- },
2031
- hover: {
2032
- create: function(t) {
2033
- const e = E((e) => {
2034
- const n = e, o = K(n.target);
2035
- o && o !== K(n.relatedTarget) && t.push(i(n, "enter", o));
2036
- }), n = E((e) => {
2037
- const n = e, o = K(n.target);
2038
- o && o !== K(n.relatedTarget) && t.push(i(n, "leave", o));
2039
- });
2040
- function i(e, n, i) {
2041
- return {
2042
- name: "hover",
2043
- type: n,
2044
- timestamp: Date.now(),
2045
- ts: e.timeStamp,
2046
- isTrusted: e.isTrusted,
2047
- pointerType: G[e.pointerType] ?? "unknown",
2048
- element: t.resolveElement(i)
2049
- };
2050
- }
2051
- return T(document, "pointerover", e), T(document, "pointerout", n), () => {
2052
- x(document, "pointerover", e), x(document, "pointerout", n);
2053
- };
2054
- },
2055
- layer: "behavioral"
2056
- },
2057
- shinsei: {
2058
- create: function(t) {
2059
- const e = new URLSearchParams(window.location.search).get("source");
2060
- function n(e) {
2061
- const n = t.sanitizeUrl(e);
2062
- try {
2063
- return new URL(n).pathname;
2064
- } catch {
2065
- return n;
2066
- }
2067
- }
2068
- function i(i, o) {
2069
- return function(e) {
2070
- e.pageUrl = t.sanitizeUrl(e.pageUrl);
2071
- for (const i of e.events) {
2072
- if ("page" !== i.type) continue;
2073
- const e = i.data;
2074
- e.url && (e.url = n(e.url)), e.referrer && (e.referrer = t.sanitizeUrl(e.referrer));
2075
- }
2076
- }(o), {
2077
- name: "shinsei_batch",
2078
- timestamp: Date.now(),
2079
- delivery: i,
2080
- source: e,
2081
- batch: o
2082
- };
2083
- }
2084
- return I(() => function(t, e) {
2085
- return !un && (un = !0, function() {
2086
- Bt = performance.now(), jt = !1, Ot.push({
2087
- type: "page",
2088
- t: performance.now(),
2089
- data: {
2090
- event: "load",
2091
- referrer: document.referrer
2092
- }
2093
- });
2094
- const t = () => setTimeout(() => Qt(), 1500);
2095
- "complete" === document.readyState ? t() : window.addEventListener("load", t, { once: !0 }), window.addEventListener("popstate", () => setTimeout(() => Qt(), 500));
2096
- const e = history.pushState.bind(history);
2097
- history.pushState = function(...t) {
2098
- e(...t), setTimeout(() => Qt(), 500);
2099
- }, document.addEventListener("visibilitychange", Yt), window.addEventListener("focus", Jt), window.addEventListener("blur", Gt), document.addEventListener("mousemove", Kt, { passive: !0 }), document.addEventListener("keydown", Kt, { passive: !0 }), document.addEventListener("scroll", Kt, { passive: !0 }), document.addEventListener("click", Kt, { passive: !0 });
2100
- }(), nt = performance.now(), pt = null, wt = 0, ut = 0, lt = 0, dt = 0, ft = 0, ht = !1, mt.length = 0, document.addEventListener("mousemove", yt, { passive: !0 }), document.addEventListener("click", vt, { passive: !0 }), document.addEventListener("contextmenu", gt, { passive: !0 }), document.addEventListener("mouseenter", bt, {
2101
- passive: !0,
2102
- capture: !0
2103
- }), document.addEventListener("mouseleave", kt, {
2104
- passive: !0,
2105
- capture: !0
2106
- }), document.addEventListener("keydown", _t, { passive: !0 }), document.addEventListener("keyup", Dt, { passive: !0 }), document.addEventListener("paste", Ct, { passive: !0 }), Pt = performance.now(), zt = window.scrollY, window.addEventListener("scroll", Ht, { passive: !0 }), window.addEventListener("wheel", Ft, { passive: !0 }), document.addEventListener("focus", ie, {
2107
- capture: !0,
2108
- passive: !0
2109
- }), document.addEventListener("input", ie, {
2110
- capture: !0,
2111
- passive: !0
2112
- }), document.addEventListener("click", ie, {
2113
- capture: !0,
2114
- passive: !0
2115
- }), document.addEventListener("keydown", Me, {
2116
- capture: !0,
2117
- passive: !0
2118
- }), document.addEventListener("keydown", _e, {
2119
- capture: !0,
2120
- passive: !0
2121
- }), document.addEventListener("input", Ce, {
2122
- capture: !0,
2123
- passive: !0
2124
- }), document.addEventListener("focus", Ae, {
2125
- capture: !0,
2126
- passive: !0
2127
- }), document.addEventListener("mousedown", Ee, {
2128
- capture: !0,
2129
- passive: !0
2130
- }), document.addEventListener("submit", Ie, {
2131
- capture: !0,
2132
- passive: !0
2133
- }), document.addEventListener("submit", De, {
2134
- capture: !0,
2135
- passive: !0
2136
- }), Oe(Pe()), we = new MutationObserver((t) => {
2137
- for (const e of t) for (const t of Array.from(e.addedNodes)) {
2138
- if (!(t instanceof HTMLElement)) continue;
2139
- const e = Le(t) ? [t] : [];
2140
- t.querySelectorAll("input, textarea, select").forEach((t) => e.push(t)), Oe(e);
2141
- }
2142
- }), we.observe(document.body, {
2143
- subtree: !0,
2144
- childList: !0
2145
- }), tn(t, e, [
2146
- te,
2147
- Tt,
2148
- Lt,
2149
- Ut,
2150
- oe,
2151
- je
2152
- ], ln), !0);
2153
- }({
2154
- send(e) {
2155
- I(() => t.push(i("interval", e)));
2156
- },
2157
- beacon(e) {
2158
- I(() => {
2159
- t.push(i("beacon", e)), t.flush();
2160
- });
2161
- }
2162
- }, t.getActivityId)), () => {
2163
- I(() => {
2164
- un && (un = !1, document.removeEventListener("visibilitychange", Yt), window.removeEventListener("focus", Jt), window.removeEventListener("blur", Gt), document.removeEventListener("mousemove", Kt), document.removeEventListener("keydown", Kt), document.removeEventListener("scroll", Kt), document.removeEventListener("click", Kt), Vt(), jt = !1, document.removeEventListener("mousemove", yt), document.removeEventListener("click", vt), document.removeEventListener("contextmenu", gt), document.removeEventListener("mouseenter", bt, { capture: !0 }), document.removeEventListener("mouseleave", kt, { capture: !0 }), pt = null, document.removeEventListener("keydown", _t), document.removeEventListener("keyup", Dt), document.removeEventListener("paste", Ct), St.clear(), window.removeEventListener("scroll", Ht), window.removeEventListener("wheel", Ft), document.removeEventListener("focus", ie, { capture: !0 }), document.removeEventListener("input", ie, { capture: !0 }), document.removeEventListener("click", ie, { capture: !0 }), document.removeEventListener("keydown", Me, !0), document.removeEventListener("keydown", _e, !0), document.removeEventListener("input", Ce, !0), document.removeEventListener("focus", Ae, !0), document.removeEventListener("mousedown", Ee, !0), document.removeEventListener("submit", Ie, !0), document.removeEventListener("submit", De, !0), we && (we.disconnect(), we = null), Ge && clearInterval(Ge), document.removeEventListener("visibilitychange", en), window.removeEventListener("beforeunload", nn), We = null, Je = null);
2165
- });
2166
- };
2167
- },
2168
- layer: "behavioral"
2169
- },
2170
- fpsignals: {
2171
- create: function(t, e, i) {
2172
- const o = p(i, "device"), s = p(i, "pid"), c = p(i, "behaviour"), u = new a();
2173
- let l, d = !1, f = null;
2174
- const h = new Promise(function(t) {
2175
- l = t;
2176
- });
2177
- function m(e) {
2178
- if (!e) return !1;
2179
- const n = {
2180
- name: "fp_signals",
2181
- timestamp: Date.now(),
2182
- signals: e
2183
- };
2184
- return t.push(n), !0;
2185
- }
2186
- function w() {
2187
- return !!u.isReady() && m(u.getSignals(r.Behaviour));
2188
- }
2189
- function y(t) {
2190
- const e = I(() => u.getSignals(t));
2191
- return e && I(() => m(e)) ? e : null;
2192
- }
2193
- L = h;
2194
- const v = E(() => {
2195
- "hidden" === document.visibilityState && w() && t.flush();
2196
- }), g = E((e) => {
2197
- ("click" !== e.type || e.target instanceof Element && e.target.closest(b)) && w() && t.flush();
2198
- });
2199
- return A(async () => {
2200
- if (await u.initialize("https://cdn.incodesmile.com/ml-wasm-kit-release/v2.14.54-pre1-fpsignals3/fpSignals/fpSignalsLib.wasm", "https://cdn.incodesmile.com/ml-wasm-kit-release/v2.14.54-pre1-fpsignals3/fpSignals/fpSignalsLibSimd.wasm"), d) return void u.freeResources();
2201
- if (u.setHostInfo(t.host.platform, t.host.version), c && (u.setBehaviourCollectionEnabled(!0), f = setInterval(_(w), 1e4), T(document, "visibilitychange", v), T(document, "submit", g), T(document, "click", g)), !o && !s) return;
2202
- if (await u.collect(), d) return;
2203
- const e = o ? y(r.Device) : null, i = s ? y(r.PID) : null;
2204
- l({
2205
- pid: i,
2206
- device: e
2207
- });
2208
- }).then(function() {
2209
- l(null);
2210
- }), () => {
2211
- d = !0, l(null), L === h && (L = null), null !== f && clearInterval(f), x(document, "visibilitychange", v), x(document, "submit", g), x(document, "click", g), I(() => {
2212
- c && w();
2213
- }), I(() => u.freeResources());
2214
- };
2215
- },
2216
- layer: "device-fingerprinting",
2217
- events: [
2218
- "device",
2219
- "pid",
2220
- "behaviour"
2221
- ]
2222
- }
2223
- };
2224
- const fn = Object.keys(dn);
2225
- const hn = [
2226
- /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
2227
- /^0b[01]+$/i,
2228
- /^0o[0-7]+$/i,
2229
- /^0x[0-9a-f]+$/i,
2230
- /^[a-z][a-z0-9]{1,12}:[A-Za-z0-9+/=_-]{6,}$/i,
2231
- /^[a-z]{2,8}_(?=.*\d)[A-Za-z0-9]{3,}$/,
2232
- /^\d{4,}$/,
2233
- /@/,
2234
- /^[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{10,}$/,
2235
- /^[A-Za-z0-9_-]{20,}={0,2}$/,
2236
- /^[0-9a-f]{7,}$/i
2237
- ];
2238
- function mn(t) {
2239
- try {
2240
- const e = new URL(t, location.href);
2241
- e.username = "", e.password = "", e.hash = "";
2242
- const n = [...e.searchParams.keys()], i = n.length > 0 ? "?" + n.map((t) => `${encodeURIComponent(t)}=<redacted>`).join("&") : "";
2243
- e.search = "", e.pathname = e.pathname.split("/").map((t) => "" !== t && function(t) {
2244
- for (const e of hn) if (e.test(t)) return !0;
2245
- return !1;
2246
- }(t) ? ":param" : t).join("/");
2247
- const o = e.origin + e.pathname + i;
2248
- return o.length > 2048 ? o.slice(0, 2048) : o;
2249
- } catch {
2250
- return "";
2251
- }
2252
- }
2253
- const pn = "idle";
2254
- const wn = "ready";
2255
- const yn = "started";
2256
- const vn = "collection-disabled";
2257
- const gn = "init-failed";
2258
- const bn = {
2259
- flush: {
2260
- intervalMs: 2e3,
2261
- maxIntervalMs: 3e4,
2262
- size: 50,
2263
- backoffFailureThreshold: 2
2264
- },
2265
- queue: { size: 100 }
2266
- };
2267
- function kn() {
2268
- const t = {};
2269
- for (const e of fn) t[e] = Sn(e, void 0, !0);
2270
- return t;
2271
- }
2272
- function Tn(t) {
2273
- const e = {};
2274
- for (const n of fn) e[n] = Sn(n, void 0, t[dn[n].layer] ?? !1);
2275
- return e;
2276
- }
2277
- function xn(t) {
2278
- const e = {};
2279
- for (const n of fn) {
2280
- const i = t[n];
2281
- e[n] = Sn(n, i, i?.enabled ?? !1);
2282
- }
2283
- return e;
2284
- }
2285
- function Sn(t, e, n) {
2286
- const i = dn[t]?.events ?? [];
2287
- if (0 === i.length) return { enabled: n };
2288
- const o = e?.events, r = {};
2289
- for (const t of i) r[t] = { enabled: o?.[t] ?? !0 };
2290
- return {
2291
- enabled: n,
2292
- events: r
2293
- };
2294
- }
2295
- function Mn(t) {
2296
- if (!t) return null;
2297
- const e = t.split(".")[1], n = atob(e.replace(/-/g, "+").replace(/_/g, "/"));
2298
- return JSON.parse(n);
2299
- }
2300
- const In = function(t, e = 30) {
2301
- if (!t) return !0;
2302
- const n = Mn(t);
2303
- return !n || "number" != typeof n.exp || 1e3 * n.exp <= Date.now() + 1e3 * e;
2304
- };
2305
- async function An(t, e) {
2306
- return globalThis.navigator && "locks" in globalThis.navigator && "request" in globalThis.navigator.locks && "query" in globalThis.navigator.locks ? navigator.locks.request(t, { mode: "exclusive" }, async () => A(e)) : A(e);
2307
- }
2308
- function En(t) {
2309
- function e() {
2310
- return globalThis.window && globalThis.window[t] && void 0 !== globalThis.window[t];
2311
- }
2312
- return {
2313
- get: function(n) {
2314
- if (!e()) return null;
2315
- try {
2316
- const e = window[t].getItem(n) ?? "null";
2317
- return "null" === e ? null : JSON.parse(e);
2318
- } catch {
2319
- return null;
2320
- }
2321
- },
2322
- set: function(n, i) {
2323
- e() && I(() => window[t].setItem(n, JSON.stringify(i)));
2324
- },
2325
- remove: function(n) {
2326
- e() && I(() => window[t].removeItem(n));
2327
- },
2328
- key: function(n) {
2329
- return e() ? window[t].key(n) : null;
2330
- },
2331
- get length() {
2332
- return e() ? window[t].length : 0;
2333
- }
2334
- };
2335
- }
2336
- const _n = En("localStorage");
2337
- const Dn = En("sessionStorage");
2338
- const Cn = "__tri";
2339
- const Ln = `${Cn}_activity_token`;
2340
- const Rn = `${Cn}_activity_id`;
2341
- const zn = `${Cn}_activity_status`;
2342
- const Pn = "__tri_activity_lock";
2343
- var $n = class {
2344
- constructor(t) {
2345
- this.context = t, this.h = null, this.m = null, this.p = null, this.v = null, this.k = null, this.T = !1;
2346
- }
2347
- getToken() {
2348
- return this.h;
2349
- }
2350
- getActivityId() {
2351
- return this.m ?? "";
2352
- }
2353
- isActive() {
2354
- return "ACTIVE" === this.p && null !== this.h;
2355
- }
2356
- async start() {
2357
- return this.T = !0, this.v || (this.v = this.S()), this.v;
2358
- }
2359
- async stop() {
2360
- const t = this.M();
2361
- this.k = t;
2362
- try {
2363
- await t;
2364
- } finally {
2365
- this.k === t && (this.k = null);
2366
- }
2367
- }
2368
- async M() {
2369
- this.T = !1, this.p = "INACTIVE", this.I(null), this.v = null, this.h && await this.context.stopActivity(), this.A(null);
2370
- }
2371
- async refresh() {
2372
- if (!this.T) return;
2373
- const t = this.h;
2374
- await An(Pn, async () => {
2375
- if (this.h && this.h !== t && !In(this.h) && "ACTIVE" === this.p) return;
2376
- const e = this._();
2377
- e && e.token !== t && !In(e.token) && "ACTIVE" === e.activityStatus ? this.A(e) : (this.D(), await this.C());
2378
- });
2379
- }
2380
- async S() {
2381
- try {
2382
- if (this.k && await this.k, this.h && !In(this.h)) return;
2383
- await An(Pn, async () => {
2384
- await this.C();
2385
- });
2386
- } finally {
2387
- this.v = null;
2388
- }
2389
- }
2390
- async C() {
2391
- const t = this._();
2392
- if (t && !In(t.token) && "ACTIVE" === t.activityStatus) return void this.A(t);
2393
- t && this.D();
2394
- const e = await this.context.startActivity();
2395
- if (!e.ok) return;
2396
- if (!e.data.token) return;
2397
- const n = e.data;
2398
- this.A(n), this.L(n);
2399
- }
2400
- _() {
2401
- const [t, e, n] = [
2402
- _n.get(Ln),
2403
- _n.get(Rn),
2404
- _n.get(zn)
2405
- ];
2406
- return t && e && n ? {
2407
- token: t,
2408
- activityId: e,
2409
- activityStatus: n
2410
- } : ((t || e || n) && this.D(), null);
2411
- }
2412
- L(t) {
2413
- _n.set(Ln, t.token), _n.set(Rn, t.activityId), _n.set(zn, t.activityStatus);
2414
- }
2415
- D() {
2416
- this.I(null), this.A(null);
2417
- }
2418
- I(t) {
2419
- if (!t) return _n.remove(Ln), _n.remove(Rn), void _n.remove(zn);
2420
- _n.set(Ln, t.token), _n.set(Rn, t.activityId), _n.set(zn, t.activityStatus);
2421
- }
2422
- A(t) {
2423
- if (!t) return this.h = null, this.m = null, void (this.p = null);
2424
- this.h = t.token, this.m = t.activityId, this.p = t.activityStatus;
2425
- }
2426
- };
2427
- const Hn = [
2428
- 401,
2429
- 403,
2430
- 409
2431
- ];
2432
- const Fn = Object.freeze({
2433
- tab: 80,
2434
- navigation: 80,
2435
- visibility: 80,
2436
- network: 80,
2437
- screen: 80,
2438
- shinsei_batch: 80,
2439
- fp_signals: 80,
2440
- pointer: 60,
2441
- keystroke: 60,
2442
- autofill: 60,
2443
- change: 60,
2444
- form: 60,
2445
- form_snapshot: 60,
2446
- clipboard: 60,
2447
- selection: 60,
2448
- focus: 60,
2449
- viewport: 60,
2450
- network_request: 60,
2451
- scroll: 40,
2452
- sensors: 40,
2453
- wheel: 40,
2454
- hover: 40
2455
- });
2456
- function Un(t) {
2457
- return "pointer" === t.name && "move" === t.phase || "viewport" === t.name && "resize" === t.type ? 40 : Fn[t.name];
2458
- }
2459
- const On = Object.freeze({
2460
- tri: "/events/capture",
2461
- shinsei: "/events/capture/shinsei",
2462
- "fp-signals": "/events/capture/fp-signals"
2463
- });
2464
- const Bn = /* @__PURE__ */ new Map([["shinsei_batch", "shinsei"], ["fp_signals", "fp-signals"]]);
2465
- function jn(t) {
2466
- return Bn.get(t.name) ?? "tri";
2467
- }
2468
- const Nn = new Array(256);
2469
- for (let t = 0; t < 256; t++) Nn[t] = (t + 256).toString(16).slice(1);
2470
- const qn = /* @__PURE__ */ new Uint8Array(16);
2471
- function Wn(t) {
2472
- return Nn[t[0]] + Nn[t[1]] + Nn[t[2]] + Nn[t[3]] + "-" + Nn[t[4]] + Nn[t[5]] + "-" + Nn[t[6]] + Nn[t[7]] + "-" + Nn[t[8]] + Nn[t[9]] + "-" + Nn[t[10]] + Nn[t[11]] + Nn[t[12]] + Nn[t[13]] + Nn[t[14]] + Nn[t[15]];
2473
- }
2474
- function Xn() {
2475
- return crypto.randomUUID();
2476
- }
2477
- function Yn() {
2478
- return crypto.getRandomValues(qn), qn[6] = 15 & qn[6] | 64, qn[8] = 63 & qn[8] | 128, Wn(qn);
2479
- }
2480
- function Jn() {
2481
- for (let t = 0; t < 16; t++) qn[t] = 256 * Math.random() | 0;
2482
- return qn[6] = 15 & qn[6] | 64, qn[8] = 63 & qn[8] | 128, Wn(qn);
2483
- }
2484
- const Gn = function() {
2485
- if ("undefined" != typeof crypto) {
2486
- if ("function" == typeof crypto.randomUUID) return Xn;
2487
- if ("function" == typeof crypto.getRandomValues) return Yn;
2488
- }
2489
- return Jn;
2490
- }();
2491
- function Vn() {
2492
- return Gn();
2493
- }
2494
- var Zn = class {
2495
- constructor(t, e) {
2496
- this.R = t, this.P = e, this.$ = [], this.H = null, this.F = [], this.U = null, this.T = !1, this.O = !0, this.B = 0, this.j = 0, this.N = 0, this.q = t.flush.intervalMs;
2497
- }
2498
- push(t) {
2499
- if (this.T) {
2500
- if (this.$.length < this.W() ? this.$.push(t) : this.X(t), this.O) return this.$.length >= this.R.flush.size ? (C(this.H), this.H = null, void this.flush("capacity")) : void this.Y();
2501
- } else e.warn("Transport", "push() called before start() — event dropped");
2502
- }
2503
- flush(t) {
2504
- if (this.T && this.P.isActivityActive()) try {
2505
- if ("lifecycle" === t) return void this.J();
2506
- if (0 === this.$.length) return;
2507
- if ("submit" === t && !this.O) return;
2508
- const n = "submit" === t;
2509
- for (const i of this.G(!1)) {
2510
- const o = this.V(i, t, n ? this.Z() : void 0);
2511
- o && (n ? this.K(o) : this.P.ingest(o, !1)).then((t) => this.tt(t, o)).catch(() => {
2512
- e.warn("Transport", "ingest threw unexpectedly — batch dropped");
2513
- });
2514
- }
2515
- this.$.length > 0 && this.Y();
2516
- } catch (t) {
2517
- e.warn("Transport", "flush() threw unexpectedly:", t);
2518
- }
2519
- }
2520
- start() {
2521
- this.T || (this.T = !0, this.O = "undefined" == typeof navigator || navigator.onLine);
2522
- }
2523
- stop() {
2524
- if (!this.T) return Promise.resolve();
2525
- C(this.H), this.H = null, C(this.U), this.U = null;
2526
- const t = this.J();
2527
- return this.T = !1, t;
2528
- }
2529
- onConnectionChange() {
2530
- const t = "undefined" == typeof navigator || navigator.onLine;
2531
- if (t !== this.O) {
2532
- if (this.O = t, !this.O) return C(this.H), this.H = null, C(this.U), void (this.U = null);
2533
- this.$.length > 0 && this.Y(), this.F.length > 0 && this.et();
2534
- }
2535
- }
2536
- Y() {
2537
- this.T && this.O && null === this.H && (this.H = D(() => {
2538
- this.H = null, this.flush("interval");
2539
- }, this.q));
2540
- }
2541
- et() {
2542
- this.T && this.O && null === this.U && (this.U = D(() => {
2543
- this.U = null, this.nt();
2544
- }, this.q));
2545
- }
2546
- nt() {
2547
- if (!this.T || !this.O || 0 === this.F.length || !this.P.isActivityActive()) return;
2548
- const t = this.F.shift();
2549
- this.P.ingest(t.batch, !1).then((e) => this.it(e, t)).catch(() => {
2550
- e.warn("Transport", "retry drain ingest threw unexpectedly — batch dropped"), this.F.length > 0 && this.et();
2551
- });
2552
- }
2553
- ot(t, n) {
2554
- this.F.length >= 5 && (this.F.shift(), e.warn("Transport", "retry queue full — oldest batch evicted")), this.F.push({
2555
- batch: t,
2556
- attempts: n
2557
- }), this.et();
2558
- }
2559
- tt(t, e) {
2560
- t.ok ? this.rt() : this.st(t) && this.ot(e, 1);
2561
- }
2562
- it(t, n) {
2563
- if (t.ok) return this.rt(), void (this.F.length > 0 && this.et());
2564
- if (this.st(t)) {
2565
- if (n.attempts >= 3) return this.ct(), e.warn("Transport", "batch dropped after MAX_RETRY_ATTEMPTS", n.batch.batchId), void (this.F.length > 0 && this.et());
2566
- this.ct(), this.ot(n.batch, n.attempts + 1);
2567
- } else this.F.length > 0 && this.et();
2568
- }
2569
- ct() {
2570
- this.B++, this.B % this.R.flush.backoffFailureThreshold === 0 && (this.q = Math.min(2 * this.q, this.R.flush.maxIntervalMs));
2571
- }
2572
- rt() {
2573
- this.B = 0, this.q = this.R.flush.intervalMs;
2574
- }
2575
- W() {
2576
- return this.R.queue.size * (this.O ? 1 : 2);
2577
- }
2578
- async J() {
2579
- if (!this.P.isActivityActive()) return Promise.resolve();
2580
- const t = [];
2581
- let n = this.Z();
2582
- for (const i of this.G(!0)) {
2583
- const o = this.V(i, "lifecycle", n);
2584
- o && (n -= Kn(o.events), t.push(this.K(o).catch(() => {
2585
- e.warn("Transport", "lifecycle ingest threw — batch dropped");
2586
- })));
2587
- }
2588
- const i = [];
2589
- for (const o of this.F) {
2590
- const r = Kn(o.batch.events);
2591
- r > n ? i.push(o) : (n -= r, t.push(this.K(o.batch).catch(() => {
2592
- e.warn("Transport", "lifecycle retry ingest threw — batch dropped");
2593
- })));
2594
- }
2595
- return this.F = i, Promise.allSettled(t).then(() => {});
2596
- }
2597
- Z() {
2598
- return Math.max(0, 49152 - this.N);
2599
- }
2600
- K(t) {
2601
- const e = Kn(t.events);
2602
- return this.N += e, this.P.ingest(t, !0).finally(() => {
2603
- this.N -= e;
2604
- });
2605
- }
2606
- X(t) {
2607
- const e = Un(t);
2608
- for (let n = 0; n < this.$.length; n++) if (Un(this.$[n]) < e) {
2609
- for (let t = n; t < this.$.length - 1; t++) this.$[t] = this.$[t + 1];
2610
- this.$.length -= 1, this.$.push(t);
2611
- return;
2612
- }
2613
- }
2614
- V(t, e, n) {
2615
- const i = this.ut(t, "lifecycle" === e, n);
2616
- return 0 === i.length ? null : {
2617
- activityId: "",
2618
- batchId: Vn(),
2619
- batchSequence: this.j++,
2620
- clientTimestamp: Date.now(),
2621
- schemaVersion: "0.1.0",
2622
- sdkVersion: "0.5.1",
2623
- sdkPlatform: "web",
2624
- tabId: this.P.getTabId(),
2625
- events: i
2626
- };
2627
- }
2628
- ut(t, e, n) {
2629
- const i = this.R.flush.size, o = /* @__PURE__ */ new Set();
2630
- let r = 0;
2631
- for (let s = 0; s < this.$.length && o.size < i; s++) {
2632
- const i = e ? this.$.length - 1 - s : s, a = this.$[i];
2633
- if (jn(a) === t) {
2634
- if (void 0 !== n && (r += Qn(a), r > n)) break;
2635
- o.add(i);
2636
- }
2637
- }
2638
- if (0 === o.size) return [];
2639
- const s = [], a = [];
2640
- for (let t = 0; t < this.$.length; t++) o.has(t) ? s.push(this.$[t]) : a.push(this.$[t]);
2641
- return this.$ = a, s;
2642
- }
2643
- G(t) {
2644
- const e = [];
2645
- for (let n = 0; n < this.$.length; n++) {
2646
- const i = jn(this.$[t ? this.$.length - 1 - n : n]);
2647
- e.includes(i) || e.push(i);
2648
- }
2649
- return e;
2650
- }
2651
- st(t) {
2652
- if (t.ok) return !1;
2653
- switch (t.kind) {
2654
- case "timeout":
2655
- case "server":
2656
- case "rate_limited":
2657
- case "network": return !0;
2658
- default: return !1;
2659
- }
2660
- }
2661
- };
2662
- function Kn(t) {
2663
- let e = 0;
2664
- for (let n = 0; n < t.length; n++) e += Qn(t[n]);
2665
- return e;
2666
- }
2667
- function Qn(t) {
2668
- try {
2669
- return JSON.stringify(t).length + 1;
2670
- } catch {
2671
- return 0;
2672
- }
2673
- }
2674
- const ti = "tri:bcast:";
2675
- const ei = "function" == typeof BroadcastChannel ? BroadcastChannel : function() {
2676
- if ("undefined" == typeof Storage || "undefined" == typeof window) return !1;
2677
- try {
2678
- const t = "__tri_bcast_probe__";
2679
- localStorage.setItem(t, "1");
2680
- const e = "1" === localStorage.getItem(t);
2681
- return localStorage.removeItem(t), e;
2682
- } catch {
2683
- return !1;
2684
- }
2685
- }() ? class {
2686
- constructor(t) {
2687
- this.seq = 0, this.closed = !1, this.listeners = /* @__PURE__ */ new Set(), this.onStorageEvent = (t) => {
2688
- if (this.closed) return;
2689
- if (!t.key || !t.key.startsWith(`${ti}${this.channelName}:`)) return;
2690
- if (null === t.newValue) return;
2691
- let e;
2692
- I(() => _n.remove(t.key));
2693
- try {
2694
- e = JSON.parse(t.newValue);
2695
- } catch {
2696
- return;
2697
- }
2698
- const n = { data: e };
2699
- for (const t of this.listeners) I(() => t(n));
2700
- }, this.channelName = t, this.senderId = Vn(), window.addEventListener("storage", this.onStorageEvent);
2701
- }
2702
- postMessage(t) {
2703
- if (this.closed) return;
2704
- const e = `${ti}${this.channelName}:${this.senderId}:${this.seq++}`;
2705
- I(() => {
2706
- _n.set(e, t), _n.remove(e);
2707
- });
2708
- }
2709
- addEventListener(t, e) {
2710
- this.listeners.add(e);
2711
- }
2712
- removeEventListener(t, e) {
2713
- this.listeners.delete(e);
2714
- }
2715
- close() {
2716
- this.closed || (this.closed = !0, window.removeEventListener("storage", this.onStorageEvent), this.listeners.clear());
2717
- }
2718
- } : class {
2719
- constructor(t) {
2720
- e.warn("BroadcastChannel", "BroadcastChannel is unavailable and localStorage is not writable in this context. Cross-tab discovery is disabled; tab count will always be reported as 1.");
2721
- }
2722
- postMessage(t) {}
2723
- addEventListener(t, e) {}
2724
- removeEventListener(t, e) {}
2725
- close() {}
2726
- };
2727
- const ni = "__tri_tabId";
2728
- var ii = class {
2729
- constructor(t) {
2730
- this.context = t, this.lt = "", this.T = !1, this.dt = null, this.ft = null, this.ht = null, this.wt = /* @__PURE__ */ new Map(), this.yt = -1, this.vt = null;
2731
- }
2732
- async start() {
2733
- this.T || (this.T = !0, this.lt = this.gt(), this.bt(), this.kt({
2734
- type: "hello",
2735
- tabId: this.lt,
2736
- ts: Date.now()
2737
- }), this.Tt(), this.xt("active"), this.St());
2738
- }
2739
- stop() {
2740
- this.T && (this.T = !1, this.xt("inactive"), this.kt({
2741
- type: "bye",
2742
- tabId: this.lt,
2743
- ts: Date.now()
2744
- }), this.Mt(this.It()), this.At(), this.Et(), this._t());
2745
- }
2746
- getTabId() {
2747
- return this.lt;
2748
- }
2749
- queryTabsNumber() {
2750
- return this.wt.size + 1;
2751
- }
2752
- bt() {
2753
- try {
2754
- this.dt = new ei("__tri_tab_channel"), this.vt = this.Dt.bind(this), this.dt.addEventListener("message", this.vt);
2755
- } catch (t) {
2756
- e.warn("TabManager", "failed to open broadcast channel:", t);
2757
- }
2758
- }
2759
- _t() {
2760
- try {
2761
- if (!this.dt) return;
2762
- this.vt && this.dt.removeEventListener("message", this.vt), this.dt.close();
2763
- } catch {} finally {
2764
- this.dt = null, this.vt = null;
2765
- }
2766
- }
2767
- Tt() {
2768
- this.ft = setInterval(() => {
2769
- const t = Date.now();
2770
- this.kt({
2771
- type: "heartbeat",
2772
- tabId: this.lt,
2773
- ts: t
2774
- });
2775
- }, 1e3);
2776
- }
2777
- At() {
2778
- null != this.ft && (clearInterval(this.ft), this.ft = null);
2779
- }
2780
- St() {
2781
- null != this.ht && clearTimeout(this.ht), this.ht = setTimeout(() => {
2782
- this.ht = null;
2783
- const t = this.It() + 1;
2784
- t !== this.yt && (this.yt = t, this.Mt(t));
2785
- }, 1e3);
2786
- }
2787
- Et() {
2788
- null != this.ht && (clearTimeout(this.ht), this.ht = null);
2789
- }
2790
- kt(t) {
2791
- try {
2792
- if (!this.dt) return;
2793
- this.dt.postMessage(t);
2794
- } catch {
2795
- e.warn("TabManager", "failed to broadcast message:", t);
2796
- }
2797
- }
2798
- Dt(t) {
2799
- const { type: e, tabId: n } = t.data;
2800
- if (n === this.lt) return;
2801
- const i = Date.now();
2802
- "hello" === e ? (this.kt({
2803
- type: "ack",
2804
- tabId: this.lt,
2805
- ts: i,
2806
- to: n
2807
- }), this.wt.set(n, i)) : "heartbeat" === e || "ack" === e ? this.wt.set(n, i) : "bye" === e && this.wt.delete(n);
2808
- }
2809
- Mt(t) {
2810
- this.context.events.count && this.context.push({
2811
- name: "tab",
2812
- type: "count",
2813
- tabId: this.lt,
2814
- timestamp: Date.now(),
2815
- ts: performance.now(),
2816
- value: t
2817
- });
2818
- }
2819
- xt(t) {
2820
- this.context.events.state && this.context.push({
2821
- name: "tab",
2822
- type: "state",
2823
- tabId: this.lt,
2824
- timestamp: Date.now(),
2825
- ts: performance.now(),
2826
- value: t
2827
- });
2828
- }
2829
- gt() {
2830
- const t = Dn.get(ni);
2831
- if (t) return t;
2832
- const e = Vn();
2833
- return Dn.set(ni, e), e;
2834
- }
2835
- It(t = Date.now()) {
2836
- let e = 0;
2837
- for (const [n, i] of this.wt.entries()) t - i >= 3e3 ? this.wt.delete(n) : e++;
2838
- return e;
2839
- }
2840
- };
2841
- const oi = globalThis.CompressionStream;
2842
- const ri = globalThis.Response;
2843
- const si = globalThis.Blob;
2844
- const ai = new TextEncoder();
2845
- let ci = null;
2846
- async function ui(t) {
2847
- const n = await async function(t) {
2848
- if ("function" != typeof oi) return null;
2849
- try {
2850
- const e = ai.encode(t), n = new si([e]).stream().pipeThrough(new oi("gzip"));
2851
- return await new ri(n).arrayBuffer();
2852
- } catch (t) {
2853
- return e.warn("compression", "Native gzip failed:", t), null;
2854
- }
2855
- }(t);
2856
- return null !== n ? n : async function(t) {
2857
- try {
2858
- const n = await function() {
2859
- if (null === ci) {
2860
- const t = function(t, n = 1e4) {
2861
- let i = null;
2862
- const o = new Promise((t) => {
2863
- i = D(() => {
2864
- e.warn("import", `Import timed out after ${n}ms`), t(null);
2865
- }, n);
2866
- }), r = Promise.resolve().then(t).catch((t) => (e.warn("import", "Import failed:", t), null));
2867
- return Promise.race([r, o]).finally(() => {
2868
- C(i);
2869
- });
2870
- }(() => import("./browser-pQZA35G2-Bu4in9gN.esm.js"), 1e4);
2871
- ci = t, t.then((e) => {
2872
- null === e && D(() => {
2873
- ci === t && (ci = null);
2874
- }, 1e4);
2875
- });
2876
- }
2877
- return ci;
2878
- }();
2879
- if (null === n) return null;
2880
- const { gzipSync: i } = n, o = i(ai.encode(t));
2881
- return o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength);
2882
- } catch (t) {
2883
- return e.warn("compression", "fflate gzip failed:", t), null;
2884
- }
2885
- }(t);
2886
- }
2887
- function li(t, e) {
2888
- const n = [JSON.stringify(t)];
2889
- for (let t = 0; t < e.length; t++) try {
2890
- n.push(JSON.stringify(e[t]));
2891
- } catch {}
2892
- return n.join("\n");
2893
- }
2894
- function di(t) {
2895
- const e = { Accept: "application/json" };
2896
- return t?.hasBody && ("json" === t.contentType ? e["Content-Type"] = "application/json" : "ndjson" === t.contentType && (e["Content-Type"] = "application/x-ndjson"), "gzip" === t.contentEncoding && (e["Content-Encoding"] = "gzip")), t?.token && (e.Authorization = `Bearer ${t.token}`), t?.profileId && (e["x-profile-id"] = t.profileId), t?.api?.version && (e["x-api-version"] = t.api.version), t?.customHeaders && Object.entries(t.customHeaders).forEach(([t, n]) => {
2897
- e[t] = n;
2898
- }), e;
2899
- }
2900
- const fi = "function" == typeof globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0;
2901
- function hi(t) {
2902
- "undefined" != typeof document && "function" == typeof globalThis.fetch || e.warn("FalconService", "createFalconServiceManager called in a non-browser environment — all requests will resolve with { ok: false, kind: 'network' }.");
2903
- const n = function(t) {
2904
- const e = t?.timeout, n = t?.baseUrl ?? "", i = t?.api;
2905
- async function o(t, o, r) {
2906
- if (void 0 === fi) return {
2907
- ok: !1,
2908
- kind: "network"
2909
- };
2910
- const s = n ? `${n}${o}` : o, a = new AbortController();
2911
- let c = null, u = !1;
2912
- c = D(() => {
2913
- u = !0, a.abort();
2914
- }, e);
2915
- const l = r?.signal;
2916
- let d, f = () => {};
2917
- if (l) if (l.aborted) a.abort();
2918
- else {
2919
- const t = () => a.abort();
2920
- l.addEventListener("abort", t, { once: !0 }), f = () => l.removeEventListener("abort", t);
2921
- }
2922
- if (null != r && "body" in r && null != r.body) {
2923
- const t = function(t) {
2924
- if (null == t) return {
2925
- ok: !0,
2926
- body: void 0
2927
- };
2928
- if ("string" == typeof t || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || t instanceof Blob || t instanceof FormData || t instanceof URLSearchParams || t instanceof ReadableStream) return {
2929
- ok: !0,
2930
- body: t
2931
- };
2932
- try {
2933
- return {
2934
- ok: !0,
2935
- body: JSON.stringify(t)
2936
- };
2937
- } catch {
2938
- return { ok: !1 };
2939
- }
2940
- }(r.body);
2941
- if (!t.ok) return C(c), f(), {
2942
- ok: !1,
2943
- kind: "serialize"
2944
- };
2945
- d = t.body;
2946
- }
2947
- try {
2948
- const e = await fi(s, {
2949
- method: t,
2950
- headers: di({
2951
- token: r?.token,
2952
- profileId: r?.profileId,
2953
- contentType: r?.contentType,
2954
- contentEncoding: r?.contentEncoding,
2955
- api: i,
2956
- hasBody: void 0 !== d,
2957
- customHeaders: r?.customHeaders
2958
- }),
2959
- body: d,
2960
- signal: a.signal,
2961
- keepalive: r?.keepalive
2962
- });
2963
- if (!e.ok) return 429 === (h = e.status) ? {
2964
- ok: !1,
2965
- kind: "rate_limited",
2966
- status: h
2967
- } : h >= 400 && h < 500 ? {
2968
- ok: !1,
2969
- kind: "client",
2970
- status: h
2971
- } : {
2972
- ok: !1,
2973
- kind: "server",
2974
- status: h
2975
- };
2976
- if (204 === e.status) return {
2977
- ok: !0,
2978
- data: void 0,
2979
- status: 204
2980
- };
2981
- try {
2982
- return {
2983
- ok: !0,
2984
- data: await e.json(),
2985
- status: e.status
2986
- };
2987
- } catch {
2988
- return a.signal.aborted ? u ? {
2989
- ok: !1,
2990
- kind: "timeout"
2991
- } : {
2992
- ok: !1,
2993
- kind: "abort"
2994
- } : {
2995
- ok: !1,
2996
- kind: "parse",
2997
- status: e.status
2998
- };
2999
- }
3000
- } catch {
3001
- return u ? {
3002
- ok: !1,
3003
- kind: "timeout"
3004
- } : a.signal.aborted ? {
3005
- ok: !1,
3006
- kind: "abort"
3007
- } : {
3008
- ok: !1,
3009
- kind: "network"
3010
- };
3011
- } finally {
3012
- C(c), f();
3013
- }
3014
- var h;
3015
- }
3016
- return {
3017
- post: async function(t, e) {
3018
- return o("POST", t, e);
3019
- },
3020
- get: async function(t, e) {
3021
- return o("GET", t, e);
3022
- }
3023
- };
3024
- }({
3025
- baseUrl: `${t.api.url}/api/v1`,
3026
- timeout: 1e4,
3027
- api: { version: t.api.version }
3028
- }), i = function(t) {
3029
- const { getToken: n, refresh: i } = t;
3030
- let o = null;
3031
- return { withAuth: async function(t, r) {
3032
- if (o) {
3033
- const e = await o;
3034
- if (e) return t(e);
3035
- }
3036
- const s = n() ?? "", a = await t(s);
3037
- if ((c = a).ok || !("rejected" === c.kind || "client" === c.kind && Hn.includes(c.status)) || !1 === r?.refreshable) return a;
3038
- var c;
3039
- const u = await (o || (o = async function() {
3040
- try {
3041
- return await i(), n();
3042
- } catch (t) {
3043
- return e.warn("AuthMiddleware", "auth refresh failed", t), null;
3044
- }
3045
- }().finally(() => {
3046
- o = null;
3047
- }), o));
3048
- return u && u !== s ? t(u) : a;
3049
- } };
3050
- }(t), o = () => ({ profileId: t.getProfileId() ?? void 0 });
3051
- return { api: {
3052
- ingest: async function(e, r) {
3053
- return i.withAuth(async (i) => {
3054
- const { events: s, ...a } = e, c = {
3055
- ...a,
3056
- activityId: t.getActivityId()
3057
- };
3058
- let u, l = !1;
3059
- try {
3060
- if (r) u = li(c, s);
3061
- else {
3062
- const t = await async function(t, e) {
3063
- const n = li(t, e), i = await ui(n);
3064
- return i ? {
3065
- type: "gzip",
3066
- body: i
3067
- } : {
3068
- type: "ndjson",
3069
- body: n
3070
- };
3071
- }(c, s);
3072
- u = t.body, l = "gzip" === t.type;
3073
- }
3074
- } catch {
3075
- return {
3076
- ok: !1,
3077
- kind: "serialize"
3078
- };
3079
- }
3080
- const d = await n.post(function(t) {
3081
- return t.length > 0 ? On[jn(t[0])] : On.tri;
3082
- }(s), {
3083
- body: u,
3084
- token: i,
3085
- keepalive: r,
3086
- contentType: "ndjson",
3087
- contentEncoding: l ? "gzip" : void 0,
3088
- ...o()
3089
- });
3090
- return function(t) {
3091
- return t.ok && !0 === t.data?.malformedBatch;
3092
- }(d) ? {
3093
- ok: !1,
3094
- kind: "rejected",
3095
- status: d.status
3096
- } : d;
3097
- }, { refreshable: !r });
3098
- },
3099
- reportEvent: async function(t) {
3100
- return i.withAuth((e) => n.post("/events/report-event", {
3101
- body: t,
3102
- token: e,
3103
- contentType: "json",
3104
- ...o()
3105
- }));
3106
- },
3107
- startActivity: async function() {
3108
- return n.post("/events/start-activity", {
3109
- token: t.getSdkToken(),
3110
- ...o()
3111
- });
3112
- },
3113
- stopActivity: async function() {
3114
- return i.withAuth((t) => n.post("/events/end-activity", {
3115
- token: t,
3116
- keepalive: !0,
3117
- ...o()
3118
- }), { refreshable: !1 });
3119
- },
3120
- collectionStatus: async function() {
3121
- return n.get("/sdk/collection-status", {
3122
- token: t.getSdkToken(),
3123
- ...o()
3124
- });
3125
- },
3126
- linkInterview: async function(e) {
3127
- const r = t.getToken();
3128
- return r && !In(r) || await t.refresh(), i.withAuth((t) => n.post("/events/link-interview", {
3129
- token: t,
3130
- contentType: "json",
3131
- ...o(),
3132
- customHeaders: { "X-Incode-Hardware-Id": e }
3133
- }), { refreshable: !1 });
3134
- }
3135
- } };
3136
- }
3137
- var mi = class {
3138
- constructor(t) {
3139
- this.context = t;
3140
- }
3141
- stop() {}
3142
- async report(t, n) {
3143
- const i = {
3144
- name: t,
3145
- metadata: n,
3146
- timestamp: Date.now(),
3147
- activityId: this.context.getActivityId() ?? ""
3148
- };
3149
- try {
3150
- const o = await this.context.reportEvent(i);
3151
- if (o.ok) return o;
3152
- e.warn("EventReport", "Failed to report event:", t, n, "with result:", o);
3153
- } catch (i) {
3154
- e.warn("EventReport", "Failed to report event:", t, n, "with error:", i);
3155
- }
3156
- }
3157
- };
3158
- const pi = /* @__PURE__ */ new Set([
3159
- "A",
3160
- "BUTTON",
3161
- "INPUT",
3162
- "SELECT",
3163
- "TEXTAREA",
3164
- "SUMMARY",
3165
- "DETAILS",
3166
- "LABEL",
3167
- "OPTION",
3168
- "FIELDSET"
3169
- ]);
3170
- const wi = /* @__PURE__ */ new Set([
3171
- "button",
3172
- "link",
3173
- "tab",
3174
- "menuitem",
3175
- "menuitemcheckbox",
3176
- "menuitemradio",
3177
- "checkbox",
3178
- "radio",
3179
- "switch",
3180
- "slider",
3181
- "spinbutton",
3182
- "combobox",
3183
- "listbox",
3184
- "option",
3185
- "searchbox",
3186
- "textbox",
3187
- "treeitem"
3188
- ]);
3189
- const yi = 255;
3190
- function vi(t, e, n, i = mn) {
3191
- const o = t.tagName.toLowerCase(), r = function(t) {
3192
- const e = t.parentElement?.children ?? [], n = Math.min(e.length, 1e3);
3193
- let i = n - 1, o = 0, r = 0;
3194
- for (let i = 0; i < n; i++) {
3195
- r++;
3196
- const n = e[i];
3197
- if (u(n, t.tagName) && o++, n === t) break;
3198
- }
3199
- return {
3200
- siblings: i,
3201
- ofType: o,
3202
- child: r
3203
- };
3204
- }(t), s = function(t, e, n) {
3205
- const i = function(t) {
3206
- if (!t) return null;
3207
- const e = t.getAttribute("data-tri-redact-attrs");
3208
- return e ? e.split(",").map((t) => t.trim().toLowerCase()) : null;
3209
- }(t), o = {}, r = t.id;
3210
- r && !h("id", i) && (o.id = r);
3211
- const s = t.getAttribute("autocomplete");
3212
- s && !h("autocomplete", i) && (o.autocomplete = s);
3213
- const a = t.getAttribute("aria-invalid");
3214
- a && !h("aria-invalid", i) && (o.ariaInvalid = a);
3215
- const c = t.getAttribute("tabindex");
3216
- c && !h("tabindex", i) && (o.tabIndex = parseInt(c, 10));
3217
- const u = function(t) {
3218
- return t.getAttribute("data-testid") ?? t.getAttribute("data-cy") ?? null;
3219
- }(t);
3220
- u && !h("data-testid", i) && (o.testId = u);
3221
- const l = t.hasAttribute("readonly");
3222
- l && !h("readonly", i) && (o.readOnly = l);
3223
- const d = t.hasAttribute("required");
3224
- d && !h("required", i) && (o.required = d);
3225
- const f = t.getAttribute("contenteditable");
3226
- f && !h("contenteditable", i) && (o.contentEditable = "true" === f || "" === f);
3227
- const p = t.getAttribute("href");
3228
- p && !h("href", i) && (o.href = {
3229
- ...e ? {} : { url: n(p) },
3230
- external: m(p)
3231
- });
3232
- const w = t.getAttribute("role");
3233
- w && !h("role", i) && (o.role = w);
3234
- const y = t.getAttribute("type");
3235
- y && !h("type", i) && (o.type = y);
3236
- const v = t.getAttribute("name");
3237
- v && !h("name", i) && (o.name = v);
3238
- const g = t.getAttribute("placeholder");
3239
- !g || e || h("placeholder", i) || (o.placeholder = g);
3240
- const b = Array.from(t.classList).slice(0, 5);
3241
- b.length > 0 && !h("class", i) && (o.classes = b);
3242
- const k = t.getAttribute("alt");
3243
- return !k || e || h("alt", i) || (o.alt = k), Object.keys(o).length ? o : null;
3244
- }(t, e, i);
3245
- return {
3246
- tagName: o,
3247
- frame: n,
3248
- ...s ? { attributes: s } : {},
3249
- ...r ? { nth: r } : {}
3250
- };
3251
- }
3252
- function gi(t, e) {
3253
- let n = 0;
3254
- const i = [];
3255
- return function(t) {
3256
- return pi.has(t.tagName);
3257
- }(t) && (n += 40, i.push("native")), function(t) {
3258
- return t.hasAttribute("data-tri-interactive");
3259
- }(t) && (n += 40, i.push("tri-interactive")), function(t) {
3260
- return u(t, "a") && t.hasAttribute("href");
3261
- }(t) && (n += 15, i.push("has-href")), function(t) {
3262
- const e = t.getAttribute("role");
3263
- return null !== e && wi.has(e);
3264
- }(t) && (n += 30, i.push("role")), function(t) {
3265
- return t.hasAttribute("onclick") || t.hasAttribute("ng-click") || t.hasAttribute("data-action") || t.hasAttribute("@click");
3266
- }(t) && (n += 20, i.push("click-handler")), function(t) {
3267
- const e = t.getAttribute("tabindex");
3268
- if (null === e) return !1;
3269
- const n = parseInt(e, 10);
3270
- return null !== n && n >= 0;
3271
- }(t) && (n += 10, i.push("tabindex")), (t.id || t.getAttribute("data-testid")) && (n += 5, i.push("has-id")), e > 0 && (n += Math.round(15 / e), i.push("depth")), {
3272
- score: n,
3273
- reasons: i
3274
- };
3275
- }
3276
- function bi(t) {
3277
- return t >= 20;
3278
- }
3279
- function ki(t) {
3280
- return null !== t && t.width > 0 && t.height > 0 && t.y < window.innerHeight && t.y + t.height > 0 && t.x < window.innerWidth && t.x + t.width > 0;
3281
- }
3282
- function Ti(t) {
3283
- return !0 === t.disabled || "true" === t.getAttribute("aria-disabled");
3284
- }
3285
- function xi(t, e = !1) {
3286
- if (e) return null;
3287
- const n = Mi(t, "labelledby");
3288
- if (n) return {
3289
- text: Ai(n),
3290
- resolutionMethod: "aria-labelledby",
3291
- confidence: "high"
3292
- };
3293
- const i = Ii(t);
3294
- if (i) return {
3295
- text: Ai(i),
3296
- resolutionMethod: "aria-label",
3297
- confidence: "high"
3298
- };
3299
- const o = function(t) {
3300
- if (!t.id) return null;
3301
- const e = document.querySelector(`label[for="${CSS.escape(t.id)}"]`);
3302
- return e ? Si(e) : null;
3303
- }(t);
3304
- if (o) return {
3305
- text: Ai(o),
3306
- resolutionMethod: "html-for",
3307
- confidence: "high"
3308
- };
3309
- const r = function(t) {
3310
- const e = t.closest("label");
3311
- return e ? Si(e) : null;
3312
- }(t);
3313
- if (r) return {
3314
- text: Ai(r),
3315
- resolutionMethod: "wrapping-label",
3316
- confidence: "high"
3317
- };
3318
- const s = function(t) {
3319
- return t.getAttribute("placeholder")?.trim() ?? null;
3320
- }(t);
3321
- if (s) return {
3322
- text: Ai(s),
3323
- resolutionMethod: "placeholder",
3324
- confidence: "low"
3325
- };
3326
- const a = function(t) {
3327
- return t.getAttribute("title")?.trim() ?? null;
3328
- }(t);
3329
- if (a) return {
3330
- text: Ai(a),
3331
- resolutionMethod: "title",
3332
- confidence: "low"
3333
- };
3334
- const c = Mi(t, "describedby");
3335
- if (c) return {
3336
- text: Ai(c),
3337
- resolutionMethod: "aria-describedby",
3338
- confidence: "low"
3339
- };
3340
- const u = Si(t);
3341
- return u ? {
3342
- text: u,
3343
- resolutionMethod: "text-content",
3344
- confidence: "low"
3345
- } : null;
3346
- }
3347
- function Si(t, e = 0) {
3348
- if (e > 8) return "";
3349
- if (c(t)) return function(t) {
3350
- return t ? t.trim().split(/(\s+)/).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, yi) : null;
3351
- }(t.textContent) ?? "";
3352
- if (!t.childNodes?.length) return "";
3353
- let n = "";
3354
- for (const i of t.childNodes) {
3355
- const t = Si(i, e + 1);
3356
- if (t && (n = n ? `${n} ${t}` : t, n.length >= yi)) break;
3357
- }
3358
- return Ai(n);
3359
- }
3360
- function Mi(t, e) {
3361
- const n = "labelledby" === e ? "aria-labelledby" : "aria-describedby", i = t?.getAttribute(n);
3362
- if (!i) return null;
3363
- const o = i.split(/\s+/), r = [];
3364
- for (const t of o) {
3365
- const e = document.getElementById(t);
3366
- if (!e) continue;
3367
- const n = Ii(e) ?? Si(e);
3368
- n.length && r.push(n);
3369
- }
3370
- return r.length ? r.join(" ") : null;
3371
- }
3372
- function Ii(t) {
3373
- return t?.getAttribute("aria-label")?.trim() ?? null;
3374
- }
3375
- function Ai(t) {
3376
- return t.length > yi ? t.slice(0, yi) + "..." : t;
3377
- }
3378
- function Ei(t) {
3379
- const e = t.getBoundingClientRect();
3380
- return {
3381
- x: e.x,
3382
- y: e.y,
3383
- width: e.width,
3384
- height: e.height
3385
- };
3386
- }
3387
- var _i = class {
3388
- constructor(t) {
3389
- this.capacity = t, this.cache = /* @__PURE__ */ new Map();
3390
- }
3391
- get(t) {
3392
- return this.cache.get(t);
3393
- }
3394
- set(t, e) {
3395
- if (this.cache.has(t)) this.cache.delete(t);
3396
- else if (this.cache.size >= this.capacity) {
3397
- const t = this.cache.keys().next().value;
3398
- t && this.cache.delete(t);
3399
- }
3400
- this.cache.set(t, e);
3401
- }
3402
- delete(t) {
3403
- this.cache.delete(t);
3404
- }
3405
- clear() {
3406
- this.cache.clear();
3407
- }
3408
- size() {
3409
- return this.cache.size;
3410
- }
3411
- };
3412
- function Di() {
3413
- return {
3414
- height: window.innerHeight,
3415
- width: window.innerWidth,
3416
- scrollX: window.scrollX,
3417
- scrollY: window.scrollY,
3418
- dpr: window.devicePixelRatio
3419
- };
3420
- }
3421
- async function Ci(t, n) {
3422
- const { collectors: i, sdk: o } = t;
3423
- let r = null, s = null, a = null, c = null;
3424
- try {
3425
- r = hi({
3426
- api: {
3427
- version: o.api.version,
3428
- url: o.api.url
3429
- },
3430
- getSdkToken: () => o.token,
3431
- getProfileId: () => n.getProfileId(),
3432
- getToken: () => s?.getToken() ?? null,
3433
- refresh: async () => s?.refresh() ?? Promise.resolve(),
3434
- getActivityId: () => s?.getActivityId() ?? ""
3435
- });
3436
- const t = await r.api.collectionStatus();
3437
- if (!t.ok || !0 !== t.data.eventsCollectionEnabled) return { status: "collection-disabled" };
3438
- s = new $n({
3439
- startActivity: () => r.api.startActivity(),
3440
- stopActivity: () => r.api.stopActivity()
3441
- }), a = new Zn(bn, {
3442
- ingest: (t, e) => r.api.ingest(t, e),
3443
- getTabId: () => c?.getTabId() ?? "unknown",
3444
- isActivityActive: () => s?.isActive() ?? !1
3445
- });
3446
- const h = i.tab;
3447
- c = new ii({
3448
- push: (t) => a?.push(t),
3449
- events: {
3450
- state: h.enabled && h.events.state.enabled,
3451
- count: h.enabled && h.events.count.enabled
3452
- }
3453
- });
3454
- const m = function(t) {
3455
- function e(e) {
3456
- "hidden" === document.visibilityState && t.flush();
3457
- }
3458
- function n(e) {
3459
- t.flush(), t.stopTab(), t.getShouldSkipStopActivity() || t.stopActivity();
3460
- }
3461
- const i = E((e) => {
3462
- e.persisted && t.resume();
3463
- }), o = E(() => t.onConnectionChange());
3464
- return {
3465
- start: function() {
3466
- T(document, "visibilitychange", e), T(window, "pagehide", n), T(window, "pageshow", i), T(window, "online", o), T(window, "offline", o);
3467
- },
3468
- stop: function() {
3469
- x(document, "visibilitychange", e), x(window, "pagehide", n), x(window, "pageshow", i), x(window, "online", o), x(window, "offline", o);
3470
- }
3471
- };
3472
- }({
3473
- flush: () => a?.flush("lifecycle"),
3474
- stopActivity: async () => s?.stop(),
3475
- stopTab: () => c?.stop(),
3476
- getShouldSkipStopActivity: () => (c?.queryTabsNumber() ?? 0) > 1,
3477
- onConnectionChange: () => a?.onConnectionChange(),
3478
- resume: async () => {
3479
- try {
3480
- await s?.start(), await c?.start();
3481
- } catch (t) {
3482
- e.warn("IncodeTRI", "resume after bfcache restore failed:", t);
3483
- }
3484
- }
3485
- }), p = function(t = {}) {
3486
- const { elementLevel: e, sanitizeUrl: n = mn } = t, i = e || "redact", o = new _i(6), r = new _i(6);
3487
- return { resolve: function(t, e) {
3488
- if (!t || d(t) || "off" === i) return null;
3489
- let s = o.get(t);
3490
- if (s || (s = function(t) {
3491
- if (!t || d(t)) return {
3492
- chain: [],
3493
- redaction: {
3494
- level: "ignore",
3495
- index: -1
3496
- }
3497
- };
3498
- const e = [];
3499
- let n = t, i = -1;
3500
- for (; n;) {
3501
- if (d(n)) return {
3502
- chain: [],
3503
- redaction: {
3504
- level: "ignore",
3505
- index: -1
3506
- }
3507
- };
3508
- f(n) && (i = e.length), e.push(n);
3509
- const t = n.parentNode;
3510
- if (!t || u(n, "body")) break;
3511
- if (l(t)) n = t.host;
3512
- else {
3513
- if (t.nodeType !== Node.ELEMENT_NODE) break;
3514
- n = t;
3515
- }
3516
- }
3517
- return {
3518
- chain: e,
3519
- redaction: {
3520
- level: -1 === i ? "full" : "redact",
3521
- index: i
3522
- }
3523
- };
3524
- }(t.parentElement), o.set(t, s)), "ignore" === s.redaction.level) return null;
3525
- const a = "redact" === s.redaction.level || "redact" === i || f(t), c = r.get(t);
3526
- if (!c) {
3527
- const e = function(t, e, i, o) {
3528
- const r = getComputedStyle(t), s = Ei(t), a = function(t, e, n = !1, i = mn) {
3529
- const o = [], r = [];
3530
- for (let s = t.length - 1; s >= 0; s--) {
3531
- const a = t[s], c = n || s <= e, u = s + 1, l = vi(a, c, Ei(a), i), { score: d, reasons: f } = gi(a, u);
3532
- if (o.push(l), !bi(d)) continue;
3533
- const h = xi(a, c);
3534
- r.push({
3535
- ...l,
3536
- ...h ? { label: h } : {},
3537
- depth: u,
3538
- score: d,
3539
- reasons: f
3540
- });
3541
- }
3542
- return {
3543
- ancestors: o,
3544
- interactiveCandidates: r.reverse()
3545
- };
3546
- }(e, o, i, n), c = vi(t, i, s, n), u = function(t, e, n) {
3547
- const { score: i, reasons: o } = gi(t, 0);
3548
- return {
3549
- interactive: bi(i),
3550
- ...o.length > 0 ? { reasons: o } : {},
3551
- disabled: Ti(t),
3552
- rendered: "none" !== e?.display,
3553
- visible: "hidden" !== e?.visibility,
3554
- inViewport: ki(n),
3555
- acceptsPointer: "none" !== e?.pointerEvents,
3556
- opacity: parseFloat(e?.opacity || "1")
3557
- };
3558
- }(t, r, s);
3559
- let l = null;
3560
- return i || (l = u.interactive ? xi(t) : null), {
3561
- elementId: B(t),
3562
- tagName: c.tagName,
3563
- frame: c.frame,
3564
- viewport: Di(),
3565
- attributes: c.attributes,
3566
- nth: c.nth,
3567
- ...l ? { label: l } : {},
3568
- ancestors: a.ancestors,
3569
- interactiveCandidates: a.interactiveCandidates,
3570
- interactivity: u
3571
- };
3572
- }(t, s.chain, a, s.redaction.index);
3573
- return r.set(t, e), e;
3574
- }
3575
- return e?.freshGeometry ? {
3576
- ...c,
3577
- frame: Ei(t),
3578
- viewport: Di()
3579
- } : c;
3580
- } };
3581
- }({
3582
- elementLevel: o.capture?.element,
3583
- sanitizeUrl: o.sanitizeUrl
3584
- }), w = /* @__PURE__ */ new Set();
3585
- try {
3586
- w.add(new URL(o.api.url).origin);
3587
- } catch {}
3588
- const y = function(t, e, n = "on") {
3589
- const i = /* @__PURE__ */ new Map();
3590
- function o(o) {
3591
- if (i.has(o)) return;
3592
- const r = dn[o];
3593
- if (!r || !function(t, e) {
3594
- return e[t]?.enabled ?? !1;
3595
- }(o, e)) return;
3596
- const s = e[o], a = r.create(t, n, s && "events" in s ? s.events : void 0);
3597
- i.set(o, a);
3598
- }
3599
- return {
3600
- start: o,
3601
- stopCollector: function(t) {
3602
- const e = i.get(t);
3603
- e && (e(), i.delete(t));
3604
- },
3605
- stop: function() {
3606
- for (const [, t] of i) t();
3607
- i.clear();
3608
- },
3609
- isRunning: function(t) {
3610
- return i.has(t);
3611
- },
3612
- autocapture: function() {
3613
- for (const t of fn) o(t);
3614
- }
3615
- };
3616
- }({
3617
- push: (t) => a?.push(t),
3618
- flush: () => a?.flush("submit"),
3619
- resolveElement: (t, e) => p.resolve(t, e),
3620
- sanitizeUrl: o.sanitizeUrl,
3621
- ignoredOrigins: w,
3622
- getActivityId: () => s?.getActivityId() ?? "",
3623
- host: o.host
3624
- }, i, o.capture?.content), v = new mi({
3625
- getActivityId: () => s?.getActivityId() ?? "",
3626
- reportEvent: (t) => r.api.reportEvent(t)
3627
- });
3628
- return {
3629
- status: "ready",
3630
- managers: {
3631
- falconServiceManager: r,
3632
- activityManager: s,
3633
- transportManager: a,
3634
- tabManager: c,
3635
- lifecycleManager: m,
3636
- collectorManager: y,
3637
- eventReportManager: v
3638
- }
3639
- };
3640
- } catch (t) {
3641
- return e.warn("IncodeTRI", "setup() failed during construction:", t), { status: "init-failed" };
3642
- }
3643
- }
3644
- let Li = class t {
3645
- constructor() {
3646
- this.Ct = 0, this.Lt = null, this.Rt = pn;
3647
- }
3648
- static get instance() {
3649
- return t.o || (t.o = new t()), t.o;
3650
- }
3651
- async setup(t) {
3652
- if (this.Rt !== pn) return e.fatal("error", "setup()", `cannot set up from state '${this.Rt}' — call reset() (or reload) first. Ignoring.`), gn;
3653
- try {
3654
- const n = function(t) {
3655
- if ("undefined" == typeof document) return e.fatal("error", "IncodeTRI", "TRI is not available in a non-browser environment."), null;
3656
- if (!t?.token) return e.fatal("error", "SDK", "token is required."), null;
3657
- if (!t.apiURL) return e.fatal("error", "SDK", "Couldn't initialise SDK — apiURL isn't provided."), null;
3658
- const { element: n, content: i } = t.capture ?? {}, o = {
3659
- token: t.token,
3660
- capture: {
3661
- element: n ?? "redact",
3662
- content: i ?? "off"
3663
- },
3664
- api: {
3665
- version: t.apiVersion ?? "1.0",
3666
- url: t.apiURL
3667
- },
3668
- sanitizeUrl: (s = t.sanitizeUrl, s ? function(t) {
3669
- return I(() => s(t, mn)) ?? mn(t);
3670
- } : mn),
3671
- host: (r = t.host, "string" == typeof r?.platform && "" !== r.platform && "string" == typeof r.version && "" !== r.version ? {
3672
- platform: r.platform,
3673
- version: r.version
3674
- } : (void 0 !== r && e.warn("SDK", "host needs a non-empty platform and version — reporting TRI itself."), {
3675
- platform: "tri-web",
3676
- version: "0.5.1"
3677
- })),
3678
- DEBUG: t.DEBUG ?? !1
3679
- };
3680
- var r, s;
3681
- return void 0 === t.collectors && void 0 === t.layers ? {
3682
- sdk: o,
3683
- collectors: kn()
3684
- } : void 0 !== t.collectors ? {
3685
- sdk: o,
3686
- collectors: xn(t.collectors)
3687
- } : {
3688
- sdk: o,
3689
- collectors: Tn(t.layers)
3690
- };
3691
- }(t);
3692
- if (!n) return this.Rt = gn, gn;
3693
- e.DEBUG = n.sdk.DEBUG;
3694
- const i = await Ci(n, { getProfileId: () => null });
3695
- return "collection-disabled" === i.status ? (e.fatal("warn", "setup()", "Collection is disabled for the provided API Key."), this.Rt = vn, vn) : "init-failed" === i.status ? (this.Rt = gn, gn) : (this.Lt = i.managers, this.Rt = wn, !1 !== t.autostart ? this.start() : wn);
3696
- } catch (t) {
3697
- return e.warn("setup()", "failed:", t), this.Rt = gn, gn;
3698
- }
3699
- }
3700
- async start() {
3701
- if (this.Rt === pn) return e.warn("start()", "start() requires a prior successful setup() — ignoring."), this.Rt;
3702
- if (this.Rt !== wn) return e.fatal("warn", "start()", "TRI is either already started or isn't ready — ignoring."), this.Rt;
3703
- this.Rt = "starting";
3704
- const t = ++this.Ct;
3705
- return await this.S(t), this.Rt;
3706
- }
3707
- async stop() {
3708
- e.warn("stop()", "called");
3709
- const t = this.Lt;
3710
- return t ? (++this.Ct, t.lifecycleManager.stop(), t.collectorManager.stop(), t.tabManager.stop(), t.eventReportManager.stop(), this.Rt = wn, this.zt(t)) : Promise.resolve(this.Rt);
3711
- }
3712
- async reset() {
3713
- const t = this.stop();
3714
- return this.Rt = pn, this.Lt = null, t.then(() => this.Rt);
3715
- }
3716
- async zt(t) {
3717
- return await function(t) {
3718
- let e = null;
3719
- const n = new Promise((t) => {
3720
- e = D(t, 2e3);
3721
- });
3722
- return Promise.race([t.finally(() => C(e)), n]);
3723
- }(Promise.resolve(t.transportManager.stop())), await t.activityManager.stop(), this.Rt;
3724
- }
3725
- async S(t) {
3726
- const n = this.Lt;
3727
- if (n) {
3728
- try {
3729
- if (await n.activityManager.start(), t !== this.Ct) return;
3730
- if (n.transportManager.start(), await n.tabManager.start(), t !== this.Ct) return;
3731
- n.lifecycleManager.start(), n.collectorManager.autocapture();
3732
- } catch (n) {
3733
- e.warn("start()", "failed during monitoring start:", n), t === this.Ct && (this.Rt = wn);
3734
- return;
3735
- }
3736
- t === this.Ct && (this.Rt = yn);
3737
- }
3738
- }
3739
- async linkInterview(t) {
3740
- if (this.Rt !== yn || !this.Lt) return e.warn("linkInterview()", "linkInterview() called before start() completed — ignoring."), !1;
3741
- if (!t) return e.warn("linkInterview()", "linkInterview() called without sessionToken — ignoring."), !1;
3742
- try {
3743
- return (await this.Lt.falconServiceManager.api.linkInterview(t)).ok;
3744
- } catch (t) {
3745
- return e.warn("linkInterview()", "failed:", t), !1;
3746
- }
3747
- }
3748
- async getFpSignals() {
3749
- if (this.Rt !== yn) return e.warn("getFpSignals()", "getFpSignals() called before start() completed — ignoring."), null;
3750
- try {
3751
- return await (L ?? Promise.resolve(null));
3752
- } catch (t) {
3753
- return e.warn("getFpSignals()", "failed:", t), null;
3754
- }
3755
- }
3756
- addFpSignals(t) {
3757
- const n = this.Lt;
3758
- if (this.Rt !== yn || !n) return e.warn("addFpSignals()", "addFpSignals() called before start() completed — ignoring."), !1;
3759
- if (n.collectorManager.isRunning("fpsignals")) return e.warn("addFpSignals()", "the fpsignals collector is on and sends its own results — ignoring."), !1;
3760
- if ("string" != typeof t || !t) return e.warn("addFpSignals()", "signals is empty — ignoring."), !1;
3761
- try {
3762
- return n.transportManager.push({
3763
- name: "fp_signals",
3764
- timestamp: Date.now(),
3765
- signals: t
3766
- }), !0;
3767
- } catch (t) {
3768
- return e.warn("addFpSignals()", "failed:", t), !1;
3769
- }
3770
- }
3771
- getActivityId() {
3772
- const t = this.Lt;
3773
- if (this.Rt !== yn || !t) return e.warn("getActivityId()", "getActivityId() called before start() completed — returning null."), null;
3774
- try {
3775
- const { activityManager: e } = t;
3776
- return e.isActive() && e.getActivityId() || null;
3777
- } catch (t) {
3778
- return e.warn("getActivityId()", "failed:", t), null;
3779
- }
3780
- }
3781
- };
3782
- async function Ri(t, e) {
3783
- const n = e?.apiURL ?? "https://falcon-ingest-k8s.stage.incodetest.com", i = e?.timeout ?? 1e4, o = new AbortController();
3784
- let r = null, s = !1, a = () => {};
3785
- i && (r = D(() => {
3786
- s = !0, o.abort();
3787
- }, i));
3788
- const c = e?.signal;
3789
- if (c) if (c.aborted) o.abort();
3790
- else {
3791
- const t = () => o.abort();
3792
- c.addEventListener("abort", t, { once: !0 }), a = () => c.removeEventListener("abort", t);
3793
- }
3794
- try {
3795
- const e = await fetch(`${n}/api/v1/sdk/init`, {
3796
- method: "POST",
3797
- headers: {
3798
- "content-type": "application/json",
3799
- "x-api-key": t,
3800
- "x-api-version": "1.0"
3801
- },
3802
- signal: o.signal
3803
- });
3804
- if (!e.ok) {
3805
- let t = e.statusText;
3806
- try {
3807
- const n = await e.json();
3808
- n.errorMessage && (t = n.errorMessage);
3809
- } catch {}
3810
- return {
3811
- token: null,
3812
- expiresAt: null,
3813
- tokenType: null,
3814
- eventsCollectionEnabled: !1,
3815
- error: {
3816
- status: e.status,
3817
- message: t
3818
- }
3819
- };
3820
- }
3821
- const i = await e.json();
3822
- return {
3823
- token: i.token,
3824
- expiresAt: i.expiresAt,
3825
- tokenType: i.tokenType,
3826
- eventsCollectionEnabled: !0,
3827
- error: null
3828
- };
3829
- } catch (t) {
3830
- throw new Error((s ? "[TRI] createSession timed out" : "[TRI] Failed to create session:") + " " + t.message);
3831
- } finally {
3832
- C(r), a();
3833
- }
3834
- }
3835
- Li.o = null;
3836
- const zi = Li.instance;
3837
- //#endregion
3838
- export { Ri as createSession, zi as default };