posthog-js 1.285.1 → 1.285.2
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/README.md +5 -4
- 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/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/posthog-recorder.js +1 -1
- package/lib/package.json +1 -1
- package/package.json +2 -2
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,r=Array.prototype.forEach,n=null==e?void 0:e.navigator,i=null==e?void 0:e.document;null==e||e.location,null==e||e.fetch,null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest&&e.XMLHttpRequest,null==e||e.AbortController,null==n||n.userAgent;var o=null!=t?t:{};function s(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){s(o,n,i,a,u,"next",t)}function u(t){s(o,n,i,a,u,"throw",t)}a(void 0)}))}}function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},u.apply(null,arguments)}var l=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),d=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({});var c=function(t){return t.trim()},h=Array.isArray,v=Object.prototype,f=v.hasOwnProperty,m=v.toString,p=h||function(t){return"[object Array]"===m.call(t)},g=t=>"function"==typeof t,I=t=>t===Object(t)&&!p(t),y=t=>void 0===t,b=t=>"[object String]"==m.call(t),C=t=>null===t,w=t=>y(t)||C(t),S=t=>"[object Number]"==m.call(t),A=t=>"[object Boolean]"===m.call(t),k=t=>t instanceof FormData;function N(t,e,r,n,i){return e>r&&(n.warn("min cannot be greater than max."),e=r),S(t)?t>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),N(i||r,e,r,n))}class R{constructor(t){this.t={},this.i=t.i,this.o=N(t.bucketSize,0,100,t.u),this.h=N(t.refillRate,0,this.o,t.u),this.m=N(t.refillInterval,0,864e5,t.u)}I(t,e){var r=e-t.lastAccess,n=Math.floor(r/this.m);if(n>0){var i=n*this.h;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+n*this.m}}consumeRateLimit(t){var e,r=Date.now(),n=String(t),i=this.t[n];return i?this.I(i,r):(i={tokens:this.o,lastAccess:r},this.t[n]=i),0===i.tokens||(i.tokens--,0===i.tokens&&(null==(e=this.i)||e.call(this,t)),0===i.tokens)}stop(){this.t={}}}var T={LIB_VERSION:"1.285.1"},M=e=>{var r={C:function(r){if(t&&o.POSTHOG_DEBUG&&!y(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];n(e,...s)}},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.C("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.C("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.C("error",...e)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:t=>{r.error("You must initialize PostHog before calling "+t)},createLogger:t=>M(e+" "+t)};return r},F=M("[PostHog.js]"),_=F.createLogger,B={};function O(t,e,n){if(!w(t)){if(p(t))return function(t,e,n){if(p(t))if(r&&t.forEach===r)t.forEach(e,n);else if("length"in t&&t.length===+t.length)for(var i=0,o=t.length;i<o;i++)if(i in t&&e.call(n,t[i],i)===B)return}(t,e,n);if(k(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===B)return}else for(var o in t)if(f.call(t,o)&&e.call(n,t[o],o)===B)return}}function x(t,e,r,n){var{capture:i=!1,passive:o=!0}={};null==t||t.addEventListener(e,r,{capture:i,passive:o})}var Z=["localhost","127.0.0.1"],Y=t=>{var e=null==i?void 0:i.createElement("a");return y(e)?null:(e.href=t,e)},E=function(t,e){var r,n;void 0===e&&(e="&");var i=[];return O(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),n=encodeURIComponent(e),i[i.length]=n+"="+r)})),i.join(e)},G="$session_is_sampled",L="$session_recording_url_trigger_activated_session",W="$session_recording_event_trigger_activated_session",D=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})"),V=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})");var X="[SessionRecording]",z="redacted",J={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"]},K=["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"],H=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],j=["/s/","/e/","/i/"];function U(t,e,r,n){if(w(t))return t;var i=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return b(i)&&(i=parseInt(i)),i>r?X+" "+n+" body too large to record ("+i+" bytes)":t}function P(t,e){if(w(t))return t;var r=t;return function(t,e){if(w(t))return!1;if(b(t)){if(t=c(t),D.test((t||"").replace(/[- ]/g,"")))return!1;if(V.test(t))return!1}return!0}(r)||(r=X+" "+e+" body "+z),O(H,(t=>{var n,i;null!=(n=r)&&n.length&&-1!==(null==(i=r)?void 0:i.indexOf(t))&&(r=X+" "+e+" body "+z+" as might contain: "+t)})),r}var q=(t,e)=>{var r,n,i,o={payloadSizeLimitBytes:J.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...J.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...J.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,d=(r=o,i=Math.min(1e6,null!==(n=r.payloadSizeLimitBytes)&&void 0!==n?n:1e6),t=>(null!=t&&t.requestBody&&(t.requestBody=U(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=U(t.responseBody,t.responseHeaders,i,"Response")),t)),c=e=>{return d(((t,e)=>{var r,n=Y(t.name),i=0===e.indexOf("http")?null==(r=Y(e))?void 0:r.pathname:e;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&j.some((t=>0===o.indexOf(t)))))return t})((n=(r=e).requestHeaders,w(n)||O(Object.keys(null!=n?n:{}),(t=>{K.includes(t.toLowerCase())&&(n[t]=z)})),r),t.api_host));var r,n},h=g(t.session_recording.maskNetworkRequestFn);return h&&g(t.session_recording.maskCapturedNetworkRequestFn)&&F.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return u({},e,{name:null==r?void 0:r.url})}),o.maskRequestFn=g(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r,n=c(e);return n&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(n))&&void 0!==r?r:void 0}:t=>function(t){if(!y(t))return t.requestBody=P(t.requestBody,"Request"),t.responseBody=P(t.responseBody,"Response"),t}(c(t)),u({},J,o,{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Q="disabled",tt="sampled",et="active",rt="buffering",nt="paused",it="trigger",ot=it+"_activated",st=it+"_pending",at=it+"_"+Q;function ut(t,e){return e.some((e=>"regex"===e.matching&&new RegExp(e.url).test(t)))}class lt{constructor(t){this.S=t}triggerStatus(t){var e=this.S.map((e=>e.triggerStatus(t)));return e.includes(ot)?ot:e.includes(st)?st:at}stop(){this.S.forEach((t=>t.stop()))}}class dt{constructor(t){this.S=t}triggerStatus(t){var e=new Set;for(var r of this.S)e.add(r.triggerStatus(t));switch(e.delete(at),e.size){case 0:return at;case 1:return Array.from(e)[0];default:return st}}stop(){this.S.forEach((t=>t.stop()))}}class ct{triggerStatus(){return st}stop(){}}var ht=t=>"sessionRecording"in t;class vt{constructor(t){this.A=[],this.k=[],this.urlBlocked=!1,this._instance=t}onConfig(t){var e,r;this.A=(ht(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.k=(ht(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[]}onRemoteConfig(t){this.onConfig(t)}N(t){var e;return 0===this.A.length?at:(null==(e=this._instance)?void 0:e.get_property(L))===t?ot:st}triggerStatus(t){var e=this.N(t),r=e===ot?ot:e===st?st:at;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,r,n){if(void 0!==t&&t.location.href){var i=t.location.href,o=this.urlBlocked,s=ut(i,this.k);o&&s||(s&&!o?e():!s&&o&&r(),ut(i,this.A)&&n("url"))}}stop(){}}class ft{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.R=()=>{},this._instance=t}triggerStatus(){var t=st;return w(this.linkedFlag)&&(t=at),this.linkedFlagSeen&&(t=ot),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(ht(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!w(this.linkedFlag)&&!this.linkedFlagSeen){var n=b(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,i=b(this.linkedFlag)?null:this.linkedFlag.variant;this.R=this._instance.onFeatureFlags(((t,r)=>{var o=!1;if(I(r)&&n in r){var s=r[n];o=A(s)?!0===s:i?s===i:!!s}this.linkedFlagSeen=o,o&&e(n,i)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.R()}}class mt{constructor(t){this.T=[],this._instance=t}onConfig(t){var e;this.T=(ht(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}M(t){var e;return 0===this.T.length?at:(null==(e=this._instance)?void 0:e.get_property(W))===t?ot:st}triggerStatus(t){var e=this.M(t),r=e===ot?ot:e===st?st:at;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function pt(t){return t.isRecordingEnabled?rt:Q}function gt(t){if(!t.receivedFlags)return rt;if(!t.isRecordingEnabled)return Q;if(t.urlTriggerMatching.urlBlocked)return nt;var e=!0===t.isSampled,r=new lt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?tt:r===ot?et:r===st?rt:!1===t.isSampled?Q:et}function It(t){if(!t.receivedFlags)return rt;if(!t.isRecordingEnabled)return Q;if(t.urlTriggerMatching.urlBlocked)return nt;var e=new dt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==at,n=A(t.isSampled);return r&&e===st?rt:r&&e===at||n&&!t.isSampled?Q:!0===t.isSampled?tt:et}function yt(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(I(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}var bt=Uint8Array,Ct=Uint16Array,wt=Uint32Array,St=new bt([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]),At=new bt([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]),kt=new bt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nt=function(t,e){for(var r=new Ct(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new wt(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Rt=Nt(St,2),Tt=Rt[0],Mt=Rt[1];Tt[28]=258,Mt[258]=28;for(var Ft=Nt(At,0)[1],_t=new Ct(32768),Bt=0;Bt<32768;++Bt){var Ot=(43690&Bt)>>>1|(21845&Bt)<<1;Ot=(61680&(Ot=(52428&Ot)>>>2|(13107&Ot)<<2))>>>4|(3855&Ot)<<4,_t[Bt]=((65280&Ot)>>>8|(255&Ot)<<8)>>>1}var xt=function(t,e,r){for(var n=t.length,i=0,o=new Ct(e);i<n;++i)++o[t[i]-1];var s,a=new Ct(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Ct(1<<e);var u=15-e;for(i=0;i<n;++i)if(t[i])for(var l=i<<4|t[i],d=e-t[i],c=a[t[i]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)s[_t[c]>>>u]=l}else for(s=new Ct(n),i=0;i<n;++i)s[i]=_t[a[t[i]-1]++]>>>15-t[i];return s},Zt=new bt(288);for(Bt=0;Bt<144;++Bt)Zt[Bt]=8;for(Bt=144;Bt<256;++Bt)Zt[Bt]=9;for(Bt=256;Bt<280;++Bt)Zt[Bt]=7;for(Bt=280;Bt<288;++Bt)Zt[Bt]=8;var Yt=new bt(32);for(Bt=0;Bt<32;++Bt)Yt[Bt]=5;var Et=xt(Zt,9,0),Gt=xt(Yt,5,0),Lt=function(t){return(t/8>>0)+(7&t&&1)},Wt=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var n=new(t instanceof Ct?Ct:t instanceof wt?wt:bt)(r-e);return n.set(t.subarray(e,r)),n},Dt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8},Vt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},Xt=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return[new bt(0),0];if(1==i){var s=new bt(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,d=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};d!=i-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=d&&r[l].f<r[c].f?l++:c++],r[d++]={s:-1,f:a.f+u.f,l:a,r:u};var h=o[0].s;for(n=1;n<i;++n)o[n].s>h&&(h=o[n].s);var v=new Ct(h+1),f=zt(r[d-1],v,0);if(f>e){n=0;var m=0,p=f-e,g=1<<p;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n<i;++n){var I=o[n].s;if(!(v[I]>e))break;m+=g-(1<<f-v[I]),v[I]=e}for(m>>>=p;m>0;){var y=o[n].s;v[y]<e?m-=1<<e-v[y]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;v[b]==e&&(--v[b],++m)}f=e}return[new bt(v),f]},zt=function(t,e,r){return-1==t.s?Math.max(zt(t.l,e,r+1),zt(t.r,e,r+1)):e[t.s]=r},Jt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ct(++e),n=0,i=t[0],o=1,s=function(t){r[n++]=t},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},Kt=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},Ht=function(t,e,r){var n=r.length,i=Lt(e+2);t[i]=255&n,t[i+1]=n>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<n;++o)t[i+o+4]=r[o];return 8*(i+4+n)},jt=function(t,e,r,n,i,o,s,a,u,l,d){Dt(e,d++,r),++i[256];for(var c=Xt(i,15),h=c[0],v=c[1],f=Xt(o,15),m=f[0],p=f[1],g=Jt(h),I=g[0],y=g[1],b=Jt(m),C=b[0],w=b[1],S=new Ct(19),A=0;A<I.length;++A)S[31&I[A]]++;for(A=0;A<C.length;++A)S[31&C[A]]++;for(var k=Xt(S,7),N=k[0],R=k[1],T=19;T>4&&!N[kt[T-1]];--T);var M,F,_,B,O=l+5<<3,x=Kt(i,Zt)+Kt(o,Yt)+s,Z=Kt(i,h)+Kt(o,m)+s+14+3*T+Kt(S,N)+(2*S[16]+3*S[17]+7*S[18]);if(O<=x&&O<=Z)return Ht(e,d,t.subarray(u,u+l));if(Dt(e,d,1+(Z<x)),d+=2,Z<x){M=xt(h,v,0),F=h,_=xt(m,p,0),B=m;var Y=xt(N,R,0);Dt(e,d,y-257),Dt(e,d+5,w-1),Dt(e,d+10,T-4),d+=14;for(A=0;A<T;++A)Dt(e,d+3*A,N[kt[A]]);d+=3*T;for(var E=[I,C],G=0;G<2;++G){var L=E[G];for(A=0;A<L.length;++A){var W=31&L[A];Dt(e,d,Y[W]),d+=N[W],W>15&&(Dt(e,d,L[A]>>>5&127),d+=L[A]>>>12)}}}else M=Et,F=Zt,_=Gt,B=Yt;for(A=0;A<a;++A)if(n[A]>255){W=n[A]>>>18&31;Vt(e,d,M[W+257]),d+=F[W+257],W>7&&(Dt(e,d,n[A]>>>23&31),d+=St[W]);var D=31&n[A];Vt(e,d,_[D]),d+=B[D],D>3&&(Vt(e,d,n[A]>>>5&8191),d+=At[D])}else Vt(e,d,M[n[A]]),d+=F[n[A]];return Vt(e,d,M[256]),d+F[256]},Ut=new wt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pt=function(){for(var t=new wt(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),qt=function(){var t=4294967295;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=Pt[255&r^e[n]]^r>>>8;t=r},d:function(){return 4294967295^t}}},Qt=function(t,e,r,n,i){return function(t,e,r,n,i,o){var s=t.length,a=new bt(n+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(n,a.length-i),l=0;if(!e||s<8)for(var d=0;d<=s;d+=65535){var c=d+65535;c<s?l=Ht(u,l,t.subarray(d,c)):(u[d]=o,l=Ht(u,l,t.subarray(d,s)))}else{for(var h=Ut[e-1],v=h>>>13,f=8191&h,m=(1<<r)-1,p=new Ct(32768),g=new Ct(m+1),I=Math.ceil(r/3),y=2*I,b=function(e){return(t[e]^t[e+1]<<I^t[e+2]<<y)&m},C=new wt(25e3),w=new Ct(288),S=new Ct(32),A=0,k=0,N=(d=0,0),R=0,T=0;d<s;++d){var M=b(d),F=32767&d,_=g[M];if(p[F]=_,g[M]=F,R<=d){var B=s-d;if((A>7e3||N>24576)&&B>423){l=jt(t,u,0,C,w,S,k,N,T,d-T,l),N=A=k=0,T=d;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)S[O]=0}var x=2,Z=0,Y=f,E=F-_&32767;if(B>2&&M==b(d-E))for(var G=Math.min(v,B)-1,L=Math.min(32767,d),W=Math.min(258,B);E<=L&&--Y&&F!=_;){if(t[d+x]==t[d+x-E]){for(var D=0;D<W&&t[d+D]==t[d+D-E];++D);if(D>x){if(x=D,Z=E,D>G)break;var V=Math.min(E,D-2),X=0;for(O=0;O<V;++O){var z=d-E+O+32768&32767,J=z-p[z]+32768&32767;J>X&&(X=J,_=z)}}}E+=(F=_)-(_=p[F])+32768&32767}if(Z){C[N++]=268435456|Mt[x]<<18|Ft[Z];var K=31&Mt[x],H=31&Ft[Z];k+=St[K]+At[H],++w[257+K],++S[H],R=d+x,++A}else C[N++]=t[d],++w[t[d]]}}l=jt(t,u,o,C,w,S,k,N,T,d-T,l)}return Wt(a,0,n+Lt(l)+i)}(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,n,!0)},$t=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},te=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&$t(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var n=0;n<=r.length;++n)t[n+10]=r.charCodeAt(n)}},ee=function(t){return 10+(t.filename&&t.filename.length+1||0)};class re{constructor(t,e){var r,n;void 0===e&&(e={}),this.F={},this.B=t=>{if(!this.F[t]){var e,r;this.F[t]=!0;var n=this.O(t);null==(e=(r=this.Z).onBlockedNode)||e.call(r,t,n)}},this.Y=t=>{var e=this.O(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.O=t=>this._rrweb.mirror.getNode(t),this.G=t=>{var e,r,n,i,o,s,a,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(n=null==(i=t.attributes)?void 0:i.length)&&void 0!==n?n:0)+(null!==(o=null==(s=t.texts)?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null==(u=t.adds)?void 0:u.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.G(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.Y(t.id);return!this.L.consumeRateLimit(e)&&t})));var n=this.G(e);return 0!==n||r===n?t:void 0},this._rrweb=t,this.Z=e,this.L=new R({bucketSize:null!==(r=this.Z.bucketSize)&&void 0!==r?r:100,refillRate:null!==(n=this.Z.refillRate)&&void 0!==n?n:10,refillInterval:1e3,i:this.B,u:F})}reset(){this.F={}}stop(){this.L.stop(),this.reset()}}function ne(t,e){return function(t){for(var e=0,r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<N(100*e,0,100,F)}var ie=3e5,oe="[SessionRecording]",se=_(oe),ae=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],ue=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function le(){var t;return null==o||null==(t=o.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record}function de(t){return function(t,e){for(var r="",n=0;n<t.length;){var i=t[n++];r+=String.fromCharCode(i)}return r}(function(t,e){void 0===e&&(e={});var r=qt(),n=t.length;r.p(t);var i=Qt(t,e,ee(e),8),o=i.length;return te(i,e),$t(i,o-8,r.d()),$t(i,o-4,n),i}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new bt(t.length+(t.length>>>1)),i=0,o=function(t){n[i++]=t},s=0;s<r;++s){if(i+5>n.length){var a=new bt(i+8+(r-s<<1));a.set(n),n=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Wt(n,0,i)}(JSON.stringify(t))))}function ce(t,e){return t.type===l.Custom&&t.data.tag===e}function he(t){return ce(t,"sessionIdle")}function ve(t){return ce(t,"$session_ending")}function fe(t){return ce(t,"$session_starting")}function me(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),n=t.data.slice(0,r),i=t.data.slice(r);return[me({size:yt(n),data:n,sessionId:t.sessionId,windowId:t.windowId}),me({size:yt(i),data:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class pe{get sessionId(){return this.W}get D(){if(!this._instance.sessionManager)throw new Error(oe+" must be started with a valid sessionManager.");return this._instance.sessionManager}get V(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get X(){var t=this._instance.get_property(G);return A(t)?t:b(t)?t===this.sessionId:null}get J(){var t,e=null==(t=this.K)?void 0:t.sampleRate;return S(e)?e:null}get H(){var t,e=null==(t=this.K)?void 0:t.minimumDurationMilliseconds;return S(e)?e:null}constructor(t){this.j="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.U=void 0,this.P=Date.now(),this.q=[],this.$="unknown",this.tt=new ct,this.et=void 0,this.rt=void 0,this.nt=pt,this.it=void 0,this.ot=void 0,this.st=void 0,this.ut=void 0,this.lt=(t,e,r)=>{if(r){var n,i,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength);o&&(n=this.W,i=this.dt,this.ct("$session_ending",{nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.P})),this.ct("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.ht(),this.U||this.start("session_id_changed"),o&&this.ct("$session_starting",{previousSessionId:n,previousWindowId:i,changeReason:r,lastActivityTimestamp:this.P}),S(this.J)&&w(this.st)&&this.vt(t)}},this.ft=()=>{this.gt()},this.It=()=>{this.ct("browser offline",{})},this.yt=()=>{this.ct("browser online",{})},this.bt=()=>{if(null!=i&&i.visibilityState){var t="window "+i.visibilityState;this.ct(t,{})}},this._instance=t;var{sessionId:e,windowId:r}=this.D.checkAndGetSessionAndWindowId();this.W=e,this.dt=r,this.Ct=new ft(this._instance),this.wt=new vt(this._instance),this.St=new mt(this._instance),this.At=this.kt(),this.V>=this.D.sessionTimeoutMs&&se.warn("session_idle_threshold_ms ("+this.V+") is greater than the session timeout ("+this.D.sessionTimeoutMs+"). Session will never be detected as idle")}get Nt(){var t,e,r,n,i,o,s,a=null==(t=this.K)?void 0:t.masking,u={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==(n=this._instance.config.session_recording)?void 0:n.blockSelector},l=null!==(i=null==u?void 0:u.maskAllInputs)&&void 0!==i?i:null==a?void 0:a.maskAllInputs,d=null!==(o=null==u?void 0:u.maskTextSelector)&&void 0!==o?o:null==a?void 0:a.maskTextSelector,c=null!==(s=null==u?void 0:u.blockSelector)&&void 0!==s?s:null==a?void 0:a.blockSelector;return y(l)&&y(d)&&y(c)?void 0:{maskAllInputs:null==l||l,maskTextSelector:d,blockSelector:c}}get Rt(){var t,e,r,n,i,o,s,a=this._instance.config.session_recording.captureCanvas,u=null==(t=this.K)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,d=null!==(n=null!==(i=null==a?void 0:a.canvasFps)&&void 0!==i?i:null==u?void 0:u.fps)&&void 0!==n?n:4,c=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==u?void 0:u.quality)&&void 0!==o?o:.4;if("string"==typeof c){var h=parseFloat(c);c=isNaN(h)?.4:h}return{enabled:l,fps:N(d,0,12,_("canvas recording fps"),4),quality:N(c,0,1,_("canvas recording quality"),.4)}}get Tt(){var t,e=!(null==(t=this.K)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Mt(){var t,e,r,n=null==(t=this.K)?void 0:t.networkPayloadCapture,i={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},o=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),a=I(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,u=!!(A(a)?a:null==n?void 0:n.capturePerformance);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}Ft(){var t,e,r=[],n=null==(t=o.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Tt&&r.push(n());var i=null==(e=o.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;this.Mt&&g(i)&&(!Z.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(i(q(this._instance.config,this.Mt))):se.info("NetworkCapture not started because we are on localhost."));return r}_t(t){var e=this._instance.config.session_recording;if(e.maskNetworkRequestFn){var r,n={url:t};return null==(r=n=e.maskNetworkRequestFn(n))?void 0:r.url}return t}Bt(t){try{return t.rrwebMethod(),!0}catch(e){return this.q.length<10?this.q.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):se.warn("could not emit queued rrweb event.",e,t),!1}}ct(t,e){return this.Bt(ue((()=>le().addCustomEvent(t,e))))}Ot(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=e.origin+e.pathname+e.search,n=this._t(r);this.xt!==n&&(this.xt=n,this.ct("$url_changed",{href:n}))}catch(t){}}Zt(){if(this.q.length){var t=[...this.q];this.q=[],t.forEach((t=>{Date.now()-t.enqueuedAt<=2e3&&this.Bt(t)}))}}Yt(){return this.Bt(ue((()=>le().takeFullSnapshot())))}get Et(){var t,e;return this.tt.triggerStatus(this.sessionId)!==st||["sampled","active"].includes(this.status)?null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.full_snapshot_interval_millis)&&void 0!==t?t:ie:6e4}Gt(){if(this.Lt&&clearInterval(this.Lt),!0!==this.$){var t=this.Et;t&&(this.Lt=setInterval((()=>{this.Yt()}),t))}}Wt(){this.wt.urlBlocked||(this.wt.urlBlocked=!0,clearInterval(this.Lt),se.info("recording paused due to URL blocker"),this.ct("recording paused",{reason:"url blocker"}))}Dt(){this.wt.urlBlocked&&(this.wt.urlBlocked=!1,this.Yt(),this.Gt(),this.ct("recording resumed",{reason:"left blocked url"}),se.info("recording resumed"))}Vt(t){var e;this.tt.triggerStatus(this.sessionId)===st&&(null==(e=this._instance)||null==(e=e.persistence)||e.register({["url"===t?L:W]:this.W}),this.gt(),this.Xt(t+"_trigger_matched"))}get isStarted(){return!!this.U}get K(){var t=this._instance.get_property("$session_recording_remote_config");if(t)return I(t)?t:JSON.parse(t)}start(e){var r,n=this.K;if(n){var{sessionId:i,windowId:o}=this.D.checkAndGetSessionAndWindowId();this.W=i,this.dt=o,null!=n&&n.endpoint&&(this.j=null==n?void 0:n.endpoint),"any"===(null==n?void 0:n.triggerMatchType)?(this.nt=gt,this.tt=new lt([this.St,this.wt])):(this.nt=It,this.tt=new dt([this.St,this.wt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==n?void 0:n.triggerMatchType}),this.wt.onConfig(n),this.St.onConfig(n),null==(r=this.rt)||r.call(this),this.zt(),this.Ct.onConfig(n,((t,e)=>{this.Xt("linked_flag_matched",{flag:t,variant:e})})),this.vt(this.sessionId),this.Jt(),x(t,"beforeunload",this.ft),x(t,"offline",this.It),x(t,"online",this.yt),x(t,"visibilitychange",this.bt),this.it||(this.it=this.D.onSessionId(this.lt)),this.ot||(this.ot=this.D.on("forcedIdleReset",(()=>{this.ht(),this.$="unknown",this.stop(),this.ut=this.D.onSessionId(((t,e,r)=>{var n;null==(n=this.ut)||n.call(this),this.ut=void 0,this.lt(t,e,r)}))}))),w(this.et)&&(this.et=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this._t(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.ct("$pageview",{href:e})}}catch(t){se.error("Could not add $pageview to rrweb session",t)}}))),this.status===et&&this.Xt(e||"recording_initialized")}else se.info("remote config must be stored in persistence before recording can start")}stop(){var e,r,n,i,o,s,a,u;null==t||t.removeEventListener("beforeunload",this.ft),null==t||t.removeEventListener("offline",this.It),null==t||t.removeEventListener("online",this.yt),null==t||t.removeEventListener("visibilitychange",this.bt),this.kt(),clearInterval(this.Lt),this.Kt(),null==(e=this.et)||e.call(this),this.et=void 0,null==(r=this.rt)||r.call(this),this.rt=void 0,null==(n=this.it)||n.call(this),this.it=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0,null==(o=this.st)||o.call(this),this.st=void 0,null==(s=this.ut)||s.call(this),this.ut=void 0,this.St.stop(),this.wt.stop(),this.Ct.stop(),null==(a=this.Ht)||a.stop(),this.q=[],null==(u=this.U)||u.call(this),this.U=void 0,se.info("stopped")}onRRwebEmit(t){var e;if(this.Zt(),t&&I(t)){if(t.type===l.Meta){var r=this._t(t.data.href);if(this.xt=r,!r)return;t.data.href=r}else this.Ot();if(this.wt.checkUrlTriggerConditions((()=>this.Wt()),(()=>this.Dt()),(t=>this.Vt(t))),!this.wt.urlBlocked||(n=t).type===l.Custom&&"recording paused"===n.data.tag){var n,i;if(t.type===l.FullSnapshot)this.Gt(),null==(i=this.Ht)||i.reset();t.type===l.FullSnapshot&&this.tt.triggerStatus(this.sessionId)===st&&this.jt();var o=this.Ht?this.Ht.throttleMutations(t):t;if(o){var s=function(t){var e=t;if(e&&I(e)&&6===e.type&&I(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=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?r.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):r.push(e.data.payload.payload[n]);return e.data.payload.payload=r,t}return t}(o);if(this.Ut(s),!0!==this.$||function(t){return he(t)||ve(t)||fe(t)}(s)){if(he(s)){var a=s.data.payload;if(a){var c=a.lastActivityTimestamp,h=a.threshold;s.timestamp=c+h}}if(ve(s)||fe(s)){var v=s.data.payload;null!=v&&v.lastActivityTimestamp&&(s.timestamp=v.lastActivityTimestamp)}var f=null===(e=this._instance.config.session_recording.compress_events)||void 0===e||e?function(t){try{if(t.type===l.FullSnapshot)return u({},t,{data:de(t.data),cv:"2024-10"});if(t.type===l.IncrementalSnapshot&&t.data.source===d.Mutation)return u({},t,{cv:"2024-10",data:u({},t.data,{texts:de(t.data.texts),attributes:de(t.data.attributes),removes:de(t.data.removes),adds:de(t.data.adds)})});if(t.type===l.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return u({},t,{cv:"2024-10",data:u({},t.data,{adds:t.data.adds?de(t.data.adds):void 0,removes:t.data.removes?de(t.data.removes):void 0})})}catch(t){se.error("could not compress event - will use uncompressed event",t)}return t}(s):s,m={$snapshot_bytes:yt(f),$snapshot_data:f,$session_id:this.W,$window_id:this.dt};this.status!==Q?this.Pt(m):this.kt()}}}}}get status(){return this.nt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:this.X,urlTriggerMatching:this.wt,eventTriggerMatching:this.St,linkedFlagMatching:this.Ct,sessionId:this.sessionId})}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.Ct.linkedFlagSeen=!0,this.Yt(),this.Xt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[G]:this.sessionId}),this.Yt(),this.Xt("sampling_overridden")}overrideTrigger(t){this.Vt(t)}Kt(){this.qt&&(clearTimeout(this.qt),this.qt=void 0)}gt(){this.Kt();var t=this.H,e=this.Qt,r=S(e)&&e>=0,n=S(t)&&r&&e<t;if(this.status===rt||this.status===nt||this.status===Q||n)return this.qt=setTimeout((()=>{this.gt()}),2e3),this.At;this.At.data.length>0&&me(this.At).forEach((t=>{this.$t({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:T.LIB_VERSION})}));return this.kt()}Pt(t){var e,r=2+((null==(e=this.At)?void 0:e.data.length)||0);!this.$&&(this.At.size+t.$snapshot_bytes+r>943718.4||this.At.sessionId!==this.W)&&(this.At=this.gt()),this.At.size+=t.$snapshot_bytes,this.At.data.push(t.$snapshot_data),this.qt||this.$||(this.qt=setTimeout((()=>{this.gt()}),2e3))}$t(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.j),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qt(){var t,e,r=null==(t=this.At)?void 0:t.data[(null==(e=this.At)?void 0:e.data.length)-1],{sessionStartTimestamp:n}=this.D.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}jt(){if(!this.At||0===this.At.data.length)return this.kt();for(var t=-1,e=this.At.data.length-1;e>=0;e--)if(this.At.data[e].type===l.Meta){t=e;break}return t>=0?(this.At.data=this.At.data.slice(t),this.At.size=this.At.data.reduce(((t,e)=>t+yt(e)),0),this.At):this.kt()}kt(){return this.At={size:0,data:[],sessionId:this.W,windowId:this.dt},this.At}Xt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),se.info(t.replace("_"," "),e),-1===["recording_initialized","session_id_changed"].indexOf(t)&&this.ct(t,e)}te(t){var e;return 3===t.type&&-1!==ae.indexOf(null==(e=t.data)?void 0:e.source)}Ut(t){var e=this.te(t);e||this.$||t.timestamp-this.P>this.V&&(this.$=!0,clearInterval(this.Lt),this.ct("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.P,threshold:this.V,bufferLength:this.At.data.length,bufferSize:this.At.size}),this.gt());var r=!1;if(e&&(this.P=t.timestamp,this.$)){var n="unknown"===this.$;this.$=!1,n||(this.ct("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.$){var{windowId:i,sessionId:o}=this.D.checkAndGetSessionAndWindowId(!e,t.timestamp),s=this.W!==o,a=this.dt!==i;this.dt=i,this.W=o,s||a?(this.stop(),this.start("session_id_changed")):r&&this.Gt()}}ht(){var t,e,r;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(W),null==(e=this._instance)||null==(e=e.persistence)||e.unregister(L),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(G)}vt(t){var e,r=this.W!==t,n=this.J;if(S(n)){var i=this.X,o=r||!A(i),s=o?ne(t,n):i;o&&(s?this.Xt(tt):se.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server."),this.ct("samplingDecisionMade",{sampleRate:n,isSampled:s})),null==(e=this._instance.persistence)||e.register({[G]:!!s&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(G)}}zt(){0!==this.St.T.length&&w(this.rt)&&(this.rt=this._instance.on("eventCaptured",(t=>{try{this.St.T.includes(t.event)&&this.Vt("event")}catch(t){se.error("Could not activate event trigger",t)}})))}get sdkDebugProperties(){var{sessionStartTimestamp:t}=this.D.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.At.data.length,$sdk_debug_replay_internal_buffer_size:this.At.size,$sdk_debug_current_session_duration:this.Qt,$sdk_debug_session_start:t}}Jt(){var t;if(!this.U){var e,r,n,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this._instance.config.session_recording;for(var[s,a]of Object.entries(o||{}))s in i&&("maskInputOptions"===s?i.maskInputOptions=u({password:!0},a):i[s]=a);if(this.Rt&&this.Rt.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.Rt.fps},i.dataURLOptions={type:"image/webp",quality:this.Rt.quality}),this.Nt)i.maskAllInputs=null===(e=this.Nt.maskAllInputs)||void 0===e||e,i.maskTextSelector=null!==(r=this.Nt.maskTextSelector)&&void 0!==r?r:void 0,i.blockSelector=null!==(n=this.Nt.blockSelector)&&void 0!==n?n:void 0;var l=le();if(l){this.Ht=null!==(t=this.Ht)&&void 0!==t?t:new re(l,{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";se.info(r,{node:e}),this.log(oe+" "+r,"warn")}});var d=this.Ft();this.U=l(u({emit:t=>{this.onRRwebEmit(t)},plugins:d},i)),this.P=Date.now(),this.$=A(this.$)?this.$:"unknown",this.tryAddCustomEvent("$remote_config_received",this.K),this.ct("$session_options",{sessionRecordingOptions:i,activePlugins:d.map((t=>null==t?void 0:t.name))}),this.ct("$posthog_config",{config:this._instance.config})}else se.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.ct(t,e)}}var ge,Ie=["type"],ye=Object.defineProperty,be=(t,e,r)=>((t,e,r)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ce=Object.defineProperty,we=(t,e,r)=>((t,e,r)=>e in t?Ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Se=(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))(Se||{}),Ae={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ke={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Ne={};function Re(t){if(Ne[t])return Ne[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,n=t in Ae?Ae[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in ke?ke[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return Ne[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Ne[t]=l:e.prototype}catch(t){return e.prototype}}var Te={};function Me(t,e,r){var n,i=t+"."+String(r);if(Te[i])return Te[i].call(e);var o=Re(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Te[i]=s,s.call(e)):e[r]}var Fe={};function _e(t,e,r){var n=t+"."+String(r);if(Fe[n])return Fe[n].bind(e);var i=Re(t)[r];return"function"!=typeof i?e[r]:(Fe[n]=i,i.bind(e))}var Be={childNodes:function(t){return Me("Node",t,"childNodes")},parentNode:function(t){return Me("Node",t,"parentNode")},parentElement:function(t){return Me("Node",t,"parentElement")},textContent:function(t){return Me("Node",t,"textContent")},contains:function(t,e){return _e("Node",t,"contains")(e)},getRootNode:function(t){return _e("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Me("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Me("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Me("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Me("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Re("MutationObserver").constructor}};function Oe(t){return t.nodeType===t.ELEMENT_NODE}function xe(t){var e=t&&"host"in t&&"mode"in t&&Be.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Be.shadowRoot(e)===t)}function Ze(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function Ye(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>Ee(e,t.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(t){return null}var n}function Ee(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=Ye(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)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?Ue(r,t.styleSheet.href):r}var n,i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),e?Ue(i,e):i}function Ge(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let Le=class{constructor(){we(this,"idNodeMap",new Map),we(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){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function We(t){var{element:e,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:s}=t,a=o||"",u=i&&De(i);return(r[n.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function De(t){return t.toLowerCase()}var Ve="__rrweb_original__";function Xe(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?De(e):null}function ze(t,e){var r,n;try{n=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var Je=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ke=/^(?:[a-z+]+:)?\/\//i,He=/^www\..*/i,je=/^(data:)([^,]*),(.*)/i;function Ue(t,e){return(t||"").replace(Je,((t,r,n,i,o,s)=>{var a,u=n||o||s,l=r||i||"";if(!u)return t;if(Ke.test(u)||He.test(u))return"url("+l+u+l+")";if(je.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var d=e.split("/"),c=u.split("/");for(var h of(d.pop(),c))"."!==h&&(".."===h?d.pop():d.push(h));return"url("+l+d.join("/")+l+")"}))}var Pe,qe,Qe=1,$e=new RegExp("[^a-z0-9-_:]"),tr=-2;function er(){return Qe++}var rr=/^[^ \t\n\r\u000c]+/,nr=/^[, \t\n\r\u000c]+/;var ir=new WeakMap;function or(t,e){return e&&""!==e.trim()?ar(t,e):e}function sr(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function ar(t,e){var r=ir.get(t);if(r||(r=t.createElement("a"),ir.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function ur(t,e,r,n){return n?"src"===r||"href"===r&&("use"!==e||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?or(t,n):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function n(t){var n,i=t.exec(e.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(nr),!(r>=e.length);){var o=n(rr);if(","===o.slice(-1))o=or(t,o.substring(0,o.length-1)),i.push(o);else{var s="";o=or(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){i.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,i.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return i.join(", ")}(t,n):"style"===r?Ue(n,ar(t)):"object"===e&&"data"===r?or(t,n):n:or(t,n):n}function lr(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function dr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&dr(Be.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&dr(Be.parentNode(t),e,r)}function cr(t,e,r,n){var i;if(Oe(t)){if(i=t,!Be.childNodes(i).length)return!1}else{if(null===Be.parentElement(t))return!1;i=Be.parentElement(t)}try{if("string"==typeof e){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(dr(i,e,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(t){}return!1}function hr(t,e){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:d,dataURLOptions:c={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m=!1}=e,p=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,n);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Se.Document,childNodes:[],compatMode:t.compatMode}:{type:Se.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Se.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:p};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:v=!1,rootId:f}=e,m=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,i,o),p=function(t){if(t instanceof HTMLFormElement)return"form";var e=De(t.tagName);return $e.test(e)?"div":e}(t),g={},I=t.attributes.length,y=0;y<I;y++){var b=t.attributes[y];lr(p,b.name,b.value)||(g[b.name]=ur(n,p,De(b.name),b.value))}if("link"===p&&s){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=Ge(n,C);if(!w&&C.includes(".css"))w=Ge(n,window.location.origin+"/"+C.replace(window.location.href,""));var S=null;w&&(S=Ye(w)),S&&(delete g.rel,delete g.href,g._cssText=S)}}if("style"===p&&t.sheet&&!(t.innerText||Be.textContent(t)||"").trim().length){var A=Ye(t.sheet);A&&(g._cssText=A)}if("input"===p||"textarea"===p||"select"===p){var k=t.value,N=t.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&k?g.value=We({element:t,type:Xe(t),tagName:p,value:k,maskInputOptions:a,maskInputFn:u}):N&&(g.checked=N)}"option"===p&&(t.selected&&!a.select?g.selected=!0:delete g.selected);if("dialog"===p&&t.open)try{g.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){g.rr_open_mode="modal",g.ph_rr_could_not_detect_modal=!0}if("canvas"===p&&c)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var n=0;n<t.height;n+=50){var i=e.getImageData,o=Ve in i?i[Ve]:i;if(new Uint32Array(o.call(e,r,n,Math.min(50,t.width-r),Math.min(50,t.height-n)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(g.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var R=t.toDataURL(l.type,l.quality),T=n.createElement("canvas");T.width=t.width,T.height=t.height,R!==T.toDataURL(l.type,l.quality)&&(g.rr_dataURL=R)}if("img"===p&&d){Pe||(Pe=n.createElement("canvas"),qe=Pe.getContext("2d"));var M=t,F=M.currentSrc||M.getAttribute("src")||"<unknown-src>",_=M.crossOrigin,B=()=>{M.removeEventListener("load",B);try{Pe.width=M.naturalWidth,Pe.height=M.naturalHeight,qe.drawImage(M,0,0),g.rr_dataURL=Pe.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==M.crossOrigin)return M.crossOrigin="anonymous",void(M.complete&&0!==M.naturalWidth?B():M.addEventListener("load",B));console.warn("Cannot inline img src="+F+"! Error: "+t)}"anonymous"===M.crossOrigin&&(_?g.crossOrigin=_:M.removeAttribute("crossorigin"))};M.complete&&0!==M.naturalWidth?B():M.addEventListener("load",B)}if("audio"===p||"video"===p){var O=g;O.rr_mediaState=t.paused?"paused":"played",O.rr_mediaCurrentTime=t.currentTime,O.rr_mediaPlaybackRate=t.playbackRate,O.rr_mediaMuted=t.muted,O.rr_mediaLoop=t.loop,O.rr_mediaVolume=t.volume}v||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop));if(m){var{width:x,height:Z}=t.getBoundingClientRect();g={class:g.class,rr_width:x+"px",rr_height:Z+"px"}}"iframe"!==p||h(g.src)||(t.contentDocument||(g.rr_src=g.src),delete g.src);try{customElements.get(p)&&(r=!0)}catch(t){}return{type:Se.Element,tagName:p,attributes:g,childNodes:[],isSVG:sr(t)||void 0,needBlock:m,rootId:f,isCustom:r}}(t,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,dataURLOptions:c,inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m,rootId:p});case t.TEXT_NODE:return function(t,e){var r,{needsMask:n,maskTextFn:i,rootId:o}=e,s=Be.parentNode(t),a=s&&s.tagName,u=Be.textContent(t),l="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=Ye(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=Ue(u,ar(e.doc))}d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&n&&(u=i?i(u,Be.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:Se.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:p});case t.CDATA_SECTION_NODE:return{type:Se.CDATA,textContent:"",rootId:p};case t.COMMENT_NODE:return{type:Se.Comment,textContent:Be.textContent(t)||"",rootId:p};default:return!1}}function vr(t){return null==t?"":t.toLowerCase()}function fr(t,e){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:d={},maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=(()=>!1),newlyAddedElement:S=!1}=e,{needsMask:A}=e,{preserveWhiteSpace:k=!0}=e;A||(A=cr(t,s,a,void 0===A));var N,R=hr(t,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,dataURLOptions:f,inlineImages:m,recordCanvas:p,keepIframeSrcFn:w,newlyAddedElement:S});if(!R)return console.warn(t,"not serialized"),null;N=n.hasNode(t)?n.getId(t):!function(t,e){if(e.comment&&t.type===Se.Comment)return!0;if(t.type===Se.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"===ze(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(vr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===vr(t.attributes.name)||"icon"===vr(t.attributes.rel)||"apple-touch-icon"===vr(t.attributes.rel)||"shortcut icon"===vr(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&vr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(vr(t.attributes.property).match(/^(og|twitter|fb):/)||vr(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===vr(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===vr(t.attributes.name)||"googlebot"===vr(t.attributes.name)||"bingbot"===vr(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===vr(t.attributes.name)||"generator"===vr(t.attributes.name)||"framework"===vr(t.attributes.name)||"publisher"===vr(t.attributes.name)||"progid"===vr(t.attributes.name)||vr(t.attributes.property).match(/^article:/)||vr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===vr(t.attributes.name)||"yandex-verification"===vr(t.attributes.name)||"csrf-token"===vr(t.attributes.name)||"p:domain_verify"===vr(t.attributes.name)||"verify-v1"===vr(t.attributes.name)||"verification"===vr(t.attributes.name)||"shopify-checkout-api-token"===vr(t.attributes.name)))return!0}}return!1}(R,v)&&(k||R.type!==Se.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?er():tr;var T=Object.assign(R,{id:N});if(n.add(t,T),N===tr)return null;g&&g(t);var M=!u;if(T.type===Se.Element){M=M&&!T.needBlock,delete T.needBlock;var F=Be.shadowRoot(t);F&&Ze(F)&&(T.isShadowHost=!0)}if((T.type===Se.Document||T.type===Se.Element)&&M){v.headWhitespace&&T.type===Se.Element&&"head"===T.tagName&&(k=!1);var _={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w};if(T.type===Se.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else for(var B of Array.from(Be.childNodes(t))){var O=fr(B,_);O&&T.childNodes.push(O)}var x=null;if(Oe(t)&&(x=Be.shadowRoot(t)))for(var Z of Array.from(Be.childNodes(x))){var Y=fr(Z,_);Y&&(Ze(x)&&(Y.isShadow=!0),T.childNodes.push(Y))}}var E=Be.parentNode(t);return E&&xe(E)&&Ze(E)&&(T.isShadow=!0),T.type===Se.Element&&"iframe"===T.tagName&&function(t,e,r){var n=t.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(t){return}if("complete"===i){var s="about:blank";if(n.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=fr(e,{doc:e,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});r&&I(t,r)}}),y),T.type===Se.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===ze(T.attributes.href))&&function(t,e,r){var n,i=!1;try{n=t.sheet}catch(t){return}if(!n){var o=setTimeout((()=>{i||(e(),i=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),i=!0,e()}))}}(t,(()=>{if(b){var e=fr(t,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});e&&b(t,e)}}),C),T}let mr=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 pr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},gr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Ir={};function yr(t){if(Ir[t])return Ir[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,n=t in pr?pr[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in gr?gr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return Ir[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Ir[t]=l:r}catch(t){return r}}var br={};function Cr(t,e,r){var n,i=t+"."+String(r);if(br[i])return br[i].call(e);var o=yr(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(br[i]=s,s.call(e)):e[r]}var wr={};function Sr(t,e,r){var n=t+"."+String(r);if(wr[n])return wr[n].bind(e);var i=yr(t)[r];return"function"!=typeof i?e[r]:(wr[n]=i,i.bind(e))}function Ar(){return yr("MutationObserver").constructor}var kr={childNodes:function(t){return Cr("Node",t,"childNodes")},parentNode:function(t){return Cr("Node",t,"parentNode")},parentElement:function(t){return Cr("Node",t,"parentElement")},textContent:function(t){return Cr("Node",t,"textContent")},contains:function(t,e){return Sr("Node",t,"contains")(e)},getRootNode:function(t){return Sr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Cr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Cr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Cr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Cr("Element",t,"querySelectorAll")(e)},mutationObserver:Ar};function Nr(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}var Rr="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.",Tr={map:{},getId:()=>(console.error(Rr),-1),getNode:()=>(console.error(Rr),null),removeNodeFromMap(){console.error(Rr)},has:()=>(console.error(Rr),!1),reset(){console.error(Rr)}};function Mr(t,e,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}}function Fr(t,e,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>Fr(t,e,o||{},!0)}function _r(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Tr=new Proxy(Tr,{get:(t,e,r)=>("map"===e&&console.error(Rr),Reflect.get(t,e,r))}));var Br=Date.now;function Or(t){var e,r,n,i,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=kr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=kr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function xr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Yr(t){return t?t.nodeType===t.ELEMENT_NODE?t:kr.parentElement(t):null}function Er(t,e,r,n){if(!t)return!1;var i=Yr(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(dr(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Gr(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===tr}function Lr(t,e){if(xe(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var n=kr.parentNode(t);return(!n||n.nodeType!==t.DOCUMENT_NODE)&&(!n||Lr(n,e))}function Wr(t){return Boolean(t.changedTouches)}function Dr(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Vr(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Xr(t){return!!t&&(t instanceof mr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(kr.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Br=()=>(new Date).getTime());let zr=class{constructor(){be(this,"id",1),be(this,"styleIDMap",new WeakMap),be(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 Jr(t){var e,r=null;return"getRootNode"in t&&(null==(e=kr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&kr.host(kr.getRootNode(t))&&(r=kr.host(kr.getRootNode(t))),r}function Kr(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Jr(r);)r=e;return r}(t);return kr.contains(e,r)}function Hr(t){var e=t.ownerDocument;return!!e&&(kr.contains(e,t)||Kr(t))}var jr=(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))(jr||{}),Ur=(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))(Ur||{}),Pr=(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))(Pr||{}),qr=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(qr||{}),Qr=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Qr||{}),$r=(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))($r||{});function tn(t){return"__ln"in t}class en{constructor(){be(this,"length",0),be(this,"head",null),be(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;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&&tn(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&&tn(t.nextSibling)&&t.nextSibling.__ln.previous){var n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){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 rn,nn=(t,e)=>t+"@"+e;class on{constructor(){be(this,"frozen",!1),be(this,"locked",!1),be(this,"texts",[]),be(this,"attributes",[]),be(this,"attributeMap",new WeakMap),be(this,"removes",[]),be(this,"mapRemoves",[]),be(this,"movedMap",{}),be(this,"addedSet",new Set),be(this,"movedSet",new Set),be(this,"droppedSet",new Set),be(this,"mutationCb"),be(this,"blockClass"),be(this,"blockSelector"),be(this,"maskTextClass"),be(this,"maskTextSelector"),be(this,"inlineStylesheet"),be(this,"maskInputOptions"),be(this,"maskTextFn"),be(this,"maskInputFn"),be(this,"keepIframeSrcFn"),be(this,"recordCanvas"),be(this,"inlineImages"),be(this,"slimDOMOptions"),be(this,"dataURLOptions"),be(this,"doc"),be(this,"mirror"),be(this,"iframeManager"),be(this,"stylesheetManager"),be(this,"shadowDomManager"),be(this,"canvasManager"),be(this,"processedNodeManager"),be(this,"unattachedDoc"),be(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),be(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new en,n=t=>{for(var e=t,r=tr;r===tr;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},i=i=>{var o=kr.parentNode(i);if(o&&Hr(i)&&"TEXTAREA"!==o.tagName){var s=xe(o)?this.mirror.getId(Jr(i)):this.mirror.getId(o),a=n(i);if(-1===s||-1===a)return r.addNode(i);var u=fr(i,{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=>{Dr(t,this.mirror)&&this.iframeManager.addIframe(t),Vr(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Xr(i)&&this.shadowDomManager.addShadowRoot(kr.shadowRoot(i),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)an(this.removes,o,this.mirror)&&!this.movedSet.has(kr.parentNode(o))||i(o);for(var s of this.addedSet)un(this.droppedSet,s)||an(this.removes,s,this.mirror)?un(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(kr.parentNode(a.value)),d=n(a.value);-1!==l&&-1!==d&&(u=a)}if(!u)for(var c=r.tail;c;){var h=c;if(c=c.previous,h){var v=this.mirror.getId(kr.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=h.value,m=kr.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=kr.host(m);if(-1!==this.mirror.getId(p)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),i(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=kr.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),n=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+n).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};(g.texts.length||g.attributes.length||g.removes.length||g.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(g))}})),be(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(kr.childNodes(t),(t=>kr.textContent(t)||"")).join("")})),be(this,"processMutation",(t=>{if(!Gr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=kr.textContent(t.target);Er(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:cr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Yr(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if("value"===n){var o=Xe(r);i=We({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Er(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===n&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!lr(r.tagName,n))if(s.attributes[n]=ur(this.doc,De(r.tagName),De(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),d=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===d?l:[l,d]:s._unchangedStyles[u]=[l,d]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Er(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),n=xe(t.target)?this.mirror.getId(kr.host(t.target)):this.mirror.getId(t.target);Er(t.target,this.blockClass,this.blockSelector,!1)||Gr(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(sn(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Lr(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[nn(r,n)]?sn(this.movedSet,e):this.removes.push({parentId:n,id:r,isShadow:!(!xe(t.target)||!Ze(t.target))||void 0})),this.mapRemoves.push(e))}))}})),be(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Gr(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[nn(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Er(t,this.blockClass,this.blockSelector,!1)||(kr.childNodes(t).forEach((t=>this.genAdds(t))),Xr(t)&&kr.childNodes(kr.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 sn(t,e){t.delete(e),kr.childNodes(e).forEach((e=>sn(t,e)))}function an(t,e,r){return 0!==t.length&&function(t,e,r){var n,i=kr.parentNode(e),o=function(){var e=r.getId(i);if(t.some((t=>t.id===e)))return{v:!0};i=kr.parentNode(i)};for(;i;)if(n=o())return n.v;return!1}(t,e,r)}function un(t,e){return 0!==t.size&&ln(t,e)}function ln(t,e){var r=kr.parentNode(e);return!!r&&(!!t.has(r)||ln(t,r))}var dn=t=>{if(!rn)return t;return function(){try{return t(...arguments)}catch(t){if(rn&&!0===rn(t))return;throw t}}},cn=[];function hn(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 vn(t,e){var r=new on;cn.push(r),r.init(t);var n=new(Ar())(dn(r.processMutations.bind(r)));return n.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function fn(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;if(!1===s.mouseInteraction)return()=>{};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],d=null;return Object.keys(Pr).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var s=De(t),a=(t=>r=>{var s=hn(r);if(!Er(s,i,o,!0)){var a=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":a=qr.Mouse;break;case"touch":a=qr.Touch;break;case"pen":a=qr.Pen}a===qr.Touch?Pr[t]===Pr.MouseDown?l="TouchStart":Pr[t]===Pr.MouseUp&&(l="TouchEnd"):qr.Pen}else Wr(r)&&(a=qr.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===qr.Touch||l.startsWith("Mouse")&&a===qr.Mouse)&&(a=null)):Pr[t]===Pr.Click&&(a=d,d=null);var c=Wr(r)?r.changedTouches[0]:r;if(c){var h=n.getId(s),{clientX:v,clientY:f}=c;dn(e)(u({type:Pr[l],id:h,x:v,y:f},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch(Pr[t]){case Pr.MouseDown:case Pr.MouseUp:s=s.replace("mouse","pointer");break;case Pr.TouchStart:case Pr.TouchEnd:return}l.push(Nr(s,a,r))})),dn((()=>{l.forEach((t=>t()))}))}function mn(t){var{scrollCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;return Nr("scroll",dn(Mr(dn((t=>{var s=hn(t);if(s&&!Er(s,i,o,!0)){var a=n.getId(s);if(s===r&&r.defaultView){var u=Or(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var pn=["INPUT","TEXTAREA","SELECT"],gn=new WeakMap;function In(t){return function(t,e){if(wn("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||wn("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||wn("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||wn("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function yn(t,e,r){var n,i;return t?(t.ownerNode?n=e.getId(t.ownerNode):i=r.getId(t),{styleId:i,id:n}):{}}function bn(t,e){var r,n,i,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(kr.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),dn((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Cn(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:c,fontCb:h,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),n(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),i(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),d(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),h(...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=vn(t,t.doc));var i=function(t){var{mousemoveCb:e,sampling:r,doc:n,mirror:i}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Mr(dn((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),d=dn(Mr(dn((t=>{var e=hn(t),{clientX:r,clientY:n}=Wr(t)?t.changedTouches[0]:t;o||(o=Br()),u.push({x:r,y:n,id:i.getId(e),timeOffset:Br()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Ur.Drag:t instanceof MouseEvent?Ur.MouseMove:Ur.TouchMove)})),s,{trailing:!1})),c=[Nr("mousemove",d,n),Nr("touchmove",d,n),Nr("drag",d,n)];return dn((()=>{c.forEach((t=>t()))}))}(t),o=fn(t),s=mn(t),a=function(t,e){var{viewportResizeCb:r}=t,{win:n}=e,i=-1,o=-1;return Nr("resize",dn(Mr(dn((()=>{var t=xr(),e=Zr();i===t&&o===e||(r({width:Number(e),height:Number(t)}),i=t,o=e)})),200)),n)}(t,{win:n}),l=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:c,userTriggeredOnInput:h}=t;function v(t){var e=hn(t),n=t.isTrusted,u=e&&e.tagName;if(e&&"OPTION"===u&&(e=kr.parentElement(e)),e&&u&&!(pn.indexOf(u)<0)&&!Er(e,i,o,!0)&&!(e.classList.contains(s)||a&&e.matches(a))){var c=e.value,v=!1,m=Xe(e)||"";"radio"===m||"checkbox"===m?v=e.checked:(l[u.toLowerCase()]||l[m])&&(c=We({element:e,maskInputOptions:l,tagName:u,type:m,value:c,maskInputFn:d})),f(e,h?{text:c,isChecked:v,userTriggered:n}:{text:c,isChecked:v});var p=e.name;"radio"===m&&p&&v&&r.querySelectorAll('input[type="radio"][name="'+p+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,r){var i=gn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){gn.set(t,r);var o=n.getId(t);dn(e)(u({},r,{id:o}))}}var m=("last"===c.input?["change"]:["input","change"]).map((t=>Nr(t,dn(v),r))),p=r.defaultView;if(!p)return()=>{m.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),I=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...I.map((t=>Fr(t[0],t[1],{set(){dn(v)({target:this,isTrusted:!1})}},!1,p)))),dn((()=>{m.forEach((t=>t()))}))}(t),d=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:s}=t,a=dn((t=>Mr(dn((o=>{var s=hn(o);if(s&&!Er(s,r,n,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:d,loop:c}=s;e({type:t,id:i.getId(s),currentTime:a,volume:u,muted:l,playbackRate:d,loop:c})}})),o.media||500))),u=[Nr("play",a($r.Play),s),Nr("pause",a($r.Pause),s),Nr("seeked",a($r.Seeked),s),Nr("volumechange",a($r.VolumeChange),s),Nr("ratechange",a($r.RateChange),s)];return dn((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},h=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:dn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=yn(e,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var n=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var d={};Sn("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(Sn("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),Sn("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),Sn("CSSSupportsRule")&&(d.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:dn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=yn(e.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...In(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e.parentStyleSheet,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...In(e),s]}]}),t.apply(e,o)}))})})),dn((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),h=bn(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:dn(((t,e,s)=>{var u,[l,d,c]=s;if(i.has(l))return a.apply(e,[l,d,c]);var{id:h,styleId:v}=yn(null==(u=e.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:d,priority:c},index:In(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:dn(((t,e,s)=>{var a,[l]=s;if(i.has(l))return u.apply(e,[l]);var{id:d,styleId:c}=yn(null==(a=e.parentRule)?void 0:a.parentStyleSheet,n,o.styleMirror);return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:In(e.parentRule)}),t.apply(e,s)}))}),dn((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,r){var n=new s(t,e,r);return o.set(n,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n};var a=_r(r.fonts,"add",(function(t){return function(r){return setTimeout(dn((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return i.push((()=>{n.FontFace=s})),i.push(a),dn((()=>{i.forEach((t=>t()))}))}(t)));var m=function(t){var{doc:e,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=t,s=!0,a=dn((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var d=t.getRangeAt(l),{startContainer:c,startOffset:h,endContainer:v,endOffset:f}=d;Er(c,n,i,!0)||Er(v,n,i,!0)||a.push({start:r.getId(c),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),Nr("selectionchange",a)}(t),p=function(t){var{doc:e,customElementCb:r}=t,n=e.defaultView;return n&&n.customElements?_r(n.customElements,"define",(function(t){return function(e,n,i){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,n,i])}})):()=>{}}(t),g=[];for(var I of t.plugins)g.push(I.observer(I.callback,n,I.options));return dn((()=>{cn.forEach((t=>t.reset())),null==r||r.disconnect(),i(),o(),s(),a(),l(),d(),c(),h(),v(),f(),m(),p(),g.forEach((t=>t()))}))}function wn(t){return void 0!==window[t]}function Sn(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class An{constructor(t){be(this,"iframeIdToRemoteIdMap",new WeakMap),be(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,n){var i=r||this.getIdToRemoteIdMap(t),o=n||this.getRemoteIdToIdMap(t),s=i.get(e);return s||(s=this.generateIdFn(),i.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,n)))}getRemoteId(t,e,r){var n=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var i=n.get(e);return i||-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||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class kn{constructor(t){be(this,"iframes",new WeakMap),be(this,"crossOriginIframeMap",new WeakMap),be(this,"crossOriginIframeMirror",new An(er)),be(this,"crossOriginIframeStyleMirror"),be(this,"crossOriginIframeRootIdMap",new WeakMap),be(this,"mirror"),be(this,"mutationCb"),be(this,"wrappedEmit"),be(this,"loadListener"),be(this,"stylesheetManager"),be(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new An(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,n;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==(n=this.loadListener)||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){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 n=this.transformCrossOriginEvent(r,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case jr.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:jr.IncrementalSnapshot,data:{source:Ur.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case jr.Meta:case jr.Load:case jr.DomContentLoaded:return!1;case jr.Plugin:return e;case jr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case jr.IncrementalSnapshot:switch(e.data.source){case Ur.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 Ur.Drag:case Ur.TouchMove:case Ur.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Ur.ViewportResize:return!1;case Ur.MediaInteraction:case Ur.MouseInteraction:case Ur.Scroll:case Ur.CanvasMutation:case Ur.Input:return this.replaceIds(e.data,t,["id"]),e;case Ur.StyleSheetRule:case Ur.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Ur.Font:return e;case Ur.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Ur.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,n){for(var i of n)(Array.isArray(e[i])||"number"==typeof e[i])&&(Array.isArray(e[i])?e[i]=t.getIds(r,e[i]):e[i]=t.getId(r,e[i]));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===Se.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Nn{constructor(t){be(this,"shadowDoms",new WeakSet),be(this,"mutationCb"),be(this,"scrollCb"),be(this,"bypassOptions"),be(this,"mirror"),be(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(Ze(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=vn(u({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(mn(u({},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(kr.host(t))),this.restoreHandlers.push(bn({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(_r(t.prototype,"attachShadow",(function(t){return function(n){var i=t.call(this,n),o=kr.shadowRoot(this);return o&&Hr(this)&&r.addShadowRoot(o,e),i}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Mn=0;Mn<64;Mn++)Tn[Rn.charCodeAt(Mn)]=Mn;var Fn=new Map;var _n=(t,e,r)=>{if(t&&(xn(t,e)||"object"==typeof t)){var n=function(t,e){var r=Fn.get(t);return r||(r=new Map,Fn.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),i=n.indexOf(t);return-1===i&&(i=n.length,n.push(t)),i}};function Bn(t,e,r){if(t instanceof Array)return t.map((t=>Bn(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),n=r.length,i="";for(e=0;e<n;e+=3)i+=Rn[r[e]>>2],i+=Rn[(3&r[e])<<4|r[e+1]>>4],i+=Rn[(15&r[e+1])<<2|r[e+2]>>6],i+=Rn[63&r[e+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Bn(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var n=t.constructor.name,{src:i}=t;return{rr_type:n,src:i}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Bn(t.data,e,r),t.width,t.height]}:xn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:_n(t,e,r)}:t}var On=(t,e,r)=>t.map((t=>Bn(t,e,r))),xn=(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 Zn(t,e,r,n){var i=[];try{var o=_r(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Er(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(i);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[i,...s])}}));i.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((t=>t()))}}function Yn(t,e,r,n,i,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=_r(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var d=t.apply(this,u);if(_n(d,o,this),"tagName"in this.canvas&&!Er(this.canvas,n,i,!0)){var c=On(u,o,this),h={type:e,property:a,args:c};r(this.canvas,h)}return d}}));s.push(u)}catch(n){var l=Fr(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(l)}};for(var l of a)u(l);return s}var En,Gn,Ln,Wn,Dn="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Vn="undefined"!=typeof window&&window.Blob&&new Blob([(En=Dn,Uint8Array.from(atob(En),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Xn(t){var e;try{if(!(e=Vn&&(window.URL||window.webkitURL).createObjectURL(Vn)))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,"+Dn,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class zn{constructor(t){be(this,"pendingCanvasMutations",new Map),be(this,"rafStamps",{latestId:0,invokeId:null}),be(this,"mirror"),be(this,"mutationCb"),be(this,"resetObservers"),be(this,"frozen",!1),be(this,"locked",!1),be(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:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,n,i){var o=this,s=Zn(e,r,n,!0),u=new Map,l=new Xn;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:n,width:i,height:o}=t.data;this.mutationCb({id:e,type:Qr["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var d,c=1e3/t,h=0,v=t=>{var s,f;h&&t-h<c?d=requestAnimationFrame(v):(h=t,(s=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{Er(t,r,n,!0)||s.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(e.document),s).forEach(function(){var t=a((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);!1===(null==(e=null==n?void 0:n.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var s=t.clientWidth||t.width,a=t.clientHeight||t.height,d=yield createImageBitmap(t,{resizeWidth:s,resizeHeight:a});l.postMessage({id:r,bitmap:d,width:s,height:a,dataURLOptions:i.dataURLOptions},[d])}}));return function(e){return t.apply(this,arguments)}}()),d=requestAnimationFrame(v))};d=requestAnimationFrame(v),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Zn(t,e,r,!1),i=function(t,e,r,n){var i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=_r(e.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return Er(this.canvas,r,n,!0)||setTimeout((()=>{var r=On(a,e,this);t(this.canvas,{type:Qr["2D"],property:o,args:r})}),0),i.apply(this,a)}}));i.push(s)}catch(r){var a=Fr(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:Qr["2D"],property:o,args:[e],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,n){var i=[];return i.push(...Yn(e.WebGLRenderingContext.prototype,Qr.WebGL,t,r,n,e)),void 0!==e.WebGL2RenderingContext&&i.push(...Yn(e.WebGL2RenderingContext.prototype,Qr.WebGL2,t,r,n,e)),()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{n(),i(),o()}}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 n=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,Ie);return e})),{type:i}=r[0];this.mutationCb({id:e,type:i,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Jn{constructor(t){be(this,"trackedLinkElements",new WeakSet),be(this,"mutationCb"),be(this,"adoptedStyleSheetCb"),be(this,"styleMirror",new zr),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 n={id:e,styleIds:[]},i=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:Ee(e,t.href),index:r})))})),n.styleIds.push(e)};for(var s of t)o(s);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Kn{constructor(){be(this,"nodeMap",new WeakMap),be(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 Hn=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var jn=document.createElement("iframe");document.body.appendChild(jn),Array.from=(null==(ge=jn.contentWindow)?void 0:ge.Array.from)||Array.from,document.body.removeChild(jn)}}catch(t){console.debug("Unable to override Array.from",t)}var Un,Pn,qn=new Le;function Qn(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:v,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:I,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:S=!1,recordCrossOriginIframes:A=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:N=!1,collectFonts:R=!1,inlineImages:T=!1,plugins:M,keepIframeSrcFn:F=(()=>!1),ignoreCSSAttributes:_=new Set([]),errorHandler:B}=t;rn=B;var O=!A||window.parent===window,x=!1;if(!O)try{window.parent.document&&(x=!1)}catch(t){x=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!x)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),qn.reset();var Z,Y=!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}: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=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var G=0,L=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!x&&(t=I(t)),t};Gn=(t,i)=>{var o,s=t;if(s.timestamp=Br(),!(null==(o=cn[0])?void 0:o.isFrozen())||s.type===jr.FullSnapshot||s.type===jr.IncrementalSnapshot&&s.data.source===Ur.Mutation||cn.forEach((t=>t.unfreeze())),O)null==e||e(L(s),i);else if(x){var a={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(s.type===jr.FullSnapshot)Z=s,G=0;else if(s.type===jr.IncrementalSnapshot){if(s.data.source===Ur.Mutation&&s.data.isAttachIframe)return;G++;var u=n&&G>=n,l=r&&s.timestamp-Z.timestamp>r;(u||l)&&Ln(!0)}};var W=t=>{Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Mutation},t)})},D=t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Scroll},t)}),V=t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.CanvasMutation},t)}),X=new Jn({mutationCb:W,adoptedStyleSheetCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.AdoptedStyleSheet},t)})}),z=new kn({mirror:qn,mutationCb:W,stylesheetManager:X,recordCrossOriginIframes:A,wrappedEmit:Gn});for(var J of M||[])J.getMirror&&J.getMirror({nodeMirror:qn,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new Kn;Wn=new zn({recordCanvas:S,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:qn,sampling:y.canvas,dataURLOptions:b});var H=new Nn({mutationCb:W,scrollCb:D,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskInputOptions:Y,dataURLOptions:b,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:T,sampling:y,slimDOMOptions:E,iframeManager:z,stylesheetManager:X,canvasManager:Wn,keepIframeSrcFn:F,processedNodeManager:K},mirror:qn});Ln=function(t){if(void 0===t&&(t=!1),w){Gn({type:jr.Meta,data:{href:window.location.href,width:Zr(),height:xr()}},t),X.reset(),H.init(),cn.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new Le,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:c,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C=(()=>!1)}=e||{};return fr(t,{doc:t,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:c,maskInputFn:h,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:u,recordCanvas:l,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:qn,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Y,maskTextFn:p,maskInputFn:m,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:t=>{Dr(t,qn)&&z.addIframe(t),Vr(t,qn)&&X.trackLinkElement(t),Xr(t)&&H.addShadowRoot(kr.shadowRoot(t),document)},onIframeLoad:(t,e)=>{z.attachIframe(t,e),H.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{X.attachLinkElement(t,e)},keepIframeSrcFn:F});if(!e)return console.warn("Failed to snapshot the document");Gn({type:jr.FullSnapshot,data:{node:e,initialOffset:Or(window)}},t),cn.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,qn.getId(document))}};try{var j=[],U=t=>{var e;return dn(Cn)({mutationCb:W,mousemoveCb:(t,e)=>Gn({type:jr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.MouseInteraction},t)}),scrollCb:D,viewportResizeCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.ViewportResize},t)}),inputCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Input},t)}),mediaInteractionCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.MediaInteraction},t)}),styleSheetRuleCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.StyleSheetRule},t)}),styleDeclarationCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Font},t)}),selectionCb:t=>{Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Selection},t)})},customElementCb:t=>{Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.CustomElement},t)})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:d,maskInputOptions:Y,inlineStylesheet:c,sampling:y,recordDOM:w,recordCanvas:S,inlineImages:T,userTriggeredOnInput:N,collectFonts:R,doc:t,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:E,dataURLOptions:b,mirror:qn,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:Wn,ignoreCSSAttributes:_,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Gn({type:jr.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},g)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{Ln(),j.push(U(document)),Hn=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(Nr("DOMContentLoaded",(()=>{Gn({type:jr.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&P()}))),j.push(Nr("load",(()=>{Gn({type:jr.Load,data:{}}),"load"===k&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),Hn=!1,rn=void 0}}catch(t){console.warn(t)}}Qn.addCustomEvent=(t,e)=>{if(!Hn)throw new Error("please add custom event after start recording");Gn({type:jr.Custom,data:{tag:t,payload:e}})},Qn.freezePage=()=>{cn.forEach((t=>t.freeze()))},Qn.takeFullSnapshot=t=>{if(!Hn)throw new Error("please take full snapshot after start recording");Ln(t)},Qn.mirror=qn,(Pn=Un||(Un={}))[Pn.NotStarted=0]="NotStarted",Pn[Pn.Running=1]="Running",Pn[Pn.Stopped=2]="Stopped";var $n,ti=Object.defineProperty,ei=(t,e,r)=>((t,e,r)=>e in t?ti(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ri=Object.defineProperty,ni=(t,e,r)=>((t,e,r)=>e in t?ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ii=Object.defineProperty,oi=(t,e,r)=>((t,e,r)=>e in t?ii(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),si={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ai={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ui={};function li(t){if(ui[t])return ui[t];var e=globalThis[t],r=e.prototype,n=t in si?si[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in ai?ai[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return ui[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ui[t]=l:r}catch(t){return r}}var di={};function ci(t,e,r){var n,i=t+"."+String(r);if(di[i])return di[i].call(e);var o=li(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(di[i]=s,s.call(e)):e[r]}var hi={};function vi(t,e,r){var n=t+"."+String(r);if(hi[n])return hi[n].bind(e);var i=li(t)[r];return"function"!=typeof i?e[r]:(hi[n]=i,i.bind(e))}var fi={childNodes:function(t){return ci("Node",t,"childNodes")},parentNode:function(t){return ci("Node",t,"parentNode")},parentElement:function(t){return ci("Node",t,"parentElement")},textContent:function(t){return ci("Node",t,"textContent")},contains:function(t,e){return vi("Node",t,"contains")(e)},getRootNode:function(t){return vi("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ci("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ci("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ci("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ci("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return li("MutationObserver").constructor}};class mi{constructor(){oi(this,"idNodeMap",new Map),oi(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){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function pi(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&pi(fi.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&pi(fi.parentNode(t),e,r)}class gi{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 gi))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 Ii={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},yi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},bi={};function Ci(t){if(bi[t])return bi[t];var e=globalThis[t],r=e.prototype,n=t in Ii?Ii[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in yi?yi[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return bi[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?bi[t]=l:r}catch(t){return r}}var wi={};function Si(t,e,r){var n,i=t+"."+String(r);if(wi[i])return wi[i].call(e);var o=Ci(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(wi[i]=s,s.call(e)):e[r]}var Ai={};function ki(t,e,r){var n=t+"."+String(r);if(Ai[n])return Ai[n].bind(e);var i=Ci(t)[r];return"function"!=typeof i?e[r]:(Ai[n]=i,i.bind(e))}var Ni={childNodes:function(t){return Si("Node",t,"childNodes")},parentNode:function(t){return Si("Node",t,"parentNode")},parentElement:function(t){return Si("Node",t,"parentElement")},textContent:function(t){return Si("Node",t,"textContent")},contains:function(t,e){return ki("Node",t,"contains")(e)},getRootNode:function(t){return ki("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Si("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Si("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Si("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Si("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Ci("MutationObserver").constructor}};var Ri="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.",Ti={map:{},getId:()=>(console.error(Ri),-1),getNode:()=>(console.error(Ri),null),removeNodeFromMap(){console.error(Ri)},has:()=>(console.error(Ri),!1),reset(){console.error(Ri)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ti=new Proxy(Ti,{get:(t,e,r)=>("map"===e&&console.error(Ri),Reflect.get(t,e,r))}));var Mi=Date.now;function Fi(t){return t?t.nodeType===t.ELEMENT_NODE?t:Ni.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(Mi=()=>(new Date).getTime());function _i(t){var e,r=null;return"getRootNode"in t&&(null==(e=Ni.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Ni.host(Ni.getRootNode(t))&&(r=Ni.host(Ni.getRootNode(t))),r}function Bi(t){for(var e,r=t;e=_i(r);)r=e;return r}function Oi(t){var e=t.ownerDocument;if(!e)return!1;var r=Bi(t);return Ni.contains(e,r)}for(var xi=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){ni(this,"id",1),ni(this,"styleIDMap",new WeakMap),ni(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 Ti},closestElementOfNode:Fi,getBaseDimension:function t(e,r){var n,i,o=null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var n=e[r[0]];return 1===r.length?n:t(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:Bi,getShadowHost:_i,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,n,i,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=Ni.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=Ni.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof gi&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Ni.shadowRoot(t)))},hookSetter:function t(e,r,n,i,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,i?n:{set(t){setTimeout((()=>{n.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(Ni.contains(e,t)||Oi(t))},isAncestorRemoved:function t(e,r){if(i=(n=e)&&"host"in n&&"mode"in n&&fi.host(n)||null,Boolean(i&&"shadowRoot"in i&&fi.shadowRoot(i)===n))return!1;var n,i,o=r.getId(e);if(!r.has(o))return!0;var s=Ni.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,n){if(!t)return!1;var i=Fi(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(pi(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return 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 n=e.children.length-1;n>=0;n--)t(e.children[n],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return Mi},on:function(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var n={value:t,parent:r,children:[]};return e[t.node.id]=n,n},n=[];for(var i of t){var{nextId:o,parentId:s}=i;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(i,a.parent))}else{var l=n.indexOf(a);n.splice(l,0,r(i,null))}}else if(s in e){var d=e[s];d.children.push(r(i,d))}else n.push(r(i,null))}return n},shadowHostInDom:Oi,throttle:function(t,e,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],n=t.length;n--;){var i=t[n];e.has(i.id)||(r.push(i),e.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Zi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ei=0;Ei<64;Ei++)Yi[Zi.charCodeAt(Ei)]=Ei;var Gi;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var Li=document.createElement("iframe");document.body.appendChild(Li),Array.from=(null==($n=Li.contentWindow)?void 0:$n.Array.from)||Array.from,document.body.removeChild(Li)}}catch(t){console.debug("Unable to override Array.from",t)}new mi,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Gi||(Gi={}));class Wi{constructor(t){ei(this,"fileName"),ei(this,"functionName"),ei(this,"lineNumber"),ei(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 Di=/(^|@)\S+:\d+/,Vi=/^\s*at .*(\S+:\d+|\(native\))/m,Xi=/^(eval@)?(\[native code])?$/,zi={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Vi)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(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:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Vi)}),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+)\)$)/),n=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Wi({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Xi)}),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 Wi({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Wi({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(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:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Wi({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Wi({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Di)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),n=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Wi({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ji(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var n=t.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var s=n.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&i.push(s)}i.length>1&&(r+=":eq("+i.indexOf(t)+")"),e=r+(e?">"+e:""),t=n}return e}function Ki(t){return"[object Object]"===Object.prototype.toString.call(t)}function Hi(t,e){if(0===e)return!0;var r=Object.keys(t);for(var n of r)if(Ki(t[n])&&Hi(t[n],e-1))return!0;return!1}function ji(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var n=[],i=[];return JSON.stringify(t,(function(t,e){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,t):i.push(t),~n.indexOf(e)&&(e=n[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(e)).join(".")+"]")}else n.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Ki(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Ki(t)&&Hi(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Ji(u.length?u[0]:null):s[a]=u}return s}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 Ui={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 Pi(t,e,r){var n,i=r?Object.assign({},Ui,r):Ui,o=i.logger;if(!o)return()=>{};n="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(i.level.includes("error")){var l=e=>{var r=e.message,n=e.error,o=zi.parse(n).map((t=>t.toString())),s=[ji(r,i.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var d=e=>{var r,n;e.reason instanceof Error?n=[ji("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[ji("Uncaught (in promise)",i.stringifyOptions),ji(e.reason,i.stringifyOptions)]);var o=zi.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:n})};e.addEventListener("unhandledrejection",d),u.push((()=>{e.removeEventListener("unhandledrejection",d)}))}for(var c of i.level)u.push(h(n,c));return()=>{u.forEach((t=>t()))};function h(e,r){var n=this;return e[r]?xi.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(e.apply(n,u),!("assert"===r&&u[0]||a)){a=!0;try{var d=zi.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>ji(t,i.stringifyOptions)));++s<i.lengthThreshold?t({level:r,trace:d,payload:c}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[ji("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var qi=t=>({name:"rrweb/console@1",observer:Pi,options:t}),Qi=t=>t instanceof Document;function $i(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return g(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}function to(t,e){var r,n=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),i={hostname:n,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of e.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}var eo=_("[Recorder]"),ro=t=>"navigation"===t.entryType,no=t=>"resource"===t.entryType;function io(t,e,r){if(r.recordInitialRequests){var n=e.performance.getEntries().filter((t=>ro(t)||no(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:n.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new e.PerformanceObserver((e=>{var n=e.getEntries().filter((t=>ro(t)||no(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:n.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function oo(t,e){return!!e&&(A(e)||e[t])}function so(t){var{type:e,recordBody:r,headers:n,url:i}=t;function o(t){var e=Object.keys(n).find((t=>"content-type"===t.toLowerCase())),r=e&&n[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}}(i))return!1;if(A(r))return!0;if(p(r))return o(r);var s=r[e];return A(s)?s:o(s)}function ao(t,e,r,n,i,o){return uo.apply(this,arguments)}function uo(){return uo=a((function*(t,e,r,n,i,o){if(void 0===o&&(o=0),o>10)return eo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>no(t)&&t.initiatorType===e&&(y(n)||t.startTime>=n)&&(y(i)||t.startTime<=i)));return s||(yield new Promise((t=>setTimeout(t,50*o))),ao(t,e,r,n,i,o+1))})),uo.apply(this,arguments)}function lo(t){var{body:e,options:r,url:n}=t;if(w(e))return null;var{hostname:i,isHostDenied:o}=to(n,r);if(o)return i+" is in deny list";if(b(e))return e;if(Qi(e))return e.textContent;if(k(e))return E(e);if(I(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 co=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ho(t){var{entry:e,method:r,status:n,networkRequest:i,isInitial:o,start:s,end:a,url:l,initiatorType:d}=t;s=e?e.startTime:s,a=e?e.responseEnd:a;var c=Math.floor(Date.now()-performance.now()),h=Math.floor(c+(s||0)),v=[u({},e?e.toJSON():{name:l},{startTime:y(s)?void 0:Math.round(s),endTime:y(a)?void 0:Math.round(a),timeOrigin:c,timestamp:h,method:r,initiatorType:d||(e?e.initiatorType:void 0),status:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(co(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:h,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var vo=["video/","audio/"];function fo(t){return new Promise(((e,r)=>{var n=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(n)))}catch(t){clearTimeout(n),e("[SessionReplay] Failed to read body")}}))}function mo(){return(mo=a((function*(t){var{r:e,options:r,url:n}=t,{hostname:i,isHostDenied:o}=to(n,r);return o?Promise.resolve(i+" is in deny list"):fo(e)}))).apply(this,arguments)}function po(){return(po=a((function*(t){var{r:e,options:r,url:n}=t,i=function(t){var e,{r:r,options:n,url:i}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=vo.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=to(i,n);return u?a+" is in deny list":null}({r:e,options:r,url:n});return C(i)?fo(e):Promise.resolve(i)}))).apply(this,arguments)}function go(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=oo("request",r.recordHeaders),i=oo("response",r.recordHeaders),o=$i(e,"fetch",(o=>function(){var s=a((function*(s,a){var u,l,d,c=new Request(s,a),h={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(h.requestHeaders=v),so({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(h.requestBody=yield function(t){return mo.apply(this,arguments)}({r:c,options:r,url:s})),l=e.performance.now(),u=yield o(c),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),i&&(h.responseHeaders=f),so({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(h.responseBody=yield function(t){return po.apply(this,arguments)}({r:u,options:r,url:s})),u}finally{ao(e,"fetch",c.url,l,d).then((e=>{var r,n=ho({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:d,url:c.url,initiatorType:"fetch"});t({requests:n})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}var Io=null;function yo(t,e,r){if(!("performance"in e))return()=>{};if(Io)return eo.warn("Network observer already initialised, doing nothing"),()=>{};var n=r?Object.assign({},J,r):J,i=e=>{var r=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(u({},e,{requests:r}))},o=io(i,e,n),s=()=>{},a=()=>{};return(n.recordHeaders||n.recordBody)&&(s=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=oo("request",r.recordHeaders),i=oo("response",r.recordHeaders),o=$i(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,d){void 0===u&&(u=!0);var c,h,v=this,f=new Request(a),m={},p={},g=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(p[t]=e,g(t,e)),n&&(m.requestHeaders=p);var I=v.send.bind(v);v.send=t=>(so({type:"request",headers:p,url:a,recordBody:r.recordBody})&&(m.requestBody=lo({body:t,options:r,url:a})),c=e.performance.now(),I(t));var y=()=>{if(v.readyState===v.DONE){v.removeEventListener("readystatechange",y),h=e.performance.now();var n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),i=e.join(": ");r&&(n[r]=i)})),i&&(m.responseHeaders=n),so({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(m.responseBody=lo({body:v.response,options:r,url:a})),ao(e,"xmlhttprequest",f.url,c,h).then((e=>{var r=ho({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:m,start:c,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",y),o.call(v,s,a,u,l,d)}));return()=>{o()}}(i,e,n),a=go(i,e,n)),Io=()=>{o(),s(),a()}}var bo=t=>({name:"rrweb/network@1",observer:yo,options:t});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:qi,getRecordNetworkPlugin:bo},o.__PosthogExtensions__.rrweb={record:Qn,version:"v2"},o.rrweb={record:Qn,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:qi},o.getRecordNetworkPlugin=bo,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=t=>new pe(t)}();
|
|
1
|
+
!function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,r=Array.prototype.forEach,n=null==e?void 0:e.navigator,i=null==e?void 0:e.document;null==e||e.location,null==e||e.fetch,null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest&&e.XMLHttpRequest,null==e||e.AbortController,null==n||n.userAgent;var o=null!=t?t:{};function s(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){s(o,n,i,a,u,"next",t)}function u(t){s(o,n,i,a,u,"throw",t)}a(void 0)}))}}function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},u.apply(null,arguments)}var l=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),d=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({});var c=function(t){return t.trim()},h=Array.isArray,v=Object.prototype,f=v.hasOwnProperty,m=v.toString,p=h||function(t){return"[object Array]"===m.call(t)},g=t=>"function"==typeof t,I=t=>t===Object(t)&&!p(t),y=t=>void 0===t,b=t=>"[object String]"==m.call(t),C=t=>null===t,w=t=>y(t)||C(t),S=t=>"[object Number]"==m.call(t),A=t=>"[object Boolean]"===m.call(t),k=t=>t instanceof FormData;function N(t,e,r,n,i){return e>r&&(n.warn("min cannot be greater than max."),e=r),S(t)?t>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),N(i||r,e,r,n))}class R{constructor(t){this.t={},this.i=t.i,this.o=N(t.bucketSize,0,100,t.u),this.h=N(t.refillRate,0,this.o,t.u),this.m=N(t.refillInterval,0,864e5,t.u)}I(t,e){var r=e-t.lastAccess,n=Math.floor(r/this.m);if(n>0){var i=n*this.h;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+n*this.m}}consumeRateLimit(t){var e,r=Date.now(),n=String(t),i=this.t[n];return i?this.I(i,r):(i={tokens:this.o,lastAccess:r},this.t[n]=i),0===i.tokens||(i.tokens--,0===i.tokens&&(null==(e=this.i)||e.call(this,t)),0===i.tokens)}stop(){this.t={}}}var T={LIB_VERSION:"1.285.2"},M=e=>{var r={C:function(r){if(t&&o.POSTHOG_DEBUG&&!y(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];n(e,...s)}},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.C("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.C("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.C("error",...e)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:t=>{r.error("You must initialize PostHog before calling "+t)},createLogger:t=>M(e+" "+t)};return r},F=M("[PostHog.js]"),_=F.createLogger,B={};function O(t,e,n){if(!w(t)){if(p(t))return function(t,e,n){if(p(t))if(r&&t.forEach===r)t.forEach(e,n);else if("length"in t&&t.length===+t.length)for(var i=0,o=t.length;i<o;i++)if(i in t&&e.call(n,t[i],i)===B)return}(t,e,n);if(k(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===B)return}else for(var o in t)if(f.call(t,o)&&e.call(n,t[o],o)===B)return}}function x(t,e,r,n){var{capture:i=!1,passive:o=!0}={};null==t||t.addEventListener(e,r,{capture:i,passive:o})}var Z=["localhost","127.0.0.1"],Y=t=>{var e=null==i?void 0:i.createElement("a");return y(e)?null:(e.href=t,e)},E=function(t,e){var r,n;void 0===e&&(e="&");var i=[];return O(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),n=encodeURIComponent(e),i[i.length]=n+"="+r)})),i.join(e)},G="$session_is_sampled",L="$session_recording_url_trigger_activated_session",W="$session_recording_event_trigger_activated_session",D=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})"),V=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})");var X="[SessionRecording]",z="redacted",J={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"]},K=["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"],H=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],j=["/s/","/e/","/i/"];function U(t,e,r,n){if(w(t))return t;var i=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return b(i)&&(i=parseInt(i)),i>r?X+" "+n+" body too large to record ("+i+" bytes)":t}function P(t,e){if(w(t))return t;var r=t;return function(t,e){if(w(t))return!1;if(b(t)){if(t=c(t),D.test((t||"").replace(/[- ]/g,"")))return!1;if(V.test(t))return!1}return!0}(r)||(r=X+" "+e+" body "+z),O(H,(t=>{var n,i;null!=(n=r)&&n.length&&-1!==(null==(i=r)?void 0:i.indexOf(t))&&(r=X+" "+e+" body "+z+" as might contain: "+t)})),r}var q=(t,e)=>{var r,n,i,o={payloadSizeLimitBytes:J.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...J.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...J.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,d=(r=o,i=Math.min(1e6,null!==(n=r.payloadSizeLimitBytes)&&void 0!==n?n:1e6),t=>(null!=t&&t.requestBody&&(t.requestBody=U(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=U(t.responseBody,t.responseHeaders,i,"Response")),t)),c=e=>{return d(((t,e)=>{var r,n=Y(t.name),i=0===e.indexOf("http")?null==(r=Y(e))?void 0:r.pathname:e;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&j.some((t=>0===o.indexOf(t)))))return t})((n=(r=e).requestHeaders,w(n)||O(Object.keys(null!=n?n:{}),(t=>{K.includes(t.toLowerCase())&&(n[t]=z)})),r),t.api_host));var r,n},h=g(t.session_recording.maskNetworkRequestFn);return h&&g(t.session_recording.maskCapturedNetworkRequestFn)&&F.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return u({},e,{name:null==r?void 0:r.url})}),o.maskRequestFn=g(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r,n=c(e);return n&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(n))&&void 0!==r?r:void 0}:t=>function(t){if(!y(t))return t.requestBody=P(t.requestBody,"Request"),t.responseBody=P(t.responseBody,"Response"),t}(c(t)),u({},J,o,{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Q="disabled",tt="sampled",et="active",rt="buffering",nt="paused",it="trigger",ot=it+"_activated",st=it+"_pending",at=it+"_"+Q;function ut(t,e){return e.some((e=>"regex"===e.matching&&new RegExp(e.url).test(t)))}class lt{constructor(t){this.S=t}triggerStatus(t){var e=this.S.map((e=>e.triggerStatus(t)));return e.includes(ot)?ot:e.includes(st)?st:at}stop(){this.S.forEach((t=>t.stop()))}}class dt{constructor(t){this.S=t}triggerStatus(t){var e=new Set;for(var r of this.S)e.add(r.triggerStatus(t));switch(e.delete(at),e.size){case 0:return at;case 1:return Array.from(e)[0];default:return st}}stop(){this.S.forEach((t=>t.stop()))}}class ct{triggerStatus(){return st}stop(){}}var ht=t=>"sessionRecording"in t;class vt{constructor(t){this.A=[],this.k=[],this.urlBlocked=!1,this._instance=t}onConfig(t){var e,r;this.A=(ht(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.k=(ht(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[]}onRemoteConfig(t){this.onConfig(t)}N(t){var e;return 0===this.A.length?at:(null==(e=this._instance)?void 0:e.get_property(L))===t?ot:st}triggerStatus(t){var e=this.N(t),r=e===ot?ot:e===st?st:at;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,r,n){if(void 0!==t&&t.location.href){var i=t.location.href,o=this.urlBlocked,s=ut(i,this.k);o&&s||(s&&!o?e():!s&&o&&r(),ut(i,this.A)&&n("url"))}}stop(){}}class ft{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.R=()=>{},this._instance=t}triggerStatus(){var t=st;return w(this.linkedFlag)&&(t=at),this.linkedFlagSeen&&(t=ot),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(ht(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!w(this.linkedFlag)&&!this.linkedFlagSeen){var n=b(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,i=b(this.linkedFlag)?null:this.linkedFlag.variant;this.R=this._instance.onFeatureFlags(((t,r)=>{var o=!1;if(I(r)&&n in r){var s=r[n];o=A(s)?!0===s:i?s===i:!!s}this.linkedFlagSeen=o,o&&e(n,i)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.R()}}class mt{constructor(t){this.T=[],this._instance=t}onConfig(t){var e;this.T=(ht(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}M(t){var e;return 0===this.T.length?at:(null==(e=this._instance)?void 0:e.get_property(W))===t?ot:st}triggerStatus(t){var e=this.M(t),r=e===ot?ot:e===st?st:at;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function pt(t){return t.isRecordingEnabled?rt:Q}function gt(t){if(!t.receivedFlags)return rt;if(!t.isRecordingEnabled)return Q;if(t.urlTriggerMatching.urlBlocked)return nt;var e=!0===t.isSampled,r=new lt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?tt:r===ot?et:r===st?rt:!1===t.isSampled?Q:et}function It(t){if(!t.receivedFlags)return rt;if(!t.isRecordingEnabled)return Q;if(t.urlTriggerMatching.urlBlocked)return nt;var e=new dt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==at,n=A(t.isSampled);return r&&e===st?rt:r&&e===at||n&&!t.isSampled?Q:!0===t.isSampled?tt:et}function yt(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(I(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}var bt=Uint8Array,Ct=Uint16Array,wt=Uint32Array,St=new bt([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]),At=new bt([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]),kt=new bt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nt=function(t,e){for(var r=new Ct(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new wt(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Rt=Nt(St,2),Tt=Rt[0],Mt=Rt[1];Tt[28]=258,Mt[258]=28;for(var Ft=Nt(At,0)[1],_t=new Ct(32768),Bt=0;Bt<32768;++Bt){var Ot=(43690&Bt)>>>1|(21845&Bt)<<1;Ot=(61680&(Ot=(52428&Ot)>>>2|(13107&Ot)<<2))>>>4|(3855&Ot)<<4,_t[Bt]=((65280&Ot)>>>8|(255&Ot)<<8)>>>1}var xt=function(t,e,r){for(var n=t.length,i=0,o=new Ct(e);i<n;++i)++o[t[i]-1];var s,a=new Ct(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Ct(1<<e);var u=15-e;for(i=0;i<n;++i)if(t[i])for(var l=i<<4|t[i],d=e-t[i],c=a[t[i]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)s[_t[c]>>>u]=l}else for(s=new Ct(n),i=0;i<n;++i)s[i]=_t[a[t[i]-1]++]>>>15-t[i];return s},Zt=new bt(288);for(Bt=0;Bt<144;++Bt)Zt[Bt]=8;for(Bt=144;Bt<256;++Bt)Zt[Bt]=9;for(Bt=256;Bt<280;++Bt)Zt[Bt]=7;for(Bt=280;Bt<288;++Bt)Zt[Bt]=8;var Yt=new bt(32);for(Bt=0;Bt<32;++Bt)Yt[Bt]=5;var Et=xt(Zt,9,0),Gt=xt(Yt,5,0),Lt=function(t){return(t/8>>0)+(7&t&&1)},Wt=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var n=new(t instanceof Ct?Ct:t instanceof wt?wt:bt)(r-e);return n.set(t.subarray(e,r)),n},Dt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8},Vt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},Xt=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return[new bt(0),0];if(1==i){var s=new bt(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,d=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};d!=i-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=d&&r[l].f<r[c].f?l++:c++],r[d++]={s:-1,f:a.f+u.f,l:a,r:u};var h=o[0].s;for(n=1;n<i;++n)o[n].s>h&&(h=o[n].s);var v=new Ct(h+1),f=zt(r[d-1],v,0);if(f>e){n=0;var m=0,p=f-e,g=1<<p;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n<i;++n){var I=o[n].s;if(!(v[I]>e))break;m+=g-(1<<f-v[I]),v[I]=e}for(m>>>=p;m>0;){var y=o[n].s;v[y]<e?m-=1<<e-v[y]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;v[b]==e&&(--v[b],++m)}f=e}return[new bt(v),f]},zt=function(t,e,r){return-1==t.s?Math.max(zt(t.l,e,r+1),zt(t.r,e,r+1)):e[t.s]=r},Jt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ct(++e),n=0,i=t[0],o=1,s=function(t){r[n++]=t},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},Kt=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},Ht=function(t,e,r){var n=r.length,i=Lt(e+2);t[i]=255&n,t[i+1]=n>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<n;++o)t[i+o+4]=r[o];return 8*(i+4+n)},jt=function(t,e,r,n,i,o,s,a,u,l,d){Dt(e,d++,r),++i[256];for(var c=Xt(i,15),h=c[0],v=c[1],f=Xt(o,15),m=f[0],p=f[1],g=Jt(h),I=g[0],y=g[1],b=Jt(m),C=b[0],w=b[1],S=new Ct(19),A=0;A<I.length;++A)S[31&I[A]]++;for(A=0;A<C.length;++A)S[31&C[A]]++;for(var k=Xt(S,7),N=k[0],R=k[1],T=19;T>4&&!N[kt[T-1]];--T);var M,F,_,B,O=l+5<<3,x=Kt(i,Zt)+Kt(o,Yt)+s,Z=Kt(i,h)+Kt(o,m)+s+14+3*T+Kt(S,N)+(2*S[16]+3*S[17]+7*S[18]);if(O<=x&&O<=Z)return Ht(e,d,t.subarray(u,u+l));if(Dt(e,d,1+(Z<x)),d+=2,Z<x){M=xt(h,v,0),F=h,_=xt(m,p,0),B=m;var Y=xt(N,R,0);Dt(e,d,y-257),Dt(e,d+5,w-1),Dt(e,d+10,T-4),d+=14;for(A=0;A<T;++A)Dt(e,d+3*A,N[kt[A]]);d+=3*T;for(var E=[I,C],G=0;G<2;++G){var L=E[G];for(A=0;A<L.length;++A){var W=31&L[A];Dt(e,d,Y[W]),d+=N[W],W>15&&(Dt(e,d,L[A]>>>5&127),d+=L[A]>>>12)}}}else M=Et,F=Zt,_=Gt,B=Yt;for(A=0;A<a;++A)if(n[A]>255){W=n[A]>>>18&31;Vt(e,d,M[W+257]),d+=F[W+257],W>7&&(Dt(e,d,n[A]>>>23&31),d+=St[W]);var D=31&n[A];Vt(e,d,_[D]),d+=B[D],D>3&&(Vt(e,d,n[A]>>>5&8191),d+=At[D])}else Vt(e,d,M[n[A]]),d+=F[n[A]];return Vt(e,d,M[256]),d+F[256]},Ut=new wt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pt=function(){for(var t=new wt(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),qt=function(){var t=4294967295;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=Pt[255&r^e[n]]^r>>>8;t=r},d:function(){return 4294967295^t}}},Qt=function(t,e,r,n,i){return function(t,e,r,n,i,o){var s=t.length,a=new bt(n+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(n,a.length-i),l=0;if(!e||s<8)for(var d=0;d<=s;d+=65535){var c=d+65535;c<s?l=Ht(u,l,t.subarray(d,c)):(u[d]=o,l=Ht(u,l,t.subarray(d,s)))}else{for(var h=Ut[e-1],v=h>>>13,f=8191&h,m=(1<<r)-1,p=new Ct(32768),g=new Ct(m+1),I=Math.ceil(r/3),y=2*I,b=function(e){return(t[e]^t[e+1]<<I^t[e+2]<<y)&m},C=new wt(25e3),w=new Ct(288),S=new Ct(32),A=0,k=0,N=(d=0,0),R=0,T=0;d<s;++d){var M=b(d),F=32767&d,_=g[M];if(p[F]=_,g[M]=F,R<=d){var B=s-d;if((A>7e3||N>24576)&&B>423){l=jt(t,u,0,C,w,S,k,N,T,d-T,l),N=A=k=0,T=d;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)S[O]=0}var x=2,Z=0,Y=f,E=F-_&32767;if(B>2&&M==b(d-E))for(var G=Math.min(v,B)-1,L=Math.min(32767,d),W=Math.min(258,B);E<=L&&--Y&&F!=_;){if(t[d+x]==t[d+x-E]){for(var D=0;D<W&&t[d+D]==t[d+D-E];++D);if(D>x){if(x=D,Z=E,D>G)break;var V=Math.min(E,D-2),X=0;for(O=0;O<V;++O){var z=d-E+O+32768&32767,J=z-p[z]+32768&32767;J>X&&(X=J,_=z)}}}E+=(F=_)-(_=p[F])+32768&32767}if(Z){C[N++]=268435456|Mt[x]<<18|Ft[Z];var K=31&Mt[x],H=31&Ft[Z];k+=St[K]+At[H],++w[257+K],++S[H],R=d+x,++A}else C[N++]=t[d],++w[t[d]]}}l=jt(t,u,o,C,w,S,k,N,T,d-T,l)}return Wt(a,0,n+Lt(l)+i)}(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,n,!0)},$t=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},te=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&$t(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var n=0;n<=r.length;++n)t[n+10]=r.charCodeAt(n)}},ee=function(t){return 10+(t.filename&&t.filename.length+1||0)};class re{constructor(t,e){var r,n;void 0===e&&(e={}),this.F={},this.B=t=>{if(!this.F[t]){var e,r;this.F[t]=!0;var n=this.O(t);null==(e=(r=this.Z).onBlockedNode)||e.call(r,t,n)}},this.Y=t=>{var e=this.O(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.O=t=>this._rrweb.mirror.getNode(t),this.G=t=>{var e,r,n,i,o,s,a,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(n=null==(i=t.attributes)?void 0:i.length)&&void 0!==n?n:0)+(null!==(o=null==(s=t.texts)?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null==(u=t.adds)?void 0:u.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.G(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.Y(t.id);return!this.L.consumeRateLimit(e)&&t})));var n=this.G(e);return 0!==n||r===n?t:void 0},this._rrweb=t,this.Z=e,this.L=new R({bucketSize:null!==(r=this.Z.bucketSize)&&void 0!==r?r:100,refillRate:null!==(n=this.Z.refillRate)&&void 0!==n?n:10,refillInterval:1e3,i:this.B,u:F})}reset(){this.F={}}stop(){this.L.stop(),this.reset()}}function ne(t,e){return function(t){for(var e=0,r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<N(100*e,0,100,F)}var ie=3e5,oe="[SessionRecording]",se=_(oe),ae=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],ue=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function le(){var t;return null==o||null==(t=o.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record}function de(t){return function(t,e){for(var r="",n=0;n<t.length;){var i=t[n++];r+=String.fromCharCode(i)}return r}(function(t,e){void 0===e&&(e={});var r=qt(),n=t.length;r.p(t);var i=Qt(t,e,ee(e),8),o=i.length;return te(i,e),$t(i,o-8,r.d()),$t(i,o-4,n),i}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new bt(t.length+(t.length>>>1)),i=0,o=function(t){n[i++]=t},s=0;s<r;++s){if(i+5>n.length){var a=new bt(i+8+(r-s<<1));a.set(n),n=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Wt(n,0,i)}(JSON.stringify(t))))}function ce(t,e){return t.type===l.Custom&&t.data.tag===e}function he(t){return ce(t,"sessionIdle")}function ve(t){return ce(t,"$session_ending")}function fe(t){return ce(t,"$session_starting")}function me(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),n=t.data.slice(0,r),i=t.data.slice(r);return[me({size:yt(n),data:n,sessionId:t.sessionId,windowId:t.windowId}),me({size:yt(i),data:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class pe{get sessionId(){return this.W}get D(){if(!this._instance.sessionManager)throw new Error(oe+" must be started with a valid sessionManager.");return this._instance.sessionManager}get V(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get X(){var t=this._instance.get_property(G);return A(t)?t:b(t)?t===this.sessionId:null}get J(){var t,e=null==(t=this.K)?void 0:t.sampleRate;return S(e)?e:null}get H(){var t,e=null==(t=this.K)?void 0:t.minimumDurationMilliseconds;return S(e)?e:null}constructor(t){this.j="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.U=void 0,this.P=Date.now(),this.q=[],this.$="unknown",this.tt=new ct,this.et=void 0,this.rt=void 0,this.nt=pt,this.it=void 0,this.ot=void 0,this.st=void 0,this.ut=void 0,this.lt=(t,e,r)=>{if(r){var n,i,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength);o&&(n=this.W,i=this.dt,this.ct("$session_ending",{nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.P})),this.ct("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.ht(),this.U||this.start("session_id_changed"),o&&this.ct("$session_starting",{previousSessionId:n,previousWindowId:i,changeReason:r,lastActivityTimestamp:this.P}),S(this.J)&&w(this.st)&&this.vt(t)}},this.ft=()=>{this.gt()},this.It=()=>{this.ct("browser offline",{})},this.yt=()=>{this.ct("browser online",{})},this.bt=()=>{if(null!=i&&i.visibilityState){var t="window "+i.visibilityState;this.ct(t,{})}},this._instance=t;var{sessionId:e,windowId:r}=this.D.checkAndGetSessionAndWindowId();this.W=e,this.dt=r,this.Ct=new ft(this._instance),this.wt=new vt(this._instance),this.St=new mt(this._instance),this.At=this.kt(),this.V>=this.D.sessionTimeoutMs&&se.warn("session_idle_threshold_ms ("+this.V+") is greater than the session timeout ("+this.D.sessionTimeoutMs+"). Session will never be detected as idle")}get Nt(){var t,e,r,n,i,o,s,a=null==(t=this.K)?void 0:t.masking,u={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==(n=this._instance.config.session_recording)?void 0:n.blockSelector},l=null!==(i=null==u?void 0:u.maskAllInputs)&&void 0!==i?i:null==a?void 0:a.maskAllInputs,d=null!==(o=null==u?void 0:u.maskTextSelector)&&void 0!==o?o:null==a?void 0:a.maskTextSelector,c=null!==(s=null==u?void 0:u.blockSelector)&&void 0!==s?s:null==a?void 0:a.blockSelector;return y(l)&&y(d)&&y(c)?void 0:{maskAllInputs:null==l||l,maskTextSelector:d,blockSelector:c}}get Rt(){var t,e,r,n,i,o,s,a=this._instance.config.session_recording.captureCanvas,u=null==(t=this.K)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,d=null!==(n=null!==(i=null==a?void 0:a.canvasFps)&&void 0!==i?i:null==u?void 0:u.fps)&&void 0!==n?n:4,c=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==u?void 0:u.quality)&&void 0!==o?o:.4;if("string"==typeof c){var h=parseFloat(c);c=isNaN(h)?.4:h}return{enabled:l,fps:N(d,0,12,_("canvas recording fps"),4),quality:N(c,0,1,_("canvas recording quality"),.4)}}get Tt(){var t,e=!(null==(t=this.K)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Mt(){var t,e,r,n=null==(t=this.K)?void 0:t.networkPayloadCapture,i={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},o=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),a=I(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,u=!!(A(a)?a:null==n?void 0:n.capturePerformance);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}Ft(){var t,e,r=[],n=null==(t=o.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Tt&&r.push(n());var i=null==(e=o.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;this.Mt&&g(i)&&(!Z.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(i(q(this._instance.config,this.Mt))):se.info("NetworkCapture not started because we are on localhost."));return r}_t(t){var e=this._instance.config.session_recording;if(e.maskNetworkRequestFn){var r,n={url:t};return null==(r=n=e.maskNetworkRequestFn(n))?void 0:r.url}return t}Bt(t){try{return t.rrwebMethod(),!0}catch(e){return this.q.length<10?this.q.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):se.warn("could not emit queued rrweb event.",e,t),!1}}ct(t,e){return this.Bt(ue((()=>le().addCustomEvent(t,e))))}Ot(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=e.origin+e.pathname+e.search,n=this._t(r);this.xt!==n&&(this.xt=n,this.ct("$url_changed",{href:n}))}catch(t){}}Zt(){if(this.q.length){var t=[...this.q];this.q=[],t.forEach((t=>{Date.now()-t.enqueuedAt<=2e3&&this.Bt(t)}))}}Yt(){return this.Bt(ue((()=>le().takeFullSnapshot())))}get Et(){var t,e;return this.tt.triggerStatus(this.sessionId)!==st||["sampled","active"].includes(this.status)?null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.full_snapshot_interval_millis)&&void 0!==t?t:ie:6e4}Gt(){if(this.Lt&&clearInterval(this.Lt),!0!==this.$){var t=this.Et;t&&(this.Lt=setInterval((()=>{this.Yt()}),t))}}Wt(){this.wt.urlBlocked||(this.wt.urlBlocked=!0,clearInterval(this.Lt),se.info("recording paused due to URL blocker"),this.ct("recording paused",{reason:"url blocker"}))}Dt(){this.wt.urlBlocked&&(this.wt.urlBlocked=!1,this.Yt(),this.Gt(),this.ct("recording resumed",{reason:"left blocked url"}),se.info("recording resumed"))}Vt(t){var e;this.tt.triggerStatus(this.sessionId)===st&&(null==(e=this._instance)||null==(e=e.persistence)||e.register({["url"===t?L:W]:this.W}),this.gt(),this.Xt(t+"_trigger_matched"))}get isStarted(){return!!this.U}get K(){var t=this._instance.get_property("$session_recording_remote_config");if(t)return I(t)?t:JSON.parse(t)}start(e){var r,n=this.K;if(n){var{sessionId:i,windowId:o}=this.D.checkAndGetSessionAndWindowId();this.W=i,this.dt=o,null!=n&&n.endpoint&&(this.j=null==n?void 0:n.endpoint),"any"===(null==n?void 0:n.triggerMatchType)?(this.nt=gt,this.tt=new lt([this.St,this.wt])):(this.nt=It,this.tt=new dt([this.St,this.wt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==n?void 0:n.triggerMatchType}),this.wt.onConfig(n),this.St.onConfig(n),null==(r=this.rt)||r.call(this),this.zt(),this.Ct.onConfig(n,((t,e)=>{this.Xt("linked_flag_matched",{flag:t,variant:e})})),this.vt(this.sessionId),this.Jt(),x(t,"beforeunload",this.ft),x(t,"offline",this.It),x(t,"online",this.yt),x(t,"visibilitychange",this.bt),this.it||(this.it=this.D.onSessionId(this.lt)),this.ot||(this.ot=this.D.on("forcedIdleReset",(()=>{this.ht(),this.$="unknown",this.stop(),this.ut=this.D.onSessionId(((t,e,r)=>{var n;null==(n=this.ut)||n.call(this),this.ut=void 0,this.lt(t,e,r)}))}))),w(this.et)&&(this.et=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this._t(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.ct("$pageview",{href:e})}}catch(t){se.error("Could not add $pageview to rrweb session",t)}}))),this.status===et&&this.Xt(e||"recording_initialized")}else se.info("remote config must be stored in persistence before recording can start")}stop(){var e,r,n,i,o,s,a,u;null==t||t.removeEventListener("beforeunload",this.ft),null==t||t.removeEventListener("offline",this.It),null==t||t.removeEventListener("online",this.yt),null==t||t.removeEventListener("visibilitychange",this.bt),this.kt(),clearInterval(this.Lt),this.Kt(),null==(e=this.et)||e.call(this),this.et=void 0,null==(r=this.rt)||r.call(this),this.rt=void 0,null==(n=this.it)||n.call(this),this.it=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0,null==(o=this.st)||o.call(this),this.st=void 0,null==(s=this.ut)||s.call(this),this.ut=void 0,this.St.stop(),this.wt.stop(),this.Ct.stop(),null==(a=this.Ht)||a.stop(),this.q=[],null==(u=this.U)||u.call(this),this.U=void 0,se.info("stopped")}onRRwebEmit(t){var e;if(this.Zt(),t&&I(t)){if(t.type===l.Meta){var r=this._t(t.data.href);if(this.xt=r,!r)return;t.data.href=r}else this.Ot();if(this.wt.checkUrlTriggerConditions((()=>this.Wt()),(()=>this.Dt()),(t=>this.Vt(t))),!this.wt.urlBlocked||(n=t).type===l.Custom&&"recording paused"===n.data.tag){var n,i;if(t.type===l.FullSnapshot)this.Gt(),null==(i=this.Ht)||i.reset();t.type===l.FullSnapshot&&this.tt.triggerStatus(this.sessionId)===st&&this.jt();var o=this.Ht?this.Ht.throttleMutations(t):t;if(o){var s=function(t){var e=t;if(e&&I(e)&&6===e.type&&I(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=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?r.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):r.push(e.data.payload.payload[n]);return e.data.payload.payload=r,t}return t}(o);if(this.Ut(s),!0!==this.$||function(t){return he(t)||ve(t)||fe(t)}(s)){if(he(s)){var a=s.data.payload;if(a){var c=a.lastActivityTimestamp,h=a.threshold;s.timestamp=c+h}}if(ve(s)||fe(s)){var v=s.data.payload;null!=v&&v.lastActivityTimestamp&&(s.timestamp=v.lastActivityTimestamp)}var f=null===(e=this._instance.config.session_recording.compress_events)||void 0===e||e?function(t){try{if(t.type===l.FullSnapshot)return u({},t,{data:de(t.data),cv:"2024-10"});if(t.type===l.IncrementalSnapshot&&t.data.source===d.Mutation)return u({},t,{cv:"2024-10",data:u({},t.data,{texts:de(t.data.texts),attributes:de(t.data.attributes),removes:de(t.data.removes),adds:de(t.data.adds)})});if(t.type===l.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return u({},t,{cv:"2024-10",data:u({},t.data,{adds:t.data.adds?de(t.data.adds):void 0,removes:t.data.removes?de(t.data.removes):void 0})})}catch(t){se.error("could not compress event - will use uncompressed event",t)}return t}(s):s,m={$snapshot_bytes:yt(f),$snapshot_data:f,$session_id:this.W,$window_id:this.dt};this.status!==Q?this.Pt(m):this.kt()}}}}}get status(){return this.nt({receivedFlags:!0,isRecordingEnabled:!0,isSampled:this.X,urlTriggerMatching:this.wt,eventTriggerMatching:this.St,linkedFlagMatching:this.Ct,sessionId:this.sessionId})}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.Ct.linkedFlagSeen=!0,this.Yt(),this.Xt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[G]:this.sessionId}),this.Yt(),this.Xt("sampling_overridden")}overrideTrigger(t){this.Vt(t)}Kt(){this.qt&&(clearTimeout(this.qt),this.qt=void 0)}gt(){this.Kt();var t=this.H,e=this.Qt,r=S(e)&&e>=0,n=S(t)&&r&&e<t;if(this.status===rt||this.status===nt||this.status===Q||n)return this.qt=setTimeout((()=>{this.gt()}),2e3),this.At;this.At.data.length>0&&me(this.At).forEach((t=>{this.$t({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:T.LIB_VERSION})}));return this.kt()}Pt(t){var e,r=2+((null==(e=this.At)?void 0:e.data.length)||0);!this.$&&(this.At.size+t.$snapshot_bytes+r>943718.4||this.At.sessionId!==this.W)&&(this.At=this.gt()),this.At.size+=t.$snapshot_bytes,this.At.data.push(t.$snapshot_data),this.qt||this.$||(this.qt=setTimeout((()=>{this.gt()}),2e3))}$t(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.j),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qt(){var t,e,r=null==(t=this.At)?void 0:t.data[(null==(e=this.At)?void 0:e.data.length)-1],{sessionStartTimestamp:n}=this.D.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}jt(){if(!this.At||0===this.At.data.length)return this.kt();for(var t=-1,e=this.At.data.length-1;e>=0;e--)if(this.At.data[e].type===l.Meta){t=e;break}return t>=0?(this.At.data=this.At.data.slice(t),this.At.size=this.At.data.reduce(((t,e)=>t+yt(e)),0),this.At):this.kt()}kt(){return this.At={size:0,data:[],sessionId:this.W,windowId:this.dt},this.At}Xt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),se.info(t.replace("_"," "),e),-1===["recording_initialized","session_id_changed"].indexOf(t)&&this.ct(t,e)}te(t){var e;return 3===t.type&&-1!==ae.indexOf(null==(e=t.data)?void 0:e.source)}Ut(t){var e=this.te(t);e||this.$||t.timestamp-this.P>this.V&&(this.$=!0,clearInterval(this.Lt),this.ct("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.P,threshold:this.V,bufferLength:this.At.data.length,bufferSize:this.At.size}),this.gt());var r=!1;if(e&&(this.P=t.timestamp,this.$)){var n="unknown"===this.$;this.$=!1,n||(this.ct("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.$){var{windowId:i,sessionId:o}=this.D.checkAndGetSessionAndWindowId(!e,t.timestamp),s=this.W!==o,a=this.dt!==i;this.dt=i,this.W=o,s||a?(this.stop(),this.start("session_id_changed")):r&&this.Gt()}}ht(){var t,e,r;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(W),null==(e=this._instance)||null==(e=e.persistence)||e.unregister(L),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(G)}vt(t){var e,r=this.W!==t,n=this.J;if(S(n)){var i=this.X,o=r||!A(i),s=o?ne(t,n):i;o&&(s?this.Xt(tt):se.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server."),this.ct("samplingDecisionMade",{sampleRate:n,isSampled:s})),null==(e=this._instance.persistence)||e.register({[G]:!!s&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(G)}}zt(){0!==this.St.T.length&&w(this.rt)&&(this.rt=this._instance.on("eventCaptured",(t=>{try{this.St.T.includes(t.event)&&this.Vt("event")}catch(t){se.error("Could not activate event trigger",t)}})))}get sdkDebugProperties(){var{sessionStartTimestamp:t}=this.D.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.At.data.length,$sdk_debug_replay_internal_buffer_size:this.At.size,$sdk_debug_current_session_duration:this.Qt,$sdk_debug_session_start:t}}Jt(){var t;if(!this.U){var e,r,n,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this._instance.config.session_recording;for(var[s,a]of Object.entries(o||{}))s in i&&("maskInputOptions"===s?i.maskInputOptions=u({password:!0},a):i[s]=a);if(this.Rt&&this.Rt.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.Rt.fps},i.dataURLOptions={type:"image/webp",quality:this.Rt.quality}),this.Nt)i.maskAllInputs=null===(e=this.Nt.maskAllInputs)||void 0===e||e,i.maskTextSelector=null!==(r=this.Nt.maskTextSelector)&&void 0!==r?r:void 0,i.blockSelector=null!==(n=this.Nt.blockSelector)&&void 0!==n?n:void 0;var l=le();if(l){this.Ht=null!==(t=this.Ht)&&void 0!==t?t:new re(l,{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";se.info(r,{node:e}),this.log(oe+" "+r,"warn")}});var d=this.Ft();this.U=l(u({emit:t=>{this.onRRwebEmit(t)},plugins:d},i)),this.P=Date.now(),this.$=A(this.$)?this.$:"unknown",this.tryAddCustomEvent("$remote_config_received",this.K),this.ct("$session_options",{sessionRecordingOptions:i,activePlugins:d.map((t=>null==t?void 0:t.name))}),this.ct("$posthog_config",{config:this._instance.config})}else se.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.ct(t,e)}}var ge,Ie=["type"],ye=Object.defineProperty,be=(t,e,r)=>((t,e,r)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ce=Object.defineProperty,we=(t,e,r)=>((t,e,r)=>e in t?Ce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Se=(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))(Se||{}),Ae={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ke={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Ne={};function Re(t){if(Ne[t])return Ne[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,n=t in Ae?Ae[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in ke?ke[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return Ne[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Ne[t]=l:e.prototype}catch(t){return e.prototype}}var Te={};function Me(t,e,r){var n,i=t+"."+String(r);if(Te[i])return Te[i].call(e);var o=Re(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Te[i]=s,s.call(e)):e[r]}var Fe={};function _e(t,e,r){var n=t+"."+String(r);if(Fe[n])return Fe[n].bind(e);var i=Re(t)[r];return"function"!=typeof i?e[r]:(Fe[n]=i,i.bind(e))}var Be={childNodes:function(t){return Me("Node",t,"childNodes")},parentNode:function(t){return Me("Node",t,"parentNode")},parentElement:function(t){return Me("Node",t,"parentElement")},textContent:function(t){return Me("Node",t,"textContent")},contains:function(t,e){return _e("Node",t,"contains")(e)},getRootNode:function(t){return _e("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Me("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Me("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Me("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Me("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Re("MutationObserver").constructor}};function Oe(t){return t.nodeType===t.ELEMENT_NODE}function xe(t){var e=t&&"host"in t&&"mode"in t&&Be.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Be.shadowRoot(e)===t)}function Ze(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function Ye(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>Ee(e,t.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(t){return null}var n}function Ee(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=Ye(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)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?Ue(r,t.styleSheet.href):r}var n,i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),e?Ue(i,e):i}function Ge(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let Le=class{constructor(){we(this,"idNodeMap",new Map),we(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){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function We(t){var{element:e,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:s}=t,a=o||"",u=i&&De(i);return(r[n.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function De(t){return t.toLowerCase()}var Ve="__rrweb_original__";function Xe(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?De(e):null}function ze(t,e){var r,n;try{n=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var Je=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ke=/^(?:[a-z+]+:)?\/\//i,He=/^www\..*/i,je=/^(data:)([^,]*),(.*)/i;function Ue(t,e){return(t||"").replace(Je,((t,r,n,i,o,s)=>{var a,u=n||o||s,l=r||i||"";if(!u)return t;if(Ke.test(u)||He.test(u))return"url("+l+u+l+")";if(je.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var d=e.split("/"),c=u.split("/");for(var h of(d.pop(),c))"."!==h&&(".."===h?d.pop():d.push(h));return"url("+l+d.join("/")+l+")"}))}var Pe,qe,Qe=1,$e=new RegExp("[^a-z0-9-_:]"),tr=-2;function er(){return Qe++}var rr=/^[^ \t\n\r\u000c]+/,nr=/^[, \t\n\r\u000c]+/;var ir=new WeakMap;function or(t,e){return e&&""!==e.trim()?ar(t,e):e}function sr(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function ar(t,e){var r=ir.get(t);if(r||(r=t.createElement("a"),ir.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function ur(t,e,r,n){return n?"src"===r||"href"===r&&("use"!==e||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?or(t,n):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function n(t){var n,i=t.exec(e.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(nr),!(r>=e.length);){var o=n(rr);if(","===o.slice(-1))o=or(t,o.substring(0,o.length-1)),i.push(o);else{var s="";o=or(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){i.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,i.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return i.join(", ")}(t,n):"style"===r?Ue(n,ar(t)):"object"===e&&"data"===r?or(t,n):n:or(t,n):n}function lr(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function dr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&dr(Be.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&dr(Be.parentNode(t),e,r)}function cr(t,e,r,n){var i;if(Oe(t)){if(i=t,!Be.childNodes(i).length)return!1}else{if(null===Be.parentElement(t))return!1;i=Be.parentElement(t)}try{if("string"==typeof e){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(dr(i,e,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(t){}return!1}function hr(t,e){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:d,dataURLOptions:c={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m=!1}=e,p=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,n);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Se.Document,childNodes:[],compatMode:t.compatMode}:{type:Se.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Se.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:p};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:v=!1,rootId:f}=e,m=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,i,o),p=function(t){if(t instanceof HTMLFormElement)return"form";var e=De(t.tagName);return $e.test(e)?"div":e}(t),g={},I=t.attributes.length,y=0;y<I;y++){var b=t.attributes[y];lr(p,b.name,b.value)||(g[b.name]=ur(n,p,De(b.name),b.value))}if("link"===p&&s){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=Ge(n,C);if(!w&&C.includes(".css"))w=Ge(n,window.location.origin+"/"+C.replace(window.location.href,""));var S=null;w&&(S=Ye(w)),S&&(delete g.rel,delete g.href,g._cssText=S)}}if("style"===p&&t.sheet&&!(t.innerText||Be.textContent(t)||"").trim().length){var A=Ye(t.sheet);A&&(g._cssText=A)}if("input"===p||"textarea"===p||"select"===p){var k=t.value,N=t.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&k?g.value=We({element:t,type:Xe(t),tagName:p,value:k,maskInputOptions:a,maskInputFn:u}):N&&(g.checked=N)}"option"===p&&(t.selected&&!a.select?g.selected=!0:delete g.selected);if("dialog"===p&&t.open)try{g.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){g.rr_open_mode="modal",g.ph_rr_could_not_detect_modal=!0}if("canvas"===p&&c)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var n=0;n<t.height;n+=50){var i=e.getImageData,o=Ve in i?i[Ve]:i;if(new Uint32Array(o.call(e,r,n,Math.min(50,t.width-r),Math.min(50,t.height-n)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(g.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var R=t.toDataURL(l.type,l.quality),T=n.createElement("canvas");T.width=t.width,T.height=t.height,R!==T.toDataURL(l.type,l.quality)&&(g.rr_dataURL=R)}if("img"===p&&d){Pe||(Pe=n.createElement("canvas"),qe=Pe.getContext("2d"));var M=t,F=M.currentSrc||M.getAttribute("src")||"<unknown-src>",_=M.crossOrigin,B=()=>{M.removeEventListener("load",B);try{Pe.width=M.naturalWidth,Pe.height=M.naturalHeight,qe.drawImage(M,0,0),g.rr_dataURL=Pe.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==M.crossOrigin)return M.crossOrigin="anonymous",void(M.complete&&0!==M.naturalWidth?B():M.addEventListener("load",B));console.warn("Cannot inline img src="+F+"! Error: "+t)}"anonymous"===M.crossOrigin&&(_?g.crossOrigin=_:M.removeAttribute("crossorigin"))};M.complete&&0!==M.naturalWidth?B():M.addEventListener("load",B)}if("audio"===p||"video"===p){var O=g;O.rr_mediaState=t.paused?"paused":"played",O.rr_mediaCurrentTime=t.currentTime,O.rr_mediaPlaybackRate=t.playbackRate,O.rr_mediaMuted=t.muted,O.rr_mediaLoop=t.loop,O.rr_mediaVolume=t.volume}v||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop));if(m){var{width:x,height:Z}=t.getBoundingClientRect();g={class:g.class,rr_width:x+"px",rr_height:Z+"px"}}"iframe"!==p||h(g.src)||(t.contentDocument||(g.rr_src=g.src),delete g.src);try{customElements.get(p)&&(r=!0)}catch(t){}return{type:Se.Element,tagName:p,attributes:g,childNodes:[],isSVG:sr(t)||void 0,needBlock:m,rootId:f,isCustom:r}}(t,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,dataURLOptions:c,inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m,rootId:p});case t.TEXT_NODE:return function(t,e){var r,{needsMask:n,maskTextFn:i,rootId:o}=e,s=Be.parentNode(t),a=s&&s.tagName,u=Be.textContent(t),l="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=Ye(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=Ue(u,ar(e.doc))}d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&n&&(u=i?i(u,Be.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:Se.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:p});case t.CDATA_SECTION_NODE:return{type:Se.CDATA,textContent:"",rootId:p};case t.COMMENT_NODE:return{type:Se.Comment,textContent:Be.textContent(t)||"",rootId:p};default:return!1}}function vr(t){return null==t?"":t.toLowerCase()}function fr(t,e){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:d={},maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=(()=>!1),newlyAddedElement:S=!1}=e,{needsMask:A}=e,{preserveWhiteSpace:k=!0}=e;A||(A=cr(t,s,a,void 0===A));var N,R=hr(t,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,dataURLOptions:f,inlineImages:m,recordCanvas:p,keepIframeSrcFn:w,newlyAddedElement:S});if(!R)return console.warn(t,"not serialized"),null;N=n.hasNode(t)?n.getId(t):!function(t,e){if(e.comment&&t.type===Se.Comment)return!0;if(t.type===Se.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"===ze(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(vr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===vr(t.attributes.name)||"icon"===vr(t.attributes.rel)||"apple-touch-icon"===vr(t.attributes.rel)||"shortcut icon"===vr(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&vr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(vr(t.attributes.property).match(/^(og|twitter|fb):/)||vr(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===vr(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===vr(t.attributes.name)||"googlebot"===vr(t.attributes.name)||"bingbot"===vr(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===vr(t.attributes.name)||"generator"===vr(t.attributes.name)||"framework"===vr(t.attributes.name)||"publisher"===vr(t.attributes.name)||"progid"===vr(t.attributes.name)||vr(t.attributes.property).match(/^article:/)||vr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===vr(t.attributes.name)||"yandex-verification"===vr(t.attributes.name)||"csrf-token"===vr(t.attributes.name)||"p:domain_verify"===vr(t.attributes.name)||"verify-v1"===vr(t.attributes.name)||"verification"===vr(t.attributes.name)||"shopify-checkout-api-token"===vr(t.attributes.name)))return!0}}return!1}(R,v)&&(k||R.type!==Se.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?er():tr;var T=Object.assign(R,{id:N});if(n.add(t,T),N===tr)return null;g&&g(t);var M=!u;if(T.type===Se.Element){M=M&&!T.needBlock,delete T.needBlock;var F=Be.shadowRoot(t);F&&Ze(F)&&(T.isShadowHost=!0)}if((T.type===Se.Document||T.type===Se.Element)&&M){v.headWhitespace&&T.type===Se.Element&&"head"===T.tagName&&(k=!1);var _={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w};if(T.type===Se.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else for(var B of Array.from(Be.childNodes(t))){var O=fr(B,_);O&&T.childNodes.push(O)}var x=null;if(Oe(t)&&(x=Be.shadowRoot(t)))for(var Z of Array.from(Be.childNodes(x))){var Y=fr(Z,_);Y&&(Ze(x)&&(Y.isShadow=!0),T.childNodes.push(Y))}}var E=Be.parentNode(t);return E&&xe(E)&&Ze(E)&&(T.isShadow=!0),T.type===Se.Element&&"iframe"===T.tagName&&function(t,e,r){var n=t.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(t){return}if("complete"===i){var s="about:blank";if(n.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=fr(e,{doc:e,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});r&&I(t,r)}}),y),T.type===Se.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===ze(T.attributes.href))&&function(t,e,r){var n,i=!1;try{n=t.sheet}catch(t){return}if(!n){var o=setTimeout((()=>{i||(e(),i=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),i=!0,e()}))}}(t,(()=>{if(b){var e=fr(t,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:A,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:k,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});e&&b(t,e)}}),C),T}let mr=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 pr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},gr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Ir={};function yr(t){if(Ir[t])return Ir[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,n=t in pr?pr[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in gr?gr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return Ir[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Ir[t]=l:r}catch(t){return r}}var br={};function Cr(t,e,r){var n,i=t+"."+String(r);if(br[i])return br[i].call(e);var o=yr(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(br[i]=s,s.call(e)):e[r]}var wr={};function Sr(t,e,r){var n=t+"."+String(r);if(wr[n])return wr[n].bind(e);var i=yr(t)[r];return"function"!=typeof i?e[r]:(wr[n]=i,i.bind(e))}function Ar(){return yr("MutationObserver").constructor}var kr={childNodes:function(t){return Cr("Node",t,"childNodes")},parentNode:function(t){return Cr("Node",t,"parentNode")},parentElement:function(t){return Cr("Node",t,"parentElement")},textContent:function(t){return Cr("Node",t,"textContent")},contains:function(t,e){return Sr("Node",t,"contains")(e)},getRootNode:function(t){return Sr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Cr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Cr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Cr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Cr("Element",t,"querySelectorAll")(e)},mutationObserver:Ar};function Nr(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}var Rr="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.",Tr={map:{},getId:()=>(console.error(Rr),-1),getNode:()=>(console.error(Rr),null),removeNodeFromMap(){console.error(Rr)},has:()=>(console.error(Rr),!1),reset(){console.error(Rr)}};function Mr(t,e,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}}function Fr(t,e,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>Fr(t,e,o||{},!0)}function _r(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Tr=new Proxy(Tr,{get:(t,e,r)=>("map"===e&&console.error(Rr),Reflect.get(t,e,r))}));var Br=Date.now;function Or(t){var e,r,n,i,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=kr.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=kr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function xr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Zr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Yr(t){return t?t.nodeType===t.ELEMENT_NODE?t:kr.parentElement(t):null}function Er(t,e,r,n){if(!t)return!1;var i=Yr(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(dr(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Gr(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===tr}function Lr(t,e){if(xe(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var n=kr.parentNode(t);return(!n||n.nodeType!==t.DOCUMENT_NODE)&&(!n||Lr(n,e))}function Wr(t){return Boolean(t.changedTouches)}function Dr(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Vr(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Xr(t){return!!t&&(t instanceof mr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(kr.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Br=()=>(new Date).getTime());let zr=class{constructor(){be(this,"id",1),be(this,"styleIDMap",new WeakMap),be(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 Jr(t){var e,r=null;return"getRootNode"in t&&(null==(e=kr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&kr.host(kr.getRootNode(t))&&(r=kr.host(kr.getRootNode(t))),r}function Kr(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Jr(r);)r=e;return r}(t);return kr.contains(e,r)}function Hr(t){var e=t.ownerDocument;return!!e&&(kr.contains(e,t)||Kr(t))}var jr=(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))(jr||{}),Ur=(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))(Ur||{}),Pr=(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))(Pr||{}),qr=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(qr||{}),Qr=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Qr||{}),$r=(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))($r||{});function tn(t){return"__ln"in t}class en{constructor(){be(this,"length",0),be(this,"head",null),be(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;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&&tn(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&&tn(t.nextSibling)&&t.nextSibling.__ln.previous){var n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){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 rn,nn=(t,e)=>t+"@"+e;class on{constructor(){be(this,"frozen",!1),be(this,"locked",!1),be(this,"texts",[]),be(this,"attributes",[]),be(this,"attributeMap",new WeakMap),be(this,"removes",[]),be(this,"mapRemoves",[]),be(this,"movedMap",{}),be(this,"addedSet",new Set),be(this,"movedSet",new Set),be(this,"droppedSet",new Set),be(this,"mutationCb"),be(this,"blockClass"),be(this,"blockSelector"),be(this,"maskTextClass"),be(this,"maskTextSelector"),be(this,"inlineStylesheet"),be(this,"maskInputOptions"),be(this,"maskTextFn"),be(this,"maskInputFn"),be(this,"keepIframeSrcFn"),be(this,"recordCanvas"),be(this,"inlineImages"),be(this,"slimDOMOptions"),be(this,"dataURLOptions"),be(this,"doc"),be(this,"mirror"),be(this,"iframeManager"),be(this,"stylesheetManager"),be(this,"shadowDomManager"),be(this,"canvasManager"),be(this,"processedNodeManager"),be(this,"unattachedDoc"),be(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),be(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new en,n=t=>{for(var e=t,r=tr;r===tr;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},i=i=>{var o=kr.parentNode(i);if(o&&Hr(i)&&"TEXTAREA"!==o.tagName){var s=xe(o)?this.mirror.getId(Jr(i)):this.mirror.getId(o),a=n(i);if(-1===s||-1===a)return r.addNode(i);var u=fr(i,{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=>{Dr(t,this.mirror)&&this.iframeManager.addIframe(t),Vr(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Xr(i)&&this.shadowDomManager.addShadowRoot(kr.shadowRoot(i),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)an(this.removes,o,this.mirror)&&!this.movedSet.has(kr.parentNode(o))||i(o);for(var s of this.addedSet)un(this.droppedSet,s)||an(this.removes,s,this.mirror)?un(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(kr.parentNode(a.value)),d=n(a.value);-1!==l&&-1!==d&&(u=a)}if(!u)for(var c=r.tail;c;){var h=c;if(c=c.previous,h){var v=this.mirror.getId(kr.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=h.value,m=kr.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=kr.host(m);if(-1!==this.mirror.getId(p)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),i(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=kr.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),n=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+n).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};(g.texts.length||g.attributes.length||g.removes.length||g.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(g))}})),be(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(kr.childNodes(t),(t=>kr.textContent(t)||"")).join("")})),be(this,"processMutation",(t=>{if(!Gr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=kr.textContent(t.target);Er(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:cr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Yr(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if("value"===n){var o=Xe(r);i=We({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Er(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===n&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!lr(r.tagName,n))if(s.attributes[n]=ur(this.doc,De(r.tagName),De(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),d=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===d?l:[l,d]:s._unchangedStyles[u]=[l,d]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Er(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),n=xe(t.target)?this.mirror.getId(kr.host(t.target)):this.mirror.getId(t.target);Er(t.target,this.blockClass,this.blockSelector,!1)||Gr(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(sn(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Lr(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[nn(r,n)]?sn(this.movedSet,e):this.removes.push({parentId:n,id:r,isShadow:!(!xe(t.target)||!Ze(t.target))||void 0})),this.mapRemoves.push(e))}))}})),be(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Gr(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[nn(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Er(t,this.blockClass,this.blockSelector,!1)||(kr.childNodes(t).forEach((t=>this.genAdds(t))),Xr(t)&&kr.childNodes(kr.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 sn(t,e){t.delete(e),kr.childNodes(e).forEach((e=>sn(t,e)))}function an(t,e,r){return 0!==t.length&&function(t,e,r){var n,i=kr.parentNode(e),o=function(){var e=r.getId(i);if(t.some((t=>t.id===e)))return{v:!0};i=kr.parentNode(i)};for(;i;)if(n=o())return n.v;return!1}(t,e,r)}function un(t,e){return 0!==t.size&&ln(t,e)}function ln(t,e){var r=kr.parentNode(e);return!!r&&(!!t.has(r)||ln(t,r))}var dn=t=>{if(!rn)return t;return function(){try{return t(...arguments)}catch(t){if(rn&&!0===rn(t))return;throw t}}},cn=[];function hn(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 vn(t,e){var r=new on;cn.push(r),r.init(t);var n=new(Ar())(dn(r.processMutations.bind(r)));return n.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function fn(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;if(!1===s.mouseInteraction)return()=>{};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],d=null;return Object.keys(Pr).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var s=De(t),a=(t=>r=>{var s=hn(r);if(!Er(s,i,o,!0)){var a=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":a=qr.Mouse;break;case"touch":a=qr.Touch;break;case"pen":a=qr.Pen}a===qr.Touch?Pr[t]===Pr.MouseDown?l="TouchStart":Pr[t]===Pr.MouseUp&&(l="TouchEnd"):qr.Pen}else Wr(r)&&(a=qr.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===qr.Touch||l.startsWith("Mouse")&&a===qr.Mouse)&&(a=null)):Pr[t]===Pr.Click&&(a=d,d=null);var c=Wr(r)?r.changedTouches[0]:r;if(c){var h=n.getId(s),{clientX:v,clientY:f}=c;dn(e)(u({type:Pr[l],id:h,x:v,y:f},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch(Pr[t]){case Pr.MouseDown:case Pr.MouseUp:s=s.replace("mouse","pointer");break;case Pr.TouchStart:case Pr.TouchEnd:return}l.push(Nr(s,a,r))})),dn((()=>{l.forEach((t=>t()))}))}function mn(t){var{scrollCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;return Nr("scroll",dn(Mr(dn((t=>{var s=hn(t);if(s&&!Er(s,i,o,!0)){var a=n.getId(s);if(s===r&&r.defaultView){var u=Or(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var pn=["INPUT","TEXTAREA","SELECT"],gn=new WeakMap;function In(t){return function(t,e){if(wn("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||wn("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||wn("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||wn("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function yn(t,e,r){var n,i;return t?(t.ownerNode?n=e.getId(t.ownerNode):i=r.getId(t),{styleId:i,id:n}):{}}function bn(t,e){var r,n,i,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(kr.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),dn((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Cn(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:c,fontCb:h,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),n(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),i(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),d(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),h(...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=vn(t,t.doc));var i=function(t){var{mousemoveCb:e,sampling:r,doc:n,mirror:i}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Mr(dn((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),d=dn(Mr(dn((t=>{var e=hn(t),{clientX:r,clientY:n}=Wr(t)?t.changedTouches[0]:t;o||(o=Br()),u.push({x:r,y:n,id:i.getId(e),timeOffset:Br()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Ur.Drag:t instanceof MouseEvent?Ur.MouseMove:Ur.TouchMove)})),s,{trailing:!1})),c=[Nr("mousemove",d,n),Nr("touchmove",d,n),Nr("drag",d,n)];return dn((()=>{c.forEach((t=>t()))}))}(t),o=fn(t),s=mn(t),a=function(t,e){var{viewportResizeCb:r}=t,{win:n}=e,i=-1,o=-1;return Nr("resize",dn(Mr(dn((()=>{var t=xr(),e=Zr();i===t&&o===e||(r({width:Number(e),height:Number(t)}),i=t,o=e)})),200)),n)}(t,{win:n}),l=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:c,userTriggeredOnInput:h}=t;function v(t){var e=hn(t),n=t.isTrusted,u=e&&e.tagName;if(e&&"OPTION"===u&&(e=kr.parentElement(e)),e&&u&&!(pn.indexOf(u)<0)&&!Er(e,i,o,!0)&&!(e.classList.contains(s)||a&&e.matches(a))){var c=e.value,v=!1,m=Xe(e)||"";"radio"===m||"checkbox"===m?v=e.checked:(l[u.toLowerCase()]||l[m])&&(c=We({element:e,maskInputOptions:l,tagName:u,type:m,value:c,maskInputFn:d})),f(e,h?{text:c,isChecked:v,userTriggered:n}:{text:c,isChecked:v});var p=e.name;"radio"===m&&p&&v&&r.querySelectorAll('input[type="radio"][name="'+p+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,r){var i=gn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){gn.set(t,r);var o=n.getId(t);dn(e)(u({},r,{id:o}))}}var m=("last"===c.input?["change"]:["input","change"]).map((t=>Nr(t,dn(v),r))),p=r.defaultView;if(!p)return()=>{m.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),I=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...I.map((t=>Fr(t[0],t[1],{set(){dn(v)({target:this,isTrusted:!1})}},!1,p)))),dn((()=>{m.forEach((t=>t()))}))}(t),d=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:s}=t,a=dn((t=>Mr(dn((o=>{var s=hn(o);if(s&&!Er(s,r,n,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:d,loop:c}=s;e({type:t,id:i.getId(s),currentTime:a,volume:u,muted:l,playbackRate:d,loop:c})}})),o.media||500))),u=[Nr("play",a($r.Play),s),Nr("pause",a($r.Pause),s),Nr("seeked",a($r.Seeked),s),Nr("volumechange",a($r.VolumeChange),s),Nr("ratechange",a($r.RateChange),s)];return dn((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},h=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:dn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=yn(e,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var n=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var d={};Sn("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(Sn("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),Sn("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),Sn("CSSSupportsRule")&&(d.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:dn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=yn(e.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...In(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:dn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=yn(e.parentStyleSheet,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...In(e),s]}]}),t.apply(e,o)}))})})),dn((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),h=bn(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:dn(((t,e,s)=>{var u,[l,d,c]=s;if(i.has(l))return a.apply(e,[l,d,c]);var{id:h,styleId:v}=yn(null==(u=e.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:d,priority:c},index:In(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:dn(((t,e,s)=>{var a,[l]=s;if(i.has(l))return u.apply(e,[l]);var{id:d,styleId:c}=yn(null==(a=e.parentRule)?void 0:a.parentStyleSheet,n,o.styleMirror);return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:In(e.parentRule)}),t.apply(e,s)}))}),dn((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,r){var n=new s(t,e,r);return o.set(n,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n};var a=_r(r.fonts,"add",(function(t){return function(r){return setTimeout(dn((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return i.push((()=>{n.FontFace=s})),i.push(a),dn((()=>{i.forEach((t=>t()))}))}(t)));var m=function(t){var{doc:e,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=t,s=!0,a=dn((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var d=t.getRangeAt(l),{startContainer:c,startOffset:h,endContainer:v,endOffset:f}=d;Er(c,n,i,!0)||Er(v,n,i,!0)||a.push({start:r.getId(c),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),Nr("selectionchange",a)}(t),p=function(t){var{doc:e,customElementCb:r}=t,n=e.defaultView;return n&&n.customElements?_r(n.customElements,"define",(function(t){return function(e,n,i){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,n,i])}})):()=>{}}(t),g=[];for(var I of t.plugins)g.push(I.observer(I.callback,n,I.options));return dn((()=>{cn.forEach((t=>t.reset())),null==r||r.disconnect(),i(),o(),s(),a(),l(),d(),c(),h(),v(),f(),m(),p(),g.forEach((t=>t()))}))}function wn(t){return void 0!==window[t]}function Sn(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class An{constructor(t){be(this,"iframeIdToRemoteIdMap",new WeakMap),be(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,n){var i=r||this.getIdToRemoteIdMap(t),o=n||this.getRemoteIdToIdMap(t),s=i.get(e);return s||(s=this.generateIdFn(),i.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,n)))}getRemoteId(t,e,r){var n=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var i=n.get(e);return i||-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||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class kn{constructor(t){be(this,"iframes",new WeakMap),be(this,"crossOriginIframeMap",new WeakMap),be(this,"crossOriginIframeMirror",new An(er)),be(this,"crossOriginIframeStyleMirror"),be(this,"crossOriginIframeRootIdMap",new WeakMap),be(this,"mirror"),be(this,"mutationCb"),be(this,"wrappedEmit"),be(this,"loadListener"),be(this,"stylesheetManager"),be(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new An(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,n;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==(n=this.loadListener)||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){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 n=this.transformCrossOriginEvent(r,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case jr.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:jr.IncrementalSnapshot,data:{source:Ur.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case jr.Meta:case jr.Load:case jr.DomContentLoaded:return!1;case jr.Plugin:return e;case jr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case jr.IncrementalSnapshot:switch(e.data.source){case Ur.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 Ur.Drag:case Ur.TouchMove:case Ur.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Ur.ViewportResize:return!1;case Ur.MediaInteraction:case Ur.MouseInteraction:case Ur.Scroll:case Ur.CanvasMutation:case Ur.Input:return this.replaceIds(e.data,t,["id"]),e;case Ur.StyleSheetRule:case Ur.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Ur.Font:return e;case Ur.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Ur.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,n){for(var i of n)(Array.isArray(e[i])||"number"==typeof e[i])&&(Array.isArray(e[i])?e[i]=t.getIds(r,e[i]):e[i]=t.getId(r,e[i]));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===Se.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Nn{constructor(t){be(this,"shadowDoms",new WeakSet),be(this,"mutationCb"),be(this,"scrollCb"),be(this,"bypassOptions"),be(this,"mirror"),be(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(Ze(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=vn(u({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(mn(u({},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(kr.host(t))),this.restoreHandlers.push(bn({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(_r(t.prototype,"attachShadow",(function(t){return function(n){var i=t.call(this,n),o=kr.shadowRoot(this);return o&&Hr(this)&&r.addShadowRoot(o,e),i}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Mn=0;Mn<64;Mn++)Tn[Rn.charCodeAt(Mn)]=Mn;var Fn=new Map;var _n=(t,e,r)=>{if(t&&(xn(t,e)||"object"==typeof t)){var n=function(t,e){var r=Fn.get(t);return r||(r=new Map,Fn.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),i=n.indexOf(t);return-1===i&&(i=n.length,n.push(t)),i}};function Bn(t,e,r){if(t instanceof Array)return t.map((t=>Bn(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),n=r.length,i="";for(e=0;e<n;e+=3)i+=Rn[r[e]>>2],i+=Rn[(3&r[e])<<4|r[e+1]>>4],i+=Rn[(15&r[e+1])<<2|r[e+2]>>6],i+=Rn[63&r[e+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Bn(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var n=t.constructor.name,{src:i}=t;return{rr_type:n,src:i}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Bn(t.data,e,r),t.width,t.height]}:xn(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:_n(t,e,r)}:t}var On=(t,e,r)=>t.map((t=>Bn(t,e,r))),xn=(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 Zn(t,e,r,n){var i=[];try{var o=_r(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Er(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(i);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[i,...s])}}));i.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((t=>t()))}}function Yn(t,e,r,n,i,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=_r(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var d=t.apply(this,u);if(_n(d,o,this),"tagName"in this.canvas&&!Er(this.canvas,n,i,!0)){var c=On(u,o,this),h={type:e,property:a,args:c};r(this.canvas,h)}return d}}));s.push(u)}catch(n){var l=Fr(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(l)}};for(var l of a)u(l);return s}var En,Gn,Ln,Wn,Dn="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Vn="undefined"!=typeof window&&window.Blob&&new Blob([(En=Dn,Uint8Array.from(atob(En),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Xn(t){var e;try{if(!(e=Vn&&(window.URL||window.webkitURL).createObjectURL(Vn)))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,"+Dn,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class zn{constructor(t){be(this,"pendingCanvasMutations",new Map),be(this,"rafStamps",{latestId:0,invokeId:null}),be(this,"mirror"),be(this,"mutationCb"),be(this,"resetObservers"),be(this,"frozen",!1),be(this,"locked",!1),be(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:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,n,i){var o=this,s=Zn(e,r,n,!0),u=new Map,l=new Xn;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:n,width:i,height:o}=t.data;this.mutationCb({id:e,type:Qr["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var d,c=1e3/t,h=0,v=t=>{var s,f;h&&t-h<c?d=requestAnimationFrame(v):(h=t,(s=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{Er(t,r,n,!0)||s.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(e.document),s).forEach(function(){var t=a((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);!1===(null==(e=null==n?void 0:n.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var s=t.clientWidth||t.width,a=t.clientHeight||t.height,d=yield createImageBitmap(t,{resizeWidth:s,resizeHeight:a});l.postMessage({id:r,bitmap:d,width:s,height:a,dataURLOptions:i.dataURLOptions},[d])}}));return function(e){return t.apply(this,arguments)}}()),d=requestAnimationFrame(v))};d=requestAnimationFrame(v),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Zn(t,e,r,!1),i=function(t,e,r,n){var i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=_r(e.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return Er(this.canvas,r,n,!0)||setTimeout((()=>{var r=On(a,e,this);t(this.canvas,{type:Qr["2D"],property:o,args:r})}),0),i.apply(this,a)}}));i.push(s)}catch(r){var a=Fr(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:Qr["2D"],property:o,args:[e],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,n){var i=[];return i.push(...Yn(e.WebGLRenderingContext.prototype,Qr.WebGL,t,r,n,e)),void 0!==e.WebGL2RenderingContext&&i.push(...Yn(e.WebGL2RenderingContext.prototype,Qr.WebGL2,t,r,n,e)),()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{n(),i(),o()}}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 n=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,Ie);return e})),{type:i}=r[0];this.mutationCb({id:e,type:i,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Jn{constructor(t){be(this,"trackedLinkElements",new WeakSet),be(this,"mutationCb"),be(this,"adoptedStyleSheetCb"),be(this,"styleMirror",new zr),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 n={id:e,styleIds:[]},i=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:Ee(e,t.href),index:r})))})),n.styleIds.push(e)};for(var s of t)o(s);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Kn{constructor(){be(this,"nodeMap",new WeakMap),be(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 Hn=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var jn=document.createElement("iframe");document.body.appendChild(jn),Array.from=(null==(ge=jn.contentWindow)?void 0:ge.Array.from)||Array.from,document.body.removeChild(jn)}}catch(t){console.debug("Unable to override Array.from",t)}var Un,Pn,qn=new Le;function Qn(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:v,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:I,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:S=!1,recordCrossOriginIframes:A=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:N=!1,collectFonts:R=!1,inlineImages:T=!1,plugins:M,keepIframeSrcFn:F=(()=>!1),ignoreCSSAttributes:_=new Set([]),errorHandler:B}=t;rn=B;var O=!A||window.parent===window,x=!1;if(!O)try{window.parent.document&&(x=!1)}catch(t){x=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!x)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),qn.reset();var Z,Y=!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}: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=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var G=0,L=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!x&&(t=I(t)),t};Gn=(t,i)=>{var o,s=t;if(s.timestamp=Br(),!(null==(o=cn[0])?void 0:o.isFrozen())||s.type===jr.FullSnapshot||s.type===jr.IncrementalSnapshot&&s.data.source===Ur.Mutation||cn.forEach((t=>t.unfreeze())),O)null==e||e(L(s),i);else if(x){var a={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(s.type===jr.FullSnapshot)Z=s,G=0;else if(s.type===jr.IncrementalSnapshot){if(s.data.source===Ur.Mutation&&s.data.isAttachIframe)return;G++;var u=n&&G>=n,l=r&&s.timestamp-Z.timestamp>r;(u||l)&&Ln(!0)}};var W=t=>{Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Mutation},t)})},D=t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Scroll},t)}),V=t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.CanvasMutation},t)}),X=new Jn({mutationCb:W,adoptedStyleSheetCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.AdoptedStyleSheet},t)})}),z=new kn({mirror:qn,mutationCb:W,stylesheetManager:X,recordCrossOriginIframes:A,wrappedEmit:Gn});for(var J of M||[])J.getMirror&&J.getMirror({nodeMirror:qn,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new Kn;Wn=new zn({recordCanvas:S,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:qn,sampling:y.canvas,dataURLOptions:b});var H=new Nn({mutationCb:W,scrollCb:D,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskInputOptions:Y,dataURLOptions:b,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:T,sampling:y,slimDOMOptions:E,iframeManager:z,stylesheetManager:X,canvasManager:Wn,keepIframeSrcFn:F,processedNodeManager:K},mirror:qn});Ln=function(t){if(void 0===t&&(t=!1),w){Gn({type:jr.Meta,data:{href:window.location.href,width:Zr(),height:xr()}},t),X.reset(),H.init(),cn.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new Le,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:c,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C=(()=>!1)}=e||{};return fr(t,{doc:t,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:c,maskInputFn:h,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:u,recordCanvas:l,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:qn,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Y,maskTextFn:p,maskInputFn:m,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:t=>{Dr(t,qn)&&z.addIframe(t),Vr(t,qn)&&X.trackLinkElement(t),Xr(t)&&H.addShadowRoot(kr.shadowRoot(t),document)},onIframeLoad:(t,e)=>{z.attachIframe(t,e),H.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{X.attachLinkElement(t,e)},keepIframeSrcFn:F});if(!e)return console.warn("Failed to snapshot the document");Gn({type:jr.FullSnapshot,data:{node:e,initialOffset:Or(window)}},t),cn.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,qn.getId(document))}};try{var j=[],U=t=>{var e;return dn(Cn)({mutationCb:W,mousemoveCb:(t,e)=>Gn({type:jr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.MouseInteraction},t)}),scrollCb:D,viewportResizeCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.ViewportResize},t)}),inputCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Input},t)}),mediaInteractionCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.MediaInteraction},t)}),styleSheetRuleCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.StyleSheetRule},t)}),styleDeclarationCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Font},t)}),selectionCb:t=>{Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.Selection},t)})},customElementCb:t=>{Gn({type:jr.IncrementalSnapshot,data:u({source:Ur.CustomElement},t)})},blockClass:i,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:d,maskInputOptions:Y,inlineStylesheet:c,sampling:y,recordDOM:w,recordCanvas:S,inlineImages:T,userTriggeredOnInput:N,collectFonts:R,doc:t,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:F,blockSelector:o,slimDOMOptions:E,dataURLOptions:b,mirror:qn,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:Wn,ignoreCSSAttributes:_,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Gn({type:jr.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},g)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{Ln(),j.push(U(document)),Hn=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(Nr("DOMContentLoaded",(()=>{Gn({type:jr.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&P()}))),j.push(Nr("load",(()=>{Gn({type:jr.Load,data:{}}),"load"===k&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),Hn=!1,rn=void 0}}catch(t){console.warn(t)}}Qn.addCustomEvent=(t,e)=>{if(!Hn)throw new Error("please add custom event after start recording");Gn({type:jr.Custom,data:{tag:t,payload:e}})},Qn.freezePage=()=>{cn.forEach((t=>t.freeze()))},Qn.takeFullSnapshot=t=>{if(!Hn)throw new Error("please take full snapshot after start recording");Ln(t)},Qn.mirror=qn,(Pn=Un||(Un={}))[Pn.NotStarted=0]="NotStarted",Pn[Pn.Running=1]="Running",Pn[Pn.Stopped=2]="Stopped";var $n,ti=Object.defineProperty,ei=(t,e,r)=>((t,e,r)=>e in t?ti(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ri=Object.defineProperty,ni=(t,e,r)=>((t,e,r)=>e in t?ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ii=Object.defineProperty,oi=(t,e,r)=>((t,e,r)=>e in t?ii(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),si={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ai={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ui={};function li(t){if(ui[t])return ui[t];var e=globalThis[t],r=e.prototype,n=t in si?si[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in ai?ai[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return ui[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?ui[t]=l:r}catch(t){return r}}var di={};function ci(t,e,r){var n,i=t+"."+String(r);if(di[i])return di[i].call(e);var o=li(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(di[i]=s,s.call(e)):e[r]}var hi={};function vi(t,e,r){var n=t+"."+String(r);if(hi[n])return hi[n].bind(e);var i=li(t)[r];return"function"!=typeof i?e[r]:(hi[n]=i,i.bind(e))}var fi={childNodes:function(t){return ci("Node",t,"childNodes")},parentNode:function(t){return ci("Node",t,"parentNode")},parentElement:function(t){return ci("Node",t,"parentElement")},textContent:function(t){return ci("Node",t,"textContent")},contains:function(t,e){return vi("Node",t,"contains")(e)},getRootNode:function(t){return vi("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ci("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ci("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ci("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ci("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return li("MutationObserver").constructor}};class mi{constructor(){oi(this,"idNodeMap",new Map),oi(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){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function pi(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&pi(fi.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&pi(fi.parentNode(t),e,r)}class gi{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 gi))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 Ii={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},yi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},bi={};function Ci(t){if(bi[t])return bi[t];var e=globalThis[t],r=e.prototype,n=t in Ii?Ii[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in yi?yi[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(i&&s)return bi[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?bi[t]=l:r}catch(t){return r}}var wi={};function Si(t,e,r){var n,i=t+"."+String(r);if(wi[i])return wi[i].call(e);var o=Ci(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(wi[i]=s,s.call(e)):e[r]}var Ai={};function ki(t,e,r){var n=t+"."+String(r);if(Ai[n])return Ai[n].bind(e);var i=Ci(t)[r];return"function"!=typeof i?e[r]:(Ai[n]=i,i.bind(e))}var Ni={childNodes:function(t){return Si("Node",t,"childNodes")},parentNode:function(t){return Si("Node",t,"parentNode")},parentElement:function(t){return Si("Node",t,"parentElement")},textContent:function(t){return Si("Node",t,"textContent")},contains:function(t,e){return ki("Node",t,"contains")(e)},getRootNode:function(t){return ki("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Si("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Si("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Si("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Si("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Ci("MutationObserver").constructor}};var Ri="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.",Ti={map:{},getId:()=>(console.error(Ri),-1),getNode:()=>(console.error(Ri),null),removeNodeFromMap(){console.error(Ri)},has:()=>(console.error(Ri),!1),reset(){console.error(Ri)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ti=new Proxy(Ti,{get:(t,e,r)=>("map"===e&&console.error(Ri),Reflect.get(t,e,r))}));var Mi=Date.now;function Fi(t){return t?t.nodeType===t.ELEMENT_NODE?t:Ni.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(Mi=()=>(new Date).getTime());function _i(t){var e,r=null;return"getRootNode"in t&&(null==(e=Ni.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Ni.host(Ni.getRootNode(t))&&(r=Ni.host(Ni.getRootNode(t))),r}function Bi(t){for(var e,r=t;e=_i(r);)r=e;return r}function Oi(t){var e=t.ownerDocument;if(!e)return!1;var r=Bi(t);return Ni.contains(e,r)}for(var xi=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){ni(this,"id",1),ni(this,"styleIDMap",new WeakMap),ni(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 Ti},closestElementOfNode:Fi,getBaseDimension:function t(e,r){var n,i,o=null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var n=e[r[0]];return 1===r.length?n:t(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:Bi,getShadowHost:_i,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,n,i,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=Ni.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=Ni.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof gi&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Ni.shadowRoot(t)))},hookSetter:function t(e,r,n,i,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,i?n:{set(t){setTimeout((()=>{n.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(Ni.contains(e,t)||Oi(t))},isAncestorRemoved:function t(e,r){if(i=(n=e)&&"host"in n&&"mode"in n&&fi.host(n)||null,Boolean(i&&"shadowRoot"in i&&fi.shadowRoot(i)===n))return!1;var n,i,o=r.getId(e);if(!r.has(o))return!0;var s=Ni.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,n){if(!t)return!1;var i=Fi(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(pi(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return 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 n=e.children.length-1;n>=0;n--)t(e.children[n],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return Mi},on:function(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var n={value:t,parent:r,children:[]};return e[t.node.id]=n,n},n=[];for(var i of t){var{nextId:o,parentId:s}=i;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(i,a.parent))}else{var l=n.indexOf(a);n.splice(l,0,r(i,null))}}else if(s in e){var d=e[s];d.children.push(r(i,d))}else n.push(r(i,null))}return n},shadowHostInDom:Oi,throttle:function(t,e,r){void 0===r&&(r={});var n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],n=t.length;n--;){var i=t[n];e.has(i.id)||(r.push(i),e.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Zi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ei=0;Ei<64;Ei++)Yi[Zi.charCodeAt(Ei)]=Ei;var Gi;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var Li=document.createElement("iframe");document.body.appendChild(Li),Array.from=(null==($n=Li.contentWindow)?void 0:$n.Array.from)||Array.from,document.body.removeChild(Li)}}catch(t){console.debug("Unable to override Array.from",t)}new mi,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Gi||(Gi={}));class Wi{constructor(t){ei(this,"fileName"),ei(this,"functionName"),ei(this,"lineNumber"),ei(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 Di=/(^|@)\S+:\d+/,Vi=/^\s*at .*(\S+:\d+|\(native\))/m,Xi=/^(eval@)?(\[native code])?$/,zi={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Vi)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(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:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Vi)}),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+)\)$)/),n=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Wi({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Xi)}),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 Wi({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Wi({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(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:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Wi({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Wi({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Di)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),n=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Wi({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ji(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var n=t.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var s=n.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&i.push(s)}i.length>1&&(r+=":eq("+i.indexOf(t)+")"),e=r+(e?">"+e:""),t=n}return e}function Ki(t){return"[object Object]"===Object.prototype.toString.call(t)}function Hi(t,e){if(0===e)return!0;var r=Object.keys(t);for(var n of r)if(Ki(t[n])&&Hi(t[n],e-1))return!0;return!1}function ji(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var n=[],i=[];return JSON.stringify(t,(function(t,e){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,t):i.push(t),~n.indexOf(e)&&(e=n[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(e)).join(".")+"]")}else n.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Ki(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Ki(t)&&Hi(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Ji(u.length?u[0]:null):s[a]=u}return s}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 Ui={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 Pi(t,e,r){var n,i=r?Object.assign({},Ui,r):Ui,o=i.logger;if(!o)return()=>{};n="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(i.level.includes("error")){var l=e=>{var r=e.message,n=e.error,o=zi.parse(n).map((t=>t.toString())),s=[ji(r,i.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var d=e=>{var r,n;e.reason instanceof Error?n=[ji("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[ji("Uncaught (in promise)",i.stringifyOptions),ji(e.reason,i.stringifyOptions)]);var o=zi.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:n})};e.addEventListener("unhandledrejection",d),u.push((()=>{e.removeEventListener("unhandledrejection",d)}))}for(var c of i.level)u.push(h(n,c));return()=>{u.forEach((t=>t()))};function h(e,r){var n=this;return e[r]?xi.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(e.apply(n,u),!("assert"===r&&u[0]||a)){a=!0;try{var d=zi.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>ji(t,i.stringifyOptions)));++s<i.lengthThreshold?t({level:r,trace:d,payload:c}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[ji("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var qi=t=>({name:"rrweb/console@1",observer:Pi,options:t}),Qi=t=>t instanceof Document;function $i(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return g(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}function to(t,e){var r,n=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),i={hostname:n,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of e.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}var eo=_("[Recorder]"),ro=t=>"navigation"===t.entryType,no=t=>"resource"===t.entryType;function io(t,e,r){if(r.recordInitialRequests){var n=e.performance.getEntries().filter((t=>ro(t)||no(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:n.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new e.PerformanceObserver((e=>{var n=e.getEntries().filter((t=>ro(t)||no(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:n.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function oo(t,e){return!!e&&(A(e)||e[t])}function so(t){var{type:e,recordBody:r,headers:n,url:i}=t;function o(t){var e=Object.keys(n).find((t=>"content-type"===t.toLowerCase())),r=e&&n[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}}(i))return!1;if(A(r))return!0;if(p(r))return o(r);var s=r[e];return A(s)?s:o(s)}function ao(t,e,r,n,i,o){return uo.apply(this,arguments)}function uo(){return uo=a((function*(t,e,r,n,i,o){if(void 0===o&&(o=0),o>10)return eo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>no(t)&&t.initiatorType===e&&(y(n)||t.startTime>=n)&&(y(i)||t.startTime<=i)));return s||(yield new Promise((t=>setTimeout(t,50*o))),ao(t,e,r,n,i,o+1))})),uo.apply(this,arguments)}function lo(t){var{body:e,options:r,url:n}=t;if(w(e))return null;var{hostname:i,isHostDenied:o}=to(n,r);if(o)return i+" is in deny list";if(b(e))return e;if(Qi(e))return e.textContent;if(k(e))return E(e);if(I(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 co=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ho(t){var{entry:e,method:r,status:n,networkRequest:i,isInitial:o,start:s,end:a,url:l,initiatorType:d}=t;s=e?e.startTime:s,a=e?e.responseEnd:a;var c=Math.floor(Date.now()-performance.now()),h=Math.floor(c+(s||0)),v=[u({},e?e.toJSON():{name:l},{startTime:y(s)?void 0:Math.round(s),endTime:y(a)?void 0:Math.round(a),timeOrigin:c,timestamp:h,method:r,initiatorType:d||(e?e.initiatorType:void 0),status:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(co(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:h,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var vo=["video/","audio/"];function fo(t){return new Promise(((e,r)=>{var n=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(n)))}catch(t){clearTimeout(n),e("[SessionReplay] Failed to read body")}}))}function mo(){return(mo=a((function*(t){var{r:e,options:r,url:n}=t,{hostname:i,isHostDenied:o}=to(n,r);return o?Promise.resolve(i+" is in deny list"):fo(e)}))).apply(this,arguments)}function po(){return(po=a((function*(t){var{r:e,options:r,url:n}=t,i=function(t){var e,{r:r,options:n,url:i}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=vo.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=to(i,n);return u?a+" is in deny list":null}({r:e,options:r,url:n});return C(i)?fo(e):Promise.resolve(i)}))).apply(this,arguments)}function go(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=oo("request",r.recordHeaders),i=oo("response",r.recordHeaders),o=$i(e,"fetch",(o=>function(){var s=a((function*(s,a){var u,l,d,c=new Request(s,a),h={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(h.requestHeaders=v),so({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(h.requestBody=yield function(t){return mo.apply(this,arguments)}({r:c,options:r,url:s})),l=e.performance.now(),u=yield o(c),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),i&&(h.responseHeaders=f),so({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(h.responseBody=yield function(t){return po.apply(this,arguments)}({r:u,options:r,url:s})),u}finally{ao(e,"fetch",c.url,l,d).then((e=>{var r,n=ho({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:d,url:c.url,initiatorType:"fetch"});t({requests:n})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}var Io=null;function yo(t,e,r){if(!("performance"in e))return()=>{};if(Io)return eo.warn("Network observer already initialised, doing nothing"),()=>{};var n=r?Object.assign({},J,r):J,i=e=>{var r=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(u({},e,{requests:r}))},o=io(i,e,n),s=()=>{},a=()=>{};return(n.recordHeaders||n.recordBody)&&(s=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=oo("request",r.recordHeaders),i=oo("response",r.recordHeaders),o=$i(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,d){void 0===u&&(u=!0);var c,h,v=this,f=new Request(a),m={},p={},g=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(p[t]=e,g(t,e)),n&&(m.requestHeaders=p);var I=v.send.bind(v);v.send=t=>(so({type:"request",headers:p,url:a,recordBody:r.recordBody})&&(m.requestBody=lo({body:t,options:r,url:a})),c=e.performance.now(),I(t));var y=()=>{if(v.readyState===v.DONE){v.removeEventListener("readystatechange",y),h=e.performance.now();var n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),i=e.join(": ");r&&(n[r]=i)})),i&&(m.responseHeaders=n),so({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(m.responseBody=lo({body:v.response,options:r,url:a})),ao(e,"xmlhttprequest",f.url,c,h).then((e=>{var r=ho({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:m,start:c,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",y),o.call(v,s,a,u,l,d)}));return()=>{o()}}(i,e,n),a=go(i,e,n)),Io=()=>{o(),s(),a()}}var bo=t=>({name:"rrweb/network@1",observer:yo,options:t});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:qi,getRecordNetworkPlugin:bo},o.__PosthogExtensions__.rrweb={record:Qn,version:"v2"},o.rrweb={record:Qn,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:qi},o.getRecordNetworkPlugin=bo,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=t=>new pe(t)}();
|
|
2
2
|
//# sourceMappingURL=lazy-recorder.js.map
|