posthog-js 1.433.2 → 1.433.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/array.full.es5.js +1 -1
  3. package/dist/array.full.es5.js.map +1 -1
  4. package/dist/array.full.js +1 -1
  5. package/dist/array.full.js.map +1 -1
  6. package/dist/array.full.no-external.js +1 -1
  7. package/dist/array.full.no-external.js.map +1 -1
  8. package/dist/array.js +1 -1
  9. package/dist/array.js.map +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/array.no-external.js.map +1 -1
  12. package/dist/customizations.full.js +1 -1
  13. package/dist/customizations.js +1 -1
  14. package/dist/default-extensions.js +1 -1
  15. package/dist/default-extensions.js.map +1 -1
  16. package/dist/extension-bundles.js +1 -1
  17. package/dist/lazy-recorder.js +1 -1
  18. package/dist/main.js +1 -1
  19. package/dist/main.js.map +1 -1
  20. package/dist/module.full.cjs +1 -1
  21. package/dist/module.full.js +1 -1
  22. package/dist/module.full.js.map +1 -1
  23. package/dist/module.full.no-external.cjs +1 -1
  24. package/dist/module.full.no-external.js +1 -1
  25. package/dist/module.full.no-external.js.map +1 -1
  26. package/dist/module.js +1 -1
  27. package/dist/module.js.map +1 -1
  28. package/dist/module.mjs +1 -1
  29. package/dist/module.mjs.map +1 -1
  30. package/dist/module.no-external.cjs +1 -1
  31. package/dist/module.no-external.js +1 -1
  32. package/dist/module.no-external.js.map +1 -1
  33. package/dist/module.slim.js +1 -1
  34. package/dist/module.slim.js.map +1 -1
  35. package/dist/module.slim.no-external.js +1 -1
  36. package/dist/module.slim.no-external.js.map +1 -1
  37. package/dist/posthog-recorder.js +1 -1
  38. package/lib/package.json +1 -1
  39. package/lib/src/request.js +3 -1
  40. package/lib/src/request.js.map +1 -1
  41. package/package.json +6 -6
