flowgrid-sdk 1.2.1 → 1.3.0

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 (312) hide show
  1. package/README.md +224 -250
  2. package/dist/237.flowgrid.min.js +2 -0
  3. package/dist/237.flowgrid.min.js.map +1 -0
  4. package/dist/546.flowgrid.min.js +3 -0
  5. package/dist/546.flowgrid.min.js.LICENSE.txt +14 -0
  6. package/dist/546.flowgrid.min.js.map +1 -0
  7. package/dist/EXAMPLE.d.ts +1 -0
  8. package/dist/EXAMPLE.js +55 -0
  9. package/dist/EXAMPLE.js.map +1 -0
  10. package/dist/browser.d.ts +46 -103
  11. package/dist/browser.js +102 -0
  12. package/dist/browser.js.map +1 -0
  13. package/dist/flowgrid.min.js +1 -1
  14. package/dist/flowgrid.min.js.map +1 -1
  15. package/dist/index.d.ts +7 -8
  16. package/dist/index.js +64 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/lib/client/transport.d.ts +14 -4
  19. package/dist/lib/client/transport.js +432 -0
  20. package/dist/lib/client/transport.js.map +1 -0
  21. package/dist/lib/consent/index.d.ts +0 -5
  22. package/dist/lib/consent/index.js +32 -0
  23. package/dist/lib/consent/index.js.map +1 -0
  24. package/dist/lib/consent/manager.js +336 -0
  25. package/dist/lib/consent/manager.js.map +1 -0
  26. package/dist/lib/consent/types.d.ts +3 -20
  27. package/dist/lib/consent/types.js +10 -0
  28. package/dist/lib/consent/types.js.map +1 -0
  29. package/dist/lib/features/analytics/attribution.d.ts +6 -47
  30. package/dist/lib/features/analytics/attribution.js +181 -0
  31. package/dist/lib/features/analytics/attribution.js.map +1 -0
  32. package/dist/lib/features/analytics/events.d.ts +1 -28
  33. package/dist/lib/features/analytics/events.js +256 -0
  34. package/dist/lib/features/analytics/events.js.map +1 -0
  35. package/dist/lib/features/analytics/funnels.js +260 -0
  36. package/dist/lib/features/analytics/funnels.js.map +1 -0
  37. package/dist/lib/features/analytics/heatmaps.d.ts +12 -19
  38. package/dist/lib/features/analytics/heatmaps.js +258 -0
  39. package/dist/lib/features/analytics/heatmaps.js.map +1 -0
  40. package/dist/lib/features/analytics/identify.d.ts +1 -21
  41. package/dist/lib/features/analytics/identify.js +213 -0
  42. package/dist/lib/features/analytics/identify.js.map +1 -0
  43. package/dist/lib/features/analytics/index.d.ts +2 -0
  44. package/dist/lib/features/analytics/index.js +15 -0
  45. package/dist/lib/features/analytics/index.js.map +1 -0
  46. package/dist/lib/features/analytics/page-views.d.ts +13 -30
  47. package/dist/lib/features/analytics/page-views.js +268 -0
  48. package/dist/lib/features/analytics/page-views.js.map +1 -0
  49. package/dist/lib/features/analytics/performance.d.ts +18 -24
  50. package/dist/lib/features/analytics/performance.js +232 -0
  51. package/dist/lib/features/analytics/performance.js.map +1 -0
  52. package/dist/lib/features/analytics/replay.d.ts +170 -0
  53. package/dist/lib/features/analytics/replay.js +381 -0
  54. package/dist/lib/features/analytics/replay.js.map +1 -0
  55. package/dist/lib/features/analytics/retention.d.ts +1 -76
  56. package/dist/lib/features/analytics/retention.js +135 -0
  57. package/dist/lib/features/analytics/retention.js.map +1 -0
  58. package/dist/lib/features/analytics/sessions.d.ts +12 -37
  59. package/dist/lib/features/analytics/sessions.js +213 -0
  60. package/dist/lib/features/analytics/sessions.js.map +1 -0
  61. package/dist/lib/features/core/activation.d.ts +1 -24
  62. package/dist/lib/features/core/activation.js +175 -0
  63. package/dist/lib/features/core/activation.js.map +1 -0
  64. package/dist/lib/features/core/experiment.d.ts +53 -21
  65. package/dist/lib/features/core/experiment.js +554 -0
  66. package/dist/lib/features/core/experiment.js.map +1 -0
  67. package/dist/lib/features/core/index.js +9 -0
  68. package/dist/lib/features/core/index.js.map +1 -0
  69. package/dist/lib/features/core/track-feature.d.ts +1 -8
  70. package/dist/lib/features/core/track-feature.js +119 -0
  71. package/dist/lib/features/core/track-feature.js.map +1 -0
  72. package/dist/lib/features/core/track-prompt.d.ts +5 -8
  73. package/dist/lib/features/core/track-prompt.js +181 -0
  74. package/dist/lib/features/core/track-prompt.js.map +1 -0
  75. package/dist/lib/features/ecommerce/cart.d.ts +1 -24
  76. package/dist/lib/features/ecommerce/cart.js +244 -0
  77. package/dist/lib/features/ecommerce/cart.js.map +1 -0
  78. package/dist/lib/features/ecommerce/checkout.d.ts +1 -28
  79. package/dist/lib/features/ecommerce/checkout.js +254 -0
  80. package/dist/lib/features/ecommerce/checkout.js.map +1 -0
  81. package/dist/lib/features/ecommerce/index.d.ts +0 -2
  82. package/dist/lib/features/ecommerce/index.js +15 -0
  83. package/dist/lib/features/ecommerce/index.js.map +1 -0
  84. package/dist/lib/features/ecommerce/ltv.d.ts +1 -69
  85. package/dist/lib/features/ecommerce/ltv.js +114 -0
  86. package/dist/lib/features/ecommerce/ltv.js.map +1 -0
  87. package/dist/lib/features/ecommerce/products.d.ts +1 -33
  88. package/dist/lib/features/ecommerce/products.js +223 -0
  89. package/dist/lib/features/ecommerce/products.js.map +1 -0
  90. package/dist/lib/features/ecommerce/promotions.d.ts +1 -30
  91. package/dist/lib/features/ecommerce/promotions.js +197 -0
  92. package/dist/lib/features/ecommerce/promotions.js.map +1 -0
  93. package/dist/lib/features/ecommerce/purchases.d.ts +1 -48
  94. package/dist/lib/features/ecommerce/purchases.js +193 -0
  95. package/dist/lib/features/ecommerce/purchases.js.map +1 -0
  96. package/dist/lib/features/ecommerce/refunds.d.ts +1 -27
  97. package/dist/lib/features/ecommerce/refunds.js +195 -0
  98. package/dist/lib/features/ecommerce/refunds.js.map +1 -0
  99. package/dist/lib/features/ecommerce/search.d.ts +1 -24
  100. package/dist/lib/features/ecommerce/search.js +156 -0
  101. package/dist/lib/features/ecommerce/search.js.map +1 -0
  102. package/dist/lib/features/ecommerce/subscriptions.d.ts +1 -28
  103. package/dist/lib/features/ecommerce/subscriptions.js +207 -0
  104. package/dist/lib/features/ecommerce/subscriptions.js.map +1 -0
  105. package/dist/lib/features/ecommerce/wishlist.d.ts +1 -28
  106. package/dist/lib/features/ecommerce/wishlist.js +186 -0
  107. package/dist/lib/features/ecommerce/wishlist.js.map +1 -0
  108. package/dist/lib/features/enterprise/acquisition.d.ts +2 -57
  109. package/dist/lib/features/enterprise/acquisition.js +166 -0
  110. package/dist/lib/features/enterprise/acquisition.js.map +1 -0
  111. package/dist/lib/features/enterprise/alerts.d.ts +1 -37
  112. package/dist/lib/features/enterprise/alerts.js +246 -0
  113. package/dist/lib/features/enterprise/alerts.js.map +1 -0
  114. package/dist/lib/features/enterprise/churn.d.ts +1 -42
  115. package/dist/lib/features/enterprise/churn.js +175 -0
  116. package/dist/lib/features/enterprise/churn.js.map +1 -0
  117. package/dist/lib/features/enterprise/cohorts.d.ts +1 -37
  118. package/dist/lib/features/enterprise/cohorts.js +201 -0
  119. package/dist/lib/features/enterprise/cohorts.js.map +1 -0
  120. package/dist/lib/features/enterprise/engagement.d.ts +40 -46
  121. package/dist/lib/features/enterprise/engagement.js +335 -0
  122. package/dist/lib/features/enterprise/engagement.js.map +1 -0
  123. package/dist/lib/features/enterprise/forecasting.d.ts +0 -50
  124. package/dist/lib/features/enterprise/forecasting.js +232 -0
  125. package/dist/lib/features/enterprise/forecasting.js.map +1 -0
  126. package/dist/lib/features/enterprise/index.d.ts +1 -1
  127. package/dist/lib/features/enterprise/index.js +76 -0
  128. package/dist/lib/features/enterprise/index.js.map +1 -0
  129. package/dist/lib/features/enterprise/monetization.d.ts +1 -60
  130. package/dist/lib/features/enterprise/monetization.js +146 -0
  131. package/dist/lib/features/enterprise/monetization.js.map +1 -0
  132. package/dist/lib/features/enterprise/multi-path-funnels.d.ts +1 -17
  133. package/dist/lib/features/enterprise/multi-path-funnels.js +205 -0
  134. package/dist/lib/features/enterprise/multi-path-funnels.js.map +1 -0
  135. package/dist/lib/features/enterprise/paths.d.ts +1 -56
  136. package/dist/lib/features/enterprise/paths.js +149 -0
  137. package/dist/lib/features/enterprise/paths.js.map +1 -0
  138. package/dist/lib/features/enterprise/security.d.ts +8 -57
  139. package/dist/lib/features/enterprise/security.js +202 -0
  140. package/dist/lib/features/enterprise/security.js.map +1 -0
  141. package/dist/lib/features/enterprise/support.d.ts +3 -42
  142. package/dist/lib/features/enterprise/support.js +162 -0
  143. package/dist/lib/features/enterprise/support.js.map +1 -0
  144. package/dist/lib/flowgrid.d.ts +278 -0
  145. package/dist/lib/flowgrid.js +323 -0
  146. package/dist/lib/flowgrid.js.map +1 -0
  147. package/dist/lib/frameworks/index.d.ts +13 -6
  148. package/dist/lib/frameworks/index.js +18 -0
  149. package/dist/lib/frameworks/index.js.map +1 -0
  150. package/dist/lib/frameworks/nextjs/client.js +355 -0
  151. package/dist/lib/frameworks/nextjs/client.js.map +1 -0
  152. package/dist/lib/frameworks/nextjs/index.js +31 -0
  153. package/dist/lib/frameworks/nextjs/index.js.map +1 -0
  154. package/dist/lib/frameworks/nextjs/server.js +259 -0
  155. package/dist/lib/frameworks/nextjs/server.js.map +1 -0
  156. package/dist/lib/frameworks/node/index.js +391 -0
  157. package/dist/lib/frameworks/node/index.js.map +1 -0
  158. package/dist/lib/frameworks/nuxt/index.js +288 -0
  159. package/dist/lib/frameworks/nuxt/index.js.map +1 -0
  160. package/dist/lib/frameworks/react/CookieBanner.js +166 -0
  161. package/dist/lib/frameworks/react/CookieBanner.js.map +1 -0
  162. package/dist/lib/frameworks/react/index.js +271 -0
  163. package/dist/lib/frameworks/react/index.js.map +1 -0
  164. package/dist/lib/frameworks/vue/CookieBanner.js +165 -0
  165. package/dist/lib/frameworks/vue/CookieBanner.js.map +1 -0
  166. package/dist/lib/frameworks/vue/index.js +390 -0
  167. package/dist/lib/frameworks/vue/index.js.map +1 -0
  168. package/dist/lib/tracking/analytics/attribution.d.ts +14 -0
  169. package/dist/lib/tracking/analytics/attribution.js +18 -0
  170. package/dist/lib/tracking/analytics/attribution.js.map +1 -0
  171. package/dist/lib/tracking/analytics/events.d.ts +26 -0
  172. package/dist/lib/tracking/analytics/events.js +30 -0
  173. package/dist/lib/tracking/analytics/events.js.map +1 -0
  174. package/dist/lib/tracking/analytics/funnels.d.ts +16 -0
  175. package/dist/lib/tracking/analytics/funnels.js +22 -0
  176. package/dist/lib/tracking/analytics/funnels.js.map +1 -0
  177. package/dist/lib/tracking/analytics/heatmaps.d.ts +27 -0
  178. package/dist/lib/tracking/analytics/heatmaps.js +22 -0
  179. package/dist/lib/tracking/analytics/heatmaps.js.map +1 -0
  180. package/dist/lib/tracking/analytics/identify.d.ts +16 -0
  181. package/dist/lib/tracking/analytics/identify.js +22 -0
  182. package/dist/lib/tracking/analytics/identify.js.map +1 -0
  183. package/dist/lib/tracking/analytics/index.d.ts +10 -0
  184. package/dist/lib/tracking/analytics/index.js +11 -0
  185. package/dist/lib/tracking/analytics/index.js.map +1 -0
  186. package/dist/lib/tracking/analytics/page-views.d.ts +29 -0
  187. package/dist/lib/tracking/analytics/page-views.js +50 -0
  188. package/dist/lib/tracking/analytics/page-views.js.map +1 -0
  189. package/dist/lib/tracking/analytics/performance.d.ts +22 -0
  190. package/dist/lib/tracking/analytics/performance.js +22 -0
  191. package/dist/lib/tracking/analytics/performance.js.map +1 -0
  192. package/dist/lib/tracking/analytics/replay.d.ts +34 -0
  193. package/dist/lib/tracking/analytics/replay.js +46 -0
  194. package/dist/lib/tracking/analytics/replay.js.map +1 -0
  195. package/dist/lib/tracking/analytics/retention.d.ts +10 -0
  196. package/dist/lib/tracking/analytics/retention.js +10 -0
  197. package/dist/lib/tracking/analytics/retention.js.map +1 -0
  198. package/dist/lib/tracking/analytics/sessions.d.ts +20 -0
  199. package/dist/lib/tracking/analytics/sessions.js +26 -0
  200. package/dist/lib/tracking/analytics/sessions.js.map +1 -0
  201. package/dist/lib/tracking/core/activation.d.ts +23 -0
  202. package/dist/lib/tracking/core/activation.js +33 -0
  203. package/dist/lib/tracking/core/activation.js.map +1 -0
  204. package/dist/lib/tracking/core/experiment.d.ts +122 -0
  205. package/dist/lib/tracking/core/experiment.js +150 -0
  206. package/dist/lib/tracking/core/experiment.js.map +1 -0
  207. package/dist/lib/tracking/core/feature.d.ts +13 -0
  208. package/dist/lib/tracking/core/feature.js +14 -0
  209. package/dist/lib/tracking/core/feature.js.map +1 -0
  210. package/dist/lib/tracking/core/index.d.ts +4 -0
  211. package/dist/lib/tracking/core/index.js +5 -0
  212. package/dist/lib/tracking/core/index.js.map +1 -0
  213. package/dist/lib/tracking/core/prompt.d.ts +18 -0
  214. package/dist/lib/tracking/core/prompt.js +26 -0
  215. package/dist/lib/tracking/core/prompt.js.map +1 -0
  216. package/dist/lib/tracking/ecommerce/cart.d.ts +17 -0
  217. package/dist/lib/tracking/ecommerce/cart.js +22 -0
  218. package/dist/lib/tracking/ecommerce/cart.js.map +1 -0
  219. package/dist/lib/tracking/ecommerce/checkout.d.ts +17 -0
  220. package/dist/lib/tracking/ecommerce/checkout.js +22 -0
  221. package/dist/lib/tracking/ecommerce/checkout.js.map +1 -0
  222. package/dist/lib/tracking/ecommerce/index.d.ts +10 -0
  223. package/dist/lib/tracking/ecommerce/index.js +11 -0
  224. package/dist/lib/tracking/ecommerce/index.js.map +1 -0
  225. package/dist/lib/tracking/ecommerce/ltv.d.ts +15 -0
  226. package/dist/lib/tracking/ecommerce/ltv.js +14 -0
  227. package/dist/lib/tracking/ecommerce/ltv.js.map +1 -0
  228. package/dist/lib/tracking/ecommerce/products.d.ts +15 -0
  229. package/dist/lib/tracking/ecommerce/products.js +18 -0
  230. package/dist/lib/tracking/ecommerce/products.js.map +1 -0
  231. package/dist/lib/tracking/ecommerce/promotions.d.ts +14 -0
  232. package/dist/lib/tracking/ecommerce/promotions.js +25 -0
  233. package/dist/lib/tracking/ecommerce/promotions.js.map +1 -0
  234. package/dist/lib/tracking/ecommerce/purchases.d.ts +11 -0
  235. package/dist/lib/tracking/ecommerce/purchases.js +10 -0
  236. package/dist/lib/tracking/ecommerce/purchases.js.map +1 -0
  237. package/dist/lib/tracking/ecommerce/refunds.d.ts +17 -0
  238. package/dist/lib/tracking/ecommerce/refunds.js +22 -0
  239. package/dist/lib/tracking/ecommerce/refunds.js.map +1 -0
  240. package/dist/lib/tracking/ecommerce/search.d.ts +24 -0
  241. package/dist/lib/tracking/ecommerce/search.js +22 -0
  242. package/dist/lib/tracking/ecommerce/search.js.map +1 -0
  243. package/dist/lib/tracking/ecommerce/subscriptions.d.ts +21 -0
  244. package/dist/lib/tracking/ecommerce/subscriptions.js +38 -0
  245. package/dist/lib/tracking/ecommerce/subscriptions.js.map +1 -0
  246. package/dist/lib/tracking/ecommerce/wishlist.d.ts +19 -0
  247. package/dist/lib/tracking/ecommerce/wishlist.js +26 -0
  248. package/dist/lib/tracking/ecommerce/wishlist.js.map +1 -0
  249. package/dist/lib/tracking/enterprise/acquisition.d.ts +25 -0
  250. package/dist/lib/tracking/enterprise/acquisition.js +22 -0
  251. package/dist/lib/tracking/enterprise/acquisition.js.map +1 -0
  252. package/dist/lib/tracking/enterprise/alerts.d.ts +32 -0
  253. package/dist/lib/tracking/enterprise/alerts.js +30 -0
  254. package/dist/lib/tracking/enterprise/alerts.js.map +1 -0
  255. package/dist/lib/tracking/enterprise/churn.d.ts +23 -0
  256. package/dist/lib/tracking/enterprise/churn.js +22 -0
  257. package/dist/lib/tracking/enterprise/churn.js.map +1 -0
  258. package/dist/lib/tracking/enterprise/cohorts.d.ts +18 -0
  259. package/dist/lib/tracking/enterprise/cohorts.js +18 -0
  260. package/dist/lib/tracking/enterprise/cohorts.js.map +1 -0
  261. package/dist/lib/tracking/enterprise/engagement.d.ts +31 -0
  262. package/dist/lib/tracking/enterprise/engagement.js +44 -0
  263. package/dist/lib/tracking/enterprise/engagement.js.map +1 -0
  264. package/dist/lib/tracking/enterprise/forecasting.d.ts +18 -0
  265. package/dist/lib/tracking/enterprise/forecasting.js +22 -0
  266. package/dist/lib/tracking/enterprise/forecasting.js.map +1 -0
  267. package/dist/lib/tracking/enterprise/index.d.ts +11 -0
  268. package/dist/lib/tracking/enterprise/index.js +12 -0
  269. package/dist/lib/tracking/enterprise/index.js.map +1 -0
  270. package/dist/lib/tracking/enterprise/monetization.d.ts +14 -0
  271. package/dist/lib/tracking/enterprise/monetization.js +10 -0
  272. package/dist/lib/tracking/enterprise/monetization.js.map +1 -0
  273. package/dist/lib/tracking/enterprise/multi-path-funnels.d.ts +20 -0
  274. package/dist/lib/tracking/enterprise/multi-path-funnels.js +18 -0
  275. package/dist/lib/tracking/enterprise/multi-path-funnels.js.map +1 -0
  276. package/dist/lib/tracking/enterprise/paths.d.ts +20 -0
  277. package/dist/lib/tracking/enterprise/paths.js +18 -0
  278. package/dist/lib/tracking/enterprise/paths.js.map +1 -0
  279. package/dist/lib/tracking/enterprise/security.d.ts +28 -0
  280. package/dist/lib/tracking/enterprise/security.js +26 -0
  281. package/dist/lib/tracking/enterprise/security.js.map +1 -0
  282. package/dist/lib/tracking/enterprise/support.d.ts +25 -0
  283. package/dist/lib/tracking/enterprise/support.js +22 -0
  284. package/dist/lib/tracking/enterprise/support.js.map +1 -0
  285. package/dist/lib/tracking/index.d.ts +4 -0
  286. package/dist/lib/tracking/index.js +5 -0
  287. package/dist/lib/tracking/index.js.map +1 -0
  288. package/dist/lib/types/analytics.d.ts +10 -2
  289. package/dist/lib/types/analytics.js +6 -0
  290. package/dist/lib/types/analytics.js.map +1 -0
  291. package/dist/lib/types/common.js +6 -0
  292. package/dist/lib/types/common.js.map +1 -0
  293. package/dist/lib/types/ecommerce.js +6 -0
  294. package/dist/lib/types/ecommerce.js.map +1 -0
  295. package/dist/lib/types/index.js +8 -0
  296. package/dist/lib/types/index.js.map +1 -0
  297. package/dist/lib/utils/browser.d.ts +16 -0
  298. package/dist/lib/utils/browser.js +32 -0
  299. package/dist/lib/utils/browser.js.map +1 -0
  300. package/dist/lib/utils/identity.js +346 -0
  301. package/dist/lib/utils/identity.js.map +1 -0
  302. package/dist/lib/utils/storage.js +105 -0
  303. package/dist/lib/utils/storage.js.map +1 -0
  304. package/dist/umd/237.index.js +2 -0
  305. package/dist/umd/237.index.js.map +1 -0
  306. package/dist/umd/546.index.js +3 -0
  307. package/dist/umd/546.index.js.LICENSE.txt +14 -0
  308. package/dist/umd/546.index.js.map +1 -0
  309. package/dist/umd/index.js +2 -0
  310. package/dist/umd/index.js.map +1 -0
  311. package/package.json +27 -80
  312. package/dist/lib/features/ecommerce/inventory.d.ts +0 -219
