@antglobal/rlog-sdk 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,7 @@ declare function cancelRecord(options?: {
17
17
  clearData?: boolean;
18
18
  }): void;
19
19
  declare function addCustomEvent(tagName: string, payload: any): void;
20
+ declare function takeFullSnapshot(isCheckout?: boolean): void;
20
21
  declare function setConsumeOnlyMode(enable: boolean): void;
21
22
  declare function isConsumeOnlyMode(): boolean;
22
23
  declare function toggleConsumeOnlyMode(): boolean;
@@ -34,5 +35,5 @@ declare const debug: {
34
35
  clearStorage(): Promise<void>;
35
36
  getConfig: typeof getConfig;
36
37
  };
37
- export { init, cancelRecord, addCustomEvent, setConsumeOnlyMode, isConsumeOnlyMode, toggleConsumeOnlyMode, updateRouterConfig, getCurrentRouteInfo, manualRouteChange, stopRouterMonitor, shouldRecordUrl, setCustomHeaders, getCustomHeaders, setWhiteListUrls, setBlackListUrls, getBlackListUrls, getWhiteListUrls, getSdkLogEndpoint, reportError, cleanupErrorHandler, debug, };
38
+ export { init, cancelRecord, addCustomEvent, takeFullSnapshot, setConsumeOnlyMode, isConsumeOnlyMode, toggleConsumeOnlyMode, updateRouterConfig, getCurrentRouteInfo, manualRouteChange, stopRouterMonitor, shouldRecordUrl, setCustomHeaders, getCustomHeaders, setWhiteListUrls, setBlackListUrls, getBlackListUrls, getWhiteListUrls, getSdkLogEndpoint, reportError, cleanupErrorHandler, debug, };
38
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,aAAa,CAAC;AAQnE,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,IAAI,CAAC,KAAK,EAAE,MAAM;uBAQL;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;EAQ5C;AAED,iBAAS,YAAY,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,QAS1D;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAMpD;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED,iBAAS,iBAAiB,IAAI,OAAO,CAKpC;AAED,iBAAS,qBAAqB,IAAI,OAAO,CAIxC;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CA6BhD;AAED,QAAA,MAAM,KAAK;6BACgB,MAAM;;;;;;;;;;;CAgBhC,CAAC;AAGF,OAAO,EAEL,IAAI,EACJ,YAAY,EAEZ,cAAc,EAEd,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EAErB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAEjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAEjB,WAAW,EACX,mBAAmB,EAEnB,KAAK,GACN,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,aAAa,CAAC;AAQnE,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,IAAI,CAAC,KAAK,EAAE,MAAM;uBAQL;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;EAQ5C;AAED,iBAAS,YAAY,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,QAS1D;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAMpD;AAED,iBAAS,gBAAgB,CAAC,UAAU,CAAC,EAAE,OAAO,QAM7C;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED,iBAAS,iBAAiB,IAAI,OAAO,CAKpC;AAED,iBAAS,qBAAqB,IAAI,OAAO,CAIxC;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CA6BhD;AAED,QAAA,MAAM,KAAK;6BACgB,MAAM;;;;;;;;;;;CAgBhC,CAAC;AAGF,OAAO,EAEL,IAAI,EACJ,YAAY,EAEZ,cAAc,EAEd,gBAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EAErB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAEjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAEjB,WAAW,EACX,mBAAmB,EAEnB,KAAK,GACN,CAAC"}
package/dist/esm/index.js CHANGED
@@ -46,6 +46,13 @@ function addCustomEvent(tagName, payload) {
46
46
  logger.warn('Failed to add custom event:', error);
47
47
  }
48
48
  }