@@ -1,2 +1,2 @@
1
- !function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const r="undefined"!=typeof globalThis?globalThis:t;r&&"undefined"==typeof self&&(r.self=r),r&&"undefined"==typeof File&&(r.File=function(){});const s=null!=t?t:{},o="$replay_override_sampling",a="$replay_override_linked_flag",l="$replay_override_url_trigger",u="$replay_override_event_trigger",c="$session_is_sampled",h="$session_recording_url_trigger_activated_session",d="$session_recording_event_trigger_activated_session",f="$posthog_sr_group_event_trigger_",v="$posthog_sr_group_url_trigger_",p="$sess_rec_flush_size",m="$stored_person_properties",g="$sdk_debug_replay_event_trigger_status",y="$sdk_debug_replay_linked_flag_trigger_status",b="$sdk_debug_replay_matched_recording_trigger_groups",w="$sdk_debug_replay_pending_trigger_conditions",_="$sdk_debug_replay_remote_trigger_matching_config",k="$sdk_debug_replay_trigger_groups_count",S="$sdk_debug_replay_url_trigger_status",C="$sdk_debug_rrweb_attached",I="$sdk_debug_rrweb_start_attempted",M="$session_recording_start_reason";function R(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function A(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){R(s,i,r,o,a,"next",t)}function a(t){R(s,i,r,o,a,"throw",t)}o(void 0)})}}function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function T(t,e,n){return(e=function(t){var e=function(t){if("object"!=x(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==x(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function E(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach(function(e){T(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const F=Object.prototype,D=F.hasOwnProperty,L=F.toString,N=Array.isArray||function(t){return"[object Array]"===L.call(t)},P=t=>"function"==typeof t,j=t=>t===Object(t)&&!N(t),B=t=>void 0===t,z=t=>"[object String]"==L.call(t),W=t=>null===t,U=t=>B(t)||W(t),H=t=>"[object Number]"==L.call(t)&&t==t,q=t=>"[object Boolean]"===L.call(t),G=t=>t instanceof FormData;function V(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),H(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),V(null!=r?r:n,e,n,i))}var Z=class{constructor(t){this.C={},this.I=t.I,this.R=V(t.bucketSize,0,100,t.$),this.A=V(t.refillRate,0,this.R,t.$),this.O=V(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.R,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};function J(t){return t?t.split("#")[0]:t}const Q="NativeGzipValidationError";let X;const Y=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Q,`Native gzip produced invalid output: ${t}`)},K=(tt=A(function*(t,e){18>t.size&&Y("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&Y("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(X)return X;X=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;X[t]=e>>>0}return X})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&Y("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&Y("invalid-size")}),function(t,e){return tt.apply(this,arguments)});var tt;function et(){return et=A(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),s=r.write(e).then(()=>r.close()).catch((i=A(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),o=new Response(n.readable).blob(),[a]=yield Promise.all([o,s]);return yield K(a,e),a}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),et.apply(this,arguments)}const nt="0.8.3",it={DEBUG:!1,LIB_VERSION:nt,LIB_NAME:"browser-common",JS_SDK_VERSION:nt},rt=(e,{debugEnabled:n}={})=>{const i={N(i,...r){t&&(it.DEBUG||t.POSTHOG_DEBUG||n)&&!B(t.console)&&t.console&&("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i])(e,...r)},debug(...t){i.N("debug",...t)},info(...t){i.N("log",...t)},warn(...t){i.N("warn",...t)},error(...t){i.N("error",...t)},critical(...t){console.error(e,...t)},uninitializedWarning(t){i.error(`You must initialize PostHog before calling ${t}`)},createLogger:(t,n)=>rt(`${e} ${t}`,n)};return i},st=rt("[PostHog.js]"),ot=st.createLogger;function at(t,e){if(!U(t))if(N(t))t.forEach(e);else if(G(t))t.forEach((t,n)=>e(t,n));else for(const n in t)D.call(t,n)&&e(t[n],n)}function lt(t,e,n,i){const{capture:r=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:s})}const ut=["localhost","127.0.0.1"],ct=t=>{const e=null==n?void 0:n.createElement("a");return B(e)?null:(e.href=t,e)};function ht(e){var n;const i=null==t||null===(n=t.location)||void 0===n?void 0:n.href;return B(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!P(i))return e;try{const t=i(e);return z(t)&&t?t:e}catch(t){return st.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}const dt=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),ft=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,vt=[16,15,14,13],pt=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),mt=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),gt=/[0-9A-Za-z_]/;function yt(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}const bt=1e6;function wt(t){var e;return Math.min(bt,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:bt)}const _t={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:bt,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},kt=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],St=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ct=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],It=t=>{U(t)||at(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return kt.includes(e)||Ct.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Mt=["/s/","/e/","/i/"];function Rt(t,e,n,i){if(U(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return z(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function At(t,e){if(U(t))return t;let n=t;return function(t,e=!0){if(U(t))return!1;if(z(t)){if(t=t.trim(),e?dt.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(ft.lastIndex=0;e=ft.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of vt){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(dt.test(e)&&yt(e))return!0}}}return!1}(t))return!1;if(e?pt.test(t):function(t){let e;for(mt.lastIndex=0;e=mt.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&gt.test(t)&&gt.test(n)))return!0}return!1}(t))return!1}return!0}(n,!1)||(n="[SessionRecording] "+e+" body redacted"),at(St,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const xt=new WeakSet,Tt="disabled",Ot="sampled",Et="active",Ft="buffering",$t="paused",Dt="rrweb_error",Lt="trigger_activated",Nt="trigger_pending",Pt="trigger_disabled";function jt(t,e,n,i,r,s){return 0===e?Pt:(null==t?void 0:t.get_property(n?i+n:r))===s?Lt:Nt}function Bt(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function zt(t){return t.includes("trigger_activated")?Lt:t.includes("trigger_pending")?Nt:Pt}function Wt(t){const e=new Set(t);switch(e.delete(Pt),e.size){case 0:return Pt;case 1:return Array.from(e)[0];default:return Nt}}var Ut=class{constructor(t){this.q=t}triggerStatus(t){return zt(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return zt(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},Ht=class{constructor(t){this.q=t}triggerStatus(t){return Wt(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Wt(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},qt=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Lt}stop(){}};const Gt=t=>"sessionRecording"in t;var Vt=class{constructor(t,e){this._instance=t,this.j=[],this.B=[],this.H=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.j=(Gt(t)?j(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.B=(Gt(t)?j(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.H.clear(),this.U.clear();for(const t of this.j)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){st.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.B)if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){st.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}G(t){return jt(this._instance,this.j.length,this.V,v,h,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[S]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){const t=ht(this._instance);if(!t)return!1;try{return Bt(t,this.B,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=ht(this._instance);if(!n)return;if(n===this.W)return;this.W=n;const i=this.urlBlocked,r=Bt(n,this.B,this.U);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=ht(this._instance);if(!r)return;if(r===this.W)return;this.W=r;const s=this.urlBlocked,o=Bt(r,this.B,this.U);o&&!s?t():!o&&s&&e();const a=this.G(i)===Lt,l=Bt(r,this.j,this.H);!a&&l&&n("url",r)}stop(){this.W=""}},Zt=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[y]:t}),t}triggerStatusNoSideEffects(){let t=Nt;return U(this.linkedFlag)&&(t=Pt),this.linkedFlagSeen&&(t=Lt),t}onConfig(t,e){var n;if(this.linkedFlag=(Gt(t)?j(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!U(this.linkedFlag)&&!this.linkedFlagSeen){const t=z(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=z(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((i,r)=>{let s=!1;if(j(r)&&t in r){const e=r[t];s=q(e)?!0===e:n?e===n:!!e}const o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},Jt=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Gt(t)?j(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return jt(this._instance,this.K.length,this.V,f,d,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[g]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===Lt,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},Qt=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.Y=new Vt(t,e.id),this.tt=new Jt(t,e.id),this.et=new Zt(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(i),this.tt.onConfig(i),this.et.onConfig(i,n);const r=[this.tt,this.Y,this.et];this.nt="any"===e.conditions.matchType?new Ut(r):new Ht(r)}else this.nt=new qt}triggerStatus(t){return this.nt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.nt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Nt).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.tt.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.Y.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?v+this.group.id:f+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function Xt(t){if(t.rrwebError)return Dt;if(!t.receivedFlags)return Ft;if(!t.isRecordingEnabled)return Tt;if(t.urlTriggerMatching.urlBlocked)return $t;const e=!0===t.isSampled,n=new Ut([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ot:"trigger_activated"===n?Et:"trigger_pending"===n?Ft:!1===t.isSampled?Tt:Et}function Yt(t){if(t.rrwebError)return Dt;if(!t.receivedFlags)return Ft;if(!t.isRecordingEnabled)return Tt;if(t.urlTriggerMatching.urlBlocked)return $t;const e=new Ht([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==Pt,i=q(t.isSampled);return n&&"trigger_pending"===e?Ft:n&&"trigger_disabled"===e||i&&!t.isSampled?Tt:!0===t.isSampled?Ot:Et}function Kt(){const t=[];return function(e,n){if(j(n)||N(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function te(t){const e=JSON.stringify(t,Kt());return e?new Blob([e]).size:0}function ee(t){if(W(t))return 4;if(B(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":{if(N(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=B(i)||W(i)?4:ee(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];B(r)||(i||(n+=1),i=!1,n+=t.length+3+ee(r))}return n}default:return 0}}function ne(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[ne({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),ne({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var ie=Uint8Array,re=Uint16Array,se=Uint32Array,oe=new ie([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]),ae=new ie([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]),le=new ie([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ue=function(t,e){for(var n=new re(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new se(n[30]);for(i=1;30>i;++i)for(var s=n[i];n[i+1]>s;++s)r[s]=s-n[i]<<5|i;return[n,r]},ce=ue(oe,2),he=ce[1];ce[0][28]=258,he[258]=28;for(var de=ue(ae,0)[1],fe=new re(32768),ve=0;32768>ve;++ve){var pe=(43690&ve)>>>1|(21845&ve)<<1;fe[ve]=((65280&(pe=(61680&(pe=(52428&pe)>>>2|(13107&pe)<<2))>>>4|(3855&pe)<<4))>>>8|(255&pe)<<8)>>>1}var me=function(t,e,n){for(var i=t.length,r=0,s=new re(e);i>r;++r)++s[t[r]-1];var o,a=new re(e);for(r=0;e>r;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new re(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],h=a[t[r]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[fe[h]>>>l]=u}else for(o=new re(i),r=0;i>r;++r)o[r]=fe[a[t[r]-1]++]>>>15-t[r];return o},ge=new ie(288);for(ve=0;144>ve;++ve)ge[ve]=8;for(ve=144;256>ve;++ve)ge[ve]=9;for(ve=256;280>ve;++ve)ge[ve]=7;for(ve=280;288>ve;++ve)ge[ve]=8;var ye=new ie(32);for(ve=0;32>ve;++ve)ye[ve]=5;var be=me(ge,9,0),we=me(ye,5,0),_e=function(t){return(t/8|0)+(7&t&&1)},ke=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof re?re:t instanceof se?se:ie)(n-e);return i.set(t.subarray(e,n)),i},Se=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},Ce=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Ie=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,s=n.slice();if(!r)return[new ie(0),0];if(1==r){var o=new ie(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[h].f>n[u].f?u++:h++],l=n[u!=c&&n[h].f>n[u].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;r>i;++i)s[i].s>d&&(d=s[i].s);var f=new re(d+1),v=Me(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(s.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=s[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new ie(f),v]},Me=function(t,e,n){return-1==t.s?Math.max(Me(t.l,e,n+1),Me(t.r,e,n+1)):e[t.s]=n},Re=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new re(++e),i=0,r=t[0],s=1,o=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return[n.subarray(0,i),e]},Ae=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},xe=function(t,e,n){var i=n.length,r=_e(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;i>s;++s)t[r+s+4]=n[s];return 8*(r+4+i)},Te=function(t,e,n,i,r,s,o,a,l,u,c){Se(e,c++,n),++r[256];for(var h=Ie(r,15),d=h[0],f=h[1],v=Ie(s,15),p=v[0],m=v[1],g=Re(d),y=g[0],b=g[1],w=Re(p),_=w[0],k=w[1],S=new re(19),C=0;y.length>C;++C)S[31&y[C]]++;for(C=0;_.length>C;++C)S[31&_[C]]++;for(var I=Ie(S,7),M=I[0],R=I[1],A=19;A>4&&!M[le[A-1]];--A);var x,T,O,E,F=u+5<<3,D=Ae(r,ge)+Ae(s,ye)+o,L=Ae(r,d)+Ae(s,p)+o+14+3*A+Ae(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(D>=F&&L>=F)return xe(e,c,t.subarray(l,l+u));if(Se(e,c,1+(D>L)),c+=2,D>L){x=me(d,f,0),T=d,O=me(p,m,0),E=p;var N=me(M,R,0);for(Se(e,c,b-257),Se(e,c+5,k-1),Se(e,c+10,A-4),c+=14,C=0;A>C;++C)Se(e,c+3*C,M[le[C]]);c+=3*A;for(var P=[y,_],j=0;2>j;++j){var B=P[j];for(C=0;B.length>C;++C)Se(e,c,N[z=31&B[C]]),c+=M[z],z>15&&(Se(e,c,B[C]>>>5&127),c+=B[C]>>>12)}}else x=be,T=ge,O=we,E=ye;for(C=0;a>C;++C)if(i[C]>255){var z;Ce(e,c,x[257+(z=i[C]>>>18&31)]),c+=T[z+257],z>7&&(Se(e,c,i[C]>>>23&31),c+=oe[z]);var W=31&i[C];Ce(e,c,O[W]),c+=E[W],W>3&&(Ce(e,c,i[C]>>>5&8191),c+=ae[W])}else Ce(e,c,x[i[C]]),c+=T[i[C]];return Ce(e,c,x[256]),c+T[256]},Oe=new se([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ee=new ie(0),Fe=function(){for(var t=new se(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),$e=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function De(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=Fe[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,s,o,a,l,u,c=(a=10+((r=e).filename&&r.filename.length+1||0),l=8,function(t,e,n,i,r,s){var o=t.length,a=new ie(i+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>o)for(var c=0;o>=c;c+=65535){var h=c+65535;o>h?u=xe(l,u,t.subarray(c,h)):(l[c]=s,u=xe(l,u,t.subarray(c,o)))}else{for(var d=Oe[e-1],f=d>>>13,v=8191&d,p=(1<<n)-1,m=new re(32768),g=new re(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new se(25e3),k=new re(288),S=new re(32),C=0,I=0,M=(c=0,0),R=0,A=0;o>c;++c){var x=w(c),T=32767&c,O=g[x];if(m[T]=O,g[x]=T,c>=R){var E=o-c;if((C>7e3||M>24576)&&E>423){u=Te(t,l,0,_,k,S,I,M,A,c-A,u),M=C=I=0,A=c;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var D=2,L=0,N=v,P=T-O&32767;if(E>2&&x==w(c-P))for(var j=Math.min(f,E)-1,B=Math.min(32767,c),z=Math.min(258,E);B>=P&&--N&&T!=O;){if(t[c+D]==t[c+D-P]){for(var W=0;z>W&&t[c+W]==t[c+W-P];++W);if(W>D){if(D=W,L=P,W>j)break;var U=Math.min(P,W-2),H=0;for(F=0;U>F;++F){var q=c-P+F+32768&32767,G=q-m[q]+32768&32767;G>H&&(H=G,O=q)}}}P+=(T=O)-(O=m[T])+32768&32767}if(L){_[M++]=268435456|he[D]<<18|de[L];var V=31&he[D],Z=31&de[L];I+=oe[V]+ae[Z],++k[257+V],++S[Z],R=c+D,++C}else _[M++]=t[c],++k[t[c]]}}u=Te(t,l,s,_,k,S,I,M,A,c-A,u),s||(u=xe(l,u,Ee))}return ke(a,0,i+_e(u)+r)}(s=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l,!u)),h=c.length;return function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&$e(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(c,e),$e(c,h-8,n.d()),$e(c,h-4,i),c}function Le(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var Ne=class{constructor(t,e={}){var n,i,r,s;this._rrweb=t,this.it=e,this.rt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{const t=Date.now(),e=t-this.ot;e>0?(this.ct=Math.min(this.dt,this.ct+e/1e3*this.ht),this.ot=t):this.ot=t},this.ft=t=>{if(!this.rt[t]){var e,n;this.rt[t]=!0;const i=this.vt(t);null===(e=(n=this.it).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.yt=t=>{const e=this.vt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.vt=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,n,i,r,s,o,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(s=null===(o=t.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.bt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.yt(t.id);return!this.wt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.it).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const s=this.bt(e);if(0===s&&n!==s)return;if(this.kt)return t;this.ut();const o=ee(t);var a,l;return o>this.ct?(null===(a=(l=this.it).onDroppedOversizedMutation)||void 0===a||a.call(l,o),void this._t()):(this.ct-=o,t)},this._t=()=>{if(this.St)return;const t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null===(t=(e=this.it).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.wt=new Z({bucketSize:null!==(n=this.it.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.ft,$:st}),this.dt=null!==(r=this.it.bytesBucketSize)&&void 0!==r?r:0,this.ht=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.dt)||0>=this.dt,this.ct=this.dt;const o=this.it.resyncIntervalMs;this.xt=H(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.rt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ct=this.dt,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return H(t)&&isFinite(t)&&Math.floor(t)===t}),t&&!B(t.crypto)&&crypto;let Pe=null;const je={Et(){if(!W(Pe))return Pe;if(Pe=!0,B(t))Pe=!1;else try{const t="__support__";je.At(t,"xyz"),'"xyz"'!==je.Ot(t)&&(Pe=!1),je.Lt(t)}catch(t){Pe=!1}return Pe},Pt(t){st.error("sessionStorage error: ",t)},Ot(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){je.Pt(t)}return null},Dt(t){try{return JSON.parse(je.Ot(t))||null}catch(t){}return null},At(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){je.Pt(t)}return!1},Lt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){je.Pt(t)}}};it.DEBUG=!1,it.LIB_VERSION="1.433.2",it.LIB_NAME="web";var Be=it,ze=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ft=t.get_property.bind(t),this.Nt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Nt(p,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Ft(p);return j(n=e)&&z(n.sessionId)&&H(n.size)&&e.sessionId===t?e.size:0;var n}};function We(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<V(100*e,0,100,st)}const Ue=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},He=t=>t.toLowerCase(),qe={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Ue(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Ue(e,t))),icontains:(t,e)=>e.map(He).some(e=>t.map(He).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(He).every(e=>t.map(He).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},Ge=new Set(["is_not","not_icontains","not_regex"]);function Ve(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],s=t.operator||"exact";if(B(r)||W(r))return Ge.has(s);const o=qe[s];return!!o&&!B(t.value)&&!W(t.value)&&o(N(t.value)?t.value.map(String):[String(t.value)],N(r)?r.map(String):[String(r)])})}const Ze=ot("[SessionRecording]");function Je(t,e){return e?t:"!"+t}function Qe(t,e){return t===e||t!=="!"+e&&null}var Xe=class{constructor(t,e,n,i,r,s,o){this._instance=t,this.Y=e,this.tt=n,this.et=i,this.qt=r,this.jt=s,this.Bt=o,this.Ht=null,this.zt=Yt}onRemoteConfig(t){this.Ht=H(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new Ut([this.tt,this.Y]),this.zt=Xt):(this.Ut=new Ht([this.tt,this.Y]),this.zt=Yt),this._instance.register_for_session({[_]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.qt("linked_flag_matched",{flag:t,variant:e}),this.Bt()})}getStatus(t){return this.zt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return H(n)?n:null}checkUrlTriggers(t,e,n,i){this.Y.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.tt.K.length&&U(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,n,e)}catch(t){Ze.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e;const n=this.Ht;var i,r;if(!H(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const s=this._instance.get_property(c),o=this._instance.get_property("$replay_sample_rate"),a=Qe(s,t),l=H(o)&&o!==n,u=B(o)&&s===t,h=l||u||!q(a),d=h?We(t,n):a;h&&(d?this.qt("sampled"):Ze.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Je(t,d),$replay_sample_rate:W(o)&&s===t?null:n})}ensureSamplingDecision(t){if(!H(this.Ht))return;const e=this._instance.get_property(c);q(Qe(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Ut)||void 0===e?void 0:e.triggerStatus(t))===Nt}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Nt).map(({label:t})=>t)}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Ye=class{constructor(t,e,n,i,r){this._instance=t,this.Y=e,this.qt=n,this.Vt=i,this.Bt=r,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[_]:"v2_trigger_groups",[k]:t.triggerGroups.length}),this.Y.onConfig(t)):Ze.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Dt;if(!t.receivedFlags)return Ft;if(!t.isRecordingEnabled)return Tt;if(t.urlTriggerMatching.urlBlocked)return $t;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return Tt;let i=!1,r=!1;for(const s of e){const e=s.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=s.group.id,e=n.get(t);B(e)?st.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?Ot:i?Ft:Tt}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Zt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;H(t)&&(W(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.Y.checkUrlBlocklist(e,n);for(const i of this.Zt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.Bt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Wt=t(t=>{var n;if(this.Qt)return Ze.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Wt)||void 0===n||n.call(this),void(this.Wt=void 0);try{for(const n of this.Zt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),s=this._instance.get_property(m);r.some(e=>!e.properties||0===e.properties.length||Ve(e.properties,t.properties,s))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.Bt(i))},e)}catch(t){Ze.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(const n of this.Zt){var e;const i=n.group,r=i.id,s=i.sampleRate,o="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(o);let l=null,u=!1,c=!1,h=!1;if(j(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=H(n)&&n!==s,l=e===t&&H(n)&&n===s&&q(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,h=a===t;const d=u||c||h||!q(l),f=d?We(t+r,s):l;d&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:s,isSampled:f}),this.Gt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[o]:{sessionId:t,sampleRate:s,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Zt){var i,r,s;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(s=this._instance.persistence)||void 0===s||s.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Zt){const i=n.group,r=i.id,s="trigger_activated"===n.triggerStatus(t),o=!0===this.Gt.get(r);s&&e.push({id:r,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({[b]:e})}hasPendingTriggers(t){for(const e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Ve(n,e,this._instance.get_property(m))}Jt(t){this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();for(const e of t){const t=new Qt(this._instance,e,(t,n)=>{this.qt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.Bt()});this.Zt.push(t)}}};const Ke=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],tn=1e5,en=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,nn=[],rn=()=>!1,sn="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),on="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),an="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),ln="Accommodation AdministrativeArea Country Place State".split(" "),un={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:on,publisher:an},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:nn},Offer:{seller:an},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:an,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:an,areaServed:ln,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:nn}},cn=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),un.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),un.Event],[an,un.Organization],[ln,un.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),un.Product]];function hn(t,e){return D.call(t,e)?t[e]:void 0}function dn(t){const e=typeof t;return W(t)||"string"===e||"number"===e||"boolean"===e}function fn(t,e){return e&&function(t){return z(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function vn(t,e){return N(t)&&t.every(dn)?t.map(t=>fn(t,e)).filter(t=>!B(t)):dn(t)?fn(t,e):void 0}function pn(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function mn(t){if(D.call(un,t))return un[t];for(const[e,n]of cn)if(e.includes(t))return n}function gn(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function yn(t,e,n,i){if(N(t)){const r=t.map(t=>yn(t,e,n,i)).filter(t=>!B(t));return r.length?r:void 0}return bn(t,e,n,i)||void 0}function bn(t,e,n,i){if(!j(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=hn(t,"@type"),s=function(t){const e=new Set,n="string"==typeof t?[t]:N(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&en.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),o=s.filter(t=>!!mn(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of sn){const o="@type"===i?s.length?"string"==typeof r?s[0]:s:void 0:"@id"===i?pn(hn(t,i),e):vn(hn(t,i),n.maskUrl);B(o)||gn(a,i,o)}for(const i of o){const r=mn(i);for(const i of Object.keys(r)){const s=hn(t,i),o=r[i];if(!0===o){const t=vn(s,n.maskUrl);B(t)||gn(a,i,t)}else{const t=yn(s,e,n,o);B(t)||gn(a,i,t)}}}const l=yn(hn(t,"@graph"),e,n);return B(l)||gn(a,"@graph",l),Object.keys(a).length?a:null}function wn(t,e,n){if(!j(t))return null;const i=hn(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=bn(t,e,n);return r?E({"@context":"https://schema.org"},r):null}function _n(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function kn(t,e,n){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!n&&t.matches(n)}catch(t){return!1}}function Sn(t,e,n){for(let i=t;i;){if(kn(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function Cn(t){return _n(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(_n)}function In(t){return B(t)?void 0:Math.round(t)}function Mn(t){return j(t)?t.network_timing:t}const Rn=ot("[SessionRecording]"),An=[1,2,3,4,5,6,7,12],xn=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Tn(){var t;return null==s||null===(t=s.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function On(){var t;return null===(t=Tn())||void 0===t?void 0:t.record}function En(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Kt())}}function Fn(t){return Le(De(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new ie(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},s=0;e>s;++s){if(i+5>n.length){var o=new ie(i+8+(e-s<<1));o.set(n),n=o}var a=t.charCodeAt(s);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++s))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return ke(n,0,i)}(En(t))),!0)}function $n(t){return Dn.apply(this,arguments)}function Dn(){return Dn=A(function*(t){const e=yield function(t){return et.apply(this,arguments)}(En(t),Be.DEBUG,{rethrow:!0});return Le(new Uint8Array(yield e.arrayBuffer()),!0)}),Dn.apply(this,arguments)}let Ln,Nn;const Pn="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let jn=!1;function Bn(t){var e;return N(t)&&0===t.length?(Ln=null!==(e=Ln)&&void 0!==e?e:Fn([]),Ln):Fn(t)}function zn(t){return Wn.apply(this,arguments)}function Wn(){return(Wn=A(function*(t){var e;return N(t)&&0===t.length?Ln||(Nn=null!==(e=Nn)&&void 0!==e?e:$n([]).then(t=>(Ln=t,t)).catch(t=>{throw Ln=void 0,Nn=void 0,t}),Nn):$n(t)})).apply(this,arguments)}function Un(t){return Pn&&!jn&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Hn(t){return{event:t,size:ee(t)}}function qn(t,e){return E(E({},t),{},{data:e,cv:"2024-10"})}function Gn(t,e){return E(E({},t),{},{cv:"2024-10",data:E(E({},t.data),e)})}function Vn(t){try{if(2===t.type)return Hn(qn(t,Fn(t.data)));if(3===t.type&&0===t.data.source)return Hn(Gn(t,{texts:Bn(t.data.texts),attributes:Bn(t.data.attributes),removes:Bn(t.data.removes),adds:Bn(t.data.adds)}));if(3===t.type&&8===t.data.source)return Hn(Gn(t,{adds:t.data.adds?Fn(t.data.adds):void 0,removes:t.data.removes?Fn(t.data.removes):void 0}))}catch(t){Rn.error("could not compress event - will use uncompressed event",t)}return{event:t,size:te(t)}}function Zn(){return(Zn=A(function*(t){try{if(2===t.type)return Hn(qn(t,yield $n(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([zn(t.data.texts),zn(t.data.attributes),zn(t.data.removes),zn(t.data.adds)]);return Hn(Gn(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?$n(t.data.adds):void 0,t.data.removes?$n(t.data.removes):void 0]);return Hn(Gn(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Q})(e)&&(jn=!0),Rn.error("could not compress event asynchronously - trying synchronous compression",e),Vn(t)}return{event:t,size:te(t)}})).apply(this,arguments)}function Jn(t,e){return 5===t.type&&t.data.tag===e}function Qn(t){return Jn(t,"sessionIdle")}function Xn(t){return Jn(t,"$session_ending")}function Yn(t){return Jn(t,"$session_starting")}var Kn=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return Qe(this._instance.get_property(c),this.sessionId)}get Ht(){var t;const e=null===(t=this.ne)||void 0===t?void 0:t.sampleRate;return H(e)?e:null}get ie(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.se=void 0,this.ae=!1,this.le=Date.now(),this.ue=!1,this.ce=[],this.de="unknown",this.he=0,this.fe=0,this.ve=0,this.pe=0,this.me=!1,this.ge=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Ie=!1,this.Te=[],this.Re=void 0,this.$e=void 0,this.Ee=!1,this.Ae=[],this.Oe=0,this.Le=0,this.Pe=!1,this.De=void 0,this.Wt=void 0,this.Fe=void 0,this.Ne=void 0,this.qe=void 0,this.je=(t,e,n)=>{var i,r,s,o;if(!n)return;if(t===this.Xt&&e===this.Be)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Be;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le,flushed_size:null===(c=this.He)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),this._e=!1,null===(r=Tn())||void 0===r||null===(s=r.resetMaxDepthState)||void 0===s||s.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.ze(),!(!1===this.de&&this.isStarted||this.Xt===t&&this.Be===e)){const e=this.Xt!==t&&!1!==this.de;this.de="unknown",this.Ue(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le}),null===(o=this.re)||void 0===o||o.makeSamplingDecisions(t)},this.We=!1,this.Ve=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return H(n)&&H(i)?i-n:null},this.Ge=()=>{var t,e;const n=this.ie;if(!H(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.Qe;return H(t)&&t>=0&&n>t}if(this.Ve())return!1;const i=this.Ze();return!!W(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Je=()=>{"buffering"!==this.status?(this.me&&this.ge&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tn(!0)):this.en()},this.nn=()=>{this.Je()},this.rn=()=>{this.Vt("browser offline",{})},this.sn=()=>{this.Vt("browser online",{})},this.an=()=>{(null==n?void 0:n.visibilityState)&&("visible"===n.visibilityState&&(this.Ke=!0),this.Vt("window "+n.visibilityState,{}))},this.Ke=null==e||e;const{sessionId:i,windowId:r,sessionStartTimestamp:s}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=i,this.Be=r,this._sessionStartTimestamp=s,this.et=new Zt(this._instance),this.Y=new Vt(this._instance),this.tt=new Jt(this._instance),this.Rt=this.en(),this.ln="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.Yt.sessionTimeoutMs>this.te||Rn.warn(`session_idle_threshold_ms (${this.te}) is greater than the session timeout (${this.Yt.sessionTimeoutMs}). Session will never be detected as idle`),this.He=new ze(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get un(){var t,e,n,i,r,s,o,a,l;const u=null===(t=this.ne)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},h=null!==(s=null==c?void 0:c.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,d=null!==(o=null==c?void 0:c.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return B(h)&&B(d)&&B(f)&&B(v)?void 0:{maskAllInputs:null==h||h,maskTextSelector:d,blockSelector:f,maskAllElementAttributes:v}}cn(){var t;if(this.xe)return;const e=null===(t=this.ne)||void 0===t?void 0:t.masking;if(U(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!B(i)&&i!==r});0!==i.length&&(this.xe=!0,Rn.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get dn(){var t;return V(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,ot("canvas recording resolution scale"),1)}get hn(){var t,e,n,i,r,s,o;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ne)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let h=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof h){const t=parseFloat(h);h=isNaN(t)?.4:t}return{enabled:u,fps:V(c,0,12,ot("canvas recording fps"),4),quality:V(h,0,1,ot("canvas recording quality"),.4)}}get fn(){var t;const e=!!(null===(t=this.ne)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get vn(){var t,e,n;const i=null===(t=this.ne)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},s=(null==r?void 0:r.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==i?void 0:i.recordBody),a=Mn(this._instance.config.capture_performance),l=Mn(null==i?void 0:i.capturePerformance),u=!!(q(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}pn(){var t,e;const n=[],r=null===(t=s.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this.fn&&n.push(r());const o=null===(e=s.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.vn&&P(o))if(!ut.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){const t=P(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(o(((t,e,n)=>{const i={payloadSizeLimitBytes:_t.payloadSizeLimitBytes,performanceEntryTypeToObserve:[..._t.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],..._t.payloadHostDenyList]},r=!1!==t.session_recording.recordHeaders&&e.recordHeaders,s=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,a=(t=>{const e=wt(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=Rt(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=Rt(t.responseBody,t.responseHeaders,e,"Response")),t)})(i),l=e=>{return a(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=ct(t.name);let s=0===e.indexOf("http")?null===(i=ct(e))||void 0===i?void 0:i.pathname:e;"/"===s&&(s="");const o=null==r?void 0:r.pathname.replace(s||"","");return r&&o&&Mt.some(t=>0===o.indexOf(t))?void 0:t})((It((i=e).requestHeaders),It(i.responseHeaders),i),t.api_host,n));var i},u=P(t.session_recording.maskNetworkRequestFn);return u&&P(t.session_recording.maskCapturedNetworkRequestFn)&&st.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});return!n&&e.isInitial?n:E(E({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=P(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=l(e);if(!r)return;const s=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,o=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return U(o)&&s?(xt.add(s),s):null!=o?o:void 0}:t=>function(t){if(!B(t))return t.requestBody=At(t.requestBody,"Request"),t.responseBody=At(t.responseBody,"Response"),t}(l(t)),E(E(E({},_t),i),{},{recordHeaders:r,recordBody:s,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vn,t)))}else Rn.info("NetworkCapture not started because we are on localhost.");return n}mn(t){return this._instance.config.disable_capture_url_hashes?J(t):t}gn(t,e=!1){const n=e?J(t):this.mn(t),i=this._instance.config.mask_personal_data_properties?[...Ke,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yn(function(t,e){if(!t||!e||!e.length)return t;const n=t.split("#"),i=n[1],r=(n[0]||"").split("?"),s=r[1],o=r[0],a=(s||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("=");N(n)&&(e.includes(n[0])?l.push(n[0]+"=<masked>"):l.push(a[t]))}let u=o;return null!=s&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}yn(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}bn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.ce.length?this.ce.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Rn.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.bn(xn(()=>On().addCustomEvent(t,e)))}wn(){var t;return this.ae&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.de}kn(t){if(!this.wn())return!1;try{const e=On();return!!e&&(e.addCustomEvent("$json_ld",t),this.wn())}catch(t){return!1}}_n(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.Sn)||void 0===e?void 0:e.scan(t)})}xn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.gn(e.origin+e.pathname+e.search);this.Cn!==n&&(this.Cn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Mn(){if(this.ce.length){const t=[...this.ce];this.ce=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.bn(t)})}}jt(){return this.bn(xn(()=>On().takeFullSnapshot()))}get In(){var t,e,n;if((null===(t=this.re)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return H(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Tn(){if(this.Rn&&clearInterval(this.Rn),!0===this.de)return;const t=this.In;t&&(this.Rn=setInterval(()=>{this.jt()},t))}Bt(t){"event"===t&&this.$n(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Tn()}En(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null===(t=this.Sn)||void 0===t||t.scan(),clearInterval(this.Rn),Rn.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}An(){var t;this.Y.urlBlocked&&(null===(t=this.Sn)||void 0===t||t.scan(),this.Y.urlBlocked=!1,this.jt(),this._n(),this.Tn(),this.Vt("recording resumed",{reason:"left blocked url"}),Rn.info("recording resumed"))}On(t,e){var n;if("event"===t&&this.$n(),!this.ue&&(null===(n=this.re)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ue=!0;try{var i,r;const n="url"===t?h:d;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.re)||void 0===r||r.updateActiveTriggers(this.sessionId),this.Bt(),this.tn(),this.qt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ue=!1}}}get isStarted(){return!!this.se}get ne(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=j(t)?t:JSON.parse(t)}catch(t){return void Rn.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Rn.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Ln(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var i,r;const s=this.ne;if(!s)return void Rn.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.de&&!this.be;this.Xe(t?"no_interaction_since_recording_started":void 0),this.be=!1,this.ge=t,this.ye=!1}this.Pe&&(this.Pn(),this.en());const{sessionId:c,windowId:h,sessionStartTimestamp:d}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=c,this.Be=h,this._sessionStartTimestamp=d,this.Dn(),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),(null==s?void 0:s.endpoint)&&(this.oe=null==s?void 0:s.endpoint),this.re=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Ye(this._instance,this.Y,this.qt.bind(this),this.Vt.bind(this),this.Bt.bind(this)):new Xe(this._instance,this.Y,this.tt,this.et,this.qt.bind(this),this.jt.bind(this),this.Bt.bind(this)),this.re.onRemoteConfig(s),null===(r=this.Wt)||void 0===r||r.call(this),this.Wt=this.re.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.On(t,e)),this.Ln(o,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(o)}),this.Ln(a,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(a)}),this.Ln(u,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Ln(l,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.re.makeSamplingDecisions(this.sessionId),this.Fn(),this.we||(lt(t,"beforeunload",this.Je),lt(t,"pagehide",this.nn),lt(t,"offline",this.rn),lt(t,"online",this.sn),lt(n,"visibilitychange",this.an),!this.Fe&&P(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.je)),!this.Ne&&P(this.Yt.on)?this.Ne=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.de="unknown",this.stop(),this.qe=this.Yt.onSessionId((t,e,n)=>{var i;null===(i=this.qe)||void 0===i||i.call(this),this.qe=void 0,this.je(t,e,n)})}):P(this.Yt.on)||Rn.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),U(this.De)&&(this.De=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.gn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Rn.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.qt(e||"recording_initialized"))}Nn(){var e,i,r,s,o,a;null==t||t.removeEventListener("beforeunload",this.Je),null==t||t.removeEventListener("pagehide",this.nn),null==t||t.removeEventListener("offline",this.rn),null==t||t.removeEventListener("online",this.sn),null==n||n.removeEventListener("visibilitychange",this.an),clearInterval(this.Rn),this.qn(),null===(e=this.De)||void 0===e||e.call(this),this.De=void 0,null===(i=this.Wt)||void 0===i||i.call(this),this.Wt=void 0,null===(r=this.Fe)||void 0===r||r.call(this),this.Fe=void 0,null===(s=this.Ne)||void 0===s||s.call(this),this.Ne=void 0,null===(o=this.qe)||void 0===o||o.call(this),this.qe=void 0,null===(a=this.re)||void 0===a||a.stop(),this.jn(),this.Pn()}Pn(){this.Le+=1,this.Ae=[],this.Oe=0,this.Bn=void 0,this.Pe=!1}jn(){var t,e;null===(t=this.Hn)||void 0===t||t.stop(),this.ce=[],null===(e=this.Sn)||void 0===e||e.stop(),this.Sn=void 0,this.ae=!1;try{var n;null===(n=this.se)||void 0===n||n.call(this)}catch(t){Rn.warn("could not stop rrweb",t)}this.se=void 0}zn(){if(!this.Bn||0===this.Oe)return!1;if(this.Pe)return!0;this.Pe=!0,this.Un=void 0;const t=this.Le;return this.qn(),this.jn(),this.Bn.catch(()=>{}).then(()=>{t===this.Le&&(this.Pe=!1,this.tn(),this.en(),this.Wn(),this.Nn(),Rn.info("stopped"))}).catch(()=>{this.Pe=!1,this.Wn(),this.Nn(),Rn.info("stopped")}),!0}stop(){if(this.jn(),this.We)this.Ye();else if(this.zn())return;this.tn(),this.en(),this.Wn(),this.Nn(),Rn.info("stopped")}Wn(){this.Xe(void 0,{preserveLogDedup:this.We}),this.ge=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tn())}Ue(t){this.We=!0,this.le=Date.now();try{var e,n;this.stop(),this.Vn=void 0,this.Zn=void 0,this.fe=0,this.ve=0,this.pe=0,null===(e=Tn())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.ge=!1}Xe(t,{preserveLogDedup:e=!1}={}){if(this.me=!B(t),this.Un=t,B(t))return void(e||(this.Gn=void 0));if(this.We)return;const n=`${this.sessionId}:${t}`;n!==this.Gn&&(this.Gn=n,Rn.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}$n(){this.isStarted||(this.be=!0),this.me&&(this.Xe(void 0),this.ge=!1,this.ye&&(this.ye=!1,this.jt()),this.Qn())}discard({discardProducerEvents:t=!1}={}){this.me=!0,t&&(this.en(),this.jn()),this.en(),this.Nn(),this.en(),this.Wn(),Rn.info("discarded")}Jn(t,e,n,i,r){const s={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.Kn(t,i),this.Xn(s)):this.en()}Yn(){try{this.ti()}catch(t){this.Se||(this.Se=!0,Rn.error("could not track full snapshot cost",t))}}ti(){var t,e;const n=null===(t=Tn())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Zn&&(this.Zn=n,this.Vn&&this.Vn.durationMs>=n.durationMs||(this.Vn=n),500>n.durationMs||Rn.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}Kn(t,e){2!==t.type?3===t.type&&(B(this.Re)||this.Re===e||this.$e===e||(this.$e=e,Rn.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.jt())):this.Re=e}ei(t){t.counted&&t.generation===this.Le&&(this.Oe=Math.max(0,this.Oe-1)),t.counted=!1,this.Ae=this.Ae.filter(e=>e!==t)}ni(t,e,n){t.processed||t.generation!==this.Le||(t.processed=!0,this.Jn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ii(t){try{let e=t.event,n=te(t.event);if(t.compressionEnabled)try{({event:e,size:n}=Vn(t.event))}catch(t){Rn.error("could not process queued compression event - will use uncompressed event",t)}try{this.ni(t,e,n)}catch(t){Rn.error("could not capture queued compression event",t)}}finally{this.ei(t)}}Ye(){[...this.Ae].forEach(t=>{this.ii(t)})}ri(t,e,n,i){var r=this;const s={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Le,processed:!1,counted:!0};this.Ae.push(s),this.Oe+=1;const o=(a=A(function*(){try{if(s.processed)return;let n,i;try{const r=e?Un(t)?yield function(t){return Zn.apply(this,arguments)}(t):Vn(t):{event:t,size:te(t)};n=r.event,i=r.size}catch(e){Rn.error("could not process queued compression event - will use uncompressed event",e),n=t,i=te(t)}r.ni(s,n,i)}finally{r.ei(s)}}),function(){return a.apply(this,arguments)});var a;this.Bn=this.Bn?this.Bn.catch(()=>{}).then(o):o()}onRRwebEmit(e){var n,i,r,s,o,a,l,u,c,h,d,f,v,p;if(!this._instance.sessionManager)return;if(this.Mn(),!e||!j(e))return;if(4===e.type){const t=this.gn(e.data.href);if(this.Cn=t,!t)return;e.data.href=t}else this.xn();if(null===(n=this.re)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.En(),()=>this.An(),(t,e)=>this.On(t,e)),this.Y.urlBlocked&&(5!==(h=e).type||"recording paused"!==h.data.tag))return;2===e.type&&((null===(d=Tn())||void 0===d||null===(f=d.wasMaxDepthReached)||void 0===f?void 0:f.call(d))&&(this._e=!0),this.Yn(),Promise.resolve().then(()=>this.Yn()),this.Tn(),null===(v=this.Hn)||void 0===v||v.reset(),null===(p=this._instance.persistence)||void 0===p||p.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const m=2===e.type&&(null===(i=this.re)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));m&&this.oi();const g=this.Hn?this.Hn.throttleMutations(e):e;if(!g)return void(!0===this.de&&this.he++);const y=function(t){const e=t;if(e&&j(e)&&6===e.type&&j(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(g),b=function(t){return Xn(t)?t.data.payload:null}(y),w=function(t){return Yn(t)?t.data.payload:null}(y),_=function(t){return Qn(t)?t.data.payload:null}(y);b||w?(null==b?void 0:b.lastActivityTimestamp)&&(y.timestamp=b.lastActivityTimestamp):(null==_?void 0:_.sessionId)||this.si(y),2===e.type&&(this.Te.push([this.Xt,e.timestamp]),this.Te.length>6&&(this.Te=this.Te.slice(-6)));const k=null!==(r=null!==(s=null!==(o=null==b?void 0:b.currentSessionId)&&void 0!==o?o:null==w?void 0:w.nextSessionId)&&void 0!==s?s:null==_?void 0:_.sessionId)&&void 0!==r?r:this.Xt,S=null!==(a=null!==(l=null!==(u=null==b?void 0:b.currentWindowId)&&void 0!==u?u:null==w?void 0:w.nextWindowId)&&void 0!==l?l:null==_?void 0:_.windowId)&&void 0!==a?a:this.Be;if(!0===this.de&&!function(t){return Qn(t)||Xn(t)||Yn(t)}(y))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(y)&&this.he++);2===y.type&&(this.he=0),_&&(y.timestamp=_.lastActivityTimestamp+_.threshold);const C=this.ae;this.ae=!0,m?this._n(!0):C||this._n();const I=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===y.type&&"$json_ld"===y.data.tag){let e;try{e=t?this.gn(t.location.href):void 0}catch(t){}y.data.href=e}if(this.Oe>0||I&&Un(y))return void this.ri(y,I,k,S);const{event:M,size:R}=I?Vn(y):{event:y,size:te(y)};this.Jn(y,M,R,k,S)}get status(){return this.re?this.re.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.ne}):Tt}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.jt(),this.$n(),this.qt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.jt(),this.$n(),this.qt("sampling_overridden")}overrideTrigger(t){this.On(t),this.$n()}ai(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.gn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}qn(){this.li&&(clearTimeout(this.li),this.li=void 0)}Qn(){this.li||(this.li=setTimeout(()=>{this.tn()},2e3))}ui(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Xn(t)&&!Yn(t))}ci(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return B(this.hi)||this._instance.register_for_session({[w]:[]}),void(this.hi=void 0);const e=this.ci();if(0===e.length)return B(this.hi)||this._instance.register_for_session({[w]:[]}),void(this.hi=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.hi&&(this.hi=i,this._instance.register_for_session({[w]:e}),Rn.info(`buffering: ${n}`))}fi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.pi)&&je.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.gi&&943718.4>=this.Rt.size&&this.fi()&&(this.gi=this.Rt.size,je.At(this.ln,this.Rt))}Dn(){if(this.Ee||!this.fi())return;this.Ee=!0;const t=je.Dt(this.ln);je.Lt(this.ln),j(t)&&N(t.data)&&0!==t.data.length&&N(t.sizes)&&t.sizes.length===t.data.length&&H(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Be&&(this.Rt.data.length>0||(this.Rt=t))}tn(t=!1){var e;if(this.qn(),this.me)return this.Rt;if(this.ui())return this.Rt.size>943718.4?this.en():(t&&this.mi(),this.Rt);const n=this.Rt;null===(e=this.re)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Ge(),r=this.status;if(this.di(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.mi(),this.Qn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var s;const t=this.ai();ne(n).forEach(e=>{try{var n;null===(n=this.He)||void 0===n||n.trackSize(e.sessionId,e.size),this.yi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Be.LIB_NAME,$lib_version:Be.LIB_VERSION,$snapshot_host:t})}catch(t){Rn.warn("could not capture snapshot chunk - skipping it",t)}}),B(this.gi)||(je.Lt(this.ln),this.gi=void 0),null===(s=this.re)||void 0===s||s.onFlushComplete()}return this.en()}Xn(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.de&&!this.me&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.tn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.en()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.me&&(this.ye||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.ye||(this.ye=!0,this.Rt=this.en()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.de||this.me||this.Qn())}yi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}oi(){if(!this.Rt||0===this.Rt.data.length)return this.en();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.en():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}en(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Be},this.Rt}qt(t,e){this._instance.register_for_session({[M]:t}),Rn.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",E({reason:t},e))}bi(t){var e;return 3===t.type&&-1!==An.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}si(t){const e=this.bi(t);e||!0===this.de||t.timestamp-this.le>this.te&&(this.de=!0,clearInterval(this.Rn),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.le,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Be}),this.tn());const{windowId:n,sessionId:i}=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.le=t.timestamp,this.de)){const e="unknown"===this.de;this.de=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const s=this.Xt!==i,o=this.Be!==n;if(this.Be=n,this.Xt=i,s||o){const t=s&&!1!==this.de;t&&(this.de="unknown"),this.Ue(t)}else if(e&&this.$n(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.re)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.he>0&&t&&this.jt(),this._n(),this.Tn()}}ze(){var t;null===(t=this.re)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,n,i,r,s,o,a,l,u,c,h;const d=null===(t=Tn())||void 0===t||null===(e=t.getDeferredStylesheetStats)||void 0===e?void 0:e.call(t);return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Un,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(n=this.He)||void 0===n?void 0:n.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Te,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:In(null===(i=this.Vn)||void 0===i?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:In(null===(r=this.Vn)||void 0===r?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null===(s=this.Vn)||void 0===s?void 0:s.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null===(o=this.Vn)||void 0===o?void 0:o.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null===(a=this.Vn)||void 0===a?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==d?void 0:d.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==d?void 0:d.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==d?void 0:d.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:In(null==d?void 0:d.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:In(null==d?void 0:d.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:In(null===(l=Tn())||void 0===l||null===(u=l.getMutationCost)||void 0===u||null===(u=u.call(l))||void 0===u?void 0:u.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null===(c=Tn())||void 0===c||null===(h=c.getDiscardedDurationSamples)||void 0===h?void 0:h.call(c),$sdk_debug_replay_throttled_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[C]:!!this.se,[I]:this.ke}}Fn(){var e;if(this.se)return;this.ke=!0;const i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},r=this._instance.config.session_recording;for(const[t,e]of Object.entries(r||{}))if(t in i)if("maskInputOptions"===t)i.maskInputOptions=E({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},n={};B(t.mousemove)||(n.mousemove=t.mousemove),B(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),i.sampling=n}else i[t]=e;var s,o,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==i.slimDOMOptions&&"all"!==i.slimDOMOptions&&(i.slimDOMOptions=E(E({},i.slimDOMOptions),{},{script:!0})),this.hn&&this.hn.enabled&&(i.recordCanvas=!0,i.sampling=E(E({},i.sampling),{},{canvas:this.hn.fps}),i.dataURLOptions={type:"image/webp",quality:this.hn.quality},i.canvasResolutionScale=this.dn,i.canvasMasking={configured:()=>{var t;return P(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(P(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Me||(this.Me=!0,Rn.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.un&&(i.maskAllInputs=null===(s=this.un.maskAllInputs)||void 0===s||s,i.maskTextSelector=null!==(o=this.un.maskTextSelector)&&void 0!==o?o:void 0,i.blockSelector=null!==(a=this.un.blockSelector)&&void 0!==a?a:void 0,i.maskAllElementAttributes=null!==(l=this.un.maskAllElementAttributes)&&void 0!==l&&l),i.maskAllElementAttributes&&i.maskAttributeFn&&(i.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Rn.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.cn();const u=On();if(!u)return void Rn.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");this.Hn=null!==(e=this.Hn)&&void 0!==e?e:new Ne(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;Rn.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.fe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.In,onDroppedOversizedMutation:t=>{0===this.ve&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.ve+=1,this.pe+=t},requestFullSnapshot:()=>this.jt()});const c=this.pn();if(this.se=u(E({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Ie||(this.Ie=!0,Rn.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},i)),!this.se)return this.we=!0,void Rn.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==r?void 0:r.captureJsonLd)&&n&&(null==t?void 0:t.MutationObserver)&&!this.Sn&&(this.Sn=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let s=tn;const o=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?rn:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Sn(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Sn(t,e.blockClass,e.blockSelector)||Sn(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=rn,n){if(!t||t.length>tn)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},s=N(i)?i.map(t=>wn(t,e,r)):wn(i,e,r);if(r.exceeded||W(s)||N(s)&&(!s.length||s.some(W)))return null;const o=JSON.stringify(s);return o.length>2e4?null:[s,o]}catch(t){return null}}(e.text,o,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(W(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>s)return void(s=0);n.emit(u)&&(i.set(e,c),s-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!s||!1===r())return;const e=t=>{for(const e of Cn(t))a(e)};for(const n of t)if("childList"===n.type)_n(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&_n(t)&&a(t)}else"attributes"===n.type&&_n(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){s&&!1!==r()&&Cn(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(n,t.MutationObserver,{maskUrl:t=>this.gn(t),attributeFilter:i.attributeFilter,blockClass:i.blockClass,blockSelector:i.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:i.maskAllElementAttributes,maskAttributeFn:i.maskAttributeFn,maskTextClass:i.maskTextClass,maskTextSelector:i.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wn()},emit:t=>this.kn(t)}),this.Y.isCurrentUrlBlocked()&&this.Sn.scan()),this.le=Date.now(),this.de=q(this.de)?this.de:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ne),this.Vt("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}tryAddCustomEvent(t,e){return this.Vt(t,e)}};const ti=["type"];var ei=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),ni=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),ii=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),ri=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),si=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),oi=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),ai=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function li(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var ui={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ci={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},hi={};function di(t){if(hi[t])return hi[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in ui?ui[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in ci?ci[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&o)return hi[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(li(u=navigator.userAgent,"AppleWebKit")&&!li(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),hi[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var fi=Object.create(null);function vi(t,e,n){var i;const r=fi[t],s=r[n];if(s)return s.call(e);const o=di(t),a=null===(i=Object.getOwnPropertyDescriptor(o,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}fi.Node=Object.create(null),fi.ShadowRoot=Object.create(null),fi.MutationObserver=Object.create(null),fi.Element=Object.create(null);var pi,mi={};function gi(t,e,n){const i=`${t}.${String(n)}`;if(mi[i])return mi[i].bind(e);const r=di(t)[n];return"function"!=typeof r?e[n]:(mi[i]=r,r.bind(e))}function yi(){return di("MutationObserver").constructor}function bi(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},s=n(function(...t){return r.next.apply(this,t)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],o=n(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=n(i)}}}catch(t){return()=>{}}}var wi={childNodes:t=>vi("Node",t,"childNodes"),parentNode:t=>vi("Node",t,"parentNode"),parentElement:t=>vi("Node",t,"parentElement"),textContent:t=>vi("Node",t,"textContent"),isConnected(t){if(void 0===pi){var e;const t=null===(e=Object.getOwnPropertyDescriptor(di("Node"),"isConnected"))||void 0===e?void 0:e.get;pi=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==pi?void 0:pi.call(t)},contains:(t,e)=>gi("Node",t,"contains")(e),getRootNode:t=>gi("Node",t,"getRootNode")(),host:t=>t&&"host"in t?vi("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?vi("Element",t,"shadowRoot"):null,querySelector:(t,e)=>gi("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>gi("Element",t,"querySelectorAll")(e),mutationObserver:yi,patch:bi};function _i(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var ki=0;function Si(){ki+=1}function Ci(){return ki}function Ii(t,e){return(e!==ki||t>6e4)&&!0}var Mi=0,Ri=0,Ai=0,xi={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ti=null,Oi=null,Ei=[],Fi=0,$i=0,Di={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Ni(t){var e;(Mi+=1)>1||(xi={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ei=[],Fi=0,Oi=(e=t)&&e>0?e:null,Ri=_i(),Ai=ki)}function Pi(){return 0===Mi?Ti||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Mi-=1)>0?xi:(xi.durationMs=_i()-Ri,xi.deferredStylesheetCount=Fi,Li.deferredCount+=Fi,Oi=null,Ii(xi.durationMs,Ai)?xi:Ti=xi)}function ji(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const s=t[r];try{const t=s.cssRules;if(t&&t.length)i+=ji(t,e,n+1);else if(e&&s.styleSheet){const t=s.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=ji(r,e,n+1))}}}catch(t){}}return i}function Bi(t){if(0===Mi)return;const e=ji(t,null,0);xi.cssRuleCount+=e,$i>0&&(xi.nonDeferrableCssRuleCount+=e)}function zi(t){$i+=1;try{return t()}finally{$i-=1}}function Wi(t){Mi>0&&(xi.stylesheetMs+=t)}function Ui(t){if(0===Mi||null===Oi)return!1;const e=xi.cssRuleCount-xi.nonDeferrableCssRuleCount;return e>=Oi||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),ji(e,n,0)}catch(t){return 0}}(t)>Oi}function Hi(){const t=Ei;return Ei=[],t}function qi(){Li.failedCount+=1}function Gi(t){t>0&&(Li.abandonedCount+=t)}function Vi(t){return Vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(t)}function Zi(t,e,n){return(e=function(t){var e=function(t){if("object"!=Vi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ji(t){return t.nodeType===t.ELEMENT_NODE}function Qi(t){const e=t&&"host"in t&&"mode"in t&&wi.host(t)||null;return Boolean(e&&"shadowRoot"in e&&wi.shadowRoot(e)===t)}function Xi(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Yi(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Ki(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var tr=0;function er(t){const e=0===tr,n=e?_i():0;tr+=1;try{const e=t.rules||t.cssRules;if(!e)return null;Bi(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Yi(Array.from(e,t=>nr(t,n)).join(""))}catch(t){return null}finally{tr-=1,e&&Wi(_i()-n)}}function nr(t,e){if(rr(t)){let e;try{e=er(t.styleSheet)||Ki(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return wr(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return sr(t)&&t.selectorText.includes(":")&&(n=ir(n)),e?wr(n,e):n}}function ir(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function rr(t){return"styleSheet"in t}function sr(t){return"selectorText"in t}var or=/^-?[A-Za-z_][\w-]*$/,ar=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function lr(t){const e=[];let n=!1,i=null;const r=new Map;function s(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);o(e[e.length-1],r.importRule,t)}function o(t,e,n){try{let r;try{r=n||Ki(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=wr(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&rr(n)){const i=r.get(n);return null===i?(t.parts.push(n.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:n}):void o(t,n,null)}if(function(t,n){try{const i=function(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(sr(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!or.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?or.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":ar.test(e.name)?`@layer ${e.name} {`:null:null}(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?wr(i,r):i,fixColons:"sheet"===n.kind&&sr(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&sr(n)&&n.selectorText.includes(":")&&(i=ir(i)),t.parts.push(t.sheetHref?wr(i,t.sheetHref):i),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;Bi(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const s=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!rr(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;Bi(t);let s=i.href;!s&&i.ownerNode&&(s=i.ownerNode.baseURI);const o=Array.from(t);r.set(e,{sheet:i,rules:o,sheetHref:s}),n.push({sheet:i,rules:o,index:0})}catch(t){}}}(s,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=_i();let o=t>0?t:1;try{for(;!n&&o>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?ir(n):n}else e=Yi(t.parts.join(""))}catch(t){}s(e);continue}o-=1;try{a(t)}catch(t){s(null)}}}catch(t){n=!0,i=null}finally{Wi(_i()-r)}return n},text:()=>n?i:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var ur=class{constructor(){Zi(this,"idNodeMap",new Map),Zi(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),Ji(t)){const e=wi.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function cr({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:s}){let o=r||"";const a=i&&hr(i);return(e[n.toLowerCase()]||a&&e[a])&&(o=s?s(o,t):"*".repeat(o.length)),o}function hr(t){return t.toLowerCase()}var dr=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function fr({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:s=!1}){return n?i?s&&dr.has(hr(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var vr="__rrweb_original__";function pr(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?hr(e):null}catch(t){return null}}var mr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,gr=/^(?:[a-z+]+:)?\/\//i,yr=/^www\..*/i,br=/^(data:)([^,]*),(.*)/i;function wr(t,e){return(t||"").replace(mr,(t,n,i,r,s,o)=>{const a=i||s||o,l=n||r||"";if(!a)return t;if(gr.test(a)||yr.test(a))return`url(${l}${a}${l})`;if(br.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var _r,kr,Sr=new Map,Cr=1,Ir=new RegExp("[^a-z0-9-_:]");function Mr(){return Cr++}var Rr=/^[^ \t\n\r\u000c]+/,Ar=/^[, \t\n\r\u000c]+/,xr=new WeakMap;function Tr(t,e){return e&&""!==e.trim()?Or(t,e):e}function Or(t,e){let n=xr.get(t);if(n||(n=t.createElement("a"),xr.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Er(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Fr(t,e,n,i,r,s){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){if("link"===e&&r){var o;const t=null===(o=r.sheet)||void 0===o?void 0:o.href;if(t)return t}const n=Tr(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=Sr.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const s=r.getContext("2d");if(!s)return e;s.drawImage(t,0,0);const o=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>o.length?o:e;if(Sr.size>=10){const t=Sr.keys().next().value;void 0!==t&&Sr.delete(t)}return Sr.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,s.type,s.quality)),Er(t,s)}if("image"===e)return Er(n,s)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Tr(t,i);return"image"===e&&n.startsWith("data:")?Er(n,s):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(Ar),e.length>n;){let s=i(Rr);if(","===s.slice(-1))s=Tr(t,s.substring(0,s.length-1)),r.push(s);else{let i="";s=Tr(t,s);let o=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((s+i).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){n+=1,r.push((s+i).trim());break}"("===t&&(o=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?wr(i,Or(t)):"object"===e&&"data"===n?Tr(t,i):i:Tr(t,i)}function $r(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===hr(e)}function Dr(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&Dr(wi.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&Dr(wi.parentNode(t),e,n)}function Lr(t,e,n,i){let r;if(Ji(t)){if(r=t,!wi.childNodes(r).length)return!1}else{if(null===wi.parentElement(t))return!1;r=wi.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if(Dr(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function Nr(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Pr=new Map;function jr(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Br(t){return null==t?"":t.toLowerCase()}var zr=!1,Wr=!1;function Ur(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f=!1,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,canvasMaskingConfigured:b,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k=5e3,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:R=!1,depth:A=0,maxDepth:x=50}=e;let{needsMask:T}=e,{preserveWhiteSpace:O=!0}=e;if(A>=x)return Wr=!0,zr||(zr=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${x}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;T||(T=Lr(t,o,a,void 0===T)),Mi>0&&(xi.nodeCount+=1);const E=function(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:h=!1,maskAttributeFn:d,dataURLOptions:f={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:ai.Document,childNodes:[],compatMode:t.compatMode}:{type:ai.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:ai.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:s,maskInputOptions:o={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:h,recordCanvas:d,canvasMaskingConfigured:f,keepIframeSrcFn:v,newlyAddedElement:p=!1,rootId:m}=e,g=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,i,r),y=function(t){if(t instanceof HTMLFormElement)return"form";const e=hr(t.tagName);return Ir.test(e)?"div":e}(t),b=new Set;let w={};const _=t.attributes.length;for(let e=0;_>e;e++){const i=t.attributes[e];$r(y,i.name)||(w[i.name]=Fr(n,y,hr(i.name),i.value,t,c))}if("link"===y&&s&&!g){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=jr(n,i),!e&&i.includes(".css"))&&(e=jr(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(Ui(e)?Mi>0&&(Ei.push(t),Fi+=1):i=er(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}if("style"===y&&t.sheet&&!(t.innerText||wi.textContent(t)||"").trim().length){const e=zi(()=>er(t.sheet));e&&(w._cssText=e)}if("input"===y||"textarea"===y||"select"===y){const e=t.value,n=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&e?w.value=cr({element:t,type:pr(t),tagName:y,value:e,maskInputOptions:o,maskInputFn:a}):n&&(w.checked=n)}if("option"===y&&(t.selected&&!o.select?w.selected=!0:delete w.selected),"dialog"===y&&t.open){try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}b.add("rr_open_mode")}if("canvas"===y&&d&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData;if(new Uint32Array((vr in r?r[vr]:r).call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i)).data.buffer).some(t=>0!==t))return!1}return!0})(t)||(w.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=t.width,i.height=t.height,e!==i.toDataURL(c.type,c.quality)&&(w.rr_dataURL=e)}let k,S=!1;if("img"===y&&h){_r||(_r=n.createElement("canvas"),kr=_r.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,s=(e,n)=>S?fr({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,o=()=>{Nr(e,"load",o);try{_r.width=e.naturalWidth,_r.height=e.naturalHeight,kr.drawImage(e,0,0);const t=_r.toDataURL(c.type,c.quality);w.rr_dataURL=s("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o));console.warn(`Cannot inline img src=${i}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?w.crossOrigin=s("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}if("audio"===y||"video"===y){const e=w;e.rr_mediaState=t.paused?"paused":"played",b.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(p||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),g){var C,I,M;const{width:e,height:i,left:r,top:s}=t.getBoundingClientRect(),o=null===(C=n.defaultView)||void 0===C?void 0:C.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(I=n.defaultView)||void 0===I?void 0:I.scrollX)||0))}px`,rr_top:`${Math.floor(s+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollY)||0))}px`},b.add("rr_width"),b.add("rr_height"),b.add("rr_left"),b.add("rr_top"),o&&(w.rr_position=o.position||"static",b.add("rr_position"),o.transform&&"none"!==o.transform&&(w.rr_transform=o.transform,b.add("rr_transform")),o.display&&o.display.startsWith("inline")&&(w.rr_display=o.display,b.add("rr_display")))}if("iframe"!==y||v(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src),l||u)for(const[e,n]of Object.entries(w))"string"!=typeof n&&null!==n||(w[e]=fr({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));S=!0;try{customElements.get(y)&&(k=!0)}catch(t){}return{type:ai.Element,tagName:y,attributes:w,childNodes:[],isSVG:(R=t,Boolean("svg"===R.tagName||R.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:k};var R}(t,{doc:n,blockClass:r,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:h,maskAttributeFn:d,dataURLOptions:f,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case t.TEXT_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,s=wi.parentNode(t),o=s&&s.tagName;let a=wi.textContent(t);const l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(Ui(s.sheet));else if(null===(c=s.sheet)||void 0===c?void 0:c.cssRules){const t=er(s.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=wr(a,Or(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,wi.parentElement(t)):a.replace(/[\S]/g,"*")),{type:ai.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:o,maskTextFn:u,rootId:b});case t.CDATA_SECTION_NODE:return{type:ai.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:ai.Comment,textContent:wi.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:T,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:M,newlyAddedElement:R});if(!E)return console.warn(t,"not serialized"),null;let F;F=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===ai.Comment)return!0;if(t.type===ai.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Br(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Br(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Br(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Br(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Br(t.attributes.property).match(/^(og|twitter|fb):/)||Br(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Br(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Br(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Br(t.attributes.name))||Br(t.attributes.property).match(/^article:/)||Br(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Br(t.attributes.name)))return!0}}return!1}(E,p)||!O&&E.type===ai.Text&&!E.isStyle&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Mr();const D=Object.assign(E,{id:F});if(i.add(t,D),-2===F)return null;w&&w(t);let L=!l;if(D.type===ai.Element){L=L&&!D.needBlock,delete D.needBlock;const e=wi.shadowRoot(t);e&&Xi(e)&&(D.isShadowHost=!0)}if((D.type===ai.Document||D.type===ai.Element)&&L){p.headWhitespace&&D.type===ai.Element&&"head"===D.tagName&&(O=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:T,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,depth:A+1,maxDepth:x};if(D.type===ai.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else for(const n of Array.from(wi.childNodes(t))){const t=Ur(n,e);t&&D.childNodes.push(t)}let R=null;if(Ji(t)&&(R=wi.shadowRoot(t)))for(const t of Array.from(wi.childNodes(R))){const n=Ur(t,e);n&&(Xi(R)&&(n.isShadow=!0),D.childNodes.push(n))}}const N=wi.parentNode(t);if(N&&Qi(N)&&Xi(N)&&(D.isShadow=!0),D.type===ai.Element&&"iframe"===D.tagName){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let s;try{s=r.document.readyState}catch(t){return i}const o=()=>e();if("complete"!==s){let i=!1,r=null;const s=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),Nr(t,"load",a),t.addEventListener("load",o),e())},a=()=>s();return r=setTimeout(s,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?Nr(t,"load",o):(i=!0,Nr(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(n),Nr(t,"load",o)}}return t.addEventListener("load",o),()=>{Nr(t,"load",o)}}(t,()=>{const e=t.contentDocument;if(e&&_){const n=Ur(e,{doc:e,mirror:i,blockClass:r,blockSelector:s,needsMask:T,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,depth:A+1,maxDepth:x});n&&_(t,n)}},k);null==S||S(t,e)}return D.type===ai.Element&&"link"===D.tagName&&"stylesheet"===D.attributes.rel&&function(e,l,S){if(Pr.has(e))return;let R;try{R=e.sheet}catch(t){return}if(R)return;const E=new AbortController;let F=!1;const D=()=>{if(!F){F=!0;try{(()=>{if(C){const e=Ur(t,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:T,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,depth:A,maxDepth:x});e&&C(t,e)}})()}finally{Pr.delete(e),E.abort()}}},L=setTimeout(D,S);E.signal.addEventListener("abort",()=>clearTimeout(L),{once:!0}),e.addEventListener("load",D,{signal:E.signal,once:!0}),Pr.set(e,E)}(t,0,I),D}function Hr(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var qr=class t{constructor(...t){Zi(this,"parentElement",null),Zi(this,"parentNode",null),Zi(this,"ownerDocument",void 0),Zi(this,"firstChild",null),Zi(this,"lastChild",null),Zi(this,"previousSibling",null),Zi(this,"nextSibling",null),Zi(this,"ELEMENT_NODE",1),Zi(this,"TEXT_NODE",3),Zi(this,"nodeType",void 0),Zi(this,"nodeName",void 0),Zi(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Gr(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Vr(n,t,e,i)}function Vr(t,e,n,i){Zr(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Zr(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Jr(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Qr="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.",Xr={map:{},getId(){return console.warn(Qr),-1},getNode(){return console.warn(Qr),null},removeNodeFromMap(){console.warn(Qr)},has(){return console.warn(Qr),!1},reset(){console.warn(Qr)}};function Yr(t,e,n={}){let i=null,r=0;return function(...s){const o=Date.now();r||!1!==n.leading||(r=o);const a=e-(o-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=o,t.apply(l,s)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,s)},a))}}function Kr(t,e,n,i,r=window){const s=r.Object.getOwnPropertyDescriptor(t,e);return r.Object.defineProperty(t,e,i?n:{set(t){if(setTimeout(()=>{try{n.set.call(this,t)}catch(t){}},0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>Kr(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xr=new Proxy(Xr,{get(t,e,n){return"map"===e&&console.warn(Qr),Reflect.get(t,e,n)}}));var ts=Date.now;function es(t){var e,n,i,r;const s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null===(e=wi.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null===(i=wi.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(r=s.body)||void 0===r?void 0:r.scrollTop)||0}}function ns(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function is(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function rs(t){return t?t.nodeType===t.ELEMENT_NODE?t:wi.parentElement(t):null}function ss(t,e,n,i){if(!t)return!1;const r=rs(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if(Dr(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function os(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function as(t,e){if(Qi(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=wi.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||as(i,e))}function ls(t){return Boolean(t.changedTouches)}function us(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function cs(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function hs(t){return!!t&&(t instanceof qr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(wi.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ts=()=>(new Date).getTime());var ds=class{constructor(){Zi(this,"id",1),Zi(this,"styleIDMap",new WeakMap),Zi(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function fs(t){var e;let n=null;return"getRootNode"in t&&(null===(e=wi.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&wi.host(wi.getRootNode(t))&&(n=wi.host(wi.getRootNode(t))),n}function vs(t){const e=t.ownerDocument;if(!e)return!1;if(wi.contains(e,t))return!0;const n=wi.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=fs(n);)n=e;return n}(t);return wi.contains(e,n)}(t)}function ps(t){return"__ln"in t}var ms,gs=class{constructor(){Zi(this,"length",0),Zi(this,"head",null),Zi(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ps(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&ps(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},ys=(t,e)=>`${t}@${e}`,bs=class{constructor(){Zi(this,"frozen",!1),Zi(this,"locked",!1),Zi(this,"texts",[]),Zi(this,"attributes",[]),Zi(this,"attributeMap",new WeakMap),Zi(this,"generatedAttributes",new WeakMap),Zi(this,"removes",[]),Zi(this,"mapRemoves",new Set),Zi(this,"movedMap",{}),Zi(this,"addedSet",new Set),Zi(this,"movedSet",new Set),Zi(this,"droppedSet",new Set),Zi(this,"removesSubTreeCache",new Set),Zi(this,"mutationCb",void 0),Zi(this,"blockClass",void 0),Zi(this,"blockSelector",void 0),Zi(this,"maskTextClass",void 0),Zi(this,"maskTextSelector",void 0),Zi(this,"inlineStylesheet",void 0),Zi(this,"maskInputOptions",void 0),Zi(this,"maskTextFn",void 0),Zi(this,"maskInputFn",void 0),Zi(this,"maskAllElementAttributes",void 0),Zi(this,"maskAttributeFn",void 0),Zi(this,"keepIframeSrcFn",void 0),Zi(this,"recordCanvas",void 0),Zi(this,"canvasMaskingConfigured",void 0),Zi(this,"inlineImages",void 0),Zi(this,"slimDOMOptions",void 0),Zi(this,"dataURLOptions",void 0),Zi(this,"doc",void 0),Zi(this,"mirror",void 0),Zi(this,"iframeManager",void 0),Zi(this,"stylesheetManager",void 0),Zi(this,"shadowDomManager",void 0),Zi(this,"canvasManager",void 0),Zi(this,"processedNodeManager",void 0),Zi(this,"unattachedDoc",void 0),Zi(this,"canvasManagerReleased",!1),Zi(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Zi(this,"emit",()=>{if(this.frozen||this.locked)return;const t=_i(),e=Ci();try{this.processBufferedMutations()}finally{n=_i()-t,i=e,Mi>0||Ii(n,null!=i?i:ki)||n>Di.slowestBatchMs&&(Di.slowestBatchMs=n)}var n,i}),Zi(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new gs,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let r;const s=s=>{var o;const a=wi.parentNode(s);if(!a||!vs(s)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=Qi(a)?this.mirror.getId(fs(s)):this.mirror.getId(a),u=i(s);if(-1===l||-1===u)return n.addNode(s);null!==(o=r)&&void 0!==o||(r={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{us(t,this.mirror)&&this.iframeManager.addIframe(t),cs(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),hs(t)&&!ss(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(wi.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=Ur(s,r);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)_s(this.removesSubTreeCache,t)&&!this.movedSet.has(wi.parentNode(t))||s(t);for(const t of this.addedSet)ks(this.droppedSet,t)||_s(this.removesSubTreeCache,t)?ks(this.movedSet,t)?s(t):this.droppedSet.add(t):s(t);let o=null;for(;n.length;){let t=null;if(o){const e=this.mirror.getId(wi.parentNode(o.value)),n=i(o.value);-1!==e&&-1!==n&&(t=o)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(wi.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==e){t=n;break}{const e=wi.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=wi.host(e);if(-1!==this.mirror.getId(i)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}o=t.previous,n.removeNode(t.value),s(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=wi.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=fr({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),Zi(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Zi(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(wi.childNodes(t),t=>wi.textContent(t)||"").join("");e.attributes.value=cr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:pr(t),value:n,maskInputFn:this.maskInputFn})}),Zi(this,"processMutation",t=>{if(!os(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=wi.textContent(t.target);ss(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Lr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,rs(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=hr(i.tagName),s=t.attributeName,o=null!==(e=t.attributeNamespace)&&void 0!==e?e:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(i,s,o),l=o?i.getAttributeNS(o,s):t.target.getAttribute(s);if("value"===a){const t=i,e=pr(t);l=cr({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(ss(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&i.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!$r(r,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Fr(this.doc,r,hr(a),l,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=i.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const i=n.getPropertyValue(t),r=n.getPropertyPriority(t);i!==e.style.getPropertyValue(t)||r!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?i:[i,r]:u._unchangedStyles[t]=[i,r]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(ss(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=Qi(t.target)?this.mirror.getId(wi.host(t.target)):this.mirror.getId(t.target);ss(t.target,this.blockClass,this.blockSelector,!1)||os(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ws(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||as(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ys(n,i)]?ws(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Qi(t.target)||!Xi(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),wi.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),Zi(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(os(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[ys(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!ss(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=wi.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(hs(t)){const e=wi.childNodes(wi.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),ss(t,n||e,this.blockSelector,!0))return!0;const i="getRootNode"in t?wi.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?wi.host(i):null}return!1}};function ws(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=wi.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function _s(t,e,n){return 0!==t.size&&function(t,e){const n=wi.parentNode(e);return!!n&&t.has(n)}(t,e)}function ks(t,e){if(0===t.size)return!1;let n=wi.parentNode(e);for(;n;){if(t.has(n))return!0;n=wi.parentNode(n)}return!1}function Ss(t){ms=t}function Cs(){ms=void 0}var Is=(t,e="rrweb")=>ms?(...n)=>{try{return t(...n)}catch(t){if(ms&&!0===ms(t,e))return;throw t}}:t,Ms=[];function Rs(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function As(t,e){const n=new bs;let i;n.init(t);try{i=new(yi())(Is(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),Ms.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function xs({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:s}){const o=new Map,a=s=>{const a=Rs(s);if(!a||ss(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=es(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const h=`${u},${c}`;o.get(l)!==h&&(o.set(l,h),t({id:l,x:u,y:c}))},l=[Gr("scroll",Is(Yr(Is(t=>a(t)),s.scroll||100)),e)];return"onscrollend"in e&&l.push(Gr("scrollend",Is(a),e)),()=>l.forEach(t=>t())}function Ts(t,e){for(let n=Ms.length-1;n>=0;n--){const i=Ms[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Ms.splice(n,1))}}var Os=["INPUT","TEXTAREA","SELECT"],Es=new WeakMap;function Fs(t){return function t(e,n){if(Ns("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ns("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ns("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ns("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function $s(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function Ds({mirror:t,stylesheetManager:e},n){var i,r;let s=null;s=t.getId("#document"===n.nodeName?n:wi.host(n));const o="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var i;n=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{e.adoptStyleSheets(t,s)}catch(t){}return n}}),Is(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function Ls(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,r;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),s(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),o(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),h(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),d(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const s=[],o=Is(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Ms.indexOf(r);-1!==t&&Ms.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Jr(s)}});try{if(t.recordDOM){const e=As(t,t.doc);i=e.observer,r=e.buffer}if(s.push(function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,s="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,a=[];const l=Yr(Is(e=>{const n=Date.now()-o;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],o=null}),s),u=Is(Yr(Is(t=>{const e=Rs(t),{clientX:n,clientY:r}=ls(t)?t.changedTouches[0]:t;o||(o=ts()),a.push({x:n,y:r,id:i.getId(e),timeOffset:ts()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?ni.Drag:t instanceof MouseEvent?ni.MouseMove:ni.TouchMove)}),r,{trailing:!1})),c=[Gr("mousemove",u,n),Gr("touchmove",u,n),Gr("drag",u,n)];return Is(()=>{c.forEach(t=>t())})}(t)),s.push(function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const o=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];let l=null;return Object.keys(ii).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t]).forEach(s=>{let o=hr(s);const u=(e=>s=>{const o=Rs(s);if(ss(o,i,r,!0))return;let a=null,u=e;if("pointerType"in s){switch(s.pointerType){case"mouse":a=ri.Mouse;break;case"touch":a=ri.Touch;break;case"pen":a=ri.Pen}a===ri.Touch&&(ii[e]===ii.MouseDown?u="TouchStart":ii[e]===ii.MouseUp&&(u="TouchEnd"))}else ls(s)&&(a=ri.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===ri.Touch||u.startsWith("Mouse")&&a===ri.Mouse)&&(a=null)):ii[e]===ii.Click&&(a=l,l=null);const c=ls(s)?s.changedTouches[0]:s;if(!c)return;const h=n.getId(o),{clientX:d,clientY:f}=c;Is(t)(E({type:ii[u],id:h,x:d,y:f},null!==a&&{pointerType:a}))})(s);if(window.PointerEvent)switch(ii[s]){case ii.MouseDown:case ii.MouseUp:o=o.replace("mouse","pointer");break;case ii.TouchStart:case ii.TouchEnd:return}a.push(Gr(o,u,e))}),Is(()=>{a.forEach(t=>t())})}(t)),s.push(xs(t)),s.push(function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Gr("resize",Is(Yr(Is(()=>{const e=ns(),r=is();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),s.push(function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,ignoreClass:s,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(t){let n=Rs(t);const u=t.isTrusted,h=e.defaultView;if(n&&h&&!(n instanceof h.HTMLElement))return;const f=n&&n.tagName;if(n&&"OPTION"===f&&(n=wi.parentElement(n)),!n||!f||0>Os.indexOf(f)||ss(n,i,r,!0))return;if(n.classList.contains(s)||o&&n.matches(o))return;let v=n.value,p=!1;const m=pr(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=cr({element:n,maskInputOptions:a,tagName:f,type:m,value:v,maskInputFn:l})),d(n,c?{text:v,isChecked:p,userTriggered:u}:{text:v,isChecked:p});const g=n.name;"radio"===m&&g&&p&&e.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(t=>{if(t!==n){const e=t.value;d(t,c?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function d(e,i){const r=Es.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){Es.set(e,i);const r=n.getId(e);Is(t)(E(E({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>Gr(t,Is(h),e)),v=e.defaultView;if(!v)return()=>{f.forEach(t=>t())};const p=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value");return p&&p.set&&f.push(...[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]].map(t=>Kr(t[0],t[1],{set(){Is(h)({target:this,isTrusted:!1})}},!1,v))),Is(()=>{Jr(f)})}(t)),s.push(function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:s}){const o=Is(s=>Yr(Is(r=>{const o=Rs(r);if(!o||ss(o,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=o;t({type:s,id:i.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}),r.media||500)),a=[Gr("play",o(oi.Play),s),Gr("pause",o(oi.Pause),s),Gr("seeked",o(oi.Seeked),s),Gr("volumechange",o(oi.VolumeChange),s),Gr("ratechange",o(oi.RateChange),s)];return Is(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},s=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),s(t)):r(n)},queuePendingMutation(o,a,l){if(!i)return()=>{};let u=e.get(o);u||(u=[],e.set(o,u));const c={emit:a,ready:!1};u.push(c);let h,d=!1,f=!1;const v=()=>{d||f||(d=!0,void 0!==h&&n.delete(h),c.ready=!0,c.emit=void 0,s(o))};try{h=t.setTimeout(v,5e3),d||f?t.clearTimeout(h):n.add(h)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==h&&(t.clearTimeout(h),n.delete(h)),d?e&&r(l):(c.ready=!0,e||(c.emit=void 0),s(o)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);s.push(e.reset),s.push(function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=$s(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const o=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=$s(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);try{const i=null==l?void 0:l.then;if(s.ownerNode||!l||"function"!=typeof i)return l;n.onCssomSheetMutation(s);const{id:o,styleId:u}=$s(s,e,n.styleMirror);if(!(o&&-1!==o||u&&-1!==u))return l;const c=r.queuePendingMutation(s,()=>t({id:o,styleId:u,replace:a}),()=>{const e=er(s);null!==e&&t({id:o,styleId:u,replace:e})});try{i.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=$s(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};Ps("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Ps("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Ps("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Ps("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,s])=>{c[i]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[i].insertRule,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=$s(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Fs(s),l];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=$s(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Fs(s),a];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Is(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),s.push(Ds(t,t.doc)),s.push(function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:s}){const o=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Is((r,o,a)=>{var l;const[u,c,h]=a,d=r.apply(o,a);if(n.has(u))return d;const f=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=$s(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=Fs(o.parentRule);s.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:h},index:e}))}return d},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Is((r,o,a)=>{var l;const[u]=a,c=r.apply(o,a);if(n.has(u))return c;const h=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(h);const{id:d,styleId:f}=$s(h,e,i.styleMirror);if(d&&-1!==d||f&&-1!==f){const e=Fs(o.parentRule);s.queueMutation(h,()=>t({id:d,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Is(()=>{r.CSSStyleDeclaration.prototype.setProperty=o,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&s.push(function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,n){const i=new s(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const o=bi(e.fonts,"add",function(e){return function(n){return setTimeout(Is(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=s}),i.push(o),Is(()=>{i.forEach(t=>t())})}(t))}s.push(function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:s}=t;let o=!0;const a=Is(()=>{const t=e.getSelection();if(!t||o&&(null==t?void 0:t.isCollapsed))return;o=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:s,startOffset:o,endContainer:l,endOffset:u}=t.getRangeAt(e);ss(s,i,r,!0)||ss(l,i,r,!0)||a.push({start:n.getId(s),startOffset:o,end:n.getId(l),endOffset:u})}s({ranges:a})});return a(),Gr("selectionchange",a)}(t)),s.push(function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?bi(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)s.push(e.observer(e.callback,n,e.options))}catch(t){try{o()}catch(t){}throw t}return o}function Ns(t){return void 0!==window[t]}function Ps(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var js=class{constructor(t){Zi(this,"generateIdFn",void 0),Zi(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Zi(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t);let o=r.get(e);return void 0===o&&(o=this.generateIdFn(),r.set(e,o),s.set(o,e)),o}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},Bs=class{constructor(t){Zi(this,"iframes",new WeakMap),Zi(this,"crossOriginIframeMap",new WeakMap),Zi(this,"crossOriginIframeMirror",new js(Mr)),Zi(this,"crossOriginIframeStyleMirror",void 0),Zi(this,"crossOriginIframeRootIdMap",new WeakMap),Zi(this,"mirror",void 0),Zi(this,"mutationCb",void 0),Zi(this,"wrappedEmit",void 0),Zi(this,"loadListener",void 0),Zi(this,"pageHideListener",void 0),Zi(this,"stylesheetManager",void 0),Zi(this,"recordCrossOriginIframes",void 0),Zi(this,"messageHandler",void 0),Zi(this,"nestedIframeListeners",new Map),Zi(this,"attachedWindows",new WeakMap),Zi(this,"attachedDocuments",new WeakMap),Zi(this,"attachedIframes",new Map),Zi(this,"loadListenerDisposers",new WeakMap),Zi(this,"iframeElementsById",new Map),Zi(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new js(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Zr(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Vr(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);Zr(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}Zr(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}transformCrossOriginEvent(t,e){switch(e.type){case ei.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:ei.IncrementalSnapshot,data:{source:ni.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ei.Meta:case ei.Load:case ei.DomContentLoaded:return!1;case ei.Plugin:return e;case ei.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case ei.IncrementalSnapshot:switch(e.data.source){case ni.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case ni.Drag:case ni.TouchMove:case ni.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case ni.ViewportResize:return!1;case ni.MediaInteraction:case ni.MouseInteraction:case ni.Scroll:case ni.CanvasMutation:case ni.Input:return this.replaceIds(e.data,t,["id"]),e;case ni.StyleSheetRule:case ni.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ni.Font:return e;case ni.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case ni.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===ai.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(Vr(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Vr(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{Zr(()=>this.mirror.removeNodeFromMap(t))}),Zr(()=>Ts(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Vr(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Vr(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},zs=class{constructor(t){Zi(this,"shadowDoms",new WeakSet),Zi(this,"mutationCb",void 0),Zi(this,"scrollCb",void 0),Zi(this,"bypassOptions",void 0),Zi(this,"mirror",void 0),Zi(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!Xi(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=null!==(n=null===(i=wi.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:s,buffer:o}=As(E(E({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:r,handler(){s.disconnect(),o.destroy(),o.releaseCanvasManager();const t=Ms.indexOf(o);-1!==t&&Ms.splice(t,1)}}),this.restoreHandlers.push({doc:r,handler:xs(E(E({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(wi.host(t))),this.restoreHandlers.push({doc:r,handler:Ds({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:bi(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),s=wi.shadowRoot(this);return s&&vs(this)&&n.addShadowRoot(s,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},Ws="skip-frame";function Us(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Hs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gs=0;64>Gs;Gs++)qs[Hs.charCodeAt(Gs)]=Gs;var Vs=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Hs[n[e]>>2],r+=Hs[(3&n[e])<<4|n[e+1]>>4],r+=Hs[(15&n[e+1])<<2|n[e+2]>>6],r+=Hs[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},Zs=new Map,Js=(t,e,n)=>{if(!t||!Ys(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Zs.get(t);return n||(n=new Map,Zs.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function Qs(t,e,n,i){if(t instanceof Array)return t.map(t=>Qs(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Vs(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Qs(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Qs(t.data,e,n,i),t.width,t.height]}:Ys(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Js(t,e,n)}:t}var Xs=(t,e,n,i)=>t.map(t=>Qs(t,e,n,i)),Ys=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},Ks=["webgl","webgl2"];function to(t){return"nodeType"in t}function eo(t,e,n,i){const r=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return bi(i.prototype,"configure",function(i){return function(r){const s=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!s||to(s)&&ss(s,e,n,!0))return i.call(this,r);to(s)&&!("__context"in s)&&(s.__context="webgpu");const o=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==o&&r?E(E({},r),{},{usage:"number"==typeof r.usage?r.usage|o:o}):r)}})}(t,e,n);i&&r.push(i)}const s=bi(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...s){const o=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!ss(this,e,n,!0)&&("__context"in this||(this.__context=o),i&&Ks.includes(o)))if(s[0]&&"object"==typeof s[0]){const t=s[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...s])}});r.push(s)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(t=>t())}}function no(t,e,n,i,r,s,o){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=bi(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Js(l,s,this),this.canvas&&"tagName"in this.canvas&&!ss(this.canvas,i,r,!0)){const t=Xs(a,s,this,o);n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(s){const o=Kr(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!ss(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(o)}return a}var io='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',ro="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",io],{type:"text/javascript;charset=utf-8"});function so(t){let e;try{if(e=ro&&(self.URL||self.webkitURL).createObjectURL(ro),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(io),{name:null==t?void 0:t.name})}}var oo,ao,lo,uo=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){Zi(this,"pendingCanvasMutations",new Map),Zi(this,"rafStamps",{latestId:0,invokeId:null}),Zi(this,"mirror",void 0),Zi(this,"mutationCb",void 0),Zi(this,"resetObservers",void 0),Zi(this,"frozen",!1),Zi(this,"locked",!1),Zi(this,"rafIdTimestamp",null),Zi(this,"rafIdFlush",null),Zi(this,"refCount",0),Zi(this,"torndown",!1),Zi(this,"resetFrameDedup",null),Zi(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:s,dataURLOptions:o,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(n,i,r,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:o,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var s=this;if(!("OffscreenCanvas"in e))return;const o="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,a=eo(e,n,i,!0),l=new Map;let u;try{u=new so}catch(t){return}let c=!1;u.onerror=()=>{var t;c=!0,cancelAnimationFrame(d),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{const{id:e}=t.data;if(l.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:s}=t.data;this.mutationCb({id:e,type:si["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,s]}],displayWidth:r,displayHeight:s})};const h=1e3/t;let d,f=0;const v=t=>{var a;c||(f&&h>t-f||(f=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{ss(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((a=A(function*(t){const e=s.mirror.getId(t);if(!l.get(e)&&0!==t.width&&0!==t.height){l.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void l.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=t.clientWidth||t.width,a=t.clientHeight||t.height,c=Math.max(1,Math.round(s*o)),h=Math.max(1,Math.round(a*o)),d=function(t,e,n,i,r,s){if(!t||"function"!=typeof t.regionsFn)return;let o;try{o=t.regionsFn(e)}catch(t){return Ws}if(void 0===o)return;if(!Array.isArray(o)||!o.every(Us))return Ws;const a=n/r,l=i/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,c,h,s,a);if("skip-frame"===d)return void l.set(e,!1);const f=yield createImageBitmap(t,1>o?{resizeWidth:c,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:h});u.postMessage({id:e,bitmap:f,width:c,height:h,displayWidth:s,displayHeight:a,dataURLOptions:r.dataURLOptions,maskRegions:d},[f])}catch(t){l.set(e,!1)}}}),function(t){return a.apply(this,arguments)}))),d=requestAnimationFrame(v))};d=requestAnimationFrame(v),this.resetObservers=()=>{var t;a(),cancelAnimationFrame(d),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=eo(t,e,n,!1),s=function(t,e,n,i,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const o=bi(e.CanvasRenderingContext2D.prototype,a,function(s){return function(...o){return ss(this.canvas,n,i,!0)||setTimeout(()=>{const n=Xs(o,e,this,r);t(this.canvas,{type:si["2D"],property:a,args:n})},0),s.apply(this,o)}});s.push(o)}catch(r){const o=Kr(e.CanvasRenderingContext2D.prototype,a,{set(e){ss(this.canvas,n,i,!0)||t(this.canvas,{type:si["2D"],property:a,args:[e],setter:!0})}});s.push(o)}return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),o=function(t,e,n,i,r){const s=[];return void 0!==e.WebGLRenderingContext&&s.push(...no(e.WebGLRenderingContext.prototype,si.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&s.push(...no(e.WebGL2RenderingContext.prototype,si.WebGL2,t,n,i,e,r)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;s.length>i;i++)e.includes(n=s[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,ti)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}},co=class{constructor(t){var e;Zi(this,"trackedLinkElements",new WeakSet),Zi(this,"pendingDeferredSheets",new Set),Zi(this,"mutationCb",void 0),Zi(this,"adoptedStyleSheetCb",void 0),Zi(this,"maskAllElementAttributes",void 0),Zi(this,"maskAttributeFn",void 0),Zi(this,"styleMirror",new ds),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,i=null;try{i=t.sheet,i&&(n=lr(i))}catch(t){}if(!n||!i)return qi(),null;const r=n;let s=!1;const o={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);let a=!1;return{advance:n=>{if(a)return!0;const l=_i(),u=Ci();let c=!0;try{if(s)return a=!0,qi(),!0;if(!r.advance(n))return c=!1,!1;a=!0;const o=r.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==i?(qi(),!0):o?(this.emitCssTextMutation(t,e,o),!0):(qi(),!0)}finally{c&&this.pendingDeferredSheets.delete(o),Ii(h=_i()-l,null!=(d=u)?d:ki)||(Li.totalMs+=h,h>Li.slowestSliceMs&&(Li.slowestSliceMs=h))}var h,d},remainingRules:()=>r.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:fr({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=_i();try{zi(()=>{try{const t=e.rules||e.cssRules;t&&Bi(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:nr(t,e.href),index:n}))})})}finally{Wi(_i()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Pr.forEach(t=>t.abort()),Pr.clear()}trackStylesheetInLinkElement(t){}},ho=class{constructor(){Zi(this,"nodeMap",new WeakMap),Zi(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},fo=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var vo;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(vo=t.contentWindow)||void 0===vo?void 0:vo.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var po=new ur,mo=new Set([ni.Mutation,ni.MediaInteraction,ni.StyleSheetRule,ni.CanvasMutation,ni.Font,ni.Log,ni.StyleDeclaration,ni.AdoptedStyleSheet]);function go(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}function yo(t={}){let e;const{emit:n,checkoutEveryNms:i,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,inlineStylesheetBudgetRules:d,maskAllInputs:f,maskInputOptions:v,slimDOMOptions:p,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y=!1,maskAttributeFn:b,hooks:w,packFn:_,sampling:k={},dataURLOptions:S={},canvasResolutionScale:C,canvasMasking:I,mousemoveWait:M,recordDOM:R=!0,recordCanvas:A=!1,recordCrossOriginIframes:x=!1,recordAfter:T=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:F=!1,inlineImages:D=!1,plugins:L,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:P=new Set([]),attributeFilter:j,errorHandler:B}=t;Ss(B);const z=E({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),W=!x||window.parent===window;let U=!1;if(!W)try{window.parent.document&&(U=!1)}catch(t){U=!0}if(W&&!n)throw new Error("emit function is required");if(!W&&!U)return()=>{};void 0!==M&&void 0===k.mousemove&&(k.mousemove=M),po.reset();const H=!0===f?{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!==v?v:{password:!0},q=Hr(void 0!==p&&p);let G;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let V=0;const Z=new Map;let J,Q;const X=t=>{for(const e of L||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!U&&(t=_(t)),t};oo=(t,e)=>{var s;const o=t;if(o.timestamp=ts(),!(null===(s=Ms[0])||void 0===s?void 0:s.isFrozen())||o.type===ei.FullSnapshot||o.type===ei.IncrementalSnapshot&&mo.has(o.data.source)||Ms.forEach(t=>t.unfreeze()),W)null==n||n(X(o),e);else if(U){const t={type:"rrweb",event:X(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(o.type===ei.FullSnapshot)G=o,V=0;else if(o.type===ei.IncrementalSnapshot){if(o.data.source===ni.Mutation&&o.data.isAttachIframe)return;V++,(r&&V>=r||i&&o.timestamp-G.timestamp>i)&&ao(!0)}};const Y=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=po.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=nt.getIframeElementById(t);i&&n.has(i)?nt.forgetIframeId(t):(null==J||J(t),nt.removeIframeById(t))}),null==Q||Q(),nt.cleanupDetachedIframes()}oo({type:ei.IncrementalSnapshot,data:E({source:ni.Mutation},t)})},K=t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.Scroll},t)}),tt=t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.CanvasMutation},t)}),et=new co({mutationCb:Y,adoptedStyleSheetCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.AdoptedStyleSheet},t)}),maskAllElementAttributes:y,maskAttributeFn:b}),nt=new Bs({mirror:po,mutationCb:Y,stylesheetManager:et,recordCrossOriginIframes:x,wrappedEmit:oo});for(const t of L||[])t.getMirror&&t.getMirror({nodeMirror:po,crossOriginIframeMirror:nt.crossOriginIframeMirror,crossOriginIframeStyleMirror:nt.crossOriginIframeStyleMirror});const it=new ho,rt=null==I?void 0:I.configured;lo=new uo({recordCanvas:A,mutationCb:tt,win:window,blockClass:s,blockSelector:o,mirror:po,sampling:k.canvas,dataURLOptions:z,resolutionScale:C,canvasMasking:I});const st=new zs({mutationCb:Y,scrollCb:K,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:H,dataURLOptions:z,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,recordCanvas:A,canvasMaskingConfigured:rt,inlineImages:D,sampling:k,slimDOMOptions:q,iframeManager:nt,stylesheetManager:et,canvasManager:lo,keepIframeSrcFn:N,processedNodeManager:it,attributeFilter:j},mirror:po});ao=(t=!1)=>{if(R){Ni(d);try{oo({type:ei.Meta,data:{href:window.location.href,width:is(),height:ns()}},t),null==e||e.cancel(),e=void 0,et.reset(),st.init(),Ms.forEach(t=>t.lock());let n=null,i=[];try{n=function(t,e){const{mirror:n=new ur,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:f,maskAllElementAttributes:v=!1,maskAttributeFn:p,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:_,onIframeListenerRegistered:k,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:I=()=>!1,maxDepth:M,inlineStylesheetBudgetRules:R}=e||{},A=!0===h?{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===h?{password:!0}:h,x=Hr(m);Ni(R);try{return Ur(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:A,maskTextFn:d,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:x,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:_,onIframeListenerRegistered:k,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:I,newlyAddedElement:!1,maxDepth:M})}finally{Pi()}}(document,{mirror:po,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:H,inlineStylesheetBudgetRules:d,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOM:q,dataURLOptions:z,recordCanvas:A,canvasMaskingConfigured:rt,inlineImages:D,onSerialize(t){us(t,po)&&nt.addIframe(t),cs(t,po)&&et.trackLinkElement(t),hs(t)&&st.addShadowRoot(wi.shadowRoot(t),document)},onIframeLoad(t,e){nt.attachIframe(t,e),st.observeAttachShadow(t)},onIframeListenerRegistered(t,e){nt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){et.attachLinkElement(t,e)},keepIframeSrcFn:N})}finally{i=Hi()}if(!n)return console.warn("Failed to snapshot the document");if(oo({type:ei.FullSnapshot,data:{node:n,initialOffset:es(window)}},t),Ms.forEach(t=>t.unlock()),lo.onFullSnapshot(),i.length){const t=function(t,e,n){let i=!1,r=null,s=0,o=null;const a=()=>null!==o||t.length>s,l=()=>{const n=t[s];t[s]=null,s+=1,n&&Zr(()=>{o=e.beginDeferredLinkInlining(n,po.getId(n))})},u=()=>{if(!o)return;const t=o;let e=!0;Zr(()=>{e=t.advance(200)}),e&&(o=null)},c=()=>{o||l(),u()},h=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==o||o.discard(),o=null,Gi(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=go(h):n())};return r=go(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==r||r.cancel(),r=null},flush(){if(i)return;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){o||l();const t=o;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),o=null,c+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==o?1:0);for(let n=s;t.length>n;n++)null!==t[n]&&(e+=1);Gi(e),null==o||o.discard(),o=null}n()}}}(i,et,()=>{e===t&&(e=void 0)});e=t}x&&nt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&et.adoptStyleSheets(document.adoptedStyleSheets,po.getId(document))}finally{Pi()}}};try{const t=[];t.push(Gr("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Gr(e,Si,document));J=e=>{const n=Z.get(e);n&&(n.forEach(e=>{Zr(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),Z.delete(e))},Q=()=>{for(const[t]of Z){const e=po.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==J||J(t)}catch(e){null==J||J(t)}else null==J||J(t)}};const n=t=>{var e;return Is(Ls)({mutationCb:Y,mousemoveCb:(t,e)=>oo({type:ei.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.MouseInteraction},t)}),scrollCb:K,viewportResizeCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.ViewportResize},t)}),inputCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.Input},t)}),mediaInteractionCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.MediaInteraction},t)}),styleSheetRuleCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.StyleSheetRule},t)}),styleDeclarationCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.StyleDeclaration},t)}),canvasMutationCb:tt,fontCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.Font},t)}),selectionCb(t){oo({type:ei.IncrementalSnapshot,data:E({source:ni.Selection},t)})},customElementCb(t){oo({type:ei.IncrementalSnapshot,data:E({source:ni.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:H,inlineStylesheet:h,sampling:k,recordDOM:R,recordCanvas:A,canvasMaskingConfigured:rt,inlineImages:D,userTriggeredOnInput:O,collectFonts:F,doc:t,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y,maskAttributeFn:b,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:q,dataURLOptions:z,mirror:po,iframeManager:nt,stylesheetManager:et,shadowDomManager:st,processedNodeManager:it,canvasManager:lo,ignoreCSSAttributes:P,attributeFilter:j,plugins:(null==L||null===(e=L.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>oo({type:ei.Plugin,data:{plugin:t.name,payload:e}})})))||[]},w)};nt.addLoadListener(e=>{try{const i=po.getId(e),r=n(e.contentDocument);if("function"==typeof r&&(t.push(r),-1!==i)){let t=Z.get(i);t||(t=new Set,Z.set(i,t)),t.add(r)}}catch(t){console.warn(t)}}),nt.addPageHideListener(t=>{const e=po.getId(t);null==J||J(e),Ts(t)});let i=-1;const r=t=>oo({type:ei.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),d=()=>{var t,e,n,s;const o=document,a=null!==(t=null!==(e=null!==(n=null!==(s=o.fullscreenElement)&&void 0!==s?s:o.webkitFullscreenElement)&&void 0!==n?n:o.mozFullScreenElement)&&void 0!==e?e:o.msFullscreenElement)&&void 0!==t?t:null,l=a?po.getId(a):-1;l!==i&&(-1!==i&&r({id:i,enter:!1}),i=l,-1!==l&&r({id:l,enter:!0}))},f=()=>{ao();const e=n(document);"function"==typeof e&&t.push(e),t.push(Gr("fullscreenchange",d)),t.push(Gr("webkitfullscreenchange",d)),t.push(Gr("mozfullscreenchange",d)),t.push(Gr("MSFullscreenChange",d)),fo=!0};return["interactive","complete"].includes(document.readyState)?f():(t.push(Gr("DOMContentLoaded",()=>{oo({type:ei.DomContentLoaded,data:{}}),"DOMContentLoaded"===T&&f()})),t.push(Gr("load",()=>{oo({type:ei.Load,data:{}}),"load"===T&&f()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Jr(t),it.destroy(),nt.removeLoadListener(),nt.destroy(),Z.clear(),st.reset(),po.reset(),fo=!1,Cs()}}catch(t){console.warn(t)}}yo.addCustomEvent=(t,e)=>{if(!fo)throw new Error("please add custom event after start recording");oo({type:ei.Custom,data:{tag:t,payload:e}})},yo.freezePage=()=>{Ms.forEach(t=>t.freeze())},yo.takeFullSnapshot=t=>{if(!fo)throw new Error("please take full snapshot after start recording");ao(t)},yo.mirror=po,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var bo=Object.create(null);function wo(t){return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(t)}function _o(t,e,n){return(e=function(t){var e=function(t){if("object"!=wo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wo(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}bo.Node=Object.create(null),bo.ShadowRoot=Object.create(null),bo.MutationObserver=Object.create(null),bo.Element=Object.create(null);var ko=class{constructor(t){_o(this,"fileName",void 0),_o(this,"functionName",void 0),_o(this,"lineNumber",void 0),_o(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},So=/(^|@)\S+:\d+/,Co=/^\s*at .*(\S+:\d+|\(native\))/m,Io=/^(eval@)?(\[native code])?$/,Mo={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Co)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(Co)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new ko({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Io)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new ko({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new ko({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new ko({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new ko({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(So)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new ko({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Ro(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function Ao(t){return Array.isArray(t)}function xo(t){return"object"==typeof t&&null!==t&&!Ao(t)}function To(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(xo(t[i])&&To(t[i],e-1))return!0;return!1}function Oo(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(xo(s=e)&&Object.keys(s).length>n.numOfKeysLimit||"function"==typeof s||xo(s)&&To(s,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var s;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=Ao(i)?Ro(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Eo={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 Fo(t,e,n){const i=n?Object.assign({},Eo,n):Eo,r=i.logger;if(!r)return()=>{};let s;s="string"==typeof r?e[r]:r;let o=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Mo.parse(e.error).map(t=>t.toString()),payload:[Oo(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[Oo(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Oo("Uncaught (in promise)",i.stringifyOptions),Oo(e.reason,i.stringifyOptions)]),t({level:"error",trace:Mo.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(s,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,s){try{if(!(s in r))return()=>{};const u=r[s],c={next:u},h=(r=>(...s)=>{if(r.apply(e,s),l&&!("assert"===n&&s[0]||a)){a=!0;try{const e=Mo.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?s.slice(1):s).map(t=>Oo(t,i.stringifyOptions));o++,i.lengthThreshold>o?t({level:n,trace:e,payload:r}):o===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Oo("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...s])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[s]=h,()=>{if(r[s]===h)return void(r[s]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[s],n=t(e);for(;n;){if(n.next===h)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var $o=t=>({name:"rrweb/console@1",observer:Fo,options:t});const Do=()=>{},Lo=t=>{var e;if(P(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function No(t,e,n){try{if(!(e in t))return Do;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return P(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],s=Lo(n);for(;s;){if(s.next===r)return void(s.next=i.next);n=s.next,s=Lo(n)}}}catch(t){return Do}}function Po(t,e){var n;const i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}const jo=ot("[Recorder]"),Bo=t=>"navigation"===t.entryType,zo=t=>"resource"===t.entryType;function Wo(t,e){return!!e&&(q(e)||e[t])}function Uo(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Ho=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function qo({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Uo(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Ho))return!1;if(q(e))return!0;if(N(e))return r(e);const s=e[t];return q(s)?s:r(s)}function Go(t,e,n,i,r){return Vo.apply(this,arguments)}function Vo(){return Vo=A(function*(t,e,n,i,r,s=0){if(s>10)return jo.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const o=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>zo(t)&&t.initiatorType===e&&(B(i)||t.startTime>=i)&&(B(r)||r>=t.startTime));return o||(yield new Promise(t=>setTimeout(t,50*s)),Go(t,e,n,i,r,s+1))}),Vo.apply(this,arguments)}function Zo({body:t,options:e,url:n}){if(U(t))return null;const{hostname:i,isHostDenied:r}=Po(n,e);if(r)return i+" is in deny list";if(z(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(G(t))return function(t,e="&"){let n,i;const r=[];return at(t,function(t,e){B(t)||B(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)}(t);if(j(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Jo=t=>!W(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qo({entry:t,method:e,status:n,networkRequest:i,isInitial:r,start:s,end:o,url:a,initiatorType:l}){s=t?t.startTime:s,o=t?t.responseEnd:o;const u=Math.floor(Date.now()-performance.now()),c=Math.floor(u+(s||0)),h=[E(E({},t?t.toJSON():{name:a}),{},{startTime:B(s)?void 0:Math.round(s),endTime:B(o)?void 0:Math.round(o),timeOrigin:u,timestamp:c,method:e,initiatorType:l||(t?t.initiatorType:void 0),status:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:r})];if(Jo(t))for(const e of t.serverTiming||[])h.push({timeOrigin:u,timestamp:c,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const Xo=["video/","audio/"];function Yo(t){return j(t)&&P(t.getReader)&&P(t.tee)}const Ko="[SessionReplay] Timeout while trying to read body",ta="[SessionReplay] Failed to read body";function ea(t){return`${ta}: ${t}`}function na(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function ia(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Ko),500);try{t.clone().text().then(t=>e(t),t=>e(ea(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(ta)}})}(t);const n=wt(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const s=parseInt(r,10);return Number.isFinite(s)&&s>e}catch(t){return!1}}(t,n)?Promise.resolve(na(n)):function(t,e){return new Promise(n=>{let i,r=!1;function s(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function o(t){r||(r=!0,clearTimeout(a),s(),n(t))}const a=setTimeout(()=>o(Ko),500);let l;try{l=t.clone()}catch(t){return void o(ta)}const u=l.body;if(!Yo(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>o(t),t=>o(ea(t)))}catch(t){o(ta)}return}try{i=u.getReader()}catch(t){return void o(ta)}const c=[];let h=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)s();else if(n)o((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,h)));else{if(i){if(h+i.byteLength>e)return void o(na(e));h+=i.byteLength,c.push(i)}t()}},t=>o(ea(t)))}()})}(t,n)}function ra(){return(ra=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Po(n,e);return r?Promise.resolve(i+" is in deny list"):ia(t,e)})).apply(this,arguments)}function sa(){return(sa=A(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),s=Xo.some(t=>null==r?void 0:r.startsWith(t));if(r&&s)return`Content-Type ${r} is not supported`;const{hostname:o,isHostDenied:a}=Po(n,e);return a?o+" is in deny list":null}({r:t,options:e,url:n});return W(i)?ia(t,e):Promise.resolve(i)})).apply(this,arguments)}let oa=null;function aa(t,e,n){if(!("performance"in e))return()=>{};if(oa)return jo.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},_t,n):_t;let r=!0;const s=e=>{if(!r)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;const r=i.maskRequestFn(t);e||(s=!r||(t=>!!t&&xt.has(t))(r)),r&&n.push(r)}),n.length>0&&t(E(E({},e),{},{requests:n}))},o=function(t,e,n){n.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>Bo(t)||zo(t)&&n.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});const i=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>Bo(t)||zo(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),r=PerformanceObserver.supportedEntryTypes.filter(t=>n.performanceEntryTypeToObserve.includes(t));return i.observe({entryTypes:r}),()=>{i.disconnect()}}(s,e,i);let a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Wo("request",n.recordHeaders),r=Wo("response",n.recordHeaders),s=No(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l=!0,u,c){const h=this;try{const s=new Request(a),l={};let u,c;const d={},f=h.setRequestHeader.bind(h);h.setRequestHeader=(t,e)=>(d[t]=e,f(t,e)),i&&(l.requestHeaders=d);const v=h.send.bind(h);h.send=t=>(qo({type:"request",headers:d,url:a,recordBody:n.recordBody})&&(l.requestBody=Zo({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{h.removeEventListener("readystatechange",m),h.removeEventListener("error",p),h.removeEventListener("abort",p),h.removeEventListener("timeout",p)},m=()=>{if(h.readyState!==h.DONE)return;p(),c=e.performance.now();const i={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),qo({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=Zo({body:h.response,options:n,url:a})),Go(e,"xmlhttprequest",s.url,u,c).then(e=>{t({requests:Qo({entry:e,method:o,status:null==h?void 0:h.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};h.addEventListener("readystatechange",m),h.addEventListener("error",p),h.addEventListener("abort",p),h.addEventListener("timeout",p)}catch(t){jo.error("Failed to instrument XHR for network capture",t)}s.call(h,o,a.toString(),l,u,c)});return()=>{s()}}(s,e,i),l=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Wo("request",n.recordHeaders),r=Wo("response",n.recordHeaders),s=No(e,"fetch",s=>function(){var o=A(function*(o,a){let l,u;try{l=new Request(o,a)}catch(t){return jo.error("Failed to instrument fetch for network capture",t),s(o,a)}const c={};let h,d;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!Yo(null==a?void 0:a.body)&&qo({type:"request",headers:t,url:o,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return ra.apply(this,arguments)}({r:l,options:n,url:o}))}catch(t){jo.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Uo(o)?yield s(l):yield s(o,a),d=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),qo({type:"response",headers:t,url:o,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return sa.apply(this,arguments)}({r:u,options:n,url:o}))}catch(t){jo.error("Failed to record fetch response for network capture",t)}return u}finally{Go(e,"fetch",l.url,h,d).then(e=>{t({requests:Qo({entry:e,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return o.apply(this,arguments)}}());return()=>{s()}}(s,e,i)),oa=()=>{r=!1,o(),a(),l(),oa=null},oa}const la=t=>({name:"rrweb/network@1",observer:aa,options:t});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:$o,getRecordNetworkPlugin:la},s.__PosthogExtensions__.rrweb={record:yo,version:"v2",wasMaxDepthReached:()=>Wr,resetMaxDepthState(){Wr=!1,zr=!1},getLastSnapshotCost:()=>Ti,getMutationCost:()=>E({},Di),resetSnapshotCostState(){Mi=0,Ri=0,Ai=0,ki=0,xi={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ti=null,Oi=null,Ei=[],Fi=0,$i=0,Di={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:yo,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:$o},s.getRecordNetworkPlugin=la,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(t,e)=>new Kn(t,e)}();
1
+ !function(){const t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,n=null==e?void 0:e.document,i=null==e?void 0:e.location;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;const r="undefined"!=typeof globalThis?globalThis:t;r&&"undefined"==typeof self&&(r.self=r),r&&"undefined"==typeof File&&(r.File=function(){});const s=null!=t?t:{},o="$replay_override_sampling",a="$replay_override_linked_flag",l="$replay_override_url_trigger",u="$replay_override_event_trigger",c="$session_is_sampled",h="$session_recording_url_trigger_activated_session",d="$session_recording_event_trigger_activated_session",f="$posthog_sr_group_event_trigger_",v="$posthog_sr_group_url_trigger_",p="$sess_rec_flush_size",m="$stored_person_properties",g="$sdk_debug_replay_event_trigger_status",y="$sdk_debug_replay_linked_flag_trigger_status",b="$sdk_debug_replay_matched_recording_trigger_groups",w="$sdk_debug_replay_pending_trigger_conditions",_="$sdk_debug_replay_remote_trigger_matching_config",k="$sdk_debug_replay_trigger_groups_count",S="$sdk_debug_replay_url_trigger_status",C="$sdk_debug_rrweb_attached",I="$sdk_debug_rrweb_start_attempted",M="$session_recording_start_reason";function R(t,e,n,i,r,s,o){try{var a=t[s](o),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function A(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var s=t.apply(e,n);function o(t){R(s,i,r,o,a,"next",t)}function a(t){R(s,i,r,o,a,"throw",t)}o(void 0)})}}function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function T(t,e,n){return(e=function(t){var e=function(t){if("object"!=x(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==x(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function E(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach(function(e){T(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}const F=Object.prototype,D=F.hasOwnProperty,L=F.toString,N=Array.isArray||function(t){return"[object Array]"===L.call(t)},P=t=>"function"==typeof t,j=t=>t===Object(t)&&!N(t),B=t=>void 0===t,z=t=>"[object String]"==L.call(t),W=t=>null===t,U=t=>B(t)||W(t),H=t=>"[object Number]"==L.call(t)&&t==t,q=t=>"[object Boolean]"===L.call(t),G=t=>t instanceof FormData;function V(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),H(t)?t>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),V(null!=r?r:n,e,n,i))}var Z=class{constructor(t){this.C={},this.I=t.I,this.R=V(t.bucketSize,0,100,t.$),this.A=V(t.refillRate,0,this.R,t.$),this.O=V(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}consumeRateLimit(t){var e;const n=Date.now(),i=String(t);let r=this.C[i];return r?this.F(r,n):(r={tokens:this.R,lastAccess:n},this.C[i]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(e=this.I)||void 0===e||e.call(this,t)),0===r.tokens)}stop(){this.C={}}};function J(t){return t?t.split("#")[0]:t}const Q="NativeGzipValidationError";let X;const Y=t=>{throw function(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return n}(Q,`Native gzip produced invalid output: ${t}`)},K=(tt=A(function*(t,e){18>t.size&&Y("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());var i;(2>(i=n).length||31!==i[0]||139!==i[1]||8!==n[2])&&Y("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{const e=(()=>{if(X)return X;X=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?3988292384^e>>>1:e>>>1;X[t]=e>>>0}return X})();let n=4294967295;for(let i=0;t.length>i;i++)n=e[255&(n^t[i])]^n>>>8;return(4294967295^n)>>>0})(e)&&Y("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&Y("invalid-size")}),function(t,e){return tt.apply(this,arguments)});var tt;function et(){return et=A(function*(t,e=!0,n){try{const e=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),r=n.writable.getWriter(),s=r.write(e).then(()=>r.close()).catch((i=A(function*(t){try{yield r.abort(t)}catch(t){}throw t}),function(t){return i.apply(this,arguments)})),o=new Response(n.readable).blob(),[a]=yield Promise.all([o,s]);return yield K(a,e),a}catch(t){if(null==n?void 0:n.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}var i}),et.apply(this,arguments)}const nt="0.8.3",it={DEBUG:!1,LIB_VERSION:nt,LIB_NAME:"browser-common",JS_SDK_VERSION:nt},rt=(e,{debugEnabled:n}={})=>{const i={N(i,...r){t&&(it.DEBUG||t.POSTHOG_DEBUG||n)&&!B(t.console)&&t.console&&("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i])(e,...r)},debug(...t){i.N("debug",...t)},info(...t){i.N("log",...t)},warn(...t){i.N("warn",...t)},error(...t){i.N("error",...t)},critical(...t){console.error(e,...t)},uninitializedWarning(t){i.error(`You must initialize PostHog before calling ${t}`)},createLogger:(t,n)=>rt(`${e} ${t}`,n)};return i},st=rt("[PostHog.js]"),ot=st.createLogger;function at(t,e){if(!U(t))if(N(t))t.forEach(e);else if(G(t))t.forEach((t,n)=>e(t,n));else for(const n in t)D.call(t,n)&&e(t[n],n)}function lt(t,e,n,i){const{capture:r=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,n,{capture:r,passive:s})}const ut=["localhost","127.0.0.1"],ct=t=>{const e=null==n?void 0:n.createElement("a");return B(e)?null:(e.href=t,e)};function ht(e){var n;const i=null==t||null===(n=t.location)||void 0===n?void 0:n.href;return B(i)?void 0:function(t,e){var n;const i=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!P(i))return e;try{const t=i(e);return z(t)&&t?t:e}catch(t){return st.error("Error in get_current_url, falling back to window.location.href",t),e}}(e,i)}const dt=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),ft=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,vt=[16,15,14,13],pt=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),mt=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),gt=/[0-9A-Za-z_]/;function yt(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}const bt=1e6;function wt(t){var e;return Math.min(bt,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:bt)}const _t={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:bt,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},kt=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],St=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ct=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],It=t=>{U(t)||at(Object.keys(t),e=>{(t=>{const e=t.toLowerCase();return kt.includes(e)||Ct.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Mt=["/s/","/e/","/i/"];function Rt(t,e,n,i){if(U(t))return t;let r=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return z(r)&&(r=parseInt(r)),r>n?`[SessionRecording] ${i} body too large to record (${r} bytes)`:t}function At(t,e){if(U(t))return t;let n=t;return function(t,e=!0){if(U(t))return!1;if(z(t)){if(t=t.trim(),e?dt.test((t||"").replace(/[- ]/g,"")):function(t){let e;for(ft.lastIndex=0;e=ft.exec(t);){const t=e[2];if(!t)continue;const n=t.replace(/[- ]/g,"");for(let t=0;n.length>t;t++)for(const e of vt){const i=t+e;if(n.length>=i){const e=n.slice(t,i);if(dt.test(e)&&yt(e))return!0}}}return!1}(t))return!1;if(e?pt.test(t):function(t){let e;for(mt.lastIndex=0;e=mt.exec(t);){const t=e[1],n=e[3];if(!(t&&n&&gt.test(t)&&gt.test(n)))return!0}return!1}(t))return!1}return!0}(n,!1)||(n="[SessionRecording] "+e+" body redacted"),at(St,t=>{(null==n?void 0:n.length)&&-1!==(null==n?void 0:n.indexOf(t))&&(n="[SessionRecording] "+e+" body redacted as might contain: "+t)}),n}const xt=new WeakSet,Tt="disabled",Ot="sampled",Et="active",Ft="buffering",$t="paused",Dt="rrweb_error",Lt="trigger_activated",Nt="trigger_pending",Pt="trigger_disabled";function jt(t,e,n,i,r,s){return 0===e?Pt:(null==t?void 0:t.get_property(n?i+n:r))===s?Lt:Nt}function Bt(t,e,n){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==n?void 0:n.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function zt(t){return t.includes("trigger_activated")?Lt:t.includes("trigger_pending")?Nt:Pt}function Wt(t){const e=new Set(t);switch(e.delete(Pt),e.size){case 0:return Pt;case 1:return Array.from(e)[0];default:return Nt}}var Ut=class{constructor(t){this.q=t}triggerStatus(t){return zt(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return zt(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},Ht=class{constructor(t){this.q=t}triggerStatus(t){return Wt(this.q.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Wt(this.q.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.q.forEach(t=>t.stop())}},qt=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Lt}stop(){}};const Gt=t=>"sessionRecording"in t;var Vt=class{constructor(t,e){this._instance=t,this.j=[],this.B=[],this.H=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,n;this.j=(Gt(t)?j(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.B=(Gt(t)?j(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){this.H.clear(),this.U.clear();for(const t of this.j)if("regex"===t.matching&&!this.H.has(t.url))try{this.H.set(t.url,new RegExp(t.url))}catch(e){st.error("Invalid URL trigger regex pattern:",t.url,e)}for(const t of this.B)if("regex"===t.matching&&!this.U.has(t.url))try{this.U.set(t.url,new RegExp(t.url))}catch(e){st.error("Invalid URL blocklist regex pattern:",t.url,e)}}onRemoteConfig(t){this.onConfig(t)}G(t){return jt(this._instance,this.j.length,this.V,v,h,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[S]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){const t=ht(this._instance);if(!t)return!1;try{return Bt(t,this.B,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){const n=ht(this._instance);if(!n)return;if(n===this.W)return;this.W=n;const i=this.urlBlocked,r=Bt(n,this.B,this.U);i&&r||(r&&!i?t():!r&&i&&e())}checkUrlTriggerConditions(t,e,n,i){const r=ht(this._instance);if(!r)return;if(r===this.W)return;this.W=r;const s=this.urlBlocked,o=Bt(r,this.B,this.U);o&&!s?t():!o&&s&&e();const a=this.G(i)===Lt,l=Bt(r,this.j,this.H);!a&&l&&n("url",r)}stop(){this.W=""}},Zt=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){const t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[y]:t}),t}triggerStatusNoSideEffects(){let t=Nt;return U(this.linkedFlag)&&(t=Pt),this.linkedFlagSeen&&(t=Lt),t}onConfig(t,e){var n;if(this.linkedFlag=(Gt(t)?j(t.sessionRecording)?null===(n=t.sessionRecording)||void 0===n?void 0:n.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!U(this.linkedFlag)&&!this.linkedFlagSeen){const t=z(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=z(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((i,r)=>{let s=!1;if(j(r)&&t in r){const e=r[t];s=q(e)?!0===e:n?e===n:!!e}const o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(t,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},Jt=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Gt(t)?j(t.sessionRecording)?null===(e=t.sessionRecording)||void 0===e?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return jt(this._instance,this.K.length,this.V,f,d,t)}triggerStatus(t){const e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[g]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,n){if(0===this.K.length)return;const i=this.X(n)===Lt,r=this.K.includes(t);!i&&r&&e("event",t)}stop(){}},Qt=class{constructor(t,e,n){if(this._instance=t,this.group=e,this.Y=new Vt(t,e.id),this.tt=new Jt(t,e.id),this.et=new Zt(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){const t=(e.conditions.events||[]).map(t=>t.name),i={urlTriggers:e.conditions.urls||[],eventTriggers:t,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(i),this.tt.onConfig(i),this.et.onConfig(i,n);const r=[this.tt,this.Y,this.et];this.nt="any"===e.conditions.matchType?new Ut(r):new Ht(r)}else this.nt=new qt}triggerStatus(t){return this.nt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.nt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Nt).map(({label:t})=>t)}checkEventTriggerConditions(t,e,n){this.tt.checkEventTriggerConditions(t,e,n)}checkUrlTriggerConditions(t,e,n,i){this.Y.checkUrlTriggerConditions(t,e,n,i)}activateTrigger(t,e){var n;const i="url"===t?v+this.group.id:f+this.group.id;null===(n=this._instance.persistence)||void 0===n||n.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function Xt(t){if(t.rrwebError)return Dt;if(!t.receivedFlags)return Ft;if(!t.isRecordingEnabled)return Tt;if(t.urlTriggerMatching.urlBlocked)return $t;const e=!0===t.isSampled,n=new Ut([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ot:"trigger_activated"===n?Et:"trigger_pending"===n?Ft:!1===t.isSampled?Tt:Et}function Yt(t){if(t.rrwebError)return Dt;if(!t.receivedFlags)return Ft;if(!t.isRecordingEnabled)return Tt;if(t.urlTriggerMatching.urlBlocked)return $t;const e=new Ht([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),n=e!==Pt,i=q(t.isSampled);return n&&"trigger_pending"===e?Ft:n&&"trigger_disabled"===e||i&&!t.isSampled?Tt:!0===t.isSampled?Ot:Et}function Kt(){const t=[];return function(e,n){if(j(n)||N(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n}}function te(t){const e=JSON.stringify(t,Kt());return e?new Blob([e]).size:0}function ee(t){if(W(t))return 4;if(B(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":{if(N(t)){let e=2;for(let n=0;t.length>n;n++){n>0&&(e+=1);const i=t[n];e+=B(i)||W(i)?4:ee(i)}return e}const e=t;let n=2,i=!0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const r=e[t];B(r)||(i||(n+=1),i=!1,n+=t.length+3+ee(r))}return n}default:return 0}}function ne(t,e=6606028.8){if(t.size>=e&&t.data.length>1){const e=Math.floor(t.data.length/2),n=t.sizes.slice(0,e),i=t.sizes.slice(e);return[ne({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(0,e),sizes:n,sessionId:t.sessionId,windowId:t.windowId}),ne({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(e),sizes:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var ie=Uint8Array,re=Uint16Array,se=Uint32Array,oe=new ie([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]),ae=new ie([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]),le=new ie([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ue=function(t,e){for(var n=new re(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new se(n[30]);for(i=1;30>i;++i)for(var s=n[i];n[i+1]>s;++s)r[s]=s-n[i]<<5|i;return[n,r]},ce=ue(oe,2),he=ce[1];ce[0][28]=258,he[258]=28;for(var de=ue(ae,0)[1],fe=new re(32768),ve=0;32768>ve;++ve){var pe=(43690&ve)>>>1|(21845&ve)<<1;fe[ve]=((65280&(pe=(61680&(pe=(52428&pe)>>>2|(13107&pe)<<2))>>>4|(3855&pe)<<4))>>>8|(255&pe)<<8)>>>1}var me=function(t,e,n){for(var i=t.length,r=0,s=new re(e);i>r;++r)++s[t[r]-1];var o,a=new re(e);for(r=0;e>r;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new re(1<<e);var l=15-e;for(r=0;i>r;++r)if(t[r])for(var u=r<<4|t[r],c=e-t[r],h=a[t[r]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[fe[h]>>>l]=u}else for(o=new re(i),r=0;i>r;++r)o[r]=fe[a[t[r]-1]++]>>>15-t[r];return o},ge=new ie(288);for(ve=0;144>ve;++ve)ge[ve]=8;for(ve=144;256>ve;++ve)ge[ve]=9;for(ve=256;280>ve;++ve)ge[ve]=7;for(ve=280;288>ve;++ve)ge[ve]=8;var ye=new ie(32);for(ve=0;32>ve;++ve)ye[ve]=5;var be=me(ge,9,0),we=me(ye,5,0),_e=function(t){return(t/8|0)+(7&t&&1)},ke=function(t,e,n){(null==e||0>e)&&(e=0),(null==n||n>t.length)&&(n=t.length);var i=new(t instanceof re?re:t instanceof se?se:ie)(n-e);return i.set(t.subarray(e,n)),i},Se=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},Ce=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},Ie=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,s=n.slice();if(!r)return[new ie(0),0];if(1==r){var o=new ie(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=n[n[h].f>n[u].f?u++:h++],l=n[u!=c&&n[h].f>n[u].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;r>i;++i)s[i].s>d&&(d=s[i].s);var f=new re(d+1),v=Me(n[c-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(s.sort(function(t,e){return f[e.s]-f[t.s]||t.f-e.f});r>i;++i){var y=s[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new ie(f),v]},Me=function(t,e,n){return-1==t.s?Math.max(Me(t.l,e,n+1),Me(t.r,e,n+1)):e[t.s]=n},Re=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new re(++e),i=0,r=t[0],s=1,o=function(t){n[i++]=t},a=1;e>=a;++a)if(t[a]==r&&a!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[a]}return[n.subarray(0,i),e]},Ae=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},xe=function(t,e,n){var i=n.length,r=_e(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;i>s;++s)t[r+s+4]=n[s];return 8*(r+4+i)},Te=function(t,e,n,i,r,s,o,a,l,u,c){Se(e,c++,n),++r[256];for(var h=Ie(r,15),d=h[0],f=h[1],v=Ie(s,15),p=v[0],m=v[1],g=Re(d),y=g[0],b=g[1],w=Re(p),_=w[0],k=w[1],S=new re(19),C=0;y.length>C;++C)S[31&y[C]]++;for(C=0;_.length>C;++C)S[31&_[C]]++;for(var I=Ie(S,7),M=I[0],R=I[1],A=19;A>4&&!M[le[A-1]];--A);var x,T,O,E,F=u+5<<3,D=Ae(r,ge)+Ae(s,ye)+o,L=Ae(r,d)+Ae(s,p)+o+14+3*A+Ae(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(D>=F&&L>=F)return xe(e,c,t.subarray(l,l+u));if(Se(e,c,1+(D>L)),c+=2,D>L){x=me(d,f,0),T=d,O=me(p,m,0),E=p;var N=me(M,R,0);for(Se(e,c,b-257),Se(e,c+5,k-1),Se(e,c+10,A-4),c+=14,C=0;A>C;++C)Se(e,c+3*C,M[le[C]]);c+=3*A;for(var P=[y,_],j=0;2>j;++j){var B=P[j];for(C=0;B.length>C;++C)Se(e,c,N[z=31&B[C]]),c+=M[z],z>15&&(Se(e,c,B[C]>>>5&127),c+=B[C]>>>12)}}else x=be,T=ge,O=we,E=ye;for(C=0;a>C;++C)if(i[C]>255){var z;Ce(e,c,x[257+(z=i[C]>>>18&31)]),c+=T[z+257],z>7&&(Se(e,c,i[C]>>>23&31),c+=oe[z]);var W=31&i[C];Ce(e,c,O[W]),c+=E[W],W>3&&(Ce(e,c,i[C]>>>5&8191),c+=ae[W])}else Ce(e,c,x[i[C]]),c+=T[i[C]];return Ce(e,c,x[256]),c+T[256]},Oe=new se([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ee=new ie(0),Fe=function(){for(var t=new se(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),$e=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function De(t,e){void 0===e&&(e={});var n=function(){var t=4294967295;return{p(e){for(var n=t,i=0;e.length>i;++i)n=Fe[255&n^e[i]]^n>>>8;t=n},d(){return 4294967295^t}}}(),i=t.length;n.p(t);var r,s,o,a,l,u,c=(a=10+((r=e).filename&&r.filename.length+1||0),l=8,function(t,e,n,i,r,s){var o=t.length,a=new ie(i+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(i,a.length-r),u=0;if(!e||8>o)for(var c=0;o>=c;c+=65535){var h=c+65535;o>h?u=xe(l,u,t.subarray(c,h)):(l[c]=s,u=xe(l,u,t.subarray(c,o)))}else{for(var d=Oe[e-1],f=d>>>13,v=8191&d,p=(1<<n)-1,m=new re(32768),g=new re(p+1),y=Math.ceil(n/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},_=new se(25e3),k=new re(288),S=new re(32),C=0,I=0,M=(c=0,0),R=0,A=0;o>c;++c){var x=w(c),T=32767&c,O=g[x];if(m[T]=O,g[x]=T,c>=R){var E=o-c;if((C>7e3||M>24576)&&E>423){u=Te(t,l,0,_,k,S,I,M,A,c-A,u),M=C=I=0,A=c;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var D=2,L=0,N=v,P=T-O&32767;if(E>2&&x==w(c-P))for(var j=Math.min(f,E)-1,B=Math.min(32767,c),z=Math.min(258,E);B>=P&&--N&&T!=O;){if(t[c+D]==t[c+D-P]){for(var W=0;z>W&&t[c+W]==t[c+W-P];++W);if(W>D){if(D=W,L=P,W>j)break;var U=Math.min(P,W-2),H=0;for(F=0;U>F;++F){var q=c-P+F+32768&32767,G=q-m[q]+32768&32767;G>H&&(H=G,O=q)}}}P+=(T=O)-(O=m[T])+32768&32767}if(L){_[M++]=268435456|he[D]<<18|de[L];var V=31&he[D],Z=31&de[L];I+=oe[V]+ae[Z],++k[257+V],++S[Z],R=c+D,++C}else _[M++]=t[c],++k[t[c]]}}u=Te(t,l,s,_,k,S,I,M,A,c-A,u),s||(u=xe(l,u,Ee))}return ke(a,0,i+_e(u)+r)}(s=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l,!u)),h=c.length;return function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&$e(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;n.length>=i;++i)t[i+10]=n.charCodeAt(i)}}(c,e),$e(c,h-8,n.d()),$e(c,h-4,i),c}function Le(t,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var r=t[i++];128>r||e?n+=String.fromCharCode(r):224>r?n+=String.fromCharCode((31&r)<<6|63&t[i++]):240>r?n+=String.fromCharCode((15&r)<<12|(63&t[i++])<<6|63&t[i++]):(r=((15&r)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}var Ne=class{constructor(t,e={}){var n,i,r,s;this._rrweb=t,this.it=e,this.rt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{const t=Date.now(),e=t-this.ot;e>0?(this.ct=Math.min(this.dt,this.ct+e/1e3*this.ht),this.ot=t):this.ot=t},this.ft=t=>{if(!this.rt[t]){var e,n;this.rt[t]=!0;const i=this.vt(t);null===(e=(n=this.it).onBlockedNode)||void 0===e||e.call(n,t,i)}},this.yt=t=>{const e=this.vt(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){const t=e.closest("svg");if(t)return[this._rrweb.mirror.getId(t),t]}return[t,e]},this.vt=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,n,i,r,s,o,a,l;return(null!==(e=null===(n=t.removes)||void 0===n?void 0:n.length)&&void 0!==e?e:0)+(null!==(i=null===(r=t.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(s=null===(o=t.texts)||void 0===o?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null===(l=t.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;const e=t.data,n=this.bt(e);if(e.attributes){const t=e.attributes.length;e.attributes=e.attributes.filter(t=>{const[e]=this.yt(t.id);return!this.wt.consumeRateLimit(e)&&t});const n=t-e.attributes.length;var i,r;n>0&&(null===(i=(r=this.it).onDroppedAttributeMutations)||void 0===i||i.call(r,n))}const s=this.bt(e);if(0===s&&n!==s)return;if(this.kt)return t;this.ut();const o=ee(t);var a,l;return o>this.ct?(null===(a=(l=this.it).onDroppedOversizedMutation)||void 0===a||a.call(l,o),void this._t()):(this.ct-=o,t)},this._t=()=>{if(this.St)return;const t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null===(t=(e=this.it).requestFullSnapshot)||void 0===t||t.call(e)},t)},this.wt=new Z({bucketSize:null!==(n=this.it.bucketSize)&&void 0!==n?n:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.ft,$:st}),this.dt=null!==(r=this.it.bytesBucketSize)&&void 0!==r?r:0,this.ht=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.dt)||0>=this.dt,this.ct=this.dt;const o=this.it.resyncIntervalMs;this.xt=H(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.rt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ct=this.dt,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return H(t)&&isFinite(t)&&Math.floor(t)===t}),t&&!B(t.crypto)&&crypto;let Pe=null;const je={Et(){if(!W(Pe))return Pe;if(Pe=!0,B(t))Pe=!1;else try{const t="__support__";je.At(t,"xyz"),'"xyz"'!==je.Ot(t)&&(Pe=!1),je.Lt(t)}catch(t){Pe=!1}return Pe},Pt(t){st.error("sessionStorage error: ",t)},Ot(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){je.Pt(t)}return null},Dt(t){try{return JSON.parse(je.Ot(t))||null}catch(t){}return null},At(e,n){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(n)),!0}catch(t){je.Pt(t)}return!1},Lt(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){je.Pt(t)}}};it.DEBUG=!1,it.LIB_VERSION="1.433.3",it.LIB_NAME="web";var Be=it,ze=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ft=t.get_property.bind(t),this.Nt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Nt(p,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){const e=this.Ft(p);return j(n=e)&&z(n.sessionId)&&H(n.size)&&e.sessionId===t?e.size:0;var n}};function We(t,e){return function(t){let e=0;for(let n=0;t.length>n;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)}(t)%100<V(100*e,0,100,st)}const Ue=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},He=t=>t.toLowerCase(),qe={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Ue(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Ue(e,t))),icontains:(t,e)=>e.map(He).some(e=>t.map(He).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(He).every(e=>t.map(He).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})},Ge=new Set(["is_not","not_icontains","not_regex"]);function Ve(t,e,n){return!t||0===t.length||t.every(t=>{const i="person"===t.type?n:e,r=null==i?void 0:i[t.key],s=t.operator||"exact";if(B(r)||W(r))return Ge.has(s);const o=qe[s];return!!o&&!B(t.value)&&!W(t.value)&&o(N(t.value)?t.value.map(String):[String(t.value)],N(r)?r.map(String):[String(r)])})}const Ze=ot("[SessionRecording]");function Je(t,e){return e?t:"!"+t}function Qe(t,e){return t===e||t!=="!"+e&&null}var Xe=class{constructor(t,e,n,i,r,s,o){this._instance=t,this.Y=e,this.tt=n,this.et=i,this.qt=r,this.jt=s,this.Bt=o,this.Ht=null,this.zt=Yt}onRemoteConfig(t){this.Ht=H(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new Ut([this.tt,this.Y]),this.zt=Xt):(this.Ut=new Ht([this.tt,this.Y]),this.zt=Yt),this._instance.register_for_session({[_]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.qt("linked_flag_matched",{flag:t,variant:e}),this.Bt()})}getStatus(t){return this.zt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){const e=this._instance.get_property("$session_recording_remote_config"),n=null==e?void 0:e.minimumDurationMilliseconds;return H(n)?n:null}checkUrlTriggers(t,e,n,i){this.Y.checkUrlTriggerConditions(e,n,i,t)}setupEventTriggerListeners(t,e,n){if(0!==this.tt.K.length&&U(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,n,e)}catch(t){Ze.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e;const n=this.Ht;var i,r;if(!H(n))return null===(i=this._instance.persistence)||void 0===i||i.unregister("$session_is_sampled"),void(null===(r=this._instance.persistence)||void 0===r||r.unregister("$replay_sample_rate"));const s=this._instance.get_property(c),o=this._instance.get_property("$replay_sample_rate"),a=Qe(s,t),l=H(o)&&o!==n,u=B(o)&&s===t,h=l||u||!q(a),d=h?We(t,n):a;h&&(d?this.qt("sampled"):Ze.warn(`Sample rate (${n}) has determined that this sessionId (${t}) will not be sent to the server.`)),null===(e=this._instance.persistence)||void 0===e||e.register({$session_is_sampled:Je(t,d),$replay_sample_rate:W(o)&&s===t?null:n})}ensureSamplingDecision(t){if(!H(this.Ht))return;const e=this._instance.get_property(c);q(Qe(e,t))||this.makeSamplingDecisions(t)}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,n,i,r;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_recording_event_trigger_activated_session"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$session_recording_url_trigger_activated_session"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_is_sampled"),null===(i=this._instance.persistence)||void 0===i||i.unregister("$replay_sample_rate"),null===(r=this._instance.persistence)||void 0===r||r.unregister("$session_past_minimum_duration")}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null===(e=this.Ut)||void 0===e?void 0:e.triggerStatus(t))===Nt}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(({status:t})=>t===Nt).map(({label:t})=>t)}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},Ye=class{constructor(t,e,n,i,r){this._instance=t,this.Y=e,this.qt=n,this.Vt=i,this.Bt=r,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[_]:"v2_trigger_groups",[k]:t.triggerGroups.length}),this.Y.onConfig(t)):Ze.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Dt;if(!t.receivedFlags)return Ft;if(!t.isRecordingEnabled)return Tt;if(t.urlTriggerMatching.urlBlocked)return $t;const e=t.triggerGroupMatchers,n=t.triggerGroupSamplingResults;if(0===e.length)return Tt;let i=!1,r=!1;for(const s of e){const e=s.triggerStatus(t.sessionId);if("trigger_activated"===e){const t=s.group.id,e=n.get(t);B(e)?st.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:t}):!0===e&&(r=!0)}else"trigger_pending"===e&&(i=!0)}return r?Ot:i?Ft:Tt}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){let e=null;for(const n of this.Zt)if("trigger_activated"===n.triggerStatus(t)){const t=n.group.minDurationMs;H(t)&&(W(e)||e>t)&&(e=t)}return e}checkUrlTriggers(t,e,n,i){this.Y.checkUrlBlocklist(e,n);for(const i of this.Zt)i.checkUrlTriggerConditions(e,n,e=>{this.Kt(i,void 0)&&(i.activateTrigger(e,t),this.updateActiveTriggers(t),this.Bt(e))},t)}setupEventTriggerListeners(t,e,n){return this.Wt=t(t=>{var n;if(this.Qt)return Ze.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null===(n=this.Wt)||void 0===n||n.call(this),void(this.Wt=void 0);try{for(const n of this.Zt)n.checkEventTriggerConditions(t.event,i=>{if(!this.Kt(n,t.properties))return;const r=(n.group.conditions.events||[]).filter(e=>e.name===t.event),s=this._instance.get_property(m);r.some(e=>!e.properties||0===e.properties.length||Ve(e.properties,t.properties,s))&&(n.activateTrigger(i,e),this.updateActiveTriggers(e),this.Bt(i))},e)}catch(t){Ze.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(const n of this.Zt){var e;const i=n.group,r=i.id,s=i.sampleRate,o="$posthog_sr_group_sampling_"+r,a=this._instance.get_property(o);let l=null,u=!1,c=!1,h=!1;if(j(a)){const e=a.sessionId,n=a.sampleRate,i=a.sampled;u="string"==typeof e&&e!==t,c=H(n)&&n!==s,l=e===t&&H(n)&&n===s&&q(i)?i:null}else l=a===t||null,u="string"==typeof a&&a!==t,h=a===t;const d=u||c||h||!q(l),f=d?We(t+r,s):l;d&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:r,group_name:i.name,sampleRate:s,isSampled:f}),this.Gt.set(r,f),null===(e=this._instance.persistence)||void 0===e||e.register({[o]:{sessionId:t,sampleRate:s,sampled:f}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,n;null===(t=this._instance.persistence)||void 0===t||t.unregister("$session_is_sampled"),null===(e=this._instance.persistence)||void 0===e||e.unregister("$replay_sample_rate"),null===(n=this._instance.persistence)||void 0===n||n.unregister("$session_past_minimum_duration");for(const t of this.Zt){var i,r,s;const e=t.group.id;null===(i=this._instance.persistence)||void 0===i||i.unregister("$posthog_sr_group_event_trigger_"+e),null===(r=this._instance.persistence)||void 0===r||r.unregister("$posthog_sr_group_url_trigger_"+e),null===(s=this._instance.persistence)||void 0===s||s.unregister("$posthog_sr_group_sampling_"+e)}}updateActiveTriggers(t){const e=[];for(const n of this.Zt){const i=n.group,r=i.id,s="trigger_activated"===n.triggerStatus(t),o=!0===this.Gt.get(r);s&&e.push({id:r,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({[b]:e})}hasPendingTriggers(t){for(const e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>`trigger group "${e.group.name}": ${t}`))}stop(){var t;null===(t=this.Wt)||void 0===t||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){const n=t.group.conditions.properties;return!n||0===n.length||Ve(n,e,this._instance.get_property(m))}Jt(t){this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();for(const e of t){const t=new Qt(this._instance,e,(t,n)=>{this.qt("linked_flag_matched",{flag:t,variant:n,group_id:e.id,group_name:e.name}),this.Bt()});this.Zt.push(t)}}};const Ke=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],tn=1e5,en=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,nn=[],rn=()=>!1,sn="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),on="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),an="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),ln="Accommodation AdministrativeArea Country Place State".split(" "),un={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:on,publisher:an},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:nn},Offer:{seller:an},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:an,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:an,areaServed:ln,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:nn}},cn=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),un.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),un.Event],[an,un.Organization],[ln,un.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),un.Product]];function hn(t,e){return D.call(t,e)?t[e]:void 0}function dn(t){const e=typeof t;return W(t)||"string"===e||"number"===e||"boolean"===e}function fn(t,e){return e&&function(t){return z(t)&&/^(https?:\/\/|\/|\.\.?\/)/i.test(t.trim())}(t)?e(t.trim())||void 0:t}function vn(t,e){return N(t)&&t.every(dn)?t.map(t=>fn(t,e)).filter(t=>!B(t)):dn(t)?fn(t,e):void 0}function pn(t,e){if("string"!=typeof t)return;const n=t.trim(),i=n.indexOf("#"),r=0>i?n:n.slice(i+1);if(!(!r||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(n)||n.includes("/")||n.includes("?"))))try{return e(r)?r:void 0}catch(t){return}}function mn(t){if(D.call(un,t))return un[t];for(const[e,n]of cn)if(e.includes(t))return n}function gn(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}function yn(t,e,n,i){if(N(t)){const r=t.map(t=>yn(t,e,n,i)).filter(t=>!B(t));return r.length?r:void 0}return bn(t,e,n,i)||void 0}function bn(t,e,n,i){if(!j(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(n))return null;const r=hn(t,"@type"),s=function(t){const e=new Set,n="string"==typeof t?[t]:N(t)?t:[],i=[];for(const t of n){if("string"!=typeof t)continue;const n=t.replace(/^https?:\/\/schema\.org\//,"");if(100>=n.length&&en.test(n)&&!e.has(n)&&(e.add(n),i.push(n),20===i.length))break}return i}(r),o=s.filter(t=>!!mn(t)&&(!i||!i.length||i.includes(t))),a={};for(const i of sn){const o="@type"===i?s.length?"string"==typeof r?s[0]:s:void 0:"@id"===i?pn(hn(t,i),e):vn(hn(t,i),n.maskUrl);B(o)||gn(a,i,o)}for(const i of o){const r=mn(i);for(const i of Object.keys(r)){const s=hn(t,i),o=r[i];if(!0===o){const t=vn(s,n.maskUrl);B(t)||gn(a,i,t)}else{const t=yn(s,e,n,o);B(t)||gn(a,i,t)}}}const l=yn(hn(t,"@graph"),e,n);return B(l)||gn(a,"@graph",l),Object.keys(a).length?a:null}function wn(t,e,n){if(!j(t))return null;const i=hn(t,"@context");if("string"!=typeof i||!/^https?:\/\/schema\.org\/?$/.test(i))return null;const r=bn(t,e,n);return r?E({"@context":"https://schema.org"},r):null}function _n(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null===(e=t.getAttribute("type"))||void 0===e?void 0:e.trim().toLowerCase())}function kn(t,e,n){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!n&&t.matches(n)}catch(t){return!1}}function Sn(t,e,n){for(let i=t;i;){if(kn(i,e,n))return!0;const t=i.parentNode;i=i.parentElement||(t&&t.nodeType===t.DOCUMENT_FRAGMENT_NODE?t.host:null)}return!1}function Cn(t){return _n(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(_n)}function In(t){return B(t)?void 0:Math.round(t)}function Mn(t){return j(t)?t.network_timing:t}const Rn=ot("[SessionRecording]"),An=[1,2,3,4,5,6,7,12],xn=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Tn(){var t;return null==s||null===(t=s.__PosthogExtensions__)||void 0===t?void 0:t.rrweb}function On(){var t;return null===(t=Tn())||void 0===t?void 0:t.record}function En(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Kt())}}function Fn(t){return Le(De(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new ie(t.length+(t.length>>>1)),i=0,r=function(t){n[i++]=t},s=0;e>s;++s){if(i+5>n.length){var o=new ie(i+8+(e-s<<1));o.set(n),n=o}var a=t.charCodeAt(s);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++s))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return ke(n,0,i)}(En(t))),!0)}function $n(t){return Dn.apply(this,arguments)}function Dn(){return Dn=A(function*(t){const e=yield function(t){return et.apply(this,arguments)}(En(t),Be.DEBUG,{rethrow:!0});return Le(new Uint8Array(yield e.arrayBuffer()),!0)}),Dn.apply(this,arguments)}let Ln,Nn;const Pn="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob;let jn=!1;function Bn(t){var e;return N(t)&&0===t.length?(Ln=null!==(e=Ln)&&void 0!==e?e:Fn([]),Ln):Fn(t)}function zn(t){return Wn.apply(this,arguments)}function Wn(){return(Wn=A(function*(t){var e;return N(t)&&0===t.length?Ln||(Nn=null!==(e=Nn)&&void 0!==e?e:$n([]).then(t=>(Ln=t,t)).catch(t=>{throw Ln=void 0,Nn=void 0,t}),Nn):$n(t)})).apply(this,arguments)}function Un(t){return Pn&&!jn&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Hn(t){return{event:t,size:ee(t)}}function qn(t,e){return E(E({},t),{},{data:e,cv:"2024-10"})}function Gn(t,e){return E(E({},t),{},{cv:"2024-10",data:E(E({},t.data),e)})}function Vn(t){try{if(2===t.type)return Hn(qn(t,Fn(t.data)));if(3===t.type&&0===t.data.source)return Hn(Gn(t,{texts:Bn(t.data.texts),attributes:Bn(t.data.attributes),removes:Bn(t.data.removes),adds:Bn(t.data.adds)}));if(3===t.type&&8===t.data.source)return Hn(Gn(t,{adds:t.data.adds?Fn(t.data.adds):void 0,removes:t.data.removes?Fn(t.data.removes):void 0}))}catch(t){Rn.error("could not compress event - will use uncompressed event",t)}return{event:t,size:te(t)}}function Zn(){return(Zn=A(function*(t){try{if(2===t.type)return Hn(qn(t,yield $n(t.data)));if(3===t.type&&0===t.data.source){const[e,n,i,r]=yield Promise.all([zn(t.data.texts),zn(t.data.attributes),zn(t.data.removes),zn(t.data.adds)]);return Hn(Gn(t,{texts:e,attributes:n,removes:i,adds:r}))}if(3===t.type&&8===t.data.source){const[e,n]=yield Promise.all([t.data.adds?$n(t.data.adds):void 0,t.data.removes?$n(t.data.removes):void 0]);return Hn(Gn(t,{adds:e,removes:n}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;const e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Q})(e)&&(jn=!0),Rn.error("could not compress event asynchronously - trying synchronous compression",e),Vn(t)}return{event:t,size:te(t)}})).apply(this,arguments)}function Jn(t,e){return 5===t.type&&t.data.tag===e}function Qn(t){return Jn(t,"sessionIdle")}function Xn(t){return Jn(t,"$session_ending")}function Yn(t){return Jn(t,"$session_starting")}var Kn=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return Qe(this._instance.get_property(c),this.sessionId)}get Ht(){var t;const e=null===(t=this.ne)||void 0===t?void 0:t.sampleRate;return H(e)?e:null}get ie(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.se=void 0,this.ae=!1,this.le=Date.now(),this.ue=!1,this.ce=[],this.de="unknown",this.he=0,this.fe=0,this.ve=0,this.pe=0,this.me=!1,this.ge=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Ie=!1,this.Te=[],this.Re=void 0,this.$e=void 0,this.Ee=!1,this.Ae=[],this.Oe=0,this.Le=0,this.Pe=!1,this.De=void 0,this.Wt=void 0,this.Fe=void 0,this.Ne=void 0,this.qe=void 0,this.je=(t,e,n)=>{var i,r,s,o;if(!n)return;if(t===this.Xt&&e===this.Be)return;const a=!n.noSessionId&&(n.activityTimeout||n.sessionPastMaximumLength),l=this.Xt,u=this.Be;var c;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le,flushed_size:null===(c=this.He)||void 0===c?void 0:c.currentTrackedSize(l)}),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),this._e=!1,null===(r=Tn())||void 0===r||null===(s=r.resetMaxDepthState)||void 0===s||s.call(r),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:n}),this.ze(),!(!1===this.de&&this.isStarted||this.Xt===t&&this.Be===e)){const e=this.Xt!==t&&!1!==this.de;this.de="unknown",this.Ue(e)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:n,lastActivityTimestamp:this.le}),null===(o=this.re)||void 0===o||o.makeSamplingDecisions(t)},this.We=!1,this.Ve=()=>{var t;return(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$session_past_minimum_duration)===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;const n=null===(t=this.Rt.data[0])||void 0===t?void 0:t.timestamp,i=null===(e=this.Rt.data[this.Rt.data.length-1])||void 0===e?void 0:e.timestamp;return H(n)&&H(i)?i-n:null},this.Ge=()=>{var t,e;const n=this.ie;if(!H(n))return!1;if(null===(t=null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.strictMinimumDuration)||void 0===t||!t){const t=this.Qe;return H(t)&&t>=0&&n>t}if(this.Ve())return!1;const i=this.Ze();return!!W(i)||n>i||(null===(r=this._instance.persistence)||void 0===r||r.register({$session_past_minimum_duration:this.Xt}),!1);var r},this.Je=()=>{"buffering"!==this.status?(this.me&&this.ge&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tn(!0)):this.en()},this.nn=()=>{this.Je()},this.rn=()=>{this.Vt("browser offline",{})},this.sn=()=>{this.Vt("browser online",{})},this.an=()=>{(null==n?void 0:n.visibilityState)&&("visible"===n.visibilityState&&(this.Ke=!0),this.Vt("window "+n.visibilityState,{}))},this.Ke=null==e||e;const{sessionId:i,windowId:r,sessionStartTimestamp:s}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=i,this.Be=r,this._sessionStartTimestamp=s,this.et=new Zt(this._instance),this.Y=new Vt(this._instance),this.tt=new Jt(this._instance),this.Rt=this.en(),this.ln="ph_replay_pending_buffer_"+JSON.stringify([this._instance.config.persistence_name||this._instance.config.token,this._instance.config.token]),this.Yt.sessionTimeoutMs>this.te||Rn.warn(`session_idle_threshold_ms (${this.te}) is greater than the session timeout (${this.Yt.sessionTimeoutMs}). Session will never be detected as idle`),this.He=new ze(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get un(){var t,e,n,i,r,s,o,a,l;const u=null===(t=this.ne)||void 0===t?void 0:t.masking,c={maskAllInputs:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.maskTextSelector,blockSelector:null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.blockSelector,maskAllElementAttributes:null===(r=this._instance.config.session_recording)||void 0===r?void 0:r.maskAllElementAttributes},h=null!==(s=null==c?void 0:c.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,d=null!==(o=null==c?void 0:c.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,f=null!==(a=null==c?void 0:c.blockSelector)&&void 0!==a?a:null==u?void 0:u.blockSelector,v=null!==(l=null==c?void 0:c.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return B(h)&&B(d)&&B(f)&&B(v)?void 0:{maskAllInputs:null==h||h,maskTextSelector:d,blockSelector:f,maskAllElementAttributes:v}}cn(){var t;if(this.xe)return;const e=null===(t=this.ne)||void 0===t?void 0:t.masking;if(U(e))return;const n=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{const i=null==n?void 0:n[t],r=e[t];return!B(i)&&i!==r});0!==i.length&&(this.xe=!0,Rn.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==n?void 0:n.maskAllInputs,maskTextSelector:null==n?void 0:n.maskTextSelector,blockSelector:null==n?void 0:n.blockSelector,maskAllElementAttributes:null==n?void 0:n.maskAllElementAttributes},project:e}))}get dn(){var t;return V(null===(t=this._instance.config.session_recording.canvasCapture)||void 0===t?void 0:t.resolutionScale,.1,1,ot("canvas recording resolution scale"),1)}get hn(){var t,e,n,i,r,s,o;const a=this._instance.config.session_recording.captureCanvas,l=null===(t=this.ne)||void 0===t?void 0:t.canvasRecording,u=null!==(e=null!==(n=null==a?void 0:a.recordCanvas)&&void 0!==n?n:null==l?void 0:l.enabled)&&void 0!==e&&e,c=null!==(i=null!==(r=null==a?void 0:a.canvasFps)&&void 0!==r?r:null==l?void 0:l.fps)&&void 0!==i?i:4;let h=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof h){const t=parseFloat(h);h=isNaN(t)?.4:t}return{enabled:u,fps:V(c,0,12,ot("canvas recording fps"),4),quality:V(h,0,1,ot("canvas recording quality"),.4)}}get fn(){var t;const e=!!(null===(t=this.ne)||void 0===t?void 0:t.consoleLogRecordingEnabled),n=this._instance.config.enable_recording_console_log;return null!=n?n:e}get vn(){var t,e,n;const i=null===(t=this.ne)||void 0===t?void 0:t.networkPayloadCapture,r={recordHeaders:null===(e=this._instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.recordBody},s=(null==r?void 0:r.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==i?void 0:i.recordBody),a=Mn(this._instance.config.capture_performance),l=Mn(null==i?void 0:i.capturePerformance),u=!!(q(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}pn(){var t,e;const n=[],r=null===(t=s.__PosthogExtensions__)||void 0===t||null===(t=t.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;r&&this.fn&&n.push(r());const o=null===(e=s.__PosthogExtensions__)||void 0===e||null===(e=e.rrwebPlugins)||void 0===e?void 0:e.getRecordNetworkPlugin;if(this.vn&&P(o))if(!ut.includes(i.hostname)||this._forceAllowLocalhostNetworkCapture){const t=P(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;n.push(o(((t,e,n)=>{const i={payloadSizeLimitBytes:_t.payloadSizeLimitBytes,performanceEntryTypeToObserve:[..._t.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],..._t.payloadHostDenyList]},r=!1!==t.session_recording.recordHeaders&&e.recordHeaders,s=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,a=(t=>{const e=wt(t);return t=>((null==t?void 0:t.requestBody)&&(t.requestBody=Rt(t.requestBody,t.requestHeaders,e,"Request")),(null==t?void 0:t.responseBody)&&(t.responseBody=Rt(t.responseBody,t.responseHeaders,e,"Response")),t)})(i),l=e=>{return a(((t,e,n)=>{var i;if(null==n?void 0:n(t.name))return;const r=ct(t.name);let s=0===e.indexOf("http")?null===(i=ct(e))||void 0===i?void 0:i.pathname:e;"/"===s&&(s="");const o=null==r?void 0:r.pathname.replace(s||"","");return r&&o&&Mt.some(t=>0===o.indexOf(t))?void 0:t})((It((i=e).requestHeaders),It(i.responseHeaders),i),t.api_host,n));var i},u=P(t.session_recording.maskNetworkRequestFn);return u&&P(t.session_recording.maskCapturedNetworkRequestFn)&&st.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{const n=t.session_recording.maskNetworkRequestFn({url:e.name});return!n&&e.isInitial?n:E(E({},e),{},{name:null==n?void 0:n.url})}),i.maskRequestFn=P(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var n,i;const r=l(e);if(!r)return;const s=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,o=null===(n=(i=t.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,r);return U(o)&&s?(xt.add(s),s):null!=o?o:void 0}:t=>function(t){if(!B(t))return t.requestBody=At(t.requestBody,"Request"),t.responseBody=At(t.responseBody,"Response"),t}(l(t)),E(E(E({},_t),i),{},{recordHeaders:r,recordBody:s,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vn,t)))}else Rn.info("NetworkCapture not started because we are on localhost.");return n}mn(t){return this._instance.config.disable_capture_url_hashes?J(t):t}gn(t,e=!1){const n=e?J(t):this.mn(t),i=this._instance.config.mask_personal_data_properties?[...Ke,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yn(function(t,e){if(!t||!e||!e.length)return t;const n=t.split("#"),i=n[1],r=(n[0]||"").split("?"),s=r[1],o=r[0],a=(s||"").split("&"),l=[];for(let t=0;a.length>t;t++){const n=a[t].split("=");N(n)&&(e.includes(n[0])?l.push(n[0]+"=<masked>"):l.push(a[t]))}let u=o;return null!=s&&(u+="?"+l.join("&")),null!=i&&(u+="#"+i),u}(n,i))}yn(t){const e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var n;const i=e.maskCapturedNetworkRequestFn({name:t});return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:null==i?void 0:i.url}if(e.maskNetworkRequestFn){const n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}bn(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.ce.length?this.ce.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Rn.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.bn(xn(()=>On().addCustomEvent(t,e)))}wn(){var t;return this.ae&&!0===(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.de}kn(t){if(!this.wn())return!1;try{const e=On();return!!e&&(e.addCustomEvent("$json_ld",t),this.wn())}catch(t){return!1}}_n(t=!1){Promise.resolve().then(()=>{var e;return null===(e=this.Sn)||void 0===e?void 0:e.scan(t)})}xn(){try{if(this._instance.config.capture_pageview||!t)return;const e=new URL(t.location.href),n=this.gn(e.origin+e.pathname+e.search);this.Cn!==n&&(this.Cn=n,this.Vt("$url_changed",{href:n}))}catch(t){}}Mn(){if(this.ce.length){const t=[...this.ce];this.ce=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.bn(t)})}}jt(){return this.bn(xn(()=>On().takeFullSnapshot()))}get In(){var t,e,n;if((null===(t=this.re)||void 0===t?void 0:t.hasPendingTriggers(this.sessionId))&&!["sampled","active"].includes(this.status)){var i;const t=null===(i=this._instance.config.session_recording)||void 0===i?void 0:i.trigger_pending_buffer_interval_millis;return H(t)&&Number.isFinite(t)&&t>=1e3&&36e5>=t?t:6e4}return null!==(e=null===(n=this._instance.config.session_recording)||void 0===n?void 0:n.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Tn(){if(this.Rn&&clearInterval(this.Rn),!0===this.de)return;const t=this.In;t&&(this.Rn=setInterval(()=>{this.jt()},t))}Bt(t){"event"===t&&this.$n(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Tn()}En(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null===(t=this.Sn)||void 0===t||t.scan(),clearInterval(this.Rn),Rn.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}An(){var t;this.Y.urlBlocked&&(null===(t=this.Sn)||void 0===t||t.scan(),this.Y.urlBlocked=!1,this.jt(),this._n(),this.Tn(),this.Vt("recording resumed",{reason:"left blocked url"}),Rn.info("recording resumed"))}On(t,e){var n;if("event"===t&&this.$n(),!this.ue&&(null===(n=this.re)||void 0===n?void 0:n.hasPendingTriggers(this.sessionId))){this.ue=!0;try{var i,r;const n="url"===t?h:d;null===(i=this._instance.persistence)||void 0===i||i.register({[n]:this.sessionId}),null===(r=this.re)||void 0===r||r.updateActiveTriggers(this.sessionId),this.Bt(),this.tn(),this.qt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.ue=!1}}}get isStarted(){return!!this.se}get ne(){const t=this._instance.get_property("$session_recording_remote_config");if(!t)return;let e;try{e=j(t)?t:JSON.parse(t)}catch(t){return void Rn.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var n;const i=null!==(n=e.cache_timestamp)&&void 0!==n?n:Date.now();if(Date.now()-i>36e5)return void Rn.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:i,persistedConfig:t})}return e}Ln(t,e,n){this._instance.get_property(t)&&(e(),n())}start(e){var i,r;const s=this.ne;if(!s)return void Rn.info("remote config must be stored in persistence before recording can start");if(!this.isStarted){const t=!1!==this.de&&!this.be;this.Xe(t?"no_interaction_since_recording_started":void 0),this.be=!1,this.ge=t,this.ye=!1}this.Pe&&(this.Pn(),this.en());const{sessionId:c,windowId:h,sessionStartTimestamp:d}=this.Yt.checkAndGetSessionAndWindowId();this.Xt=c,this.Be=h,this._sessionStartTimestamp=d,this.Dn(),null===(i=this._instance.persistence)||void 0===i||i.unregister("$debug_first_full_snapshot_timestamp"),(null==s?void 0:s.endpoint)&&(this.oe=null==s?void 0:s.endpoint),this.re=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Ye(this._instance,this.Y,this.qt.bind(this),this.Vt.bind(this),this.Bt.bind(this)):new Xe(this._instance,this.Y,this.tt,this.et,this.qt.bind(this),this.jt.bind(this),this.Bt.bind(this)),this.re.onRemoteConfig(s),null===(r=this.Wt)||void 0===r||r.call(this),this.Wt=this.re.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.On(t,e)),this.Ln(o,()=>{this.overrideSampling()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(o)}),this.Ln(a,()=>{this.overrideLinkedFlag()},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(a)}),this.Ln(u,()=>{this.overrideTrigger("event")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(u)}),this.Ln(l,()=>{this.overrideTrigger("url")},()=>{var t;return null===(t=this._instance.persistence)||void 0===t?void 0:t.unregister(l)}),this.re.makeSamplingDecisions(this.sessionId),this.Fn(),this.we||(lt(t,"beforeunload",this.Je),lt(t,"pagehide",this.nn),lt(t,"offline",this.rn),lt(t,"online",this.sn),lt(n,"visibilitychange",this.an),!this.Fe&&P(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.je)),!this.Ne&&P(this.Yt.on)?this.Ne=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.de="unknown",this.stop(),this.qe=this.Yt.onSessionId((t,e,n)=>{var i;null===(i=this.qe)||void 0===i||i.call(this),this.qe=void 0,this.je(t,e,n)})}):P(this.Yt.on)||Rn.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),U(this.De)&&(this.De=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){const e=(null==t?void 0:t.properties.$current_url)?this.gn(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Rn.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.qt(e||"recording_initialized"))}Nn(){var e,i,r,s,o,a;null==t||t.removeEventListener("beforeunload",this.Je),null==t||t.removeEventListener("pagehide",this.nn),null==t||t.removeEventListener("offline",this.rn),null==t||t.removeEventListener("online",this.sn),null==n||n.removeEventListener("visibilitychange",this.an),clearInterval(this.Rn),this.qn(),null===(e=this.De)||void 0===e||e.call(this),this.De=void 0,null===(i=this.Wt)||void 0===i||i.call(this),this.Wt=void 0,null===(r=this.Fe)||void 0===r||r.call(this),this.Fe=void 0,null===(s=this.Ne)||void 0===s||s.call(this),this.Ne=void 0,null===(o=this.qe)||void 0===o||o.call(this),this.qe=void 0,null===(a=this.re)||void 0===a||a.stop(),this.jn(),this.Pn()}Pn(){this.Le+=1,this.Ae=[],this.Oe=0,this.Bn=void 0,this.Pe=!1}jn(){var t,e;null===(t=this.Hn)||void 0===t||t.stop(),this.ce=[],null===(e=this.Sn)||void 0===e||e.stop(),this.Sn=void 0,this.ae=!1;try{var n;null===(n=this.se)||void 0===n||n.call(this)}catch(t){Rn.warn("could not stop rrweb",t)}this.se=void 0}zn(){if(!this.Bn||0===this.Oe)return!1;if(this.Pe)return!0;this.Pe=!0,this.Un=void 0;const t=this.Le;return this.qn(),this.jn(),this.Bn.catch(()=>{}).then(()=>{t===this.Le&&(this.Pe=!1,this.tn(),this.en(),this.Wn(),this.Nn(),Rn.info("stopped"))}).catch(()=>{this.Pe=!1,this.Wn(),this.Nn(),Rn.info("stopped")}),!0}stop(){if(this.jn(),this.We)this.Ye();else if(this.zn())return;this.tn(),this.en(),this.Wn(),this.Nn(),Rn.info("stopped")}Wn(){this.Xe(void 0,{preserveLogDedup:this.We}),this.ge=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tn())}Ue(t){this.We=!0,this.le=Date.now();try{var e,n;this.stop(),this.Vn=void 0,this.Zn=void 0,this.fe=0,this.ve=0,this.pe=0,null===(e=Tn())||void 0===e||null===(n=e.resetSnapshotCostState)||void 0===n||n.call(e),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.ge=!1}Xe(t,{preserveLogDedup:e=!1}={}){if(this.me=!B(t),this.Un=t,B(t))return void(e||(this.Gn=void 0));if(this.We)return;const n=`${this.sessionId}:${t}`;n!==this.Gn&&(this.Gn=n,Rn.info(`holding buffer: ${t}. nothing is uploaded until the user interacts with the page`))}$n(){this.isStarted||(this.be=!0),this.me&&(this.Xe(void 0),this.ge=!1,this.ye&&(this.ye=!1,this.jt()),this.Qn())}discard({discardProducerEvents:t=!1}={}){this.me=!0,t&&(this.en(),this.jn()),this.en(),this.Nn(),this.en(),this.Wn(),Rn.info("discarded")}Jn(t,e,n,i,r){const s={$snapshot_bytes:n,$snapshot_data:e,$session_id:i,$window_id:r};"disabled"!==this.status?(this.Kn(t,i),this.Xn(s)):this.en()}Yn(){try{this.ti()}catch(t){this.Se||(this.Se=!0,Rn.error("could not track full snapshot cost",t))}}ti(){var t,e;const n=null===(t=Tn())||void 0===t||null===(e=t.getLastSnapshotCost)||void 0===e?void 0:e.call(t);n&&n!==this.Zn&&(this.Zn=n,this.Vn&&this.Vn.durationMs>=n.durationMs||(this.Vn=n),500>n.durationMs||Rn.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(n.durationMs),stylesheetMs:Math.round(n.stylesheetMs),nodeCount:n.nodeCount,cssRuleCount:n.cssRuleCount,nonDeferrableCssRuleCount:n.nonDeferrableCssRuleCount,deferredStylesheetCount:n.deferredStylesheetCount}))}Kn(t,e){2!==t.type?3===t.type&&(B(this.Re)||this.Re===e||this.$e===e||(this.$e=e,Rn.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.jt())):this.Re=e}ei(t){t.counted&&t.generation===this.Le&&(this.Oe=Math.max(0,this.Oe-1)),t.counted=!1,this.Ae=this.Ae.filter(e=>e!==t)}ni(t,e,n){t.processed||t.generation!==this.Le||(t.processed=!0,this.Jn(t.event,e,n,t.targetSessionId,t.targetWindowId))}ii(t){try{let e=t.event,n=te(t.event);if(t.compressionEnabled)try{({event:e,size:n}=Vn(t.event))}catch(t){Rn.error("could not process queued compression event - will use uncompressed event",t)}try{this.ni(t,e,n)}catch(t){Rn.error("could not capture queued compression event",t)}}finally{this.ei(t)}}Ye(){[...this.Ae].forEach(t=>{this.ii(t)})}ri(t,e,n,i){var r=this;const s={event:t,compressionEnabled:e,targetSessionId:n,targetWindowId:i,generation:this.Le,processed:!1,counted:!0};this.Ae.push(s),this.Oe+=1;const o=(a=A(function*(){try{if(s.processed)return;let n,i;try{const r=e?Un(t)?yield function(t){return Zn.apply(this,arguments)}(t):Vn(t):{event:t,size:te(t)};n=r.event,i=r.size}catch(e){Rn.error("could not process queued compression event - will use uncompressed event",e),n=t,i=te(t)}r.ni(s,n,i)}finally{r.ei(s)}}),function(){return a.apply(this,arguments)});var a;this.Bn=this.Bn?this.Bn.catch(()=>{}).then(o):o()}onRRwebEmit(e){var n,i,r,s,o,a,l,u,c,h,d,f,v,p;if(!this._instance.sessionManager)return;if(this.Mn(),!e||!j(e))return;if(4===e.type){const t=this.gn(e.data.href);if(this.Cn=t,!t)return;e.data.href=t}else this.xn();if(null===(n=this.re)||void 0===n||n.checkUrlTriggers(this.sessionId,()=>this.En(),()=>this.An(),(t,e)=>this.On(t,e)),this.Y.urlBlocked&&(5!==(h=e).type||"recording paused"!==h.data.tag))return;2===e.type&&((null===(d=Tn())||void 0===d||null===(f=d.wasMaxDepthReached)||void 0===f?void 0:f.call(d))&&(this._e=!0),this.Yn(),Promise.resolve().then(()=>this.Yn()),this.Tn(),null===(v=this.Hn)||void 0===v||v.reset(),null===(p=this._instance.persistence)||void 0===p||p.register_once({$debug_first_full_snapshot_timestamp:e.timestamp},void 0));const m=2===e.type&&(null===(i=this.re)||void 0===i?void 0:i.hasPendingTriggers(this.sessionId));m&&this.oi();const g=this.Hn?this.Hn.throttleMutations(e):e;if(!g)return void(!0===this.de&&this.he++);const y=function(t){const e=t;if(e&&j(e)&&6===e.type&&j(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));const n=[];for(let t=0;e.data.payload.payload.length>t;t++)n.push(e.data.payload.payload[t]&&e.data.payload.payload[t].length>2e3?e.data.payload.payload[t].slice(0,2e3)+"...[truncated]":e.data.payload.payload[t]);return e.data.payload.payload=n,t}return t}(g),b=function(t){return Xn(t)?t.data.payload:null}(y),w=function(t){return Yn(t)?t.data.payload:null}(y),_=function(t){return Qn(t)?t.data.payload:null}(y);b||w?(null==b?void 0:b.lastActivityTimestamp)&&(y.timestamp=b.lastActivityTimestamp):(null==_?void 0:_.sessionId)||this.si(y),2===e.type&&(this.Te.push([this.Xt,e.timestamp]),this.Te.length>6&&(this.Te=this.Te.slice(-6)));const k=null!==(r=null!==(s=null!==(o=null==b?void 0:b.currentSessionId)&&void 0!==o?o:null==w?void 0:w.nextSessionId)&&void 0!==s?s:null==_?void 0:_.sessionId)&&void 0!==r?r:this.Xt,S=null!==(a=null!==(l=null!==(u=null==b?void 0:b.currentWindowId)&&void 0!==u?u:null==w?void 0:w.nextWindowId)&&void 0!==l?l:null==_?void 0:_.windowId)&&void 0!==a?a:this.Be;if(!0===this.de&&!function(t){return Qn(t)||Xn(t)||Yn(t)}(y))return void(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source}(y)&&this.he++);2===y.type&&(this.he=0),_&&(y.timestamp=_.lastActivityTimestamp+_.threshold);const C=this.ae;this.ae=!0,m?this._n(!0):C||this._n();const I=null===(c=this._instance.config.session_recording.compress_events)||void 0===c||c;if(5===y.type&&"$json_ld"===y.data.tag){let e;try{e=t?this.gn(t.location.href):void 0}catch(t){}y.data.href=e}if(this.Oe>0||I&&Un(y))return void this.ri(y,I,k,S);const{event:M,size:R}=I?Vn(y):{event:y,size:te(y)};this.Jn(y,M,R,k,S)}get status(){return this.re?this.re.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.ne}):Tt}log(t,e="log"){var n;null===(n=this._instance.sessionRecording)||void 0===n||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.jt(),this.$n(),this.qt("linked_flag_overridden")}overrideSampling(){var t;null===(t=this._instance.persistence)||void 0===t||t.register({$session_is_sampled:this.sessionId,$replay_sample_rate:null}),this.jt(),this.$n(),this.qt("sampling_overridden")}overrideTrigger(t){this.On(t),this.$n()}ai(){try{var e;const n=null==t||null===(e=t.location)||void 0===e?void 0:e.href;if(!n)return;const i=this.gn(n);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}qn(){this.li&&(clearTimeout(this.li),this.li=void 0)}Qn(){this.li||(this.li=setTimeout(()=>{this.tn()},2e3))}ui(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!Xn(t)&&!Yn(t))}ci(){var t,e;return null!==(t=null===(e=this.re)||void 0===e?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return B(this.hi)||this._instance.register_for_session({[w]:[]}),void(this.hi=void 0);const e=this.ci();if(0===e.length)return B(this.hi)||this._instance.register_for_session({[w]:[]}),void(this.hi=void 0);const n=e.join(", "),i=`${this.sessionId}:${n}`;i!==this.hi&&(this.hi=i,this._instance.register_for_session({[w]:e}),Rn.info(`buffering: ${n}`))}fi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null===(t=this._instance.persistence)||void 0===t?void 0:t.pi)&&je.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.gi&&943718.4>=this.Rt.size&&this.fi()&&(this.gi=this.Rt.size,je.At(this.ln,this.Rt))}Dn(){if(this.Ee||!this.fi())return;this.Ee=!0;const t=je.Dt(this.ln);je.Lt(this.ln),j(t)&&N(t.data)&&0!==t.data.length&&N(t.sizes)&&t.sizes.length===t.data.length&&H(t.size)&&t.sessionId===this.Xt&&t.windowId===this.Be&&(this.Rt.data.length>0||(this.Rt=t))}tn(t=!1){var e;if(this.qn(),this.me)return this.Rt;if(this.ui())return this.Rt.size>943718.4?this.en():(t&&this.mi(),this.Rt);const n=this.Rt;null===(e=this.re)||void 0===e||e.ensureSamplingDecision(this.sessionId);const i=this.Ge(),r=this.status;if(this.di(r),"buffering"===r||"paused"===r||"disabled"===r||i)return!t||"active"!==r&&"sampled"!==r||this.mi(),this.Qn(),this.Rt;if(this.Rt!==n)return this.Rt;if(n.data.length>0){var s;const t=this.ai();ne(n).forEach(e=>{try{var n;null===(n=this.He)||void 0===n||n.trackSize(e.sessionId,e.size),this.yi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:Be.LIB_NAME,$lib_version:Be.LIB_VERSION,$snapshot_host:t})}catch(t){Rn.warn("could not capture snapshot chunk - skipping it",t)}}),B(this.gi)||(je.Lt(this.ln),this.gi=void 0),null===(s=this.re)||void 0===s||s.onFlushComplete()}return this.en()}Xn(t){var e;const n=2+((null===(e=this.Rt)||void 0===e?void 0:e.data.length)||0),i=t.$session_id,r=this.Rt.sessionId!==i;if(r||!0!==this.de&&!this.me&&this.Rt.size+t.$snapshot_bytes+n>943718.4){const e=this.Xt;if(this.Rt=this.tn(),this.Xt!==e)return;r&&this.Rt.data.length>0&&(this.Rt=this.en()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.me&&(this.ye||this.Rt.size+t.$snapshot_bytes+n>943718.4)?this.ye||(this.ye=!0,this.Rt=this.en()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.de||this.me||this.Qn())}yi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e;const n=null===(t=this.Rt)||void 0===t?void 0:t.data[(null===(e=this.Rt)||void 0===e?void 0:e.data.length)-1];return n?n.timestamp-this._sessionStartTimestamp:null}oi(){if(!this.Rt||0===this.Rt.data.length)return this.en();let t=-1;for(let e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.en():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}en(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.Be},this.Rt}qt(t,e){this._instance.register_for_session({[M]:t}),Rn.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",E({reason:t},e))}bi(t){var e;return 3===t.type&&-1!==An.indexOf(null===(e=t.data)||void 0===e?void 0:e.source)}si(t){const e=this.bi(t);e||!0===this.de||t.timestamp-this.le>this.te&&(this.de=!0,clearInterval(this.Rn),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.le,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.Be}),this.tn());const{windowId:n,sessionId:i}=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp);let r=!1;if(e&&(this.le=t.timestamp,this.de)){const e="unknown"===this.de;this.de=!1,e||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}const s=this.Xt!==i,o=this.Be!==n;if(this.Be=n,this.Xt=i,s||o){const t=s&&!1!==this.de;t&&(this.de="unknown"),this.Ue(t)}else if(e&&this.$n(),r){var a;const t=["sampled","active"].includes(this.status)||(null===(a=this.re)||void 0===a?void 0:a.hasPendingTriggers(this.sessionId));this.he>0&&t&&this.jt(),this._n(),this.Tn()}}ze(){var t;null===(t=this.re)||void 0===t||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,n,i,r,s,o,a,l,u,c,h;const d=null===(t=Tn())||void 0===t||null===(e=t.getDeferredStylesheetStats)||void 0===e?void 0:e.call(t);return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Un,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null===(n=this.He)||void 0===n?void 0:n.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Te,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:In(null===(i=this.Vn)||void 0===i?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:In(null===(r=this.Vn)||void 0===r?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null===(s=this.Vn)||void 0===s?void 0:s.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null===(o=this.Vn)||void 0===o?void 0:o.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null===(a=this.Vn)||void 0===a?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==d?void 0:d.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==d?void 0:d.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==d?void 0:d.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:In(null==d?void 0:d.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:In(null==d?void 0:d.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:In(null===(l=Tn())||void 0===l||null===(u=l.getMutationCost)||void 0===u||null===(u=u.call(l))||void 0===u?void 0:u.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null===(c=Tn())||void 0===c||null===(h=c.getDiscardedDurationSamples)||void 0===h?void 0:h.call(c),$sdk_debug_replay_throttled_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[C]:!!this.se,[I]:this.ke}}Fn(){var e;if(this.se)return;this.ke=!0;const i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},r=this._instance.config.session_recording;for(const[t,e]of Object.entries(r||{}))if(t in i)if("maskInputOptions"===t)i.maskInputOptions=E({password:!0},e);else if("sampling"===t){const t=null!=e?e:{},n={};B(t.mousemove)||(n.mousemove=t.mousemove),B(t.mouseInteraction)||(n.mouseInteraction=t.mouseInteraction),i.sampling=n}else i[t]=e;var s,o,a,l;!0===(null==r?void 0:r.captureJsonLd)&&!0!==i.slimDOMOptions&&"all"!==i.slimDOMOptions&&(i.slimDOMOptions=E(E({},i.slimDOMOptions),{},{script:!0})),this.hn&&this.hn.enabled&&(i.recordCanvas=!0,i.sampling=E(E({},i.sampling),{},{canvas:this.hn.fps}),i.dataURLOptions={type:"image/webp",quality:this.hn.quality},i.canvasResolutionScale=this.dn,i.canvasMasking={configured:()=>{var t;return P(null===(t=this._instance.config.session_recording)||void 0===t||null===(t=t.canvasCapture)||void 0===t?void 0:t.maskRegionsFn)},regionsFn:t=>{var e;const n=null===(e=this._instance.config.session_recording)||void 0===e||null===(e=e.canvasCapture)||void 0===e?void 0:e.maskRegionsFn;if(P(n))try{var i;return null!==(i=n(t))&&void 0!==i?i:null}catch(t){return this.Me||(this.Me=!0,Rn.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.un&&(i.maskAllInputs=null===(s=this.un.maskAllInputs)||void 0===s||s,i.maskTextSelector=null!==(o=this.un.maskTextSelector)&&void 0!==o?o:void 0,i.blockSelector=null!==(a=this.un.blockSelector)&&void 0!==a?a:void 0,i.maskAllElementAttributes=null!==(l=this.un.maskAllElementAttributes)&&void 0!==l&&l),i.maskAllElementAttributes&&i.maskAttributeFn&&(i.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Rn.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.cn();const u=On();if(!u)return void Rn.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.");this.Hn=null!==(e=this.Hn)&&void 0!==e?e:new Ne(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{const n=`Too many mutations on node '${t}'. Rate limiting. This could be due to SVG animations or something similar`;Rn.info(n,{node:e}),this.log("[SessionRecording] "+n,"warn")},onDroppedAttributeMutations:t=>this.fe+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.In,onDroppedOversizedMutation:t=>{0===this.ve&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.ve+=1,this.pe+=t},requestFullSnapshot:()=>this.jt()});const c=this.pn();if(this.se=u(E({emit:t=>{this.onRRwebEmit(t)},plugins:c,errorHandler:(t,e)=>"rrweb"===e&&(this.Ie||(this.Ie=!0,Rn.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},i)),!this.se)return this.we=!0,void Rn.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==r?void 0:r.captureJsonLd)&&n&&(null==t?void 0:t.MutationObserver)&&!this.Sn&&(this.Sn=function(t,e,n){const i=new WeakMap,r=n.getCaptureState||(()=>!0);let s=tn;const o=function(t,e){const n=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||(null==n?void 0:n.length)&&!n.includes("id")?rn:n=>{const i=t.getElementById(n);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Sn(i,e.blockClass,e.blockSelector)}}(t,n),a=e=>{try{const a=r();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Sn(t,e.blockClass,e.blockSelector)||Sn(t,e.maskTextClass,e.maskTextSelector)}(e,n))return;const l=function(t,e=rn,n){if(!t||t.length>tn)return null;try{const i=JSON.parse(t),r={maskUrl:n,remainingNodes:2048,exceeded:!1},s=N(i)?i.map(t=>wn(t,e,r)):wn(i,e,r);if(r.exceeded||W(s)||N(s)&&(!s.length||s.some(W)))return null;const o=JSON.stringify(s);return o.length>2e4?null:[s,o]}catch(t){return null}}(e.text,o,n.maskUrl);if(!l)return void i.delete(e);const[u,c]=l;if(W(a))return void i.set(e,c);if(i.get(e)!==c){if(c.length>s)return void(s=0);n.emit(u)&&(i.set(e,c),s-=c.length)}}catch(t){return}};try{const n=new e(t=>{try{if(!s||!1===r())return;const e=t=>{for(const e of Cn(t))a(e)};for(const n of t)if("childList"===n.type)_n(n.target)&&a(n.target),n.addedNodes.forEach(e);else if("characterData"===n.type){const t=n.target.parentNode;t&&_n(t)&&a(t)}else"attributes"===n.type&&_n(n.target)&&a(n.target)}catch(t){return}});return n.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e=!1){s&&!1!==r()&&Cn(t.documentElement).forEach(t=>{e&&i.delete(t),a(t)})},stop(){return n.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(n,t.MutationObserver,{maskUrl:t=>this.gn(t),attributeFilter:i.attributeFilter,blockClass:i.blockClass,blockSelector:i.blockSelector,isRecordedElement:t=>u.mirror.getId(t)>0,maskAllElementAttributes:i.maskAllElementAttributes,maskAttributeFn:i.maskAttributeFn,maskTextClass:i.maskTextClass,maskTextSelector:i.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null===(t=this._instance.config.session_recording)||void 0===t?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wn()},emit:t=>this.kn(t)}),this.Y.isCurrentUrlBlocked()&&this.Sn.scan()),this.le=Date.now(),this.de=q(this.de)?this.de:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ne),this.Vt("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}tryAddCustomEvent(t,e){return this.Vt(t,e)}};const ti=["type"];var ei=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),ni=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),ii=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),ri=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),si=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),oi=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),ai=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function li(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var ui={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ci={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},hi={};function di(t){if(hi[t])return hi[t];const e=function(t){var e,n;const i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(n=e.__symbol__)||void 0===n?void 0:n.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],n=e.prototype,i=t in ui?ui[t]:void 0,r=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(n,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in ci?ci[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof n[t]&&(null===(e=n[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(r&&o)return hi[t]=e.prototype,e.prototype;const a=document.createElement("iframe");a.style.display="none";let l=!1;try{document.body.appendChild(a);const i=a.contentWindow;if(!i)return e.prototype;const r=i[t].prototype;return r?(li(u=navigator.userAgent,"AppleWebKit")&&!li(u,"Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),hi[t]=r):n}catch(t){return n}finally{!l&&a.parentNode&&document.body.removeChild(a)}var u}var fi=Object.create(null);function vi(t,e,n){var i;const r=fi[t],s=r[n];if(s)return s.call(e);const o=di(t),a=null===(i=Object.getOwnPropertyDescriptor(o,n))||void 0===i?void 0:i.get;return a?(r[n]=a,a.call(e)):e[n]}fi.Node=Object.create(null),fi.ShadowRoot=Object.create(null),fi.MutationObserver=Object.create(null),fi.Element=Object.create(null);var pi,mi={};function gi(t,e,n){const i=`${t}.${String(n)}`;if(mi[i])return mi[i].bind(e);const r=di(t)[n];return"function"!=typeof r?e[n]:(mi[i]=r,r.bind(e))}function yi(){return di("MutationObserver").constructor}function bi(t,e,n){try{if(!(e in t))return()=>{};const i=t[e],r={next:i},s=n(function(...t){return r.next.apply(this,t)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);const n=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let i=t[e],o=n(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=n(i)}}}catch(t){return()=>{}}}var wi={childNodes:t=>vi("Node",t,"childNodes"),parentNode:t=>vi("Node",t,"parentNode"),parentElement:t=>vi("Node",t,"parentElement"),textContent:t=>vi("Node",t,"textContent"),isConnected(t){if(void 0===pi){var e;const t=null===(e=Object.getOwnPropertyDescriptor(di("Node"),"isConnected"))||void 0===e?void 0:e.get;pi=(null==t?void 0:t.toString().includes("[native code]"))?t:null}return null==pi?void 0:pi.call(t)},contains:(t,e)=>gi("Node",t,"contains")(e),getRootNode:t=>gi("Node",t,"getRootNode")(),host:t=>t&&"host"in t?vi("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?vi("Element",t,"shadowRoot"):null,querySelector:(t,e)=>gi("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>gi("Element",t,"querySelectorAll")(e),mutationObserver:yi,patch:bi};function _i(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var ki=0;function Si(){ki+=1}function Ci(){return ki}function Ii(t,e){return(e!==ki||t>6e4)&&!0}var Mi=0,Ri=0,Ai=0,xi={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ti=null,Oi=null,Ei=[],Fi=0,$i=0,Di={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Ni(t){var e;(Mi+=1)>1||(xi={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ei=[],Fi=0,Oi=(e=t)&&e>0?e:null,Ri=_i(),Ai=ki)}function Pi(){return 0===Mi?Ti||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Mi-=1)>0?xi:(xi.durationMs=_i()-Ri,xi.deferredStylesheetCount=Fi,Li.deferredCount+=Fi,Oi=null,Ii(xi.durationMs,Ai)?xi:Ti=xi)}function ji(t,e,n){let i=t.length;if(n>=32)return i;for(let r=0;t.length>r;r++){const s=t[r];try{const t=s.cssRules;if(t&&t.length)i+=ji(t,e,n+1);else if(e&&s.styleSheet){const t=s.styleSheet;if(!e.has(t)){e.add(t);const r=t.rules||t.cssRules;r&&(i+=ji(r,e,n+1))}}}catch(t){}}return i}function Bi(t){if(0===Mi)return;const e=ji(t,null,0);xi.cssRuleCount+=e,$i>0&&(xi.nonDeferrableCssRuleCount+=e)}function zi(t){$i+=1;try{return t()}finally{$i-=1}}function Wi(t){Mi>0&&(xi.stylesheetMs+=t)}function Ui(t){if(0===Mi||null===Oi)return!1;const e=xi.cssRuleCount-xi.nonDeferrableCssRuleCount;return e>=Oi||e+function(t){try{const e=t&&(t.rules||t.cssRules);if(!e)return 0;const n=new WeakSet;return n.add(t),ji(e,n,0)}catch(t){return 0}}(t)>Oi}function Hi(){const t=Ei;return Ei=[],t}function qi(){Li.failedCount+=1}function Gi(t){t>0&&(Li.abandonedCount+=t)}function Vi(t){return Vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(t)}function Zi(t,e,n){return(e=function(t){var e=function(t){if("object"!=Vi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vi(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ji(t){return t.nodeType===t.ELEMENT_NODE}function Qi(t){const e=t&&"host"in t&&"mode"in t&&wi.host(t)||null;return Boolean(e&&"shadowRoot"in e&&wi.shadowRoot(e)===t)}function Xi(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Yi(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Ki(t){const{cssText:e}=t;if(3>e.split('"').length)return e;const n=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?n.push("layer"):t.layerName&&n.push(`layer(${t.layerName})`),t.supportsText&&n.push(`supports(${t.supportsText})`),t.media.length&&n.push(t.media.mediaText),n.join(" ")+";"}var tr=0;function er(t){const e=0===tr,n=e?_i():0;tr+=1;try{const e=t.rules||t.cssRules;if(!e)return null;Bi(e);let n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Yi(Array.from(e,t=>nr(t,n)).join(""))}catch(t){return null}finally{tr-=1,e&&Wi(_i()-n)}}function nr(t,e){if(rr(t)){let e;try{e=er(t.styleSheet)||Ki(t)}catch(n){e=t.cssText}try{var n;if(e&&(null===(n=t.styleSheet)||void 0===n?void 0:n.href))return wr(e,t.styleSheet.href)}catch(t){}return e}{let n=t.cssText;return sr(t)&&t.selectorText.includes(":")&&(n=ir(n)),e?wr(n,e):n}}function ir(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function rr(t){return"styleSheet"in t}function sr(t){return"selectorText"in t}var or=/^-?[A-Za-z_][\w-]*$/,ar=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function lr(t){const e=[];let n=!1,i=null;const r=new Map;function s(t){const r=e.pop();if("group"===r.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}const n=e[e.length-1];return n.parts.push(t),void(n.index+=1)}if(!r.importRule)return n=!0,void(i=t);o(e[e.length-1],r.importRule,t)}function o(t,e,n){try{let r;try{r=n||Ki(e)}catch(t){r=e.cssText}try{var i;r&&(null===(i=e.styleSheet)||void 0===i?void 0:i.href)&&(r=wr(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){const n=t.rules[t.index];if("sheet"===t.kind&&rr(n)){const i=r.get(n);return null===i?(t.parts.push(n.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:n}):void o(t,n,null)}if(function(t,n){try{const i=function(t){const e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return`@media ${e.media.mediaText} {`;if(sr(t)){if("number"==typeof e.type&&1!==e.type)return null;const n=e.style?e.style.cssText:"";return`${t.selectorText} {${n?" "+n:""}`}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!or.test(e.containerName)?null:`@container ${e.containerName?`${e.containerName} `:""}${e.containerQuery} {`;if("string"==typeof e.conditionText){let i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?`@supports ${e.conditionText} {`:null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?or.test(e.name)?`@keyframes ${e.name} {`:null:""===e.name?"@layer {":ar.test(e.name)?`@layer ${e.name} {`:null:null}(t);if(null===i)return!1;const r=n.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:r,index:0,parts:[],prelude:r?wr(i,r):i,fixColons:"sheet"===n.kind&&sr(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(n,t))return;let i=n.cssText;"sheet"===t.kind&&sr(n)&&n.selectorText.includes(":")&&(i=ir(i)),t.parts.push(t.sheetHref?wr(i,t.sheetHref):i),t.index+=1}return function(t){try{const n=t.rules||t.cssRules;if(!n)return!1;Bi(n);let i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);const s=Array.from(n);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){const n=[{sheet:e,rules:t,index:0}];for(;n.length>0;){const t=n[n.length-1];if(t.index>=t.rules.length){n.pop();continue}const e=t.rules[t.index];if(t.index+=1,!rr(e)||r.has(e))continue;let i=null;try{i=e.styleSheet}catch(t){r.set(e,null);continue}if(i&&!n.some(t=>t.sheet===i))try{const t=i.rules||i.cssRules;if(!t)continue;Bi(t);let s=i.href;!s&&i.ownerNode&&(s=i.ownerNode.baseURI);const o=Array.from(t);r.set(e,{sheet:i,rules:o,sheetHref:s}),n.push({sheet:i,rules:o,index:0})}catch(t){}}}(s,t),!0}catch(t){return!1}}(t)||(n=!0),{advance(t){if(n)return!0;const r=_i();let o=t>0?t:1;try{for(;!n&&o>0;){const t=e[e.length-1];if(t.index>=t.rules.length){let e=null;try{if("group"===t.kind){const n=t.prelude+t.parts.join("")+"}";e=t.fixColons?ir(n):n}else e=Yi(t.parts.join(""))}catch(t){}s(e);continue}o-=1;try{a(t)}catch(t){s(null)}}}catch(t){n=!0,i=null}finally{Wi(_i()-r)}return n},text:()=>n?i:null,remainingRules(){if(n)return 0;let t=0;for(const n of e)t+=n.rules.length-n.index;return t}}}var ur=class{constructor(){Zi(this,"idNodeMap",new Map),Zi(this,"nodeMetaMap",new WeakMap)}getId(t){var e,n;return t&&null!==(e=null===(n=this.getMeta(t))||void 0===n?void 0:n.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),Ji(t)){const e=wi.shadowRoot(t);e&&this.removeNodeFromMap(e),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){const n=this.getNode(t);if(n){const t=this.nodeMetaMap.get(n);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function cr({element:t,maskInputOptions:e,tagName:n,type:i,value:r,maskInputFn:s}){let o=r||"";const a=i&&hr(i);return(e[n.toLowerCase()]||a&&e[a])&&(o=s?s(o,t):"*".repeat(o.length)),o}function hr(t){return t.toLowerCase()}var dr=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function fr({element:t,name:e,value:n,maskAllElementAttributes:i,maskAttributeFn:r,isGenerated:s=!1}){return n?i?s&&dr.has(hr(e))?n:"*".repeat(n.length):r?r(e,n,t):n:n}var vr="__rrweb_original__";function pr(t){try{const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?hr(e):null}catch(t){return null}}var mr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,gr=/^(?:[a-z+]+:)?\/\//i,yr=/^www\..*/i,br=/^(data:)([^,]*),(.*)/i;function wr(t,e){return(t||"").replace(mr,(t,n,i,r,s,o)=>{const a=i||s||o,l=n||r||"";if(!a)return t;if(gr.test(a)||yr.test(a))return`url(${l}${a}${l})`;if(br.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+a}${l})`;const u=e.split("/"),c=a.split("/");u.pop();for(const t of c)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${l}${u.join("/")}${l})`})}var _r,kr,Sr=new Map,Cr=1,Ir=new RegExp("[^a-z0-9-_:]");function Mr(){return Cr++}var Rr=/^[^ \t\n\r\u000c]+/,Ar=/^[, \t\n\r\u000c]+/,xr=new WeakMap;function Tr(t,e){return e&&""!==e.trim()?Or(t,e):e}function Or(t,e){let n=xr.get(t);if(n||(n=t.createElement("a"),xr.set(t,n)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return n.setAttribute("href",e),n.href}function Er(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Fr(t,e,n,i,r,s){if(!i)return i;if("src"===n||"href"===n&&("use"!==e||"#"!==i[0])){if("link"===e&&r){var o;const t=null===(o=r.sheet)||void 0===o?void 0:o.href;if(t)return t}const n=Tr(t,i);if(n.startsWith("data:")){if("img"===e&&r){let t=n;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(t=function(t,e,n,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;const r=Sr.get(e);if(r&&r.type===n&&r.quality===i)return r.result;try{const r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const s=r.getContext("2d");if(!s)return e;s.drawImage(t,0,0);const o=r.toDataURL(n||"image/webp",null!=i?i:.4),a=e.length>o.length?o:e;if(Sr.size>=10){const t=Sr.keys().next().value;void 0!==t&&Sr.delete(t)}return Sr.set(e,{type:n,quality:i,result:a}),a}catch(t){return e}}(r,n,s.type,s.quality)),Er(t,s)}if("image"===e)return Er(n,s)}return n}if("xlink:href"===n&&"#"!==i[0]){const n=Tr(t,i);return"image"===e&&n.startsWith("data:")?Er(n,s):n}return"background"!==n||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===n?function(t,e){if(""===e.trim())return e;let n=0;function i(t){let i;const r=t.exec(e.substring(n));return r?(i=r[0],n+=i.length,i):""}const r=[];for(;i(Ar),e.length>n;){let s=i(Rr);if(","===s.slice(-1))s=Tr(t,s.substring(0,s.length-1)),r.push(s);else{let i="";s=Tr(t,s);let o=!1;for(;;){const t=e.charAt(n);if(""===t){r.push((s+i).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){n+=1,r.push((s+i).trim());break}"("===t&&(o=!0)}i+=t,n+=1}}}return r.join(", ")}(t,i):"style"===n?wr(i,Or(t)):"object"===e&&"data"===n?Tr(t,i):i:Tr(t,i)}function $r(t,e,n){return("video"===t||"audio"===t)&&"autoplay"===hr(e)}function Dr(t,e,n){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!n&&Dr(wi.parentNode(t),e,n);for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;return!!n&&Dr(wi.parentNode(t),e,n)}function Lr(t,e,n,i){let r;if(Ji(t)){if(r=t,!wi.childNodes(r).length)return!1}else{if(null===wi.parentElement(t))return!1;r=wi.parentElement(t)}try{if("string"==typeof e){if(i){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if(Dr(r,e,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(t){}return!1}function Nr(t,e,n){const i=t.removeEventListener;"function"==typeof i&&i.call(t,e,n)}var Pr=new Map;function jr(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Br(t){return null==t?"":t.toLowerCase()}var zr=!1,Wr=!1;function Ur(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f=!1,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m={},inlineImages:g=!1,recordCanvas:y=!1,canvasMaskingConfigured:b,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k=5e3,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:R=!1,depth:A=0,maxDepth:x=50}=e;let{needsMask:T}=e,{preserveWhiteSpace:O=!0}=e;if(A>=x)return Wr=!0,zr||(zr=!0,console.warn(`[rrweb-snapshot] DOM tree depth exceeded max depth of ${x}. Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.`)),null;T||(T=Lr(t,o,a,void 0===T)),Mi>0&&(xi.nodeCount+=1);const E=function(t,e){const{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,maskAllElementAttributes:h=!1,maskAttributeFn:d,dataURLOptions:f={},inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y=!1}=e,b=function(t,e){if(!e.hasNode(t))return;const n=e.getId(t);return 1===n?void 0:n}(n,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:ai.Document,childNodes:[],compatMode:t.compatMode}:{type:ai.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:ai.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){const{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:s,maskInputOptions:o={},maskInputFn:a,maskAllElementAttributes:l=!1,maskAttributeFn:u,dataURLOptions:c={},inlineImages:h,recordCanvas:d,canvasMaskingConfigured:f,keepIframeSrcFn:v,newlyAddedElement:p=!1,rootId:m}=e,g=function(t,e,n){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let n=t.classList.length;n--;)if(e.test(t.classList[n]))return!0;if(n)return t.matches(n)}catch(t){}return!1}(t,i,r),y=function(t){if(t instanceof HTMLFormElement)return"form";const e=hr(t.tagName);return Ir.test(e)?"div":e}(t),b=new Set;let w={};const _=t.attributes.length;for(let e=0;_>e;e++){const i=t.attributes[e];$r(y,i.name)||(w[i.name]=Fr(n,y,hr(i.name),i.value,t,c))}if("link"===y&&s&&!g){let e=t.sheet;if(!e){const i=function(t){return t.href}(t);i&&(e=jr(n,i),!e&&i.includes(".css"))&&(e=jr(n,window.location.origin+"/"+i.replace(window.location.href,"")))}let i=null;e&&(Ui(e)?Mi>0&&(Ei.push(t),Fi+=1):i=er(e)),i&&(delete w.rel,delete w.href,w._cssText=i)}if("style"===y&&t.sheet&&!(t.innerText||wi.textContent(t)||"").trim().length){const e=zi(()=>er(t.sheet));e&&(w._cssText=e)}if("input"===y||"textarea"===y||"select"===y){const e=t.value,n=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&e?w.value=cr({element:t,type:pr(t),tagName:y,value:e,maskInputOptions:o,maskInputFn:a}):n&&(w.checked=n)}if("option"===y&&(t.selected&&!o.select?w.selected=!0:delete w.selected),"dialog"===y&&t.open){try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}b.add("rr_open_mode")}if("canvas"===y&&d&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let n=0;t.width>n;n+=50)for(let i=0;t.height>i;i+=50){const r=e.getImageData;if(new Uint32Array((vr in r?r[vr]:r).call(e,n,i,Math.min(50,t.width-n),Math.min(50,t.height-i)).data.buffer).some(t=>0!==t))return!1}return!0})(t)||(w.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){const e=t.toDataURL(c.type,c.quality),i=n.createElement("canvas");i.width=t.width,i.height=t.height,e!==i.toDataURL(c.type,c.quality)&&(w.rr_dataURL=e)}let k,S=!1;if("img"===y&&h){_r||(_r=n.createElement("canvas"),kr=_r.getContext("2d"));const e=t,i=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,s=(e,n)=>S?fr({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u}):n,o=()=>{Nr(e,"load",o);try{_r.width=e.naturalWidth,_r.height=e.naturalHeight,kr.drawImage(e,0,0);const t=_r.toDataURL(c.type,c.quality);w.rr_dataURL=s("rr_dataURL",t)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o));console.warn(`Cannot inline img src=${i}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?w.crossOrigin=s("crossOrigin",r):e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?o():e.addEventListener("load",o)}if("audio"===y||"video"===y){const e=w;e.rr_mediaState=t.paused?"paused":"played",b.add("rr_mediaState"),e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(p||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),g){var C,I,M;const{width:e,height:i,left:r,top:s}=t.getBoundingClientRect(),o=null===(C=n.defaultView)||void 0===C?void 0:C.getComputedStyle(t);w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`,rr_left:`${Math.floor(r+((null===(I=n.defaultView)||void 0===I?void 0:I.scrollX)||0))}px`,rr_top:`${Math.floor(s+((null===(M=n.defaultView)||void 0===M?void 0:M.scrollY)||0))}px`},b.add("rr_width"),b.add("rr_height"),b.add("rr_left"),b.add("rr_top"),o&&(w.rr_position=o.position||"static",b.add("rr_position"),o.transform&&"none"!==o.transform&&(w.rr_transform=o.transform,b.add("rr_transform")),o.display&&o.display.startsWith("inline")&&(w.rr_display=o.display,b.add("rr_display")))}if("iframe"!==y||v(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src),l||u)for(const[e,n]of Object.entries(w))"string"!=typeof n&&null!==n||(w[e]=fr({element:t,name:e,value:n,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:b.has(e)}));S=!0;try{customElements.get(y)&&(k=!0)}catch(t){}return{type:ai.Element,tagName:y,attributes:w,childNodes:[],isSVG:(R=t,Boolean("svg"===R.tagName||R.ownerSVGElement)||void 0),needBlock:g,rootId:m,isCustom:k};var R}(t,{doc:n,blockClass:r,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,maskAllElementAttributes:h,maskAttributeFn:d,dataURLOptions:f,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case t.TEXT_NODE:return function(t,e){const{needsMask:n,maskTextFn:i,rootId:r}=e,s=wi.parentNode(t),o=s&&s.tagName;let a=wi.textContent(t);const l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var c;if(t.nextSibling||t.previousSibling);else if(Ui(s.sheet));else if(null===(c=s.sheet)||void 0===c?void 0:c.cssRules){const t=er(s.sheet);t&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(t)&&(a=t)}}catch(e){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${e}`,t)}a=wr(a,Or(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&n&&(a=i?i(a,wi.parentElement(t)):a.replace(/[\S]/g,"*")),{type:ai.Text,textContent:a||"",isStyle:l,rootId:r}}(t,{doc:n,needsMask:o,maskTextFn:u,rootId:b});case t.CDATA_SECTION_NODE:return{type:ai.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:ai.Comment,textContent:wi.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:T,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:M,newlyAddedElement:R});if(!E)return console.warn(t,"not serialized"),null;let F;F=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===ai.Comment)return!0;if(t.type===ai.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e;let n;try{n=new URL(t,window.location.href)}catch(t){return null}const i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Br(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Br(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Br(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Br(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Br(t.attributes.property).match(/^(og|twitter|fb):/)||Br(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Br(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Br(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Br(t.attributes.name))||Br(t.attributes.property).match(/^article:/)||Br(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Br(t.attributes.name)))return!0}}return!1}(E,p)||!O&&E.type===ai.Text&&!E.isStyle&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Mr();const D=Object.assign(E,{id:F});if(i.add(t,D),-2===F)return null;w&&w(t);let L=!l;if(D.type===ai.Element){L=L&&!D.needBlock,delete D.needBlock;const e=wi.shadowRoot(t);e&&Xi(e)&&(D.isShadowHost=!0)}if((D.type===ai.Document||D.type===ai.Element)&&L){p.headWhitespace&&D.type===ai.Element&&"head"===D.tagName&&(O=!1);const e={doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:T,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,depth:A+1,maxDepth:x};if(D.type===ai.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else for(const n of Array.from(wi.childNodes(t))){const t=Ur(n,e);t&&D.childNodes.push(t)}let R=null;if(Ji(t)&&(R=wi.shadowRoot(t)))for(const t of Array.from(wi.childNodes(R))){const n=Ur(t,e);n&&(Xi(R)&&(n.isShadow=!0),D.childNodes.push(n))}}const N=wi.parentNode(t);if(N&&Qi(N)&&Xi(N)&&(D.isShadow=!0),D.type===ai.Element&&"iframe"===D.tagName){const e=function(t,e,n){const i=()=>{},r=t.contentWindow;if(!r)return i;let s;try{s=r.document.readyState}catch(t){return i}const o=()=>e();if("complete"!==s){let i=!1,r=null;const s=()=>{i||(i=!0,null!==r&&(clearTimeout(r),r=null),Nr(t,"load",a),t.addEventListener("load",o),e())},a=()=>s();return r=setTimeout(s,n),t.addEventListener("load",a),()=>{null!==r&&(clearTimeout(r),r=null),i?Nr(t,"load",o):(i=!0,Nr(t,"load",a))}}const a="about:blank";let l;try{l=r.location.href}catch(t){return i}if(l!==a||t.src===a||""===t.src){const n=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(n),Nr(t,"load",o)}}return t.addEventListener("load",o),()=>{Nr(t,"load",o)}}(t,()=>{const e=t.contentDocument;if(e&&_){const n=Ur(e,{doc:e,mirror:i,blockClass:r,blockSelector:s,needsMask:T,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k,onIframeListenerRegistered:S,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,depth:A+1,maxDepth:x});n&&_(t,n)}},k);null==S||S(t,e)}return D.type===ai.Element&&"link"===D.tagName&&"stylesheet"===D.attributes.rel&&function(e,l,S){if(Pr.has(e))return;let R;try{R=e.sheet}catch(t){return}if(R)return;const E=new AbortController;let F=!1;const D=()=>{if(!F){F=!0;try{(()=>{if(C){const e=Ur(t,{doc:n,mirror:i,blockClass:r,blockSelector:s,needsMask:T,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,maskAllElementAttributes:f,maskAttributeFn:v,slimDOMOptions:p,dataURLOptions:m,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:O,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:k,onStylesheetLoad:C,stylesheetLoadTimeout:I,keepIframeSrcFn:M,depth:A,maxDepth:x});e&&C(t,e)}})()}finally{Pr.delete(e),E.abort()}}},L=setTimeout(D,S);E.signal.addEventListener("abort",()=>clearTimeout(L),{once:!0}),e.addEventListener("load",D,{signal:E.signal,once:!0}),Pr.set(e,E)}(t,0,I),D}function Hr(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var qr=class t{constructor(...t){Zi(this,"parentElement",null),Zi(this,"parentNode",null),Zi(this,"ownerDocument",void 0),Zi(this,"firstChild",null),Zi(this,"lastChild",null),Zi(this,"previousSibling",null),Zi(this,"nextSibling",null),Zi(this,"ELEMENT_NODE",1),Zi(this,"TEXT_NODE",3),Zi(this,"nodeType",void 0),Zi(this,"nodeName",void 0),Zi(this,"RRNodeType",void 0)}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function Gr(t,e,n=document){const i={capture:!0,passive:!0};return n.addEventListener(t,e,i),()=>Vr(n,t,e,i)}function Vr(t,e,n,i){Zr(()=>{const r=t.removeEventListener;"function"==typeof r&&(void 0!==i?r.call(t,e,n,i):r.call(t,e,n))})}function Zr(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Jr(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Qr="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.",Xr={map:{},getId(){return console.warn(Qr),-1},getNode(){return console.warn(Qr),null},removeNodeFromMap(){console.warn(Qr)},has(){return console.warn(Qr),!1},reset(){console.warn(Qr)}};function Yr(t,e,n={}){let i=null,r=0;return function(...s){const o=Date.now();r||!1!==n.leading||(r=o);const a=e-(o-r),l=this;0>=a||a>e?(i&&(clearTimeout(i),i=null),r=o,t.apply(l,s)):i||!1===n.trailing||(i=setTimeout(()=>{r=!1===n.leading?0:Date.now(),i=null,t.apply(l,s)},a))}}function Kr(t,e,n,i,r=window){const s=r.Object.getOwnPropertyDescriptor(t,e);return r.Object.defineProperty(t,e,i?n:{set(t){if(setTimeout(()=>{try{n.set.call(this,t)}catch(t){}},0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>Kr(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xr=new Proxy(Xr,{get(t,e,n){return"map"===e&&console.warn(Qr),Reflect.get(t,e,n)}}));var ts=Date.now;function es(t){var e,n,i,r;const s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null===(e=wi.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null===(i=wi.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(r=s.body)||void 0===r?void 0:r.scrollTop)||0}}function ns(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function is(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function rs(t){return t?t.nodeType===t.ELEMENT_NODE?t:wi.parentElement(t):null}function ss(t,e,n,i){if(!t)return!1;const r=rs(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(i&&null!==r.closest("."+e))return!0}else if(Dr(r,e,i))return!0}catch(t){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function os(t,e,n){return!("TITLE"!==t.tagName||!n.headTitleMutations)||-2===e.getId(t)}function as(t,e){if(Qi(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const i=wi.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||as(i,e))}function ls(t){return Boolean(t.changedTouches)}function us(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function cs(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function hs(t){return!!t&&(t instanceof qr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(wi.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ts=()=>(new Date).getTime());var ds=class{constructor(){Zi(this,"id",1),Zi(this,"styleIDMap",new WeakMap),Zi(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let n;return n=void 0===e?this.id++:e,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function fs(t){var e;let n=null;return"getRootNode"in t&&(null===(e=wi.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&wi.host(wi.getRootNode(t))&&(n=wi.host(wi.getRootNode(t))),n}function vs(t){const e=t.ownerDocument;if(!e)return!1;if(wi.contains(e,t))return!0;const n=wi.isConnected(t);return"boolean"==typeof n?n:function(t){const e=t.ownerDocument;if(!e)return!1;const n=function(t){let e,n=t;for(;e=fs(n);)n=e;return n}(t);return wi.contains(e,n)}(t)}function ps(t){return"__ln"in t}var ms,gs=class{constructor(){Zi(this,"length",0),Zi(this,"head",null),Zi(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let n=0;t>n;n++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ps(t.previousSibling)){const n=t.previousSibling.__ln.next;e.next=n,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,n&&(n.previous=e)}else if(t.nextSibling&&ps(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},ys=(t,e)=>`${t}@${e}`,bs=class{constructor(){Zi(this,"frozen",!1),Zi(this,"locked",!1),Zi(this,"texts",[]),Zi(this,"attributes",[]),Zi(this,"attributeMap",new WeakMap),Zi(this,"generatedAttributes",new WeakMap),Zi(this,"removes",[]),Zi(this,"mapRemoves",new Set),Zi(this,"movedMap",{}),Zi(this,"addedSet",new Set),Zi(this,"movedSet",new Set),Zi(this,"droppedSet",new Set),Zi(this,"removesSubTreeCache",new Set),Zi(this,"mutationCb",void 0),Zi(this,"blockClass",void 0),Zi(this,"blockSelector",void 0),Zi(this,"maskTextClass",void 0),Zi(this,"maskTextSelector",void 0),Zi(this,"inlineStylesheet",void 0),Zi(this,"maskInputOptions",void 0),Zi(this,"maskTextFn",void 0),Zi(this,"maskInputFn",void 0),Zi(this,"maskAllElementAttributes",void 0),Zi(this,"maskAttributeFn",void 0),Zi(this,"keepIframeSrcFn",void 0),Zi(this,"recordCanvas",void 0),Zi(this,"canvasMaskingConfigured",void 0),Zi(this,"inlineImages",void 0),Zi(this,"slimDOMOptions",void 0),Zi(this,"dataURLOptions",void 0),Zi(this,"doc",void 0),Zi(this,"mirror",void 0),Zi(this,"iframeManager",void 0),Zi(this,"stylesheetManager",void 0),Zi(this,"shadowDomManager",void 0),Zi(this,"canvasManager",void 0),Zi(this,"processedNodeManager",void 0),Zi(this,"unattachedDoc",void 0),Zi(this,"canvasManagerReleased",!1),Zi(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Zi(this,"emit",()=>{if(this.frozen||this.locked)return;const t=_i(),e=Ci();try{this.processBufferedMutations()}finally{n=_i()-t,i=e,Mi>0||Ii(n,null!=i?i:ki)||n>Di.slowestBatchMs&&(Di.slowestBatchMs=n)}var n,i}),Zi(this,"processBufferedMutations",()=>{const t=[],e=new Set,n=new gs,i=t=>{let e=t,n=-2;for(;-2===n;)e=e&&e.nextSibling,n=e&&this.mirror.getId(e);return n};let r;const s=s=>{var o;const a=wi.parentNode(s);if(!a||!vs(s)||"TEXTAREA"===a.tagName)return;if(this.isBlockedAtEmission(a))return;const l=Qi(a)?this.mirror.getId(fs(s)):this.mirror.getId(a),u=i(s);if(-1===l||-1===u)return n.addNode(s);null!==(o=r)&&void 0!==o||(r={doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{us(t,this.mirror)&&this.iframeManager.addIframe(t),cs(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),hs(t)&&!ss(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(wi.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});const c=Ur(s,r);c&&(t.push({parentId:l,nextId:u,node:c}),e.add(c.id))};for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t);for(const t of this.movedSet)_s(this.removesSubTreeCache,t)&&!this.movedSet.has(wi.parentNode(t))||s(t);for(const t of this.addedSet)ks(this.droppedSet,t)||_s(this.removesSubTreeCache,t)?ks(this.movedSet,t)?s(t):this.droppedSet.add(t):s(t);let o=null;for(;n.length;){let t=null;if(o){const e=this.mirror.getId(wi.parentNode(o.value)),n=i(o.value);-1!==e&&-1!==n&&(t=o)}if(!t){let e=n.tail;for(;e;){const n=e;if(e=e.previous,n){const e=this.mirror.getId(wi.parentNode(n.value));if(-1===i(n.value))continue;if(-1!==e){t=n;break}{const e=wi.parentNode(n.value);if(e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=wi.host(e);if(-1!==this.mirror.getId(i)){t=n;break}}}}}}if(!t){for(;n.head;)n.removeNode(n.head.value);break}o=t.previous,n.removeNode(t.value),s(t.value)}const a={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const e=t.node,n=wi.parentNode(e);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{const{attributes:e}=t;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){const n=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>n.length&&(n+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(const[i,r]of Object.entries(e))if("string"==typeof r||null===r){var n;e[i]=fr({element:t.node,name:i,value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(n=this.generatedAttributes.get(t.node))||void 0===n?void 0:n.has(i)})}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&this.mutationCb(a)}),Zi(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Zi(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e));const n=Array.from(wi.childNodes(t),t=>wi.textContent(t)||"").join("");e.attributes.value=cr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:pr(t),value:n,maskInputFn:this.maskInputFn})}),Zi(this,"processMutation",t=>{if(!os(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=wi.textContent(t.target);ss(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Lr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,rs(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{var e;const i=t.target,r=hr(i.tagName),s=t.attributeName,o=null!==(e=t.attributeNamespace)&&void 0!==e?e:null;let a=function(t,e,n){if(!n)return e;const i=t.getAttributeNodeNS(n,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===n)return`xlink:${e}`;if("http://www.w3.org/XML/1998/namespace"===n)return`xml:${e}`;if("http://www.w3.org/2000/xmlns/"===n)return"xmlns"===e?e:`xmlns:${e}`;const r=t.lookupPrefix(n);return r?`${r}:${e}`:e}(i,s,o),l=o?i.getAttributeNS(o,s):t.target.getAttribute(s);if("value"===a){const t=i,e=pr(t);l=cr({element:t,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:l,maskInputFn:this.maskInputFn})}if(ss(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;let u=this.attributeMap.get(t.target);const c="iframe"===r&&"src"===a;if(c&&!this.keepIframeSrcFn(l)&&i.contentDocument)return;if("type"===a&&"input"===r&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!$r(r,a)){var n;u||(u={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(u),this.attributeMap.set(t.target,u));const e=Fr(this.doc,r,hr(a),l,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(l)&&(a="rr_src"),u.attributes[a]=e,null===(n=this.generatedAttributes.get(t.target))||void 0===n||n.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const e=this.unattachedDoc.createElement("span"),n=i.style;t.oldValue&&(e.style.cssText=t.oldValue);for(const t of Array.from(n)){const i=n.getPropertyValue(t),r=n.getPropertyPriority(t);i!==e.style.getPropertyValue(t)||r!==e.style.getPropertyPriority(t)?u.styleDiff[t]=""===r?i:[i,r]:u._unchangedStyles[t]=[i,r]}for(const t of Array.from(e.style))""===n.getPropertyValue(t)&&(u.styleDiff[t]=!1)}else if("open"===a&&"dialog"===r){u.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";let e=this.generatedAttributes.get(t.target);e||(e=new Set,this.generatedAttributes.set(t.target,e)),e.add("rr_open_mode")}}break}case"childList":if(ss(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const n=this.mirror.getId(e),i=Qi(t.target)?this.mirror.getId(wi.host(t.target)):this.mirror.getId(t.target);ss(t.target,this.blockClass,this.blockSelector,!1)||os(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ws(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===n||as(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ys(n,i)]?ws(this.movedSet,e):(this.removes.push({parentId:i,id:n,isShadow:!(!Qi(t.target)||!Xi(t.target))||void 0}),function(t,e){const n=[t];for(;n.length;){const t=n.pop();e.has(t)||(e.add(t),wi.childNodes(t).forEach(t=>n.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),Zi(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(os(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;e&&this.mirror.hasNode(e)&&(n=this.mirror.getId(e)),n&&-1!==n&&(this.movedMap[ys(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!ss(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;const e=wi.childNodes(t);for(let t=0,n=e.length;n>t;t++){const n=e[t];n&&this.genAdds(n)}if(hs(t)){const e=wi.childNodes(wi.shadowRoot(t));for(let n=0,i=e.length;i>n;n++){const i=e[n];i&&(this.processedNodeManager.add(i,this),this.genAdds(i,t))}}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(const t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){const e=this.blockClass,n=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;for(;t;){if(n&&(n.lastIndex=0),ss(t,n||e,this.blockSelector,!0))return!0;const i="getRootNode"in t?wi.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?wi.host(i):null}return!1}};function ws(t,e){const n=[e];for(;n.length;){const e=n.pop();if(t.delete(e),e.nodeType===e.TEXT_NODE)continue;const i=wi.childNodes(e);for(let t=0,e=i.length;e>t;t++){const e=i[t];e&&n.push(e)}}}function _s(t,e,n){return 0!==t.size&&function(t,e){const n=wi.parentNode(e);return!!n&&t.has(n)}(t,e)}function ks(t,e){if(0===t.size)return!1;let n=wi.parentNode(e);for(;n;){if(t.has(n))return!0;n=wi.parentNode(n)}return!1}function Ss(t){ms=t}function Cs(){ms=void 0}var Is=(t,e="rrweb")=>ms?(...n)=>{try{return t(...n)}catch(t){if(ms&&!0===ms(t,e))return;throw t}}:t,Ms=[];function Rs(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function As(t,e){const n=new bs;let i;n.init(t);try{i=new(yi())(Is(n.processMutations.bind(n)));const r={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(r.attributeFilter=t.attributeFilter),i.observe(e,r),Ms.push(n),{observer:i,buffer:n}}catch(t){try{null==i||i.disconnect(),n.destroy(),n.reset()}catch(t){}throw t}}function xs({scrollCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:s}){const o=new Map,a=s=>{const a=Rs(s);if(!a||ss(a,i,r,!0))return;const l=n.getId(a);let u,c;if(a===e&&e.defaultView){const t=es(e.defaultView);u=t.left,c=t.top}else u=a.scrollLeft,c=a.scrollTop;const h=`${u},${c}`;o.get(l)!==h&&(o.set(l,h),t({id:l,x:u,y:c}))},l=[Gr("scroll",Is(Yr(Is(t=>a(t)),s.scroll||100)),e)];return"onscrollend"in e&&l.push(Gr("scrollend",Is(a),e)),()=>l.forEach(t=>t())}function Ts(t,e){for(let n=Ms.length-1;n>=0;n--){const i=Ms[n];if(!i)continue;let r=i.bufferBelongsToIframe(t);!r&&e&&e.has(i.bufferDoc())&&(r=!0),r&&(i.reset(),Ms.splice(n,1))}}var Os=["INPUT","TEXTAREA","SELECT"],Es=new WeakMap;function Fs(t){return function t(e,n){if(Ns("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ns("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ns("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ns("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const i=Array.from(e.parentRule.cssRules).indexOf(e);return n.unshift(i),t(e.parentRule,n)}if(e.parentStyleSheet){const t=Array.from(e.parentStyleSheet.cssRules).indexOf(e);n.unshift(t)}return n}(t,[])}function $s(t,e,n){let i,r;return t?(t.ownerNode?i=e.getId(t.ownerNode):r=n.getId(t),{styleId:r,id:i}):{}}function Ds({mirror:t,stylesheetManager:e},n){var i,r;let s=null;s=t.getId("#document"===n.nodeName?n:wi.host(n));const o="#document"===n.nodeName?null===(i=n.defaultView)||void 0===i?void 0:i.Document:null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&a?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){let n;try{var i;n=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{e.adoptStyleSheets(t,s)}catch(t){}return n}}),Is(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function Ls(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};let i,r;!function(t,e){const{mutationCb:n,mousemoveCb:i,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:d,selectionCb:f,customElementCb:v}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),n(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),i(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),s(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),o(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),a(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),u(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),h(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),d(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),f(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),v(...t)}}(t,e);const s=[],o=Is(()=>{try{if(r)try{r.destroy(),r.reset()}finally{const t=Ms.indexOf(r);-1!==t&&Ms.splice(t,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{Jr(s)}});try{if(t.recordDOM){const e=As(t,t.doc);i=e.observer,r=e.buffer}if(s.push(function({mousemoveCb:t,sampling:e,doc:n,mirror:i}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,s="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,a=[];const l=Yr(Is(e=>{const n=Date.now()-o;t(a.map(t=>(t.timeOffset-=n,t)),e),a=[],o=null}),s),u=Is(Yr(Is(t=>{const e=Rs(t),{clientX:n,clientY:r}=ls(t)?t.changedTouches[0]:t;o||(o=ts()),a.push({x:n,y:r,id:i.getId(e),timeOffset:ts()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?ni.Drag:t instanceof MouseEvent?ni.MouseMove:ni.TouchMove)}),r,{trailing:!1})),c=[Gr("mousemove",u,n),Gr("touchmove",u,n),Gr("drag",u,n)];return Is(()=>{c.forEach(t=>t())})}(t)),s.push(function({mouseInteractionCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const o=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];let l=null;return Object.keys(ii).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t]).forEach(s=>{let o=hr(s);const u=(e=>s=>{const o=Rs(s);if(ss(o,i,r,!0))return;let a=null,u=e;if("pointerType"in s){switch(s.pointerType){case"mouse":a=ri.Mouse;break;case"touch":a=ri.Touch;break;case"pen":a=ri.Pen}a===ri.Touch&&(ii[e]===ii.MouseDown?u="TouchStart":ii[e]===ii.MouseUp&&(u="TouchEnd"))}else ls(s)&&(a=ri.Touch);null!==a?(l=a,(u.startsWith("Touch")&&a===ri.Touch||u.startsWith("Mouse")&&a===ri.Mouse)&&(a=null)):ii[e]===ii.Click&&(a=l,l=null);const c=ls(s)?s.changedTouches[0]:s;if(!c)return;const h=n.getId(o),{clientX:d,clientY:f}=c;Is(t)(E({type:ii[u],id:h,x:d,y:f},null!==a&&{pointerType:a}))})(s);if(window.PointerEvent)switch(ii[s]){case ii.MouseDown:case ii.MouseUp:o=o.replace("mouse","pointer");break;case ii.TouchStart:case ii.TouchEnd:return}a.push(Gr(o,u,e))}),Is(()=>{a.forEach(t=>t())})}(t)),s.push(xs(t)),s.push(function({viewportResizeCb:t},{win:e}){let n=-1,i=-1;return Gr("resize",Is(Yr(Is(()=>{const e=ns(),r=is();n===e&&i===r||(t({width:Number(r),height:Number(e)}),n=e,i=r)}),200)),e)}(t,{win:n})),s.push(function({inputCb:t,doc:e,mirror:n,blockClass:i,blockSelector:r,ignoreClass:s,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(t){let n=Rs(t);const u=t.isTrusted,h=e.defaultView;if(n&&h&&!(n instanceof h.HTMLElement))return;const f=n&&n.tagName;if(n&&"OPTION"===f&&(n=wi.parentElement(n)),!n||!f||0>Os.indexOf(f)||ss(n,i,r,!0))return;if(n.classList.contains(s)||o&&n.matches(o))return;let v=n.value,p=!1;const m=pr(n)||"";"radio"===m||"checkbox"===m?p=n.checked:(a[f.toLowerCase()]||a[m])&&(v=cr({element:n,maskInputOptions:a,tagName:f,type:m,value:v,maskInputFn:l})),d(n,c?{text:v,isChecked:p,userTriggered:u}:{text:v,isChecked:p});const g=n.name;"radio"===m&&g&&p&&e.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(t=>{if(t!==n){const e=t.value;d(t,c?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function d(e,i){const r=Es.get(e);if(!r||r.text!==i.text||r.isChecked!==i.isChecked){Es.set(e,i);const r=n.getId(e);Is(t)(E(E({},i),{},{id:r}))}}const f=("last"===u.input?["change"]:["input","change"]).map(t=>Gr(t,Is(h),e)),v=e.defaultView;if(!v)return()=>{f.forEach(t=>t())};const p=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value");return p&&p.set&&f.push(...[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]].map(t=>Kr(t[0],t[1],{set(){Is(h)({target:this,isTrusted:!1})}},!1,v))),Is(()=>{Jr(f)})}(t)),s.push(function({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:i,sampling:r,doc:s}){const o=Is(s=>Yr(Is(r=>{const o=Rs(r);if(!o||ss(o,e,n,!0))return;const{currentTime:a,volume:l,muted:u,playbackRate:c,loop:h}=o;t({type:s,id:i.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:h})}),r.media||500)),a=[Gr("play",o(oi.Play),s),Gr("pause",o(oi.Pause),s),Gr("seeked",o(oi.Seeked),s),Gr("volumechange",o(oi.VolumeChange),s),Gr("ratechange",o(oi.RateChange),s)];return Is(()=>{a.forEach(t=>t())})}(t)),t.recordDOM){const e=function(t){const e=new Map,n=new Set;let i=!0;const r=t=>{if(i)try{t()}catch(t){}},s=t=>{var n;const i=e.get(t);if(i){for(;null===(n=i[0])||void 0===n?void 0:n.ready;){const t=i.shift();(null==t?void 0:t.emit)&&r(t.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,n){if(!t)return void r(n);const i=e.get(t);i?(i.push({emit:n,ready:!0}),s(t)):r(n)},queuePendingMutation(o,a,l){if(!i)return()=>{};let u=e.get(o);u||(u=[],e.set(o,u));const c={emit:a,ready:!1};u.push(c);let h,d=!1,f=!1;const v=()=>{d||f||(d=!0,void 0!==h&&n.delete(h),c.ready=!0,c.emit=void 0,s(o))};try{h=t.setTimeout(v,5e3),d||f?t.clearTimeout(h):n.add(h)}catch(t){v()}return e=>{!f&&i&&(f=!0,void 0!==h&&(t.clearTimeout(h),n.delete(h)),d?e&&r(l):(c.ready=!0,e||(c.emit=void 0),s(o)))}},reset(){i=!1,n.forEach(e=>t.clearTimeout(e)),n.clear(),e.clear()}}}(n);s.push(e.reset),s.push(function({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:i,mutationQueue:r}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=$s(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,adds:[{rule:a,index:l}]})),l},"host")}),i.CSSStyleSheet.prototype.addRule=function(t,e,n=this.cssRules.length){return i.CSSStyleSheet.prototype.insertRule.apply(this,[`${t} { ${e} }`,n])};const o=i.CSSStyleSheet.prototype.deleteRule;let a,l;i.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=$s(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,removes:[{index:a}]})),l},"host")}),i.CSSStyleSheet.prototype.removeRule=function(t){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},i.CSSStyleSheet.prototype.replace&&(a=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);try{const i=null==l?void 0:l.then;if(s.ownerNode||!l||"function"!=typeof i)return l;n.onCssomSheetMutation(s);const{id:o,styleId:u}=$s(s,e,n.styleMirror);if(!(o&&-1!==o||u&&-1!==u))return l;const c=r.queuePendingMutation(s,()=>t({id:o,styleId:u,replace:a}),()=>{const e=er(s);null!==e&&t({id:o,styleId:u,replace:e})});try{i.call(l,()=>c(!0),()=>c(!1))}catch(t){c(!1)}}catch(t){}return l},"host")})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s);const{id:u,styleId:c}=$s(s,e,n.styleMirror);return(u&&-1!==u||c&&-1!==c)&&r.queueMutation(s,()=>t({id:u,styleId:c,replaceSync:a})),l},"host")}));const u={};Ps("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(Ps("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),Ps("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),Ps("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(u).forEach(([i,s])=>{c[i]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[i].insertRule,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=$s(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Fs(s),l];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,adds:[{rule:a,index:e}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(c[i].deleteRule,{apply:Is((i,s,o)=>{const[a]=o,l=i.apply(s,o);n.onCssomSheetMutation(s.parentStyleSheet);const{id:u,styleId:c}=$s(s.parentStyleSheet,e,n.styleMirror);if(s.parentStyleSheet&&(u&&-1!==u||c&&-1!==c)){const e=[...Fs(s),a];r.queueMutation(s.parentStyleSheet,()=>t({id:u,styleId:c,removes:[{index:e}]}))}return l},"host")})}),Is(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=o,a&&(i.CSSStyleSheet.prototype.replace=a),l&&(i.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([t,e])=>{e.prototype.insertRule=c[t].insertRule,e.prototype.deleteRule=c[t].deleteRule})})}(t,{win:n,mutationQueue:e})),s.push(Ds(t,t.doc)),s.push(function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:i},{win:r,mutationQueue:s}){const o=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Is((r,o,a)=>{var l;const[u,c,h]=a,d=r.apply(o,a);if(n.has(u))return d;const f=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(f);const{id:v,styleId:p}=$s(f,e,i.styleMirror);if(v&&-1!==v||p&&-1!==p){const e=Fs(o.parentRule);s.queueMutation(f,()=>t({id:v,styleId:p,set:{property:u,value:c,priority:h},index:e}))}return d},"host")});const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:Is((r,o,a)=>{var l;const[u]=a,c=r.apply(o,a);if(n.has(u))return c;const h=null===(l=o.parentRule)||void 0===l?void 0:l.parentStyleSheet;i.onCssomSheetMutation(h);const{id:d,styleId:f}=$s(h,e,i.styleMirror);if(d&&-1!==d||f&&-1!==f){const e=Fs(o.parentRule);s.queueMutation(h,()=>t({id:d,styleId:f,remove:{property:u},index:e}))}return c},"host")}),Is(()=>{r.CSSStyleDeclaration.prototype.setProperty=o,r.CSSStyleDeclaration.prototype.removeProperty=a})}(t,{win:n,mutationQueue:e})),t.collectFonts&&s.push(function({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const i=[],r=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,n){const i=new s(t,e,n);return r.set(i,{family:t,buffer:"string"!=typeof e,descriptors:n,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};const o=bi(e.fonts,"add",function(e){return function(n){return setTimeout(Is(()=>{const e=r.get(n);e&&(t(e),r.delete(n))}),0),e.apply(this,[n])}});return i.push(()=>{n.FontFace=s}),i.push(o),Is(()=>{i.forEach(t=>t())})}(t))}s.push(function(t){const{doc:e,mirror:n,blockClass:i,blockSelector:r,selectionCb:s}=t;let o=!0;const a=Is(()=>{const t=e.getSelection();if(!t||o&&(null==t?void 0:t.isCollapsed))return;o=t.isCollapsed||!1;const a=[],l=t.rangeCount||0;for(let e=0;l>e;e++){const{startContainer:s,startOffset:o,endContainer:l,endOffset:u}=t.getRangeAt(e);ss(s,i,r,!0)||ss(l,i,r,!0)||a.push({start:n.getId(s),startOffset:o,end:n.getId(l),endOffset:u})}s({ranges:a})});return a(),Gr("selectionchange",a)}(t)),s.push(function({doc:t,customElementCb:e}){const n=t.defaultView;return n&&n.customElements?bi(n.customElements,"define",function(t){return function(n,i,r){try{e({define:{name:n}})}catch(t){console.warn(`Custom element callback failed for ${n}`)}return t.apply(this,[n,i,r])}}):()=>{}}(t));for(const e of t.plugins)s.push(e.observer(e.callback,n,e.options))}catch(t){try{o()}catch(t){}throw t}return o}function Ns(t){return void 0!==window[t]}function Ps(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var js=class{constructor(t){Zi(this,"generateIdFn",void 0),Zi(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Zi(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,n,i){if(0>e)return e;const r=n||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t);let o=r.get(e);return void 0===o&&(o=this.generateIdFn(),r.set(e,o),s.set(o,e)),o}getIds(t,e){const n=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,n,i))}getRemoteId(t,e,n){var i;return"number"!=typeof e||0>e?e:null!==(i=(n||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){const n=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,n))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){let e=this.iframeRemoteIdToLocalIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToLocalIdMap.set(t,e)),e}getLocalIdToRemoteIdMap(t){let e=this.iframeLocalIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeLocalIdToRemoteIdMap.set(t,e)),e}},Bs=class{constructor(t){Zi(this,"iframes",new WeakMap),Zi(this,"crossOriginIframeMap",new WeakMap),Zi(this,"crossOriginIframeMirror",new js(Mr)),Zi(this,"crossOriginIframeStyleMirror",void 0),Zi(this,"crossOriginIframeRootIdMap",new WeakMap),Zi(this,"mirror",void 0),Zi(this,"mutationCb",void 0),Zi(this,"wrappedEmit",void 0),Zi(this,"loadListener",void 0),Zi(this,"pageHideListener",void 0),Zi(this,"stylesheetManager",void 0),Zi(this,"recordCrossOriginIframes",void 0),Zi(this,"messageHandler",void 0),Zi(this,"nestedIframeListeners",new Map),Zi(this,"attachedWindows",new WeakMap),Zi(this,"attachedDocuments",new WeakMap),Zi(this,"attachedIframes",new Map),Zi(this,"loadListenerDisposers",new WeakMap),Zi(this,"iframeElementsById",new Map),Zi(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new js(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){let n=this.loadListenerDisposers.get(t);n||(n=new Set,this.loadListenerDisposers.set(t,n)),n.add(e);const i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,n,i;return null!==(e=null!==(n=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==n?n:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){const e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Zr(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){const e=this.pageHideHandlers.get(t);e&&(e.forEach(({win:t,handler:e})=>{Vr(t,"pagehide",e)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){const n=this.mirror.getId(t);return this.attachedIframes.set(n,{element:t,content:e}),n}attachIframe(t,e){var n;const i=this.trackIframeContent(t,e);if(t.contentDocument){let e=this.attachedDocuments.get(t);e||(e=new Set,this.attachedDocuments.set(t,e)),e.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});const r=t.contentWindow;if(this.recordCrossOriginIframes&&r&&!this.nestedIframeListeners.has(r)){const e=this.handleMessage.bind(this);Zr(()=>{r.addEventListener("message",e),this.nestedIframeListeners.set(r,e);let n=this.attachedWindows.get(t);n||(n=new Set,this.attachedWindows.set(t,n)),n.add(r)})}Zr(()=>{const e=t.contentWindow;if(!e)return;let n=this.pageHideHandlers.get(t);if(n)for(const t of n)if(t.win===e)return;const i=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",i),n||(n=new Set,this.pageHideHandlers.set(t,n)),n.add({win:e,handler:i})}),null===(n=this.loadListener)||void 0===n||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const i=this.transformCrossOriginEvent(n,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}transformCrossOriginEvent(t,e){switch(e.type){case ei.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:ei.IncrementalSnapshot,data:{source:ni.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ei.Meta:case ei.Load:case ei.DomContentLoaded:return!1;case ei.Plugin:return e;case ei.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case ei.IncrementalSnapshot:switch(e.data.source){case ni.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const n=this.crossOriginIframeRootIdMap.get(t);n&&this.patchRootIdOnNode(e.node,n)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case ni.Drag:case ni.TouchMove:case ni.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case ni.ViewportResize:return!1;case ni.MediaInteraction:case ni.MouseInteraction:case ni.Scroll:case ni.CanvasMutation:case ni.Input:return this.replaceIds(e.data,t,["id"]),e;case ni.StyleSheetRule:case ni.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ni.Font:return e;case ni.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case ni.AdoptedStyleSheet:var n;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(n=e.data.styles)||void 0===n||n.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,n,i){for(const r of i)(Array.isArray(e[r])||"number"==typeof e[r])&&(e[r]=Array.isArray(e[r])?t.getIds(n,e[r]):t.getId(n,e[r]));return e}replaceIds(t,e,n){return this.replace(this.crossOriginIframeMirror,t,e,n)}replaceStyleIds(t,e,n){return this.replace(this.crossOriginIframeStyleMirror,t,e,n)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===ai.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){const e=this.attachedIframes.get(t),n=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),n){const t=n.contentWindow,e=this.attachedWindows.get(n);e&&(e.forEach(t=>{const e=this.nestedIframeListeners.get(t);e&&(Vr(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(n)),t&&this.nestedIframeListeners.has(t)&&(Vr(t,"message",this.nestedIframeListeners.get(t)),this.nestedIframeListeners.delete(t)),t&&this.crossOriginIframeMap.delete(t),this.iframes.delete(n),this.disposeLoadListeners(n),this.removePageHideListener(n);const i=this.attachedDocuments.get(n);i&&(i.forEach(t=>{Zr(()=>this.mirror.removeNodeFromMap(t))}),Zr(()=>Ts(n,i)),this.attachedDocuments.delete(n))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0===this.attachedIframes.size)return;const t=[];this.attachedIframes.forEach((e,n)=>{this.mirror.has(n)||t.push(n)}),t.forEach(t=>this.removeIframeById(t))}reattachIframes(){this.attachedIframes.forEach(({content:t},e)=>{this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Vr(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Vr(e,"message",t)}),this.nestedIframeListeners.clear();const t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(({element:e})=>t.add(e)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},zs=class{constructor(t){Zi(this,"shadowDoms",new WeakSet),Zi(this,"mutationCb",void 0),Zi(this,"scrollCb",void 0),Zi(this,"bypassOptions",void 0),Zi(this,"mirror",void 0),Zi(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var n,i;if(!Xi(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const r=null!==(n=null===(i=wi.host(t))||void 0===i?void 0:i.ownerDocument)&&void 0!==n?n:e,{observer:s,buffer:o}=As(E(E({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push({doc:r,handler(){s.disconnect(),o.destroy(),o.releaseCanvasManager();const t=Ms.indexOf(o);-1!==t&&Ms.splice(t,1)}}),this.restoreHandlers.push({doc:r,handler:xs(E(E({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(wi.host(t))),this.restoreHandlers.push({doc:r,handler:Ds({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const n=this;this.restoreHandlers.push({doc:e,handler:bi(t.prototype,"attachShadow",function(t){return function(i){const r=t.call(this,i),s=wi.shadowRoot(this);return s&&vs(this)&&n.addShadowRoot(s,e),r}})})}reset(){this.restoreHandlers.forEach(({handler:t})=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){const e=[];for(const n of this.restoreHandlers)if(n.doc===t)try{n.handler()}catch(t){}else e.push(n);this.restoreHandlers=e}},Ws="skip-frame";function Us(t){if("object"!=typeof t||null===t)return!1;const{x:e,y:n,width:i,height:r}=t;return Number.isFinite(e)&&Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Hs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qs="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gs=0;64>Gs;Gs++)qs[Hs.charCodeAt(Gs)]=Gs;var Vs=function(t){var e,n=new Uint8Array(t),i=n.length,r="";for(e=0;i>e;e+=3)r+=Hs[n[e]>>2],r+=Hs[(3&n[e])<<4|n[e+1]>>4],r+=Hs[(15&n[e+1])<<2|n[e+2]>>6],r+=Hs[63&n[e+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r},Zs=new Map,Js=(t,e,n)=>{if(!t||!Ys(t,e)&&"object"!=typeof t)return;const i=function(t,e){let n=Zs.get(t);return n||(n=new Map,Zs.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}(n,t.constructor.name);let r=i.indexOf(t);return-1===r&&(r=i.length,i.push(t)),r};function Qs(t,e,n,i){if(t instanceof Array)return t.map(t=>Qs(t,e,n,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:Vs(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Qs(t.buffer,e,n,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:n}=t;return{rr_type:e,src:n}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Qs(t.data,e,n,i),t.width,t.height]}:Ys(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Js(t,e,n)}:t}var Xs=(t,e,n,i)=>t.map(t=>Qs(t,e,n,i)),Ys=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(n.find(n=>t instanceof e[n]))},Ks=["webgl","webgl2"];function to(t){return"nodeType"in t}function eo(t,e,n,i){const r=[];try{if(i){const i=function(t,e,n){const i=t.GPUCanvasContext;if((null==i?void 0:i.prototype)&&"function"==typeof i.prototype.configure)return bi(i.prototype,"configure",function(i){return function(r){const s=function(t){const{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!s||to(s)&&ss(s,e,n,!0))return i.call(this,r);to(s)&&!("__context"in s)&&(s.__context="webgpu");const o=function(t){const e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return i.call(this,null!==o&&r?E(E({},r),{},{usage:"number"==typeof r.usage?r.usage|o:o}):r)}})}(t,e,n);i&&r.push(i)}const s=bi(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...s){const o=function(t){return"experimental-webgl"===t?"webgl":t}(r);if(!ss(this,e,n,!0)&&("__context"in this||(this.__context=o),i&&Ks.includes(o)))if(s[0]&&"object"==typeof s[0]){const t=s[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...s])}});r.push(s)}catch(t){console.warn("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(t=>t())}}function no(t,e,n,i,r,s,o){const a=[],l=Object.getOwnPropertyNames(t);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if("function"!=typeof t[u])continue;const l=bi(t,u,function(t){return function(...a){const l=t.apply(this,a);if(Js(l,s,this),this.canvas&&"tagName"in this.canvas&&!ss(this.canvas,i,r,!0)){const t=Xs(a,s,this,o);n(this.canvas,{type:e,property:u,args:t})}return l}});a.push(l)}catch(s){const o=Kr(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!ss(this.canvas,i,r,!0)&&n(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(o)}return a}var io='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',ro="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",io],{type:"text/javascript;charset=utf-8"});function so(t){let e;try{if(e=ro&&(self.URL||self.webkitURL).createObjectURL(ro),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(io),{name:null==t?void 0:t.name})}}var oo,ao,lo,uo=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){Zi(this,"pendingCanvasMutations",new Map),Zi(this,"rafStamps",{latestId:0,invokeId:null}),Zi(this,"mirror",void 0),Zi(this,"mutationCb",void 0),Zi(this,"resetObservers",void 0),Zi(this,"frozen",!1),Zi(this,"locked",!1),Zi(this,"rafIdTimestamp",null),Zi(this,"rafIdFlush",null),Zi(this,"refCount",0),Zi(this,"torndown",!1),Zi(this,"resetFrameDedup",null),Zi(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:n,blockClass:i,blockSelector:r,recordCanvas:s,dataURLOptions:o,resolutionScale:a,canvasMasking:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(n,i,r,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,n,i,r,{dataURLOptions:o,resolutionScale:a,canvasMasking:l})}initCanvasFPSObserver(t,e,n,i,r){var s=this;if(!("OffscreenCanvas"in e))return;const o="number"==typeof r.resolutionScale&&Number.isFinite(r.resolutionScale)?Math.min(1,Math.max(.1,r.resolutionScale)):1,a=eo(e,n,i,!0),l=new Map;let u;try{u=new so}catch(t){return}let c=!1;u.onerror=()=>{var t;c=!0,cancelAnimationFrame(d),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{const{id:e}=t.data;if(l.set(e,!1),!("base64"in t.data))return;const{base64:n,type:i,displayWidth:r,displayHeight:s}=t.data;this.mutationCb({id:e,type:si["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0,r,s]}],displayWidth:r,displayHeight:s})};const h=1e3/t;let d,f=0;const v=t=>{var a;c||(f&&h>t-f||(f=t,(()=>{const t=[],r=e=>{try{e.querySelectorAll("canvas").forEach(e=>{ss(e,n,i,!0)||t.push(e)}),e.querySelectorAll("*").forEach(t=>{t.shadowRoot&&r(t.shadowRoot)})}catch(t){}};return r(e.document),t})().forEach((a=A(function*(t){const e=s.mirror.getId(t);if(!l.get(e)&&0!==t.width&&0!==t.height){l.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n,i;const r=t.getContext(t.__context);if(null==r||null===(n=r.isContextLost)||void 0===n?void 0:n.call(r))return void l.set(e,!1);!1===(null==r||null===(i=r.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=t.clientWidth||t.width,a=t.clientHeight||t.height,c=Math.max(1,Math.round(s*o)),h=Math.max(1,Math.round(a*o)),d=function(t,e,n,i,r,s){if(!t||"function"!=typeof t.regionsFn)return;let o;try{o=t.regionsFn(e)}catch(t){return Ws}if(void 0===o)return;if(!Array.isArray(o)||!o.every(Us))return Ws;const a=n/r,l=i/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{const e=Math.floor(t.x*a),n=Math.floor(t.y*l);return{x:e,y:n,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-n}})}(r.canvasMasking,t,c,h,s,a);if("skip-frame"===d)return void l.set(e,!1);const f=yield createImageBitmap(t,1>o?{resizeWidth:c,resizeHeight:h,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:h});u.postMessage({id:e,bitmap:f,width:c,height:h,displayWidth:s,displayHeight:a,dataURLOptions:r.dataURLOptions,maskRegions:d},[f])}catch(t){l.set(e,!1)}}}),function(t){return a.apply(this,arguments)}))),d=requestAnimationFrame(v))};d=requestAnimationFrame(v),this.resetObservers=()=>{var t;a(),cancelAnimationFrame(d),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}initCanvasMutationObserver(t,e,n,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=eo(t,e,n,!1),s=function(t,e,n,i,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])continue;const o=bi(e.CanvasRenderingContext2D.prototype,a,function(s){return function(...o){return ss(this.canvas,n,i,!0)||setTimeout(()=>{const n=Xs(o,e,this,r);t(this.canvas,{type:si["2D"],property:a,args:n})},0),s.apply(this,o)}});s.push(o)}catch(r){const o=Kr(e.CanvasRenderingContext2D.prototype,a,{set(e){ss(this.canvas,n,i,!0)||t(this.canvas,{type:si["2D"],property:a,args:[e],setter:!0})}});s.push(o)}return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i),o=function(t,e,n,i,r){const s=[];return void 0!==e.WebGLRenderingContext&&s.push(...no(e.WebGLRenderingContext.prototype,si.WebGL,t,n,i,e,r)),void 0!==e.WebGL2RenderingContext&&s.push(...no(e.WebGL2RenderingContext.prototype,si.WebGL2,t,n,i,e,r)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,n,i);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const n=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,n)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||-1===e)return;const i=n.map(t=>function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;s.length>i;i++)e.includes(n=s[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,ti)),{type:r}=n[0];this.mutationCb({id:e,type:r,commands:i}),this.pendingCanvasMutations.delete(t)}},co=class{constructor(t){var e;Zi(this,"trackedLinkElements",new WeakSet),Zi(this,"pendingDeferredSheets",new Set),Zi(this,"mutationCb",void 0),Zi(this,"adoptedStyleSheetCb",void 0),Zi(this,"maskAllElementAttributes",void 0),Zi(this,"maskAttributeFn",void 0),Zi(this,"styleMirror",new ds),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;let n=null,i=null;try{i=t.sheet,i&&(n=lr(i))}catch(t){}if(!n||!i)return qi(),null;const r=n;let s=!1;const o={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);let a=!1;return{advance:n=>{if(a)return!0;const l=_i(),u=Ci();let c=!0;try{if(s)return a=!0,qi(),!0;if(!r.advance(n))return c=!1,!1;a=!0;const o=r.text();if(!t.isConnected)return!0;let l=null;try{l=t.sheet}catch(t){}return l!==i?(qi(),!0):o?(this.emitCssTextMutation(t,e,o),!0):(qi(),!0)}finally{c&&this.pendingDeferredSheets.delete(o),Ii(h=_i()-l,null!=(d=u)?d:ki)||(Li.totalMs+=h,h>Li.slowestSliceMs&&(Li.slowestSliceMs=h))}var h,d},remainingRules:()=>r.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(const e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var n;null===(n=this.beginDeferredLinkInlining(t,e))||void 0===n||n.advance(1/0)}emitCssTextMutation(t,e,n){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:fr({element:t,name:"_cssText",value:n,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const n={id:e,styleIds:[]},i=[];for(const e of t){let t;if(this.styleMirror.has(e))t=this.styleMirror.getId(e);else{const n=this.styleMirror.add(e);t=n;const r=_i();try{zi(()=>{try{const t=e.rules||e.cssRules;t&&Bi(t)}catch(t){}i.push({styleId:n,rules:Array.from(e.rules||CSSRule,(t,n)=>({rule:nr(t,e.href),index:n}))})})}finally{Wi(_i()-r)}}n.styleIds.push(t)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Pr.forEach(t=>t.abort()),Pr.clear()}trackStylesheetInLinkElement(t){}},ho=class{constructor(){Zi(this,"nodeMap",new WeakMap),Zi(this,"active",!1)}inOtherBuffer(t,e){const n=this.nodeMap.get(t);return n&&Array.from(n).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},fo=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var vo;const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null===(vo=t.contentWindow)||void 0===vo?void 0:vo.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}var po=new ur,mo=new Set([ni.Mutation,ni.MediaInteraction,ni.StyleSheetRule,ni.CanvasMutation,ni.Font,ni.Log,ni.StyleDeclaration,ni.AdoptedStyleSheet]);function go(t){const e=window;if("function"==typeof e.requestIdleCallback){const n=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,n)}}}const n=setTimeout(t,250);return{cancel:()=>clearTimeout(n)}}function yo(t={}){let e;const{emit:n,checkoutEveryNms:i,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,inlineStylesheetBudgetRules:d,maskAllInputs:f,maskInputOptions:v,slimDOMOptions:p,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y=!1,maskAttributeFn:b,hooks:w,packFn:_,sampling:k={},dataURLOptions:S={},canvasResolutionScale:C,canvasMasking:I,mousemoveWait:M,recordDOM:R=!0,recordCanvas:A=!1,recordCrossOriginIframes:x=!1,recordAfter:T=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:F=!1,inlineImages:D=!1,plugins:L,keepIframeSrcFn:N=()=>!1,ignoreCSSAttributes:P=new Set([]),attributeFilter:j,errorHandler:B}=t;Ss(B);const z=E({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),W=!x||window.parent===window;let U=!1;if(!W)try{window.parent.document&&(U=!1)}catch(t){U=!0}if(W&&!n)throw new Error("emit function is required");if(!W&&!U)return()=>{};void 0!==M&&void 0===k.mousemove&&(k.mousemove=M),po.reset();const H=!0===f?{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!==v?v:{password:!0},q=Hr(void 0!==p&&p);let G;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();let V=0;const Z=new Map;let J,Q;const X=t=>{for(const e of L||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!U&&(t=_(t)),t};oo=(t,e)=>{var s;const o=t;if(o.timestamp=ts(),!(null===(s=Ms[0])||void 0===s?void 0:s.isFrozen())||o.type===ei.FullSnapshot||o.type===ei.IncrementalSnapshot&&mo.has(o.data.source)||Ms.forEach(t=>t.unfreeze()),W)null==n||n(X(o),e);else if(U){const t={type:"rrweb",event:X(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(t,"*")}if(o.type===ei.FullSnapshot)G=o,V=0;else if(o.type===ei.IncrementalSnapshot){if(o.data.source===ni.Mutation&&o.data.isAttachIframe)return;V++,(r&&V>=r||i&&o.timestamp-G.timestamp>i)&&ao(!0)}};const Y=t=>{if(t.removes&&t.removes.length>0){const e=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,n=new Set;if(t.adds.length>0)for(const e of t.adds){const t=po.getNode(e.node.id);t&&"IFRAME"===t.nodeName&&n.add(t)}t.removes.forEach(({id:t})=>{if(e&&e.has(t))return;const i=nt.getIframeElementById(t);i&&n.has(i)?nt.forgetIframeId(t):(null==J||J(t),nt.removeIframeById(t))}),null==Q||Q(),nt.cleanupDetachedIframes()}oo({type:ei.IncrementalSnapshot,data:E({source:ni.Mutation},t)})},K=t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.Scroll},t)}),tt=t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.CanvasMutation},t)}),et=new co({mutationCb:Y,adoptedStyleSheetCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.AdoptedStyleSheet},t)}),maskAllElementAttributes:y,maskAttributeFn:b}),nt=new Bs({mirror:po,mutationCb:Y,stylesheetManager:et,recordCrossOriginIframes:x,wrappedEmit:oo});for(const t of L||[])t.getMirror&&t.getMirror({nodeMirror:po,crossOriginIframeMirror:nt.crossOriginIframeMirror,crossOriginIframeStyleMirror:nt.crossOriginIframeStyleMirror});const it=new ho,rt=null==I?void 0:I.configured;lo=new uo({recordCanvas:A,mutationCb:tt,win:window,blockClass:s,blockSelector:o,mirror:po,sampling:k.canvas,dataURLOptions:z,resolutionScale:C,canvasMasking:I});const st=new zs({mutationCb:Y,scrollCb:K,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:H,dataURLOptions:z,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,recordCanvas:A,canvasMaskingConfigured:rt,inlineImages:D,sampling:k,slimDOMOptions:q,iframeManager:nt,stylesheetManager:et,canvasManager:lo,keepIframeSrcFn:N,processedNodeManager:it,attributeFilter:j},mirror:po});ao=(t=!1)=>{if(R){Ni(d);try{oo({type:ei.Meta,data:{href:window.location.href,width:is(),height:ns()}},t),null==e||e.cancel(),e=void 0,et.reset(),st.init(),Ms.forEach(t=>t.lock());let n=null,i=[];try{n=function(t,e){const{mirror:n=new ur,blockClass:i="rr-block",blockSelector:r=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,canvasMaskingConfigured:c,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:f,maskAllElementAttributes:v=!1,maskAttributeFn:p,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:_,onIframeListenerRegistered:k,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:I=()=>!1,maxDepth:M,inlineStylesheetBudgetRules:R}=e||{},A=!0===h?{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===h?{password:!0}:h,x=Hr(m);Ni(R);try{return Ur(t,{doc:t,mirror:n,blockClass:i,blockSelector:r,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:A,maskTextFn:d,maskInputFn:f,maskAllElementAttributes:v,maskAttributeFn:p,slimDOMOptions:x,dataURLOptions:g,inlineImages:l,recordCanvas:u,canvasMaskingConfigured:c,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:_,onIframeListenerRegistered:k,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:I,newlyAddedElement:!1,maxDepth:M})}finally{Pi()}}(document,{mirror:po,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:H,inlineStylesheetBudgetRules:d,maskTextFn:g,maskInputFn:m,maskAllElementAttributes:y,maskAttributeFn:b,slimDOM:q,dataURLOptions:z,recordCanvas:A,canvasMaskingConfigured:rt,inlineImages:D,onSerialize(t){us(t,po)&&nt.addIframe(t),cs(t,po)&&et.trackLinkElement(t),hs(t)&&st.addShadowRoot(wi.shadowRoot(t),document)},onIframeLoad(t,e){nt.attachIframe(t,e),st.observeAttachShadow(t)},onIframeListenerRegistered(t,e){nt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){et.attachLinkElement(t,e)},keepIframeSrcFn:N})}finally{i=Hi()}if(!n)return console.warn("Failed to snapshot the document");if(oo({type:ei.FullSnapshot,data:{node:n,initialOffset:es(window)}},t),Ms.forEach(t=>t.unlock()),lo.onFullSnapshot(),i.length){const t=function(t,e,n){let i=!1,r=null,s=0,o=null;const a=()=>null!==o||t.length>s,l=()=>{const n=t[s];t[s]=null,s+=1,n&&Zr(()=>{o=e.beginDeferredLinkInlining(n,po.getId(n))})},u=()=>{if(!o)return;const t=o;let e=!0;Zr(()=>{e=t.advance(200)}),e&&(o=null)},c=()=>{o||l(),u()},h=t=>{if(r=null,i)return;let e=0;do{try{c()}catch(t){null==o||o.discard(),o=null,Gi(1)}e+=1}while(!i&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(a()?r=go(h):n())};return r=go(h),{cancel(){i=!0,null==o||o.discard(),o=null,null==r||r.cancel(),r=null},flush(){if(i)return;i=!0,null==r||r.cancel(),r=null;let e=0,c=0;for(;a()&&50>e;){o||l();const t=o;if(t)if(Math.floor(t.remainingRules()/200)+1>50-e)t.discard(),o=null,c+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,c+=1}e+=1}}if(a()||c>0){let e=c+(null!==o?1:0);for(let n=s;t.length>n;n++)null!==t[n]&&(e+=1);Gi(e),null==o||o.discard(),o=null}n()}}}(i,et,()=>{e===t&&(e=void 0)});e=t}x&&nt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&et.adoptStyleSheets(document.adoptedStyleSheets,po.getId(document))}finally{Pi()}}};try{const t=[];t.push(Gr("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window));for(const e of["visibilitychange","freeze","resume"])t.push(Gr(e,Si,document));J=e=>{const n=Z.get(e);n&&(n.forEach(e=>{Zr(e);const n=t.indexOf(e);-1!==n&&t.splice(n,1)}),Z.delete(e))},Q=()=>{for(const[t]of Z){const e=po.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==J||J(t)}catch(e){null==J||J(t)}else null==J||J(t)}};const n=t=>{var e;return Is(Ls)({mutationCb:Y,mousemoveCb:(t,e)=>oo({type:ei.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.MouseInteraction},t)}),scrollCb:K,viewportResizeCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.ViewportResize},t)}),inputCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.Input},t)}),mediaInteractionCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.MediaInteraction},t)}),styleSheetRuleCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.StyleSheetRule},t)}),styleDeclarationCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.StyleDeclaration},t)}),canvasMutationCb:tt,fontCb:t=>oo({type:ei.IncrementalSnapshot,data:E({source:ni.Font},t)}),selectionCb(t){oo({type:ei.IncrementalSnapshot,data:E({source:ni.Selection},t)})},customElementCb(t){oo({type:ei.IncrementalSnapshot,data:E({source:ni.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:H,inlineStylesheet:h,sampling:k,recordDOM:R,recordCanvas:A,canvasMaskingConfigured:rt,inlineImages:D,userTriggeredOnInput:O,collectFonts:F,doc:t,maskInputFn:m,maskTextFn:g,maskAllElementAttributes:y,maskAttributeFn:b,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:q,dataURLOptions:z,mirror:po,iframeManager:nt,stylesheetManager:et,shadowDomManager:st,processedNodeManager:it,canvasManager:lo,ignoreCSSAttributes:P,attributeFilter:j,plugins:(null==L||null===(e=L.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>oo({type:ei.Plugin,data:{plugin:t.name,payload:e}})})))||[]},w)};nt.addLoadListener(e=>{try{const i=po.getId(e),r=n(e.contentDocument);if("function"==typeof r&&(t.push(r),-1!==i)){let t=Z.get(i);t||(t=new Set,Z.set(i,t)),t.add(r)}}catch(t){console.warn(t)}}),nt.addPageHideListener(t=>{const e=po.getId(t);null==J||J(e),Ts(t)});let i=-1;const r=t=>oo({type:ei.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),d=()=>{var t,e,n,s;const o=document,a=null!==(t=null!==(e=null!==(n=null!==(s=o.fullscreenElement)&&void 0!==s?s:o.webkitFullscreenElement)&&void 0!==n?n:o.mozFullScreenElement)&&void 0!==e?e:o.msFullscreenElement)&&void 0!==t?t:null,l=a?po.getId(a):-1;l!==i&&(-1!==i&&r({id:i,enter:!1}),i=l,-1!==l&&r({id:l,enter:!0}))},f=()=>{ao();const e=n(document);"function"==typeof e&&t.push(e),t.push(Gr("fullscreenchange",d)),t.push(Gr("webkitfullscreenchange",d)),t.push(Gr("mozfullscreenchange",d)),t.push(Gr("MSFullscreenChange",d)),fo=!0};return["interactive","complete"].includes(document.readyState)?f():(t.push(Gr("DOMContentLoaded",()=>{oo({type:ei.DomContentLoaded,data:{}}),"DOMContentLoaded"===T&&f()})),t.push(Gr("load",()=>{oo({type:ei.Load,data:{}}),"load"===T&&f()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Jr(t),it.destroy(),nt.removeLoadListener(),nt.destroy(),Z.clear(),st.reset(),po.reset(),fo=!1,Cs()}}catch(t){console.warn(t)}}yo.addCustomEvent=(t,e)=>{if(!fo)throw new Error("please add custom event after start recording");oo({type:ei.Custom,data:{tag:t,payload:e}})},yo.freezePage=()=>{Ms.forEach(t=>t.freeze())},yo.takeFullSnapshot=t=>{if(!fo)throw new Error("please take full snapshot after start recording");ao(t)},yo.mirror=po,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date,"0".repeat(32),"0".repeat(16);var bo=Object.create(null);function wo(t){return wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wo(t)}function _o(t,e,n){return(e=function(t){var e=function(t){if("object"!=wo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wo(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}bo.Node=Object.create(null),bo.ShadowRoot=Object.create(null),bo.MutationObserver=Object.create(null),bo.Element=Object.create(null);var ko=class{constructor(t){_o(this,"fileName",void 0),_o(this,"functionName",void 0),_o(this,"lineNumber",void 0),_o(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${e})`:`${this.fileName}:${t}:${e}`}},So=/(^|@)\S+:\d+/,Co=/^\s*at .*(\S+:\d+|\(native\))/m,Io=/^(eval@)?(\[native code])?$/,Mo={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Co)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(Co)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=e.match(/ (\((.+):(\d+):(\d+)\)$)/);e=n?e.replace(n[0],""):e;const i=e.split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop());return new ko({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Io)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new ko({functionName:t});{const e=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(e),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(t.replace(e,""));return new ko({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[];for(let t=2,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new ko({fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera10(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[];for(let t=0,r=n.length;r>t;t+=2){const r=e.exec(n[t]);r&&i.push(new ko({functionName:r[3]||void 0,fileName:r[2],lineNumber:parseFloat(r[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(So)&&!t.match(/^Error created at/)},this).map(function(t){const e=t.split("@"),n=this.extractLocation(e.pop());return new ko({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Ro(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const i=t.parentElement,r=[];if(i.children&&i.children.length>0)for(let t=0;i.children.length>t;t++){const e=i.children[t];e.localName&&e.localName.toLowerCase&&e.localName.toLowerCase()===n&&r.push(e)}r.length>1&&(n+=`:eq(${r.indexOf(t)})`),e=n+(e?">"+e:""),t=i}return e}function Ao(t){return Array.isArray(t)}function xo(t){return"object"==typeof t&&null!==t&&!Ao(t)}function To(t,e){if(0===e)return!0;const n=Object.keys(t);for(const i of n)if(xo(t[i])&&To(t[i],e-1))return!0;return!1}function Oo(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const i=[],r=[];return JSON.stringify(t,function(t,e){if(i.length>0){const n=i.indexOf(this);~n?i.splice(n+1):i.push(this),~n?r.splice(n,1/0,t):r.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(xo(s=e)&&Object.keys(s).length>n.numOfKeysLimit||"function"==typeof s||xo(s)&&To(s,n.depthOfLimit))return function(t){let e=t.toString();return n.stringLengthLimit&&e.length>n.stringLengthLimit&&(e=`${e.slice(0,n.stringLengthLimit)}...`),e}(e);var s;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){const t={};for(const n in e){const i=e[n];t[n]=Ao(i)?Ro(i.length?i[0]:null):i}return t}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Eo={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 Fo(t,e,n){const i=n?Object.assign({},Eo,n):Eo,r=i.logger;if(!r)return()=>{};let s;s="string"==typeof r?e[r]:r;let o=0,a=!1,l=!0;const u=[];if(i.level.includes("error")){const n=e=>{const n=e.message;t({level:"error",trace:Mo.parse(e.error).map(t=>t.toString()),payload:[Oo(n,i.stringifyOptions)]})};e.addEventListener("error",n),u.push(()=>{e.removeEventListener("error",n)});const r=e=>{let n,r;e.reason instanceof Error?(n=e.reason,r=[Oo(`Uncaught (in promise) ${n.name}: ${n.message}`,i.stringifyOptions)]):(n=new Error,r=[Oo("Uncaught (in promise)",i.stringifyOptions),Oo(e.reason,i.stringifyOptions)]),t({level:"error",trace:Mo.parse(n).map(t=>t.toString()),payload:r})};e.addEventListener("unhandledrejection",r),u.push(()=>{e.removeEventListener("unhandledrejection",r)})}for(const t of i.level)u.push(c(s,t));return()=>{l=!1,u.forEach(t=>t())};function c(e,n){return e[n]?function(r,s){try{if(!(s in r))return()=>{};const u=r[s],c={next:u},h=(r=>(...s)=>{if(r.apply(e,s),l&&!("assert"===n&&s[0]||a)){a=!0;try{const e=Mo.parse(new Error).map(t=>t.toString()).splice(1),r=("assert"===n?s.slice(1):s).map(t=>Oo(t,i.stringifyOptions));o++,i.lengthThreshold>o?t({level:n,trace:e,payload:r}):o===i.lengthThreshold&&t({level:"warn",trace:[],payload:[Oo("The number of log records reached the threshold.")]})}catch(t){r.apply(e,["rrweb logger error:",t,...s])}finally{a=!1}}})(function(...t){return c.next.apply(this,t)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:c}})),r[s]=h,()=>{if(r[s]===h)return void(r[s]=c.next);const t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0};let e=r[s],n=t(e);for(;n;){if(n.next===h)return void(n.next=c.next);e=n.next,n=t(e)}}}catch(t){return()=>{}}}(e,n):()=>{}}}var $o=t=>({name:"rrweb/console@1",observer:Fo,options:t});const Do=()=>{},Lo=t=>{var e;if(P(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function No(t,e,n){try{if(!(e in t))return Do;const i={next:t[e]},r=n(function(...t){return i.next.apply(this,t)});return P(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let n=t[e],s=Lo(n);for(;s;){if(s.next===r)return void(s.next=i.next);n=s.next,s=Lo(n)}}}catch(t){return Do}}function Po(t,e){var n;const i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),r={hostname:i,isHostDenied:!1};if(!(null===(n=e.payloadHostDenyList)||void 0===n?void 0:n.length)||!(null==i?void 0:i.trim().length))return r;for(const t of e.payloadHostDenyList)if(i.endsWith(t))return{hostname:i,isHostDenied:!0};return r}const jo=ot("[Recorder]"),Bo=t=>"navigation"===t.entryType,zo=t=>"resource"===t.entryType;function Wo(t,e){return!!e&&(q(e)||e[t])}function Uo(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}const Ho=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function qo({type:t,recordBody:e,headers:n,url:i}){function r(t){const e=Object.keys(n).find(t=>"content-type"===t.toLowerCase()),i=e&&n[e];return t.some(t=>null==i?void 0:i.toLowerCase().includes(t))}if(!e)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Uo(e)&&t(e.url)}catch(t){return!1}}(i))return!1;if(r(Ho))return!1;if(q(e))return!0;if(N(e))return r(e);const s=e[t];return q(s)?s:r(s)}function Go(t,e,n,i,r){return Vo.apply(this,arguments)}function Vo(){return Vo=A(function*(t,e,n,i,r,s=0){if(s>10)return jo.warn("Failed to get performance entry for request",{url:n,initiatorType:e}),null;const o=function(t,e){for(let n=t.length-1;n>=0;n-=1)if(e(t[n]))return t[n]}(t.performance.getEntriesByName(n),t=>zo(t)&&t.initiatorType===e&&(B(i)||t.startTime>=i)&&(B(r)||r>=t.startTime));return o||(yield new Promise(t=>setTimeout(t,50*s)),Go(t,e,n,i,r,s+1))}),Vo.apply(this,arguments)}function Zo({body:t,options:e,url:n}){if(U(t))return null;const{hostname:i,isHostDenied:r}=Po(n,e);if(r)return i+" is in deny list";if(z(t))return t;if((t=>"u">typeof Document&&t instanceof Document)(t))return t.textContent;if(G(t))return function(t,e="&"){let n,i;const r=[];return at(t,function(t,e){B(t)||B(e)||"undefined"===e||(n=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),r[r.length]=i+"="+n)}),r.join(e)}(t);if(j(t))try{return JSON.stringify(t)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}const Jo=t=>!W(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qo({entry:t,method:e,status:n,networkRequest:i,isInitial:r,start:s,end:o,url:a,initiatorType:l}){s=t?t.startTime:s,o=t?t.responseEnd:o;const u=Math.floor(Date.now()-performance.now()),c=Math.floor(u+(s||0)),h=[E(E({},t?t.toJSON():{name:a}),{},{startTime:B(s)?void 0:Math.round(s),endTime:B(o)?void 0:Math.round(o),timeOrigin:u,timestamp:c,method:e,initiatorType:l||(t?t.initiatorType:void 0),status:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:r})];if(Jo(t))for(const e of t.serverTiming||[])h.push({timeOrigin:u,timestamp:c,startTime:Math.round(t.startTime),name:e.name,duration:e.duration,entryType:"serverTiming"});return h}const Xo=["video/","audio/"];function Yo(t){return j(t)&&P(t.getReader)&&P(t.tee)}const Ko="[SessionReplay] Timeout while trying to read body",ta="[SessionReplay] Failed to read body";function ea(t){return`${ta}: ${t}`}function na(t){return`[SessionReplay] Body too large to record (> ${t} bytes)`}function ia(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{const n=setTimeout(()=>e(Ko),500);try{t.clone().text().then(t=>e(t),t=>e(ea(t))).finally(()=>clearTimeout(n))}catch(t){clearTimeout(n),e(ta)}})}(t);const n=wt(e);return function(t,e){try{var n,i;const r=null===(n=t.headers)||void 0===n||null===(i=n.get)||void 0===i?void 0:i.call(n,"content-length");if(!r)return!1;const s=parseInt(r,10);return Number.isFinite(s)&&s>e}catch(t){return!1}}(t,n)?Promise.resolve(na(n)):function(t,e){return new Promise(n=>{let i,r=!1;function s(){try{null==i||i.cancel().catch(()=>{})}catch(t){}}function o(t){r||(r=!0,clearTimeout(a),s(),n(t))}const a=setTimeout(()=>o(Ko),500);let l;try{l=t.clone()}catch(t){return void o(ta)}const u=l.body;if(!Yo(u)||"undefined"==typeof TextDecoder){try{l.text().then(t=>o(t),t=>o(ea(t)))}catch(t){o(ta)}return}try{i=u.getReader()}catch(t){return void o(ta)}const c=[];let h=0;!function t(){i.read().then(({done:n,value:i})=>{if(r)s();else if(n)o((new TextDecoder).decode(function(t,e){const n=new Uint8Array(e);let i=0;for(const e of t)n.set(e,i),i+=e.byteLength;return n}(c,h)));else{if(i){if(h+i.byteLength>e)return void o(na(e));h+=i.byteLength,c.push(i)}t()}},t=>o(ea(t)))}()})}(t,n)}function ra(){return(ra=A(function*({r:t,options:e,url:n}){const{hostname:i,isHostDenied:r}=Po(n,e);return r?Promise.resolve(i+" is in deny list"):ia(t,e)})).apply(this,arguments)}function sa(){return(sa=A(function*({r:t,options:e,url:n}){const i=function({r:t,options:e,url:n}){var i;if("chunked"===t.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";const r=null===(i=t.headers.get("Content-Type"))||void 0===i?void 0:i.toLowerCase(),s=Xo.some(t=>null==r?void 0:r.startsWith(t));if(r&&s)return`Content-Type ${r} is not supported`;const{hostname:o,isHostDenied:a}=Po(n,e);return a?o+" is in deny list":null}({r:t,options:e,url:n});return W(i)?ia(t,e):Promise.resolve(i)})).apply(this,arguments)}let oa=null;function aa(t,e,n){if(!("performance"in e))return()=>{};if(oa)return jo.warn("Network observer already initialised, doing nothing"),()=>{};const i=n?Object.assign({},_t,n):_t;let r=!0;const s=e=>{if(!r)return;const n=[];let s=!1;e.requests.forEach(t=>{const e="serverTiming"===t.entryType;if(e&&s)return;const r=i.maskRequestFn(t);e||(s=!r||(t=>!!t&&xt.has(t))(r)),r&&n.push(r)}),n.length>0&&t(E(E({},e),{},{requests:n}))},o=function(t,e,n){n.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>Bo(t)||zo(t)&&n.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});const i=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>Bo(t)||zo(t)&&n.initiatorTypes.includes(t.initiatorType)&&(t=>!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),r=PerformanceObserver.supportedEntryTypes.filter(t=>n.performanceEntryTypeToObserve.includes(t));return i.observe({entryTypes:r}),()=>{i.disconnect()}}(s,e,i);let a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(t,e,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return()=>{};const i=Wo("request",n.recordHeaders),r=Wo("response",n.recordHeaders),s=No(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l=!0,u,c){const h=this;try{const s=new Request(a),l={};let u,c;const d={},f=h.setRequestHeader.bind(h);h.setRequestHeader=(t,e)=>(d[t]=e,f(t,e)),i&&(l.requestHeaders=d);const v=h.send.bind(h);h.send=t=>(qo({type:"request",headers:d,url:a,recordBody:n.recordBody})&&(l.requestBody=Zo({body:t,options:n,url:a})),u=e.performance.now(),v(t));const p=()=>{h.removeEventListener("readystatechange",m),h.removeEventListener("error",p),h.removeEventListener("abort",p),h.removeEventListener("timeout",p)},m=()=>{if(h.readyState!==h.DONE)return;p(),c=e.performance.now();const i={};h.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const e=t.split(": "),n=e.shift(),r=e.join(": ");n&&(i[n]=r)}),r&&(l.responseHeaders=i),qo({type:"response",headers:i,url:a,recordBody:n.recordBody})&&(l.responseBody=Zo({body:h.response,options:n,url:a})),Go(e,"xmlhttprequest",s.url,u,c).then(e=>{t({requests:Qo({entry:e,method:o,status:null==h?void 0:h.status,networkRequest:l,start:u,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})};h.addEventListener("readystatechange",m),h.addEventListener("error",p),h.addEventListener("abort",p),h.addEventListener("timeout",p)}catch(t){jo.error("Failed to instrument XHR for network capture",t)}s.call(h,o,a.toString(),l,u,c)});return()=>{s()}}(s,e,i),l=function(t,e,n){if(!n.initiatorTypes.includes("fetch"))return()=>{};const i=Wo("request",n.recordHeaders),r=Wo("response",n.recordHeaders),s=No(e,"fetch",s=>function(){var o=A(function*(o,a){let l,u;try{l=new Request(o,a)}catch(t){return jo.error("Failed to instrument fetch for network capture",t),s(o,a)}const c={};let h,d;try{try{const t={};l.headers.forEach((e,n)=>{t[n]=e}),i&&(c.requestHeaders=t),!Yo(null==a?void 0:a.body)&&qo({type:"request",headers:t,url:o,recordBody:n.recordBody})&&(c.requestBody=yield function(t){return ra.apply(this,arguments)}({r:l,options:n,url:o}))}catch(t){jo.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Uo(o)?yield s(l):yield s(o,a),d=e.performance.now();try{const t={};u.headers.forEach((e,n)=>{t[n]=e}),r&&(c.responseHeaders=t),qo({type:"response",headers:t,url:o,recordBody:n.recordBody})&&(c.responseBody=yield function(t){return sa.apply(this,arguments)}({r:u,options:n,url:o}))}catch(t){jo.error("Failed to record fetch response for network capture",t)}return u}finally{Go(e,"fetch",l.url,h,d).then(e=>{t({requests:Qo({entry:e,method:l.method,status:null==u?void 0:u.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return o.apply(this,arguments)}}());return()=>{s()}}(s,e,i)),oa=()=>{r=!1,o(),a(),l(),oa=null},oa}const la=t=>({name:"rrweb/network@1",observer:aa,options:t});s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:$o,getRecordNetworkPlugin:la},s.__PosthogExtensions__.rrweb={record:yo,version:"v2",wasMaxDepthReached:()=>Wr,resetMaxDepthState(){Wr=!1,zr=!1},getLastSnapshotCost:()=>Ti,getMutationCost:()=>E({},Di),resetSnapshotCostState(){Mi=0,Ri=0,Ai=0,ki=0,xi={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ti=null,Oi=null,Ei=[],Fi=0,$i=0,Di={slowestBatchMs:0},Li={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},s.rrweb={record:yo,version:"v2"},s.rrwebConsoleRecord={getRecordConsolePlugin:$o},s.getRecordNetworkPlugin=la,s.__PosthogExtensions__=s.__PosthogExtensions__||{},s.__PosthogExtensions__.initSessionRecording=(t,e)=>new Kn(t,e)}();
2
2
  //# sourceMappingURL=lazy-recorder.js.map