var perfill=function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}const n=()=>"undefined"!=typeof window,r=()=>"fetch"in window,o=()=>"navigator"in window;var i={supportsEnvironment:n,supportsNavigatorApi:o,supportsPerformanceApi:()=>"performance"in window,supportsBeaconOrFetch:()=>o()&&"sendBeacon"in window.navigator||r(),supportsFetchApi:r,supportsMatchMediaApi:()=>n()&&void 0!==window.matchMedia,supportsPreloadState:()=>n()&&"__PRELOADED_STATE__"in window,supportsWeakSet:()=>"WeakSet"in window,supportsLocalStorageApi:()=>"localStorage"in window};const s={},a={};var c={subscribe:(e,t)=>{a[e]=a[e]||[],a[e].push(t),(s[e]||[]).map((e=>t(e))),delete s[e]},queue:(e,t)=>{const n=a[e]||[];n.forEach((e=>e(t))),n.length||(s[e]=s[e]||[],s[e].push(t))}},l={CLIENT_COOKIES:"client-cookies",WEB_VITALS:"web-vitals",RESOURCE_TIMING:"resource-timing",PAGE_RENDER:"page-render",A11Y:"a11y",AVAILABILITY:"availability",CDN_HEALTH:"cdn-health",TRAFFIC_HEALTH:"traffic-health",SESSION_REPLAY:"session-replay"};var u={arrayOperator:e=>e.reduce(((e,t)=>e.concat(t)),[]),objectOperator:e=>Object.keys(e).reduce(((t,n)=>{const r=e[n],o="object"!=typeof r||Array.isArray(r)||null===r?{[n]:r}:r;return Object.assign(t,o)}),{})},d={endpoint:"https://events.mercadolibre.com/v2/perf-metric",deviceInfoMetrics:["ram-size","cpu-cores"],connectionInfoMetrics:["network-type","network-speed","user-agent","save-data","rtt"],clientInfo:["name","version"],tags:["platform","site","application","device","webview","scope"],browserInfoMetrics:["d2id","url","dark-mode","session-id"]},h={AVAILABILITY_FAILURE:"failure",AVAILABILITY_TRANSFER_SIZE:"transfersize",AVAILABILITY_BROWSER_ERRORS:"errors-js",BROWSER:"browser",WINDOW_DOM:"window-dom",D2ID:"d2id",NETWORK_TYPE:"network-type",NETWORK_SPEED:"network-speed",USER_AGENT:"user-agent",RAM_SIZE:"ram-size",CPU_CORES:"cpu-cores",WINDOW_WIDTH:"window-width",WINDOW_HEIGHT:"window-height",LCP:"lcp",CLS:"cls",FCP:"fcp",FID:"fid",TBT:"tbt",INP:"inp",TTFB:"time-to-first-byte",DNS_LOOKUP_TIME:"dns-lookup-time",DOWNLOAD_TIME:"download-time",FETCH_TIME:"fetch-time",HEADER_SIZE:"header-size",TOTAL_TIME:"total-time",WORKER_TIME:"worker-time",HYDRATE_COMPLETE:"hydrate-complete",HYDRATE_DURATION:"hydrate-duration",REDIRECT_COUNT:"redirect-count",DOM_COMPLETE:"dom-complete",DOM_INTERACTIVE:"dom-interactive",DOM_CONTENT_LOADED_END:"dom-content-loaded-end",DOM_CONTENT_LOADED_START:"dom-content-loaded-start",DOM_CONTENT_LOADED:"dom-content-loaded",ONLOAD:"onload",ONLOAD_END:"onload-end",ONLOAD_START:"onload-start",REQUEST_START:"request-start",RESPONSE_START:"response-start",RESPONSE_END:"response-end",RESPONSE_TIME:"response-time",NAVIGATION_TYPE:"navigation-type",NAVIGATION_TIMING:"navigationtiming",INITIAL_CONTENT_SIZE:"initial-content-size",DARK_MODE:"dark-mode",REDUCED_MOTION:"reduced-motion",REDUCED_COLOR:"reduced-contrast",URL:"url",X_CDN:"cdn",DURATION_SUM:"duration-sum",RESOURCE_SIZE:"resources-size",RESOURCE_FAILURE:"resources-failure",RESOURCE_SUCCESS:"resources-success",DEBUG_TARGET_LCP:"debug-target-lcp",DEBUG_TARGET_FID:"debug-target-fid",DEBUG_TARGET_CLS:"debug-target-cls",DEBUG_TARGET_INP:"debug-target-inp",RESOURCE_TIMING:"resourceTiming",SESSION_REPLAY:"session-replay",SESSION_REPLAY_CTX:"session-replay-ctx",SESSION_REPLAY_START:"start-recording",SESSION_REPLAY_STOP:"stop-recording",TRACEABILITY_ID:"traceability-id",APP_NAME:"application",SCOPE_NAME:"scope",DEVICE:"device",PLATFORM_ID:"platform",SITE_ID:"site",WEBVIEW:"webview",SESSION_ID:"session-id",MLDATA_SESSION_ID:"_mldataSessionId",REQUEST_ID:"requestId",VIEW_NAME:"view-name",CUSTOM_ATTRIBUTES:"custom-attributes",USER_ID:"user-id",CONTEXT_ID:"context-id",FRONTEND_SESSION_ID:"frontend-session-id"};const{objectOperator:p}=u,m=d,{FCP:f,LCP:g,FID:y,CLS:v,TBT:E,INP:S,DNS_LOOKUP_TIME:T,DOWNLOAD_TIME:w,FETCH_TIME:b,HEADER_SIZE:I,TTFB:M,TOTAL_TIME:C,WORKER_TIME:N,REDIRECT_COUNT:O,DOM_COMPLETE:D,DOM_INTERACTIVE:R,DOM_CONTENT_LOADED_END:A,DOM_CONTENT_LOADED_START:k,DOM_CONTENT_LOADED:_,ONLOAD_END:L,ONLOAD_START:x,ONLOAD:F,REQUEST_START:P,RESPONSE_START:U,RESPONSE_END:B,RESPONSE_TIME:W,NAVIGATION_TYPE:j,INITIAL_CONTENT_SIZE:V,REDUCED_MOTION:$,REDUCED_COLOR:H,DEBUG_TARGET_LCP:G,DEBUG_TARGET_CLS:Y,DEBUG_TARGET_FID:z,DEBUG_TARGET_INP:q}=h;var X=p({commons:m,metrics:[f,g,y,v,E,S,T,w,b,I,M,C,N,O,D,R,A,k,_,L,x,F,P,U,B,W,j,V,$,H,G,Y,z,q]});const{objectOperator:Z}=u,K=d,{HYDRATE_COMPLETE:J,HYDRATE_DURATION:Q}=h;var ee=Z({commons:K,metrics:[J,Q]});const{objectOperator:te}=u,ne=d,{AVAILABILITY_FAILURE:re,AVAILABILITY_TRANSFER_SIZE:oe,AVAILABILITY_BROWSER_ERRORS:ie}=h;var se=te([ne,{thresholdEntries:{img:25e4,script:17e4,style:5e4},fileSupport:{img:["apng","avif","gif","jpg","jpeg","jfif","pjpeg","pjp","png","svg","webp"],script:["js"],style:["css"]},metrics:[re,oe,ie]}]);const{objectOperator:ae}=u,ce=d,{X_CDN:le,RESOURCE_SIZE:ue,DURATION_SUM:de}=h;var he=ae({commons:ce,metrics:[le,ue,de]});const{objectOperator:pe}=u,me=d,{WINDOW_DOM:fe,WINDOW_WIDTH:ge,WINDOW_HEIGHT:ye}=h;var ve=pe([me,{endpoint:"https://events.mercadolibre.com/dom",metrics:[fe,ge,ye]}]);const{objectOperator:Ee}=u,Se=d,{WINDOW_DOM:Te,WINDOW_WIDTH:we,WINDOW_HEIGHT:be,RAM_SIZE:Ie,CPU_CORES:Me,USER_AGENT:Ce,DARK_MODE:Ne,REDUCED_MOTION:Oe,REDUCED_COLOR:De,APP_NAME:Re,SCOPE_NAME:Ae,DEVICE:ke,PLATFORM_ID:_e,SITE_ID:Le,WEBVIEW:xe,REQUEST_ID:Fe,VIEW_NAME:Pe}=h,Ue=1e6;var Be=Ee([Se,{endpoint:e=>`https://events.mercadolibre.com/v1/media-storage-service/session-replay-store-${e}/assets`,RRWEB_EVENT_TYPES:{DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5},MAX_PAYLOAD_SIZE:Ue,PAYLOAD_SIZE:999e3,MAX_MLDATA_WAITING_TIME:3e3,CHUNKS_EXPIRATION_TIME:24e4,MAX_CHUNKS_SIZE:50,MAX_FLUSH_TIME:3e4},{metrics:[Te,we,be,Ie,Me,Ce,Ne,Oe,De,URL,Re,Ae,ke,_e,Le,xe,Fe,Pe]}]);const{objectOperator:We}=u;var je=We([d,{metricSupport:["css","img","link","script","other"]}]);var Ve=(e={},t=[])=>t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{});const{WEB_VITALS:$e,PAGE_RENDER:He,A11Y:Ge,AVAILABILITY:Ye,CDN_HEALTH:ze,SESSION_REPLAY:qe}=l,Xe=X,Ze=ee,Ke=ve,Je=se,Qe=he,et=Be,tt=d,{REQUEST_ID:nt}=h,{objectOperator:rt}=u,ot={[$e]:Xe,[He]:Ze,[Ge]:Ke,[Ye]:Je,[ze]:Qe,[qe]:et,commons:tt};var it={prepareConfiguration:e=>{const{platform:t,site:n,device:r,application:o,initiatives:i,scope:s,webview:a}=e,c=e[nt];if(!Array.isArray(i))return null;if(t&&n&&r&&o&&i){const e={platform:t,site:n,device:r,application:o,webview:a,initiatives:i.map((e=>rt({i:e,sent:!1})))};return c&&(e[nt]=c),s&&(e.scope=s),e}return null},getConfiguration:(e,t="commons",n=null)=>e in ot[t]?ot[t][e]:n},st={METRICS:"metrics",TAGS:"tags",DEVICE_INFO_METRICS:"deviceInfoMetrics",CONNECTION_INFO_METRICS:"connectionInfoMetrics",BROWSER_INFO_METRICS:"browserInfoMetrics"};const at=Ve,{WEB_VITALS:ct}=l,{getConfiguration:lt}=it,{FCP:ut,LCP:dt,CLS:ht,INP:pt}=h,{METRICS:mt}=st,ft=[ut,dt,ht];"undefined"!=typeof window&&"PerformanceEventTiming"in window&&"interactionId"in window.PerformanceEventTiming.prototype&&ft.push(pt);var gt=(e,t)=>{const n=lt(mt,ct),r=at(t,n);if(!Object.keys(r).length)throw new Error("Metrics not found");const o=Object.keys(r);if(!ft.every((e=>-1!==o.indexOf(e))))throw new Error("Metrics missing");return{name:ct,data:r}};const{RESOURCE_TIMING:yt}=l;var vt=(e,t)=>t&&t.resources&&t.resources.length?{name:yt,data:t}:null;const Et=Ve,{PAGE_RENDER:St}=l,{getConfiguration:Tt}=it,{METRICS:wt}=st;var bt=(e,t)=>{const n=Tt(wt,St),r=Et(t,n);if(!Object.keys(r).length)throw new Error("Metrics not found");return{name:St,data:r}};var It=(e,t)=>e.reduce(((e,t)=>e.replace(new RegExp(t.original,"g"),t.translated)),t);const Mt=Ve,Ct=It,{objectOperator:Nt}=u,{getConfiguration:Ot}=it,{TAGS:Dt,DEVICE_INFO_METRICS:Rt,CONNECTION_INFO_METRICS:At,BROWSER_INFO_METRICS:kt}=st,_t="commons",Lt=/^([a-zA-Z]+)-(iOS|Android|AndroidNoPS|SmartPOS)?(?:\/|%2F)((?:\d+\.){2}\d+)/,xt=[{original:"SmartPOS",translated:"Android"},{original:"AndroidNoPS",translated:"Android"}],Ft=(e,t=_t)=>({tags:Mt(e,Ot(Dt,t,[]))}),Pt=(e,t)=>{const n=Mt(t,["device","webview"]),r=n.webview&&"mobile"===n.device||!1,o=e["user-agent"]||"",i=Lt.exec(o),s=i?Ct(xt,i[2]).toLowerCase():null;if(n.webview&&!s)throw new Error("Unknown device native type");return`${r?"webview":"web"}/${r?s:n.device}`};var Ut={prepareTags:Ft,prepareEventTags:(e,t,n=_t)=>{const{tags:r}=Ft(t,n);return{tags:Nt({tags:r,device:Pt(e,t)})}},prepareDeviceInfo:(e,t=_t)=>({"device-info":Mt(e,Ot(Rt,t,[]))}),prepareClientInfo:()=>({"client-info":{name:"perfill-agent",version:"3.17.2"}}),prepareConnectionInfo:(e,t=_t)=>({"connection-info":Mt(e,Ot(At,t,[]))}),prepareBrowserInfo:(e,t=_t)=>({"browser-info":Mt(e,Ot(kt,t,[]))}),prepareDeviceType:Pt};const Bt=Ve,{A11Y:Wt}=l,{deviceInfoMetrics:jt,connectionInfoMetrics:Vt,browserInfoMetrics:$t}=ve,{prepareEventTags:Ht,prepareClientInfo:Gt}=Ut,{arrayOperator:Yt,objectOperator:zt}=u,{getConfiguration:qt}=it,{METRICS:Xt}=st;var Zt=(e,t)=>{const{name:n,version:r}=Gt()["client-info"],{tags:o}=Ht(t,e,Wt),i=qt(Xt,Wt),s=Bt(t,Yt([jt,Vt,$t,i]));if(!Object.keys(s).length)throw new Error("Metrics not found");const a=zt({metricsCollected:s,tags:o,client_name:n,client_version:r}),c=[];return Object.keys(a).forEach((e=>{if("window-dom"!==e)c.push([e.replace("-","_"),a[e]]);else{const e=new Blob([a["window-dom"]],{type:"text/html"});c.push(["file",e,"dom.html"])}})),{name:Wt,data:c}};const Kt=Ve,{getConfiguration:Jt}=it,{AVAILABILITY:Qt}=l,{AVAILABILITY_FAILURE:en,AVAILABILITY_TRANSFER_SIZE:tn,AVAILABILITY_BROWSER_ERRORS:nn}=h,{METRICS:rn}=st;var on=(e,t)=>{const n=Jt(rn,Qt),r=Kt(t,n);if(!Object.keys(r).length)throw new Error("Metrics not found");return{name:Qt,data:{[en]:r[en],[tn]:r[tn],[nn]:r[nn]}}};const sn=Ve,{objectOperator:an}=u,{getConfiguration:cn}=it,{CDN_HEALTH:ln}=l,{RESOURCE_SIZE:un,RESOURCE_FAILURE:dn,RESOURCE_SUCCESS:hn,X_CDN:pn,AVAILABILITY_FAILURE:mn}=h,{METRICS:fn}=st,gn=[pn];var yn=(e,t)=>{const n=cn(fn,ln),r=sn(t,n);if(!Object.keys(r).length)throw new Error("Metrics not found");const o=Object.keys(r);if(!gn.every((e=>-1!==o.indexOf(e))))throw new Error("Metrics missing");const i=(t[mn]||[]).length,s=r[un]-i;return{name:ln,data:an({collection:r,[dn]:i,[hn]:s})}};const vn=gt,En=vt,Sn=bt,Tn=Zt,wn=on,bn=yn,{WEB_VITALS:In,PAGE_RENDER:Mn,A11Y:Cn,AVAILABILITY:Nn,CDN_HEALTH:On,RESOURCE_TIMING:Dn}=l,{objectOperator:Rn}=u,{prepareEventTags:An,prepareDeviceInfo:kn,prepareConnectionInfo:_n,prepareClientInfo:Ln,prepareBrowserInfo:xn}=Ut,Fn={[In]:{builder:vn},[Dn]:{builder:En},[Mn]:{builder:Sn},[Cn]:{builder:Tn},[Nn]:{builder:wn},[On]:{builder:bn}},Pn=(e,t,n)=>{const{builder:r}=(e=>{if(e.id in Fn)return Fn[e.id];throw new Error("Initiative not found")})(e);return r(t,n)};var Un={preparePayload:(e,t,n)=>{const r=((e,t,n)=>{try{const r=Pn(e,t,n),o=An(n,t);return{"event-info":Rn({initiativePayload:r,tags:o})}}catch(e){return null}})(e,t,n);if(!r)return null;const o=Ln(),i=kn(n),s=_n(n),a=xn(n);return Rn({clientInfo:o,eventInfo:r,deviceInfo:i,connectionInfo:s,browserInfo:a})},prepareFormData:(e,t,n)=>{try{const{data:r}=Pn(e,t,n),o=new FormData;return r.forEach((e=>{const[t,n,r]=e;r?o.append(t,n,r):o.append(t,n)})),o}catch(e){return null}}};const Bn=(e,t,n=!0)=>{window.fetch(e,{method:"POST",body:t,headers:{"Content-Type":"application/json"},keepalive:n}).then((e=>e.text())).catch((e=>e))};var Wn={beaconWithFetchFallback:(e,t)=>{const n=JSON.stringify(t);window.navigator&&window.navigator.sendBeacon&&window.navigator.sendBeacon(e,n)||Bn(e,n)},sendWithFetch:Bn,sendFormDataWithFetch:(e,t,n=!0)=>{window.fetch(e,{method:"POST",body:t,keepalive:n}).then((e=>e.text())).catch((e=>e))},getWithFetch:(e,t={})=>window.fetch(e,t)};const jn=(e="")=>window.WMANS&&window.WMANS[e];var Vn={recordLog:(e,t={})=>{jn("recordLog")&&window.WMANS.recordLog(e,t)},recordCount:(e,t=1,n=null,r={})=>{jn("recordCount")&&window.WMANS.recordCount(e,t,n,r)},recordHistogram:(e,t=1,n=null,r={})=>{jn("recordHistogram")&&window.WMANS.recordHistogram(e,t,n,r)},recordSpan:(e,t=[],n={})=>{jn("recordSpan")&&window.WMANS.recordSpan(e,t,n)}};const{WEB_VITALS:$n,RESOURCE_TIMING:Hn,PAGE_RENDER:Gn,A11Y:Yn,AVAILABILITY:zn,CDN_HEALTH:qn}=l,{AVAILABILITY_BROWSER_ERRORS:Xn,AVAILABILITY_TRANSFER_SIZE:Zn,AVAILABILITY_FAILURE:Kn,X_CDN:Jn,DURATION_SUM:Qn,RESOURCE_SIZE:er,RESOURCE_FAILURE:tr,RESOURCE_SUCCESS:nr,HYDRATE_COMPLETE:rr,HYDRATE_DURATION:or}=h,ir=gt,sr=vt,ar=bt,cr=Zt,lr=on,ur=yn,{recordSpan:dr,recordHistogram:hr,recordCount:pr,recordLog:mr}=Vn,fr={[$n]:{builder:ir,sender:e=>{Object.keys(e).forEach((t=>{hr(`${$n}.${t}`,e[t])}))}},[Hn]:{builder:sr,sender:({resources:e})=>{(e||[]).forEach((e=>{dr(Hn,[],e)}))}},[Gn]:{builder:ar,sender:e=>{hr(`${Gn}.${rr}`,e[rr],"ms"),hr(`${Gn}.${or}`,e[or],"ms")}},[Yn]:{builder:cr,sender:()=>{}},[zn]:{builder:lr,sender:e=>{(e[Zn]||[]).forEach((e=>{dr(`${zn}.${Zn}`,[],e),pr(`${zn}.${Zn}.${e.initiator}`)})),(e[Kn]||[]).forEach((e=>{dr(`${zn}.${Kn}`,[],e),pr(`${zn}.${Kn}.${e.initiator}`)})),(e[Xn]||[]).forEach((e=>{mr(e.message,{filename:e.filename,initiator:e.initiator}),pr(`${zn}.${Xn}`)}))}},[qn]:{builder:ur,sender:e=>{hr(`${qn}.${e[Jn]}.${Qn}`,e[Qn],"ms"),hr(`${qn}.${e[Jn]}.${er}`,e[er],"ms"),e[tr]&&hr(`${qn}.${e[Jn]}.${tr}`,e[tr]),e[nr]&&hr(`${qn}.${e[Jn]}.${nr}`,e[nr])}}};var gr={sendWebMonitoring:(e,t,n)=>{const{builder:r,sender:o}=(e=>{if(e.id in fr)return fr[e.id];throw new Error("Initiative not found")})(e),{data:i}=r(t,n);o(i)}};const{endpoint:yr}=X,{endpoint:vr}=ee,{endpoint:Er}=se,{endpoint:Sr}=he,{endpoint:Tr}=ve,{endpoint:wr}=Be,{endpoint:br}=je,{preparePayload:Ir,prepareFormData:Mr}=Un,{beaconWithFetchFallback:Cr,sendFormDataWithFetch:Nr}=Wn,{WEB_VITALS:Or,PAGE_RENDER:Dr,A11Y:Rr,AVAILABILITY:Ar,CDN_HEALTH:kr,RESOURCE_TIMING:_r,SESSION_REPLAY:Lr}=l,{sendWebMonitoring:xr}=gr,{getConfiguration:Fr}=it,{METRICS:Pr}=st,Ur={},Br={[Or]:yr,[Dr]:vr,[Rr]:Tr,[Ar]:Er,[kr]:Sr,[_r]:br,[Lr]:wr},Wr=e=>void 0!==Ur[e],jr=e=>{Wr(e)&&delete Ur[e]};var Vr={trackMetric:(e,t)=>{Ur[e]=t},appendMetric:(e,t)=>{(Ur[e]=Ur[e]||[]).push(t)},getMetricsCollected:()=>Ur,sendMetrics:(e,t,n)=>{const r=Ir(e,t,n);return!!r&&(xr(e,t,n),Cr(Br[e.id],r),!0)},sendFormData:(e,t,n)=>{const r=Mr(e,t,n);return!!r&&(Nr(Br[e.id],r,!1),!0)},clearMetric:jr,checkMetric:Wr,getMetric:(e,t=null)=>Wr(e)?Ur[e]:t,clearAllMetrics:e=>{(Fr(Pr,e.id)||[]).forEach((e=>{jr(e)}))}};const{trackMetric:$r}=Vr,{supportsNavigatorApi:Hr}=i,{RAM_SIZE:Gr,CPU_CORES:Yr}=h;var zr=()=>{Hr()&&(window.navigator.deviceMemory&&$r(Gr,`${window.navigator.deviceMemory}`),window.navigator.hardwareConcurrency&&$r(Yr,`${window.navigator.hardwareConcurrency}`))};const{trackMetric:qr}=Vr,{supportsNavigatorApi:Xr}=i,{NETWORK_SPEED:Zr,NETWORK_TYPE:Kr,USER_AGENT:Jr}=h;var Qr=()=>{if(!Xr())return;const{navigator:e}=window;e.connection&&(e.connection.effectiveType&&qr(Kr,e.connection.effectiveType),e.connection.downlink&&qr(Zr,`${e.connection.downlink}`),"saveData"in e.connection&&qr("save-data",e.connection.saveData),e.connection.rtt&&qr("rtt",`${e.connection.rtt}`)),e.userAgent&&qr(Jr,e.userAgent)};var eo={toFixedNumber:(e,t=6)=>Number.isNaN(e)||!e||Number.isInteger(e)||"string"==typeof e?e:parseFloat(e.toFixed(t)),truncateDecimals:(e,t=2)=>Number.isNaN(e)||!e||"string"==typeof e||Number.isNaN(t)||"string"==typeof t?e:Math.trunc(e*10**t)/10**t,BIGQUERY_MAX_DECIMALS:6};let to=-1;var no={getBFCacheRestoreTime:()=>to,onBFCacheRestore:e=>{window.addEventListener("pageshow",(t=>{t.persisted&&(to=t.timeStamp,e(t))}),!0)}};const{trackMetric:ro}=Vr,{supportsPerformanceApi:oo}=i,{toFixedNumber:io}=eo,{getBFCacheRestoreTime:so}=no,{REDIRECT_COUNT:ao,DOM_COMPLETE:co,DOM_INTERACTIVE:lo,DOM_CONTENT_LOADED_END:uo,DOM_CONTENT_LOADED_START:ho,DOM_CONTENT_LOADED:po,ONLOAD_END:mo,ONLOAD_START:fo,ONLOAD:go,REQUEST_START:yo,RESPONSE_START:vo,RESPONSE_END:Eo,RESPONSE_TIME:So,NAVIGATION_TYPE:To}=h;var wo,bo,Io=()=>{if(!oo())return;const[e]=window.performance.getEntriesByType("navigation");if(e){const{domComplete:t,domContentLoadedEventEnd:n,domContentLoadedEventStart:r,domInteractive:o,loadEventEnd:i,loadEventStart:s,redirectCount:a,requestStart:c,responseStart:l,responseEnd:u,type:d,activationStart:h}=e;if(a&&ro(ao,a),t&&ro(co,io(t)),o&&ro(lo,io(o)),n&&ro(uo,io(n)),r&&ro(ho,io(r)),r&&n&&ro(po,io(n-r)),i&&ro(mo,io(i)),s&&ro(fo,io(s)),s&&i&&ro(go,io(i-s)),c&&ro(yo,io(c)),l&&ro(vo,io(l)),u&&ro(Eo,io(u)),l&&u&&ro(So,io(u-l)),d){let t=d;const n=e;so()>=0?t="back-forward-cache":n&&(document.prerendering||h>0?t="prerender":document.wasDiscarded?t="restore":n.type&&(t=n.type.replace(/_/g,"-"))),ro(To,t)}}},Mo={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4,reportOptions:{}},Co=globalThis,No=Co.console,Oo=Co.navigator,Do=Co.performance,Ro=function(){return Oo.deviceMemory},Ao=function(){return Oo.hardwareConcurrency},ko="mark.",_o=function(){return Do&&!!Do.getEntriesByType&&!!Do.now&&!!Do.mark},Lo="4g",xo=!1,Fo={},Po={value:0},Uo={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},Bo={value:0},Wo={value:0},jo={},Vo={isHidden:!1,didChange:!1},$o=function(){Vo.isHidden=!1,document.hidden&&(Vo.isHidden=document.hidden,Vo.didChange=!0)},Ho=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){No.warn("Perfume.js:",e)}return null},Go=function(){return!!(Ao()&&Ao()<=4)||!!(Ro()&&Ro()<=4)},Yo=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return Go()||t}},zo=function(e){return parseFloat(e.toFixed(4))},qo=function(e){return"number"!=typeof e?null:zo(e/Math.pow(1024,2))},Xo=function(e,t,n,r,o){var i,s=function(){Mo.analyticsTracker&&(Vo.isHidden&&!["CLS","INP"].includes(e)||Mo.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:Oo?{deviceMemory:Ro()||0,hardwareConcurrency:Ao()||0,serviceWorkerStatus:"serviceWorker"in Oo?Oo.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:Go(),isLowEndExperience:Yo(Lo,xo)}:{},rating:n,navigationType:o}))};["CLS","INP"].includes(e)?s():(i=s,"requestIdleCallback"in Co?Co.requestIdleCallback(i,{timeout:3e3}):i())},Zo=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime0&&(Bo.value+=t,Wo.value+=t)}}))};!function(e){e.instant="instant",e.quick="quick",e.moderate="moderate",e.slow="slow",e.unavoidable="unavoidable"}(wo||(wo={}));var Ko,Jo,Qo,ei,ti,ni=((bo={})[wo.instant]={vitalsThresholds:[100,200],maxOutlierThreshold:1e4},bo[wo.quick]={vitalsThresholds:[200,500],maxOutlierThreshold:1e4},bo[wo.moderate]={vitalsThresholds:[500,1e3],maxOutlierThreshold:1e4},bo[wo.slow]={vitalsThresholds:[1e3,2e3],maxOutlierThreshold:1e4},bo[wo.unavoidable]={vitalsThresholds:[2e3,5e3],maxOutlierThreshold:2e4},bo),ri={RT:[100,200],TBT:[200,600],NTBT:[200,600]},oi=function(e,t){return ri[e]?t<=ri[e][0]?"good":t<=ri[e][1]?"needsImprovement":"poor":null},ii=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=zo(t[e]))})),Xo(e,t,null,n||{})},si=function(e){var t=e.attribution,n=e.name,r=e.rating,o=e.value,i=e.navigationType;"FCP"===n&&(Po.value=o),["FCP","LCP"].includes(n)&&!jo[0]&&(jo[0]=Ho("longtask",Zo)),"FID"===n&&setTimeout((function(){Vo.didChange||(si({attribution:t,name:"TBT",rating:oi("TBT",Bo.value),value:Bo.value,navigationType:i}),ii("dataConsumption",Uo.value))}),1e4);var s=zo(o);s<=Mo.maxTime&&s>=0&&Xo(n,s,r,t,i)},ai=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},ci=function(e){if("loading"===document.readyState)return"loading";var t=ai();if(t){if(e(t||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;e=r.parentNode}}catch(e){}return n},di=-1,hi=function(){return di},pi=function(e){addEventListener("pageshow",(function(t){t.persisted&&(di=t.timeStamp,e(t))}),!0)},mi=function(){var e=ai();return e&&e.activationStart||0},fi=function(e,t){var n=ai(),r="navigate";return hi()>=0?r="back-forward-cache":n&&(document.prerendering||mi()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},gi=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},yi=function(e,t,n,r){var o,i;return function(s){t.value>=0&&(s||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},vi=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ei=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},Si=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},Ti=-1,wi=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},bi=function(e){"hidden"===document.visibilityState&&Ti>-1&&(Ti="visibilitychange"===e.type?e.timeStamp:0,Mi())},Ii=function(){addEventListener("visibilitychange",bi,!0),addEventListener("prerenderingchange",bi,!0)},Mi=function(){removeEventListener("visibilitychange",bi,!0),removeEventListener("prerenderingchange",bi,!0)},Ci=function(){return Ti<0&&(Ti=wi(),Ii(),pi((function(){setTimeout((function(){Ti=wi(),Ii()}),0)}))),{get firstHiddenTime(){return Ti}}},Ni=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Oi=[1800,3e3],Di=function(e,t){t=t||{},Ni((function(){var n,r=Ci(),o=fi("FCP"),i=gi("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime=0&&Jo1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){_i(e,t),o()},r=function(){o()},o=function(){removeEventListener("pointerup",n,Ai),removeEventListener("pointercancel",r,Ai)};addEventListener("pointerup",n,Ai),addEventListener("pointercancel",r,Ai)}(t,e):_i(t,e)}},Fi=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,xi,Ai)}))},Pi=[100,300],Ui=0,Bi=1/0,Wi=0,ji=function(e){e.forEach((function(e){e.interactionId&&(Bi=Math.min(Bi,e.interactionId),Wi=Math.max(Wi,e.interactionId),Ui=Wi?(Wi-Bi)/7+1:0)}))},Vi=function(){return ti?Ui:performance.interactionCount||0},$i=[200,500],Hi=0,Gi=function(){return Vi()-Hi},Yi=[],zi={},qi=function(e){var t=Yi[Yi.length-1],n=zi[e.interactionId];if(n||Yi.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};zi[r.id]=r,Yi.push(r)}Yi.sort((function(e,t){return t.latency-e.latency})),Yi.splice(10).forEach((function(e){delete zi[e.id]}))}},Xi=function(e,t){!function(e,t){t=t||{},Ni((function(){var n;"interactionCount"in performance||ti||(ti=gi("event",ji,{type:"event",buffered:!0,durationThreshold:0}));var r,o=fi("INP"),i=function(e){e.forEach((function(e){e.interactionId&&qi(e),"first-input"===e.entryType&&!Yi.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&qi(e)}));var t,n=(t=Math.min(Yi.length-1,Math.floor(Gi()/50)),Yi[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())},s=gi("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=yi(e,o,$i,t.reportAllChanges),s&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),Ei((function(){i(s.takeRecords()),o.value<0&&Gi()>0&&(o.value=0,o.entries=[]),r(!0)})),pi((function(){Yi=[],Hi=Vi(),o=fi("INP"),r=yi(e,o,$i,t.reportAllChanges)})))}))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0],n=e.entries.find((function(e){return e.target}));e.attribution={eventTarget:ui(n&&n.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:ci(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},Zi=[2500,4e3],Ki={},Ji=[800,1800],Qi=function e(t){document.prerendering?Ni((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},es=function(e,t){t=t||{};var n=fi("TTFB"),r=yi(e,n,Ji,t.reportAllChanges);Qi((function(){var o=ai();if(o){var i=o.responseStart;if(i<=0||i>performance.now())return;n.value=Math.max(i-mi(),0),n.entries=[o],r(!0),pi((function(){n=fi("TTFB",0),(r=yi(e,n,Ji,t.reportAllChanges))(!0)}))}}))},ts=function(e){e.forEach((function(e){e.identifier&&si({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},ns=function(e){e.forEach((function(e){if(Mo.isResourceTiming&&ii("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;Uo.value[e.initiatorType]+=t,Uo.value.total+=t}}))},rs=function(){!function(e,t){es((function(e){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),o=Math.max(t.connectStart-n,0),i=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:o-r,connectionTime:i-o,requestTime:e.value-i,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(e),function(e){e.value>0&&si(e)}(e)}),t)}(0,Mo.reportOptions.ttfb),function(e,t){!function(e,t){t=t||{},Di(Si((function(){var n,r=fi("CLS",0),o=0,i=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},a=gi("layout-shift",s);a&&(n=yi(e,r,Ri,t.reportAllChanges),Ei((function(){s(a.takeRecords()),n(!0)})),pi((function(){o=0,r=fi("CLS",0),n=yi(e,r,Ri,t.reportAllChanges),vi((function(){return n()}))})),setTimeout(n,0))})))}((function(e){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:ui(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:ci(t.startTime)})}}var r;e.attribution={}}(e),function(e){si(e)}(e)}),t)}(0,Mo.reportOptions.cls),function(e,t){Di((function(e){!function(e){if(e.entries.length){var t=ai(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,o=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:ci(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ci(hi())}}(e),function(e){si(e)}(e)}),t)}(0,Mo.reportOptions.fcp),function(e,t){!function(e,t){t=t||{},Ni((function(){var n,r=Ci(),o=fi("FID"),i=function(e){e.startTime0;if(Do.getEntriesByName(ko+n).length>0&&o&&Mo.steps&&Mo.steps[e]){var i=ni[Mo.steps[e].threshold],s=i.maxOutlierThreshold,a=i.vitalsThresholds,c=Do.measure(r,ko+t,ko+n);if(c){var l=c.duration;if(l<=s){var u=function(e,t){return e<=t[0]?"good":e<=t[1]?"needsImprovement":"poor"}(l,a);l>=0&&(Xo("userJourneyStep",l,u,{stepName:e},void 0),Do.measure("step.".concat(e,"_vitals_").concat(u),{start:c.startTime+c.duration,end:c.startTime+c.duration,detail:{type:"stepVital",duration:l}}))}}}},us=function(){var e=as(),t=is.startMarkToStepsMap,n=Object.keys(e).length;if(0===n)return{};var r={},o=n-1,i=cs(o);if(Object.keys(i).forEach((function(e){var n,o=null!==(n=t[e])&&void 0!==n?n:[];Object.keys(o).forEach((function(e){r[e]=!0}))})),n>1){var s=cs(o-1);Object.keys(s).forEach((function(e){var n,o=null!==(n=t[e])&&void 0!==n?n:[];Object.keys(o).forEach((function(e){r[e]=!0}))}))}return r},ds=function(e){var t,n,r,o,i,s;if(is.finalMarkToStepsMap[e]){!function(e){var t=is.navigationSteps,n=is.finalMarkToStepsMap,r=Object.keys(t).length;if(0!==r){var o=r-1,i=cs(o);if(i&&n[e]){var s=n[e];s&&Object.keys(s).forEach((function(e){if(i[e]){var n=cs(o)||{};n[e]=!1,t[o]=n}if(r>1){var s=o-1,a=cs(s);a[e]&&(a[e]=!1,t[s]=a)}}))}}}(e);var a=is.finalMarkToStepsMap[e];Object.keys(a).forEach((function(t){var n=a[t];n.forEach(ss),Promise.all(n.map((function(n){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function(){return function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?o:1)-1)||[])[n]=!0,r[i]=s,function(e){var t,n=null!==(t=is.startMarkToStepsMap[e])&&void 0!==t?t:[];Object.keys(n).forEach((function(e){is.active[e]||(is.active[e]=!0)}))}(e);var c=us();null===(t=Mo.onMarkStep)||void 0===t||t.call(Mo,e,Object.keys(c))},hs=function(e){_o()&&!Fo[e]&&(Fo[e]=!0,Do.mark("mark_".concat(e,"_start")))},ps=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),_o()&&Fo[e]){Do.mark("mark_".concat(e,"_end")),delete Fo[e];var r=function(e){Do.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=Do.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&ii(e,zo(r),t)}},ms=0,fs=Object.freeze({__proto__:null,get IThresholdTier(){return wo},clear:function(e){delete Fo[e],Do.clearMarks&&(Do.clearMarks("mark_".concat(e,"_start")),Do.clearMarks("mark_".concat(e,"_end")))},end:ps,initPerfume:function(e){if(void 0===e&&(e={}),Mo.analyticsTracker=e.analyticsTracker,Mo.isResourceTiming=!!e.resourceTiming,Mo.isElementTiming=!!e.elementTiming,Mo.maxTime=e.maxMeasureTime||Mo.maxTime,Mo.reportOptions=e.reportOptions||Mo.reportOptions,Mo.steps=e.steps,Mo.onMarkStep=e.onMarkStep,_o()){"PerformanceObserver"in Co&&rs(),void 0!==document.hidden&&document.addEventListener("visibilitychange",$o);var t=function(){if(!_o())return{};var e=Do.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();ii("navigationTiming",t),t.redirectTime&&si({attribution:{},name:"RT",rating:oi("RT",t.redirectTime),value:t.redirectTime}),ii("networkInformation",function(){if("connection"in Oo){var e=Oo.connection;return"object"!=typeof e?{}:(Lo=e.effectiveType,xo=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),Oo&&Oo.storage&&"function"==typeof Oo.storage.estimate&&Oo.storage.estimate().then(os),Mo.steps&&Mo.steps&&(is.startMarkToStepsMap={},is.finalMarkToStepsMap={},is.active={},is.navigationSteps={},Object.entries(Mo.steps).forEach((function(e){var t,n,r=e[0],o=e[1].marks,i=o[0],s=o[1],a=null!==(n=is.startMarkToStepsMap[i])&&void 0!==n?n:{};if(a[r]=!0,is.startMarkToStepsMap[i]=a,is.finalMarkToStepsMap[s]){var c=is.finalMarkToStepsMap[s][i]||[];c.push(r),is.finalMarkToStepsMap[s][i]=c}else is.finalMarkToStepsMap[s]=((t={})[i]=[r],t)})))}},markNTBT:function(){hs("ntbt"),Wo.value=0,clearTimeout(ms),ms=setTimeout((function(){ps("ntbt",{},!1),si({attribution:{},name:"NTBT",rating:oi("NTBT",Wo.value),value:Wo.value}),Wo.value=0}),2e3)},markStep:function(e){_o()&&(Do.mark(ko+e),ds(e))},markStepOnce:function(e){0===Do.getEntriesByName(ko+e).length&&(Do.mark(ko+e),ds(e))},start:hs,trackUJNavigation:function(){var e,t=Object.keys(is.navigationSteps).length;is.navigationSteps[t]={};var n=us();null===(e=Mo.onMarkStep)||void 0===e||e.call(Mo,"",Object.keys(n))}}),gs=t(fs);const{initPerfume:ys}=gs,{trackMetric:vs,sendMetrics:Es,getMetricsCollected:Ss}=Vr,{LCP:Ts,CLS:ws,FID:bs,INP:Is,WORKER_TIME:Ms,TOTAL_TIME:Cs,TTFB:Ns,HEADER_SIZE:Os,FETCH_TIME:Ds,DOWNLOAD_TIME:Rs,DNS_LOOKUP_TIME:As,DEBUG_TARGET_LCP:ks,DEBUG_TARGET_CLS:_s,DEBUG_TARGET_FID:Ls,DEBUG_TARGET_INP:xs,NAVIGATION_TIMING:Fs}=h,{onBFCacheRestore:Ps}=no;const{trackMetric:Us}=Vr,{supportsEnvironment:Bs,supportsMatchMediaApi:Ws}=i,{D2ID:js,DARK_MODE:Vs,REDUCED_MOTION:$s,REDUCED_COLOR:Hs,URL:Gs}=h,Ys=/(?:_d2id=)([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})/;var zs=()=>{const e=function(e){if(!e)return null;const t=e.match(Ys);return t?t[1]:t}("undefined"!=typeof document&&document.cookie);if(e&&Us(js,`${e}`),Bs()&&Us(Gs,`${window.location.origin}${window.location.pathname}`),Ws()){Us(Vs,window.matchMedia("(prefers-color-scheme: dark)").matches);const e=!0===window.matchMedia("(prefers-reduced-motion: reduce)").matches||!0===window.matchMedia("(prefers-reduced-motion: reduce)").matches;Us($s,e);const t=!0===window.matchMedia("(prefers-contrast: custom), (prefers-contrast: less), (prefers-contrast: more)").matches||!0===window.matchMedia("(forced-colors: active)").matches;Us(Hs,t)}};const{trackMetric:qs}=Vr,{supportsPreloadState:Xs,supportsWeakSet:Zs}=i,{INITIAL_CONTENT_SIZE:Ks}=h;var Js=()=>{try{if(Xs()&&Zs()){const e=JSON.stringify(window.__PRELOADED_STATE__,(()=>{const e=new WeakSet;return(t,n)=>{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n)}return n}})());qs(Ks,e.length)}}catch(e){}};var Qs={getCookie:(e,t=null)=>{const n=document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));return n?n[2]:t},setCookie:(e,t,n={})=>{document.cookie=`${e}=${t}; ${Object.keys(n).map((e=>`${e}=${n[e]}`)).join("; ")}`}};var ea=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));const{trackMetric:ta}=Vr,{SESSION_ID:na,MLDATA_SESSION_ID:ra}=h,{getCookie:oa,setCookie:ia}=Qs,sa=ea;var aa=()=>{const e=oa(ra);if(!e){const e=sa();return ia(ra,e,{"max-age":18e5}),void ta(na,e)}ta(na,e)};const{WEB_VITALS:ca}=l,{trackMetric:la,sendMetrics:ua,getMetricsCollected:da}=Vr,{subscribe:ha}=c,pa=window.requestIdleCallback||(e=>setTimeout(e,200)),ma="webVitalsEvent";let fa=!1;const ga=(e,t)=>{e.forEach((e=>{la(e.metric,e.value)})),(e=>{const t=()=>{"hidden"===window.document.visibilityState&&(ua({id:ca},e,da()),window.document.removeEventListener(ma,t),fa=!1)};fa||(window.document.addEventListener(ma,t),fa=!0),window.document.addEventListener("visibilitychange",(()=>{const e=new window.Event(ma);window.document.dispatchEvent(e)}))})(t)};var ya=e=>{ha(ca,(t=>{t&&pa((()=>ga(t,e)))}))};const va=zr,Ea=Qr,Sa=Io,Ta=(e,t)=>{let n=!1;return Ps((()=>{n=!1})),ys({analyticsTracker:r=>{if(n)return;const{attribution:o,metricName:i,data:s}=r,a="string"==typeof i?i.toLowerCase():i;a===Ts&&o&&vs(ks,o.element),a===ws&&o&&vs(_s,o.largestShiftTarget),a===bs&&o&&vs(Ls,o.eventTarget),a===Is&&o&&vs(xs,o.eventTarget),a===Fs&&s&&"object"==typeof s&&(vs(As,s.dnsLookupTime),vs(Rs,s.downloadTime),vs(Ds,s.fetchTime),vs(Os,s.headerSize),vs(Ns,s.timeToFirstByte),vs(Cs,s.totalTime),vs(Ms,s.workerTime)),vs(a,s),n=Es(t,e,Ss())}})},wa=zs,ba=Js,Ia=aa,Ma=ya,{prepareConfiguration:Ca}=it,{supportsPerformanceApi:Na,supportsBeaconOrFetch:Oa}=i,{onBFCacheRestore:Da}=no,{clearAllMetrics:Ra}=Vr,Aa=()=>{va(),Ea(),wa(),Sa(),ba(),Ia(),Ma()};var ka={start:(e,t)=>{const n=Ca(e);if(n){Da((()=>{Ra(t),Aa()}));try{Na()&&Oa()&&(Ta(n,t),Aa())}catch(e){}}}};const{initPerfume:_a}=gs,{RESOURCE_TIMING:La}=h,{metricSupport:xa}=je,{appendMetric:Fa}=Vr,{truncateDecimals:Pa}=eo;const{RESOURCE_TIMING:Ua}=l,{RESOURCE_TIMING:Ba}=h,{sendMetrics:Wa,getMetricsCollected:ja}=Vr,Va=window.requestIdleCallback||(e=>setTimeout(e,200)),$a="resourceTimingEvent";let Ha=!1;const Ga=e=>{(e=>{const t=async()=>{if("hidden"===window.document.visibilityState){const n=ja()[Ba];Wa({id:Ua},e,{resources:n}),window.document.removeEventListener($a,t),Ha=!1}};Ha||(window.document.addEventListener($a,t),Ha=!0),window.document.addEventListener("visibilitychange",(()=>{const e=new window.Event($a);window.document.dispatchEvent(e)}))})(e)};var Ya=e=>{Va((()=>Ga(e)))};const za=()=>_a({resourceTiming:!0,analyticsTracker:({metricName:e,data:t})=>{if(e===La&&xa.includes(t.initiatorType)){const e=JSON.parse(JSON.stringify(t));Object.keys(e).forEach((t=>{"number"==typeof e[t]&&(e[t]=Pa(e[t]))})),Fa(La,e)}}}),qa=Ya,Xa=aa,{prepareConfiguration:Za}=it,{supportsPerformanceApi:Ka,supportsBeaconOrFetch:Ja}=i;var Qa={start:e=>{const t=Za(e);if(t)try{Ka()&&Ja()&&(za(),qa(t),Xa())}catch(e){}}};var ec={commands:{SET_COOKIE:"set-cookie"},endpoint:"https://events.mercadolibre.com/v2/client-cookies"};const{CLIENT_COOKIES:tc}=l,{commands:nc,endpoint:rc}=ec,{subscribe:oc}=c,{beaconWithFetchFallback:ic}=Wn,{objectOperator:sc}=u,{prepareClientInfo:ac,prepareTags:cc}=Ut;let lc=[];const uc=e=>{if(1!==e.length||!e[0])throw new Error;return e[0]},dc={path:uc,domain:uc,expires:uc,samesite:uc,"max-age":e=>{const t=parseInt(uc(e),10);if(Number.isNaN(t))throw new Error;return t},secure:e=>{if(e.length)throw new Error;return!0}},hc=(e,t)=>{e["unknown-metadata"]=`${e["unknown-metadata"]?`${e["unknown-metadata"]};`:""}${t}`},pc=window.requestIdleCallback||(e=>setTimeout(e,200));let mc=!1;const fc={[nc.SET_COOKIE]:(e,t,n)=>{const r=((e,t=null)=>{if(!e)return null;const n=e.split(";").reduce(((t,n,r)=>{const o=n.trim();if(!o)return t;const i=o.split("=").map((e=>e.trim())),s=i[0];if(!r)return s&&2===i.length&&(t.name=s,t["cookie-length"]=e.length,t["cookie-value-length"]=i[1].length),t;const a=s.toLowerCase(),c=dc[a];if(c)try{t[a]=c(i.slice(1))}catch(e){hc(t,n)}else hc(t,n);return t}),{name:null,path:null,domain:null,"max-age":null,expires:null,samesite:null,secure:null,"unknown-metadata":null,"user-preferences":t,"cookie-length":0,"cookie-value-length":0});return n.name?n:null})(e,n);r&&(lc.push(r),(e=>{const t=()=>{if("hidden"===window.document.visibilityState){const n=ac(),r=cc(e);ic(rc,sc({clientInfo:n,tags:r,cookies:lc})),lc=[],window.document.removeEventListener("visibilitychange",t),mc=!1}};mc||(window.document.addEventListener("visibilitychange",t),mc=!0)})(t))}};var gc=e=>{oc(tc,(t=>{t&&fc[t.type]&&pc((()=>fc[t.type](t.data,e,t.userPreferences)))}))};const yc=gc,{supportsBeaconOrFetch:vc}=i;var Ec={start:e=>{try{vc()&&yc(e)}catch(e){}}};const{PAGE_RENDER:Sc}=l,{trackMetric:Tc,sendMetrics:wc,getMetricsCollected:bc}=Vr,{subscribe:Ic}=c,Mc=window.requestIdleCallback||(e=>setTimeout(e,200)),Cc="pageRenderEvent";let Nc=!1;const Oc=(e,t)=>{e.forEach((e=>{Tc(e.metric,e.value)})),(e=>{const t=()=>{"hidden"===window.document.visibilityState&&(wc({id:Sc},e,bc()),window.document.removeEventListener(Cc,t),Nc=!1)};Nc||(window.document.addEventListener(Cc,t),Nc=!0),window.document.addEventListener("visibilitychange",(()=>{const e=new window.Event(Cc);window.document.dispatchEvent(e)}))})(t)};var Dc=e=>{Ic(Sc,(t=>{t&&Mc((()=>Oc(t,e)))}))};const Rc=Dc,Ac=zr,kc=Qr,_c=zs,Lc=aa,{prepareConfiguration:xc}=it,{supportsBeaconOrFetch:Fc}=i;var Pc={start:e=>{const t=xc(e);if(t)try{Fc()&&(Ac(),kc(),Rc(t),_c(),Lc())}catch(e){}}};const{arrayOperator:Uc}=u,Bc=It,Wc=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],jc={STYLE:!0,IFRAME:!0,SCRIPT:!0,svg:!0,path:!0},Vc={"data-hj-suppress":!0,"data-hj-suppressed":!0,"data-hj-masked":!0,"data-pii-mask":!0,"nav-header-username":!0},$c={address:!0,address1:!0,address2:!0,addressline1:!0,addressline2:!0,cell:!0,cellphone:!0,dateofbirth:!0,dob:!0,email:!0,familyname:!0,firstname:!0,fullname:!0,lastname:!0,firstName:!0,fullName:!0,lastName:!0,phone:!0,postalcode:!0,postcode:!0,surname:!0,tel:!0,telephone:!0,username:!0,zip:!0,zipcode:!0,nationalinsurancenumber:!0,nin:!0,ppsn:!0,security:!0,securitynum:!0,socialsec:!0,socialsecuritynumber:!0,socsec:!0,ssn:!0,authpw:!0,contrasena:!0,contrasenya:!0,pass:!0,passord:!0,password:!0,passwort:!0,pw:!0,pwd:!0,pword:!0,pwrd:!0,sapwd:!0,senha:!0,userpw:!0,userpwd:!0,cc:!0,cccsc:!0,cccvc:!0,cccvv:!0,ccexp:!0,ccexpiry:!0,ccexpmonth:!0,ccexpyear:!0,ccname:!0,ccnum:!0,ccnumber:!0,cctype:!0,creditcard:!0,csc:!0,cvc:!0,cvv:!0,exp:!0,accountnum:!0,accountnumber:!0,bic:!0,iban:!0,ibanaccountnum:!0,ibanaccountnumber:!0,pin:!0,pinnum:!0,secq:!0,secret:!0,secretq:!0,secretquestion:!0,securityq:!0,securityquestion:!0,sortcode:!0,swift:!0,buyerEmail:!0,nickname:!0,buyerFullName:!0,buyerPhone:!0,buyerId:!0,sellerId:!0,first_name:!0,last_name:!0,secure_email:!0,issuerName:!0,expirationMonth:!0,expirationYear:!0,lastFourDigits:!0},Hc={A:["href"],INPUT:["value","placeholder"],TEXTAREA:["value","placeholder"],OPTION:["label","value"],PROGRESS:["value"],OPTGROUP:["label"],IMG:["alt"],DIV:["title"],DEFAULT:["textContent"]},Gc=/[.*+?^${}()|[\]\\]/g,Yc=e=>e.replace(Gc,"\\$&"),zc=e=>{const t=[];for(let n=0;n(e=>Uc([e.classList||[]]).some((e=>Vc[e])))(e)||(e=>[e.name,e.id].map((e=>e?e.replace(qc,"").toLowerCase():e)).some((e=>$c[e])))(e)||(e=>Zc.test(e))(t)||(e=>Xc.test(e))(t)||(e=>e.indexOf("@")>-1&&Kc.test(e))(t)||(e=>Jc.test(e)||Qc.test(e))(t),tl=e=>{const t=[];return Uc([e]).forEach((e=>{if(jc[e.tagName])return;if((e.children||[]).length>0)return;const n=Uc([Hc.DEFAULT,Hc[e.tagName]||[]]).reduce(((t,n)=>{const r=e[n],o=el(e,r);return r&&o&&t.push(r),t}),[]);n.length&&t.push({el:e.outerHTML,attrs:n})})),t},nl=new RegExp(/[a-zA-Z0-9äÄëËïÏöÖüÜáéíóúáéíóúÁÉÍÓÚÂÊÎÔÛâêîôûàèìòùÀÈÌÒÙ.]/,"i"),rl=e=>{const t=[{original:".*<\\/iframe>",translated:""},{original:".*<\\/noscript>",translated:""},{original:'"(addresses)":+\\s*[[][\\s\\S]*?[]],*',translated:""},{original:'"(phone|address|address|alternative_phone|identification)":+\\s*[{][\\s\\S]*?[}],*',translated:""},{original:"(user)+\\s*:\\s*[{]+[\\s\\S]*?[}]+?",translated:"$1: {}"},{original:"[a-z0-9.+-]+@+[a-z0-9.+-]+",translated:"***@***.***"},{original:`"(${Object.keys($c).join("|")})"+\\s*:\\s*"+[a-z0-9.+-\\s]+"+?`,translated:'"$1":"abc123"'},{original:`"(${Object.keys($c).join("|")})"+\\s*:\\s*[^"][0-9]+`,translated:'"$1":123987546'}];return e.reduce(((e,t)=>{const n=t.el;return t.attrs.forEach((e=>{t.el=t.el.replace(e,(e=>e.startsWith("http")?"#":e.split(" ").map((e=>nl.test(e)?zc(e.length):e)).join(" "))(e))})),e.push({original:Yc(n),translated:Yc(t.el)}),e}),t)};var ol={anonymizeDOM:e=>{const t=tl(((e="*")=>document.body.querySelectorAll(e))()),n=rl(t);return Bc(n,e)},generateRandomText:zc,shouldSuppressData:el,extractMessages:tl,generateTranslations:rl};const{A11Y:il}=l,{WINDOW_DOM:sl}=h,{trackMetric:al,sendFormData:cl,getMetricsCollected:ll}=Vr,{anonymizeDOM:ul}=ol,dl=window.requestIdleCallback||(e=>setTimeout(e,200));let hl=!1;const pl=e=>{hl||(hl=cl({id:il},e,ll()))},ml=e=>{try{(()=>{const{document:e}=window;if(!e||!e.documentElement||!e.documentElement.outerHTML)throw new Error("DOM not found");const t=ul(e.documentElement.outerHTML);al(sl,t)})(),pl(e)}catch(e){}};var fl=e=>{dl((()=>ml(e)))};const{trackMetric:gl}=Vr,{WINDOW_HEIGHT:yl,WINDOW_WIDTH:vl}=h;const El=fl,Sl=zr,Tl=Qr,wl=zs,bl=()=>{const{innerWidth:e,innerHeight:t}=window;e&&gl(vl,`${e}`),t&&gl(yl,`${t}`)},Il=aa,{prepareConfiguration:Ml}=it,{supportsFetchApi:Cl}=i;var Nl={start:e=>{const t=Ml(e);if(t)try{Cl()&&(Sl(),Tl(),bl(),El(t),wl(),Il())}catch(e){}}};const{AVAILABILITY:Ol}=l,{AVAILABILITY_FAILURE:Dl,AVAILABILITY_TRANSFER_SIZE:Rl,AVAILABILITY_BROWSER_ERRORS:Al}=h,{appendMetric:kl,sendMetrics:_l,getMetricsCollected:Ll}=Vr,{subscribe:xl}=c,Fl=window.requestIdleCallback||(e=>setTimeout(e,200)),Pl="availabilityEvent";let Ul=!1;const Bl=e=>{(e=>{const t=()=>{"hidden"===window.document.visibilityState&&(_l({id:Ol},e,Ll()),window.document.removeEventListener(Pl,t),Ul=!1)};Ul||(window.document.addEventListener(Pl,t),Ul=!0),window.document.addEventListener("visibilitychange",(()=>{const e=new window.Event(Pl);window.document.dispatchEvent(e)}))})(e)};var Wl=e=>{xl(Dl,(e=>{e&&kl(Dl,e)})),xl(Rl,(e=>{e&&kl(Rl,e)})),xl(Al,(e=>{e&&kl(Al,e)})),Fl((()=>Bl(e)))};const{AVAILABILITY_FAILURE:jl}=h,{queue:Vl}=c;var $l=()=>{const{_pfl:e}=window;(e||[]).forEach((e=>{const[t,n]=e;Vl(jl,{filename:n,initiator:t,value:1})}))};const{appendMetric:Hl}=Vr,{supportsPerformanceApi:Gl}=i,{AVAILABILITY_TRANSFER_SIZE:Yl}=h,{thresholdEntries:zl,fileSupport:ql}=se,Xl=e=>e.substring(e.lastIndexOf(".")+1,e.length),Zl=e=>{const t=Xl(e);return Object.keys(ql).find((e=>ql[e].some((e=>e===t))))},Kl=e=>{const{type:t,value:n,name:r}=e;n>(zl[t]||0)&&Hl(Yl,{filename:r,initiator:t,value:n})};var Jl=()=>{const e=(()=>{if(!Gl())return[];const{performance:e}=window,t=Object.keys(ql).reduce(((e,t)=>e.concat(ql[t])),[]);return e.getEntries().filter((e=>t.some((t=>t===Xl(e.name))))).filter(((e,t,n)=>n.findIndex((t=>t.name===e.name))===t)).map((e=>{const t=e.encodedBodySize&&e.encodedBodySize>0?e.encodedBodySize:e.transferSize;return{name:e.name,type:Zl(e.name),value:t}}))})();e.forEach(Kl)};const Ql=Wl,eu=zr,tu=Qr,{prepareConfiguration:nu}=it,ru=zs,ou=$l,iu=Jl,su=aa,{supportsBeaconOrFetch:au}=i;var cu={start:e=>{const t=nu(e);if(t)try{au()&&(eu(),tu(),Ql(t),ou(),iu(),ru(),su())}catch(e){}}};const{CDN_HEALTH:lu}=l,{AVAILABILITY_FAILURE:uu}=h,{appendMetric:du,sendMetrics:hu,getMetricsCollected:pu}=Vr,{subscribe:mu}=c,fu=window.requestIdleCallback||(e=>setTimeout(e,200)),gu="cdnHealthEvent";let yu=!1;const vu=e=>{(e=>{const t=()=>{"hidden"===window.document.visibilityState&&(hu({id:lu},e,pu()),window.document.removeEventListener(gu,t),yu=!1)};yu||(window.document.addEventListener(gu,t),yu=!0),window.document.addEventListener("visibilitychange",(()=>{const e=new window.Event(gu);window.document.dispatchEvent(e)}))})(e)};var Eu=e=>{mu(uu,(e=>{e&&du(uu,e)})),fu((()=>vu(e)))};const{trackMetric:Su}=Vr,{supportsFetchApi:Tu}=i,{getWithFetch:wu}=Wn,{X_CDN:bu}=h,Iu={g:"google",a:"akamai"};var Mu=()=>Tu()?wu("https://http2.mlstatic.com/cdn/ping.gif").then((e=>{if(e.headers.has("x-cdn")){const t=e.headers.get("x-cdn");Su(bu,Iu[t])}})).catch((e=>e)):null;const{trackMetric:Cu}=Vr,{supportsPerformanceApi:Nu}=i,{toFixedNumber:Ou}=eo,{DURATION_SUM:Du,RESOURCE_SIZE:Ru}=h;var Au=()=>{if(!Nu())return;const e=window.performance.getEntriesByType("resource").filter((e=>new RegExp("http2.mlstatic.com").test(e.name))),t=e.reduce(((e,t)=>e+=t.duration),0);Cu(Du,Ou(t)),Cu(Ru,e.length)};const ku=Eu,_u=Mu,Lu=zr,xu=Qr,{prepareConfiguration:Fu}=it,Pu=zs,Uu=$l,Bu=Au,Wu=aa,{supportsBeaconOrFetch:ju}=i;var Vu={start:e=>{const t=Fu(e);if(t)try{ju()&&(_u(),Uu(),ku(t),Bu(),Lu(),xu(),Pu(),Wu())}catch(e){}}};const{objectOperator:$u}=u,{AVAILABILITY:Hu,CDN_HEALTH:Gu}=l,{start:Yu}=Vu,{start:zu}=cu;var qu={start:e=>{Yu($u({args:e,id:Gu})),zu($u({args:e,id:Hu}))}};const Xu=(e,t,n)=>{let r=[];for(const o in e)e.hasOwnProperty(o)&&(o===t&&e[o]===n?r.push(e):"object"==typeof e[o]&&(r=r.concat(Xu(e[o],t,n))));return r};var Zu=Xu;const{getCookie:Ku}=Qs,Ju=Zu;var Qu={getUserId:(e=null)=>{const t=window.melidata_namespace&&window.melidata_namespace.actual_track&&window.melidata_namespace.actual_track.user&&window.melidata_namespace.actual_track.user.user_id,n=Ku("orguseridp",t);return n&&!Number.isNaN(parseInt(n,10))?parseInt(n,10):e},getPath:()=>{const e=window.melidata_namespace&&window.melidata_namespace.actual_track&&window.melidata_namespace.actual_track.path?window.melidata_namespace.actual_track.path:null;if(e)return e;let t=null;try{t=(e=>{if(!e)return null;const t=Ju(e,"provider","melidata"),n=Ju(t,"type","view").pop();return n?n.path:null})(window.__PRELOADED_STATE__.floxResponse)}catch(e){}const n=window.location.pathname||null;return t||n}};const{trackMetric:ed}=Vr,{APP_NAME:td,SCOPE_NAME:nd,DEVICE:rd,PLATFORM_ID:od,SITE_ID:id,WEBVIEW:sd,REQUEST_ID:ad,VIEW_NAME:cd,USER_ID:ld}=h,ud=Ve,{getUserId:dd,getPath:hd}=Qu;var pd,md=e=>{const t=ud(e,[td,nd,rd,od,id,sd,ad]),n=hd();n&&ed(cd,n);const r=dd();r&&ed(ld,parseInt(r,10)),Object.keys(t).forEach((e=>{t[e]&&ed(e,t[e])}))};function fd(e){return e.nodeType===e.ELEMENT_NODE}function gd(e){const t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function yd(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function vd(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,Ed).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function Ed(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=vd(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(pd||(pd={}));let Sd=class{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Td(){return new Sd}function wd({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let s=o||"";const a=r&&bd(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=i?i(s,e):"*".repeat(s.length)),s}function bd(e){return e.toLowerCase()}const Id="__rrweb_original__";function Md(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?bd(t):null}function Cd(e,t){var n;let r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}const o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}let Nd=1;const Od=new RegExp("[^a-z0-9-_:]"),Dd=-2;function Rd(){return Nd++}let Ad,kd;const _d=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ld=/^(?:[a-z+]+:)?\/\//i,xd=/^www\..*/i,Fd=/^(data:)([^,]*),(.*)/i;function Pd(e,t){return(e||"").replace(_d,((e,n,r,o,i,s)=>{const a=r||i||s,c=n||o||"";if(!a)return e;if(Ld.test(a)||xd.test(a))return`url(${c}${a}${c})`;if(Fd.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`}))}const Ud=/^[^ \t\n\r\u000c]+/,Bd=/^[, \t\n\r\u000c]+/;function Wd(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function jd(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Vd(){const e=document.createElement("a");return e.href="",e.href}function $d(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?Wd(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(Bd),!(n>=t.length);){let i=r(Ud);if(","===i.slice(-1))i=Wd(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=Wd(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?Pd(r,Vd()):"object"===t&&"data"===n?Wd(e,r):r:Wd(e,r):r}function Hd(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Gd(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Gd(e.parentNode,t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&Gd(e.parentNode,t,n)}function Yd(e,t,n,r){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(Gd(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function zd(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,dataURLOptions:d={},inlineImages:h,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:f=!1}=t,g=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:pd.Document,childNodes:[],compatMode:e.compatMode}:{type:pd.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:pd.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:g};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:c={},inlineImages:l,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:h=!1,rootId:p}=t,m=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),f=function(e){if(e instanceof HTMLFormElement)return"form";const t=bd(e.tagName);return Od.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;tt.href===e.href));let r=null;t&&(r=vd(t)),r&&(delete g.rel,delete g.href,g._cssText=Pd(r,t.href))}if("style"===f&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=vd(e.sheet);t&&(g._cssText=Pd(t,Vd()))}if("input"===f||"textarea"===f||"select"===f){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=wd({element:e,type:Md(e),tagName:f,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}"option"===f&&(e.selected&&!s.select?g.selected=!0:delete g.selected);if("canvas"===f&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n0!==e)))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),n=document.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(c.type,c.quality)&&(g.rr_dataURL=t)}if("img"===f&&l){Ad||(Ad=n.createElement("canvas"),kd=Ad.getContext("2d"));const t=e,r=t.crossOrigin;t.crossOrigin="anonymous";const o=()=>{t.removeEventListener("load",o);try{Ad.width=t.naturalWidth,Ad.height=t.naturalHeight,kd.drawImage(t,0,0),g.rr_dataURL=Ad.toDataURL(c.type,c.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}r?g.crossOrigin=r:t.removeAttribute("crossorigin")};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}"audio"!==f&&"video"!==f||(g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime);h||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==f||d(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(f)&&(v=!0)}catch(e){}return{type:pd.Element,tagName:f,attributes:g,childNodes:[],isSVG:jd(e)||void 0,needBlock:m,rootId:p,isCustom:v}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:h,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:f,rootId:g});case e.TEXT_NODE:return function(e,t){var n;const{needsMask:r,maskTextFn:o,rootId:i}=t,s=e.parentNode&&e.parentNode.tagName;let a=e.textContent;const c="STYLE"===s||void 0,l="SCRIPT"===s||void 0;if(c&&a){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(a=vd(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}a=Pd(a,Vd())}l&&(a="SCRIPT_PLACEHOLDER");!c&&!l&&a&&r&&(a=o?o(a,e.parentElement):a.replace(/[\S]/g,"*"));return{type:pd.Text,textContent:a||"",isStyle:c,rootId:i}}(e,{needsMask:s,maskTextFn:l,rootId:g});case e.CDATA_SECTION_NODE:return{type:pd.CDATA,textContent:"",rootId:g};case e.COMMENT_NODE:return{type:pd.Comment,textContent:e.textContent||"",rootId:g};default:return!1}}function qd(e){return null==e?"":e.toLowerCase()}function Xd(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m={},inlineImages:f=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:w=()=>!1,newlyAddedElement:b=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:M=!0}=t;if(!I&&e.childNodes){I=Yd(e,s,a,void 0===I)}const C=zd(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:b});if(!C)return console.warn(e,"not serialized"),null;let N;N=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===pd.Comment)return!0;if(e.type===pd.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Cd(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(qd(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===qd(e.attributes.name)||"icon"===qd(e.attributes.rel)||"apple-touch-icon"===qd(e.attributes.rel)||"shortcut icon"===qd(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&qd(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(qd(e.attributes.property).match(/^(og|twitter|fb):/)||qd(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===qd(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===qd(e.attributes.name)||"googlebot"===qd(e.attributes.name)||"bingbot"===qd(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===qd(e.attributes.name)||"generator"===qd(e.attributes.name)||"framework"===qd(e.attributes.name)||"publisher"===qd(e.attributes.name)||"progid"===qd(e.attributes.name)||qd(e.attributes.property).match(/^article:/)||qd(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===qd(e.attributes.name)||"yandex-verification"===qd(e.attributes.name)||"csrf-token"===qd(e.attributes.name)||"p:domain_verify"===qd(e.attributes.name)||"verify-v1"===qd(e.attributes.name)||"verification"===qd(e.attributes.name)||"shopify-checkout-api-token"===qd(e.attributes.name)))return!0}}return!1}(C,p)&&(M||C.type!==pd.Text||C.isStyle||C.textContent.replace(/^\s+|\s+$/gm,"").length)?Rd():Dd;const O=Object.assign(C,{id:N});if(r.add(e,O),N===Dd)return null;y&&y(e);let D=!c;if(O.type===pd.Element){D=D&&!O.needBlock,delete O.needBlock;const t=e.shadowRoot;t&&yd(t)&&(O.isShadowHost=!0)}if((O.type===pd.Document||O.type===pd.Element)&&D){p.headWhitespace&&O.type===pd.Element&&"head"===O.tagName&&(M=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E,onStylesheetLoad:S,stylesheetLoadTimeout:T,keepIframeSrcFn:w};if(O.type===pd.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(const n of Array.from(e.childNodes)){const e=Xd(n,t);e&&O.childNodes.push(e)}if(fd(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=Xd(n,t);r&&(yd(e.shadowRoot)&&(r.isShadow=!0),O.childNodes.push(r))}}return e.parentNode&&gd(e.parentNode)&&yd(e.parentNode)&&(O.isShadow=!0),O.type===pd.Element&&"iframe"===O.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout((()=>{i||(t(),i=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),i=!0,t()}))}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&v){const n=Xd(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E,onStylesheetLoad:S,stylesheetLoadTimeout:T,keepIframeSrcFn:w});n&&v(e,n)}}),E),O.type===pd.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===Cd(O.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=setTimeout((()=>{o||(t(),o=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(i),o=!0,t()}))}(e,(()=>{if(S){const t=Xd(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:I,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:E,onStylesheetLoad:S,stylesheetLoadTimeout:T,keepIframeSrcFn:w});t&&S(e,t)}}),T),O}const Zd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Kd(e,t={}){let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function i(){const e={line:n,column:r};return t=>(t.position=new s(e),p(),t)}class s{constructor(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}s.prototype.content=e;const a=[];function c(o){const i=new Error(`${t.source||""}:${n}:${r}: ${o}`);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;a.push(i)}function l(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){let t;const n=[];for(p(),m(n);e.length&&"}"!==e.charAt(0)&&(t=I()||M());)t&&(n.push(t),m(n));return n}function h(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function p(){h(/^\s*/)}function m(e=[]){let t;for(;t=f();)t&&e.push(t),t=f();return e}function f(){const t=i();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return c("End of comment missing");const s=e.slice(2,n-2);return r+=2,o(s),e=e.slice(n),r+=2,t({type:"comment",comment:s})}function g(){const e=h(/^([^{]+)/);if(e)return Jd(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(e=>e.replace(/,/g,"‌"))).split(/\s*(?![^(]*\)),\s*/).map((e=>e.replace(/\u200C/g,",")))}function y(){const e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;const n=Jd(t[0]);if(!h(/^:\s*/))return c("property missing ':'");const r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(Zd,""),value:r?Jd(r[0]).replace(Zd,""):""});return h(/^[;\s]*/),o}function v(){const e=[];if(!l())return c("missing '{'");let t;for(m(e);t=y();)!1!==t&&(e.push(t),m(e)),t=y();return u()?e:c("missing '}'")}function E(){let e;const t=[],n=i();for(;e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}const S=b("import"),T=b("charset"),w=b("namespace");function b(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>{const n=i(),r=h(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function I(){if("@"===e[0])return function(){const e=i();let t=h(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=h(/^([-\w]+)\s*/),!t)return c("@keyframes missing name");const r=t[1];if(!l())return c("@keyframes missing '{'");let o,s=m();for(;o=E();)s.push(o),s=s.concat(m());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:s}):c("@keyframes missing '}'")}()||function(){const e=i(),t=h(/^@media *([^{]+)/);if(!t)return;const n=Jd(t[1]);if(!l())return c("@media missing '{'");const r=m().concat(d());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}()||function(){const e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Jd(t[1]),media:Jd(t[2])})}()||function(){const e=i(),t=h(/^@supports *([^{]+)/);if(!t)return;const n=Jd(t[1]);if(!l())return c("@supports missing '{'");const r=m().concat(d());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}()||S()||T()||w()||function(){const e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Jd(t[1]),r=Jd(t[2]);if(!l())return c("@document missing '{'");const o=m().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):c("@document missing '}'")}()||function(){const e=i();if(!h(/^@page */))return;const t=g()||[];if(!l())return c("@page missing '{'");let n,r=m();for(;n=y();)r.push(n),r=r.concat(m());return u()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}()||function(){const e=i();if(!h(/^@host\s*/))return;if(!l())return c("@host missing '{'");const t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}()||function(){const e=i();if(!h(/^@font-face\s*/))return;if(!l())return c("@font-face missing '{'");let t,n=m();for(;t=y();)n.push(t),n=n.concat(m());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}()}function M(){const e=i(),t=g();return t?(m(),e({type:"rule",selectors:t,declarations:v()})):c("selector missing")}return Qd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())}function Jd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Qd(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t of Object.keys(e)){const n=e[t];Array.isArray(n)?n.forEach((e=>{Qd(e,r)})):n&&"object"==typeof n&&Qd(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}const eh={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function th(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const nh=/(max|min)-device-(width|height)/,rh=new RegExp(nh.source,"g"),oh=/([^\\]):hover/,ih=new RegExp(oh.source,"g");function sh(e,t){const n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;const r=Kd(e,{silent:!0});if(!r.stylesheet)return e;const o=[],i=[];!function e(t){"selectors"in t&&t.selectors&&t.selectors.forEach((e=>{oh.test(e)&&o.push(e)})),"media"in t&&t.media&&nh.test(t.media)&&i.push(t.media),"rules"in t&&t.rules&&t.rules.forEach(e)}(r.stylesheet);let s=e;if(o.length>0){const e=new RegExp(o.filter(((e,t)=>o.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>th(e))).join("|"),"g");s=s.replace(e,(e=>{const t=e.replace(ih,"$1.\\:hover");return`${e}, ${t}`}))}if(i.length>0){const e=new RegExp(i.filter(((e,t)=>i.indexOf(e)===t)).sort(((e,t)=>t.length-e.length)).map((e=>th(e))).join("|"),"g");s=s.replace(e,(e=>e.replace(rh,"$1-$2")))}return null==t||t.stylesWithHoverClass.set(e,s),s}function ah(){return{stylesWithHoverClass:new Map}}function ch(e,t){var n;const{doc:r,hackCss:o,cache:i}=t;switch(e.type){case pd.Document:return r.implementation.createDocument(null,"",null);case pd.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case pd.Element:{const t=function(e){let t=eh[e.tagName]?eh[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);let s;e.isSVG?s=r.createElementNS("http://www.w3.org/2000/svg",t):(e.isCustom&&(null===(n=r.defaultView)||void 0===n?void 0:n.customElements)&&!r.defaultView.customElements.get(e.tagName)&&r.defaultView.customElements.define(e.tagName,class extends r.defaultView.HTMLElement{}),s=r.createElement(t));const a={};for(const n in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,n))continue;let c=e.attributes[n];if("option"===t&&"selected"===n&&!1===c)continue;if(null===c)continue;if(!0===c&&(c=""),n.startsWith("rr_")){a[n]=c;continue}const l="textarea"===t&&"value"===n,u="style"===t&&"_cssText"===n;if(u&&o&&"string"==typeof c&&(c=sh(c,i)),!l&&!u||"string"!=typeof c)try{if(e.isSVG&&"xlink:href"===n)s.setAttributeNS("http://www.w3.org/1999/xlink",n,c.toString());else if("onload"===n||"onclick"===n||"onmouse"===n.substring(0,7))s.setAttribute("_"+n,c.toString());else{if("meta"===t&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===n){s.setAttribute("csp-content",c.toString());continue}("link"!==t||"preload"!==e.attributes.rel&&"modulepreload"!==e.attributes.rel||"script"!==e.attributes.as)&&("link"===t&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===t&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(n,c.toString())))}}catch(e){}else s.appendChild(r.createTextNode(c)),e.childNodes=[]}for(const n in a){const r=a[n];if("canvas"===t&&"rr_dataURL"===n){const e=document.createElement("img");e.onload=()=>{const t=s.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=r.toString(),s.RRNodeType&&(s.rr_dataURL=r.toString())}else if("img"===t&&"rr_dataURL"===n){const t=s;t.currentSrc.startsWith("data:")||(t.setAttribute("rrweb-original-src",e.attributes.src),t.src=r.toString())}if("rr_width"===n)s.style.width=r.toString();else if("rr_height"===n)s.style.height=r.toString();else if("rr_mediaCurrentTime"===n&&"number"==typeof r)s.currentTime=r;else if("rr_mediaState"===n)switch(r){case"played":s.play().catch((e=>console.warn("media playback error",e)));break;case"paused":s.pause()}}if(e.isShadowHost)if(s.shadowRoot)for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);else s.attachShadow({mode:"open"});return s}case pd.Text:return r.createTextNode(e.isStyle&&o?sh(e.textContent,i):e.textContent);case pd.CDATA:return r.createCDATASection(e.textContent);case pd.Comment:return r.createComment(e.textContent);default:return null}}function lh(e,t){const{doc:n,mirror:r,skipChild:o=!1,hackCss:i=!0,afterAppend:s,cache:a}=t;if(r.has(e.id)){const t=r.getNode(e.id);if(function(e,t){return!(!e||!t||e.type!==t.type)&&(e.type===pd.Document?e.compatMode===t.compatMode:e.type===pd.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===pd.Comment||e.type===pd.Text||e.type===pd.CDATA?e.textContent===t.textContent:e.type===pd.Element&&e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock)}(r.getMeta(t),e))return r.getNode(e.id)}let c=ch(e,{doc:n,hackCss:i,cache:a});if(!c)return null;if(e.rootId&&r.getNode(e.rootId)!==n&&r.replace(e.rootId,n),e.type===pd.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==pd.DocumentType&&(e.childNodes[0].type===pd.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write(''):n.write('')),c=n),r.add(c,e),(e.type===pd.Document||e.type===pd.Element)&&!o)for(const t of e.childNodes){const o=lh(t,{doc:n,mirror:r,skipChild:!1,hackCss:i,afterAppend:s,cache:a});if(o){if(t.isShadow&&fd(c)&&c.shadowRoot)c.shadowRoot.appendChild(o);else if(e.type===pd.Document&&t.type==pd.Element){const e=o;let t=null;e.childNodes.forEach((e=>{"BODY"===e.nodeName&&(t=e)})),t?(e.removeChild(t),c.appendChild(o),e.appendChild(t)):c.appendChild(o)}else c.appendChild(o);s&&s(o,t.id)}else console.warn("Failed to rebuild",t)}return c}function uh(e,t){const{doc:n,onVisit:r,hackCss:o=!0,afterAppend:i,cache:s,mirror:a=new Sd}=t,c=lh(e,{doc:n,mirror:a,skipChild:!1,hackCss:o,afterAppend:i,cache:s});return function(e,t){for(const r of e.getIds())e.has(r)&&(n=e.getNode(r),t(n));var n}(a,(e=>{r&&r(e),function(e,t){const n=t.getMeta(e);if((null==n?void 0:n.type)!==pd.Element)return;const r=e;for(const e in n.attributes){if(!Object.prototype.hasOwnProperty.call(n.attributes,e)||!e.startsWith("rr_"))continue;const t=n.attributes[e];"rr_scrollLeft"===e&&(r.scrollLeft=t),"rr_scrollTop"===e&&(r.scrollTop=t)}}(e,a)})),c}function dh(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const hh="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ph={map:{},getId:()=>(console.error(hh),-1),getNode:()=>(console.error(hh),null),removeNodeFromMap(){console.error(hh)},has:()=>(console.error(hh),!1),reset(){console.error(hh)}};function mh(e,t,n={}){let r=null,o=0;return function(...i){const s=Date.now();o||!1!==n.leading||(o=s);const a=t-(s-o),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=s,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout((()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)}),a))}}function fh(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),i&&i.set&&i.set.call(this,e)}}),()=>fh(e,t,i||{},!0)}function gh(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ph=new Proxy(ph,{get:(e,t,n)=>("map"===t&&console.error(hh),Reflect.get(e,t,n))}));let yh=Date.now;function vh(e){var t,n,r,o,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==a?void 0:a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(i=null===(o=null==a?void 0:a.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(s=null==a?void 0:a.body)||void 0===s?void 0:s.scrollTop)||0}}function Eh(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Sh(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Th(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}function wh(e,t,n,r){if(!e)return!1;const o=Th(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(Gd(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function bh(e,t){return-1!==t.getId(e)}function Ih(e,t){return t.getId(e)===Dd}function Mh(e,t){if(gd(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Mh(e.parentNode,t))}function Ch(e){return Boolean(e.changedTouches)}function Nh(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}function Oh(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const o of e){const{nextId:e,parentId:i}=o;if(e&&e in t){const i=t[e];if(i.parent){const e=i.parent.children.indexOf(i);i.parent.children.splice(e,0,n(o,i.parent))}else{const e=r.indexOf(i);r.splice(e,0,n(o,null))}}else if(i in t){const e=t[i];e.children.push(n(o,e))}else r.push(n(o,null))}return r}function Dh(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Dh(e.children[n],t)}function Rh(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ah(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function kh(e,t){var n,r;const o=null===(r=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),s=kh(o,t),a=i.height/o.clientHeight;return{x:i.x*s.relativeScale+s.x,y:i.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function _h(e){return Boolean(null==e?void 0:e.shadowRoot)}function Lh(e,t){const n=e[t[0]];return 1===t.length?n:Lh(n.cssRules[t[1]].cssRules,t.slice(2))}function xh(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Fh(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}/[1-9][0-9]{12}/.test(Date.now().toString())||(yh=()=>(new Date).getTime());class Ph{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Uh(e){var t,n;let r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function Bh(e){let t,n=e;for(;t=Uh(n);)n=t;return n}function Wh(e){const t=e.ownerDocument;if(!t)return!1;const n=Bh(e);return t.contains(n)}function jh(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Wh(e))}var Vh=Object.freeze({__proto__:null,StyleSheetMirror:Ph,get _mirror(){return ph},closestElementOfNode:Th,getBaseDimension:kh,getNestedRule:Lh,getPositionsAndIndex:xh,getRootShadowHost:Bh,getShadowHost:Uh,getWindowHeight:Eh,getWindowScroll:vh,getWindowWidth:Sh,hasShadowRoot:_h,hookSetter:fh,inDom:jh,isAncestorRemoved:Mh,isBlocked:wh,isIgnored:Ih,isSerialized:bh,isSerializedIframe:Rh,isSerializedStylesheet:Ah,iterateResolveTree:Dh,legacy_isTouchEvent:Ch,get nowTimestamp(){return yh},on:dh,patch:gh,polyfill:Nh,queueToResolveTrees:Oh,shadowHostInDom:Wh,throttle:mh,uniqueTextMutations:Fh}),$h=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))($h||{}),Hh=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Hh||{}),Gh=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Gh||{}),Yh=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Yh||{}),zh=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(zh||{}),qh=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(qh||{});function Xh(e){return"__ln"in e}class Zh{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n`${e}@${t}`;class Jh{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Zh,r=e=>{let t=e,n=Dd;for(;n===Dd;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{if(!o.parentNode||!jh(o)||"TEXTAREA"===o.parentNode.tagName)return;const i=gd(o.parentNode)?this.mirror.getId(Uh(o)):this.mirror.getId(o.parentNode),s=r(o);if(-1===i||-1===s)return n.addNode(o);const a=Xd(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Rh(e,this.mirror)&&this.iframeManager.addIframe(e),Ah(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),_h(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});a&&(e.push({parentId:i,nextId:s,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)ep(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)np(this.droppedSet,e)||ep(this.removes,e,this.mirror)?np(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const s={texts:this.texts.map((e=>{const t=e.node;return"TEXTAREA"===t.parentNode.tagName&&this.genTextAreaValueMutation(t.parentNode),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.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(s))},this.genTextAreaValueMutation=e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")},this.processMutation=e=>{if(!Ih(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;wh(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Yd(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Th(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=Md(t);r=wd({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(wh(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Hd(t.tagName,n)&&(o.attributes[n]=$d(this.doc,bd(t.tagName),bd(n),r),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?r:[r,i]:o._unchangedStyles[e]=[r,i]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(wh(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=gd(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);wh(e.target,this.blockClass,this.blockSelector,!1)||Ih(t,this.mirror)||!bh(t,this.mirror)||(this.addedSet.has(t)?(Qh(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Mh(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Kh(n,r)]?Qh(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!gd(e.target)||!yd(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ih(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Kh(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wh(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),_h(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Qh(e,t){e.delete(t),t.childNodes.forEach((t=>Qh(e,t)))}function ep(e,t,n){return 0!==e.length&&tp(e,t,n)}function tp(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some((e=>e.id===o))||tp(e,r,n)}function np(e,t){return 0!==e.size&&rp(e,t)}function rp(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||rp(e,n))}let op;function ip(e){op=e}function sp(){op=void 0}const ap=e=>{if(!op)return e;return(...t)=>{try{return e(...t)}catch(e){if(op&&!0===op(e))return;throw e}}},cp=[];function lp(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function up(e,t){var n,r;const o=new Jh;cp.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const s=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");s&&window[s]&&(i=window[s]);const a=new i(ap(o.processMutations.bind(o)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function dp({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let c=null;return Object.keys(Gh).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e])).forEach((i=>{let s=bd(i);const l=(t=>i=>{const s=lp(i);if(wh(s,r,o,!0))return;let a=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=Yh.Mouse;break;case"touch":a=Yh.Touch;break;case"pen":a=Yh.Pen}a===Yh.Touch?Gh[t]===Gh.MouseDown?l="TouchStart":Gh[t]===Gh.MouseUp&&(l="TouchEnd"):Yh.Pen}else Ch(i)&&(a=Yh.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===Yh.Touch||l.startsWith("Mouse")&&a===Yh.Mouse)&&(a=null)):Gh[t]===Gh.Click&&(a=c,c=null);const u=Ch(i)?i.changedTouches[0]:i;if(!u)return;const d=n.getId(s),{clientX:h,clientY:p}=u;ap(e)(Object.assign({type:Gh[l],id:d,x:h,y:p},null!==a&&{pointerType:a}))})(i);if(window.PointerEvent)switch(Gh[i]){case Gh.MouseDown:case Gh.MouseUp:s=s.replace("mouse","pointer");break;case Gh.TouchStart:case Gh.TouchEnd:return}a.push(dh(s,l,t))})),ap((()=>{a.forEach((e=>e()))}))}function hp({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return dh("scroll",ap(mh(ap((i=>{const s=lp(i);if(!s||wh(s,r,o,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=vh(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})})),i.scroll||100)),t)}const pp=["INPUT","TEXTAREA","SELECT"],mp=new WeakMap;function fp(e){return function(e,t){if(Ep("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ep("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ep("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ep("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function gp(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function yp({mirror:e,stylesheetManager:t},n){var r,o,i;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(i=null===(o=n.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===i?void 0:i.ShadowRoot,c=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return r}}),ap((()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function vp(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}(e,t),e.recordDOM&&(r=up(e,e.doc));const o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=mh(ap((t=>{const n=Date.now()-s;e(a.map((e=>(e.timeOffset-=n,e))),t),a=[],s=null})),i),l=ap(mh(ap((e=>{const t=lp(e),{clientX:n,clientY:o}=Ch(e)?e.changedTouches[0]:e;s||(s=yh()),a.push({x:n,y:o,id:r.getId(t),timeOffset:yh()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Hh.Drag:e instanceof MouseEvent?Hh.MouseMove:Hh.TouchMove)})),o,{trailing:!1})),u=[dh("mousemove",l,n),dh("touchmove",l,n),dh("drag",l,n)];return ap((()=>{u.forEach((e=>e()))}))}(e),i=dp(e),s=hp(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return dh("resize",ap(mh(ap((()=>{const t=Eh(),o=Sh();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)})),200)),t)}(e,{win:n}),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=lp(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=n.parentElement),!n||!d||pp.indexOf(d)<0||wh(n,r,o,!0))return;if(n.classList.contains(i)||s&&n.matches(s))return;let p=n.value,m=!1;const f=Md(n)||"";"radio"===f||"checkbox"===f?m=n.checked:(a[d.toLowerCase()]||a[f])&&(p=wd({element:n,maskInputOptions:a,tagName:d,type:f,value:p,maskInputFn:c})),h(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});const g=n.name;"radio"===f&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach((e=>{if(e!==n){const t=e.value;h(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}}))}function h(t,r){const o=mp.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){mp.set(t,r);const o=n.getId(t);ap(e)(Object.assign(Object.assign({},r),{id:o}))}}const p=("last"===l.input?["change"]:["input","change"]).map((e=>dh(e,ap(d),t))),m=t.defaultView;if(!m)return()=>{p.forEach((e=>e()))};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),g=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...g.map((e=>fh(e[0],e[1],{set(){ap(d)({target:this,isTrusted:!1})}},!1,m)))),ap((()=>{p.forEach((e=>e()))}))}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const s=ap((i=>mh(ap((o=>{const s=lp(o);if(!s||wh(s,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:u}=s;e({type:i,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u})})),o.media||500))),a=[dh("play",s(0),i),dh("pause",s(1),i),dh("seeked",s(2),i),dh("volumechange",s(3),i),dh("ratechange",s(4),i)];return ap((()=>{a.forEach((e=>e()))}))}(e);let u=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:ap(((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=gp(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:a}]}),r.apply(o,i)}))});const i=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ap(((r,o,i)=>{const[s]=i,{id:a,styleId:c}=gp(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),r.apply(o,i)}))}),r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:ap(((r,o,i)=>{const[s]=i,{id:a,styleId:c}=gp(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),r.apply(o,i)}))})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:ap(((r,o,i)=>{const[s]=i,{id:a,styleId:c}=gp(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),r.apply(o,i)}))}));const c={};Sp("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Sp("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Sp("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Sp("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach((([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:ap(((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=gp(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:[...fp(o),a||0]}]}),r.apply(o,i)}))}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:ap(((r,o,i)=>{const[s]=i,{id:a,styleId:c}=gp(o.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...fp(o),s]}]}),r.apply(o,i)}))})})),ap((()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}))}(e,{win:n}),d=yp(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:ap(((o,s,a)=>{var c;const[l,u,d]=a;if(n.has(l))return i.apply(s,[l,u,d]);const{id:h,styleId:p}=gp(null===(c=s.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:l,value:u,priority:d},index:fp(s.parentRule)}),o.apply(s,a)}))});const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:ap(((o,i,a)=>{var c;const[l]=a;if(n.has(l))return s.apply(i,[l]);const{id:u,styleId:d}=gp(null===(c=i.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:fp(i.parentRule)}),o.apply(i,a)}))}),ap((()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s}))}(e,{win:n}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=gh(t.fonts,"add",(function(t){return function(n){return setTimeout(ap((()=>{const t=o.get(n);t&&(e(t),o.delete(n))})),0),t.apply(this,[n])}}));return r.push((()=>{n.FontFace=i})),r.push(s),ap((()=>{r.forEach((e=>e()))}))}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=ap((()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return ap((()=>{cp.forEach((e=>e.reset())),null==r||r.disconnect(),o(),i(),s(),a(),c(),l(),u(),d(),h(),p(),m(),f(),g.forEach((e=>e()))}))}function Ep(e){return void 0!==window[e]}function Sp(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Tp{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class wp{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Tp(Rd),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tp(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case $h.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:$h.IncrementalSnapshot,data:{source:Hh.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $h.Meta:case $h.Load:case $h.DomContentLoaded:return!1;case $h.Plugin:return t;case $h.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case $h.IncrementalSnapshot:switch(t.data.source){case Hh.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Hh.Drag:case Hh.TouchMove:case Hh.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Hh.ViewportResize:return!1;case Hh.MediaInteraction:case Hh.MouseInteraction:case Hh.Scroll:case Hh.CanvasMutation:case Hh.Input:return this.replaceIds(t.data,e,["id"]),t;case Hh.StyleSheetRule:case Hh.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Hh.Font:return t;case Hh.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Hh.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===pd.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class bp{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!yd(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=up(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(hp(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(yp({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(gh(e.prototype,"attachShadow",(function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&jh(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function Ip(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}for(var Mp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cp="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Np=0;Np<64;Np++)Cp[Mp.charCodeAt(Np)]=Np;var Op=function(e){var t,n,r,o,i,s=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var l=new ArrayBuffer(s),u=new Uint8Array(l);for(t=0;t>4,u[c++]=(15&r)<<4|o>>2,u[c++]=(3&o)<<6|63&i;return l};const Dp=new Map;const Rp=(e,t,n)=>{if(!e||!_p(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Dp.get(e);return n||(n=new Map,Dp.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function Ap(e,t,n){if(e instanceof Array)return e.map((e=>Ap(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t>2],o+=Mp[(3&n[t])<<4|n[t+1]>>4],o+=Mp[(15&n[t+1])<<2|n[t+2]>>6],o+=Mp[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ap(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ap(e.data,t,n),e.width,e.height]}}if(_p(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Rp(e,t,n)}}return e}const kp=(e,t,n)=>e.map((e=>Ap(e,t,n))),_p=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Lp(e,t,n,r){const o=[];try{const i=gh(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...i){if(!wh(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}}));o.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function xp(e,t,n,r,o,i,s){const a=[],c=Object.getOwnPropertyNames(e);for(const i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const c=gh(e,i,(function(e){return function(...a){const c=e.apply(this,a);if(Rp(c,s,this),"tagName"in this.canvas&&!wh(this.canvas,r,o,!0)){const e=kp(a,s,this),r={type:t,property:i,args:e};n(this.canvas,r)}return c}}));a.push(c)}catch(r){const o=fh(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});a.push(o)}return a}var Fp,Pp,Up,Bp=(Fp=function(){!function(){ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ function e(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),r=0;r<64;r++)n[t.charCodeAt(r)]=r;var o=function(e){var n,r=new Uint8Array(e),o=r.length,i="";for(n=0;n>2],i+=t[(3&r[n])<<4|r[n+1]>>4],i+=t[(15&r[n+1])<<2|r[n+2]>>6],i+=t[63&r[n+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i};const i=new Map,s=new Map,a=self;a.onmessage=function(t){return e(this,void 0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return a.postMessage({id:t.data.id});{const{id:n,bitmap:r,width:c,height:l,dataURLOptions:u}=t.data,d=function(t,n,r){return e(this,void 0,void 0,(function*(){const e=`${t}-${n}`;if("OffscreenCanvas"in globalThis){if(s.has(e))return s.get(e);const i=new OffscreenCanvas(t,n);i.getContext("2d");const a=yield i.convertToBlob(r),c=yield a.arrayBuffer(),l=o(c);return s.set(e,l),l}return""}))}(c,l,u),h=new OffscreenCanvas(c,l);h.getContext("2d").drawImage(r,0,0),r.close();const p=yield h.convertToBlob(u),m=p.type,f=yield p.arrayBuffer(),g=o(f);if(!i.has(n)&&(yield d)===g)return i.set(n,g),a.postMessage({id:n});if(i.get(n)===g)return a.postMessage({id:n});a.postMessage({id:n,type:m,base64:g,width:c,height:l}),i.set(n,g)}}))}}()},Pp=null,function(e){return Up=Up||function(e,t){var n=function(e,t){var n=void 0===t?null:t,r=e.toString().split("\n");r.pop(),r.shift();for(var o=r[0].search(/\S/),i=/(['"])__worker_loader_strict__(['"])/g,s=0,a=r.length;s{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:s})}initCanvasFPSObserver(e,t,n,r,o){const i=Lp(t,n,r,!0),s=new Map,a=new Bp;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:zh["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const d=e=>{u&&e-u{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{wh(t,n,r,!0)||e.push(t)})),e})().forEach((e=>Ip(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(s.get(n))return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Lp(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=gh(t.CanvasRenderingContext2D.prototype,s,(function(o){return function(...i){return wh(this.canvas,n,r,!0)||setTimeout((()=>{const n=kp(i,t,this);e(this.canvas,{type:zh["2D"],property:s,args:n})}),0),o.apply(this,i)}}));o.push(i)}catch(n){const r=fh(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:zh["2D"],property:s,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return o.push(...xp(t.WebGLRenderingContext.prototype,zh.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...xp(t.WebGL2RenderingContext.prototype,zh.WebGL2,e,n,r,0,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o({rule:Ed(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Vp{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function $p(e){return Object.assign(Object.assign({},e),{timestamp:yh()})}let Hp,Gp,Yp,zp=!1;const qp=Td();function Xp(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:p,maskInputFn:m,maskTextFn:f,hooks:g,packFn:y,sampling:v={},dataURLOptions:E={},mousemoveWait:S,recordDOM:T=!0,recordCanvas:w=!1,recordCrossOriginIframes:b=!1,recordAfter:I=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:M=!1,collectFonts:C=!1,inlineImages:N=!1,plugins:O,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:R=new Set([]),errorHandler:A}=e;ip(A);const k=!b||window.parent===window;let _=!1;if(!k)try{window.parent.document&&(_=!1)}catch(e){_=!0}if(k&&!t)throw new Error("emit function is required");void 0!==S&&void 0===v.mousemove&&(v.mousemove=S),qp.reset();const L=!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==h?h:{password:!0},x=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let F;Nh();let P=0;const U=e=>{for(const t of O||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!_&&(e=y(e)),e};Hp=(e,o)=>{var i;if(!(null===(i=cp[0])||void 0===i?void 0:i.isFrozen())||e.type===$h.FullSnapshot||e.type===$h.IncrementalSnapshot&&e.data.source===Hh.Mutation||cp.forEach((e=>e.unfreeze())),k)null==t||t(U(e),o);else if(_){const t={type:"rrweb",event:U(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===$h.FullSnapshot)F=e,P=0;else if(e.type===$h.IncrementalSnapshot){if(e.data.source===Hh.Mutation&&e.data.isAttachIframe)return;P++;const t=r&&P>=r,o=n&&e.timestamp-F.timestamp>n;(t||o)&&Gp(!0)}};const B=e=>{Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.Mutation},e)}))},W=e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.Scroll},e)})),j=e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.CanvasMutation},e)})),V=new jp({mutationCb:B,adoptedStyleSheetCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.AdoptedStyleSheet},e)}))}),$=new wp({mirror:qp,mutationCb:B,stylesheetManager:V,recordCrossOriginIframes:b,wrappedEmit:Hp});for(const e of O||[])e.getMirror&&e.getMirror({nodeMirror:qp,crossOriginIframeMirror:$.crossOriginIframeMirror,crossOriginIframeStyleMirror:$.crossOriginIframeStyleMirror});const H=new Vp;Yp=new Wp({recordCanvas:w,mutationCb:j,win:window,blockClass:o,blockSelector:i,mirror:qp,sampling:v.canvas,dataURLOptions:E});const G=new bp({mutationCb:B,scrollCb:W,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:L,dataURLOptions:E,maskTextFn:f,maskInputFn:m,recordCanvas:w,inlineImages:N,sampling:v,slimDOMOptions:x,iframeManager:$,stylesheetManager:V,canvasManager:Yp,keepIframeSrcFn:D,processedNodeManager:H},mirror:qp});Gp=(e=!1)=>{if(!T)return;Hp($p({type:$h.Meta,data:{href:window.location.href,width:Sh(),height:Eh()}}),e),V.reset(),G.init(),cp.forEach((e=>e.lock()));const t=function(e,t){const{mirror:n=new Sd,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:E,stylesheetLoadTimeout:S,keepIframeSrcFn:T=()=>!1}=t||{};return Xd(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:m,inlineImages:c,recordCanvas:l,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:v,onStylesheetLoad:E,stylesheetLoadTimeout:S,keepIframeSrcFn:T,newlyAddedElement:!1})}(document,{mirror:qp,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:L,maskTextFn:f,slimDOM:x,dataURLOptions:E,recordCanvas:w,inlineImages:N,onSerialize:e=>{Rh(e,qp)&&$.addIframe(e),Ah(e,qp)&&V.trackLinkElement(e),_h(e)&&G.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{$.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:D});if(!t)return console.warn("Failed to snapshot the document");Hp($p({type:$h.FullSnapshot,data:{node:t,initialOffset:vh(window)}}),e),cp.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,qp.getId(document))};try{const e=[],t=e=>{var t;return ap(vp)({mutationCb:B,mousemoveCb:(e,t)=>Hp($p({type:$h.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.MouseInteraction},e)})),scrollCb:W,viewportResizeCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.ViewportResize},e)})),inputCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.Input},e)})),mediaInteractionCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.MediaInteraction},e)})),styleSheetRuleCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.StyleSheetRule},e)})),styleDeclarationCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.StyleDeclaration},e)})),canvasMutationCb:j,fontCb:e=>Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.Font},e)})),selectionCb:e=>{Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.Selection},e)}))},customElementCb:e=>{Hp($p({type:$h.IncrementalSnapshot,data:Object.assign({source:Hh.CustomElement},e)}))},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:c,maskTextSelector:l,maskInputOptions:L,inlineStylesheet:u,sampling:v,recordDOM:T,recordCanvas:w,inlineImages:N,userTriggeredOnInput:M,collectFonts:C,doc:e,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:D,blockSelector:i,slimDOMOptions:x,dataURLOptions:E,mirror:qp,iframeManager:$,stylesheetManager:V,shadowDomManager:G,processedNodeManager:H,canvasManager:Yp,ignoreCSSAttributes:R,plugins:(null===(t=null==O?void 0:O.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Hp($p({type:$h.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},g)};$.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}}));const n=()=>{Gp(),e.push(t(document)),zp=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(dh("DOMContentLoaded",(()=>{Hp($p({type:$h.DomContentLoaded,data:{}})),"DOMContentLoaded"===I&&n()}))),e.push(dh("load",(()=>{Hp($p({type:$h.Load,data:{}})),"load"===I&&n()}),window))),()=>{e.forEach((e=>e())),H.destroy(),zp=!1,sp()}}catch(e){console.warn(e)}}var Zp;Xp.addCustomEvent=(e,t)=>{if(!zp)throw new Error("please add custom event after start recording");Hp($p({type:$h.Custom,data:{tag:e,payload:t}}))},Xp.freezePage=()=>{cp.forEach((e=>e.freeze()))},Xp.takeFullSnapshot=e=>{if(!zp)throw new Error("please take full snapshot after start recording");Gp(e)},Xp.mirror=qp,function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(Zp||(Zp={}));class Kp{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Jp(e){const t=[];for(const n in e){const r=e[n];if("string"!=typeof r)continue;const o=rm(n);t.push(`${o}: ${r};`)}return t.join(" ")}const Qp=/-([a-z])/g,em=/^--[a-zA-Z0-9-]+$/,tm=e=>em.test(e)?e:e.replace(Qp,((e,t)=>t?t.toUpperCase():"")),nm=/\B([A-Z])/g,rm=e=>e.replace(nm,"-$1").toLowerCase();class om{constructor(...e){this.parentElement=null,this.parentNode=null,this.firstChild=null,this.lastChild=null,this.previousSibling=null,this.nextSibling=null,this.ELEMENT_NODE=mm.ELEMENT_NODE,this.TEXT_NODE=mm.TEXT_NODE}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof om))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function im(e){return class extends e{constructor(e,t,n){super(),this.nodeType=mm.DOCUMENT_TYPE_NODE,this.RRNodeType=Zp.DocumentType,this.name=e,this.publicId=t,this.systemId=n,this.nodeName=e,this.textContent=null}toString(){return"RRDocumentType"}}}function sm(e){return class extends e{constructor(e){super(),this.nodeType=mm.ELEMENT_NODE,this.RRNodeType=Zp.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach((t=>e+=t.textContent)),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new um(this.attributes.class,(e=>{this.attributes.class=e}))}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?function(e){const t={},n=/:(.+)/;return e.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach((function(e){if(e){const r=e.split(n);r.length>1&&(t[tm(r[0].trim())]=r[1].trim())}})),t}(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(n,r,o)=>{if(t.test(n))return;const i=tm(n);r?e[i]=r:delete e[i],"important"===o&&(e[i]+=" !important"),this.attributes.style=Jp(e)},e.removeProperty=n=>{if(t.test(n))return"";const r=tm(n),o=e[r]||"";return delete e[r],this.attributes.style=Jp(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,n){this.setAttribute(t,n)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return dm(this,e)}insertBefore(e,t){return hm(this,e,t)}removeChild(e){return pm(this,e)}attachShadow(e){const t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(const t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}}}function am(e){return class extends e{constructor(e){super(),this.nodeType=mm.TEXT_NODE,this.nodeName="#text",this.RRNodeType=Zp.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function cm(e){return class extends e{constructor(e){super(),this.nodeType=mm.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=Zp.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function lm(e){return class extends e{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=mm.CDATA_SECTION_NODE,this.RRNodeType=Zp.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class um{constructor(e,t){if(this.classes=[],this.add=(...e)=>{for(const t of e){const e=String(t);this.classes.indexOf(e)>=0||this.classes.push(e)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...e)=>{this.classes=this.classes.filter((t=>-1===e.indexOf(t))),this.onChange&&this.onChange(this.classes.join(" "))},e){const t=e.trim().split(/\s+/);this.classes.push(...t)}this.onChange=t}}function dm(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function hm(e,t,n){if(!n)return dm(e,t);if(n.parentNode!==e)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===n||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=n.previousSibling,n.previousSibling=t,t.nextSibling=n,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function pm(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var mm;!function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(mm||(mm={}));const fm={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},gm={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let ym=null;function vm(e,t,n,r=t.mirror||t.ownerDocument.mirror){e=function(e,t,n,r){var o;n.afterAppend&&!ym&&(ym=new WeakSet,setTimeout((()=>{ym=null}),0));if(!Tm(e,t)){const i=Sm(t,n.mirror,r);null===(o=e.parentNode)||void 0===o||o.replaceChild(i,e),e=i}switch(t.RRNodeType){case Zp.Document:if(!wm(e,t,n.mirror,r)){const o=r.getMeta(t);o&&(n.mirror.removeNodeFromMap(e),e.close(),e.open(),n.mirror.add(e,o),null==ym||ym.add(e))}break;case Zp.Element:{const o=e,i=t;switch(i.tagName){case"IFRAME":{const o=e.contentDocument;if(!o)break;vm(o,t.contentDocument,n,r);break}}i.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),Em(o.shadowRoot,i.shadowRoot,n,r)),function(e,t,n){const r=e.attributes,o=t.attributes;for(const r in o){const i=o[r],s=n.getMeta(t);if((null==s?void 0:s.isSVG)&&fm[r])e.setAttributeNS(fm[r],r,i);else if("CANVAS"===t.tagName&&"rr_dataURL"===r){const t=document.createElement("img");t.src=i,t.onload=()=>{const n=e.getContext("2d");n&&n.drawImage(t,0,0,t.width,t.height)}}else{if("IFRAME"===t.tagName&&"srcdoc"===r)continue;e.setAttribute(r,i)}}for(const{name:t}of Array.from(r))t in o||e.removeAttribute(t);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}(o,i,r);break}}return e}(e,t,n,r),Em(e,t,n,r),function(e,t,n){var r;switch(t.RRNodeType){case Zp.Document:{const e=t.scrollData;e&&n.applyScroll(e,!0);break}case Zp.Element:{const r=e,o=t;switch(o.scrollData&&n.applyScroll(o.scrollData,!0),o.inputData&&n.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const t=e,n=o;void 0!==n.paused&&(n.paused?t.pause():t.play()),void 0!==n.muted&&(t.muted=n.muted),void 0!==n.volume&&(t.volume=n.volume),void 0!==n.currentTime&&(t.currentTime=n.currentTime),void 0!==n.playbackRate&&(t.playbackRate=n.playbackRate);break}case"CANVAS":{const o=t;if(null!==o.rr_dataURL){const e=document.createElement("img");e.onload=()=>{const t=r.getContext("2d");t&&t.drawImage(e,0,0,e.width,e.height)},e.src=o.rr_dataURL}o.canvasMutations.forEach((t=>n.applyCanvas(t.event,t.mutation,e)));break}case"STYLE":{const e=r.sheet;e&&t.rules.forEach((t=>n.applyStyleSheetMutation(t,e)));break}}break}case Zp.Text:case Zp.Comment:case Zp.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}(null==ym?void 0:ym.has(e))&&(ym.delete(e),null===(r=n.afterAppend)||void 0===r||r.call(n,e,n.mirror.getId(e)))}(e,t,n)}function Em(e,t,n,r){const o=Array.from(e.childNodes),i=t.childNodes;if(0===o.length&&0===i.length)return;let s,a,c=0,l=o.length-1,u=0,d=i.length-1,h=o[c],p=o[l],m=i[u],f=i[d];for(;c<=l&&u<=d;)if(void 0===h)h=o[++c];else if(void 0===p)p=o[--l];else if(wm(h,m,n.mirror,r))h=o[++c],m=i[++u];else if(wm(p,f,n.mirror,r))p=o[--l],f=i[--d];else if(wm(h,f,n.mirror,r)){try{e.insertBefore(h,p.nextSibling)}catch(e){console.warn(e)}h=o[++c],f=i[--d]}else if(wm(p,m,n.mirror,r)){try{e.insertBefore(p,h)}catch(e){console.warn(e)}p=o[--l],m=i[++u]}else{if(!s){s={};for(let e=c;e<=l;e++){const t=o[e];t&&n.mirror.hasNode(t)&&(s[n.mirror.getId(t)]=e)}}a=s[r.getId(m)];const t=o[a];if(void 0!==a&&t&&wm(t,m,n.mirror,r)){try{e.insertBefore(t,h)}catch(e){console.warn(e)}o[a]=void 0}else{const t=Sm(m,n.mirror,r);"#document"===e.nodeName&&h&&(t.nodeType===t.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||t.nodeType===t.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(e.removeChild(h),n.mirror.removeNodeFromMap(h),h=o[++c]);try{e.insertBefore(t,h||null)}catch(e){console.warn(e)}}m=i[++u]}if(c>l){const t=i[d+1];let o=null;for(t&&(o=n.mirror.getNode(r.getId(t)));u<=d;++u){const t=Sm(i[u],n.mirror,r);try{e.insertBefore(t,o)}catch(e){console.warn(e)}}}else if(u>d)for(;c<=l;c++){const t=o[c];if(t&&t.parentNode===e)try{e.removeChild(t),n.mirror.removeNodeFromMap(t)}catch(e){console.warn(e)}}let g=e.firstChild,y=t.firstChild;for(;null!==g&&null!==y;)vm(g,y,n,r),g=g.nextSibling,y=y.nextSibling}function Sm(e,t,n){const r=n.getId(e),o=n.getMeta(e);let i=null;if(r>-1&&(i=t.getNode(r)),null!==i&&Tm(i,e))return i;switch(e.RRNodeType){case Zp.Document:i=new Document;break;case Zp.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case Zp.Element:{let t=e.tagName.toLowerCase();t=gm[t]||t,i=o&&"isSVG"in o&&(null==o?void 0:o.isSVG)?document.createElementNS(fm.svg,t):document.createElement(e.tagName);break}case Zp.Text:i=document.createTextNode(e.data);break;case Zp.Comment:i=document.createComment(e.data);break;case Zp.CDATA:i=document.createCDATASection(e.data)}o&&t.add(i,Object.assign({},o));try{null==ym||ym.add(i)}catch(e){}return i}function Tm(e,t){return e.nodeType===t.nodeType&&(e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName)}function wm(e,t,n,r){const o=n.getId(e),i=r.getId(t);return-1!==o&&o===i&&Tm(e,t)}class bm extends(function(e){return class t extends e{constructor(...e){super(e),this.nodeType=mm.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=Zp.Document,this.textContent=null,this.ownerDocument=this}get documentElement(){return this.childNodes.find((e=>e.RRNodeType===Zp.Element&&"HTML"===e.tagName))||null}get body(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===Zp.Element&&"BODY"===e.tagName)))||null}get head(){var e;return(null===(e=this.documentElement)||void 0===e?void 0:e.childNodes.find((e=>e.RRNodeType===Zp.Element&&"HEAD"===e.tagName)))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const t=e.RRNodeType;if((t===Zp.Element||t===Zp.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===t)))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===Zp.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const n=dm(this,e);return n.parentElement=null,n}insertBefore(e,t){const n=e.RRNodeType;if((n===Zp.Element||n===Zp.DocumentType)&&this.childNodes.some((e=>e.RRNodeType===n)))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${n===Zp.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=hm(this,e,t);return r.parentElement=null,r}removeChild(e){return pm(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(''===e?t="-//W3C//DTD XHTML 1.0 Transitional//EN":''===e&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){const e=this.createDocumentType("html",t,"");this.open(),this.appendChild(e)}}createDocument(e,n,r){return new t}createDocumentType(e,t,n){const r=new(im(om))(e,t,n);return r.ownerDocument=this,r}createElement(e){const t=new(sm(om))(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){const t=new(am(om))(e);return t.ownerDocument=this,t}createComment(e){const t=new(cm(om))(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new(lm(om))(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}}}(om)){get unserializedId(){return this._unserializedId--}constructor(e){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new xm,this.scrollData=null,e&&(this.mirror=e)}createDocument(e,t,n){return new bm}createDocumentType(e,t,n){const r=new Im(e,t,n);return r.ownerDocument=this,r}createElement(e){const t=e.toUpperCase();let n;switch(t){case"AUDIO":case"VIDEO":n=new Cm(t);break;case"IFRAME":n=new Dm(t,this.mirror);break;case"CANVAS":n=new Nm(t);break;case"STYLE":n=new Om(t);break;default:n=new Mm(t)}return n.ownerDocument=this,n}createComment(e){const t=new Am(e);return t.ownerDocument=this,t}createCDATASection(e){const t=new km(e);return t.ownerDocument=this,t}createTextNode(e){const t=new Rm(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Im=im(om);class Mm extends(sm(om)){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Cm extends(function(e){return class extends e{attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(Mm)){}class Nm extends Mm{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Om extends Mm{constructor(){super(...arguments),this.rules=[]}}class Dm extends Mm{constructor(e,t){super(e),this.contentDocument=new bm,this.contentDocument.mirror=t}}const Rm=am(om),Am=cm(om),km=lm(om);function _m(e,t,n,r){let o;switch(e.nodeType){case mm.DOCUMENT_NODE:r&&"IFRAME"===r.nodeName?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case mm.DOCUMENT_TYPE_NODE:{const n=e;o=t.createDocumentType(n.name,n.publicId,n.systemId);break}case mm.ELEMENT_NODE:{const n=e,r=(i=n)instanceof HTMLFormElement?"FORM":i.tagName.toUpperCase();o=t.createElement(r);const s=o;for(const{name:e,value:t}of Array.from(n.attributes))s.attributes[e]=t;n.scrollLeft&&(s.scrollLeft=n.scrollLeft),n.scrollTop&&(s.scrollTop=n.scrollTop);break}case mm.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case mm.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case mm.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case mm.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}var i;let s=n.getMeta(e);return t instanceof bm&&(s||(s=Fm(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function Lm(e,t=function(){return new Kp}(),n=new bm){return function e(r,o){const i=_m(r,n,t,o);if(null!==i)if("IFRAME"!==(null==o?void 0:o.nodeName)&&r.nodeType!==mm.DOCUMENT_FRAGMENT_NODE&&(null==o||o.appendChild(i),i.parentNode=o,i.parentElement=o),"IFRAME"===r.nodeName){const t=r.contentDocument;t&&e(t,i)}else r.nodeType!==mm.DOCUMENT_NODE&&r.nodeType!==mm.ELEMENT_NODE&&r.nodeType!==mm.DOCUMENT_FRAGMENT_NODE||(r.nodeType===mm.ELEMENT_NODE&&r.shadowRoot&&e(r.shadowRoot,i),r.childNodes.forEach((t=>e(t,i))))}(e,null),n}class xm{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var t;if(!e)return-1;const n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Fm(e,t){switch(e.RRNodeType){case Zp.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case Zp.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case Zp.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case Zp.Text:case Zp.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case Zp.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const{addCustomEvent:Pm}=Xp,{freezePage:Um}=Xp;var Bm=Uint8Array,Wm=Uint16Array,jm=Uint32Array,Vm=new Bm([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]),$m=new Bm([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]),Hm=new Bm([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gm=function(e,t){for(var n=new Wm(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&Qm)<<1;ef=(61680&(ef=(52428&ef)>>>2|(13107&ef)<<2))>>>4|(3855&ef)<<4,Jm[Qm]=((65280&ef)>>>8|(255&ef)<<8)>>>1}var tf=function(e,t,n){for(var r=e.length,o=0,i=new Wm(t);o>>c]=l}else for(s=new Wm(r),o=0;o>>15-e[o];return s},nf=new Bm(288);for(Qm=0;Qm<144;++Qm)nf[Qm]=8;for(Qm=144;Qm<256;++Qm)nf[Qm]=9;for(Qm=256;Qm<280;++Qm)nf[Qm]=7;for(Qm=280;Qm<288;++Qm)nf[Qm]=8;var rf=new Bm(32);for(Qm=0;Qm<32;++Qm)rf[Qm]=5;var of=tf(nf,9,0),sf=tf(nf,9,1),af=tf(rf,5,0),cf=tf(rf,5,1),lf=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},uf=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>>(7&t)&n},df=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},hf=function(e){return(e/8|0)+(7&e&&1)},pf=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Wm?Wm:e instanceof jm?jm:Bm)(n-t);return r.set(e.subarray(t,n)),r},mf=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},ff=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},gf=function(e,t){for(var n=[],r=0;rh&&(h=i[r].s);var p=new Wm(h+1),m=yf(n[u-1],p,0);if(m>t){r=0;var f=0,g=m-t,y=1<t))break;f+=y-(1<>>=g;f>0;){var E=i[r].s;p[E]=0&&f;--r){var S=i[r].s;p[S]==t&&(--p[S],++f)}m=t}return[new Bm(p),m]},yf=function(e,t,n){return-1==e.s?Math.max(yf(e.l,t,n+1),yf(e.r,t,n+1)):t[e.s]=n},vf=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Wm(++t),r=0,o=e[0],i=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return[n.subarray(0,r),t]},Ef=function(e,t){for(var n=0,r=0;r>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i4&&!C[Hm[O-1]];--O);var D,R,A,k,_=l+5<<3,L=Ef(o,nf)+Ef(i,rf)+s,x=Ef(o,h)+Ef(i,f)+s+14+3*O+Ef(b,C)+(2*b[16]+3*b[17]+7*b[18]);if(_<=L&&_<=x)return Sf(t,u,e.subarray(c,c+l));if(mf(t,u,1+(x15&&(mf(t,u,B[I]>>>5&127),u+=B[I]>>>12)}}}else D=of,R=nf,A=af,k=rf;for(I=0;I255){W=r[I]>>>18&31;ff(t,u,D[W+257]),u+=R[W+257],W>7&&(mf(t,u,r[I]>>>23&31),u+=Vm[W]);var j=31&r[I];ff(t,u,A[j]),u+=k[j],j>3&&(ff(t,u,r[I]>>>5&8191),u+=$m[j])}else ff(t,u,D[r[I]]),u+=R[r[I]];return ff(t,u,D[256]),u+R[256]},wf=new jm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bf=new Bm(0),If=function(e,t,n,r,o){return function(e,t,n,r,o,i){var s=e.length,a=new Bm(r+s+5*(1+Math.floor(s/7e3))+o),c=a.subarray(r,a.length-o),l=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d>>13,m=8191&h,f=(1<7e3||C>24576)&&k>423){l=Tf(e,c,0,T,w,b,M,C,O,u-O,l),C=I=M=0,O=u;for(var _=0;_<286;++_)w[_]=0;for(_=0;_<30;++_)b[_]=0}var L=2,x=0,F=m,P=R-A&32767;if(k>2&&D==S(u-P))for(var U=Math.min(p,k)-1,B=Math.min(32767,u),W=Math.min(258,k);P<=B&&--F&&R!=A;){if(e[u+L]==e[u+L-P]){for(var j=0;jL){if(L=j,x=P,j>U)break;var V=Math.min(P,j-2),$=0;for(_=0;_$&&($=G,A=H)}}}P+=(R=A)-(A=g[R])+32768&32767}if(x){T[C++]=268435456|qm[L]<<18|Km[x];var Y=31&qm[L],z=31&Km[x];M+=Vm[Y]+$m[z],++w[257+Y],++b[z],N=u+L,++I}else T[C++]=e[u],++w[e[u]]}}l=Tf(e,c,i,T,w,b,M,C,O,u-O,l),i||(l=Sf(c,l,bf))}return pf(a,0,r+hf(l)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!o)};function Mf(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,o=t,i=n.length,s=0;s!=i;){for(var a=Math.min(s+5552,i);s>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r=If(e,t,2,4);return function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)}(r,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(r,r.length-4,n.d()),r}function Cf(e,t){return function(e,t,n){var r=e.length,o=!t||n,i=!n||n.i;n||(n={}),t||(t=new Bm(3*r));var s=function(e){var n=t.length;if(e>n){var r=new Bm(Math.max(2*n,e));r.set(t),t=r}},a=n.f||0,c=n.p||0,l=n.b||0,u=n.l,d=n.d,h=n.m,p=n.n,m=8*r;do{if(!u){n.f=a=uf(e,c,1);var f=uf(e,c+1,3);if(c+=3,!f){var g=e[(N=hf(c)+4)-4]|e[N-3]<<8,y=N+g;if(y>r){if(i)throw"unexpected EOF";break}o&&s(l+g),t.set(e.subarray(N,y),l),n.b=l+=g,n.p=c=8*y;continue}if(1==f)u=sf,d=cf,h=9,p=5;else{if(2!=f)throw"invalid block type";var v=uf(e,c,31)+257,E=uf(e,c+10,15)+4,S=v+uf(e,c+5,31)+1;c+=14;for(var T=new Bm(S),w=new Bm(19),b=0;bm)break;var C=tf(w,I,1);for(b=0;b>>4)<16)T[b++]=N;else{var D=0,R=0;for(16==N?(R=3+uf(e,c,3),c+=2,D=T[b-1]):17==N?(R=3+uf(e,c,7),c+=3):18==N&&(R=11+uf(e,c,127),c+=7);R--;)T[b++]=D}}var A=T.subarray(0,v),k=T.subarray(v);h=lf(A),p=lf(k),u=tf(A,h,1),d=tf(k,p,1)}if(c>m)throw"unexpected EOF"}o&&s(l+131072);for(var _=(1<>>4;if((c+=15&D)>m)throw"unexpected EOF";if(!D)throw"invalid length/literal";if(F<256)t[l++]=F;else{if(256==F){u=null;break}var P=F-254;if(F>264){var U=Vm[b=F-257];P=uf(e,c,(1<>>4;if(!B)throw"invalid distance";if(c+=15&B,k=Zm[W],W>3&&(U=$m[W],k+=df(e,c)&(1<m)throw"unexpected EOF";o&&s(l+131072);for(var j=l+P;l>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}function Nf(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Bm(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},s=0;sr.length){var a=new Bm(o+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?i(c):c<2048?(i(192|c>>>6),i(128|63&c)):c>55295&&c<57344?(i(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),i(128|c>>>12&63),i(128|c>>>6&63),i(128|63&c)):(i(224|c>>>12),i(128|c>>>6&63),i(128|63&c))}return pf(r,0,o)}function Of(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r>10,56320|1023&o))}return n}const Df="v1";class Rf{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Af=/(^|@)\S+:\d+/,kf=/^\s*at .*(\S+:\d+|\(native\))/m,_f=/^(eval@)?(\[native code])?$/,Lf={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(kf)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(kf)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,s=["eval",""].indexOf(o[0])>-1?void 0:o[0];return new Rf({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(_f)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Rf({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Rf({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,o=n.length;e/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Rf({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function xf(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(let e=0;e1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Ff(e){return"[object Object]"===Object.prototype.toString.call(e)}function Pf(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Ff(e[r])&&Pf(e[r],t-1))return!0;return!1}function Uf(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ff(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ff(e)&&Pf(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=xf(r.length?r[0]:null):e[n]=r}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}const Bf={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 Wf(e,t,n){const r=n?Object.assign({},Bf,n):Bf,o=r.logger;if(!o)return()=>{};let i;i="string"==typeof o?t[o]:o;let s=0,a=!1;const c=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,i=Lf.parse(o).map((e=>e.toString())),s=[Uf(n,r.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",n),c.push((()=>{t.removeEventListener("error",n)}));const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[Uf(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[Uf("Uncaught (in promise)",r.stringifyOptions),Uf(t.reason,r.stringifyOptions)]);const i=Lf.parse(n).map((e=>e.toString()));e({level:"error",trace:i,payload:o})};t.addEventListener("unhandledrejection",o),c.push((()=>{t.removeEventListener("unhandledrejection",o)}))}for(const e of r.level)c.push(l(i,e));return()=>{c.forEach((e=>e()))};function l(t,n){return t[n]?gh(t,n,(t=>(...o)=>{if(t.apply(this,o),!a){a=!0;try{const t=Lf.parse(new Error).map((e=>e.toString())).splice(1),i=o.map((e=>Uf(e,r.stringifyOptions)));s++,s{}}}const jf="rrweb/console@1",Vf="__rrweb_original__",$f={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class Hf{constructor(e){this.config=Object.assign($f,e)}getConsoleLogger(){const e={};for(const t of this.config.level)e[t]="trace"===t?e=>{(console.log[Vf]?console.log[Vf]:console.log)(...e.payload.map((e=>JSON.parse(e))),this.formatMessage(e))}:e=>{(console[t][Vf]?console[t][Vf]:console[t])(...e.payload.map((e=>JSON.parse(e))),this.formatMessage(e))};return e}formatMessage(e){if(0===e.trace.length)return"";const t="\n\tat ";let n=t;return n+=e.trace.join(t),n}}const Gf=new Map;function Yf(e,t){let n=Gf.get(e);return n||(n=new Map,Gf.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function zf(e,t,n){return r=>Ip(this,void 0,void 0,(function*(){if(r&&"object"==typeof r&&"rr_type"in r){if(n&&(n.isUnchanged=!1),"ImageBitmap"===r.rr_type&&"args"in r){const o=yield zf(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}if("index"in r){if(n||null===t)return r;const{rr_type:e,index:o}=r;return Yf(t,e)[o]}if("args"in r){const{rr_type:o,args:i}=r;return new(0,window[o])(...yield Promise.all(i.map(zf(e,t,n))))}if("base64"in r)return Op(r.base64);if("src"in r){const t=e.get(r.src);if(t)return t;{const t=new Image;return t.src=r.src,e.set(r.src,t),t}}if("data"in r&&"Blob"===r.rr_type){const o=yield Promise.all(r.data.map(zf(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r)){return yield Promise.all(r.map(zf(e,t,n)))}return r}))}const qf=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Xf({mutation:e,target:t,type:n,imageMap:r,errorHandler:o}){return Ip(this,void 0,void 0,(function*(){try{const o=function(e,t){try{return t===zh.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(t,n);if(!o)return;if(e.setter)return void(o[e.property]=e.args[0]);const i=o[e.property],s=yield Promise.all(e.args.map(zf(r,o)));!function(e,t){if(!(null==t?void 0:t.constructor))return;const{name:n}=t.constructor;if(!qf.includes(n))return;const r=Yf(e,n);r.includes(t)||r.push(t)}(o,i.apply(o,s))}catch(t){o(e,t)}}))}function Zf({event:e,mutation:t,target:n,imageMap:r,canvasEventMap:o,errorHandler:i}){return Ip(this,void 0,void 0,(function*(){try{const s=o.get(e)||t,a="commands"in s?s.commands:[s];if([zh.WebGL,zh.WebGL2].includes(t.type)){for(let e=0;eIp(this,void 0,void 0,(function*(){return Promise.all(e.args.map(zf(r,i)))}))));(yield Promise.all(s)).forEach(((n,s)=>{const a=t[s];try{if(a.setter)return void(i[a.property]=a.args[0]);const t=i[a.property];"drawImage"===a.property&&"string"==typeof a.args[0]?(r.get(e),t.apply(i,a.args)):t.apply(i,n)}catch(e){o(a,e)}}))}))}({event:e,mutations:a,target:n,imageMap:r,errorHandler:i})}catch(e){i(t,e)}}))}function Kf(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}}}var Jf,Qf=Object.freeze({__proto__:null,default:Kf});function eg(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)return;const n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;const s=(a=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(a)?1:0);var a;function c(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s1?1:a,n=function(e){return.5*(1-Math.cos(Math.PI*e))}(a),o=t.startX+(t.x-t.startX)*n,s=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,s),o===t.x&&s===t.y||e.requestAnimationFrame(p.bind(e,t))}function m(n,r,s){let a,l,u,d;const h=i();n===t.body?(a=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=o.scroll):(a=n,l=n.scrollLeft,u=n.scrollTop,d=c),p({scrollable:a,method:d,startTime:h,startX:l,startY:u,x:r,y:s})}e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?m.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0===arguments[0])return;if(!0===l(arguments[0])){if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");return void o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}const e=arguments[0].left,t=arguments[0].top;m.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0===l(arguments[0]))return void o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0]);const n=function(e){for(;e!==t.body&&!1===h(e);)e=e.parentNode||e.host;return e}(this),r=n.getBoundingClientRect(),i=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+i.left-r.left,n.scrollTop+i.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}}class tg{constructor(e=[],t){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t.speed}addAction(e){const t=!0===this.raf;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const t=this.findActionIndex(e);this.actions.splice(t,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const e=this.actions[0];if(!(this.timeOffset>=e.delay))break;this.actions.shift(),e.doAction()}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(!0!==this.raf&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return null!==this.raf}findActionIndex(e){let t=0,n=this.actions.length-1;for(;t<=n;){const r=Math.floor((t+n)/2);if(this.actions[r].delaye.delay))return r+1;n=r-1}}return t}}function ng(e,t){if(e.type===$h.IncrementalSnapshot&&e.data.source===Hh.MouseMove&&e.data.positions&&e.data.positions.length){const n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function rg(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Jf||(Jf={}));var og={type:"xstate.init"};function ig(e){return void 0===e?[]:[].concat(e)}function sg(e){return{type:"xstate.assign",assignment:e}}function ag(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function cg(e){return function(t){return e===t}}function lg(e){return"string"==typeof e?{type:e}:e}function ug(e,t){return{value:e,context:t,actions:[],changed:!1,matches:cg(e)}}function dg(e,t,n){var r=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},r);return"function"==typeof e.assignment?t=e.assignment(r,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](r,n):e.assignment[o]})),r=t,!1}return!0})),r,o]}function hg(e,t){void 0===t&&(t={});var n=rg(dg(ig(e.states[e.initial].entry).map((function(e){return ag(e,t.actions)})),e.context,og),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:cg(e.initial)},transition:function(t,n){var r,o,s="string"==typeof t?{value:t,context:e.context}:t,a=s.value,c=s.context,l=lg(n),u=e.states[a];if(u.on){var d=ig(u.on[l.type]);try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=h.next();!p.done;p=h.next()){var m=p.value;if(void 0===m)return ug(a,c);var f="string"==typeof m?{target:m}:m,g=f.target,y=f.actions,v=void 0===y?[]:y,E=f.cond,S=void 0===E?function(){return!0}:E,T=void 0===g,w=null!=g?g:a,b=e.states[w];if(S(c,l)){var I=rg(dg((T?ig(v):[].concat(u.exit,v,b.entry).filter((function(e){return e}))).map((function(e){return ag(e,i._options.actions)})),c,l),3),M=I[0],C=I[1],N=I[2],O=null!=g?g:a;return{value:O,context:C,actions:M,changed:g!==a||M.length>0||N,matches:cg(O)}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}}return ug(a,c)}};return i}var pg=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function mg(e){var t=e.initialState,n=Jf.NotStarted,r=new Set,o={_machine:e,send:function(o){n===Jf.Running&&(t=e.transition(t,o),pg(t,lg(o)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var i="object"==typeof r?r:{context:e.config.context,value:r};t={value:i.value,actions:[],context:i.context,matches:cg(i.value)}}return n=Jf.Running,pg(t,og),o},stop:function(){return n=Jf.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}function fg(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const o=hg({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:sg({lastPlayedEvent:(e,t)=>"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}),recordTimeOffset:sg(((e,t)=>{let n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),Object.assign(Object.assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play(e){var o;const{timer:i,events:s,baselineTime:a,lastPlayedEvent:c}=e;i.clear();for(const e of s)ng(e,a);const l=function(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===$h.Meta&&r.timestamp<=t)return e.slice(n)}return e}(s,a);let u=null==c?void 0:c.timestamp;(null==c?void 0:c.type)===$h.IncrementalSnapshot&&c.data.source===Hh.MouseMove&&(u=c.timestamp+(null===(o=c.data.positions[0])||void 0===o?void 0:o.timeOffset)),a<(u||0)&&r.emit(qh.PlayBack);const d=new Array;for(const e of l)if(!(u&&u{n()},delay:e.delay})}n(d),r.emit(qh.Flush),i.start()},pause(e){e.timer.clear()},resetLastPlayedEvent:sg((e=>Object.assign(Object.assign({},e),{lastPlayedEvent:null}))),startLive:sg({baselineTime:(e,t)=>(e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now())}),addEvent:sg(((e,n)=>{const{baselineTime:r,timer:o,events:i}=e;if("ADD_EVENT"===n.type){const{event:e}=n.payload;ng(e,r);let s=i.length-1;if(!i[s]||i[s].timestamp<=e.timestamp)i.push(e);else{let t=-1,n=0;for(;n<=s;){const t=Math.floor((n+s)/2);i[t].timestamp<=e.timestamp?n=t+1:s=t-1}-1===t&&(t=n),i.splice(t,0,e)}const a=e.timestamp{c()},delay:e.delay})}return Object.assign(Object.assign({},e),{events:i})}))}});return mg(o)}const gg=Kf||Qf,yg="[replayer]",vg={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Eg(e){return e.type==$h.IncrementalSnapshot&&(e.data.source==Hh.TouchMove||e.data.source==Hh.MouseInteraction&&e.data.type==Gh.TouchStart)}var Sg=Object.freeze({__proto__:null,EventType:$h,IncrementalSource:Hh,MouseInteractions:Gh,PLUGIN_NAME:jf,Replayer:class{get timer(){return this.service.state.context.timer}constructor(e,t){if(this.usingVirtualDom=!1,this.virtualDom=new bm,this.mouseTail=null,this.tailPositions=[],this.emitter=gg(),this.legacy_missingNodeRetryMap={},this.cache=ah(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Td(),this.styleMirror=new Ph,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=e=>{this.iframe.style.display="inherit";for(const t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))},this.applyEventsSynchronously=e=>{for(const t of e){switch(t.type){case $h.DomContentLoaded:case $h.Load:case $h.Custom:continue;case $h.FullSnapshot:case $h.Meta:case $h.Plugin:case $h.IncrementalSnapshot:}this.getCastFn(t,!0)()}},this.getCastFn=(e,t=!1)=>{let n;switch(e.type){case $h.DomContentLoaded:case $h.Load:break;case $h.Custom:n=()=>{this.emitter.emit(qh.CustomEvent,e)};break;case $h.Meta:n=()=>this.emitter.emit(qh.Resize,{width:e.data.width,height:e.data.height});break;case $h.FullSnapshot:n=()=>{var n;if(this.firstFullSnapshot){if(this.firstFullSnapshot===e)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,t),null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo(e.data.initialOffset),this.styleMirror.reset()};break;case $h.IncrementalSnapshot:n=()=>{if(this.applyIncremental(e,t),!t&&(e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const t of this.service.state.context.events)if(!(t.timestamp<=e.timestamp)&&this.isUserInteraction(t)){t.delay-e.delay>1e4*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=t);break}if(this.nextUserInteractionEvent){const t=this.nextUserInteractionEvent.delay-e.delay,n={speed:Math.min(Math.round(t/5e3),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:n}),this.emitter.emit(qh.SkipStart,n)}}}}return()=>{n&&n();for(const n of this.config.plugins||[])n.handler&&n.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const r=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[r]){const t=()=>{r{if(this.usingVirtualDom){const e={mirror:this.mirror,applyCanvas:(e,t,n)=>{Zf({event:e,mutation:t,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(e,t)=>{e.source===Hh.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===Hh.StyleDeclaration&&this.applyStyleDeclaration(e,t)},afterAppend:(e,t)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})}};if(this.iframe.contentDocument)try{vm(this.iframe.contentDocument,this.virtualDom,e,this.virtualDom.mirror)}catch(e){console.warn(e)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const t in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[t],r=Sm(n.node,this.mirror,this.virtualDom.mirror);vm(r,n.node,e,this.virtualDom.mirror),n.node=r}catch(e){this.warn(e)}this.constructedStyleMutations.forEach((e=>{this.applyStyleSheetMutation(e)})),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach((e=>{this.applyAdoptedStyleSheet(e)})),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[e,t]=this.lastMouseDownEvent;e.dispatchEvent(t)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)})),this.emitter.on(qh.PlayBack,(()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()}));const r=new tg([],{speed:this.config.speed});this.service=fg({events:e.map((e=>t&&t.unpackFn?t.unpackFn(e):e)).sort(((e,t)=>e.timestamp-t.timestamp)),timer:r,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((e=>{this.emitter.emit(qh.StateChange,{player:e})})),this.speedService=mg(hg({id:"speed",context:{normalSpeed:-1,timer:r},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(e,t)=>{"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:sg({normalSpeed:e=>e.timer.speed}),restoreSpeed:e=>{e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((e=>{this.emitter.emit(qh.StateChange,{speed:e})}));const o=this.service.state.context.events.find((e=>e.type===$h.Meta)),i=this.service.state.context.events.find((e=>e.type===$h.FullSnapshot));if(o){const{width:e,height:t}=o.data;setTimeout((()=>{this.emitter.emit(qh.Resize,{width:e,height:t})}),0)}i&&setTimeout((()=>{var e;this.firstFullSnapshot||(this.firstFullSnapshot=i,this.rebuildFullSnapshot(i),null===(e=this.iframe.contentWindow)||void 0===e||e.scrollTo(i.data.initialOffset))}),1),this.service.state.context.events.find(Eg)&&this.mouse.classList.add("touch-device")}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach((t=>{e[t],this.config[t]=e[t]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,n;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.remove("rrweb-paused"),this.emitter.emit(qh.Start)}pause(e){var t,n;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.getElementsByTagName("html")[0])||void 0===n||n.classList.add("rrweb-paused"),this.emitter.emit(qh.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(qh.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(qh.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;Eg(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((()=>this.service.send({type:"ADD_EVENT",payload:{event:t}})))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=ah()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(eg(this.iframe.contentWindow,this.iframe.contentDocument),Nh(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[],r=(e,t)=>{this.collectIframeAndAttachDocument(n,e);for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),uh(e.data.node,{doc:this.iframe.contentDocument,afterAppend:r,cache:this.cache,mirror:this.mirror}),r(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:e,builtNode:t}of n)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e));const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(qh.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var n;const r=(o=this.config.blockClass,[`.${o} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var o;if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Fm(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:Hh.StyleSheetRule,adds:r.map(((e,t)=>({rule:e,index:t})))})}else{const o=document.createElement("style");e.insertBefore(o,t);for(let e=0;e{this.collectIframeAndAttachDocument(r,e);const i=n.getMeta(e);if((null==i?void 0:i.type)===pd.Element&&"HTML"===(null==i?void 0:i.tagName.toUpperCase())){const{documentElement:e,head:n}=t.contentDocument;this.insertStyleRules(e,n)}if(!this.usingVirtualDom)for(const t of this.config.plugins||[])t.onBuild&&t.onBuild(e,{id:o,replayer:this})};lh(e.node,{doc:t.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:e,builtNode:t}of r)this.attachDocumentToIframe(e,t),this.newDocumentQueue=this.newDocumentQueue.filter((t=>t!==e))}collectIframeAndAttachDocument(e,t){if(Rh(t,this.mirror)){const n=this.newDocumentQueue.find((e=>e.parentId===this.mirror.getId(t)));n&&e.push({mutationInQueue:n,builtNode:t})}}waitForStylesheetLoad(){var e;const t=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(t){const e=new Set;let n,r=this.service.state;const o=()=>{r=this.service.state};this.emitter.on(qh.Start,o),this.emitter.on(qh.Pause,o);const i=()=>{this.emitter.off(qh.Start,o),this.emitter.off(qh.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach((t=>{t.sheet||(e.add(t),t.addEventListener("load",(()=>{e.delete(t),0===e.size&&-1!==n&&(r.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(qh.LoadStylesheetEnd),n&&clearTimeout(n),i())})))})),e.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(qh.LoadStylesheetStart),n=setTimeout((()=>{r.matches("playing")&&this.play(this.getCurrentTime()),n=-1,i()}),this.config.loadTimeout))}}preloadAllImages(){return Ip(this,void 0,void 0,(function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(qh.Start,e),this.emitter.on(qh.Pause,e);const t=[];for(const e of this.service.state.context.events)if(e.type===$h.IncrementalSnapshot&&e.data.source===Hh.CanvasMutation){t.push(this.deserializeAndPreloadCanvasEvents(e.data,e));("commands"in e.data?e.data.commands:[e.data]).forEach((t=>{this.preloadImages(t,e)}))}return Promise.all(t)}))}preloadImages(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){const t=document.createElement("canvas"),n=t.getContext("2d"),r=null==n?void 0:n.createImageData(t.width,t.height);null==r||r.data,JSON.parse(e.args[0]),null==n||n.putImageData(r,0,0)}}deserializeAndPreloadCanvasEvents(e,t){return Ip(this,void 0,void 0,(function*(){if(!this.canvasEventMap.has(t)){const n={isUnchanged:!0};if("commands"in e){const r=yield Promise.all(e.commands.map((e=>Ip(this,void 0,void 0,(function*(){const t=yield Promise.all(e.args.map(zf(this.imageMap,null,n)));return Object.assign(Object.assign({},e),{args:t})})))));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{commands:r}))}else{const r=yield Promise.all(e.args.map(zf(this.imageMap,null,n)));!1===n.isUnchanged&&this.canvasEventMap.set(t,Object.assign(Object.assign({},e),{args:r}))}}}))}applyIncremental(e,t){var n,r,o;const{data:i}=e;switch(i.source){case Hh.Mutation:try{this.applyMutation(i,t)}catch(e){this.warn(`Exception in mutation ${e.message||e}`,i)}break;case Hh.Drag:case Hh.TouchMove:case Hh.MouseMove:if(t){const e=i.positions[i.positions.length-1];this.mousePos={x:e.x,y:e.y,id:e.id,debugData:i}}else i.positions.forEach((n=>{const r={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,t,i)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(r)})),this.timer.addAction({doAction(){},delay:e.delay-(null===(n=i.positions[0])||void 0===n?void 0:n.timeOffset)});break;case Hh.MouseInteraction:{if(-1===i.id)break;const e=new Event(bd(Gh[i.type])),n=this.mirror.getNode(i.id);if(!n)return this.debugNodeNotFound(i,i.id);this.emitter.emit(qh.MouseInteraction,{type:i.type,target:n});const{triggerFocus:r}=this.config;switch(i.type){case Gh.Blur:"blur"in n&&n.blur();break;case Gh.Focus:r&&n.focus&&n.focus({preventScroll:!0});break;case Gh.Click:case Gh.TouchStart:case Gh.TouchEnd:case Gh.MouseDown:case Gh.MouseUp:t?(i.type===Gh.TouchStart?this.touchActive=!0:i.type===Gh.TouchEnd&&(this.touchActive=!1),i.type===Gh.MouseDown?this.lastMouseDownEvent=[n,e]:i.type===Gh.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:i.x||0,y:i.y||0,id:i.id,debugData:i}):(i.type===Gh.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x||0,i.y||0,i.id,t,i),i.type===Gh.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===Gh.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===Gh.TouchEnd?this.mouse.classList.remove("touch-active"):n.dispatchEvent(e));break;case Gh.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:n.dispatchEvent(e)}break}case Hh.Scroll:if(-1===i.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);e.scrollData=i;break}this.applyScroll(i,t);break;case Hh.ViewportResize:this.emitter.emit(qh.Resize,{width:i.width,height:i.height});break;case Hh.Input:if(-1===i.id)break;if(this.usingVirtualDom){const e=this.virtualDom.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);e.inputData=i;break}this.applyInput(i);break;case Hh.MediaInteraction:{const e=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!e)return this.debugNodeNotFound(i,i.id);const t=e;try{void 0!==i.currentTime&&(t.currentTime=i.currentTime),void 0!==i.volume&&(t.volume=i.volume),void 0!==i.muted&&(t.muted=i.muted),1===i.type&&t.pause(),0===i.type&&t.play(),4===i.type&&(t.playbackRate=i.playbackRate)}catch(e){this.warn(`Failed to replay media interactions: ${e.message||e}`)}break}case Hh.StyleSheetRule:case Hh.StyleDeclaration:this.usingVirtualDom?i.styleId?this.constructedStyleMutations.push(i):i.id&&(null===(r=this.virtualDom.mirror.getNode(i.id))||void 0===r||r.rules.push(i)):this.applyStyleSheetMutation(i);break;case Hh.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const t=this.virtualDom.mirror.getNode(i.id);if(!t)return this.debugNodeNotFound(i,i.id);t.canvasMutations.push({event:e,mutation:i})}else{const t=this.mirror.getNode(i.id);if(!t)return this.debugNodeNotFound(i,i.id);Zf({event:e,mutation:i,target:t,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case Hh.Font:try{const e=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);null===(o=this.iframe.contentDocument)||void 0===o||o.fonts.add(e)}catch(e){this.warn(e)}break;case Hh.Selection:if(t){this.lastSelectionData=i;break}this.applySelection(i);break;case Hh.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(i):this.applyAdoptedStyleSheet(i)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,Lm(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const e in this.legacy_missingNodeRetryMap)try{const t=this.legacy_missingNodeRetryMap[e],n=_m(t.node,this.virtualDom,this.mirror);n&&(t.node=n)}catch(e){this.warn(e)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter((t=>!!n.getNode(t.id)||(this.warnNodeNotFound(e,t.id),!1))),e.removes.forEach((t=>{var r;const o=n.getNode(t.id);if(!o)return;let i=n.getNode(t.parentId);if(!i)return this.warnNodeNotFound(e,t.parentId);if(t.isShadow&&_h(i)&&(i=i.shadowRoot),n.removeNodeFromMap(o),i)try{i.removeChild(o),this.usingVirtualDom&&"#text"===o.nodeName&&"STYLE"===i.nodeName&&(null===(r=i.rules)||void 0===r?void 0:r.length)>0&&(i.rules=[])}catch(t){if(!(t instanceof DOMException))throw t;this.warn("parent could not remove child in mutation",i,o,e)}}));const r=Object.assign({},this.legacy_missingNodeRetryMap),o=[],i=e=>{var t,i;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let s=n.getNode(e.parentId);if(!s)return e.node.type===pd.Document?this.newDocumentQueue.push(e):o.push(e);e.node.isShadow&&(_h(s)||s.attachShadow({mode:"open"}),s=s.shadowRoot);let a=null,c=null;if(e.previousId&&(a=n.getNode(e.previousId)),e.nextId&&(c=n.getNode(e.nextId)),(e=>{let t=null;return e.nextId&&(t=n.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t})(e))return o.push(e);if(e.node.rootId&&!n.getNode(e.node.rootId))return;const l=e.node.rootId?n.getNode(e.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Rh(s,n))return void this.attachDocumentToIframe(e,s);const u=(e,t)=>{if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(e,{id:t,replayer:this})},d=lh(e.node,{doc:l,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:u});if(-1===e.previousId||-1===e.nextId)return void(r[e.node.id]={node:d,mutation:e});const h=n.getMeta(s);if(h&&h.type===pd.Element&&"textarea"===h.tagName&&e.node.type===pd.Text){const e=Array.isArray(s.childNodes)?s.childNodes:Array.from(s.childNodes);for(const t of e)t.nodeType===s.TEXT_NODE&&s.removeChild(t)}else if((null==h?void 0:h.type)===pd.Document){const n=s;e.node.type===pd.DocumentType&&(null===(t=n.childNodes[0])||void 0===t?void 0:t.nodeType)===Node.DOCUMENT_TYPE_NODE&&n.removeChild(n.childNodes[0]),"HTML"===d.nodeName&&n.documentElement&&n.removeChild(n.documentElement)}if(a&&a.nextSibling&&a.nextSibling.parentNode?s.insertBefore(d,a.nextSibling):c&&c.parentNode?s.contains(c)?s.insertBefore(d,c):s.insertBefore(d,null):s.appendChild(d),u(d,e.node.id),this.usingVirtualDom&&"#text"===d.nodeName&&"STYLE"===s.nodeName&&(null===(i=s.rules)||void 0===i?void 0:i.length)>0&&(s.rules=[]),Rh(d,this.mirror)){const e=this.mirror.getId(d),t=this.newDocumentQueue.find((t=>t.parentId===e));t&&(this.attachDocumentToIframe(t,d),this.newDocumentQueue=this.newDocumentQueue.filter((e=>e!==t)))}(e.previousId||e.nextId)&&this.legacy_resolveMissingNode(r,s,d,e)};e.adds.forEach((e=>{i(e)}));const s=Date.now();for(;o.length;){const e=Oh(o);if(o.length=0,Date.now()-s>500){this.warn("Timeout in the loop, please check the resolve tree data:",e);break}for(const t of e){n.getNode(t.value.parentId)?Dh(t,(e=>{i(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",t)}}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),Fh(e.texts).forEach((t=>{var r;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}if(o.textContent=t.value,this.usingVirtualDom){const e=o.parentNode;(null===(r=null==e?void 0:e.rules)||void 0===r?void 0:r.length)>0&&(e.rules=[])}})),e.attributes.forEach((t=>{var r;const o=n.getNode(t.id);if(!o){if(e.removes.find((e=>e.id===t.id)))return;return this.warnNodeNotFound(e,t.id)}for(const e in t.attributes)if("string"==typeof e){const i=t.attributes[e];if(null===i)o.removeAttribute(e);else if("string"==typeof i)try{if("_cssText"===e&&("LINK"===o.nodeName||"STYLE"===o.nodeName))try{const e=n.getMeta(o);Object.assign(e.attributes,t.attributes);const r=lh(e,{doc:o.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),i=o.nextSibling,s=o.parentNode;if(r&&s){s.removeChild(o),s.insertBefore(r,i),n.replace(t.id,r);break}}catch(e){}if("value"===e&&"TEXTAREA"===o.nodeName){const e=o;e.childNodes.forEach((t=>e.removeChild(t)));const t=null===(r=o.ownerDocument)||void 0===r?void 0:r.createTextNode(i);t&&e.appendChild(t)}else o.setAttribute(e,i)}catch(e){this.warn("An error occurred may due to the checkout feature.",e)}else if("style"===e){const e=i,t=o;for(const n in e)if(!1===e[n])t.style.removeProperty(n);else if(e[n]instanceof Array){const r=e[n];t.style.setProperty(n,r[0],r[1])}else{const r=e[n];t.style.setProperty(n,r)}}}}))}applyScroll(e,t){var n,r;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const i=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)null===(n=this.iframe.contentWindow)||void 0===n||n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((null==i?void 0:i.type)===pd.Document)null===(r=o.defaultView)||void 0===r||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(e){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}}applySelection(e){try{const t=new Set,n=e.ranges.map((({start:e,startOffset:n,end:r,endOffset:o})=>{const i=this.mirror.getNode(e),s=this.mirror.getNode(r);if(!i||!s)return;const a=new Range;a.setStart(i,n),a.setEnd(s,o);const c=i.ownerDocument,l=null==c?void 0:c.getSelection();return l&&t.add(l),{range:a,selection:l}}));t.forEach((e=>e.removeAllRanges())),n.forEach((e=>{var t;return e&&(null===(t=e.selection)||void 0===t?void 0:t.addRange(e.range))}))}catch(e){}}applyStyleSheetMutation(e){var t;let n=null;e.styleId?n=this.styleMirror.getStyle(e.styleId):e.id&&(n=(null===(t=this.mirror.getNode(e.id))||void 0===t?void 0:t.sheet)||null),n&&(e.source===Hh.StyleSheetRule?this.applyStyleSheetRule(e,n):e.source===Hh.StyleDeclaration&&this.applyStyleDeclaration(e,n))}applyStyleSheetRule(e,t){var n,r,o,i;if(null===(n=e.adds)||void 0===n||n.forEach((({rule:e,index:n})=>{try{if(Array.isArray(n)){const{positions:r,index:o}=xh(n);Lh(t.cssRules,r).insertRule(e,o)}else{const r=void 0===n?void 0:Math.min(n,t.cssRules.length);null==t||t.insertRule(e,r)}}catch(e){}})),null===(r=e.removes)||void 0===r||r.forEach((({index:e})=>{try{if(Array.isArray(e)){const{positions:n,index:r}=xh(e);Lh(t.cssRules,n).deleteRule(r||0)}else null==t||t.deleteRule(e)}catch(e){}})),e.replace)try{null===(o=t.replace)||void 0===o||o.call(t,e.replace)}catch(e){}if(e.replaceSync)try{null===(i=t.replaceSync)||void 0===i||i.call(t,e.replaceSync)}catch(e){}}applyStyleDeclaration(e,t){if(e.set){Lh(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){Lh(t.rules,e.index).style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){var t;const n=this.mirror.getNode(e.id);if(!n)return;null===(t=e.styles)||void 0===t||t.forEach((e=>{var t;let r=null,o=null;if(_h(n)?o=(null===(t=n.ownerDocument)||void 0===t?void 0:t.defaultView)||null:"#document"===n.nodeName&&(o=n.defaultView),o)try{r=new o.CSSStyleSheet,this.styleMirror.add(r,e.styleId),this.applyStyleSheetRule({source:Hh.StyleSheetRule,adds:e.rules},r)}catch(e){}}));let r=0;const o=(e,t)=>{const n=t.map((e=>this.styleMirror.getStyle(e))).filter((e=>null!==e));_h(e)?e.shadowRoot.adoptedStyleSheets=n:"#document"===e.nodeName&&(e.adoptedStyleSheets=n),n.length!==t.length&&r<10&&(setTimeout((()=>o(e,t)),0+100*r),r++)};o(n,e.styleIds)}legacy_resolveMissingNode(e,t,n,r){const{previousId:o,nextId:i}=r,s=o&&e[o],a=i&&e[i];if(s){const{node:r,mutation:o}=s;t.insertBefore(r,n),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,r,o)}if(a){const{node:r,mutation:o}=a;t.insertBefore(r,n.nextSibling),delete e[o.node.id],delete this.legacy_missingNodeRetryMap[o.node.id],(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(e,t,r,o)}}moveAndHover(e,t,n,r,o){const i=this.mirror.getNode(n);if(!i)return this.debugNodeNotFound(o,n);const s=kh(i,this.iframe),a=e*s.absoluteScale+s.x,c=t*s.absoluteScale+s.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,r||this.drawMouseTail({x:a,y:c}),this.hoverElements(i)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:n,strokeStyle:r,duration:o}=!0===this.config.mouseTail?vg:Object.assign({},vg,this.config.mouseTail),i=()=>{if(!this.mouseTail)return;const e=this.mouseTail.getContext("2d");e&&this.tailPositions.length&&(e.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),e.beginPath(),e.lineWidth=n,e.lineCap=t,e.strokeStyle=r,e.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach((t=>e.lineTo(t.x,t.y))),e.stroke())};this.tailPositions.push(e),i(),setTimeout((()=>{this.tailPositions=this.tailPositions.filter((t=>t!==e)),i()}),o/this.speedService.state.context.timer.speed)}hoverElements(e){var t;null===(t=this.lastHoveredRootNode||this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((e=>{e.classList.remove(":hover")})),this.lastHoveredRootNode=e.getRootNode();let n=e;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(e){return e.type===$h.IncrementalSnapshot&&(e.data.source>Hh.Mutation&&e.data.source<=Hh.Input)}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(qh.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(yg,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(yg,...e)}},ReplayerEvents:qh,addCustomEvent:Pm,canvasMutation:Zf,freezePage:Um,getRecordConsolePlugin:e=>({name:jf,observer:Wf,options:e}),getReplayConsolePlugin:e=>{const t=(null==e?void 0:e.replayLogger)||new Hf(e).getConsoleLogger();return{handler(e,n,r){let o=null;if(e.type===$h.IncrementalSnapshot&&e.data.source===Hh.Log?o=e.data:e.type===$h.Plugin&&e.data.plugin===jf&&(o=e.data.payload),o)try{"function"==typeof t[o.level]&&t[o.level](o)}catch(e){r.replayer.config.showWarning&&console.warn(e)}}}},get mirror(){return ph},pack:e=>{const t=Object.assign(Object.assign({},e),{v:Df});return Of(Mf(Nf(JSON.stringify(t))),!0)},record:Xp,unpack:e=>{if("string"!=typeof e)return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch(e){}try{const t=JSON.parse(Of(Cf(Nf(e,!0))));if(t.v===Df)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Df}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}},utils:Vh}),Tg=t(Sg);const{supportsLocalStorageApi:wg}=i,{clearMetric:bg,checkMetric:Ig,getMetric:Mg,appendMetric:Cg,trackMetric:Ng}=Vr,Og=()=>({data:[],expireTime:0}),Dg=e=>{wg()?window.localStorage.removeItem(e):bg(e)},Rg=(e,t=null)=>{if(!wg())return Mg(e,t);const n=JSON.parse(window.localStorage.getItem(e));return n?n.expireTime<=Date.now()?(Dg(e),t):n.data:t};var Ag={clearBuffer:Dg,checkBuffer:e=>wg()?!!window.localStorage.getItem(e):Ig(e),getBuffer:Rg,appendToBuffer:(e,t,n=0)=>{if(!wg())return void Cg(e,t);const r=Rg(e,{data:[],expireTime:0});r.data.push(t),r.expireTime=Date.now()+n,window.localStorage.setItem(e,JSON.stringify(r))},getBufferSchema:Og,addToBuffer:(e,t,n=0)=>{if(!wg())return void Ng(e,t);const r=Rg(e,{data:[],expireTime:0});r.data=t,r.expireTime=Date.now()+n,window.localStorage.setItem(e,JSON.stringify(r))}};const{getMetric:kg,clearMetric:_g,appendMetric:Lg,checkMetric:xg}=Vr,{sendWithFetch:Fg}=Wn,{getUserId:Pg,getPath:Ug}=Qu,{prepareDeviceType:Bg}=Ut,{endpoint:Wg,PAYLOAD_SIZE:jg,MAX_MLDATA_WAITING_TIME:Vg,MAX_CHUNKS_SIZE:$g,MAX_FLUSH_TIME:Hg,CHUNKS_EXPIRATION_TIME:Gg}=Be,{SESSION_ID:Yg,REQUEST_ID:zg,APP_NAME:qg,SCOPE_NAME:Xg,USER_AGENT:Zg,DEVICE:Kg,WEBVIEW:Jg,CUSTOM_ATTRIBUTES:Qg,TRACEABILITY_ID:ey,SESSION_REPLAY:ty,SITE_ID:ny}=h,{objectOperator:ry}=u,{addToBuffer:oy,getBuffer:iy,clearBuffer:sy}=Ag,ay={flushTime:Hg,size:$g,limit:jg,maxAge:Gg,isFirstRun:!0};let cy=null;const ly=()=>({session_id:kg(Yg),view_id:kg(zg),app_name:kg(qg),fury_context_name:kg(Xg)}),uy=["mla","mlb","mlm"],dy=()=>{const e=(kg(ny)||"").toLowerCase();return uy.some((t=>t===e))?e:"rola"},hy=()=>{const e=kg(Qg);let t=null,n=null;return e&&(t=e,e.userId&&(n=e.userId)),{metadataPayload:t,fallbackUserId:n}},py=(e,t)=>{const{metadataPayload:n,fallbackUserId:r}=hy(),o=ry([{},e,{device_timestamp:Date.now(),user_id:Pg(r),view_name:Ug(),mime_type:"application/json",asset:t,metadata:n}]),i=kg(ey);i&&(o.traceability_id=i);const s=Bg({[Zg]:kg(Zg)},{device:kg(Kg),webview:kg(Jg)});return s&&(o.device_platform=`/${s}`),{data:o}},my=(e,t=!0)=>{const n=kg(e);return t&&(clearTimeout(cy),_g(e)),n},fy={hasReached:!1,ref:null},gy=()=>{if(fy.hasReached)return!0;const e=void 0===window.melidata||window.melidata_namespace&&window.melidata_namespace.actual_track&&Object.keys(window.melidata_namespace.actual_track).length>0;return e&&fy.ref&&clearTimeout(fy.ref),!!e||(fy.hasReached||fy.ref||(fy.ref=setTimeout((()=>{fy.hasReached=!0}),Vg)),!1)},yy=e=>{if(!gy())return;const t=ly(),n=my(e);if(!n||!t)return;const r=py(t,n);Fg(`${Wg(dy())}`,JSON.stringify(r),!1)},vy=(e,t)=>{Lg(e,t),(e=>{const t=kg(e);(JSON.stringify(t).length>=ay.limit||t.length>=ay.size)&&yy(e)})(e)},Ey=()=>{const{payload:e,url:t}=iy(ty,{payload:null,url:null});e&&(sy(ty),Fg(`${t}`,JSON.stringify(e),!1))},Sy=(e,t)=>{ay.isFirstRun&&(Ey(),ay.isFirstRun=!1),Lg(e,t),(e=>{cy=setTimeout((()=>{yy(e)}),ay.flushTime)})(e)};var Ty={monitor:(e,t)=>{xg(e)?vy(e,t):Sy(e,t)},send:yy,savePending:()=>{const e=ly(),t=my(ty);if(!t||!e)return;const n=py(e,t),r=Wg(dy());oy(ty,{payload:n,url:r},ay.maxAge)},sendPending:Ey,processMetadata:hy};const{SESSION_REPLAY:wy}=l,by=Ve,{getConfiguration:Iy}=it,{METRICS:My}=st;var Cy=(e,t)=>{const n=Iy(My,wy),r=by(t,n);if(!Object.keys(r).length)throw new Error("Metrics not found");return{name:wy,data:r}};const Ny=Tg,{SESSION_REPLAY:Oy,CUSTOM_ATTRIBUTES:Dy,SESSION_REPLAY_START:Ry,SESSION_REPLAY_STOP:Ay,TRACEABILITY_ID:ky}=h,{RRWEB_EVENT_TYPES:_y}=Be,{monitor:Ly}=Ty,xy=Cy,{getMetricsCollected:Fy,trackMetric:Py}=Vr,{objectOperator:Uy}=u,{subscribe:By}=c;let Wy=null;const jy=(e={},t=null)=>{t&&Py(ky,t),Object.keys(e).length&&Py(Dy,e),Wy=Ny.record({emit:e=>{if(e.type===_y.Meta){const t=xy(null,Fy());e.data=Uy([{},t.data,e.data])}Ly(Oy,e)},inlineStylesheet:!0,recordCanvas:!0,recordCrossOriginIframes:!0,maskTextClass:/(ml-mask|rr-mask|nav-header-username|user-badge-title|payment-card-component)/,blockClass:/(ml-block|rr-block)/,maskInputOptions:{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}})},Vy=()=>Wy&&Wy();var $y=()=>{By(Ry,((e={})=>{jy(e.metadata||{},e.traceability_id||null)})),By(Ay,(()=>{Vy()})),window.startRecording=(e={},t=null)=>jy(e,t),window.stopRecording=()=>Vy()};const{savePending:Hy,sendPending:Gy}=Ty,Yy=window.requestIdleCallback||(e=>setTimeout(e,200)),zy="sessionReplayEvent",qy=()=>{window.document.addEventListener(zy,(async()=>{"hidden"===window.document.visibilityState&&Hy(),"visible"===window.document.visibilityState&&Gy()})),window.document.addEventListener("visibilitychange",(()=>{const e=new window.Event(zy);window.document.dispatchEvent(e)}))};var Xy=()=>{Yy((()=>qy()))};const Zy=zr,Ky=Qr,{prepareConfiguration:Jy}=it,Qy=zs,ev=md,tv=$y,nv=aa,rv=Xy,{supportsBeaconOrFetch:ov}=i;var iv={start:e=>{const t=Jy(e);if(t)try{ov()&&(Zy(),Ky(),Qy(),nv(),ev(t),tv(),rv())}catch(e){}}};const{WEB_VITALS:sv,RESOURCE_TIMING:av,CLIENT_COOKIES:cv,PAGE_RENDER:lv,A11Y:uv,AVAILABILITY:dv,CDN_HEALTH:hv,TRAFFIC_HEALTH:pv,SESSION_REPLAY:mv}=l,fv=ka,gv=Qa,yv=Ec,vv=Pc,Ev=Nl,Sv=cu,Tv=Vu,wv=qu,bv=iv;var Iv={[sv]:fv,[av]:gv,[cv]:yv,[lv]:vv,[uv]:Ev,[dv]:Sv,[hv]:Tv,[pv]:wv,[mv]:bv};const{supportsEnvironment:Mv}=i,{queue:Cv}=c,{agentKey:Nv}={agentKey:"_perfill"},Ov=Iv,Dv={},Rv=()=>(Dv.initiatives||[]).forEach((e=>{e&&e.id&&Ov[e.id]&&Ov[e.id].start(Dv,e)})),Av=()=>{window.requestIdleCallback?window.requestIdleCallback(Rv,{timeout:2e3}):setTimeout(Rv,500)};let kv=!1;const _v={set:(e,t)=>{Dv[e]=t},queue:Cv,send:e=>{e in _v&&_v[e]()},start:()=>{!kv&&Mv()&&(kv=!0,"complete"===window.document.readyState?Av():window.addEventListener("load",Av))}},Lv=e=>{try{const t=e[0],n=_v[t];t&&n&&n.apply(null,[].slice.call(e,1))}catch(e){}};return e((()=>{const e=(window[Nv]||{}).q||[];window[Nv]=(...e)=>Lv(e);try{e.forEach(Lv)}catch(e){}})())}(); //# sourceMappingURL=perfill-agent.min.js.map