49
+ function takeFullSnapshot(isCheckout) {
50
+ try {
51
+ record.takeFullSnapshot(isCheckout);
52
+ } catch (error) {
53
+ logger.warn('Failed to take full snapshot:', error);
54
+ }
55
+ }
49
56
  function setConsumeOnlyMode(enable) {
50
57
  updateConfig({
51
58
  consumeOnly: enable
@@ -136,6 +143,8 @@ export {
136
143
  init, cancelRecord,
137
144
  // 自定义事件
138
145
  addCustomEvent,
146
+ // 全量快照
147
+ takeFullSnapshot,
139
148
  // 只采集不上报模式
140
149
  setConsumeOnlyMode, isConsumeOnlyMode, toggleConsumeOnlyMode,
141
150
  // 路由监控
@@ -17,6 +17,7 @@ declare function cancelRecord(options?: {
17
17
  clearData?: boolean;
18
18
  }): void;
19
19
  declare function addCustomEvent(tagName: string, payload: any): void;
20
+ declare function takeFullSnapshot(isCheckout?: boolean): void;
20
21
  declare function setConsumeOnlyMode(enable: boolean): void;
21
22
  declare function isConsumeOnlyMode(): boolean;
22
23
  declare function toggleConsumeOnlyMode(): boolean;
@@ -34,5 +35,5 @@ declare const debug: {
34
35
  clearStorage(): Promise<void>;
35
36
  getConfig: typeof getConfig;
36
37
  };
37
- export { init, cancelRecord, addCustomEvent, setConsumeOnlyMode, isConsumeOnlyMode, toggleConsumeOnlyMode, updateRouterConfig, getCurrentRouteInfo, manualRouteChange, stopRouterMonitor, shouldRecordUrl, setCustomHeaders, getCustomHeaders, setWhiteListUrls, setBlackListUrls, getBlackListUrls, getWhiteListUrls, getSdkLogEndpoint, reportError, cleanupErrorHandler, debug, };
38
+ export { init, cancelRecord, addCustomEvent, takeFullSnapshot, setConsumeOnlyMode, isConsumeOnlyMode, toggleConsumeOnlyMode, updateRouterConfig, getCurrentRouteInfo, manualRouteChange, stopRouterMonitor, shouldRecordUrl, setCustomHeaders, getCustomHeaders, setWhiteListUrls, setBlackListUrls, getBlackListUrls, getWhiteListUrls, getSdkLogEndpoint, reportError, cleanupErrorHandler, debug, };
38
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,aAAa,CAAC;AAQnE,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,IAAI,CAAC,KAAK,EAAE,MAAM;uBAQL;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;EAQ5C;AAED,iBAAS,YAAY,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,QAS1D;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAMpD;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED,iBAAS,iBAAiB,IAAI,OAAO,CAKpC;AAED,iBAAS,qBAAqB,IAAI,OAAO,CAIxC;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CA6BhD;AAED,QAAA,MAAM,KAAK;6BACgB,MAAM;;;;;;;;;;;CAgBhC,CAAC;AAGF,OAAO,EAEL,IAAI,EACJ,YAAY,EAEZ,cAAc,EAEd,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EAErB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAEjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAEjB,WAAW,EACX,mBAAmB,EAEnB,KAAK,GACN,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,aAAa,CAAC;AAQnE,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,iBAAS,IAAI,CAAC,KAAK,EAAE,MAAM;uBAQL;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;EAQ5C;AAED,iBAAS,YAAY,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,QAS1D;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAMpD;AAED,iBAAS,gBAAgB,CAAC,UAAU,CAAC,EAAE,OAAO,QAM7C;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED,iBAAS,iBAAiB,IAAI,OAAO,CAKpC;AAED,iBAAS,qBAAqB,IAAI,OAAO,CAIxC;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CA6BhD;AAED,QAAA,MAAM,KAAK;6BACgB,MAAM;;;;;;;;;;;CAgBhC,CAAC;AAGF,OAAO,EAEL,IAAI,EACJ,YAAY,EAEZ,cAAc,EAEd,gBAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EAErB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAEjB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAEjB,WAAW,EACX,mBAAmB,EAEnB,KAAK,GACN,CAAC"}
package/dist/lib/index.js CHANGED
@@ -82,6 +82,7 @@ Object.defineProperty(exports, "stopRouterMonitor", {
82
82
  return _routerMonitor.stopRouterMonitor;
83
83
  }
84
84
  });
85
+ exports.takeFullSnapshot = takeFullSnapshot;
85
86
  exports.toggleConsumeOnlyMode = toggleConsumeOnlyMode;
86
87
  Object.defineProperty(exports, "updateRouterConfig", {
87
88
  enumerable: true,
@@ -138,6 +139,13 @@ function addCustomEvent(tagName, payload) {
138
139
  _logger.default.warn('Failed to add custom event:', error);
139
140
  }
140
141
  }
142
+ function takeFullSnapshot(isCheckout) {
143
+ try {
144
+ _rrweb.record.takeFullSnapshot(isCheckout);
145
+ } catch (error) {
146
+ _logger.default.warn('Failed to take full snapshot:', error);
147
+ }
148
+ }
141
149
  function setConsumeOnlyMode(enable) {
142
150
  (0, _config.updateConfig)({
143
151
  consumeOnly: enable
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Rlog=t():e.Rlog=t()}(self,(function(){return function(){var e={982:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),i=a[0],s=a[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,s)),l=0,f=s>0?i-4:i;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=16383,s=0,u=n-o;s<u;s+=i)a.push(c(e,s,s+i>u?u:s+i));1===o?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=a.length;i<s;++i)r[i]=a[i],n[a.charCodeAt(i)]=i;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,a,i=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},825:function(e,t,r){"use strict";var n=r(982),o=r(501),a=r(664);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(t,r);e=s(e,n);var o=e.write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|p(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|p(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var a,i=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var l=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*i}else-1!==l&&(a-=a-l),l=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var f=!0,d=0;d<u;d++)if(c(e,a+d)!==c(t,d)){f=!1;break}if(f)return a}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))return i;e[r+i]=s}return i}function I(e,t,r,n){return j(G(t,e.length-r),e,r,n)}function b(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return b(e,t,r,n)}function S(e,t,r,n){return j(K(t),e,r,n)}function k(e,t,r,n){return j(function(e,t){for(var r,n,o,a=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var a,i,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[o+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(u=(15&c)<<12|(63&a)<<6|63&i)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[o+1],i=e[o+2],s=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));return r}(n)}t.lW=u,t.h2=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.g.TYPED_ARRAY_SUPPORT?r.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),s=Math.min(a,i),c=this.slice(n,o),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){a=c[f],i=l[f];break}return a<i?-1:i<a?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return I(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return C(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function M(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=t;a<r;++a)o+=W(e[a]);return o}function O(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,o,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-r,2);o<a;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function _(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-r,4);o<a;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function F(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,a){return a||F(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,a){return a||F(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;r=new u(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,o=1,a=this[e+--n];n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=0,i=1,s=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=r-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,a=n-r;if(this===e&&r<t&&t<n)for(o=a-1;o>=0;--o)e[o+t]=this[o+r];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var i=u.isBuffer(e)?e:G(new u(e,n).toString()),s=i.length;for(a=0;a<r-t;++a)this[a+t]=i[a%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,o=null,a=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function K(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}},501:function(e,t){t.read=function(e,t,r,n,o){var a,i,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,n),a-=c}return(p?-1:1)*i*Math.pow(2,a-n)},t.write=function(e,t,r,n,o,a){var i,s,u,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(i++,u/=2),i+f>=l?(s=0,i=l):i+f>=1?(s=(t*u-1)*Math.pow(2,o),i+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(i=i<<o|s,c+=o;c>0;e[r+p]=255&i,p+=h,i/=256,c-=8);e[r+p-h]|=128*g}},664:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},619:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=i(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||i(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},389:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},361:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},461:function(e,t,r){var n=r(389);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},468:function(e){function t(e,t,r,n,o,a,i){try{var s=e[a](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=e.apply(r,n);function s(e){t(i,o,a,s,u,"next",e)}function u(e){t(i,o,a,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},745:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},776:function(e,t,r){var n=r(284);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},305:function(e,t,r){var n=r(848);e.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}},e.exports.__esModule=!0,e.exports.default=e.exports},254:function(e,t,r){var n=r(284);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},48:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},785:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},746:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},474:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},227:function(e,t,r){var n=r(254);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},658:function(e,t,r){var n=r(978).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,i=a.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof w?t:w,a=Object.create(o.prototype),i=new L(n||[]);return s(a,"_invoke",{value:T(e,r,i)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var g="suspendedStart",v="executing",m="completed",y={};function w(){}function I(){}function b(){}var C={};d(C,c,(function(){return this}));var S=Object.getPrototypeOf,k=S&&S(S(N([])));k&&k!==a&&i.call(k,c)&&(C=k);var x=b.prototype=w.prototype=Object.create(C);function A(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,a,s,u){var c=h(e[o],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function T(e,r,n){var o=g;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var u=R(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function R(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return I.prototype=b,s(x,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:I,configurable:!0}),I.displayName=d(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,f,"GeneratorFunction")),e.prototype=Object.create(x),e},r.awrap=function(e){return{__await:e}},A(E.prototype),d(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new E(p(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(x),d(x,f,"Generator"),d(x,c,(function(){return this})),d(x,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},257:function(e,t,r){var n=r(361),o=r(785),a=r(848),i=r(746);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},480:function(e,t,r){var n=r(461),o=r(48),a=r(848),i=r(474);e.exports=function(e){return n(e)||o(e)||a(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},478:function(e,t,r){var n=r(978).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},284:function(e,t,r){var n=r(978).default,o=r(478);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},978:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},848:function(e,t,r){var n=r(389);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{addCustomEvent:function(){return Oa},cancelRecord:function(){return Ma},cleanupErrorHandler:function(){return Sa},debug:function(){return Fa},getBlackListUrls:function(){return Xn},getCurrentRouteInfo:function(){return ha},getCustomHeaders:function(){return eo},getSdkLogEndpoint:function(){return Qn},getWhiteListUrls:function(){return qn},init:function(){return Ra},isConsumeOnlyMode:function(){return Na},manualRouteChange:function(){return ga},reportError:function(){return _a},setBlackListUrls:function(){return zn},setConsumeOnlyMode:function(){return La},setCustomHeaders:function(){return $n},setWhiteListUrls:function(){return Jn},shouldRecordUrl:function(){return Wn},stopRouterMonitor:function(){return va},toggleConsumeOnlyMode:function(){return Da},updateRouterConfig:function(){return sa}});var e,t=r(658),o=r.n(t),a=r(468),i=r.n(a),s=r(978),u=r.n(s),c=r(254),l=r.n(c),f=r(227),d=r.n(f),p=r(305),h=r.n(p);function g(e){return e.nodeType===e.ELEMENT_NODE}function v(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function m(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function y(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(w).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function w(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=y(e.styleSheet)||t}catch(e){}return t}!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"}(e||(e={}));var I=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-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,r=this.getId(e);this.idNodeMap.delete(r),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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function b(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,a=e.maskInputFn,i=o||"";return(t[r.toLowerCase()]||t[n])&&(i=a?a(i):"*".repeat(i.length)),i}var C="__rrweb_original__";var S,k,x=1,A=new RegExp("[^a-z0-9-_:]");function E(){return x++}var T=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,M=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(T,(function(e,r,n,o,a,i){var s,u=n||a||i,c=r||o||"";if(!u)return e;if(!R.test(u))return"url(".concat(c).concat(u).concat(c,")");if(M.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=t.split("/"),f=u.split("/");l.pop();for(var d=0,p=f;d<p.length;d++){var h=p[d];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var L=/^[^ \t\n\r\u000c]+/,N=/^[, \t\n\r\u000c]+/;function D(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function _(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function F(){var e=document.createElement("a");return e.href="",e.href}function U(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?D(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(N),!(r>=t.length);){var a=n(L);if(","===a.slice(-1))a=D(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=D(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?O(n,F()):"object"===t&&"data"===r&&n?D(e,n):n:D(e,n)}function B(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&B(e.parentNode,t,r);for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&B(e.parentNode,t,r)}function P(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(B(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function W(t,r){var n=r.doc,o=r.mirror,a=r.blockClass,i=r.blockSelector,s=r.maskTextClass,u=r.maskTextSelector,c=r.inlineStylesheet,l=r.maskInputOptions,f=void 0===l?{}:l,d=r.maskTextFn,p=r.maskInputFn,h=r.dataURLOptions,g=void 0===h?{}:h,v=r.inlineImages,m=r.recordCanvas,w=r.keepIframeSrcFn,I=r.newlyAddedElement,x=void 0!==I&&I,E=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,o=r.blockClass,a=r.blockSelector,i=r.inlineStylesheet,s=r.maskInputOptions,u=void 0===s?{}:s,c=r.maskInputFn,l=r.dataURLOptions,f=void 0===l?{}:l,d=r.inlineImages,p=r.recordCanvas,h=r.keepIframeSrcFn,g=r.newlyAddedElement,v=void 0!==g&&g,m=r.rootId,w=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(t,o,a),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return A.test(t)?"div":t}(t),x={},E=t.attributes.length,T=0;T<E;T++){var R=t.attributes[T];x[R.name]=U(n,I,R.name,R.value)}if("link"===I&&i){var M=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),L=null;M&&(L=y(M)),L&&(delete x.rel,delete x.href,x._cssText=O(L,M.href))}if("style"===I&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(L=y(t.sheet))&&(x._cssText=O(L,F()))}if("input"===I||"textarea"===I||"select"===I){var N=t.value,D=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&N?x.value=b({type:x.type,tagName:I,value:N,maskInputOptions:u,maskInputFn:c}):D&&(x.checked=D)}"option"===I&&(t.selected&&!u.select?x.selected=!0:delete x.selected);if("canvas"===I&&p)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,a=C in o?o[C]:o;if(new Uint32Array(a.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var B=t.toDataURL(f.type,f.quality),P=document.createElement("canvas");P.width=t.width,P.height=t.height,B!==P.toDataURL(f.type,f.quality)&&(x.rr_dataURL=B)}if("img"===I&&d){S||(S=n.createElement("canvas"),k=S.getContext("2d"));var W=t,G=W.crossOrigin;W.crossOrigin="anonymous";var K=function(){try{S.width=W.naturalWidth,S.height=W.naturalHeight,k.drawImage(W,0,0),x.rr_dataURL=S.toDataURL(f.type,f.quality)}catch(e){console.warn("Cannot inline img src=".concat(W.currentSrc,"! Error: ").concat(e))}G?x.crossOrigin=G:W.removeAttribute("crossorigin")};W.complete&&0!==W.naturalWidth?K():W.onload=K}"audio"!==I&&"video"!==I||(x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime);v||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop));if(w){var j=t.getBoundingClientRect(),Y=j.width,Z=j.height;x={class:x.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(Z,"px")}}"iframe"!==I||h(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);return{type:e.Element,tagName:I,attributes:x,childNodes:[],isSVG:_(t)||void 0,needBlock:w,rootId:m}}(t,{doc:n,blockClass:a,blockSelector:i,inlineStylesheet:c,maskInputOptions:f,maskInputFn:p,dataURLOptions:g,inlineImages:v,recordCanvas:m,keepIframeSrcFn:w,newlyAddedElement:x,rootId:E});case t.TEXT_NODE:return function(t,r){var n,o=r.maskTextClass,a=r.maskTextSelector,i=r.maskTextFn,s=r.rootId,u=t.parentNode&&t.parentNode.tagName,c=t.textContent,l="STYLE"===u||void 0,f="SCRIPT"===u||void 0;if(l&&c){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(d=t.parentNode.sheet).cssRules?Array.from(d.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}c=O(c,F())}var d;f&&(c="SCRIPT_PLACEHOLDER");!l&&!f&&c&&P(t,o,a)&&(c=i?i(c):c.replace(/[\S]/g,"*"));return{type:e.Text,textContent:c||"",isStyle:l,rootId:s}}(t,{maskTextClass:s,maskTextSelector:u,maskTextFn:d,rootId:E});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function G(e){return void 0===e?"":e.toLowerCase()}function K(t,r){var n,o=r.doc,a=r.mirror,i=r.blockClass,s=r.blockSelector,u=r.maskTextClass,c=r.maskTextSelector,l=r.skipChild,f=void 0!==l&&l,d=r.inlineStylesheet,p=void 0===d||d,h=r.maskInputOptions,y=void 0===h?{}:h,w=r.maskTextFn,I=r.maskInputFn,b=r.slimDOMOptions,C=r.dataURLOptions,S=void 0===C?{}:C,k=r.inlineImages,x=void 0!==k&&k,A=r.recordCanvas,T=void 0!==A&&A,R=r.onSerialize,M=r.onIframeLoad,O=r.iframeLoadTimeout,L=void 0===O?5e3:O,N=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=void 0===D?5e3:D,F=r.keepIframeSrcFn,U=void 0===F?function(){return!1}:F,B=r.newlyAddedElement,P=void 0!==B&&B,j=r.preserveWhiteSpace,Y=void 0===j||j,Z=W(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,dataURLOptions:S,inlineImages:x,recordCanvas:T,keepIframeSrcFn:U,newlyAddedElement:P});if(!Z)return console.warn(t,"not serialized"),null;n=a.hasNode(t)?a.getId(t):!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(G(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===G(t.attributes.name)||"icon"===G(t.attributes.rel)||"apple-touch-icon"===G(t.attributes.rel)||"shortcut icon"===G(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&G(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(G(t.attributes.property).match(/^(og|twitter|fb):/)||G(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===G(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===G(t.attributes.name)||"googlebot"===G(t.attributes.name)||"bingbot"===G(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===G(t.attributes.name)||"generator"===G(t.attributes.name)||"framework"===G(t.attributes.name)||"publisher"===G(t.attributes.name)||"progid"===G(t.attributes.name)||G(t.attributes.property).match(/^article:/)||G(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===G(t.attributes.name)||"yandex-verification"===G(t.attributes.name)||"csrf-token"===G(t.attributes.name)||"p:domain_verify"===G(t.attributes.name)||"verify-v1"===G(t.attributes.name)||"verification"===G(t.attributes.name)||"shopify-checkout-api-token"===G(t.attributes.name)))return!0}}return!1}(Z,b)&&(Y||Z.type!==e.Text||Z.isStyle||Z.textContent.replace(/^\s+|\s+$/gm,"").length)?E():-2;var V=Object.assign(Z,{id:n});if(a.add(t,V),-2===n)return null;R&&R(t);var H=!f;if(V.type===e.Element){H=H&&!V.needBlock,delete V.needBlock;var J=t.shadowRoot;J&&m(J)&&(V.isShadowHost=!0)}if((V.type===e.Document||V.type===e.Element)&&H){b.headWhitespace&&V.type===e.Element&&"head"===V.tagName&&(Y=!1);for(var q={doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:f,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:U},z=0,X=Array.from(t.childNodes);z<X.length;z++){(ee=K(X[z],q))&&V.childNodes.push(ee)}if(g(t)&&t.shadowRoot)for(var Q=0,$=Array.from(t.shadowRoot.childNodes);Q<$.length;Q++){var ee;(ee=K($[Q],q))&&(m(t.shadowRoot)&&(ee.isShadow=!0),V.childNodes.push(ee))}}return t.parentNode&&v(t.parentNode)&&m(t.parentNode)&&(V.isShadow=!0),V.type===e.Element&&"iframe"===V.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,a=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&M){var r=K(e,{doc:e,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:U});r&&M(t,r)}}),L),V.type===e.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(e,t,r){var n,o=!1;try{n=e.sheet}catch(e){return}if(!n){var a=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(t,(function(){if(N){var e=K(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:U});e&&N(t,e)}}),_),V}function j(e,t){var r=t||{},n=r.mirror,o=void 0===n?new I:n,a=r.blockClass,i=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,c=r.maskTextClass,l=void 0===c?"rr-mask":c,f=r.maskTextSelector,d=void 0===f?null:f,p=r.inlineStylesheet,h=void 0===p||p,g=r.inlineImages,v=void 0!==g&&g,m=r.recordCanvas,y=void 0!==m&&m,w=r.maskAllInputs,b=void 0!==w&&w,C=r.maskTextFn,S=r.maskInputFn,k=r.slimDOM,x=void 0!==k&&k,A=r.dataURLOptions,E=r.preserveWhiteSpace,T=r.onSerialize,R=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn;return K(e,{doc:e,mirror:o,blockClass:i,blockSelector:u,maskTextClass:l,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===x,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===x?{}:x,dataURLOptions:A,inlineImages:v,recordCanvas:y,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:R,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}var Y=/([^\\]):hover/;new RegExp(Y.source,"g");var Z=r(257),V=r.n(Z),H=r(480),J=r(745),q=r.n(J),z=r(776),X=r.n(z);function Q(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),function(){return r.removeEventListener(e,t,n)}}var $="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.",ee={map:{},getId:function(){return console.error($),-1},getNode:function(){return console.error($),null},removeNodeFromMap:function(){console.error($)},has:function(){return console.error($),!1},reset:function(){console.error($)}};function te(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var u=Date.now();o||!1!==r.leading||(o=u);var c=t-(u-o),l=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=u,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout((function(){o=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)}),c))}}function re(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set:function(e){var t=this;setTimeout((function(){r.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return re(e,t,a||{},!0)}}function ne(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}function oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ae(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ie(e,t,r,n){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(B(o,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function se(e,t){return-2===t.getId(e)}function ue(e,t){if(v(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function le(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r[0];if(!(0 in r))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}function fe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function de(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function pe(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,r){return"map"===t&&console.error($),Reflect.get(e,t,r)}}));var he=function(){function e(){J(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return z(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}(),ge=function(e){return 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}(ge||{}),ve=function(e){return 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}(ve||{}),me=function(e){return 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}(me||{}),ye=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(ye||{});function we(e){return"__ln"in e}var Ie=function(){function e(){J(this,e),this.length=0,this.head=null}return z(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&we(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&we(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}]),e}(),be=function(e,t){return"".concat(e,"@").concat(t)},Ce=function(){function e(){var t=this;J(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],r=new Ie,n=function(e){for(var r=e,n=-2;-2===n;)n=(r=r&&r.nextSibling)&&t.mirror.getId(r);return n},o=function(o){var a,i,s,u,c=null;(null===(i=null===(a=o.getRootNode)||void 0===a?void 0:a.call(o))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(c=o.getRootNode().host);for(var l=c;(null===(u=null===(s=null==l?void 0:l.getRootNode)||void 0===s?void 0:s.call(l))||void 0===u?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;var f=!(t.doc.contains(o)||l&&t.doc.contains(l));if(o.parentNode&&!f){var d=v(o.parentNode)?t.mirror.getId(c):t.mirror.getId(o.parentNode),p=n(o);if(-1===d||-1===p)return r.addNode(o);var h=K(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){fe(e,t.mirror)&&t.iframeManager.addIframe(e),de(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),pe(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,r){t.iframeManager.attachIframe(e,r),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,r){t.stylesheetManager.attachLinkElement(e,r)}});h&&e.push({parentId:d,nextId:p,node:h})}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=0,i=Array.from(t.movedSet.values());a<i.length;a++){var s=i[a];ke(t.removes,s,t.mirror)&&!t.movedSet.has(s.parentNode)||o(s)}for(var u=0,c=Array.from(t.addedSet.values());u<c.length;u++){var l=c[u];Ae(t.droppedSet,l)||ke(t.removes,l,t.mirror)?Ae(t.movedSet,l)?o(l):t.droppedSet.add(l):o(l)}for(var f=null;r.length;){var d=null;if(f){var p=t.mirror.getId(f.value.parentNode),h=n(f.value);-1!==p&&-1!==h&&(d=f)}if(!d)for(var g=r.length-1;g>=0;g--){var m=r.get(g);if(m){var y=t.mirror.getId(m.value.parentNode);if(-1===n(m.value))continue;if(-1!==y){d=m;break}var w=m.value;if(w.parentNode&&w.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var I=w.parentNode.host;if(-1!==t.mirror.getId(I)){d=m;break}}}}if(!d){for(;r.head;)r.removeNode(r.head.value);break}f=d.previous,r.removeNode(d.value),o(d.value)}var b={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){return{id:t.mirror.getId(e.node),attributes:e.attributes}})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(b.texts.length||b.attributes.length||b.removes.length||b.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(b))}},this.processMutation=function(e){if(!se(e.target,t.mirror))switch(e.type){case"characterData":var r=e.target.textContent;ie(e.target,t.blockClass,t.blockSelector,!1)||r===e.oldValue||t.texts.push({value:P(e.target,t.maskTextClass,t.maskTextSelector)&&r?t.maskTextFn?t.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var n=e.target,o=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(o=b({maskInputOptions:t.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:o,maskInputFn:t.maskInputFn})),ie(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var a=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===n.tagName&&"src"===e.attributeName&&!t.keepIframeSrcFn(o)){if(n.contentDocument)return;e.attributeName="rr_src"}if(a||(a={node:e.target,attributes:{}},t.attributes.push(a)),"style"===e.attributeName){var i=t.doc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue),void 0!==a.attributes.style&&null!==a.attributes.style||(a.attributes.style={});for(var s=a.attributes.style,u=0,c=Array.from(n.style);u<c.length;u++){var l=c[u],f=n.style.getPropertyValue(l),d=n.style.getPropertyPriority(l);f===i.style.getPropertyValue(l)&&d===i.style.getPropertyPriority(l)||(s[l]=""===d?f:[f,d])}for(var p=0,h=Array.from(i.style);p<h.length;p++){var g=h[p];""===n.style.getPropertyValue(g)&&(s[g]=!1)}}else a.attributes[e.attributeName]=U(t.doc,n.tagName,e.attributeName,o);break;case"childList":if(ie(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(r){return t.genAdds(r,e.target)})),e.removedNodes.forEach((function(r){var n=t.mirror.getId(r),o=v(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);ie(e.target,t.blockClass,t.blockSelector,!1)||se(r,t.mirror)||!function(e,t){return-1!==t.getId(e)}(r,t.mirror)||(t.addedSet.has(r)?(Se(t.addedSet,r),t.droppedSet.add(r)):t.addedSet.has(e.target)&&-1===n||ue(e.target,t.mirror)||(t.movedSet.has(r)&&t.movedMap[be(n,o)]?Se(t.movedSet,r):t.removes.push({parentId:o,id:n,isShadow:!(!v(e.target)||!m(e.target))||void 0})),t.mapRemoves.push(r))}))}},this.genAdds=function(e,r){if(t.mirror.hasNode(e)){if(se(e,t.mirror))return;t.movedSet.add(e);var n=null;r&&t.mirror.hasNode(r)&&(n=t.mirror.getId(r)),n&&-1!==n&&(t.movedMap[be(t.mirror.getId(e),n)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);ie(e,t.blockClass,t.blockSelector,!1)||e.childNodes.forEach((function(e){return t.genAdds(e)}))}}return z(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((function(r){t[r]=e[r]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Se(e,t){e.delete(t),t.childNodes.forEach((function(t){return Se(e,t)}))}function ke(e,t,r){return 0!==e.length&&xe(e,t,r)}function xe(e,t,r){var n=t.parentNode;if(!n)return!1;var o=r.getId(n);return!!e.some((function(e){return e.id===o}))||xe(e,n,r)}function Ae(e,t){return 0!==e.size&&Ee(e,t)}function Ee(e,t){var r=t.parentNode;return!!r&&(!!e.has(r)||Ee(e,r))}var Te=[],Re="undefined"!=typeof CSSGroupingRule,Me="undefined"!=typeof CSSMediaRule,Oe="undefined"!=typeof CSSSupportsRule,Le="undefined"!=typeof CSSConditionRule;function Ne(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function De(e,t){var r,n,o=new Ce;Te.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function _e(e){var t=e.mousemoveCb,r=e.sampling,n=e.doc,o=e.mirror;if(!1===r.mousemove)return function(){};var a,i="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],c=te((function(e){var r=Date.now()-a;t(u.map((function(e){return e.timeOffset-=r,e})),e),u=[],a=null}),s),l=te((function(e){var t=Ne(e),r=ce(e)?e.changedTouches[0]:e,n=r.clientX,i=r.clientY;a||(a=Date.now()),u.push({x:n,y:i,id:o.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?ve.Drag:e instanceof MouseEvent?ve.MouseMove:ve.TouchMove)}),i,{trailing:!1}),f=[Q("mousemove",l,n),Q("touchmove",l,n),Q("drag",l,n)];return function(){f.forEach((function(e){return e()}))}}function Fe(e){var t=e.mouseInteractionCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,u=[];return Object.keys(me).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=e.toLowerCase(),s=function(e){return function(r){var i=Ne(r);if(!ie(i,o,a,!0)){var s=ce(r)?r.changedTouches[0]:r;if(s){var u=n.getId(i),c=s.clientX,l=s.clientY;t({type:me[e],id:u,x:c,y:l})}}}}(e);u.push(Q(i,s,r))})),function(){u.forEach((function(e){return e()}))}}function Ue(e){var t=e.scrollCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector;return Q("scroll",te((function(e){var i=Ne(e);if(i&&!ie(i,o,a,!0)){var s=n.getId(i);if(i===r){var u=r.scrollingElement||r.documentElement;t({id:s,x:u.scrollLeft,y:u.scrollTop})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),r)}function Be(e){var t=e.viewportResizeCb,r=-1,n=-1;return Q("resize",te((function(){var e=oe(),o=ae();r===e&&n===o||(t({width:Number(o),height:Number(e)}),r=e,n=o)}),200),window)}function Pe(e,t){var r=Object.assign({},e);return t||delete r.userTriggered,r}var We=["INPUT","TEXTAREA","SELECT"],Ge=new WeakMap;function Ke(e){var t=e.inputCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.maskInputOptions,u=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function f(e){var t=Ne(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(We.indexOf(t.tagName)<0)&&!ie(t,o,a,!0)){var c=t.type;if(!t.classList.contains(i)){var f=t.value,p=!1;"radio"===c||"checkbox"===c?p=t.checked:(s[t.tagName.toLowerCase()]||s[c])&&(f=b({maskInputOptions:s,tagName:t.tagName,type:c,value:f,maskInputFn:u})),d(t,Pe({text:f,isChecked:p,userTriggered:n},l));var h=t.name;"radio"===c&&h&&p&&r.querySelectorAll('input[type="radio"][name="'.concat(h,'"]')).forEach((function(e){e!==t&&d(e,Pe({text:e.value,isChecked:!p,userTriggered:!1},l))}))}}}function d(e,r){var o=Ge.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Ge.set(e,r);var a=n.getId(e);t(Object.assign(Object.assign({},r),{id:a}))}}var p=("last"===c.input?["change"]:["input","change"]).map((function(e){return Q(e,f,r)})),h=r.defaultView;if(!h)return function(){p.forEach((function(e){return e()}))};var g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),v=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push.apply(p,H(v.map((function(e){return re(e[0],e[1],{set:function(){f({target:this})}},!1,h)})))),function(){p.forEach((function(e){return e()}))}}function je(e){return function(e,t){if(Re&&e.parentRule instanceof CSSGroupingRule||Me&&e.parentRule instanceof CSSMediaRule||Oe&&e.parentRule instanceof CSSSupportsRule||Le&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ye(e,t,r){var n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Ze(e,t){var r=e.styleSheetRuleCb,n=e.mirror,o=e.stylesheetManager,a=t.win,i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var a=Ye(this,n,o.styleMirror),s=a.id,u=a.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:t}]}),i.apply(this,[e,t])};var s,u,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=Ye(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,removes:[{index:e}]}),c.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=function(e){var t=Ye(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replace:e}),s.apply(this,[e])}),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=function(e){var t=Ye(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replaceSync:e}),u.apply(this,[e])});var l={};Re?l.CSSGroupingRule=a.CSSGroupingRule:(Me&&(l.CSSMediaRule=a.CSSMediaRule),Le&&(l.CSSConditionRule=a.CSSConditionRule),Oe&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=Z(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(e,t){var i=Ye(this.parentStyleSheet,n,o.styleMirror),s=i.id,u=i.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:[].concat(H(je(this)),[t||0])}]}),f[a].insertRule.apply(this,[e,t])},i.prototype.deleteRule=function(e){var t=Ye(this.parentStyleSheet,n,o.styleMirror),i=t.id,s=t.styleId;return(i&&-1!==i||s&&-1!==s)&&r({id:i,styleId:s,removes:[{index:[].concat(H(je(this)),[e])}]}),f[a].deleteRule.apply(this,[e])}})),function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=c,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(e){var t=Z(e,2),r=t[0],n=t[1];n.prototype.insertRule=f[r].insertRule,n.prototype.deleteRule=f[r].deleteRule}))}}function Ve(e,t){var r,n,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var u="#document"===t.nodeName?null===(r=t.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&u&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,r=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return r}}),function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):function(){}}function He(e,t){var r=e.styleDeclarationCb,n=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var u;if(o.has(e))return s.apply(this,[e,t,i]);var c=Ye(null===(u=this.parentRule)||void 0===u?void 0:u.parentStyleSheet,n,a.styleMirror),l=c.id,f=c.styleId;return(l&&-1!==l||f&&-1!==f)&&r({id:l,styleId:f,set:{property:e,value:t,priority:i},index:je(this.parentRule)}),s.apply(this,[e,t,i])};var u=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t;if(o.has(e))return u.apply(this,[e]);var i=Ye(null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet,n,a.styleMirror),s=i.id,c=i.styleId;return(s&&-1!==s||c&&-1!==c)&&r({id:s,styleId:c,remove:{property:e},index:je(this.parentRule)}),u.apply(this,[e])},function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=u}}function Je(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.blockSelector,o=e.mirror,a=e.sampling,i=function(e){return te((function(a){var i=Ne(a);if(i&&!ie(i,r,n,!0)){var s=i.currentTime,u=i.volume,c=i.muted,l=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:u,muted:c,playbackRate:l})}}),a.media||500)},s=[Q("play",i(0)),Q("pause",i(1)),Q("seeked",i(2)),Q("volumechange",i(3)),Q("ratechange",i(4))];return function(){s.forEach((function(e){return e()}))}}function qe(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return function(){};var o=[],a=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,r){var n=new i(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=ne(r.fonts,"add",(function(e){return function(r){return setTimeout((function(){var e=a.get(r);e&&(t(e),a.delete(r))}),0),e.apply(this,[r])}}));return o.push((function(){n.FontFace=i})),o.push(s),function(){o.forEach((function(e){return e()}))}}function ze(e){var t=e.doc,r=e.mirror,n=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,c=0;c<u;c++){var l=e.getRangeAt(c),f=l.startContainer,d=l.startOffset,p=l.endContainer,h=l.endOffset;ie(f,n,o,!0)||ie(p,n,o,!0)||s.push({start:r.getId(f),startOffset:d,end:r.getId(p),endOffset:h})}a({ranges:s})}};return s(),Q("selectionchange",s)}function Xe(e,t){var r=e.mutationCb,n=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,c=e.styleSheetRuleCb,l=e.styleDeclarationCb,f=e.canvasMutationCb,d=e.fontCb,p=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),r.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),n.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),f.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),d.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),p.apply(void 0,arguments)}}function Qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};Xe(e,t);var n,o=De(e,e.doc),a=_e(e),i=Fe(e),s=Ue(e),u=Be(e),c=Ke(e),l=Je(e),f=Ze(e,{win:r}),d=Ve(e,e.doc),h=He(e,{win:r}),g=e.collectFonts?qe(e):function(){},v=ze(e),m=[],y=p(e.plugins);try{for(y.s();!(n=y.n()).done;){var w=n.value;m.push(w.observer(w.callback,r,w.options))}}catch(e){y.e(e)}finally{y.f()}return function(){Te.forEach((function(e){return e.reset()})),o.disconnect(),a(),i(),s(),u(),c(),l(),f(),d(),h(),g(),v(),m.forEach((function(e){return e()}))}}var $e=function(){function e(t){J(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return z(e,[{key:"getId",value:function(e,t,r,n){var o=r||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),a.set(i,t)),i}},{key:"getIds",value:function(e,t){var r=this,n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getId(e,t,n,o)}))}},{key:"getRemoteId",value:function(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=n.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var r=this,n=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getRemoteId(e,t,n)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),et=function(){function e(t){J(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new $e(E),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new $e(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return z(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){if("rrweb"===e.data.type){if(!e.source)return;var t=this.crossOriginIframeMap.get(e.source);if(!t)return;var r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}},{key:"transformCrossOriginEvent",value:function(e,t){var r,n=this;switch(t.type){case ge.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:ge.IncrementalSnapshot,data:{source:ve.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ge.Meta:case ge.Load:case ge.DomContentLoaded:return!1;case ge.Plugin:return t;case ge.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ge.IncrementalSnapshot:switch(t.data.source){case ve.Mutation:return t.data.adds.forEach((function(t){n.replaceIds(t,e,["parentId","nextId","previousId"]),n.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((function(t){n.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){n.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case ve.Drag:case ve.TouchMove:case ve.MouseMove:return t.data.positions.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case ve.ViewportResize:return!1;case ve.MediaInteraction:case ve.MouseInteraction:case ve.Scroll:case ve.CanvasMutation:case ve.Input:return this.replaceIds(t.data,e,["id"]),t;case ve.StyleSheetRule:case ve.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ve.Font:return t;case ve.Selection:return t.data.ranges.forEach((function(t){n.replaceIds(t,e,["start","end"])})),t;case ve.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((function(t){n.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,r,n){var o,a=p(n);try{for(a.s();!(o=a.n()).done;){var i=o.value;(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}},{key:"replaceStyleIds",value:function(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}},{key:"replaceIdOnNode",value:function(e,t){var r=this;this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((function(e){r.replaceIdOnNode(e,t)}))}}]),e}(),tt=function(){function e(t){J(this,e),this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;var r=this;this.restorePatches.push(ne(Element.prototype,"attachShadow",(function(e){return function(t){var n=e.call(this,t);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return z(e,[{key:"addShadowRoot",value:function(e,t){var r=this;m(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),De(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Ue(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(e.host)),Ve({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e)}),0)))}},{key:"observeAttachShadow",value:function(e){if(e.contentWindow){var t=this;this.restorePatches.push(ne(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(n){var o=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}},{key:"reset",value:function(){this.restorePatches.forEach((function(e){return e()})),this.shadowDoms=new WeakSet}}]),e}();function rt(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}for(var nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot="undefined"==typeof Uint8Array?[]:new Uint8Array(256),at=0;at<nt.length;at++)ot[nt.charCodeAt(at)]=at;var it=new Map;var st=function(e,t,r){if(e&&(lt(e,t)||"object"===s(e))){var n=function(e,t){var r=it.get(e);return r||(r=new Map,it.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o}};function ut(e,t,r){if(e instanceof Array)return e.map((function(e){return ut(e,t,r)}));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){var n=e.constructor.name,o=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=nt[r[t]>>2],o+=nt[(3&r[t])<<4|r[t+1]>>4],o+=nt[(15&r[t+1])<<2|r[t+2]>>6],o+=nt[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:n,base64:o}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ut(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[ut(e.data,t,r),e.width,e.height]}:lt(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:st(e,t,r)}:e}var ct=function(e,t,r){return H(e).map((function(e){return ut(e,t,r)}))},lt=function(e,t){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(r.find((function(r){return e instanceof t[r]})))};function ft(e,t,r){var n=[];try{var o=ne(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){ie(this,t,r,!0)||"__context"in this||(this.__context=n);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return e.apply(this,[n].concat(a))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}function dt(e,t,r,n,o,a,i){var s,u=[],c=Object.getOwnPropertyNames(e),l=p(c);try{var f=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var c=ne(e,a,(function(e){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var l=e.apply(this,u);if(st(l,i,this),!ie(this.canvas,n,o,!0)){var f=ct([].concat(u),i,this),d={type:t,property:a,args:f};r(this.canvas,d)}return l}}));u.push(c)}catch(n){var l=re(e,a,{set:function(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});u.push(l)}};for(l.s();!(s=l.n()).done;)f()}catch(e){l.e(e)}finally{l.f()}return u}var pt=null;try{var ht="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof require&&require("worker_threads")||"function"==typeof require&&require("worker_threads");pt=ht.Worker}catch(e){}var gt=r(825).lW;function vt(e,t,r){var n=void 0===t?null:t,o=function(e,t){return gt.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:"");return function(e){return new pt(i,Object.assign({},e,{eval:!0}))}}function mt(e,t,r){var n=void 0===t?null:t,o=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,a=r.length;o<a;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var yt=r(619),wt="[object process]"===Object.prototype.toString.call(void 0!==yt?yt:0);var It,bt,Ct,St,kt,xt,At=(It="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",bt=null,Ct=!1,wt?vt(It,bt,Ct):function(e,t,r){var n;return function(o){return n=n||mt(e,t,r),new Worker(n,o)}}(It,bt,Ct)),Et=function(){function e(t){var r=this;J(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId)&&r.rafStamps.invokeId||(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(e)||r.pendingCanvasMutations.set(e,[]),r.pendingCanvasMutations.get(e).push(t)};var n=t.sampling,o=void 0===n?"all":n,a=t.win,i=t.blockClass,s=t.blockSelector,u=t.recordCanvas,c=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(a,i,s),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,s,{dataURLOptions:c})}return z(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,n,o,a){var i=this,s=ft(r,n,o),u=new Map,c=new At;c.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var r=e.data,n=r.base64,o=r.type,a=r.width,s=r.height;i.mutationCb({id:t,type:ye["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})}};var l,f=1e3/e,d=0;l=requestAnimationFrame((function e(s){var p;d&&s-d<f?l=requestAnimationFrame(e):(d=s,(p=[],r.document.querySelectorAll("canvas").forEach((function(e){ie(e,n,o,!0)||p.push(e)})),p).forEach((function(e){return rt(i,void 0,void 0,t().mark((function r(){var n,o,i,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!u.get(o)){t.next=3;break}return t.abrupt("return");case 3:return u.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null===(n=null==i?void 0:i.getContextAttributes())||void 0===n?void 0:n.preserveDrawingBuffer)&&(null==i||i.clear(i.COLOR_BUFFER_BIT))),t.next=7,createImageBitmap(e);case 7:s=t.sent,c.postMessage({id:o,bitmap:s,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[s]);case 9:case"end":return t.stop()}}),r,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ft(e,t,r),o=function(e,t,r,n){var o,a=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=p(i);try{var u=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return 1;var s=ne(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return ie(this.canvas,r,n,!0)||setTimeout((function(){var r=ct([].concat(u),t,a);e(a.canvas,{type:ye["2D"],property:i,args:r})}),0),o.apply(this,u)}}));a.push(s)}catch(r){var u=re(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:ye["2D"],property:i,args:[t],setter:!0})}});a.push(u)}};for(s.s();!(o=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r),a=function(e,t,r,n,o){var a=[];return a.push.apply(a,H(dt(t.WebGLRenderingContext.prototype,ye.WebGL,e,r,n,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,H(dt(t.WebGL2RenderingContext.prototype,ye.WebGL2,e,r,n,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=function(){n(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(r){e.rafStamps.latestId=r,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,r){var n=e.mirror.getId(r);e.flushPendingCanvasMutationFor(r,n)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((function(e){var t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),o=r[0].type;this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),Tt=function(){function e(t){J(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return z(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var r,n={id:t,styleIds:[]},o=[],a=p(e);try{for(a.s();!(r=a.n()).done;){var i=r.value,s=void 0;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);var u=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:u.map((function(e,t){return{rule:w(e),index:t}}))})}n.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}();function Rt(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var Mt=!1,Ot=new I;function Lt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,r=e.checkoutEveryNms,n=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.maskTextClass,f=void 0===l?"rr-mask":l,d=e.maskTextSelector,h=void 0===d?null:d,g=e.inlineStylesheet,v=void 0===g||g,m=e.maskAllInputs,y=e.maskInputOptions,w=e.slimDOMOptions,I=e.maskInputFn,b=e.maskTextFn,C=e.hooks,S=e.packFn,k=e.sampling,x=void 0===k?{}:k,A=e.dataURLOptions,E=void 0===A?{}:A,T=e.mousemoveWait,R=e.recordCanvas,M=void 0!==R&&R,O=e.recordCrossOriginIframes,L=void 0!==O&&O,N=e.userTriggeredOnInput,D=void 0!==N&&N,_=e.collectFonts,F=void 0!==_&&_,U=e.inlineImages,B=void 0!==U&&U,P=e.plugins,W=e.keepIframeSrcFn,G=void 0===W?function(){return!1}:W,K=e.ignoreCSSAttributes,Y=void 0===K?new Set([]):K,Z=!L||window.parent===window,V=!1;if(!Z)try{window.parent.document,V=!1}catch(e){V=!0}if(Z&&!t)throw new Error("emit function is required");void 0!==T&&void 0===x.mousemove&&(x.mousemove=T),Ot.reset();var H,J=!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}:void 0!==y?y:{password:!0},q=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};le();var z=0,X=function(e){var t,r=p(P||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.eventProcessor&&(e=n.eventProcessor(e))}}catch(e){r.e(e)}finally{r.f()}return S&&(e=S(e)),e};St=function(e,o){var a;if(!(null===(a=Te[0])||void 0===a?void 0:a.isFrozen())||e.type===ge.FullSnapshot||e.type===ge.IncrementalSnapshot&&e.data.source===ve.Mutation||Te.forEach((function(e){return e.unfreeze()})),Z)null==t||t(X(e),o);else if(V){var i={type:"rrweb",event:X(e),isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===ge.FullSnapshot)H=e,z=0;else if(e.type===ge.IncrementalSnapshot){if(e.data.source===ve.Mutation&&e.data.isAttachIframe)return;z++;var s=n&&z>=n,u=r&&e.timestamp-H.timestamp>r;(s||u)&&kt(!0)}};var $,ee=function(e){St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Mutation},e)}))},te=function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Scroll},e)}))},re=function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.CanvasMutation},e)}))},ne=function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.AdoptedStyleSheet},e)}))},ie=new Tt({mutationCb:ee,adoptedStyleSheetCb:ne}),se=new et({mirror:Ot,mutationCb:ee,stylesheetManager:ie,recordCrossOriginIframes:L,wrappedEmit:St}),ue=p(P||[]);try{for(ue.s();!($=ue.n()).done;){var ce=$.value;ce.getMirror&&ce.getMirror({nodeMirror:Ot,crossOriginIframeMirror:se.crossOriginIframeMirror,crossOriginIframeStyleMirror:se.crossOriginIframeStyleMirror})}}catch(e){ue.e(e)}finally{ue.f()}xt=new Et({recordCanvas:M,mutationCb:re,win:window,blockClass:a,blockSelector:s,mirror:Ot,sampling:x.canvas,dataURLOptions:E});var he=new tt({mutationCb:ee,scrollCb:te,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:h,inlineStylesheet:v,maskInputOptions:J,dataURLOptions:E,maskTextFn:b,maskInputFn:I,recordCanvas:M,inlineImages:B,sampling:x,slimDOMOptions:q,iframeManager:se,stylesheetManager:ie,canvasManager:xt,keepIframeSrcFn:G},mirror:Ot});kt=function(){var e,t,r,n,o,i,u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];St(Rt({type:ge.Meta,data:{href:window.location.href,width:ae(),height:oe()}}),u),ie.reset(),Te.forEach((function(e){return e.lock()}));var c=j(document,{mirror:Ot,blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:h,inlineStylesheet:v,maskAllInputs:J,maskTextFn:b,slimDOM:q,dataURLOptions:E,recordCanvas:M,inlineImages:B,onSerialize:function(e){fe(e,Ot)&&se.addIframe(e),de(e,Ot)&&ie.trackLinkElement(e),pe(e)&&he.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){se.attachIframe(e,t),he.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ie.attachLinkElement(e,t)},keepIframeSrcFn:G});if(!c)return console.warn("Failed to snapshot the document");St(Rt({type:ge.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(t=null===(e=null===document||void 0===document?void 0:document.body)||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.scrollTop)||0}}})),Te.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,Ot.getId(document))};try{var me=[];me.push(Q("DOMContentLoaded",(function(){St(Rt({type:ge.DomContentLoaded,data:{}}))})));var ye=function(e){var t;return Qe({mutationCb:ee,mousemoveCb:function(e,t){return St(Rt({type:ge.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.MouseInteraction},e)}))},scrollCb:te,viewportResizeCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.ViewportResize},e)}))},inputCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Input},e)}))},mediaInteractionCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.StyleDeclaration},e)}))},canvasMutationCb:re,fontCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Font},e)}))},selectionCb:function(e){St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Selection},e)}))},blockClass:a,ignoreClass:c,maskTextClass:f,maskTextSelector:h,maskInputOptions:J,inlineStylesheet:v,sampling:x,recordCanvas:M,inlineImages:B,userTriggeredOnInput:D,collectFonts:F,doc:e,maskInputFn:I,maskTextFn:b,keepIframeSrcFn:G,blockSelector:s,slimDOMOptions:q,dataURLOptions:E,mirror:Ot,iframeManager:se,stylesheetManager:ie,shadowDomManager:he,canvasManager:xt,ignoreCSSAttributes:Y,plugins:(null===(t=null==P?void 0:P.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return St(Rt({type:ge.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};se.addLoadListener((function(e){me.push(ye(e.contentDocument))}));var we=function(){kt(),me.push(ye(document)),Mt=!0};return"interactive"===document.readyState||"complete"===document.readyState?we():me.push(Q("load",(function(){St(Rt({type:ge.Load,data:{}})),we()}),window)),function(){me.forEach((function(e){return e()})),Mt=!1}}catch(e){console.warn(e)}}Lt.addCustomEvent=function(e,t){if(!Mt)throw new Error("please add custom event after start recording");St(Rt({type:ge.Custom,data:{tag:e,payload:t}}))},Lt.freezePage=function(){Te.forEach((function(e){return e.freeze()}))},Lt.takeFullSnapshot=function(e){if(!Mt)throw new Error("please take full snapshot after start recording");kt(e)},Lt.mirror=Ot;var Nt=Uint8Array,Dt=Uint16Array,_t=Uint32Array,Ft=new Nt([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]),Ut=new Nt([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]),Bt=new Nt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pt=function(e,t){for(var r=new Dt(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new _t(r[30]);for(n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)o[a]=a-r[n]<<5|n;return[r,o]},Wt=Pt(Ft,2),Gt=Wt[0],Kt=Wt[1];Gt[28]=258,Kt[258]=28;for(var jt=Pt(Ut,0),Yt=(jt[0],jt[1]),Zt=new Dt(32768),Vt=0;Vt<32768;++Vt){var Ht=(43690&Vt)>>>1|(21845&Vt)<<1;Ht=(61680&(Ht=(52428&Ht)>>>2|(13107&Ht)<<2))>>>4|(3855&Ht)<<4,Zt[Vt]=((65280&Ht)>>>8|(255&Ht)<<8)>>>1}var Jt=function(e,t,r){for(var n=e.length,o=0,a=new Dt(t);o<n;++o)++a[e[o]-1];var i,s=new Dt(t);for(o=0;o<t;++o)s[o]=s[o-1]+a[o-1]<<1;if(r){i=new Dt(1<<t);var u=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],f=s[e[o]-1]++<<l,d=f|(1<<l)-1;f<=d;++f)i[Zt[f]>>>u]=c}else for(i=new Dt(n),o=0;o<n;++o)i[o]=Zt[s[e[o]-1]++]>>>15-e[o];return i},qt=new Nt(288);for(Vt=0;Vt<144;++Vt)qt[Vt]=8;for(Vt=144;Vt<256;++Vt)qt[Vt]=9;for(Vt=256;Vt<280;++Vt)qt[Vt]=7;for(Vt=280;Vt<288;++Vt)qt[Vt]=8;var zt=new Nt(32);for(Vt=0;Vt<32;++Vt)zt[Vt]=5;var Xt=Jt(qt,9,0),Qt=Jt(zt,5,0),$t=function(e){return(e/8>>0)+(7&e&&1)},er=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Dt?Dt:e instanceof _t?_t:Nt)(r-t);return n.set(e.subarray(t,r)),n},tr=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},rr=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},nr=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,a=r.slice();if(!o)return[new Nt(0),0];if(1==o){var i=new Nt(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],c=0,l=1,f=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=r[r[c].f<r[f].f?c++:f++],u=r[c!=l&&r[c].f<r[f].f?c++:f++],r[l++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(n=1;n<o;++n)a[n].s>d&&(d=a[n].s);var p=new Dt(d+1),h=or(r[l-1],p,0);if(h>t){n=0;var g=0,v=h-t,m=1<<v;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<o;++n){var y=a[n].s;if(!(p[y]>t))break;g+=m-(1<<h-p[y]),p[y]=t}for(g>>>=v;g>0;){var w=a[n].s;p[w]<t?g-=1<<t-p[w]++-1:++n}for(;n>=0&&g;--n){var I=a[n].s;p[I]==t&&(--p[I],++g)}h=t}return[new Nt(p),h]},or=function e(t,r,n){return-1==t.s?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},ar=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Dt(++t),n=0,o=e[0],a=1,i=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++a;else{if(!o&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(o),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(o);a=1,o=e[s]}return[r.subarray(0,n),t]},ir=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},sr=function(e,t,r){var n=r.length,o=$t(t+2);e[o]=255&n,e[o+1]=n>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var a=0;a<n;++a)e[o+a+4]=r[a];return 8*(o+4+n)},ur=function(e,t,r,n,o,a,i,s,u,c,l){tr(t,l++,r),++o[256];for(var f=nr(o,15),d=f[0],p=f[1],h=nr(a,15),g=h[0],v=h[1],m=ar(d),y=m[0],w=m[1],I=ar(g),b=I[0],C=I[1],S=new Dt(19),k=0;k<y.length;++k)S[31&y[k]]++;for(k=0;k<b.length;++k)S[31&b[k]]++;for(var x=nr(S,7),A=x[0],E=x[1],T=19;T>4&&!A[Bt[T-1]];--T);var R,M,O,L,N=c+5<<3,D=ir(o,qt)+ir(a,zt)+i,_=ir(o,d)+ir(a,g)+i+14+3*T+ir(S,A)+(2*S[16]+3*S[17]+7*S[18]);if(N<=D&&N<=_)return sr(t,l,e.subarray(u,u+c));if(tr(t,l,1+(_<D)),l+=2,_<D){R=Jt(d,p,0),M=d,O=Jt(g,v,0),L=g;var F=Jt(A,E,0);tr(t,l,w-257),tr(t,l+5,C-1),tr(t,l+10,T-4),l+=14;for(k=0;k<T;++k)tr(t,l+3*k,A[Bt[k]]);l+=3*T;for(var U=[y,b],B=0;B<2;++B){var P=U[B];for(k=0;k<P.length;++k){var W=31&P[k];tr(t,l,F[W]),l+=A[W],W>15&&(tr(t,l,P[k]>>>5&127),l+=P[k]>>>12)}}}else R=Xt,M=qt,O=Qt,L=zt;for(k=0;k<s;++k)if(n[k]>255){W=n[k]>>>18&31;rr(t,l,R[W+257]),l+=M[W+257],W>7&&(tr(t,l,n[k]>>>23&31),l+=Ft[W]);var G=31&n[k];rr(t,l,O[G]),l+=L[G],G>3&&(rr(t,l,n[k]>>>5&8191),l+=Ut[G])}else rr(t,l,R[n[k]]),l+=M[n[k]];return rr(t,l,R[256]),l+M[256]},cr=new _t([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lr=new Nt(0),fr=function(e,t,r,n,o){return function(e,t,r,n,o,a){var i=e.length,s=new Nt(n+i+5*(1+Math.floor(i/7e3))+o),u=s.subarray(n,s.length-o),c=0;if(!t||i<8)for(var l=0;l<=i;l+=65535){var f=l+65535;f<i?c=sr(u,c,e.subarray(l,f)):(u[l]=a,c=sr(u,c,e.subarray(l,i)))}else{for(var d=cr[t-1],p=d>>>13,h=8191&d,g=(1<<r)-1,v=new Dt(32768),m=new Dt(g+1),y=Math.ceil(r/3),w=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<w)&g},b=new _t(25e3),C=new Dt(288),S=new Dt(32),k=0,x=0,A=(l=0,0),E=0,T=0;l<i;++l){var R=I(l),M=32767&l,O=m[R];if(v[M]=O,m[R]=M,E<=l){var L=i-l;if((k>7e3||A>24576)&&L>423){c=ur(e,u,0,b,C,S,x,A,T,l-T,c),A=k=x=0,T=l;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)S[N]=0}var D=2,_=0,F=h,U=M-O&32767;if(L>2&&R==I(l-U))for(var B=Math.min(p,L)-1,P=Math.min(32767,l),W=Math.min(258,L);U<=P&&--F&&M!=O;){if(e[l+D]==e[l+D-U]){for(var G=0;G<W&&e[l+G]==e[l+G-U];++G);if(G>D){if(D=G,_=U,G>B)break;var K=Math.min(U,G-2),j=0;for(N=0;N<K;++N){var Y=l-U+N+32768&32767,Z=Y-v[Y]+32768&32767;Z>j&&(j=Z,O=Y)}}}U+=(M=O)-(O=v[M])+32768&32767}if(_){b[A++]=268435456|Kt[D]<<18|Yt[_];var V=31&Kt[D],H=31&Yt[_];x+=Ft[V]+Ut[H],++C[257+V],++S[H],E=l+D,++k}else b[A++]=e[l],++C[e[l]]}}c=ur(e,u,a,b,C,S,x,A,T,l-T,c),a||(c=sr(u,c,lr))}return er(s,0,n+$t(c)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!o)};function dr(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,a=r.length,i=0;i!=a;){for(var s=Math.min(i+5552,a);i<s;++i)o+=n+=r[i];n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n=fr(e,t,2,4);return function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)}(n,t),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(n,n.length-4,r.d()),n}var pr=function(e){var t=Object.assign(Object.assign({},e),{v:"v1"});return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}(dr(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Nt(e.length+(e.length>>>1)),o=0,a=function(e){n[o++]=e},i=0;i<r;++i){if(o+5>n.length){var s=new Nt(o+8+(r-i<<1));s.set(n),n=s}var u=e.charCodeAt(i);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++i))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return er(n,0,o)}(JSON.stringify(t))),!0)},hr=Object.defineProperty,gr=function(e,t,r){return function(e,t,r){return t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r}(e,"symbol"!==s(t)?t+"":t,r)};var vr=function(){function e(t){J(this,e),gr(this,"fileName"),gr(this,"functionName"),gr(this,"lineNumber"),gr(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return z(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),mr=/(^|@)\S+:\d+/,yr=/^\s*at .*(\S+:\d+|\(native\))/m,wr=/^(eval@)?(\[native code])?$/,Ir={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(yr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(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(yr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new vr({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(wr)}),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 vr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(t,""));return new vr({functionName:n,fileName:o[0],lineNumber:o[1],columnNumber:o[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){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],o=2,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new vr({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],o=0,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new vr({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(mr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new vr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function br(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(var a=0;a<n.children.length;a++){var i=n.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===r&&o.push(i)}o.length>1&&(r+=":eq(".concat(o.indexOf(e),")")),t=r+(t?">"+t:""),e=n}return t}function Cr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Sr(e,t){if(0===t)return!0;for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(Cr(e[o])&&Sr(e[o],t-1))return!0}return!1}function kr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],o=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?o.splice(a,1/0,e):o.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Cr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Cr(e)&&Sr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t="".concat(t.slice(0,r.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=br(u.length?u[0]:null):i[s]=u}return i}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}))}var xr={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 Ar(e,t,r){var n,o=r?Object.assign({},xr,r):xr,a=o.logger;if(!a)return function(){};n="string"==typeof a?t[a]:a;var i=0,s=!1,u=[];if(o.level.includes("error")){var c=function(t){var r=t.message,n=t.error,a=Ir.parse(n).map((function(e){return e.toString()})),i=[kr(r,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var r,n;t.reason instanceof Error?(r=t.reason,n=[kr("Uncaught (in promise) ".concat(r.name,": ").concat(r.message),o.stringifyOptions)]):(r=new Error,n=[kr("Uncaught (in promise)",o.stringifyOptions),kr(t.reason,o.stringifyOptions)]);var a=Ir.parse(r).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var f,d=p(o.level);try{for(d.s();!(f=d.n()).done;){var h=f.value;u.push(g(n,h))}}catch(e){d.e(e)}finally{d.f()}return function(){u.forEach((function(e){return e()}))};function g(t,r){var n=this;return t[r]?function(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}(t,r,(function(t){return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var l=Ir.parse(new Error).map((function(e){return e.toString()})).splice(1),f="assert"===r?u.slice(1):u,d=f.map((function(e){return kr(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:r,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[kr("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Er="rlog-deviceId",Tr="rlog-",Rr="rlog_data_",Mr="rlog_lock_",Or="RLOG_CONSUME_ONLY",Lr="YES",Nr=36e5,Dr=3e5,_r=1e4,Fr=1e4,Ur=["taskId"],Br="rlog-upload-failure",Pr="custom-error-event",Wr="http-success",Gr="http-error",Kr="network-status",jr="page-lifecycle",Yr=["arms","log","marmot-cloud.com","alipayobjects.com","renderpre.alipay.com","nemo-office.alipay.com","render.alipay.com"],Zr=["r.png","dwcookieLogGet.do","track","spm","logstores","render",".json",".js",".css",".wasm",".png",".jpg",".jpeg",".weapp",".data"],Vr=["sky_trace_id","antbank-traceid"],Hr=["http://alipay-rmsdeploy-image.cn-hangzhou.alipay.aliyun-inc.com"],Jr="[Rlog]";function qr(e){for(var t,r,n,o,a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];switch(e){case"log":(t=console).log.apply(t,[Jr].concat(i));break;case"info":(r=console).info.apply(r,[Jr].concat(i));break;case"warn":(n=console).warn.apply(n,[Jr].concat(i));break;case"error":(o=console).error.apply(o,[Jr].concat(i))}}var zr={log:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["log"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["info"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["error"].concat(t))}},Xr=zr,Qr=new(function(){function e(){q()(this,e),l()(this,"memoryFallback",new Map),l()(this,"useMemory",!1),this.useMemory=!this.isLocalStorageAvailable(),this.useMemory&&Xr.warn("localStorage 不可用,SafeStorage 已降级为内存存储")}return X()(e,[{key:"isLocalStorageAvailable",value:function(){try{if("undefined"==typeof window||!window.localStorage)return!1;var e="__rlog_safe_storage_test__";return window.localStorage.setItem(e,"1"),window.localStorage.removeItem(e),!0}catch(e){return!1}}},{key:"getItem",value:function(e){var t;if(this.useMemory)return null!==(t=this.memoryFallback.get(e))&&void 0!==t?t:null;try{return localStorage.getItem(e)}catch(t){var r;return this.useMemory=!0,null!==(r=this.memoryFallback.get(e))&&void 0!==r?r:null}}},{key:"setItem",value:function(e,t){if(this.useMemory)this.memoryFallback.set(e,t);else try{localStorage.setItem(e,t)}catch(r){this.useMemory=!0,this.memoryFallback.set(e,t)}}},{key:"removeItem",value:function(e){if(this.useMemory)this.memoryFallback.delete(e);else try{localStorage.removeItem(e)}catch(t){this.useMemory=!0,this.memoryFallback.delete(e)}}}]),e}()),$r=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},en=function(){if(Qr.getItem(Er))return Qr.getItem(Er);var e=Qr.getItem("utoken")||Qr.getItem("IWP-iwp-deivceTag")||$r();return Qr.setItem(Er,e),e},tn=null,rn="rlog_sessions",nn=function(){return tn||function(e){try{var t=JSON.parse(Qr.getItem(rn)||"{}");t[e]=Date.now(),Qr.setItem(rn,JSON.stringify(t))}catch(e){}}(tn=$r()),tn},on=function(){return"".concat(en(),"_").concat(nn())};function an(e){try{var t=JSON.parse(Qr.getItem(rn)||"{}");delete t[e],Qr.setItem(rn,JSON.stringify(t))}catch(e){}}function sn(){try{for(var e=JSON.parse(Qr.getItem(rn)||"{}"),t=Date.now(),r=en(),n=nn(),o=[],a=0,i=Object.keys(e);a<i.length;a++){var s=i[a];if(s!==n){var u=e[s];if(!(t-u>Nr||t-u>Dr)){var c="".concat(r,"_").concat(s),l="".concat(Rr).concat(c),f=Qr.getItem(l);f&&"[]"!==f&&o.push({sessionId:s,storageKey:c})}}}return o}catch(e){return[]}}function un(e){if(!e||0===e.length)return!1;var t,r=1/0,n=-1/0,o=h()(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;a&&"number"==typeof a.timestamp&&(a.timestamp<r&&(r=a.timestamp),a.timestamp>n&&(n=a.timestamp))}}catch(e){o.e(e)}finally{o.f()}return r!==1/0&&n!==-1/0&&(!(n-r>12e4)&&!(Date.now()-n>Dr))}function cn(e){try{var t=en(),r="".concat(Rr).concat(t,"_").concat(e),n="".concat(Mr).concat(t,"_").concat(e);Qr.removeItem(r),Qr.removeItem(n),an(e)}catch(e){}}var ln=function(e){return null!==e&&"object"===u()(e)&&!Array.isArray(e)},fn=function e(t,r){var n=d()({},t);for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],i=t[o];ln(a)&&ln(i)?n[o]=e(i,a):void 0!==a&&(n[o]=a)}return n},dn="logs",pn=function(){function e(){q()(this,e),l()(this,"db",null),l()(this,"isOpening",!1),l()(this,"openPromise",null),this.openDB().catch(Xr.error)}var t,r,n,a,s,u,c,f,d,p,h;return X()(e,[{key:"openDB",value:(h=i()(o()().mark((function e(){var t=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.db){e.next=2;break}return e.abrupt("return");case 2:if(!this.isOpening||!this.openPromise){e.next=4;break}return e.abrupt("return",this.openPromise);case 4:return this.isOpening=!0,this.openPromise=new Promise((function(e,r){var n=indexedDB.open("LogStorageDB",2);n.onupgradeneeded=function(e){var t=e.target.result;if(t.objectStoreNames.contains(dn)){var r=e.target.transaction;if(r){var n=r.objectStore(dn);n.indexNames.contains("lastModified")||n.createIndex("lastModified","lastModified",{unique:!1})}}else t.createObjectStore(dn,{keyPath:"deviceId"}).createIndex("lastModified","lastModified",{unique:!1})},n.onsuccess=function(r){t.db=r.target.result,t.isOpening=!1,e()},n.onerror=function(e){t.isOpening=!1,r(e.target.error)},n.onblocked=function(){Xr.warn("IndexedDB is blocked, trying to close existing connections"),t.isOpening=!1,r(new Error("IndexedDB blocked"))}})),e.abrupt("return",this.openPromise);case 7:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"ensureDB",value:(p=i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.db){e.next=3;break}return e.next=3,this.openDB();case 3:if(this.db){e.next=5;break}throw new Error("Failed to open IndexedDB");case 5:return e.abrupt("return",this.db);case 6:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"withTransaction",value:(d=i()(o()().mark((function e(t,r){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureDB();case 2:return n=e.sent,e.abrupt("return",new Promise((function(e,o){var a,i=n.transaction([dn],t),s=i.objectStore(dn);i.onerror=function(){return o(i.error)},i.oncomplete=function(){setTimeout((function(){return e(a)}),0)},r(s).then((function(e){a=e}),o)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"push",value:(f=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.push(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>Fr&&i.data.splice(0,i.data.length-Fr);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.unshift(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>Fr&&i.data.splice(0,i.data.length-Fr);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data=r.concat(i.data),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>Fr&&i.data.splice(0,i.data.length-Fr);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(0!==i.data.length){var s=Math.min(r,i.data.length),u=i.data.slice(0,s);if(i.data=i.data.slice(s),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var c=n.put(i);c.onsuccess=function(){return e(u)},c.onerror=function(){return o(c.error)}}else{var l=n.delete(t);l.onsuccess=function(){return e(u)},l.onerror=function(){return o(l.error)}}}else e([])},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=r.delete(t);o.onsuccess=function(){return e()},o.onerror=function(){return n(o.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readonly",function(){var e=i()(o()().mark((function e(a){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var i=a.get(t);i.onsuccess=function(){var o=(i.result||{deviceId:t,data:[],lastModified:Date.now(),version:1}).data.filter((function(e){return e.timestamp>=r&&e.timestamp<=n}));e(o)},i.onerror=function(){return o(i.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(i.data=i.data.filter((function(e){return e.timestamp<r})),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}}else{var u=n.delete(t);u.onsuccess=function(){return e()},u.onerror=function(){return o(u.error)}}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"count",value:(t=i()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readonly",function(){var e=i()(o()().mark((function e(r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=r.get(t);o.onsuccess=function(){var t=o.result;e(t?t.data.length:0)},o.onerror=function(){return n(o.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),hn=function(){function e(){q()(this,e),l()(this,"storage",new Map),l()(this,"locks",new Map)}var t,r,n,a,s,u,c,f,d;return X()(e,[{key:"acquireLock",value:(d=i()(o()().mark((function e(t){var r,n,a,i=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(!this.locks.has(r)){e.next=6;break}return e.next=4,this.locks.get(r);case 4:e.next=1;break;case 6:return a=new Promise((function(e){n=e})),this.locks.set(r,a),e.abrupt("return",(function(){i.locks.delete(r),n()}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"push",value:(f=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).push(r),a.length>Fr&&a.splice(0,a.length-Fr)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).unshift(r),a.length>Fr&&a.splice(0,a.length-Fr)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),a=this.storage.get(t),(i=r.concat(a)).length>Fr&&i.splice(0,i.length-Fr),this.storage.set(t,i)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){var n,a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:if(n=e.sent,e.prev=3,0!==(a=this.storage.get(t)||[]).length){e.next=7;break}return e.abrupt("return",[]);case 7:return i=Math.min(r,a.length),s=a.slice(0,i),(u=a.slice(i)).length>0?this.storage.set(t,u):this.storage.delete(t),e.abrupt("return",s);case 12:return e.prev=12,n(),e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[3,,12,15]])}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){var r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:r=e.sent;try{this.storage.delete(t)}finally{r()}case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){var a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:return a=e.sent,e.prev=3,i=this.storage.get(t)||[],e.abrupt("return",i.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 6:return e.prev=6,a(),e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[3,,6,9]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{a=this.storage.get(t)||[],(i=a.filter((function(e){return e.timestamp<r}))).length>0?this.storage.set(t,i):this.storage.delete(t)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"count",value:(t=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:return r=e.sent,e.prev=3,n=this.storage.get(t)||[],e.abrupt("return",n.length);case 6:return e.prev=6,r(),e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[3,,6,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();l()(hn,"instance",void 0);var gn=function(){function e(){q()(this,e)}var t,r,n,a,s,u,c,l,f,d;return X()(e,[{key:"acquireLock",value:(d=i()(o()().mark((function t(r){var n,a,i,s,u,c,l;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="".concat(e.LOCK_KEY_PREFIX).concat(r),a="".concat(Date.now(),"_").concat(Math.random()),t.prev=2,!(i=localStorage.getItem(n))){t.next=8;break}if(s=i.split("_"),u=V()(s,1),c=u[0],!(Date.now()-parseInt(c)<e.LOCK_TIMEOUT)){t.next=8;break}return t.abrupt("return",!1);case 8:return localStorage.setItem(n,a),t.next=11,new Promise((function(e){return setTimeout(e,Math.floor(3*Math.random())+1)}));case 11:return l=localStorage.getItem(n),t.abrupt("return",l===a);case 15:return t.prev=15,t.t0=t.catch(2),Xr.warn("Failed to acquire lock",t.t0),t.abrupt("return",!1);case 19:case"end":return t.stop()}}),t,null,[[2,15]])}))),function(e){return d.apply(this,arguments)})},{key:"releaseLock",value:function(t){var r="".concat(e.LOCK_KEY_PREFIX).concat(t);try{localStorage.removeItem(r)}catch(e){Xr.warn("Failed to release lock",e)}}},{key:"withLock",value:(f=i()(o()().mark((function t(r,n){var a,i;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0;case 1:if(!(a<e.MAX_RETRIES)){t.next=18;break}return t.next=4,this.acquireLock(r);case 4:if(!t.sent){t.next=13;break}return t.prev=5,t.next=8,n();case 8:return i=t.sent,t.abrupt("return",i);case 10:return t.prev=10,this.releaseLock(r),t.finish(10);case 13:return a++,t.next=16,new Promise((function(t){return setTimeout(t,e.RETRY_DELAY)}));case 16:t.next=1;break;case 18:throw new Error("Failed to acquire lock after maximum retries");case 19:case"end":return t.stop()}}),t,this,[[5,,10,13]])}))),function(e,t){return f.apply(this,arguments)})},{key:"getStorageKey",value:function(t){return"".concat(e.STORAGE_KEY_PREFIX).concat(t)}},{key:"push",value:(l=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).push(r),s.length>Fr&&s.splice(0,s.length-Fr),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Xr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",hn.getInstance().push(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return l.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).unshift(r),s.length>Fr&&s.splice(0,s.length-Fr),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Xr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",hn.getInstance().unshift(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),s=i?JSON.parse(i):[],(u=r.concat(s)).length>Fr&&u.splice(0,u.length-Fr),localStorage.setItem(a,JSON.stringify(u));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Xr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",hn.getInstance().unshiftBatch(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getStorageKey(t),i=localStorage.getItem(a),0!==(s=i?JSON.parse(i):[]).length){e.next=5;break}return e.abrupt("return",[]);case 5:return u=Math.min(r,s.length),c=s.slice(0,u),(l=s.slice(u)).length>0?localStorage.setItem(a,JSON.stringify(l)):localStorage.removeItem(a),e.abrupt("return",c);case 10:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().pull(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.getStorageKey(t),localStorage.removeItem(n);case 2:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().clear(t));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.getStorageKey(t),s=localStorage.getItem(i),u=s?JSON.parse(s):[],e.abrupt("return",u.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 4:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().pullByTimeRange(t,r,n));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),s=i?JSON.parse(i):[],(u=s.filter((function(e){return e.timestamp<r}))).length>0?localStorage.setItem(a,JSON.stringify(u)):localStorage.removeItem(a);case 5:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().removeByTimeRange(t,r));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return r.apply(this,arguments)})},{key:"count",value:(t=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.getStorageKey(t),a=localStorage.getItem(n),i=a?JSON.parse(a):[],e.abrupt("return",i.length);case 4:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().count(t));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return t.apply(this,arguments)})}]),e}();l()(gn,"LOCK_KEY_PREFIX",Mr),l()(gn,"STORAGE_KEY_PREFIX",Rr),l()(gn,"LOCK_TIMEOUT",5e3),l()(gn,"RETRY_DELAY",10),l()(gn,"MAX_RETRIES",50);var vn=function(){function e(){q()(this,e),l()(this,"adapter",void 0),l()(this,"operationQueue",new Map),this.adapter=this.selectAdapter()}var t,r,n,a,s,u,c,f,d,p;return X()(e,[{key:"selectAdapter",value:function(){if("undefined"!=typeof window&&window.localStorage)try{var e="__rlog_storage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),new gn}catch(e){Xr.warn("LocalStorage不可用,降级使用内存缓存")}return hn.getInstance()}},{key:"serialize",value:(p=i()(o()().mark((function e(t,r){var n,a,i,s=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t,a=this.operationQueue.get(n)||Promise.resolve(),i=a.then((function(){return r()})).catch((function(e){throw Xr.error("Storage operation failed:",e),e})).finally((function(){s.operationQueue.get(n)===i&&s.operationQueue.delete(n)})),this.operationQueue.set(n,i),e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"push",value:(d=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.push(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"unshift",value:(f=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshift(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"unshiftBatch",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshiftBatch(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"pull",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.pull(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"clear",value:(s=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return r.adapter.clear?r.adapter.clear(t):(Xr.warn("Storage adapter does not support clear operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"pullByTimeRange",value:(a=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return a.adapter.pullByTimeRange?a.adapter.pullByTimeRange(t,r,n):(Xr.warn("Storage adapter does not support pullByTimeRange operation"),Promise.resolve([]))})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"removeByTimeRange",value:(n=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.removeByTimeRange?n.adapter.removeByTimeRange(t,r):(Xr.warn("Storage adapter does not support removeByTimeRange operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getAdapterType",value:function(){return this.adapter instanceof pn?"IndexedDB":this.adapter instanceof gn?"LocalStorage":this.adapter instanceof hn?"Memory":"Unknown"}},{key:"count",value:(r=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return r.adapter.count?r.adapter.count(t):(Xr.warn("Storage adapter does not support count operation"),Promise.resolve(0))})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getStorageState",value:(t=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getAdapterType(),e.prev=1,e.next=4,this.count(t);case 4:return n=e.sent,e.abrupt("return",{adapterType:r,eventCount:n});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{adapterType:r,eventCount:-1});case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(e){return t.apply(this,arguments)})}]),e}(),mn=new vn;function yn(e){return wn.apply(this,arguments)}function wn(){return wn=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=r.method,a=void 0===o?"GET":o,i=r.headers,s=void 0===i?{}:i,c=r.body,l=r.timeout,f=void 0===l?_r:l,d=new XMLHttpRequest;d.timeout=f,d.onreadystatechange=function(){if(4===d.readyState){var t={ok:d.status>=200&&d.status<300,status:d.status,statusText:d.statusText,data:null,json:function(){return Promise.resolve(JSON.parse(d.responseText))},text:function(){return Promise.resolve(d.responseText)}};try{t.data=JSON.parse(d.responseText)}catch(e){t.data=d.responseText}t.ok?e(t):n(new Error("HTTP ".concat(d.status,": ").concat(d.statusText)))}},d.onerror=function(){n(new Error("Network error"))},d.ontimeout=function(){n(new Error("Request timeout"))},d.open(a,t,!0),Object.keys(s).forEach((function(e){d.setRequestHeader(e,s[e])})),c instanceof FormData?d.send(c):"object"===u()(c)?(d.setRequestHeader("Content-Type","application/json"),d.send(JSON.stringify(c))):d.send(c||null)})));case 2:case"end":return e.stop()}}),e)}))),wn.apply(this,arguments)}function In(e){return bn.apply(this,arguments)}function bn(){return bn=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",yn(t,d()(d()({},r),{},{method:"GET"})));case 2:case"end":return e.stop()}}),e)}))),bn.apply(this,arguments)}function Cn(e,t){return Sn.apply(this,arguments)}function Sn(){return Sn=i()(o()().mark((function e(t,r){var n,a=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",yn(t,d()(d()({},n),{},{method:"POST",body:r})));case 2:case"end":return e.stop()}}),e)}))),Sn.apply(this,arguments)}var kn={enable:!1,uploadInterval:2e3,configUpdateInterval:3e5,console:{enable:!1,level:["log","warn","error","info"]},http:!1,consumeOnly:!1,maxRetryCount:3,checkoutEveryNms:5e3,ignoreClass:"rr-ignore",blockClass:"rr-block",maskTextClass:"rr-mask",sampling:{canvas:15,mousemove:50,scroll:100,input:"last"},packEvents:!1,clearStorageBeforeRecord:!0,error:!1,captureMode:"full",errorCapture:{beforeDuration:3e4,afterDuration:3e4,httpErrorThreshold:400},routerMonitor:{enable:!1,trackHashChange:!0,trackHistoryChange:!0,trackPageStayTime:!0,ignoreRoutes:[]}},xn=d()({},kn),An=null;function En(e){return Tn.apply(this,arguments)}function Tn(){return Tn=i()(o()().mark((function e(t){var r,n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=eo(),e.next=4,In(t,{headers:r});case 4:if(n=e.sent,a={},n.data)if("object"!==u()(n.data)||n.data.data){if("object"===u()(n.data.data))a=n.data.data;else if("string"==typeof n.data.data)try{a=JSON.parse(n.data.data)}catch(e){Xr.warn("Failed to parse config JSON string",e)}}else a=n.data;return e.abrupt("return",fn(kn,a));case 10:return e.prev=10,e.t0=e.catch(0),Xr.warn("Failed to fetch config from CDN, using default config",e.t0),e.abrupt("return",d()({},kn));case 14:case"end":return e.stop()}}),e,null,[[0,10]])}))),Tn.apply(this,arguments)}function Rn(e){xn=fn(xn,e)}function Mn(){return d()({},xn)}function On(){An&&(clearInterval(An),An=null)}function Ln(){return(Ln=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=8;break}return zn([t]),e.next=4,En(t);case 4:Rn(r=e.sent),(n=r.configUpdateInterval||kn.configUpdateInterval)&&(An&&clearInterval(An),An=setInterval(i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,En(t);case 3:Rn(e.sent),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),Xr.warn("Failed to update config from CDN",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),n));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nn=null;function Dn(e){Nn=e}var _n=[],Fn={},Un=[],Bn=null;function Pn(e){try{if(e.startsWith("http://")||e.startsWith("https://"))return e;if(e.startsWith("/"))return window.location.origin+e;var t=window.location.href,r=t.lastIndexOf("/");return t.substring(0,r+1)+e}catch(t){return e}}function Wn(e){return!function(e,t){try{var r=Pn(e),n=new URL(r),o=n.pathname,a=n.hostname;return!(!Yr.some((function(e){return a.includes(e)}))&&!Zr.some((function(e){return o.includes(e)})))||t.some((function(e){return!!r.includes(e)||!!a.includes(e)||!!o.includes(e)||(e.startsWith(".")?o.toLowerCase().endsWith(e.toLowerCase()):!(!e.startsWith("/")||!o.startsWith(e)))}))}catch(e){return!1}}(e,Un)&&(0!==_n.length&&function(e,t){try{var r=Pn(e);return t.some((function(e){return e.startsWith("/")?new URL(r).pathname.startsWith(e):r.startsWith(e)}))}catch(e){return!1}}(e,_n))}function Gn(){try{Lt.addCustomEvent(Kr,{type:"NETWORK_ONLINE",timestamp:Date.now()})}catch(e){Xr.warn("Failed to add NETWORK_ONLINE event (recording may have stopped)",e)}}function Kn(){try{Lt.addCustomEvent(Kr,{type:"NETWORK_OFFLINE",timestamp:Date.now()})}catch(e){Xr.warn("Failed to add NETWORK_OFFLINE event (recording may have stopped)",e)}}var jn=XMLHttpRequest.prototype.open,Yn=XMLHttpRequest.prototype.send,Zn=window.fetch,Vn=!1;function Hn(){jn&&(XMLHttpRequest.prototype.open=jn),Yn&&(XMLHttpRequest.prototype.send=Yn),Zn&&(window.fetch=Zn),window.removeEventListener("online",Gn),window.removeEventListener("offline",Kn),Vn=!1}function Jn(e){if(e&&e.length>0){var t=_n.concat(e),r=Array.from(new Set(t));_n.splice.apply(_n,[0,_n.length].concat(r))}}function qn(){return[].concat(_n)}function zn(e){if(e&&e.length>0){var t=Un.concat(e),r=Array.from(new Set(t));Un.splice.apply(Un,[0,Un.length].concat(r))}}function Xn(){return[].concat(Un)}function Qn(){return Bn}function $n(e){Object.assign(Fn,e)}function eo(){return d()({},Fn)}var to=null,ro=function(){to&&(to(),to=null)},no=function(){var e=Mn();if(e.enable){var t=en(),r=on();e.clearStorageBeforeRecord&&mn.clear(r).then((function(){})).catch((function(e){Xr.warn("Failed to clear storage before recording",e)}));var n,a=[];if(e.console&&e.console.enable){var s,u,c,f,p,h=d()(d()({level:e.console.level||["info","log","warn","error"]},e.console.lengthThreshold&&{lengthThreshold:e.console.lengthThreshold}),{},{stringifyOptions:d()({numOfKeysLimit:null!==(s=null===(u=e.console.stringifyOptions)||void 0===u?void 0:u.numOfKeysLimit)&&void 0!==s?s:50,depthOfLimit:null!==(c=null===(f=e.console.stringifyOptions)||void 0===f?void 0:f.depthOfLimit)&&void 0!==c?c:4},(null===(p=e.console.stringifyOptions)||void 0===p?void 0:p.stringLengthLimit)&&{stringLengthLimit:e.console.stringifyOptions.stringLengthLimit})});a.push({name:"rrweb/console@1",observer:Ar,options:h})}if(to=Lt({emit:function(e){try{mn.push(r,e)}catch(e){Xr.warn("Failed to storage push event:",e)}},recordCanvas:!0,sampling:e.sampling,checkoutEveryNms:e.checkoutEveryNms,ignoreClass:e.ignoreClass,blockClass:e.blockClass,maskTextClass:e.maskTextClass,dataURLOptions:{type:"image/webp",quality:.6},collectFonts:!0,recordCrossOriginIframes:!0,plugins:[].concat(a),packFn:e.packEvents?pr:void 0}),$n(l()({},Er,t)),Jn(Hr),e.http)try{n=Lt,Vn?Xr.warn("Network monitoring is already active"):(Vn=!0,XMLHttpRequest.prototype.open=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;try{this._rlogRequest={method:e,url:t.toString(),startTime:0,endTime:0}}catch(e){Xr.warn("Failed to save XHR request info:",e)}return jn.apply(this,[e,t,r,n,o])},XMLHttpRequest.prototype.send=function(e){var t=this;try{var r=this._rlogRequest;if(r){if(r.startTime=Date.now(),Wn(r.url))try{Object.entries(Fn).forEach((function(e){var r=V()(e,2),n=r[0],o=r[1];t.setRequestHeader(n,o)}))}catch(e){Xr.warn("Failed to set custom headers on XHR:",e)}this.addEventListener("load",(function(){var e=this;try{if(r.endTime=Date.now(),Wn(r.url)){var t={};Vr.forEach((function(r){try{var n=e.getResponseHeader(r);n&&(t[r]=n)}catch(e){}}));try{n.addCustomEvent(Wr,d()(d()({},r),{},{dur:r.endTime-r.startTime,responseHeaders:t,pagePath:window.location.href}))}catch(e){}}if(Nn){var o,a,i=null!==(o=null===(a=Mn().errorCapture)||void 0===a?void 0:a.httpErrorThreshold)&&void 0!==o?o:400;this.status>=i&&Nn.onError({type:"http",message:"XHR ".concat(r.method," ").concat(r.url," responded with status ").concat(this.status),timestamp:Date.now(),detail:{url:r.url,method:r.method,status:this.status}})}}catch(e){Xr.warn("Error in XHR load handler:",e)}})),this.addEventListener("error",(function(){try{n.addCustomEvent(Gr,d()(d()({},r),{},{dur:r.endTime-r.startTime,pagePath:window.location.href}))}catch(e){}try{Nn&&Nn.onError({type:"http",message:"XHR ".concat(r.method," ").concat(r.url," network error"),timestamp:Date.now(),detail:{url:r.url,method:r.method}})}catch(e){Xr.warn("Error in XHR error trigger:",e)}}))}}catch(e){Xr.warn("Error in XHR send hook:",e)}return Yn.apply(this,[e])},window.fetch=function(){var e=i()(o()().mark((function e(t,r){var a,i,s,u,c,l,f,p,h,g,v;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,a=t instanceof Request?t.url:t.toString(),i=(null==r?void 0:r.method)||(t instanceof Request?t.method:"GET").toUpperCase(),e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",Zn(t,r));case 8:s=Date.now(),u=r;try{Wn(a)&&Object.keys(Fn).length>0&&(u=d()(d()({},r),{},{headers:d()(d()({},(null==r?void 0:r.headers)||{}),Fn)}))}catch(e){Xr.warn("Failed to add custom headers on Fetch:",e),u=r}return e.prev=11,e.next=14,Zn(t,u);case 14:c=e.sent,e.next=22;break;case 17:e.prev=17,e.t1=e.catch(11);try{n.addCustomEvent(Gr,{url:a,method:i,pagePath:window.location.href})}catch(e){}try{Nn&&Nn.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," network error"),timestamp:Date.now(),detail:{url:a,method:i,error:String(e.t1)}})}catch(e){}throw e.t1;case 22:try{if(l=Date.now(),Wn(a)){f={},Vr.forEach((function(e){try{var t=c.headers.get(e);t&&(f[e]=t)}catch(e){}}));try{n.addCustomEvent(Wr,{url:a,method:i,dur:l-s,responseHeaders:f,pagePath:window.location.href})}catch(e){}}Nn&&(g=Mn(),v=null!==(p=null===(h=g.errorCapture)||void 0===h?void 0:h.httpErrorThreshold)&&void 0!==p?p:400,c.status>=v&&Nn.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," responded with status ").concat(c.status),timestamp:Date.now(),detail:{url:a,method:i,status:c.status}}))}catch(e){Xr.warn("Error in Fetch success handler:",e)}return e.abrupt("return",c);case 24:case"end":return e.stop()}}),e,null,[[0,5],[11,17]])})));return function(t,r){return e.apply(this,arguments)}}(),window.addEventListener("online",Gn),window.addEventListener("offline",Kn))}catch(e){Xr.warn("Failed to initialize HTTP monitoring:",e)}}};function oo(e){var t,r,n,o;n=Mn().urlParamsToCache||Ur,o=new URLSearchParams(window.location.search),n.forEach((function(e){var t=o.get(e);t&&sessionStorage.setItem("".concat(Tr).concat(e),t)}));var a=e.data&&e.data.length>0?e.data.length-1:-1,i={deviceId:e.deviceId,appId:e.appId,startTime:null===(t=e.data)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.timestamp,endTime:null===(r=e.data)||void 0===r||null===(r=r[a])||void 0===r?void 0:r.timestamp};return(Mn().urlParamsToCache||Ur).forEach((function(e){var t=function(e){return sessionStorage.getItem("".concat(Tr).concat(e))}(e);t&&(i[e]=t)})),i}var ao=function(){var e=i()(o()().mark((function e(t){var r,n,a,i,s,c,l,f;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=oo({appId:t.appId,deviceId:t.deviceId,data:t.data}),n=new URLSearchParams(r),a="".concat(t.url).concat(n?"?".concat(n):""),(i=new FormData).append("file",new Blob([JSON.stringify(t.data)]),$r()+".json"),s=eo(),e.next=8,Cn(a,i,{headers:s});case 8:c=e.sent,e.prev=9,l="string"==typeof c.data?JSON.parse(c.data):c.data,e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(9),e.abrupt("return");case 16:if(!l||"object"!==u()(l)||!1!==l.success){e.next=20;break}throw(f=new Error(l.errorMessage||"Upload failed with success=false")).responseData=l,f;case 20:case"end":return e.stop()}}),e,null,[[9,13]])})));return function(t){return e.apply(this,arguments)}}();var io=null,so=!1,uo=!1,co="",lo=!1,fo=0,po=!1,ho=0,go=null,vo=null,mo=null;function yo(e){mo=e}function wo(){return"batch_".concat(Date.now(),"_").concat(++ho)}function Io(){try{if("undefined"==typeof Worker)return null;var e="\n'use strict';\n\n// ===== Worker 内部状态 =====\nvar config = null;\nvar pollTimer = null;\nvar isRunning = false;\nvar failureCountMap = {};\n\n// ===== UUID 生成 =====\nfunction generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (Math.random() * 16) | 0;\n var v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n// ===== 构建上传 URL =====\nfunction buildUploadUrl(serv, queryParams) {\n var params = [];\n for (var key in queryParams) {\n if (queryParams.hasOwnProperty(key) && queryParams[key] != null && queryParams[key] !== '') {\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(queryParams[key]));\n }\n }\n var queryString = params.join('&');\n return serv + (queryString ? '?' + queryString : '');\n}\n\n// ===== 执行上传 =====\nfunction performUpload(msg) {\n var batchId = msg.batchId;\n var events = msg.events;\n var queryParams = msg.queryParams;\n var customHeaders = msg.customHeaders;\n\n try {\n // JSON 序列化在 Worker 中执行,不阻塞主线程\n var jsonStr = JSON.stringify(events);\n var blob = new Blob([jsonStr], { type: 'application/json' });\n var formData = new FormData();\n formData.append('file', blob, generateUUID() + '.json');\n\n var url = buildUploadUrl(config ? config.serv : '', queryParams);\n\n var xhr = new XMLHttpRequest();\n xhr.open('POST', url, true);\n xhr.timeout = ".concat(_r,";\n\n // 设置自定义请求头\n if (customHeaders) {\n for (var key in customHeaders) {\n if (customHeaders.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, customHeaders[key]);\n }\n }\n }\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n // 检查业务层 success 字段\n var uploadSuccess = true;\n var errorMessage = '';\n try {\n var responseData = JSON.parse(xhr.responseText);\n if (responseData && typeof responseData === 'object' && responseData.success === false) {\n uploadSuccess = false;\n errorMessage = responseData.errorMessage || 'Upload failed with success=false';\n }\n } catch(e) {\n // 无法解析 JSON,视为成功\n }\n\n if (uploadSuccess) {\n // 上传成功,重置失败计数\n var batchKey = config ? (config.appId + '_' + config.storageKey) : batchId;\n delete failureCountMap[batchKey];\n self.postMessage({ type: 'UPLOAD_SUCCESS', batchId: batchId });\n } else {\n handleFailure(batchId, errorMessage);\n }\n } else {\n handleFailure(batchId, 'HTTP ' + xhr.status + ': ' + xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function() {\n handleFailure(batchId, 'Network error');\n };\n\n xhr.ontimeout = function() {\n handleFailure(batchId, 'Request timeout');\n };\n\n xhr.send(formData);\n } catch (e) {\n handleFailure(batchId, 'Upload exception: ' + (e.message || String(e)));\n }\n}\n\n// ===== 处理上传失败 =====\nfunction handleFailure(batchId, errorMessage) {\n var batchKey = config ? (config.appId + '_' + config.storageKey) : batchId;\n var currentCount = failureCountMap[batchKey] || 0;\n var newCount = currentCount + 1;\n failureCountMap[batchKey] = newCount;\n\n var maxRetry = (config && config.maxRetryCount) ? config.maxRetryCount : 3;\n\n if (newCount >= maxRetry) {\n // 达到最大重试次数\n delete failureCountMap[batchKey];\n self.postMessage({\n type: 'MAX_RETRY_REACHED',\n batchId: batchId,\n error: errorMessage\n });\n } else {\n self.postMessage({\n type: 'UPLOAD_FAILURE',\n batchId: batchId,\n error: errorMessage,\n failureCount: newCount\n });\n }\n}\n\n// ===== 轮询调度 =====\nfunction startPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n }\n\n var interval = (config && config.uploadInterval) ? config.uploadInterval : 2000;\n\n pollTimer = setInterval(function() {\n if (!isRunning) return;\n\n // 向主线程请求数据批次\n // 主线程会根据当前模式(full/error)和状态决定是否提供数据\n self.postMessage({\n type: 'REQUEST_BATCH'\n });\n }, interval);\n}\n\nfunction stopPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n pollTimer = null;\n }\n}\n\n// ===== 清理 =====\nfunction cleanup() {\n isRunning = false;\n stopPolling();\n failureCountMap = {};\n config = null;\n}\n\n// ===== 消息处理 =====\nself.onmessage = function(e) {\n var msg = e.data;\n if (!msg || !msg.type) return;\n\n switch (msg.type) {\n case 'START':\n config = msg.config;\n isRunning = true;\n failureCountMap = {};\n startPolling();\n break;\n\n case 'STOP':\n cleanup();\n break;\n\n case 'UPLOAD_BATCH':\n if (isRunning) {\n performUpload(msg);\n }\n break;\n\n case 'UPDATE_CONFIG':\n if (msg.config) {\n for (var key in msg.config) {\n if (msg.config.hasOwnProperty(key) && config) {\n config[key] = msg.config[key];\n }\n }\n // 如果 uploadInterval 变了,重启轮询\n if (msg.config.uploadInterval && isRunning) {\n startPolling();\n }\n }\n break;\n\n case 'SET_ERROR_MODE_UPLOADING':\n // 状态由主线程管理,Worker 仅接收指令保持协议兼容\n break;\n }\n};\n\n// Worker 就绪通知\nself.postMessage({ type: 'READY' });\n"),t=new Blob([e],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r);return URL.revokeObjectURL(r),n}catch(e){return Xr.warn("Failed to create inline Worker, will fallback to main thread:",e),null}}function bo(e){var t=e.data;if(t&&t.type)switch(t.type){case"READY":so=!0,go&&(clearTimeout(go),go=null);break;case"REQUEST_BATCH":!function(){Co.apply(this,arguments)}();break;case"UPLOAD_SUCCESS":!function(e){ko.apply(this,arguments)}(t.batchId);break;case"UPLOAD_FAILURE":!function(e,t,r){xo.apply(this,arguments)}(t.batchId,t.error,t.failureCount);break;case"MAX_RETRY_REACHED":!function(e,t){Ao.apply(this,arguments)}(t.batchId,t.error)}else Xr.warn("Received invalid Worker message:",t)}function Co(){return Co=i()(o()().mark((function e(){var t,r,n,a,i,s,u,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!po){e.next=2;break}return e.abrupt("return");case 2:if((t=Mn()).enable){e.next=5;break}return e.abrupt("return");case 5:if(!(r="error"===t.captureMode)||lo){e.next=8;break}return e.abrupt("return");case 8:if(e.prev=8,po=!0,a=0,!r){e.next=19;break}return a=fo>0?fo:Date.now(),e.next=15,mn.pullByTimeRange(on(),a,Date.now());case 15:n=e.sent,fo=0,e.next=22;break;case 19:return e.next=21,mn.pull(on(),100);case 21:n=e.sent;case 22:if(n&&0!==n.length){e.next=25;break}return po=!1,e.abrupt("return");case 25:if(i=Mn(),!(sessionStorage.getItem(Or)===Lr||i.consumeOnly)){e.next=30;break}return po=!1,e.abrupt("return");case 30:s=oo({appId:co,deviceId:en(),data:n}),u=eo(),c=wo(),So.set(c,{events:n,isErrorMode:r,windowStart:a}),Eo({type:"UPLOAD_BATCH",batchId:c,events:n,queryParams:s,customHeaders:u}),po=!1,e.next=42;break;case 38:e.prev=38,e.t0=e.catch(8),po=!1,Xr.error("Error fetching batch for Worker:",e.t0);case 42:case"end":return e.stop()}}),e,null,[[8,38]])}))),Co.apply(this,arguments)}var So=new Map;function ko(){return(ko=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=So.get(t)){e.next=3;break}return e.abrupt("return");case 3:if(So.delete(t),e.prev=4,!(r.isErrorMode&&r.windowStart>0&&r.events.length>0)){e.next=10;break}return e.next=8,mn.removeByTimeRange(on(),r.windowStart);case 8:(n=r.events[r.events.length-1])&&n.timestamp&&(fo=n.timestamp);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),Xr.warn("Error in handleUploadSuccess:",e.t0);case 15:case"end":return e.stop()}}),e,null,[[4,12]])})))).apply(this,arguments)}function xo(){return(xo=i()(o()().mark((function e(t,r,n){var a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=So.get(t)){e.next=3;break}return e.abrupt("return");case 3:return So.delete(t),Xr.warn("Upload failed ".concat(n," time(s), will retry in next cycle:"),r),e.prev=5,e.next=8,mn.unshiftBatch(on(),a.events);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),Xr.warn("Failed to push events back to storage:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function Ao(){return(Ao=i()(o()().mark((function e(t,r){var n,a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=So.get(t)){e.next=3;break}return e.abrupt("return");case 3:return So.delete(t),a=Mn(),i=a.maxRetryCount||3,Xr.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=9,mn.unshiftBatch(on(),n.events);case 9:s=new CustomEvent(Br,{detail:{error:r,retryCount:i,appId:co,deviceId:en()}}),"undefined"!=typeof window&&window.dispatchEvent(s);try{Lt.addCustomEvent(Br,{error:r,retryCount:i,appId:co,deviceId:en(),timestamp:Date.now()})}catch(e){Xr.warn("Failed to record upload failure event via addCustomEvent:",e)}Mo(),mo&&setTimeout((function(){try{var e;null===(e=mo)||void 0===e||e()}catch(e){Xr.error("Error in cancel callback:",e)}}),0),Xr.error("Upload and recording stopped due to repeated failures");case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eo(e){if(io&&so)try{io.postMessage(e)}catch(e){Xr.warn("Failed to send message to Worker:",e)}else Xr.warn("Cannot send to Worker - worker:",!!io,"workerReady:",so,"command:",e.type)}function To(e){Xr.error("Upload Worker error:",e.message),Mo(!0)}function Ro(e){vo=e}function Mo(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(go&&(clearTimeout(go),go=null),io){try{io.postMessage({type:"STOP"}),io.terminate()}catch(e){}io=null}so=!1,uo=!1,po=!1,lo=!1,fo=0,ho=0,So.clear(),e&&vo&&vo()}function Oo(){return uo&&null!==io}var Lo=null;function No(e){Lo=e}var Do=!1,_o=new Map,Fo=!1,Uo=!1,Bo=0;function Po(e){Oo()?function(e){lo=e,Eo({type:"SET_ERROR_MODE_UPLOADING",uploading:e})}(e):Uo=e}function Wo(e){Oo()?function(e){fo=e}(e):Bo=e}function Go(e,t,r){return Ko.apply(this,arguments)}function Ko(){return(Ko=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&0!==n.length){e.next=2;break}return e.abrupt("return",{success:!0});case 2:return e.prev=2,e.next=5,ao({appId:r,data:n,deviceId:en(),url:t});case 5:return e.abrupt("return",{success:!0});case 8:return e.prev=8,e.t0=e.catch(2),Xr.warn("Upload failed:",e.t0),e.abrupt("return",{success:!1,error:e.t0});case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function jo(e,t,r,n,o,a){return Yo.apply(this,arguments)}function Yo(){return(Yo=i()(o()().mark((function e(t,r,n,a,i,s){var u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=s+1,c="".concat(n,"_").concat(on()),_o.set(c,u),!(u>=i)){e.next=16;break}return Xr.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=7,mn.unshiftBatch(on(),t);case 7:l=new CustomEvent(Br,{detail:{error:r,retryCount:i,appId:n,deviceId:en()}}),"undefined"!=typeof window&&window.dispatchEvent(l);try{Lt.addCustomEvent(Br,{error:r,retryCount:i,appId:n,deviceId:en(),timestamp:Date.now()})}catch(e){Xr.warn("Failed to record upload failure event via addCustomEvent:",e)}return _o.delete(c),Lo&&setTimeout((function(){try{var e;null===(e=Lo)||void 0===e||e()}catch(e){Xr.error("Error in cancel callback:",e)}}),0),Xr.error("Upload and recording stopped due to repeated failures"),e.abrupt("return",!0);case 16:return Xr.warn("Upload failed ".concat(u," time(s), will retry in next cycle")),e.next=19,mn.unshiftBatch(on(),t);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zo(e,t){var r=function(){var n=i()(o()().mark((function n(){var a,i,s,u,c,l,f,d,p,h,g;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Do){n.next=2;break}return n.abrupt("return");case 2:if(!Fo){n.next=5;break}return setTimeout((function(){r()}),100),n.abrupt("return");case 5:if((a=Mn()).enable){n.next=8;break}return n.abrupt("return");case 8:if(!(i="error"===a.captureMode)||Uo){n.next=12;break}return setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 12:if(n.prev=12,Fo=!0,u=0,!i){n.next=23;break}return u=Bo>0?Bo:Date.now(),n.next=19,mn.pullByTimeRange(on(),u,Date.now());case 19:s=n.sent,Bo=0,n.next=26;break;case 23:return n.next=25,mn.pull(on(),100);case 25:s=n.sent;case 26:if(s&&0!==s.length){n.next=30;break}return Fo=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 30:if(c=Mn(),!(sessionStorage.getItem(Or)===Lr||c.consumeOnly)){n.next=36;break}return Fo=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 36:return n.next=38,Go(e,t,s);case 38:if(!(l=n.sent).success){n.next=50;break}if(f="".concat(t,"_").concat(on()),_o.delete(f),!(i&&u>0&&s.length>0)){n.next=47;break}return n.next=45,mn.removeByTimeRange(on(),u);case 45:(d=s[s.length-1])&&d.timestamp&&(Bo=d.timestamp);case 47:Fo=!1,n.next=59;break;case 50:return Fo=!1,p=c.maxRetryCount||3,h="".concat(t,"_").concat(on()),g=_o.get(h)||0,n.next=56,jo(s,l.error,t,e,p,g);case 56:if(!n.sent){n.next=59;break}return n.abrupt("return");case 59:n.next=65;break;case 61:n.prev=61,n.t0=n.catch(12),Fo=!1,Xr.error("Error in upload loop:",n.t0);case 65:try{setTimeout((function(){r()}),a.uploadInterval)}catch(e){Xr.error("Failed to schedule next upload:",e)}case 66:case"end":return n.stop()}}),n,null,[[12,61]])})));return function(){return n.apply(this,arguments)}}();r()}function Vo(e,t){Ro((function(){Xr.log("Worker mode was downgraded, starting main thread upload"),Zo(e,t)}));var r=function(e,t){co=t;var r=Io();if(!r)return uo=!1,!1;(io=r).onmessage=bo,io.onerror=To;var n=Mn(),o={serv:e,appId:t,storageKey:on(),uploadInterval:n.uploadInterval,maxRetryCount:n.maxRetryCount||3};return io.postMessage({type:"START",config:o}),uo=!0,go=setTimeout((function(){so||(Xr.warn("Worker failed to send READY within ".concat(5e3,"ms, falling back to main thread")),Mo(!0))}),5e3),!0}(e,t);r||(Xr.log("Worker not available, falling back to main thread upload"),Zo(e,t))}function Ho(){Ro(null),Oo()&&Mo(),Do=!0,Fo=!1,Uo=!1,Bo=0}function Jo(){Ro(null),Oo()&&Mo(),Do=!1,Fo=!1,Uo=!1,Bo=0,_o.clear()}function qo(){return zo.apply(this,arguments)}function zo(){return(zo=i()(o()().mark((function e(){var t,r,n,a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(t=sn()).length){e.next=4;break}return e.abrupt("return");case 4:Xr.log("Found ".concat(t.length," orphan session(s) with residual data")),r=on(),n=h()(t),e.prev=7,n.s();case 9:if((a=n.n()).done){e.next=34;break}return i=a.value,e.prev=11,e.next=14,mn.pull(i.storageKey,1e4);case 14:if((s=e.sent)&&0!==s.length){e.next=18;break}return cn(i.sessionId),e.abrupt("continue",32);case 18:if(un(s)){e.next=22;break}return Xr.log("Orphan session ".concat(i.sessionId," data is out of valid range, discarding ").concat(s.length," events")),cn(i.sessionId),e.abrupt("continue",32);case 22:return e.next=24,mn.unshiftBatch(r,s);case 24:Xr.log("Merged ".concat(s.length," residual events from orphan session ").concat(i.sessionId," into current storage")),cn(i.sessionId),e.next=32;break;case 28:e.prev=28,e.t0=e.catch(11),Xr.warn("Error processing orphan session ".concat(i.sessionId,":"),e.t0),cn(i.sessionId);case 32:e.next=9;break;case 34:e.next=39;break;case 36:e.prev=36,e.t1=e.catch(7),n.e(e.t1);case 39:return e.prev=39,n.f(),e.finish(39);case 42:e.next=47;break;case 44:e.prev=44,e.t2=e.catch(0),Xr.warn("Error in flushOrphanSessions:",e.t2);case 47:case"end":return e.stop()}}),e,null,[[0,44],[7,36,39,42],[11,28]])})))).apply(this,arguments)}var Xo=d()({},Mn().routerMonitor||{}),Qo="",$o=Date.now(),ea=!1,ta=null,ra=null;function na(){return"undefined"==typeof window?"":window.location.pathname+window.location.search+window.location.hash}function oa(e,t,r){var n;if(null!==(n=Xo)&&void 0!==n&&n.enable&&(o=t,null===(a=Xo)||void 0===a||!a.ignoreRoutes||!Xo.ignoreRoutes.some((function(e){return"string"==typeof e?o.includes(e):e instanceof RegExp&&e.test(o)})))){var o,a,i={type:"route-change",from:e,to:t,method:r,timestamp:Date.now()};Qo=t,Xo.trackPageStayTime&&e&&(i.duration=Date.now()-$o);try{Lt.addCustomEvent("route-change",i)}catch(e){Xr.warn("Failed to add custom event (recording may have stopped)",e)}$o=Date.now()}}function aa(){var e=Qo,t=na();e!==t&&oa(e,t,"popstate")}function ia(){var e=Qo,t=na();e!==t&&oa(e,t,"hashchange")}function sa(e){var t,r,n,o,a,i=Mn().routerMonitor||{},s=d()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{}),u=JSON.stringify(s)!==JSON.stringify(Xo);Xo=s,u&&Xo.enable?pa(Xo):Xo.enable||va()}function ua(){try{Lt.addCustomEvent(jr,{type:"PAGE_LOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Xr.warn("Failed to add PAGE_LOAD event (recording may have stopped)",e)}}function ca(){try{Lt.addCustomEvent(jr,{type:"PAGE_UNLOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Xr.warn("Failed to add PAGE_UNLOAD event (recording may have stopped)",e)}}function la(e){try{Lt.addCustomEvent(jr,{type:"PAGE_HIDE",url:window.location.href,timestamp:Date.now(),persisted:e.persisted})}catch(e){Xr.warn("Failed to add PAGE_HIDE event (recording may have stopped)",e)}}function fa(e){try{Lt.addCustomEvent(jr,{type:"PAGE_SHOW",url:window.location.href,timestamp:Date.now(),persisted:e.persisted}),e.persisted&&($o=Date.now())}catch(e){Xr.warn("Failed to add PAGE_SHOW event (recording may have stopped)",e)}}function da(){try{var e="hidden"===document.visibilityState;Lt.addCustomEvent(jr,{type:e?"PAGE_VISIBILITY_HIDDEN":"PAGE_VISIBILITY_VISIBLE",url:window.location.href,timestamp:Date.now()})}catch(e){Xr.warn("Failed to add visibility change event (recording may have stopped)",e)}}function pa(e){var t,r,n,o,a;if(!ea&&"undefined"!=typeof window){var i=Mn().routerMonitor||{};(Xo=d()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{})).enable&&(Qo=na(),$o=Date.now(),Xo.trackHistoryChange&&(ta=window.history.pushState,ra=window.history.replaceState,window.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=ta.apply(this,t);try{var o=na();Qo!==o&&oa(Qo,o,"pushState")}catch(e){Xr.warn("Error in pushState hook:",e)}return n},window.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=ra.apply(this,t);try{var o=na();Qo!==o&&oa(Qo,o,"replaceState")}catch(e){Xr.warn("Error in replaceState hook:",e)}return n},window.addEventListener("popstate",aa)),Xo.trackHashChange&&window.addEventListener("hashchange",ia),window.addEventListener("load",ua),window.addEventListener("beforeunload",ca),window.addEventListener("pagehide",la),window.addEventListener("pageshow",fa),document.addEventListener("visibilitychange",da),ea=!0)}}function ha(){return{currentRoute:Qo,startTime:$o,stayTime:Date.now()-$o}}function ga(e,t){oa(t||Qo,e,"pushState")}function va(){ea&&(ta&&ra&&"undefined"!=typeof window&&(window.history.pushState=ta,window.history.replaceState=ra),"undefined"!=typeof window&&(window.removeEventListener("popstate",aa),window.removeEventListener("hashchange",ia),window.removeEventListener("load",ua),window.removeEventListener("beforeunload",ca),window.removeEventListener("pagehide",la),window.removeEventListener("pageshow",fa),document.removeEventListener("visibilitychange",da)),ea=!1,ta=null,ra=null)}var ma=null,ya=!1;function wa(e){ma=e}var Ia=function(e){try{Lt.addCustomEvent(Pr,e)}catch(t){Xr.error("Error captured",e)}try{"error"===Mn().captureMode&&ma&&ma.onError({type:e.type,message:e.message||e.type,timestamp:e.timestamp||Date.now(),detail:e})}catch(e){Xr.warn("Failed to notify error trigger:",e)}};function ba(e){try{var t=e;if(e.target!==window){var r={type:"RESOURCE_ERROR",resourceType:e.target.tagName,url:e.target.src||e.target.href||e.target.src,message:t.message,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};return Ia(r),!1}var n=t.message,o=t.filename,a=t.lineno,i=t.colno,s=t.error,u={type:"JS_ERROR",message:n,file:o,line:a,column:i,stack:null==s?void 0:s.stack,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};Ia(u)}catch(e){Xr.warn("Failed to handle unhandled rejection:",e)}return!1}function Ca(e){try{var t=e.reason||"Unknown rejection",r={type:"PROMISE_REJECTION",message:"string"==typeof t?t:t.message,stack:"object"===u()(t)?t.stack:null,timestamp:Date.now(),location:window.location.href};Ia(r)}catch(e){Xr.warn("Failed to handle unhandled rejection:",e)}}function Sa(){ya&&(window.removeEventListener("error",ba,!0),window.removeEventListener("unhandledrejection",Ca),ya=!1)}var ka=function(){function e(){var t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q()(this,e),l()(this,"beforeDuration",void 0),l()(this,"afterDuration",void 0),l()(this,"state","idle"),l()(this,"cooldownTimer",null),l()(this,"destroyed",!1),this.beforeDuration=null!==(t=n.beforeDuration)&&void 0!==t?t:3e4,this.afterDuration=null!==(r=n.afterDuration)&&void 0!==r?r:3e4}return X()(e,[{key:"isUploading",value:function(){return"uploading"===this.state}},{key:"onError",value:function(e){this.destroyed||("idle"===this.state?this.enterUploadingState(e.timestamp):this.resetCooldown())}},{key:"enterUploadingState",value:function(e){this.state="uploading",Wo(e-this.beforeDuration),Po(!0),this.resetCooldown()}},{key:"resetCooldown",value:function(){var e=this;this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),this.cooldownTimer=setTimeout((function(){try{e.exitUploadingState()}catch(e){Xr.warn("Error in exitUploadingState:",e)}}),this.afterDuration)}},{key:"exitUploadingState",value:function(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),Po(!1),this.state="idle"}},{key:"destroy",value:function(){this.destroyed=!0,this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),Po(!1),this.state="idle"}}]),e}(),xa=!1,Aa=null;function Ea(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"SDK instance";if(xa)Xr.warn("SDK has already been cancelled");else{xa=!0;try{if(ro(),Ho(),"undefined"!=typeof window&&window.XMLHttpRequest&&Hn(),va(),On(),Sa(),Aa&&(Aa.destroy(),Aa=null),wa(null),Dn(null),No(null),yo(null),e.clearData){var r=on();r&&mn.clear(r).catch((function(e){Xr.error("Error clearing storage",e)}))}an(nn()),Xr.log("SDK cancelled successfully via ".concat(t))}catch(e){Xr.error("Error cancelling SDK via ".concat(t),e)}}}function Ta(e,t,r){xa=!1,Jo(),setTimeout((function(){try{!function(){try{for(var e=JSON.parse(Qr.getItem(rn)||"{}"),t=Date.now(),r=en(),n=!1,o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];if(t-e[i]>Nr){var s="".concat(Rr).concat(r,"_").concat(i),u="".concat(Mr).concat(r,"_").concat(i);Qr.removeItem(s),Qr.removeItem(u),delete e[i],n=!0}}n&&Qr.setItem(rn,JSON.stringify(e))}catch(e){}}()}catch(e){Xr.warn("Failed to cleanup stale sessions:",e)}}),0);var n=Pn(e);!function(e){if(e){Bn=e;var t=Pn(e),r=[e];t!==e&&r.push(t),r.forEach((function(e){Un.includes(e)||Un.push(e)}))}}(n),function(e){return Ln.apply(this,arguments)}(r).then(i()(o()().mark((function e(){var r,a,i,s,u,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=Mn()).enable){e.next=3;break}return e.abrupt("return");case 3:(i="error"===a.captureMode)&&(wa(Aa=new ka({beforeDuration:null===(s=a.errorCapture)||void 0===s?void 0:s.beforeDuration,afterDuration:null===(u=a.errorCapture)||void 0===u?void 0:u.afterDuration})),Dn(Aa));try{no()}catch(e){Xr.error("Failed to start recording:",e)}return e.prev=6,e.next=9,qo();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),Xr.warn("Failed to flush orphan sessions:",e.t0);case 14:No(c=function(){try{Ea({},"upload failure")}catch(e){Xr.error("Failed to cancel SDK via upload failure callback:",e)}}),yo(c);try{Vo(n,t)}catch(e){Xr.error("Failed to start upload loop:",e)}try{pa(a.routerMonitor)}catch(e){Xr.warn("Failed to initialize router monitor:",e)}if(i||null!==(r=a.error)&&void 0!==r&&r)try{ya||(window.addEventListener("error",ba,!0),window.addEventListener("unhandledrejection",Ca),ya=!0)}catch(e){Xr.warn("Failed to initialize error handler:",e)}Xr.log("Initialized successfully");case 22:case"end":return e.stop()}}),e,null,[[6,11]])})))).catch((function(e){Xr.error("Failed to initialize SDK",e)}))}function Ra(e){try{Ta(e.serv,e.appId,e.cdnConfigUrl)}catch(e){Xr.error("Failed to initialize SDK:",e)}return{cancel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{Ea(e,"SDK instance")}catch(e){Xr.error("Failed to cancel SDK:",e)}}}}function Ma(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{Xr.warn("Please use rlog.cancel() from initialized instance instead of standalone cancelRecord()"),Ea(e,"standalone function")}catch(e){Xr.error("Failed to cancel record:",e)}}function Oa(e,t){try{Lt.addCustomEvent(e,t)}catch(e){Xr.warn("Failed to add custom event:",e)}}function La(e){Rn({consumeOnly:e})}function Na(){return sessionStorage.getItem(Or)===Lr||!!Mn().consumeOnly}function Da(){var e=!Mn().consumeOnly;return La(e),e}function _a(e){var t="string"==typeof e?e:e.message,r="object"===u()(e)&&e.stack?e.stack:void 0;try{Lt.addCustomEvent(Pr,{type:"CUSTOM_ERROR",message:t,stack:r,timestamp:Date.now(),location:"undefined"!=typeof window?window.location.href:""})}catch(e){Xr.warn("Failed to add custom error event:",e)}try{ma&&ma.onError({type:"custom",message:t,timestamp:Date.now(),detail:{stack:r}})}catch(e){Xr.warn("Failed to trigger error mode:",e)}}var Fa={getStorageAdapterType:function(){return mn.getAdapterType()},getDeviceId:en,getSessionId:nn,getStorageKey:on,resetUploadState:function(){Jo()},getStorageState:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=on(),e.abrupt("return",mn.getStorageState(t));case 2:case"end":return e.stop()}}),e)})))()},clearStorage:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=on(),e.abrupt("return",mn.clear(t));case 2:case"end":return e.stop()}}),e)})))()},getConfig:Mn}}(),n}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Rlog=t():e.Rlog=t()}(self,(function(){return function(){var e={982:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),i=a[0],s=a[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,s)),l=0,f=s>0?i-4:i;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=16383,s=0,u=n-o;s<u;s+=i)a.push(c(e,s,s+i>u?u:s+i));1===o?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=a.length;i<s;++i)r[i]=a[i],n[a.charCodeAt(i)]=i;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,a,i=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},825:function(e,t,r){"use strict";var n=r(982),o=r(501),a=r(664);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(t,r);e=s(e,n);var o=e.write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|p(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|p(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var a,i=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var l=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*i}else-1!==l&&(a-=a-l),l=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var f=!0,d=0;d<u;d++)if(c(e,a+d)!==c(t,d)){f=!1;break}if(f)return a}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))return i;e[r+i]=s}return i}function I(e,t,r,n){return j(G(t,e.length-r),e,r,n)}function b(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return b(e,t,r,n)}function S(e,t,r,n){return j(K(t),e,r,n)}function k(e,t,r,n){return j(function(e,t){for(var r,n,o,a=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var a,i,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[o+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(u=(15&c)<<12|(63&a)<<6|63&i)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[o+1],i=e[o+2],s=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));return r}(n)}t.lW=u,t.h2=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.g.TYPED_ARRAY_SUPPORT?r.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),s=Math.min(a,i),c=this.slice(n,o),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){a=c[f],i=l[f];break}return a<i?-1:i<a?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return I(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return C(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function M(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=t;a<r;++a)o+=W(e[a]);return o}function O(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,o,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-r,2);o<a;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function _(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-r,4);o<a;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function F(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,a){return a||F(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,a){return a||F(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;r=new u(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,o=1,a=this[e+--n];n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=0,i=1,s=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=r-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,a=n-r;if(this===e&&r<t&&t<n)for(o=a-1;o>=0;--o)e[o+t]=this[o+r];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var i=u.isBuffer(e)?e:G(new u(e,n).toString()),s=i.length;for(a=0;a<r-t;++a)this[a+t]=i[a%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,o=null,a=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function K(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}},501:function(e,t){t.read=function(e,t,r,n,o){var a,i,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,n),a-=c}return(p?-1:1)*i*Math.pow(2,a-n)},t.write=function(e,t,r,n,o,a){var i,s,u,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(i++,u/=2),i+f>=l?(s=0,i=l):i+f>=1?(s=(t*u-1)*Math.pow(2,o),i+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(i=i<<o|s,c+=o;c>0;e[r+p]=255&i,p+=h,i/=256,c-=8);e[r+p-h]|=128*g}},664:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},619:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=i(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||i(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},389:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},361:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},461:function(e,t,r){var n=r(389);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},468:function(e){function t(e,t,r,n,o,a,i){try{var s=e[a](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=e.apply(r,n);function s(e){t(i,o,a,s,u,"next",e)}function u(e){t(i,o,a,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},745:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},776:function(e,t,r){var n=r(284);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},305:function(e,t,r){var n=r(848);e.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}},e.exports.__esModule=!0,e.exports.default=e.exports},254:function(e,t,r){var n=r(284);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},48:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},785:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},746:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},474:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},227:function(e,t,r){var n=r(254);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},658:function(e,t,r){var n=r(978).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,i=a.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof w?t:w,a=Object.create(o.prototype),i=new L(n||[]);return s(a,"_invoke",{value:T(e,r,i)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var g="suspendedStart",v="executing",m="completed",y={};function w(){}function I(){}function b(){}var C={};d(C,c,(function(){return this}));var S=Object.getPrototypeOf,k=S&&S(S(N([])));k&&k!==a&&i.call(k,c)&&(C=k);var x=b.prototype=w.prototype=Object.create(C);function A(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,a,s,u){var c=h(e[o],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function T(e,r,n){var o=g;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var u=R(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function R(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return I.prototype=b,s(x,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:I,configurable:!0}),I.displayName=d(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,f,"GeneratorFunction")),e.prototype=Object.create(x),e},r.awrap=function(e){return{__await:e}},A(E.prototype),d(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new E(p(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(x),d(x,f,"Generator"),d(x,c,(function(){return this})),d(x,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},257:function(e,t,r){var n=r(361),o=r(785),a=r(848),i=r(746);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},480:function(e,t,r){var n=r(461),o=r(48),a=r(848),i=r(474);e.exports=function(e){return n(e)||o(e)||a(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},478:function(e,t,r){var n=r(978).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},284:function(e,t,r){var n=r(978).default,o=r(478);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},978:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},848:function(e,t,r){var n=r(389);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{addCustomEvent:function(){return Oa},cancelRecord:function(){return Ma},cleanupErrorHandler:function(){return Sa},debug:function(){return Ua},getBlackListUrls:function(){return Xn},getCurrentRouteInfo:function(){return ha},getCustomHeaders:function(){return eo},getSdkLogEndpoint:function(){return Qn},getWhiteListUrls:function(){return qn},init:function(){return Ra},isConsumeOnlyMode:function(){return Da},manualRouteChange:function(){return ga},reportError:function(){return Fa},setBlackListUrls:function(){return zn},setConsumeOnlyMode:function(){return Na},setCustomHeaders:function(){return $n},setWhiteListUrls:function(){return Jn},shouldRecordUrl:function(){return Wn},stopRouterMonitor:function(){return va},takeFullSnapshot:function(){return La},toggleConsumeOnlyMode:function(){return _a},updateRouterConfig:function(){return sa}});var e,t=r(658),o=r.n(t),a=r(468),i=r.n(a),s=r(978),u=r.n(s),c=r(254),l=r.n(c),f=r(227),d=r.n(f),p=r(305),h=r.n(p);function g(e){return e.nodeType===e.ELEMENT_NODE}function v(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function m(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function y(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(w).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function w(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=y(e.styleSheet)||t}catch(e){}return t}!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"}(e||(e={}));var I=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-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,r=this.getId(e);this.idNodeMap.delete(r),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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function b(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,a=e.maskInputFn,i=o||"";return(t[r.toLowerCase()]||t[n])&&(i=a?a(i):"*".repeat(i.length)),i}var C="__rrweb_original__";var S,k,x=1,A=new RegExp("[^a-z0-9-_:]");function E(){return x++}var T=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,M=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(T,(function(e,r,n,o,a,i){var s,u=n||a||i,c=r||o||"";if(!u)return e;if(!R.test(u))return"url(".concat(c).concat(u).concat(c,")");if(M.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=t.split("/"),f=u.split("/");l.pop();for(var d=0,p=f;d<p.length;d++){var h=p[d];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var L=/^[^ \t\n\r\u000c]+/,N=/^[, \t\n\r\u000c]+/;function D(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function _(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function F(){var e=document.createElement("a");return e.href="",e.href}function U(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?D(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(N),!(r>=t.length);){var a=n(L);if(","===a.slice(-1))a=D(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=D(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?O(n,F()):"object"===t&&"data"===r&&n?D(e,n):n:D(e,n)}function B(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&B(e.parentNode,t,r);for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&B(e.parentNode,t,r)}function P(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(B(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function W(t,r){var n=r.doc,o=r.mirror,a=r.blockClass,i=r.blockSelector,s=r.maskTextClass,u=r.maskTextSelector,c=r.inlineStylesheet,l=r.maskInputOptions,f=void 0===l?{}:l,d=r.maskTextFn,p=r.maskInputFn,h=r.dataURLOptions,g=void 0===h?{}:h,v=r.inlineImages,m=r.recordCanvas,w=r.keepIframeSrcFn,I=r.newlyAddedElement,x=void 0!==I&&I,E=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:E};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,o=r.blockClass,a=r.blockSelector,i=r.inlineStylesheet,s=r.maskInputOptions,u=void 0===s?{}:s,c=r.maskInputFn,l=r.dataURLOptions,f=void 0===l?{}:l,d=r.inlineImages,p=r.recordCanvas,h=r.keepIframeSrcFn,g=r.newlyAddedElement,v=void 0!==g&&g,m=r.rootId,w=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(t,o,a),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return A.test(t)?"div":t}(t),x={},E=t.attributes.length,T=0;T<E;T++){var R=t.attributes[T];x[R.name]=U(n,I,R.name,R.value)}if("link"===I&&i){var M=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),L=null;M&&(L=y(M)),L&&(delete x.rel,delete x.href,x._cssText=O(L,M.href))}if("style"===I&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(L=y(t.sheet))&&(x._cssText=O(L,F()))}if("input"===I||"textarea"===I||"select"===I){var N=t.value,D=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&N?x.value=b({type:x.type,tagName:I,value:N,maskInputOptions:u,maskInputFn:c}):D&&(x.checked=D)}"option"===I&&(t.selected&&!u.select?x.selected=!0:delete x.selected);if("canvas"===I&&p)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,a=C in o?o[C]:o;if(new Uint32Array(a.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var B=t.toDataURL(f.type,f.quality),P=document.createElement("canvas");P.width=t.width,P.height=t.height,B!==P.toDataURL(f.type,f.quality)&&(x.rr_dataURL=B)}if("img"===I&&d){S||(S=n.createElement("canvas"),k=S.getContext("2d"));var W=t,G=W.crossOrigin;W.crossOrigin="anonymous";var K=function(){try{S.width=W.naturalWidth,S.height=W.naturalHeight,k.drawImage(W,0,0),x.rr_dataURL=S.toDataURL(f.type,f.quality)}catch(e){console.warn("Cannot inline img src=".concat(W.currentSrc,"! Error: ").concat(e))}G?x.crossOrigin=G:W.removeAttribute("crossorigin")};W.complete&&0!==W.naturalWidth?K():W.onload=K}"audio"!==I&&"video"!==I||(x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime);v||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop));if(w){var j=t.getBoundingClientRect(),Y=j.width,Z=j.height;x={class:x.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(Z,"px")}}"iframe"!==I||h(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);return{type:e.Element,tagName:I,attributes:x,childNodes:[],isSVG:_(t)||void 0,needBlock:w,rootId:m}}(t,{doc:n,blockClass:a,blockSelector:i,inlineStylesheet:c,maskInputOptions:f,maskInputFn:p,dataURLOptions:g,inlineImages:v,recordCanvas:m,keepIframeSrcFn:w,newlyAddedElement:x,rootId:E});case t.TEXT_NODE:return function(t,r){var n,o=r.maskTextClass,a=r.maskTextSelector,i=r.maskTextFn,s=r.rootId,u=t.parentNode&&t.parentNode.tagName,c=t.textContent,l="STYLE"===u||void 0,f="SCRIPT"===u||void 0;if(l&&c){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(d=t.parentNode.sheet).cssRules?Array.from(d.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}c=O(c,F())}var d;f&&(c="SCRIPT_PLACEHOLDER");!l&&!f&&c&&P(t,o,a)&&(c=i?i(c):c.replace(/[\S]/g,"*"));return{type:e.Text,textContent:c||"",isStyle:l,rootId:s}}(t,{maskTextClass:s,maskTextSelector:u,maskTextFn:d,rootId:E});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function G(e){return void 0===e?"":e.toLowerCase()}function K(t,r){var n,o=r.doc,a=r.mirror,i=r.blockClass,s=r.blockSelector,u=r.maskTextClass,c=r.maskTextSelector,l=r.skipChild,f=void 0!==l&&l,d=r.inlineStylesheet,p=void 0===d||d,h=r.maskInputOptions,y=void 0===h?{}:h,w=r.maskTextFn,I=r.maskInputFn,b=r.slimDOMOptions,C=r.dataURLOptions,S=void 0===C?{}:C,k=r.inlineImages,x=void 0!==k&&k,A=r.recordCanvas,T=void 0!==A&&A,R=r.onSerialize,M=r.onIframeLoad,O=r.iframeLoadTimeout,L=void 0===O?5e3:O,N=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=void 0===D?5e3:D,F=r.keepIframeSrcFn,U=void 0===F?function(){return!1}:F,B=r.newlyAddedElement,P=void 0!==B&&B,j=r.preserveWhiteSpace,Y=void 0===j||j,Z=W(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,dataURLOptions:S,inlineImages:x,recordCanvas:T,keepIframeSrcFn:U,newlyAddedElement:P});if(!Z)return console.warn(t,"not serialized"),null;n=a.hasNode(t)?a.getId(t):!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(G(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===G(t.attributes.name)||"icon"===G(t.attributes.rel)||"apple-touch-icon"===G(t.attributes.rel)||"shortcut icon"===G(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&G(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(G(t.attributes.property).match(/^(og|twitter|fb):/)||G(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===G(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===G(t.attributes.name)||"googlebot"===G(t.attributes.name)||"bingbot"===G(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===G(t.attributes.name)||"generator"===G(t.attributes.name)||"framework"===G(t.attributes.name)||"publisher"===G(t.attributes.name)||"progid"===G(t.attributes.name)||G(t.attributes.property).match(/^article:/)||G(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===G(t.attributes.name)||"yandex-verification"===G(t.attributes.name)||"csrf-token"===G(t.attributes.name)||"p:domain_verify"===G(t.attributes.name)||"verify-v1"===G(t.attributes.name)||"verification"===G(t.attributes.name)||"shopify-checkout-api-token"===G(t.attributes.name)))return!0}}return!1}(Z,b)&&(Y||Z.type!==e.Text||Z.isStyle||Z.textContent.replace(/^\s+|\s+$/gm,"").length)?E():-2;var V=Object.assign(Z,{id:n});if(a.add(t,V),-2===n)return null;R&&R(t);var H=!f;if(V.type===e.Element){H=H&&!V.needBlock,delete V.needBlock;var J=t.shadowRoot;J&&m(J)&&(V.isShadowHost=!0)}if((V.type===e.Document||V.type===e.Element)&&H){b.headWhitespace&&V.type===e.Element&&"head"===V.tagName&&(Y=!1);for(var q={doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:f,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:U},z=0,X=Array.from(t.childNodes);z<X.length;z++){(ee=K(X[z],q))&&V.childNodes.push(ee)}if(g(t)&&t.shadowRoot)for(var Q=0,$=Array.from(t.shadowRoot.childNodes);Q<$.length;Q++){var ee;(ee=K($[Q],q))&&(m(t.shadowRoot)&&(ee.isShadow=!0),V.childNodes.push(ee))}}return t.parentNode&&v(t.parentNode)&&m(t.parentNode)&&(V.isShadow=!0),V.type===e.Element&&"iframe"===V.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,a=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&M){var r=K(e,{doc:e,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:U});r&&M(t,r)}}),L),V.type===e.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(e,t,r){var n,o=!1;try{n=e.sheet}catch(e){return}if(!n){var a=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(t,(function(){if(N){var e=K(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:U});e&&N(t,e)}}),_),V}function j(e,t){var r=t||{},n=r.mirror,o=void 0===n?new I:n,a=r.blockClass,i=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,c=r.maskTextClass,l=void 0===c?"rr-mask":c,f=r.maskTextSelector,d=void 0===f?null:f,p=r.inlineStylesheet,h=void 0===p||p,g=r.inlineImages,v=void 0!==g&&g,m=r.recordCanvas,y=void 0!==m&&m,w=r.maskAllInputs,b=void 0!==w&&w,C=r.maskTextFn,S=r.maskInputFn,k=r.slimDOM,x=void 0!==k&&k,A=r.dataURLOptions,E=r.preserveWhiteSpace,T=r.onSerialize,R=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn;return K(e,{doc:e,mirror:o,blockClass:i,blockSelector:u,maskTextClass:l,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===x,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===x?{}:x,dataURLOptions:A,inlineImages:v,recordCanvas:y,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:R,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}var Y=/([^\\]):hover/;new RegExp(Y.source,"g");var Z=r(257),V=r.n(Z),H=r(480),J=r(745),q=r.n(J),z=r(776),X=r.n(z);function Q(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),function(){return r.removeEventListener(e,t,n)}}var $="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.",ee={map:{},getId:function(){return console.error($),-1},getNode:function(){return console.error($),null},removeNodeFromMap:function(){console.error($)},has:function(){return console.error($),!1},reset:function(){console.error($)}};function te(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var u=Date.now();o||!1!==r.leading||(o=u);var c=t-(u-o),l=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=u,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout((function(){o=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)}),c))}}function re(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set:function(e){var t=this;setTimeout((function(){r.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return re(e,t,a||{},!0)}}function ne(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}function oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ae(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ie(e,t,r,n){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(B(o,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function se(e,t){return-2===t.getId(e)}function ue(e,t){if(v(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function le(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r[0];if(!(0 in r))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}function fe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function de(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function pe(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,r){return"map"===t&&console.error($),Reflect.get(e,t,r)}}));var he=function(){function e(){J(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return z(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}(),ge=function(e){return 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}(ge||{}),ve=function(e){return 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}(ve||{}),me=function(e){return 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}(me||{}),ye=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(ye||{});function we(e){return"__ln"in e}var Ie=function(){function e(){J(this,e),this.length=0,this.head=null}return z(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&we(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&we(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}]),e}(),be=function(e,t){return"".concat(e,"@").concat(t)},Ce=function(){function e(){var t=this;J(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],r=new Ie,n=function(e){for(var r=e,n=-2;-2===n;)n=(r=r&&r.nextSibling)&&t.mirror.getId(r);return n},o=function(o){var a,i,s,u,c=null;(null===(i=null===(a=o.getRootNode)||void 0===a?void 0:a.call(o))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(c=o.getRootNode().host);for(var l=c;(null===(u=null===(s=null==l?void 0:l.getRootNode)||void 0===s?void 0:s.call(l))||void 0===u?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;var f=!(t.doc.contains(o)||l&&t.doc.contains(l));if(o.parentNode&&!f){var d=v(o.parentNode)?t.mirror.getId(c):t.mirror.getId(o.parentNode),p=n(o);if(-1===d||-1===p)return r.addNode(o);var h=K(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){fe(e,t.mirror)&&t.iframeManager.addIframe(e),de(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),pe(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,r){t.iframeManager.attachIframe(e,r),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,r){t.stylesheetManager.attachLinkElement(e,r)}});h&&e.push({parentId:d,nextId:p,node:h})}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=0,i=Array.from(t.movedSet.values());a<i.length;a++){var s=i[a];ke(t.removes,s,t.mirror)&&!t.movedSet.has(s.parentNode)||o(s)}for(var u=0,c=Array.from(t.addedSet.values());u<c.length;u++){var l=c[u];Ae(t.droppedSet,l)||ke(t.removes,l,t.mirror)?Ae(t.movedSet,l)?o(l):t.droppedSet.add(l):o(l)}for(var f=null;r.length;){var d=null;if(f){var p=t.mirror.getId(f.value.parentNode),h=n(f.value);-1!==p&&-1!==h&&(d=f)}if(!d)for(var g=r.length-1;g>=0;g--){var m=r.get(g);if(m){var y=t.mirror.getId(m.value.parentNode);if(-1===n(m.value))continue;if(-1!==y){d=m;break}var w=m.value;if(w.parentNode&&w.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var I=w.parentNode.host;if(-1!==t.mirror.getId(I)){d=m;break}}}}if(!d){for(;r.head;)r.removeNode(r.head.value);break}f=d.previous,r.removeNode(d.value),o(d.value)}var b={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){return{id:t.mirror.getId(e.node),attributes:e.attributes}})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(b.texts.length||b.attributes.length||b.removes.length||b.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(b))}},this.processMutation=function(e){if(!se(e.target,t.mirror))switch(e.type){case"characterData":var r=e.target.textContent;ie(e.target,t.blockClass,t.blockSelector,!1)||r===e.oldValue||t.texts.push({value:P(e.target,t.maskTextClass,t.maskTextSelector)&&r?t.maskTextFn?t.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var n=e.target,o=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(o=b({maskInputOptions:t.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:o,maskInputFn:t.maskInputFn})),ie(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var a=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===n.tagName&&"src"===e.attributeName&&!t.keepIframeSrcFn(o)){if(n.contentDocument)return;e.attributeName="rr_src"}if(a||(a={node:e.target,attributes:{}},t.attributes.push(a)),"style"===e.attributeName){var i=t.doc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue),void 0!==a.attributes.style&&null!==a.attributes.style||(a.attributes.style={});for(var s=a.attributes.style,u=0,c=Array.from(n.style);u<c.length;u++){var l=c[u],f=n.style.getPropertyValue(l),d=n.style.getPropertyPriority(l);f===i.style.getPropertyValue(l)&&d===i.style.getPropertyPriority(l)||(s[l]=""===d?f:[f,d])}for(var p=0,h=Array.from(i.style);p<h.length;p++){var g=h[p];""===n.style.getPropertyValue(g)&&(s[g]=!1)}}else a.attributes[e.attributeName]=U(t.doc,n.tagName,e.attributeName,o);break;case"childList":if(ie(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(r){return t.genAdds(r,e.target)})),e.removedNodes.forEach((function(r){var n=t.mirror.getId(r),o=v(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);ie(e.target,t.blockClass,t.blockSelector,!1)||se(r,t.mirror)||!function(e,t){return-1!==t.getId(e)}(r,t.mirror)||(t.addedSet.has(r)?(Se(t.addedSet,r),t.droppedSet.add(r)):t.addedSet.has(e.target)&&-1===n||ue(e.target,t.mirror)||(t.movedSet.has(r)&&t.movedMap[be(n,o)]?Se(t.movedSet,r):t.removes.push({parentId:o,id:n,isShadow:!(!v(e.target)||!m(e.target))||void 0})),t.mapRemoves.push(r))}))}},this.genAdds=function(e,r){if(t.mirror.hasNode(e)){if(se(e,t.mirror))return;t.movedSet.add(e);var n=null;r&&t.mirror.hasNode(r)&&(n=t.mirror.getId(r)),n&&-1!==n&&(t.movedMap[be(t.mirror.getId(e),n)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);ie(e,t.blockClass,t.blockSelector,!1)||e.childNodes.forEach((function(e){return t.genAdds(e)}))}}return z(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((function(r){t[r]=e[r]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Se(e,t){e.delete(t),t.childNodes.forEach((function(t){return Se(e,t)}))}function ke(e,t,r){return 0!==e.length&&xe(e,t,r)}function xe(e,t,r){var n=t.parentNode;if(!n)return!1;var o=r.getId(n);return!!e.some((function(e){return e.id===o}))||xe(e,n,r)}function Ae(e,t){return 0!==e.size&&Ee(e,t)}function Ee(e,t){var r=t.parentNode;return!!r&&(!!e.has(r)||Ee(e,r))}var Te=[],Re="undefined"!=typeof CSSGroupingRule,Me="undefined"!=typeof CSSMediaRule,Oe="undefined"!=typeof CSSSupportsRule,Le="undefined"!=typeof CSSConditionRule;function Ne(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function De(e,t){var r,n,o=new Ce;Te.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function _e(e){var t=e.mousemoveCb,r=e.sampling,n=e.doc,o=e.mirror;if(!1===r.mousemove)return function(){};var a,i="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],c=te((function(e){var r=Date.now()-a;t(u.map((function(e){return e.timeOffset-=r,e})),e),u=[],a=null}),s),l=te((function(e){var t=Ne(e),r=ce(e)?e.changedTouches[0]:e,n=r.clientX,i=r.clientY;a||(a=Date.now()),u.push({x:n,y:i,id:o.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?ve.Drag:e instanceof MouseEvent?ve.MouseMove:ve.TouchMove)}),i,{trailing:!1}),f=[Q("mousemove",l,n),Q("touchmove",l,n),Q("drag",l,n)];return function(){f.forEach((function(e){return e()}))}}function Fe(e){var t=e.mouseInteractionCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,u=[];return Object.keys(me).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=e.toLowerCase(),s=function(e){return function(r){var i=Ne(r);if(!ie(i,o,a,!0)){var s=ce(r)?r.changedTouches[0]:r;if(s){var u=n.getId(i),c=s.clientX,l=s.clientY;t({type:me[e],id:u,x:c,y:l})}}}}(e);u.push(Q(i,s,r))})),function(){u.forEach((function(e){return e()}))}}function Ue(e){var t=e.scrollCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector;return Q("scroll",te((function(e){var i=Ne(e);if(i&&!ie(i,o,a,!0)){var s=n.getId(i);if(i===r){var u=r.scrollingElement||r.documentElement;t({id:s,x:u.scrollLeft,y:u.scrollTop})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),r)}function Be(e){var t=e.viewportResizeCb,r=-1,n=-1;return Q("resize",te((function(){var e=oe(),o=ae();r===e&&n===o||(t({width:Number(o),height:Number(e)}),r=e,n=o)}),200),window)}function Pe(e,t){var r=Object.assign({},e);return t||delete r.userTriggered,r}var We=["INPUT","TEXTAREA","SELECT"],Ge=new WeakMap;function Ke(e){var t=e.inputCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.maskInputOptions,u=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function f(e){var t=Ne(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(We.indexOf(t.tagName)<0)&&!ie(t,o,a,!0)){var c=t.type;if(!t.classList.contains(i)){var f=t.value,p=!1;"radio"===c||"checkbox"===c?p=t.checked:(s[t.tagName.toLowerCase()]||s[c])&&(f=b({maskInputOptions:s,tagName:t.tagName,type:c,value:f,maskInputFn:u})),d(t,Pe({text:f,isChecked:p,userTriggered:n},l));var h=t.name;"radio"===c&&h&&p&&r.querySelectorAll('input[type="radio"][name="'.concat(h,'"]')).forEach((function(e){e!==t&&d(e,Pe({text:e.value,isChecked:!p,userTriggered:!1},l))}))}}}function d(e,r){var o=Ge.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Ge.set(e,r);var a=n.getId(e);t(Object.assign(Object.assign({},r),{id:a}))}}var p=("last"===c.input?["change"]:["input","change"]).map((function(e){return Q(e,f,r)})),h=r.defaultView;if(!h)return function(){p.forEach((function(e){return e()}))};var g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),v=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push.apply(p,H(v.map((function(e){return re(e[0],e[1],{set:function(){f({target:this})}},!1,h)})))),function(){p.forEach((function(e){return e()}))}}function je(e){return function(e,t){if(Re&&e.parentRule instanceof CSSGroupingRule||Me&&e.parentRule instanceof CSSMediaRule||Oe&&e.parentRule instanceof CSSSupportsRule||Le&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ye(e,t,r){var n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Ze(e,t){var r=e.styleSheetRuleCb,n=e.mirror,o=e.stylesheetManager,a=t.win,i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var a=Ye(this,n,o.styleMirror),s=a.id,u=a.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:t}]}),i.apply(this,[e,t])};var s,u,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=Ye(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,removes:[{index:e}]}),c.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=function(e){var t=Ye(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replace:e}),s.apply(this,[e])}),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=function(e){var t=Ye(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replaceSync:e}),u.apply(this,[e])});var l={};Re?l.CSSGroupingRule=a.CSSGroupingRule:(Me&&(l.CSSMediaRule=a.CSSMediaRule),Le&&(l.CSSConditionRule=a.CSSConditionRule),Oe&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=Z(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(e,t){var i=Ye(this.parentStyleSheet,n,o.styleMirror),s=i.id,u=i.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:[].concat(H(je(this)),[t||0])}]}),f[a].insertRule.apply(this,[e,t])},i.prototype.deleteRule=function(e){var t=Ye(this.parentStyleSheet,n,o.styleMirror),i=t.id,s=t.styleId;return(i&&-1!==i||s&&-1!==s)&&r({id:i,styleId:s,removes:[{index:[].concat(H(je(this)),[e])}]}),f[a].deleteRule.apply(this,[e])}})),function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=c,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(e){var t=Z(e,2),r=t[0],n=t[1];n.prototype.insertRule=f[r].insertRule,n.prototype.deleteRule=f[r].deleteRule}))}}function Ve(e,t){var r,n,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var u="#document"===t.nodeName?null===(r=t.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&u&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,r=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return r}}),function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):function(){}}function He(e,t){var r=e.styleDeclarationCb,n=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var u;if(o.has(e))return s.apply(this,[e,t,i]);var c=Ye(null===(u=this.parentRule)||void 0===u?void 0:u.parentStyleSheet,n,a.styleMirror),l=c.id,f=c.styleId;return(l&&-1!==l||f&&-1!==f)&&r({id:l,styleId:f,set:{property:e,value:t,priority:i},index:je(this.parentRule)}),s.apply(this,[e,t,i])};var u=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t;if(o.has(e))return u.apply(this,[e]);var i=Ye(null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet,n,a.styleMirror),s=i.id,c=i.styleId;return(s&&-1!==s||c&&-1!==c)&&r({id:s,styleId:c,remove:{property:e},index:je(this.parentRule)}),u.apply(this,[e])},function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=u}}function Je(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.blockSelector,o=e.mirror,a=e.sampling,i=function(e){return te((function(a){var i=Ne(a);if(i&&!ie(i,r,n,!0)){var s=i.currentTime,u=i.volume,c=i.muted,l=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:u,muted:c,playbackRate:l})}}),a.media||500)},s=[Q("play",i(0)),Q("pause",i(1)),Q("seeked",i(2)),Q("volumechange",i(3)),Q("ratechange",i(4))];return function(){s.forEach((function(e){return e()}))}}function qe(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return function(){};var o=[],a=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,r){var n=new i(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=ne(r.fonts,"add",(function(e){return function(r){return setTimeout((function(){var e=a.get(r);e&&(t(e),a.delete(r))}),0),e.apply(this,[r])}}));return o.push((function(){n.FontFace=i})),o.push(s),function(){o.forEach((function(e){return e()}))}}function ze(e){var t=e.doc,r=e.mirror,n=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,c=0;c<u;c++){var l=e.getRangeAt(c),f=l.startContainer,d=l.startOffset,p=l.endContainer,h=l.endOffset;ie(f,n,o,!0)||ie(p,n,o,!0)||s.push({start:r.getId(f),startOffset:d,end:r.getId(p),endOffset:h})}a({ranges:s})}};return s(),Q("selectionchange",s)}function Xe(e,t){var r=e.mutationCb,n=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,c=e.styleSheetRuleCb,l=e.styleDeclarationCb,f=e.canvasMutationCb,d=e.fontCb,p=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),r.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),n.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),f.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),d.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),p.apply(void 0,arguments)}}function Qe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};Xe(e,t);var n,o=De(e,e.doc),a=_e(e),i=Fe(e),s=Ue(e),u=Be(e),c=Ke(e),l=Je(e),f=Ze(e,{win:r}),d=Ve(e,e.doc),h=He(e,{win:r}),g=e.collectFonts?qe(e):function(){},v=ze(e),m=[],y=p(e.plugins);try{for(y.s();!(n=y.n()).done;){var w=n.value;m.push(w.observer(w.callback,r,w.options))}}catch(e){y.e(e)}finally{y.f()}return function(){Te.forEach((function(e){return e.reset()})),o.disconnect(),a(),i(),s(),u(),c(),l(),f(),d(),h(),g(),v(),m.forEach((function(e){return e()}))}}var $e=function(){function e(t){J(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return z(e,[{key:"getId",value:function(e,t,r,n){var o=r||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),a.set(i,t)),i}},{key:"getIds",value:function(e,t){var r=this,n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getId(e,t,n,o)}))}},{key:"getRemoteId",value:function(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=n.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var r=this,n=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getRemoteId(e,t,n)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),et=function(){function e(t){J(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new $e(E),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new $e(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return z(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){if("rrweb"===e.data.type){if(!e.source)return;var t=this.crossOriginIframeMap.get(e.source);if(!t)return;var r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}},{key:"transformCrossOriginEvent",value:function(e,t){var r,n=this;switch(t.type){case ge.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:ge.IncrementalSnapshot,data:{source:ve.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ge.Meta:case ge.Load:case ge.DomContentLoaded:return!1;case ge.Plugin:return t;case ge.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ge.IncrementalSnapshot:switch(t.data.source){case ve.Mutation:return t.data.adds.forEach((function(t){n.replaceIds(t,e,["parentId","nextId","previousId"]),n.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((function(t){n.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){n.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case ve.Drag:case ve.TouchMove:case ve.MouseMove:return t.data.positions.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case ve.ViewportResize:return!1;case ve.MediaInteraction:case ve.MouseInteraction:case ve.Scroll:case ve.CanvasMutation:case ve.Input:return this.replaceIds(t.data,e,["id"]),t;case ve.StyleSheetRule:case ve.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ve.Font:return t;case ve.Selection:return t.data.ranges.forEach((function(t){n.replaceIds(t,e,["start","end"])})),t;case ve.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((function(t){n.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,r,n){var o,a=p(n);try{for(a.s();!(o=a.n()).done;){var i=o.value;(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}},{key:"replaceStyleIds",value:function(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}},{key:"replaceIdOnNode",value:function(e,t){var r=this;this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((function(e){r.replaceIdOnNode(e,t)}))}}]),e}(),tt=function(){function e(t){J(this,e),this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;var r=this;this.restorePatches.push(ne(Element.prototype,"attachShadow",(function(e){return function(t){var n=e.call(this,t);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return z(e,[{key:"addShadowRoot",value:function(e,t){var r=this;m(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),De(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Ue(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(e.host)),Ve({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e)}),0)))}},{key:"observeAttachShadow",value:function(e){if(e.contentWindow){var t=this;this.restorePatches.push(ne(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(n){var o=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}},{key:"reset",value:function(){this.restorePatches.forEach((function(e){return e()})),this.shadowDoms=new WeakSet}}]),e}();function rt(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}for(var nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot="undefined"==typeof Uint8Array?[]:new Uint8Array(256),at=0;at<nt.length;at++)ot[nt.charCodeAt(at)]=at;var it=new Map;var st=function(e,t,r){if(e&&(lt(e,t)||"object"===s(e))){var n=function(e,t){var r=it.get(e);return r||(r=new Map,it.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o}};function ut(e,t,r){if(e instanceof Array)return e.map((function(e){return ut(e,t,r)}));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){var n=e.constructor.name,o=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=nt[r[t]>>2],o+=nt[(3&r[t])<<4|r[t+1]>>4],o+=nt[(15&r[t+1])<<2|r[t+2]>>6],o+=nt[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:n,base64:o}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ut(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[ut(e.data,t,r),e.width,e.height]}:lt(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:st(e,t,r)}:e}var ct=function(e,t,r){return H(e).map((function(e){return ut(e,t,r)}))},lt=function(e,t){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(r.find((function(r){return e instanceof t[r]})))};function ft(e,t,r){var n=[];try{var o=ne(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){ie(this,t,r,!0)||"__context"in this||(this.__context=n);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return e.apply(this,[n].concat(a))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}function dt(e,t,r,n,o,a,i){var s,u=[],c=Object.getOwnPropertyNames(e),l=p(c);try{var f=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var c=ne(e,a,(function(e){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var l=e.apply(this,u);if(st(l,i,this),!ie(this.canvas,n,o,!0)){var f=ct([].concat(u),i,this),d={type:t,property:a,args:f};r(this.canvas,d)}return l}}));u.push(c)}catch(n){var l=re(e,a,{set:function(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});u.push(l)}};for(l.s();!(s=l.n()).done;)f()}catch(e){l.e(e)}finally{l.f()}return u}var pt=null;try{var ht="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof require&&require("worker_threads")||"function"==typeof require&&require("worker_threads");pt=ht.Worker}catch(e){}var gt=r(825).lW;function vt(e,t,r){var n=void 0===t?null:t,o=function(e,t){return gt.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:"");return function(e){return new pt(i,Object.assign({},e,{eval:!0}))}}function mt(e,t,r){var n=void 0===t?null:t,o=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,a=r.length;o<a;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var yt=r(619),wt="[object process]"===Object.prototype.toString.call(void 0!==yt?yt:0);var It,bt,Ct,St,kt,xt,At=(It="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",bt=null,Ct=!1,wt?vt(It,bt,Ct):function(e,t,r){var n;return function(o){return n=n||mt(e,t,r),new Worker(n,o)}}(It,bt,Ct)),Et=function(){function e(t){var r=this;J(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId)&&r.rafStamps.invokeId||(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(e)||r.pendingCanvasMutations.set(e,[]),r.pendingCanvasMutations.get(e).push(t)};var n=t.sampling,o=void 0===n?"all":n,a=t.win,i=t.blockClass,s=t.blockSelector,u=t.recordCanvas,c=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(a,i,s),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,s,{dataURLOptions:c})}return z(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,n,o,a){var i=this,s=ft(r,n,o),u=new Map,c=new At;c.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var r=e.data,n=r.base64,o=r.type,a=r.width,s=r.height;i.mutationCb({id:t,type:ye["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})}};var l,f=1e3/e,d=0;l=requestAnimationFrame((function e(s){var p;d&&s-d<f?l=requestAnimationFrame(e):(d=s,(p=[],r.document.querySelectorAll("canvas").forEach((function(e){ie(e,n,o,!0)||p.push(e)})),p).forEach((function(e){return rt(i,void 0,void 0,t().mark((function r(){var n,o,i,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!u.get(o)){t.next=3;break}return t.abrupt("return");case 3:return u.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null===(n=null==i?void 0:i.getContextAttributes())||void 0===n?void 0:n.preserveDrawingBuffer)&&(null==i||i.clear(i.COLOR_BUFFER_BIT))),t.next=7,createImageBitmap(e);case 7:s=t.sent,c.postMessage({id:o,bitmap:s,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[s]);case 9:case"end":return t.stop()}}),r,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ft(e,t,r),o=function(e,t,r,n){var o,a=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=p(i);try{var u=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return 1;var s=ne(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return ie(this.canvas,r,n,!0)||setTimeout((function(){var r=ct([].concat(u),t,a);e(a.canvas,{type:ye["2D"],property:i,args:r})}),0),o.apply(this,u)}}));a.push(s)}catch(r){var u=re(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:ye["2D"],property:i,args:[t],setter:!0})}});a.push(u)}};for(s.s();!(o=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r),a=function(e,t,r,n,o){var a=[];return a.push.apply(a,H(dt(t.WebGLRenderingContext.prototype,ye.WebGL,e,r,n,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,H(dt(t.WebGL2RenderingContext.prototype,ye.WebGL2,e,r,n,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=function(){n(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(r){e.rafStamps.latestId=r,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,r){var n=e.mirror.getId(r);e.flushPendingCanvasMutationFor(r,n)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((function(e){var t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),o=r[0].type;this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),Tt=function(){function e(t){J(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return z(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var r,n={id:t,styleIds:[]},o=[],a=p(e);try{for(a.s();!(r=a.n()).done;){var i=r.value,s=void 0;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);var u=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:u.map((function(e,t){return{rule:w(e),index:t}}))})}n.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}();function Rt(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var Mt=!1,Ot=new I;function Lt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,r=e.checkoutEveryNms,n=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.maskTextClass,f=void 0===l?"rr-mask":l,d=e.maskTextSelector,h=void 0===d?null:d,g=e.inlineStylesheet,v=void 0===g||g,m=e.maskAllInputs,y=e.maskInputOptions,w=e.slimDOMOptions,I=e.maskInputFn,b=e.maskTextFn,C=e.hooks,S=e.packFn,k=e.sampling,x=void 0===k?{}:k,A=e.dataURLOptions,E=void 0===A?{}:A,T=e.mousemoveWait,R=e.recordCanvas,M=void 0!==R&&R,O=e.recordCrossOriginIframes,L=void 0!==O&&O,N=e.userTriggeredOnInput,D=void 0!==N&&N,_=e.collectFonts,F=void 0!==_&&_,U=e.inlineImages,B=void 0!==U&&U,P=e.plugins,W=e.keepIframeSrcFn,G=void 0===W?function(){return!1}:W,K=e.ignoreCSSAttributes,Y=void 0===K?new Set([]):K,Z=!L||window.parent===window,V=!1;if(!Z)try{window.parent.document,V=!1}catch(e){V=!0}if(Z&&!t)throw new Error("emit function is required");void 0!==T&&void 0===x.mousemove&&(x.mousemove=T),Ot.reset();var H,J=!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}:void 0!==y?y:{password:!0},q=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};le();var z=0,X=function(e){var t,r=p(P||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.eventProcessor&&(e=n.eventProcessor(e))}}catch(e){r.e(e)}finally{r.f()}return S&&(e=S(e)),e};St=function(e,o){var a;if(!(null===(a=Te[0])||void 0===a?void 0:a.isFrozen())||e.type===ge.FullSnapshot||e.type===ge.IncrementalSnapshot&&e.data.source===ve.Mutation||Te.forEach((function(e){return e.unfreeze()})),Z)null==t||t(X(e),o);else if(V){var i={type:"rrweb",event:X(e),isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===ge.FullSnapshot)H=e,z=0;else if(e.type===ge.IncrementalSnapshot){if(e.data.source===ve.Mutation&&e.data.isAttachIframe)return;z++;var s=n&&z>=n,u=r&&e.timestamp-H.timestamp>r;(s||u)&&kt(!0)}};var $,ee=function(e){St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Mutation},e)}))},te=function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Scroll},e)}))},re=function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.CanvasMutation},e)}))},ne=function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.AdoptedStyleSheet},e)}))},ie=new Tt({mutationCb:ee,adoptedStyleSheetCb:ne}),se=new et({mirror:Ot,mutationCb:ee,stylesheetManager:ie,recordCrossOriginIframes:L,wrappedEmit:St}),ue=p(P||[]);try{for(ue.s();!($=ue.n()).done;){var ce=$.value;ce.getMirror&&ce.getMirror({nodeMirror:Ot,crossOriginIframeMirror:se.crossOriginIframeMirror,crossOriginIframeStyleMirror:se.crossOriginIframeStyleMirror})}}catch(e){ue.e(e)}finally{ue.f()}xt=new Et({recordCanvas:M,mutationCb:re,win:window,blockClass:a,blockSelector:s,mirror:Ot,sampling:x.canvas,dataURLOptions:E});var he=new tt({mutationCb:ee,scrollCb:te,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:h,inlineStylesheet:v,maskInputOptions:J,dataURLOptions:E,maskTextFn:b,maskInputFn:I,recordCanvas:M,inlineImages:B,sampling:x,slimDOMOptions:q,iframeManager:se,stylesheetManager:ie,canvasManager:xt,keepIframeSrcFn:G},mirror:Ot});kt=function(){var e,t,r,n,o,i,u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];St(Rt({type:ge.Meta,data:{href:window.location.href,width:ae(),height:oe()}}),u),ie.reset(),Te.forEach((function(e){return e.lock()}));var c=j(document,{mirror:Ot,blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:h,inlineStylesheet:v,maskAllInputs:J,maskTextFn:b,slimDOM:q,dataURLOptions:E,recordCanvas:M,inlineImages:B,onSerialize:function(e){fe(e,Ot)&&se.addIframe(e),de(e,Ot)&&ie.trackLinkElement(e),pe(e)&&he.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){se.attachIframe(e,t),he.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ie.attachLinkElement(e,t)},keepIframeSrcFn:G});if(!c)return console.warn("Failed to snapshot the document");St(Rt({type:ge.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(t=null===(e=null===document||void 0===document?void 0:document.body)||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.scrollTop)||0}}})),Te.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,Ot.getId(document))};try{var me=[];me.push(Q("DOMContentLoaded",(function(){St(Rt({type:ge.DomContentLoaded,data:{}}))})));var ye=function(e){var t;return Qe({mutationCb:ee,mousemoveCb:function(e,t){return St(Rt({type:ge.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.MouseInteraction},e)}))},scrollCb:te,viewportResizeCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.ViewportResize},e)}))},inputCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Input},e)}))},mediaInteractionCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.StyleDeclaration},e)}))},canvasMutationCb:re,fontCb:function(e){return St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Font},e)}))},selectionCb:function(e){St(Rt({type:ge.IncrementalSnapshot,data:Object.assign({source:ve.Selection},e)}))},blockClass:a,ignoreClass:c,maskTextClass:f,maskTextSelector:h,maskInputOptions:J,inlineStylesheet:v,sampling:x,recordCanvas:M,inlineImages:B,userTriggeredOnInput:D,collectFonts:F,doc:e,maskInputFn:I,maskTextFn:b,keepIframeSrcFn:G,blockSelector:s,slimDOMOptions:q,dataURLOptions:E,mirror:Ot,iframeManager:se,stylesheetManager:ie,shadowDomManager:he,canvasManager:xt,ignoreCSSAttributes:Y,plugins:(null===(t=null==P?void 0:P.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return St(Rt({type:ge.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};se.addLoadListener((function(e){me.push(ye(e.contentDocument))}));var we=function(){kt(),me.push(ye(document)),Mt=!0};return"interactive"===document.readyState||"complete"===document.readyState?we():me.push(Q("load",(function(){St(Rt({type:ge.Load,data:{}})),we()}),window)),function(){me.forEach((function(e){return e()})),Mt=!1}}catch(e){console.warn(e)}}Lt.addCustomEvent=function(e,t){if(!Mt)throw new Error("please add custom event after start recording");St(Rt({type:ge.Custom,data:{tag:e,payload:t}}))},Lt.freezePage=function(){Te.forEach((function(e){return e.freeze()}))},Lt.takeFullSnapshot=function(e){if(!Mt)throw new Error("please take full snapshot after start recording");kt(e)},Lt.mirror=Ot;var Nt=Uint8Array,Dt=Uint16Array,_t=Uint32Array,Ft=new Nt([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]),Ut=new Nt([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]),Bt=new Nt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pt=function(e,t){for(var r=new Dt(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new _t(r[30]);for(n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)o[a]=a-r[n]<<5|n;return[r,o]},Wt=Pt(Ft,2),Gt=Wt[0],Kt=Wt[1];Gt[28]=258,Kt[258]=28;for(var jt=Pt(Ut,0),Yt=(jt[0],jt[1]),Zt=new Dt(32768),Vt=0;Vt<32768;++Vt){var Ht=(43690&Vt)>>>1|(21845&Vt)<<1;Ht=(61680&(Ht=(52428&Ht)>>>2|(13107&Ht)<<2))>>>4|(3855&Ht)<<4,Zt[Vt]=((65280&Ht)>>>8|(255&Ht)<<8)>>>1}var Jt=function(e,t,r){for(var n=e.length,o=0,a=new Dt(t);o<n;++o)++a[e[o]-1];var i,s=new Dt(t);for(o=0;o<t;++o)s[o]=s[o-1]+a[o-1]<<1;if(r){i=new Dt(1<<t);var u=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],f=s[e[o]-1]++<<l,d=f|(1<<l)-1;f<=d;++f)i[Zt[f]>>>u]=c}else for(i=new Dt(n),o=0;o<n;++o)i[o]=Zt[s[e[o]-1]++]>>>15-e[o];return i},qt=new Nt(288);for(Vt=0;Vt<144;++Vt)qt[Vt]=8;for(Vt=144;Vt<256;++Vt)qt[Vt]=9;for(Vt=256;Vt<280;++Vt)qt[Vt]=7;for(Vt=280;Vt<288;++Vt)qt[Vt]=8;var zt=new Nt(32);for(Vt=0;Vt<32;++Vt)zt[Vt]=5;var Xt=Jt(qt,9,0),Qt=Jt(zt,5,0),$t=function(e){return(e/8>>0)+(7&e&&1)},er=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Dt?Dt:e instanceof _t?_t:Nt)(r-t);return n.set(e.subarray(t,r)),n},tr=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},rr=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},nr=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,a=r.slice();if(!o)return[new Nt(0),0];if(1==o){var i=new Nt(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],c=0,l=1,f=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=r[r[c].f<r[f].f?c++:f++],u=r[c!=l&&r[c].f<r[f].f?c++:f++],r[l++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(n=1;n<o;++n)a[n].s>d&&(d=a[n].s);var p=new Dt(d+1),h=or(r[l-1],p,0);if(h>t){n=0;var g=0,v=h-t,m=1<<v;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<o;++n){var y=a[n].s;if(!(p[y]>t))break;g+=m-(1<<h-p[y]),p[y]=t}for(g>>>=v;g>0;){var w=a[n].s;p[w]<t?g-=1<<t-p[w]++-1:++n}for(;n>=0&&g;--n){var I=a[n].s;p[I]==t&&(--p[I],++g)}h=t}return[new Nt(p),h]},or=function e(t,r,n){return-1==t.s?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},ar=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Dt(++t),n=0,o=e[0],a=1,i=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++a;else{if(!o&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(o),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(o);a=1,o=e[s]}return[r.subarray(0,n),t]},ir=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},sr=function(e,t,r){var n=r.length,o=$t(t+2);e[o]=255&n,e[o+1]=n>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var a=0;a<n;++a)e[o+a+4]=r[a];return 8*(o+4+n)},ur=function(e,t,r,n,o,a,i,s,u,c,l){tr(t,l++,r),++o[256];for(var f=nr(o,15),d=f[0],p=f[1],h=nr(a,15),g=h[0],v=h[1],m=ar(d),y=m[0],w=m[1],I=ar(g),b=I[0],C=I[1],S=new Dt(19),k=0;k<y.length;++k)S[31&y[k]]++;for(k=0;k<b.length;++k)S[31&b[k]]++;for(var x=nr(S,7),A=x[0],E=x[1],T=19;T>4&&!A[Bt[T-1]];--T);var R,M,O,L,N=c+5<<3,D=ir(o,qt)+ir(a,zt)+i,_=ir(o,d)+ir(a,g)+i+14+3*T+ir(S,A)+(2*S[16]+3*S[17]+7*S[18]);if(N<=D&&N<=_)return sr(t,l,e.subarray(u,u+c));if(tr(t,l,1+(_<D)),l+=2,_<D){R=Jt(d,p,0),M=d,O=Jt(g,v,0),L=g;var F=Jt(A,E,0);tr(t,l,w-257),tr(t,l+5,C-1),tr(t,l+10,T-4),l+=14;for(k=0;k<T;++k)tr(t,l+3*k,A[Bt[k]]);l+=3*T;for(var U=[y,b],B=0;B<2;++B){var P=U[B];for(k=0;k<P.length;++k){var W=31&P[k];tr(t,l,F[W]),l+=A[W],W>15&&(tr(t,l,P[k]>>>5&127),l+=P[k]>>>12)}}}else R=Xt,M=qt,O=Qt,L=zt;for(k=0;k<s;++k)if(n[k]>255){W=n[k]>>>18&31;rr(t,l,R[W+257]),l+=M[W+257],W>7&&(tr(t,l,n[k]>>>23&31),l+=Ft[W]);var G=31&n[k];rr(t,l,O[G]),l+=L[G],G>3&&(rr(t,l,n[k]>>>5&8191),l+=Ut[G])}else rr(t,l,R[n[k]]),l+=M[n[k]];return rr(t,l,R[256]),l+M[256]},cr=new _t([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lr=new Nt(0),fr=function(e,t,r,n,o){return function(e,t,r,n,o,a){var i=e.length,s=new Nt(n+i+5*(1+Math.floor(i/7e3))+o),u=s.subarray(n,s.length-o),c=0;if(!t||i<8)for(var l=0;l<=i;l+=65535){var f=l+65535;f<i?c=sr(u,c,e.subarray(l,f)):(u[l]=a,c=sr(u,c,e.subarray(l,i)))}else{for(var d=cr[t-1],p=d>>>13,h=8191&d,g=(1<<r)-1,v=new Dt(32768),m=new Dt(g+1),y=Math.ceil(r/3),w=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<w)&g},b=new _t(25e3),C=new Dt(288),S=new Dt(32),k=0,x=0,A=(l=0,0),E=0,T=0;l<i;++l){var R=I(l),M=32767&l,O=m[R];if(v[M]=O,m[R]=M,E<=l){var L=i-l;if((k>7e3||A>24576)&&L>423){c=ur(e,u,0,b,C,S,x,A,T,l-T,c),A=k=x=0,T=l;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)S[N]=0}var D=2,_=0,F=h,U=M-O&32767;if(L>2&&R==I(l-U))for(var B=Math.min(p,L)-1,P=Math.min(32767,l),W=Math.min(258,L);U<=P&&--F&&M!=O;){if(e[l+D]==e[l+D-U]){for(var G=0;G<W&&e[l+G]==e[l+G-U];++G);if(G>D){if(D=G,_=U,G>B)break;var K=Math.min(U,G-2),j=0;for(N=0;N<K;++N){var Y=l-U+N+32768&32767,Z=Y-v[Y]+32768&32767;Z>j&&(j=Z,O=Y)}}}U+=(M=O)-(O=v[M])+32768&32767}if(_){b[A++]=268435456|Kt[D]<<18|Yt[_];var V=31&Kt[D],H=31&Yt[_];x+=Ft[V]+Ut[H],++C[257+V],++S[H],E=l+D,++k}else b[A++]=e[l],++C[e[l]]}}c=ur(e,u,a,b,C,S,x,A,T,l-T,c),a||(c=sr(u,c,lr))}return er(s,0,n+$t(c)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!o)};function dr(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,a=r.length,i=0;i!=a;){for(var s=Math.min(i+5552,a);i<s;++i)o+=n+=r[i];n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n=fr(e,t,2,4);return function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)}(n,t),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(n,n.length-4,r.d()),n}var pr=function(e){var t=Object.assign(Object.assign({},e),{v:"v1"});return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}(dr(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Nt(e.length+(e.length>>>1)),o=0,a=function(e){n[o++]=e},i=0;i<r;++i){if(o+5>n.length){var s=new Nt(o+8+(r-i<<1));s.set(n),n=s}var u=e.charCodeAt(i);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++i))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return er(n,0,o)}(JSON.stringify(t))),!0)},hr=Object.defineProperty,gr=function(e,t,r){return function(e,t,r){return t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r}(e,"symbol"!==s(t)?t+"":t,r)};var vr=function(){function e(t){J(this,e),gr(this,"fileName"),gr(this,"functionName"),gr(this,"lineNumber"),gr(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return z(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),mr=/(^|@)\S+:\d+/,yr=/^\s*at .*(\S+:\d+|\(native\))/m,wr=/^(eval@)?(\[native code])?$/,Ir={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(yr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(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(yr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new vr({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(wr)}),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 vr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(t,""));return new vr({functionName:n,fileName:o[0],lineNumber:o[1],columnNumber:o[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){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],o=2,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new vr({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],o=0,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new vr({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(mr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new vr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function br(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(var a=0;a<n.children.length;a++){var i=n.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===r&&o.push(i)}o.length>1&&(r+=":eq(".concat(o.indexOf(e),")")),t=r+(t?">"+t:""),e=n}return t}function Cr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Sr(e,t){if(0===t)return!0;for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(Cr(e[o])&&Sr(e[o],t-1))return!0}return!1}function kr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],o=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?o.splice(a,1/0,e):o.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Cr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Cr(e)&&Sr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t="".concat(t.slice(0,r.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=br(u.length?u[0]:null):i[s]=u}return i}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}))}var xr={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 Ar(e,t,r){var n,o=r?Object.assign({},xr,r):xr,a=o.logger;if(!a)return function(){};n="string"==typeof a?t[a]:a;var i=0,s=!1,u=[];if(o.level.includes("error")){var c=function(t){var r=t.message,n=t.error,a=Ir.parse(n).map((function(e){return e.toString()})),i=[kr(r,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var r,n;t.reason instanceof Error?(r=t.reason,n=[kr("Uncaught (in promise) ".concat(r.name,": ").concat(r.message),o.stringifyOptions)]):(r=new Error,n=[kr("Uncaught (in promise)",o.stringifyOptions),kr(t.reason,o.stringifyOptions)]);var a=Ir.parse(r).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var f,d=p(o.level);try{for(d.s();!(f=d.n()).done;){var h=f.value;u.push(g(n,h))}}catch(e){d.e(e)}finally{d.f()}return function(){u.forEach((function(e){return e()}))};function g(t,r){var n=this;return t[r]?function(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}(t,r,(function(t){return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var l=Ir.parse(new Error).map((function(e){return e.toString()})).splice(1),f="assert"===r?u.slice(1):u,d=f.map((function(e){return kr(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:r,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[kr("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Er="rlog-deviceId",Tr="rlog-",Rr="rlog_data_",Mr="rlog_lock_",Or="RLOG_CONSUME_ONLY",Lr="YES",Nr=36e5,Dr=3e5,_r=1e4,Fr=1e4,Ur=["taskId"],Br="rlog-upload-failure",Pr="custom-error-event",Wr="http-success",Gr="http-error",Kr="network-status",jr="page-lifecycle",Yr=["arms","log","marmot-cloud.com","alipayobjects.com","renderpre.alipay.com","nemo-office.alipay.com","render.alipay.com"],Zr=["r.png","dwcookieLogGet.do","track","spm","logstores","render",".json",".js",".css",".wasm",".png",".jpg",".jpeg",".weapp",".data"],Vr=["sky_trace_id","antbank-traceid"],Hr=["http://alipay-rmsdeploy-image.cn-hangzhou.alipay.aliyun-inc.com"],Jr="[Rlog]";function qr(e){for(var t,r,n,o,a=arguments.length,i=new Array(a>1?a-1:0),s=1;s<a;s++)i[s-1]=arguments[s];switch(e){case"log":(t=console).log.apply(t,[Jr].concat(i));break;case"info":(r=console).info.apply(r,[Jr].concat(i));break;case"warn":(n=console).warn.apply(n,[Jr].concat(i));break;case"error":(o=console).error.apply(o,[Jr].concat(i))}}var zr={log:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["log"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["info"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];qr.apply(void 0,["error"].concat(t))}},Xr=zr,Qr=new(function(){function e(){q()(this,e),l()(this,"memoryFallback",new Map),l()(this,"useMemory",!1),this.useMemory=!this.isLocalStorageAvailable(),this.useMemory&&Xr.warn("localStorage 不可用,SafeStorage 已降级为内存存储")}return X()(e,[{key:"isLocalStorageAvailable",value:function(){try{if("undefined"==typeof window||!window.localStorage)return!1;var e="__rlog_safe_storage_test__";return window.localStorage.setItem(e,"1"),window.localStorage.removeItem(e),!0}catch(e){return!1}}},{key:"getItem",value:function(e){var t;if(this.useMemory)return null!==(t=this.memoryFallback.get(e))&&void 0!==t?t:null;try{return localStorage.getItem(e)}catch(t){var r;return this.useMemory=!0,null!==(r=this.memoryFallback.get(e))&&void 0!==r?r:null}}},{key:"setItem",value:function(e,t){if(this.useMemory)this.memoryFallback.set(e,t);else try{localStorage.setItem(e,t)}catch(r){this.useMemory=!0,this.memoryFallback.set(e,t)}}},{key:"removeItem",value:function(e){if(this.useMemory)this.memoryFallback.delete(e);else try{localStorage.removeItem(e)}catch(t){this.useMemory=!0,this.memoryFallback.delete(e)}}}]),e}()),$r=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},en=function(){if(Qr.getItem(Er))return Qr.getItem(Er);var e=Qr.getItem("utoken")||Qr.getItem("IWP-iwp-deivceTag")||$r();return Qr.setItem(Er,e),e},tn=null,rn="rlog_sessions",nn=function(){return tn||function(e){try{var t=JSON.parse(Qr.getItem(rn)||"{}");t[e]=Date.now(),Qr.setItem(rn,JSON.stringify(t))}catch(e){}}(tn=$r()),tn},on=function(){return"".concat(en(),"_").concat(nn())};function an(e){try{var t=JSON.parse(Qr.getItem(rn)||"{}");delete t[e],Qr.setItem(rn,JSON.stringify(t))}catch(e){}}function sn(){try{for(var e=JSON.parse(Qr.getItem(rn)||"{}"),t=Date.now(),r=en(),n=nn(),o=[],a=0,i=Object.keys(e);a<i.length;a++){var s=i[a];if(s!==n){var u=e[s];if(!(t-u>Nr||t-u>Dr)){var c="".concat(r,"_").concat(s),l="".concat(Rr).concat(c),f=Qr.getItem(l);f&&"[]"!==f&&o.push({sessionId:s,storageKey:c})}}}return o}catch(e){return[]}}function un(e){if(!e||0===e.length)return!1;var t,r=1/0,n=-1/0,o=h()(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;a&&"number"==typeof a.timestamp&&(a.timestamp<r&&(r=a.timestamp),a.timestamp>n&&(n=a.timestamp))}}catch(e){o.e(e)}finally{o.f()}return r!==1/0&&n!==-1/0&&(!(n-r>12e4)&&!(Date.now()-n>Dr))}function cn(e){try{var t=en(),r="".concat(Rr).concat(t,"_").concat(e),n="".concat(Mr).concat(t,"_").concat(e);Qr.removeItem(r),Qr.removeItem(n),an(e)}catch(e){}}var ln=function(e){return null!==e&&"object"===u()(e)&&!Array.isArray(e)},fn=function e(t,r){var n=d()({},t);for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],i=t[o];ln(a)&&ln(i)?n[o]=e(i,a):void 0!==a&&(n[o]=a)}return n},dn="logs",pn=function(){function e(){q()(this,e),l()(this,"db",null),l()(this,"isOpening",!1),l()(this,"openPromise",null),this.openDB().catch(Xr.error)}var t,r,n,a,s,u,c,f,d,p,h;return X()(e,[{key:"openDB",value:(h=i()(o()().mark((function e(){var t=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.db){e.next=2;break}return e.abrupt("return");case 2:if(!this.isOpening||!this.openPromise){e.next=4;break}return e.abrupt("return",this.openPromise);case 4:return this.isOpening=!0,this.openPromise=new Promise((function(e,r){var n=indexedDB.open("LogStorageDB",2);n.onupgradeneeded=function(e){var t=e.target.result;if(t.objectStoreNames.contains(dn)){var r=e.target.transaction;if(r){var n=r.objectStore(dn);n.indexNames.contains("lastModified")||n.createIndex("lastModified","lastModified",{unique:!1})}}else t.createObjectStore(dn,{keyPath:"deviceId"}).createIndex("lastModified","lastModified",{unique:!1})},n.onsuccess=function(r){t.db=r.target.result,t.isOpening=!1,e()},n.onerror=function(e){t.isOpening=!1,r(e.target.error)},n.onblocked=function(){Xr.warn("IndexedDB is blocked, trying to close existing connections"),t.isOpening=!1,r(new Error("IndexedDB blocked"))}})),e.abrupt("return",this.openPromise);case 7:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"ensureDB",value:(p=i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.db){e.next=3;break}return e.next=3,this.openDB();case 3:if(this.db){e.next=5;break}throw new Error("Failed to open IndexedDB");case 5:return e.abrupt("return",this.db);case 6:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"withTransaction",value:(d=i()(o()().mark((function e(t,r){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureDB();case 2:return n=e.sent,e.abrupt("return",new Promise((function(e,o){var a,i=n.transaction([dn],t),s=i.objectStore(dn);i.onerror=function(){return o(i.error)},i.oncomplete=function(){setTimeout((function(){return e(a)}),0)},r(s).then((function(e){a=e}),o)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"push",value:(f=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.push(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>Fr&&i.data.splice(0,i.data.length-Fr);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.unshift(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>Fr&&i.data.splice(0,i.data.length-Fr);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data=r.concat(i.data),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>Fr&&i.data.splice(0,i.data.length-Fr);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(0!==i.data.length){var s=Math.min(r,i.data.length),u=i.data.slice(0,s);if(i.data=i.data.slice(s),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var c=n.put(i);c.onsuccess=function(){return e(u)},c.onerror=function(){return o(c.error)}}else{var l=n.delete(t);l.onsuccess=function(){return e(u)},l.onerror=function(){return o(l.error)}}}else e([])},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=r.delete(t);o.onsuccess=function(){return e()},o.onerror=function(){return n(o.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readonly",function(){var e=i()(o()().mark((function e(a){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var i=a.get(t);i.onsuccess=function(){var o=(i.result||{deviceId:t,data:[],lastModified:Date.now(),version:1}).data.filter((function(e){return e.timestamp>=r&&e.timestamp<=n}));e(o)},i.onerror=function(){return o(i.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(i.data=i.data.filter((function(e){return e.timestamp<r})),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}}else{var u=n.delete(t);u.onsuccess=function(){return e()},u.onerror=function(){return o(u.error)}}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"count",value:(t=i()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readonly",function(){var e=i()(o()().mark((function e(r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=r.get(t);o.onsuccess=function(){var t=o.result;e(t?t.data.length:0)},o.onerror=function(){return n(o.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),hn=function(){function e(){q()(this,e),l()(this,"storage",new Map),l()(this,"locks",new Map)}var t,r,n,a,s,u,c,f,d;return X()(e,[{key:"acquireLock",value:(d=i()(o()().mark((function e(t){var r,n,a,i=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(!this.locks.has(r)){e.next=6;break}return e.next=4,this.locks.get(r);case 4:e.next=1;break;case 6:return a=new Promise((function(e){n=e})),this.locks.set(r,a),e.abrupt("return",(function(){i.locks.delete(r),n()}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"push",value:(f=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).push(r),a.length>Fr&&a.splice(0,a.length-Fr)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).unshift(r),a.length>Fr&&a.splice(0,a.length-Fr)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),a=this.storage.get(t),(i=r.concat(a)).length>Fr&&i.splice(0,i.length-Fr),this.storage.set(t,i)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){var n,a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:if(n=e.sent,e.prev=3,0!==(a=this.storage.get(t)||[]).length){e.next=7;break}return e.abrupt("return",[]);case 7:return i=Math.min(r,a.length),s=a.slice(0,i),(u=a.slice(i)).length>0?this.storage.set(t,u):this.storage.delete(t),e.abrupt("return",s);case 12:return e.prev=12,n(),e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[3,,12,15]])}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){var r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:r=e.sent;try{this.storage.delete(t)}finally{r()}case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){var a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:return a=e.sent,e.prev=3,i=this.storage.get(t)||[],e.abrupt("return",i.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 6:return e.prev=6,a(),e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[3,,6,9]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{a=this.storage.get(t)||[],(i=a.filter((function(e){return e.timestamp<r}))).length>0?this.storage.set(t,i):this.storage.delete(t)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"count",value:(t=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:return r=e.sent,e.prev=3,n=this.storage.get(t)||[],e.abrupt("return",n.length);case 6:return e.prev=6,r(),e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[3,,6,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();l()(hn,"instance",void 0);var gn=function(){function e(){q()(this,e)}var t,r,n,a,s,u,c,l,f,d;return X()(e,[{key:"acquireLock",value:(d=i()(o()().mark((function t(r){var n,a,i,s,u,c,l;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="".concat(e.LOCK_KEY_PREFIX).concat(r),a="".concat(Date.now(),"_").concat(Math.random()),t.prev=2,!(i=localStorage.getItem(n))){t.next=8;break}if(s=i.split("_"),u=V()(s,1),c=u[0],!(Date.now()-parseInt(c)<e.LOCK_TIMEOUT)){t.next=8;break}return t.abrupt("return",!1);case 8:return localStorage.setItem(n,a),t.next=11,new Promise((function(e){return setTimeout(e,Math.floor(3*Math.random())+1)}));case 11:return l=localStorage.getItem(n),t.abrupt("return",l===a);case 15:return t.prev=15,t.t0=t.catch(2),Xr.warn("Failed to acquire lock",t.t0),t.abrupt("return",!1);case 19:case"end":return t.stop()}}),t,null,[[2,15]])}))),function(e){return d.apply(this,arguments)})},{key:"releaseLock",value:function(t){var r="".concat(e.LOCK_KEY_PREFIX).concat(t);try{localStorage.removeItem(r)}catch(e){Xr.warn("Failed to release lock",e)}}},{key:"withLock",value:(f=i()(o()().mark((function t(r,n){var a,i;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0;case 1:if(!(a<e.MAX_RETRIES)){t.next=18;break}return t.next=4,this.acquireLock(r);case 4:if(!t.sent){t.next=13;break}return t.prev=5,t.next=8,n();case 8:return i=t.sent,t.abrupt("return",i);case 10:return t.prev=10,this.releaseLock(r),t.finish(10);case 13:return a++,t.next=16,new Promise((function(t){return setTimeout(t,e.RETRY_DELAY)}));case 16:t.next=1;break;case 18:throw new Error("Failed to acquire lock after maximum retries");case 19:case"end":return t.stop()}}),t,this,[[5,,10,13]])}))),function(e,t){return f.apply(this,arguments)})},{key:"getStorageKey",value:function(t){return"".concat(e.STORAGE_KEY_PREFIX).concat(t)}},{key:"push",value:(l=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).push(r),s.length>Fr&&s.splice(0,s.length-Fr),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Xr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",hn.getInstance().push(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return l.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).unshift(r),s.length>Fr&&s.splice(0,s.length-Fr),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Xr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",hn.getInstance().unshift(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),s=i?JSON.parse(i):[],(u=r.concat(s)).length>Fr&&u.splice(0,u.length-Fr),localStorage.setItem(a,JSON.stringify(u));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Xr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",hn.getInstance().unshiftBatch(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getStorageKey(t),i=localStorage.getItem(a),0!==(s=i?JSON.parse(i):[]).length){e.next=5;break}return e.abrupt("return",[]);case 5:return u=Math.min(r,s.length),c=s.slice(0,u),(l=s.slice(u)).length>0?localStorage.setItem(a,JSON.stringify(l)):localStorage.removeItem(a),e.abrupt("return",c);case 10:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().pull(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.getStorageKey(t),localStorage.removeItem(n);case 2:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().clear(t));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.getStorageKey(t),s=localStorage.getItem(i),u=s?JSON.parse(s):[],e.abrupt("return",u.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 4:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().pullByTimeRange(t,r,n));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),s=i?JSON.parse(i):[],(u=s.filter((function(e){return e.timestamp<r}))).length>0?localStorage.setItem(a,JSON.stringify(u)):localStorage.removeItem(a);case 5:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().removeByTimeRange(t,r));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return r.apply(this,arguments)})},{key:"count",value:(t=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.getStorageKey(t),a=localStorage.getItem(n),i=a?JSON.parse(a):[],e.abrupt("return",i.length);case 4:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",hn.getInstance().count(t));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return t.apply(this,arguments)})}]),e}();l()(gn,"LOCK_KEY_PREFIX",Mr),l()(gn,"STORAGE_KEY_PREFIX",Rr),l()(gn,"LOCK_TIMEOUT",5e3),l()(gn,"RETRY_DELAY",10),l()(gn,"MAX_RETRIES",50);var vn=function(){function e(){q()(this,e),l()(this,"adapter",void 0),l()(this,"operationQueue",new Map),this.adapter=this.selectAdapter()}var t,r,n,a,s,u,c,f,d,p;return X()(e,[{key:"selectAdapter",value:function(){if("undefined"!=typeof window&&window.localStorage)try{var e="__rlog_storage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),new gn}catch(e){Xr.warn("LocalStorage不可用,降级使用内存缓存")}return hn.getInstance()}},{key:"serialize",value:(p=i()(o()().mark((function e(t,r){var n,a,i,s=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t,a=this.operationQueue.get(n)||Promise.resolve(),i=a.then((function(){return r()})).catch((function(e){throw Xr.error("Storage operation failed:",e),e})).finally((function(){s.operationQueue.get(n)===i&&s.operationQueue.delete(n)})),this.operationQueue.set(n,i),e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"push",value:(d=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.push(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"unshift",value:(f=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshift(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"unshiftBatch",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshiftBatch(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"pull",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.pull(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"clear",value:(s=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return r.adapter.clear?r.adapter.clear(t):(Xr.warn("Storage adapter does not support clear operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"pullByTimeRange",value:(a=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return a.adapter.pullByTimeRange?a.adapter.pullByTimeRange(t,r,n):(Xr.warn("Storage adapter does not support pullByTimeRange operation"),Promise.resolve([]))})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"removeByTimeRange",value:(n=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.removeByTimeRange?n.adapter.removeByTimeRange(t,r):(Xr.warn("Storage adapter does not support removeByTimeRange operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getAdapterType",value:function(){return this.adapter instanceof pn?"IndexedDB":this.adapter instanceof gn?"LocalStorage":this.adapter instanceof hn?"Memory":"Unknown"}},{key:"count",value:(r=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return r.adapter.count?r.adapter.count(t):(Xr.warn("Storage adapter does not support count operation"),Promise.resolve(0))})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getStorageState",value:(t=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getAdapterType(),e.prev=1,e.next=4,this.count(t);case 4:return n=e.sent,e.abrupt("return",{adapterType:r,eventCount:n});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{adapterType:r,eventCount:-1});case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(e){return t.apply(this,arguments)})}]),e}(),mn=new vn;function yn(e){return wn.apply(this,arguments)}function wn(){return wn=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=r.method,a=void 0===o?"GET":o,i=r.headers,s=void 0===i?{}:i,c=r.body,l=r.timeout,f=void 0===l?_r:l,d=new XMLHttpRequest;d.timeout=f,d.onreadystatechange=function(){if(4===d.readyState){var t={ok:d.status>=200&&d.status<300,status:d.status,statusText:d.statusText,data:null,json:function(){return Promise.resolve(JSON.parse(d.responseText))},text:function(){return Promise.resolve(d.responseText)}};try{t.data=JSON.parse(d.responseText)}catch(e){t.data=d.responseText}t.ok?e(t):n(new Error("HTTP ".concat(d.status,": ").concat(d.statusText)))}},d.onerror=function(){n(new Error("Network error"))},d.ontimeout=function(){n(new Error("Request timeout"))},d.open(a,t,!0),Object.keys(s).forEach((function(e){d.setRequestHeader(e,s[e])})),c instanceof FormData?d.send(c):"object"===u()(c)?(d.setRequestHeader("Content-Type","application/json"),d.send(JSON.stringify(c))):d.send(c||null)})));case 2:case"end":return e.stop()}}),e)}))),wn.apply(this,arguments)}function In(e){return bn.apply(this,arguments)}function bn(){return bn=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",yn(t,d()(d()({},r),{},{method:"GET"})));case 2:case"end":return e.stop()}}),e)}))),bn.apply(this,arguments)}function Cn(e,t){return Sn.apply(this,arguments)}function Sn(){return Sn=i()(o()().mark((function e(t,r){var n,a=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",yn(t,d()(d()({},n),{},{method:"POST",body:r})));case 2:case"end":return e.stop()}}),e)}))),Sn.apply(this,arguments)}var kn={enable:!1,uploadInterval:2e3,configUpdateInterval:3e5,console:{enable:!1,level:["log","warn","error","info"]},http:!1,consumeOnly:!1,maxRetryCount:3,checkoutEveryNms:5e3,ignoreClass:"rr-ignore",blockClass:"rr-block",maskTextClass:"rr-mask",sampling:{canvas:15,mousemove:50,scroll:100,input:"last"},packEvents:!1,clearStorageBeforeRecord:!0,error:!1,captureMode:"full",errorCapture:{beforeDuration:3e4,afterDuration:3e4,httpErrorThreshold:400},routerMonitor:{enable:!1,trackHashChange:!0,trackHistoryChange:!0,trackPageStayTime:!0,ignoreRoutes:[]}},xn=d()({},kn),An=null;function En(e){return Tn.apply(this,arguments)}function Tn(){return Tn=i()(o()().mark((function e(t){var r,n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=eo(),e.next=4,In(t,{headers:r});case 4:if(n=e.sent,a={},n.data)if("object"!==u()(n.data)||n.data.data){if("object"===u()(n.data.data))a=n.data.data;else if("string"==typeof n.data.data)try{a=JSON.parse(n.data.data)}catch(e){Xr.warn("Failed to parse config JSON string",e)}}else a=n.data;return e.abrupt("return",fn(kn,a));case 10:return e.prev=10,e.t0=e.catch(0),Xr.warn("Failed to fetch config from CDN, using default config",e.t0),e.abrupt("return",d()({},kn));case 14:case"end":return e.stop()}}),e,null,[[0,10]])}))),Tn.apply(this,arguments)}function Rn(e){xn=fn(xn,e)}function Mn(){return d()({},xn)}function On(){An&&(clearInterval(An),An=null)}function Ln(){return(Ln=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=8;break}return zn([t]),e.next=4,En(t);case 4:Rn(r=e.sent),(n=r.configUpdateInterval||kn.configUpdateInterval)&&(An&&clearInterval(An),An=setInterval(i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,En(t);case 3:Rn(e.sent),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),Xr.warn("Failed to update config from CDN",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),n));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nn=null;function Dn(e){Nn=e}var _n=[],Fn={},Un=[],Bn=null;function Pn(e){try{if(e.startsWith("http://")||e.startsWith("https://"))return e;if(e.startsWith("/"))return window.location.origin+e;var t=window.location.href,r=t.lastIndexOf("/");return t.substring(0,r+1)+e}catch(t){return e}}function Wn(e){return!function(e,t){try{var r=Pn(e),n=new URL(r),o=n.pathname,a=n.hostname;return!(!Yr.some((function(e){return a.includes(e)}))&&!Zr.some((function(e){return o.includes(e)})))||t.some((function(e){return!!r.includes(e)||!!a.includes(e)||!!o.includes(e)||(e.startsWith(".")?o.toLowerCase().endsWith(e.toLowerCase()):!(!e.startsWith("/")||!o.startsWith(e)))}))}catch(e){return!1}}(e,Un)&&(0!==_n.length&&function(e,t){try{var r=Pn(e);return t.some((function(e){return e.startsWith("/")?new URL(r).pathname.startsWith(e):r.startsWith(e)}))}catch(e){return!1}}(e,_n))}function Gn(){try{Lt.addCustomEvent(Kr,{type:"NETWORK_ONLINE",timestamp:Date.now()})}catch(e){Xr.warn("Failed to add NETWORK_ONLINE event (recording may have stopped)",e)}}function Kn(){try{Lt.addCustomEvent(Kr,{type:"NETWORK_OFFLINE",timestamp:Date.now()})}catch(e){Xr.warn("Failed to add NETWORK_OFFLINE event (recording may have stopped)",e)}}var jn=XMLHttpRequest.prototype.open,Yn=XMLHttpRequest.prototype.send,Zn=window.fetch,Vn=!1;function Hn(){jn&&(XMLHttpRequest.prototype.open=jn),Yn&&(XMLHttpRequest.prototype.send=Yn),Zn&&(window.fetch=Zn),window.removeEventListener("online",Gn),window.removeEventListener("offline",Kn),Vn=!1}function Jn(e){if(e&&e.length>0){var t=_n.concat(e),r=Array.from(new Set(t));_n.splice.apply(_n,[0,_n.length].concat(r))}}function qn(){return[].concat(_n)}function zn(e){if(e&&e.length>0){var t=Un.concat(e),r=Array.from(new Set(t));Un.splice.apply(Un,[0,Un.length].concat(r))}}function Xn(){return[].concat(Un)}function Qn(){return Bn}function $n(e){Object.assign(Fn,e)}function eo(){return d()({},Fn)}var to=null,ro=function(){to&&(to(),to=null)},no=function(){var e=Mn();if(e.enable){var t=en(),r=on();e.clearStorageBeforeRecord&&mn.clear(r).then((function(){})).catch((function(e){Xr.warn("Failed to clear storage before recording",e)}));var n,a=[];if(e.console&&e.console.enable){var s,u,c,f,p,h=d()(d()({level:e.console.level||["info","log","warn","error"]},e.console.lengthThreshold&&{lengthThreshold:e.console.lengthThreshold}),{},{stringifyOptions:d()({numOfKeysLimit:null!==(s=null===(u=e.console.stringifyOptions)||void 0===u?void 0:u.numOfKeysLimit)&&void 0!==s?s:50,depthOfLimit:null!==(c=null===(f=e.console.stringifyOptions)||void 0===f?void 0:f.depthOfLimit)&&void 0!==c?c:4},(null===(p=e.console.stringifyOptions)||void 0===p?void 0:p.stringLengthLimit)&&{stringLengthLimit:e.console.stringifyOptions.stringLengthLimit})});a.push({name:"rrweb/console@1",observer:Ar,options:h})}if(to=Lt({emit:function(e){try{mn.push(r,e)}catch(e){Xr.warn("Failed to storage push event:",e)}},recordCanvas:!0,sampling:e.sampling,checkoutEveryNms:e.checkoutEveryNms,ignoreClass:e.ignoreClass,blockClass:e.blockClass,maskTextClass:e.maskTextClass,dataURLOptions:{type:"image/webp",quality:.6},collectFonts:!0,recordCrossOriginIframes:!0,plugins:[].concat(a),packFn:e.packEvents?pr:void 0}),$n(l()({},Er,t)),Jn(Hr),e.http)try{n=Lt,Vn?Xr.warn("Network monitoring is already active"):(Vn=!0,XMLHttpRequest.prototype.open=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;try{this._rlogRequest={method:e,url:t.toString(),startTime:0,endTime:0}}catch(e){Xr.warn("Failed to save XHR request info:",e)}return jn.apply(this,[e,t,r,n,o])},XMLHttpRequest.prototype.send=function(e){var t=this;try{var r=this._rlogRequest;if(r){if(r.startTime=Date.now(),Wn(r.url))try{Object.entries(Fn).forEach((function(e){var r=V()(e,2),n=r[0],o=r[1];t.setRequestHeader(n,o)}))}catch(e){Xr.warn("Failed to set custom headers on XHR:",e)}this.addEventListener("load",(function(){var e=this;try{if(r.endTime=Date.now(),Wn(r.url)){var t={};Vr.forEach((function(r){try{var n=e.getResponseHeader(r);n&&(t[r]=n)}catch(e){}}));try{n.addCustomEvent(Wr,d()(d()({},r),{},{dur:r.endTime-r.startTime,responseHeaders:t,pagePath:window.location.href}))}catch(e){}}if(Nn){var o,a,i=null!==(o=null===(a=Mn().errorCapture)||void 0===a?void 0:a.httpErrorThreshold)&&void 0!==o?o:400;this.status>=i&&Nn.onError({type:"http",message:"XHR ".concat(r.method," ").concat(r.url," responded with status ").concat(this.status),timestamp:Date.now(),detail:{url:r.url,method:r.method,status:this.status}})}}catch(e){Xr.warn("Error in XHR load handler:",e)}})),this.addEventListener("error",(function(){try{n.addCustomEvent(Gr,d()(d()({},r),{},{dur:r.endTime-r.startTime,pagePath:window.location.href}))}catch(e){}try{Nn&&Nn.onError({type:"http",message:"XHR ".concat(r.method," ").concat(r.url," network error"),timestamp:Date.now(),detail:{url:r.url,method:r.method}})}catch(e){Xr.warn("Error in XHR error trigger:",e)}}))}}catch(e){Xr.warn("Error in XHR send hook:",e)}return Yn.apply(this,[e])},window.fetch=function(){var e=i()(o()().mark((function e(t,r){var a,i,s,u,c,l,f,p,h,g,v;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,a=t instanceof Request?t.url:t.toString(),i=(null==r?void 0:r.method)||(t instanceof Request?t.method:"GET").toUpperCase(),e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",Zn(t,r));case 8:s=Date.now(),u=r;try{Wn(a)&&Object.keys(Fn).length>0&&(u=d()(d()({},r),{},{headers:d()(d()({},(null==r?void 0:r.headers)||{}),Fn)}))}catch(e){Xr.warn("Failed to add custom headers on Fetch:",e),u=r}return e.prev=11,e.next=14,Zn(t,u);case 14:c=e.sent,e.next=22;break;case 17:e.prev=17,e.t1=e.catch(11);try{n.addCustomEvent(Gr,{url:a,method:i,pagePath:window.location.href})}catch(e){}try{Nn&&Nn.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," network error"),timestamp:Date.now(),detail:{url:a,method:i,error:String(e.t1)}})}catch(e){}throw e.t1;case 22:try{if(l=Date.now(),Wn(a)){f={},Vr.forEach((function(e){try{var t=c.headers.get(e);t&&(f[e]=t)}catch(e){}}));try{n.addCustomEvent(Wr,{url:a,method:i,dur:l-s,responseHeaders:f,pagePath:window.location.href})}catch(e){}}Nn&&(g=Mn(),v=null!==(p=null===(h=g.errorCapture)||void 0===h?void 0:h.httpErrorThreshold)&&void 0!==p?p:400,c.status>=v&&Nn.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," responded with status ").concat(c.status),timestamp:Date.now(),detail:{url:a,method:i,status:c.status}}))}catch(e){Xr.warn("Error in Fetch success handler:",e)}return e.abrupt("return",c);case 24:case"end":return e.stop()}}),e,null,[[0,5],[11,17]])})));return function(t,r){return e.apply(this,arguments)}}(),window.addEventListener("online",Gn),window.addEventListener("offline",Kn))}catch(e){Xr.warn("Failed to initialize HTTP monitoring:",e)}}};function oo(e){var t,r,n,o;n=Mn().urlParamsToCache||Ur,o=new URLSearchParams(window.location.search),n.forEach((function(e){var t=o.get(e);t&&sessionStorage.setItem("".concat(Tr).concat(e),t)}));var a=e.data&&e.data.length>0?e.data.length-1:-1,i={deviceId:e.deviceId,appId:e.appId,startTime:null===(t=e.data)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.timestamp,endTime:null===(r=e.data)||void 0===r||null===(r=r[a])||void 0===r?void 0:r.timestamp};return(Mn().urlParamsToCache||Ur).forEach((function(e){var t=function(e){return sessionStorage.getItem("".concat(Tr).concat(e))}(e);t&&(i[e]=t)})),i}var ao=function(){var e=i()(o()().mark((function e(t){var r,n,a,i,s,c,l,f;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=oo({appId:t.appId,deviceId:t.deviceId,data:t.data}),n=new URLSearchParams(r),a="".concat(t.url).concat(n?"?".concat(n):""),(i=new FormData).append("file",new Blob([JSON.stringify(t.data)]),$r()+".json"),s=eo(),e.next=8,Cn(a,i,{headers:s});case 8:c=e.sent,e.prev=9,l="string"==typeof c.data?JSON.parse(c.data):c.data,e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(9),e.abrupt("return");case 16:if(!l||"object"!==u()(l)||!1!==l.success){e.next=20;break}throw(f=new Error(l.errorMessage||"Upload failed with success=false")).responseData=l,f;case 20:case"end":return e.stop()}}),e,null,[[9,13]])})));return function(t){return e.apply(this,arguments)}}();var io=null,so=!1,uo=!1,co="",lo=!1,fo=0,po=!1,ho=0,go=null,vo=null,mo=null;function yo(e){mo=e}function wo(){return"batch_".concat(Date.now(),"_").concat(++ho)}function Io(){try{if("undefined"==typeof Worker)return null;var e="\n'use strict';\n\n// ===== Worker 内部状态 =====\nvar config = null;\nvar pollTimer = null;\nvar isRunning = false;\nvar failureCountMap = {};\n\n// ===== UUID 生成 =====\nfunction generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (Math.random() * 16) | 0;\n var v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n// ===== 构建上传 URL =====\nfunction buildUploadUrl(serv, queryParams) {\n var params = [];\n for (var key in queryParams) {\n if (queryParams.hasOwnProperty(key) && queryParams[key] != null && queryParams[key] !== '') {\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(queryParams[key]));\n }\n }\n var queryString = params.join('&');\n return serv + (queryString ? '?' + queryString : '');\n}\n\n// ===== 执行上传 =====\nfunction performUpload(msg) {\n var batchId = msg.batchId;\n var events = msg.events;\n var queryParams = msg.queryParams;\n var customHeaders = msg.customHeaders;\n\n try {\n // JSON 序列化在 Worker 中执行,不阻塞主线程\n var jsonStr = JSON.stringify(events);\n var blob = new Blob([jsonStr], { type: 'application/json' });\n var formData = new FormData();\n formData.append('file', blob, generateUUID() + '.json');\n\n var url = buildUploadUrl(config ? config.serv : '', queryParams);\n\n var xhr = new XMLHttpRequest();\n xhr.open('POST', url, true);\n xhr.timeout = ".concat(_r,";\n\n // 设置自定义请求头\n if (customHeaders) {\n for (var key in customHeaders) {\n if (customHeaders.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, customHeaders[key]);\n }\n }\n }\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n // 检查业务层 success 字段\n var uploadSuccess = true;\n var errorMessage = '';\n try {\n var responseData = JSON.parse(xhr.responseText);\n if (responseData && typeof responseData === 'object' && responseData.success === false) {\n uploadSuccess = false;\n errorMessage = responseData.errorMessage || 'Upload failed with success=false';\n }\n } catch(e) {\n // 无法解析 JSON,视为成功\n }\n\n if (uploadSuccess) {\n // 上传成功,重置失败计数\n var batchKey = config ? (config.appId + '_' + config.storageKey) : batchId;\n delete failureCountMap[batchKey];\n self.postMessage({ type: 'UPLOAD_SUCCESS', batchId: batchId });\n } else {\n handleFailure(batchId, errorMessage);\n }\n } else {\n handleFailure(batchId, 'HTTP ' + xhr.status + ': ' + xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function() {\n handleFailure(batchId, 'Network error');\n };\n\n xhr.ontimeout = function() {\n handleFailure(batchId, 'Request timeout');\n };\n\n xhr.send(formData);\n } catch (e) {\n handleFailure(batchId, 'Upload exception: ' + (e.message || String(e)));\n }\n}\n\n// ===== 处理上传失败 =====\nfunction handleFailure(batchId, errorMessage) {\n var batchKey = config ? (config.appId + '_' + config.storageKey) : batchId;\n var currentCount = failureCountMap[batchKey] || 0;\n var newCount = currentCount + 1;\n failureCountMap[batchKey] = newCount;\n\n var maxRetry = (config && config.maxRetryCount) ? config.maxRetryCount : 3;\n\n if (newCount >= maxRetry) {\n // 达到最大重试次数\n delete failureCountMap[batchKey];\n self.postMessage({\n type: 'MAX_RETRY_REACHED',\n batchId: batchId,\n error: errorMessage\n });\n } else {\n self.postMessage({\n type: 'UPLOAD_FAILURE',\n batchId: batchId,\n error: errorMessage,\n failureCount: newCount\n });\n }\n}\n\n// ===== 轮询调度 =====\nfunction startPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n }\n\n var interval = (config && config.uploadInterval) ? config.uploadInterval : 2000;\n\n pollTimer = setInterval(function() {\n if (!isRunning) return;\n\n // 向主线程请求数据批次\n // 主线程会根据当前模式(full/error)和状态决定是否提供数据\n self.postMessage({\n type: 'REQUEST_BATCH'\n });\n }, interval);\n}\n\nfunction stopPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n pollTimer = null;\n }\n}\n\n// ===== 清理 =====\nfunction cleanup() {\n isRunning = false;\n stopPolling();\n failureCountMap = {};\n config = null;\n}\n\n// ===== 消息处理 =====\nself.onmessage = function(e) {\n var msg = e.data;\n if (!msg || !msg.type) return;\n\n switch (msg.type) {\n case 'START':\n config = msg.config;\n isRunning = true;\n failureCountMap = {};\n startPolling();\n break;\n\n case 'STOP':\n cleanup();\n break;\n\n case 'UPLOAD_BATCH':\n if (isRunning) {\n performUpload(msg);\n }\n break;\n\n case 'UPDATE_CONFIG':\n if (msg.config) {\n for (var key in msg.config) {\n if (msg.config.hasOwnProperty(key) && config) {\n config[key] = msg.config[key];\n }\n }\n // 如果 uploadInterval 变了,重启轮询\n if (msg.config.uploadInterval && isRunning) {\n startPolling();\n }\n }\n break;\n\n case 'SET_ERROR_MODE_UPLOADING':\n // 状态由主线程管理,Worker 仅接收指令保持协议兼容\n break;\n }\n};\n\n// Worker 就绪通知\nself.postMessage({ type: 'READY' });\n"),t=new Blob([e],{type:"application/javascript"}),r=URL.createObjectURL(t),n=new Worker(r);return URL.revokeObjectURL(r),n}catch(e){return Xr.warn("Failed to create inline Worker, will fallback to main thread:",e),null}}function bo(e){var t=e.data;if(t&&t.type)switch(t.type){case"READY":so=!0,go&&(clearTimeout(go),go=null);break;case"REQUEST_BATCH":!function(){Co.apply(this,arguments)}();break;case"UPLOAD_SUCCESS":!function(e){ko.apply(this,arguments)}(t.batchId);break;case"UPLOAD_FAILURE":!function(e,t,r){xo.apply(this,arguments)}(t.batchId,t.error,t.failureCount);break;case"MAX_RETRY_REACHED":!function(e,t){Ao.apply(this,arguments)}(t.batchId,t.error)}else Xr.warn("Received invalid Worker message:",t)}function Co(){return Co=i()(o()().mark((function e(){var t,r,n,a,i,s,u,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!po){e.next=2;break}return e.abrupt("return");case 2:if((t=Mn()).enable){e.next=5;break}return e.abrupt("return");case 5:if(!(r="error"===t.captureMode)||lo){e.next=8;break}return e.abrupt("return");case 8:if(e.prev=8,po=!0,a=0,!r){e.next=19;break}return a=fo>0?fo:Date.now(),e.next=15,mn.pullByTimeRange(on(),a,Date.now());case 15:n=e.sent,fo=0,e.next=22;break;case 19:return e.next=21,mn.pull(on(),100);case 21:n=e.sent;case 22:if(n&&0!==n.length){e.next=25;break}return po=!1,e.abrupt("return");case 25:if(i=Mn(),!(sessionStorage.getItem(Or)===Lr||i.consumeOnly)){e.next=30;break}return po=!1,e.abrupt("return");case 30:s=oo({appId:co,deviceId:en(),data:n}),u=eo(),c=wo(),So.set(c,{events:n,isErrorMode:r,windowStart:a}),Eo({type:"UPLOAD_BATCH",batchId:c,events:n,queryParams:s,customHeaders:u}),po=!1,e.next=42;break;case 38:e.prev=38,e.t0=e.catch(8),po=!1,Xr.error("Error fetching batch for Worker:",e.t0);case 42:case"end":return e.stop()}}),e,null,[[8,38]])}))),Co.apply(this,arguments)}var So=new Map;function ko(){return(ko=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=So.get(t)){e.next=3;break}return e.abrupt("return");case 3:if(So.delete(t),e.prev=4,!(r.isErrorMode&&r.windowStart>0&&r.events.length>0)){e.next=10;break}return e.next=8,mn.removeByTimeRange(on(),r.windowStart);case 8:(n=r.events[r.events.length-1])&&n.timestamp&&(fo=n.timestamp);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),Xr.warn("Error in handleUploadSuccess:",e.t0);case 15:case"end":return e.stop()}}),e,null,[[4,12]])})))).apply(this,arguments)}function xo(){return(xo=i()(o()().mark((function e(t,r,n){var a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=So.get(t)){e.next=3;break}return e.abrupt("return");case 3:return So.delete(t),Xr.warn("Upload failed ".concat(n," time(s), will retry in next cycle:"),r),e.prev=5,e.next=8,mn.unshiftBatch(on(),a.events);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),Xr.warn("Failed to push events back to storage:",e.t0);case 13:case"end":return e.stop()}}),e,null,[[5,10]])})))).apply(this,arguments)}function Ao(){return(Ao=i()(o()().mark((function e(t,r){var n,a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=So.get(t)){e.next=3;break}return e.abrupt("return");case 3:return So.delete(t),a=Mn(),i=a.maxRetryCount||3,Xr.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=9,mn.unshiftBatch(on(),n.events);case 9:s=new CustomEvent(Br,{detail:{error:r,retryCount:i,appId:co,deviceId:en()}}),"undefined"!=typeof window&&window.dispatchEvent(s);try{Lt.addCustomEvent(Br,{error:r,retryCount:i,appId:co,deviceId:en(),timestamp:Date.now()})}catch(e){Xr.warn("Failed to record upload failure event via addCustomEvent:",e)}Mo(),mo&&setTimeout((function(){try{var e;null===(e=mo)||void 0===e||e()}catch(e){Xr.error("Error in cancel callback:",e)}}),0),Xr.error("Upload and recording stopped due to repeated failures");case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eo(e){if(io&&so)try{io.postMessage(e)}catch(e){Xr.warn("Failed to send message to Worker:",e)}else Xr.warn("Cannot send to Worker - worker:",!!io,"workerReady:",so,"command:",e.type)}function To(e){Xr.error("Upload Worker error:",e.message),Mo(!0)}function Ro(e){vo=e}function Mo(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(go&&(clearTimeout(go),go=null),io){try{io.postMessage({type:"STOP"}),io.terminate()}catch(e){}io=null}so=!1,uo=!1,po=!1,lo=!1,fo=0,ho=0,So.clear(),e&&vo&&vo()}function Oo(){return uo&&null!==io}var Lo=null;function No(e){Lo=e}var Do=!1,_o=new Map,Fo=!1,Uo=!1,Bo=0;function Po(e){Oo()?function(e){lo=e,Eo({type:"SET_ERROR_MODE_UPLOADING",uploading:e})}(e):Uo=e}function Wo(e){Oo()?function(e){fo=e}(e):Bo=e}function Go(e,t,r){return Ko.apply(this,arguments)}function Ko(){return(Ko=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&0!==n.length){e.next=2;break}return e.abrupt("return",{success:!0});case 2:return e.prev=2,e.next=5,ao({appId:r,data:n,deviceId:en(),url:t});case 5:return e.abrupt("return",{success:!0});case 8:return e.prev=8,e.t0=e.catch(2),Xr.warn("Upload failed:",e.t0),e.abrupt("return",{success:!1,error:e.t0});case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function jo(e,t,r,n,o,a){return Yo.apply(this,arguments)}function Yo(){return(Yo=i()(o()().mark((function e(t,r,n,a,i,s){var u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=s+1,c="".concat(n,"_").concat(on()),_o.set(c,u),!(u>=i)){e.next=16;break}return Xr.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=7,mn.unshiftBatch(on(),t);case 7:l=new CustomEvent(Br,{detail:{error:r,retryCount:i,appId:n,deviceId:en()}}),"undefined"!=typeof window&&window.dispatchEvent(l);try{Lt.addCustomEvent(Br,{error:r,retryCount:i,appId:n,deviceId:en(),timestamp:Date.now()})}catch(e){Xr.warn("Failed to record upload failure event via addCustomEvent:",e)}return _o.delete(c),Lo&&setTimeout((function(){try{var e;null===(e=Lo)||void 0===e||e()}catch(e){Xr.error("Error in cancel callback:",e)}}),0),Xr.error("Upload and recording stopped due to repeated failures"),e.abrupt("return",!0);case 16:return Xr.warn("Upload failed ".concat(u," time(s), will retry in next cycle")),e.next=19,mn.unshiftBatch(on(),t);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zo(e,t){var r=function(){var n=i()(o()().mark((function n(){var a,i,s,u,c,l,f,d,p,h,g;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Do){n.next=2;break}return n.abrupt("return");case 2:if(!Fo){n.next=5;break}return setTimeout((function(){r()}),100),n.abrupt("return");case 5:if((a=Mn()).enable){n.next=8;break}return n.abrupt("return");case 8:if(!(i="error"===a.captureMode)||Uo){n.next=12;break}return setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 12:if(n.prev=12,Fo=!0,u=0,!i){n.next=23;break}return u=Bo>0?Bo:Date.now(),n.next=19,mn.pullByTimeRange(on(),u,Date.now());case 19:s=n.sent,Bo=0,n.next=26;break;case 23:return n.next=25,mn.pull(on(),100);case 25:s=n.sent;case 26:if(s&&0!==s.length){n.next=30;break}return Fo=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 30:if(c=Mn(),!(sessionStorage.getItem(Or)===Lr||c.consumeOnly)){n.next=36;break}return Fo=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 36:return n.next=38,Go(e,t,s);case 38:if(!(l=n.sent).success){n.next=50;break}if(f="".concat(t,"_").concat(on()),_o.delete(f),!(i&&u>0&&s.length>0)){n.next=47;break}return n.next=45,mn.removeByTimeRange(on(),u);case 45:(d=s[s.length-1])&&d.timestamp&&(Bo=d.timestamp);case 47:Fo=!1,n.next=59;break;case 50:return Fo=!1,p=c.maxRetryCount||3,h="".concat(t,"_").concat(on()),g=_o.get(h)||0,n.next=56,jo(s,l.error,t,e,p,g);case 56:if(!n.sent){n.next=59;break}return n.abrupt("return");case 59:n.next=65;break;case 61:n.prev=61,n.t0=n.catch(12),Fo=!1,Xr.error("Error in upload loop:",n.t0);case 65:try{setTimeout((function(){r()}),a.uploadInterval)}catch(e){Xr.error("Failed to schedule next upload:",e)}case 66:case"end":return n.stop()}}),n,null,[[12,61]])})));return function(){return n.apply(this,arguments)}}();r()}function Vo(e,t){Ro((function(){Xr.log("Worker mode was downgraded, starting main thread upload"),Zo(e,t)}));var r=function(e,t){co=t;var r=Io();if(!r)return uo=!1,!1;(io=r).onmessage=bo,io.onerror=To;var n=Mn(),o={serv:e,appId:t,storageKey:on(),uploadInterval:n.uploadInterval,maxRetryCount:n.maxRetryCount||3};return io.postMessage({type:"START",config:o}),uo=!0,go=setTimeout((function(){so||(Xr.warn("Worker failed to send READY within ".concat(5e3,"ms, falling back to main thread")),Mo(!0))}),5e3),!0}(e,t);r||(Xr.log("Worker not available, falling back to main thread upload"),Zo(e,t))}function Ho(){Ro(null),Oo()&&Mo(),Do=!0,Fo=!1,Uo=!1,Bo=0}function Jo(){Ro(null),Oo()&&Mo(),Do=!1,Fo=!1,Uo=!1,Bo=0,_o.clear()}function qo(){return zo.apply(this,arguments)}function zo(){return(zo=i()(o()().mark((function e(){var t,r,n,a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(t=sn()).length){e.next=4;break}return e.abrupt("return");case 4:Xr.log("Found ".concat(t.length," orphan session(s) with residual data")),r=on(),n=h()(t),e.prev=7,n.s();case 9:if((a=n.n()).done){e.next=34;break}return i=a.value,e.prev=11,e.next=14,mn.pull(i.storageKey,1e4);case 14:if((s=e.sent)&&0!==s.length){e.next=18;break}return cn(i.sessionId),e.abrupt("continue",32);case 18:if(un(s)){e.next=22;break}return Xr.log("Orphan session ".concat(i.sessionId," data is out of valid range, discarding ").concat(s.length," events")),cn(i.sessionId),e.abrupt("continue",32);case 22:return e.next=24,mn.unshiftBatch(r,s);case 24:Xr.log("Merged ".concat(s.length," residual events from orphan session ").concat(i.sessionId," into current storage")),cn(i.sessionId),e.next=32;break;case 28:e.prev=28,e.t0=e.catch(11),Xr.warn("Error processing orphan session ".concat(i.sessionId,":"),e.t0),cn(i.sessionId);case 32:e.next=9;break;case 34:e.next=39;break;case 36:e.prev=36,e.t1=e.catch(7),n.e(e.t1);case 39:return e.prev=39,n.f(),e.finish(39);case 42:e.next=47;break;case 44:e.prev=44,e.t2=e.catch(0),Xr.warn("Error in flushOrphanSessions:",e.t2);case 47:case"end":return e.stop()}}),e,null,[[0,44],[7,36,39,42],[11,28]])})))).apply(this,arguments)}var Xo=d()({},Mn().routerMonitor||{}),Qo="",$o=Date.now(),ea=!1,ta=null,ra=null;function na(){return"undefined"==typeof window?"":window.location.pathname+window.location.search+window.location.hash}function oa(e,t,r){var n;if(null!==(n=Xo)&&void 0!==n&&n.enable&&(o=t,null===(a=Xo)||void 0===a||!a.ignoreRoutes||!Xo.ignoreRoutes.some((function(e){return"string"==typeof e?o.includes(e):e instanceof RegExp&&e.test(o)})))){var o,a,i={type:"route-change",from:e,to:t,method:r,timestamp:Date.now()};Qo=t,Xo.trackPageStayTime&&e&&(i.duration=Date.now()-$o);try{Lt.addCustomEvent("route-change",i)}catch(e){Xr.warn("Failed to add custom event (recording may have stopped)",e)}$o=Date.now()}}function aa(){var e=Qo,t=na();e!==t&&oa(e,t,"popstate")}function ia(){var e=Qo,t=na();e!==t&&oa(e,t,"hashchange")}function sa(e){var t,r,n,o,a,i=Mn().routerMonitor||{},s=d()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{}),u=JSON.stringify(s)!==JSON.stringify(Xo);Xo=s,u&&Xo.enable?pa(Xo):Xo.enable||va()}function ua(){try{Lt.addCustomEvent(jr,{type:"PAGE_LOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Xr.warn("Failed to add PAGE_LOAD event (recording may have stopped)",e)}}function ca(){try{Lt.addCustomEvent(jr,{type:"PAGE_UNLOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Xr.warn("Failed to add PAGE_UNLOAD event (recording may have stopped)",e)}}function la(e){try{Lt.addCustomEvent(jr,{type:"PAGE_HIDE",url:window.location.href,timestamp:Date.now(),persisted:e.persisted})}catch(e){Xr.warn("Failed to add PAGE_HIDE event (recording may have stopped)",e)}}function fa(e){try{Lt.addCustomEvent(jr,{type:"PAGE_SHOW",url:window.location.href,timestamp:Date.now(),persisted:e.persisted}),e.persisted&&($o=Date.now())}catch(e){Xr.warn("Failed to add PAGE_SHOW event (recording may have stopped)",e)}}function da(){try{var e="hidden"===document.visibilityState;Lt.addCustomEvent(jr,{type:e?"PAGE_VISIBILITY_HIDDEN":"PAGE_VISIBILITY_VISIBLE",url:window.location.href,timestamp:Date.now()})}catch(e){Xr.warn("Failed to add visibility change event (recording may have stopped)",e)}}function pa(e){var t,r,n,o,a;if(!ea&&"undefined"!=typeof window){var i=Mn().routerMonitor||{};(Xo=d()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{})).enable&&(Qo=na(),$o=Date.now(),Xo.trackHistoryChange&&(ta=window.history.pushState,ra=window.history.replaceState,window.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=ta.apply(this,t);try{var o=na();Qo!==o&&oa(Qo,o,"pushState")}catch(e){Xr.warn("Error in pushState hook:",e)}return n},window.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=ra.apply(this,t);try{var o=na();Qo!==o&&oa(Qo,o,"replaceState")}catch(e){Xr.warn("Error in replaceState hook:",e)}return n},window.addEventListener("popstate",aa)),Xo.trackHashChange&&window.addEventListener("hashchange",ia),window.addEventListener("load",ua),window.addEventListener("beforeunload",ca),window.addEventListener("pagehide",la),window.addEventListener("pageshow",fa),document.addEventListener("visibilitychange",da),ea=!0)}}function ha(){return{currentRoute:Qo,startTime:$o,stayTime:Date.now()-$o}}function ga(e,t){oa(t||Qo,e,"pushState")}function va(){ea&&(ta&&ra&&"undefined"!=typeof window&&(window.history.pushState=ta,window.history.replaceState=ra),"undefined"!=typeof window&&(window.removeEventListener("popstate",aa),window.removeEventListener("hashchange",ia),window.removeEventListener("load",ua),window.removeEventListener("beforeunload",ca),window.removeEventListener("pagehide",la),window.removeEventListener("pageshow",fa),document.removeEventListener("visibilitychange",da)),ea=!1,ta=null,ra=null)}var ma=null,ya=!1;function wa(e){ma=e}var Ia=function(e){try{Lt.addCustomEvent(Pr,e)}catch(t){Xr.error("Error captured",e)}try{"error"===Mn().captureMode&&ma&&ma.onError({type:e.type,message:e.message||e.type,timestamp:e.timestamp||Date.now(),detail:e})}catch(e){Xr.warn("Failed to notify error trigger:",e)}};function ba(e){try{var t=e;if(e.target!==window){var r={type:"RESOURCE_ERROR",resourceType:e.target.tagName,url:e.target.src||e.target.href||e.target.src,message:t.message,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};return Ia(r),!1}var n=t.message,o=t.filename,a=t.lineno,i=t.colno,s=t.error,u={type:"JS_ERROR",message:n,file:o,line:a,column:i,stack:null==s?void 0:s.stack,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};Ia(u)}catch(e){Xr.warn("Failed to handle unhandled rejection:",e)}return!1}function Ca(e){try{var t=e.reason||"Unknown rejection",r={type:"PROMISE_REJECTION",message:"string"==typeof t?t:t.message,stack:"object"===u()(t)?t.stack:null,timestamp:Date.now(),location:window.location.href};Ia(r)}catch(e){Xr.warn("Failed to handle unhandled rejection:",e)}}function Sa(){ya&&(window.removeEventListener("error",ba,!0),window.removeEventListener("unhandledrejection",Ca),ya=!1)}var ka=function(){function e(){var t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};q()(this,e),l()(this,"beforeDuration",void 0),l()(this,"afterDuration",void 0),l()(this,"state","idle"),l()(this,"cooldownTimer",null),l()(this,"destroyed",!1),this.beforeDuration=null!==(t=n.beforeDuration)&&void 0!==t?t:3e4,this.afterDuration=null!==(r=n.afterDuration)&&void 0!==r?r:3e4}return X()(e,[{key:"isUploading",value:function(){return"uploading"===this.state}},{key:"onError",value:function(e){this.destroyed||("idle"===this.state?this.enterUploadingState(e.timestamp):this.resetCooldown())}},{key:"enterUploadingState",value:function(e){this.state="uploading",Wo(e-this.beforeDuration),Po(!0),this.resetCooldown()}},{key:"resetCooldown",value:function(){var e=this;this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),this.cooldownTimer=setTimeout((function(){try{e.exitUploadingState()}catch(e){Xr.warn("Error in exitUploadingState:",e)}}),this.afterDuration)}},{key:"exitUploadingState",value:function(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),Po(!1),this.state="idle"}},{key:"destroy",value:function(){this.destroyed=!0,this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),Po(!1),this.state="idle"}}]),e}(),xa=!1,Aa=null;function Ea(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"SDK instance";if(xa)Xr.warn("SDK has already been cancelled");else{xa=!0;try{if(ro(),Ho(),"undefined"!=typeof window&&window.XMLHttpRequest&&Hn(),va(),On(),Sa(),Aa&&(Aa.destroy(),Aa=null),wa(null),Dn(null),No(null),yo(null),e.clearData){var r=on();r&&mn.clear(r).catch((function(e){Xr.error("Error clearing storage",e)}))}an(nn()),Xr.log("SDK cancelled successfully via ".concat(t))}catch(e){Xr.error("Error cancelling SDK via ".concat(t),e)}}}function Ta(e,t,r){xa=!1,Jo(),setTimeout((function(){try{!function(){try{for(var e=JSON.parse(Qr.getItem(rn)||"{}"),t=Date.now(),r=en(),n=!1,o=0,a=Object.keys(e);o<a.length;o++){var i=a[o];if(t-e[i]>Nr){var s="".concat(Rr).concat(r,"_").concat(i),u="".concat(Mr).concat(r,"_").concat(i);Qr.removeItem(s),Qr.removeItem(u),delete e[i],n=!0}}n&&Qr.setItem(rn,JSON.stringify(e))}catch(e){}}()}catch(e){Xr.warn("Failed to cleanup stale sessions:",e)}}),0);var n=Pn(e);!function(e){if(e){Bn=e;var t=Pn(e),r=[e];t!==e&&r.push(t),r.forEach((function(e){Un.includes(e)||Un.push(e)}))}}(n),function(e){return Ln.apply(this,arguments)}(r).then(i()(o()().mark((function e(){var r,a,i,s,u,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=Mn()).enable){e.next=3;break}return e.abrupt("return");case 3:(i="error"===a.captureMode)&&(wa(Aa=new ka({beforeDuration:null===(s=a.errorCapture)||void 0===s?void 0:s.beforeDuration,afterDuration:null===(u=a.errorCapture)||void 0===u?void 0:u.afterDuration})),Dn(Aa));try{no()}catch(e){Xr.error("Failed to start recording:",e)}return e.prev=6,e.next=9,qo();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),Xr.warn("Failed to flush orphan sessions:",e.t0);case 14:No(c=function(){try{Ea({},"upload failure")}catch(e){Xr.error("Failed to cancel SDK via upload failure callback:",e)}}),yo(c);try{Vo(n,t)}catch(e){Xr.error("Failed to start upload loop:",e)}try{pa(a.routerMonitor)}catch(e){Xr.warn("Failed to initialize router monitor:",e)}if(i||null!==(r=a.error)&&void 0!==r&&r)try{ya||(window.addEventListener("error",ba,!0),window.addEventListener("unhandledrejection",Ca),ya=!0)}catch(e){Xr.warn("Failed to initialize error handler:",e)}Xr.log("Initialized successfully");case 22:case"end":return e.stop()}}),e,null,[[6,11]])})))).catch((function(e){Xr.error("Failed to initialize SDK",e)}))}function Ra(e){try{Ta(e.serv,e.appId,e.cdnConfigUrl)}catch(e){Xr.error("Failed to initialize SDK:",e)}return{cancel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{Ea(e,"SDK instance")}catch(e){Xr.error("Failed to cancel SDK:",e)}}}}function Ma(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{Xr.warn("Please use rlog.cancel() from initialized instance instead of standalone cancelRecord()"),Ea(e,"standalone function")}catch(e){Xr.error("Failed to cancel record:",e)}}function Oa(e,t){try{Lt.addCustomEvent(e,t)}catch(e){Xr.warn("Failed to add custom event:",e)}}function La(e){try{Lt.takeFullSnapshot(e)}catch(e){Xr.warn("Failed to take full snapshot:",e)}}function Na(e){Rn({consumeOnly:e})}function Da(){return sessionStorage.getItem(Or)===Lr||!!Mn().consumeOnly}function _a(){var e=!Mn().consumeOnly;return Na(e),e}function Fa(e){var t="string"==typeof e?e:e.message,r="object"===u()(e)&&e.stack?e.stack:void 0;try{Lt.addCustomEvent(Pr,{type:"CUSTOM_ERROR",message:t,stack:r,timestamp:Date.now(),location:"undefined"!=typeof window?window.location.href:""})}catch(e){Xr.warn("Failed to add custom error event:",e)}try{ma&&ma.onError({type:"custom",message:t,timestamp:Date.now(),detail:{stack:r}})}catch(e){Xr.warn("Failed to trigger error mode:",e)}}var Ua={getStorageAdapterType:function(){return mn.getAdapterType()},getDeviceId:en,getSessionId:nn,getStorageKey:on,resetUploadState:function(){Jo()},getStorageState:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=on(),e.abrupt("return",mn.getStorageState(t));case 2:case"end":return e.stop()}}),e)})))()},clearStorage:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=on(),e.abrupt("return",mn.clear(t));case 2:case"end":return e.stop()}}),e)})))()},getConfig:Mn}}(),n}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antglobal/rlog-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "日志上报sdk",
5
5
  "main": "dist/lib/index.js",
6
6
  "module": "dist/esm/index.js",