@@ -0,0 +1,3 @@
1
+ /*! For license information please see 546.flowgrid.min.js.LICENSE.txt */
2
+ "use strict";(this.webpackChunkflowgrid=this.webpackChunkflowgrid||[]).push([[546],{546(e,t,n){n.r(t),n.d(t,{EventType:()=>pe,IncrementalSource:()=>me,MouseInteractions:()=>fe,PLUGIN_NAME:()=>eo,Replayer:()=>Fo,ReplayerEvents:()=>ye,addCustomEvent:()=>Jt,freezePage:()=>Xt,getRecordConsolePlugin:()=>to,getReplayConsolePlugin:()=>io,mirror:()=>Y,pack:()=>Gn,record:()=>ft,unpack:()=>Pn,utils:()=>o});var o={};n.r(o),n.d(o,{StyleSheetMirror:()=>he,_mirror:()=>Y,getBaseDimension:()=>ae,getNestedRule:()=>ce,getPositionsAndIndex:()=>de,getWindowHeight:()=>Q,getWindowWidth:()=>J,hasShadowRoot:()=>le,hookSetter:()=>z,isAncestorRemoved:()=>ee,isBlocked:()=>X,isIgnored:()=>$,isSerialized:()=>q,isSerializedIframe:()=>ie,isSerializedStylesheet:()=>se,isTouchEvent:()=>te,iterateResolveTree:()=>re,on:()=>Z,patch:()=>H,polyfill:()=>ne,queueToResolveTrees:()=>oe,throttle:()=>j,uniqueTextMutations:()=>ue});var r,i={};function s(e){return e.nodeType===e.ELEMENT_NODE}function a(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function l(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function c(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(d).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function d(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=c(e.styleSheet)||t}catch(e){}return t}n.r(i),n.d(i,{default:()=>so}),function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(r||(r={}));var u=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function h(){return new u}function p(e){var t=e.maskInputOptions,n=e.tagName,o=e.type,r=e.value,i=e.maskInputFn,s=r||"";return(t[n.toLowerCase()]||t[o])&&(s=i?i(s):"*".repeat(s.length)),s}var m,f,g="__rrweb_original__",y=1,v=new RegExp("[^a-z0-9-_:]");function C(){return y++}var I=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,b=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,S=/^(data:)([^,]*),(.*)/i;function w(e,t){return(e||"").replace(I,function(e,n,o,r,i,s){var a,l=o||i||s,c=n||r||"";if(!l)return e;if(!b.test(l))return"url(".concat(c).concat(l).concat(c,")");if(S.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var d=t.split("/"),u=l.split("/");d.pop();for(var h=0,p=u;h<p.length;h++){var m=p[h];"."!==m&&(".."===m?d.pop():d.push(m))}return"url(".concat(c).concat(d.join("/")).concat(c,")")})}var N=/^[^ \t\n\r\u000c]+/,A=/^[, \t\n\r\u000c]+/;function E(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function T(){var e=document.createElement("a");return e.href="",e.href}function M(e,t,n,o){return"src"===n||"href"===n&&o&&("use"!==t||"#"!==o[0])||"xlink:href"===n&&o&&"#"!==o[0]?E(e,o):"background"!==n||!o||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&o?function(e,t){if(""===t.trim())return t;var n=0;function o(e){var o,r=e.exec(t.substring(n));return r?(o=r[0],n+=o.length,o):""}for(var r=[];o(A),!(n>=t.length);){var i=o(N);if(","===i.slice(-1))i=E(e,i.substring(0,i.length-1)),r.push(i);else{var s="";i=E(e,i);for(var a=!1;;){var l=t.charAt(n);if(""===l){r.push((i+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,r.push((i+s).trim());break}"("===l&&(a=!0)}s+=l,n+=1}}}return r.join(", ")}(e,o):"style"===n&&o?w(o,T()):"object"===t&&"data"===n&&o?E(e,o):o:E(e,o)}function k(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&k(e.parentNode,t,n);for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&k(e.parentNode,t,n)}function R(e,t,n){var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(o.closest(".".concat(t)))return!0}else if(k(o,t,!0))return!0;if(n){if(o.matches(n))return!0;if(o.closest(n))return!0}return!1}function D(e){return void 0===e?"":e.toLowerCase()}function x(e,t){var n,o=t.doc,i=t.mirror,d=t.blockClass,u=t.blockSelector,h=t.maskTextClass,y=t.maskTextSelector,I=t.skipChild,b=void 0!==I&&I,S=t.inlineStylesheet,N=void 0===S||S,A=t.maskInputOptions,E=void 0===A?{}:A,k=t.maskTextFn,O=t.maskInputFn,L=t.slimDOMOptions,F=t.dataURLOptions,_=void 0===F?{}:F,B=t.inlineImages,W=void 0!==B&&B,U=t.recordCanvas,V=void 0!==U&&U,G=t.onSerialize,P=t.onIframeLoad,Z=t.iframeLoadTimeout,K=void 0===Z?5e3:Z,Y=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,z=void 0===j?5e3:j,H=t.keepIframeSrcFn,Q=void 0===H?function(){return!1}:H,J=t.newlyAddedElement,X=void 0!==J&&J,q=t.preserveWhiteSpace,$=void 0===q||q,ee=function(e,t){var n=t.doc,o=t.mirror,i=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,d=t.inlineStylesheet,u=t.maskInputOptions,h=void 0===u?{}:u,y=t.maskTextFn,C=t.maskInputFn,I=t.dataURLOptions,b=void 0===I?{}:I,S=t.inlineImages,N=t.recordCanvas,A=t.keepIframeSrcFn,E=t.newlyAddedElement,k=void 0!==E&&E,D=function(e,t){if(t.hasNode(e)){var n=t.getId(e);return 1===n?void 0:n}}(n,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:r.Document,childNodes:[],compatMode:e.compatMode}:{type:r.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:r.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:D};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,o=t.inlineStylesheet,i=t.maskInputOptions,s=void 0===i?{}:i,a=t.maskInputFn,l=t.dataURLOptions,d=void 0===l?{}:l,u=t.inlineImages,h=t.recordCanvas,y=t.keepIframeSrcFn,C=t.newlyAddedElement,I=void 0!==C&&C,b=t.rootId,S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&e.matches(n)}(e,t.blockClass,t.blockSelector),N=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return v.test(t)?"div":t}(e),A={},E=e.attributes.length,k=0;k<E;k++){var R=e.attributes[k];A[R.name]=M(n,N,R.name,R.value)}if("link"===N&&o){var D=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),x=null;D&&(x=c(D)),x&&(delete A.rel,delete A.href,A._cssText=w(x,D.href))}if("style"===N&&e.sheet&&!(e.innerText||e.textContent||"").trim().length&&(x=c(e.sheet))&&(A._cssText=w(x,T())),"input"===N||"textarea"===N||"select"===N){var O=e.value,L=e.checked;"radio"!==A.type&&"checkbox"!==A.type&&"submit"!==A.type&&"button"!==A.type&&O?A.value=p({type:A.type,tagName:N,value:O,maskInputOptions:s,maskInputFn:a}):L&&(A.checked=L)}if("option"===N&&(e.selected&&!s.select?A.selected=!0:delete A.selected),"canvas"===N&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var o=0;o<e.height;o+=50){var r=t.getImageData,i=g in r?r[g]:r;if(new Uint32Array(i.call(t,n,o,Math.min(50,e.width-n),Math.min(50,e.height-o)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(A.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var F=e.toDataURL(d.type,d.quality),_=document.createElement("canvas");_.width=e.width,_.height=e.height,F!==_.toDataURL(d.type,d.quality)&&(A.rr_dataURL=F)}if("img"===N&&u){m||(m=n.createElement("canvas"),f=m.getContext("2d"));var B=e,W=B.crossOrigin;B.crossOrigin="anonymous";var U=function(){try{m.width=B.naturalWidth,m.height=B.naturalHeight,f.drawImage(B,0,0),A.rr_dataURL=m.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(B.currentSrc,"! Error: ").concat(e))}W?A.crossOrigin=W:B.removeAttribute("crossorigin")};B.complete&&0!==B.naturalWidth?U():B.onload=U}if("audio"!==N&&"video"!==N||(A.rr_mediaState=e.paused?"paused":"played",A.rr_mediaCurrentTime=e.currentTime),I||(e.scrollLeft&&(A.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(A.rr_scrollTop=e.scrollTop)),S){var V=e.getBoundingClientRect(),G=V.width,P=V.height;A={class:A.class,rr_width:"".concat(G,"px"),rr_height:"".concat(P,"px")}}return"iframe"!==N||y(A.src)||(e.contentDocument||(A.rr_src=A.src),delete A.src),{type:r.Element,tagName:N,attributes:A,childNodes:[],isSVG:(Z=e,Boolean("svg"===Z.tagName||Z.ownerSVGElement)||void 0),needBlock:S,rootId:b};var Z}(e,{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:d,maskInputOptions:h,maskInputFn:C,dataURLOptions:b,inlineImages:S,recordCanvas:N,keepIframeSrcFn:A,newlyAddedElement:k,rootId:D});case e.TEXT_NODE:return function(e,t){var n,o,i=t.maskTextClass,s=t.maskTextSelector,a=t.maskTextFn,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,d=e.textContent,u="STYLE"===c||void 0,h="SCRIPT"===c||void 0;if(u&&d){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(d=(o=e.parentNode.sheet).cssRules?Array.from(o.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}d=w(d,T())}return h&&(d="SCRIPT_PLACEHOLDER"),!u&&!h&&d&&R(e,i,s)&&(d=a?a(d):d.replace(/[\S]/g,"*")),{type:r.Text,textContent:d||"",isStyle:u,rootId:l}}(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:y,rootId:D});case e.CDATA_SECTION_NODE:return{type:r.CDATA,textContent:"",rootId:D};case e.COMMENT_NODE:return{type:r.Comment,textContent:e.textContent||"",rootId:D};default:return!1}}(e,{doc:o,mirror:i,blockClass:d,blockSelector:u,maskTextClass:h,maskTextSelector:y,inlineStylesheet:N,maskInputOptions:E,maskTextFn:k,maskInputFn:O,dataURLOptions:_,inlineImages:W,recordCanvas:V,keepIframeSrcFn:Q,newlyAddedElement:X});if(!ee)return console.warn(e,"not serialized"),null;n=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===r.Comment)return!0;if(e.type===r.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(D(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===D(e.attributes.name)||"icon"===D(e.attributes.rel)||"apple-touch-icon"===D(e.attributes.rel)||"shortcut icon"===D(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&D(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(D(e.attributes.property).match(/^(og|twitter|fb):/)||D(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===D(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===D(e.attributes.name)||"googlebot"===D(e.attributes.name)||"bingbot"===D(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===D(e.attributes.name)||"generator"===D(e.attributes.name)||"framework"===D(e.attributes.name)||"publisher"===D(e.attributes.name)||"progid"===D(e.attributes.name)||D(e.attributes.property).match(/^article:/)||D(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===D(e.attributes.name)||"yandex-verification"===D(e.attributes.name)||"csrf-token"===D(e.attributes.name)||"p:domain_verify"===D(e.attributes.name)||"verify-v1"===D(e.attributes.name)||"verification"===D(e.attributes.name)||"shopify-checkout-api-token"===D(e.attributes.name)))return!0}}return!1}(ee,L)&&($||ee.type!==r.Text||ee.isStyle||ee.textContent.replace(/^\s+|\s+$/gm,"").length)?C():-2;var te=Object.assign(ee,{id:n});if(i.add(e,te),-2===n)return null;G&&G(e);var ne=!b;if(te.type===r.Element){ne=ne&&!te.needBlock,delete te.needBlock;var oe=e.shadowRoot;oe&&l(oe)&&(te.isShadowHost=!0)}if((te.type===r.Document||te.type===r.Element)&&ne){L.headWhitespace&&te.type===r.Element&&"head"===te.tagName&&($=!1);for(var re={doc:o,mirror:i,blockClass:d,blockSelector:u,maskTextClass:h,maskTextSelector:y,skipChild:b,inlineStylesheet:N,maskInputOptions:E,maskTextFn:k,maskInputFn:O,slimDOMOptions:L,dataURLOptions:_,inlineImages:W,recordCanvas:V,preserveWhiteSpace:$,onSerialize:G,onIframeLoad:P,iframeLoadTimeout:K,onStylesheetLoad:Y,stylesheetLoadTimeout:z,keepIframeSrcFn:Q},ie=0,se=Array.from(e.childNodes);ie<se.length;ie++)(ce=x(se[ie],re))&&te.childNodes.push(ce);if(s(e)&&e.shadowRoot)for(var ae=0,le=Array.from(e.shadowRoot.childNodes);ae<le.length;ae++){var ce;(ce=x(le[ae],re))&&(l(e.shadowRoot)&&(ce.isShadow=!0),te.childNodes.push(ce))}}return e.parentNode&&a(e.parentNode)&&l(e.parentNode)&&(te.isShadow=!0),te.type===r.Element&&"iframe"===te.tagName&&function(e,t,n){var o=e.contentWindow;if(o){var r,i=!1;try{r=o.document.readyState}catch(e){return}if("complete"===r){var s="about:blank";if(o.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(a),i=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&P){var n=x(t,{doc:t,mirror:i,blockClass:d,blockSelector:u,maskTextClass:h,maskTextSelector:y,skipChild:!1,inlineStylesheet:N,maskInputOptions:E,maskTextFn:k,maskInputFn:O,slimDOMOptions:L,dataURLOptions:_,inlineImages:W,recordCanvas:V,preserveWhiteSpace:$,onSerialize:G,onIframeLoad:P,iframeLoadTimeout:K,onStylesheetLoad:Y,stylesheetLoadTimeout:z,keepIframeSrcFn:Q});n&&P(e,n)}},K),te.type===r.Element&&"link"===te.tagName&&"stylesheet"===te.attributes.rel&&function(e,t,n){var o,r=!1;try{o=e.sheet}catch(e){return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}(e,function(){if(Y){var t=x(e,{doc:o,mirror:i,blockClass:d,blockSelector:u,maskTextClass:h,maskTextSelector:y,skipChild:!1,inlineStylesheet:N,maskInputOptions:E,maskTextFn:k,maskInputFn:O,slimDOMOptions:L,dataURLOptions:_,inlineImages:W,recordCanvas:V,preserveWhiteSpace:$,onSerialize:G,onIframeLoad:P,iframeLoadTimeout:K,onStylesheetLoad:Y,stylesheetLoadTimeout:z,keepIframeSrcFn:Q});t&&Y(e,t)}},z),te}var O=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function L(e,t){void 0===t&&(t={});var n=1,o=1;function r(e){var t=e.match(/\n/g);t&&(n+=t.length);var r=e.lastIndexOf("\n");o=-1===r?o+e.length:e.length-r}function i(){var e={line:n,column:o};return function(t){return t.position=new s(e),p(),t}}var s=function(e){this.start=e,this.end={line:n,column:o},this.source=t.source};s.prototype.content=e;var a=[];function l(r){var i=new Error("".concat(t.source||"",":").concat(n,":").concat(o,": ").concat(r));if(i.reason=r,i.filename=t.source,i.line=n,i.column=o,i.source=e,!t.silent)throw i;a.push(i)}function c(){return h(/^{\s*/)}function d(){return h(/^}/)}function u(){var t,n=[];for(p(),m(n);e.length&&"}"!==e.charAt(0)&&(t=A()||E());)!1!==t&&(n.push(t),m(n));return n}function h(t){var n=t.exec(e);if(n){var o=n[0];return r(o),e=e.slice(o.length),n}}function p(){h(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=f();)!1!==t&&e.push(t),t=f();return e}function f(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");var s=e.slice(2,n-2);return o+=2,r(s),e=e.slice(n),o+=2,t({type:"comment",comment:s})}}function g(){var e=h(/^([^{]+)/);if(e)return F(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function y(){var e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=F(t[0]);if(!h(/^:\s*/))return l("property missing ':'");var o=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),r=e({type:"declaration",property:n.replace(O,""),value:o?F(o[0]).replace(O,""):""});return h(/^[;\s]*/),r}}function v(){var e,t=[];if(!c())return l("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return d()?t:l("missing '}'")}function C(){for(var e,t=[],n=i();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}var I,b=N("import"),S=N("charset"),w=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=i(),o=h(t);if(o){var r={type:e};return r[e]=o[1].trim(),n(r)}}}function A(){if("@"===e[0])return function(){var e=i(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return l("@keyframes missing name");var o,r=t[1];if(!c())return l("@keyframes missing '{'");for(var s=m();o=C();)s.push(o),s=s.concat(m());return d()?e({type:"keyframes",name:r,vendor:n,keyframes:s}):l("@keyframes missing '}'")}}()||function(){var e=i(),t=h(/^@media *([^{]+)/);if(t){var n=F(t[1]);if(!c())return l("@media missing '{'");var o=m().concat(u());return d()?e({type:"media",media:n,rules:o}):l("@media missing '}'")}}()||function(){var e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:F(t[1]),media:F(t[2])})}()||function(){var e=i(),t=h(/^@supports *([^{]+)/);if(t){var n=F(t[1]);if(!c())return l("@supports missing '{'");var o=m().concat(u());return d()?e({type:"supports",supports:n,rules:o}):l("@supports missing '}'")}}()||b()||S()||w()||function(){var e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=F(t[1]),o=F(t[2]);if(!c())return l("@document missing '{'");var r=m().concat(u());return d()?e({type:"document",document:o,vendor:n,rules:r}):l("@document missing '}'")}}()||function(){var e=i();if(h(/^@page */)){var t=g()||[];if(!c())return l("@page missing '{'");for(var n,o=m();n=y();)o.push(n),o=o.concat(m());return d()?e({type:"page",selectors:t,declarations:o}):l("@page missing '}'")}}()||function(){var e=i();if(h(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=m().concat(u());return d()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=i();if(h(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,n=m();t=y();)n.push(t),n=n.concat(m());return d()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}}()}function E(){var e=i(),t=g();return t?(m(),e({type:"rule",selectors:t,declarations:v()})):l("selector missing")}return _((I=u(),{type:"stylesheet",stylesheet:{source:t.source,rules:I,parsingErrors:a}}))}function F(e){return e?e.replace(/^\s+|\s+$/g,""):""}function _(e,t){for(var n=e&&"string"==typeof e.type,o=n?e:t,r=0,i=Object.keys(e);r<i.length;r++){var s=e[i[r]];Array.isArray(s)?s.forEach(function(e){_(e,o)}):s&&"object"==typeof s&&_(s,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var B={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"},W=/([^\\]):hover/,U=new RegExp(W.source,"g");function V(e,t){var n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;var o=L(e,{silent:!0});if(!o.stylesheet)return e;var r=[];if(o.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){W.test(e)&&r.push(e)})}),0===r.length)return e;var i=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("|"),"g"),s=e.replace(i,function(e){var t=e.replace(U,"$1.\\:hover");return"".concat(e,", ").concat(t)});return null==t||t.stylesWithHoverClass.set(e,s),s}function G(){return{stylesWithHoverClass:new Map}}function P(e,t){var n=t.doc,o=t.mirror,i=t.skipChild,a=void 0!==i&&i,l=t.hackCss,c=void 0===l||l,d=t.afterAppend,u=t.cache,h=function(e,t){var n=t.doc,o=t.hackCss,i=t.cache;switch(e.type){case r.Document:return n.implementation.createDocument(null,"",null);case r.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case r.Element:var s,a=function(e){var t=B[e.tagName]?B[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);s=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",a):n.createElement(a);var l={};for(var c in e.attributes)if(Object.prototype.hasOwnProperty.call(e.attributes,c)){var d=e.attributes[c];if("option"!==a||"selected"!==c||!1!==d)if(!0===d&&(d=""),c.startsWith("rr_"))l[c]=d;else{var u="textarea"===a&&"value"===c,h="style"===a&&"_cssText"===c;if(h&&o&&"string"==typeof d&&(d=V(d,i)),!u&&!h||"string"!=typeof d)try{if(e.isSVG&&"xlink:href"===c)s.setAttributeNS("http://www.w3.org/1999/xlink",c,d.toString());else if("onload"===c||"onclick"===c||"onmouse"===c.substring(0,7))s.setAttribute("_"+c,d.toString());else{if("meta"===a&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===c){s.setAttribute("csp-content",d.toString());continue}"link"===a&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===a&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===a&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(c,d.toString()))}}catch(e){}else{for(var p=n.createTextNode(d),m=0,f=Array.from(s.childNodes);m<f.length;m++){var g=f[m];g.nodeType===s.TEXT_NODE&&s.removeChild(g)}s.appendChild(p)}}}var y=function(t){var n=l[t];if("canvas"===a&&"rr_dataURL"===t){var o=document.createElement("img");o.onload=function(){var e=s.getContext("2d");e&&e.drawImage(o,0,0,o.width,o.height)},o.src=n.toString(),s.RRNodeType&&(s.rr_dataURL=n.toString())}else if("img"===a&&"rr_dataURL"===t){var r=s;r.currentSrc.startsWith("data:")||(r.setAttribute("rrweb-original-src",e.attributes.src),r.src=n.toString())}if("rr_width"===t)s.style.width=n.toString();else if("rr_height"===t)s.style.height=n.toString();else if("rr_mediaCurrentTime"===t&&"number"==typeof n)s.currentTime=n;else if("rr_mediaState"===t)switch(n){case"played":s.play().catch(function(e){return console.warn("media playback error",e)});break;case"paused":s.pause()}};for(var v in l)y(v);if(e.isShadowHost)if(s.shadowRoot)for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);else s.attachShadow({mode:"open"});return s;case r.Text:return n.createTextNode(e.isStyle&&o?V(e.textContent,i):e.textContent);case r.CDATA:return n.createCDATASection(e.textContent);case r.Comment:return n.createComment(e.textContent);default:return null}}(e,{doc:n,hackCss:c,cache:u});if(!h)return null;if(e.rootId&&o.getNode(e.rootId)!==n&&o.replace(e.rootId,n),e.type===r.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==r.DocumentType&&(e.childNodes[0].type===r.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),h=n),o.add(h,e),(e.type===r.Document||e.type===r.Element)&&!a)for(var p=0,m=e.childNodes;p<m.length;p++){var f=m[p],g=P(f,{doc:n,mirror:o,skipChild:!1,hackCss:c,afterAppend:d,cache:u});g?(f.isShadow&&s(h)&&h.shadowRoot?h.shadowRoot.appendChild(g):h.appendChild(g),d&&d(g,f.id)):console.warn("Failed to rebuild",f)}return h}function Z(e,t,n=document){const o={capture:!0,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)}const K="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Y={map:{},getId:()=>(console.error(K),-1),getNode:()=>(console.error(K),null),removeNodeFromMap(){console.error(K)},has:()=>(console.error(K),!1),reset(){console.error(K)}};function j(e,t,n={}){let o=null,r=0;return function(...i){const s=Date.now();r||!1!==n.leading||(r=s);const a=t-(s-r),l=this;a<=0||a>t?(o&&(clearTimeout(o),o=null),r=s,e.apply(l,i)):o||!1===n.trailing||(o=setTimeout(()=>{r=!1===n.leading?0:Date.now(),o=null,e.apply(l,i)},a))}}function z(e,t,n,o,r=window){const i=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>z(e,t,i||{},!0)}function H(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch(e){return()=>{}}}function Q(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function J(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function X(e,t,n,o){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(o&&null!==r.closest("."+t))return!0}else if(k(r,t,o))return!0;if(n){if(e.matches(n))return!0;if(o&&null!==r.closest(n))return!0}return!1}function q(e,t){return-1!==t.getId(e)}function $(e,t){return-2===t.getId(e)}function ee(e,t){if(a(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ee(e.parentNode,t))}function te(e){return Boolean(e.changedTouches)}function ne(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}function oe(e){const t={},n=(e,n)=>{const o={value:e,parent:n,children:[]};return t[e.node.id]=o,o},o=[];for(const r of e){const{nextId:e,parentId:i}=r;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,n(r,i.parent))}else{const e=o.indexOf(i);o.splice(e,0,n(r,null))}continue}if(i in t){const e=t[i];e.children.push(n(r,e));continue}o.push(n(r,null))}return o}function re(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)re(e.children[n],t)}function ie(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function se(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ae(e,t){var n,o;const r=null===(o=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.frameElement;if(!r||r===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=r.getBoundingClientRect(),s=ae(r,t),a=i.height/r.clientHeight;return{x:i.x*s.relativeScale+s.x,y:i.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function le(e){return Boolean(null==e?void 0:e.shadowRoot)}function ce(e,t){const n=e[t[0]];return 1===t.length?n:ce(n.cssRules[t[1]].cssRules,t.slice(2))}function de(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function ue(e){const t=new Set,n=[];for(let o=e.length;o--;){const r=e[o];t.has(r.id)||(n.push(r),t.add(r.id))}return n}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Y=new Proxy(Y,{get:(e,t,n)=>("map"===t&&console.error(K),Reflect.get(e,t,n))}));class he{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var pe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(pe||{}),me=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(me||{}),fe=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(fe||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),ye=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(ye||{});function ve(e){return"__ln"in e}class Ce{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ve(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ve(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Ie=(e,t)=>`${e}@${t}`;class be{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Ce,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{var r,i,s,l;let c=null;(null===(i=null===(r=o.getRootNode)||void 0===r?void 0:r.call(o))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(c=o.getRootNode().host);let d=c;for(;(null===(l=null===(s=null==d?void 0:d.getRootNode)||void 0===s?void 0:s.call(d))||void 0===l?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&d.getRootNode().host;)d=d.getRootNode().host;const u=!(this.doc.contains(o)||d&&this.doc.contains(d));if(!o.parentNode||u)return;const h=a(o.parentNode)?this.mirror.getId(c):this.mirror.getId(o.parentNode),p=n(o);if(-1===h||-1===p)return t.addNode(o);const m=x(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{ie(e,this.mirror)&&this.iframeManager.addIframe(e),se(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),le(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});m&&e.push({parentId:h,nextId:p,node:m})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))we(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of Array.from(this.addedSet.values()))Ae(this.droppedSet,e)||we(this.removes,e,this.mirror)?Ae(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let r=null;for(;t.length;){let e=null;if(r){const t=this.mirror.getId(r.value.parentNode),o=n(r.value);-1!==t&&-1!==o&&(e=r)}if(!e)for(let o=t.length-1;o>=0;o--){const r=t.get(o);if(r){const t=this.mirror.getId(r.value.parentNode);if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=r;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}r=e.previous,t.removeNode(e.value),o(e.value)}const i={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!$(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;X(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:R(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=p({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),X(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==o.attributes.style&&null!==o.attributes.style||(o.attributes.style={});const r=o.attributes.style;for(const e of Array.from(t.style)){const o=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);o===n.style.getPropertyValue(e)&&i===n.style.getPropertyPriority(e)||(r[e]=""===i?o:[o,i])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r[e]=!1)}else o.attributes[e.attributeName]=M(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(X(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),o=a(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||$(t,this.mirror)||!q(t,this.mirror)||(this.addedSet.has(t)?(Se(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||ee(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ie(n,o)]?Se(this.movedSet,t):this.removes.push({parentId:o,id:n,isShadow:!(!a(e.target)||!l(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if($(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ie(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Se(e,t){e.delete(t),t.childNodes.forEach(t=>Se(e,t))}function we(e,t,n){return 0!==e.length&&Ne(e,t,n)}function Ne(e,t,n){const{parentNode:o}=t;if(!o)return!1;const r=n.getId(o);return!!e.some(e=>e.id===r)||Ne(e,o,n)}function Ae(e,t){return 0!==e.size&&Ee(e,t)}function Ee(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Ee(e,n))}const Te=[],Me="undefined"!=typeof CSSGroupingRule,ke="undefined"!=typeof CSSMediaRule,Re="undefined"!=typeof CSSSupportsRule,De="undefined"!=typeof CSSConditionRule;function xe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Oe(e,t){var n,o;const r=new be;Te.push(r),r.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null===(o=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===o?void 0:o.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(r.processMutations.bind(r));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Le({scrollCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:i}){return Z("scroll",j(i=>{const s=xe(i);if(!s||X(s,o,r,!0))return;const a=n.getId(s);if(s===t){const n=t.scrollingElement||t.documentElement;e({id:a,x:n.scrollLeft,y:n.scrollTop})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})},i.scroll||100),t)}function Fe(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const _e=["INPUT","TEXTAREA","SELECT"],Be=new WeakMap;function We(e){return function(e,t){if(Me&&e.parentRule instanceof CSSGroupingRule||ke&&e.parentRule instanceof CSSMediaRule||Re&&e.parentRule instanceof CSSSupportsRule||De&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ue(e,t,n){let o,r;return e?(e.ownerNode?o=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:o}):{}}function Ve({mirror:e,stylesheetManager:t},n){var o,r,i;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(o=n.defaultView)||void 0===o?void 0:o.Document:null===(i=null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===i?void 0:i.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&a&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var n;const o=null===(n=l.set)||void 0===n?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return o}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function Ge(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:o,mouseInteractionCb:r,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),o(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),r(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const o=Oe(e,e.doc),r=function({mousemoveCb:e,sampling:t,doc:n,mirror:o}){if(!1===t.mousemove)return()=>{};const r="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const l=j(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null},i),c=j(e=>{const t=xe(e),{clientX:n,clientY:r}=te(e)?e.changedTouches[0]:e;s||(s=Date.now()),a.push({x:n,y:r,id:o.getId(t),timeOffset:Date.now()-s}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?me.Drag:e instanceof MouseEvent?me.MouseMove:me.TouchMove)},r,{trailing:!1}),d=[Z("mousemove",c,n),Z("touchmove",c,n),Z("drag",c,n)];return()=>{d.forEach(e=>e())}}(e),i=function({mouseInteractionCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];return Object.keys(fe).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(i=>{const s=i.toLowerCase(),l=(t=>i=>{const s=xe(i);if(X(s,o,r,!0))return;const a=te(i)?i.changedTouches[0]:i;if(!a)return;const l=n.getId(s),{clientX:c,clientY:d}=a;e({type:fe[t],id:l,x:c,y:d})})(i);a.push(Z(s,l,t))}),()=>{a.forEach(e=>e())}}(e),s=Le(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return Z("resize",j(()=>{const o=Q(),r=J();t===o&&n===r||(e({width:Number(r),height:Number(o)}),t=o,n=r)},200),window)}(e),l=function({inputCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,ignoreClass:i,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function d(e){let n=xe(e);const l=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||_e.indexOf(n.tagName)<0||X(n,o,r,!0))return;const d=n.type;if(n.classList.contains(i))return;let h=n.value,m=!1;"radio"===d||"checkbox"===d?m=n.checked:(s[n.tagName.toLowerCase()]||s[d])&&(h=p({maskInputOptions:s,tagName:n.tagName,type:d,value:h,maskInputFn:a})),u(n,Fe({text:h,isChecked:m,userTriggered:l},c));const f=n.name;"radio"===d&&f&&m&&t.querySelectorAll(`input[type="radio"][name="${f}"]`).forEach(e=>{e!==n&&u(e,Fe({text:e.value,isChecked:!m,userTriggered:!1},c))})}function u(t,o){const r=Be.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){Be.set(t,o);const r=n.getId(t);e(Object.assign(Object.assign({},o),{id:r}))}}const h=("last"===l.input?["change"]:["input","change"]).map(e=>Z(e,d,t)),m=t.defaultView;if(!m)return()=>{h.forEach(e=>e())};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),g=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&h.push(...g.map(e=>z(e[0],e[1],{set(){d({target:this})}},!1,m))),()=>{h.forEach(e=>e())}}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:o,sampling:r}){const i=i=>j(r=>{const s=xe(r);if(!s||X(s,t,n,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:d}=s;e({type:i,id:o.getId(s),currentTime:a,volume:l,muted:c,playbackRate:d})},r.media||500),s=[Z("play",i(0)),Z("pause",i(1)),Z("seeked",i(2)),Z("volumechange",i(3)),Z("ratechange",i(4))];return()=>{s.forEach(e=>e())}}(e),d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:o}){const r=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=function(o,i){const{id:s,styleId:a}=Ue(this,t,n.styleMirror);return(s&&-1!==s||a&&-1!==a)&&e({id:s,styleId:a,adds:[{rule:o,index:i}]}),r.apply(this,[o,i])};const i=o.CSSStyleSheet.prototype.deleteRule;let s,a;o.CSSStyleSheet.prototype.deleteRule=function(o){const{id:r,styleId:s}=Ue(this,t,n.styleMirror);return(r&&-1!==r||s&&-1!==s)&&e({id:r,styleId:s,removes:[{index:o}]}),i.apply(this,[o])},o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=function(o){const{id:r,styleId:i}=Ue(this,t,n.styleMirror);return(r&&-1!==r||i&&-1!==i)&&e({id:r,styleId:i,replace:o}),s.apply(this,[o])}),o.CSSStyleSheet.prototype.replaceSync&&(a=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=function(o){const{id:r,styleId:i}=Ue(this,t,n.styleMirror);return(r&&-1!==r||i&&-1!==i)&&e({id:r,styleId:i,replaceSync:o}),a.apply(this,[o])});const l={};Me?l.CSSGroupingRule=o.CSSGroupingRule:(ke&&(l.CSSMediaRule=o.CSSMediaRule),De&&(l.CSSConditionRule=o.CSSConditionRule),Re&&(l.CSSSupportsRule=o.CSSSupportsRule));const c={};return Object.entries(l).forEach(([o,r])=>{c[o]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=function(r,i){const{id:s,styleId:a}=Ue(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||a&&-1!==a)&&e({id:s,styleId:a,adds:[{rule:r,index:[...We(this),i||0]}]}),c[o].insertRule.apply(this,[r,i])},r.prototype.deleteRule=function(r){const{id:i,styleId:s}=Ue(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||s&&-1!==s)&&e({id:i,styleId:s,removes:[{index:[...We(this),r]}]}),c[o].deleteRule.apply(this,[r])}}),()=>{o.CSSStyleSheet.prototype.insertRule=r,o.CSSStyleSheet.prototype.deleteRule=i,s&&(o.CSSStyleSheet.prototype.replace=s),a&&(o.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})}}(e,{win:n}),u=Ve(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:o},{win:r}){const i=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(r,s,a){var l;if(n.has(r))return i.apply(this,[r,s,a]);const{id:c,styleId:d}=Ue(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,o.styleMirror);return(c&&-1!==c||d&&-1!==d)&&e({id:c,styleId:d,set:{property:r,value:s,priority:a},index:We(this.parentRule)}),i.apply(this,[r,s,a])};const s=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(r){var i;if(n.has(r))return s.apply(this,[r]);const{id:a,styleId:l}=Ue(null===(i=this.parentRule)||void 0===i?void 0:i.parentStyleSheet,t,o.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,remove:{property:r},index:We(this.parentRule)}),s.apply(this,[r])},()=>{r.CSSStyleDeclaration.prototype.setProperty=i,r.CSSStyleDeclaration.prototype.removeProperty=s}}(e,{win:n}),m=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const o=[],r=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const o=new i(e,t,n);return r.set(o,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),o};const s=H(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=r.get(n);t&&(e(t),r.delete(n))},0),t.apply(this,[n])}});return o.push(()=>{n.FontFace=i}),o.push(s),()=>{o.forEach(e=>e())}}(e):()=>{},f=function(e){const{doc:t,mirror:n,blockClass:o,blockSelector:r,selectionCb:i}=e;let s=!0;const a=()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:l,endContainer:c,endOffset:d}=i;X(s,o,r,!0)||X(c,o,r,!0)||a.push({start:n.getId(s),startOffset:l,end:n.getId(c),endOffset:d})}i({ranges:a})};return a(),Z("selectionchange",a)}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return()=>{Te.forEach(e=>e.reset()),o.disconnect(),r(),i(),s(),a(),l(),c(),d(),u(),h(),m(),f(),g.forEach(e=>e())}}class Pe{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,o){const r=n||this.getIdToRemoteIdMap(e),i=o||this.getRemoteIdToIdMap(e);let s=r.get(t);return s||(s=this.generateIdFn(),r.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,o))}getRemoteId(e,t,n){const o=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;return o.get(t)||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Ze{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Pe(C),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Pe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case pe.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:pe.IncrementalSnapshot,data:{source:me.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case pe.Meta:case pe.Load:case pe.DomContentLoaded:return!1;case pe.Plugin:return t;case pe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case pe.IncrementalSnapshot:switch(t.data.source){case me.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case me.Drag:case me.TouchMove:case me.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case me.ViewportResize:return!1;case me.MediaInteraction:case me.MouseInteraction:case me.Scroll:case me.CanvasMutation:case me.Input:return this.replaceIds(t.data,e,["id"]),t;case me.StyleSheetRule:case me.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case me.Font:return t;case me.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case me.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,o){for(const r of o)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class Ke{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(H(Element.prototype,"attachShadow",function(e){return function(n){const o=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(e,t){l(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),Oe(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Le(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),Ve({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(H(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const r=n.call(this,o);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}function Ye(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((o=o.apply(e,t||[])).next())})}for(var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ze="undefined"==typeof Uint8Array?[]:new Uint8Array(256),He=0;He<64;He++)ze[je.charCodeAt(He)]=He;const Qe=new Map,Je=(e,t,n)=>{if(!e||!$e(e,t)&&"object"!=typeof e)return;const o=function(e,t){let n=Qe.get(e);return n||(n=new Map,Qe.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=o.indexOf(e);return-1===r&&(r=o.length,o.push(e)),r};function Xe(e,t,n){if(e instanceof Array)return e.map(e=>Xe(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),o=n.length,r="";for(t=0;t<o;t+=3)r+=je[n[t]>>2],r+=je[(3&n[t])<<4|n[t+1]>>4],r+=je[(15&n[t+1])<<2|n[t+2]>>6],r+=je[63&n[t+2]];return o%3==2?r=r.substring(0,r.length-1)+"=":o%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e);return{rr_type:t,base64:n}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Xe(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Xe(e.data,t,n),e.width,e.height]}:$e(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:Je(e,t,n)}:e}const qe=(e,t,n)=>[...e].map(e=>Xe(e,t,n)),$e=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function et(e,t,n){const o=[];try{const r=H(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(o,...r){return X(this,t,n,!0)||"__context"in this||(this.__context=o),e.apply(this,[o,...r])}});o.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(e=>e())}}function tt(e,t,n,o,r,i,s){const a=[],l=Object.getOwnPropertyNames(e);for(const i of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const l=H(e,i,function(e){return function(...a){const l=e.apply(this,a);if(Je(l,s,this),!X(this.canvas,o,r,!0)){const e=qe([...a],s,this),o={type:t,property:i,args:e};n(this.canvas,o)}return l}});a.push(l)}catch(o){const r=z(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});a.push(r)}return a}var nt=null;try{var ot="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof require&&require("worker_threads")||"function"==typeof require&&require("worker_threads");nt=ot.Worker}catch(po){}var rt,it,st=(rt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",it=!1,"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?function(e,t,n){var o=void 0===t?null:t,r=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),i=r.indexOf("\n",10)+1,s=r.substring(i)+(o?"//# sourceMappingURL="+o:"");return function(e){return new nt(s,Object.assign({},e,{eval:!0}))}}(rt,null,it):function(e){var t;return function(n){return t=t||function(e,t,n){var o=void 0===t?null:t,r=function(e,t){var n=atob(e);if(t){for(var o=new Uint8Array(n.length),r=0,i=n.length;r<i;++r)o[r]=n.charCodeAt(r);return String.fromCharCode.apply(null,new Uint16Array(o.buffer))}return n}(e,void 0!==n&&n),i=r.indexOf("\n",10)+1,s=r.substring(i)+(o?"//# sourceMappingURL="+o:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}(e,null,false),new Worker(t,n)}}(rt));class at{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:o,blockSelector:r,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,o,r),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,o,r,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,o,r){const i=et(t,n,o),s=new Map,a=new st;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:o,width:r,height:i}=e.data;this.mutationCb({id:t,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,r,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})};const l=1e3/e;let c,d=0;const u=e=>{d&&e-d<l||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{X(t,n,o,!0)||e.push(t)}),e})().forEach(e=>Ye(this,void 0,void 0,function*(){var t;const n=this.mirror.getId(e);if(s.get(n))return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const o=yield createImageBitmap(e);a.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[o])}))),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{i(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=et(e,t,n),r=function(e,t,n,o){const r=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=H(t.CanvasRenderingContext2D.prototype,s,function(r){return function(...i){return X(this.canvas,n,o,!0)||setTimeout(()=>{const n=qe([...i],t,this);e(this.canvas,{type:ge["2D"],property:s,args:n})},0),r.apply(this,i)}});r.push(i)}catch(n){const o=z(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:ge["2D"],property:s,args:[t],setter:!0})}});r.push(o)}return()=>{r.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,o){const r=[];return r.push(...tt(t.WebGLRenderingContext.prototype,ge.WebGL,e,n,o,0,t)),void 0!==t.WebGL2RenderingContext&&r.push(...tt(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,n,o,0,t)),()=>{r.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{o(),r(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const o=n.map(e=>{const t=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["type"]);return t}),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:o}),this.pendingCanvasMutations.delete(e)}}class lt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},o=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);o.push({styleId:e,rules:n.map((e,t)=>({rule:d(e),index:t}))})}n.styleIds.push(e)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function ct(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let dt,ut,ht,pt=!1;const mt=h();function ft(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:o,blockClass:r="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:p,maskInputFn:m,maskTextFn:f,hooks:g,packFn:y,sampling:v={},dataURLOptions:C={},mousemoveWait:I,recordCanvas:b=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:w=!1,collectFonts:N=!1,inlineImages:A=!1,plugins:E,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:M=new Set([])}=e,k=!S||window.parent===window;let R=!1;if(!k)try{window.parent.document,R=!1}catch(e){R=!0}if(k&&!t)throw new Error("emit function is required");void 0!==I&&void 0===v.mousemove&&(v.mousemove=I),mt.reset();const D=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},O=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let L;ne();let F=0;const _=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&(e=y(e)),e};dt=(e,r)=>{var i;if(!(null===(i=Te[0])||void 0===i?void 0:i.isFrozen())||e.type===pe.FullSnapshot||e.type===pe.IncrementalSnapshot&&e.data.source===me.Mutation||Te.forEach(e=>e.unfreeze()),k)null==t||t(_(e),r);else if(R){const t={type:"rrweb",event:_(e),isCheckout:r};window.parent.postMessage(t,"*")}if(e.type===pe.FullSnapshot)L=e,F=0;else if(e.type===pe.IncrementalSnapshot){if(e.data.source===me.Mutation&&e.data.isAttachIframe)return;F++;const t=o&&F>=o,r=n&&e.timestamp-L.timestamp>n;(t||r)&&ut(!0)}};const B=e=>{dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.Mutation},e)}))},W=e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.Scroll},e)})),U=e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.CanvasMutation},e)})),V=new lt({mutationCb:B,adoptedStyleSheetCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.AdoptedStyleSheet},e)}))}),G=new Ze({mirror:mt,mutationCb:B,stylesheetManager:V,recordCrossOriginIframes:S,wrappedEmit:dt});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:mt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});ht=new at({recordCanvas:b,mutationCb:U,win:window,blockClass:r,blockSelector:i,mirror:mt,sampling:v.canvas,dataURLOptions:C});const P=new Ke({mutationCb:B,scrollCb:W,bypassOptions:{blockClass:r,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:C,maskTextFn:f,maskInputFn:m,recordCanvas:b,inlineImages:A,sampling:v,slimDOMOptions:O,iframeManager:G,stylesheetManager:V,canvasManager:ht,keepIframeSrcFn:T},mirror:mt});ut=(e=!1)=>{var t,n,o,s,d,h;dt(ct({type:pe.Meta,data:{href:window.location.href,width:J(),height:Q()}}),e),V.reset(),Te.forEach(e=>e.lock());const p=function(e,t){var n=t||{},o=n.mirror,r=void 0===o?new u:o,i=n.blockClass,s=n.blockSelector,a=n.maskTextClass,l=n.maskTextSelector,c=n.inlineStylesheet,d=n.inlineImages,h=n.recordCanvas,p=n.maskAllInputs,m=void 0!==p&&p,f=n.slimDOM,g=void 0!==f&&f,y=n.keepIframeSrcFn;return x(e,{doc:e,mirror:r,blockClass:void 0===i?"rr-block":i,blockSelector:void 0===s?null:s,maskTextClass:void 0===a?"rr-mask":a,maskTextSelector:void 0===l?null:l,skipChild:!1,inlineStylesheet:void 0===c||c,maskInputOptions:!0===m?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===m?{password:!0}:m,maskTextFn:n.maskTextFn,maskInputFn:n.maskInputFn,slimDOMOptions:!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===g,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===g?{}:g,dataURLOptions:n.dataURLOptions,inlineImages:void 0!==d&&d,recordCanvas:void 0!==h&&h,preserveWhiteSpace:n.preserveWhiteSpace,onSerialize:n.onSerialize,onIframeLoad:n.onIframeLoad,iframeLoadTimeout:n.iframeLoadTimeout,onStylesheetLoad:n.onStylesheetLoad,stylesheetLoadTimeout:n.stylesheetLoadTimeout,keepIframeSrcFn:void 0===y?function(){return!1}:y,newlyAddedElement:!1})}(document,{mirror:mt,blockClass:r,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:D,maskTextFn:f,slimDOM:O,dataURLOptions:C,recordCanvas:b,inlineImages:A,onSerialize:e=>{ie(e,mt)&&G.addIframe(e),se(e,mt)&&V.trackLinkElement(e),le(e)&&P.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),P.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!p)return console.warn("Failed to snapshot the document");dt(ct({type:pe.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(d=null===(s=null===document||void 0===document?void 0:document.body)||void 0===s?void 0:s.parentElement)||void 0===d?void 0:d.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),Te.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,mt.getId(document))};try{const e=[];e.push(Z("DOMContentLoaded",()=>{dt(ct({type:pe.DomContentLoaded,data:{}}))}));const t=e=>{var t;return Ge({mutationCb:B,mousemoveCb:(e,t)=>dt(ct({type:pe.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.MouseInteraction},e)})),scrollCb:W,viewportResizeCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.ViewportResize},e)})),inputCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.Input},e)})),mediaInteractionCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.MediaInteraction},e)})),styleSheetRuleCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.StyleSheetRule},e)})),styleDeclarationCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.StyleDeclaration},e)})),canvasMutationCb:U,fontCb:e=>dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.Font},e)})),selectionCb:e=>{dt(ct({type:pe.IncrementalSnapshot,data:Object.assign({source:me.Selection},e)}))},blockClass:r,ignoreClass:s,maskTextClass:a,maskTextSelector:l,maskInputOptions:D,inlineStylesheet:c,sampling:v,recordCanvas:b,inlineImages:A,userTriggeredOnInput:w,collectFonts:N,doc:e,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:O,dataURLOptions:C,mirror:mt,iframeManager:G,stylesheetManager:V,shadowDomManager:P,canvasManager:ht,ignoreCSSAttributes:M,plugins:(null===(t=null==E?void 0:E.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>dt(ct({type:pe.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},g)};G.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{ut(),e.push(t(document)),pt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(Z("load",()=>{dt(ct({type:pe.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),pt=!1}}catch(e){console.warn(e)}}var gt;ft.addCustomEvent=(e,t)=>{if(!pt)throw new Error("please add custom event after start recording");dt(ct({type:pe.Custom,data:{tag:e,payload:t}}))},ft.freezePage=()=>{Te.forEach(e=>e.freeze())},ft.takeFullSnapshot=e=>{if(!pt)throw new Error("please take full snapshot after start recording");ut(e)},ft.mirror=mt,function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(gt||(gt={}));var yt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function vt(e){const t=[];for(const n in e){const o=e[n];if("string"!=typeof o)continue;const r=wt(n);t.push(`${r}: ${o};`)}return t.join(" ")}const Ct=/-([a-z])/g,It=/^--[a-zA-Z0-9-]+$/,bt=e=>It.test(e)?e:e.replace(Ct,(e,t)=>t?t.toUpperCase():""),St=/\B([A-Z])/g,wt=e=>e.replace(St,"-$1").toLowerCase();class Nt{constructor(...e){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=Dt.ELEMENT_NODE,this.TEXT_NODE=Dt.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const e=this.parentNode;if(!e)return null;const t=e.childNodes,n=t.indexOf(this);return t[n+1]||null}contains(e){if(e===this)return!0;for(const t of this.childNodes)if(t.contains(e))return!0;return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function At(e){return class extends e{constructor(e,t,n){super(),this.nodeType=Dt.DOCUMENT_TYPE_NODE,this.RRNodeType=gt.DocumentType,this.textContent=null,this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e}toString(){return"RRDocumentType"}}}function Et(e){return class extends e{constructor(e){super(),this.nodeType=Dt.ELEMENT_NODE,this.RRNodeType=gt.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.childNodes=[this.ownerDocument.createTextNode(e)]}get classList(){return new Rt(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},n=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach(function(e){if(e){const o=e.split(n);o.length>1&&(t[bt(o[0].trim())]=o[1].trim())}}),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,o,r)=>{if(t.test(n))return;const i=bt(n);o?e[i]=o:delete e[i],"important"===r&&(e[i]+=" !important"),this.attributes.style=vt(e)},e.removeProperty=n=>{if(t.test(n))return"";const o=bt(n),r=e[o]||"";return delete e[o],this.attributes.style=vt(e),r},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return this.childNodes.push(e),e.parentNode=this,e.parentElement=this,e}insertBefore(e,t){if(null===t)return this.appendChild(e);const n=this.childNodes.indexOf(t);if(-1==n)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,e),e.parentElement=this,e.parentNode=this,e}removeChild(e){const t=this.childNodes.indexOf(e);if(-1===t)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(t,1),e.parentElement=null,e.parentNode=null,e}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}}function Tt(e){return class extends e{constructor(e){super(),this.nodeType=Dt.TEXT_NODE,this.nodeName="#text",this.RRNodeType=gt.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Mt(e){return class extends e{constructor(e){super(),this.nodeType=Dt.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=gt.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function kt(e){return class extends e{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=Dt.CDATA_SECTION_NODE,this.RRNodeType=gt.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Rt{constructor(e,t){if(this.classes=[],this.add=(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...e)=>{this.classes=this.classes.filter(t=>-1===e.indexOf(t)),this.onChange&&this.onChange(this.classes.join(" "))},e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}var Dt;!function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Dt||(Dt={}));const xt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Ot={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Lt(e,t,n,o){const r=e.childNodes,i=t.childNodes;o=o||t.mirror||t.ownerDocument.mirror,(r.length>0||i.length>0)&&Ft(Array.from(r),i,e,n,o);let s=null,a=null;switch(t.RRNodeType){case gt.Document:a=t.scrollData;break;case gt.Element:{const r=e,i=t;switch(function(e,t,n){const o=e.attributes,r=t.attributes;for(const o in r){const i=r[o],s=n.getMeta(t);if(s&&"isSVG"in s&&s.isSVG&&xt[o])e.setAttributeNS(xt[o],o,i);else if("CANVAS"===t.tagName&&"rr_dataURL"===o){const t=document.createElement("img");t.src=i,t.onload=()=>{const n=e.getContext("2d");n&&n.drawImage(t,0,0,t.width,t.height)}}else e.setAttribute(o,i)}for(const{name:t}of Array.from(o))t in r||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(r,i,o),a=i.scrollData,s=i.inputData,i.tagName){case"AUDIO":case"VIDEO":{const t=e,n=i;void 0!==n.paused&&(n.paused?t.pause():t.play()),void 0!==n.muted&&(t.muted=n.muted),void 0!==n.volume&&(t.volume=n.volume),void 0!==n.currentTime&&(t.currentTime=n.currentTime),void 0!==n.playbackRate&&(t.playbackRate=n.playbackRate);break}case"CANVAS":{const o=t;if(null!==o.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=r.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.rr_dataURL}o.canvasMutations.forEach(t=>n.applyCanvas(t.event,t.mutation,e))}break;case"STYLE":{const e=r.sheet;e&&t.rules.forEach(t=>n.applyStyleSheetMutation(t,e))}}if(i.shadowRoot){r.shadowRoot||r.attachShadow({mode:"open"});const e=r.shadowRoot.childNodes,t=i.shadowRoot.childNodes;(e.length>0||t.length>0)&&Ft(Array.from(e),t,r.shadowRoot,n,o)}break}case gt.Text:case gt.Comment:case gt.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}if(a&&n.applyScroll(a,!0),s&&n.applyInput(s),"IFRAME"===t.nodeName){const r=e.contentDocument,i=t;if(r){const e=o.getMeta(i.contentDocument);e&&n.mirror.add(r,Object.assign({},e)),Lt(r,i.contentDocument,n,o)}}}function Ft(e,t,n,o,r){var i;let s,a,l=0,c=e.length-1,d=0,u=t.length-1,h=e[l],p=e[c],m=t[d],f=t[u];for(;l<=c&&d<=u;){const g=o.mirror.getId(h),y=o.mirror.getId(p),v=r.getId(m),C=r.getId(f);if(void 0===h)h=e[++l];else if(void 0===p)p=e[--c];else if(-1!==g&&g===v)Lt(h,m,o,r),h=e[++l],m=t[++d];else if(-1!==y&&y===C)Lt(p,f,o,r),p=e[--c],f=t[--u];else if(-1!==g&&g===C)n.insertBefore(h,p.nextSibling),Lt(h,f,o,r),h=e[++l],f=t[--u];else if(-1!==y&&y===v)n.insertBefore(p,h),Lt(p,m,o,r),p=e[--c],m=t[++d];else{if(!s){s={};for(let t=l;t<=c;t++){const n=e[t];n&&o.mirror.hasNode(n)&&(s[o.mirror.getId(n)]=t)}}if(a=s[r.getId(m)],a){const t=e[a];n.insertBefore(t,h),Lt(t,m,o,r),e[a]=void 0}else{const t=_t(m,o.mirror,r);"#document"===n.nodeName&&(null===(i=o.mirror.getMeta(t))||void 0===i?void 0:i.type)===gt.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[l]=void 0,h=void 0),n.insertBefore(t,h||null),Lt(t,m,o,r)}m=t[++d]}}if(l>c){const e=t[u+1];let i=null;for(e&&n.childNodes.forEach(t=>{o.mirror.getId(t)===r.getId(e)&&(i=t)});d<=u;++d){const e=_t(t[d],o.mirror,r);n.insertBefore(e,i),Lt(e,t[d],o,r)}}else if(d>u)for(;l<=c;l++){const t=e[l];t&&(n.removeChild(t),o.mirror.removeNodeFromMap(t))}}function _t(e,t,n){const o=n.getId(e),r=n.getMeta(e);let i=null;if(o>-1&&(i=t.getNode(o)),null!==i)return i;switch(e.RRNodeType){case gt.Document:i=new Document;break;case gt.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case gt.Element:{let t=e.tagName.toLowerCase();t=Ot[t]||t,i=r&&"isSVG"in r&&(null==r?void 0:r.isSVG)?document.createElementNS(xt.svg,t):document.createElement(e.tagName);break}case gt.Text:i=document.createTextNode(e.data);break;case gt.Comment:i=document.createComment(e.data);break;case gt.CDATA:i=document.createCDATASection(e.data)}return r&&t.add(i,Object.assign({},r)),i}class Bt extends(function(e){return class t extends e{constructor(){super(...arguments),this.nodeType=Dt.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=gt.Document,this.textContent=null}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===gt.Element&&"HTML"===e.tagName)||null}get body(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find(e=>e.RRNodeType===gt.Element&&"BODY"===e.tagName))||null}get head(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find(e=>e.RRNodeType===gt.Element&&"HEAD"===e.tagName))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===gt.Element||t===gt.DocumentType)&&this.childNodes.some(e=>e.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===gt.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return e.parentElement=null,e.parentNode=this,this.childNodes.push(e),e}insertBefore(e,t){const n=e.RRNodeType;if((n===gt.Element||n===gt.DocumentType)&&this.childNodes.some(e=>e.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===gt.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(null===t)return this.appendChild(e);const o=this.childNodes.indexOf(t);if(-1==o)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(o,0,e),e.parentElement=null,e.parentNode=this,e}removeChild(e){const t=this.childNodes.indexOf(e);if(-1===t)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(t,1),e.parentElement=null,e.parentNode=null,e}open(){this.childNodes=[]}close(){}write(e){let t;if('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,n,o){return new t}createDocumentType(e,t,n){const o=new(At(Nt))(e,t,n);return o.ownerDocument=this,o}createElement(e){const t=new(Et(Nt))(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new(Tt(Nt))(e);return t.ownerDocument=this,t}createComment(e){const t=new(Mt(Nt))(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new(kt(Nt))(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}}(Nt)){constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new Ht,this.scrollData=null,e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,n){return new Bt}createDocumentType(e,t,n){const o=new Wt(e,t,n);return o.ownerDocument=this,o}createElement(e){const t=e.toUpperCase();let n;switch(t){case"AUDIO":case"VIDEO":n=new Vt(t);break;case"IFRAME":n=new Zt(t,this.mirror);break;case"CANVAS":n=new Gt(t);break;case"STYLE":n=new Pt(t);break;default:n=new Ut(t)}return n.ownerDocument=this,n}createComment(e){const t=new Yt(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new jt(e);return t.ownerDocument=this,t}createTextNode(e){const t=new Kt(e);return t.ownerDocument=this,t}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Wt=At(Nt);class Ut extends(Et(Nt)){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Vt extends(function(e){return class extends e{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(Ut)){}class Gt extends Ut{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Pt extends Ut{constructor(){super(...arguments),this.rules=[]}}class Zt extends Ut{constructor(e,t){super(e),this.contentDocument=new Bt,this.contentDocument.mirror=t}}const Kt=Tt(Nt),Yt=Mt(Nt),jt=kt(Nt);function zt(e,t,n,o){let r;switch(e.nodeType){case Dt.DOCUMENT_NODE:o&&"IFRAME"===o.nodeName?r=o.contentDocument:(r=t,r.compatMode=e.compatMode);break;case Dt.DOCUMENT_TYPE_NODE:{const n=e;r=t.createDocumentType(n.name,n.publicId,n.systemId);break}case Dt.ELEMENT_NODE:{const n=e,o=(i=n)instanceof HTMLFormElement?"FORM":i.tagName.toUpperCase();r=t.createElement(o);const s=r;for(const{name:e,value:t}of Array.from(n.attributes))s.attributes[e]=t;n.scrollLeft&&(s.scrollLeft=n.scrollLeft),n.scrollTop&&(s.scrollTop=n.scrollTop);break}case Dt.TEXT_NODE:r=t.createTextNode(e.textContent||"");break;case Dt.CDATA_SECTION_NODE:r=t.createCDATASection(e.data);break;case Dt.COMMENT_NODE:r=t.createComment(e.textContent||"");break;case Dt.DOCUMENT_FRAGMENT_NODE:r=o.attachShadow({mode:"open"});break;default:return null}var i;let s=n.getMeta(e);return t instanceof Bt&&(s||(s=Qt(r,t.unserializedId),n.add(e,s)),t.mirror.add(r,Object.assign({},s))),r}class Ht{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Qt(e,t){switch(e.RRNodeType){case gt.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case gt.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case gt.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case gt.Text:case gt.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case gt.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const{addCustomEvent:Jt}=ft,{freezePage:Xt}=ft;var qt=Uint8Array,$t=Uint16Array,en=Uint32Array,tn=new qt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nn=new qt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),on=new qt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rn=function(e,t){for(var n=new $t(31),o=0;o<31;++o)n[o]=t+=1<<e[o-1];var r=new en(n[30]);for(o=1;o<30;++o)for(var i=n[o];i<n[o+1];++i)r[i]=i-n[o]<<5|o;return[n,r]},sn=rn(tn,2),an=sn[0],ln=sn[1];an[28]=258,ln[258]=28;for(var cn=rn(nn,0),dn=cn[0],un=cn[1],hn=new $t(32768),pn=0;pn<32768;++pn){var mn=(43690&pn)>>>1|(21845&pn)<<1;mn=(61680&(mn=(52428&mn)>>>2|(13107&mn)<<2))>>>4|(3855&mn)<<4,hn[pn]=((65280&mn)>>>8|(255&mn)<<8)>>>1}var fn=function(e,t,n){for(var o=e.length,r=0,i=new $t(t);r<o;++r)++i[e[r]-1];var s,a=new $t(t);for(r=0;r<t;++r)a[r]=a[r-1]+i[r-1]<<1;if(n){s=new $t(1<<t);var l=15-t;for(r=0;r<o;++r)if(e[r])for(var c=r<<4|e[r],d=t-e[r],u=a[e[r]-1]++<<d,h=u|(1<<d)-1;u<=h;++u)s[hn[u]>>>l]=c}else for(s=new $t(o),r=0;r<o;++r)s[r]=hn[a[e[r]-1]++]>>>15-e[r];return s},gn=new qt(288);for(pn=0;pn<144;++pn)gn[pn]=8;for(pn=144;pn<256;++pn)gn[pn]=9;for(pn=256;pn<280;++pn)gn[pn]=7;for(pn=280;pn<288;++pn)gn[pn]=8;var yn=new qt(32);for(pn=0;pn<32;++pn)yn[pn]=5;var vn=fn(gn,9,0),Cn=fn(gn,9,1),In=fn(yn,5,0),bn=fn(yn,5,1),Sn=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},wn=function(e,t,n){var o=t/8|0;return(e[o]|e[o+1]<<8)>>>(7&t)&n},Nn=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},An=function(e){return(e/8|0)+(7&e&&1)},En=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var o=new(e instanceof $t?$t:e instanceof en?en:qt)(n-t);return o.set(e.subarray(t,n)),o},Tn=function(e,t,n){n<<=7&t;var o=t/8|0;e[o]|=n,e[o+1]|=n>>>8},Mn=function(e,t,n){n<<=7&t;var o=t/8|0;e[o]|=n,e[o+1]|=n>>>8,e[o+2]|=n>>>16},kn=function(e,t){for(var n=[],o=0;o<e.length;++o)e[o]&&n.push({s:o,f:e[o]});var r=n.length,i=n.slice();if(!r)return[new qt(0),0];if(1==r){var s=new qt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,d=1,u=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};d!=r-1;)a=n[n[c].f<n[u].f?c++:u++],l=n[c!=d&&n[c].f<n[u].f?c++:u++],n[d++]={s:-1,f:a.f+l.f,l:a,r:l};var h=i[0].s;for(o=1;o<r;++o)i[o].s>h&&(h=i[o].s);var p=new $t(h+1),m=Rn(n[d-1],p,0);if(m>t){o=0;var f=0,g=m-t,y=1<<g;for(i.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});o<r;++o){var v=i[o].s;if(!(p[v]>t))break;f+=y-(1<<m-p[v]),p[v]=t}for(f>>>=g;f>0;){var C=i[o].s;p[C]<t?f-=1<<t-p[C]++-1:++o}for(;o>=0&&f;--o){var I=i[o].s;p[I]==t&&(--p[I],++f)}m=t}return[new qt(p),m]},Rn=function(e,t,n){return-1==e.s?Math.max(Rn(e.l,t,n+1),Rn(e.r,t,n+1)):t[e.s]=n},Dn=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new $t(++t),o=0,r=e[0],i=1,s=function(e){n[o++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++i;else{if(!r&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(r),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(r);i=1,r=e[a]}return[n.subarray(0,o),t]},xn=function(e,t){for(var n=0,o=0;o<t.length;++o)n+=e[o]*t[o];return n},On=function(e,t,n){var o=n.length,r=An(t+2);e[r]=255&o,e[r+1]=o>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var i=0;i<o;++i)e[r+i+4]=n[i];return 8*(r+4+o)},Ln=function(e,t,n,o,r,i,s,a,l,c,d){Tn(t,d++,n),++r[256];for(var u=kn(r,15),h=u[0],p=u[1],m=kn(i,15),f=m[0],g=m[1],y=Dn(h),v=y[0],C=y[1],I=Dn(f),b=I[0],S=I[1],w=new $t(19),N=0;N<v.length;++N)w[31&v[N]]++;for(N=0;N<b.length;++N)w[31&b[N]]++;for(var A=kn(w,7),E=A[0],T=A[1],M=19;M>4&&!E[on[M-1]];--M);var k,R,D,x,O=c+5<<3,L=xn(r,gn)+xn(i,yn)+s,F=xn(r,h)+xn(i,f)+s+14+3*M+xn(w,E)+(2*w[16]+3*w[17]+7*w[18]);if(O<=L&&O<=F)return On(t,d,e.subarray(l,l+c));if(Tn(t,d,1+(F<L)),d+=2,F<L){k=fn(h,p,0),R=h,D=fn(f,g,0),x=f;var _=fn(E,T,0);for(Tn(t,d,C-257),Tn(t,d+5,S-1),Tn(t,d+10,M-4),d+=14,N=0;N<M;++N)Tn(t,d+3*N,E[on[N]]);d+=3*M;for(var B=[v,b],W=0;W<2;++W){var U=B[W];for(N=0;N<U.length;++N){var V=31&U[N];Tn(t,d,_[V]),d+=E[V],V>15&&(Tn(t,d,U[N]>>>5&127),d+=U[N]>>>12)}}}else k=vn,R=gn,D=In,x=yn;for(N=0;N<a;++N)if(o[N]>255){V=o[N]>>>18&31,Mn(t,d,k[V+257]),d+=R[V+257],V>7&&(Tn(t,d,o[N]>>>23&31),d+=tn[V]);var G=31&o[N];Mn(t,d,D[G]),d+=x[G],G>3&&(Mn(t,d,o[N]>>>5&8191),d+=nn[G])}else Mn(t,d,k[o[N]]),d+=R[o[N]];return Mn(t,d,k[256]),d+R[256]},Fn=new en([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_n=new qt(0);function Bn(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var o=e,r=t,i=n.length,s=0;s!=i;){for(var a=Math.min(s+5552,i);s<a;++s)r+=o+=n[s];o%=65521,r%=65521}e=o,t=r},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var o,r,i,s,a,l=(i=2,s=4,function(e,t,n,o,r,i){var s=e.length,a=new qt(o+s+5*(1+Math.floor(s/7e3))+r),l=a.subarray(o,a.length-r),c=0;if(!t||s<8)for(var d=0;d<=s;d+=65535){var u=d+65535;u<s?c=On(l,c,e.subarray(d,u)):(l[d]=i,c=On(l,c,e.subarray(d,s)))}else{for(var h=Fn[t-1],p=h>>>13,m=8191&h,f=(1<<n)-1,g=new $t(32768),y=new $t(f+1),v=Math.ceil(n/3),C=2*v,I=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<C)&f},b=new en(25e3),S=new $t(288),w=new $t(32),N=0,A=0,E=(d=0,0),T=0,M=0;d<s;++d){var k=I(d),R=32767&d,D=y[k];if(g[R]=D,y[k]=R,T<=d){var x=s-d;if((N>7e3||E>24576)&&x>423){c=Ln(e,l,0,b,S,w,A,E,M,d-M,c),E=N=A=0,M=d;for(var O=0;O<286;++O)S[O]=0;for(O=0;O<30;++O)w[O]=0}var L=2,F=0,_=m,B=R-D&32767;if(x>2&&k==I(d-B))for(var W=Math.min(p,x)-1,U=Math.min(32767,d),V=Math.min(258,x);B<=U&&--_&&R!=D;){if(e[d+L]==e[d+L-B]){for(var G=0;G<V&&e[d+G]==e[d+G-B];++G);if(G>L){if(L=G,F=B,G>W)break;var P=Math.min(B,G-2),Z=0;for(O=0;O<P;++O){var K=d-B+O+32768&32767,Y=K-g[K]+32768&32767;Y>Z&&(Z=Y,D=K)}}}B+=(R=D)-(D=g[R])+32768&32767}if(F){b[E++]=268435456|ln[L]<<18|un[F];var j=31&ln[L],z=31&un[F];A+=tn[j]+nn[z],++S[257+j],++w[z],T=d+L,++N}else b[E++]=e[d],++S[e[d]]}}c=Ln(e,l,i,b,S,w,A,E,M,d-M,c),i||(c=On(l,c,_n))}return En(a,0,o+An(c)+r)}(o=e,null==(r=t).level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(o.length)))):12+r.mem,i,s,!a));return function(e,t){var n=t.level,o=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=o<<6|(o?32-2*o:1)}(l,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(l,l.length-4,n.d()),l}function Wn(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var o=new qt(e.length+(e.length>>>1)),r=0,i=function(e){o[r++]=e},s=0;s<n;++s){if(r+5>o.length){var a=new qt(r+8+(n-s<<1));a.set(o),o=a}var l=e.charCodeAt(s);l<128||t?i(l):l<2048?(i(192|l>>>6),i(128|63&l)):l>55295&&l<57344?(i(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),i(128|l>>>12&63),i(128|l>>>6&63),i(128|63&l)):(i(224|l>>>12),i(128|l>>>6&63),i(128|63&l))}return En(o,0,r)}function Un(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var o=0;o<e.length;){var r=e[o++];r<128||t?n+=String.fromCharCode(r):r<224?n+=String.fromCharCode((31&r)<<6|63&e[o++]):r<240?n+=String.fromCharCode((15&r)<<12|(63&e[o++])<<6|63&e[o++]):(r=((15&r)<<18|(63&e[o++])<<12|(63&e[o++])<<6|63&e[o++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}const Vn="v1",Gn=e=>{const t=Object.assign(Object.assign({},e),{v:Vn});return Un(Bn(Wn(JSON.stringify(t))),!0)},Pn=e=>{if("string"!=typeof e)return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch(e){}try{const o=JSON.parse(Un(function(e,t,n){var o=e.length,r=!t||n,i=!n||n.i;n||(n={}),t||(t=new qt(3*o));var s=function(e){var n=t.length;if(e>n){var o=new qt(Math.max(2*n,e));o.set(t),t=o}},a=n.f||0,l=n.p||0,c=n.b||0,d=n.l,u=n.d,h=n.m,p=n.n,m=8*o;do{if(!d){n.f=a=wn(e,l,1);var f=wn(e,l+1,3);if(l+=3,!f){var g=e[(T=An(l)+4)-4]|e[T-3]<<8,y=T+g;if(y>o){if(i)throw"unexpected EOF";break}r&&s(c+g),t.set(e.subarray(T,y),c),n.b=c+=g,n.p=l=8*y;continue}if(1==f)d=Cn,u=bn,h=9,p=5;else{if(2!=f)throw"invalid block type";var v=wn(e,l,31)+257,C=wn(e,l+10,15)+4,I=v+wn(e,l+5,31)+1;l+=14;for(var b=new qt(I),S=new qt(19),w=0;w<C;++w)S[on[w]]=wn(e,l+3*w,7);l+=3*C;var N=Sn(S),A=(1<<N)-1;if(!i&&l+I*(N+7)>m)break;var E=fn(S,N,1);for(w=0;w<I;){var T,M=E[wn(e,l,A)];if(l+=15&M,(T=M>>>4)<16)b[w++]=T;else{var k=0,R=0;for(16==T?(R=3+wn(e,l,3),l+=2,k=b[w-1]):17==T?(R=3+wn(e,l,7),l+=3):18==T&&(R=11+wn(e,l,127),l+=7);R--;)b[w++]=k}}var D=b.subarray(0,v),x=b.subarray(v);h=Sn(D),p=Sn(x),d=fn(D,h,1),u=fn(x,p,1)}if(l>m)throw"unexpected EOF"}r&&s(c+131072);for(var O=(1<<h)-1,L=(1<<p)-1,F=h+p+18;i||l+F<m;){var _=(k=d[Nn(e,l)&O])>>>4;if((l+=15&k)>m)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(_<256)t[c++]=_;else{if(256==_){d=null;break}var B=_-254;if(_>264){var W=tn[w=_-257];B=wn(e,l,(1<<W)-1)+an[w],l+=W}var U=u[Nn(e,l)&L],V=U>>>4;if(!U)throw"invalid distance";if(l+=15&U,x=dn[V],V>3&&(W=nn[V],x+=Nn(e,l)&(1<<W)-1,l+=W),l>m)throw"unexpected EOF";r&&s(c+131072);for(var G=c+B;c<G;c+=4)t[c]=t[c-x],t[c+1]=t[c+1-x],t[c+2]=t[c+2-x],t[c+3]=t[c+3-x];c=G}}n.l=d,n.p=l,n.b=c,d&&(a=1,n.m=h,n.d=u,n.n=p)}while(!a);return c==t.length?t:En(t,0,c)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(t=Wn(e,!0)),t.subarray(2,-4)),n)));if(o.v===Vn)return o;throw new Error(`These events were packed with packer ${o.v} which is incompatible with current packer ${Vn}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}var t,n};class Zn{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Kn=/(^|@)\S+:\d+/,Yn=/^\s*at .*(\S+:\d+|\(native\))/m,jn=/^(eval@)?(\[native code])?$/,zn={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(Yn))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Yn)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const o=t.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:o.pop()),i=o.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new Zn({functionName:i,fileName:s,lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(jn)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Zn({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),o=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new Zn({functionName:o,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),o=[];for(let e=2,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&o.push(new Zn({fileName:r[2],lineNumber:parseFloat(r[1])}))}return o},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),o=[];for(let e=0,r=n.length;e<r;e+=2){const r=t.exec(n[e]);r&&o.push(new Zn({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return o},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Kn)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),o=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Zn({functionName:o,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Hn(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const o=e.parentElement,r=[];if(o.children&&o.children.length>0)for(let e=0;e<o.children.length;e++){const t=o.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&r.push(t)}r.length>1&&(n+=`:eq(${r.indexOf(e)})`),t=n+(t?">"+t:""),e=o}return t}function Qn(e){return"[object Object]"===Object.prototype.toString.call(e)}function Jn(e,t){if(0===t)return!0;const n=Object.keys(e);for(const o of n)if(Qn(e[o])&&Jn(e[o],t-1))return!0;return!1}function Xn(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const o=[],r=[];return JSON.stringify(e,function(e,t){if(o.length>0){const n=o.indexOf(this);~n?o.splice(n+1):o.push(this),~n?r.splice(n,1/0,e):r.push(e),~o.indexOf(t)&&(t=o[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(t)).join(".")+"]")}else o.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Qn(i=t)&&Object.keys(i).length>n.numOfKeysLimit||"function"==typeof i||Qn(i)&&Jn(i,n.depthOfLimit))return function(e){let t=e.toString();return n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`),t}(t);var i;if(t instanceof Event){const e={};for(const n in t){const o=t[n];Array.isArray(o)?e[n]=Hn(o.length?o[0]:null):e[n]=o}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}const qn={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function $n(e,t,n){const o=n?Object.assign({},qn,n):qn,r=o.logger;if(!r)return()=>{};let i;i="string"==typeof r?t[r]:r;let s=0;const a=[];if(o.level.includes("error")&&window){const t=t=>{const n=t.message,r=t.error,i=zn.parse(r).map(e=>e.toString()),s=[Xn(n,o.stringifyOptions)];e({level:"error",trace:i,payload:s})};window.addEventListener("error",t),a.push(()=>{window&&window.removeEventListener("error",t)})}for(const e of o.level)a.push(l(i,e));return()=>{a.forEach(e=>e())};function l(t,n){return t[n]?H(t,n,t=>(...r)=>{t.apply(this,r);try{const t=zn.parse(new Error).map(e=>e.toString()).splice(1),i=r.map(e=>Xn(e,o.stringifyOptions));s++,s<o.lengthThreshold?e({level:n,trace:t,payload:i}):s===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Xn("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...r)}}):()=>{}}}const eo="rrweb/console@1",to=e=>({name:eo,observer:$n,options:e}),no="__rrweb_original__",oo={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class ro{constructor(e){this.config=Object.assign(oo,e)}getConsoleLogger(){const e={};for(const t of this.config.level)e[t]="trace"===t?e=>{(console.log[no]?console.log[no]:console.log)(...e.payload.map(e=>JSON.parse(e)),this.formatMessage(e))}:e=>{(console[t][no]?console[t][no]:console[t])(...e.payload.map(e=>JSON.parse(e)),this.formatMessage(e))};return e}formatMessage(e){if(0===e.trace.length)return"";const t="\n\tat ";let n=t;return n+=e.trace.join(t),n}}const io=e=>{const t=(null==e?void 0:e.replayLogger)||new ro(e).getConsoleLogger();return{handler(e,n,o){let r=null;if(e.type===pe.IncrementalSnapshot&&e.data.source===me.Log?r=e.data:e.type===pe.Plugin&&e.data.plugin===eo&&(r=e.data.payload),r)try{"function"==typeof t[r.level]&&t[r.level](r)}catch(e){o.replayer.config.showWarning&&console.warn(e)}}}};function so(e){return{all:e=e||new Map,on:function(t,n){var o=e.get(t);o?o.push(n):e.set(t,[n])},off:function(t,n){var o=e.get(t);o&&(n?o.splice(o.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var o=e.get(t);o&&o.slice().map(function(e){e(n)}),(o=e.get("*"))&&o.slice().map(function(e){e(t,n)})}}}function ao(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const n=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},r=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,i=(s=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(s)?1:0);var s;function a(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+i<e.scrollHeight:"X"===t?e.clientWidth+i<e.scrollWidth:void 0}function d(t,n){const o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function u(e){const t=c(e,"Y")&&d(e,"Y"),n=c(e,"X")&&d(e,"X");return t||n}function h(t){let n,o,i,s=(r()-t.startTime)/468;var a;s=s>1?1:s,a=s,n=.5*(1-Math.cos(Math.PI*a)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(h.bind(e,t))}function p(n,i,s){let l,c,d,u;const p=r();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,d=e.scrollY||e.pageYOffset,u=o.scroll):(l=n,c=n.scrollLeft,d=n.scrollTop,u=a),h({scrollable:l,method:u,startTime:p,startX:c,startY:d,x:i,y:s})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?p.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):p.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0===arguments[0])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}const e=arguments[0].left,t=arguments[0].top;p.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0===l(arguments[0]))return void o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const n=function(e){for(;e!==t.body&&!1===u(e);)e=e.parentNode||e.host;return e}(this),r=n.getBoundingClientRect(),i=this.getBoundingClientRect();n!==t.body?(p.call(this,n,n.scrollLeft+i.left-r.left,n.scrollTop+i.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}}class lo{constructor(e=[],t){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t.speed,this.liveMode=t.liveMode}addAction(e){if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)return void this.actions.push(e);const t=this.findActionIndex(e);this.actions.splice(t,0,e)}start(){this.timeOffset=0;let e=performance.now();const t=()=>{const n=performance.now();for(this.timeOffset+=(n-e)*this.speed,e=n;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}(this.actions.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(t))};this.raf=requestAnimationFrame(t)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}toggleLiveMode(e){this.liveMode=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){const o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o+1;n=o-1}}return t}}function co(e,t){if(e.type===pe.IncrementalSnapshot&&e.data.source===me.MouseMove&&e.data.positions&&e.data.positions.length){const n=e.data.positions[0].timeOffset,o=e.timestamp+n;return e.delay=o-t,o-t}return e.delay=e.timestamp-t,e.delay}function uo(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}var ho;!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(ho||(ho={}));var po={type:"xstate.init"};function mo(e){return void 0===e?[]:[].concat(e)}function fo(e){return{type:"xstate.assign",assignment:e}}function go(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function yo(e){return function(t){return e===t}}function vo(e){return"string"==typeof e?{type:e}:e}function Co(e,t){return{value:e,context:t,actions:[],changed:!1,matches:yo(e)}}function Io(e,t,n){var o=t,r=!1;return[e.filter(function(e){if("xstate.assign"===e.type){r=!0;var t=Object.assign({},o);return"function"==typeof e.assignment?t=e.assignment(o,n):Object.keys(e.assignment).forEach(function(r){t[r]="function"==typeof e.assignment[r]?e.assignment[r](o,n):e.assignment[r]}),o=t,!1}return!0}),o,r]}function bo(e,t){void 0===t&&(t={});var n=uo(Io(mo(e.states[e.initial].entry).map(function(e){return go(e,t.actions)}),e.context,po),2),o=n[0],r=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:o,context:r,matches:yo(e.initial)},transition:function(t,n){var o,r,s="string"==typeof t?{value:t,context:e.context}:t,a=s.value,l=s.context,c=vo(n),d=e.states[a];if(d.on){var u=mo(d.on[c.type]);try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),p=h.next();!p.done;p=h.next()){var m=p.value;if(void 0===m)return Co(a,l);var f="string"==typeof m?{target:m}:m,g=f.target,y=f.actions,v=void 0===y?[]:y,C=f.cond,I=void 0===C?function(){return!0}:C,b=void 0===g,S=null!=g?g:a,w=e.states[S];if(I(l,c)){var N=uo(Io((b?mo(v):[].concat(d.exit,v,w.entry).filter(function(e){return e})).map(function(e){return go(e,i._options.actions)}),l,c),3),A=N[0],E=N[1],T=N[2],M=null!=g?g:a;return{value:M,context:E,actions:A,changed:g!==a||A.length>0||T,matches:yo(M)}}}}catch(e){o={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}}return Co(a,l)}};return i}var So=function(e,t){return e.actions.forEach(function(n){var o=n.exec;return o&&o(e.context,t)})};function wo(e){var t=e.initialState,n=ho.NotStarted,o=new Set,r={_machine:e,send:function(r){n===ho.Running&&(t=e.transition(t,r),So(t,vo(r)),o.forEach(function(e){return e(t)}))},subscribe:function(e){return o.add(e),e(t),{unsubscribe:function(){return o.delete(e)}}},start:function(o){if(o){var i="object"==typeof o?o:{context:e.config.context,value:o};t={value:i.value,actions:[],context:i.context,matches:yo(i.value)}}return n=ho.Running,So(t,po),r},stop:function(){return n=ho.Stopped,o.clear(),r},get state(){return t},get status(){return n}};return r}const No=new Map;function Ao(e,t){let n=No.get(e);return n||(n=new Map,No.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Eo(e,t,n){return o=>Ye(this,void 0,void 0,function*(){if(o&&"object"==typeof o&&"rr_type"in o){if(n&&(n.isUnchanged=!1),"ImageBitmap"===o.rr_type&&"args"in o){const r=yield Eo(e,t,n)(o.args);return yield createImageBitmap.apply(null,r)}if("index"in o){if(n||null===t)return o;const{rr_type:e,index:r}=o;return Ao(t,e)[r]}if("args"in o){const{rr_type:r,args:i}=o;return new(0,window[r])(...yield Promise.all(i.map(Eo(e,t,n))))}if("base64"in o)return function(e){var t,n,o,r,i,s=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var c=new ArrayBuffer(s),d=new Uint8Array(c);for(t=0;t<a;t+=4)n=ze[e.charCodeAt(t)],o=ze[e.charCodeAt(t+1)],r=ze[e.charCodeAt(t+2)],i=ze[e.charCodeAt(t+3)],d[l++]=n<<2|o>>4,d[l++]=(15&o)<<4|r>>2,d[l++]=(3&r)<<6|63&i;return c}(o.base64);if("src"in o){const t=e.get(o.src);if(t)return t;{const t=new Image;return t.src=o.src,e.set(o.src,t),t}}if("data"in o&&"Blob"===o.rr_type){const r=yield Promise.all(o.data.map(Eo(e,t,n)));return new Blob(r,{type:o.type})}}else if(Array.isArray(o))return yield Promise.all(o.map(Eo(e,t,n)));return o})}const To=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Mo({mutation:e,target:t,type:n,imageMap:o,errorHandler:r}){return Ye(this,void 0,void 0,function*(){try{const r=function(e,t){try{return t===ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(t,n);if(!r)return;if(e.setter)return void(r[e.property]=e.args[0]);const i=r[e.property],s=yield Promise.all(e.args.map(Eo(o,r)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:n}=t.constructor;if(!To.includes(n))return;const o=Ao(e,n);o.includes(t)||o.push(t)}(r,i.apply(r,s))}catch(t){r(e,t)}})}function ko({event:e,mutation:t,target:n,imageMap:o,errorHandler:r}){return Ye(this,void 0,void 0,function*(){try{const r=n.getContext("2d");if(t.setter)return void(r[t.property]=t.args[0]);const i=r[t.property];if("drawImage"===t.property&&"string"==typeof t.args[0])o.get(e),i.apply(r,t.args);else{const e=yield Promise.all(t.args.map(Eo(o,r)));i.apply(r,e)}}catch(e){r(t,e)}})}function Ro({event:e,mutation:t,target:n,imageMap:o,canvasEventMap:r,errorHandler:i}){return Ye(this,void 0,void 0,function*(){try{const s=r.get(e)||t,a="commands"in s?s.commands:[s];if([ge.WebGL,ge.WebGL2].includes(t.type)){for(let e=0;e<a.length;e++){const r=a[e];yield Mo({mutation:r,type:t.type,target:n,imageMap:o,errorHandler:i})}return}for(let t=0;t<a.length;t++){const r=a[t];yield ko({event:e,mutation:r,target:n,imageMap:o,errorHandler:i})}}catch(e){i(t,e)}})}const Do=so||i,xo="[replayer]",Oo={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Lo(e){return e.type==pe.IncrementalSnapshot&&(e.data.source==me.TouchMove||e.data.source==me.MouseInteraction&&e.data.type==fe.TouchStart)}class Fo{constructor(e,t){if(this.usingVirtualDom=!1,this.virtualDom=new Bt,this.mouseTail=null,this.tailPositions=[],this.emitter=Do(),this.legacy_missingNodeRetryMap={},this.cache=G(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=h(),this.styleMirror=new he,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))},this.applyEventsSynchronously=e=>{for(const t of e){switch(t.type){case pe.DomContentLoaded:case pe.Load:case pe.Custom:continue;case pe.FullSnapshot:case pe.Meta:case pe.Plugin:case pe.IncrementalSnapshot:}this.getCastFn(t,!0)()}!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(e,t=!1)=>{let n;switch(e.type){case pe.DomContentLoaded:case pe.Load:break;case pe.Custom:n=()=>{this.emitter.emit(ye.CustomEvent,e)};break;case pe.Meta:n=()=>this.emitter.emit(ye.Resize,{width:e.data.width,height:e.data.height});break;case pe.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,t),null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo(e.data.initialOffset),this.styleMirror.reset()};break;case pe.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&(e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>1e4*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay,n={speed:Math.min(Math.round(t/5e3),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:n}),this.emitter.emit(ye.SkipStart,n)}}}}return()=>{n&&n();for(const n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const o=this.service.state.context.events.length-1;if(e===this.service.state.context.events[o]){const t=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(ye.Finish))};e.type===pe.IncrementalSnapshot&&e.data.source===me.MouseMove&&e.data.positions.length?setTimeout(()=>{t()},Math.max(0,50-e.data.positions[0].timeOffset)):t()}this.emitter.emit(ye.EventCast,e)}},!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Oo,useVirtualDom:!0};this.config=Object.assign({},n,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(ye.Resize,this.handleResize),this.setupDom();for(const e of this.config.plugins||[])e.getMirror&&e.getMirror({nodeMirror:this.mirror});this.emitter.on(ye.Flush,()=>{if(this.usingVirtualDom){const e={mirror:this.mirror,applyCanvas:(e,t,n)=>{Ro({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===me.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===me.StyleDeclaration&&this.applyStyleDeclaration(e,t)}};if(this.iframe.contentDocument&&Lt(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const t in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[t],o=_t(n.node,this.mirror,this.virtualDom.mirror);Lt(o,n.node,e,this.virtualDom.mirror),n.node=o}catch(e){this.config.showWarning&&console.warn(e)}this.constructedStyleMutations.forEach(e=>{this.applyStyleSheetMutation(e)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(e=>{this.applyAdoptedStyleSheet(e)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(ye.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});const o=new lo([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=function(e,{getCastFn:t,applyEventsSynchronously:n,emitter:o}){const r=bo({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:fo({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:fo((e,t)=>{let n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),Object.assign(Object.assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})}),play(e){var r;const{timer:i,events:s,baselineTime:a,lastPlayedEvent:l}=e;i.clear();for(const e of s)co(e,a);const c=function(e,t){for(let n=e.length-1;n>=0;n--){const o=e[n];if(o.type===pe.Meta&&o.timestamp<=t)return e.slice(n)}return e}(s,a);let d=null==l?void 0:l.timestamp;(null==l?void 0:l.type)===pe.IncrementalSnapshot&&l.data.source===me.MouseMove&&(d=l.timestamp+(null===(r=l.data.positions[0])||void 0===r?void 0:r.timeOffset)),a<(d||0)&&o.emit(ye.PlayBack);const u=new Array;for(const e of c)if(!(d&&d<a&&(e.timestamp<=d||e===l)))if(e.timestamp<a)u.push(e);else{const n=t(e,!1);i.addAction({doAction:()=>{n()},delay:e.delay})}n(u),o.emit(ye.Flush),i.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:fo(e=>Object.assign(Object.assign({},e),{lastPlayedEvent:null})),startLive:fo({baselineTime:(e,t)=>(e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:fo((e,n)=>{const{baselineTime:o,timer:r,events:i}=e;if("ADD_EVENT"===n.type){const{event:e}=n.payload;co(e,o);let s=i.length-1;if(!i[s]||i[s].timestamp<=e.timestamp)i.push(e);else{let t=-1,n=0;for(;n<=s;){const t=Math.floor((n+s)/2);i[t].timestamp<=e.timestamp?n=t+1:s=t-1}-1===t&&(t=n),i.splice(t,0,e)}const a=e.timestamp<o,l=t(e,a);a?l():r.isActive()&&r.addAction({doAction:()=>{l()},delay:e.delay})}return Object.assign(Object.assign({},e),{events:i})})}});return wo(r)}({events:e.map(e=>t&&t.unpackFn?t.unpackFn(e):e).sort((e,t)=>e.timestamp-t.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(e=>{this.emitter.emit(ye.StateChange,{player:e})}),this.speedService=wo(bo({id:"speed",context:{normalSpeed:-1,timer:o},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:fo({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe(e=>{this.emitter.emit(ye.StateChange,{speed:e})});const r=this.service.state.context.events.find(e=>e.type===pe.Meta),i=this.service.state.context.events.find(e=>e.type===pe.FullSnapshot);if(r){const{width:e,height:t}=r.data;setTimeout(()=>{this.emitter.emit(ye.Resize,{width:e,height:t})},0)}i&&setTimeout(()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=i,this.rebuildFullSnapshot(i),null===(e=this.iframe.contentWindow)||void 0===e||e.scrollTo(i.data.initialOffset))},1),this.service.state.context.events.find(Lo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,n;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.remove("rrweb-paused"),this.emitter.emit(ye.Start)}pause(e){var t,n;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.add("rrweb-paused"),this.emitter.emit(ye.Pause)}resume(e=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(ye.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(ye.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Lo(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=G()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(ao(this.iframe.contentWindow,this.iframe.contentDocument),ne(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[],o=(e,t)=>{this.collectIframeAndAttachDocument(n,e);for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})};(function(e,t){var n=t.doc,o=t.onVisit,i=t.hackCss,s=void 0===i||i,a=t.afterAppend,l=t.cache,c=t.mirror,d=void 0===c?new u:c,h=P(e,{doc:n,mirror:d,skipChild:!1,hackCss:s,afterAppend:a,cache:l});(function(e,t){function n(e){t(e)}for(var o=0,r=e.getIds();o<r.length;o++){var i=r[o];e.has(i)&&n(e.getNode(i))}})(d,function(e){o&&o(e),function(e,t){var n=t.getMeta(e);if((null==n?void 0:n.type)===r.Element){var o=e;for(var i in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,i)&&i.startsWith("rr_")){var s=n.attributes[i];"rr_scrollLeft"===i&&(o.scrollLeft=s),"rr_scrollTop"===i&&(o.scrollTop=s)}}}(e,d)})})(e.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror}),o(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter(t=>t!==e);const{documentElement:i,head:s}=this.iframe.contentDocument;this.insertStyleRules(i,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(ye.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;const o=(r=this.config.blockClass,[`.${r} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var r;if(this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Qt(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:me.StyleSheetRule,adds:o.map((e,t)=>({rule:e,index:t}))})}else{const r=document.createElement("style");e.insertBefore(r,t);for(let e=0;e<o.length;e++)null===(n=r.sheet)||void 0===n||n.insertRule(o[e],e)}}attachDocumentToIframe(e,t){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[],i=(e,i)=>{this.collectIframeAndAttachDocument(o,e);const s=n.getMeta(e);if((null==s?void 0:s.type)===r.Element&&"HTML"===(null==s?void 0:s.tagName.toUpperCase())){const{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:i,replayer:this})};P(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i,cache:this.cache}),i(t.contentDocument,e.node.id);for(const{mutationInQueue:e,builtNode:t}of o)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter(t=>t!==e)}collectIframeAndAttachDocument(e,t){if(ie(t,this.mirror)){const n=this.newDocumentQueue.find(e=>e.parentId===this.mirror.getId(t));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(t){const e=new Set;let n,o=this.service.state;const r=()=>{o=this.service.state};this.emitter.on(ye.Start,r),this.emitter.on(ye.Pause,r);const i=()=>{this.emitter.off(ye.Start,r),this.emitter.off(ye.Pause,r)};t.querySelectorAll('link[rel="stylesheet"]').forEach(t=>{t.sheet||(e.add(t),t.addEventListener("load",()=>{e.delete(t),0===e.size&&-1!==n&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(ye.LoadStylesheetEnd),n&&clearTimeout(n),i())}))}),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(ye.LoadStylesheetStart),n=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),n=-1,i()},this.config.loadTimeout))}}preloadAllImages(){return Ye(this,void 0,void 0,function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(ye.Start,e),this.emitter.on(ye.Pause,e);const t=[];for(const e of this.service.state.context.events)e.type===pe.IncrementalSnapshot&&e.data.source===me.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(e.data,e)),("commands"in e.data?e.data.commands:[e.data]).forEach(t=>{this.preloadImages(t,e)}));return Promise.all(t)})}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const t=document.createElement("canvas"),n=t.getContext("2d"),o=null==n?void 0:n.createImageData(t.width,t.height);null==o||o.data,JSON.parse(e.args[0]),null==n||n.putImageData(o,0,0)}}deserializeAndPreloadCanvasEvents(e,t){return Ye(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(t)){const n={isUnchanged:!0};if("commands"in e){const o=yield Promise.all(e.commands.map(e=>Ye(this,void 0,void 0,function*(){const t=yield Promise.all(e.args.map(Eo(this.imageMap,null,n)));return Object.assign(Object.assign({},e),{args:t})})));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{commands:o}))}else{const o=yield Promise.all(e.args.map(Eo(this.imageMap,null,n)));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{args:o}))}}})}applyIncremental(e,t){var n,o,r;const{data:i}=e;switch(i.source){case me.Mutation:try{this.applyMutation(i,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,i)}break;case me.Drag:case me.TouchMove:case me.MouseMove:if(t){const e=i.positions[i.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:i}}else i.positions.forEach(n=>{const o={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,i)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(o)}),this.timer.addAction({doAction(){},delay:e.delay-(null===(n=i.positions[0])||void 0===n?void 0:n.timeOffset)});break;case me.MouseInteraction:{if(-1===i.id||t)break;const e=new Event(fe[i.type].toLowerCase()),n=this.mirror.getNode(i.id);if(!n)return this.debugNodeNotFound(i,i.id);this.emitter.emit(ye.MouseInteraction,{type:i.type,target:n});const{triggerFocus:o}=this.config;switch(i.type){case fe.Blur:"blur"in n&&n.blur();break;case fe.Focus:o&&n.focus&&n.focus({preventScroll:!0});break;case fe.Click:case fe.TouchStart:case fe.TouchEnd:t?(i.type===fe.TouchStart?this.touchActive=!0:i.type===fe.TouchEnd&&(this.touchActive=!1),this.mousePos={x:i.x,y:i.y,id:i.id,debugData:i}):(i.type===fe.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x,i.y,i.id,t,i),i.type===fe.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===fe.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===fe.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case fe.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:n.dispatchEvent(e)}break}case me.Scroll:if(-1===i.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);e.scrollData=i;break}this.applyScroll(i,t);break;case me.ViewportResize:this.emitter.emit(ye.Resize,{width:i.width,height:i.height});break;case me.Input:if(-1===i.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);e.inputData=i;break}this.applyInput(i);break;case me.MediaInteraction:{const e=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);const t=e;try{i.currentTime&&(t.currentTime=i.currentTime),i.volume&&(t.volume=i.volume),i.muted&&(t.muted=i.muted),1===i.type&&t.pause(),0===i.type&&t.play(),4===i.type&&(t.playbackRate=i.playbackRate)}catch(e){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${e.message||e}`)}break}case me.StyleSheetRule:case me.StyleDeclaration:this.usingVirtualDom?i.styleId?this.constructedStyleMutations.push(i):i.id&&(null===(o=this.virtualDom.mirror.getNode(i.id))||void 0===o||o.rules.push(i)):this.applyStyleSheetMutation(i);break;case me.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(i.id);if(!t)return this.debugNodeNotFound(i,i.id);t.canvasMutations.push({event:e,mutation:i})}else{const t=this.mirror.getNode(i.id);if(!t)return this.debugNodeNotFound(i,i.id);Ro({event:e,mutation:i,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case me.Font:try{const e=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(e)}catch(e){this.config.showWarning&&console.warn(e)}break;case me.Selection:if(t){this.lastSelectionData=i;break}this.applySelection(i);break;case me.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(i):this.applyAdoptedStyleSheet(i)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,function(e,t=function(){return new yt}(),n=new Bt){(function e(o,r){const i=zt(o,n,t,r);if(null!==i)if("IFRAME"!==(null==r?void 0:r.nodeName)&&o.nodeType!==Dt.DOCUMENT_FRAGMENT_NODE&&(null==r||r.appendChild(i),i.parentNode=r,i.parentElement=r),"IFRAME"===o.nodeName){const t=o.contentDocument;t&&e(t,i)}else o.nodeType!==Dt.DOCUMENT_NODE&&o.nodeType!==Dt.ELEMENT_NODE&&o.nodeType!==Dt.DOCUMENT_FRAGMENT_NODE||(o.nodeType===Dt.ELEMENT_NODE&&o.shadowRoot&&e(o.shadowRoot,i),o.childNodes.forEach(t=>e(t,i)))})(e,null)}(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],n=zt(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.config.showWarning&&console.warn(e)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes.forEach(t=>{var o;const r=n.getNode(t.id);if(!r){if(e.removes.find(e=>e.id===t.parentId))return;return this.warnNodeNotFound(e,t.id)}let i=n.getNode(t.parentId);if(!i)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&le(i)&&(i=i.shadowRoot),n.removeNodeFromMap(r),i)try{i.removeChild(r),this.usingVirtualDom&&"#text"===r.nodeName&&"STYLE"===i.nodeName&&(null===(o=i.rules)||void 0===o?void 0:o.length)>0&&(i.rules=[])}catch(t){if(!(t instanceof DOMException))throw t;this.warn("parent could not remove child in mutation",i,r,e)}});const o=Object.assign({},this.legacy_missingNodeRetryMap),i=[],s=e=>{var t;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let s=n.getNode(e.parentId);if(!s)return e.node.type===r.Document?this.newDocumentQueue.push(e):i.push(e);e.node.isShadow&&(le(s)||s.attachShadow({mode:"open"}),s=s.shadowRoot);let a=null,l=null;if(e.previousId&&(a=n.getNode(e.previousId)),e.nextId&&(l=n.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return i.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;const c=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ie(s,n))return void this.attachDocumentToIframe(e,s);const d=(e,t)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})},u=P(e.node,{doc:c,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(-1===e.previousId||-1===e.nextId)return void(o[e.node.id]={node:u,mutation:e});const h=n.getMeta(s);if(h&&h.type===r.Element&&"textarea"===h.tagName&&e.node.type===r.Text){const e=Array.isArray(s.childNodes)?s.childNodes:Array.from(s.childNodes);for(const t of e)t.nodeType===s.TEXT_NODE&&s.removeChild(t)}if(a&&a.nextSibling&&a.nextSibling.parentNode)s.insertBefore(u,a.nextSibling);else if(l&&l.parentNode)s.contains(l)?s.insertBefore(u,l):s.insertBefore(u,null);else{if(s===c)for(;c.firstChild;)c.removeChild(c.firstChild);s.appendChild(u)}if(d(u,e.node.id),this.usingVirtualDom&&"#text"===u.nodeName&&"STYLE"===s.nodeName&&(null===(t=s.rules)||void 0===t?void 0:t.length)>0&&(s.rules=[]),ie(u,this.mirror)){const e=this.mirror.getId(u),t=this.newDocumentQueue.find(t=>t.parentId===e);t&&(this.attachDocumentToIframe(t,u),this.newDocumentQueue=this.newDocumentQueue.filter(e=>e!==t))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(o,s,u,e)};e.adds.forEach(e=>{s(e)});const a=Date.now();for(;i.length;){const e=oe(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e)n.getNode(t.value.parentId)?re(t,e=>{s(e)}):this.debug("Drop resolve tree since there is no parent for the root node.",t)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),ue(e.texts).forEach(t=>{var o;const r=n.getNode(t.id);if(!r){if(e.removes.find(e=>e.id===t.id))return;return this.warnNodeNotFound(e,t.id)}if(r.textContent=t.value,this.usingVirtualDom){const e=r.parentNode;(null===(o=null==e?void 0:e.rules)||void 0===o?void 0:o.length)>0&&(e.rules=[])}}),e.attributes.forEach(t=>{const o=n.getNode(t.id);if(!o){if(e.removes.find(e=>e.id===t.id))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const r=t.attributes[e];if(null===r)o.removeAttribute(e);else if("string"==typeof r)try{if("_cssText"===e&&("LINK"===o.nodeName||"STYLE"===o.nodeName))try{const e=n.getMeta(o);Object.assign(e.attributes,t.attributes);const r=P(e,{doc:o.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),i=o.nextSibling,s=o.parentNode;if(r&&s){s.removeChild(o),s.insertBefore(r,i),n.replace(t.id,r);break}}catch(e){}o.setAttribute(e,r)}catch(e){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===e){const e=r,t=o;for(const n in e)if(!1===e[n])t.style.removeProperty(n);else if(e[n]instanceof Array){const o=e[n];t.style.setProperty(n,o[0],o[1])}else{const o=e[n];t.style.setProperty(n,o)}}}})}applyScroll(e,t){var n,o;const i=this.mirror.getNode(e.id);if(!i)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(i);if(i===this.iframe.contentDocument)null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==s?void 0:s.type)===r.Document)null===(o=i.defaultView)||void 0===o||o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(e){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}}applySelection(e){try{const t=new Set,n=e.ranges.map(({start:e,startOffset:n,end:o,endOffset:r})=>{const i=this.mirror.getNode(e),s=this.mirror.getNode(o);if(!i||!s)return;const a=new Range;a.setStart(i,n),a.setEnd(s,r);const l=i.ownerDocument,c=null==l?void 0:l.getSelection();return c&&t.add(c),{range:a,selection:c}});t.forEach(e=>e.removeAllRanges()),n.forEach(e=>{var t;return e&&(null===(t=e.selection)||void 0===t?void 0:t.addRange(e.range))})}catch(e){}}applyStyleSheetMutation(e){var t;let n=null;e.styleId?n=this.styleMirror.getStyle(e.styleId):e.id&&(n=(null===(t=this.mirror.getNode(e.id))||void 0===t?void 0:t.sheet)||null),n&&(e.source===me.StyleSheetRule?this.applyStyleSheetRule(e,n):e.source===me.StyleDeclaration&&this.applyStyleDeclaration(e,n))}applyStyleSheetRule(e,t){var n,o,r,i;if(null===(n=e.adds)||void 0===n||n.forEach(({rule:e,index:n})=>{try{if(Array.isArray(n)){const{positions:o,index:r}=de(n);ce(t.cssRules,o).insertRule(e,r)}else{const o=void 0===n?void 0:Math.min(n,t.cssRules.length);null==t||t.insertRule(e,o)}}catch(e){}}),null===(o=e.removes)||void 0===o||o.forEach(({index:e})=>{try{if(Array.isArray(e)){const{positions:n,index:o}=de(e);ce(t.cssRules,n).deleteRule(o||0)}else null==t||t.deleteRule(e)}catch(e){}}),e.replace)try{null===(r=t.replace)||void 0===r||r.call(t,e.replace)}catch(e){}if(e.replaceSync)try{null===(i=t.replaceSync)||void 0===i||i.call(t,e.replaceSync)}catch(e){}}applyStyleDeclaration(e,t){e.set&&ce(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&ce(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const n=this.mirror.getNode(e.id);if(!n)return;null===(t=e.styles)||void 0===t||t.forEach(e=>{var t;let o=null,r=null;if(le(n)?r=(null===(t=n.ownerDocument)||void 0===t?void 0:t.defaultView)||null:"#document"===n.nodeName&&(r=n.defaultView),r)try{o=new r.CSSStyleSheet,this.styleMirror.add(o,e.styleId),this.applyStyleSheetRule({source:me.StyleSheetRule,adds:e.rules},o)}catch(e){}});let o=0;const r=(e,t)=>{const n=t.map(e=>this.styleMirror.getStyle(e)).filter(e=>null!==e);le(e)?e.shadowRoot.adoptedStyleSheets=n:"#document"===e.nodeName&&(e.adoptedStyleSheets=n),n.length!==t.length&&o<10&&(setTimeout(()=>r(e,t),0+100*o),o++)};r(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,o){const{previousId:r,nextId:i}=o,s=r&&e[r],a=i&&e[i];if(s){const{node:o,mutation:r}=s;t.insertBefore(o,n),delete e[r.node.id],delete this.legacy_missingNodeRetryMap[r.node.id],(r.previousId||r.nextId)&&this.legacy_resolveMissingNode(e,t,o,r)}if(a){const{node:o,mutation:r}=a;t.insertBefore(o,n.nextSibling),delete e[r.node.id],delete this.legacy_missingNodeRetryMap[r.node.id],(r.previousId||r.nextId)&&this.legacy_resolveMissingNode(e,t,o,r)}}moveAndHover(e,t,n,o,r){const i=this.mirror.getNode(n);if(!i)return this.debugNodeNotFound(r,n);const s=ae(i,this.iframe),a=e*s.absoluteScale+s.x,l=t*s.absoluteScale+s.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${l}px`,o||this.drawMouseTail({x:a,y:l}),this.hoverElements(i)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:n,strokeStyle:o,duration:r}=!0===this.config.mouseTail?Oo:Object.assign({},Oo,this.config.mouseTail),i=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=o,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(t=>e.lineTo(t.x,t.y)),e.stroke())};this.tailPositions.push(e),i(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(t=>t!==e),i()},r/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach(e=>{e.classList.remove(":hover")});let n=e;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(e){return e.type===pe.IncrementalSnapshot&&e.data.source>me.Mutation&&e.data.source<=me.Input}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(ye.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(xo,`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&console.warn(xo,...e)}debug(...e){this.config.showDebug&&console.log(xo,...e)}}}}]);
3
+ //# sourceMappingURL=546.flowgrid.min.js.map
@@ -0,0 +1,14 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */