@incodetech/core 0.0.0-dev-20260615-7defa108 → 0.0.0-dev-20260616-e026f0c8

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 (218) hide show
  1. package/dist/{OpenViduRecordingProvider-DtCkxhaa.esm.js → OpenViduRecordingProvider-BDIlX9Cq.esm.js} +1 -1
  2. package/dist/{StreamCanvasCapture-CPTcu6u6.esm.js → StreamCanvasCapture-Dr5n_iK1.esm.js} +1 -1
  3. package/dist/{StreamCanvasCapture-DFBEzBLB.d.ts → StreamCanvasCapture-uQFmjDCE.d.ts} +1 -1
  4. package/dist/{addressSearch-BQCvIe1E.esm.js → addressSearch-4xxBiFtH.esm.js} +4 -4
  5. package/dist/{ae-signature-DxX99lOP.esm.js → ae-signature-C8mNUYSC.esm.js} +1 -1
  6. package/dist/ae-signature.d.ts +3 -3
  7. package/dist/ae-signature.esm.js +9 -9
  8. package/dist/antifraud.d.ts +3 -3
  9. package/dist/antifraud.esm.js +6 -6
  10. package/dist/{antifraudManager-DI9S7XTK.esm.js → antifraudManager-By70WUpS.esm.js} +3 -3
  11. package/dist/{antifraudManager-CMzQ05Gx.d.ts → antifraudManager-vkuogwAe.d.ts} +2 -2
  12. package/dist/{antifraudStateMachine-ZzjAr546.esm.js → antifraudStateMachine-DPs0Knyq.esm.js} +3 -3
  13. package/dist/authentication.d.ts +13 -13
  14. package/dist/authentication.esm.js +27 -27
  15. package/dist/{authenticationManager-bKzA0gLB.d.ts → authenticationManager-CDxVMHF1.d.ts} +2 -2
  16. package/dist/{authenticationManager-CwcMuMzK.esm.js → authenticationManager-Dz4IJIrK.esm.js} +6 -6
  17. package/dist/{authenticationStateMachine-D7BUqBCb.esm.js → authenticationStateMachine-ZqIWl4M4.esm.js} +8 -8
  18. package/dist/{backCameraStream-lMXrbEpC.esm.js → backCameraStream-iftkf3rd.esm.js} +3 -3
  19. package/dist/browser-8Za96B1X-CUY3snMa.esm.js +1425 -0
  20. package/dist/{browserSimulation-DJfvkbAE.esm.js → browserSimulation-CGjpdNA1.esm.js} +2 -2
  21. package/dist/camera.d.ts +1 -1
  22. package/dist/camera.esm.js +4 -4
  23. package/dist/certificate-issuance.d.ts +30 -30
  24. package/dist/certificate-issuance.esm.js +7 -7
  25. package/dist/{certificateIssuanceStateMachine-DpPZoGT3.esm.js → certificateIssuanceStateMachine-DB2r-cpB.esm.js} +4 -4
  26. package/dist/consent.d.ts +3 -3
  27. package/dist/consent.esm.js +6 -6
  28. package/dist/{consentManager-BIoVcRI-.esm.js → consentManager-ChvHt6T_.esm.js} +3 -3
  29. package/dist/{consentManager-dB4AdXT1.d.ts → consentManager-DWB0fOnC.d.ts} +52 -52
  30. package/dist/{consentStateMachine-DbaAIypS.esm.js → consentStateMachine-CWypW8J8.esm.js} +3 -3
  31. package/dist/cpf-ocr.d.ts +3 -3
  32. package/dist/cpf-ocr.esm.js +6 -6
  33. package/dist/{cpfOcrManager-qoIZene3.esm.js → cpfOcrManager-B52QLxQV.esm.js} +5 -5
  34. package/dist/{cpfOcrManager-BoKvGSo5.d.ts → cpfOcrManager-DZudorH5.d.ts} +25 -25
  35. package/dist/cross-document-data-match.d.ts +1 -1
  36. package/dist/cross-document-data-match.esm.js +5 -5
  37. package/dist/curp-validation.d.ts +7 -7
  38. package/dist/curp-validation.esm.js +6 -6
  39. package/dist/{curpValidationManager-BYxOLnL5.d.ts → curpValidationManager-CeXO_2dN.d.ts} +3 -3
  40. package/dist/{curpValidationManager-Bzxw5FVS.esm.js → curpValidationManager-De6xoNE4.esm.js} +3 -3
  41. package/dist/{curpValidationStateMachine-HGNg1cZZ.esm.js → curpValidationStateMachine-Cx2u6xYU.esm.js} +3 -3
  42. package/dist/custom-fields.d.ts +2 -2
  43. package/dist/custom-fields.esm.js +5 -5
  44. package/dist/custom-watchlist.d.ts +1 -1
  45. package/dist/custom-watchlist.esm.js +5 -5
  46. package/dist/{customWatchlistStateMachine-DOv0pHd_.esm.js → customWatchlistStateMachine-EkXjc819.esm.js} +3 -3
  47. package/dist/{deepsightLoader-Cm_PBWfU.esm.js → deepsightLoader-cR0EgL9O.esm.js} +13 -13
  48. package/dist/{deepsightService-C5vSOVue.esm.js → deepsightService-40p8oygL.esm.js} +7 -7
  49. package/dist/{deepsightService-DmCqRh9-.d.ts → deepsightService-BpVpDm2O.d.ts} +1 -1
  50. package/dist/device.esm.js +4 -4
  51. package/dist/document-capture.d.ts +235 -235
  52. package/dist/document-capture.esm.js +13 -13
  53. package/dist/document-upload.d.ts +53 -53
  54. package/dist/document-upload.esm.js +8 -8
  55. package/dist/{documentCaptureStateMachine-D6ZC_Ty0.esm.js → documentCaptureStateMachine-BBEoBbLb.esm.js} +7 -7
  56. package/dist/dynamic-forms.d.ts +2 -2
  57. package/dist/dynamic-forms.esm.js +5 -5
  58. package/dist/ekyb.d.ts +6 -6
  59. package/dist/ekyb.esm.js +16 -16
  60. package/dist/{ekybStateMachine-BStKk0D1.esm.js → ekybStateMachine-iBJaSAJs.esm.js} +5 -5
  61. package/dist/ekyc.d.ts +3 -3
  62. package/dist/ekyc.esm.js +8 -8
  63. package/dist/{ekycStateMachine-IqmWlBh8.esm.js → ekycStateMachine-dXnYshTa.esm.js} +5 -5
  64. package/dist/electronic-signature.d.ts +3 -3
  65. package/dist/electronic-signature.esm.js +8 -8
  66. package/dist/{electronicSignatureManager-D2WzDJUK.esm.js → electronicSignatureManager-Db9SeoGj.esm.js} +6 -6
  67. package/dist/email.d.ts +4 -4
  68. package/dist/email.esm.js +8 -8
  69. package/dist/{emailManager-DnID6SGV.d.ts → emailManager-DLFWfHIl.d.ts} +3 -3
  70. package/dist/{emailManager-BbI08-We.esm.js → emailManager-DQJIAsix.esm.js} +4 -4
  71. package/dist/{emailStateMachine-CgLix5Wg.esm.js → emailStateMachine-C1DabizS.esm.js} +5 -5
  72. package/dist/{events-BAfXOOYZ.esm.js → events-CmarQoum.esm.js} +1 -1
  73. package/dist/events.esm.js +2 -2
  74. package/dist/extensibility.d.ts +26 -26
  75. package/dist/extensibility.esm.js +57 -57
  76. package/dist/{externalFetch-h7WAdNPQ.esm.js → externalFetch-crimxkN9.esm.js} +1 -1
  77. package/dist/face-match.d.ts +1 -1
  78. package/dist/face-match.esm.js +5 -5
  79. package/dist/{faceCaptureManagerFactory-C2o4b80r.d.ts → faceCaptureManagerFactory-BQg4HVQ0.d.ts} +9 -9
  80. package/dist/{faceCaptureManagerFactory-BIG0X_6p.esm.js → faceCaptureManagerFactory-ByC4Qa8y.esm.js} +4 -4
  81. package/dist/{faceCaptureSetup-CWZnwDLg.esm.js → faceCaptureSetup-B2H2mNGa.esm.js} +7 -7
  82. package/dist/{faceMatchStateMachine-dCBdFrmq.esm.js → faceMatchStateMachine-eQOGyK1R.esm.js} +3 -3
  83. package/dist/field-comparison.d.ts +3 -3
  84. package/dist/field-comparison.esm.js +5 -5
  85. package/dist/{fieldComparisonManager-BOIJSYPj.d.ts → fieldComparisonManager-CgJctoEw.d.ts} +2 -2
  86. package/dist/{fieldComparisonManager-Ce8rDT_m.esm.js → fieldComparisonManager-IaJfvmEt.esm.js} +4 -4
  87. package/dist/fiscal-qr.d.ts +3 -3
  88. package/dist/fiscal-qr.esm.js +12 -12
  89. package/dist/flow-events.d.ts +6 -6
  90. package/dist/flow.d.ts +12 -12
  91. package/dist/flow.esm.js +16 -16
  92. package/dist/{flowCompletionService-D8OXFjRA.esm.js → flowCompletionService-D9l6fDFY.esm.js} +3 -3
  93. package/dist/{flowServices-DPPO-zkq.esm.js → flowServices-BRfa1_9p.esm.js} +4 -4
  94. package/dist/geolocation.d.ts +2 -2
  95. package/dist/geolocation.esm.js +6 -6
  96. package/dist/{geolocationStateMachine-CiwWx_j9.esm.js → geolocationStateMachine-CB4yyRz1.esm.js} +4 -4
  97. package/dist/{getDeviceClass-BnkJjTVR.esm.js → getDeviceClass-rXKlXywy.esm.js} +1 -1
  98. package/dist/government-validation.d.ts +3 -3
  99. package/dist/government-validation.esm.js +7 -7
  100. package/dist/{governmentValidationStateMachine-Kvfdljb6.esm.js → governmentValidationStateMachine-DXqbvuKL.esm.js} +5 -5
  101. package/dist/home.d.ts +15 -15
  102. package/dist/home.esm.js +3 -3
  103. package/dist/http.esm.js +2 -2
  104. package/dist/id-ocr.d.ts +54 -54
  105. package/dist/id-ocr.esm.js +6 -6
  106. package/dist/id-verification.d.ts +27 -27
  107. package/dist/id-verification.esm.js +5 -5
  108. package/dist/id.d.ts +12 -12
  109. package/dist/id.esm.js +31 -31
  110. package/dist/{idCaptureManager-DWRE6Jd4.esm.js → idCaptureManager-Cm-IXB70.esm.js} +5 -5
  111. package/dist/{idCaptureManager-CLOK998H.d.ts → idCaptureManager-Wn84cPTa.d.ts} +8 -8
  112. package/dist/{idCaptureStateMachine-BIz8XI5L.esm.js → idCaptureStateMachine-CU3F89Pn.esm.js} +19 -19
  113. package/dist/{idOcrStateMachine-Dmqb6Lay.esm.js → idOcrStateMachine-BwksZ-bt.esm.js} +5 -5
  114. package/dist/{idVerificationStateMachine-DoxfID_7.esm.js → idVerificationStateMachine-BMzgkkbQ.esm.js} +3 -3
  115. package/dist/identity-reuse.d.ts +3 -3
  116. package/dist/identity-reuse.esm.js +6 -6
  117. package/dist/{identityReuseManager-DcBFqi3g.esm.js → identityReuseManager-Bew667Pj.esm.js} +3 -3
  118. package/dist/{identityReuseManager-BqsBPObh.d.ts → identityReuseManager-mEnl2R8N.d.ts} +36 -36
  119. package/dist/{identityReuseStateMachine-BYee6d-o.esm.js → identityReuseStateMachine-CbR5itoo.esm.js} +3 -3
  120. package/dist/{index-DeuHzDNj.d.ts → index-B1r8U5de.d.ts} +169 -169
  121. package/dist/index-Dn9cDS6f.d.ts +99 -0
  122. package/dist/{index-BbKckxUr.d.ts → index-cIuvyWMa.d.ts} +2 -2
  123. package/dist/index.d.ts +3 -2
  124. package/dist/index.esm.js +13 -12
  125. package/dist/{invokeOnCaptureCallback-DW53sNuV.esm.js → invokeOnCaptureCallback-DyJrH089.esm.js} +1 -1
  126. package/dist/{lib-BCAntT8H.esm.js → lib-DOI53AqI.esm.js} +1 -1
  127. package/dist/mandatory-consent.d.ts +7 -7
  128. package/dist/mandatory-consent.esm.js +6 -6
  129. package/dist/{mandatoryConsentManager--05U1ab3.d.ts → mandatoryConsentManager-HAXD0YGt.d.ts} +53 -53
  130. package/dist/{mandatoryConsentManager-CaZap2vM.esm.js → mandatoryConsentManager-kbO0Dr65.esm.js} +3 -3
  131. package/dist/{mandatoryConsentStateMachine-DebtfjHH.esm.js → mandatoryConsentStateMachine-DtjGqH2e.esm.js} +3 -3
  132. package/dist/openviduLazy--VDjpeVq.esm.js +3 -0
  133. package/dist/{openviduLazy-D7RY-Wk1.esm.js → openviduLazy-BapX8Ljx.esm.js} +2 -2
  134. package/dist/{permissionGuards-D-u5o-ZS.esm.js → permissionGuards-MDEdZAXO.esm.js} +1 -1
  135. package/dist/{permissionServices-DOMAS5FL.esm.js → permissionServices-BApXq7a0.esm.js} +3 -3
  136. package/dist/phone.d.ts +4 -4
  137. package/dist/phone.esm.js +8 -8
  138. package/dist/{phoneManager-C0NWX3dt.esm.js → phoneManager-CZA4CST1.esm.js} +4 -4
  139. package/dist/{phoneManager-BjqCfWeD.d.ts → phoneManager-CkEiuAuM.d.ts} +3 -3
  140. package/dist/{phoneStateMachine-BGhYP8mx.esm.js → phoneStateMachine-BQNuJGjq.esm.js} +5 -5
  141. package/dist/{qe-signature-D10dlZ0x.esm.js → qe-signature-BVUV3TE_.esm.js} +1 -1
  142. package/dist/qe-signature.d.ts +3 -3
  143. package/dist/qe-signature.esm.js +9 -9
  144. package/dist/{recordingService-CBkqroyl.esm.js → recordingService-Cw3hJgT2.esm.js} +15 -15
  145. package/dist/redirect-to-mobile.d.ts +3 -3
  146. package/dist/redirect-to-mobile.esm.js +8 -8
  147. package/dist/{redirectToMobileManager-DK7C4-jS.esm.js → redirectToMobileManager-B4PTmB3H.esm.js} +4 -4
  148. package/dist/{redirectToMobileManager-BzdVum0z.d.ts → redirectToMobileManager-DYQsXMqo.d.ts} +2 -2
  149. package/dist/{redirectToMobileStateMachine-POVmJ2pQ.esm.js → redirectToMobileStateMachine-BWrpS_sN.esm.js} +5 -5
  150. package/dist/{runChildModule-D1kJKuZp.esm.js → runChildModule-DaOsL9FE.esm.js} +3 -3
  151. package/dist/selfie.d.ts +13 -13
  152. package/dist/selfie.esm.js +28 -28
  153. package/dist/{selfieManager-CEO1DECO.d.ts → selfieManager-CxktnRiy.d.ts} +2 -2
  154. package/dist/{selfieManager-CQwbCfx1.esm.js → selfieManager-MGv9xxlB.esm.js} +6 -6
  155. package/dist/{selfieStateMachine-D0azn4SB.esm.js → selfieStateMachine-DIep8sRA.esm.js} +4 -4
  156. package/dist/{session-Bdskj4-a.esm.js → session-C_G3d7av.esm.js} +3 -3
  157. package/dist/session.d.ts +5 -5
  158. package/dist/session.esm.js +12 -12
  159. package/dist/{sessionInitializer-CnF49tUG.esm.js → sessionInitializer-Qlg7EwTl.esm.js} +7 -7
  160. package/dist/{setup-Xw_UwsPu.d.ts → setup-CPD1Cb_d.d.ts} +47 -1
  161. package/dist/{setup-BtMy_8iH.esm.js → setup-wZGxwi9m.esm.js} +36 -7
  162. package/dist/signature.d.ts +2 -2
  163. package/dist/signature.esm.js +5 -5
  164. package/dist/{signatureStateMachine-B8MOqm3t.esm.js → signatureStateMachine-B7hxdXio.esm.js} +3 -3
  165. package/dist/{stats-DYtpAi8r.esm.js → stats-32mOt6D8.esm.js} +2 -2
  166. package/dist/stats.esm.js +3 -3
  167. package/dist/tri-Bn_ESCop.esm.js +326 -0
  168. package/dist/tri.d.ts +2 -0
  169. package/dist/tri.esm-Drm5tKql.esm.js +2590 -0
  170. package/dist/tri.esm.js +4 -0
  171. package/dist/trust-graph.d.ts +3 -3
  172. package/dist/trust-graph.esm.js +3 -3
  173. package/dist/{types-CMtiO-70.d.ts → types-CNiMvUpA.d.ts} +1 -1
  174. package/dist/{types-DVP3cl71.d.ts → types-D8y52YD5.d.ts} +2 -2
  175. package/dist/{types-GHZBxVAa.d.ts → types-DR2YKE_o.d.ts} +1 -1
  176. package/dist/wasm.d.ts +3 -2
  177. package/dist/wasm.esm.js +13 -12
  178. package/dist/watchlist-for-business.d.ts +1 -1
  179. package/dist/watchlist-for-business.esm.js +5 -5
  180. package/dist/watchlist.d.ts +1 -1
  181. package/dist/watchlist.esm.js +5 -5
  182. package/dist/{watchlistForBusinessStateMachine-C_w0OJjF.esm.js → watchlistForBusinessStateMachine-D3W0_TEt.esm.js} +3 -3
  183. package/dist/{watchlistStateMachine-C6vF9Zrp.esm.js → watchlistStateMachine-D8EXhr5W.esm.js} +3 -3
  184. package/dist/workflow.d.ts +97 -97
  185. package/dist/workflow.esm.js +63 -63
  186. package/package.json +6 -1
  187. package/dist/openviduLazy-Cen9OnxA.esm.js +0 -3
  188. /package/dist/{Actor-VPMjMiQi.d.ts → Actor-CeqUTqL9.d.ts} +0 -0
  189. /package/dist/{BrowserStorageProvider-r6RSzdfq.esm.js → BrowserStorageProvider-CGCKial0.esm.js} +0 -0
  190. /package/dist/{BrowserTimerProvider-CswUX7jZ.esm.js → BrowserTimerProvider-BVgutW_b.esm.js} +0 -0
  191. /package/dist/{ITimerCapability-BAVwUNw-.esm.js → ITimerCapability-BvH0pDwp.esm.js} +0 -0
  192. /package/dist/{IpifyProvider-WAAszwtP.esm.js → IpifyProvider-oZf7Ke1O.esm.js} +0 -0
  193. /package/dist/{Manager-TNEsbB6B.d.ts → Manager-CHiHBvMT.d.ts} +0 -0
  194. /package/dist/{MotionSensorProvider-CnpzpFUv.esm.js → MotionSensorProvider-C9fPAJdS.esm.js} +0 -0
  195. /package/dist/{StateMachine-D1N4vDv3.d.ts → StateMachine-HpHVxl3G.d.ts} +0 -0
  196. /package/dist/{WasmUtilProvider-DrWyN0yi.esm.js → WasmUtilProvider-CAZ4AD98.esm.js} +0 -0
  197. /package/dist/{api-D5AupVUC.esm.js → api-DUZwyz0o.esm.js} +0 -0
  198. /package/dist/{apiError-DNxc6p50.esm.js → apiError-D-GTvFrH.esm.js} +0 -0
  199. /package/dist/{camera-q1KoKNR1.d.ts → camera-D0c7ez3w.d.ts} +0 -0
  200. /package/dist/{camera-CBMl39hO.esm.js → camera-x4LjGTjZ.esm.js} +0 -0
  201. /package/dist/{canvas-Q8Scx3Gn.esm.js → canvas-7uX2izHb.esm.js} +0 -0
  202. /package/dist/{chunk-DHPE1s-n.esm.js → chunk-BK1xu56N.esm.js} +0 -0
  203. /package/dist/{cpf-BSpGHuIr.esm.js → cpf-xBg-DFNn.esm.js} +0 -0
  204. /package/dist/{dateUtils-D-YO9_Hp.esm.js → dateUtils-8dCcuArE.esm.js} +0 -0
  205. /package/dist/{endpoints-BUiak39U.esm.js → endpoints-B2t80MAM.esm.js} +0 -0
  206. /package/dist/{flowCompletionService-CamSPuV-.d.ts → flowCompletionService-DSPt5J5M.d.ts} +0 -0
  207. /package/dist/{getBrowser-CNCEFWPH.esm.js → getBrowser-Dv8LZyHE.esm.js} +0 -0
  208. /package/dist/{getDeviceClass-C3N2KaOI.esm.js → getDeviceClass-C0zrM97a.esm.js} +0 -0
  209. /package/dist/{http-CkcES084.esm.js → http-B2UWIXGr.esm.js} +0 -0
  210. /package/dist/{otp-Buh7Tv8k.d.ts → otp-BHJnjEEc.d.ts} +0 -0
  211. /package/dist/{otp-BiWjw9ZQ.esm.js → otp-BcSa5nTM.esm.js} +0 -0
  212. /package/dist/{platform-DctkySJU.esm.js → platform-BfoqeM61.esm.js} +0 -0
  213. /package/dist/{types-CruqHl68.d.ts → types-C1ixFPzO.d.ts} +0 -0
  214. /package/dist/{types-rL_0z8ZR.esm.js → types-C3Yf5jrM.esm.js} +0 -0
  215. /package/dist/{types-BBaEWy5n.d.ts → types-F0IXbaCB.d.ts} +0 -0
  216. /package/dist/{urlUtils-C9o6zrp8.esm.js → urlUtils-8RNHyW3x.esm.js} +0 -0
  217. /package/dist/{warmup-bRMrjEVP.d.ts → warmup-CdT_pVcp.d.ts} +0 -0
  218. /package/dist/{xstate.esm-BMAePvR6.esm.js → xstate.esm-CbU9dpcC.esm.js} +0 -0
