posthog-js 1.372.6 → 1.372.7
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.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +1 -1
- package/package.json +3 -3
package/dist/lazy-recorder.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var r=null==e?void 0:e.document;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var i=null!=t?t:{};function n(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(i,s){var o=t.apply(e,r);function a(t){n(o,i,s,a,l,"next",t)}function l(t){n(o,i,s,a,l,"throw",t)}a(void 0)}))}}function o(){return o=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},o.apply(null,arguments)}var a={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},l=Object.prototype,u=l.hasOwnProperty,h=l.toString,d=Array.isArray||function(t){return"[object Array]"===h.call(t)},c=t=>"function"==typeof t,v=t=>t===Object(t)&&!d(t),f=t=>void 0===t,g=t=>"[object String]"==h.call(t),m=t=>null===t,p=t=>f(t)||m(t),I=t=>"[object Number]"==h.call(t)&&t==t,y=t=>"[object Boolean]"===h.call(t),b=t=>t instanceof FormData;function C(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),I(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):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: "+r+", fallback: "+n),C(n||r,e,r,i))}class w{constructor(t){this.$t={},this.zt=t.zt,this.Ut=C(t.bucketSize,0,100,t.Gt),this.Wt=C(t.refillRate,0,this.Ut,t.Gt),this.Xt=C(t.refillInterval,0,864e5,t.Gt)}Jt(t,e){var r=Math.floor((e-t.lastAccess)/this.Xt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Xt)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.$t[i];return n?this.Jt(n,r):this.$t[i]=n={tokens:this.Ut,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.zt)||e.call(this,t)),0===n.tokens)}stop(){this.$t={}}}var S="1.372.6",k="web",A=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,s={C(r){if(t&&(i.POSTHOG_DEBUG||n)&&!f(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];s(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("error",...e)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(t){s.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>A(e+" "+t,r)};return s},R=A("[PostHog.js]"),N=R.createLogger;function _(t,e){if(!p(t))if(d(t))t.forEach(e);else if(b(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)u.call(t,r)&&e(t[r],r)}function T(t,e,r,i){var{capture:n=!1,passive:s=!0}={};null==t||t.addEventListener(e,r,{capture:n,passive:s})}var M=["localhost","127.0.0.1"],F=t=>{var e=null==r?void 0:r.createElement("a");return f(e)?null:(e.href=t,e)},x=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return _(t,(function(t,e){f(t)||f(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},B="$session_recording_remote_config",O="$replay_override_sampling",Z="$replay_override_linked_flag",Y="$replay_override_url_trigger",E="$replay_override_event_trigger",G="$session_is_sampled",L="$session_past_minimum_duration",D="$session_recording_url_trigger_activated_session",W="$session_recording_event_trigger_activated_session",V="$posthog_sr_group_event_trigger_",X="$posthog_sr_group_url_trigger_",z="$posthog_sr_group_sampling_",J="$debug_first_full_snapshot_timestamp",K="$stored_person_properties",H="$sdk_debug_replay_remote_trigger_matching_config",j=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})"),U=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})"),P="[SessionRecording]",q="redacted",Q={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},tt=["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"],et=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],rt=["/s/","/e/","/i/"];function it(t,e,r,i){if(p(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return g(n)&&(n=parseInt(n)),n>r?P+" "+i+" body too large to record ("+n+" bytes)":t}function nt(t,e){if(p(t))return t;var r=t;return function(t,e){if(p(t))return!1;if(g(t)){if(t=t.trim(),j.test((t||"").replace(/[- ]/g,"")))return!1;if(U.test(t))return!1}return!0}(r)||(r=P+" "+e+" body "+q),_(et,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=P+" "+e+" body "+q+" as might contain: "+t)})),r}var st="disabled",ot="sampled",at="active",lt="buffering",ut="paused",ht="rrweb_error",dt="trigger",ct=dt+"_activated",vt=dt+"_pending",ft=dt+"_"+st;function gt(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}class mt{constructor(t){this.t=t}triggerStatus(t){var e=this.t.map((e=>e.triggerStatus(t)));return e.includes(ct)?ct:e.includes(vt)?vt:ft}stop(){this.t.forEach((t=>t.stop()))}}class pt{constructor(t){this.t=t}triggerStatus(t){var e=new Set;for(var r of this.t)e.add(r.triggerStatus(t));switch(e.delete(ft),e.size){case 0:return ft;case 1:return Array.from(e)[0];default:return vt}}stop(){this.t.forEach((t=>t.stop()))}}class It{triggerStatus(){return ct}stop(){}}var yt=t=>"sessionRecording"in t;class bt{constructor(t,e){this.u=[],this.Aa=[],this.Ra=new Map,this.Na=new Map,this.Ma="",this.urlBlocked=!1,this._instance=t,this.Fa=e}onConfig(t){var e,r;this.u=(yt(t)?v(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.Aa=(yt(t)?v(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Ba()}Ba(){for(var t of(this.Ra.clear(),this.Na.clear(),this.u))if("regex"===t.matching&&!this.Ra.has(t.url))try{this.Ra.set(t.url,new RegExp(t.url))}catch(e){R.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.Aa)if("regex"===e.matching&&!this.Na.has(e.url))try{this.Na.set(e.url,new RegExp(e.url))}catch(t){R.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}Oa(t){var e;return 0===this.u.length?ft:(null==(e=this._instance)?void 0:e.get_property(this.Fa?X+this.Fa:D))===t?ct:vt}triggerStatus(t){var e=this.Oa(t),r=e===ct?ct:e===vt?vt:ft;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlBlocklist(e,r){if(void 0!==t&&t.location.href){var i=t.location.href;if(i!==this.Ma){this.Ma=i;var n=this.urlBlocked,s=gt(i,this.Aa,this.Na);n&&s||(s&&!n?e():!s&&n&&r())}}}checkUrlTriggerConditions(e,r,i,n){if(void 0!==t&&t.location.href){var s=t.location.href;if(s!==this.Ma){this.Ma=s;var o=this.urlBlocked,a=gt(s,this.Aa,this.Na);a&&!o?e():!a&&o&&r();var l=this.Oa(n)===ct,u=gt(s,this.u,this.Ra);!l&&u&&i("url",s)}}}stop(){this.Ma=""}}class Ct{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Za=()=>{},this._instance=t}triggerStatus(){var t=vt;return p(this.linkedFlag)&&(t=ft),this.linkedFlagSeen&&(t=ct),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(yt(t)?v(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!p(this.linkedFlag)&&!this.linkedFlagSeen){var i=g(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=g(this.linkedFlag)?null:this.linkedFlag.variant;this.Za=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(v(r)&&i in r){var o=r[i];s=y(o)?!0===o:n?o===n:!!o}this.linkedFlagSeen=s,s&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Za()}}class wt{constructor(t,e){this.Ya=[],this._instance=t,this.Fa=e}onConfig(t){var e;this.Ya=(yt(t)?v(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}Ga(t){var e;return 0===this.Ya.length?ft:(null==(e=this._instance)?void 0:e.get_property(this.Fa?V+this.Fa:W))===t?ct:vt}triggerStatus(t){var e=this.Ga(t),r=e===ct?ct:e===vt?vt:ft;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}checkEventTriggerConditions(t,e,r){if(0!==this.Ya.length){var i=this.Ga(r)===ct,n=this.Ya.includes(t);!i&&n&&e("event",t)}}stop(){}}class St{constructor(t,e,r){if(this._instance=t,this.group=e,this.La=new bt(t,e.id),this.Da=new wt(t,e.id),this.Wa=new Ct(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.La.onConfig(n),this.Da.onConfig(n),this.Wa.onConfig(n,r);var s=[this.Da,this.La,this.Wa];this.Va="any"===e.conditions.matchType?new mt(s):new pt(s)}else this.Va=new It}triggerStatus(t){return this.Va.triggerStatus(t)}checkEventTriggerConditions(t,e,r){this.Da.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.La.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?X+this.group.id:V+this.group.id]:e})}stop(){this.La.stop(),this.Da.stop(),this.Wa.stop()}}function kt(t){if(t.rrwebError)return ht;if(!t.receivedFlags)return lt;if(!t.isRecordingEnabled)return st;if(t.urlTriggerMatching.urlBlocked)return ut;var e=!0===t.isSampled,r=new mt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ot:r===ct?at:r===vt?lt:!1===t.isSampled?st:at}function At(t){if(t.rrwebError)return ht;if(!t.receivedFlags)return lt;if(!t.isRecordingEnabled)return st;if(t.urlTriggerMatching.urlBlocked)return ut;var e=new pt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==ft,i=y(t.isSampled);return r&&e===vt?lt:r&&e===ft||i&&!t.isSampled?st:!0===t.isSampled?ot:at}function Rt(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(v(e)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(e)?"[Circular]":(r.push(e),e)}return e})))?void 0:e.length)||0}function Nt(t){if(m(t))return 4;if(f(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(d(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=f(i)||m(i)?4:Nt(i)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];f(l)||(o||(s+=1),o=!1,s+=a.length+3+Nt(l))}return s;default:return 0}}var _t=Uint8Array,Tt=Uint16Array,Mt=Uint32Array,Ft=new _t([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]),xt=new _t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bt=new _t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ot=function(t,e){for(var r=new Tt(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Mt(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Zt=Ot(Ft,2),Yt=Zt[1];Zt[0][28]=258,Yt[258]=28;for(var Et=Ot(xt,0)[1],Gt=new Tt(32768),Lt=0;32768>Lt;++Lt){var Dt=(43690&Lt)>>>1|(21845&Lt)<<1;Gt[Lt]=((65280&(Dt=(61680&(Dt=(52428&Dt)>>>2|(13107&Dt)<<2))>>>4|(3855&Dt)<<4))>>>8|(255&Dt)<<8)>>>1}var Wt=function(t,e,r){for(var i=t.length,n=0,s=new Tt(e);i>n;++n)++s[t[n]-1];var o,a=new Tt(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Tt(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[Gt[d]>>>l]=u}else for(o=new Tt(i),n=0;i>n;++n)o[n]=Gt[a[t[n]-1]++]>>>15-t[n];return o},Vt=new _t(288);for(Lt=0;144>Lt;++Lt)Vt[Lt]=8;for(Lt=144;256>Lt;++Lt)Vt[Lt]=9;for(Lt=256;280>Lt;++Lt)Vt[Lt]=7;for(Lt=280;288>Lt;++Lt)Vt[Lt]=8;var Xt=new _t(32);for(Lt=0;32>Lt;++Lt)Xt[Lt]=5;var zt=Wt(Vt,9,0),Jt=Wt(Xt,5,0),Kt=function(t){return(t/8>>0)+(7&t&&1)},Ht=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Tt?Tt:t instanceof Mt?Mt:_t)(r-e);return i.set(t.subarray(e,r)),i},jt=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ut=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Pt=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new _t(0),0];if(1==n){var o=new _t(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Tt(c+1),f=qt(r[h-1],v,0);if(f>e){i=0;var g=0,m=f-e,p=1<<m;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var I=s[i].s;if(e>=v[I])break;g+=p-(1<<f-v[I]),v[I]=e}for(g>>>=m;g>0;){var y=s[i].s;e>v[y]?g-=1<<e-v[y]++-1:++i}for(;i>=0&&g;--i){var b=s[i].s;v[b]==e&&(--v[b],++g)}f=e}return[new _t(v),f]},qt=function(t,e,r){return-1==t.s?Math.max(qt(t.l,e,r+1),qt(t.r,e,r+1)):e[t.s]=r},Qt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Tt(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&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(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},$t=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},te=function(t,e,r){var i=r.length,n=Kt(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},ee=function(t,e,r,i,n,s,o,a,l,u,h){jt(e,h++,r),++n[256];for(var d=Pt(n,15),c=d[0],v=d[1],f=Pt(s,15),g=f[0],m=f[1],p=Qt(c),I=p[0],y=p[1],b=Qt(g),C=b[0],w=b[1],S=new Tt(19),k=0;I.length>k;++k)S[31&I[k]]++;for(k=0;C.length>k;++k)S[31&C[k]]++;for(var A=Pt(S,7),R=A[0],N=A[1],_=19;_>4&&!R[Bt[_-1]];--_);var T,M,F,x,B=u+5<<3,O=$t(n,Vt)+$t(s,Xt)+o,Z=$t(n,c)+$t(s,g)+o+14+3*_+$t(S,R)+(2*S[16]+3*S[17]+7*S[18]);if(O>=B&&Z>=B)return te(e,h,t.subarray(l,l+u));if(jt(e,h,1+(O>Z)),h+=2,O>Z){T=Wt(c,v,0),M=c,F=Wt(g,m,0),x=g;var Y=Wt(R,N,0);for(jt(e,h,y-257),jt(e,h+5,w-1),jt(e,h+10,_-4),h+=14,k=0;_>k;++k)jt(e,h+3*k,R[Bt[k]]);h+=3*_;for(var E=[I,C],G=0;2>G;++G){var L=E[G];for(k=0;L.length>k;++k)jt(e,h,Y[D=31&L[k]]),h+=R[D],D>15&&(jt(e,h,L[k]>>>5&127),h+=L[k]>>>12)}}else T=zt,M=Vt,F=Jt,x=Xt;for(k=0;a>k;++k)if(i[k]>255){var D;Ut(e,h,T[257+(D=i[k]>>>18&31)]),h+=M[D+257],D>7&&(jt(e,h,i[k]>>>23&31),h+=Ft[D]);var W=31&i[k];Ut(e,h,F[W]),h+=x[W],W>3&&(Ut(e,h,i[k]>>>5&8191),h+=xt[W])}else Ut(e,h,T[i[k]]),h+=M[i[k]];return Ut(e,h,T[256]),h+M[256]},re=new Mt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ie=function(){for(var t=new Mt(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),ne=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=ie[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},se=function(t,e,r,i,n){return function(t,e,r,i,n,s){var o=t.length,a=new _t(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=te(l,u,t.subarray(h,d)):(l[h]=true,u=te(l,u,t.subarray(h,o)))}else{for(var c=re[e-1],v=c>>>13,f=8191&c,g=(1<<r)-1,m=new Tt(32768),p=new Tt(g+1),I=Math.ceil(r/3),y=2*I,b=function(e){return(t[e]^t[e+1]<<I^t[e+2]<<y)&g},C=new Mt(25e3),w=new Tt(288),S=new Tt(32),k=0,A=0,R=(h=0,0),N=0,_=0;o>h;++h){var T=b(h),M=32767&h,F=p[T];if(m[M]=F,p[T]=M,h>=N){var x=o-h;if((k>7e3||R>24576)&&x>423){u=ee(t,l,0,C,w,S,A,R,_,h-_,u),R=k=A=0,_=h;for(var B=0;286>B;++B)w[B]=0;for(B=0;30>B;++B)S[B]=0}var O=2,Z=0,Y=f,E=M-F&32767;if(x>2&&T==b(h-E))for(var G=Math.min(v,x)-1,L=Math.min(32767,h),D=Math.min(258,x);L>=E&&--Y&&M!=F;){if(t[h+O]==t[h+O-E]){for(var W=0;D>W&&t[h+W]==t[h+W-E];++W);if(W>O){if(O=W,Z=E,W>G)break;var V=Math.min(E,W-2),X=0;for(B=0;V>B;++B){var z=h-E+B+32768&32767,J=z-m[z]+32768&32767;J>X&&(X=J,F=z)}}}E+=(M=F)-(F=m[M])+32768&32767}if(Z){C[R++]=268435456|Yt[O]<<18|Et[Z];var K=31&Yt[O],H=31&Et[Z];A+=Ft[K]+xt[H],++w[257+K],++S[H],N=h+O,++k}else C[R++]=t[h],++w[t[h]]}}u=ee(t,l,true,C,w,S,A,R,_,h-_,u)}return Ht(a,0,i+Kt(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},oe=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ae=function(t,e){var r=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&&oe(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},le=function(t){return 10+(t.filename&&t.filename.length+1||0)};class ue{constructor(t,e){var r,i;void 0===e&&(e={}),this.Xa={},this.za=t=>{if(!this.Xa[t]){var e,r;this.Xa[t]=!0;var i=this.Ja(t);null==(e=(r=this.Ka).onBlockedNode)||e.call(r,t,i)}},this.Ha=t=>{var e=this.Ja(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.Ja=t=>this._rrweb.mirror.getNode(t),this.ja=t=>{var e,r,i,n,s,o,a,l;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.ja(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.Ha(t.id);return!this.do.consumeRateLimit(e)&&t})));var i=this.ja(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.Ka=e,this.do=new w({bucketSize:null!==(r=this.Ka.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.Ka.refillRate)&&void 0!==i?i:10,refillInterval:1e3,zt:this.za,Gt:R})}reset(){this.Xa={}}stop(){this.do.stop(),this.reset()}}var he="$sess_rec_flush_size";class de{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.Ua=t.get_property.bind(t),this.Pa=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=Number(this.Ua(he))||0;this.Pa(he,e+t)}reset(){return this.Pa(he,0)}get currentTrackedSize(){return Number(this.Ua(he))||0}}function ce(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<C(100*e,0,100,R)}var ve=function(t,e){if(!function(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}},fe={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=>ve(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ve(e,t))))),icontains:(t,e)=>e.map(ge).some((e=>t.map(ge).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ge).every((e=>t.map(ge).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},ge=t=>t.toLowerCase(),me=new Set(["is_not","not_icontains","not_regex"]);function pe(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(f(n)||m(n))return me.has(s);var o=fe[s];return!!o&&!f(t.value)&&!m(t.value)&&o(d(t.value)?t.value.map(String):[String(t.value)],d(n)?n.map(String):[String(n)])}))}var Ie=N("[SessionRecording]");class ye{constructor(t,e,r,i,n,s){this.qa=null,this.Qa=At,this._instance=t,this.La=e,this.Da=r,this.Wa=i,this.$a=n,this.tu=s}onRemoteConfig(t){this.qa=I(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.eu=new mt([this.Da,this.La]),this.Qa=kt):(this.eu=new pt([this.Da,this.La]),this.Qa=At),this._instance.register_for_session({[H]:t.triggerMatchType}),this.La.onConfig(t),this.Da.onConfig(t),this.Wa.onConfig(t,((t,e)=>{this.$a("linked_flag_matched",{flag:t,variant:e})}))}getStatus(t){return this.Qa({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return I(r)?r:null}checkUrlTriggers(t,e,r,i){this.La.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.Da.Ya.length&&p(this.ru))return this.ru=t((t=>{try{this.Da.checkEventTriggerConditions(t.event,r,e)}catch(t){Ie.error("Could not activate event trigger",t)}})),this.ru}makeSamplingDecisions(t){var e,r=this.qa;if(I(r)){var i=this._instance.get_property(G),n=i===t||!1!==i&&null,s="string"==typeof i&&i!==t||!y(n),o=s?ce(t,r):n;s&&(o?this.$a("sampled"):Ie.warn("Sample rate ("+r+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[G]:!!o&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(G)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i;null==(t=this._instance.persistence)||t.unregister(W),null==(e=this._instance.persistence)||e.unregister(D),null==(r=this._instance.persistence)||r.unregister(G),null==(i=this._instance.persistence)||i.unregister(L)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.eu)?void 0:e.triggerStatus(t))===vt}stop(){var t;null==(t=this.ru)||t.call(this),this.ru=void 0,this.Da.stop(),this.La.stop(),this.Wa.stop()}}class be{constructor(t,e,r,i){this.iu=[],this.nu=new Map,this.su=!1,this._instance=t,this.La=e,this.$a=r,this.ou=i}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.au(t.triggerGroups),this._instance.register_for_session({[H]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.La.onConfig(t)):Ie.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return ht;if(t.urlTriggerMatching.urlBlocked)return ut;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return st;var i=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if(o===ct){var a=s.group.id,l=r.get(a);f(l)?R.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else o===vt&&(i=!0)}return n?ot:i?lt:st}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.iu,triggerGroupSamplingResults:this.nu,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.iu)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;I(i)&&(m(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.La.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.lu(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t))}),t)};for(var o of this.iu)s(o)}setupEventTriggerListeners(t,e,r){var i=this;return this.ru=t((t=>{var r;if(this.su)return Ie.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.ru)||r.call(this),void(this.ru=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.lu(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),o=i._instance.get_property(K);s.some((e=>!e.properties||0===e.properties.length||pe(e.properties,t.properties,o)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e))}}),e)};for(var s of this.iu)n(s)}catch(t){Ie.error("Could not activate event trigger for trigger groups",t)}})),this.ru}makeSamplingDecisions(t){for(var e of this.iu){var r,i=e.group,n=i.id,s=i.sampleRate,o=z+n,a=this._instance.get_property(o),l=a===t||!1!==a&&null,u="string"==typeof a&&a!==t||!y(l),h=u?ce(t+n,s):l;u&&this.ou("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:h}),this.nu.set(n,h),null==(r=this._instance.persistence)||r.register({[o]:!!h&&t})}this.updateActiveTriggers(t)}onFlushComplete(){this.su=!0}clearConditionalRecordingPersistence(){var t,e;for(var r of(null==(t=this._instance.persistence)||t.unregister(G),null==(e=this._instance.persistence)||e.unregister(L),this.iu)){var i,n,s,o=r.group.id;null==(i=this._instance.persistence)||i.unregister(V+o),null==(n=this._instance.persistence)||n.unregister(X+o),null==(s=this._instance.persistence)||s.unregister(z+o)}}updateActiveTriggers(t){var e=[];for(var r of this.iu){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),o=!0===this.nu.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.iu)if(e.triggerStatus(t)===vt)return!0;return!1}stop(){var t;null==(t=this.ru)||t.call(this),this.ru=void 0,this.iu.forEach((t=>t.stop())),this.iu=[],this.nu.clear(),this.La.stop()}lu(t,e){var r=t.group.conditions.properties;return!r||0===r.length||pe(r,e,this._instance.get_property(K))}au(t){var e=this;this.iu.forEach((t=>t.stop())),this.iu=[],this.nu.clear();var r=function(t){var r=new St(e._instance,t,((r,i)=>{e.$a("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name})}));e.iu.push(r)};for(var i of t)r(i)}}function Ce(t){return v(t)?t.network_timing:t}var we,Se="[SessionRecording]",ke=N(Se),Ae=[1,2,3,4,5,6,7,12],Re=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ne(){var t;return null==i||null==(t=i.__PosthogExtensions__)?void 0:t.rrweb}function _e(){var t;return null==(t=Ne())?void 0:t.record}function Te(t){return function(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}(function(t,e){void 0===e&&(e={});var r=ne(),i=t.length;r.p(t);var n=se(t,e,le(e),8),s=n.length;return ae(n,e),oe(n,s-8,r.d()),oe(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new _t(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new _t(n+8+(r-o<<1));a.set(i),i=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Ht(i,0,n)}(JSON.stringify(t))))}function Me(t){return d(t)&&0===t.length?we=null!=we?we:Te([]):Te(t)}function Fe(t,e){return t.type===a.Custom&&t.data.tag===e}function xe(t){return Fe(t,"sessionIdle")}function Be(t){return Fe(t,"$session_ending")}function Oe(t){return Fe(t,"$session_starting")}function Ze(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[Ze({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),Ze({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class Ye{get sessionId(){return this.di}get uu(){if(!this._instance.sessionManager)throw new Error(Se+" must be started with a valid sessionManager.");return this._instance.sessionManager}get hu(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get du(){var t=this._instance.get_property(G);return!0===t?null:!1!==t&&(g(t)?t===this.sessionId:null)}get qa(){var t,e=null==(t=this.ea)?void 0:t.sampleRate;return I(e)?e:null}get cu(){var t,e;return null!==(t=null==(e=this.vu)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t){this.fu="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.gu=void 0,this.mu=Date.now(),this.pu=!1,this.Iu=[],this.yu="unknown",this.bu=!1,this.Cu=!1,this.wu=[],this.Su=void 0,this.ru=void 0,this.ku=void 0,this.Au=void 0,this.Ru=void 0,this.Nu=void 0,this.ti=(t,e,r)=>{var i,n;if(r&&(t!==this.di||e!==this.ci)){var s,o,a=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),l=this.di,u=this.ci;a&&this.ou("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.mu,flushed_size:null==(s=this._u)?void 0:s.currentTrackedSize}),this._u&&this._u.reset(),null==(i=this._instance.persistence)||i.unregister(J),this.Cu=!1,null==(n=Ne())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.ou("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Tu(),!0===this.yu&&(this.yu="unknown",this.stop(),this.start("session_id_changed")),a&&this.ou("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.mu}),I(this.qa)&&p(this.Ru)&&(null==(o=this.vu)||o.makeSamplingDecisions(t))}},this.Mu=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[L])===this.di},this.Fu=()=>{var t,e;if(0===this.T.data.length)return null;var r=null==(t=this.T.data[0])?void 0:t.timestamp,i=null==(e=this.T.data[this.T.data.length-1])?void 0:e.timestamp;return I(r)&&I(i)?i-r:null},this.xu=()=>{var t,e,r=this.cu;if(!I(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Bu;return I(i)&&i>=0&&r>i}if(this.Mu())return!1;var n,s=this.Fu();return!!m(s)||r>s||(null==(n=this._instance.persistence)||n.register({[L]:this.di}),!1)},this.Ou=()=>{this.status!==lt?this.Zu():this.Yu()},this.Eu=()=>{this.ou("browser offline",{})},this.Gu=()=>{this.ou("browser online",{})},this.Lt=()=>{null!=r&&r.visibilityState&&this.ou("window "+r.visibilityState,{})},this._instance=t;var{sessionId:e,windowId:i}=this.uu.checkAndGetSessionAndWindowId();this.di=e,this.ci=i,this.Wa=new Ct(this._instance),this.La=new bt(this._instance),this.Da=new wt(this._instance),this.T=this.Yu(),this.uu.sessionTimeoutMs>this.hu||ke.warn("session_idle_threshold_ms ("+this.hu+") is greater than the session timeout ("+this.uu.sessionTimeoutMs+"). Session will never be detected as idle"),this._u=new de(this._instance)}get Lu(){var t,e,r,i,n,s,o,a=null==(t=this.ea)?void 0:t.masking,l={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},u=null!==(n=null==l?void 0:l.maskAllInputs)&&void 0!==n?n:null==a?void 0:a.maskAllInputs,h=null!==(s=null==l?void 0:l.maskTextSelector)&&void 0!==s?s:null==a?void 0:a.maskTextSelector,d=null!==(o=null==l?void 0:l.blockSelector)&&void 0!==o?o:null==a?void 0:a.blockSelector;return f(u)&&f(h)&&f(d)?void 0:{maskAllInputs:null==u||u,maskTextSelector:h,blockSelector:d}}get Du(){var t,e,r,i,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.ea)?void 0:t.canvasRecording,u=null!==(e=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==i?i:4,d=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 d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:u,fps:C(h,0,12,N("canvas recording fps"),4),quality:C(d,0,1,N("canvas recording quality"),.4)}}get Wu(){var t,e=!(null==(t=this.ea)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Vu(){var t,e,r,i=null==(t=this.ea)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),a=Ce(this._instance.config.capture_performance),l=Ce(null==i?void 0:i.capturePerformance),u=!!(y(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}Xu(){var t,e,r=[],n=null==(t=i.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Wu&&r.push(n());var s,a,l,u,h,d,v,g,m,I,y,b=null==(e=i.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;return this.Vu&&c(b)&&(!M.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(b((h={payloadSizeLimitBytes:Q.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Q.performanceEntryTypeToObserve],payloadHostDenyList:[...(a=this.Vu).payloadHostDenyList||[],...Q.payloadHostDenyList]},d=!1!==(s=this._instance.config).session_recording.recordHeaders&&a.recordHeaders,v=!1!==s.session_recording.recordBody&&a.recordBody,g=!1!==s.capture_performance&&a.recordPerformance,u=Math.min(1e6,null!==(l=h.payloadSizeLimitBytes)&&void 0!==l?l:1e6),m=t=>(null!=t&&t.requestBody&&(t.requestBody=it(t.requestBody,t.requestHeaders,u,"Request")),null!=t&&t.responseBody&&(t.responseBody=it(t.responseBody,t.responseHeaders,u,"Response")),t),I=t=>{return m(((t,e)=>{var r,i=F(t.name),n=0===e.indexOf("http")?null==(r=F(e))?void 0:r.pathname:e;"/"===n&&(n="");var s=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&s&&rt.some((t=>0===s.indexOf(t)))))return t})((p(r=(e=t).requestHeaders)||_(Object.keys(null!=r?r:{}),(t=>{tt.includes(t.toLowerCase())&&(r[t]=q)})),e),s.api_host));var e,r},(y=c(s.session_recording.maskNetworkRequestFn))&&c(s.session_recording.maskCapturedNetworkRequestFn)&&R.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),y&&(s.session_recording.maskCapturedNetworkRequestFn=t=>{var e=s.session_recording.maskNetworkRequestFn({url:t.name});return o({},t,{name:null==e?void 0:e.url})}),h.maskRequestFn=c(s.session_recording.maskCapturedNetworkRequestFn)?t=>{var e,r=I(t);return r&&null!==(e=null==s.session_recording.maskCapturedNetworkRequestFn?void 0:s.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==e?e:void 0}:t=>function(t){if(!f(t))return t.requestBody=nt(t.requestBody,"Request"),t.responseBody=nt(t.responseBody,"Response"),t}(I(t)),o({},Q,h,{recordHeaders:d,recordBody:v,recordPerformance:g,recordInitialRequests:g})))):ke.info("NetworkCapture not started because we are on localhost.")),r}zu(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Ju(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Iu.length?this.Iu.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):ke.warn("could not emit queued rrweb event.",e,t),!1}}ou(t,e){return this.Ju(Re((()=>_e().addCustomEvent(t,e))))}Ku(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=this.zu(e.origin+e.pathname+e.search);this.Hu!==r&&(this.Hu=r,this.ou("$url_changed",{href:r}))}catch(t){}}ju(){if(this.Iu.length){var t=[...this.Iu];this.Iu=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Ju(t)}))}}tu(){return this.Ju(Re((()=>_e().takeFullSnapshot())))}get Uu(){var t,e,r;return null!=(t=this.vu)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)?6e4:null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Pu(){if(this.qu&&clearInterval(this.qu),!0!==this.yu){var t=this.Uu;t&&(this.qu=setInterval((()=>{this.tu()}),t))}}Qu(){this.La.urlBlocked||(this.La.urlBlocked=!0,clearInterval(this.qu),ke.info("recording paused due to URL blocker"),this.ou("recording paused",{reason:"url blocker"}))}$u(){this.La.urlBlocked&&(this.La.urlBlocked=!1,this.tu(),this.Pu(),this.ou("recording resumed",{reason:"left blocked url"}),ke.info("recording resumed"))}th(t,e){var r;if(!this.pu&&null!=(r=this.vu)&&r.hasPendingTriggers(this.sessionId)){this.pu=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?D:W]:this.sessionId}),null==(n=this.vu)||n.updateActiveTriggers(this.sessionId),this.Zu(),this.$a(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.pu=!1}}}get isStarted(){return!!this.gu}get ea(){var t=this._instance.get_property(B);if(t){var e=v(t)?t:JSON.parse(t);if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return ke.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(B))}return e}}eh(t,e,r){this._instance.get_property(t)&&(e(),r())}start(e){var r,i,n=this.ea;if(n){var{sessionId:s,windowId:o}=this.uu.checkAndGetSessionAndWindowId();this.di=s,this.ci=o,null==(r=this._instance.persistence)||r.unregister(J),null!=n&&n.endpoint&&(this.fu=null==n?void 0:n.endpoint),this.vu=2===(null==n?void 0:n.version)&&(null==n?void 0:n.triggerGroups)&&n.triggerGroups.length>0?new be(this._instance,this.La,this.$a.bind(this),this.ou.bind(this)):new ye(this._instance,this.La,this.Da,this.Wa,this.$a.bind(this),this.tu.bind(this)),this.vu.onRemoteConfig(n),null==(i=this.ru)||i.call(this),this.ru=this.vu.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.th(t,e))),this.eh(O,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(O)})),this.eh(Z,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Z)})),this.eh(E,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(E)})),this.eh(Y,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Y)})),this.vu.makeSamplingDecisions(this.sessionId),this.rh(),this.bu||(T(t,"beforeunload",this.Ou),T(t,"offline",this.Eu),T(t,"online",this.Gu),T(t,"visibilitychange",this.Lt),this.ku||(this.ku=this.uu.onSessionId(this.ti)),this.Au||(this.Au=this.uu.on("forcedIdleReset",(()=>{this.Tu(),this.yu="unknown",this.stop(),this.Nu=this.uu.onSessionId(((t,e,r)=>{var i;null==(i=this.Nu)||i.call(this),this.Nu=void 0,this.ti(t,e,r)}))}))),p(this.Su)&&(this.Su=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.zu(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.ou("$pageview",{href:e})}}catch(t){ke.error("Could not add $pageview to rrweb session",t)}}))),this.status===at&&this.$a(e||"recording_initialized"))}else ke.info("remote config must be stored in persistence before recording can start")}ih(){var e,r,i,n,s,o,a,l,u;null==t||t.removeEventListener("beforeunload",this.Ou),null==t||t.removeEventListener("offline",this.Eu),null==t||t.removeEventListener("online",this.Gu),null==t||t.removeEventListener("visibilitychange",this.Lt),clearInterval(this.qu),this.nh(),null==(e=this.Su)||e.call(this),this.Su=void 0,null==(r=this.ru)||r.call(this),this.ru=void 0,null==(i=this.ku)||i.call(this),this.ku=void 0,null==(n=this.Au)||n.call(this),this.Au=void 0,null==(s=this.Ru)||s.call(this),this.Ru=void 0,null==(o=this.Nu)||o.call(this),this.Nu=void 0,null==(a=this.vu)||a.stop(),null==(l=this.sh)||l.stop(),this.Iu=[],null==(u=this.gu)||u.call(this),this.gu=void 0}stop(){this.Zu(),this.Yu(),this.ih(),ke.info("stopped")}discard(){this.Yu(),this.ih(),ke.info("discarded")}onRRwebEmit(t){var e,r,i,n,s,l,u,h;if(this.ju(),t&&v(t)){if(t.type===a.Meta){var d=this.zu(t.data.href);if(this.Hu=d,!d)return;t.data.href=d}else this.Ku();if(null==(e=this.vu)||e.checkUrlTriggers(this.sessionId,(()=>this.Qu()),(()=>this.$u()),((t,e)=>this.th(t,e))),!this.La.urlBlocked||(c=t).type===a.Custom&&"recording paused"===c.data.tag){var c,f,g;t.type===a.FullSnapshot&&(this.Pu(),null==(f=this.sh)||f.reset(),null==(g=this._instance.persistence)||g.register_once({[J]:t.timestamp},void 0)),t.type===a.FullSnapshot&&null!=(r=this.vu)&&r.hasPendingTriggers(this.sessionId)&&this.oh();var m=this.sh?this.sh.throttleMutations(t):t;if(m){var p=function(t){var e=t;if(e&&v(e)&&6===e.type&&v(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]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(m),I=function(t){return Be(t)?t.data.payload:null}(p),y=function(t){return Oe(t)?t.data.payload:null}(p);if(I||y){var b=null!=I?I:y;null!=b&&b.lastActivityTimestamp&&(p.timestamp=b.lastActivityTimestamp)}else this.ah(p);t.type===a.FullSnapshot&&(this.wu.push([this.di,t.timestamp]),this.wu.length>6&&(this.wu=this.wu.slice(-6)));var C=null!==(i=null!==(n=null==I?void 0:I.currentSessionId)&&void 0!==n?n:null==y?void 0:y.nextSessionId)&&void 0!==i?i:this.di,w=null!==(s=null!==(l=null==I?void 0:I.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==s?s:this.ci;if(!0!==this.yu||function(t){return xe(t)||Be(t)||Oe(t)}(p)){if(xe(p)){var S=p.data.payload;S&&(p.timestamp=S.lastActivityTimestamp+S.threshold)}var{event:k,size:A}=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u?function(t){try{if(t.type===a.FullSnapshot){var e=o({},t,{data:Te(t.data),cv:"2024-10"});return{event:e,size:Nt(e)}}if(t.type===a.IncrementalSnapshot&&0===t.data.source){var r=o({},t,{cv:"2024-10",data:o({},t.data,{texts:Me(t.data.texts),attributes:Me(t.data.attributes),removes:Me(t.data.removes),adds:Me(t.data.adds)})});return{event:r,size:Nt(r)}}if(t.type===a.IncrementalSnapshot&&8===t.data.source){var i=o({},t,{cv:"2024-10",data:o({},t.data,{adds:t.data.adds?Te(t.data.adds):void 0,removes:t.data.removes?Te(t.data.removes):void 0})});return{event:i,size:Nt(i)}}}catch(t){ke.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Rt(t)}}(p):{event:p,size:Rt(p)},R={$snapshot_bytes:A,$snapshot_data:k,$session_id:C,$window_id:w};p.type===a.FullSnapshot&&null!=(h=Ne())&&null!=h.wasMaxDepthReached&&h.wasMaxDepthReached()&&(this.Cu=!0),this.status!==st?this.lh(R):this.Yu()}}}}}get status(){return this.vu?this.vu.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.du,rrwebError:this.bu,urlTriggerMatching:this.La,eventTriggerMatching:this.Da,linkedFlagMatching:this.Wa,remoteConfig:this.ea}):st}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.Wa.linkedFlagSeen=!0,this.tu(),this.$a("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[G]:this.sessionId}),this.tu(),this.$a("sampling_overridden")}overrideTrigger(t){this.th(t)}nh(){this.uh&&(clearTimeout(this.uh),this.uh=void 0)}Zu(){this.nh();var t,e=this.xu();return this.status===lt||this.status===ut||this.status===st||e?(this.uh=setTimeout((()=>{this.Zu()}),2e3),this.T):(this.T.data.length>0&&(Ze(this.T).forEach((t=>{var e;null==(e=this._u)||e.trackSize(t.size),this.hh({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:k,$lib_version:S})})),null==(t=this.vu)||t.onFlushComplete()),this.Yu())}lh(t){var e,r=2+((null==(e=this.T)?void 0:e.data.length)||0),i=t.$session_id;this.yu||943718.4>=this.T.size+t.$snapshot_bytes+r&&this.T.sessionId===i||(this.T=this.Zu(),this.T.sessionId=i,this.T.windowId=t.$window_id),this.T.size+=t.$snapshot_bytes,this.T.data.push(t.$snapshot_data),this.T.sizes.push(t.$snapshot_bytes),this.uh||this.yu||(this.uh=setTimeout((()=>{this.Zu()}),2e3))}hh(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.fu),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Bu(){var t,e,r=null==(t=this.T)?void 0:t.data[(null==(e=this.T)?void 0:e.data.length)-1],{sessionStartTimestamp:i}=this.uu.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}oh(){if(!this.T||0===this.T.data.length)return this.Yu();for(var t=-1,e=this.T.data.length-1;e>=0;e--)if(this.T.data[e].type===a.Meta){t=e;break}return 0>t?this.Yu():(this.T.data=this.T.data.slice(t),this.T.sizes=this.T.sizes.slice(t),this.T.size=this.T.sizes.reduce(((t,e)=>t+e),0),this.T)}Yu(){return this.T={size:0,data:[],sizes:[],sessionId:this.di,windowId:this.ci},this.T}$a(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),ke.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.ou("$recording_started",o({reason:t},e))}dh(t){var e;return 3===t.type&&-1!==Ae.indexOf(null==(e=t.data)?void 0:e.source)}ah(t){var e=this.dh(t);e||this.yu||t.timestamp-this.mu>this.hu&&(this.yu=!0,clearInterval(this.qu),this.ou("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.mu,threshold:this.hu,bufferLength:this.T.data.length,bufferSize:this.T.size}),this.Zu());var r=!1;if(e&&(this.mu=t.timestamp,this.yu)){var i="unknown"===this.yu;this.yu=!1,i||(this.ou("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.yu){var{windowId:n,sessionId:s}=this.uu.checkAndGetSessionAndWindowId(!e,t.timestamp),o=this.di!==s,a=this.ci!==n;this.ci=n,this.di=s,o||a?(this.stop(),this.start("session_id_changed")):r&&this.Pu()}}Tu(){var t;null==(t=this.vu)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.uu.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.T.data.length,$sdk_debug_replay_internal_buffer_size:this.T.size,$sdk_debug_current_session_duration:this.Bu,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this._u)?void 0:t.currentTrackedSize,$sdk_debug_replay_full_snapshots:this.wu,$snapshot_max_depth_exceeded:this.Cu,$sdk_debug_replay_rrweb_error:this.bu}}rh(){var t;if(!this.gu){var e,r,i,n={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,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this._instance.config.session_recording;for(var[a,l]of Object.entries(s||{}))a in n&&("maskInputOptions"===a?n.maskInputOptions=o({password:!0},l):n[a]=l);this.Du&&this.Du.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.Du.fps},n.dataURLOptions={type:"image/webp",quality:this.Du.quality}),this.Lu&&(n.maskAllInputs=null===(e=this.Lu.maskAllInputs)||void 0===e||e,n.maskTextSelector=null!==(r=this.Lu.maskTextSelector)&&void 0!==r?r:void 0,n.blockSelector=null!==(i=this.Lu.blockSelector)&&void 0!==i?i:void 0);var u=_e();if(u){this.sh=null!==(t=this.sh)&&void 0!==t?t:new ue(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";ke.info(r,{node:e}),this.log(Se+" "+r,"warn")}});var h=this.Xu();if(this.gu=u(o({emit:t=>{this.onRRwebEmit(t)},plugins:h},n)),!this.gu)return this.bu=!0,void ke.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.bu=!1,this.mu=Date.now(),this.yu=y(this.yu)?this.yu:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ea),this.ou("$session_options",{sessionRecordingOptions:n,activePlugins:h.map((t=>null==t?void 0:t.name))}),this.ou("$posthog_config",{config:this._instance.config})}else ke.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.ou(t,e)}}var Ee,Ge=["type"],Le=Object.defineProperty,De=(t,e,r)=>((t,e,r)=>e in t?Le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),We=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?We(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Xe=(t=>(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))(Xe||{}),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Je={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ke={};function He(t){if(Ke[t])return Ke[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in ze?ze[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Je?Je[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Ke[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ke[t]=u:e.prototype}catch(t){return e.prototype}}var je={};function Ue(t,e,r){var i,n=t+"."+String(r);if(je[n])return je[n].call(e);var s=He(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(je[n]=o,o.call(e)):e[r]}var Pe={};function qe(t,e,r){var i=t+"."+String(r);if(Pe[i])return Pe[i].bind(e);var n=He(t)[r];return"function"!=typeof n?e[r]:(Pe[i]=n,n.bind(e))}var Qe={childNodes:t=>Ue("Node",t,"childNodes"),parentNode:t=>Ue("Node",t,"parentNode"),parentElement:t=>Ue("Node",t,"parentElement"),textContent:t=>Ue("Node",t,"textContent"),contains:(t,e)=>qe("Node",t,"contains")(e),getRootNode:t=>qe("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Ue("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Ue("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Ue("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Ue("Element",t,"querySelectorAll")(e),mutationObserver:()=>He("MutationObserver").constructor};function $e(t){return t.nodeType===t.ELEMENT_NODE}function tr(t){var e=t&&"host"in t&&"mode"in t&&Qe.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Qe.shadowRoot(e)===t)}function er(t){return"[object ShadowRoot]"==={}.toString.call(t)}function rr(t){try{var e=t.rules||t.cssRules;return e?((r=Array.from(e,(e=>ir(e,t.href))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r):null}catch(t){return null}var r}function ir(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=rr(t.styleSheet)||function(t){var{cssText:e}=t;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?gr(r,t.styleSheet.href):r}var i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?gr(i,e):i}function nr(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let sr=class{constructor(){Ve(this,"idNodeMap",new Map),Ve(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function or(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",l=n&&ar(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,e):"*".repeat(a.length)),a}function ar(t){return t.toLowerCase()}var lr="__rrweb_original__";function ur(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ar(e):null}function hr(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var dr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,cr=/^(?:[a-z+]+:)?\/\//i,vr=/^www\..*/i,fr=/^(data:)([^,]*),(.*)/i;function gr(t,e){return(t||"").replace(dr,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(cr.test(l)||vr.test(l))return"url("+u+l+u+")";if(fr.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var mr,pr,Ir=1,yr=new RegExp("[^a-z0-9-_:]"),br=-2;function Cr(){return Ir++}var wr=/^[^ \t\n\r\u000c]+/,Sr=/^[, \t\n\r\u000c]+/,kr=new WeakMap;function Ar(t,e){return e&&""!==e.trim()?Rr(t,e):e}function Rr(t,e){var r=kr.get(t);if(r||(r=t.createElement("a"),kr.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Nr(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Ar(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Sr),e.length>r;){var s=i(wr);if(","===s.slice(-1))s=Ar(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Ar(t,s);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?gr(i,Rr(t)):"object"===e&&"data"===r?Ar(t,i):i:Ar(t,i):i}function _r(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function Tr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Tr(Qe.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Tr(Qe.parentNode(t),e,r)}function Mr(t,e,r,i){var n;if($e(t)){if(!Qe.childNodes(n=t).length)return!1}else{if(null===Qe.parentElement(t))return!1;n=Qe.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(Tr(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function Fr(t){return null==t?"":t.toLowerCase()}function xr(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=(()=>!1),newlyAddedElement:S=!1}=e,{needsMask:k}=e,{preserveWhiteSpace:A=!0}=e;k||(k=Mr(t,o,a,void 0===k));var R,N=function(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:g=!1}=e,m=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Xe.Document,childNodes:[],compatMode:t.compatMode}:{type:Xe.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Xe.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:h,recordCanvas:d,keepIframeSrcFn:c,newlyAddedElement:v=!1,rootId:f}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=ar(t.tagName);return yr.test(e)?"div":e}(t),p={},I=t.attributes.length,y=0;I>y;y++){var b=t.attributes[y];_r(m,b.name)||(p[b.name]=Nr(i,m,ar(b.name),b.value))}if("link"===m&&o){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=nr(i,C);!w&&C.includes(".css")&&(w=nr(i,window.location.origin+"/"+C.replace(window.location.href,"")));var S=null;w&&(S=rr(w)),S&&(delete p.rel,delete p.href,p._cssText=S)}}if("style"===m&&t.sheet&&!(t.innerText||Qe.textContent(t)||"").trim().length){var k=rr(t.sheet);k&&(p._cssText=k)}if("input"===m||"textarea"===m||"select"===m){var A=t.value,R=t.checked;"radio"!==p.type&&"checkbox"!==p.type&&"submit"!==p.type&&"button"!==p.type&&A?p.value=or({element:t,type:ur(t),tagName:m,value:A,maskInputOptions:a,maskInputFn:l}):R&&(p.checked=R)}if("option"===m&&(t.selected&&!a.select?p.selected=!0:delete p.selected),"dialog"===m&&t.open)try{p.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){p.rr_open_mode="modal",p.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((lr in n?n[lr]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(p.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var N=t.toDataURL(u.type,u.quality),_=i.createElement("canvas");_.width=t.width,_.height=t.height,N!==_.toDataURL(u.type,u.quality)&&(p.rr_dataURL=N)}if("img"===m&&h){mr||(mr=i.createElement("canvas"),pr=mr.getContext("2d"));var T=t,M=T.currentSrc||T.getAttribute("src")||"<unknown-src>",F=T.crossOrigin,x=()=>{T.removeEventListener("load",x);try{mr.width=T.naturalWidth,mr.height=T.naturalHeight,pr.drawImage(T,0,0),p.rr_dataURL=mr.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==T.crossOrigin)return T.crossOrigin="anonymous",void(T.complete&&0!==T.naturalWidth?x():T.addEventListener("load",x));console.warn("Cannot inline img src="+M+"! Error: "+t)}"anonymous"===T.crossOrigin&&(F?p.crossOrigin=F:T.removeAttribute("crossorigin"))};T.complete&&0!==T.naturalWidth?x():T.addEventListener("load",x)}if("audio"===m||"video"===m){var B=p;B.rr_mediaState=t.paused?"paused":"played",B.rr_mediaCurrentTime=t.currentTime,B.rr_mediaPlaybackRate=t.playbackRate,B.rr_mediaMuted=t.muted,B.rr_mediaLoop=t.loop,B.rr_mediaVolume=t.volume}if(v||(t.scrollLeft&&(p.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(p.rr_scrollTop=t.scrollTop)),g){var{width:O,height:Z}=t.getBoundingClientRect();p={class:p.class,rr_width:O+"px",rr_height:Z+"px"}}"iframe"!==m||c(p.src)||(t.contentDocument||(p.rr_src=p.src),delete p.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:Xe.Element,tagName:m,attributes:p,childNodes:[],isSVG:(Y=t,Boolean("svg"===Y.tagName||Y.ownerSVGElement)||void 0),needBlock:g,rootId:f,isCustom:r};var Y}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:d,inlineImages:c,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=Qe.parentNode(t),a=o&&o.tagName,l=Qe.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=rr(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=gr(l,Rr(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,Qe.parentElement(t)):l.replace(/[\S]/g,"*")),{type:Xe.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:Xe.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:Xe.Comment,textContent:Qe.textContent(t)||"",rootId:m};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:k,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:w,newlyAddedElement:S});if(!N)return console.warn(t,"not serialized"),null;R=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===Xe.Comment)return!0;if(t.type===Xe.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===hr(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Fr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Fr(t.attributes.name)||"icon"===Fr(t.attributes.rel)||"apple-touch-icon"===Fr(t.attributes.rel)||"shortcut icon"===Fr(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Fr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Fr(t.attributes.property).match(/^(og|twitter|fb):/)||Fr(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Fr(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===Fr(t.attributes.name)||"googlebot"===Fr(t.attributes.name)||"bingbot"===Fr(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===Fr(t.attributes.name)||"generator"===Fr(t.attributes.name)||"framework"===Fr(t.attributes.name)||"publisher"===Fr(t.attributes.name)||"progid"===Fr(t.attributes.name)||Fr(t.attributes.property).match(/^article:/)||Fr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===Fr(t.attributes.name)||"yandex-verification"===Fr(t.attributes.name)||"csrf-token"===Fr(t.attributes.name)||"p:domain_verify"===Fr(t.attributes.name)||"verify-v1"===Fr(t.attributes.name)||"verification"===Fr(t.attributes.name)||"shopify-checkout-api-token"===Fr(t.attributes.name)))return!0}}return!1}(N,v)&&(A||N.type!==Xe.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?Cr():br;var _=Object.assign(N,{id:R});if(i.add(t,_),R===br)return null;p&&p(t);var T=!l;if(_.type===Xe.Element){T=T&&!_.needBlock,delete _.needBlock;var M=Qe.shadowRoot(t);M&&er(M)&&(_.isShadowHost=!0)}if((_.type===Xe.Document||_.type===Xe.Element)&&T){v.headWhitespace&&_.type===Xe.Element&&"head"===_.tagName&&(A=!1);var F={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:A,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w};if(_.type===Xe.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else for(var x of Array.from(Qe.childNodes(t))){var B=xr(x,F);B&&_.childNodes.push(B)}var O=null;if($e(t)&&(O=Qe.shadowRoot(t)))for(var Z of Array.from(Qe.childNodes(O))){var Y=xr(Z,F);Y&&(er(O)&&(Y.isShadow=!0),_.childNodes.push(Y))}}var E=Qe.parentNode(t);return E&&tr(E)&&er(E)&&(_.isShadow=!0),_.type===Xe.Element&&"iframe"===_.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=xr(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:A,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});r&&I(t,r)}}),y),_.type===Xe.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===hr(_.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(b){var e=xr(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:A,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});e&&b(t,e)}}),C),_}let Br=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;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"}};var Or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Zr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Yr={};function Er(t){if(Yr[t])return Yr[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Or?Or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Zr?Zr[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Yr[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Yr[t]=u:r}catch(t){return r}}var Gr={};function Lr(t,e,r){var i,n=t+"."+String(r);if(Gr[n])return Gr[n].call(e);var s=Er(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Gr[n]=o,o.call(e)):e[r]}var Dr={};function Wr(t,e,r){var i=t+"."+String(r);if(Dr[i])return Dr[i].bind(e);var n=Er(t)[r];return"function"!=typeof n?e[r]:(Dr[i]=n,n.bind(e))}function Vr(){return Er("MutationObserver").constructor}var Xr={childNodes:t=>Lr("Node",t,"childNodes"),parentNode:t=>Lr("Node",t,"parentNode"),parentElement:t=>Lr("Node",t,"parentElement"),textContent:t=>Lr("Node",t,"textContent"),contains:(t,e)=>Wr("Node",t,"contains")(e),getRootNode:t=>Wr("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Lr("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Lr("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Lr("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Lr("Element",t,"querySelectorAll")(e),mutationObserver:Vr};function zr(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var Jr="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.",Kr={map:{},getId(){return console.error(Jr),-1},getNode(){return console.error(Jr),null},removeNodeFromMap(){console.error(Jr)},has(){return console.error(Jr),!1},reset(){console.error(Jr)}};function Hr(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function jr(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>jr(t,e,s||{},!0)}function Ur(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Kr=new Proxy(Kr,{get(t,e,r){return"map"===e&&console.error(Jr),Reflect.get(t,e,r)}}));var Pr=Date.now;function qr(t){var e,r,i,n,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=Xr.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.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=Xr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Qr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $r(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ti(t){return t?t.nodeType===t.ELEMENT_NODE?t:Xr.parentElement(t):null}function ei(t,e,r,i){if(!t)return!1;var n=ti(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Tr(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function ri(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===br}function ii(t,e){if(tr(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=Xr.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ii(i,e))}function ni(t){return Boolean(t.changedTouches)}function si(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function oi(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function ai(t){return!!t&&(t instanceof Br&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Xr.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Pr=()=>(new Date).getTime());let li=class{constructor(){De(this,"id",1),De(this,"styleIDMap",new WeakMap),De(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 ui(t){var e,r=null;return"getRootNode"in t&&(null==(e=Xr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Xr.host(Xr.getRootNode(t))&&(r=Xr.host(Xr.getRootNode(t))),r}function hi(t){var e=t.ownerDocument;return!!e&&(Xr.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=ui(r);)r=e;return r}(t);return Xr.contains(e,r)}(t))}var di=(t=>(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))(di||{}),ci=(t=>(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))(ci||{}),vi=(t=>(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))(vi||{}),fi=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(fi||{}),gi=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(gi||{}),mi=(t=>(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))(mi||{});function pi(t){return"__ln"in t}class Ii{constructor(){De(this,"length",0),De(this,"head",null),De(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&pi(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&pi(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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){var 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--)}}var yi,bi=(t,e)=>t+"@"+e;class Ci{constructor(){De(this,"frozen",!1),De(this,"locked",!1),De(this,"texts",[]),De(this,"attributes",[]),De(this,"attributeMap",new WeakMap),De(this,"removes",[]),De(this,"mapRemoves",[]),De(this,"movedMap",{}),De(this,"addedSet",new Set),De(this,"movedSet",new Set),De(this,"droppedSet",new Set),De(this,"mutationCb"),De(this,"blockClass"),De(this,"blockSelector"),De(this,"maskTextClass"),De(this,"maskTextSelector"),De(this,"inlineStylesheet"),De(this,"maskInputOptions"),De(this,"maskTextFn"),De(this,"maskInputFn"),De(this,"keepIframeSrcFn"),De(this,"recordCanvas"),De(this,"inlineImages"),De(this,"slimDOMOptions"),De(this,"dataURLOptions"),De(this,"doc"),De(this,"mirror"),De(this,"iframeManager"),De(this,"stylesheetManager"),De(this,"shadowDomManager"),De(this,"canvasManager"),De(this,"processedNodeManager"),De(this,"unattachedDoc"),De(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),De(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ii,i=t=>{for(var e=t,r=br;r===br;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=Xr.parentNode(n);if(s&&hi(n)&&"TEXTAREA"!==s.tagName){var o=tr(s)?this.mirror.getId(ui(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=xr(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{si(t,this.mirror)&&this.iframeManager.addIframe(t),oi(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),ai(n)&&this.shadowDomManager.addShadowRoot(Xr.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Si(this.removes,s,this.mirror)&&!this.movedSet.has(Xr.parentNode(s))||n(s);for(var o of this.addedSet)ki(this.droppedSet,o)||Si(this.removes,o,this.mirror)?ki(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(Xr.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(Xr.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=Xr.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=Xr.host(f);if(-1!==this.mirror.getId(g)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=Xr.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}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};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),De(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e)),e.attributes.value=Array.from(Xr.childNodes(t),(t=>Xr.textContent(t)||"")).join("")})),De(this,"processMutation",(t=>{if(!ri(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Xr.textContent(t.target);ei(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Mr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ti(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=ur(r);n=or({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(ei(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!_r(r.tagName,i))if(o.attributes[i]=Nr(this.doc,ar(r.tagName),ar(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(ei(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=>{var r=this.mirror.getId(e),i=tr(t.target)?this.mirror.getId(Xr.host(t.target)):this.mirror.getId(t.target);ei(t.target,this.blockClass,this.blockSelector,!1)||ri(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(wi(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||ii(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[bi(r,i)]?wi(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!tr(t.target)||!er(t.target))||void 0})),this.mapRemoves.push(e))}))}})),De(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ri(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[bi(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ei(t,this.blockClass,this.blockSelector,!1)||(Xr.childNodes(t).forEach((t=>this.genAdds(t))),ai(t)&&Xr.childNodes(Xr.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function wi(t,e){t.delete(e),Xr.childNodes(e).forEach((e=>wi(t,e)))}function Si(t,e,r){return 0!==t.length&&function(t,e,r){for(var i,n=Xr.parentNode(e),s=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=Xr.parentNode(n)};n;)if(i=s())return i.v;return!1}(t,e,r)}function ki(t,e){return 0!==t.size&&Ai(t,e)}function Ai(t,e){var r=Xr.parentNode(e);return!!r&&(!!t.has(r)||Ai(t,r))}var Ri=t=>yi?function(){try{return t(...arguments)}catch(t){if(yi&&!0===yi(t))return;throw t}}:t,Ni=[];function _i(t){try{if("composedPath"in t){var 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 Ti(t,e){var r=new Ci;Ni.push(r),r.init(t);var i=new(Vr())(Ri(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Mi(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return zr("scroll",Ri(Hr(Ri((t=>{var o=_i(t);if(o&&!ei(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=qr(r.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var Fi=["INPUT","TEXTAREA","SELECT"],xi=new WeakMap;function Bi(t){return function(t,e){if(Ei("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Ei("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Ei("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Ei("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function Oi(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Zi(t,e){var r,i,n,s,{mirror:o,stylesheetManager:a}=t;s=o.getId("#document"===e.nodeName?e:Xr.host(e));var l="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r=null==(e=u.set)?void 0:e.call(this,t);if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),Ri((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Yi(t,e){void 0===e&&(e={});var r,i=t.doc.defaultView;if(!i)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:c,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(r=Ti(t,t.doc));var n=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=Hr(Ri((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),h=Ri(Hr(Ri((t=>{var e=_i(t),{clientX:r,clientY:i}=ni(t)?t.changedTouches[0]:t;s||(s=Pr()),l.push({x:r,y:i,id:n.getId(e),timeOffset:Pr()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?ci.Drag:t instanceof MouseEvent?ci.MouseMove:ci.TouchMove)})),o,{trailing:!1})),d=[zr("mousemove",h,i),zr("touchmove",h,i),zr("drag",h,i)];return Ri((()=>{d.forEach((t=>t()))}))}(t),s=function(t){var{mouseInteractionCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(vi).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=ar(t),l=(t=>r=>{var a=_i(r);if(!ei(a,n,s,!0)){var l=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":l=fi.Mouse;break;case"touch":l=fi.Touch;break;case"pen":l=fi.Pen}l===fi.Touch&&(vi[t]===vi.MouseDown?u="TouchStart":vi[t]===vi.MouseUp&&(u="TouchEnd"))}else ni(r)&&(l=fi.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===fi.Touch||u.startsWith("Mouse")&&l===fi.Mouse)&&(l=null)):vi[t]===vi.Click&&(l=h,h=null);var d=ni(r)?r.changedTouches[0]:r;if(d){var c=i.getId(a),{clientX:v,clientY:f}=d;Ri(e)(o({type:vi[u],id:c,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(vi[t]){case vi.MouseDown:case vi.MouseUp:a=a.replace("mouse","pointer");break;case vi.TouchStart:case vi.TouchEnd:return}u.push(zr(a,l,r))})),Ri((()=>{u.forEach((t=>t()))}))}(t),a=Mi(t),l=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return zr("resize",Ri(Hr(Ri((()=>{var t=Qr(),e=$r();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:i}),u=function(t){var{inputCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:d,userTriggeredOnInput:c}=t;function v(t){var e=_i(t),i=t.isTrusted,o=e&&e.tagName;if(e&&"OPTION"===o&&(e=Xr.parentElement(e)),e&&o&&Fi.indexOf(o)>=0&&!ei(e,n,s,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var d=e.value,v=!1,g=ur(e)||"";"radio"===g||"checkbox"===g?v=e.checked:(u[o.toLowerCase()]||u[g])&&(d=or({element:e,maskInputOptions:u,tagName:o,type:g,value:d,maskInputFn:h})),f(e,c?{text:d,isChecked:v,userTriggered:i}:{text:d,isChecked:v});var m=e.name;"radio"===g&&m&&v&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,c?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,r){var n=xi.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){xi.set(t,r);var s=i.getId(t);Ri(e)(o({},r,{id:s}))}}var g=("last"===d.input?["change"]:["input","change"]).map((t=>zr(t,Ri(v),r))),m=r.defaultView;if(!m)return()=>{g.forEach((t=>t()))};var p=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value");return p&&p.set&&g.push(...[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]].map((t=>jr(t[0],t[1],{set(){Ri(v)({target:this,isTrusted:!1})}},!1,m)))),Ri((()=>{g.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=Ri((t=>Hr(Ri((s=>{var o=_i(s);if(o&&!ei(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:d}=o;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[zr("play",a(mi.Play),o),zr("pause",a(mi.Pause),o),zr("seeked",a(mi.Seeked),o),zr("volumechange",a(mi.VolumeChange),o),zr("ratechange",a(mi.RateChange),o)];return Ri((()=>{l.forEach((t=>t()))}))}(t),d=()=>{},c=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(d=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ri(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=Oi(e,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),t.apply(e,s)}))}));var h={};Gi("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Gi("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Gi("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Gi("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var[e,s]=t;d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Ri(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=Oi(e.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...Bi(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...Bi(e),o]}]}),t.apply(e,s)}))})})),Ri((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:i}),c=Zi(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ri(((t,e,o)=>{var l,[u,h,d]=o;if(n.has(u))return a.apply(e,[u,h,d]);var{id:c,styleId:v}=Oi(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||v&&-1!==v)&&r({id:c,styleId:v,set:{property:u,value:h,priority:d},index:Bi(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ri(((t,e,o)=>{var a,[u]=o;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:d}=Oi(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||d&&-1!==d)&&r({id:h,styleId:d,remove:{property:u},index:Bi(e.parentRule)}),t.apply(e,o)}))}),Ri((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:i}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=Ur(r.fonts,"add",(function(t){return function(r){return setTimeout(Ri((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ri((()=>{n.forEach((t=>t()))}))}(t)));var g=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=Ri((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),{startContainer:d,startOffset:c,endContainer:v,endOffset:f}=h;ei(d,i,n,!0)||ei(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),zr("selectionchange",a)}(t),m=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?Ur(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),p=[];for(var I of t.plugins)p.push(I.observer(I.callback,i,I.options));return Ri((()=>{Ni.forEach((t=>t.reset())),null==r||r.disconnect(),n(),s(),a(),l(),u(),h(),d(),c(),v(),f(),g(),m(),p.forEach((t=>t()))}))}function Ei(t){return void 0!==window[t]}function Gi(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Li{constructor(t){De(this,"iframeIdToRemoteIdMap",new WeakMap),De(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class Di{constructor(t){De(this,"iframes",new WeakMap),De(this,"crossOriginIframeMap",new WeakMap),De(this,"crossOriginIframeMirror",new Li(Cr)),De(this,"crossOriginIframeStyleMirror"),De(this,"crossOriginIframeRootIdMap",new WeakMap),De(this,"mirror"),De(this,"mutationCb"),De(this,"wrappedEmit"),De(this,"loadListener"),De(this,"stylesheetManager"),De(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Li(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.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){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case di.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:di.IncrementalSnapshot,data:{source:ci.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case di.Meta:case di.Load:case di.DomContentLoaded:return!1;case di.Plugin:return e;case di.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case di.IncrementalSnapshot:switch(e.data.source){case ci.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 ci.Drag:case ci.TouchMove:case ci.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case ci.ViewportResize:return!1;case ci.MediaInteraction:case ci.MouseInteraction:case ci.Scroll:case ci.CanvasMutation:case ci.Input:return this.replaceIds(e.data,t,["id"]),e;case ci.StyleSheetRule:case ci.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ci.Font:return e;case ci.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case ci.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===Xe.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Wi{constructor(t){De(this,"shadowDoms",new WeakSet),De(this,"mutationCb"),De(this,"scrollCb"),De(this,"bypassOptions"),De(this,"mirror"),De(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){if(er(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=Ti(o({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Mi(o({},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(Xr.host(t))),this.restoreHandlers.push(Zi({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){var r=this;this.restoreHandlers.push(Ur(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=Xr.shadowRoot(this);return s&&hi(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Vi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),zi=0;64>zi;zi++)Xi[Vi.charCodeAt(zi)]=zi;var Ji=new Map,Ki=(t,e,r)=>{if(t&&(Ui(t,e)||"object"==typeof t)){var i=function(t,e){var r=Ji.get(t);return r||Ji.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Hi(t,e,r){if(t instanceof Array)return t.map((t=>Hi(t,e,r)));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:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Vi[r[e]>>2],n+=Vi[(3&r[e])<<4|r[e+1]>>4],n+=Vi[(15&r[e+1])<<2|r[e+2]>>6],n+=Vi[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Hi(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL()}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Hi(t.data,e,r),t.width,t.height]}:Ui(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ki(t,e,r)}:t}var ji=(t,e,r)=>t.map((t=>Hi(t,e,r))),Ui=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Pi(t,e,r,i){var n=[];try{var s=Ur(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!ei(this,e,r,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function qi(t,e,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=Ur(t,a,(function(t){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var h=t.apply(this,l);if(Ki(h,s,this),"tagName"in this.canvas&&!ei(this.canvas,i,n,!0)){var d=ji(l,s,this);r(this.canvas,{type:e,property:a,args:d})}return h}}));o.push(l)}catch(i){var u=jr(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var Qi,$i,tn,en,rn="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",nn="undefined"!=typeof window&&window.Blob&&new Blob([(Qi=rn,Uint8Array.from(atob(Qi),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function sn(t){var e;try{if(!(e=nn&&(window.URL||window.webkitURL).createObjectURL(nn)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+rn,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class on{constructor(t){De(this,"pendingCanvasMutations",new Map),De(this,"rafStamps",{latestId:0,invokeId:null}),De(this,"mirror"),De(this,"mutationCb"),De(this,"resetObservers"),De(this,"frozen",!1),De(this,"locked",!1),De(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)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,i,n){var o=this,a=Pi(e,r,i,!0),l=new Map,u=new sn;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:gi["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,d=1e3/t,c=0,v=t=>{var a,f;c&&d>t-c||(c=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{ei(t,r,i,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(e.document),a).forEach(function(){var t=s((function*(t){var e,r=o.mirror.getId(t);if(!l.get(r)&&0!==t.width&&0!==t.height){if(l.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var s=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:s,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:s,height:a,dataURLOptions:n.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}())),h=requestAnimationFrame(v)};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Pi(t,e,r,!1),n=function(t,e,r,i){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=Ur(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return ei(this.canvas,r,i,!0)||setTimeout((()=>{var r=ji(a,e,this);t(this.canvas,{type:gi["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=jr(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:gi["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),s=function(t,e,r,i){var n=[];return n.push(...qi(e.WebGLRenderingContext.prototype,gi.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...qi(e.WebGL2RenderingContext.prototype,gi.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Ge);return e})),{type:n}=r[0];this.mutationCb({id:e,type:n,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class an{constructor(t){De(this,"trackedLinkElements",new WeakSet),De(this,"mutationCb"),De(this,"adoptedStyleSheetCb"),De(this,"styleMirror",new li),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ir(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class ln{constructor(){De(this,"nodeMap",new WeakMap),De(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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(){}}var un=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var hn=document.createElement("iframe");document.body.appendChild(hn),Array.from=(null==(Ee=hn.contentWindow)?void 0:Ee.Array.from)||Array.from,document.body.removeChild(hn)}}catch(t){console.debug("Unable to override Array.from",t)}var dn,cn,vn=new sr;function fn(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:n="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:d=!0,maskAllInputs:c,maskInputOptions:v,slimDOMOptions:f,maskInputFn:g,maskTextFn:m,hooks:p,packFn:I,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:A=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:N=!1,inlineImages:_=!1,plugins:T,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:F=new Set([]),errorHandler:x}=t;yi=x;var B=!k||window.parent===window,O=!1;if(!B)try{window.parent.document&&(O=!1)}catch(t){O=!0}if(B&&!e)throw new Error("emit function is required");if(!B&&!O)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),vn.reset();var Z,Y=!0===c?{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},E=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(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)}();var G=0,L=t=>{for(var e of T||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!O&&(t=I(t)),t};$i=(t,n)=>{var s,o=t;if(o.timestamp=Pr(),!(null==(s=Ni[0])?void 0:s.isFrozen())||o.type===di.FullSnapshot||o.type===di.IncrementalSnapshot&&o.data.source===ci.Mutation||Ni.forEach((t=>t.unfreeze())),B)null==e||e(L(o),n);else if(O){var a={type:"rrweb",event:L(o),origin:window.location.origin,isCheckout:n};window.parent.postMessage(a,"*")}if(o.type===di.FullSnapshot)Z=o,G=0;else if(o.type===di.IncrementalSnapshot){if(o.data.source===ci.Mutation&&o.data.isAttachIframe)return;G++,(i&&G>=i||r&&o.timestamp-Z.timestamp>r)&&tn(!0)}};var D=t=>{$i({type:di.IncrementalSnapshot,data:o({source:ci.Mutation},t)})},W=t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.Scroll},t)}),V=t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.CanvasMutation},t)}),X=new an({mutationCb:D,adoptedStyleSheetCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.AdoptedStyleSheet},t)})}),z=new Di({mirror:vn,mutationCb:D,stylesheetManager:X,recordCrossOriginIframes:k,wrappedEmit:$i});for(var J of T||[])J.getMirror&&J.getMirror({nodeMirror:vn,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new ln;en=new on({recordCanvas:S,mutationCb:V,win:window,blockClass:n,blockSelector:s,mirror:vn,sampling:y.canvas,dataURLOptions:b});var H=new Wi({mutationCb:D,scrollCb:W,bypassOptions:{blockClass:n,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:d,maskInputOptions:Y,dataURLOptions:b,maskTextFn:m,maskInputFn:g,recordCanvas:S,inlineImages:_,sampling:y,slimDOMOptions:E,iframeManager:z,stylesheetManager:X,canvasManager:en,keepIframeSrcFn:M,processedNodeManager:K},mirror:vn});tn=function(t){if(void 0===t&&(t=!1),w){$i({type:di.Meta,data:{href:window.location.href,width:$r(),height:Qr()}},t),X.reset(),H.init(),Ni.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new sr,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:c,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C=(()=>!1)}=e||{};return xr(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!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,maskTextFn:d,maskInputFn:c,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:vn,blockClass:n,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:d,maskAllInputs:Y,maskTextFn:m,maskInputFn:g,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:_,onSerialize(t){si(t,vn)&&z.addIframe(t),oi(t,vn)&&X.trackLinkElement(t),ai(t)&&H.addShadowRoot(Xr.shadowRoot(t),document)},onIframeLoad(t,e){z.attachIframe(t,e),H.observeAttachShadow(t)},onStylesheetLoad(t,e){X.attachLinkElement(t,e)},keepIframeSrcFn:M});if(!e)return console.warn("Failed to snapshot the document");$i({type:di.FullSnapshot,data:{node:e,initialOffset:qr(window)}},t),Ni.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,vn.getId(document))}};try{var j=[],U=t=>{var e;return Ri(Yi)({mutationCb:D,mousemoveCb:(t,e)=>$i({type:di.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.MouseInteraction},t)}),scrollCb:W,viewportResizeCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.ViewportResize},t)}),inputCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.Input},t)}),mediaInteractionCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.MediaInteraction},t)}),styleSheetRuleCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.StyleSheetRule},t)}),styleDeclarationCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.Font},t)}),selectionCb(t){$i({type:di.IncrementalSnapshot,data:o({source:ci.Selection},t)})},customElementCb(t){$i({type:di.IncrementalSnapshot,data:o({source:ci.CustomElement},t)})},blockClass:n,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:Y,inlineStylesheet:d,sampling:y,recordDOM:w,recordCanvas:S,inlineImages:_,userTriggeredOnInput:R,collectFonts:N,doc:t,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:M,blockSelector:s,slimDOMOptions:E,dataURLOptions:b,mirror:vn,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:en,ignoreCSSAttributes:F,plugins:(null==(e=null==T?void 0:T.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>$i({type:di.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},p)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{tn(),j.push(U(document)),un=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(zr("DOMContentLoaded",(()=>{$i({type:di.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&P()}))),j.push(zr("load",(()=>{$i({type:di.Load,data:{}}),"load"===A&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),un=!1,yi=void 0}}catch(t){console.warn(t)}}fn.addCustomEvent=(t,e)=>{if(!un)throw new Error("please add custom event after start recording");$i({type:di.Custom,data:{tag:t,payload:e}})},fn.freezePage=()=>{Ni.forEach((t=>t.freeze()))},fn.takeFullSnapshot=t=>{if(!un)throw new Error("please take full snapshot after start recording");tn(t)},fn.mirror=vn,(cn=dn||(dn={}))[cn.NotStarted=0]="NotStarted",cn[cn.Running=1]="Running",cn[cn.Stopped=2]="Stopped";var gn,mn=Object.defineProperty,pn=(t,e,r)=>((t,e,r)=>e in t?mn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),In=Object.defineProperty,yn=(t,e,r)=>((t,e,r)=>e in t?In(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),bn=Object.defineProperty,Cn=(t,e,r)=>((t,e,r)=>e in t?bn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),wn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Sn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},kn={};function An(t){if(kn[t])return kn[t];var e=globalThis[t],r=e.prototype,i=t in wn?wn[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Sn?Sn[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return kn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?kn[t]=u:r}catch(t){return r}}var Rn={};function Nn(t,e,r){var i,n=t+"."+String(r);if(Rn[n])return Rn[n].call(e);var s=An(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Rn[n]=o,o.call(e)):e[r]}var _n={};function Tn(t,e,r){var i=t+"."+String(r);if(_n[i])return _n[i].bind(e);var n=An(t)[r];return"function"!=typeof n?e[r]:(_n[i]=n,n.bind(e))}var Mn={childNodes:t=>Nn("Node",t,"childNodes"),parentNode:t=>Nn("Node",t,"parentNode"),parentElement:t=>Nn("Node",t,"parentElement"),textContent:t=>Nn("Node",t,"textContent"),contains:(t,e)=>Tn("Node",t,"contains")(e),getRootNode:t=>Tn("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Nn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Nn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Nn("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Nn("Element",t,"querySelectorAll")(e),mutationObserver:()=>An("MutationObserver").constructor};function Fn(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Fn(Mn.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Fn(Mn.parentNode(t),e,r)}class xn{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof xn))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.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"}}var Bn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},On={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Zn={};function Yn(t){if(Zn[t])return Zn[t];var e=globalThis[t],r=e.prototype,i=t in Bn?Bn[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in On?On[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Zn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Zn[t]=u:r}catch(t){return r}}var En={};function Gn(t,e,r){var i,n=t+"."+String(r);if(En[n])return En[n].call(e);var s=Yn(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(En[n]=o,o.call(e)):e[r]}var Ln={};function Dn(t,e,r){var i=t+"."+String(r);if(Ln[i])return Ln[i].bind(e);var n=Yn(t)[r];return"function"!=typeof n?e[r]:(Ln[i]=n,n.bind(e))}var Wn={childNodes:t=>Gn("Node",t,"childNodes"),parentNode:t=>Gn("Node",t,"parentNode"),parentElement:t=>Gn("Node",t,"parentElement"),textContent:t=>Gn("Node",t,"textContent"),contains:(t,e)=>Dn("Node",t,"contains")(e),getRootNode:t=>Dn("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Gn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Gn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Gn("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Gn("Element",t,"querySelectorAll")(e),mutationObserver:()=>Yn("MutationObserver").constructor},Vn="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.",Xn={map:{},getId(){return console.error(Vn),-1},getNode(){return console.error(Vn),null},removeNodeFromMap(){console.error(Vn)},has(){return console.error(Vn),!1},reset(){console.error(Vn)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xn=new Proxy(Xn,{get(t,e,r){return"map"===e&&console.error(Vn),Reflect.get(t,e,r)}}));var zn,Jn=Date.now;function Kn(t){return t?t.nodeType===t.ELEMENT_NODE?t:Wn.parentElement(t):null}function Hn(t){var e,r=null;return"getRootNode"in t&&(null==(e=Wn.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Wn.host(Wn.getRootNode(t))&&(r=Wn.host(Wn.getRootNode(t))),r}function jn(t){for(var e,r=t;e=Hn(r);)r=e;return r}function Un(t){var e=t.ownerDocument;if(!e)return!1;var r=jn(t);return Wn.contains(e,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Jn=()=>(new Date).getTime());for(var Pn=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){yn(this,"id",1),yn(this,"styleIDMap",new WeakMap),yn(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return Xn},closestElementOfNode:Kn,getBaseDimension:function t(e,r){var i,n,s=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:jn,getShadowHost:Hn,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(t){var e,r,i,n,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=Wn.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.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=Wn.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:t=>!!t&&(t instanceof xn&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Wn.shadowRoot(t))),hookSetter:function t(e,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,r);return s.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,r,o||{},!0)},inDom(t){var e=t.ownerDocument;return!!e&&(Wn.contains(e,t)||Un(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&Mn.host(i)||null,Boolean(n&&"shadowRoot"in n&&Mn.shadowRoot(n)===i))return!1;var i,n,s=r.getId(e);if(!r.has(s))return!0;var o=Wn.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,r))},isBlocked(t,e,r,i){if(!t)return!1;var n=Kn(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Fn(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:(t,e,r)=>!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t),isSerialized:(t,e)=>-1!==e.getId(t),isSerializedIframe:(t,e)=>Boolean("IFRAME"===t.nodeName&&e.getMeta(t)),isSerializedStylesheet:(t,e)=>Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t)),iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:t=>Boolean(t.changedTouches),get nowTimestamp(){return Jn},on(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill(t){void 0===t&&(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)},queueToResolveTrees(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in e){var h=e[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:Un,throttle(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}},uniqueTextMutations(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"}))),qn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Qn=0;64>Qn;Qn++)qn["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Qn)]=Qn;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(t=>t.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var $n=document.createElement("iframe");document.body.appendChild($n),Array.from=(null==(gn=$n.contentWindow)?void 0:gn.Array.from)||Array.from,document.body.removeChild($n)}}catch(t){console.debug("Unable to override Array.from",t)}new class{constructor(){Cn(this,"idNodeMap",new Map),Cn(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(zn||(zn={}));class ts{constructor(t){pn(this,"fileName"),pn(this,"functionName"),pn(this,"lineNumber"),pn(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var es=/(^|@)\S+:\d+/,rs=/^\s*at .*(\S+:\d+|\(native\))/m,is=/^(eval@)?(\[native code])?$/,ns={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(rs)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var 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(rs)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new ts({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(is)}),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 ts({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new ts({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new ts({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new ts({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(es)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ts({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function ss(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function os(t){return"[object Object]"==={}.toString.call(t)}function as(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(os(t[i])&&as(t[i],e-1))return!0;return!1}function ls(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(os(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||os(o)&&as(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Array.isArray(u)?ss(u.length?u[0]:null):u}return a}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 us={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 hs(t,e,r){var i,n=r?Object.assign({},us,r):us,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=ns.parse(e.error).map((t=>t.toString())),s=[ls(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[ls("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[ls("Uncaught (in promise)",n.stringifyOptions),ls(e.reason,n.stringifyOptions)]);var s=ns.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?Pn.patch(e,r,(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=ns.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>ls(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[ls("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var ds=t=>({name:"rrweb/console@1",observer:hs,options:t}),cs=t=>t instanceof Document;function vs(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return c(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function fs(t,e){var r,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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var gs=N("[Recorder]"),ms=t=>"navigation"===t.entryType,ps=t=>"resource"===t.entryType;function Is(t,e){return!!e&&(y(e)||e[t])}function ys(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(y(r))return!0;if(d(r))return s(r);var o=r[e];return y(o)?o:s(o)}function bs(t,e,r,i,n,s){return Cs.apply(this,arguments)}function Cs(){return Cs=s((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return gs.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(ps(o=t[s])&&o.initiatorType===e&&(f(i)||o.startTime>=i)&&(f(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),bs(t,e,r,i,n,s+1))})),Cs.apply(this,arguments)}function ws(t){var{body:e,options:r,url:i}=t;if(p(e))return null;var{hostname:n,isHostDenied:s}=fs(i,r);if(s)return n+" is in deny list";if(g(e))return e;if(cs(e))return e.textContent;if(b(e))return x(e);if(v(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Ss=t=>!m(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ks(t){var{entry:e,method:r,status:i,networkRequest:n,isInitial:s,start:a,end:l,url:u,initiatorType:h}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[o({},e?e.toJSON():{name:u},{startTime:f(a)?void 0:Math.round(a),endTime:f(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Ss(e))for(var g of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:g.name,duration:g.duration,entryType:"serverTiming"});return v}var As=["video/","audio/"];function Rs(t){return new Promise((e=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function Ns(){return(Ns=s((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=fs(i,r);return s?Promise.resolve(n+" is in deny list"):Rs(e)}))).apply(this,arguments)}function _s(){return(_s=s((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=As.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=fs(n,i);return l?a+" is in deny list":null}({r:e,options:r,url:i});return m(n)?Rs(e):Promise.resolve(n)}))).apply(this,arguments)}var Ts=null;function Ms(t,e,r){if(!("performance"in e))return()=>{};if(Ts)return gs.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},Q,r):Q,n=e=>{var r=[];e.requests.forEach((t=>{var e=i.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(o({},e,{requests:r}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>ms(t)||ps(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ks({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>ms(t)||ps(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ks({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,i),l=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Is("request",r.recordHeaders),n=Is("response",r.recordHeaders),s=vs(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d,c,v=this,f=new Request(a),g={},m={},p=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(m[t]=e,p(t,e)),i&&(g.requestHeaders=m);var I=v.send.bind(v);v.send=t=>(ys({type:"request",headers:m,url:a,recordBody:r.recordBody})&&(g.requestBody=ws({body:t,options:r,url:a})),d=e.performance.now(),I(t));var y=()=>{v.removeEventListener("readystatechange",b),v.removeEventListener("error",y),v.removeEventListener("abort",y),v.removeEventListener("timeout",y)},b=()=>{if(v.readyState===v.DONE){y(),c=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(g.responseHeaders=i),ys({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=ws({body:v.response,options:r,url:a})),bs(e,"xmlhttprequest",f.url,d,c).then((e=>{var r=ks({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:g,start:d,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",b),v.addEventListener("error",y),v.addEventListener("abort",y),v.addEventListener("timeout",y),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(n,e,i),u=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=Is("request",r.recordHeaders),n=Is("response",r.recordHeaders),o=vs(e,"fetch",(o=>function(){var a=s((function*(s,a){var l,u,h,d=new Request(s,a),c={};try{var v={};d.headers.forEach(((t,e)=>{v[e]=t})),i&&(c.requestHeaders=v),ys({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(c.requestBody=yield function(t){return Ns.apply(this,arguments)}({r:d,options:r,url:s})),u=e.performance.now(),l=yield o(d),h=e.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),n&&(c.responseHeaders=f),ys({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(c.responseBody=yield function(t){return _s.apply(this,arguments)}({r:l,options:r,url:s})),l}finally{bs(e,"fetch",d.url,u,h).then((e=>{var r,i=ks({entry:e,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:u,end:h,url:d.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(n,e,i)),Ts=()=>{a(),l(),u(),Ts=null}}var Fs=t=>({name:"rrweb/network@1",observer:Ms,options:t});i.__PosthogExtensions__=i.__PosthogExtensions__||{},i.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:ds,getRecordNetworkPlugin:Fs},i.__PosthogExtensions__.rrweb={record:fn,version:"v2"},i.rrweb={record:fn,version:"v2"},i.rrwebConsoleRecord={getRecordConsolePlugin:ds},i.getRecordNetworkPlugin=Fs,i.__PosthogExtensions__=i.__PosthogExtensions__||{},i.__PosthogExtensions__.initSessionRecording=t=>new Ye(t)}();
|
|
1
|
+
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var r=null==e?void 0:e.document;null!=e&&e.XMLHttpRequest&&new e.XMLHttpRequest;var i=null!=t?t:{};function n(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(i,s){var o=t.apply(e,r);function a(t){n(o,i,s,a,l,"next",t)}function l(t){n(o,i,s,a,l,"throw",t)}a(void 0)}))}}function o(){return o=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},o.apply(null,arguments)}var a={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},l=Object.prototype,u=l.hasOwnProperty,h=l.toString,d=Array.isArray||function(t){return"[object Array]"===h.call(t)},c=t=>"function"==typeof t,v=t=>t===Object(t)&&!d(t),f=t=>void 0===t,g=t=>"[object String]"==h.call(t),m=t=>null===t,p=t=>f(t)||m(t),I=t=>"[object Number]"==h.call(t)&&t==t,y=t=>"[object Boolean]"===h.call(t),b=t=>t instanceof FormData;function C(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),I(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):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: "+r+", fallback: "+n),C(n||r,e,r,i))}class w{constructor(t){this.$t={},this.zt=t.zt,this.Ut=C(t.bucketSize,0,100,t.Gt),this.Wt=C(t.refillRate,0,this.Ut,t.Gt),this.Xt=C(t.refillInterval,0,864e5,t.Gt)}Jt(t,e){var r=Math.floor((e-t.lastAccess)/this.Xt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Xt)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.$t[i];return n?this.Jt(n,r):this.$t[i]=n={tokens:this.Ut,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.zt)||e.call(this,t)),0===n.tokens)}stop(){this.$t={}}}var S="1.372.7",k="web",A=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,s={C(r){if(t&&(i.POSTHOG_DEBUG||n)&&!f(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];s(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.C("error",...e)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(t){s.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>A(e+" "+t,r)};return s},R=A("[PostHog.js]"),N=R.createLogger;function _(t,e){if(!p(t))if(d(t))t.forEach(e);else if(b(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)u.call(t,r)&&e(t[r],r)}function T(t,e,r,i){var{capture:n=!1,passive:s=!0}={};null==t||t.addEventListener(e,r,{capture:n,passive:s})}var M=["localhost","127.0.0.1"],F=t=>{var e=null==r?void 0:r.createElement("a");return f(e)?null:(e.href=t,e)},x=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return _(t,(function(t,e){f(t)||f(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},B="$session_recording_remote_config",O="$replay_override_sampling",Z="$replay_override_linked_flag",Y="$replay_override_url_trigger",E="$replay_override_event_trigger",G="$session_is_sampled",L="$session_past_minimum_duration",D="$session_recording_url_trigger_activated_session",W="$session_recording_event_trigger_activated_session",V="$posthog_sr_group_event_trigger_",X="$posthog_sr_group_url_trigger_",z="$posthog_sr_group_sampling_",J="$debug_first_full_snapshot_timestamp",K="$stored_person_properties",H="$sdk_debug_replay_remote_trigger_matching_config",j=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})"),U=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})"),P="[SessionRecording]",q="redacted",Q={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},tt=["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"],et=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],rt=["/s/","/e/","/i/"];function it(t,e,r,i){if(p(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return g(n)&&(n=parseInt(n)),n>r?P+" "+i+" body too large to record ("+n+" bytes)":t}function nt(t,e){if(p(t))return t;var r=t;return function(t,e){if(p(t))return!1;if(g(t)){if(t=t.trim(),j.test((t||"").replace(/[- ]/g,"")))return!1;if(U.test(t))return!1}return!0}(r)||(r=P+" "+e+" body "+q),_(et,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=P+" "+e+" body "+q+" as might contain: "+t)})),r}var st="disabled",ot="sampled",at="active",lt="buffering",ut="paused",ht="rrweb_error",dt="trigger",ct=dt+"_activated",vt=dt+"_pending",ft=dt+"_"+st;function gt(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}class mt{constructor(t){this.t=t}triggerStatus(t){var e=this.t.map((e=>e.triggerStatus(t)));return e.includes(ct)?ct:e.includes(vt)?vt:ft}stop(){this.t.forEach((t=>t.stop()))}}class pt{constructor(t){this.t=t}triggerStatus(t){var e=new Set;for(var r of this.t)e.add(r.triggerStatus(t));switch(e.delete(ft),e.size){case 0:return ft;case 1:return Array.from(e)[0];default:return vt}}stop(){this.t.forEach((t=>t.stop()))}}class It{triggerStatus(){return ct}stop(){}}var yt=t=>"sessionRecording"in t;class bt{constructor(t,e){this.u=[],this.Aa=[],this.Ra=new Map,this.Na=new Map,this.Ma="",this.urlBlocked=!1,this._instance=t,this.Fa=e}onConfig(t){var e,r;this.u=(yt(t)?v(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.Aa=(yt(t)?v(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Ba()}Ba(){for(var t of(this.Ra.clear(),this.Na.clear(),this.u))if("regex"===t.matching&&!this.Ra.has(t.url))try{this.Ra.set(t.url,new RegExp(t.url))}catch(e){R.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.Aa)if("regex"===e.matching&&!this.Na.has(e.url))try{this.Na.set(e.url,new RegExp(e.url))}catch(t){R.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}Oa(t){var e;return 0===this.u.length?ft:(null==(e=this._instance)?void 0:e.get_property(this.Fa?X+this.Fa:D))===t?ct:vt}triggerStatus(t){var e=this.Oa(t),r=e===ct?ct:e===vt?vt:ft;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlBlocklist(e,r){if(void 0!==t&&t.location.href){var i=t.location.href;if(i!==this.Ma){this.Ma=i;var n=this.urlBlocked,s=gt(i,this.Aa,this.Na);n&&s||(s&&!n?e():!s&&n&&r())}}}checkUrlTriggerConditions(e,r,i,n){if(void 0!==t&&t.location.href){var s=t.location.href;if(s!==this.Ma){this.Ma=s;var o=this.urlBlocked,a=gt(s,this.Aa,this.Na);a&&!o?e():!a&&o&&r();var l=this.Oa(n)===ct,u=gt(s,this.u,this.Ra);!l&&u&&i("url",s)}}}stop(){this.Ma=""}}class Ct{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Za=()=>{},this._instance=t}triggerStatus(){var t=vt;return p(this.linkedFlag)&&(t=ft),this.linkedFlagSeen&&(t=ct),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(yt(t)?v(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!p(this.linkedFlag)&&!this.linkedFlagSeen){var i=g(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=g(this.linkedFlag)?null:this.linkedFlag.variant;this.Za=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(v(r)&&i in r){var o=r[i];s=y(o)?!0===o:n?o===n:!!o}this.linkedFlagSeen=s,s&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Za()}}class wt{constructor(t,e){this.Ya=[],this._instance=t,this.Fa=e}onConfig(t){var e;this.Ya=(yt(t)?v(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}Ga(t){var e;return 0===this.Ya.length?ft:(null==(e=this._instance)?void 0:e.get_property(this.Fa?V+this.Fa:W))===t?ct:vt}triggerStatus(t){var e=this.Ga(t),r=e===ct?ct:e===vt?vt:ft;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}checkEventTriggerConditions(t,e,r){if(0!==this.Ya.length){var i=this.Ga(r)===ct,n=this.Ya.includes(t);!i&&n&&e("event",t)}}stop(){}}class St{constructor(t,e,r){if(this._instance=t,this.group=e,this.La=new bt(t,e.id),this.Da=new wt(t,e.id),this.Wa=new Ct(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.La.onConfig(n),this.Da.onConfig(n),this.Wa.onConfig(n,r);var s=[this.Da,this.La,this.Wa];this.Va="any"===e.conditions.matchType?new mt(s):new pt(s)}else this.Va=new It}triggerStatus(t){return this.Va.triggerStatus(t)}checkEventTriggerConditions(t,e,r){this.Da.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.La.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?X+this.group.id:V+this.group.id]:e})}stop(){this.La.stop(),this.Da.stop(),this.Wa.stop()}}function kt(t){if(t.rrwebError)return ht;if(!t.receivedFlags)return lt;if(!t.isRecordingEnabled)return st;if(t.urlTriggerMatching.urlBlocked)return ut;var e=!0===t.isSampled,r=new mt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?ot:r===ct?at:r===vt?lt:!1===t.isSampled?st:at}function At(t){if(t.rrwebError)return ht;if(!t.receivedFlags)return lt;if(!t.isRecordingEnabled)return st;if(t.urlTriggerMatching.urlBlocked)return ut;var e=new pt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==ft,i=y(t.isSampled);return r&&e===vt?lt:r&&e===ft||i&&!t.isSampled?st:!0===t.isSampled?ot:at}function Rt(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(v(e)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(e)?"[Circular]":(r.push(e),e)}return e})))?void 0:e.length)||0}function Nt(t){if(m(t))return 4;if(f(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(d(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=f(i)||m(i)?4:Nt(i)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];f(l)||(o||(s+=1),o=!1,s+=a.length+3+Nt(l))}return s;default:return 0}}var _t=Uint8Array,Tt=Uint16Array,Mt=Uint32Array,Ft=new _t([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]),xt=new _t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bt=new _t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ot=function(t,e){for(var r=new Tt(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Mt(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Zt=Ot(Ft,2),Yt=Zt[1];Zt[0][28]=258,Yt[258]=28;for(var Et=Ot(xt,0)[1],Gt=new Tt(32768),Lt=0;32768>Lt;++Lt){var Dt=(43690&Lt)>>>1|(21845&Lt)<<1;Gt[Lt]=((65280&(Dt=(61680&(Dt=(52428&Dt)>>>2|(13107&Dt)<<2))>>>4|(3855&Dt)<<4))>>>8|(255&Dt)<<8)>>>1}var Wt=function(t,e,r){for(var i=t.length,n=0,s=new Tt(e);i>n;++n)++s[t[n]-1];var o,a=new Tt(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Tt(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[Gt[d]>>>l]=u}else for(o=new Tt(i),n=0;i>n;++n)o[n]=Gt[a[t[n]-1]++]>>>15-t[n];return o},Vt=new _t(288);for(Lt=0;144>Lt;++Lt)Vt[Lt]=8;for(Lt=144;256>Lt;++Lt)Vt[Lt]=9;for(Lt=256;280>Lt;++Lt)Vt[Lt]=7;for(Lt=280;288>Lt;++Lt)Vt[Lt]=8;var Xt=new _t(32);for(Lt=0;32>Lt;++Lt)Xt[Lt]=5;var zt=Wt(Vt,9,0),Jt=Wt(Xt,5,0),Kt=function(t){return(t/8>>0)+(7&t&&1)},Ht=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Tt?Tt:t instanceof Mt?Mt:_t)(r-e);return i.set(t.subarray(e,r)),i},jt=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ut=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Pt=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new _t(0),0];if(1==n){var o=new _t(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Tt(c+1),f=qt(r[h-1],v,0);if(f>e){i=0;var g=0,m=f-e,p=1<<m;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var I=s[i].s;if(e>=v[I])break;g+=p-(1<<f-v[I]),v[I]=e}for(g>>>=m;g>0;){var y=s[i].s;e>v[y]?g-=1<<e-v[y]++-1:++i}for(;i>=0&&g;--i){var b=s[i].s;v[b]==e&&(--v[b],++g)}f=e}return[new _t(v),f]},qt=function(t,e,r){return-1==t.s?Math.max(qt(t.l,e,r+1),qt(t.r,e,r+1)):e[t.s]=r},Qt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Tt(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&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(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},$t=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},te=function(t,e,r){var i=r.length,n=Kt(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},ee=function(t,e,r,i,n,s,o,a,l,u,h){jt(e,h++,r),++n[256];for(var d=Pt(n,15),c=d[0],v=d[1],f=Pt(s,15),g=f[0],m=f[1],p=Qt(c),I=p[0],y=p[1],b=Qt(g),C=b[0],w=b[1],S=new Tt(19),k=0;I.length>k;++k)S[31&I[k]]++;for(k=0;C.length>k;++k)S[31&C[k]]++;for(var A=Pt(S,7),R=A[0],N=A[1],_=19;_>4&&!R[Bt[_-1]];--_);var T,M,F,x,B=u+5<<3,O=$t(n,Vt)+$t(s,Xt)+o,Z=$t(n,c)+$t(s,g)+o+14+3*_+$t(S,R)+(2*S[16]+3*S[17]+7*S[18]);if(O>=B&&Z>=B)return te(e,h,t.subarray(l,l+u));if(jt(e,h,1+(O>Z)),h+=2,O>Z){T=Wt(c,v,0),M=c,F=Wt(g,m,0),x=g;var Y=Wt(R,N,0);for(jt(e,h,y-257),jt(e,h+5,w-1),jt(e,h+10,_-4),h+=14,k=0;_>k;++k)jt(e,h+3*k,R[Bt[k]]);h+=3*_;for(var E=[I,C],G=0;2>G;++G){var L=E[G];for(k=0;L.length>k;++k)jt(e,h,Y[D=31&L[k]]),h+=R[D],D>15&&(jt(e,h,L[k]>>>5&127),h+=L[k]>>>12)}}else T=zt,M=Vt,F=Jt,x=Xt;for(k=0;a>k;++k)if(i[k]>255){var D;Ut(e,h,T[257+(D=i[k]>>>18&31)]),h+=M[D+257],D>7&&(jt(e,h,i[k]>>>23&31),h+=Ft[D]);var W=31&i[k];Ut(e,h,F[W]),h+=x[W],W>3&&(Ut(e,h,i[k]>>>5&8191),h+=xt[W])}else Ut(e,h,T[i[k]]),h+=M[i[k]];return Ut(e,h,T[256]),h+M[256]},re=new Mt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ie=function(){for(var t=new Mt(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),ne=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=ie[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},se=function(t,e,r,i,n){return function(t,e,r,i,n,s){var o=t.length,a=new _t(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=te(l,u,t.subarray(h,d)):(l[h]=true,u=te(l,u,t.subarray(h,o)))}else{for(var c=re[e-1],v=c>>>13,f=8191&c,g=(1<<r)-1,m=new Tt(32768),p=new Tt(g+1),I=Math.ceil(r/3),y=2*I,b=function(e){return(t[e]^t[e+1]<<I^t[e+2]<<y)&g},C=new Mt(25e3),w=new Tt(288),S=new Tt(32),k=0,A=0,R=(h=0,0),N=0,_=0;o>h;++h){var T=b(h),M=32767&h,F=p[T];if(m[M]=F,p[T]=M,h>=N){var x=o-h;if((k>7e3||R>24576)&&x>423){u=ee(t,l,0,C,w,S,A,R,_,h-_,u),R=k=A=0,_=h;for(var B=0;286>B;++B)w[B]=0;for(B=0;30>B;++B)S[B]=0}var O=2,Z=0,Y=f,E=M-F&32767;if(x>2&&T==b(h-E))for(var G=Math.min(v,x)-1,L=Math.min(32767,h),D=Math.min(258,x);L>=E&&--Y&&M!=F;){if(t[h+O]==t[h+O-E]){for(var W=0;D>W&&t[h+W]==t[h+W-E];++W);if(W>O){if(O=W,Z=E,W>G)break;var V=Math.min(E,W-2),X=0;for(B=0;V>B;++B){var z=h-E+B+32768&32767,J=z-m[z]+32768&32767;J>X&&(X=J,F=z)}}}E+=(M=F)-(F=m[M])+32768&32767}if(Z){C[R++]=268435456|Yt[O]<<18|Et[Z];var K=31&Yt[O],H=31&Et[Z];A+=Ft[K]+xt[H],++w[257+K],++S[H],N=h+O,++k}else C[R++]=t[h],++w[t[h]]}}u=ee(t,l,true,C,w,S,A,R,_,h-_,u)}return Ht(a,0,i+Kt(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},oe=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ae=function(t,e){var r=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&&oe(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},le=function(t){return 10+(t.filename&&t.filename.length+1||0)};class ue{constructor(t,e){var r,i;void 0===e&&(e={}),this.Xa={},this.za=t=>{if(!this.Xa[t]){var e,r;this.Xa[t]=!0;var i=this.Ja(t);null==(e=(r=this.Ka).onBlockedNode)||e.call(r,t,i)}},this.Ha=t=>{var e=this.Ja(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.Ja=t=>this._rrweb.mirror.getNode(t),this.ja=t=>{var e,r,i,n,s,o,a,l;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.ja(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.Ha(t.id);return!this.do.consumeRateLimit(e)&&t})));var i=this.ja(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.Ka=e,this.do=new w({bucketSize:null!==(r=this.Ka.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.Ka.refillRate)&&void 0!==i?i:10,refillInterval:1e3,zt:this.za,Gt:R})}reset(){this.Xa={}}stop(){this.do.stop(),this.reset()}}var he="$sess_rec_flush_size";class de{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.Ua=t.get_property.bind(t),this.Pa=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=Number(this.Ua(he))||0;this.Pa(he,e+t)}reset(){return this.Pa(he,0)}get currentTrackedSize(){return Number(this.Ua(he))||0}}function ce(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<C(100*e,0,100,R)}var ve=function(t,e){if(!function(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}},fe={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=>ve(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ve(e,t))))),icontains:(t,e)=>e.map(ge).some((e=>t.map(ge).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ge).every((e=>t.map(ge).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},ge=t=>t.toLowerCase(),me=new Set(["is_not","not_icontains","not_regex"]);function pe(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(f(n)||m(n))return me.has(s);var o=fe[s];return!!o&&!f(t.value)&&!m(t.value)&&o(d(t.value)?t.value.map(String):[String(t.value)],d(n)?n.map(String):[String(n)])}))}var Ie=N("[SessionRecording]");class ye{constructor(t,e,r,i,n,s){this.qa=null,this.Qa=At,this._instance=t,this.La=e,this.Da=r,this.Wa=i,this.$a=n,this.tu=s}onRemoteConfig(t){this.qa=I(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.eu=new mt([this.Da,this.La]),this.Qa=kt):(this.eu=new pt([this.Da,this.La]),this.Qa=At),this._instance.register_for_session({[H]:t.triggerMatchType}),this.La.onConfig(t),this.Da.onConfig(t),this.Wa.onConfig(t,((t,e)=>{this.$a("linked_flag_matched",{flag:t,variant:e})}))}getStatus(t){return this.Qa({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return I(r)?r:null}checkUrlTriggers(t,e,r,i){this.La.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.Da.Ya.length&&p(this.ru))return this.ru=t((t=>{try{this.Da.checkEventTriggerConditions(t.event,r,e)}catch(t){Ie.error("Could not activate event trigger",t)}})),this.ru}makeSamplingDecisions(t){var e,r=this.qa;if(I(r)){var i=this._instance.get_property(G),n=i===t||!1!==i&&null,s="string"==typeof i&&i!==t||!y(n),o=s?ce(t,r):n;s&&(o?this.$a("sampled"):Ie.warn("Sample rate ("+r+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[G]:!!o&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(G)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i;null==(t=this._instance.persistence)||t.unregister(W),null==(e=this._instance.persistence)||e.unregister(D),null==(r=this._instance.persistence)||r.unregister(G),null==(i=this._instance.persistence)||i.unregister(L)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.eu)?void 0:e.triggerStatus(t))===vt}stop(){var t;null==(t=this.ru)||t.call(this),this.ru=void 0,this.Da.stop(),this.La.stop(),this.Wa.stop()}}class be{constructor(t,e,r,i){this.iu=[],this.nu=new Map,this.su=!1,this._instance=t,this.La=e,this.$a=r,this.ou=i}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.au(t.triggerGroups),this._instance.register_for_session({[H]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.La.onConfig(t)):Ie.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return ht;if(t.urlTriggerMatching.urlBlocked)return ut;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return st;var i=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if(o===ct){var a=s.group.id,l=r.get(a);f(l)?R.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else o===vt&&(i=!0)}return n?ot:i?lt:st}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.iu,triggerGroupSamplingResults:this.nu,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.iu)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;I(i)&&(m(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.La.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.lu(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t))}),t)};for(var o of this.iu)s(o)}setupEventTriggerListeners(t,e,r){var i=this;return this.ru=t((t=>{var r;if(this.su)return Ie.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.ru)||r.call(this),void(this.ru=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.lu(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),o=i._instance.get_property(K);s.some((e=>!e.properties||0===e.properties.length||pe(e.properties,t.properties,o)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e))}}),e)};for(var s of this.iu)n(s)}catch(t){Ie.error("Could not activate event trigger for trigger groups",t)}})),this.ru}makeSamplingDecisions(t){for(var e of this.iu){var r,i=e.group,n=i.id,s=i.sampleRate,o=z+n,a=this._instance.get_property(o),l=a===t||!1!==a&&null,u="string"==typeof a&&a!==t||!y(l),h=u?ce(t+n,s):l;u&&this.ou("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:h}),this.nu.set(n,h),null==(r=this._instance.persistence)||r.register({[o]:!!h&&t})}this.updateActiveTriggers(t)}onFlushComplete(){this.su=!0}clearConditionalRecordingPersistence(){var t,e;for(var r of(null==(t=this._instance.persistence)||t.unregister(G),null==(e=this._instance.persistence)||e.unregister(L),this.iu)){var i,n,s,o=r.group.id;null==(i=this._instance.persistence)||i.unregister(V+o),null==(n=this._instance.persistence)||n.unregister(X+o),null==(s=this._instance.persistence)||s.unregister(z+o)}}updateActiveTriggers(t){var e=[];for(var r of this.iu){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),o=!0===this.nu.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:o})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.iu)if(e.triggerStatus(t)===vt)return!0;return!1}stop(){var t;null==(t=this.ru)||t.call(this),this.ru=void 0,this.iu.forEach((t=>t.stop())),this.iu=[],this.nu.clear(),this.La.stop()}lu(t,e){var r=t.group.conditions.properties;return!r||0===r.length||pe(r,e,this._instance.get_property(K))}au(t){var e=this;this.iu.forEach((t=>t.stop())),this.iu=[],this.nu.clear();var r=function(t){var r=new St(e._instance,t,((r,i)=>{e.$a("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name})}));e.iu.push(r)};for(var i of t)r(i)}}function Ce(t){return v(t)?t.network_timing:t}var we,Se="[SessionRecording]",ke=N(Se),Ae=[1,2,3,4,5,6,7,12],Re=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Ne(){var t;return null==i||null==(t=i.__PosthogExtensions__)?void 0:t.rrweb}function _e(){var t;return null==(t=Ne())?void 0:t.record}function Te(t){return function(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}(function(t,e){void 0===e&&(e={});var r=ne(),i=t.length;r.p(t);var n=se(t,e,le(e),8),s=n.length;return ae(n,e),oe(n,s-8,r.d()),oe(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new _t(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new _t(n+8+(r-o<<1));a.set(i),i=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Ht(i,0,n)}(JSON.stringify(t))))}function Me(t){return d(t)&&0===t.length?we=null!=we?we:Te([]):Te(t)}function Fe(t,e){return t.type===a.Custom&&t.data.tag===e}function xe(t){return Fe(t,"sessionIdle")}function Be(t){return Fe(t,"$session_ending")}function Oe(t){return Fe(t,"$session_starting")}function Ze(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[Ze({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),Ze({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class Ye{get sessionId(){return this.di}get uu(){if(!this._instance.sessionManager)throw new Error(Se+" must be started with a valid sessionManager.");return this._instance.sessionManager}get hu(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get du(){var t=this._instance.get_property(G);return!0===t?null:!1!==t&&(g(t)?t===this.sessionId:null)}get qa(){var t,e=null==(t=this.ea)?void 0:t.sampleRate;return I(e)?e:null}get cu(){var t,e;return null!==(t=null==(e=this.vu)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t){this.fu="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.gu=void 0,this.mu=Date.now(),this.pu=!1,this.Iu=[],this.yu="unknown",this.bu=!1,this.Cu=!1,this.wu=[],this.Su=void 0,this.ru=void 0,this.ku=void 0,this.Au=void 0,this.Ru=void 0,this.Nu=void 0,this.ti=(t,e,r)=>{var i,n;if(r&&(t!==this.di||e!==this.ci)){var s,o,a=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),l=this.di,u=this.ci;a&&this.ou("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.mu,flushed_size:null==(s=this._u)?void 0:s.currentTrackedSize}),this._u&&this._u.reset(),null==(i=this._instance.persistence)||i.unregister(J),this.Cu=!1,null==(n=Ne())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.ou("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Tu(),!0===this.yu&&(this.yu="unknown",this.stop(),this.start("session_id_changed")),a&&this.ou("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.mu}),I(this.qa)&&p(this.Ru)&&(null==(o=this.vu)||o.makeSamplingDecisions(t))}},this.Mu=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[L])===this.di},this.Fu=()=>{var t,e;if(0===this.T.data.length)return null;var r=null==(t=this.T.data[0])?void 0:t.timestamp,i=null==(e=this.T.data[this.T.data.length-1])?void 0:e.timestamp;return I(r)&&I(i)?i-r:null},this.xu=()=>{var t,e,r=this.cu;if(!I(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Bu;return I(i)&&i>=0&&r>i}if(this.Mu())return!1;var n,s=this.Fu();return!!m(s)||r>s||(null==(n=this._instance.persistence)||n.register({[L]:this.di}),!1)},this.Ou=()=>{this.status!==lt?this.Zu():this.Yu()},this.Eu=()=>{this.ou("browser offline",{})},this.Gu=()=>{this.ou("browser online",{})},this.Lt=()=>{null!=r&&r.visibilityState&&this.ou("window "+r.visibilityState,{})},this._instance=t;var{sessionId:e,windowId:i}=this.uu.checkAndGetSessionAndWindowId();this.di=e,this.ci=i,this.Wa=new Ct(this._instance),this.La=new bt(this._instance),this.Da=new wt(this._instance),this.T=this.Yu(),this.uu.sessionTimeoutMs>this.hu||ke.warn("session_idle_threshold_ms ("+this.hu+") is greater than the session timeout ("+this.uu.sessionTimeoutMs+"). Session will never be detected as idle"),this._u=new de(this._instance)}get Lu(){var t,e,r,i,n,s,o,a=null==(t=this.ea)?void 0:t.masking,l={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},u=null!==(n=null==l?void 0:l.maskAllInputs)&&void 0!==n?n:null==a?void 0:a.maskAllInputs,h=null!==(s=null==l?void 0:l.maskTextSelector)&&void 0!==s?s:null==a?void 0:a.maskTextSelector,d=null!==(o=null==l?void 0:l.blockSelector)&&void 0!==o?o:null==a?void 0:a.blockSelector;return f(u)&&f(h)&&f(d)?void 0:{maskAllInputs:null==u||u,maskTextSelector:h,blockSelector:d}}get Du(){var t,e,r,i,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.ea)?void 0:t.canvasRecording,u=null!==(e=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==i?i:4,d=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 d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:u,fps:C(h,0,12,N("canvas recording fps"),4),quality:C(d,0,1,N("canvas recording quality"),.4)}}get Wu(){var t,e=!(null==(t=this.ea)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Vu(){var t,e,r,i=null==(t=this.ea)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),a=Ce(this._instance.config.capture_performance),l=Ce(null==i?void 0:i.capturePerformance),u=!!(y(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}Xu(){var t,e,r=[],n=null==(t=i.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Wu&&r.push(n());var s,a,l,u,h,d,v,g,m,I,y,b=null==(e=i.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;return this.Vu&&c(b)&&(!M.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(b((h={payloadSizeLimitBytes:Q.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Q.performanceEntryTypeToObserve],payloadHostDenyList:[...(a=this.Vu).payloadHostDenyList||[],...Q.payloadHostDenyList]},d=!1!==(s=this._instance.config).session_recording.recordHeaders&&a.recordHeaders,v=!1!==s.session_recording.recordBody&&a.recordBody,g=!1!==s.capture_performance&&a.recordPerformance,u=Math.min(1e6,null!==(l=h.payloadSizeLimitBytes)&&void 0!==l?l:1e6),m=t=>(null!=t&&t.requestBody&&(t.requestBody=it(t.requestBody,t.requestHeaders,u,"Request")),null!=t&&t.responseBody&&(t.responseBody=it(t.responseBody,t.responseHeaders,u,"Response")),t),I=t=>{return m(((t,e)=>{var r,i=F(t.name),n=0===e.indexOf("http")?null==(r=F(e))?void 0:r.pathname:e;"/"===n&&(n="");var s=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&s&&rt.some((t=>0===s.indexOf(t)))))return t})((p(r=(e=t).requestHeaders)||_(Object.keys(null!=r?r:{}),(t=>{tt.includes(t.toLowerCase())&&(r[t]=q)})),e),s.api_host));var e,r},(y=c(s.session_recording.maskNetworkRequestFn))&&c(s.session_recording.maskCapturedNetworkRequestFn)&&R.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),y&&(s.session_recording.maskCapturedNetworkRequestFn=t=>{var e=s.session_recording.maskNetworkRequestFn({url:t.name});return o({},t,{name:null==e?void 0:e.url})}),h.maskRequestFn=c(s.session_recording.maskCapturedNetworkRequestFn)?t=>{var e,r=I(t);return r&&null!==(e=null==s.session_recording.maskCapturedNetworkRequestFn?void 0:s.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==e?e:void 0}:t=>function(t){if(!f(t))return t.requestBody=nt(t.requestBody,"Request"),t.responseBody=nt(t.responseBody,"Response"),t}(I(t)),o({},Q,h,{recordHeaders:d,recordBody:v,recordPerformance:g,recordInitialRequests:g})))):ke.info("NetworkCapture not started because we are on localhost.")),r}zu(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Ju(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Iu.length?this.Iu.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):ke.warn("could not emit queued rrweb event.",e,t),!1}}ou(t,e){return this.Ju(Re((()=>_e().addCustomEvent(t,e))))}Ku(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=this.zu(e.origin+e.pathname+e.search);this.Hu!==r&&(this.Hu=r,this.ou("$url_changed",{href:r}))}catch(t){}}ju(){if(this.Iu.length){var t=[...this.Iu];this.Iu=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Ju(t)}))}}tu(){return this.Ju(Re((()=>_e().takeFullSnapshot())))}get Uu(){var t,e,r;return null!=(t=this.vu)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)?6e4:null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Pu(){if(this.qu&&clearInterval(this.qu),!0!==this.yu){var t=this.Uu;t&&(this.qu=setInterval((()=>{this.tu()}),t))}}Qu(){this.La.urlBlocked||(this.La.urlBlocked=!0,clearInterval(this.qu),ke.info("recording paused due to URL blocker"),this.ou("recording paused",{reason:"url blocker"}))}$u(){this.La.urlBlocked&&(this.La.urlBlocked=!1,this.tu(),this.Pu(),this.ou("recording resumed",{reason:"left blocked url"}),ke.info("recording resumed"))}th(t,e){var r;if(!this.pu&&null!=(r=this.vu)&&r.hasPendingTriggers(this.sessionId)){this.pu=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?D:W]:this.sessionId}),null==(n=this.vu)||n.updateActiveTriggers(this.sessionId),this.Zu(),this.$a(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.pu=!1}}}get isStarted(){return!!this.gu}get ea(){var t=this._instance.get_property(B);if(t){var e=v(t)?t:JSON.parse(t);if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return ke.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(B))}return e}}eh(t,e,r){this._instance.get_property(t)&&(e(),r())}start(e){var r,i,n=this.ea;if(n){var{sessionId:s,windowId:o}=this.uu.checkAndGetSessionAndWindowId();this.di=s,this.ci=o,null==(r=this._instance.persistence)||r.unregister(J),null!=n&&n.endpoint&&(this.fu=null==n?void 0:n.endpoint),this.vu=2===(null==n?void 0:n.version)&&(null==n?void 0:n.triggerGroups)&&n.triggerGroups.length>0?new be(this._instance,this.La,this.$a.bind(this),this.ou.bind(this)):new ye(this._instance,this.La,this.Da,this.Wa,this.$a.bind(this),this.tu.bind(this)),this.vu.onRemoteConfig(n),null==(i=this.ru)||i.call(this),this.ru=this.vu.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.th(t,e))),this.eh(O,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(O)})),this.eh(Z,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Z)})),this.eh(E,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(E)})),this.eh(Y,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Y)})),this.vu.makeSamplingDecisions(this.sessionId),this.rh(),this.bu||(T(t,"beforeunload",this.Ou),T(t,"offline",this.Eu),T(t,"online",this.Gu),T(t,"visibilitychange",this.Lt),this.ku||(this.ku=this.uu.onSessionId(this.ti)),this.Au||(this.Au=this.uu.on("forcedIdleReset",(()=>{this.Tu(),this.yu="unknown",this.stop(),this.Nu=this.uu.onSessionId(((t,e,r)=>{var i;null==(i=this.Nu)||i.call(this),this.Nu=void 0,this.ti(t,e,r)}))}))),p(this.Su)&&(this.Su=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.zu(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.ou("$pageview",{href:e})}}catch(t){ke.error("Could not add $pageview to rrweb session",t)}}))),this.status===at&&this.$a(e||"recording_initialized"))}else ke.info("remote config must be stored in persistence before recording can start")}ih(){var e,r,i,n,s,o,a,l,u;null==t||t.removeEventListener("beforeunload",this.Ou),null==t||t.removeEventListener("offline",this.Eu),null==t||t.removeEventListener("online",this.Gu),null==t||t.removeEventListener("visibilitychange",this.Lt),clearInterval(this.qu),this.nh(),null==(e=this.Su)||e.call(this),this.Su=void 0,null==(r=this.ru)||r.call(this),this.ru=void 0,null==(i=this.ku)||i.call(this),this.ku=void 0,null==(n=this.Au)||n.call(this),this.Au=void 0,null==(s=this.Ru)||s.call(this),this.Ru=void 0,null==(o=this.Nu)||o.call(this),this.Nu=void 0,null==(a=this.vu)||a.stop(),null==(l=this.sh)||l.stop(),this.Iu=[],null==(u=this.gu)||u.call(this),this.gu=void 0}stop(){this.Zu(),this.Yu(),this.ih(),ke.info("stopped")}discard(){this.Yu(),this.ih(),ke.info("discarded")}onRRwebEmit(t){var e,r,i,n,s,l,u,h;if(this.ju(),t&&v(t)){if(t.type===a.Meta){var d=this.zu(t.data.href);if(this.Hu=d,!d)return;t.data.href=d}else this.Ku();if(null==(e=this.vu)||e.checkUrlTriggers(this.sessionId,(()=>this.Qu()),(()=>this.$u()),((t,e)=>this.th(t,e))),!this.La.urlBlocked||(c=t).type===a.Custom&&"recording paused"===c.data.tag){var c,f,g;t.type===a.FullSnapshot&&(this.Pu(),null==(f=this.sh)||f.reset(),null==(g=this._instance.persistence)||g.register_once({[J]:t.timestamp},void 0)),t.type===a.FullSnapshot&&null!=(r=this.vu)&&r.hasPendingTriggers(this.sessionId)&&this.oh();var m=this.sh?this.sh.throttleMutations(t):t;if(m){var p=function(t){var e=t;if(e&&v(e)&&6===e.type&&v(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]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(m),I=function(t){return Be(t)?t.data.payload:null}(p),y=function(t){return Oe(t)?t.data.payload:null}(p);if(I||y){var b=null!=I?I:y;null!=b&&b.lastActivityTimestamp&&(p.timestamp=b.lastActivityTimestamp)}else this.ah(p);t.type===a.FullSnapshot&&(this.wu.push([this.di,t.timestamp]),this.wu.length>6&&(this.wu=this.wu.slice(-6)));var C=null!==(i=null!==(n=null==I?void 0:I.currentSessionId)&&void 0!==n?n:null==y?void 0:y.nextSessionId)&&void 0!==i?i:this.di,w=null!==(s=null!==(l=null==I?void 0:I.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==s?s:this.ci;if(!0!==this.yu||function(t){return xe(t)||Be(t)||Oe(t)}(p)){if(xe(p)){var S=p.data.payload;S&&(p.timestamp=S.lastActivityTimestamp+S.threshold)}var{event:k,size:A}=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u?function(t){try{if(t.type===a.FullSnapshot){var e=o({},t,{data:Te(t.data),cv:"2024-10"});return{event:e,size:Nt(e)}}if(t.type===a.IncrementalSnapshot&&0===t.data.source){var r=o({},t,{cv:"2024-10",data:o({},t.data,{texts:Me(t.data.texts),attributes:Me(t.data.attributes),removes:Me(t.data.removes),adds:Me(t.data.adds)})});return{event:r,size:Nt(r)}}if(t.type===a.IncrementalSnapshot&&8===t.data.source){var i=o({},t,{cv:"2024-10",data:o({},t.data,{adds:t.data.adds?Te(t.data.adds):void 0,removes:t.data.removes?Te(t.data.removes):void 0})});return{event:i,size:Nt(i)}}}catch(t){ke.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Rt(t)}}(p):{event:p,size:Rt(p)},R={$snapshot_bytes:A,$snapshot_data:k,$session_id:C,$window_id:w};p.type===a.FullSnapshot&&null!=(h=Ne())&&null!=h.wasMaxDepthReached&&h.wasMaxDepthReached()&&(this.Cu=!0),this.status!==st?this.lh(R):this.Yu()}}}}}get status(){return this.vu?this.vu.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.du,rrwebError:this.bu,urlTriggerMatching:this.La,eventTriggerMatching:this.Da,linkedFlagMatching:this.Wa,remoteConfig:this.ea}):st}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.Wa.linkedFlagSeen=!0,this.tu(),this.$a("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[G]:this.sessionId}),this.tu(),this.$a("sampling_overridden")}overrideTrigger(t){this.th(t)}nh(){this.uh&&(clearTimeout(this.uh),this.uh=void 0)}Zu(){this.nh();var t,e=this.xu();return this.status===lt||this.status===ut||this.status===st||e?(this.uh=setTimeout((()=>{this.Zu()}),2e3),this.T):(this.T.data.length>0&&(Ze(this.T).forEach((t=>{var e;null==(e=this._u)||e.trackSize(t.size),this.hh({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:k,$lib_version:S})})),null==(t=this.vu)||t.onFlushComplete()),this.Yu())}lh(t){var e,r=2+((null==(e=this.T)?void 0:e.data.length)||0),i=t.$session_id;this.yu||943718.4>=this.T.size+t.$snapshot_bytes+r&&this.T.sessionId===i||(this.T=this.Zu(),this.T.sessionId=i,this.T.windowId=t.$window_id),this.T.size+=t.$snapshot_bytes,this.T.data.push(t.$snapshot_data),this.T.sizes.push(t.$snapshot_bytes),this.uh||this.yu||(this.uh=setTimeout((()=>{this.Zu()}),2e3))}hh(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.fu),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Bu(){var t,e,r=null==(t=this.T)?void 0:t.data[(null==(e=this.T)?void 0:e.data.length)-1],{sessionStartTimestamp:i}=this.uu.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}oh(){if(!this.T||0===this.T.data.length)return this.Yu();for(var t=-1,e=this.T.data.length-1;e>=0;e--)if(this.T.data[e].type===a.Meta){t=e;break}return 0>t?this.Yu():(this.T.data=this.T.data.slice(t),this.T.sizes=this.T.sizes.slice(t),this.T.size=this.T.sizes.reduce(((t,e)=>t+e),0),this.T)}Yu(){return this.T={size:0,data:[],sizes:[],sessionId:this.di,windowId:this.ci},this.T}$a(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),ke.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.ou("$recording_started",o({reason:t},e))}dh(t){var e;return 3===t.type&&-1!==Ae.indexOf(null==(e=t.data)?void 0:e.source)}ah(t){var e=this.dh(t);e||this.yu||t.timestamp-this.mu>this.hu&&(this.yu=!0,clearInterval(this.qu),this.ou("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.mu,threshold:this.hu,bufferLength:this.T.data.length,bufferSize:this.T.size}),this.Zu());var r=!1;if(e&&(this.mu=t.timestamp,this.yu)){var i="unknown"===this.yu;this.yu=!1,i||(this.ou("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.yu){var{windowId:n,sessionId:s}=this.uu.checkAndGetSessionAndWindowId(!e,t.timestamp),o=this.di!==s,a=this.ci!==n;this.ci=n,this.di=s,o||a?(this.stop(),this.start("session_id_changed")):r&&this.Pu()}}Tu(){var t;null==(t=this.vu)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.uu.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.T.data.length,$sdk_debug_replay_internal_buffer_size:this.T.size,$sdk_debug_current_session_duration:this.Bu,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this._u)?void 0:t.currentTrackedSize,$sdk_debug_replay_full_snapshots:this.wu,$snapshot_max_depth_exceeded:this.Cu,$sdk_debug_replay_rrweb_error:this.bu}}rh(){var t;if(!this.gu){var e,r,i,n={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,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this._instance.config.session_recording;for(var[a,l]of Object.entries(s||{}))a in n&&("maskInputOptions"===a?n.maskInputOptions=o({password:!0},l):n[a]=l);this.Du&&this.Du.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.Du.fps},n.dataURLOptions={type:"image/webp",quality:this.Du.quality}),this.Lu&&(n.maskAllInputs=null===(e=this.Lu.maskAllInputs)||void 0===e||e,n.maskTextSelector=null!==(r=this.Lu.maskTextSelector)&&void 0!==r?r:void 0,n.blockSelector=null!==(i=this.Lu.blockSelector)&&void 0!==i?i:void 0);var u=_e();if(u){this.sh=null!==(t=this.sh)&&void 0!==t?t:new ue(u,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";ke.info(r,{node:e}),this.log(Se+" "+r,"warn")}});var h=this.Xu();if(this.gu=u(o({emit:t=>{this.onRRwebEmit(t)},plugins:h},n)),!this.gu)return this.bu=!0,void ke.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.bu=!1,this.mu=Date.now(),this.yu=y(this.yu)?this.yu:"unknown",this.tryAddCustomEvent("$remote_config_received",this.ea),this.ou("$session_options",{sessionRecordingOptions:n,activePlugins:h.map((t=>null==t?void 0:t.name))}),this.ou("$posthog_config",{config:this._instance.config})}else ke.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.ou(t,e)}}var Ee,Ge=["type"],Le=Object.defineProperty,De=(t,e,r)=>((t,e,r)=>e in t?Le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),We=Object.defineProperty,Ve=(t,e,r)=>((t,e,r)=>e in t?We(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Xe=(t=>(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))(Xe||{}),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Je={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ke={};function He(t){if(Ke[t])return Ke[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in ze?ze[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Je?Je[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Ke[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ke[t]=u:e.prototype}catch(t){return e.prototype}}var je={};function Ue(t,e,r){var i,n=t+"."+String(r);if(je[n])return je[n].call(e);var s=He(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(je[n]=o,o.call(e)):e[r]}var Pe={};function qe(t,e,r){var i=t+"."+String(r);if(Pe[i])return Pe[i].bind(e);var n=He(t)[r];return"function"!=typeof n?e[r]:(Pe[i]=n,n.bind(e))}var Qe={childNodes:t=>Ue("Node",t,"childNodes"),parentNode:t=>Ue("Node",t,"parentNode"),parentElement:t=>Ue("Node",t,"parentElement"),textContent:t=>Ue("Node",t,"textContent"),contains:(t,e)=>qe("Node",t,"contains")(e),getRootNode:t=>qe("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Ue("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Ue("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Ue("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Ue("Element",t,"querySelectorAll")(e),mutationObserver:()=>He("MutationObserver").constructor};function $e(t){return t.nodeType===t.ELEMENT_NODE}function tr(t){var e=t&&"host"in t&&"mode"in t&&Qe.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Qe.shadowRoot(e)===t)}function er(t){return"[object ShadowRoot]"==={}.toString.call(t)}function rr(t){try{var e=t.rules||t.cssRules;return e?((r=Array.from(e,(e=>ir(e,t.href))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r):null}catch(t){return null}var r}function ir(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=rr(t.styleSheet)||function(t){var{cssText:e}=t;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?gr(r,t.styleSheet.href):r}var i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?gr(i,e):i}function nr(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let sr=class{constructor(){Ve(this,"idNodeMap",new Map),Ve(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function or(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",l=n&&ar(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,e):"*".repeat(a.length)),a}function ar(t){return t.toLowerCase()}var lr="__rrweb_original__";function ur(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ar(e):null}function hr(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var dr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,cr=/^(?:[a-z+]+:)?\/\//i,vr=/^www\..*/i,fr=/^(data:)([^,]*),(.*)/i;function gr(t,e){return(t||"").replace(dr,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(cr.test(l)||vr.test(l))return"url("+u+l+u+")";if(fr.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var mr,pr,Ir=1,yr=new RegExp("[^a-z0-9-_:]"),br=-2;function Cr(){return Ir++}var wr=/^[^ \t\n\r\u000c]+/,Sr=/^[, \t\n\r\u000c]+/,kr=new WeakMap;function Ar(t,e){return e&&""!==e.trim()?Rr(t,e):e}function Rr(t,e){var r=kr.get(t);if(r||(r=t.createElement("a"),kr.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Nr(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Ar(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Sr),e.length>r;){var s=i(wr);if(","===s.slice(-1))s=Ar(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Ar(t,s);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?gr(i,Rr(t)):"object"===e&&"data"===r?Ar(t,i):i:Ar(t,i):i}function _r(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function Tr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Tr(Qe.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Tr(Qe.parentNode(t),e,r)}function Mr(t,e,r,i){var n;if($e(t)){if(!Qe.childNodes(n=t).length)return!1}else{if(null===Qe.parentElement(t))return!1;n=Qe.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(Tr(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function Fr(t){return null==t?"":t.toLowerCase()}function xr(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=(()=>!1),newlyAddedElement:S=!1}=e,{needsMask:k}=e,{preserveWhiteSpace:A=!0}=e;k||(k=Mr(t,o,a,void 0===k));var R,N=function(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:g=!1}=e,m=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Xe.Document,childNodes:[],compatMode:t.compatMode}:{type:Xe.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Xe.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:h,recordCanvas:d,keepIframeSrcFn:c,newlyAddedElement:v=!1,rootId:f}=e,g=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=ar(t.tagName);return yr.test(e)?"div":e}(t),p={},I=t.attributes.length,y=0;I>y;y++){var b=t.attributes[y];_r(m,b.name)||(p[b.name]=Nr(i,m,ar(b.name),b.value))}if("link"===m&&o){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=nr(i,C);!w&&C.includes(".css")&&(w=nr(i,window.location.origin+"/"+C.replace(window.location.href,"")));var S=null;w&&(S=rr(w)),S&&(delete p.rel,delete p.href,p._cssText=S)}}if("style"===m&&t.sheet&&!(t.innerText||Qe.textContent(t)||"").trim().length){var k=rr(t.sheet);k&&(p._cssText=k)}if("input"===m||"textarea"===m||"select"===m){var A=t.value,R=t.checked;"radio"!==p.type&&"checkbox"!==p.type&&"submit"!==p.type&&"button"!==p.type&&A?p.value=or({element:t,type:ur(t),tagName:m,value:A,maskInputOptions:a,maskInputFn:l}):R&&(p.checked=R)}if("option"===m&&(t.selected&&!a.select?p.selected=!0:delete p.selected),"dialog"===m&&t.open)try{p.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){p.rr_open_mode="modal",p.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((lr in n?n[lr]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(p.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var N=t.toDataURL(u.type,u.quality),_=i.createElement("canvas");_.width=t.width,_.height=t.height,N!==_.toDataURL(u.type,u.quality)&&(p.rr_dataURL=N)}if("img"===m&&h){mr||(mr=i.createElement("canvas"),pr=mr.getContext("2d"));var T=t,M=T.currentSrc||T.getAttribute("src")||"<unknown-src>",F=T.crossOrigin,x=()=>{T.removeEventListener("load",x);try{mr.width=T.naturalWidth,mr.height=T.naturalHeight,pr.drawImage(T,0,0),p.rr_dataURL=mr.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==T.crossOrigin)return T.crossOrigin="anonymous",void(T.complete&&0!==T.naturalWidth?x():T.addEventListener("load",x));console.warn("Cannot inline img src="+M+"! Error: "+t)}"anonymous"===T.crossOrigin&&(F?p.crossOrigin=F:T.removeAttribute("crossorigin"))};T.complete&&0!==T.naturalWidth?x():T.addEventListener("load",x)}if("audio"===m||"video"===m){var B=p;B.rr_mediaState=t.paused?"paused":"played",B.rr_mediaCurrentTime=t.currentTime,B.rr_mediaPlaybackRate=t.playbackRate,B.rr_mediaMuted=t.muted,B.rr_mediaLoop=t.loop,B.rr_mediaVolume=t.volume}if(v||(t.scrollLeft&&(p.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(p.rr_scrollTop=t.scrollTop)),g){var{width:O,height:Z}=t.getBoundingClientRect();p={class:p.class,rr_width:O+"px",rr_height:Z+"px"}}"iframe"!==m||c(p.src)||(t.contentDocument||(p.rr_src=p.src),delete p.src);try{customElements.get(m)&&(r=!0)}catch(t){}return{type:Xe.Element,tagName:m,attributes:p,childNodes:[],isSVG:(Y=t,Boolean("svg"===Y.tagName||Y.ownerSVGElement)||void 0),needBlock:g,rootId:f,isCustom:r};var Y}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:d,inlineImages:c,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=Qe.parentNode(t),a=o&&o.tagName,l=Qe.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=rr(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=gr(l,Rr(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,Qe.parentElement(t)):l.replace(/[\S]/g,"*")),{type:Xe.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:Xe.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:Xe.Comment,textContent:Qe.textContent(t)||"",rootId:m};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:k,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:w,newlyAddedElement:S});if(!N)return console.warn(t,"not serialized"),null;R=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===Xe.Comment)return!0;if(t.type===Xe.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===hr(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Fr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Fr(t.attributes.name)||"icon"===Fr(t.attributes.rel)||"apple-touch-icon"===Fr(t.attributes.rel)||"shortcut icon"===Fr(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Fr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Fr(t.attributes.property).match(/^(og|twitter|fb):/)||Fr(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Fr(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===Fr(t.attributes.name)||"googlebot"===Fr(t.attributes.name)||"bingbot"===Fr(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===Fr(t.attributes.name)||"generator"===Fr(t.attributes.name)||"framework"===Fr(t.attributes.name)||"publisher"===Fr(t.attributes.name)||"progid"===Fr(t.attributes.name)||Fr(t.attributes.property).match(/^article:/)||Fr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===Fr(t.attributes.name)||"yandex-verification"===Fr(t.attributes.name)||"csrf-token"===Fr(t.attributes.name)||"p:domain_verify"===Fr(t.attributes.name)||"verify-v1"===Fr(t.attributes.name)||"verification"===Fr(t.attributes.name)||"shopify-checkout-api-token"===Fr(t.attributes.name)))return!0}}return!1}(N,v)&&(A||N.type!==Xe.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?Cr():br;var _=Object.assign(N,{id:R});if(i.add(t,_),R===br)return null;p&&p(t);var T=!l;if(_.type===Xe.Element){T=T&&!_.needBlock,delete _.needBlock;var M=Qe.shadowRoot(t);M&&er(M)&&(_.isShadowHost=!0)}if((_.type===Xe.Document||_.type===Xe.Element)&&T){v.headWhitespace&&_.type===Xe.Element&&"head"===_.tagName&&(A=!1);var F={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:A,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w};if(_.type===Xe.Element&&"textarea"===_.tagName&&void 0!==_.attributes.value);else for(var x of Array.from(Qe.childNodes(t))){var B=xr(x,F);B&&_.childNodes.push(B)}var O=null;if($e(t)&&(O=Qe.shadowRoot(t)))for(var Z of Array.from(Qe.childNodes(O))){var Y=xr(Z,F);Y&&(er(O)&&(Y.isShadow=!0),_.childNodes.push(Y))}}var E=Qe.parentNode(t);return E&&tr(E)&&er(E)&&(_.isShadow=!0),_.type===Xe.Element&&"iframe"===_.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=xr(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:A,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});r&&I(t,r)}}),y),_.type===Xe.Element&&"link"===_.tagName&&"string"==typeof _.attributes.rel&&("stylesheet"===_.attributes.rel||"preload"===_.attributes.rel&&"string"==typeof _.attributes.href&&"css"===hr(_.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(b){var e=xr(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:k,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:f,inlineImages:g,recordCanvas:m,preserveWhiteSpace:A,onSerialize:p,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});e&&b(t,e)}}),C),_}let Br=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;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"}};var Or={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Zr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Yr={};function Er(t){if(Yr[t])return Yr[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Or?Or[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Zr?Zr[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Yr[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Yr[t]=u:r}catch(t){return r}}var Gr={};function Lr(t,e,r){var i,n=t+"."+String(r);if(Gr[n])return Gr[n].call(e);var s=Er(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Gr[n]=o,o.call(e)):e[r]}var Dr={};function Wr(t,e,r){var i=t+"."+String(r);if(Dr[i])return Dr[i].bind(e);var n=Er(t)[r];return"function"!=typeof n?e[r]:(Dr[i]=n,n.bind(e))}function Vr(){return Er("MutationObserver").constructor}var Xr={childNodes:t=>Lr("Node",t,"childNodes"),parentNode:t=>Lr("Node",t,"parentNode"),parentElement:t=>Lr("Node",t,"parentElement"),textContent:t=>Lr("Node",t,"textContent"),contains:(t,e)=>Wr("Node",t,"contains")(e),getRootNode:t=>Wr("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Lr("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Lr("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Lr("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Lr("Element",t,"querySelectorAll")(e),mutationObserver:Vr};function zr(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var Jr="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.",Kr={map:{},getId(){return console.error(Jr),-1},getNode(){return console.error(Jr),null},removeNodeFromMap(){console.error(Jr)},has(){return console.error(Jr),!1},reset(){console.error(Jr)}};function Hr(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function jr(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>jr(t,e,s||{},!0)}function Ur(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Kr=new Proxy(Kr,{get(t,e,r){return"map"===e&&console.error(Jr),Reflect.get(t,e,r)}}));var Pr=Date.now;function qr(t){var e,r,i,n,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=Xr.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.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=Xr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Qr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $r(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ti(t){return t?t.nodeType===t.ELEMENT_NODE?t:Xr.parentElement(t):null}function ei(t,e,r,i){if(!t)return!1;var n=ti(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Tr(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function ri(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===br}function ii(t,e){if(tr(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=Xr.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||ii(i,e))}function ni(t){return Boolean(t.changedTouches)}function si(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function oi(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function ai(t){return!!t&&(t instanceof Br&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Xr.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Pr=()=>(new Date).getTime());let li=class{constructor(){De(this,"id",1),De(this,"styleIDMap",new WeakMap),De(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 ui(t){var e,r=null;return"getRootNode"in t&&(null==(e=Xr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Xr.host(Xr.getRootNode(t))&&(r=Xr.host(Xr.getRootNode(t))),r}function hi(t){var e=t.ownerDocument;return!!e&&(Xr.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=ui(r);)r=e;return r}(t);return Xr.contains(e,r)}(t))}var di=(t=>(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))(di||{}),ci=(t=>(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))(ci||{}),vi=(t=>(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))(vi||{}),fi=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(fi||{}),gi=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(gi||{}),mi=(t=>(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))(mi||{});function pi(t){return"__ln"in t}class Ii{constructor(){De(this,"length",0),De(this,"head",null),De(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&pi(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&pi(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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){var 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--)}}var yi,bi=(t,e)=>t+"@"+e;class Ci{constructor(){De(this,"frozen",!1),De(this,"locked",!1),De(this,"texts",[]),De(this,"attributes",[]),De(this,"attributeMap",new WeakMap),De(this,"removes",[]),De(this,"mapRemoves",[]),De(this,"movedMap",{}),De(this,"addedSet",new Set),De(this,"movedSet",new Set),De(this,"droppedSet",new Set),De(this,"mutationCb"),De(this,"blockClass"),De(this,"blockSelector"),De(this,"maskTextClass"),De(this,"maskTextSelector"),De(this,"inlineStylesheet"),De(this,"maskInputOptions"),De(this,"maskTextFn"),De(this,"maskInputFn"),De(this,"keepIframeSrcFn"),De(this,"recordCanvas"),De(this,"inlineImages"),De(this,"slimDOMOptions"),De(this,"dataURLOptions"),De(this,"doc"),De(this,"mirror"),De(this,"iframeManager"),De(this,"stylesheetManager"),De(this,"shadowDomManager"),De(this,"canvasManager"),De(this,"processedNodeManager"),De(this,"unattachedDoc"),De(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),De(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ii,i=t=>{for(var e=t,r=br;r===br;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=Xr.parentNode(n);if(s&&hi(n)&&"TEXTAREA"!==s.tagName){var o=tr(s)?this.mirror.getId(ui(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=xr(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{si(t,this.mirror)&&this.iframeManager.addIframe(t),oi(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),ai(n)&&this.shadowDomManager.addShadowRoot(Xr.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Si(this.removes,s,this.mirror)&&!this.movedSet.has(Xr.parentNode(s))||n(s);for(var o of this.addedSet)ki(this.droppedSet,o)||Si(this.removes,o,this.mirror)?ki(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(Xr.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(Xr.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=Xr.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=Xr.host(f);if(-1!==this.mirror.getId(g)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=Xr.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}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};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),De(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e)),e.attributes.value=Array.from(Xr.childNodes(t),(t=>Xr.textContent(t)||"")).join("")})),De(this,"processMutation",(t=>{if(!ri(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Xr.textContent(t.target);ei(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Mr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,ti(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=ur(r);n=or({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(ei(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!_r(r.tagName,i))if(o.attributes[i]=Nr(this.doc,ar(r.tagName),ar(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(ei(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=>{var r=this.mirror.getId(e),i=tr(t.target)?this.mirror.getId(Xr.host(t.target)):this.mirror.getId(t.target);ei(t.target,this.blockClass,this.blockSelector,!1)||ri(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(wi(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||ii(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[bi(r,i)]?wi(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!tr(t.target)||!er(t.target))||void 0})),this.mapRemoves.push(e))}))}})),De(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ri(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[bi(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ei(t,this.blockClass,this.blockSelector,!1)||(Xr.childNodes(t).forEach((t=>this.genAdds(t))),ai(t)&&Xr.childNodes(Xr.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function wi(t,e){t.delete(e),Xr.childNodes(e).forEach((e=>wi(t,e)))}function Si(t,e,r){return 0!==t.length&&function(t,e,r){for(var i,n=Xr.parentNode(e),s=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=Xr.parentNode(n)};n;)if(i=s())return i.v;return!1}(t,e,r)}function ki(t,e){return 0!==t.size&&Ai(t,e)}function Ai(t,e){var r=Xr.parentNode(e);return!!r&&(!!t.has(r)||Ai(t,r))}var Ri=t=>yi?function(){try{return t(...arguments)}catch(t){if(yi&&!0===yi(t))return;throw t}}:t,Ni=[];function _i(t){try{if("composedPath"in t){var 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 Ti(t,e){var r=new Ci;Ni.push(r),r.init(t);var i=new(Vr())(Ri(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Mi(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return zr("scroll",Ri(Hr(Ri((t=>{var o=_i(t);if(o&&!ei(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=qr(r.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var Fi=["INPUT","TEXTAREA","SELECT"],xi=new WeakMap;function Bi(t){return function(t,e){if(Ei("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Ei("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Ei("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Ei("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function Oi(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Zi(t,e){var r,i,n,s,{mirror:o,stylesheetManager:a}=t;s=o.getId("#document"===e.nodeName?e:Xr.host(e));var l="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r=null==(e=u.set)?void 0:e.call(this,t);if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),Ri((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function Yi(t,e){void 0===e&&(e={});var r,i=t.doc.defaultView;if(!i)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:c,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(r=Ti(t,t.doc));var n=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=Hr(Ri((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),h=Ri(Hr(Ri((t=>{var e=_i(t),{clientX:r,clientY:i}=ni(t)?t.changedTouches[0]:t;s||(s=Pr()),l.push({x:r,y:i,id:n.getId(e),timeOffset:Pr()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?ci.Drag:t instanceof MouseEvent?ci.MouseMove:ci.TouchMove)})),o,{trailing:!1})),d=[zr("mousemove",h,i),zr("touchmove",h,i),zr("drag",h,i)];return Ri((()=>{d.forEach((t=>t()))}))}(t),s=function(t){var{mouseInteractionCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(vi).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=ar(t),l=(t=>r=>{var a=_i(r);if(!ei(a,n,s,!0)){var l=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":l=fi.Mouse;break;case"touch":l=fi.Touch;break;case"pen":l=fi.Pen}l===fi.Touch&&(vi[t]===vi.MouseDown?u="TouchStart":vi[t]===vi.MouseUp&&(u="TouchEnd"))}else ni(r)&&(l=fi.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===fi.Touch||u.startsWith("Mouse")&&l===fi.Mouse)&&(l=null)):vi[t]===vi.Click&&(l=h,h=null);var d=ni(r)?r.changedTouches[0]:r;if(d){var c=i.getId(a),{clientX:v,clientY:f}=d;Ri(e)(o({type:vi[u],id:c,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(vi[t]){case vi.MouseDown:case vi.MouseUp:a=a.replace("mouse","pointer");break;case vi.TouchStart:case vi.TouchEnd:return}u.push(zr(a,l,r))})),Ri((()=>{u.forEach((t=>t()))}))}(t),a=Mi(t),l=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return zr("resize",Ri(Hr(Ri((()=>{var t=Qr(),e=$r();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:i}),u=function(t){var{inputCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:d,userTriggeredOnInput:c}=t;function v(t){var e=_i(t),i=t.isTrusted,o=e&&e.tagName;if(e&&"OPTION"===o&&(e=Xr.parentElement(e)),e&&o&&Fi.indexOf(o)>=0&&!ei(e,n,s,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var d=e.value,v=!1,g=ur(e)||"";"radio"===g||"checkbox"===g?v=e.checked:(u[o.toLowerCase()]||u[g])&&(d=or({element:e,maskInputOptions:u,tagName:o,type:g,value:d,maskInputFn:h})),f(e,c?{text:d,isChecked:v,userTriggered:i}:{text:d,isChecked:v});var m=e.name;"radio"===g&&m&&v&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,c?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,r){var n=xi.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){xi.set(t,r);var s=i.getId(t);Ri(e)(o({},r,{id:s}))}}var g=("last"===d.input?["change"]:["input","change"]).map((t=>zr(t,Ri(v),r))),m=r.defaultView;if(!m)return()=>{g.forEach((t=>t()))};var p=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value");return p&&p.set&&g.push(...[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]].map((t=>jr(t[0],t[1],{set(){Ri(v)({target:this,isTrusted:!1})}},!1,m)))),Ri((()=>{g.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=Ri((t=>Hr(Ri((s=>{var o=_i(s);if(o&&!ei(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:d}=o;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[zr("play",a(mi.Play),o),zr("pause",a(mi.Pause),o),zr("seeked",a(mi.Seeked),o),zr("volumechange",a(mi.VolumeChange),o),zr("ratechange",a(mi.RateChange),o)];return Ri((()=>{l.forEach((t=>t()))}))}(t),d=()=>{},c=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(d=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ri(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=Oi(e,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),t.apply(e,s)}))}));var h={};Gi("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Gi("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Gi("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Gi("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var[e,s]=t;d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Ri(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=Oi(e.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...Bi(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Ri(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=Oi(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...Bi(e),o]}]}),t.apply(e,s)}))})})),Ri((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:i}),c=Zi(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ri(((t,e,o)=>{var l,[u,h,d]=o;if(n.has(u))return a.apply(e,[u,h,d]);var{id:c,styleId:v}=Oi(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||v&&-1!==v)&&r({id:c,styleId:v,set:{property:u,value:h,priority:d},index:Bi(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ri(((t,e,o)=>{var a,[u]=o;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:d}=Oi(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||d&&-1!==d)&&r({id:h,styleId:d,remove:{property:u},index:Bi(e.parentRule)}),t.apply(e,o)}))}),Ri((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:i}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=Ur(r.fonts,"add",(function(t){return function(r){return setTimeout(Ri((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ri((()=>{n.forEach((t=>t()))}))}(t)));var g=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=Ri((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),{startContainer:d,startOffset:c,endContainer:v,endOffset:f}=h;ei(d,i,n,!0)||ei(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),zr("selectionchange",a)}(t),m=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?Ur(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),p=[];for(var I of t.plugins)p.push(I.observer(I.callback,i,I.options));return Ri((()=>{Ni.forEach((t=>t.reset())),null==r||r.disconnect(),n(),s(),a(),l(),u(),h(),d(),c(),v(),f(),g(),m(),p.forEach((t=>t()))}))}function Ei(t){return void 0!==window[t]}function Gi(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Li{constructor(t){De(this,"iframeIdToRemoteIdMap",new WeakMap),De(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class Di{constructor(t){De(this,"iframes",new WeakMap),De(this,"crossOriginIframeMap",new WeakMap),De(this,"crossOriginIframeMirror",new Li(Cr)),De(this,"crossOriginIframeStyleMirror"),De(this,"crossOriginIframeRootIdMap",new WeakMap),De(this,"mirror"),De(this,"mutationCb"),De(this,"wrappedEmit"),De(this,"loadListener"),De(this,"stylesheetManager"),De(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Li(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.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){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case di.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:di.IncrementalSnapshot,data:{source:ci.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case di.Meta:case di.Load:case di.DomContentLoaded:return!1;case di.Plugin:return e;case di.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case di.IncrementalSnapshot:switch(e.data.source){case ci.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 ci.Drag:case ci.TouchMove:case ci.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case ci.ViewportResize:return!1;case ci.MediaInteraction:case ci.MouseInteraction:case ci.Scroll:case ci.CanvasMutation:case ci.Input:return this.replaceIds(e.data,t,["id"]),e;case ci.StyleSheetRule:case ci.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ci.Font:return e;case ci.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case ci.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===Xe.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Wi{constructor(t){De(this,"shadowDoms",new WeakSet),De(this,"mutationCb"),De(this,"scrollCb"),De(this,"bypassOptions"),De(this,"mirror"),De(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){if(er(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=Ti(o({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Mi(o({},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(Xr.host(t))),this.restoreHandlers.push(Zi({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){var r=this;this.restoreHandlers.push(Ur(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=Xr.shadowRoot(this);return s&&hi(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Vi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),zi=0;64>zi;zi++)Xi[Vi.charCodeAt(zi)]=zi;var Ji=new Map,Ki=(t,e,r)=>{if(t&&(Ui(t,e)||"object"==typeof t)){var i=function(t,e){var r=Ji.get(t);return r||Ji.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Hi(t,e,r){if(t instanceof Array)return t.map((t=>Hi(t,e,r)));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:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Vi[r[e]>>2],n+=Vi[(3&r[e])<<4|r[e+1]>>4],n+=Vi[(15&r[e+1])<<2|r[e+2]>>6],n+=Vi[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Hi(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL()}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Hi(t.data,e,r),t.width,t.height]}:Ui(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ki(t,e,r)}:t}var ji=(t,e,r)=>t.map((t=>Hi(t,e,r))),Ui=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Pi(t,e,r,i){var n=[];try{var s=Ur(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!ei(this,e,r,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function qi(t,e,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=Ur(t,a,(function(t){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var h=t.apply(this,l);if(Ki(h,s,this),"tagName"in this.canvas&&!ei(this.canvas,i,n,!0)){var d=ji(l,s,this);r(this.canvas,{type:e,property:a,args:d})}return h}}));o.push(l)}catch(i){var u=jr(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var Qi,$i,tn,en,rn="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",nn="undefined"!=typeof window&&window.Blob&&new Blob([(Qi=rn,Uint8Array.from(atob(Qi),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function sn(t){var e;try{if(!(e=nn&&(window.URL||window.webkitURL).createObjectURL(nn)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+rn,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class on{constructor(t){De(this,"pendingCanvasMutations",new Map),De(this,"rafStamps",{latestId:0,invokeId:null}),De(this,"mirror"),De(this,"mutationCb"),De(this,"resetObservers"),De(this,"frozen",!1),De(this,"locked",!1),De(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)}));var{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,i,n){var o=this,a=Pi(e,r,i,!0),l=new Map,u=new sn;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:gi["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,d=1e3/t,c=0,v=t=>{var a,f;c&&d>t-c||(c=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{ei(t,r,i,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(e.document),a).forEach(function(){var t=s((function*(t){var e,r=o.mirror.getId(t);if(!l.get(r)&&0!==t.width&&0!==t.height){if(l.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var s=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:s,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:s,height:a,dataURLOptions:n.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}())),h=requestAnimationFrame(v)};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Pi(t,e,r,!1),n=function(t,e,r,i){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=Ur(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return ei(this.canvas,r,i,!0)||setTimeout((()=>{var r=ji(a,e,this);t(this.canvas,{type:gi["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=jr(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:gi["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),s=function(t,e,r,i){var n=[];return n.push(...qi(e.WebGLRenderingContext.prototype,gi.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...qi(e.WebGL2RenderingContext.prototype,gi.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Ge);return e})),{type:n}=r[0];this.mutationCb({id:e,type:n,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class an{constructor(t){De(this,"trackedLinkElements",new WeakSet),De(this,"mutationCb"),De(this,"adoptedStyleSheetCb"),De(this,"styleMirror",new li),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ir(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class ln{constructor(){De(this,"nodeMap",new WeakMap),De(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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(){}}var un=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var hn=document.createElement("iframe");document.body.appendChild(hn),Array.from=(null==(Ee=hn.contentWindow)?void 0:Ee.Array.from)||Array.from,document.body.removeChild(hn)}}catch(t){console.debug("Unable to override Array.from",t)}var dn,cn,vn=new sr;function fn(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:n="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:d=!0,maskAllInputs:c,maskInputOptions:v,slimDOMOptions:f,maskInputFn:g,maskTextFn:m,hooks:p,packFn:I,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:A=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:N=!1,inlineImages:_=!1,plugins:T,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:F=new Set([]),errorHandler:x}=t;yi=x;var B=!k||window.parent===window,O=!1;if(!B)try{window.parent.document&&(O=!1)}catch(t){O=!0}if(B&&!e)throw new Error("emit function is required");if(!B&&!O)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),vn.reset();var Z,Y=!0===c?{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},E=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(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)}();var G=0,L=t=>{for(var e of T||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!O&&(t=I(t)),t};$i=(t,n)=>{var s,o=t;if(o.timestamp=Pr(),!(null==(s=Ni[0])?void 0:s.isFrozen())||o.type===di.FullSnapshot||o.type===di.IncrementalSnapshot&&o.data.source===ci.Mutation||Ni.forEach((t=>t.unfreeze())),B)null==e||e(L(o),n);else if(O){var a={type:"rrweb",event:L(o),origin:window.location.origin,isCheckout:n};window.parent.postMessage(a,"*")}if(o.type===di.FullSnapshot)Z=o,G=0;else if(o.type===di.IncrementalSnapshot){if(o.data.source===ci.Mutation&&o.data.isAttachIframe)return;G++,(i&&G>=i||r&&o.timestamp-Z.timestamp>r)&&tn(!0)}};var D=t=>{$i({type:di.IncrementalSnapshot,data:o({source:ci.Mutation},t)})},W=t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.Scroll},t)}),V=t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.CanvasMutation},t)}),X=new an({mutationCb:D,adoptedStyleSheetCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.AdoptedStyleSheet},t)})}),z=new Di({mirror:vn,mutationCb:D,stylesheetManager:X,recordCrossOriginIframes:k,wrappedEmit:$i});for(var J of T||[])J.getMirror&&J.getMirror({nodeMirror:vn,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new ln;en=new on({recordCanvas:S,mutationCb:V,win:window,blockClass:n,blockSelector:s,mirror:vn,sampling:y.canvas,dataURLOptions:b});var H=new Wi({mutationCb:D,scrollCb:W,bypassOptions:{blockClass:n,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:d,maskInputOptions:Y,dataURLOptions:b,maskTextFn:m,maskInputFn:g,recordCanvas:S,inlineImages:_,sampling:y,slimDOMOptions:E,iframeManager:z,stylesheetManager:X,canvasManager:en,keepIframeSrcFn:M,processedNodeManager:K},mirror:vn});tn=function(t){if(void 0===t&&(t=!1),w){$i({type:di.Meta,data:{href:window.location.href,width:$r(),height:Qr()}},t),X.reset(),H.init(),Ni.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new sr,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:c,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C=(()=>!1)}=e||{};return xr(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!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,maskTextFn:d,maskInputFn:c,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:m,onIframeLoad:p,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:vn,blockClass:n,blockSelector:s,maskTextClass:u,maskTextSelector:h,inlineStylesheet:d,maskAllInputs:Y,maskTextFn:m,maskInputFn:g,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:_,onSerialize(t){si(t,vn)&&z.addIframe(t),oi(t,vn)&&X.trackLinkElement(t),ai(t)&&H.addShadowRoot(Xr.shadowRoot(t),document)},onIframeLoad(t,e){z.attachIframe(t,e),H.observeAttachShadow(t)},onStylesheetLoad(t,e){X.attachLinkElement(t,e)},keepIframeSrcFn:M});if(!e)return console.warn("Failed to snapshot the document");$i({type:di.FullSnapshot,data:{node:e,initialOffset:qr(window)}},t),Ni.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,vn.getId(document))}};try{var j=[],U=t=>{var e;return Ri(Yi)({mutationCb:D,mousemoveCb:(t,e)=>$i({type:di.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.MouseInteraction},t)}),scrollCb:W,viewportResizeCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.ViewportResize},t)}),inputCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.Input},t)}),mediaInteractionCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.MediaInteraction},t)}),styleSheetRuleCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.StyleSheetRule},t)}),styleDeclarationCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>$i({type:di.IncrementalSnapshot,data:o({source:ci.Font},t)}),selectionCb(t){$i({type:di.IncrementalSnapshot,data:o({source:ci.Selection},t)})},customElementCb(t){$i({type:di.IncrementalSnapshot,data:o({source:ci.CustomElement},t)})},blockClass:n,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:Y,inlineStylesheet:d,sampling:y,recordDOM:w,recordCanvas:S,inlineImages:_,userTriggeredOnInput:R,collectFonts:N,doc:t,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:M,blockSelector:s,slimDOMOptions:E,dataURLOptions:b,mirror:vn,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:en,ignoreCSSAttributes:F,plugins:(null==(e=null==T?void 0:T.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>$i({type:di.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},p)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{tn(),j.push(U(document)),un=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(zr("DOMContentLoaded",(()=>{$i({type:di.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&P()}))),j.push(zr("load",(()=>{$i({type:di.Load,data:{}}),"load"===A&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),un=!1,yi=void 0}}catch(t){console.warn(t)}}fn.addCustomEvent=(t,e)=>{if(!un)throw new Error("please add custom event after start recording");$i({type:di.Custom,data:{tag:t,payload:e}})},fn.freezePage=()=>{Ni.forEach((t=>t.freeze()))},fn.takeFullSnapshot=t=>{if(!un)throw new Error("please take full snapshot after start recording");tn(t)},fn.mirror=vn,(cn=dn||(dn={}))[cn.NotStarted=0]="NotStarted",cn[cn.Running=1]="Running",cn[cn.Stopped=2]="Stopped";var gn,mn=Object.defineProperty,pn=(t,e,r)=>((t,e,r)=>e in t?mn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),In=Object.defineProperty,yn=(t,e,r)=>((t,e,r)=>e in t?In(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),bn=Object.defineProperty,Cn=(t,e,r)=>((t,e,r)=>e in t?bn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),wn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Sn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},kn={};function An(t){if(kn[t])return kn[t];var e=globalThis[t],r=e.prototype,i=t in wn?wn[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in Sn?Sn[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return kn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?kn[t]=u:r}catch(t){return r}}var Rn={};function Nn(t,e,r){var i,n=t+"."+String(r);if(Rn[n])return Rn[n].call(e);var s=An(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Rn[n]=o,o.call(e)):e[r]}var _n={};function Tn(t,e,r){var i=t+"."+String(r);if(_n[i])return _n[i].bind(e);var n=An(t)[r];return"function"!=typeof n?e[r]:(_n[i]=n,n.bind(e))}var Mn={childNodes:t=>Nn("Node",t,"childNodes"),parentNode:t=>Nn("Node",t,"parentNode"),parentElement:t=>Nn("Node",t,"parentElement"),textContent:t=>Nn("Node",t,"textContent"),contains:(t,e)=>Tn("Node",t,"contains")(e),getRootNode:t=>Tn("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Nn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Nn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Nn("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Nn("Element",t,"querySelectorAll")(e),mutationObserver:()=>An("MutationObserver").constructor};function Fn(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Fn(Mn.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Fn(Mn.parentNode(t),e,r)}class xn{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof xn))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.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"}}var Bn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},On={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Zn={};function Yn(t){if(Zn[t])return Zn[t];var e=globalThis[t],r=e.prototype,i=t in Bn?Bn[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in On?On[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Zn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Zn[t]=u:r}catch(t){return r}}var En={};function Gn(t,e,r){var i,n=t+"."+String(r);if(En[n])return En[n].call(e);var s=Yn(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(En[n]=o,o.call(e)):e[r]}var Ln={};function Dn(t,e,r){var i=t+"."+String(r);if(Ln[i])return Ln[i].bind(e);var n=Yn(t)[r];return"function"!=typeof n?e[r]:(Ln[i]=n,n.bind(e))}var Wn={childNodes:t=>Gn("Node",t,"childNodes"),parentNode:t=>Gn("Node",t,"parentNode"),parentElement:t=>Gn("Node",t,"parentElement"),textContent:t=>Gn("Node",t,"textContent"),contains:(t,e)=>Dn("Node",t,"contains")(e),getRootNode:t=>Dn("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Gn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Gn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Gn("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Gn("Element",t,"querySelectorAll")(e),mutationObserver:()=>Yn("MutationObserver").constructor},Vn="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.",Xn={map:{},getId(){return console.error(Vn),-1},getNode(){return console.error(Vn),null},removeNodeFromMap(){console.error(Vn)},has(){return console.error(Vn),!1},reset(){console.error(Vn)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xn=new Proxy(Xn,{get(t,e,r){return"map"===e&&console.error(Vn),Reflect.get(t,e,r)}}));var zn,Jn=Date.now;function Kn(t){return t?t.nodeType===t.ELEMENT_NODE?t:Wn.parentElement(t):null}function Hn(t){var e,r=null;return"getRootNode"in t&&(null==(e=Wn.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Wn.host(Wn.getRootNode(t))&&(r=Wn.host(Wn.getRootNode(t))),r}function jn(t){for(var e,r=t;e=Hn(r);)r=e;return r}function Un(t){var e=t.ownerDocument;if(!e)return!1;var r=jn(t);return Wn.contains(e,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Jn=()=>(new Date).getTime());for(var Pn=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){yn(this,"id",1),yn(this,"styleIDMap",new WeakMap),yn(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){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return Xn},closestElementOfNode:Kn,getBaseDimension:function t(e,r){var i,n,s=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:jn,getShadowHost:Hn,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(t){var e,r,i,n,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=Wn.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.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=Wn.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:t=>!!t&&(t instanceof xn&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Wn.shadowRoot(t))),hookSetter:function t(e,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,r);return s.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,r,o||{},!0)},inDom(t){var e=t.ownerDocument;return!!e&&(Wn.contains(e,t)||Un(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&Mn.host(i)||null,Boolean(n&&"shadowRoot"in n&&Mn.shadowRoot(n)===i))return!1;var i,n,s=r.getId(e);if(!r.has(s))return!0;var o=Wn.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,r))},isBlocked(t,e,r,i){if(!t)return!1;var n=Kn(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Fn(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:(t,e,r)=>!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t),isSerialized:(t,e)=>-1!==e.getId(t),isSerializedIframe:(t,e)=>Boolean("IFRAME"===t.nodeName&&e.getMeta(t)),isSerializedStylesheet:(t,e)=>Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t)),iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:t=>Boolean(t.changedTouches),get nowTimestamp(){return Jn},on(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill(t){void 0===t&&(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)},queueToResolveTrees(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in e){var h=e[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:Un,throttle(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}},uniqueTextMutations(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"}))),qn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Qn=0;64>Qn;Qn++)qn["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Qn)]=Qn;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(t=>t.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var $n=document.createElement("iframe");document.body.appendChild($n),Array.from=(null==(gn=$n.contentWindow)?void 0:gn.Array.from)||Array.from,document.body.removeChild($n)}}catch(t){console.debug("Unable to override Array.from",t)}new class{constructor(){Cn(this,"idNodeMap",new Map),Cn(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}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){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(zn||(zn={}));class ts{constructor(t){pn(this,"fileName"),pn(this,"functionName"),pn(this,"lineNumber"),pn(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var es=/(^|@)\S+:\d+/,rs=/^\s*at .*(\S+:\d+|\(native\))/m,is=/^(eval@)?(\[native code])?$/,ns={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(rs)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var 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(rs)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new ts({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(is)}),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 ts({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new ts({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[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){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new ts({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new ts({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(es)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ts({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function ss(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function os(t){return"[object Object]"==={}.toString.call(t)}function as(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(os(t[i])&&as(t[i],e-1))return!0;return!1}function ls(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(os(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||os(o)&&as(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Array.isArray(u)?ss(u.length?u[0]:null):u}return a}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 us={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 hs(t,e,r){var i,n=r?Object.assign({},us,r):us,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=ns.parse(e.error).map((t=>t.toString())),s=[ls(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[ls("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[ls("Uncaught (in promise)",n.stringifyOptions),ls(e.reason,n.stringifyOptions)]);var s=ns.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?Pn.patch(e,r,(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=ns.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>ls(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[ls("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var ds=t=>({name:"rrweb/console@1",observer:hs,options:t}),cs=t=>t instanceof Document;function vs(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return c(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function fs(t,e){var r,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),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var gs=N("[Recorder]"),ms=t=>"navigation"===t.entryType,ps=t=>"resource"===t.entryType;function Is(t,e){return!!e&&(y(e)||e[t])}function ys(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(y(r))return!0;if(d(r))return s(r);var o=r[e];return y(o)?o:s(o)}function bs(t,e,r,i,n,s){return Cs.apply(this,arguments)}function Cs(){return Cs=s((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return gs.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(ps(o=t[s])&&o.initiatorType===e&&(f(i)||o.startTime>=i)&&(f(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),bs(t,e,r,i,n,s+1))})),Cs.apply(this,arguments)}function ws(t){var{body:e,options:r,url:i}=t;if(p(e))return null;var{hostname:n,isHostDenied:s}=fs(i,r);if(s)return n+" is in deny list";if(g(e))return e;if(cs(e))return e.textContent;if(b(e))return x(e);if(v(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Ss=t=>!m(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ks(t){var{entry:e,method:r,status:i,networkRequest:n,isInitial:s,start:a,end:l,url:u,initiatorType:h}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[o({},e?e.toJSON():{name:u},{startTime:f(a)?void 0:Math.round(a),endTime:f(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Ss(e))for(var g of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:g.name,duration:g.duration,entryType:"serverTiming"});return v}var As=["video/","audio/"];function Rs(t){return new Promise((e=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function Ns(){return(Ns=s((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=fs(i,r);return s?Promise.resolve(n+" is in deny list"):Rs(e)}))).apply(this,arguments)}function _s(){return(_s=s((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=As.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=fs(n,i);return l?a+" is in deny list":null}({r:e,options:r,url:i});return m(n)?Rs(e):Promise.resolve(n)}))).apply(this,arguments)}var Ts=null;function Ms(t,e,r){if(!("performance"in e))return()=>{};if(Ts)return gs.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},Q,r):Q,n=e=>{var r=[];e.requests.forEach((t=>{var e=i.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(o({},e,{requests:r}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>ms(t)||ps(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ks({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>ms(t)||ps(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ks({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,i),l=()=>{},u=()=>{};return(i.recordHeaders||i.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Is("request",r.recordHeaders),n=Is("response",r.recordHeaders),s=vs(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d,c,v=this,f=new Request(a),g={},m={},p=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(m[t]=e,p(t,e)),i&&(g.requestHeaders=m);var I=v.send.bind(v);v.send=t=>(ys({type:"request",headers:m,url:a,recordBody:r.recordBody})&&(g.requestBody=ws({body:t,options:r,url:a})),d=e.performance.now(),I(t));var y=()=>{v.removeEventListener("readystatechange",b),v.removeEventListener("error",y),v.removeEventListener("abort",y),v.removeEventListener("timeout",y)},b=()=>{if(v.readyState===v.DONE){y(),c=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(g.responseHeaders=i),ys({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=ws({body:v.response,options:r,url:a})),bs(e,"xmlhttprequest",f.url,d,c).then((e=>{var r=ks({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:g,start:d,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",b),v.addEventListener("error",y),v.addEventListener("abort",y),v.addEventListener("timeout",y),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(n,e,i),u=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=Is("request",r.recordHeaders),n=Is("response",r.recordHeaders),o=vs(e,"fetch",(o=>function(){var a=s((function*(s,a){var l,u,h,d=new Request(s,a),c={};try{var v={};d.headers.forEach(((t,e)=>{v[e]=t})),i&&(c.requestHeaders=v),ys({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(c.requestBody=yield function(t){return Ns.apply(this,arguments)}({r:d,options:r,url:s})),u=e.performance.now(),l=yield o(d),h=e.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),n&&(c.responseHeaders=f),ys({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(c.responseBody=yield function(t){return _s.apply(this,arguments)}({r:l,options:r,url:s})),l}finally{bs(e,"fetch",d.url,u,h).then((e=>{var r,i=ks({entry:e,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:u,end:h,url:d.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(n,e,i)),Ts=()=>{a(),l(),u(),Ts=null}}var Fs=t=>({name:"rrweb/network@1",observer:Ms,options:t});i.__PosthogExtensions__=i.__PosthogExtensions__||{},i.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:ds,getRecordNetworkPlugin:Fs},i.__PosthogExtensions__.rrweb={record:fn,version:"v2"},i.rrweb={record:fn,version:"v2"},i.rrwebConsoleRecord={getRecordConsolePlugin:ds},i.getRecordNetworkPlugin=Fs,i.__PosthogExtensions__=i.__PosthogExtensions__||{},i.__PosthogExtensions__.initSessionRecording=t=>new Ye(t)}();
|
|
2
2
|
//# sourceMappingURL=lazy-recorder.js.map
|