@@ -0,0 +1,2590 @@
1
+ //#region ../../node_modules/.pnpm/@incodetech+tri-sdk@0.3.0/node_modules/@incodetech/tri-sdk/dist/tri.esm.js
2
+ var t = class t {
3
+ constructor() {
4
+ this.t = 0;
5
+ }
6
+ static get instance() {
7
+ return t.i || (t.i = new t()), t.i;
8
+ }
9
+ get DEBUG() {
10
+ return this.t;
11
+ }
12
+ set DEBUG(t$1) {
13
+ this.t = t$1;
14
+ }
15
+ warn(t$1, n$1, ...e$1) {
16
+ this.t && this.o("warn", t$1, n$1, ...e$1);
17
+ }
18
+ error(t$1, n$1, ...e$1) {
19
+ this.t && this.o("error", t$1, n$1, ...e$1);
20
+ }
21
+ info(t$1, n$1, ...e$1) {
22
+ this.t && this.o("info", t$1, n$1, ...e$1);
23
+ }
24
+ fatal(t$1, n$1, e$1, ...i$1) {
25
+ this.o(t$1, n$1, e$1, ...i$1);
26
+ }
27
+ o(t$1, n$1, e$1, ...i$1) {
28
+ const o$1 = n$1 ? `[${n$1}]` : "", r$1 = console?.[t$1];
29
+ r$1 && r$1(`[IncodeTRI]${o$1} ${e$1}`, ...i$1);
30
+ }
31
+ };
32
+ const n = t.instance;
33
+ function e(t$1, n$1, e$1) {
34
+ let i$1 = t$1, o$1 = n$1;
35
+ if ("devicepixelratiochange" === n$1) {
36
+ const t$2 = window.devicePixelRatio;
37
+ i$1 = window.matchMedia(`(resolution: ${t$2}dppx)`), o$1 = "change";
38
+ }
39
+ i$1.addEventListener(o$1, e$1, {
40
+ capture: 1,
41
+ passive: 1
42
+ });
43
+ }
44
+ function i(t$1, n$1, e$1) {
45
+ let i$1 = t$1, o$1 = n$1;
46
+ if ("devicepixelratiochange" === n$1) {
47
+ const t$2 = window.devicePixelRatio;
48
+ i$1 = window.matchMedia(`(resolution: ${t$2}dppx)`), o$1 = "change";
49
+ }
50
+ i$1.removeEventListener(o$1, e$1, { capture: 1 });
51
+ }
52
+ const o = globalThis.setTimeout.bind(globalThis), r = globalThis.clearTimeout.bind(globalThis);
53
+ function s(t$1, e$1) {
54
+ try {
55
+ return t$1();
56
+ } catch (t$2) {
57
+ n.warn("utils", "safeSync swallowed error:", t$2);
58
+ }
59
+ }
60
+ async function c(t$1) {
61
+ try {
62
+ return await t$1();
63
+ } catch (t$2) {
64
+ n.warn("utils", "safeAsync swallowed error:", t$2);
65
+ }
66
+ }
67
+ function a(t$1) {
68
+ return (n$1) => s(() => t$1(n$1));
69
+ }
70
+ function l(t$1) {
71
+ return (...e$1) => {
72
+ try {
73
+ t$1(...e$1);
74
+ } catch (t$2) {
75
+ n.warn("utils", "safeTimer swallowed error:", t$2);
76
+ }
77
+ };
78
+ }
79
+ function u(t$1, n$1) {
80
+ return o(l(t$1), n$1);
81
+ }
82
+ function d(t$1) {
83
+ if (null !== t$1) try {
84
+ r(t$1);
85
+ } catch (t$2) {
86
+ n.warn("utils", "safeClearTimeout swallowed error:", t$2);
87
+ }
88
+ }
89
+ const h = new Set([
90
+ "xmlhttprequest",
91
+ "fetch",
92
+ "beacon",
93
+ "navigation",
94
+ "script",
95
+ "link",
96
+ "css",
97
+ "img",
98
+ "iframe",
99
+ "video",
100
+ "audio"
101
+ ]), f = new Set([
102
+ "xmlhttprequest",
103
+ "fetch",
104
+ "beacon"
105
+ ]);
106
+ function p(t$1, n$1) {
107
+ return n$1 ? t$1 : null;
108
+ }
109
+ function m(t$1, n$1) {
110
+ const e$1 = t$1, i$1 = t$1.responseStart > 0, o$1 = p(t$1.domainLookupEnd - t$1.domainLookupStart, i$1), r$1 = p(t$1.connectEnd - t$1.connectStart, i$1), s$1 = p(t$1.connectEnd > 0 && t$1.secureConnectionStart > 0 ? t$1.connectEnd - t$1.secureConnectionStart : 0, i$1), c$1 = p(t$1.responseStart - t$1.requestStart, i$1), a$1 = p(t$1.responseEnd - t$1.responseStart, i$1), l$1 = i$1 ? t$1.transferSize : null, u$1 = i$1 ? t$1.encodedBodySize : null, d$1 = i$1 ? t$1.decodedBodySize : null, f$1 = i$1 && t$1.nextHopProtocol || null, m$1 = i$1 && void 0 !== e$1.deliveryType ? e$1.deliveryType : null, w$1 = e$1.responseStatus, y$1 = void 0 !== w$1 && 0 !== w$1 ? w$1 : null;
111
+ return {
112
+ name: "network_request",
113
+ timestamp: Date.now(),
114
+ performanceTime: t$1.startTime + t$1.duration,
115
+ url: n$1(t$1.name),
116
+ initiatorType: (v$1 = t$1.initiatorType, h.has(v$1) ? v$1 : "other"),
117
+ startTime: t$1.startTime,
118
+ durationMs: t$1.duration,
119
+ dnsLookupMs: o$1,
120
+ tcpConnectMs: r$1,
121
+ tlsHandshakeMs: s$1,
122
+ ttfbMs: c$1,
123
+ responseDownloadMs: a$1,
124
+ transferSize: l$1,
125
+ encodedBodySize: u$1,
126
+ decodedBodySize: d$1,
127
+ nextHopProtocol: f$1,
128
+ deliveryType: m$1,
129
+ responseStatus: y$1
130
+ };
131
+ var v$1;
132
+ }
133
+ function w() {}
134
+ const y = 2e3;
135
+ function v(t$1) {
136
+ return !!t$1 && t$1.nodeType === Node.TEXT_NODE;
137
+ }
138
+ function g(t$1, n$1) {
139
+ return t$1.tagName?.toLowerCase() === n$1.toLowerCase();
140
+ }
141
+ function b(t$1) {
142
+ return !!t$1 && t$1.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
143
+ }
144
+ function k(t$1) {
145
+ return t$1 ? t$1.hasAttribute("data-tri-ignore") : 0;
146
+ }
147
+ function T(t$1) {
148
+ return t$1 ? t$1.hasAttribute("data-tri-redact") : 0;
149
+ }
150
+ function _(t$1, n$1) {
151
+ return n$1?.includes(t$1.toLowerCase()) ?? 0;
152
+ }
153
+ function I(t$1) {
154
+ try {
155
+ return new URL(t$1).origin !== window.location.origin;
156
+ } catch {
157
+ return 0;
158
+ }
159
+ }
160
+ function S(t$1, n$1) {
161
+ return t$1 ? t$1[n$1]?.enabled ?? 0 : 1;
162
+ }
163
+ function x() {
164
+ const t$1 = document.activeElement;
165
+ if (t$1 instanceof HTMLInputElement || t$1 instanceof HTMLTextAreaElement) {
166
+ const n$2 = t$1.selectionStart, e$1 = t$1.selectionEnd;
167
+ return null == n$2 || null == e$1 || n$2 === e$1 ? null : t$1.value.substring(n$2, e$1);
168
+ }
169
+ const n$1 = window.getSelection();
170
+ return !n$1 || n$1.isCollapsed ? null : n$1.toString() || null;
171
+ }
172
+ function E(t$1, n$1) {
173
+ return "off" === n$1 || k(t$1) || T(t$1) ? 0 : 1;
174
+ }
175
+ function A(t$1) {
176
+ const n$1 = document.activeElement;
177
+ if (n$1 instanceof HTMLInputElement || n$1 instanceof HTMLTextAreaElement) return n$1;
178
+ const e$1 = window.getSelection();
179
+ return (i$1 = ("start" === t$1 ? e$1?.anchorNode : e$1?.focusNode) ?? null) ? v(i$1) ? i$1.parentElement : i$1 instanceof Element ? i$1 : null : null;
180
+ var i$1;
181
+ }
182
+ function M() {
183
+ const t$1 = window, n$1 = "__fpjs_p_l_b", e$1 = t$1[n$1];
184
+ if (function(t$2, n$2) {
185
+ var e$2;
186
+ const i$1 = null === (e$2 = Object.getOwnPropertyDescriptor) || void 0 === e$2 ? void 0 : e$2.call(Object, t$2, n$2);
187
+ (null == i$1 ? void 0 : i$1.configurable) ? delete t$2[n$2] : i$1 && !i$1.writable || (t$2[n$2] = void 0);
188
+ }(t$1, n$1), "function" != typeof (null == e$1 ? void 0 : e$1.load)) throw new Error($);
189
+ return e$1;
190
+ }
191
+ const D = "Blocked by CSP", P = "The endpoint parameter is not a valid URL";
192
+ function C(t$1) {
193
+ return function(t$2, n$1) {
194
+ const e$1 = document, i$1 = "securitypolicyviolation";
195
+ let o$1;
196
+ const r$1 = (n$2) => {
197
+ const e$2 = new URL(t$2, location.href), { blockedURI: i$2 } = n$2;
198
+ i$2 !== e$2.href && i$2 !== e$2.protocol.slice(0, -1) && i$2 !== e$2.origin || (o$1 = n$2, s$1());
199
+ };
200
+ e$1.addEventListener(i$1, r$1);
201
+ const s$1 = () => e$1.removeEventListener(i$1, r$1);
202
+ return Promise.resolve().then(n$1).then((t$3) => (s$1(), t$3), (t$3) => new Promise((t$4) => {
203
+ const n$2 = new MessageChannel();
204
+ n$2.port1.onmessage = () => t$4(), n$2.port2.postMessage(null);
205
+ }).then(() => {
206
+ if (s$1(), o$1) return (() => {
207
+ throw new Error(D);
208
+ })();
209
+ throw t$3;
210
+ }));
211
+ }(t$1, () => function(t$2) {
212
+ return new Promise((n$1, e$1) => {
213
+ if (function(t$3) {
214
+ if (URL.prototype) try {
215
+ return new URL(t$3, location.href), 0;
216
+ } catch (t$4) {
217
+ if (t$4 instanceof Error && "TypeError" === t$4.name) return 1;
218
+ throw t$4;
219
+ }
220
+ }(t$2)) throw new Error(P);
221
+ const i$1 = document.createElement("script"), o$1 = () => {
222
+ var t$3;
223
+ return null === (t$3 = i$1.parentNode) || void 0 === t$3 ? void 0 : t$3.removeChild(i$1);
224
+ }, r$1 = document.head || document.getElementsByTagName("head")[0];
225
+ i$1.onload = () => {
226
+ o$1(), n$1();
227
+ }, i$1.onerror = () => {
228
+ o$1(), e$1(new Error(L));
229
+ }, i$1.async = 1, i$1.src = t$2, r$1.appendChild(i$1);
230
+ });
231
+ }(t$1)).then(M);
232
+ }
233
+ const R = "API key required";
234
+ var z = "3.12.9";
235
+ const L = "Failed to load the JS script of the agent", $ = "9319", U = { scriptUrl: "https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js" };
236
+ function B(t$1) {
237
+ function n$1() {
238
+ return globalThis.window && globalThis.window[t$1] && void 0 !== globalThis.window[t$1];
239
+ }
240
+ return {
241
+ get: function(e$1) {
242
+ if (!n$1()) return null;
243
+ try {
244
+ const n$2 = window[t$1].getItem(e$1) ?? "null";
245
+ return "null" === n$2 ? null : JSON.parse(n$2);
246
+ } catch {
247
+ return null;
248
+ }
249
+ },
250
+ set: function(e$1, i$1) {
251
+ n$1() && s(() => window[t$1].setItem(e$1, JSON.stringify(i$1)));
252
+ },
253
+ remove: function(e$1) {
254
+ n$1() && s(() => window[t$1].removeItem(e$1));
255
+ },
256
+ key: function(e$1) {
257
+ return n$1() ? window[t$1].key(e$1) : null;
258
+ },
259
+ get length() {
260
+ return n$1() ? window[t$1].length : 0;
261
+ }
262
+ };
263
+ }
264
+ const O = B("localStorage"), q = B("sessionStorage"), j = "__tri_fingerprint";
265
+ let H = null, N = null;
266
+ async function F(t$1) {
267
+ try {
268
+ const e$1 = await (await function(t$2) {
269
+ return H || (H = function(t$3) {
270
+ var n$1, e$2;
271
+ const { picked: i$2, rest: o$1 } = function(t$4, n$2) {
272
+ const e$3 = {}, i$3 = {};
273
+ for (const [o$2, r$2] of Object.entries(t$4)) n$2.includes(o$2) ? e$3[o$2] = r$2 : i$3[o$2] = r$2;
274
+ return {
275
+ picked: e$3,
276
+ rest: i$3
277
+ };
278
+ }(t$3, [
279
+ "scriptUrlPattern",
280
+ "token",
281
+ "apiKey"
282
+ ]), r$1 = null !== (n$1 = i$2.apiKey) && void 0 !== n$1 ? n$1 : i$2.token, s$1 = null !== (e$2 = function(t$4, n$2) {
283
+ return function(t$5, n$3) {
284
+ return Object.prototype.hasOwnProperty.call(t$5, n$3);
285
+ }(t$4, n$2) ? t$4[n$2] : void 0;
286
+ }(t$3, "scriptUrlPattern")) && void 0 !== e$2 ? e$2 : U.scriptUrl, [c$1, a$1] = function() {
287
+ const t$4 = [], n$2 = () => {
288
+ t$4.push({
289
+ time: /* @__PURE__ */ new Date(),
290
+ state: document.visibilityState
291
+ });
292
+ }, e$3 = ((i$3 = document).addEventListener("visibilitychange", o$2 = n$2, r$2), () => i$3.removeEventListener("visibilitychange", o$2, r$2));
293
+ var i$3, o$2, r$2;
294
+ return n$2(), [t$4, e$3];
295
+ }();
296
+ return Promise.resolve().then(() => {
297
+ if (!r$1 || "string" != typeof r$1) throw new Error(R);
298
+ return function(t$4, n$2) {
299
+ const e$3 = [], [i$3, o$2] = function(t$5) {
300
+ const n$3 = function(t$6) {
301
+ const n$4 = [...t$6];
302
+ return {
303
+ current: () => n$4[0],
304
+ postpone() {
305
+ const t$7 = n$4.shift();
306
+ void 0 !== t$7 && n$4.push(t$7);
307
+ },
308
+ exclude() {
309
+ n$4.shift();
310
+ }
311
+ };
312
+ }(t$5), e$4 = function() {
313
+ let t$6 = 0;
314
+ return () => Math.random() * Math.min(3e3, 100 * Math.pow(2, t$6++));
315
+ }(), i$4 = /* @__PURE__ */ new Set();
316
+ return [n$3.current(), (t$6, o$3) => {
317
+ let r$3;
318
+ const s$3 = o$3 instanceof Error ? o$3.message : "";
319
+ if (s$3 === D || s$3 === P) n$3.exclude(), r$3 = 0;
320
+ else if (s$3 === $) n$3.exclude();
321
+ else if (s$3 === L) {
322
+ const e$5 = Date.now() - t$6.getTime() < 50, o$4 = n$3.current();
323
+ o$4 && e$5 && !i$4.has(o$4) && (i$4.add(o$4), r$3 = 0), n$3.postpone();
324
+ } else n$3.postpone();
325
+ const c$2 = n$3.current();
326
+ return void 0 === c$2 ? void 0 : [c$2, null != r$3 ? r$3 : t$6.getTime() + e$4() - Date.now()];
327
+ }];
328
+ }(t$4);
329
+ let r$2;
330
+ if (void 0 === i$3) return Promise.reject(/* @__PURE__ */ new TypeError("The list of script URL patterns is empty"));
331
+ const s$2 = (t$5) => {
332
+ const i$4 = /* @__PURE__ */ new Date(), c$2 = (n$3) => e$3.push({
333
+ url: t$5,
334
+ startedAt: i$4,
335
+ finishedAt: /* @__PURE__ */ new Date(),
336
+ error: n$3
337
+ }), a$2 = n$2(t$5);
338
+ return a$2.then(() => c$2(), c$2), a$2.catch((t$6) => {
339
+ if (r$2 ??= t$6, e$3.length >= 5) throw r$2;
340
+ const n$3 = o$2(i$4, t$6);
341
+ if (!n$3) throw r$2;
342
+ const [c$3, a$3] = n$3;
343
+ return (l$1 = a$3, new Promise((t$7) => setTimeout(t$7, l$1))).then(() => s$2(c$3));
344
+ var l$1;
345
+ });
346
+ };
347
+ return s$2(i$3).then((t$5) => [t$5, e$3]);
348
+ }(function(t$4, n$2) {
349
+ return (Array.isArray(t$4) ? t$4 : [t$4]).map((t$5) => function(t$6, n$3) {
350
+ const e$3 = encodeURIComponent;
351
+ return t$6.replace(/<[^<>]+>/g, (t$7) => "<version>" === t$7 ? "3" : "<apiKey>" === t$7 ? e$3(n$3) : "<loaderVersion>" === t$7 ? e$3(z) : t$7);
352
+ }(String(t$5), n$2));
353
+ }(s$1, r$1), C);
354
+ }).catch((t$4) => {
355
+ throw a$1(), function(t$5) {
356
+ return t$5 instanceof Error && t$5.message === $ ? new Error(L) : t$5;
357
+ }(t$4);
358
+ }).then(([t$4, n$2]) => (a$1(), t$4.load({
359
+ ...o$1,
360
+ ldi: {
361
+ attempts: n$2,
362
+ visibilityStates: c$1
363
+ }
364
+ })));
365
+ }({
366
+ apiKey: t$2.apiKey,
367
+ region: t$2.region,
368
+ endpoint: t$2.endpoint,
369
+ scriptUrlPattern: t$2.scriptUrlPattern
370
+ }).catch((t$3) => {
371
+ throw H = null, t$3;
372
+ }), H);
373
+ }(t$1)).get({
374
+ timeout: t$1.timeoutMs,
375
+ extendedResult: 1
376
+ });
377
+ if (!e$1.visitorId) return null;
378
+ const i$1 = t$1.cacheTtlMs ?? 2592e6;
379
+ return i$1 > 0 && function(t$2, n$1, e$2) {
380
+ const i$2 = {
381
+ visitorId: t$2,
382
+ requestId: n$1,
383
+ expiresAt: Date.now() + e$2
384
+ };
385
+ O.set(j, i$2);
386
+ }(e$1.visitorId, e$1.requestId, i$1), {
387
+ visitorId: e$1.visitorId,
388
+ requestId: e$1.requestId
389
+ };
390
+ } catch {
391
+ return null;
392
+ }
393
+ }
394
+ const X = {
395
+ apiKey: "5uYRiI0XM6p8k4124ELX",
396
+ endpoint: "https://fingerprint.incodesmile.com",
397
+ scriptUrlPattern: "https://fingerprint.incodesmile.com/web/v<version>/<apiKey>/loader_v<loaderVersion>.js"
398
+ }, K = {
399
+ focusin: "in",
400
+ focusout: "out"
401
+ };
402
+ function V(t$1) {
403
+ return t$1 instanceof HTMLInputElement || t$1 instanceof HTMLTextAreaElement || t$1 instanceof HTMLSelectElement;
404
+ }
405
+ const Y = new Set([
406
+ "Shift",
407
+ "Control",
408
+ "Alt",
409
+ "Meta",
410
+ "Backspace",
411
+ "Delete",
412
+ "Enter",
413
+ "Tab",
414
+ "CapsLock",
415
+ "ArrowUp",
416
+ "ArrowDown",
417
+ "ArrowLeft",
418
+ "ArrowRight"
419
+ ]), J = {
420
+ mouse: "mouse",
421
+ touch: "touch",
422
+ pen: "pen"
423
+ }, G = {
424
+ pointerdown: "down",
425
+ pointerup: "up",
426
+ click: "click",
427
+ dblclick: "dblclick",
428
+ contextmenu: "contextmenu"
429
+ };
430
+ function Z(t$1, n$1, e$1, i$1, o$1) {
431
+ return {
432
+ name: "navigation",
433
+ timestamp: Date.now(),
434
+ phase: t$1,
435
+ type: n$1,
436
+ from: e$1.from,
437
+ to: e$1.to,
438
+ timeOrigin: i$1,
439
+ timing: o$1
440
+ };
441
+ }
442
+ const Q = {
443
+ fingerprint: {
444
+ create: function(t$1) {
445
+ let n$1 = 0;
446
+ return c(async () => {
447
+ const e$1 = await async function(t$2) {
448
+ const n$2 = function() {
449
+ const t$3 = O.get(j);
450
+ return t$3 ? "string" != typeof t$3.visitorId || "number" != typeof t$3.expiresAt || t$3.expiresAt <= Date.now() ? (O.remove(j), null) : {
451
+ visitorId: t$3.visitorId,
452
+ requestId: "string" == typeof t$3.requestId ? t$3.requestId : ""
453
+ } : null;
454
+ }();
455
+ return n$2 ? {
456
+ visitorId: n$2.visitorId,
457
+ requestId: n$2.requestId || null
458
+ } : N || (N = F(t$2).finally(() => {
459
+ N = null;
460
+ }), N);
461
+ }(X);
462
+ !n$1 && e$1 && t$1.push({
463
+ name: "fingerprint",
464
+ deviceId: e$1.visitorId,
465
+ requestId: e$1.requestId,
466
+ timestamp: Date.now()
467
+ });
468
+ }), () => {
469
+ n$1 = 1;
470
+ };
471
+ },
472
+ layer: "device-fingerprinting"
473
+ },
474
+ pointer: {
475
+ create: function(t$1, n$1, o$1) {
476
+ const r$1 = a((n$2) => {
477
+ const e$1 = function(n$3) {
478
+ const e$2 = n$3, i$1 = function(t$2) {
479
+ if ("mouse" === t$2.pointerType) return {
480
+ button: t$2.button,
481
+ buttons: t$2.buttons
482
+ };
483
+ const n$4 = {
484
+ force: t$2.pressure,
485
+ contact: Math.min(t$2.width, t$2.height)
486
+ };
487
+ return "pen" === t$2.pointerType && (n$4.tiltX = t$2.tiltX, n$4.tiltY = t$2.tiltY, n$4.twist = t$2.twist), n$4;
488
+ }(e$2);
489
+ return {
490
+ id: e$2.pointerId,
491
+ name: "pointer",
492
+ timestamp: Date.now(),
493
+ type: J[e$2.pointerType] ?? "unknown",
494
+ phase: G[n$3.type],
495
+ isTrusted: e$2.isTrusted,
496
+ element: t$1.resolveElement(e$2.target),
497
+ isPrimary: e$2.isPrimary,
498
+ modifiers: {
499
+ shift: e$2.shiftKey,
500
+ ctrl: e$2.ctrlKey,
501
+ alt: e$2.altKey,
502
+ meta: e$2.metaKey
503
+ },
504
+ coordinates: {
505
+ x: e$2.clientX,
506
+ y: e$2.clientY
507
+ },
508
+ ...i$1
509
+ };
510
+ }(n$2);
511
+ t$1.push(e$1);
512
+ });
513
+ return S(o$1, "pointer") && (e(document, "pointerdown", r$1), e(document, "pointerup", r$1)), S(o$1, "click") && e(document, "click", r$1), S(o$1, "dblclick") && e(document, "dblclick", r$1), S(o$1, "contextmenu") && e(document, "contextmenu", r$1), () => {
514
+ i(document, "pointerdown", r$1), i(document, "pointerup", r$1), i(document, "click", r$1), i(document, "dblclick", r$1), i(document, "contextmenu", r$1);
515
+ };
516
+ },
517
+ layer: "behavioral",
518
+ events: [
519
+ "pointer",
520
+ "click",
521
+ "dblclick",
522
+ "contextmenu"
523
+ ]
524
+ },
525
+ pointermove: {
526
+ create: function(t$1) {
527
+ let n$1 = null, o$1 = null;
528
+ const r$1 = a((e$1) => {
529
+ const i$1 = e$1;
530
+ n$1 && n$1.id !== i$1.pointerId && (t$1.push(n$1), n$1 = null), n$1 ? n$1.samples.ts.length >= 50 ? (t$1.push(n$1), n$1 = s$1(i$1), c$1(t$1)) : (n$1.samples.x.push(i$1.clientX), n$1.samples.y.push(i$1.clientY), n$1.samples.ts.push(i$1.timeStamp), "pen" === i$1.pointerType && (n$1.samples.tiltX?.push(i$1.tiltX), n$1.samples.tiltY?.push(i$1.tiltY)), "mouse" !== i$1.pointerType && (n$1.samples.force?.push(i$1.pressure), n$1.samples.radius?.push(Math.max(i$1.width, i$1.height))), c$1(t$1)) : (n$1 = s$1(i$1), c$1(t$1));
531
+ });
532
+ function s$1(t$2) {
533
+ const n$2 = function(t$3) {
534
+ if ("mouse" === t$3.pointerType) return null;
535
+ const n$3 = {
536
+ force: [t$3.pressure],
537
+ radius: [Math.max(t$3.width, t$3.height)]
538
+ };
539
+ return "pen" === t$3.pointerType && (n$3.tiltX = [t$3.tiltX], n$3.tiltY = [t$3.tiltY]), n$3;
540
+ }(t$2);
541
+ return {
542
+ name: "pointer",
543
+ timestamp: Date.now(),
544
+ id: t$2.pointerId,
545
+ type: t$2.pointerType,
546
+ phase: "move",
547
+ isTrusted: t$2.isTrusted,
548
+ isPrimary: t$2.isPrimary,
549
+ samples: {
550
+ x: [t$2.clientX],
551
+ y: [t$2.clientY],
552
+ ts: [t$2.timeStamp],
553
+ ...n$2 ?? {}
554
+ }
555
+ };
556
+ }
557
+ function c$1(t$2) {
558
+ o$1 && clearTimeout(o$1), o$1 = setTimeout(() => {
559
+ n$1 && (t$2.push(n$1), n$1 = null), o$1 = null;
560
+ }, y);
561
+ }
562
+ return e(document, "pointermove", r$1), () => {
563
+ i(document, "pointermove", r$1), o$1 && (clearTimeout(o$1), o$1 = null), n$1 && (t$1.push(n$1), n$1 = null);
564
+ };
565
+ },
566
+ layer: "behavioral"
567
+ },
568
+ focus: {
569
+ create: function(t$1) {
570
+ const n$1 = a((n$2) => {
571
+ const e$1 = function(n$3) {
572
+ const e$2 = n$3;
573
+ return {
574
+ name: "focus",
575
+ type: K[n$3.type] ?? "unknown",
576
+ timestamp: Date.now(),
577
+ isTrusted: e$2.isTrusted,
578
+ element: t$1.resolveElement(e$2.target),
579
+ relatedTarget: t$1.resolveElement(e$2.relatedTarget)
580
+ };
581
+ }(n$2);
582
+ t$1.push(e$1);
583
+ });
584
+ return e(document, "focusin", n$1), e(document, "focusout", n$1), () => {
585
+ i(document, "focusin", n$1), i(document, "focusout", n$1);
586
+ };
587
+ },
588
+ layer: "behavioral"
589
+ },
590
+ input: {
591
+ create: function(t$1) {
592
+ const n$1 = a((n$2) => {
593
+ const e$1 = n$2;
594
+ t$1.push(function(n$3) {
595
+ return {
596
+ name: "keystroke",
597
+ type: "input",
598
+ timestamp: Date.now(),
599
+ isTrusted: n$3.isTrusted,
600
+ element: t$1.resolveElement(n$3.target),
601
+ inputType: n$3.inputType ?? "",
602
+ isComposing: n$3.isComposing ?? 0,
603
+ length: (e$2 = n$3.target, e$2 instanceof HTMLInputElement || e$2 instanceof HTMLTextAreaElement || e$2 instanceof HTMLSelectElement ? e$2.value.length : 0)
604
+ };
605
+ var e$2;
606
+ }(e$1)), function(t$2) {
607
+ if ("insertReplacementText" === t$2.inputType) return 1;
608
+ const n$3 = t$2.target;
609
+ return V(n$3) ? function(t$3) {
610
+ try {
611
+ return t$3.matches(":-webkit-autofill");
612
+ } catch {
613
+ return 0;
614
+ }
615
+ }(n$3) : 0;
616
+ }(e$1) && t$1.push(function(t$2, n$3) {
617
+ const e$2 = t$2.target;
618
+ let i$1 = 0;
619
+ return V(e$2) && (i$1 = e$2.value.length), {
620
+ name: "autofill",
621
+ timestamp: Date.now(),
622
+ element: n$3.resolveElement(e$2),
623
+ length: i$1
624
+ };
625
+ }(e$1, t$1));
626
+ });
627
+ return e(document, "input", n$1), function() {
628
+ i(document, "input", n$1);
629
+ };
630
+ },
631
+ layer: "behavioral"
632
+ },
633
+ keystroke: {
634
+ create: function(t$1) {
635
+ const { resolve: n$1, reset: o$1 } = function() {
636
+ let t$2 = 0;
637
+ const n$2 = /* @__PURE__ */ new Map();
638
+ return {
639
+ resolve: function(e$1, i$1) {
640
+ if ("keydown" === i$1) {
641
+ const i$2 = n$2.get(e$1);
642
+ if (void 0 !== i$2) return i$2;
643
+ const o$3 = ++t$2;
644
+ if (n$2.size >= 32) {
645
+ const t$3 = n$2.keys().next().value;
646
+ void 0 !== t$3 && n$2.delete(t$3);
647
+ }
648
+ return n$2.set(e$1, o$3), o$3;
649
+ }
650
+ const o$2 = n$2.get(e$1);
651
+ return void 0 !== o$2 ? (n$2.delete(e$1), o$2) : ++t$2;
652
+ },
653
+ reset: function() {
654
+ n$2.clear();
655
+ }
656
+ };
657
+ }(), r$1 = a((e$1) => {
658
+ const i$1 = function(t$2) {
659
+ const e$2 = t$2, i$2 = t$2.type;
660
+ return {
661
+ name: "keystroke",
662
+ type: i$2,
663
+ id: n$1(e$2.code, i$2),
664
+ timestamp: Date.now(),
665
+ isTrusted: e$2.isTrusted,
666
+ keys: Y.has(e$2.key) ? [e$2.key] : []
667
+ };
668
+ }(e$1);
669
+ t$1.push(i$1);
670
+ }), s$1 = a(() => {
671
+ o$1();
672
+ });
673
+ return e(document, "keydown", r$1), e(document, "keyup", r$1), e(window, "blur", s$1), () => {
674
+ i(document, "keydown", r$1), i(document, "keyup", r$1), i(window, "blur", s$1);
675
+ };
676
+ },
677
+ layer: "behavioral"
678
+ },
679
+ clipboard: {
680
+ create: function(t$1, n$1 = "on", o$1) {
681
+ const r$1 = a((e$1) => {
682
+ const i$1 = function(e$2) {
683
+ const i$2 = e$2, o$2 = e$2.type, r$2 = ("paste" === e$2.type ? i$2.clipboardData?.getData("text/plain") : x()) ?? null, s$1 = E(i$2.target, n$1);
684
+ return {
685
+ name: "clipboard",
686
+ type: o$2,
687
+ timestamp: Date.now(),
688
+ isTrusted: i$2.isTrusted,
689
+ element: t$1.resolveElement(i$2.target),
690
+ length: r$2?.length ?? 0,
691
+ ...s$1 && r$2 ? { content: r$2 } : {}
692
+ };
693
+ }(e$1);
694
+ t$1.push(i$1);
695
+ });
696
+ return S(o$1, "paste") && e(document, "paste", r$1), S(o$1, "cut") && e(document, "cut", r$1), S(o$1, "copy") && e(document, "copy", r$1), () => {
697
+ i(document, "paste", r$1), i(document, "cut", r$1), i(document, "copy", r$1);
698
+ };
699
+ },
700
+ layer: "behavioral",
701
+ events: [
702
+ "paste",
703
+ "cut",
704
+ "copy"
705
+ ]
706
+ },
707
+ form: {
708
+ create: function(t$1, n$1, o$1) {
709
+ const r$1 = a((n$2) => {
710
+ const e$1 = {
711
+ name: "form",
712
+ type: (i$1 = n$2).type,
713
+ timestamp: Date.now(),
714
+ isTrusted: i$1.isTrusted,
715
+ element: t$1.resolveElement(i$1.target)
716
+ };
717
+ var i$1;
718
+ t$1.push(e$1);
719
+ });
720
+ return S(o$1, "submit") && e(document, "submit", r$1), S(o$1, "invalid") && e(document, "invalid", r$1), () => {
721
+ i(document, "submit", r$1), i(document, "invalid", r$1);
722
+ };
723
+ },
724
+ layer: "behavioral",
725
+ events: ["submit", "invalid"]
726
+ },
727
+ change: {
728
+ create: function(t$1) {
729
+ const n$1 = a((n$2) => {
730
+ const e$1 = (i$1 = n$2, {
731
+ name: "change",
732
+ timestamp: Date.now(),
733
+ isTrusted: i$1.isTrusted,
734
+ element: t$1.resolveElement(i$1.target)
735
+ });
736
+ var i$1;
737
+ t$1.push(e$1);
738
+ });
739
+ return e(document, "change", n$1), () => {
740
+ i(document, "change", n$1);
741
+ };
742
+ },
743
+ layer: "behavioral"
744
+ },
745
+ selection: {
746
+ create: function(t$1, n$1) {
747
+ let o$1 = 0, r$1 = 0, s$1 = null, c$1 = 0, l$1 = 0;
748
+ function u$1() {
749
+ s$1 && (clearTimeout(s$1), s$1 = null);
750
+ }
751
+ function d$1() {
752
+ u$1(), c$1 || l$1 || (s$1 = setTimeout(() => {
753
+ s$1 = null, o$1 && h$1("timeout");
754
+ }, 250));
755
+ }
756
+ function h$1(e$1) {
757
+ o$1 && (o$1 = 0, u$1(), function(e$2) {
758
+ const i$1 = A("end"), o$2 = i$1 && E(i$1, n$1), r$2 = x();
759
+ t$1.push({
760
+ name: "selection",
761
+ phase: "end",
762
+ timestamp: Date.now(),
763
+ trigger: e$2,
764
+ isTrusted: 1,
765
+ element: t$1.resolveElement(i$1),
766
+ length: r$2?.length ?? 0,
767
+ ...o$2 && r$2 ? { content: r$2 } : {}
768
+ });
769
+ }(e$1));
770
+ }
771
+ const f$1 = a(() => {
772
+ const n$2 = function() {
773
+ const t$2 = document.getSelection();
774
+ return !t$2 || t$2.isCollapsed || 0 === t$2.rangeCount;
775
+ }();
776
+ if (!o$1 && !n$2) return o$1 = 1, r$1 = Date.now(), t$1.push({
777
+ name: "selection",
778
+ phase: "start",
779
+ timestamp: r$1,
780
+ element: t$1.resolveElement(A("start"))
781
+ }), void d$1();
782
+ o$1 && n$2 ? h$1("collapse") : o$1 && d$1();
783
+ }), p$1 = a((t$2) => {
784
+ 0 === t$2.button && (c$1 = 1, u$1());
785
+ }), m$1 = a((t$2) => {
786
+ 0 === t$2.button && (c$1 = 0, o$1 && h$1("pointer"));
787
+ }), w$1 = a((t$2) => {
788
+ "Shift" === t$2.key && (l$1 = 1, u$1());
789
+ }), y$1 = a((t$2) => {
790
+ "Shift" === t$2.key && (l$1 = 0, o$1 && h$1("keyboard"));
791
+ }), v$1 = a(() => {
792
+ c$1 = 0;
793
+ }), g$1 = a(() => {
794
+ "hidden" === document.visibilityState && (c$1 = 0, l$1 = 0, o$1 && h$1("timeout"));
795
+ }), b$1 = a(() => {
796
+ c$1 = 0, o$1 && h$1("pointer");
797
+ });
798
+ return e(document, "selectionchange", f$1), e(document, "pointerdown", p$1), e(document, "pointerup", m$1), e(document, "keydown", w$1), e(document, "keyup", y$1), e(document, "contextmenu", v$1), e(document, "visibilitychange", g$1), e(document, "dragend", b$1), () => {
799
+ u$1(), i(document, "selectionchange", f$1), i(document, "pointerdown", p$1), i(document, "pointerup", m$1), i(document, "keydown", w$1), i(document, "keyup", y$1), i(document, "contextmenu", v$1), i(document, "visibilitychange", g$1), i(document, "dragend", b$1);
800
+ };
801
+ },
802
+ layer: "behavioral"
803
+ },
804
+ tab: {
805
+ create: () => () => {},
806
+ layer: "session",
807
+ events: ["state", "count"]
808
+ },
809
+ visibility: {
810
+ create: function(t$1) {
811
+ const n$1 = a((n$2) => {
812
+ const e$1 = document.visibilityState;
813
+ if ("visible" !== e$1 && "hidden" !== e$1) return;
814
+ const i$1 = {
815
+ name: "visibility",
816
+ type: e$1,
817
+ timestamp: Date.now(),
818
+ isTrusted: n$2.isTrusted
819
+ };
820
+ t$1.push(i$1);
821
+ });
822
+ return e(document, "visibilitychange", n$1), () => {
823
+ i(document, "visibilitychange", n$1);
824
+ };
825
+ },
826
+ layer: "session"
827
+ },
828
+ navigation: {
829
+ create: function(t$1) {
830
+ let n$1 = t$1.sanitizeUrl(document.referrer || "");
831
+ function o$1(e$1) {
832
+ t$1.push(e$1), n$1 = e$1.to ?? "";
833
+ }
834
+ const r$1 = a(() => {
835
+ const [n$2] = performance.getEntriesByType("navigation");
836
+ var e$1;
837
+ o$1(Z("load", n$2?.type ?? "navigate", {
838
+ from: document.referrer ? t$1.sanitizeUrl(document.referrer) : null,
839
+ to: t$1.sanitizeUrl(location.href)
840
+ }, performance.timeOrigin, n$2 ? {
841
+ fetchStart: (e$1 = n$2).fetchStart,
842
+ domainLookupStart: e$1.domainLookupStart,
843
+ domainLookupEnd: e$1.domainLookupEnd,
844
+ connectStart: e$1.connectStart,
845
+ connectEnd: e$1.connectEnd,
846
+ requestStart: e$1.requestStart,
847
+ responseStart: e$1.responseStart,
848
+ responseEnd: e$1.responseEnd,
849
+ domInteractive: e$1.domInteractive,
850
+ domContentLoadedEventStart: e$1.domContentLoadedEventStart,
851
+ domContentLoadedEventEnd: e$1.domContentLoadedEventEnd,
852
+ domComplete: e$1.domComplete,
853
+ loadEventStart: e$1.loadEventStart,
854
+ loadEventEnd: e$1.loadEventEnd,
855
+ redirectCount: e$1.redirectCount,
856
+ transferSize: e$1.transferSize,
857
+ encodedBodySize: e$1.encodedBodySize,
858
+ decodedBodySize: e$1.decodedBodySize
859
+ } : void 0));
860
+ }), c$1 = a((e$1) => {
861
+ const i$1 = e$1;
862
+ if (null === i$1.navigationType) return;
863
+ const r$2 = t$1.sanitizeUrl(location.href);
864
+ r$2 !== n$1 && o$1(Z("change", i$1.navigationType, {
865
+ from: n$1,
866
+ to: r$2
867
+ }, performance.timeOrigin));
868
+ }), l$1 = a(() => d$1("traverse")), u$1 = a(() => d$1("hashchange"));
869
+ function d$1(e$1) {
870
+ const i$1 = t$1.sanitizeUrl(location.href);
871
+ "hashchange" === e$1 && i$1 === n$1 || o$1(Z("change", e$1, {
872
+ from: n$1,
873
+ to: i$1
874
+ }, performance.timeOrigin));
875
+ }
876
+ const h$1 = history.pushState, f$1 = history.replaceState, p$1 = function(...t$2) {
877
+ const n$2 = h$1.apply(this, t$2);
878
+ return s(() => d$1("push")), n$2;
879
+ }, m$1 = function(...t$2) {
880
+ const n$2 = f$1.apply(this, t$2);
881
+ return s(() => d$1("replace")), n$2;
882
+ };
883
+ return window.navigation ? e(window.navigation, "currententrychange", c$1) : (history.pushState = p$1, history.replaceState = m$1, e(window, "popstate", l$1), e(window, "hashchange", u$1)), "complete" === document.readyState ? r$1(new Event("load")) : e(window, "load", r$1), () => {
884
+ window.navigation ? i(window.navigation, "currententrychange", c$1) : (history.pushState === p$1 && (history.pushState = h$1), history.replaceState === m$1 && (history.replaceState = f$1), i(window, "popstate", l$1), i(window, "hashchange", u$1)), i(window, "load", r$1);
885
+ };
886
+ },
887
+ layer: "session"
888
+ },
889
+ networkconnection: {
890
+ create: function(t$1) {
891
+ const n$1 = a(() => {
892
+ const n$2 = {
893
+ name: "network",
894
+ type: "connection",
895
+ state: navigator.onLine ? "online" : "offline",
896
+ timestamp: Date.now()
897
+ };
898
+ t$1.push(n$2);
899
+ });
900
+ return e(window, "online", n$1), e(window, "offline", n$1), () => {
901
+ i(window, "online", n$1), i(window, "offline", n$1);
902
+ };
903
+ },
904
+ layer: "session"
905
+ },
906
+ scroll: {
907
+ create: function(t$1) {
908
+ let n$1 = null, o$1 = null;
909
+ const r$1 = a((e$1) => n$1 ? n$1.samples.ts.length >= 50 ? (t$1.push(n$1), n$1 = s$1(e$1), void c$1(t$1)) : (n$1.samples.x.push(window.scrollX), n$1.samples.y.push(window.scrollY), n$1.samples.ts.push(e$1.timeStamp), void c$1(t$1)) : (n$1 = s$1(e$1), void c$1(t$1)));
910
+ function s$1(t$2) {
911
+ return {
912
+ name: "scroll",
913
+ timestamp: Date.now(),
914
+ samples: {
915
+ x: [window.scrollX],
916
+ y: [window.scrollY],
917
+ ts: [t$2.timeStamp]
918
+ },
919
+ height: window.innerHeight,
920
+ width: window.innerWidth,
921
+ scrollX: window.scrollX,
922
+ scrollY: window.scrollY,
923
+ pageX: window.pageXOffset,
924
+ pageY: window.pageYOffset
925
+ };
926
+ }
927
+ function c$1(t$2) {
928
+ o$1 && clearTimeout(o$1), o$1 = setTimeout(() => {
929
+ n$1 && (t$2.push(n$1), n$1 = null), o$1 = null;
930
+ }, y);
931
+ }
932
+ return e(window, "scroll", r$1), () => {
933
+ i(window, "scroll", r$1), o$1 && (clearTimeout(o$1), o$1 = null), n$1 && (t$1.push(n$1), n$1 = null);
934
+ };
935
+ },
936
+ layer: "behavioral"
937
+ },
938
+ viewportresize: {
939
+ create: function(t$1) {
940
+ let n$1 = null, o$1 = null;
941
+ const r$1 = a((e$1) => n$1 ? n$1.samples.ts.length >= 50 ? (t$1.push(n$1), n$1 = s$1(e$1), void c$1(t$1)) : (n$1.samples.height.push(window.innerHeight), n$1.samples.width.push(window.innerWidth), n$1.samples.ts.push(e$1.timeStamp), n$1.samples.scrollX.push(window.scrollX), n$1.samples.scrollY.push(window.scrollY), n$1.samples.dpr.push(window.devicePixelRatio), void c$1(t$1)) : (n$1 = s$1(e$1), void c$1(t$1)));
942
+ function s$1(t$2) {
943
+ return {
944
+ name: "viewport",
945
+ type: "resize",
946
+ timestamp: Date.now(),
947
+ samples: {
948
+ height: [window.innerHeight],
949
+ width: [window.innerWidth],
950
+ ts: [t$2.timeStamp],
951
+ scrollX: [window.scrollX],
952
+ scrollY: [window.scrollY],
953
+ dpr: [window.devicePixelRatio]
954
+ }
955
+ };
956
+ }
957
+ function c$1(t$2) {
958
+ o$1 && clearTimeout(o$1), o$1 = setTimeout(() => {
959
+ n$1 && (t$2.push(n$1), n$1 = null), o$1 = null;
960
+ }, y);
961
+ }
962
+ return e(window, "resize", r$1), () => {
963
+ i(window, "resize", r$1), o$1 && (clearTimeout(o$1), o$1 = null), n$1 && (t$1.push(n$1), n$1 = null);
964
+ };
965
+ },
966
+ layer: "behavioral"
967
+ },
968
+ viewport: {
969
+ create: function(t$1, n$1, o$1) {
970
+ const r$1 = a((n$2) => {
971
+ const e$1 = c$1(n$2, "orientation");
972
+ t$1.push(e$1);
973
+ }), s$1 = a((n$2) => {
974
+ const e$1 = c$1(n$2, "ratiochange");
975
+ t$1.push(e$1);
976
+ });
977
+ function c$1(t$2, n$2) {
978
+ return {
979
+ name: "viewport",
980
+ type: n$2,
981
+ timestamp: Date.now(),
982
+ isTrusted: t$2.isTrusted,
983
+ height: window.innerHeight,
984
+ width: window.innerWidth,
985
+ scrollX: window.scrollX,
986
+ scrollY: window.scrollY,
987
+ dpr: window.devicePixelRatio
988
+ };
989
+ }
990
+ return S(o$1, "orientationchange") && e(window, "orientationchange", r$1), S(o$1, "devicepixelratiochange") && e(window, "devicepixelratiochange", s$1), () => {
991
+ i(window, "orientationchange", r$1), i(window, "devicepixelratiochange", s$1);
992
+ };
993
+ },
994
+ layer: "behavioral",
995
+ events: ["orientationchange", "devicepixelratiochange"]
996
+ },
997
+ sensors: {
998
+ create: function(t$1, n$1, o$1) {
999
+ let r$1 = null, s$1 = null, c$1 = null, u$1 = null, h$1 = 0;
1000
+ function f$1() {
1001
+ u$1 && d(u$1), u$1 = setTimeout(l(() => {
1002
+ p$1(), u$1 = null;
1003
+ }), y);
1004
+ }
1005
+ function p$1() {
1006
+ r$1 && (t$1.push(r$1), r$1 = null), s$1 && (t$1.push(s$1), s$1 = null), c$1 && (t$1.push(c$1), c$1 = null);
1007
+ }
1008
+ const m$1 = a((n$2) => {
1009
+ const e$1 = n$2, i$1 = e$1.timeStamp, o$2 = e$1.acceleration, s$2 = e$1.accelerationIncludingGravity, c$2 = e$1.rotationRate;
1010
+ if (!o$2 && !s$2 && !c$2) return;
1011
+ if (!r$1) return r$1 = {
1012
+ name: "sensors",
1013
+ type: "motion",
1014
+ timestamp: Date.now(),
1015
+ interval: e$1.interval ?? null,
1016
+ samples: {
1017
+ ax: [o$2?.x ?? 0],
1018
+ ay: [o$2?.y ?? 0],
1019
+ az: [o$2?.z ?? 0],
1020
+ agx: [s$2?.x ?? 0],
1021
+ agy: [s$2?.y ?? 0],
1022
+ agz: [s$2?.z ?? 0],
1023
+ rrAlpha: [c$2?.alpha ?? 0],
1024
+ rrBeta: [c$2?.beta ?? 0],
1025
+ rrGamma: [c$2?.gamma ?? 0],
1026
+ ts: [i$1]
1027
+ }
1028
+ }, void f$1();
1029
+ if (r$1.samples.ts.length >= 50) return t$1.push(r$1), r$1 = {
1030
+ name: "sensors",
1031
+ type: "motion",
1032
+ timestamp: Date.now(),
1033
+ interval: e$1.interval ?? null,
1034
+ samples: {
1035
+ ax: [o$2?.x ?? 0],
1036
+ ay: [o$2?.y ?? 0],
1037
+ az: [o$2?.z ?? 0],
1038
+ agx: [s$2?.x ?? 0],
1039
+ agy: [s$2?.y ?? 0],
1040
+ agz: [s$2?.z ?? 0],
1041
+ rrAlpha: [c$2?.alpha ?? 0],
1042
+ rrBeta: [c$2?.beta ?? 0],
1043
+ rrGamma: [c$2?.gamma ?? 0],
1044
+ ts: [i$1]
1045
+ }
1046
+ }, void f$1();
1047
+ const a$1 = r$1.samples;
1048
+ a$1.ax.push(o$2?.x ?? 0), a$1.ay.push(o$2?.y ?? 0), a$1.az.push(o$2?.z ?? 0), a$1.agx.push(s$2?.x ?? 0), a$1.agy.push(s$2?.y ?? 0), a$1.agz.push(s$2?.z ?? 0), a$1.rrAlpha.push(c$2?.alpha ?? 0), a$1.rrBeta.push(c$2?.beta ?? 0), a$1.rrGamma.push(c$2?.gamma ?? 0), a$1.ts.push(i$1), f$1();
1049
+ }), w$1 = a((n$2) => {
1050
+ const e$1 = n$2;
1051
+ if (null == e$1.alpha && null == e$1.beta && null == e$1.gamma) return;
1052
+ const i$1 = e$1.timeStamp, o$2 = e$1.webkitCompassHeading ?? 0;
1053
+ if (!s$1) return s$1 = {
1054
+ name: "sensors",
1055
+ type: "orientation",
1056
+ timestamp: Date.now(),
1057
+ absolute: h$1 || e$1.absolute,
1058
+ samples: {
1059
+ alpha: [e$1.alpha ?? 0],
1060
+ beta: [e$1.beta ?? 0],
1061
+ gamma: [e$1.gamma ?? 0],
1062
+ compassHeading: [o$2],
1063
+ ts: [i$1]
1064
+ }
1065
+ }, void f$1();
1066
+ if (s$1.samples.ts.length >= 50) return t$1.push(s$1), s$1 = {
1067
+ name: "sensors",
1068
+ type: "orientation",
1069
+ timestamp: Date.now(),
1070
+ absolute: h$1 || e$1.absolute,
1071
+ samples: {
1072
+ alpha: [e$1.alpha ?? 0],
1073
+ beta: [e$1.beta ?? 0],
1074
+ gamma: [e$1.gamma ?? 0],
1075
+ compassHeading: [o$2],
1076
+ ts: [i$1]
1077
+ }
1078
+ }, void f$1();
1079
+ const r$2 = s$1.samples;
1080
+ r$2.alpha.push(e$1.alpha ?? 0), r$2.beta.push(e$1.beta ?? 0), r$2.gamma.push(e$1.gamma ?? 0), r$2.compassHeading.push(o$2), r$2.ts.push(i$1), f$1();
1081
+ }), v$1 = a((n$2) => {
1082
+ const e$1 = n$2.value;
1083
+ if (null == e$1) return;
1084
+ const i$1 = n$2.timeStamp;
1085
+ c$1 ? c$1.samples.ts.length >= 50 ? (t$1.push(c$1), c$1 = {
1086
+ name: "sensors",
1087
+ type: "light",
1088
+ timestamp: Date.now(),
1089
+ samples: {
1090
+ lux: [e$1],
1091
+ ts: [i$1]
1092
+ }
1093
+ }, f$1()) : (c$1.samples.lux.push(e$1), c$1.samples.ts.push(i$1), f$1()) : (c$1 = {
1094
+ name: "sensors",
1095
+ type: "light",
1096
+ timestamp: Date.now(),
1097
+ samples: {
1098
+ lux: [e$1],
1099
+ ts: [i$1]
1100
+ }
1101
+ }, f$1());
1102
+ });
1103
+ return S(o$1, "motion") && e(window, "devicemotion", m$1), S(o$1, "orientation") && ("ondeviceorientationabsolute" in window ? (h$1 = 1, e(window, "deviceorientationabsolute", w$1)) : e(window, "deviceorientation", w$1)), S(o$1, "light") && e(window, "devicelight", v$1), function() {
1104
+ i(window, "devicemotion", m$1), i(window, h$1 ? "deviceorientationabsolute" : "deviceorientation", w$1), i(window, "devicelight", v$1), u$1 && (d(u$1), u$1 = null), p$1();
1105
+ };
1106
+ },
1107
+ layer: "behavioral",
1108
+ events: [
1109
+ "motion",
1110
+ "orientation",
1111
+ "light"
1112
+ ]
1113
+ },
1114
+ "network-request": {
1115
+ create: function(t$1) {
1116
+ var e$1;
1117
+ const i$1 = function(t$2, e$2, i$2, o$1 = f) {
1118
+ if ("undefined" == typeof PerformanceObserver) return w;
1119
+ let r$1 = null;
1120
+ try {
1121
+ r$1 = new PerformanceObserver((n$1) => {
1122
+ for (const r$2 of n$1.getEntries()) {
1123
+ const n$2 = r$2;
1124
+ o$1.has(n$2.initiatorType) && (e$2(n$2.name) || t$2(m(n$2, i$2)));
1125
+ }
1126
+ }), r$1.observe({
1127
+ type: "resource",
1128
+ buffered: 1
1129
+ });
1130
+ } catch {
1131
+ return n.warn("network-request", "PerformanceObserver failed to start"), w;
1132
+ }
1133
+ return function() {
1134
+ r$1?.disconnect(), r$1 = null;
1135
+ };
1136
+ }(function(n$1) {
1137
+ s(() => t$1.push(n$1));
1138
+ }, (e$1 = t$1.ignoredOrigins, function(t$2) {
1139
+ try {
1140
+ return e$1.has(new URL(t$2).origin);
1141
+ } catch {
1142
+ return 0;
1143
+ }
1144
+ }), t$1.sanitizeUrl);
1145
+ return function() {
1146
+ i$1();
1147
+ };
1148
+ },
1149
+ layer: "session"
1150
+ },
1151
+ screen: {
1152
+ create: function(t$1) {
1153
+ const n$1 = s(() => function() {
1154
+ const t$2 = window.screen;
1155
+ return {
1156
+ name: "screen",
1157
+ timestamp: Date.now(),
1158
+ availWidth: t$2.availWidth,
1159
+ availHeight: t$2.availHeight,
1160
+ width: t$2.width,
1161
+ height: t$2.height,
1162
+ colorDepth: t$2.colorDepth,
1163
+ pixelDepth: t$2.pixelDepth,
1164
+ availLeft: t$2.availLeft ?? 0,
1165
+ availTop: t$2.availTop ?? 0,
1166
+ orientation: t$2.orientation ? {
1167
+ type: t$2.orientation.type,
1168
+ angle: t$2.orientation.angle
1169
+ } : null,
1170
+ isExtended: t$2.isExtended ?? 0,
1171
+ viewport: {
1172
+ height: window.innerHeight,
1173
+ width: window.innerWidth,
1174
+ scrollX: window.scrollX,
1175
+ scrollY: window.scrollY,
1176
+ dpr: window.devicePixelRatio
1177
+ }
1178
+ };
1179
+ }());
1180
+ return n$1 && t$1.push(n$1), () => {};
1181
+ },
1182
+ layer: "session"
1183
+ }
1184
+ }, W = Object.keys(Q), tt = [
1185
+ /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
1186
+ /^0b[01]+$/i,
1187
+ /^0o[0-7]+$/i,
1188
+ /^0x[0-9a-f]+$/i,
1189
+ /^[a-z][a-z0-9]{1,12}:[A-Za-z0-9+/=_-]{6,}$/i,
1190
+ /^[a-z]{2,8}_(?=.*\d)[A-Za-z0-9]{3,}$/,
1191
+ /^\d{4,}$/,
1192
+ /@/,
1193
+ /^[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{10,}$/,
1194
+ /^[A-Za-z0-9_-]{20,}={0,2}$/,
1195
+ /^[0-9a-f]{7,}$/i
1196
+ ];
1197
+ function nt(t$1) {
1198
+ try {
1199
+ const n$1 = new URL(t$1, location.href);
1200
+ n$1.username = "", n$1.password = "", n$1.hash = "";
1201
+ const e$1 = [...n$1.searchParams.keys()], i$1 = e$1.length > 0 ? "?" + e$1.map((t$2) => `${encodeURIComponent(t$2)}=<redacted>`).join("&") : "";
1202
+ n$1.search = "", n$1.pathname = n$1.pathname.split("/").map((t$2) => "" !== t$2 && function(t$3) {
1203
+ for (const n$2 of tt) if (n$2.test(t$3)) return 1;
1204
+ return 0;
1205
+ }(t$2) ? ":param" : t$2).join("/");
1206
+ const o$1 = n$1.origin + n$1.pathname + i$1;
1207
+ return o$1.length > 2048 ? o$1.slice(0, 2048) : o$1;
1208
+ } catch {
1209
+ return "";
1210
+ }
1211
+ }
1212
+ const et = {
1213
+ flush: {
1214
+ intervalMs: 2e3,
1215
+ maxIntervalMs: 3e4,
1216
+ size: 50,
1217
+ backoffFailureThreshold: 2
1218
+ },
1219
+ queue: { size: 100 }
1220
+ };
1221
+ function it() {
1222
+ const t$1 = {};
1223
+ for (const n$1 of W) t$1[n$1] = st(n$1, void 0, 1);
1224
+ return t$1;
1225
+ }
1226
+ function ot(t$1) {
1227
+ const n$1 = {};
1228
+ for (const e$1 of W) n$1[e$1] = st(e$1, void 0, t$1[Q[e$1].layer] ?? 0);
1229
+ return n$1;
1230
+ }
1231
+ function rt(t$1) {
1232
+ const n$1 = {};
1233
+ for (const e$1 of W) {
1234
+ const i$1 = t$1[e$1];
1235
+ n$1[e$1] = st(e$1, i$1, i$1?.enabled ?? 0);
1236
+ }
1237
+ return n$1;
1238
+ }
1239
+ function st(t$1, n$1, e$1) {
1240
+ const i$1 = Q[t$1]?.events ?? [];
1241
+ if (0 === i$1.length) return { enabled: e$1 };
1242
+ const o$1 = n$1?.events, r$1 = {};
1243
+ for (const t$2 of i$1) r$1[t$2] = { enabled: o$1?.[t$2] ?? 1 };
1244
+ return {
1245
+ enabled: e$1,
1246
+ events: r$1
1247
+ };
1248
+ }
1249
+ function ct(t$1) {
1250
+ if (!t$1) return null;
1251
+ const n$1 = t$1.split(".")[1], e$1 = atob(n$1.replace(/-/g, "+").replace(/_/g, "/"));
1252
+ return JSON.parse(e$1);
1253
+ }
1254
+ const at = function(t$1, n$1 = 30) {
1255
+ if (!t$1) return 1;
1256
+ const e$1 = ct(t$1);
1257
+ return e$1 && "number" == typeof e$1.exp ? 1e3 * e$1.exp <= Date.now() + 1e3 * n$1 : 1;
1258
+ };
1259
+ async function lt(t$1, n$1) {
1260
+ return globalThis.navigator && "locks" in globalThis.navigator && "request" in globalThis.navigator.locks && "query" in globalThis.navigator.locks ? navigator.locks.request(t$1, { mode: "exclusive" }, async () => c(n$1)) : c(n$1);
1261
+ }
1262
+ const ut = "__tri", dt = `${ut}_activity_token`, ht = `${ut}_activity_id`, ft = `${ut}_activity_status`, pt = "__tri_activity_lock";
1263
+ var mt = class {
1264
+ constructor(t$1) {
1265
+ this.context = t$1, this.l = null, this.u = null, this.h = null, this.p = null, this.m = 0;
1266
+ }
1267
+ getToken() {
1268
+ return this.l;
1269
+ }
1270
+ getActivityId() {
1271
+ return this.u ?? "";
1272
+ }
1273
+ isActive() {
1274
+ return "ACTIVE" === this.h && null !== this.l;
1275
+ }
1276
+ async start() {
1277
+ return this.m = 1, this.p || (this.p = this.v()), this.p;
1278
+ }
1279
+ async stop() {
1280
+ this.m = 0, this.k(null), this.p = null, this.l && await this.context.stopActivity(), this.T(null);
1281
+ }
1282
+ async refresh() {
1283
+ if (!this.m) return;
1284
+ const t$1 = this.l;
1285
+ await lt(pt, async () => {
1286
+ if (this.l && this.l !== t$1 && !at(this.l) && "ACTIVE" === this.h) return;
1287
+ const n$1 = this._();
1288
+ n$1 && n$1.token !== t$1 && !at(n$1.token) && "ACTIVE" === n$1.activityStatus ? this.T(n$1) : (this.I(), await this.S());
1289
+ });
1290
+ }
1291
+ async v() {
1292
+ try {
1293
+ if (this.l && !at(this.l)) return;
1294
+ await lt(pt, async () => {
1295
+ await this.S();
1296
+ });
1297
+ } finally {
1298
+ this.p = null;
1299
+ }
1300
+ }
1301
+ async S() {
1302
+ const t$1 = this._();
1303
+ if (t$1 && !at(t$1.token) && "ACTIVE" === t$1.activityStatus) return void this.T(t$1);
1304
+ t$1 && this.I();
1305
+ const n$1 = await this.context.startActivity();
1306
+ if (!n$1.ok) return;
1307
+ if (!n$1.data.token) return;
1308
+ const e$1 = n$1.data;
1309
+ this.T(e$1), this.A(e$1);
1310
+ }
1311
+ _() {
1312
+ const [t$1, n$1, e$1] = [
1313
+ O.get(dt),
1314
+ O.get(ht),
1315
+ O.get(ft)
1316
+ ];
1317
+ return t$1 && n$1 && e$1 ? {
1318
+ token: t$1,
1319
+ activityId: n$1,
1320
+ activityStatus: e$1
1321
+ } : ((t$1 || n$1 || e$1) && this.I(), null);
1322
+ }
1323
+ A(t$1) {
1324
+ O.set(dt, t$1.token), O.set(ht, t$1.activityId), O.set(ft, t$1.activityStatus);
1325
+ }
1326
+ I() {
1327
+ this.k(null), this.T(null);
1328
+ }
1329
+ k(t$1) {
1330
+ if (!t$1) return O.remove(dt), O.remove(ht), void O.remove(ft);
1331
+ O.set(dt, t$1.token), O.set(ht, t$1.activityId), O.set(ft, t$1.activityStatus);
1332
+ }
1333
+ T(t$1) {
1334
+ if (!t$1) return this.l = null, this.u = null, void (this.h = null);
1335
+ this.l = t$1.token, this.u = t$1.activityId, this.h = t$1.activityStatus;
1336
+ }
1337
+ };
1338
+ const wt = [
1339
+ 401,
1340
+ 403,
1341
+ 409
1342
+ ], yt = Object.freeze({
1343
+ tab: 80,
1344
+ navigation: 80,
1345
+ visibility: 80,
1346
+ network: 80,
1347
+ screen: 80,
1348
+ fingerprint: 80,
1349
+ pointer: 60,
1350
+ keystroke: 60,
1351
+ autofill: 60,
1352
+ change: 60,
1353
+ form: 60,
1354
+ clipboard: 60,
1355
+ selection: 60,
1356
+ focus: 60,
1357
+ viewport: 60,
1358
+ network_request: 60,
1359
+ scroll: 40,
1360
+ sensors: 40
1361
+ });
1362
+ function vt(t$1) {
1363
+ return "pointer" === t$1.name && "move" === t$1.phase || "viewport" === t$1.name && "resize" === t$1.type ? 40 : yt[t$1.name];
1364
+ }
1365
+ const gt = new Array(256);
1366
+ for (let t$1 = 0; t$1 < 256; t$1++) gt[t$1] = (t$1 + 256).toString(16).slice(1);
1367
+ const bt = new Uint8Array(16);
1368
+ function kt(t$1) {
1369
+ return gt[t$1[0]] + gt[t$1[1]] + gt[t$1[2]] + gt[t$1[3]] + "-" + gt[t$1[4]] + gt[t$1[5]] + "-" + gt[t$1[6]] + gt[t$1[7]] + "-" + gt[t$1[8]] + gt[t$1[9]] + "-" + gt[t$1[10]] + gt[t$1[11]] + gt[t$1[12]] + gt[t$1[13]] + gt[t$1[14]] + gt[t$1[15]];
1370
+ }
1371
+ function Tt() {
1372
+ return crypto.randomUUID();
1373
+ }
1374
+ function _t() {
1375
+ return crypto.getRandomValues(bt), bt[6] = 15 & bt[6] | 64, bt[8] = 63 & bt[8] | 128, kt(bt);
1376
+ }
1377
+ function It() {
1378
+ for (let t$1 = 0; t$1 < 16; t$1++) bt[t$1] = 256 * Math.random() | 0;
1379
+ return bt[6] = 15 & bt[6] | 64, bt[8] = 63 & bt[8] | 128, kt(bt);
1380
+ }
1381
+ const St = function() {
1382
+ if ("undefined" != typeof crypto) {
1383
+ if ("function" == typeof crypto.randomUUID) return Tt;
1384
+ if ("function" == typeof crypto.getRandomValues) return _t;
1385
+ }
1386
+ return It;
1387
+ }();
1388
+ function xt() {
1389
+ return St();
1390
+ }
1391
+ var Et = class {
1392
+ constructor(t$1, n$1) {
1393
+ this.M = t$1, this.D = n$1, this.P = [], this.C = null, this.R = [], this.L = null, this.m = 0, this.$ = 1, this.U = 0, this.B = 0, this.O = t$1.flush.intervalMs;
1394
+ }
1395
+ push(t$1) {
1396
+ if (this.m) {
1397
+ if (this.P.length < this.q() ? this.P.push(t$1) : this.j(t$1), this.$) return this.P.length >= this.M.flush.size ? (d(this.C), this.C = null, void this.flush("capacity")) : void this.H();
1398
+ } else n.warn("Transport", "push() called before start() — event dropped");
1399
+ }
1400
+ flush(t$1) {
1401
+ if (this.m && this.D.isActivityActive()) try {
1402
+ if ("lifecycle" === t$1) return void this.N();
1403
+ if (0 === this.P.length) return;
1404
+ const e$1 = this.F(t$1);
1405
+ this.D.ingest(e$1, 0).then((t$2) => this.X(t$2, e$1)).catch(() => {
1406
+ n.warn("Transport", "ingest threw unexpectedly — batch dropped");
1407
+ }), this.P.length > 0 && this.H();
1408
+ } catch (t$2) {
1409
+ n.warn("Transport", "flush() threw unexpectedly:", t$2);
1410
+ }
1411
+ }
1412
+ start() {
1413
+ this.m || (this.m = 1, this.$ = "undefined" != typeof navigator ? navigator.onLine : 1);
1414
+ }
1415
+ stop() {
1416
+ if (!this.m) return Promise.resolve();
1417
+ d(this.C), this.C = null, d(this.L), this.L = null;
1418
+ const t$1 = this.N();
1419
+ return this.m = 0, t$1;
1420
+ }
1421
+ onConnectionChange() {
1422
+ const t$1 = "undefined" != typeof navigator ? navigator.onLine : 1;
1423
+ if (t$1 !== this.$) {
1424
+ if (this.$ = t$1, !this.$) return d(this.C), this.C = null, d(this.L), void (this.L = null);
1425
+ this.P.length > 0 && this.H(), this.R.length > 0 && this.K();
1426
+ }
1427
+ }
1428
+ H() {
1429
+ this.m && this.$ && null === this.C && (this.C = u(() => {
1430
+ this.C = null, this.flush("interval");
1431
+ }, this.O));
1432
+ }
1433
+ K() {
1434
+ this.m && this.$ && null === this.L && (this.L = u(() => {
1435
+ this.L = null, this.V();
1436
+ }, this.O));
1437
+ }
1438
+ V() {
1439
+ if (!this.m || !this.$ || 0 === this.R.length || !this.D.isActivityActive()) return;
1440
+ const t$1 = this.R.shift();
1441
+ this.D.ingest(t$1.batch, 0).then((n$1) => this.Y(n$1, t$1)).catch(() => {
1442
+ n.warn("Transport", "retry drain ingest threw unexpectedly — batch dropped"), this.R.length > 0 && this.K();
1443
+ });
1444
+ }
1445
+ J(t$1, e$1) {
1446
+ this.R.length >= 5 && (this.R.shift(), n.warn("Transport", "retry queue full — oldest batch evicted")), this.R.push({
1447
+ batch: t$1,
1448
+ attempts: e$1
1449
+ }), this.K();
1450
+ }
1451
+ X(t$1, n$1) {
1452
+ t$1.ok ? this.G() : this.Z(t$1) && this.J(n$1, 1);
1453
+ }
1454
+ Y(t$1, e$1) {
1455
+ if (t$1.ok) return this.G(), void (this.R.length > 0 && this.K());
1456
+ if (this.Z(t$1)) {
1457
+ if (e$1.attempts >= 3) return this.W(), n.warn("Transport", "batch dropped after MAX_RETRY_ATTEMPTS", e$1.batch.batchId), void (this.R.length > 0 && this.K());
1458
+ this.W(), this.J(e$1.batch, e$1.attempts + 1);
1459
+ } else this.R.length > 0 && this.K();
1460
+ }
1461
+ W() {
1462
+ this.U++, this.U % this.M.flush.backoffFailureThreshold === 0 && (this.O = Math.min(2 * this.O, this.M.flush.maxIntervalMs));
1463
+ }
1464
+ G() {
1465
+ this.U = 0, this.O = this.M.flush.intervalMs;
1466
+ }
1467
+ q() {
1468
+ return this.M.queue.size * (this.$ ? 1 : 2);
1469
+ }
1470
+ async N() {
1471
+ if (!this.D.isActivityActive()) return Promise.resolve();
1472
+ const t$1 = [];
1473
+ for (const e$1 of this.R) t$1.push(this.D.ingest(e$1.batch, 1).catch(() => {
1474
+ n.warn("Transport", "lifecycle retry ingest threw — batch dropped");
1475
+ }));
1476
+ if (this.R = [], this.P.length > 0) {
1477
+ const e$1 = this.F("lifecycle");
1478
+ t$1.push(this.D.ingest(e$1, 1).catch(() => {
1479
+ n.warn("Transport", "lifecycle ingest threw — batch dropped");
1480
+ }));
1481
+ }
1482
+ return Promise.allSettled(t$1).then(() => {});
1483
+ }
1484
+ j(t$1) {
1485
+ const n$1 = vt(t$1);
1486
+ for (let e$1 = 0; e$1 < this.P.length; e$1++) if (vt(this.P[e$1]) < n$1) {
1487
+ for (let t$2 = e$1; t$2 < this.P.length - 1; t$2++) this.P[t$2] = this.P[t$2 + 1];
1488
+ this.P.length -= 1, this.P.push(t$1);
1489
+ return;
1490
+ }
1491
+ }
1492
+ F(t$1) {
1493
+ const n$1 = "lifecycle" === t$1 ? this.P.splice(-this.M.flush.size) : this.P.splice(0, this.M.flush.size);
1494
+ return {
1495
+ activityId: "",
1496
+ batchId: xt(),
1497
+ batchSequence: this.B++,
1498
+ clientTimestamp: Date.now(),
1499
+ schemaVersion: "0.1.0",
1500
+ sdkVersion: "0.3.0",
1501
+ sdkPlatform: "web",
1502
+ tabId: this.D.getTabId(),
1503
+ events: n$1
1504
+ };
1505
+ }
1506
+ Z(t$1) {
1507
+ if (t$1.ok) return 0;
1508
+ switch (t$1.kind) {
1509
+ case "timeout":
1510
+ case "server":
1511
+ case "rate_limited": return 1;
1512
+ default: return 0;
1513
+ }
1514
+ }
1515
+ };
1516
+ const At = "tri:bcast:";
1517
+ const Mt = "function" == typeof BroadcastChannel ? BroadcastChannel : function() {
1518
+ if ("undefined" == typeof Storage || "undefined" == typeof window) return 0;
1519
+ try {
1520
+ const t$1 = "__tri_bcast_probe__";
1521
+ localStorage.setItem(t$1, "1");
1522
+ const n$1 = "1" === localStorage.getItem(t$1);
1523
+ return localStorage.removeItem(t$1), n$1;
1524
+ } catch {
1525
+ return 0;
1526
+ }
1527
+ }() ? class {
1528
+ constructor(t$1) {
1529
+ this.seq = 0, this.closed = 0, this.listeners = /* @__PURE__ */ new Set(), this.onStorageEvent = (t$2) => {
1530
+ if (this.closed) return;
1531
+ if (!t$2.key || !t$2.key.startsWith(`${At}${this.channelName}:`)) return;
1532
+ if (null === t$2.newValue) return;
1533
+ let n$1;
1534
+ s(() => O.remove(t$2.key));
1535
+ try {
1536
+ n$1 = JSON.parse(t$2.newValue);
1537
+ } catch {
1538
+ return;
1539
+ }
1540
+ const e$1 = { data: n$1 };
1541
+ for (const t$3 of this.listeners) s(() => t$3(e$1));
1542
+ }, this.channelName = t$1, this.senderId = xt(), window.addEventListener("storage", this.onStorageEvent);
1543
+ }
1544
+ postMessage(t$1) {
1545
+ if (this.closed) return;
1546
+ const n$1 = `${At}${this.channelName}:${this.senderId}:${this.seq++}`;
1547
+ s(() => {
1548
+ O.set(n$1, t$1), O.remove(n$1);
1549
+ });
1550
+ }
1551
+ addEventListener(t$1, n$1) {
1552
+ this.listeners.add(n$1);
1553
+ }
1554
+ removeEventListener(t$1, n$1) {
1555
+ this.listeners.delete(n$1);
1556
+ }
1557
+ close() {
1558
+ this.closed || (this.closed = 1, window.removeEventListener("storage", this.onStorageEvent), this.listeners.clear());
1559
+ }
1560
+ } : class {
1561
+ constructor(t$1) {
1562
+ n.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.");
1563
+ }
1564
+ postMessage(t$1) {}
1565
+ addEventListener(t$1, n$1) {}
1566
+ removeEventListener(t$1, n$1) {}
1567
+ close() {}
1568
+ }, Dt = "__tri_tabId";
1569
+ var Pt = class {
1570
+ constructor(t$1) {
1571
+ this.context = t$1, this.tt = "", this.m = 0, this.nt = null, this.et = null, this.it = null, this.ot = /* @__PURE__ */ new Map(), this.rt = -1, this.st = null;
1572
+ }
1573
+ async start() {
1574
+ this.m || (this.m = 1, this.tt = this.ct(), this.lt(), this.ut({
1575
+ type: "hello",
1576
+ tabId: this.tt,
1577
+ ts: Date.now()
1578
+ }), this.dt(), this.ht("active"), this.ft());
1579
+ }
1580
+ stop() {
1581
+ this.m && (this.m = 0, this.ht("inactive"), this.ut({
1582
+ type: "bye",
1583
+ tabId: this.tt,
1584
+ ts: Date.now()
1585
+ }), this.wt(this.yt()), this.vt(), this.gt(), this.bt());
1586
+ }
1587
+ getTabId() {
1588
+ return this.tt;
1589
+ }
1590
+ queryTabsNumber() {
1591
+ return this.ot.size + 1;
1592
+ }
1593
+ lt() {
1594
+ try {
1595
+ this.nt = new Mt("__tri_tab_channel"), this.st = this.kt.bind(this), this.nt.addEventListener("message", this.st);
1596
+ } catch (t$1) {
1597
+ n.warn("TabManager", "failed to open broadcast channel:", t$1);
1598
+ }
1599
+ }
1600
+ bt() {
1601
+ try {
1602
+ if (!this.nt) return;
1603
+ this.st && this.nt.removeEventListener("message", this.st), this.nt.close();
1604
+ } catch {} finally {
1605
+ this.nt = null, this.st = null;
1606
+ }
1607
+ }
1608
+ dt() {
1609
+ this.et = setInterval(() => {
1610
+ const t$1 = Date.now();
1611
+ this.ut({
1612
+ type: "heartbeat",
1613
+ tabId: this.tt,
1614
+ ts: t$1
1615
+ });
1616
+ }, 1e3);
1617
+ }
1618
+ vt() {
1619
+ null != this.et && (clearInterval(this.et), this.et = null);
1620
+ }
1621
+ ft() {
1622
+ null != this.it && clearTimeout(this.it), this.it = setTimeout(() => {
1623
+ this.it = null;
1624
+ const t$1 = this.yt() + 1;
1625
+ t$1 !== this.rt && (this.rt = t$1, this.wt(t$1));
1626
+ }, 1e3);
1627
+ }
1628
+ gt() {
1629
+ null != this.it && (clearTimeout(this.it), this.it = null);
1630
+ }
1631
+ ut(t$1) {
1632
+ try {
1633
+ if (!this.nt) return;
1634
+ this.nt.postMessage(t$1);
1635
+ } catch {
1636
+ n.warn("TabManager", "failed to broadcast message:", t$1);
1637
+ }
1638
+ }
1639
+ kt(t$1) {
1640
+ const { type: n$1, tabId: e$1 } = t$1.data;
1641
+ if (e$1 === this.tt) return;
1642
+ const i$1 = Date.now();
1643
+ "hello" === n$1 ? (this.ut({
1644
+ type: "ack",
1645
+ tabId: this.tt,
1646
+ ts: i$1,
1647
+ to: e$1
1648
+ }), this.ot.set(e$1, i$1)) : "heartbeat" === n$1 || "ack" === n$1 ? this.ot.set(e$1, i$1) : "bye" === n$1 && this.ot.delete(e$1);
1649
+ }
1650
+ wt(t$1) {
1651
+ this.context.events.count && this.context.push({
1652
+ name: "tab",
1653
+ type: "count",
1654
+ tabId: this.tt,
1655
+ timestamp: Date.now(),
1656
+ value: t$1
1657
+ });
1658
+ }
1659
+ ht(t$1) {
1660
+ this.context.events.state && this.context.push({
1661
+ name: "tab",
1662
+ type: "state",
1663
+ tabId: this.tt,
1664
+ timestamp: Date.now(),
1665
+ value: t$1
1666
+ });
1667
+ }
1668
+ ct() {
1669
+ const t$1 = q.get(Dt);
1670
+ if (t$1) return t$1;
1671
+ const n$1 = xt();
1672
+ return q.set(Dt, n$1), n$1;
1673
+ }
1674
+ yt(t$1 = Date.now()) {
1675
+ let n$1 = 0;
1676
+ for (const [e$1, i$1] of this.ot.entries()) t$1 - i$1 >= 3e3 ? this.ot.delete(e$1) : n$1++;
1677
+ return n$1;
1678
+ }
1679
+ };
1680
+ const Ct = globalThis.CompressionStream, Rt = globalThis.Response, zt = globalThis.Blob, Lt = new TextEncoder();
1681
+ let $t = null;
1682
+ async function Ut(t$1) {
1683
+ const e$1 = await async function(t$2) {
1684
+ if ("function" != typeof Ct) return null;
1685
+ try {
1686
+ return await new Rt(new zt([Lt.encode(t$2)]).stream().pipeThrough(new Ct("gzip"))).arrayBuffer();
1687
+ } catch (t$3) {
1688
+ return n.warn("compression", "Native gzip failed:", t$3), null;
1689
+ }
1690
+ }(t$1);
1691
+ return null !== e$1 ? e$1 : async function(t$2) {
1692
+ try {
1693
+ const e$2 = await function() {
1694
+ if (null === $t) {
1695
+ const t$3 = function(t$4, e$3 = 1e4) {
1696
+ let i$2 = null;
1697
+ const o$2 = new Promise((t$5) => {
1698
+ i$2 = u(() => {
1699
+ n.warn("import", `Import timed out after ${e$3}ms`), t$5(null);
1700
+ }, e$3);
1701
+ }), r$1 = Promise.resolve().then(t$4).catch((t$5) => (n.warn("import", "Import failed:", t$5), null));
1702
+ return Promise.race([r$1, o$2]).finally(() => {
1703
+ d(i$2);
1704
+ });
1705
+ }(() => import("./browser-8Za96B1X-CUY3snMa.esm.js"), 1e4);
1706
+ $t = t$3, t$3.then((n$1) => {
1707
+ null === n$1 && u(() => {
1708
+ $t === t$3 && ($t = null);
1709
+ }, 1e4);
1710
+ });
1711
+ }
1712
+ return $t;
1713
+ }();
1714
+ if (null === e$2) return null;
1715
+ const { gzipSync: i$1 } = e$2, o$1 = i$1(Lt.encode(t$2));
1716
+ return o$1.buffer.slice(o$1.byteOffset, o$1.byteOffset + o$1.byteLength);
1717
+ } catch (t$3) {
1718
+ return n.warn("compression", "fflate gzip failed:", t$3), null;
1719
+ }
1720
+ }(t$1);
1721
+ }
1722
+ function Bt(t$1) {
1723
+ const n$1 = { Accept: "application/json" };
1724
+ return t$1?.hasBody && ("json" === t$1.contentType ? n$1["Content-Type"] = "application/json" : "ndjson" === t$1.contentType && (n$1["Content-Type"] = "application/x-ndjson"), "gzip" === t$1.contentEncoding && (n$1["Content-Encoding"] = "gzip")), t$1?.token && (n$1.Authorization = `Bearer ${t$1.token}`), t$1?.profileId && (n$1["x-profile-id"] = t$1.profileId), t$1?.api?.version && (n$1["x-api-version"] = t$1.api.version), t$1?.customHeaders && Object.entries(t$1.customHeaders).forEach(([t$2, e$1]) => {
1725
+ n$1[t$2] = e$1;
1726
+ }), n$1;
1727
+ }
1728
+ const Ot = "function" == typeof globalThis.fetch ? globalThis.fetch.bind(globalThis) : void 0;
1729
+ var qt = class {
1730
+ constructor(t$1) {
1731
+ this.context = t$1;
1732
+ }
1733
+ stop() {}
1734
+ async report(t$1, e$1) {
1735
+ const i$1 = {
1736
+ name: t$1,
1737
+ metadata: e$1,
1738
+ timestamp: Date.now(),
1739
+ activityId: this.context.getActivityId() ?? ""
1740
+ };
1741
+ try {
1742
+ const o$1 = await this.context.reportEvent(i$1);
1743
+ if (o$1.ok) return o$1;
1744
+ n.warn("EventReport", "Failed to report event:", t$1, e$1, "with result:", o$1);
1745
+ } catch (i$2) {
1746
+ n.warn("EventReport", "Failed to report event:", t$1, e$1, "with error:", i$2);
1747
+ }
1748
+ }
1749
+ };
1750
+ const jt = new Set([
1751
+ "A",
1752
+ "BUTTON",
1753
+ "INPUT",
1754
+ "SELECT",
1755
+ "TEXTAREA",
1756
+ "SUMMARY",
1757
+ "DETAILS",
1758
+ "LABEL",
1759
+ "OPTION",
1760
+ "FIELDSET"
1761
+ ]), Ht = new Set([
1762
+ "button",
1763
+ "link",
1764
+ "tab",
1765
+ "menuitem",
1766
+ "menuitemcheckbox",
1767
+ "menuitemradio",
1768
+ "checkbox",
1769
+ "radio",
1770
+ "switch",
1771
+ "slider",
1772
+ "spinbutton",
1773
+ "combobox",
1774
+ "listbox",
1775
+ "option",
1776
+ "searchbox",
1777
+ "textbox",
1778
+ "treeitem"
1779
+ ]), Nt = 255;
1780
+ function Ft(t$1, n$1, e$1) {
1781
+ const i$1 = t$1.tagName.toLowerCase(), o$1 = function(t$2) {
1782
+ const n$2 = t$2.parentElement?.children ?? [], e$2 = Math.min(n$2.length, 1e3);
1783
+ let i$2 = e$2 - 1, o$2 = 0, r$2 = 0;
1784
+ for (let i$3 = 0; i$3 < e$2; i$3++) {
1785
+ r$2++;
1786
+ const e$3 = n$2[i$3];
1787
+ if (g(e$3, t$2.tagName) && o$2++, e$3 === t$2) break;
1788
+ }
1789
+ return {
1790
+ siblings: i$2,
1791
+ ofType: o$2,
1792
+ child: r$2
1793
+ };
1794
+ }(t$1), r$1 = function(t$2, n$2) {
1795
+ const e$2 = function(t$3) {
1796
+ if (!t$3) return null;
1797
+ const n$3 = t$3.getAttribute("data-tri-redact-attrs");
1798
+ return n$3 ? n$3.split(",").map((t$4) => t$4.trim().toLowerCase()) : null;
1799
+ }(t$2), i$2 = {}, o$2 = t$2.id;
1800
+ o$2 && !_("id", e$2) && (i$2.id = o$2);
1801
+ const r$2 = t$2.getAttribute("autocomplete");
1802
+ r$2 && !_("autocomplete", e$2) && (i$2.autocomplete = r$2);
1803
+ const s$1 = t$2.getAttribute("aria-invalid");
1804
+ s$1 && !_("aria-invalid", e$2) && (i$2.ariaInvalid = s$1);
1805
+ const c$1 = t$2.getAttribute("tabindex");
1806
+ c$1 && !_("tabindex", e$2) && (i$2.tabIndex = parseInt(c$1, 10));
1807
+ const a$1 = function(t$3) {
1808
+ return t$3.getAttribute("data-testid") ?? t$3.getAttribute("data-cy") ?? null;
1809
+ }(t$2);
1810
+ a$1 && !_("data-testid", e$2) && (i$2.testId = a$1);
1811
+ const l$1 = t$2.hasAttribute("readonly");
1812
+ l$1 && !_("readonly", e$2) && (i$2.readOnly = l$1);
1813
+ const u$1 = t$2.hasAttribute("required");
1814
+ u$1 && !_("required", e$2) && (i$2.required = u$1);
1815
+ const d$1 = t$2.getAttribute("contenteditable");
1816
+ d$1 && !_("contenteditable", e$2) && (i$2.contentEditable = "true" === d$1 || "" === d$1);
1817
+ const h$1 = t$2.getAttribute("href");
1818
+ h$1 && !_("href", e$2) && (i$2.href = {
1819
+ ...n$2 ? {} : { url: h$1 },
1820
+ external: I(h$1)
1821
+ });
1822
+ const f$1 = t$2.getAttribute("role");
1823
+ f$1 && !_("role", e$2) && (i$2.role = f$1);
1824
+ const p$1 = t$2.getAttribute("type");
1825
+ p$1 && !_("type", e$2) && (i$2.type = p$1);
1826
+ const m$1 = t$2.getAttribute("name");
1827
+ m$1 && !_("name", e$2) && (i$2.name = m$1);
1828
+ const w$1 = t$2.getAttribute("placeholder");
1829
+ !w$1 || n$2 || _("placeholder", e$2) || (i$2.placeholder = w$1);
1830
+ const y$1 = Array.from(t$2.classList).slice(0, 5);
1831
+ y$1.length > 0 && !_("class", e$2) && (i$2.classes = y$1);
1832
+ const v$1 = t$2.getAttribute("alt");
1833
+ return !v$1 || n$2 || _("alt", e$2) || (i$2.alt = v$1), Object.keys(i$2).length ? i$2 : null;
1834
+ }(t$1, n$1);
1835
+ return {
1836
+ tagName: i$1,
1837
+ frame: e$1,
1838
+ ...r$1 ? { attributes: r$1 } : {},
1839
+ ...o$1 ? { nth: o$1 } : {}
1840
+ };
1841
+ }
1842
+ function Xt(t$1, n$1) {
1843
+ let e$1 = 0;
1844
+ const i$1 = [];
1845
+ return function(t$2) {
1846
+ return jt.has(t$2.tagName);
1847
+ }(t$1) && (e$1 += 40, i$1.push("native")), function(t$2) {
1848
+ return t$2.hasAttribute("data-tri-interactive");
1849
+ }(t$1) && (e$1 += 40, i$1.push("tri-interactive")), function(t$2) {
1850
+ return g(t$2, "a") && t$2.hasAttribute("href");
1851
+ }(t$1) && (e$1 += 15, i$1.push("has-href")), function(t$2) {
1852
+ const n$2 = t$2.getAttribute("role");
1853
+ return null !== n$2 && Ht.has(n$2);
1854
+ }(t$1) && (e$1 += 30, i$1.push("role")), function(t$2) {
1855
+ return t$2.hasAttribute("onclick") || t$2.hasAttribute("ng-click") || t$2.hasAttribute("data-action") || t$2.hasAttribute("@click");
1856
+ }(t$1) && (e$1 += 20, i$1.push("click-handler")), function(t$2) {
1857
+ const n$2 = t$2.getAttribute("tabindex");
1858
+ if (null === n$2) return 0;
1859
+ const e$2 = parseInt(n$2, 10);
1860
+ return null !== e$2 && e$2 >= 0;
1861
+ }(t$1) && (e$1 += 10, i$1.push("tabindex")), (t$1.id || t$1.getAttribute("data-testid")) && (e$1 += 5, i$1.push("has-id")), n$1 > 0 && (e$1 += Math.round(15 / n$1), i$1.push("depth")), {
1862
+ score: e$1,
1863
+ reasons: i$1
1864
+ };
1865
+ }
1866
+ function Kt(t$1) {
1867
+ return t$1 >= 20;
1868
+ }
1869
+ function Vt(t$1) {
1870
+ return null !== t$1 && t$1.width > 0 && t$1.height > 0 && t$1.y < window.innerHeight && t$1.y + t$1.height > 0 && t$1.x < window.innerWidth && t$1.x + t$1.width > 0;
1871
+ }
1872
+ function Yt(t$1) {
1873
+ return 1 == t$1.disabled || "true" === t$1.getAttribute("aria-disabled");
1874
+ }
1875
+ function Jt(t$1, n$1 = 0) {
1876
+ if (n$1) return null;
1877
+ const e$1 = Zt(t$1, "labelledby");
1878
+ if (e$1) return {
1879
+ text: Wt(e$1),
1880
+ resolutionMethod: "aria-labelledby",
1881
+ confidence: "high"
1882
+ };
1883
+ const i$1 = Qt(t$1);
1884
+ if (i$1) return {
1885
+ text: Wt(i$1),
1886
+ resolutionMethod: "aria-label",
1887
+ confidence: "high"
1888
+ };
1889
+ const o$1 = function(t$2) {
1890
+ if (!t$2.id) return null;
1891
+ const n$2 = document.querySelector(`label[for="${CSS.escape(t$2.id)}"]`);
1892
+ return n$2 ? Gt(n$2) : null;
1893
+ }(t$1);
1894
+ if (o$1) return {
1895
+ text: Wt(o$1),
1896
+ resolutionMethod: "html-for",
1897
+ confidence: "high"
1898
+ };
1899
+ const r$1 = function(t$2) {
1900
+ const n$2 = t$2.closest("label");
1901
+ return n$2 ? Gt(n$2) : null;
1902
+ }(t$1);
1903
+ if (r$1) return {
1904
+ text: Wt(r$1),
1905
+ resolutionMethod: "wrapping-label",
1906
+ confidence: "high"
1907
+ };
1908
+ const s$1 = function(t$2) {
1909
+ return t$2.getAttribute("placeholder")?.trim() ?? null;
1910
+ }(t$1);
1911
+ if (s$1) return {
1912
+ text: Wt(s$1),
1913
+ resolutionMethod: "placeholder",
1914
+ confidence: "low"
1915
+ };
1916
+ const c$1 = function(t$2) {
1917
+ return t$2.getAttribute("title")?.trim() ?? null;
1918
+ }(t$1);
1919
+ if (c$1) return {
1920
+ text: Wt(c$1),
1921
+ resolutionMethod: "title",
1922
+ confidence: "low"
1923
+ };
1924
+ const a$1 = Zt(t$1, "describedby");
1925
+ if (a$1) return {
1926
+ text: Wt(a$1),
1927
+ resolutionMethod: "aria-describedby",
1928
+ confidence: "low"
1929
+ };
1930
+ const l$1 = Gt(t$1);
1931
+ return l$1 ? {
1932
+ text: l$1,
1933
+ resolutionMethod: "text-content",
1934
+ confidence: "low"
1935
+ } : null;
1936
+ }
1937
+ function Gt(t$1, n$1 = 0) {
1938
+ if (n$1 > 8) return "";
1939
+ if (v(t$1)) return function(t$2) {
1940
+ return t$2 ? t$2.trim().split(/(\s+)/).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, Nt) : null;
1941
+ }(t$1.textContent) ?? "";
1942
+ if (!t$1.childNodes?.length) return "";
1943
+ let e$1 = "";
1944
+ for (const i$1 of t$1.childNodes) {
1945
+ const t$2 = Gt(i$1, n$1 + 1);
1946
+ if (t$2 && (e$1 = e$1 ? `${e$1} ${t$2}` : t$2, e$1.length >= Nt)) break;
1947
+ }
1948
+ return Wt(e$1);
1949
+ }
1950
+ function Zt(t$1, n$1) {
1951
+ const e$1 = "labelledby" === n$1 ? "aria-labelledby" : "aria-describedby", i$1 = t$1?.getAttribute(e$1);
1952
+ if (!i$1) return null;
1953
+ const o$1 = i$1.split(/\s+/), r$1 = [];
1954
+ for (const t$2 of o$1) {
1955
+ const n$2 = document.getElementById(t$2);
1956
+ if (!n$2) continue;
1957
+ const e$2 = Qt(n$2) ?? Gt(n$2);
1958
+ e$2.length && r$1.push(e$2);
1959
+ }
1960
+ return r$1.length ? r$1.join(" ") : null;
1961
+ }
1962
+ function Qt(t$1) {
1963
+ return t$1?.getAttribute("aria-label")?.trim() ?? null;
1964
+ }
1965
+ function Wt(t$1) {
1966
+ return t$1.length > Nt ? t$1.slice(0, Nt) + "..." : t$1;
1967
+ }
1968
+ function tn(t$1) {
1969
+ const n$1 = t$1.getBoundingClientRect();
1970
+ return {
1971
+ x: n$1.x,
1972
+ y: n$1.y,
1973
+ width: n$1.width,
1974
+ height: n$1.height
1975
+ };
1976
+ }
1977
+ var nn = class {
1978
+ constructor(t$1) {
1979
+ this.capacity = t$1, this.cache = /* @__PURE__ */ new Map();
1980
+ }
1981
+ get(t$1) {
1982
+ return this.cache.get(t$1);
1983
+ }
1984
+ set(t$1, n$1) {
1985
+ if (this.cache.has(t$1)) this.cache.delete(t$1);
1986
+ else if (this.cache.size >= this.capacity) {
1987
+ const t$2 = this.cache.keys().next().value;
1988
+ t$2 && this.cache.delete(t$2);
1989
+ }
1990
+ this.cache.set(t$1, n$1);
1991
+ }
1992
+ delete(t$1) {
1993
+ this.cache.delete(t$1);
1994
+ }
1995
+ clear() {
1996
+ this.cache.clear();
1997
+ }
1998
+ size() {
1999
+ return this.cache.size;
2000
+ }
2001
+ };
2002
+ async function en(t$1, o$1) {
2003
+ const { collectors: r$1, sdk: s$1 } = t$1;
2004
+ let c$1 = null, l$1 = null, h$1 = null, f$1 = null;
2005
+ try {
2006
+ c$1 = function(t$3) {
2007
+ "undefined" != typeof document && "function" == typeof globalThis.fetch || n.warn("FalconService", "createFalconServiceManager called in a non-browser environment — all requests will resolve with { ok: false, kind: 'network' }.");
2008
+ const e$1 = function(t$4) {
2009
+ const n$1 = t$4?.timeout, e$2 = t$4?.baseUrl ?? "", i$2 = t$4?.api;
2010
+ async function o$3(t$5, o$4, r$2) {
2011
+ if (void 0 === Ot) return {
2012
+ ok: 0,
2013
+ kind: "network"
2014
+ };
2015
+ const s$2 = e$2 ? `${e$2}${o$4}` : o$4, c$2 = new AbortController();
2016
+ let a$1 = null, l$2 = 0;
2017
+ a$1 = u(() => {
2018
+ l$2 = 1, c$2.abort();
2019
+ }, n$1);
2020
+ const h$2 = r$2?.signal;
2021
+ let f$2, p$2 = () => {};
2022
+ if (h$2) if (h$2.aborted) c$2.abort();
2023
+ else {
2024
+ const t$6 = () => c$2.abort();
2025
+ h$2.addEventListener("abort", t$6, { once: 1 }), p$2 = () => h$2.removeEventListener("abort", t$6);
2026
+ }
2027
+ if (null != r$2 && "body" in r$2 && null != r$2.body) {
2028
+ const t$6 = function(t$7) {
2029
+ if (null == t$7) return {
2030
+ ok: 1,
2031
+ body: void 0
2032
+ };
2033
+ if ("string" == typeof t$7 || t$7 instanceof ArrayBuffer || ArrayBuffer.isView(t$7) || t$7 instanceof Blob || t$7 instanceof FormData || t$7 instanceof URLSearchParams || t$7 instanceof ReadableStream) return {
2034
+ ok: 1,
2035
+ body: t$7
2036
+ };
2037
+ try {
2038
+ return {
2039
+ ok: 1,
2040
+ body: JSON.stringify(t$7)
2041
+ };
2042
+ } catch {
2043
+ return { ok: 0 };
2044
+ }
2045
+ }(r$2.body);
2046
+ if (!t$6.ok) return d(a$1), p$2(), {
2047
+ ok: 0,
2048
+ kind: "serialize"
2049
+ };
2050
+ f$2 = t$6.body;
2051
+ }
2052
+ try {
2053
+ const n$2 = await Ot(s$2, {
2054
+ method: t$5,
2055
+ headers: Bt({
2056
+ token: r$2?.token,
2057
+ profileId: r$2?.profileId,
2058
+ contentType: r$2?.contentType,
2059
+ contentEncoding: r$2?.contentEncoding,
2060
+ api: i$2,
2061
+ hasBody: void 0 !== f$2,
2062
+ customHeaders: r$2?.customHeaders
2063
+ }),
2064
+ body: f$2,
2065
+ signal: c$2.signal,
2066
+ keepalive: r$2?.keepalive
2067
+ });
2068
+ if (!n$2.ok) return 429 === (m$2 = n$2.status) ? {
2069
+ ok: 0,
2070
+ kind: "rate_limited",
2071
+ status: m$2
2072
+ } : m$2 >= 400 && m$2 < 500 ? {
2073
+ ok: 0,
2074
+ kind: "client",
2075
+ status: m$2
2076
+ } : {
2077
+ ok: 0,
2078
+ kind: "server",
2079
+ status: m$2
2080
+ };
2081
+ if (204 === n$2.status) return {
2082
+ ok: 1,
2083
+ data: void 0,
2084
+ status: 204
2085
+ };
2086
+ try {
2087
+ return {
2088
+ ok: 1,
2089
+ data: await n$2.json(),
2090
+ status: n$2.status
2091
+ };
2092
+ } catch {
2093
+ return c$2.signal.aborted ? l$2 ? {
2094
+ ok: 0,
2095
+ kind: "timeout"
2096
+ } : {
2097
+ ok: 0,
2098
+ kind: "abort"
2099
+ } : {
2100
+ ok: 0,
2101
+ kind: "parse",
2102
+ status: n$2.status
2103
+ };
2104
+ }
2105
+ } catch {
2106
+ return l$2 ? {
2107
+ ok: 0,
2108
+ kind: "timeout"
2109
+ } : c$2.signal.aborted ? {
2110
+ ok: 0,
2111
+ kind: "abort"
2112
+ } : {
2113
+ ok: 0,
2114
+ kind: "network"
2115
+ };
2116
+ } finally {
2117
+ d(a$1), p$2();
2118
+ }
2119
+ var m$2;
2120
+ }
2121
+ return {
2122
+ post: async function(t$5, n$2) {
2123
+ return o$3("POST", t$5, n$2);
2124
+ },
2125
+ get: async function(t$5, n$2) {
2126
+ return o$3("GET", t$5, n$2);
2127
+ }
2128
+ };
2129
+ }({
2130
+ baseUrl: `${t$3.api.url}/api/v1`,
2131
+ timeout: 1e4,
2132
+ api: { version: t$3.api.version }
2133
+ }), i$1 = function(t$4) {
2134
+ const { getToken: e$2, refresh: i$2 } = t$4;
2135
+ let o$3 = null;
2136
+ return { withAuth: async function(t$5, r$2) {
2137
+ if (o$3) {
2138
+ const n$1 = await o$3;
2139
+ if (n$1) return t$5(n$1);
2140
+ }
2141
+ const s$2 = e$2() ?? "", c$2 = await t$5(s$2);
2142
+ if ((a$1 = c$2).ok || "client" !== a$1.kind || !wt.includes(a$1.status) || 0 == r$2?.refreshable) return c$2;
2143
+ var a$1;
2144
+ const l$2 = await (o$3 || (o$3 = async function() {
2145
+ try {
2146
+ return await i$2(), e$2();
2147
+ } catch (t$6) {
2148
+ return n.warn("AuthMiddleware", "auth refresh failed", t$6), null;
2149
+ }
2150
+ }().finally(() => {
2151
+ o$3 = null;
2152
+ }), o$3));
2153
+ return l$2 && l$2 !== s$2 ? t$5(l$2) : c$2;
2154
+ } };
2155
+ }(t$3), o$2 = () => ({ profileId: t$3.getProfileId() ?? void 0 });
2156
+ return { api: {
2157
+ ingest: async function(n$1, r$2) {
2158
+ return i$1.withAuth(async (i$2) => {
2159
+ const { events: s$2, ...c$2 } = n$1, a$1 = {
2160
+ ...c$2,
2161
+ activityId: t$3.getActivityId()
2162
+ };
2163
+ let l$2;
2164
+ try {
2165
+ l$2 = await async function(t$4, n$2) {
2166
+ const e$2 = function(t$5, n$3) {
2167
+ const e$3 = [JSON.stringify(t$5)];
2168
+ for (let t$6 = 0; t$6 < n$3.length; t$6++) try {
2169
+ e$3.push(JSON.stringify(n$3[t$6]));
2170
+ } catch {}
2171
+ return e$3.join("\n");
2172
+ }(t$4, n$2), i$3 = await Ut(e$2);
2173
+ return i$3 ? {
2174
+ type: "gzip",
2175
+ body: i$3
2176
+ } : {
2177
+ type: "ndjson",
2178
+ body: e$2
2179
+ };
2180
+ }(a$1, s$2);
2181
+ } catch {
2182
+ return {
2183
+ ok: 0,
2184
+ kind: "serialize"
2185
+ };
2186
+ }
2187
+ return e$1.post("/events/capture", {
2188
+ body: l$2.body,
2189
+ token: i$2,
2190
+ keepalive: r$2,
2191
+ contentType: "ndjson",
2192
+ contentEncoding: "gzip" === l$2.type ? "gzip" : void 0,
2193
+ ...o$2()
2194
+ });
2195
+ }, { refreshable: !r$2 });
2196
+ },
2197
+ reportEvent: async function(t$4) {
2198
+ return i$1.withAuth((n$1) => e$1.post("/events/report-event", {
2199
+ body: t$4,
2200
+ token: n$1,
2201
+ contentType: "json",
2202
+ ...o$2()
2203
+ }));
2204
+ },
2205
+ startActivity: async function() {
2206
+ return e$1.post("/events/start-activity", {
2207
+ token: t$3.getSdkToken(),
2208
+ ...o$2()
2209
+ });
2210
+ },
2211
+ stopActivity: async function() {
2212
+ return i$1.withAuth((t$4) => e$1.post("/events/end-activity", {
2213
+ token: t$4,
2214
+ keepalive: 1,
2215
+ ...o$2()
2216
+ }), { refreshable: 0 });
2217
+ },
2218
+ collectionStatus: async function() {
2219
+ return e$1.get("/sdk/collection-status", {
2220
+ token: t$3.getSdkToken(),
2221
+ ...o$2()
2222
+ });
2223
+ },
2224
+ linkInterview: async function(t$4) {
2225
+ return i$1.withAuth((n$1) => e$1.post("/events/link-interview", {
2226
+ token: n$1,
2227
+ contentType: "json",
2228
+ ...o$2(),
2229
+ customHeaders: { "X-Incode-Hardware-Id": t$4 }
2230
+ }));
2231
+ }
2232
+ } };
2233
+ }({
2234
+ api: {
2235
+ version: s$1.api.version,
2236
+ url: s$1.api.url
2237
+ },
2238
+ getSdkToken: () => s$1.token,
2239
+ getProfileId: () => o$1.getProfileId(),
2240
+ getToken: () => l$1?.getToken() ?? null,
2241
+ refresh: async () => l$1?.refresh() ?? Promise.resolve(),
2242
+ getActivityId: () => l$1?.getActivityId() ?? ""
2243
+ });
2244
+ const t$2 = await c$1.api.collectionStatus();
2245
+ if (!t$2.ok || 1 != t$2.data.eventsCollectionEnabled) return { status: "collection-disabled" };
2246
+ l$1 = new mt({
2247
+ startActivity: () => c$1.api.startActivity(),
2248
+ stopActivity: () => c$1.api.stopActivity()
2249
+ }), h$1 = new Et(et, {
2250
+ ingest: (t$3, n$1) => c$1.api.ingest(t$3, n$1),
2251
+ getTabId: () => f$1?.getTabId() ?? "unknown",
2252
+ isActivityActive: () => l$1?.isActive() ?? 0
2253
+ });
2254
+ const p$1 = r$1.tab;
2255
+ f$1 = new Pt({
2256
+ push: (t$3) => h$1?.push(t$3),
2257
+ events: {
2258
+ state: p$1.enabled && p$1.events.state.enabled,
2259
+ count: p$1.enabled && p$1.events.count.enabled
2260
+ }
2261
+ });
2262
+ const m$1 = function(t$3) {
2263
+ function n$1(n$2) {
2264
+ "hidden" === document.visibilityState && t$3.flush();
2265
+ }
2266
+ function o$2(n$2) {
2267
+ t$3.flush(), t$3.stopTab(), t$3.getShouldSkipStopActivity() || t$3.stopActivity();
2268
+ }
2269
+ const r$2 = a(() => t$3.onConnectionChange());
2270
+ return {
2271
+ start: function() {
2272
+ e(document, "visibilitychange", n$1), e(window, "pagehide", o$2), e(window, "online", r$2), e(window, "offline", r$2);
2273
+ },
2274
+ stop: function() {
2275
+ i(document, "visibilitychange", n$1), i(window, "pagehide", o$2), i(window, "online", r$2), i(window, "offline", r$2);
2276
+ }
2277
+ };
2278
+ }({
2279
+ flush: () => h$1?.flush("lifecycle"),
2280
+ stopActivity: async () => l$1?.stop(),
2281
+ stopTab: () => f$1?.stop(),
2282
+ getShouldSkipStopActivity: () => (f$1?.queryTabsNumber() ?? 0) > 1,
2283
+ onConnectionChange: () => h$1?.onConnectionChange()
2284
+ }), w$1 = function(t$3) {
2285
+ const n$1 = t$3 || "redact", e$1 = new nn(6), i$1 = new nn(6);
2286
+ return { resolve: function(t$4) {
2287
+ if (!t$4 || k(t$4) || "off" === n$1) return null;
2288
+ let o$2 = e$1.get(t$4);
2289
+ if (o$2 || (o$2 = function(t$5) {
2290
+ if (!t$5 || k(t$5)) return {
2291
+ chain: [],
2292
+ redaction: {
2293
+ level: "ignore",
2294
+ index: -1
2295
+ }
2296
+ };
2297
+ const n$2 = [];
2298
+ let e$2 = t$5, i$2 = -1;
2299
+ for (; e$2;) {
2300
+ if (k(e$2)) return {
2301
+ chain: [],
2302
+ redaction: {
2303
+ level: "ignore",
2304
+ index: -1
2305
+ }
2306
+ };
2307
+ T(e$2) && (i$2 = n$2.length), n$2.push(e$2);
2308
+ const t$6 = e$2.parentNode;
2309
+ if (!t$6 || g(e$2, "body")) break;
2310
+ e$2 = b(t$6) ? t$6.host : t$6;
2311
+ }
2312
+ return {
2313
+ chain: n$2,
2314
+ redaction: {
2315
+ level: -1 === i$2 ? "full" : "redact",
2316
+ index: i$2
2317
+ }
2318
+ };
2319
+ }(t$4.parentElement), e$1.set(t$4, o$2)), "ignore" === o$2.redaction.level) return null;
2320
+ const r$2 = "redact" === o$2.redaction.level || "redact" === n$1 || T(t$4);
2321
+ let s$2 = i$1.get(t$4);
2322
+ return s$2 || (s$2 = function(t$5, n$2, e$2, i$2) {
2323
+ const o$3 = getComputedStyle(t$5), r$3 = tn(t$5), s$3 = function(t$6, n$3) {
2324
+ const e$3 = [], i$3 = [];
2325
+ for (let o$4 = t$6.length - 1; o$4 >= 0; o$4--) {
2326
+ const r$4 = t$6[o$4], s$4 = o$4 <= n$3, c$3 = o$4 + 1, a$2 = Ft(r$4, s$4, tn(r$4)), { score: l$3, reasons: u$1 } = Xt(r$4, c$3);
2327
+ if (e$3.push(a$2), !Kt(l$3)) continue;
2328
+ const d$1 = Jt(r$4, s$4);
2329
+ i$3.push({
2330
+ ...a$2,
2331
+ ...d$1 ? { label: d$1 } : {},
2332
+ depth: c$3,
2333
+ score: l$3,
2334
+ reasons: u$1
2335
+ });
2336
+ }
2337
+ return {
2338
+ ancestors: e$3,
2339
+ interactiveCandidates: i$3.reverse()
2340
+ };
2341
+ }(n$2, i$2), c$2 = Ft(t$5, e$2, r$3), a$1 = function(t$6, n$3, e$3) {
2342
+ const { score: i$3, reasons: o$4 } = Xt(t$6, 0);
2343
+ return {
2344
+ interactive: Kt(i$3),
2345
+ ...o$4.length > 0 ? { reasons: o$4 } : {},
2346
+ disabled: Yt(t$6),
2347
+ rendered: "none" !== n$3?.display,
2348
+ visible: "hidden" !== n$3?.visibility,
2349
+ inViewport: Vt(e$3),
2350
+ acceptsPointer: "none" !== n$3?.pointerEvents,
2351
+ opacity: parseFloat(n$3?.opacity || "1")
2352
+ };
2353
+ }(t$5, o$3, r$3);
2354
+ let l$2 = null;
2355
+ return e$2 || (l$2 = a$1.interactive ? Jt(t$5) : null), {
2356
+ tagName: c$2.tagName,
2357
+ frame: c$2.frame,
2358
+ viewport: {
2359
+ height: window.innerHeight,
2360
+ width: window.innerWidth,
2361
+ scrollX: window.scrollX,
2362
+ scrollY: window.scrollY,
2363
+ dpr: window.devicePixelRatio
2364
+ },
2365
+ attributes: c$2.attributes,
2366
+ nth: c$2.nth,
2367
+ ...l$2 ? { label: l$2 } : {},
2368
+ ancestors: s$3.ancestors,
2369
+ interactiveCandidates: s$3.interactiveCandidates,
2370
+ interactivity: a$1
2371
+ };
2372
+ }(t$4, o$2.chain, r$2, o$2.redaction.index), i$1.set(t$4, s$2)), s$2;
2373
+ } };
2374
+ }(s$1.capture?.element), y$1 = /* @__PURE__ */ new Set();
2375
+ try {
2376
+ y$1.add(new URL(s$1.api.url).origin);
2377
+ } catch {}
2378
+ const v$1 = function(t$3, n$1, e$1 = "on") {
2379
+ const i$1 = /* @__PURE__ */ new Map();
2380
+ function o$2(o$3) {
2381
+ if (i$1.has(o$3)) return;
2382
+ const r$2 = Q[o$3];
2383
+ if (!r$2 || !function(t$4, n$2) {
2384
+ return n$2[t$4]?.enabled ?? 0;
2385
+ }(o$3, n$1)) return;
2386
+ const s$2 = n$1[o$3], c$2 = r$2.create(t$3, e$1, s$2 && "events" in s$2 ? s$2.events : void 0);
2387
+ i$1.set(o$3, c$2);
2388
+ }
2389
+ return {
2390
+ start: o$2,
2391
+ stopCollector: function(t$4) {
2392
+ const n$2 = i$1.get(t$4);
2393
+ n$2 && (n$2(), i$1.delete(t$4));
2394
+ },
2395
+ stop: function() {
2396
+ for (const [, t$4] of i$1) t$4();
2397
+ i$1.clear();
2398
+ },
2399
+ isRunning: function(t$4) {
2400
+ return i$1.has(t$4);
2401
+ },
2402
+ autocapture: function() {
2403
+ for (const t$4 of W) o$2(t$4);
2404
+ }
2405
+ };
2406
+ }({
2407
+ push: (t$3) => h$1?.push(t$3),
2408
+ resolveElement: (t$3) => w$1.resolve(t$3),
2409
+ sanitizeUrl: s$1.sanitizeUrl,
2410
+ ignoredOrigins: y$1
2411
+ }, r$1, s$1.capture?.content), _$1 = new qt({
2412
+ getActivityId: () => l$1?.getActivityId() ?? "",
2413
+ reportEvent: (t$3) => c$1.api.reportEvent(t$3)
2414
+ });
2415
+ return {
2416
+ status: "ready",
2417
+ managers: {
2418
+ falconServiceManager: c$1,
2419
+ activityManager: l$1,
2420
+ transportManager: h$1,
2421
+ tabManager: f$1,
2422
+ lifecycleManager: m$1,
2423
+ collectorManager: v$1,
2424
+ eventReportManager: _$1
2425
+ }
2426
+ };
2427
+ } catch (t$2) {
2428
+ return n.warn("IncodeTRI", "setup() failed during construction:", t$2), { status: "init-failed" };
2429
+ }
2430
+ }
2431
+ let on = class t$1 {
2432
+ constructor() {
2433
+ this.Tt = 0, this.M = null, this._t = null, this.It = "idle";
2434
+ }
2435
+ static get instance() {
2436
+ return t$1.i || (t$1.i = new t$1()), t$1.i;
2437
+ }
2438
+ async setup(t$2) {
2439
+ if ("idle" !== this.It) return n.fatal("error", "setup()", "called more than once — ignoring."), "init-failed";
2440
+ try {
2441
+ const e$1 = function(t$3) {
2442
+ if ("undefined" == typeof document) return n.fatal("error", "IncodeTRI", "TRI is not available in a non-browser environment."), null;
2443
+ if (!t$3?.token) return n.fatal("error", "SDK", "token is required."), null;
2444
+ if (!t$3.apiURL) return n.fatal("error", "SDK", "Couldn't initialise SDK — apiURL isn't provided."), null;
2445
+ const { element: e$2, content: i$2 } = t$3.capture ?? {}, o$1 = {
2446
+ token: t$3.token,
2447
+ capture: {
2448
+ element: e$2 ?? "redact",
2449
+ content: i$2 ?? "off"
2450
+ },
2451
+ profileId: t$3.profileId,
2452
+ api: {
2453
+ version: t$3.apiVersion ?? "1.0",
2454
+ url: t$3.apiURL
2455
+ },
2456
+ sanitizeUrl: (r$1 = t$3.sanitizeUrl, r$1 ? function(t$4) {
2457
+ return s(() => r$1(t$4, nt)) ?? nt(t$4);
2458
+ } : nt),
2459
+ DEBUG: t$3.DEBUG ?? 0
2460
+ };
2461
+ var r$1;
2462
+ return void 0 === t$3.collectors && void 0 === t$3.layers ? {
2463
+ sdk: o$1,
2464
+ collectors: it()
2465
+ } : void 0 !== t$3.collectors ? {
2466
+ sdk: o$1,
2467
+ collectors: rt(t$3.collectors)
2468
+ } : {
2469
+ sdk: o$1,
2470
+ collectors: ot(t$3.layers)
2471
+ };
2472
+ }(t$2);
2473
+ if (!e$1) return "init-failed";
2474
+ n.DEBUG = e$1.sdk.DEBUG;
2475
+ const i$1 = await en(e$1, { getProfileId: () => this.St() });
2476
+ return "collection-disabled" === i$1.status ? (n.fatal("warn", "setup()", "Collection is disabled for the provided API Key."), "collection-disabled") : "init-failed" === i$1.status ? "init-failed" : (this.M = e$1, this._t = i$1.managers, this.It = "ready", this.xt(e$1.sdk.profileId), "ready");
2477
+ } catch (t$3) {
2478
+ return n.warn("setup()", "failed:", t$3), "init-failed";
2479
+ }
2480
+ }
2481
+ async start() {
2482
+ if ("idle" === this.It) return n.warn("start()", "start() requires a prior successful setup() — ignoring."), this.It;
2483
+ if ("ready" !== this.It) return n.fatal("warn", "start()", "TRI is either already started or isn't ready — ignoring."), this.It;
2484
+ this.It = "starting";
2485
+ const t$2 = ++this.Tt;
2486
+ return await this.v(t$2), this.It;
2487
+ }
2488
+ async stop() {
2489
+ n.warn("stop()", "called");
2490
+ const t$2 = this._t;
2491
+ return t$2 ? (++this.Tt, t$2.lifecycleManager.stop(), t$2.collectorManager.stop(), t$2.tabManager.stop(), t$2.eventReportManager.stop(), this.It = "ready", this.Et(t$2)) : Promise.resolve(this.It);
2492
+ }
2493
+ async reset() {
2494
+ const t$2 = this.stop();
2495
+ return this.It = "idle", this.M = null, this._t = null, O.remove("__tri_profile_id"), t$2.then(() => this.It);
2496
+ }
2497
+ async Et(t$2) {
2498
+ return await function(t$3) {
2499
+ let n$1 = null;
2500
+ const e$1 = new Promise((t$4) => {
2501
+ n$1 = u(t$4, 2e3);
2502
+ });
2503
+ return Promise.race([t$3.finally(() => d(n$1)), e$1]);
2504
+ }(Promise.resolve(t$2.transportManager.stop())), await t$2.activityManager.stop(), this.It;
2505
+ }
2506
+ reportEvent(t$2, e$1) {
2507
+ "started" === this.It ? this._t ? c(() => this._t.eventReportManager.report(t$2, e$1)) : n.warn("reportEvent()", "reportEvent() called but managers are unavailable — dropping event.") : n.warn("reportEvent()", "reportEvent() called before start() completed — dropping event.");
2508
+ }
2509
+ setProfileId(t$2) {
2510
+ "started" === this.It ? this.M?.sdk && (this.M.sdk.profileId = t$2, this.xt(t$2)) : n.warn("setProfileId()", "setProfileId() called before start() completed — ignoring.");
2511
+ }
2512
+ async linkInterview(t$2) {
2513
+ if ("started" !== this.It || !this._t) return n.warn("linkInterview()", "linkInterview() called before start() completed — ignoring."), 0;
2514
+ if (!t$2) return n.warn("linkInterview()", "linkInterview() called without sessionToken — ignoring."), 0;
2515
+ try {
2516
+ return (await this._t.falconServiceManager.api.linkInterview(t$2)).ok;
2517
+ } catch (t$3) {
2518
+ return n.warn("linkInterview()", "failed:", t$3), 0;
2519
+ }
2520
+ }
2521
+ St() {
2522
+ return this.M?.sdk?.profileId ?? O.get("__tri_profile_id") ?? null;
2523
+ }
2524
+ xt(t$2) {
2525
+ t$2 && O.set("__tri_profile_id", t$2);
2526
+ }
2527
+ async v(t$2) {
2528
+ const e$1 = this._t;
2529
+ if (e$1) {
2530
+ try {
2531
+ if (await e$1.activityManager.start(), t$2 !== this.Tt) return;
2532
+ if (e$1.transportManager.start(), await e$1.tabManager.start(), t$2 !== this.Tt) return;
2533
+ e$1.lifecycleManager.start(), e$1.collectorManager.autocapture();
2534
+ } catch (e$2) {
2535
+ n.warn("start()", "failed during monitoring start:", e$2), t$2 === this.Tt && (this.It = "ready");
2536
+ return;
2537
+ }
2538
+ t$2 === this.Tt && (this.It = "started");
2539
+ }
2540
+ }
2541
+ };
2542
+ async function rn(t$1, n$1) {
2543
+ const e$1 = n$1?.apiURL ?? "https://falcon-ingest-k8s.stage.incodetest.com", i$1 = n$1?.timeout ?? 1e4, o$1 = new AbortController();
2544
+ let r$1 = null, s$1 = 0, c$1 = () => {};
2545
+ i$1 && (r$1 = u(() => {
2546
+ s$1 = 1, o$1.abort();
2547
+ }, i$1));
2548
+ const a$1 = n$1?.signal;
2549
+ if (a$1) if (a$1.aborted) o$1.abort();
2550
+ else {
2551
+ const t$2 = () => o$1.abort();
2552
+ a$1.addEventListener("abort", t$2, { once: 1 }), c$1 = () => a$1.removeEventListener("abort", t$2);
2553
+ }
2554
+ try {
2555
+ const n$2 = await fetch(`${e$1}/api/v1/sdk/init`, {
2556
+ method: "POST",
2557
+ headers: {
2558
+ "content-type": "application/json",
2559
+ "x-api-key": t$1,
2560
+ "x-api-version": "1.0"
2561
+ },
2562
+ signal: o$1.signal
2563
+ });
2564
+ if (!n$2.ok) {
2565
+ let t$2 = n$2.statusText;
2566
+ try {
2567
+ const e$2 = await n$2.json();
2568
+ e$2.errorMessage && (t$2 = e$2.errorMessage);
2569
+ } catch {}
2570
+ return {
2571
+ token: null,
2572
+ eventsCollectionEnabled: 0,
2573
+ error: {
2574
+ status: n$2.status,
2575
+ message: t$2
2576
+ }
2577
+ };
2578
+ }
2579
+ return await n$2.json();
2580
+ } catch (t$2) {
2581
+ throw new Error((s$1 ? "[TRI] createSession timed out" : "[TRI] Failed to create session:") + " " + t$2.message);
2582
+ } finally {
2583
+ d(r$1), c$1();
2584
+ }
2585
+ }
2586
+ on.i = null;
2587
+ const sn = on.instance;
2588
+
2589
+ //#endregion
2590
+ export { rn as createSession, sn as default };