@adora-so/adora-js 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/index.cjs +2 -52
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +2 -52
- package/dist/index.mjs.map +4 -4
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -1,54 +1,4 @@
|
|
|
1
|
-
"use strict";var Ul=Object.create;var pt=Object.defineProperty;var zl=Object.getOwnPropertyDescriptor;var Hl=Object.getOwnPropertyNames;var Bl=Object.getPrototypeOf,Wl=Object.prototype.hasOwnProperty;var Vl=(s,e,t)=>e in s?pt(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Yl=(s,e)=>{for(var t in e)pt(s,t,{get:e[t],enumerable:!0})},co=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Hl(e))!Wl.call(s,n)&&n!==t&&pt(s,n,{get:()=>e[n],enumerable:!(r=zl(e,n))||r.enumerable});return s};var ho=(s,e,t)=>(t=s!=null?Ul(Bl(s)):{},co(e||!s||!s.__esModule?pt(t,"default",{value:s,enumerable:!0}):t,s)),Gl=s=>co(pt({},"__esModule",{value:!0}),s);var fe=(s,e,t)=>Vl(s,typeof e!="symbol"?e+"":e,t);var Qp={};Yl(Qp,{adoraIsRunning:()=>Ge,adoraStart:()=>Xp,adoraStop:()=>qp});module.exports=Gl(Qp);var jl={"Content-Type":"application/json"},Kl=/\{[^{}]+\}/g,ls=class extends Request{constructor(e,t){super(e,t);for(let r in t)r in this||(this[r]=t[r])}};function us(s){let{baseUrl:e="",fetch:t=globalThis.fetch,querySerializer:r,bodySerializer:n,headers:o,...i}={...s};e.endsWith("/")&&(e=e.substring(0,e.length-1)),o=po(jl,o);let l=[];async function a(u,c){let{fetch:d=t,headers:p,params:m={},parseAs:g="json",querySerializer:f,bodySerializer:h=n??Zl,...E}=c||{},S=typeof r=="function"?r:fo(r);f&&(S=typeof f=="function"?f:fo({...typeof r=="object"?r:{},...f}));let w={redirect:"follow",...i,...E,headers:po(o,p,m.header)};w.body&&(w.body=h(w.body)),w.body instanceof FormData&&w.headers.delete("Content-Type");let I=new ls(Xl(u,{baseUrl:e,params:m,querySerializer:S}),w),_={baseUrl:e,fetch:d,parseAs:g,querySerializer:S,bodySerializer:h};for(let v of l)if(v&&typeof v=="object"&&typeof v.onRequest=="function"){I.schemaPath=u,I.params=m;let x=await v.onRequest(I,_);if(x){if(!(x instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");I=x}}let y=await d(I);for(let v=l.length-1;v>=0;v--){let x=l[v];if(x&&typeof x=="object"&&typeof x.onResponse=="function"){let O=await x.onResponse(y,_);if(O){if(!(O instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");y=O}}}if(y.status===204||y.headers.get("Content-Length")==="0")return y.ok?{data:{},response:y}:{error:{},response:y};if(y.ok)return g==="stream"?{data:y.body,response:y}:{data:await y[g](),response:y};let R=await y.text();try{R=JSON.parse(R)}catch{}return{error:R,response:y}}return{async GET(u,c){return a(u,{...c,method:"GET"})},async PUT(u,c){return a(u,{...c,method:"PUT"})},async POST(u,c){return a(u,{...c,method:"POST"})},async DELETE(u,c){return a(u,{...c,method:"DELETE"})},async OPTIONS(u,c){return a(u,{...c,method:"OPTIONS"})},async HEAD(u,c){return a(u,{...c,method:"HEAD"})},async PATCH(u,c){return a(u,{...c,method:"PATCH"})},async TRACE(u,c){return a(u,{...c,method:"TRACE"})},use(...u){for(let c of u)if(c){if(typeof c!="object"||!("onRequest"in c||"onResponse"in c))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");l.push(c)}},eject(...u){for(let c of u){let d=l.indexOf(c);d!==-1&&l.splice(d,1)}}}}function Kt(s,e,t){if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${s}=${t?.allowReserved===!0?e:encodeURIComponent(e)}`}function mo(s,e,t){if(!e||typeof e!="object")return"";let r=[],n={simple:",",label:".",matrix:";"}[t.style]||"&";if(t.style!=="deepObject"&&t.explode===!1){for(let l in e)r.push(l,t.allowReserved===!0?e[l]:encodeURIComponent(e[l]));let i=r.join(",");switch(t.style){case"form":return`${s}=${i}`;case"label":return`.${i}`;case"matrix":return`;${s}=${i}`;default:return i}}for(let i in e){let l=t.style==="deepObject"?`${s}[${i}]`:i;r.push(Kt(l,e[i],t))}let o=r.join(n);return t.style==="label"||t.style==="matrix"?`${n}${o}`:o}function go(s,e,t){if(!Array.isArray(e))return"";if(t.explode===!1){let o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",i=(t.allowReserved===!0?e:e.map(l=>encodeURIComponent(l))).join(o);switch(t.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${s}=${i}`;default:return`${s}=${i}`}}let r={simple:",",label:".",matrix:";"}[t.style]||"&",n=[];for(let o of e)t.style==="simple"||t.style==="label"?n.push(t.allowReserved===!0?o:encodeURIComponent(o)):n.push(Kt(s,o,t));return t.style==="label"||t.style==="matrix"?`${r}${n.join(r)}`:n.join(r)}function fo(s){return function(t){let r=[];if(t&&typeof t=="object")for(let n in t){let o=t[n];if(o!=null){if(Array.isArray(o)){r.push(go(n,o,{style:"form",explode:!0,...s?.array,allowReserved:s?.allowReserved||!1}));continue}if(typeof o=="object"){r.push(mo(n,o,{style:"deepObject",explode:!0,...s?.object,allowReserved:s?.allowReserved||!1}));continue}r.push(Kt(n,o,s))}}return r.join("&")}}function Jl(s,e){let t=s;for(let r of s.match(Kl)??[]){let n=r.substring(1,r.length-1),o=!1,i="simple";if(n.endsWith("*")&&(o=!0,n=n.substring(0,n.length-1)),n.startsWith(".")?(i="label",n=n.substring(1)):n.startsWith(";")&&(i="matrix",n=n.substring(1)),!e||e[n]===void 0||e[n]===null)continue;let l=e[n];if(Array.isArray(l)){t=t.replace(r,go(n,l,{style:i,explode:o}));continue}if(typeof l=="object"){t=t.replace(r,mo(n,l,{style:i,explode:o}));continue}if(i==="matrix"){t=t.replace(r,`;${Kt(n,l)}`);continue}t=t.replace(r,i==="label"?`.${l}`:l)}return t}function Zl(s){return JSON.stringify(s)}function Xl(s,e){let t=`${e.baseUrl}${s}`;e.params?.path&&(t=Jl(t,e.params.path));let r=e.querySerializer(e.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(t+=`?${r}`),t}function po(...s){let e=new Headers;for(let t of s){if(!t||typeof t!="object")continue;let r=t instanceof Headers?t.entries():Object.entries(t);for(let[n,o]of r)if(o===null)e.delete(n);else if(Array.isArray(o))for(let i of o)e.append(n,i);else o!==void 0&&e.set(n,o)}return e}var we=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(we||{}),mt=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(mt||{}),cs=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(cs||{});var ql="Adora.URLChange",yo="Adora.Cohort",Ql="Adora.AddCohort",eu="Adora.Click";var ds=["onclick","ondblclick","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onchange","onfocus","onblur","onscroll","onselect","onsubmit","onkeydown","onkeypress","onkeyup","onload","onunload"];function wo({dom0EventHandlers:s,delay:e,timestamp:t}){return{type:we.Custom,data:{tag:eu,payload:{dom0EventHandlers:s}},delay:e,timestamp:t}}function gt({payload:s,delay:e,timestamp:t}){return{type:we.Custom,data:{tag:Ql,payload:s},delay:e,timestamp:t}}function So({href:s,delay:e,timestamp:t}){return{type:we.Custom,data:{tag:ql,payload:{href:s}},delay:e,timestamp:t}}function he(s){throw new Error(`This code path should be unreachable: ${s}`)}var cu=require("uuidv7");var gg=1e3*60*30;var yg=10080*60*1e3;var Co="https://c.adora-cdn.com";var Oe=class{constructor(e){fe(this,"backendClient");fe(this,"eventPostBackendClient");this.backendClient=fs({baseUrl:e??Co})}getOrCreateEventPostClient(e){return!e.eventPostUrl||!e.eventPostToken?{path:e.sessionId,client:this.backendClient}:(this.eventPostBackendClient||(this.eventPostBackendClient=fs({baseUrl:e.eventPostUrl})),{path:e.sessionId,client:this.eventPostBackendClient})}async sessionPreload({orgId:e}){return this.backendClient.POST("/sessions/preload",{body:{orgId:e},mode:"cors"}).catch(()=>{})}async startSession({bypassSampling:e,orgId:t,language:r,domain:n,userCohorts:o,uid:i,devicePixelRatio:l,adoraUserId:a,userAgent:u,documentReferrer:c,snippetVersion:d}){return this.backendClient.POST("/sessions/start",{body:{bypassSampling:e,orgId:t,language:r,domain:n,devicePixelRatio:l,userCohorts:o||{},userAgent:u,uid:typeof i=="number"?i.toString():i!=="null"&&i!=="undefined"?i:void 0,adoraUserId:a,documentReferrer:c,snippetVersion:d},mode:"cors"}).catch(()=>{})}async gzipWithCompressionStream(e){let t=JSON.stringify(e),n=new TextEncoder().encode(t),o=new CompressionStream("gzip"),l=new ReadableStream({start(u){u.enqueue(n),u.close()}}).pipeThrough(o);return new Response(l).arrayBuffer()}async saveSessionEvents({sessionId:e,events:t,metadata:r,eventPostUrl:n,eventPostToken:o,fastpathToken:i}){let{path:l,client:a}=this.getOrCreateEventPostClient({sessionId:e,eventPostToken:o,eventPostUrl:n}),u={events:t.slice(),metadata:r,fastpathToken:i},c={params:{path:{sessionId:l}},headers:o?{token:o}:void 0};if(typeof CompressionStream<"u"){let d=await this.gzipWithCompressionStream(u);return a.POSTGzipped("/sessions/{sessionId}/events",{...c,body:d}).catch(()=>{})}return a.POST("/sessions/{sessionId}/events",{...c,body:u}).catch(()=>{})}async refreshEventToken(e){return await this.backendClient.POST("/sessions/{sessionId}/events/token",{params:{path:{sessionId:e.sessionId}},body:{},mode:"cors"}).catch(()=>{})}async syncSession(e){return await this.backendClient.POST("/sessions/{sessionId}/sync",{params:{path:{sessionId:e.sessionId}}}).catch(()=>{})}};var Jt=require("minimatch");function fu(s){return s.endsWith("$")&&(s=s.substring(0,s.length-1)),(s.endsWith("+?")||s.endsWith("*?"))&&(s=s.substring(0,s.length-1)),s}function Ze(s,e){let t=e.replace||e.path;switch(e.type){case"regexp":{let r=(e.path.startsWith("^")?"":"^")+e.path+(!e.path.endsWith("$")&&!e.partial?"$":""),n=new RegExp(r);return n.test(s)?e.partial?s.replace(n,t):t:void 0}case"wildcard":case void 0:if(e.partial){let r=(0,Jt.makeRe)(e.path,{partial:e.partial,dot:!0});if(!r)throw new Error("unable to make regexp");let n=new RegExp(fu(r.source));return n.test(s)?s.replace(n,t):void 0}return(0,Jt.minimatch)(s,e.path,{dot:!0})?t:void 0;default:he(e.type)}}var ps;(function(s){s.GOAL_SURVEY_FINISHED="goal_survey_finished",s.WELCOME_DIALOG_FINISHED="welcome_dialog_finished"})(ps||(ps={}));var ms;(function(s){s.EXPLORE_AND_VISUALIZE="Explore and visualize",s.MEASURE_AND_OPTIMIZE="Measure and optimize",s.IDENTIFY_FRICTION="Identify friction",s.DIAGNOSE_ISSUES="Diagnose issues"})(ms||(ms={}));var gs;(function(s){s.SKIPPED="skipped",s.COMPLETED="completed"})(gs||(gs={}));var ys;(function(s){s.NONE="none",s.NEW_USER_GOAL_SURVEY="new_user_goal_survey",s.EXISTING_USER_WELCOME_DIALOG="existing_user_welcome_dialog"})(ys||(ys={}));var fs=s=>({...us(s),POSTGzipped:async(t,r)=>{if(!r?.body)throw new Error("Body is required for gzipped requests");let n={...r.headers,"Content-Type":"application/json","Content-Encoding":"gzip"},o=t;r.params?.path&&Object.entries(r.params.path).forEach(([a,u])=>{o=o.replace(`{${a}}`,u)});let i=await fetch(`${s.baseUrl}${o}`,{method:"POST",headers:n,body:r.body});if(!i.ok){let a=await i.text();try{a=JSON.parse(a)}catch{}return{data:void 0,error:a,response:i}}return{data:await i.json(),error:void 0,response:i}}});var Ll=require("fast-equals"),Yt=ho(require("js-cookie"),1),Fl=require("uuidv7");var Zt=class{constructor(e,t){this.storage=t;this.eventStorageKey=e==="adoraSessionScript"?"adoraEventsScript":"adoraEventsExtension"}getEvents(){let e=this.storage.getItem(this.eventStorageKey);return e?JSON.parse(e):null}setEvents(e){this.storage.setItem(this.eventStorageKey,JSON.stringify(e))}removeEvents(){this.storage.removeItem(this.eventStorageKey)}};function ws(s){return`${s}-rate-limit-timestamp`}var Le=class{constructor(e,t){this.sessionType=e;this.storage=t}get lastRateLimitedTimestamp(){let e=this.storage.getItem(ws(this.sessionType));if(pu(e))return e}clearLastRateLimitedTimestamp(){this.storage.removeItem(ws(this.sessionType))}setLastRateLimitedTimestamp(e){this.storage.setItem(ws(this.sessionType),e.toString())}getSession(){let e=this.storage.getItem(this.sessionType);return e?JSON.parse(e):null}setSession(e){this.storage.setItem(this.sessionType,JSON.stringify(e))}removeSession(){this.storage.removeItem(this.sessionType)}};function pu(s){return!isNaN(Number(s))}function b(s,...e){(typeof window=="object"&&window.enableAdoraDebugLogs||typeof window=="object"&&window.localStorage.getItem("enableAdoraDebugLogs"))&&console.log(s,...e)}var De=class{getItem(e){if(!Ss())return null;try{return window.sessionStorage.getItem(e)}catch{return null}}setItem(e,t){if(!Ss())return null;try{return window.sessionStorage.setItem(e,t)}catch{return null}}removeItem(e){if(!Ss())return null;try{return window.sessionStorage.removeItem(e)}catch{return null}}};function Ss(){return typeof window.sessionStorage=="object"}var Xt="v0.0.1";var bo=async(s,e,t)=>{let r=new Le(s,new De),n=new Oe(t.backendUrl),o=await mu(n,t,e);return o.type==="success"&&r.setSession(o.storedSession),o};async function mu(s,e,t){try{b("starting session over network",{uid:e.uid,userCohorts:e.userCohorts||{}});let r=await s.startSession({bypassSampling:e.bypassSampling,orgId:e.orgId,language:e.language||navigator.language,domain:new URL(window.location.href).hostname,userCohorts:e.userCohorts||{},uid:e.uid,devicePixelRatio:window.devicePixelRatio,adoraUserId:t,documentReferrer:document.referrer,snippetVersion:Xt});if(!r)return{type:"error",code:void 0};if(r.error)return{type:"error",code:r.error.code};if(r.response.status!==201)return b("session not created, aborting"),{type:"error",code:"code"in r.data?r.data.code:void 0};if(r.data&&"scheduledDowntime"in r.data)return b("scheduled downtime, exiting"),{type:"error",code:void 0};if(!r.data||!("session"in r.data))return b("malformed session, exiting"),{type:"error",code:void 0};let{session:n,organization:o,eventPostUrl:i,eventPostToken:l}=r.data;return{type:"success",storedSession:{id:n.id,createdAt:n.createdAt,status:n.status,lastSyncedAt:n.lastSyncedAt,domain:n.domain,requestIp:n.requestIp,country:n.country,userAgent:n.userAgent,language:n.language,initialUserCohorts:n.initialUserCohorts,devicePixelRatio:n.devicePixelRatio,organization:o,documentReferrer:n.documentReferrer,canvasRecordingEnabled:n.canvasRecordingEnabled||!1,adoraUserId:t,settings:e,eventPostUrl:i,eventPostToken:l,limitedCanvasRecording:n.limitedCanvasRecording||!1,compressionType:n.compressionType}}}catch{return{type:"error",code:void 0}}}var ht=ho(require("web-vitals"),1);var Eo="__STATSIG__",gu="statsig@@",Ro=s=>{try{if(!s[Eo])return;let e=s[Eo];if(!wu(e))return;let t={};return Object.values(e.instances).forEach(r=>{r._logger?._lastExposureTimeMap&&Object.keys(r._logger?._lastExposureTimeMap).forEach(n=>{let o=yu(n);if(!o)return;let i=r.getExperiment(o);Cu(i)&&(t[gu+i.name]=i.groupName)})}),t}catch{return}},yu=s=>{let e=s.split("|");if(e.length>3)return e[3]};function wu(s){if(!s||typeof s!="object"||!("instances"in s)||typeof s.instances!="object"||!s.instances)return!1;let e=Object.values(s.instances);for(let t of e)if(!Su(t))return!1;return!0}function Su(s){return!s||typeof s!="object"?!1:"_logger"in s&&typeof s._logger=="object"&&vu(s._logger)&&"_sdkKey"in s&&typeof s._sdkKey=="string"&&"getExperiment"in s&&typeof s.getExperiment=="function"}function vu(s){return!s||typeof s!="object"?!1:"_lastExposureTimeMap"in s&&typeof s._lastExposureTimeMap=="object"}function Cu(s){return!s||typeof s!="object"?!1:"name"in s&&typeof s.name=="string"&&"groupName"in s&&typeof s.groupName=="string"}function qt(s,e){if(!e.windowGetters)return;let t={};if(e.windowGetters.forEach(({key:r,paths:n})=>{let o=bu(s,n);o&&(t[r]=o)}),Object.keys(t).length!==0)return t}function bu(s,e){if(typeof s>"u")return;let t=s;for(let n=0;n<e.length-1;n++)if(t=t[e[n]],typeof t!="object")return;let r=t[e[e.length-1]];if(typeof r=="string")return r;if(typeof r=="boolean"||typeof r=="number")return r.toString()}function vs(s){return Ro(s)}var Eu=Object.defineProperty,Ru=(s,e,t)=>e in s?Eu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,C=(s,e,t)=>Ru(s,typeof e!="symbol"?e+"":e,t),Io,Iu=Object.defineProperty,xu=(s,e,t)=>e in s?Iu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,xo=(s,e,t)=>xu(s,typeof e!="symbol"?e+"":e,t),q=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(q||{}),Ao={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},_o={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Qt={};function xn(s){if(Qt[s])return Qt[s];let e=globalThis[s],t=e.prototype,r=s in Ao?Ao[s]:void 0,n=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),o=s in _o?_o[s]:void 0,i=!!(o&&o.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(n&&i)return Qt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Qt[s]=u:t}catch{return t}}var Cs={};function Ue(s,e,t){var r;let n=`${s}.${String(t)}`;if(Cs[n])return Cs[n].call(e);let o=xn(s),i=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return i?(Cs[n]=i,i.call(e)):e[t]}var bs={};function Ei(s,e,t){let r=`${s}.${String(t)}`;if(bs[r])return bs[r].bind(e);let o=xn(s)[t];return typeof o!="function"?e[t]:(bs[r]=o,o.bind(e))}function Au(s){return Ue("Node",s,"childNodes")}function _u(s){return Ue("Node",s,"parentNode")}function Ou(s){return Ue("Node",s,"parentElement")}function Du(s){return Ue("Node",s,"textContent")}function Tu(s,e){return Ei("Node",s,"contains")(e)}function Nu(s){return Ei("Node",s,"getRootNode")()}function Mu(s){return!s||!("host"in s)?null:Ue("ShadowRoot",s,"host")}function ku(s){return s.styleSheets}function Pu(s){return!s||!("shadowRoot"in s)?null:Ue("Element",s,"shadowRoot")}function $u(s,e){return Ue("Element",s,"querySelector")(e)}function Lu(s,e){return Ue("Element",s,"querySelectorAll")(e)}function Fu(){return xn("MutationObserver").constructor}var ne={childNodes:Au,parentNode:_u,parentElement:Ou,textContent:Du,contains:Tu,getRootNode:Nu,host:Mu,styleSheets:ku,shadowRoot:Pu,querySelector:$u,querySelectorAll:Lu,mutationObserver:Fu};function Ri(s){return s.nodeType===s.ELEMENT_NODE}function bt(s){let e=s&&"host"in s&&"mode"in s&&ne.host(s)||null;return!!(e&&"shadowRoot"in e&&ne.shadowRoot(e)===s)}function Et(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function Uu(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function zu(s){let{cssText:e}=s;if(e.split('"').length<3)return e;let t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function $s(s){try{let e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);let r=Array.from(e,n=>Ii(n,t)).join("");return Uu(r)}catch{return null}}function Ii(s,e){if(Bu(s)){let t;try{t=$s(s.styleSheet)||zu(s)}catch{t=s.cssText}return s.styleSheet.href?Or(t,s.styleSheet.href):t}else{let t=s.cssText;return Wu(s)&&s.selectorText.includes(":")&&(t=Hu(t)),e?Or(t,e):t}}function Hu(s){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function Bu(s){return"styleSheet"in s}function Wu(s){return"selectorText"in s}var Ar=class{constructor(){xo(this,"idNodeMap",new Map),xo(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-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){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Vu(){return new Ar}function _r({element:s,maskInputOptions:e,tagName:t,type:r,value:n,maskInputFn:o}){let i=n||"",l=r&&Be(r);return(e[t.toLowerCase()]||l&&e[l])&&(o?i=o(i,s):i="*".repeat(i.length)),i}function Be(s){return s.toLowerCase()}var Oo="__rrweb_original__";function Yu(s){let e=s.getContext("2d");if(!e)return!0;let t=50;for(let r=0;r<s.width;r+=t)for(let n=0;n<s.height;n+=t){let o=e.getImageData,i=Oo in o?o[Oo]:o;if(new Uint32Array(i.call(e,r,n,Math.min(t,s.width-r),Math.min(t,s.height-n)).data.buffer).some(a=>a!==0))return!1}return!0}function An(s){let e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Be(e):null}function xi(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,n=t.pathname.match(r);return n?.[1]??null}function Gu(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}var ju=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ku=/^(?:[a-z+]+:)?\/\//i,Ju=/^www\..*/i,Zu=/^(data:)([^,]*),(.*)/i;function Or(s,e){return(s||"").replace(ju,(t,r,n,o,i,l)=>{let a=n||i||l,u=r||o||"";if(!a)return t;if(Ku.test(a)||Ju.test(a))return`url(${u}${a}${u})`;if(Zu.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${Gu(e)+a}${u})`;let c=e.split("/"),d=a.split("/");c.pop();for(let p of d)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Es(s){return s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Xu(s,e){let t=Array.from(e.childNodes),r=[];if(t.length>1&&s&&typeof s=="string"){let n=Es(s);for(let o=1;o<t.length;o++)if(t[o].textContent&&typeof t[o].textContent=="string"){let i=Es(t[o].textContent);for(let l=3;l<i.length;l++){let a=i.substring(0,l);if(n.split(a).length===2){let u=n.indexOf(a);for(let c=u;c<s.length;c++)if(Es(s.substring(0,c)).length===u){r.push(s.substring(0,c)),s=s.substring(c);break}break}}}}return r.push(s),r}function qu(s,e){return Xu(s,e).join("/* rr_split */")}var Qu=1,ec=new RegExp("[^a-z0-9-_:]"),It=-2;function Ai(){return Qu++}function tc(s){if(s instanceof HTMLFormElement)return"form";let e=Be(s.tagName);return ec.test(e)?"div":e}var Xe,Do,rc=/^[^ \t\n\r\u000c]+/,sc=/^[, \t\n\r\u000c]+/;function nc(s,e){if(e.trim()==="")return e;let t=0;function r(o){let i,l=o.exec(e.substring(t));return l?(i=l[0],t+=i.length,i):""}let n=[];for(;r(sc),!(t>=e.length);){let o=r(rc);if(o.slice(-1)===",")o=et(s,o.substring(0,o.length-1)),n.push(o);else{let i="";o=et(s,o);let l=!1;for(;;){let a=e.charAt(t);if(a===""){n.push((o+i).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,n.push((o+i).trim());break}else a==="("&&(l=!0);i+=a,t+=1}}}return n.join(", ")}var To=new WeakMap;function et(s,e){return!e||e.trim()===""?e:_n(s,e)}function oc(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function _n(s,e){let t=To.get(s);if(t||(t=s.createElement("a"),To.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function _i(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?et(s,r):t==="srcset"?nc(s,r):t==="style"?Or(r,_n(s)):e==="object"&&t==="data"?et(s,r):r)}function Oi(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function ic(s,e,t,r){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let n=s.classList.length;n--;){let o=s.classList[n];if(e.test(o))return!0}if(t)return s.matches(t);if(r&&s.tagName==="IMG"){let n=s.getAttribute("src");if(n&&r.test(n))return!0}}catch{}return!1}function Dr(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?Dr(ne.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){let n=s.classList[r];if(e.test(n))return!0}return t?Dr(ne.parentNode(s),e,t):!1}function Di(s,e,t,r){let n;if(Ri(s)){if(n=s,!ne.childNodes(n).length)return!1}else{if(ne.parentElement(s)===null)return!1;n=ne.parentElement(s)}try{if(typeof e=="string"){if(r){if(n.closest(`.${e}`))return!0}else if(n.classList.contains(e))return!0}else if(Dr(n,e,r))return!0;if(t){if(r){if(n.closest(t))return!0}else if(n.matches(t))return!0}if(n.getAttribute("contenteditable")||n.closest('[contenteditable="true"]'))return!0}catch{}return!1}function ac(s,e,t){let r=s.contentWindow;if(!r)return;let n=!1,o;try{o=r.document.readyState}catch{return}if(o!=="complete"){let l=setTimeout(()=>{n||(e(),n=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),n=!0,e()});return}let i="about:blank";if(r.location.href!==i||s.src===i||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function lc(s,e,t){let r=!1,n;try{n=s.sheet}catch{return}if(n)return;let o=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(o),r=!0,e()})}function uc(s,e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,maskAnchorHrefFn:d,blockImgSrcPattern:p,blockImgSrcFillOptions:m,dataURLOptions:g={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:E,newlyAddedElement:S=!1,cssCaptured:w=!1}=e,I=cc(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:q.Document,childNodes:[],compatMode:s.compatMode}:{type:q.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:q.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:I};case s.ELEMENT_NODE:return hc(s,{doc:t,blockClass:n,blockSelector:o,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,maskAnchorHrefFn:d,blockImgSrcPattern:p,blockImgSrcFillOptions:m,dataURLOptions:g,inlineImages:f,recordCanvas:h,keepIframeSrcFn:E,newlyAddedElement:S,rootId:I});case s.TEXT_NODE:return dc(s,{doc:t,needsMask:i,maskTextFn:u,rootId:I,cssCaptured:w});case s.CDATA_SECTION_NODE:return{type:q.CDATA,textContent:"",rootId:I};case s.COMMENT_NODE:return{type:q.Comment,textContent:ne.textContent(s)||"",rootId:I};default:return!1}}function cc(s,e){if(!e.hasNode(s))return;let t=e.getId(s);return t===1?void 0:t}function dc(s,e){let{needsMask:t,maskTextFn:r,rootId:n,cssCaptured:o}=e,i=ne.parentNode(s),l=i&&i.tagName,a="",u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":o||(a=ne.textContent(s),u&&a&&(a=Or(a,_n(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,ne.parentElement(s)):a.replace(/[\S]/g,"*")),{type:q.Text,textContent:a||"",rootId:n}}function hc(s,e){let{doc:t,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:l,maskAnchorHrefFn:a,blockImgSrcPattern:u,blockImgSrcFillOptions:c,dataURLOptions:d={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:f=!1,rootId:h}=e,E=ic(s,r,n,u),S=tc(s),w={},I=s.attributes.length;for(let y=0;y<I;y++){let R=s.attributes[y];Oi(S,R.name,R.value)||(w[R.name]=_i(t,S,Be(R.name),R.value))}if(S==="a"&&a&&typeof w.href=="string"&&(w.href=a(w.href,s)),S==="link"&&o){let y=Array.from(t.styleSheets).find(v=>v.href===s.href);if(!y&&s.href.includes(".css")){let v=window.location.origin,x=s.href.replace(window.location.href,""),O=v+"/"+x;y=Array.from(t.styleSheets).find(le=>le.href===O)}let R=null;y&&(R=$s(y)),R&&(delete w.rel,delete w.href,w._cssText=R)}if(S==="style"&&s.sheet){let y=$s(s.sheet);y&&(s.childNodes.length>1&&(y=qu(y,s)),w._cssText=y)}if(S==="input"||S==="textarea"||S==="select"){let y=s.value,R=s.checked;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&y?w.value=_r({element:s,type:An(s),tagName:S,value:y,maskInputOptions:i,maskInputFn:l}):R&&(w.checked=R)}if(S==="option"&&(s.selected&&!i.select?w.selected=!0:delete w.selected),S==="dialog"&&s.open&&(w.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),S==="canvas"&&m){if(s.__context==="2d")Yu(s)||(w.rr_dataURL=s.toDataURL(d.type,d.quality));else if(!("__context"in s)){let y=s.toDataURL(d.type,d.quality),R=t.createElement("canvas");R.width=s.width,R.height=s.height;let v=R.toDataURL(d.type,d.quality);y!==v&&(w.rr_dataURL=y)}}if(S==="img"&&p){Xe||(Xe=t.createElement("canvas"),Do=Xe.getContext("2d"));let y=s,R=y.currentSrc||y.getAttribute("src")||"<unknown-src>",v=y.crossOrigin,x=()=>{y.removeEventListener("load",x);try{Xe.width=y.naturalWidth,Xe.height=y.naturalHeight,Do.drawImage(y,0,0),w.rr_dataURL=Xe.toDataURL(d.type,d.quality)}catch(O){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?x():y.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${R}! Error: ${O}`)}y.crossOrigin==="anonymous"&&(v?w.crossOrigin=v:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?x():y.addEventListener("load",x)}if(S==="audio"||S==="video"){let y=w;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(f||(s.scrollLeft&&(w.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(w.rr_scrollTop=s.scrollTop)),E){let{width:y,height:R}=s.getBoundingClientRect();w={class:w.class,rr_width:`${y}px`,rr_height:`${R}px`}}E&&S==="img"&&(w={...w,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP89v3nfwAJuAPnyTr4jAAAAABJRU5ErkJggg==",rr_fill:c.backgroundColor,rr_stroke:c.strokeColor,rr_stroke_width:c.strokeWidth}),S==="iframe"&&!g(w.src)&&(s.contentDocument||(w.rr_src=w.src),delete w.src);let _;try{customElements.get(S)&&(_=!0)}catch{}return{type:q.Element,tagName:S,attributes:w,childNodes:[],isSVG:oc(s)||void 0,needBlock:E,rootId:h,isCustom:_}}function z(s){return s==null?"":s.toLowerCase()}function fc(s,e){if(e.comment&&s.type===q.Comment)return!0;if(s.type===q.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&xi(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(z(s.attributes.name).match(/^msapplication-tile(image|color)$/)||z(s.attributes.name)==="application-name"||z(s.attributes.rel)==="icon"||z(s.attributes.rel)==="apple-touch-icon"||z(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&z(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(z(s.attributes.property).match(/^(og|twitter|fb):/)||z(s.attributes.name).match(/^(og|twitter):/)||z(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(z(s.attributes.name)==="robots"||z(s.attributes.name)==="googlebot"||z(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(z(s.attributes.name)==="author"||z(s.attributes.name)==="generator"||z(s.attributes.name)==="framework"||z(s.attributes.name)==="publisher"||z(s.attributes.name)==="progid"||z(s.attributes.property).match(/^article:/)||z(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(z(s.attributes.name)==="google-site-verification"||z(s.attributes.name)==="yandex-verification"||z(s.attributes.name)==="csrf-token"||z(s.attributes.name)==="p:domain_verify"||z(s.attributes.name)==="verify-v1"||z(s.attributes.name)==="verification"||z(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function tt(s,e){if(s.nodeName.toLowerCase().includes("grammarly"))return null;let{doc:t,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E={},inlineImages:S=!1,recordCanvas:w=!1,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y=5e3,onStylesheetLoad:R,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:O=!1,cssCaptured:le=!1}=e,{needsMask:Y}=e,{preserveWhiteSpace:ue=!0}=e;Y||(Y=Di(s,i,l,Y===void 0));let X=uc(s,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,dataURLOptions:E,inlineImages:S,recordCanvas:w,keepIframeSrcFn:x,newlyAddedElement:O,cssCaptured:le});if(!X)return console.warn(s,"not serialized"),null;let j;r.hasNode(s)?j=r.getId(s):fc(X,h)||!ue&&X.type===q.Text&&!X.textContent.replace(/^\s+|\s+$/gm,"").length?j=It:j=Ai();let A=Object.assign(X,{id:j});if(r.add(s,A),j===It)return null;I&&I(s);let G=!a;if(A.type===q.Element){G=G&&!A.needBlock,delete A.needBlock;let F=ne.shadowRoot(s);F&&Et(F)&&(A.isShadowHost=!0)}if((A.type===q.Document||A.type===q.Element)&&G){h.headWhitespace&&A.type===q.Element&&A.tagName==="head"&&(ue=!1);let F={doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ue,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x,cssCaptured:!1};if(!(A.type===q.Element&&A.tagName==="textarea"&&A.attributes.value!==void 0)){A.type===q.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText=="string"&&(F.cssCaptured=!0);for(let Q of Array.from(ne.childNodes(s))){let re=tt(Q,F);re&&A.childNodes.push(re)}}let te=null;if(Ri(s)&&(te=ne.shadowRoot(s)))for(let Q of Array.from(ne.childNodes(te))){let re=tt(Q,F);re&&(Et(te)&&(re.isShadow=!0),A.childNodes.push(re))}}let ee=ne.parentNode(s);return ee&&bt(ee)&&Et(ee)&&(A.isShadow=!0),A.type===q.Element&&A.tagName==="iframe"&&ac(s,()=>{let F=s.contentDocument;if(F&&_){let te=tt(F,{doc:F,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ue,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x});te&&_(s,te)}},y),A.type===q.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&xi(A.attributes.href)==="css")&&lc(s,()=>{if(R){let F=tt(s,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:Y,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h,dataURLOptions:E,inlineImages:S,recordCanvas:w,preserveWhiteSpace:ue,onSerialize:I,onIframeLoad:_,iframeLoadTimeout:y,onStylesheetLoad:R,stylesheetLoadTimeout:v,keepIframeSrcFn:x});F&&R(s,F)}},v),A}function pc(s,e){let{mirror:t=new Ar,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g=null,blockImgSrcFillOptions:f={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},slimDOM:h=!1,dataURLOptions:E,preserveWhiteSpace:S,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:R,keepIframeSrcFn:v=()=>!1}=e||{};return tt(s,{doc:s,mirror:t,blockClass:r,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:l,maskInputOptions:c===!0?{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}:c===!1?{password:!0}:c,maskTextFn:d,maskInputFn:p,maskAnchorHrefFn:m,blockImgSrcPattern:g,blockImgSrcFillOptions:f,slimDOMOptions:h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:h==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:h===!1?{}:h,dataURLOptions:E,inlineImages:a,recordCanvas:u,preserveWhiteSpace:S,onSerialize:w,onIframeLoad:I,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:R,keepIframeSrcFn:v,newlyAddedElement:!1})}function mc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function gc(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var On={exports:{}},H=String,Ti=function(){return{isColorSupported:!1,reset:H,bold:H,dim:H,italic:H,underline:H,inverse:H,hidden:H,strikethrough:H,black:H,red:H,green:H,yellow:H,blue:H,magenta:H,cyan:H,white:H,gray:H,bgBlack:H,bgRed:H,bgGreen:H,bgYellow:H,bgBlue:H,bgMagenta:H,bgCyan:H,bgWhite:H}};On.exports=Ti();On.exports.createColors=Ti;var yc=On.exports,wc={},Sc=Object.freeze(Object.defineProperty({__proto__:null,default:wc},Symbol.toStringTag,{value:"Module"})),ve=gc(Sc),No=yc,Mo=ve,Ls=class Ni extends Error{constructor(e,t,r,n,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ni)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=No.isColorSupported),Mo&&e&&(t=Mo(t));let r=t.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),i=String(o).length,l,a;if(e){let{bold:u,gray:c,red:d}=No.createColors(!0);l=p=>u(d(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(n,o).map((u,c)=>{let d=n+1+c,p=" "+(" "+d).slice(-i)+" | ";if(d===this.line){let m=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
|
|
2
|
-
`+m+l("^")}return" "+a(p)+u}).join(`
|
|
3
|
-
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
4
|
-
|
|
5
|
-
`+e+`
|
|
6
|
-
`),this.name+": "+this.message+e}},Dn=Ls;Ls.default=Ls;var Pt={};Pt.isClean=Symbol("isClean");Pt.my=Symbol("my");var ko={after:`
|
|
7
|
-
`,beforeClose:`
|
|
8
|
-
`,beforeComment:`
|
|
9
|
-
`,beforeDecl:`
|
|
10
|
-
`,beforeOpen:" ",beforeRule:`
|
|
11
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function vc(s){return s[0].toUpperCase()+s.slice(1)}var Fs=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+n+o,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let n=e.parent,o=0;for(;n&&n.type!=="root";)o+=1,n=n.parent;if(r.includes(`
|
|
12
|
-
`)){let i=this.raw(e,null,"indent");if(i.length)for(let l=0;l<o;l++)r+=i}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],typeof n<"u"))return n;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return ko[r];let i=e.root();if(i.rawCache||(i.rawCache={}),typeof i.rawCache[r]<"u")return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+vc(r);this[l]?n=this[l](i,e):i.walk(a=>{if(n=a.raws[t],typeof n<"u")return!1})}return typeof n>"u"&&(n=ko[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
|
|
13
|
-
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
14
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
15
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
|
|
16
|
-
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
17
|
-
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},Mi=Fs;Fs.default=Fs;var Cc=Mi;function Us(s,e){new Cc(e).stringify(s)}var Wr=Us;Us.default=Us;var{isClean:er,my:bc}=Pt,Ec=Dn,Rc=Mi,Ic=Wr;function zs(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let n=s[r],o=typeof n;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=n:Array.isArray(n)?t[r]=n.map(i=>zs(i,t)):(o==="object"&&n!==null&&(n=zs(n)),t[r]=n)}return t}var Hs=class{constructor(e={}){this.raws={},this[er]=!1,this[bc]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=zs(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new Ec(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[er]){this[er]=!1;let e=this;for(;e=e.parent;)e[er]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let n=t.indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,o=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
|
|
18
|
-
`?(n=1,o+=1):n+=1;return{column:n,line:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),o=n.indexOf(e.word);o!==-1&&(t=this.positionInside(o,n),r=this.positionInside(o+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Rc().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},n=t==null;t=t||new Map;let o=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let l=this[i];if(Array.isArray(l))r[i]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[i]=l.toJSON(null,t);else if(i==="source"){let a=t.get(l.input);a==null&&(a=o,t.set(l.input,o),o++),r[i]={end:l.end,inputId:a,start:l.start}}else r[i]=l}return n&&(r.inputs=[...t.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ic){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let o in r)n[o]=r[o];return e.warn(t,n)}get proxyOf(){return this}},Vr=Hs;Hs.default=Hs;var xc=Vr,Bs=class extends xc{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},Yr=Bs;Bs.default=Bs;var Ac="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",_c=(s,e=21)=>(t=e)=>{let r="",n=t;for(;n--;)r+=s[Math.random()*s.length|0];return r},Oc=(s=21)=>{let e="",t=s;for(;t--;)e+=Ac[Math.random()*64|0];return e},Dc={nanoid:Oc,customAlphabet:_c},{SourceMapConsumer:Po,SourceMapGenerator:$o}=ve,{existsSync:Tc,readFileSync:Nc}=ve,{dirname:Rs,join:Mc}=ve;function kc(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var Ws=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Rs(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Po(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(n.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return kc(e.substr(RegExp.lastMatch.length));let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Rs(e),Tc(e))return this.mapFile=e,Nc(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}else{if(t instanceof Po)return $o.fromSourceMap(t).toString();if(t instanceof $o)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Mc(Rs(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},ki=Ws;Ws.default=Ws;var{SourceMapConsumer:Pc,SourceMapGenerator:$c}=ve,{fileURLToPath:Lo,pathToFileURL:tr}=ve,{isAbsolute:Vs,resolve:Ys}=ve,{nanoid:Lc}=Dc,Is=ve,Fo=Dn,Fc=ki,xs=Symbol("fromOffsetCache"),Uc=!!(Pc&&$c),Uo=!!(Ys&&Vs),Tr=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Uo||/^\w+:\/\//.test(t.from)||Vs(t.from)?this.file=t.from:this.file=Ys(t.from)),Uo&&Uc){let r=new Fc(this.css,t);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+Lc(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let o,i,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);t=d.line,r=d.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);i=d.line,l=d.col}else i=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,i,l);return a?o=new Fo(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):o=new Fo(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:l,line:i},this.css,this.file,n.plugin),o.input={column:r,endColumn:l,endLine:i,line:t,source:this.css},this.file&&(tr&&(o.input.url=tr(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[xs])r=this[xs];else{let o=this.css.split(`
|
|
19
|
-
`);r=new Array(o.length);let i=0;for(let l=0,a=o.length;l<a;l++)r[l]=i,i+=o[l].length+1;this[xs]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let o=r.length-2,i;for(;n<o;)if(i=n+(o-n>>1),e<r[i])o=i-1;else if(e>=r[i+1])n=i+1;else{n=i;break}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ys(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let o=this.map.consumer(),i=o.originalPositionFor({column:t,line:e});if(!i.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:n,line:r}));let a;Vs(i.source)?a=tr(i.source):a=new URL(i.source,this.map.consumer().sourceRoot||tr(this.map.mapFile));let u={column:i.column,endColumn:l&&l.column,endLine:l&&l.line,line:i.line,url:a.toString()};if(a.protocol==="file:")if(Lo)u.file=Lo(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(i.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},Gr=Tr;Tr.default=Tr;Is&&Is.registerInput&&Is.registerInput(Tr);var{SourceMapConsumer:Pi,SourceMapGenerator:Cr}=ve,{dirname:br,relative:$i,resolve:Li,sep:Fi}=ve,{pathToFileURL:zo}=ve,zc=Gr,Hc=!!(Pi&&Cr),Bc=!!(br&&Li&&$i&&Fi),Wc=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
20
|
-
`;this.css.includes(`\r
|
|
21
|
-
`)&&(t=`\r
|
|
22
|
-
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||br(e.file),n;this.mapOpts.sourcesContent===!1?(n=new Pi(e.text),n.sourcesContent&&(n.sourcesContent=null)):n=e.consumer(),this.map.applySourceMap(n,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Bc&&Hc&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Cr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Cr({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Cr({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,i;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(n.generated.line=e,n.generated.column=t-1,a.source&&a.source.start?(n.source=this.sourcePath(a),n.original.line=a.source.start.line,n.original.column=a.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),o=l.match(/\n/g),o?(e+=o.length,i=l.lastIndexOf(`
|
|
23
|
-
`),t=l.length-i):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=e,n.generated.column=t-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=e,n.generated.column=t-1,this.map.addMapping(n)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?br(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=br(Li(r,this.mapOpts.annotation)));let n=$i(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new zc(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(zo){let r=zo(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Fi==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ui=Wc,Vc=Vr,Gs=class extends Vc{constructor(e){super(e),this.type="comment"}},jr=Gs;Gs.default=Gs;var{isClean:zi,my:Hi}=Pt,Bi=Yr,Wi=jr,Yc=Vr,Vi,Tn,Nn,Yi;function Gi(s){return s.map(e=>(e.nodes&&(e.nodes=Gi(e.nodes)),delete e.source,e))}function ji(s){if(s[zi]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)ji(e)}var Ne=class Ki extends Yc{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let n of r)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,n;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[t]+=1;return delete this.indexes[t],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(n=>typeof n=="function"?(o,i)=>n(o.toProxy(),i):n)):t==="every"||t==="some"?r=>e[t]((n,...o)=>r(n.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let i of n)this.proxyOf.nodes.splice(r+1,0,i);let o;for(let i in this.indexes)o=this.indexes[i],r<o&&(this.indexes[i]=o+n.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),n=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let i;for(let l in this.indexes)i=this.indexes[l],r<=i&&(this.indexes[l]=i+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Gi(Vi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Bi(e)]}else if(e.selector)e=[new Tn(e)];else if(e.name)e=[new Nn(e)];else if(e.text)e=[new Wi(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[Hi]||Ki.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[zi]&&ji(n),typeof n.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(o){throw t.addToError(o)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="atrule")return t(r,n)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="decl")return t(r,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="rule")return t(r,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ne.registerParse=s=>{Vi=s};Ne.registerRule=s=>{Tn=s};Ne.registerAtRule=s=>{Nn=s};Ne.registerRoot=s=>{Yi=s};var We=Ne;Ne.default=Ne;Ne.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Nn.prototype):s.type==="rule"?Object.setPrototypeOf(s,Tn.prototype):s.type==="decl"?Object.setPrototypeOf(s,Bi.prototype):s.type==="comment"?Object.setPrototypeOf(s,Wi.prototype):s.type==="root"&&Object.setPrototypeOf(s,Yi.prototype),s[Hi]=!0,s.nodes&&s.nodes.forEach(e=>{Ne.rebuild(e)})};var Gc=We,Ji,Zi,xt=class extends Gc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ji(new Zi,this,e).stringify()}};xt.registerLazyResult=s=>{Ji=s};xt.registerProcessor=s=>{Zi=s};var Mn=xt;xt.default=xt;var js=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Xi=js;js.default=js;var jc=Xi,Ks=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new jc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},kn=Ks;Ks.default=Ks;var As=39,Ho=34,rr=92,Bo=47,sr=10,yt=32,nr=12,or=9,ir=13,Kc=91,Jc=93,Zc=40,Xc=41,qc=123,Qc=125,ed=59,td=42,rd=58,sd=64,ar=/[\t\n\f\r "#'()/;[\\\]{}]/g,lr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,nd=/.[\r\n"'(/\\]/,Wo=/[\da-f]/i,od=function(e,t={}){let r=e.css.valueOf(),n=t.ignoreErrors,o,i,l,a,u,c,d,p,m,g,f=r.length,h=0,E=[],S=[];function w(){return h}function I(v){throw e.error("Unclosed "+v,h)}function _(){return S.length===0&&h>=f}function y(v){if(S.length)return S.pop();if(h>=f)return;let x=v?v.ignoreUnclosed:!1;switch(o=r.charCodeAt(h),o){case sr:case yt:case or:case ir:case nr:{i=h;do i+=1,o=r.charCodeAt(i);while(o===yt||o===sr||o===or||o===ir||o===nr);g=["space",r.slice(h,i)],h=i-1;break}case Kc:case Jc:case qc:case Qc:case rd:case ed:case Xc:{let O=String.fromCharCode(o);g=[O,O,h];break}case Zc:{if(p=E.length?E.pop()[1]:"",m=r.charCodeAt(h+1),p==="url"&&m!==As&&m!==Ho&&m!==yt&&m!==sr&&m!==or&&m!==nr&&m!==ir){i=h;do{if(c=!1,i=r.indexOf(")",i+1),i===-1)if(n||x){i=h;break}else I("bracket");for(d=i;r.charCodeAt(d-1)===rr;)d-=1,c=!c}while(c);g=["brackets",r.slice(h,i+1),h,i],h=i}else i=r.indexOf(")",h+1),a=r.slice(h,i+1),i===-1||nd.test(a)?g=["(","(",h]:(g=["brackets",a,h,i],h=i);break}case As:case Ho:{l=o===As?"'":'"',i=h;do{if(c=!1,i=r.indexOf(l,i+1),i===-1)if(n||x){i=h+1;break}else I("string");for(d=i;r.charCodeAt(d-1)===rr;)d-=1,c=!c}while(c);g=["string",r.slice(h,i+1),h,i],h=i;break}case sd:{ar.lastIndex=h+1,ar.test(r),ar.lastIndex===0?i=r.length-1:i=ar.lastIndex-2,g=["at-word",r.slice(h,i+1),h,i],h=i;break}case rr:{for(i=h,u=!0;r.charCodeAt(i+1)===rr;)i+=1,u=!u;if(o=r.charCodeAt(i+1),u&&o!==Bo&&o!==yt&&o!==sr&&o!==or&&o!==ir&&o!==nr&&(i+=1,Wo.test(r.charAt(i)))){for(;Wo.test(r.charAt(i+1));)i+=1;r.charCodeAt(i+1)===yt&&(i+=1)}g=["word",r.slice(h,i+1),h,i],h=i;break}default:{o===Bo&&r.charCodeAt(h+1)===td?(i=r.indexOf("*/",h+2)+1,i===0&&(n||x?i=r.length:I("comment")),g=["comment",r.slice(h,i+1),h,i],h=i):(lr.lastIndex=h+1,lr.test(r),lr.lastIndex===0?i=r.length-1:i=lr.lastIndex-2,g=["word",r.slice(h,i+1),h,i],E.push(g),h=i);break}}return h++,g}function R(v){S.push(v)}return{back:R,endOfFile:_,nextToken:y,position:w}},qi=We,Nr=class extends qi{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},Pn=Nr;Nr.default=Nr;qi.registerAtRule(Nr);var Qi=We,ea,ta,st=class extends Qi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of n)o.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new ea(new ta,this,e).stringify()}};st.registerLazyResult=s=>{ea=s};st.registerProcessor=s=>{ta=s};var $t=st;st.default=st;Qi.registerRoot(st);var At={comma(s){return At.split(s,[","],!0)},space(s){let e=[" ",`
|
|
24
|
-
`," "];return At.split(s,e)},split(s,e,t){let r=[],n="",o=!1,i=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?i+=1:c===")"?i>0&&(i-=1):i===0&&e.includes(c)&&(o=!0),o?(n!==""&&r.push(n.trim()),n="",o=!1):n+=c;return(t||n!=="")&&r.push(n.trim()),r}},ra=At;At.default=At;var sa=We,id=ra,Mr=class extends sa{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return id.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}},$n=Mr;Mr.default=Mr;sa.registerRule(Mr);var ad=Yr,ld=od,ud=jr,cd=Pn,dd=$t,Vo=$n,Yo={empty:!0,space:!0};function hd(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var fd=class{constructor(e){this.input=e,this.root=new dd,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new cd;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,n,o,i=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(o=a.length-1,n=a[o];n&&n[0]==="space";)n=a[--o];n&&(t.source.end=this.getPosition(n[3]||n[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,n;for(let o=t-1;o>=0&&(n=e[o],!(n[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let t=0,r,n,o;for(let[i,l]of e.entries()){if(r=l,n=r[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return i}o=r}return!1}comment(e){let t=new ud;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=ld(this.input)}decl(e,t){let r=new ad;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||hd(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)i.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),d="";for(let p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=i.map(u=>u[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Vo;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,i=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")o||(o=u),i.push(r==="("?")":"]");else if(l&&n&&r==="{")o||(o=u),i.push("}");else if(i.length===0)if(r===";")if(n){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(n=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&n){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,i,l=r.length,a="",u=!0,c,d;for(let p=0;p<l;p+=1)o=r[p],i=o[0],i==="space"&&p===l-1&&!n?u=!1:i==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!Yo[d]&&!Yo[c]?a.slice(-1)===","?u=!1:a+=o[1]:u=!1):a+=o[1];if(!u){let p=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new Vo;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},pd=fd,md=We,gd=pd,yd=Gr;function kr(s,e){let t=new yd(s,e),r=new gd(t);try{r.parse()}catch(n){throw n}return r.root}var Ln=kr;kr.default=kr;md.registerParse(kr);var{isClean:Ie,my:wd}=Pt,Sd=Ui,vd=Wr,Cd=We,bd=Mn;var Go=kn,Ed=Ln,Rd=$t,Id={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},xd={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Ad={Once:!0,postcssPlugin:!0,prepare:!0},nt=0;function wt(s){return typeof s=="object"&&typeof s.then=="function"}function na(s){let e=!1,t=Id[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,nt,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,nt,t+"Exit"]:[t,t+"Exit"]}function jo(s){let e;return s.type==="document"?e=["Document",nt,"DocumentExit"]:s.type==="root"?e=["Root",nt,"RootExit"]:e=na(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Js(s){return s[Ie]=!1,s.nodes&&s.nodes.forEach(e=>Js(e)),s}var Zs={},ot=class oa{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=Js(t);else if(t instanceof oa||t instanceof Go)n=Js(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=Ed;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{n=o(t,r)}catch(i){this.processed=!0,this.error=i}n&&!n[wd]&&Cd.rebuild(n)}this.result=new Go(e,n,r),this.helpers={...Zs,postcss:Zs,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(t,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!xd[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ad[r])if(typeof t[r]=="object")for(let n in t[r])n==="*"?e(t,r,t[r][n]):e(t,r+"-"+n.toLowerCase(),t[r][n]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(wt(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ie];){e[Ie]=!0;let t=[jo(e)];for(;t.length>0;){let r=this.visitTick(t);if(wt(r))try{await r}catch(n){let o=t[t.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(o=>r(o,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return wt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=vd;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Sd(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(wt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ie];)e[Ie]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){this.result.lastPlugin=r;let o;try{o=n(t,this.helpers)}catch(i){throw this.handleError(i,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(wt(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&t.visitorIndex<n.length){let[i,l]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let i=t.iterator,l;for(;l=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!l[Ie]){l[Ie]=!0,e.push(jo(l));return}t.iterator=0,delete r.indexes[i]}let o=t.events;for(;t.eventIndex<o.length;){let i=o[t.eventIndex];if(t.eventIndex+=1,i===nt){r.nodes&&r.nodes.length&&(r[Ie]=!0,t.iterator=r.getIterator());return}else if(this.listeners[i]){t.visitors=this.listeners[i];return}}e.pop()}walkSync(e){e[Ie]=!0;let t=na(e);for(let r of t)if(r===nt)e.nodes&&e.each(n=>{n[Ie]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ot.registerPostcss=s=>{Zs=s};var ia=ot;ot.default=ot;Rd.registerLazyResult(ot);bd.registerLazyResult(ot);var _d=Ui,Od=Wr;var Dd=Ln,Td=kn,Xs=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n,o=Od;this.result=new Td(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let l=new _d(o,n,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Dd;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},Nd=Xs;Xs.default=Xs;var Md=Nd,kd=ia,Pd=Mn,$d=$t,_t=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Md(this,e,t):new kd(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Ld=_t;_t.default=_t;$d.registerProcessor(_t);Pd.registerProcessor(_t);var Fd=Yr,Ud=ki,zd=jr,Hd=Pn,Bd=Gr,Wd=$t,Vd=$n;function Ot(s,e){if(Array.isArray(s))return s.map(n=>Ot(n));let{inputs:t,...r}=s;if(t){e=[];for(let n of t){let o={...n,__proto__:Bd.prototype};o.map&&(o.map={...o.map,__proto__:Ud.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>Ot(n,e))),r.source){let{inputId:n,...o}=r.source;r.source=o,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new Wd(r);if(r.type==="decl")return new Fd(r);if(r.type==="rule")return new Vd(r);if(r.type==="comment")return new zd(r);if(r.type==="atrule")return new Hd(r);throw new Error("Unknown node type: "+s.type)}var Yd=Ot;Ot.default=Ot;var Gd=Dn,aa=Yr,jd=ia,Kd=We,Fn=Ld,Jd=Wr,Zd=Yd,la=Mn,Xd=Xi,ua=jr,ca=Pn,qd=kn,Qd=Gr,eh=Ln,th=ra,da=$n,ha=$t,rh=Vr;function $(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Fn(s)}$.plugin=function(e,t){let r=!1;function n(...i){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
25
|
-
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
26
|
-
https://www.w3ctech.com/topic/2226`));let l=t(...i);return l.postcssPlugin=e,l.postcssVersion=new Fn().version,l}let o;return Object.defineProperty(n,"postcss",{get(){return o||(o=n()),o}}),n.process=function(i,l,a){return $([n(a)]).process(i,l)},n};$.stringify=Jd;$.parse=eh;$.fromJSON=Zd;$.list=th;$.comment=s=>new ua(s);$.atRule=s=>new ca(s);$.decl=s=>new aa(s);$.rule=s=>new da(s);$.root=s=>new ha(s);$.document=s=>new la(s);$.CssSyntaxError=Gd;$.Declaration=aa;$.Container=Kd;$.Processor=Fn;$.Document=la;$.Comment=ua;$.Warning=Xd;$.AtRule=ca;$.Result=qd;$.Input=Qd;$.Rule=da;$.Root=ha;$.Node=rh;jd.registerPostcss($);var sh=$;$.default=$;var W=mc(sh);W.stringify;W.fromJSON;W.plugin;W.parse;W.list;W.document;W.comment;W.atRule;W.rule;W.decl;W.root;W.CssSyntaxError;W.Declaration;W.Container;W.Processor;W.Document;W.Comment;W.Warning;W.AtRule;W.Result;W.Input;W.Rule;W.Root;W.Node;var nh=Object.defineProperty,oh=(s,e,t)=>e in s?nh(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,pe=(s,e,t)=>oh(s,typeof e!="symbol"?e+"":e,t);function ih(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function ah(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var Un={exports:{}},B=String,fa=function(){return{isColorSupported:!1,reset:B,bold:B,dim:B,italic:B,underline:B,inverse:B,hidden:B,strikethrough:B,black:B,red:B,green:B,yellow:B,blue:B,magenta:B,cyan:B,white:B,gray:B,bgBlack:B,bgRed:B,bgGreen:B,bgYellow:B,bgBlue:B,bgMagenta:B,bgCyan:B,bgWhite:B}};Un.exports=fa();Un.exports.createColors=fa;var lh=Un.exports,uh={},ch=Object.freeze(Object.defineProperty({__proto__:null,default:uh},Symbol.toStringTag,{value:"Module"})),Ce=ah(ch),Ko=lh,Jo=Ce,qs=class pa extends Error{constructor(e,t,r,n,o,i){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,pa)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Ko.isColorSupported),Jo&&e&&(t=Jo(t));let r=t.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),i=String(o).length,l,a;if(e){let{bold:u,gray:c,red:d}=Ko.createColors(!0);l=p=>u(d(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(n,o).map((u,c)=>{let d=n+1+c,p=" "+(" "+d).slice(-i)+" | ";if(d===this.line){let m=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
|
|
27
|
-
`+m+l("^")}return" "+a(p)+u}).join(`
|
|
28
|
-
`)}toString(){let e=this.showSourceCode();return e&&(e=`
|
|
29
|
-
|
|
30
|
-
`+e+`
|
|
31
|
-
`),this.name+": "+this.message+e}},zn=qs;qs.default=qs;var Lt={};Lt.isClean=Symbol("isClean");Lt.my=Symbol("my");var Zo={after:`
|
|
32
|
-
`,beforeClose:`
|
|
33
|
-
`,beforeComment:`
|
|
34
|
-
`,beforeDecl:`
|
|
35
|
-
`,beforeOpen:" ",beforeRule:`
|
|
36
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function dh(s){return s[0].toUpperCase()+s.slice(1)}var Qs=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+n+o,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let n=e.parent,o=0;for(;n&&n.type!=="root";)o+=1,n=n.parent;if(r.includes(`
|
|
37
|
-
`)){let i=this.raw(e,null,"indent");if(i.length)for(let l=0;l<o;l++)r+=i}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let n;e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],typeof n<"u"))return n;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Zo[r];let i=e.root();if(i.rawCache||(i.rawCache={}),typeof i.rawCache[r]<"u")return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+dh(r);this[l]?n=this[l](i,e):i.walk(a=>{if(n=a.raws[t],typeof n<"u")return!1})}return typeof n>"u"&&(n=Zo[r]),i.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
|
|
38
|
-
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
39
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(n=>{if(typeof n.raws.before<"u")return r=n.raws.before,r.includes(`
|
|
40
|
-
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
|
|
41
|
-
`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
42
|
-
`);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}},ma=Qs;Qs.default=Qs;var hh=ma;function en(s,e){new hh(e).stringify(s)}var Kr=en;en.default=en;var{isClean:ur,my:fh}=Lt,ph=zn,mh=ma,gh=Kr;function tn(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let n=s[r],o=typeof n;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=n:Array.isArray(n)?t[r]=n.map(i=>tn(i,t)):(o==="object"&&n!==null&&(n=tn(n)),t[r]=n)}return t}var rn=class{constructor(e={}){this.raws={},this[ur]=!1,this[fh]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=tn(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new ph(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[ur]){this[ur]=!1;let e=this;for(;e=e.parent;)e[ur]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let n=t.indexOf(e.word);n!==-1&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,o=this.source.start.line;for(let i=0;i<e;i++)r[i]===`
|
|
43
|
-
`?(n=1,o+=1):n+=1;return{column:n,line:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),o=n.indexOf(e.word);o!==-1&&(t=this.positionInside(o,n),r=this.positionInside(o+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new mh().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},n=t==null;t=t||new Map;let o=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let l=this[i];if(Array.isArray(l))r[i]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[i]=l.toJSON(null,t);else if(i==="source"){let a=t.get(l.input);a==null&&(a=o,t.set(l.input,o),o++),r[i]={end:l.end,inputId:a,start:l.start}}else r[i]=l}return n&&(r.inputs=[...t.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=gh){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let n={node:this};for(let o in r)n[o]=r[o];return e.warn(t,n)}get proxyOf(){return this}},Jr=rn;rn.default=rn;var yh=Jr,sn=class extends yh{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},Zr=sn;sn.default=sn;var wh="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Sh=(s,e=21)=>(t=e)=>{let r="",n=t;for(;n--;)r+=s[Math.random()*s.length|0];return r},vh=(s=21)=>{let e="",t=s;for(;t--;)e+=wh[Math.random()*64|0];return e},Ch={nanoid:vh,customAlphabet:Sh},{SourceMapConsumer:Xo,SourceMapGenerator:qo}=Ce,{existsSync:bh,readFileSync:Eh}=Ce,{dirname:_s,join:Rh}=Ce;function Ih(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var nn=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=_s(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Xo(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,n=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(n.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Ih(e.substr(RegExp.lastMatch.length));let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=_s(e),bh(e))return this.mapFile=e,Eh(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let n=this.loadFile(r);if(!n)throw new Error("Unable to load previous source map: "+r.toString());return n}}else{if(t instanceof Xo)return qo.fromSourceMap(t).toString();if(t instanceof qo)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Rh(_s(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},ga=nn;nn.default=nn;var{SourceMapConsumer:xh,SourceMapGenerator:Ah}=Ce,{fileURLToPath:Qo,pathToFileURL:cr}=Ce,{isAbsolute:on,resolve:an}=Ce,{nanoid:_h}=Ch,Os=Ce,ei=zn,Oh=ga,Ds=Symbol("fromOffsetCache"),Dh=!!(xh&&Ah),ti=!!(an&&on),Pr=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ti||/^\w+:\/\//.test(t.from)||on(t.from)?this.file=t.from:this.file=an(t.from)),ti&&Dh){let r=new Oh(this.css,t);if(r.text){this.map=r;let n=r.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id="<input css "+_h(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let o,i,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let d=this.fromOffset(u.offset);t=d.line,r=d.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let d=this.fromOffset(c.offset);i=d.line,l=d.col}else i=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,i,l);return a?o=new ei(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):o=new ei(e,i===void 0?t:{column:r,line:t},i===void 0?r:{column:l,line:i},this.css,this.file,n.plugin),o.input={column:r,endColumn:l,endLine:i,line:t,source:this.css},this.file&&(cr&&(o.input.url=cr(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[Ds])r=this[Ds];else{let o=this.css.split(`
|
|
44
|
-
`);r=new Array(o.length);let i=0;for(let l=0,a=o.length;l<a;l++)r[l]=i,i+=o[l].length+1;this[Ds]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let o=r.length-2,i;for(;n<o;)if(i=n+(o-n>>1),e<r[i])o=i-1;else if(e>=r[i+1])n=i+1;else{n=i;break}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:an(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let o=this.map.consumer(),i=o.originalPositionFor({column:t,line:e});if(!i.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:n,line:r}));let a;on(i.source)?a=cr(i.source):a=new URL(i.source,this.map.consumer().sourceRoot||cr(this.map.mapFile));let u={column:i.column,endColumn:l&&l.column,endLine:l&&l.line,line:i.line,url:a.toString()};if(a.protocol==="file:")if(Qo)u.file=Qo(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(i.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}},Xr=Pr;Pr.default=Pr;Os&&Os.registerInput&&Os.registerInput(Pr);var{SourceMapConsumer:ya,SourceMapGenerator:Er}=Ce,{dirname:Rr,relative:wa,resolve:Sa,sep:va}=Ce,{pathToFileURL:ri}=Ce,Th=Xr,Nh=!!(ya&&Er),Mh=!!(Rr&&Sa&&wa&&va),kh=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
|
|
45
|
-
`;this.css.includes(`\r
|
|
46
|
-
`)&&(t=`\r
|
|
47
|
-
`),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Rr(e.file),n;this.mapOpts.sourcesContent===!1?(n=new ya(e.text),n.sourcesContent&&(n.sourcesContent=null)):n=e.consumer(),this.map.applySourceMap(n,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Mh&&Nh&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Er.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Er({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Er({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,i;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(n.generated.line=e,n.generated.column=t-1,a.source&&a.source.start?(n.source=this.sourcePath(a),n.original.line=a.source.start.line,n.original.column=a.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),o=l.match(/\n/g),o?(e+=o.length,i=l.lastIndexOf(`
|
|
48
|
-
`),t=l.length-i):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(n.source=this.sourcePath(a),n.original.line=a.source.end.line,n.original.column=a.source.end.column-1,n.generated.line=e,n.generated.column=t-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=e,n.generated.column=t-1,this.map.addMapping(n)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Rr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Rr(Sa(r,this.mapOpts.annotation)));let n=wa(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Th(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(ri){let r=ri(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;va==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ca=kh,Ph=Jr,ln=class extends Ph{constructor(e){super(e),this.type="comment"}},qr=ln;ln.default=ln;var{isClean:ba,my:Ea}=Lt,Ra=Zr,Ia=qr,$h=Jr,xa,Hn,Bn,Aa;function _a(s){return s.map(e=>(e.nodes&&(e.nodes=_a(e.nodes)),delete e.source,e))}function Oa(s){if(s[ba]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Oa(e)}var Me=class Da extends $h{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let n of r)this.proxyOf.nodes.push(n)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,n;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],n=e(this.proxyOf.nodes[r],r),n!==!1);)this.indexes[t]+=1;return delete this.indexes[t],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(n=>typeof n=="function"?(o,i)=>n(o.toProxy(),i):n)):t==="every"||t==="some"?r=>e[t]((n,...o)=>r(n.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let i of n)this.proxyOf.nodes.splice(r+1,0,i);let o;for(let i in this.indexes)o=this.indexes[i],r<o&&(this.indexes[i]=o+n.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),n=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let l of o)this.proxyOf.nodes.splice(r,0,l);let i;for(let l in this.indexes)i=this.indexes[l],r<=i&&(this.indexes[l]=i+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=_a(xa(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ra(e)]}else if(e.selector)e=[new Hn(e)];else if(e.name)e=[new Bn(e)];else if(e.text)e=[new Ia(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[Ea]||Da.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[ba]&&Oa(n),typeof n.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let n of r)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(o){throw t.addToError(o)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if(r.type==="atrule"&&r.name===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="atrule")return t(r,n)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if(r.type==="decl"&&r.prop===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="decl")return t(r,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if(r.type==="rule"&&r.selector===e)return t(r,n)}):(t=e,this.walk((r,n)=>{if(r.type==="rule")return t(r,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Me.registerParse=s=>{xa=s};Me.registerRule=s=>{Hn=s};Me.registerAtRule=s=>{Bn=s};Me.registerRoot=s=>{Aa=s};var Ve=Me;Me.default=Me;Me.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Bn.prototype):s.type==="rule"?Object.setPrototypeOf(s,Hn.prototype):s.type==="decl"?Object.setPrototypeOf(s,Ra.prototype):s.type==="comment"?Object.setPrototypeOf(s,Ia.prototype):s.type==="root"&&Object.setPrototypeOf(s,Aa.prototype),s[Ea]=!0,s.nodes&&s.nodes.forEach(e=>{Me.rebuild(e)})};var Lh=Ve,Ta,Na,Dt=class extends Lh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ta(new Na,this,e).stringify()}};Dt.registerLazyResult=s=>{Ta=s};Dt.registerProcessor=s=>{Na=s};var Wn=Dt;Dt.default=Dt;var un=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}},Ma=un;un.default=un;var Fh=Ma,cn=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Fh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Vn=cn;cn.default=cn;var Ts=39,si=34,dr=92,ni=47,hr=10,St=32,fr=12,pr=9,mr=13,Uh=91,zh=93,Hh=40,Bh=41,Wh=123,Vh=125,Yh=59,Gh=42,jh=58,Kh=64,gr=/[\t\n\f\r "#'()/;[\\\]{}]/g,yr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Jh=/.[\r\n"'(/\\]/,oi=/[\da-f]/i,Zh=function(e,t={}){let r=e.css.valueOf(),n=t.ignoreErrors,o,i,l,a,u,c,d,p,m,g,f=r.length,h=0,E=[],S=[];function w(){return h}function I(v){throw e.error("Unclosed "+v,h)}function _(){return S.length===0&&h>=f}function y(v){if(S.length)return S.pop();if(h>=f)return;let x=v?v.ignoreUnclosed:!1;switch(o=r.charCodeAt(h),o){case hr:case St:case pr:case mr:case fr:{i=h;do i+=1,o=r.charCodeAt(i);while(o===St||o===hr||o===pr||o===mr||o===fr);g=["space",r.slice(h,i)],h=i-1;break}case Uh:case zh:case Wh:case Vh:case jh:case Yh:case Bh:{let O=String.fromCharCode(o);g=[O,O,h];break}case Hh:{if(p=E.length?E.pop()[1]:"",m=r.charCodeAt(h+1),p==="url"&&m!==Ts&&m!==si&&m!==St&&m!==hr&&m!==pr&&m!==fr&&m!==mr){i=h;do{if(c=!1,i=r.indexOf(")",i+1),i===-1)if(n||x){i=h;break}else I("bracket");for(d=i;r.charCodeAt(d-1)===dr;)d-=1,c=!c}while(c);g=["brackets",r.slice(h,i+1),h,i],h=i}else i=r.indexOf(")",h+1),a=r.slice(h,i+1),i===-1||Jh.test(a)?g=["(","(",h]:(g=["brackets",a,h,i],h=i);break}case Ts:case si:{l=o===Ts?"'":'"',i=h;do{if(c=!1,i=r.indexOf(l,i+1),i===-1)if(n||x){i=h+1;break}else I("string");for(d=i;r.charCodeAt(d-1)===dr;)d-=1,c=!c}while(c);g=["string",r.slice(h,i+1),h,i],h=i;break}case Kh:{gr.lastIndex=h+1,gr.test(r),gr.lastIndex===0?i=r.length-1:i=gr.lastIndex-2,g=["at-word",r.slice(h,i+1),h,i],h=i;break}case dr:{for(i=h,u=!0;r.charCodeAt(i+1)===dr;)i+=1,u=!u;if(o=r.charCodeAt(i+1),u&&o!==ni&&o!==St&&o!==hr&&o!==pr&&o!==mr&&o!==fr&&(i+=1,oi.test(r.charAt(i)))){for(;oi.test(r.charAt(i+1));)i+=1;r.charCodeAt(i+1)===St&&(i+=1)}g=["word",r.slice(h,i+1),h,i],h=i;break}default:{o===ni&&r.charCodeAt(h+1)===Gh?(i=r.indexOf("*/",h+2)+1,i===0&&(n||x?i=r.length:I("comment")),g=["comment",r.slice(h,i+1),h,i],h=i):(yr.lastIndex=h+1,yr.test(r),yr.lastIndex===0?i=r.length-1:i=yr.lastIndex-2,g=["word",r.slice(h,i+1),h,i],E.push(g),h=i);break}}return h++,g}function R(v){S.push(v)}return{back:R,endOfFile:_,nextToken:y,position:w}},ka=Ve,$r=class extends ka{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}},Yn=$r;$r.default=$r;ka.registerAtRule($r);var Pa=Ve,$a,La,it=class extends Pa{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let o of n)o.raws.before=t.raws.before}return n}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new $a(new La,this,e).stringify()}};it.registerLazyResult=s=>{$a=s};it.registerProcessor=s=>{La=s};var Ft=it;it.default=it;Pa.registerRoot(it);var Tt={comma(s){return Tt.split(s,[","],!0)},space(s){let e=[" ",`
|
|
49
|
-
`," "];return Tt.split(s,e)},split(s,e,t){let r=[],n="",o=!1,i=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?i+=1:c===")"?i>0&&(i-=1):i===0&&e.includes(c)&&(o=!0),o?(n!==""&&r.push(n.trim()),n="",o=!1):n+=c;return(t||n!=="")&&r.push(n.trim()),r}},Fa=Tt;Tt.default=Tt;var Ua=Ve,Xh=Fa,Lr=class extends Ua{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Xh.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}},Gn=Lr;Lr.default=Lr;Ua.registerRule(Lr);var qh=Zr,Qh=Zh,ef=qr,tf=Yn,rf=Ft,ii=Gn,ai={empty:!0,space:!0};function sf(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var nf=class{constructor(e){this.input=e,this.root=new rf,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new tf;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,n,o,i=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(o=a.length-1,n=a[o];n&&n[0]==="space";)n=a[--o];n&&(t.source.end=this.getPosition(n[3]||n[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,n;for(let o=t-1;o>=0&&(n=e[o],!(n[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(e){let t=0,r,n,o;for(let[i,l]of e.entries()){if(r=l,n=r[0],n==="("&&(t+=1),n===")"&&(t-=1),t===0&&n===":")if(!o)this.doubleColon(r);else{if(o[0]==="word"&&o[1]==="progid")continue;return i}o=r}return!1}comment(e){let t=new ef;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let n=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}createTokenizer(){this.tokenizer=Qh(this.input)}decl(e,t){let r=new qh;this.init(r,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||sf(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let o;for(;e.length;)if(o=e.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)i.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(o=e[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=e.slice(0),d="";for(let p=u;p>0;p--){let m=c[p][0];if(d.trim().indexOf("!")===0&&m!=="space")break;d=c.pop()[1]+d}d.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=d,e=c)}if(o[0]!=="space"&&o[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=i.map(u=>u[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ii;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,i=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")o||(o=u),i.push(r==="("?")":"]");else if(l&&n&&r==="{")o||(o=u),i.push("}");else if(i.length===0)if(r===";")if(n){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(n=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&n){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,i,l=r.length,a="",u=!0,c,d;for(let p=0;p<l;p+=1)o=r[p],i=o[0],i==="space"&&p===l-1&&!n?u=!1:i==="comment"?(d=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!ai[d]&&!ai[c]?a.slice(-1)===","?u=!1:a+=o[1]:u=!1):a+=o[1];if(!u){let p=r.reduce((m,g)=>m+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new ii;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},of=nf,af=Ve,lf=of,uf=Xr;function Fr(s,e){let t=new uf(s,e),r=new lf(t);try{r.parse()}catch(n){throw n}return r.root}var jn=Fr;Fr.default=Fr;af.registerParse(Fr);var{isClean:xe,my:cf}=Lt,df=Ca,hf=Kr,ff=Ve,pf=Wn;var li=Vn,mf=jn,gf=Ft,yf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},wf={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Sf={Once:!0,postcssPlugin:!0,prepare:!0},at=0;function vt(s){return typeof s=="object"&&typeof s.then=="function"}function za(s){let e=!1,t=yf[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,at,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,at,t+"Exit"]:[t,t+"Exit"]}function ui(s){let e;return s.type==="document"?e=["Document",at,"DocumentExit"]:s.type==="root"?e=["Root",at,"RootExit"]:e=za(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function dn(s){return s[xe]=!1,s.nodes&&s.nodes.forEach(e=>dn(e)),s}var hn={},lt=class Ha{constructor(e,t,r){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=dn(t);else if(t instanceof Ha||t instanceof li)n=dn(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let o=mf;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{n=o(t,r)}catch(i){this.processed=!0,this.error=i}n&&!n[cf]&&ff.rebuild(n)}this.result=new li(e,n,r),this.helpers={...hn,postcss:hn,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}prepareVisitors(){this.listeners={};let e=(t,r,n)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!wf[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Sf[r])if(typeof t[r]=="object")for(let n in t[r])n==="*"?e(t,r,t[r][n]):e(t,r+"-"+n.toLowerCase(),t[r][n]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(vt(r))try{await r}catch(n){throw this.handleError(n)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xe];){e[xe]=!0;let t=[ui(e)];for(;t.length>0;){let r=this.visitTick(t);if(vt(r))try{await r}catch(n){let o=t[t.length-1].node;throw this.handleError(n,o)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(o=>r(o,this.helpers));await Promise.all(n)}else await r(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return vt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=hf;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new df(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(vt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[xe];)e[xe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){this.result.lastPlugin=r;let o;try{o=n(t,this.helpers)}catch(i){throw this.handleError(i,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(vt(o))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(n.length>0&&t.visitorIndex<n.length){let[i,l]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let i=t.iterator,l;for(;l=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!l[xe]){l[xe]=!0,e.push(ui(l));return}t.iterator=0,delete r.indexes[i]}let o=t.events;for(;t.eventIndex<o.length;){let i=o[t.eventIndex];if(t.eventIndex+=1,i===at){r.nodes&&r.nodes.length&&(r[xe]=!0,t.iterator=r.getIterator());return}else if(this.listeners[i]){t.visitors=this.listeners[i];return}}e.pop()}walkSync(e){e[xe]=!0;let t=za(e);for(let r of t)if(r===at)e.nodes&&e.each(n=>{n[xe]||this.walkSync(n)});else{let n=this.listeners[r];if(n&&this.visitSync(n,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};lt.registerPostcss=s=>{hn=s};var Ba=lt;lt.default=lt;gf.registerLazyResult(lt);pf.registerLazyResult(lt);var vf=Ca,Cf=Kr;var bf=jn,Ef=Vn,fn=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n,o=Cf;this.result=new Ef(this._processor,n,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let l=new vf(o,n,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=bf;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},Rf=fn;fn.default=fn;var If=Rf,xf=Ba,Af=Wn,_f=Ft,Nt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new If(this,e,t):new xf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Of=Nt;Nt.default=Nt;_f.registerProcessor(Nt);Af.registerProcessor(Nt);var Df=Zr,Tf=ga,Nf=qr,Mf=Yn,kf=Xr,Pf=Ft,$f=Gn;function Mt(s,e){if(Array.isArray(s))return s.map(n=>Mt(n));let{inputs:t,...r}=s;if(t){e=[];for(let n of t){let o={...n,__proto__:kf.prototype};o.map&&(o.map={...o.map,__proto__:Tf.prototype}),e.push(o)}}if(r.nodes&&(r.nodes=s.nodes.map(n=>Mt(n,e))),r.source){let{inputId:n,...o}=r.source;r.source=o,n!=null&&(r.source.input=e[n])}if(r.type==="root")return new Pf(r);if(r.type==="decl")return new Df(r);if(r.type==="rule")return new $f(r);if(r.type==="comment")return new Nf(r);if(r.type==="atrule")return new Mf(r);throw new Error("Unknown node type: "+s.type)}var Lf=Mt;Mt.default=Mt;var Ff=zn,Wa=Zr,Uf=Ba,zf=Ve,Kn=Of,Hf=Kr,Bf=Lf,Va=Wn,Wf=Ma,Ya=qr,Ga=Yn,Vf=Vn,Yf=Xr,Gf=jn,jf=Fa,ja=Gn,Ka=Ft,Kf=Jr;function L(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Kn(s)}L.plugin=function(e,t){let r=!1;function n(...i){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
|
|
50
|
-
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
51
|
-
https://www.w3ctech.com/topic/2226`));let l=t(...i);return l.postcssPlugin=e,l.postcssVersion=new Kn().version,l}let o;return Object.defineProperty(n,"postcss",{get(){return o||(o=n()),o}}),n.process=function(i,l,a){return L([n(a)]).process(i,l)},n};L.stringify=Hf;L.parse=Gf;L.fromJSON=Bf;L.list=jf;L.comment=s=>new Ya(s);L.atRule=s=>new Ga(s);L.decl=s=>new Wa(s);L.rule=s=>new ja(s);L.root=s=>new Ka(s);L.document=s=>new Va(s);L.CssSyntaxError=Ff;L.Declaration=Wa;L.Container=zf;L.Processor=Kn;L.Document=Va;L.Comment=Ya;L.Warning=Wf;L.AtRule=Ga;L.Result=Vf;L.Input=Yf;L.Rule=ja;L.Root=Ka;L.Node=Kf;Uf.registerPostcss(L);var Jf=L;L.default=L;var V=ih(Jf);V.stringify;V.fromJSON;V.plugin;V.parse;V.list;V.document;V.comment;V.atRule;V.rule;V.decl;V.root;V.CssSyntaxError;V.Declaration;V.Container;V.Processor;V.Document;V.Comment;V.Warning;V.AtRule;V.Result;V.Input;V.Rule;V.Root;V.Node;var pn=class s{constructor(...e){pe(this,"parentElement",null),pe(this,"parentNode",null),pe(this,"ownerDocument"),pe(this,"firstChild",null),pe(this,"lastChild",null),pe(this,"previousSibling",null),pe(this,"nextSibling",null),pe(this,"ELEMENT_NODE",1),pe(this,"TEXT_NODE",3),pe(this,"nodeType"),pe(this,"nodeName"),pe(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;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"}},ci={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},di={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wr={};function Jn(s){if(wr[s])return wr[s];let e=globalThis[s],t=e.prototype,r=s in ci?ci[s]:void 0,n=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),o=s in di?di[s]:void 0,i=!!(o&&o.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(n&&i)return wr[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?wr[s]=u:t}catch{return t}}var Ns={};function ze(s,e,t){var r;let n=`${s}.${String(t)}`;if(Ns[n])return Ns[n].call(e);let o=Jn(s),i=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return i?(Ns[n]=i,i.call(e)):e[t]}var Ms={};function Ja(s,e,t){let r=`${s}.${String(t)}`;if(Ms[r])return Ms[r].bind(e);let o=Jn(s)[t];return typeof o!="function"?e[t]:(Ms[r]=o,o.bind(e))}function Zf(s){return ze("Node",s,"childNodes")}function Xf(s){return ze("Node",s,"parentNode")}function qf(s){return ze("Node",s,"parentElement")}function Qf(s){return ze("Node",s,"textContent")}function ep(s,e){return Ja("Node",s,"contains")(e)}function tp(s){return Ja("Node",s,"getRootNode")()}function rp(s){return!s||!("host"in s)?null:ze("ShadowRoot",s,"host")}function sp(s){return s.styleSheets}function np(s){return!s||!("shadowRoot"in s)?null:ze("Element",s,"shadowRoot")}function op(s,e){return ze("Element",s,"querySelector")(e)}function ip(s,e){return ze("Element",s,"querySelectorAll")(e)}function Za(){return Jn("MutationObserver").constructor}var D={childNodes:Zf,parentNode:Xf,parentElement:qf,textContent:Qf,contains:ep,getRootNode:tp,host:rp,styleSheets:sp,shadowRoot:np,querySelector:op,querySelectorAll:ip,mutationObserver:Za};function oe(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var qe=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
"use strict";var vn=Object.create;var $e=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var wn=Object.getPrototypeOf,En=Object.prototype.hasOwnProperty;var In=(e,t,r)=>t in e?$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _n=(e,t)=>{for(var r in t)$e(e,r,{get:t[r],enumerable:!0})},Hr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Cn(t))!En.call(e,n)&&n!==r&&$e(e,n,{get:()=>t[n],enumerable:!(o=bn(t,n))||o.enumerable});return e};var Yr=(e,t,r)=>(r=e!=null?vn(wn(e)):{},Hr(t||!e||!e.__esModule?$e(r,"default",{value:e,enumerable:!0}):r,e)),Rn=e=>Hr($e({},"__esModule",{value:!0}),e);var de=(e,t,r)=>In(e,typeof t!="symbol"?t+"":t,r);var Qi={};_n(Qi,{adoraIsRunning:()=>xe,adoraStart:()=>Xi,adoraStop:()=>qi});module.exports=Rn(Qi);var An={"Content-Type":"application/json"},Dn=/\{[^{}]+\}/g,Wt=class extends Request{constructor(t,r){super(t,r);for(let o in r)o in this||(this[o]=r[o])}};function Bt(e){let{baseUrl:t="",fetch:r=globalThis.fetch,querySerializer:o,bodySerializer:n,headers:s,...a}={...e};t.endsWith("/")&&(t=t.substring(0,t.length-1)),s=Wr(An,s);let c=[];async function i(u,d){let{fetch:l=r,headers:g,params:f={},parseAs:p="json",querySerializer:h,bodySerializer:C=n??Nn,...I}=d||{},v=typeof o=="function"?o:Vr(o);h&&(v=typeof h=="function"?h:Vr({...typeof o=="object"?o:{},...h}));let y={redirect:"follow",...a,...I,headers:Wr(s,g,f.header)};y.body&&(y.body=C(y.body)),y.body instanceof FormData&&y.headers.delete("Content-Type");let _=new Wt(On(u,{baseUrl:t,params:f,querySerializer:v}),y),A={baseUrl:t,fetch:l,parseAs:p,querySerializer:v,bodySerializer:C};for(let w of c)if(w&&typeof w=="object"&&typeof w.onRequest=="function"){_.schemaPath=u,_.params=f;let D=await w.onRequest(_,A);if(D){if(!(D instanceof Request))throw new Error("Middleware must return new Request() when modifying the request");_=D}}let m=await l(_);for(let w=c.length-1;w>=0;w--){let D=c[w];if(D&&typeof D=="object"&&typeof D.onResponse=="function"){let L=await D.onResponse(m,A);if(L){if(!(L instanceof Response))throw new Error("Middleware must return new Response() when modifying the response");m=L}}}if(m.status===204||m.headers.get("Content-Length")==="0")return m.ok?{data:{},response:m}:{error:{},response:m};if(m.ok)return p==="stream"?{data:m.body,response:m}:{data:await m[p](),response:m};let E=await m.text();try{E=JSON.parse(E)}catch{}return{error:E,response:m}}return{async GET(u,d){return i(u,{...d,method:"GET"})},async PUT(u,d){return i(u,{...d,method:"PUT"})},async POST(u,d){return i(u,{...d,method:"POST"})},async DELETE(u,d){return i(u,{...d,method:"DELETE"})},async OPTIONS(u,d){return i(u,{...d,method:"OPTIONS"})},async HEAD(u,d){return i(u,{...d,method:"HEAD"})},async PATCH(u,d){return i(u,{...d,method:"PATCH"})},async TRACE(u,d){return i(u,{...d,method:"TRACE"})},use(...u){for(let d of u)if(d){if(typeof d!="object"||!("onRequest"in d||"onResponse"in d))throw new Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");c.push(d)}},eject(...u){for(let d of u){let l=c.indexOf(d);l!==-1&&c.splice(l,1)}}}}function lt(e,t,r){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${r?.allowReserved===!0?t:encodeURIComponent(t)}`}function Br(e,t,r){if(!t||typeof t!="object")return"";let o=[],n={simple:",",label:".",matrix:";"}[r.style]||"&";if(r.style!=="deepObject"&&r.explode===!1){for(let c in t)o.push(c,r.allowReserved===!0?t[c]:encodeURIComponent(t[c]));let a=o.join(",");switch(r.style){case"form":return`${e}=${a}`;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return a}}for(let a in t){let c=r.style==="deepObject"?`${e}[${a}]`:a;o.push(lt(c,t[a],r))}let s=o.join(n);return r.style==="label"||r.style==="matrix"?`${n}${s}`:s}function zr(e,t,r){if(!Array.isArray(t))return"";if(r.explode===!1){let s={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[r.style]||",",a=(r.allowReserved===!0?t:t.map(c=>encodeURIComponent(c))).join(s);switch(r.style){case"simple":return a;case"label":return`.${a}`;case"matrix":return`;${e}=${a}`;default:return`${e}=${a}`}}let o={simple:",",label:".",matrix:";"}[r.style]||"&",n=[];for(let s of t)r.style==="simple"||r.style==="label"?n.push(r.allowReserved===!0?s:encodeURIComponent(s)):n.push(lt(e,s,r));return r.style==="label"||r.style==="matrix"?`${o}${n.join(o)}`:n.join(o)}function Vr(e){return function(r){let o=[];if(r&&typeof r=="object")for(let n in r){let s=r[n];if(s!=null){if(Array.isArray(s)){o.push(zr(n,s,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof s=="object"){o.push(Br(n,s,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}o.push(lt(n,s,e))}}return o.join("&")}}function Tn(e,t){let r=e;for(let o of e.match(Dn)??[]){let n=o.substring(1,o.length-1),s=!1,a="simple";if(n.endsWith("*")&&(s=!0,n=n.substring(0,n.length-1)),n.startsWith(".")?(a="label",n=n.substring(1)):n.startsWith(";")&&(a="matrix",n=n.substring(1)),!t||t[n]===void 0||t[n]===null)continue;let c=t[n];if(Array.isArray(c)){r=r.replace(o,zr(n,c,{style:a,explode:s}));continue}if(typeof c=="object"){r=r.replace(o,Br(n,c,{style:a,explode:s}));continue}if(a==="matrix"){r=r.replace(o,`;${lt(n,c)}`);continue}r=r.replace(o,a==="label"?`.${c}`:c)}return r}function Nn(e){return JSON.stringify(e)}function On(e,t){let r=`${t.baseUrl}${e}`;t.params?.path&&(r=Tn(r,t.params.path));let o=t.querySerializer(t.params.query??{});return o.startsWith("?")&&(o=o.substring(1)),o&&(r+=`?${o}`),r}function Wr(...e){let t=new Headers;for(let r of e){if(!r||typeof r!="object")continue;let o=r instanceof Headers?r.entries():Object.entries(r);for(let[n,s]of o)if(s===null)t.delete(n);else if(Array.isArray(s))for(let a of s)t.append(n,a);else s!==void 0&&t.set(n,s)}return t}var Q=(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))(Q||{}),De=(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))(De||{}),zt=(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))(zt||{});var xn="Adora.URLChange",Gr="Adora.Cohort",Mn="Adora.AddCohort",kn="Adora.Click";var Gt=["onclick","ondblclick","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onchange","onfocus","onblur","onscroll","onselect","onsubmit","onkeydown","onkeypress","onkeyup","onload","onunload"];function Kr({dom0EventHandlers:e,delay:t,timestamp:r}){return{type:Q.Custom,data:{tag:kn,payload:{dom0EventHandlers:e}},delay:t,timestamp:r}}function Ze({payload:e,delay:t,timestamp:r}){return{type:Q.Custom,data:{tag:Mn,payload:e},delay:t,timestamp:r}}function jr({href:e,delay:t,timestamp:r}){return{type:Q.Custom,data:{tag:xn,payload:{href:e}},delay:t,timestamp:r}}function ae(e){throw new Error(`This code path should be unreachable: ${e}`)}var zn=require("uuidv7");var md=1e3*60*30;var yd=10080*60*1e3;var Zr="https://c.adora-cdn.com";var ve=class{constructor(t){de(this,"backendClient");de(this,"eventPostBackendClient");this.backendClient=jt({baseUrl:t??Zr})}getOrCreateEventPostClient(t){return!t.eventPostUrl||!t.eventPostToken?{path:t.sessionId,client:this.backendClient}:(this.eventPostBackendClient||(this.eventPostBackendClient=jt({baseUrl:t.eventPostUrl})),{path:t.sessionId,client:this.eventPostBackendClient})}async sessionPreload({orgId:t}){return this.backendClient.POST("/sessions/preload",{body:{orgId:t},mode:"cors"}).catch(()=>{})}async startSession({bypassSampling:t,orgId:r,language:o,domain:n,userCohorts:s,uid:a,devicePixelRatio:c,adoraUserId:i,userAgent:u,documentReferrer:d,snippetVersion:l}){return this.backendClient.POST("/sessions/start",{body:{bypassSampling:t,orgId:r,language:o,domain:n,devicePixelRatio:c,userCohorts:s||{},userAgent:u,uid:typeof a=="number"?a.toString():a!=="null"&&a!=="undefined"?a:void 0,adoraUserId:i,documentReferrer:d,snippetVersion:l},mode:"cors"}).catch(()=>{})}async gzipWithCompressionStream(t){let r=JSON.stringify(t),n=new TextEncoder().encode(r),s=new CompressionStream("gzip"),c=new ReadableStream({start(u){u.enqueue(n),u.close()}}).pipeThrough(s);return new Response(c).arrayBuffer()}async saveSessionEvents({sessionId:t,events:r,metadata:o,eventPostUrl:n,eventPostToken:s,fastpathToken:a}){let{path:c,client:i}=this.getOrCreateEventPostClient({sessionId:t,eventPostToken:s,eventPostUrl:n}),u={events:r.slice(),metadata:o,fastpathToken:a},d={params:{path:{sessionId:c}},headers:s?{token:s}:void 0};if(typeof CompressionStream<"u"){let l=await this.gzipWithCompressionStream(u);return i.POSTGzipped("/sessions/{sessionId}/events",{...d,body:l}).catch(()=>{})}return i.POST("/sessions/{sessionId}/events",{...d,body:u}).catch(()=>{})}async refreshEventToken(t){return await this.backendClient.POST("/sessions/{sessionId}/events/token",{params:{path:{sessionId:t.sessionId}},body:{},mode:"cors"}).catch(()=>{})}async syncSession(t){return await this.backendClient.POST("/sessions/{sessionId}/sync",{params:{path:{sessionId:t.sessionId}}}).catch(()=>{})}};var ht=require("minimatch");function jn(e){return e.endsWith("$")&&(e=e.substring(0,e.length-1)),(e.endsWith("+?")||e.endsWith("*?"))&&(e=e.substring(0,e.length-1)),e}function Pe(e,t){let r=t.replace||t.path;switch(t.type){case"regexp":{let o=(t.path.startsWith("^")?"":"^")+t.path+(!t.path.endsWith("$")&&!t.partial?"$":""),n=new RegExp(o);return n.test(e)?t.partial?e.replace(n,r):r:void 0}case"wildcard":case void 0:if(t.partial){let o=(0,ht.makeRe)(t.path,{partial:t.partial,dot:!0});if(!o)throw new Error("unable to make regexp");let n=new RegExp(jn(o.source));return n.test(e)?e.replace(n,r):void 0}return(0,ht.minimatch)(e,t.path,{dot:!0})?r:void 0;default:ae(t.type)}}var $t;(function(e){e.GOAL_SURVEY_FINISHED="goal_survey_finished",e.WELCOME_DIALOG_FINISHED="welcome_dialog_finished"})($t||($t={}));var Zt;(function(e){e.EXPLORE_AND_VISUALIZE="Explore and visualize",e.MEASURE_AND_OPTIMIZE="Measure and optimize",e.IDENTIFY_FRICTION="Identify friction",e.DIAGNOSE_ISSUES="Diagnose issues"})(Zt||(Zt={}));var Jt;(function(e){e.SKIPPED="skipped",e.COMPLETED="completed"})(Jt||(Jt={}));var Xt;(function(e){e.NONE="none",e.NEW_USER_GOAL_SURVEY="new_user_goal_survey",e.EXISTING_USER_WELCOME_DIALOG="existing_user_welcome_dialog"})(Xt||(Xt={}));var jt=e=>({...Bt(e),POSTGzipped:async(r,o)=>{if(!o?.body)throw new Error("Body is required for gzipped requests");let n={...o.headers,"Content-Type":"application/json","Content-Encoding":"gzip"},s=r;o.params?.path&&Object.entries(o.params.path).forEach(([i,u])=>{s=s.replace(`{${i}}`,u)});let a=await fetch(`${e.baseUrl}${s}`,{method:"POST",headers:n,body:o.body});if(!a.ok){let i=await a.text();try{i=JSON.parse(i)}catch{}return{data:void 0,error:i,response:a}}return{data:await a.json(),error:void 0,response:a}}});var yn=require("fast-equals"),dt=Yr(require("js-cookie"),1),Sn=require("uuidv7");var ft=class{constructor(t,r){this.storage=r;this.eventStorageKey=t==="adoraSessionScript"?"adoraEventsScript":"adoraEventsExtension"}getEvents(){let t=this.storage.getItem(this.eventStorageKey);return t?JSON.parse(t):null}setEvents(t){this.storage.setItem(this.eventStorageKey,JSON.stringify(t))}removeEvents(){this.storage.removeItem(this.eventStorageKey)}};function qt(e){return`${e}-rate-limit-timestamp`}var Ie=class{constructor(t,r){this.sessionType=t;this.storage=r}get lastRateLimitedTimestamp(){let t=this.storage.getItem(qt(this.sessionType));if($n(t))return t}clearLastRateLimitedTimestamp(){this.storage.removeItem(qt(this.sessionType))}setLastRateLimitedTimestamp(t){this.storage.setItem(qt(this.sessionType),t.toString())}getSession(){let t=this.storage.getItem(this.sessionType);return t?JSON.parse(t):null}setSession(t){this.storage.setItem(this.sessionType,JSON.stringify(t))}removeSession(){this.storage.removeItem(this.sessionType)}};function $n(e){return!isNaN(Number(e))}function b(e,...t){(typeof window=="object"&&window.enableAdoraDebugLogs||typeof window=="object"&&window.localStorage.getItem("enableAdoraDebugLogs"))&&console.log(e,...t)}var be=class{getItem(t){if(!Qt())return null;try{return window.sessionStorage.getItem(t)}catch{return null}}setItem(t,r){if(!Qt())return null;try{return window.sessionStorage.setItem(t,r)}catch{return null}}removeItem(t){if(!Qt())return null;try{return window.sessionStorage.removeItem(t)}catch{return null}}};function Qt(){return typeof window.sessionStorage=="object"}var pt="v0.0.1";var Jr=async(e,t,r)=>{let o=new Ie(e,new be),n=new ve(r.backendUrl),s=await Zn(n,r,t);return s.type==="success"&&o.setSession(s.storedSession),s};async function Zn(e,t,r){try{b("starting session over network",{uid:t.uid,userCohorts:t.userCohorts||{}});let o=await e.startSession({bypassSampling:t.bypassSampling,orgId:t.orgId,language:t.language||navigator.language,domain:new URL(window.location.href).hostname,userCohorts:t.userCohorts||{},uid:t.uid,devicePixelRatio:window.devicePixelRatio,adoraUserId:r,documentReferrer:document.referrer,snippetVersion:pt});if(!o)return{type:"error",code:void 0};if(o.error)return{type:"error",code:o.error.code};if(o.response.status!==201)return b("session not created, aborting"),{type:"error",code:"code"in o.data?o.data.code:void 0};if(o.data&&"scheduledDowntime"in o.data)return b("scheduled downtime, exiting"),{type:"error",code:void 0};if(!o.data||!("session"in o.data))return b("malformed session, exiting"),{type:"error",code:void 0};let{session:n,organization:s,eventPostUrl:a,eventPostToken:c}=o.data;return{type:"success",storedSession:{id:n.id,createdAt:n.createdAt,status:n.status,lastSyncedAt:n.lastSyncedAt,domain:n.domain,requestIp:n.requestIp,country:n.country,userAgent:n.userAgent,language:n.language,initialUserCohorts:n.initialUserCohorts,devicePixelRatio:n.devicePixelRatio,organization:s,documentReferrer:n.documentReferrer,canvasRecordingEnabled:n.canvasRecordingEnabled||!1,adoraUserId:r,settings:t,eventPostUrl:a,eventPostToken:c,limitedCanvasRecording:n.limitedCanvasRecording||!1,compressionType:n.compressionType}}}catch{return{type:"error",code:void 0}}}var Ke=Yr(require("web-vitals"),1);var Xr="__STATSIG__",Jn="statsig@@",qr=e=>{try{if(!e[Xr])return;let t=e[Xr];if(!qn(t))return;let r={};return Object.values(t.instances).forEach(o=>{o._logger?._lastExposureTimeMap&&Object.keys(o._logger?._lastExposureTimeMap).forEach(n=>{let s=Xn(n);if(!s)return;let a=o.getExperiment(s);ts(a)&&(r[Jn+a.name]=a.groupName)})}),r}catch{return}},Xn=e=>{let t=e.split("|");if(t.length>3)return t[3]};function qn(e){if(!e||typeof e!="object"||!("instances"in e)||typeof e.instances!="object"||!e.instances)return!1;let t=Object.values(e.instances);for(let r of t)if(!Qn(r))return!1;return!0}function Qn(e){return!e||typeof e!="object"?!1:"_logger"in e&&typeof e._logger=="object"&&es(e._logger)&&"_sdkKey"in e&&typeof e._sdkKey=="string"&&"getExperiment"in e&&typeof e.getExperiment=="function"}function es(e){return!e||typeof e!="object"?!1:"_lastExposureTimeMap"in e&&typeof e._lastExposureTimeMap=="object"}function ts(e){return!e||typeof e!="object"?!1:"name"in e&&typeof e.name=="string"&&"groupName"in e&&typeof e.groupName=="string"}function gt(e,t){if(!t.windowGetters)return;let r={};if(t.windowGetters.forEach(({key:o,paths:n})=>{let s=rs(e,n);s&&(r[o]=s)}),Object.keys(r).length!==0)return r}function rs(e,t){if(typeof e>"u")return;let r=e;for(let n=0;n<t.length-1;n++)if(r=r[t[n]],typeof r!="object")return;let o=r[t[t.length-1]];if(typeof o=="string")return o;if(typeof o=="boolean"||typeof o=="number")return o.toString()}function er(e){return qr(e)}var os=Object.defineProperty,ns=(e,t,r)=>t in e?os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t,r)=>ns(e,typeof t!="symbol"?t+"":t,r),Qr,ss=Object.defineProperty,is=(e,t,r)=>t in e?ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eo=(e,t,r)=>is(e,typeof t!="symbol"?t+"":t,r),K=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(K||{}),to={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ro={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},mt={};function Cr(e){if(mt[e])return mt[e];let t=globalThis[e],r=t.prototype,o=e in to?to[e]:void 0,n=!!(o&&o.every(c=>{var i,u;return!!((u=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&u.toString().includes("[native code]"))})),s=e in ro?ro[e]:void 0,a=!!(s&&s.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(n&&a)return mt[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let u=i[e].prototype;return document.body.removeChild(c),u?mt[e]=u:r}catch{return r}}var tr={};function Re(e,t,r){var o;let n=`${e}.${String(r)}`;if(tr[n])return tr[n].call(t);let s=Cr(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?(tr[n]=a,a.call(t)):t[r]}var rr={};function bo(e,t,r){let o=`${e}.${String(r)}`;if(rr[o])return rr[o].bind(t);let s=Cr(e)[r];return typeof s!="function"?t[r]:(rr[o]=s,s.bind(t))}function as(e){return Re("Node",e,"childNodes")}function ds(e){return Re("Node",e,"parentNode")}function cs(e){return Re("Node",e,"parentElement")}function us(e){return Re("Node",e,"textContent")}function ls(e,t){return bo("Node",e,"contains")(t)}function hs(e){return bo("Node",e,"getRootNode")()}function fs(e){return!e||!("host"in e)?null:Re("ShadowRoot",e,"host")}function ps(e){return e.styleSheets}function gs(e){return!e||!("shadowRoot"in e)?null:Re("Element",e,"shadowRoot")}function ms(e,t){return Re("Element",e,"querySelector")(t)}function ys(e,t){return Re("Element",e,"querySelectorAll")(t)}function Ss(){return Cr("MutationObserver").constructor}var q={childNodes:as,parentNode:ds,parentElement:cs,textContent:us,contains:ls,getRootNode:hs,host:fs,styleSheets:ps,shadowRoot:gs,querySelector:ms,querySelectorAll:ys,mutationObserver:Ss};function Co(e){return e.nodeType===e.ELEMENT_NODE}function Xe(e){let t=e&&"host"in e&&"mode"in e&&q.host(e)||null;return!!(t&&"shadowRoot"in t&&q.shadowRoot(t)===e)}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function vs(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function bs(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function dr(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.location.href);let o=Array.from(t,n=>wo(n,r)).join("");return vs(o)}catch{return null}}function wo(e,t){if(ws(e)){let r;try{r=dr(e.styleSheet)||bs(e)}catch{r=e.cssText}return e.styleSheet.href?It(r,e.styleSheet.href):r}else{let r=e.cssText;return Es(e)&&e.selectorText.includes(":")&&(r=Cs(r)),t?It(r,t):r}}function Cs(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function ws(e){return"styleSheet"in e}function Es(e){return"selectorText"in e}var wt=class{constructor(){eo(this,"idNodeMap",new Map),eo(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let o=r.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,r)}replace(t,r){let o=this.getNode(t);if(o){let n=this.nodeMetaMap.get(o);n&&this.nodeMetaMap.set(r,n)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Is(){return new wt}function Et({element:e,maskInputOptions:t,tagName:r,type:o,value:n,maskInputFn:s}){let a=n||"",c=o&&Ne(o);return(t[r.toLowerCase()]||c&&t[c])&&(s?a=s(a,e):a="*".repeat(a.length)),a}function Ne(e){return e.toLowerCase()}var oo="__rrweb_original__";function _s(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let o=0;o<e.width;o+=r)for(let n=0;n<e.height;n+=r){let s=t.getImageData,a=oo in s?s[oo]:s;if(new Uint32Array(a.call(t,o,n,Math.min(r,e.width-o),Math.min(r,e.height-n)).data.buffer).some(i=>i!==0))return!1}return!0}function wr(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ne(t):null}function Eo(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let o=/\.([0-9a-z]+)(?:$)/i,n=r.pathname.match(o);return n?.[1]??null}function Rs(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var As=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ds=/^(?:[a-z+]+:)?\/\//i,Ts=/^www\..*/i,Ns=/^(data:)([^,]*),(.*)/i;function It(e,t){return(e||"").replace(As,(r,o,n,s,a,c)=>{let i=n||a||c,u=o||s||"";if(!i)return r;if(Ds.test(i)||Ts.test(i))return`url(${u}${i}${u})`;if(Ns.test(i))return`url(${u}${i}${u})`;if(i[0]==="/")return`url(${u}${Rs(t)+i}${u})`;let d=t.split("/"),l=i.split("/");d.pop();for(let g of l)g!=="."&&(g===".."?d.pop():d.push(g));return`url(${u}${d.join("/")}${u})`})}function or(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Os(e,t){let r=Array.from(t.childNodes),o=[];if(r.length>1&&e&&typeof e=="string"){let n=or(e);for(let s=1;s<r.length;s++)if(r[s].textContent&&typeof r[s].textContent=="string"){let a=or(r[s].textContent);for(let c=3;c<a.length;c++){let i=a.substring(0,c);if(n.split(i).length===2){let u=n.indexOf(i);for(let d=u;d<e.length;d++)if(or(e.substring(0,d)).length===u){o.push(e.substring(0,d)),e=e.substring(d);break}break}}}}return o.push(e),o}function xs(e,t){return Os(e,t).join("/* rr_split */")}var Ms=1,ks=new RegExp("[^a-z0-9-_:]"),et=-2;function Io(){return Ms++}function Ls(e){if(e instanceof HTMLFormElement)return"form";let t=Ne(e.tagName);return ks.test(t)?"div":t}var Fe,no,Ps=/^[^ \t\n\r\u000c]+/,Fs=/^[, \t\n\r\u000c]+/;function Us(e,t){if(t.trim()==="")return t;let r=0;function o(s){let a,c=s.exec(t.substring(r));return c?(a=c[0],r+=a.length,a):""}let n=[];for(;o(Fs),!(r>=t.length);){let s=o(Ps);if(s.slice(-1)===",")s=Ye(e,s.substring(0,s.length-1)),n.push(s);else{let a="";s=Ye(e,s);let c=!1;for(;;){let i=t.charAt(r);if(i===""){n.push((s+a).trim());break}else if(c)i===")"&&(c=!1);else if(i===","){r+=1,n.push((s+a).trim());break}else i==="("&&(c=!0);a+=i,r+=1}}}return n.join(", ")}var so=new WeakMap;function Ye(e,t){return!t||t.trim()===""?t:Er(e,t)}function Hs(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Er(e,t){let r=so.get(e);if(r||(r=e.createElement("a"),so.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function _o(e,t,r,o){return o&&(r==="src"||r==="href"&&!(t==="use"&&o[0]==="#")||r==="xlink:href"&&o[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?Ye(e,o):r==="srcset"?Us(e,o):r==="style"?It(o,Er(e)):t==="object"&&r==="data"?Ye(e,o):o)}function Ro(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function Ys(e,t,r,o){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return!0}if(r)return e.matches(r);if(o&&e.tagName==="IMG"){let n=e.getAttribute("src");if(n&&o.test(n))return!0}}catch{}return!1}function _t(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?_t(q.parentNode(e),t,r):!1;for(let o=e.classList.length;o--;){let n=e.classList[o];if(t.test(n))return!0}return r?_t(q.parentNode(e),t,r):!1}function Ao(e,t,r,o){let n;if(Co(e)){if(n=e,!q.childNodes(n).length)return!1}else{if(q.parentElement(e)===null)return!1;n=q.parentElement(e)}try{if(typeof t=="string"){if(o){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(_t(n,t,o))return!0;if(r){if(o){if(n.closest(r))return!0}else if(n.matches(r))return!0}if(n.getAttribute("contenteditable")||n.closest('[contenteditable="true"]'))return!0}catch{}return!1}function Vs(e,t,r){let o=e.contentWindow;if(!o)return;let n=!1,s;try{s=o.document.readyState}catch{return}if(s!=="complete"){let c=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(c),n=!0,t()});return}let a="about:blank";if(o.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Ws(e,t,r){let o=!1,n;try{n=e.sheet}catch{return}if(n)return;let s=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(s),o=!0,t()})}function Bs(e,t){let{doc:r,mirror:o,blockClass:n,blockSelector:s,needsMask:a,inlineStylesheet:c,maskInputOptions:i={},maskTextFn:u,maskInputFn:d,maskAnchorHrefFn:l,blockImgSrcPattern:g,blockImgSrcFillOptions:f,dataURLOptions:p={},inlineImages:h,recordCanvas:C,keepIframeSrcFn:I,newlyAddedElement:v=!1,cssCaptured:y=!1}=t,_=zs(r,o);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:K.Document,childNodes:[],compatMode:e.compatMode}:{type:K.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:K.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return Ks(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:c,maskInputOptions:i,maskInputFn:d,maskAnchorHrefFn:l,blockImgSrcPattern:g,blockImgSrcFillOptions:f,dataURLOptions:p,inlineImages:h,recordCanvas:C,keepIframeSrcFn:I,newlyAddedElement:v,rootId:_});case e.TEXT_NODE:return Gs(e,{doc:r,needsMask:a,maskTextFn:u,rootId:_,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:K.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:K.Comment,textContent:q.textContent(e)||"",rootId:_};default:return!1}}function zs(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Gs(e,t){let{needsMask:r,maskTextFn:o,rootId:n,cssCaptured:s}=t,a=q.parentNode(e),c=a&&a.tagName,i="",u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0;return d?i="SCRIPT_PLACEHOLDER":s||(i=q.textContent(e),u&&i&&(i=It(i,Er(t.doc)))),!u&&!d&&i&&r&&(i=o?o(i,q.parentElement(e)):i.replace(/[\S]/g,"*")),{type:K.Text,textContent:i||"",rootId:n}}function Ks(e,t){let{doc:r,blockClass:o,blockSelector:n,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:c,maskAnchorHrefFn:i,blockImgSrcPattern:u,blockImgSrcFillOptions:d,dataURLOptions:l={},inlineImages:g,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:C}=t,I=Ys(e,o,n,u),v=Ls(e),y={},_=e.attributes.length;for(let m=0;m<_;m++){let E=e.attributes[m];Ro(v,E.name,E.value)||(y[E.name]=_o(r,v,Ne(E.name),E.value))}if(v==="a"&&i&&typeof y.href=="string"&&(y.href=i(y.href,e)),v==="link"&&s){let m=Array.from(r.styleSheets).find(w=>w.href===e.href);if(!m&&e.href.includes(".css")){let w=window.location.origin,D=e.href.replace(window.location.href,""),L=w+"/"+D;m=Array.from(r.styleSheets).find(oe=>oe.href===L)}let E=null;m&&(E=dr(m)),E&&(delete y.rel,delete y.href,y._cssText=E)}if(v==="style"&&e.sheet){let m=dr(e.sheet);m&&(e.childNodes.length>1&&(m=xs(m,e)),y._cssText=m)}if(v==="input"||v==="textarea"||v==="select"){let m=e.value,E=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&m?y.value=Et({element:e,type:wr(e),tagName:v,value:m,maskInputOptions:a,maskInputFn:c}):E&&(y.checked=E)}if(v==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),v==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),v==="canvas"&&f){if(e.__context==="2d")_s(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let m=e.toDataURL(l.type,l.quality),E=r.createElement("canvas");E.width=e.width,E.height=e.height;let w=E.toDataURL(l.type,l.quality);m!==w&&(y.rr_dataURL=m)}}if(v==="img"&&g){Fe||(Fe=r.createElement("canvas"),no=Fe.getContext("2d"));let m=e,E=m.currentSrc||m.getAttribute("src")||"<unknown-src>",w=m.crossOrigin,D=()=>{m.removeEventListener("load",D);try{Fe.width=m.naturalWidth,Fe.height=m.naturalHeight,no.drawImage(m,0,0),y.rr_dataURL=Fe.toDataURL(l.type,l.quality)}catch(L){if(m.crossOrigin!=="anonymous"){m.crossOrigin="anonymous",m.complete&&m.naturalWidth!==0?D():m.addEventListener("load",D);return}else console.warn(`Cannot inline img src=${E}! Error: ${L}`)}m.crossOrigin==="anonymous"&&(w?y.crossOrigin=w:m.removeAttribute("crossorigin"))};m.complete&&m.naturalWidth!==0?D():m.addEventListener("load",D)}if(v==="audio"||v==="video"){let m=y;m.rr_mediaState=e.paused?"paused":"played",m.rr_mediaCurrentTime=e.currentTime,m.rr_mediaPlaybackRate=e.playbackRate,m.rr_mediaMuted=e.muted,m.rr_mediaLoop=e.loop,m.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),I){let{width:m,height:E}=e.getBoundingClientRect();y={class:y.class,rr_width:`${m}px`,rr_height:`${E}px`}}I&&v==="img"&&(y={...y,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP89v3nfwAJuAPnyTr4jAAAAABJRU5ErkJggg==",rr_fill:d.backgroundColor,rr_stroke:d.strokeColor,rr_stroke_width:d.strokeWidth}),v==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let A;try{customElements.get(v)&&(A=!0)}catch{}return{type:K.Element,tagName:v,attributes:y,childNodes:[],isSVG:Hs(e)||void 0,needBlock:I,rootId:C,isCustom:A}}function U(e){return e==null?"":e.toLowerCase()}function js(e,t){if(t.comment&&e.type===K.Comment)return!0;if(e.type===K.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Eo(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(U(e.attributes.name).match(/^msapplication-tile(image|color)$/)||U(e.attributes.name)==="application-name"||U(e.attributes.rel)==="icon"||U(e.attributes.rel)==="apple-touch-icon"||U(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&U(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(U(e.attributes.property).match(/^(og|twitter|fb):/)||U(e.attributes.name).match(/^(og|twitter):/)||U(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(U(e.attributes.name)==="robots"||U(e.attributes.name)==="googlebot"||U(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(U(e.attributes.name)==="author"||U(e.attributes.name)==="generator"||U(e.attributes.name)==="framework"||U(e.attributes.name)==="publisher"||U(e.attributes.name)==="progid"||U(e.attributes.property).match(/^article:/)||U(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(U(e.attributes.name)==="google-site-verification"||U(e.attributes.name)==="yandex-verification"||U(e.attributes.name)==="csrf-token"||U(e.attributes.name)==="p:domain_verify"||U(e.attributes.name)==="verify-v1"||U(e.attributes.name)==="verification"||U(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ve(e,t){if(e.nodeName.toLowerCase().includes("grammarly"))return null;let{doc:r,mirror:o,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:i=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:l,maskInputFn:g,maskAnchorHrefFn:f,blockImgSrcPattern:p,blockImgSrcFillOptions:h,slimDOMOptions:C,dataURLOptions:I={},inlineImages:v=!1,recordCanvas:y=!1,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:m=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:D=()=>!1,newlyAddedElement:L=!1,cssCaptured:oe=!1}=t,{needsMask:H}=t,{preserveWhiteSpace:ne=!0}=t;H||(H=Ao(e,a,c,H===void 0));let G=Bs(e,{doc:r,mirror:o,blockClass:n,blockSelector:s,needsMask:H,inlineStylesheet:u,maskInputOptions:d,maskTextFn:l,maskInputFn:g,maskAnchorHrefFn:f,blockImgSrcPattern:p,blockImgSrcFillOptions:h,dataURLOptions:I,inlineImages:v,recordCanvas:y,keepIframeSrcFn:D,newlyAddedElement:L,cssCaptured:oe});if(!G)return console.warn(e,"not serialized"),null;let V;o.hasNode(e)?V=o.getId(e):js(G,C)||!ne&&G.type===K.Text&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?V=et:V=Io();let R=Object.assign(G,{id:V});if(o.add(e,R),V===et)return null;_&&_(e);let Y=!i;if(R.type===K.Element){Y=Y&&!R.needBlock,delete R.needBlock;let P=q.shadowRoot(e);P&&qe(P)&&(R.isShadowHost=!0)}if((R.type===K.Document||R.type===K.Element)&&Y){C.headWhitespace&&R.type===K.Element&&R.tagName==="head"&&(ne=!1);let P={doc:r,mirror:o,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:u,maskInputOptions:d,maskTextFn:l,maskInputFn:g,maskAnchorHrefFn:f,blockImgSrcPattern:p,blockImgSrcFillOptions:h,slimDOMOptions:C,dataURLOptions:I,inlineImages:v,recordCanvas:y,preserveWhiteSpace:ne,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:m,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:D,cssCaptured:!1};if(!(R.type===K.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===K.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(P.cssCaptured=!0);for(let j of Array.from(q.childNodes(e))){let J=Ve(j,P);J&&R.childNodes.push(J)}}let Z=null;if(Co(e)&&(Z=q.shadowRoot(e)))for(let j of Array.from(q.childNodes(Z))){let J=Ve(j,P);J&&(qe(Z)&&(J.isShadow=!0),R.childNodes.push(J))}}let $=q.parentNode(e);return $&&Xe($)&&qe($)&&(R.isShadow=!0),R.type===K.Element&&R.tagName==="iframe"&&Vs(e,()=>{let P=e.contentDocument;if(P&&A){let Z=Ve(P,{doc:P,mirror:o,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:l,maskInputFn:g,maskAnchorHrefFn:f,blockImgSrcPattern:p,blockImgSrcFillOptions:h,slimDOMOptions:C,dataURLOptions:I,inlineImages:v,recordCanvas:y,preserveWhiteSpace:ne,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:m,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:D});Z&&A(e,Z)}},m),R.type===K.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&Eo(R.attributes.href)==="css")&&Ws(e,()=>{if(E){let P=Ve(e,{doc:r,mirror:o,blockClass:n,blockSelector:s,needsMask:H,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:l,maskInputFn:g,maskAnchorHrefFn:f,blockImgSrcPattern:p,blockImgSrcFillOptions:h,slimDOMOptions:C,dataURLOptions:I,inlineImages:v,recordCanvas:y,preserveWhiteSpace:ne,onSerialize:_,onIframeLoad:A,iframeLoadTimeout:m,onStylesheetLoad:E,stylesheetLoadTimeout:w,keepIframeSrcFn:D});P&&E(e,P)}},w),R}function $s(e,t){let{mirror:r=new wt,blockClass:o="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=!0,inlineImages:i=!1,recordCanvas:u=!1,maskAllInputs:d=!1,maskTextFn:l,maskInputFn:g,maskAnchorHrefFn:f,blockImgSrcPattern:p=null,blockImgSrcFillOptions:h={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},slimDOM:C=!1,dataURLOptions:I,preserveWhiteSpace:v,onSerialize:y,onIframeLoad:_,iframeLoadTimeout:A,onStylesheetLoad:m,stylesheetLoadTimeout:E,keepIframeSrcFn:w=()=>!1}=t||{};return Ve(e,{doc:e,mirror:r,blockClass:o,blockSelector:n,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d===!0?{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}:d===!1?{password:!0}:d,maskTextFn:l,maskInputFn:g,maskAnchorHrefFn:f,blockImgSrcPattern:p,blockImgSrcFillOptions:h,slimDOMOptions:C===!0||C==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:C==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:C===!1?{}:C,dataURLOptions:I,inlineImages:i,recordCanvas:u,preserveWhiteSpace:v,onSerialize:y,onIframeLoad:_,iframeLoadTimeout:A,onStylesheetLoad:m,stylesheetLoadTimeout:E,keepIframeSrcFn:w,newlyAddedElement:!1})}var cr=class e{constructor(...t){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}},io={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ao={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},yt={};function Ir(e){if(yt[e])return yt[e];let t=globalThis[e],r=t.prototype,o=e in io?io[e]:void 0,n=!!(o&&o.every(c=>{var i,u;return!!((u=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&u.toString().includes("[native code]"))})),s=e in ao?ao[e]:void 0,a=!!(s&&s.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(n&&a)return yt[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let u=i[e].prototype;return document.body.removeChild(c),u?yt[e]=u:r}catch{return r}}var nr={};function Ae(e,t,r){var o;let n=`${e}.${String(r)}`;if(nr[n])return nr[n].call(t);let s=Ir(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?(nr[n]=a,a.call(t)):t[r]}var sr={};function Do(e,t,r){let o=`${e}.${String(r)}`;if(sr[o])return sr[o].bind(t);let s=Ir(e)[r];return typeof s!="function"?t[r]:(sr[o]=s,s.bind(t))}function Zs(e){return Ae("Node",e,"childNodes")}function Js(e){return Ae("Node",e,"parentNode")}function Xs(e){return Ae("Node",e,"parentElement")}function qs(e){return Ae("Node",e,"textContent")}function Qs(e,t){return Do("Node",e,"contains")(t)}function ei(e){return Do("Node",e,"getRootNode")()}function ti(e){return!e||!("host"in e)?null:Ae("ShadowRoot",e,"host")}function ri(e){return e.styleSheets}function oi(e){return!e||!("shadowRoot"in e)?null:Ae("Element",e,"shadowRoot")}function ni(e,t){return Ae("Element",e,"querySelector")(t)}function si(e,t){return Ae("Element",e,"querySelectorAll")(t)}function To(){return Ir("MutationObserver").constructor}var T={childNodes:Zs,parentNode:Js,parentElement:Xs,textContent:qs,contains:Qs,getRootNode:ei,host:ti,styleSheets:ri,shadowRoot:oi,querySelector:ni,querySelectorAll:si,mutationObserver:To};function ee(e,t,r=document){let o={capture:!0,passive:!0};return r.addEventListener(e,t,o),()=>r.removeEventListener(e,t,o)}var Ue=`Please stop import mirror directly. Instead of that,\r
|
|
52
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
53
|
-
or you can use record.mirror to access the mirror instance during recording.`,hi={map:{},getId(){return console.error(qe),-1},getNode(){return console.error(qe),null},removeNodeFromMap(){console.error(qe)},has(){return console.error(qe),!1},reset(){console.error(qe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(hi=new Proxy(hi,{get(s,e,t){return e==="map"&&console.error(qe),Reflect.get(s,e,t)}}));function kt(s,e,t={}){let r=null,n=0;return function(...o){let i=Date.now();!n&&t.leading===!1&&(n=i);let l=e-(i-n),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),n=i,s.apply(a,o)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{n=t.leading===!1?0:Date.now(),r=null,s.apply(a,o)},l))}}function Qr(s,e,t,r,n=window){let o=n.Object.getOwnPropertyDescriptor(s,e);return n.Object.defineProperty(s,e,r?t:{set(i){setTimeout(()=>{t.set.call(this,i)},0),o&&o.set&&o.set.call(this,i)}}),()=>Qr(s,e,o||{},!0)}function ct(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],n=t(r);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=n,()=>{s[e]=r}}catch{return()=>{}}}var Ur=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ur=()=>new Date().getTime());function Xa(s){var e,t,r,n;let o=s.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=D.parentElement(o.body))==null?void 0:e.scrollLeft)||((t=o?.body)==null?void 0:t.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=D.parentElement(o.body))==null?void 0:r.scrollTop)||((n=o?.body)==null?void 0:n.scrollTop)||0}}function qa(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Qa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function el(s){return s?s.nodeType===s.ELEMENT_NODE?s:D.parentElement(s):null}function ie(s,e,t,r){if(!s)return!1;let n=el(s);if(!n)return!1;try{if(typeof e=="string"){if(n.classList.contains(e)||r&&n.closest("."+e)!==null)return!0}else if(Dr(n,e,r))return!0}catch{}return!!(t&&(n.matches(t)||r&&n.closest(t)!==null))}function ap(s,e){return e.getId(s)!==-1}function ks(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===It}function tl(s,e){if(bt(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=D.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?tl(r,e):!0}function mn(s){return!!s.changedTouches}function lp(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function rl(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function sl(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function gn(s){return s?s instanceof pn&&"shadowRoot"in s?!!s.shadowRoot:!!D.shadowRoot(s):!1}var yn=class{constructor(){C(this,"id",1),C(this,"styleIDMap",new WeakMap),C(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 nl(s){var e;let t=null;return"getRootNode"in s&&((e=D.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&D.host(D.getRootNode(s))&&(t=D.host(D.getRootNode(s))),t}function up(s){let e=s,t;for(;t=nl(e);)e=t;return e}function cp(s){let e=s.ownerDocument;if(!e)return!1;let t=up(s);return D.contains(e,t)}function ol(s){let e=s.ownerDocument;return e?D.contains(e,s)||cp(s):!1}var k=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(k||{}),T=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(T||{}),de=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(de||{}),Te=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(Te||{}),ut=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(ut||{}),Qe=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Qe||{});function fi(s){return"__ln"in s}var wn=class{constructor(){C(this,"length",0),C(this,"head",null),C(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&fi(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&fi(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},pi=(s,e)=>`${s}@${e}`,Sn=class{constructor(){C(this,"frozen",!1),C(this,"locked",!1),C(this,"texts",[]),C(this,"attributes",[]),C(this,"attributeMap",new WeakMap),C(this,"removes",[]),C(this,"mapRemoves",[]),C(this,"movedMap",{}),C(this,"addedSet",new Set),C(this,"movedSet",new Set),C(this,"droppedSet",new Set),C(this,"mutationCb"),C(this,"blockClass"),C(this,"blockSelector"),C(this,"maskTextClass"),C(this,"maskTextSelector"),C(this,"inlineStylesheet"),C(this,"maskInputOptions"),C(this,"maskTextFn"),C(this,"maskInputFn"),C(this,"maskAnchorHrefFn"),C(this,"blockImgSrcPattern"),C(this,"blockImgSrcFillOptions"),C(this,"keepIframeSrcFn"),C(this,"recordCanvas"),C(this,"inlineImages"),C(this,"slimDOMOptions"),C(this,"dataURLOptions"),C(this,"doc"),C(this,"mirror"),C(this,"iframeManager"),C(this,"stylesheetManager"),C(this,"shadowDomManager"),C(this,"canvasManager"),C(this,"processedNodeManager"),C(this,"unattachedDoc"),C(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),C(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new wn,n=a=>{let u=a,c=It;for(;c===It;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},o=a=>{let u=D.parentNode(a);if(!u||!ol(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let g=u.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let d=bt(u)?this.mirror.getId(nl(a)):this.mirror.getId(u),p=n(a);if(d===-1||p===-1)return r.addNode(a);let m=tt(a,{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,maskAnchorHrefFn:this.maskAnchorHrefFn,blockImgSrcPattern:this.blockImgSrcPattern,blockImgSrcFillOptions:this.blockImgSrcFillOptions,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:g=>{rl(g,this.mirror)&&this.iframeManager.addIframe(g),sl(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),gn(a)&&this.shadowDomManager.addShadowRoot(D.shadowRoot(a),this.doc)},onIframeLoad:(g,f)=>{this.iframeManager.attachIframe(g,f),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,f)=>{this.stylesheetManager.attachLinkElement(g,f)},cssCaptured:c});m&&(e.push({parentId:d,nextId:p,node:m}),t.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)mi(this.removes,a,this.mirror)&&!this.movedSet.has(D.parentNode(a))||o(a);for(let a of this.addedSet)!gi(this.droppedSet,a)&&!mi(this.removes,a,this.mirror)||gi(this.movedSet,a)?o(a):this.droppedSet.add(a);let i=null;for(;r.length;){let a=null;if(i){let u=this.mirror.getId(D.parentNode(i.value)),c=n(i.value);u!==-1&&c!==-1&&(a=i)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let d=this.mirror.getId(D.parentNode(c.value));if(n(c.value)===-1)continue;if(d!==-1){a=c;break}else{let m=c.value,g=D.parentNode(m);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=D.host(g);if(this.mirror.getId(f)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}i=a.previous,r.removeNode(a.value),o(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=D.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),d=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+d).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l))}),C(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));let r=t.attributes.value=Array.from(D.childNodes(e),n=>D.textContent(n)||"").join("");t.attributes.value=_r({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:null,value:r,maskInputFn:this.maskInputFn})}),C(this,"processMutation",e=>{if(!ks(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=D.textContent(e.target);!ie(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Di(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,el(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,n=e.target.getAttribute(r);if(r==="value"){let l=An(t);n=_r({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:l,value:n,maskInputFn:this.maskInputFn})}let o=ie(e.target,this.blockClass,this.blockSelector,!1);if(o&&r==="style"){let l=e.target,{width:a,height:u}=l.getBoundingClientRect(),c=this.attributeMap.get(e.target);c||(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(c),this.attributeMap.set(e.target,c)),c.attributes.rr_width=`${a}px`,c.attributes.rr_height=`${u}px`}if(o||n===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(n))if(!t.contentDocument)r="rr_src";else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Oi(t.tagName,r))if(i.attributes[r]=_i(this.doc,Be(t.tagName),Be(r),n),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let l=this.unattachedDoc.createElement("span");e.oldValue&&l.setAttribute("style",e.oldValue);for(let a of Array.from(t.style)){let u=t.style.getPropertyValue(a),c=t.style.getPropertyPriority(a);u!==l.style.getPropertyValue(a)||c!==l.style.getPropertyPriority(a)?c===""?i.styleDiff[a]=u:i.styleDiff[a]=[u,c]:i._unchangedStyles[a]=[u,c]}for(let a of Array.from(l.style))t.style.getPropertyValue(a)===""&&(i.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":{if(ie(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),n=bt(e.target)?this.mirror.getId(D.host(e.target)):this.mirror.getId(e.target);ie(e.target,this.blockClass,this.blockSelector,!1)||ks(t,this.mirror,this.slimDOMOptions)||!ap(t,this.mirror)||(this.addedSet.has(t)?(vn(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||tl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[pi(r,n)]?vn(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:bt(e.target)&&Et(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}}}),C(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(ks(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[pi(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ie(e,this.blockClass,this.blockSelector,!1)||(D.childNodes(e).forEach(r=>this.genAdds(r)),gn(e)&&D.childNodes(D.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAnchorHrefFn","blockImgSrcPattern","blockImgSrcFillOptions","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 vn(s,e){s.delete(e),D.childNodes(e).forEach(t=>vn(s,t))}function mi(s,e,t){return s.length===0?!1:dp(s,e,t)}function dp(s,e,t){let r=D.parentNode(e);for(;r;){let n=t.getId(r);if(s.some(o=>o.id===n))return!0;r=D.parentNode(r)}return!1}function gi(s,e){return s.size===0?!1:il(s,e)}function il(s,e){let t=D.parentNode(e);return t?s.has(t)?!0:il(s,t):!1}var Rt;function hp(s){Rt=s}function fp(){Rt=void 0}var M=s=>Rt?(...t)=>{try{return s(...t)}catch(r){if(Rt&&Rt(r)===!0)return;throw r}}:s,He=[];function Ut(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function al(s,e){let t=new Sn;He.push(t),t.init(s);let r=new(Za())(M(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function pp({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let n=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,i=[],l,a=kt(M(d=>{let p=Date.now()-l;s(i.map(m=>(m.timeOffset-=p,m)),d),i=[],l=null}),o),u=M(kt(M(d=>{let p=Ut(d),{clientX:m,clientY:g}=mn(d)?d.changedTouches[0]:d;l||(l=Ur()),i.push({x:m,y:g,id:r.getId(p),timeOffset:Ur()-l}),a(typeof DragEvent<"u"&&d instanceof DragEvent?T.Drag:d instanceof MouseEvent?T.MouseMove:T.TouchMove)}),n,{trailing:!1})),c=[oe("mousemove",u,t),oe("touchmove",u,t),oe("drag",u,t)];return M(()=>{c.forEach(d=>d())})}function mp({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],a=null,u=c=>d=>{let p=Ut(d);if(ie(p,r,n,!0))return;let m=null,g=c;if("pointerType"in d){switch(d.pointerType){case"mouse":m=Te.Mouse;break;case"touch":m=Te.Touch;break;case"pen":m=Te.Pen;break}m===Te.Touch?de[c]===de.MouseDown?g="TouchStart":de[c]===de.MouseUp&&(g="TouchEnd"):Te.Pen}else mn(d)&&(m=Te.Touch);m!==null?(a=m,(g.startsWith("Touch")&&m===Te.Touch||g.startsWith("Mouse")&&m===Te.Mouse)&&(m=null)):de[c]===de.Click&&(m=a,a=null);let f=mn(d)?d.changedTouches[0]:d;if(!f)return;let h=t.getId(p),{clientX:E,clientY:S}=f;M(s)({type:de[g],id:h,x:E,y:S,...m!==null&&{pointerType:m}})};return Object.keys(de).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{let d=Be(c),p=u(c);if(window.PointerEvent)switch(de[c]){case de.MouseDown:case de.MouseUp:d=d.replace("mouse","pointer");break;case de.TouchStart:case de.TouchEnd:return}l.push(oe(d,p,e))}),M(()=>{l.forEach(c=>c())})}function ll({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,sampling:o}){let i=M(kt(M(l=>{let a=Ut(l);if(!a||ie(a,r,n,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Xa(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),o.scroll||100));return oe("scroll",i,e)}function gp({viewportResizeCb:s},{win:e}){let t=-1,r=-1,n=M(kt(M(()=>{let o=qa(),i=Qa();(t!==o||r!==i)&&(s({width:Number(i),height:Number(o)}),t=o,r=i)}),200));return oe("resize",n,e)}var yp=["INPUT","TEXTAREA","SELECT"],yi=new WeakMap;function wp({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function d(S){let w=Ut(S),I=S.isTrusted,_=w&&w.tagName;if(w&&_==="OPTION"&&(w=D.parentElement(w)),!w||!_||yp.indexOf(_)<0||ie(w,r,n,!0)||w.classList.contains(o)||i&&w.matches(i))return;let y=w.value,R=!1,v=An(w)||"";v==="radio"||v==="checkbox"?R=w.checked:(l[_.toLowerCase()]||l[v])&&(y=_r({element:w,maskInputOptions:l,tagName:_,type:v,value:y,maskInputFn:a})),p(w,c?{text:y,isChecked:R,userTriggered:I}:{text:y,isChecked:R});let x=w.name;v==="radio"&&x&&R&&e.querySelectorAll(`input[type="radio"][name="${Sp(x)}"]`).forEach(O=>{if(O!==w){let le=O.value;p(O,c?{text:le,isChecked:!R,userTriggered:!1}:{text:le,isChecked:!R})}})}function p(S,w){let I=yi.get(S);if(!I||I.text!==w.text||I.isChecked!==w.isChecked){yi.set(S,w);let _=t.getId(S);M(s)({...w,id:_})}}let g=(u.input==="last"?["change"]:["input","change"]).map(S=>oe(S,M(d),e)),f=e.defaultView;if(!f)return()=>{g.forEach(S=>S())};let h=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),E=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return h&&h.set&&g.push(...E.map(S=>Qr(S[0],S[1],{set(){M(d)({target:this,isTrusted:!1})}},!1,f))),M(()=>{g.forEach(S=>S())})}function zr(s){let e=[];function t(r,n){if(Sr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Sr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Sr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Sr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let i=Array.from(r.parentRule.cssRules).indexOf(r);n.unshift(i)}else if(r.parentStyleSheet){let i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);n.unshift(i)}return n}return t(s,e)}function Sp(s){return s.replace(/["\\]/g,"\\$&")}function Fe(s,e,t){let r,n;return s?(s.ownerNode?r=e.getId(s.ownerNode):n=t.getId(s),{styleId:n,id:r}):{}}function vp({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:M((c,d,p)=>{let[m,g]=p,{id:f,styleId:h}=Fe(d,e,t.styleMirror);return(f&&f!==-1||h&&h!==-1)&&s({id:f,styleId:h,adds:[{rule:m,index:g}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,d,p=this.cssRules.length){let m=`${c} { ${d} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[m,p])};let o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,removes:[{index:m}]}),c.apply(d,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,replace:m}),c.apply(d,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:M((c,d,p)=>{let[m]=p,{id:g,styleId:f}=Fe(d,e,t.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,replaceSync:m}),c.apply(d,p)})}));let a={};vr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(vr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),vr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),vr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,d])=>{u[c]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(u[c].insertRule,{apply:M((p,m,g)=>{let[f,h]=g,{id:E,styleId:S}=Fe(m.parentStyleSheet,e,t.styleMirror);return(E&&E!==-1||S&&S!==-1)&&s({id:E,styleId:S,adds:[{rule:f,index:[...zr(m),h||0]}]}),p.apply(m,g)})}),d.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:M((p,m,g)=>{let[f]=g,{id:h,styleId:E}=Fe(m.parentStyleSheet,e,t.styleMirror);return(h&&h!==-1||E&&E!==-1)&&s({id:h,styleId:E,removes:[{index:[...zr(m),f]}]}),p.apply(m,g)})})}),M(()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,d])=>{d.prototype.insertRule=u[c].insertRule,d.prototype.deleteRule=u[c].deleteRule})})}function ul({mirror:s,stylesheetManager:e},t){var r,n,o;let i=null;t.nodeName==="#document"?i=s.getId(t):i=s.getId(D.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(o=(n=t.ownerDocument)==null?void 0:n.defaultView)==null?void 0:o.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return i===null||i===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let d=(c=a.set)==null?void 0:c.call(this,u);if(i!==null&&i!==-1)try{e.adoptStyleSheets(u,i)}catch{}return d}}),M(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Cp({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:n}){let o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:M((l,a,u)=>{var c;let[d,p,m]=u;if(t.has(d))return o.apply(a,[d,p,m]);let{id:g,styleId:f}=Fe((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||f&&f!==-1)&&s({id:g,styleId:f,set:{property:d,value:p,priority:m},index:zr(a.parentRule)}),l.apply(a,u)})});let i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:M((l,a,u)=>{var c;let[d]=u;if(t.has(d))return i.apply(a,[d]);let{id:p,styleId:m}=Fe((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,remove:{property:d},index:zr(a.parentRule)}),l.apply(a,u)})}),M(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}function bp({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:n,doc:o}){let i=M(a=>kt(M(u=>{let c=Ut(u);if(!c||ie(c,e,t,!0))return;let{currentTime:d,volume:p,muted:m,playbackRate:g,loop:f}=c;s({type:a,id:r.getId(c),currentTime:d,volume:p,muted:m,playbackRate:g,loop:f})}),n.media||500)),l=[oe("play",i(Qe.Play),o),oe("pause",i(Qe.Pause),o),oe("seeked",i(Qe.Seeked),o),oe("volumechange",i(Qe.VolumeChange),o),oe("ratechange",i(Qe.RateChange),o)];return M(()=>{l.forEach(a=>a())})}function Ep({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],n=new WeakMap,o=t.FontFace;t.FontFace=function(a,u,c){let d=new o(a,u,c);return n.set(d,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),d};let i=ct(e.fonts,"add",function(l){return function(a){return setTimeout(M(()=>{let u=n.get(a);u&&(s(u),n.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=o}),r.push(i),M(()=>{r.forEach(l=>l())})}function Rp(s){let{doc:e,mirror:t,blockClass:r,blockSelector:n,selectionCb:o}=s,i=!0,l=M(()=>{let a=e.getSelection();if(!a||i&&a?.isCollapsed)return;i=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let d=0;d<c;d++){let p=a.getRangeAt(d),{startContainer:m,startOffset:g,endContainer:f,endOffset:h}=p;ie(m,r,n,!0)||ie(f,r,n,!0)||u.push({start:t.getId(m),startOffset:g,end:t.getId(f),endOffset:h})}o({ranges:u})});return l(),oe("selectionchange",l)}function Ip({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:ct(t.customElements,"define",function(n){return function(o,i,l){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,i,l])}})}function xp(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:p,selectionCb:m,customElementCb:g}=s;s.mutationCb=(...f)=>{e.mutation&&e.mutation(...f),t(...f)},s.mousemoveCb=(...f)=>{e.mousemove&&e.mousemove(...f),r(...f)},s.mouseInteractionCb=(...f)=>{e.mouseInteraction&&e.mouseInteraction(...f),n(...f)},s.scrollCb=(...f)=>{e.scroll&&e.scroll(...f),o(...f)},s.viewportResizeCb=(...f)=>{e.viewportResize&&e.viewportResize(...f),i(...f)},s.inputCb=(...f)=>{e.input&&e.input(...f),l(...f)},s.mediaInteractionCb=(...f)=>{e.mediaInteaction&&e.mediaInteaction(...f),a(...f)},s.styleSheetRuleCb=(...f)=>{e.styleSheetRule&&e.styleSheetRule(...f),u(...f)},s.styleDeclarationCb=(...f)=>{e.styleDeclaration&&e.styleDeclaration(...f),c(...f)},s.canvasMutationCb=(...f)=>{e.canvasMutation&&e.canvasMutation(...f),d(...f)},s.fontCb=(...f)=>{e.font&&e.font(...f),p(...f)},s.selectionCb=(...f)=>{e.selection&&e.selection(...f),m(...f)},s.customElementCb=(...f)=>{e.customElement&&e.customElement(...f),g(...f)}}function Ap(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};xp(s,e);let r;s.recordDOM&&(r=al(s,s.doc));let n=pp(s),o=mp(s),i=ll(s),l=gp(s,{win:t}),a=wp(s),u=bp(s),c=()=>{},d=()=>{},p=()=>{},m=()=>{};s.recordDOM&&(c=vp(s,{win:t}),d=ul(s,s.doc),p=Cp(s,{win:t}),s.collectFonts&&(m=Ep(s)));let g=Rp(s),f=Ip(s),h=[];for(let E of s.plugins)h.push(E.observer(E.callback,t,E.options));return M(()=>{He.forEach(E=>E.reset()),r?.disconnect(),n(),o(),i(),l(),a(),u(),c(),d(),p(),m(),g(),f(),h.forEach(E=>E())})}function Sr(s){return typeof window[s]<"u"}function vr(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var Hr=class{constructor(e){C(this,"iframeIdToRemoteIdMap",new WeakMap),C(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){let o=r||this.getIdToRemoteIdMap(e),i=n||this.getRemoteIdToIdMap(e),l=o.get(t);return l||(l=this.generateIdFn(),o.set(t,l),i.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(o=>this.getId(e,o,r,n))}getRemoteId(e,t,r){let n=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let o=n.get(t);return o||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(n=>this.getRemoteId(e,n,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},Cn=class{constructor(e){C(this,"iframes",new WeakMap),C(this,"crossOriginIframeMap",new WeakMap),C(this,"crossOriginIframeMirror",new Hr(Ai)),C(this,"crossOriginIframeStyleMirror"),C(this,"crossOriginIframeRootIdMap",new WeakMap),C(this,"mirror"),C(this,"mutationCb"),C(this,"wrappedEmit"),C(this,"loadListener"),C(this,"stylesheetManager"),C(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Hr(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 r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(n=this.loadListener)==null||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){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let o=this.transformCrossOriginEvent(n,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:k.IncrementalSnapshot,data:{source:T.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Plugin:return t;case k.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case k.IncrementalSnapshot:switch(t.data.source){case T.Mutation:return t.data.adds.forEach(n=>{this.replaceIds(n,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(n.node,o)}),t.data.removes.forEach(n=>{this.replaceIds(n,e,["parentId","id"])}),t.data.attributes.forEach(n=>{this.replaceIds(n,e,["id"])}),t.data.texts.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case T.Drag:case T.TouchMove:case T.MouseMove:return t.data.positions.forEach(n=>{this.replaceIds(n,e,["id"])}),t;case T.ViewportResize:return!1;case T.MediaInteraction:case T.MouseInteraction:case T.Scroll:case T.CanvasMutation:case T.Input:return this.replaceIds(t.data,e,["id"]),t;case T.StyleSheetRule:case T.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case T.Font:return t;case T.Selection:return t.data.ranges.forEach(n=>{this.replaceIds(n,e,["start","end"])}),t;case T.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(n=>{this.replaceStyleIds(n,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(let o of n)!Array.isArray(t[o])&&typeof t[o]!="number"||(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==q.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},bn=class{constructor(e){C(this,"shadowDoms",new WeakSet),C(this,"mutationCb"),C(this,"scrollCb"),C(this,"bypassOptions"),C(this,"mirror"),C(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(!Et(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=al({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ll({...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(D.host(e))),this.restoreHandlers.push(ul({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){let r=this;this.restoreHandlers.push(ct(e.prototype,"attachShadow",function(n){return function(o){let i=n.call(this,o),l=D.shadowRoot(this);return l&&ol(this)&&r.addShadowRoot(l,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_p=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Ct=0;Ct<rt.length;Ct++)_p[rt.charCodeAt(Ct)]=Ct;var Ct,Op=function(s){var e=new Uint8Array(s),t,r=e.length,n="";for(t=0;t<r;t+=3)n+=rt[e[t]>>2],n+=rt[(e[t]&3)<<4|e[t+1]>>4],n+=rt[(e[t+1]&15)<<2|e[t+2]>>6],n+=rt[e[t+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n},wi=new Map;function Dp(s,e){let t=wi.get(s);return t||(t=new Map,wi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var cl=(s,e,t)=>{if(!s||!(hl(s,e)||typeof s=="object"))return;let r=s.constructor.name,n=Dp(t,r),o=n.indexOf(s);return o===-1&&(o=n.length,n.push(s)),o};function Ir(s,e,t){if(s instanceof Array)return s.map(r=>Ir(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,n=Op(s);return{rr_type:r,base64:n}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ir(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:n}=s;return{rr_type:r,src:n}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",n=s.toDataURL();return{rr_type:r,src:n}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ir(s.data,e,t),s.width,s.height]};if(hl(s,e)||typeof s=="object"){let r=s.constructor.name,n=cl(s,e,t);return{rr_type:r,index:n}}}}return s}var dl=(s,e,t)=>s.map(r=>Ir(r,e,t)),hl=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof e[n]=="function").find(n=>s instanceof e[n]);function Tp(s,e,t,r){let n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let i of o)try{if(typeof e.CanvasRenderingContext2D.prototype[i]!="function")continue;let l=ct(e.CanvasRenderingContext2D.prototype,i,function(a){return function(...u){return ie(this.canvas,t,r,!0)||setTimeout(()=>{let c=dl(u,e,this);s(this.canvas,{type:ut["2D"],property:i,args:c})},0),a.apply(this,u)}});n.push(l)}catch{let l=Qr(e.CanvasRenderingContext2D.prototype,i,{set(a){s(this.canvas,{type:ut["2D"],property:i,args:[a],setter:!0})}});n.push(l)}return()=>{n.forEach(i=>i())}}function Np(s){return s==="experimental-webgl"?"webgl":s}function Si(s,e,t,r){let n=[];try{let o=ct(s.HTMLCanvasElement.prototype,"getContext",function(i){return function(l,...a){if(!ie(this,e,t,!0)){let u=Np(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return i.apply(this,[l,...a])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(o=>o())}}function vi(s,e,t,r,n,o){let i=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=ct(s,a,function(c){return function(...d){let p=c.apply(this,d);if(cl(p,o,this),"tagName"in this.canvas&&!ie(this.canvas,r,n,!0)){let m=dl(d,o,this),g={type:e,property:a,args:m};t(this.canvas,g)}return p}});i.push(u)}catch{let u=Qr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});i.push(u)}return i}function Mp(s,e,t,r){let n=[];return n.push(...vi(e.WebGLRenderingContext.prototype,ut.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&n.push(...vi(e.WebGL2RenderingContext.prototype,ut.WebGL2,s,t,r,e)),()=>{n.forEach(o=>o())}}var fl="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kp=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Ci=typeof window<"u"&&window.Blob&&new Blob([kp(fl)],{type:"text/javascript;charset=utf-8"});function Pp(s){let e;try{if(e=Ci&&(window.URL||window.webkitURL).createObjectURL(Ci),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+fl,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var En=class{constructor(e){C(this,"pendingCanvasMutations",new Map),C(this,"rafStamps",{latestId:0,invokeId:null}),C(this,"mirror"),C(this,"mutationCb"),C(this,"resetObservers"),C(this,"frozen",!1),C(this,"locked",!1),C(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:n,blockSelector:o,recordCanvas:i,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&t==="all"&&this.initCanvasMutationObserver(r,n,o),i&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,n,o,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,n,o){let i=Si(t,r,n,!0),l=new Map,a=new Pp;a.onmessage=g=>{let{id:f}=g.data;if(l.set(f,!1),!("base64"in g.data))return;let{base64:h,type:E,width:S,height:w}=g.data;this.mutationCb({id:f,type:ut["2D"],commands:[{property:"clearRect",args:[0,0,S,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:E}]},0,0]}]})};let u=1e3/e,c=0,d,p=()=>{let g=[];return t.document.querySelectorAll("canvas").forEach(f=>{ie(f,r,n,!0)||g.push(f)}),g},m=g=>{if(c&&g-c<u){d=requestAnimationFrame(m);return}c=g,p().forEach(async f=>{var h;let E=this.mirror.getId(f);if(l.get(E)||f.width===0||f.height===0)return;if(l.set(E,!0),["webgl","webgl2"].includes(f.__context)){let w=f.getContext(f.__context);((h=w?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}let S=await createImageBitmap(f);a.postMessage({id:E,bitmap:S,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[S])}),d=requestAnimationFrame(m)};d=requestAnimationFrame(m),this.resetObservers=()=>{i(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=Si(e,t,r,!1),o=Tp(this.processMutation.bind(this),e,t,r),i=Mp(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let n=r.map(i=>{let{type:l,...a}=i;return a}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}},Rn=class{constructor(e){C(this,"trackedLinkElements",new WeakSet),C(this,"mutationCb"),C(this,"adoptedStyleSheetCb"),C(this,"styleMirror",new yn),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},n=[];for(let o of e){let i;this.styleMirror.has(o)?i=this.styleMirror.getId(o):(i=this.styleMirror.add(o),n.push({styleId:i,rules:Array.from(o.rules||CSSRule,(l,a)=>({rule:Ii(l,o.href),index:a}))})),r.styleIds.push(i)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},In=class{constructor(){C(this,"nodeMap",new WeakMap),C(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(n=>n!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},Z,xr,Ps,Br=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Io=s.contentWindow)==null?void 0:Io.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var Se=Vu();function ke(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:p,slimDOMOptions:m,maskInputFn:g,maskTextFn:f,maskAnchorHrefFn:h,blockImgSrcPattern:E=null,blockImgSrcFillOptions:S={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},hooks:w,packFn:I,sampling:_={},dataURLOptions:y={},mousemoveWait:R,recordDOM:v=!0,recordCanvas:x=!1,recordCrossOriginIframes:O=!1,recordAfter:le=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:Y=!1,collectFonts:ue=!1,inlineImages:X=!1,plugins:j,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:G=new Set([]),errorHandler:ee}=s;hp(ee);let F=O?window.parent===window:!0,te=!1;if(!F)try{window.parent.document&&(te=!1)}catch{te=!0}if(F&&!e)throw new Error("emit function is required");if(!F&&!te)return()=>{};R!==void 0&&_.mousemove===void 0&&(_.mousemove=R),Se.reset();let Q=d===!0?{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}:p!==void 0?p:{password:!0},re=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all",headTitleMutations:m==="all"}:m||{};lp();let _e,ce=0,se=N=>{for(let ye of j||[])ye.eventProcessor&&(N=ye.eventProcessor(N));return I&&!te&&(N=I(N)),N};Z=(N,ye)=>{var K;let J=N;if(J.timestamp=Ur(),(K=He[0])!=null&&K.isFrozen()&&J.type!==k.FullSnapshot&&!(J.type===k.IncrementalSnapshot&&J.data.source===T.Mutation)&&He.forEach(Re=>Re.unfreeze()),F)e?.(se(J),ye);else if(te){let Re={type:"rrweb",event:se(J),origin:window.location.origin,isCheckout:ye};window.parent.postMessage(Re,"*")}if(J.type===k.FullSnapshot)_e=J,ce=0;else if(J.type===k.IncrementalSnapshot){if(J.data.source===T.Mutation&&J.data.isAttachIframe)return;ce++;let Re=r&&ce>=r,U=t&&J.timestamp-_e.timestamp>t;(Re||U)&&xr(!0)}};let je=N=>{Z({type:k.IncrementalSnapshot,data:{source:T.Mutation,...N}})},ft=N=>Z({type:k.IncrementalSnapshot,data:{source:T.Scroll,...N}}),Ke=N=>Z({type:k.IncrementalSnapshot,data:{source:T.CanvasMutation,...N}}),is=N=>Z({type:k.IncrementalSnapshot,data:{source:T.AdoptedStyleSheet,...N}}),be=new Rn({mutationCb:je,adoptedStyleSheetCb:is}),Ee=new Cn({mirror:Se,mutationCb:je,stylesheetManager:be,recordCrossOriginIframes:O,wrappedEmit:Z});for(let N of j||[])N.getMirror&&N.getMirror({nodeMirror:Se,crossOriginIframeMirror:Ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ee.crossOriginIframeStyleMirror});let Je=new In;Ps=new En({recordCanvas:x,mutationCb:Ke,win:window,blockClass:n,blockSelector:o,mirror:Se,sampling:_.canvas,dataURLOptions:y});let jt=new bn({mutationCb:je,scrollCb:ft,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Q,dataURLOptions:y,maskTextFn:f,maskInputFn:g,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,recordCanvas:x,inlineImages:X,sampling:_,slimDOMOptions:re,iframeManager:Ee,stylesheetManager:be,canvasManager:Ps,keepIframeSrcFn:A,processedNodeManager:Je},mirror:Se});xr=(N=!1)=>{if(!v)return;Z({type:k.Meta,data:{href:window.location.href,width:Qa(),height:qa()}},N),be.reset(),jt.init(),He.forEach(K=>K.lock());let ye=pc(document,{mirror:Se,blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Q,maskTextFn:f,maskInputFn:g,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,slimDOM:re,dataURLOptions:y,recordCanvas:x,inlineImages:X,onSerialize:K=>{rl(K,Se)&&Ee.addIframe(K),sl(K,Se)&&be.trackLinkElement(K),gn(K)&&jt.addShadowRoot(D.shadowRoot(K),document)},onIframeLoad:(K,J)=>{Ee.attachIframe(K,J),jt.observeAttachShadow(K)},onStylesheetLoad:(K,J)=>{be.attachLinkElement(K,J)},keepIframeSrcFn:A});if(!ye)return console.warn("Failed to snapshot the document");Z({type:k.FullSnapshot,data:{node:ye,initialOffset:Xa(window)}},N),He.forEach(K=>K.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,Se.getId(document))};try{let N=[],ye=J=>{var Re;return M(Ap)({mutationCb:je,mousemoveCb:(U,as)=>Z({type:k.IncrementalSnapshot,data:{source:as,positions:U}}),mouseInteractionCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.MouseInteraction,...U}}),scrollCb:ft,viewportResizeCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.ViewportResize,...U}}),inputCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.Input,...U}}),mediaInteractionCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.MediaInteraction,...U}}),styleSheetRuleCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.StyleSheetRule,...U}}),styleDeclarationCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.StyleDeclaration,...U}}),canvasMutationCb:Ke,fontCb:U=>Z({type:k.IncrementalSnapshot,data:{source:T.Font,...U}}),selectionCb:U=>{Z({type:k.IncrementalSnapshot,data:{source:T.Selection,...U}})},customElementCb:U=>{Z({type:k.IncrementalSnapshot,data:{source:T.CustomElement,...U}})},blockClass:n,ignoreClass:i,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:Q,inlineStylesheet:c,sampling:_,recordDOM:v,recordCanvas:x,inlineImages:X,userTriggeredOnInput:Y,collectFonts:ue,doc:J,maskInputFn:g,maskTextFn:f,maskAnchorHrefFn:h,blockImgSrcPattern:E,blockImgSrcFillOptions:S,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:re,dataURLOptions:y,mirror:Se,iframeManager:Ee,stylesheetManager:be,shadowDomManager:jt,processedNodeManager:Je,canvasManager:Ps,ignoreCSSAttributes:G,plugins:((Re=j?.filter(U=>U.observer))==null?void 0:Re.map(U=>({observer:U.observer,options:U.options,callback:as=>Z({type:k.Plugin,data:{plugin:U.name,payload:as}})})))||[]},w)};Ee.addLoadListener(J=>{try{N.push(ye(J.contentDocument))}catch(Re){console.warn(Re)}});let K=()=>{xr(),N.push(ye(document)),Br=!0};return document.readyState==="interactive"||document.readyState==="complete"?K():(N.push(oe("DOMContentLoaded",()=>{Z({type:k.DomContentLoaded,data:{}}),le==="DOMContentLoaded"&&K()})),N.push(oe("load",()=>{Z({type:k.Load,data:{}}),le==="load"&&K()},window))),()=>{N.forEach(J=>J()),Je.destroy(),Br=!1,fp()}}catch(N){console.warn(N)}}ke.addCustomEvent=(s,e)=>{if(!Br)throw new Error("please add custom event after start recording");Z({type:k.Custom,data:{tag:s,payload:e}})};ke.freezePage=()=>{He.forEach(s=>s.freeze())};ke.takeFullSnapshot=s=>{if(!Br)throw new Error("please take full snapshot after start recording");xr(s)};ke.mirror=Se;var bi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(bi||(bi={}));function es(s,e){if(!e)return;let t=new URL(s),r={};for(let[n,o]of t.searchParams)e.includes(n)&&(r[n]=o);return Object.keys(r).length>0?r:void 0}var pl=require("minimatch");function Zn(s){throw new Error(`This code path should be unreachable: ${s}`)}function $p(s){return(s.startsWith("http://")||s.startsWith("https://"))&&(s=s.replace(/^https?:\/\//,"")),s.endsWith("/")&&(s=s.substring(0,s.length-1)),s=s.replace(/:\d+$/,""),s}function Lp(s,e){if(!e||e==="")return!1;if(e==="*")return!0;let t=$p(e);return s===t}function me({urlStr:s,pathConfig:e}){let t=new URL(s),r=t.pathname,n=t.hostname,o=e.rules.filter(l=>Lp(n,l.domain));if(o.length>0){let l=o.find(a=>a.path==="**");if(!l)return e.defaultAction==="allow"?t:void 0;for(let a of o){if(a.path==="**")continue;let u=Ze(r,a);if(u!==void 0)switch(a.action){case"allow":return t;case"block":return;case"replace":return t.pathname=u,t;default:Zn(a.action)}}return l.action==="allow"?t:void 0}let i=e.rules.filter(l=>!l.domain);for(let l of i){let a=Ze(r,l);if(a!==void 0)switch(l.action){case"allow":return t;case"block":return;case"replace":return t.pathname=a,t;default:Zn(l.action)}}return e.defaultAction==="allow"?t:void 0}function zt(s,e,t){let r=me({urlStr:s,pathConfig:t});r||(r=new URL(s));let n=Fp(r.pathname,e.rules||[]),o=[];for(let i of r.searchParams.keys()){let l=Up(i,n?.rules||[]);switch(l){case"accept":break;case"delete":o.push(i);break;case"anonymize":r.searchParams.set(i,"*");break;default:he(l)}}for(let i of o)r.searchParams.delete(i);if(r.pathname.includes("%3F")){let i=r.pathname.split("/");i[i.length-1]=i[i.length-1].split("%3F")[0],r.pathname=i.join("/")}return r.hash.includes("=")&&(r.hash=""),r.toString()}function Fp(s,e){for(let t of e)if(Ze(s,{path:t.path}))return t}function Up(s,e){for(let t of e)if((0,pl.minimatch)(s,t.param))return t.anonymizeValue?"anonymize":"accept";return"delete"}var Xn=class{constructor(e,t,r){this.org=e;this.recorder=t;this.events=[];this._estimatedByteSize=0;this.events=r,this._estimatedByteSize=this.calculateTotalSize()}get estimatedByteSize(){return this._estimatedByteSize}calculateTotalSize(){try{let e=JSON.stringify(this.events,this.getCircularReplacer());return zp(e)}catch(e){return b(`Error calculating event size: ${e}. Falling back to approximation.`),this.events.length*500}}getCircularReplacer(){let e=new WeakSet;return(t,r)=>{if(typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}}clearEvents(){this.events=[],this._estimatedByteSize=this.calculateTotalSize()}pushEvent({eventHref:e,event:t}){if(!me({urlStr:e,pathConfig:this.org.pathConfig})){b(`URL not accepted: ${e}`);return}if(!this.recorder.isRecording){b("Dropping event - recorder is not recording");return}this.events.push(t),this._estimatedByteSize=this.calculateTotalSize()}getEvents(){return this.events}},ts=class{constructor(e,t,r,n,o){this.org=e;this.eventStorage=t;this.getHref=r;this.eventStore=new Xn(e,n,o)}get estimatedSerializedByteSize(){return this.eventStore.estimatedByteSize}clear(){this.eventStore.clearEvents(),this.eventStorage.removeEvents()}getEvents(){return this.eventStore.getEvents()}onVisibilityChange(e){e||this.eventStorage.setEvents(this.getEvents())}append(e){let t=this.getHref();if(e.type===we.Meta)e.data.href=zt(e.data.href,this.org.allowedQueryParams,this.org.pathConfig),this.lastHref=this.getHref();else if(this.lastHref&&t!=this.lastHref){b(`URL changed from ${this.lastHref} to ${t}, adding artificial meta event for ${this.getHref()}`),this.eventStore.pushEvent({eventHref:t,event:So({href:zt(t,this.org.allowedQueryParams,this.org.pathConfig),delay:e.delay,timestamp:e.timestamp})});let r=es(t,this.org.customQueryParamsCohorts);r&&this.eventStore.pushEvent({eventHref:t,event:gt({payload:{userCohorts:r,source:"query_params"},timestamp:e.timestamp,delay:e.delay})}),this.lastHref=this.getHref()}if(e.type===we.IncrementalSnapshot&&e.data.source===mt.MouseInteraction&&e.data.type===cs.Click){let r=ke.mirror.getNode(e.data.id);if(r){let n=Hp(r),o=wo({dom0EventHandlers:n,delay:e.delay,timestamp:e.timestamp});this.eventStore.pushEvent({eventHref:t,event:o})}}this.eventStore.pushEvent({eventHref:t,event:e})}};function zp(s){return new Blob([s]).size}function Hp(s){let e=[];for(let t=0;t<ds.length;t++){let n=ds[t];typeof s[n]=="function"&&e.push(n)}return e}var ge=Uint8Array,ae=Uint16Array,Vt=Uint32Array,so=new ge([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]),no=new ge([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]),ml=new ge([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Sl=function(s,e){for(var t=new ae(31),r=0;r<31;++r)t[r]=e+=1<<s[r-1];for(var n=new Vt(t[30]),r=1;r<30;++r)for(var o=t[r];o<t[r+1];++o)n[o]=o-t[r]<<5|r;return[t,n]},vl=Sl(so,2),Bp=vl[0],Qn=vl[1];Bp[28]=258,Qn[258]=28;var Cl=Sl(no,0),Uw=Cl[0],gl=Cl[1],eo=new ae(32768);for(P=0;P<32768;++P)Pe=(P&43690)>>>1|(P&21845)<<1,Pe=(Pe&52428)>>>2|(Pe&13107)<<2,Pe=(Pe&61680)>>>4|(Pe&3855)<<4,eo[P]=((Pe&65280)>>>8|(Pe&255)<<8)>>>1;var Pe,P,Wt=function(s,e,t){for(var r=s.length,n=0,o=new ae(e);n<r;++n)++o[s[n]-1];var i=new ae(e);for(n=0;n<e;++n)i[n]=i[n-1]+o[n-1]<<1;var l;if(t){l=new ae(1<<e);var a=15-e;for(n=0;n<r;++n)if(s[n])for(var u=n<<4|s[n],c=e-s[n],d=i[s[n]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)l[eo[d]>>>a]=u}else for(l=new ae(r),n=0;n<r;++n)l[n]=eo[i[s[n]-1]++]>>>15-s[n];return l},Ye=new ge(288);for(P=0;P<144;++P)Ye[P]=8;var P;for(P=144;P<256;++P)Ye[P]=9;var P;for(P=256;P<280;++P)Ye[P]=7;var P;for(P=280;P<288;++P)Ye[P]=8;var P,rs=new ge(32);for(P=0;P<32;++P)rs[P]=5;var P,Wp=Wt(Ye,9,0);var Vp=Wt(rs,5,0);var bl=function(s){return(s/8>>0)+(s&7&&1)},El=function(s,e,t){(t==null||t>s.length)&&(t=s.length);var r=new(s instanceof ae?ae:s instanceof Vt?Vt:ge)(t-e);return r.set(s.subarray(e,t)),r};var $e=function(s,e,t){t<<=e&7;var r=e/8>>0;s[r]|=t,s[r+1]|=t>>>8},Ht=function(s,e,t){t<<=e&7;var r=e/8>>0;s[r]|=t,s[r+1]|=t>>>8,s[r+2]|=t>>>16},qn=function(s,e){for(var t=[],r=0;r<s.length;++r)s[r]&&t.push({s:r,f:s[r]});var n=t.length,o=t.slice();if(!n)return[new ge(0),0];if(n==1){var i=new ge(t[0].s+1);return i[t[0].s]=1,[i,1]}t.sort(function(_,y){return _.f-y.f}),t.push({s:-1,f:25001});var l=t[0],a=t[1],u=0,c=1,d=2;for(t[0]={s:-1,f:l.f+a.f,l,r:a};c!=n-1;)l=t[t[u].f<t[d].f?u++:d++],a=t[u!=c&&t[u].f<t[d].f?u++:d++],t[c++]={s:-1,f:l.f+a.f,l,r:a};for(var p=o[0].s,r=1;r<n;++r)o[r].s>p&&(p=o[r].s);var m=new ae(p+1),g=to(t[c-1],m,0);if(g>e){var r=0,f=0,h=g-e,E=1<<h;for(o.sort(function(y,R){return m[R.s]-m[y.s]||y.f-R.f});r<n;++r){var S=o[r].s;if(m[S]>e)f+=E-(1<<g-m[S]),m[S]=e;else break}for(f>>>=h;f>0;){var w=o[r].s;m[w]<e?f-=1<<e-m[w]++-1:++r}for(;r>=0&&f;--r){var I=o[r].s;m[I]==e&&(--m[I],++f)}g=e}return[new ge(m),g]},to=function(s,e,t){return s.s==-1?Math.max(to(s.l,e,t+1),to(s.r,e,t+1)):e[s.s]=t},yl=function(s){for(var e=s.length;e&&!s[--e];);for(var t=new ae(++e),r=0,n=s[0],o=1,i=function(a){t[r++]=a},l=1;l<=e;++l)if(s[l]==n&&l!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(n),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(n);o=1,n=s[l]}return[t.subarray(0,r),e]},Bt=function(s,e){for(var t=0,r=0;r<e.length;++r)t+=s[r]*e[r];return t},ro=function(s,e,t){var r=t.length,n=bl(e+2);s[n]=r&255,s[n+1]=r>>>8,s[n+2]=s[n]^255,s[n+3]=s[n+1]^255;for(var o=0;o<r;++o)s[n+o+4]=t[o];return(n+4+r)*8},wl=function(s,e,t,r,n,o,i,l,a,u,c){$e(e,c++,t),++n[256];for(var d=qn(n,15),p=d[0],m=d[1],g=qn(o,15),f=g[0],h=g[1],E=yl(p),S=E[0],w=E[1],I=yl(f),_=I[0],y=I[1],R=new ae(19),v=0;v<S.length;++v)R[S[v]&31]++;for(var v=0;v<_.length;++v)R[_[v]&31]++;for(var x=qn(R,7),O=x[0],le=x[1],Y=19;Y>4&&!O[ml[Y-1]];--Y);var ue=u+5<<3,X=Bt(n,Ye)+Bt(o,rs)+i,j=Bt(n,p)+Bt(o,f)+i+14+3*Y+Bt(R,O)+(2*R[16]+3*R[17]+7*R[18]);if(ue<=X&&ue<=j)return ro(e,c,s.subarray(a,a+u));var A,G,ee,F;if($e(e,c,1+(j<X)),c+=2,j<X){A=Wt(p,m,0),G=p,ee=Wt(f,h,0),F=f;var te=Wt(O,le,0);$e(e,c,w-257),$e(e,c+5,y-1),$e(e,c+10,Y-4),c+=14;for(var v=0;v<Y;++v)$e(e,c+3*v,O[ml[v]]);c+=3*Y;for(var Q=[S,_],re=0;re<2;++re)for(var _e=Q[re],v=0;v<_e.length;++v){var ce=_e[v]&31;$e(e,c,te[ce]),c+=O[ce],ce>15&&($e(e,c,_e[v]>>>5&127),c+=_e[v]>>>12)}}else A=Wp,G=Ye,ee=Vp,F=rs;for(var v=0;v<l;++v)if(r[v]>255){var ce=r[v]>>>18&31;Ht(e,c,A[ce+257]),c+=G[ce+257],ce>7&&($e(e,c,r[v]>>>23&31),c+=so[ce]);var se=r[v]&31;Ht(e,c,ee[se]),c+=F[se],se>3&&(Ht(e,c,r[v]>>>5&8191),c+=no[se])}else Ht(e,c,A[r[v]]),c+=G[r[v]];return Ht(e,c,A[256]),c+G[256]},Yp=new Vt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gp=function(s,e,t,r,n,o){var i=s.length,l=new ge(r+i+5*(1+Math.floor(i/7e3))+n),a=l.subarray(r,l.length-n),u=0;if(!e||i<8)for(var c=0;c<=i;c+=65535){var d=c+65535;d<i?u=ro(a,u,s.subarray(c,d)):(a[c]=o,u=ro(a,u,s.subarray(c,i)))}else{for(var p=Yp[e-1],m=p>>>13,g=p&8191,f=(1<<t)-1,h=new ae(32768),E=new ae(f+1),S=Math.ceil(t/3),w=2*S,I=function(N){return(s[N]^s[N+1]<<S^s[N+2]<<w)&f},_=new Vt(25e3),y=new ae(288),R=new ae(32),v=0,x=0,c=0,O=0,le=0,Y=0;c<i;++c){var ue=I(c),X=c&32767,j=E[ue];if(h[X]=j,E[ue]=X,le<=c){var A=i-c;if((v>7e3||O>24576)&&A>423){u=wl(s,a,0,_,y,R,x,O,Y,c-Y,u),O=v=x=0,Y=c;for(var G=0;G<286;++G)y[G]=0;for(var G=0;G<30;++G)R[G]=0}var ee=2,F=0,te=g,Q=X-j&32767;if(A>2&&ue==I(c-Q))for(var re=Math.min(m,A)-1,_e=Math.min(32767,c),ce=Math.min(258,A);Q<=_e&&--te&&X!=j;){if(s[c+ee]==s[c+ee-Q]){for(var se=0;se<ce&&s[c+se]==s[c+se-Q];++se);if(se>ee){if(ee=se,F=Q,se>re)break;for(var je=Math.min(Q,se-2),ft=0,G=0;G<je;++G){var Ke=c-Q+G+32768&32767,is=h[Ke],be=Ke-is+32768&32767;be>ft&&(ft=be,j=Ke)}}}X=j,j=h[X],Q+=X-j+32768&32767}if(F){_[O++]=268435456|Qn[ee]<<18|gl[F];var Ee=Qn[ee]&31,Je=gl[F]&31;x+=so[Ee]+no[Je],++y[257+Ee],++R[Je],le=c+ee,++v}else _[O++]=s[c],++y[s[c]]}}u=wl(s,a,o,_,y,R,x,O,Y,c-Y,u)}return El(l,0,r+bl(u)+n)},jp=function(){var s=1,e=0;return{p:function(t){for(var r=s,n=e,o=t.length,i=0;i!=o;){for(var l=Math.min(i+5552,o);i<l;++i)r+=t[i],n+=r;r%=65521,n%=65521}s=r,e=n},d:function(){return(s>>>8<<16|(e&255)<<8|e>>>8)+((s&255)<<23)*2}}},Kp=function(s,e,t,r,n){return Gp(s,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(s.length)))*1.5):12+e.mem,t,r,!n)},Jp=function(s,e,t){for(;t;++e)s[e]=t,t>>>=8},Zp=function(s,e){var t=e.level,r=t==0?0:t<6?1:t==9?3:2;s[0]=120,s[1]=r<<6|(r?32-2*r:1)};function Rl(s,e){e===void 0&&(e={});var t=jp();t.p(s);var r=Kp(s,e,2,4);return Zp(r,e),Jp(r,r.length-4,t.d()),r}function oo(s,e){var t=s.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var r=new ge(s.length+(s.length>>>1)),n=0,o=function(u){r[n++]=u},i=0;i<t;++i){if(n+5>r.length){var l=new ge(n+8+(t-i<<1));l.set(r),r=l}var a=s.charCodeAt(i);a<128||e?o(a):a<2048?(o(192|a>>>6),o(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|s.charCodeAt(++i)&1023,o(240|a>>>18),o(128|a>>>12&63),o(128|a>>>6&63),o(128|a&63)):(o(224|a>>>12),o(128|a>>>6&63),o(128|a&63))}return El(r,0,n)}function io(s,e){var t="";if(!e&&typeof TextDecoder<"u")return new TextDecoder().decode(s);for(var r=0;r<s.length;){var n=s[r++];n<128||e?t+=String.fromCharCode(n):n<224?t+=String.fromCharCode((n&31)<<6|s[r++]&63):n<240?t+=String.fromCharCode((n&15)<<12|(s[r++]&63)<<6|s[r++]&63):(n=((n&15)<<18|(s[r++]&63)<<12|(s[r++]&63)<<6|s[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023))}return t}var ao="v1";var lo=s=>{let e={...s,v:ao};return io(Rl(oo(JSON.stringify(e))),!0)};function Il(s){let e=new URL(s),t={};for(let[r,n]of e.searchParams)switch(r){case"utm_source":case"utm_medium":case"utm_campaign":case"utm_term":case"utm_content":t[`UTM@@${r}`]=n;break}return Object.keys(t).length>0?t:void 0}var xl=3*1024*1024,Al=5e3,ss=class{constructor(e,t,r,n,o,i,l){this.window=e;this.storage=t;this.eventHolder=r;this.recorder=n;this.api=o;this.organization=i;this.windowGetters=l;this.lastSendTime=-1;this.lastAutoCohorts=void 0;this.fastpathToken=void 0;n.setOnEvent(a=>this.onEvent(a))}onEvent(e){if(e.type===we.FullSnapshot){let o,i=qt(this.window,this.organization.cohortsBootstrapConfig),l=Il(this.windowGetters.getHref()),a=es(this.windowGetters.getHref(),this.organization.customQueryParamsCohorts),u=vs(this.window);this.lastAutoCohorts=u,(l||i||u||a)&&(o=gt({payload:{userCohorts:{...i||{},...u||{},...l||{},...a||{}},source:"window_getters"},delay:e.delay,timestamp:e.timestamp}));let c=o?[...this.eventHolder.getEvents(),o,e]:[...this.eventHolder.getEvents(),e];this.clearAndSaveEvents(c);return}else if(e.type===we.IncrementalSnapshot&&e.data.source===mt.Mutation){let o=vs(this.window);o&&(!this.lastAutoCohorts||Object.keys(o).length!==Object.keys(this.lastAutoCohorts).length)&&(b("auto cohorts different, appending new event",o),this.eventHolder.append(gt({payload:{userCohorts:o,source:"window_getters"},delay:e.delay,timestamp:e.timestamp}))),this.lastAutoCohorts=o}this.eventHolder.append(e);let t=this.eventHolder.estimatedSerializedByteSize,n=Date.now()-this.lastSendTime;t>xl&&n>=Al&&(b(`MAX_EVENT_BYTE_SIZE and timeSinceLastSend exceeded: ${t} > ${xl} and ${n} >= ${Al}`),this.clearAndSaveEvents())}async clearAndSaveEvents(e){let t=this.windowGetters.getHref();if(!me({urlStr:t,pathConfig:this.organization.pathConfig}))return;let r=e||this.eventHolder.getEvents();if(r.length!==0){this.eventHolder.clear();try{b("saving events...");let n=await this.prepareAndSendEvents(r);switch(b("save events result",n.type),n.type){case"success":break;case"recreate-session":await this.recreateSession(n.session);break;case"no-session":case"unknown-failure":case"rate-limit-exceeded":this.storage.removeSession(),this.eventHolder.clear();break;default:he(n)}}catch(n){throw b("error saving events",n),this.storage.removeSession(),n}}}async prepareAndSendEvents(e){this.lastSendTime=Date.now();let t=this.storage.getSession();if(!t)return{type:"no-session"};if(t.eventPostUrl&&t.eventPostToken){let o=JSON.parse(atob(t.eventPostToken.split(".")[1]));if(o&&Date.now()>o.lastEventAt-10*1e3){b("refreshing token as it is about to expire");let i=await this.refreshToken(t);if(i.type!=="success")return i;if(t=this.storage.getSession(),!t)return{type:"no-session"}}}let r=t.compressionType==="RRWEB_PACK"?e.map(o=>lo(o)):e,n=await this.api.saveSessionEvents({sessionId:t.id,events:r,metadata:{url:zt(this.windowGetters.getHref(),this.organization.allowedQueryParams,this.organization.pathConfig)},eventPostUrl:t.eventPostUrl,eventPostToken:t.eventPostToken,fastpathToken:this.fastpathToken});if(!n)return{type:"unknown-failure"};if(n.error)switch(n.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:t};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}if(!n.data)return{type:"unknown-failure"};if(n.data&&"code"in n.data)switch(n.data.code){case"TOKEN_REFRESH":{b("refreshing token as it expired on the worker");let o=await this.refreshToken(t);return o.type!=="success"?o:this.prepareAndSendEvents(e)}default:he(n.data.code)}if(this.fastpathToken=n.data.fastpathToken,n.response.status<200||n.response.status>201)throw new Error(`got status ${n.response.status}`);return{type:"success"}}async refreshToken(e){let t=await this.api.refreshEventToken({sessionId:e.id});if(!t)return{type:"unknown-failure"};if(t.error)switch(t.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:e};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}return t.data?(this.storage.setSession({...e,eventPostToken:t.data.token}),{type:"success"}):{type:"unknown-failure"}}async recreateSession(e){b("recreating sessions");let t,r=this.recorder.isRecording;this.recorder.setRecording(!1),this.storage.removeSession(),this.fastpathToken=void 0;let n,o;try{b("recreating session...");let l=await this.api.startSession({orgId:e.settings.orgId,language:e.settings.language||this.windowGetters.getLanguage(),domain:new URL(this.windowGetters.getHref()).hostname,userCohorts:e.settings.userCohorts||{},uid:e.settings.uid,devicePixelRatio:this.windowGetters.getDevicePixelRatio(),adoraUserId:e.adoraUserId,documentReferrer:e.documentReferrer,snippetVersion:Xt});if(!l||l.error)return;if(l.response.status!==201){b("session not created, aborting");return}if(!l.data||!("session"in l.data)){b("malformed session, exiting");return}l?.data&&"eventPostUrl"in l.data&&l.data.eventPostUrl&&"eventPostToken"in l.data&&l.data.eventPostToken&&(n=l.data.eventPostUrl,o=l.data.eventPostToken),t=l.data}catch{}if(!t)return;let i={id:t.session.id,createdAt:t.session.createdAt,status:t.session.status,lastSyncedAt:t.session.lastSyncedAt,domain:t.session.domain,requestIp:t.session.requestIp,country:t.session.country,userAgent:t.session.userAgent,language:t.session.language,initialUserCohorts:t.session.initialUserCohorts,devicePixelRatio:t.session.devicePixelRatio,organization:t.organization,settings:e.settings,adoraUserId:e.adoraUserId,documentReferrer:e.documentReferrer,canvasRecordingEnabled:e.canvasRecordingEnabled,eventPostUrl:n,eventPostToken:o,limitedCanvasRecording:e.limitedCanvasRecording,compressionType:e.compressionType};this.storage.setSession(i),this.eventHolder.clear(),r&&this.recorder.setRecording(!0)}};var dt,_l=()=>{if(dt!==void 0)return dt;try{return dt=document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")===0,b("adora script - isWebpSupported? - ",dt),dt}catch{return dt=!1,!1}};var ns=class{constructor(e,t,r,n){this.limitedCanvasRecording=e;this.canvasRecordingEnabled=t;this.org=r;this.rrwebRecorder=n;this.startable=!0;b("new recorder")}setOnEvent(e){this.onEvent=e}get args(){let e=this.org.blockedCSSClasses.length>0?`|(${this.org.blockedCSSClasses.join(")|(")})`:"",t=this.org.maskedCSSClasses&&this.org.maskedCSSClasses?.length>0?`|(${this.org.maskedCSSClasses?.join(")|(")})`:"",r=_l()?"image/webp":this.limitedCanvasRecording?"image/jpeg":"image/png";return{emit:n=>{if(!this.onEvent)throw new Error("onEvent must be assigned before starting recording");this.onEvent(n)},userTriggeredOnInput:!0,blockClass:new RegExp(`(adora-block)|(rr-block|fs-exclude|ph-no-capture)${e}`),maskTextClass:new RegExp(`(adora-mask)|(rr-mask|fs-mask)${t}`),maskAllInputs:!0,maskInputFn:(n,o)=>Ol(this.org,o)?n:"*".repeat(n.length),maskTextFn:(n,o)=>o&&this.org.maskByDefault&&o.closest('button,a,div[role="button"],div[role*="menuitem"],input[type="button"],input[type="submit"],input[type="reset"]')||o&&Ol(this.org,o)?n:n.replace(/[\S]/g,"*"),maskTextSelector:this.org?.maskByDefault?"*":"",recordCanvas:this.canvasRecordingEnabled,sampling:this.canvasRecordingEnabled?{canvas:this.limitedCanvasRecording?1:2}:void 0,dataURLOptions:this.canvasRecordingEnabled?{type:r,quality:.6}:{}}}recordChangeCustomCohort(e){b("sending custom cohort change",e),this.rrwebRecorder.addCustomEvent(yo,e)}recordCLS(e){this.rrwebRecorder.addCustomEvent("CLS",e)}recordFID(e){this.rrwebRecorder.addCustomEvent("FID",e)}recordLCP(e){this.rrwebRecorder.addCustomEvent("LCP",e)}recordVisibilityChange(e){this.rrwebRecorder.addCustomEvent("Adora.VisibilityChange",{visibilityState:e})}recordFocusChange(e){this.rrwebRecorder.addCustomEvent("Adora.FocusChange",{focusState:e})}get isRecording(){return this.rrwebRecorder.isRecording}setRecording(e){if(b("setRecording",`requested status: ${e}`,`current status ${this.rrwebRecorder.isRecording}`),this.rrwebRecorder.isRecording!==e){if(e){this.startRecording();return}this.stopRecording()}}startRecording(){if(this.isRecording)throw new Error("recording already in progress!");if(!this.startable){b("recorder is not startable, returning");return}this.rrwebRecorder.record(this.args)}stopRecording(){this.rrwebRecorder.stop()}stopFutureRecordings(){this.startable=!1}};function Ol(s,e){if(e.classList.contains("adora-unmask"))return!0;for(let t of s.unmaskSelectors)if(Array.from(document.querySelectorAll(t)).find(r=>r===e))return!0;return!1}var os=class{constructor(){this._isRecording=!1}get isRecording(){return this._isRecording}record(e){if(b("record",{stopFn:typeof this.stopFn,isRecording:this._isRecording}),this.stopFn!==void 0&&this.stop(),this._isRecording=!0,this.stopFn=ke(e),!this.stopFn)throw new Error("recorder could not successfully start")}stop(){this._isRecording=!1,this.stopFn&&(this.stopFn(),this.stopFn=void 0)}addCustomEvent(e,t){if(!this._isRecording)return b("WARNING! attempting to add custom event with recording off"),!1;try{ke.addCustomEvent(e,t)}catch(r){return b("trying to record an event even though",r),!1}return!0}};var Dl=5e3;function Tl({sessionType:s}){b("initialize recording");let e=new Le(s,new De),t=e.getSession();if(!t)return;let r=new Oe(t.settings.backendUrl),n=new Zt(s,new De),o=n.getEvents();n.removeEvents();let i=()=>window.location.href,l=()=>window.navigator.language,a=()=>window.devicePixelRatio,u=new os,c=new ns(t.limitedCanvasRecording??!1,t.canvasRecordingEnabled??!1,t.organization,u),d=new ts(t.organization,n,i,c,o||[]),p=new ss(window,e,d,c,r,t.organization,{getHref:i,getLanguage:l,getDevicePixelRatio:a}),m=window.location.href;me({urlStr:m,pathConfig:t.organization.pathConfig})?(b("starting recording..."),c.setRecording(!0)):b("recording did not start as current URL is blocked");let g=qt(window,t.organization.cohortsBootstrapConfig);c.isRecording&&(c.recordChangeCustomCohort({uid:t.settings.uid,userCohorts:t.settings.userCohorts?{...g,...t.settings.userCohorts}:{}}),e.setSession(t)),ht.onCLS(I=>{c.isRecording&&c.recordCLS(I)}),ht.onFID(I=>{c.isRecording&&c.recordFID(I)}),ht.onLCP(I=>{c.isRecording&&c.recordLCP(I)});let f=()=>{p.clearAndSaveEvents(d.getEvents())},h=window.setInterval(f,Dl);window.addEventListener("blur",()=>{c.recordFocusChange("blur")}),window.addEventListener("focus",()=>{c.recordFocusChange("focus")}),document.addEventListener("visibilitychange",()=>{if(b(`detected a visibility change to ${document.visibilityState}`),c.isRecording&&c.recordVisibilityChange(document.visibilityState),document.visibilityState==="hidden"){h&&(b("clearing the saveInterval"),clearInterval(h),h=void 0),d.onVisibilityChange(!1);return}h||(b("resuming the saveInterval"),h=window.setInterval(f,Dl))});let E=m,S=new MutationObserver(function(){if(d&&window.location.href!==E){let I=me({urlStr:window.location.href,pathConfig:t.organization.pathConfig});b(`url changed detected, status: ${!!I}`),c.setRecording(!!I),E=window.location.href}});return S.observe(document,{subtree:!0,childList:!0}),{recorder:c,eventSync:p,urlChangeObserverDispose:()=>{S.disconnect()}}}var Nl=s=>Tl(s);var Ge=!1,Ml="_adora_user_id",kl="_adora_rate_limited",Ae,Gt,uo="stopped",Pl=()=>{b("startRecording",`adoraIsRunning: ${Ge}`),uo==="started"&&(Ae=Nl({sessionType:"adoraSessionScript"}))},$l=1e3*60*30,Xp=async({userCohorts:s,...e})=>{let t=e;if(uo="started",b("adora start",{adoraIsRunning:Ge,uid:t.uid,userCohorts:s||{}}),typeof window.sessionStorage!="object"){b("SSR detected");return}if(s){t.userCohorts={};for(let[a,u]of Object.entries(s))u!==void 0?(b("setting user cohorts key",{key:a,value:u}),t.userCohorts[a]=u):b("found undefined user cohorts key",{key:a})}let r=new Le("adoraSessionScript",new De),n=r.getSession();if(n){b("session detected; finding if changes should be written");let a=!1;if(t.uid&&n.settings.uid!==t.uid&&(b("detected uid change"),n.settings.uid=t.uid,r.setSession(n),a=!0),t.userCohorts&&Object.keys(t.userCohorts).length>0){b("detected user cohorts");let u=structuredClone(n.settings.userCohorts);(0,Ll.strictDeepEqual)(u,t.userCohorts)||(b("detected user cohorts have been changed"),n.settings.userCohorts=t.userCohorts,r.setSession(n),a=!0)}a&&Ae?.recorder&&Ae?.recorder.isRecording&&(b("writing cohort change to recorder"),Ae?.recorder.recordChangeCustomCohort({uid:n.settings.uid,userCohorts:n.settings.userCohorts?{...n.settings.userCohorts}:{}}))}if(Ge===!0)return;Ge=!0;let o=r.lastRateLimitedTimestamp;if(o!==void 0){if(Date.now()-o<$l){b("exiting as the session has been rate limited recently");return}r.clearLastRateLimitedTimestamp()}if(Yt.default.get(kl)){b("exiting as the domain has been rate limited recently");return}if(n){b("start recording for existing session"),Pl();return}let i=!1,l=async(a,u)=>{if(b("start status",{started:i}),i)return;i=!0;let c=await bo("adoraSessionScript",u,t);if(c.type==="error"){c.code==="RateLimitExceeded"&&(b("setting expiration on local storage"),r.setLastRateLimitedTimestamp(Date.now()),a&&(b("setting expiration cookie"),Yt.default.set(kl,a,{expires:new Date(Date.now()+$l),domain:a})));return}Pl()};b("launching session preload");try{let a=await new Oe(t.backendUrl).sessionPreload({orgId:t.orgId});b("session preload resolved");let u=window.location.href;if(a){if(a.error){b("error preloading",a.error);return}if("scheduledDowntime"in a.data){b("scheduled downtime; exiting");return}let{organization:c}=a.data;b("session preload success");let d=Yt.default.get(Ml),p;b("existing adora user id cookie:",d);for(let m of c.cookieDomains)(window.location.hostname.toLowerCase()===m||window.location.hostname.toLowerCase().endsWith("."+m))&&(p=m,d||(d=(0,Fl.uuidv7)(),Yt.default.set(Ml,d,{domain:m,expires:new Date(Date.now()+365*24*60*60*1e3)}),b("setting adoraUserId cookie on domain",d)));b("using adora user id:",d),me({urlStr:u,pathConfig:c.pathConfig})?(b("at an unblocked URL, starting adora"),await l(p,d)):(b("at an blocked URL, waiting for unblocked URL to start adora"),Gt&&Gt.disconnect(),Gt=new MutationObserver(function(m,g){if(u!=window.location.href){let f=window.location.href,h=me({urlStr:f,pathConfig:c.pathConfig});if(b(`url changed detected during blocked state, status: ${!!h}`),h){b("disconnecting observer"),g.disconnect(),b("scheduling adora to start"),l(p,d);return}u=f}}),Gt.observe(document,{subtree:!0,childList:!0}))}}catch(a){b("Error in adoraStart:",a)}},qp=async()=>{uo="stopped",b("adora stop",{adoraIsRunning:Ge}),Ae&&(Ae.recorder.setRecording(!1),Ae.recorder.stopFutureRecordings(),Ae.urlChangeObserverDispose(),await Ae.eventSync.clearAndSaveEvents()),Gt?.disconnect(),Ge=!1,Ae=void 0};
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`,co={map:{},getId(){return console.error(Ue),-1},getNode(){return console.error(Ue),null},removeNodeFromMap(){console.error(Ue)},has(){return console.error(Ue),!1},reset(){console.error(Ue)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(co=new Proxy(co,{get(e,t,r){return t==="map"&&console.error(Ue),Reflect.get(e,t,r)}}));function tt(e,t,r={}){let o=null,n=0;return function(...s){let a=Date.now();!n&&r.leading===!1&&(n=a);let c=t-(a-n),i=this;c<=0||c>t?(o&&(clearTimeout(o),o=null),n=a,e.apply(i,s)):!o&&r.trailing!==!1&&(o=setTimeout(()=>{n=r.leading===!1?0:Date.now(),o=null,e.apply(i,s)},c))}}function Nt(e,t,r,o,n=window){let s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,o?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>Nt(e,t,s||{},!0)}function ze(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],n=r(o);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=n,()=>{e[t]=o}}catch{return()=>{}}}var Rt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Rt=()=>new Date().getTime());function No(e){var t,r,o,n;let s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:s.documentElement.scrollLeft||s?.body&&((t=T.parentElement(s.body))==null?void 0:t.scrollLeft)||((r=s?.body)==null?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:s?.documentElement.scrollTop||s?.body&&((o=T.parentElement(s.body))==null?void 0:o.scrollTop)||((n=s?.body)==null?void 0:n.scrollTop)||0}}function Oo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function xo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Mo(e){return e?e.nodeType===e.ELEMENT_NODE?e:T.parentElement(e):null}function te(e,t,r,o){if(!e)return!1;let n=Mo(e);if(!n)return!1;try{if(typeof t=="string"){if(n.classList.contains(t)||o&&n.closest("."+t)!==null)return!0}else if(_t(n,t,o))return!0}catch{}return!!(r&&(n.matches(r)||o&&n.closest(r)!==null))}function ii(e,t){return t.getId(e)!==-1}function ir(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===et}function ko(e,t){if(Xe(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let o=T.parentNode(e);return o&&o.nodeType===e.DOCUMENT_NODE?!1:o?ko(o,t):!0}function ur(e){return!!e.changedTouches}function ai(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)}function Lo(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Po(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function lr(e){return e?e instanceof cr&&"shadowRoot"in e?!!e.shadowRoot:!!T.shadowRoot(e):!1}var hr=class{constructor(){S(this,"id",1),S(this,"styleIDMap",new WeakMap),S(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let o;return r===void 0?o=this.id++:o=r,this.styleIDMap.set(t,o),this.idStyleMap.set(o,t),o}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Fo(e){var t;let r=null;return"getRootNode"in e&&((t=T.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&T.host(T.getRootNode(e))&&(r=T.host(T.getRootNode(e))),r}function di(e){let t=e,r;for(;r=Fo(t);)t=r;return t}function ci(e){let t=e.ownerDocument;if(!t)return!1;let r=di(e);return T.contains(t,r)}function Uo(e){let t=e.ownerDocument;return t?T.contains(t,e)||ci(e):!1}var M=(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))(M||{}),N=(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))(N||{}),ie=(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))(ie||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),Be=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Be||{}),He=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(He||{});function uo(e){return"__ln"in e}var fr=class{constructor(){S(this,"length",0),S(this,"head",null),S(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let o=0;o<t;o++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&uo(t.previousSibling)){let o=t.previousSibling.__ln.next;r.next=o,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,o&&(o.previous=r)}else if(t.nextSibling&&uo(t.nextSibling)&&t.nextSibling.__ln.previous){let o=t.nextSibling.__ln.previous;r.previous=o,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,o&&(o.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},lo=(e,t)=>`${e}@${t}`,pr=class{constructor(){S(this,"frozen",!1),S(this,"locked",!1),S(this,"texts",[]),S(this,"attributes",[]),S(this,"attributeMap",new WeakMap),S(this,"removes",[]),S(this,"mapRemoves",[]),S(this,"movedMap",{}),S(this,"addedSet",new Set),S(this,"movedSet",new Set),S(this,"droppedSet",new Set),S(this,"mutationCb"),S(this,"blockClass"),S(this,"blockSelector"),S(this,"maskTextClass"),S(this,"maskTextSelector"),S(this,"inlineStylesheet"),S(this,"maskInputOptions"),S(this,"maskTextFn"),S(this,"maskInputFn"),S(this,"maskAnchorHrefFn"),S(this,"blockImgSrcPattern"),S(this,"blockImgSrcFillOptions"),S(this,"keepIframeSrcFn"),S(this,"recordCanvas"),S(this,"inlineImages"),S(this,"slimDOMOptions"),S(this,"dataURLOptions"),S(this,"doc"),S(this,"mirror"),S(this,"iframeManager"),S(this,"stylesheetManager"),S(this,"shadowDomManager"),S(this,"canvasManager"),S(this,"processedNodeManager"),S(this,"unattachedDoc"),S(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),S(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set,o=new fr,n=i=>{let u=i,d=et;for(;d===et;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},s=i=>{let u=T.parentNode(i);if(!u||!Uo(i))return;let d=!1;if(i.nodeType===Node.TEXT_NODE){let p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(d=!0)}let l=Xe(u)?this.mirror.getId(Fo(i)):this.mirror.getId(u),g=n(i);if(l===-1||g===-1)return o.addNode(i);let f=Ve(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAnchorHrefFn:this.maskAnchorHrefFn,blockImgSrcPattern:this.blockImgSrcPattern,blockImgSrcFillOptions:this.blockImgSrcFillOptions,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Lo(p,this.mirror)&&this.iframeManager.addIframe(p),Po(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),lr(i)&&this.shadowDomManager.addShadowRoot(T.shadowRoot(i),this.doc)},onIframeLoad:(p,h)=>{this.iframeManager.attachIframe(p,h),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,h)=>{this.stylesheetManager.attachLinkElement(p,h)},cssCaptured:d});f&&(t.push({parentId:l,nextId:g,node:f}),r.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let i of this.movedSet)ho(this.removes,i,this.mirror)&&!this.movedSet.has(T.parentNode(i))||s(i);for(let i of this.addedSet)!fo(this.droppedSet,i)&&!ho(this.removes,i,this.mirror)||fo(this.movedSet,i)?s(i):this.droppedSet.add(i);let a=null;for(;o.length;){let i=null;if(a){let u=this.mirror.getId(T.parentNode(a.value)),d=n(a.value);u!==-1&&d!==-1&&(i=a)}if(!i){let u=o.tail;for(;u;){let d=u;if(u=u.previous,d){let l=this.mirror.getId(T.parentNode(d.value));if(n(d.value)===-1)continue;if(l!==-1){i=d;break}else{let f=d.value,p=T.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let h=T.host(p);if(this.mirror.getId(h)!==-1){i=d;break}}}}}}if(!i){for(;o.head;)o.removeNode(o.head.value);break}a=i.previous,o.removeNode(i.value),s(i.value)}let c={texts:this.texts.map(i=>{let u=i.node,d=T.parentNode(u);return d&&d.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(d),{id:this.mirror.getId(u),value:i.value}}).filter(i=>!r.has(i.id)).filter(i=>this.mirror.has(i.id)),attributes:this.attributes.map(i=>{let{attributes:u}=i;if(typeof u.style=="string"){let d=JSON.stringify(i.styleDiff),l=JSON.stringify(i._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=i.styleDiff)}return{id:this.mirror.getId(i.node),attributes:u}}).filter(i=>!r.has(i.id)).filter(i=>this.mirror.has(i.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.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(c))}),S(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let o=r.attributes.value=Array.from(T.childNodes(t),n=>T.textContent(n)||"").join("");r.attributes.value=Et({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:null,value:o,maskInputFn:this.maskInputFn})}),S(this,"processMutation",t=>{if(!ir(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=T.textContent(t.target);!te(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Ao(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Mo(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,o=t.attributeName,n=t.target.getAttribute(o);if(o==="value"){let c=wr(r);n=Et({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:n,maskInputFn:this.maskInputFn})}let s=te(t.target,this.blockClass,this.blockSelector,!1);if(s&&o==="style"){let c=t.target,{width:i,height:u}=c.getBoundingClientRect(),d=this.attributeMap.get(t.target);d||(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(d),this.attributeMap.set(t.target,d)),d.attributes.rr_width=`${i}px`,d.attributes.rr_height=`${u}px`}if(s||n===t.oldValue)return;let a=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&o==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)o="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),o==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ro(r.tagName,o))if(a.attributes[o]=_o(this.doc,Ne(r.tagName),Ne(o),n),o==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let c=this.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(let i of Array.from(r.style)){let u=r.style.getPropertyValue(i),d=r.style.getPropertyPriority(i);u!==c.style.getPropertyValue(i)||d!==c.style.getPropertyPriority(i)?d===""?a.styleDiff[i]=u:a.styleDiff[i]=[u,d]:a._unchangedStyles[i]=[u,d]}for(let i of Array.from(c.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=!1)}else o==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break}case"childList":{if(te(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let o=this.mirror.getId(r),n=Xe(t.target)?this.mirror.getId(T.host(t.target)):this.mirror.getId(t.target);te(t.target,this.blockClass,this.blockSelector,!1)||ir(r,this.mirror,this.slimDOMOptions)||!ii(r,this.mirror)||(this.addedSet.has(r)?(gr(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&o===-1||ko(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[lo(o,n)]?gr(this.movedSet,r):this.removes.push({parentId:n,id:o,isShadow:Xe(t.target)&&qe(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}}),S(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(ir(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let o=null;r&&this.mirror.hasNode(r)&&(o=this.mirror.getId(r)),o&&o!==-1&&(this.movedMap[lo(this.mirror.getId(t),o)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);te(t,this.blockClass,this.blockSelector,!1)||(T.childNodes(t).forEach(o=>this.genAdds(o)),lr(t)&&T.childNodes(T.shadowRoot(t)).forEach(o=>{this.processedNodeManager.add(o,this),this.genAdds(o,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAnchorHrefFn","blockImgSrcPattern","blockImgSrcFillOptions","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}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 gr(e,t){e.delete(t),T.childNodes(t).forEach(r=>gr(e,r))}function ho(e,t,r){return e.length===0?!1:ui(e,t,r)}function ui(e,t,r){let o=T.parentNode(t);for(;o;){let n=r.getId(o);if(e.some(s=>s.id===n))return!0;o=T.parentNode(o)}return!1}function fo(e,t){return e.size===0?!1:Ho(e,t)}function Ho(e,t){let r=T.parentNode(t);return r?e.has(r)?!0:Ho(e,r):!1}var Qe;function li(e){Qe=e}function hi(){Qe=void 0}var x=e=>Qe?(...r)=>{try{return e(...r)}catch(o){if(Qe&&Qe(o)===!0)return;throw o}}:e,Te=[];function rt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Yo(e,t){let r=new pr;Te.push(r),r.init(e);let o=new(To())(x(r.processMutations.bind(r)));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function fi({mousemoveCb:e,sampling:t,doc:r,mirror:o}){if(t.mousemove===!1)return()=>{};let n=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],c,i=tt(x(l=>{let g=Date.now()-c;e(a.map(f=>(f.timeOffset-=g,f)),l),a=[],c=null}),s),u=x(tt(x(l=>{let g=rt(l),{clientX:f,clientY:p}=ur(l)?l.changedTouches[0]:l;c||(c=Rt()),a.push({x:f,y:p,id:o.getId(g),timeOffset:Rt()-c}),i(typeof DragEvent<"u"&&l instanceof DragEvent?N.Drag:l instanceof MouseEvent?N.MouseMove:N.TouchMove)}),n,{trailing:!1})),d=[ee("mousemove",u,r),ee("touchmove",u,r),ee("drag",u,r)];return x(()=>{d.forEach(l=>l())})}function pi({mouseInteractionCb:e,doc:t,mirror:r,blockClass:o,blockSelector:n,sampling:s}){if(s.mouseInteraction===!1)return()=>{};let a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,c=[],i=null,u=d=>l=>{let g=rt(l);if(te(g,o,n,!0))return;let f=null,p=d;if("pointerType"in l){switch(l.pointerType){case"mouse":f=Ce.Mouse;break;case"touch":f=Ce.Touch;break;case"pen":f=Ce.Pen;break}f===Ce.Touch?ie[d]===ie.MouseDown?p="TouchStart":ie[d]===ie.MouseUp&&(p="TouchEnd"):Ce.Pen}else ur(l)&&(f=Ce.Touch);f!==null?(i=f,(p.startsWith("Touch")&&f===Ce.Touch||p.startsWith("Mouse")&&f===Ce.Mouse)&&(f=null)):ie[d]===ie.Click&&(f=i,i=null);let h=ur(l)?l.changedTouches[0]:l;if(!h)return;let C=r.getId(g),{clientX:I,clientY:v}=h;x(e)({type:ie[p],id:C,x:I,y:v,...f!==null&&{pointerType:f}})};return Object.keys(ie).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&a[d]!==!1).forEach(d=>{let l=Ne(d),g=u(d);if(window.PointerEvent)switch(ie[d]){case ie.MouseDown:case ie.MouseUp:l=l.replace("mouse","pointer");break;case ie.TouchStart:case ie.TouchEnd:return}c.push(ee(l,g,t))}),x(()=>{c.forEach(d=>d())})}function Vo({scrollCb:e,doc:t,mirror:r,blockClass:o,blockSelector:n,sampling:s}){let a=x(tt(x(c=>{let i=rt(c);if(!i||te(i,o,n,!0))return;let u=r.getId(i);if(i===t&&t.defaultView){let d=No(t.defaultView);e({id:u,x:d.left,y:d.top})}else e({id:u,x:i.scrollLeft,y:i.scrollTop})}),s.scroll||100));return ee("scroll",a,t)}function gi({viewportResizeCb:e},{win:t}){let r=-1,o=-1,n=x(tt(x(()=>{let s=Oo(),a=xo();(r!==s||o!==a)&&(e({width:Number(a),height:Number(s)}),r=s,o=a)}),200));return ee("resize",n,t)}var mi=["INPUT","TEXTAREA","SELECT"],po=new WeakMap;function yi({inputCb:e,doc:t,mirror:r,blockClass:o,blockSelector:n,ignoreClass:s,ignoreSelector:a,maskInputOptions:c,maskInputFn:i,sampling:u,userTriggeredOnInput:d}){function l(v){let y=rt(v),_=v.isTrusted,A=y&&y.tagName;if(y&&A==="OPTION"&&(y=T.parentElement(y)),!y||!A||mi.indexOf(A)<0||te(y,o,n,!0)||y.classList.contains(s)||a&&y.matches(a))return;let m=y.value,E=!1,w=wr(y)||"";w==="radio"||w==="checkbox"?E=y.checked:(c[A.toLowerCase()]||c[w])&&(m=Et({element:y,maskInputOptions:c,tagName:A,type:w,value:m,maskInputFn:i})),g(y,d?{text:m,isChecked:E,userTriggered:_}:{text:m,isChecked:E});let D=y.name;w==="radio"&&D&&E&&t.querySelectorAll(`input[type="radio"][name="${Si(D)}"]`).forEach(L=>{if(L!==y){let oe=L.value;g(L,d?{text:oe,isChecked:!E,userTriggered:!1}:{text:oe,isChecked:!E})}})}function g(v,y){let _=po.get(v);if(!_||_.text!==y.text||_.isChecked!==y.isChecked){po.set(v,y);let A=r.getId(v);x(e)({...y,id:A})}}let p=(u.input==="last"?["change"]:["input","change"]).map(v=>ee(v,x(l),t)),h=t.defaultView;if(!h)return()=>{p.forEach(v=>v())};let C=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),I=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return C&&C.set&&p.push(...I.map(v=>Nt(v[0],v[1],{set(){x(l)({target:this,isTrusted:!1})}},!1,h))),x(()=>{p.forEach(v=>v())})}function At(e){let t=[];function r(o,n){if(St("CSSGroupingRule")&&o.parentRule instanceof CSSGroupingRule||St("CSSMediaRule")&&o.parentRule instanceof CSSMediaRule||St("CSSSupportsRule")&&o.parentRule instanceof CSSSupportsRule||St("CSSConditionRule")&&o.parentRule instanceof CSSConditionRule){let a=Array.from(o.parentRule.cssRules).indexOf(o);n.unshift(a)}else if(o.parentStyleSheet){let a=Array.from(o.parentStyleSheet.cssRules).indexOf(o);n.unshift(a)}return n}return r(e,t)}function Si(e){return e.replace(/["\\]/g,"\\$&")}function _e(e,t,r){let o,n;return e?(e.ownerNode?o=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:o}):{}}function vi({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:o}){if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};let n=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:x((d,l,g)=>{let[f,p]=g,{id:h,styleId:C}=_e(l,t,r.styleMirror);return(h&&h!==-1||C&&C!==-1)&&e({id:h,styleId:C,adds:[{rule:f,index:p}]}),d.apply(l,g)})}),o.CSSStyleSheet.prototype.addRule=function(d,l,g=this.cssRules.length){let f=`${d} { ${l} }`;return o.CSSStyleSheet.prototype.insertRule.apply(this,[f,g])};let s=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:x((d,l,g)=>{let[f]=g,{id:p,styleId:h}=_e(l,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,removes:[{index:f}]}),d.apply(l,g)})}),o.CSSStyleSheet.prototype.removeRule=function(d){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[d])};let a;o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:x((d,l,g)=>{let[f]=g,{id:p,styleId:h}=_e(l,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,replace:f}),d.apply(l,g)})}));let c;o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:x((d,l,g)=>{let[f]=g,{id:p,styleId:h}=_e(l,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,replaceSync:f}),d.apply(l,g)})}));let i={};vt("CSSGroupingRule")?i.CSSGroupingRule=o.CSSGroupingRule:(vt("CSSMediaRule")&&(i.CSSMediaRule=o.CSSMediaRule),vt("CSSConditionRule")&&(i.CSSConditionRule=o.CSSConditionRule),vt("CSSSupportsRule")&&(i.CSSSupportsRule=o.CSSSupportsRule));let u={};return Object.entries(i).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:x((g,f,p)=>{let[h,C]=p,{id:I,styleId:v}=_e(f.parentStyleSheet,t,r.styleMirror);return(I&&I!==-1||v&&v!==-1)&&e({id:I,styleId:v,adds:[{rule:h,index:[...At(f),C||0]}]}),g.apply(f,p)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:x((g,f,p)=>{let[h]=p,{id:C,styleId:I}=_e(f.parentStyleSheet,t,r.styleMirror);return(C&&C!==-1||I&&I!==-1)&&e({id:C,styleId:I,removes:[{index:[...At(f),h]}]}),g.apply(f,p)})})}),x(()=>{o.CSSStyleSheet.prototype.insertRule=n,o.CSSStyleSheet.prototype.deleteRule=s,a&&(o.CSSStyleSheet.prototype.replace=a),c&&(o.CSSStyleSheet.prototype.replaceSync=c),Object.entries(i).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Wo({mirror:e,stylesheetManager:t},r){var o,n,s;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(T.host(r));let c=r.nodeName==="#document"?(o=r.defaultView)==null?void 0:o.Document:(s=(n=r.ownerDocument)==null?void 0:n.defaultView)==null?void 0:s.ShadowRoot,i=c?.prototype?Object.getOwnPropertyDescriptor(c?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var d;let l=(d=i.set)==null?void 0:d.call(this,u);if(a!==null&&a!==-1)try{t.adoptStyleSheets(u,a)}catch{}return l}}),x(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function bi({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:o},{win:n}){let s=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:x((c,i,u)=>{var d;let[l,g,f]=u;if(r.has(l))return s.apply(i,[l,g,f]);let{id:p,styleId:h}=_e((d=i.parentRule)==null?void 0:d.parentStyleSheet,t,o.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:l,value:g,priority:f},index:At(i.parentRule)}),c.apply(i,u)})});let a=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:x((c,i,u)=>{var d;let[l]=u;if(r.has(l))return a.apply(i,[l]);let{id:g,styleId:f}=_e((d=i.parentRule)==null?void 0:d.parentStyleSheet,t,o.styleMirror);return(g&&g!==-1||f&&f!==-1)&&e({id:g,styleId:f,remove:{property:l},index:At(i.parentRule)}),c.apply(i,u)})}),x(()=>{n.CSSStyleDeclaration.prototype.setProperty=s,n.CSSStyleDeclaration.prototype.removeProperty=a})}function Ci({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:o,sampling:n,doc:s}){let a=x(i=>tt(x(u=>{let d=rt(u);if(!d||te(d,t,r,!0))return;let{currentTime:l,volume:g,muted:f,playbackRate:p,loop:h}=d;e({type:i,id:o.getId(d),currentTime:l,volume:g,muted:f,playbackRate:p,loop:h})}),n.media||500)),c=[ee("play",a(He.Play),s),ee("pause",a(He.Pause),s),ee("seeked",a(He.Seeked),s),ee("volumechange",a(He.VolumeChange),s),ee("ratechange",a(He.RateChange),s)];return x(()=>{c.forEach(i=>i())})}function wi({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let o=[],n=new WeakMap,s=r.FontFace;r.FontFace=function(i,u,d){let l=new s(i,u,d);return n.set(l,{family:i,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};let a=ze(t.fonts,"add",function(c){return function(i){return setTimeout(x(()=>{let u=n.get(i);u&&(e(u),n.delete(i))}),0),c.apply(this,[i])}});return o.push(()=>{r.FontFace=s}),o.push(a),x(()=>{o.forEach(c=>c())})}function Ei(e){let{doc:t,mirror:r,blockClass:o,blockSelector:n,selectionCb:s}=e,a=!0,c=x(()=>{let i=t.getSelection();if(!i||a&&i?.isCollapsed)return;a=i.isCollapsed||!1;let u=[],d=i.rangeCount||0;for(let l=0;l<d;l++){let g=i.getRangeAt(l),{startContainer:f,startOffset:p,endContainer:h,endOffset:C}=g;te(f,o,n,!0)||te(h,o,n,!0)||u.push({start:r.getId(f),startOffset:p,end:r.getId(h),endOffset:C})}s({ranges:u})});return c(),ee("selectionchange",c)}function Ii({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:ze(r.customElements,"define",function(n){return function(s,a,c){try{t({define:{name:s}})}catch{console.warn(`Custom element callback failed for ${s}`)}return n.apply(this,[s,a,c])}})}function _i(e,t){let{mutationCb:r,mousemoveCb:o,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:a,inputCb:c,mediaInteractionCb:i,styleSheetRuleCb:u,styleDeclarationCb:d,canvasMutationCb:l,fontCb:g,selectionCb:f,customElementCb:p}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),o(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),n(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),s(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),c(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),i(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),u(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),d(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),l(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),g(...h)},e.selectionCb=(...h)=>{t.selection&&t.selection(...h),f(...h)},e.customElementCb=(...h)=>{t.customElement&&t.customElement(...h),p(...h)}}function Ri(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};_i(e,t);let o;e.recordDOM&&(o=Yo(e,e.doc));let n=fi(e),s=pi(e),a=Vo(e),c=gi(e,{win:r}),i=yi(e),u=Ci(e),d=()=>{},l=()=>{},g=()=>{},f=()=>{};e.recordDOM&&(d=vi(e,{win:r}),l=Wo(e,e.doc),g=bi(e,{win:r}),e.collectFonts&&(f=wi(e)));let p=Ei(e),h=Ii(e),C=[];for(let I of e.plugins)C.push(I.observer(I.callback,r,I.options));return x(()=>{Te.forEach(I=>I.reset()),o?.disconnect(),n(),s(),a(),c(),i(),u(),d(),l(),g(),f(),p(),h(),C.forEach(I=>I())})}function St(e){return typeof window[e]<"u"}function vt(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Dt=class{constructor(t){S(this,"iframeIdToRemoteIdMap",new WeakMap),S(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,o,n){let s=o||this.getIdToRemoteIdMap(t),a=n||this.getRemoteIdToIdMap(t),c=s.get(r);return c||(c=this.generateIdFn(),s.set(r,c),a.set(c,r)),c}getIds(t,r){let o=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getId(t,s,o,n))}getRemoteId(t,r,o){let n=o||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let s=n.get(r);return s||-1}getRemoteIds(t,r){let o=this.getRemoteIdToIdMap(t);return r.map(n=>this.getRemoteId(t,n,o))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},mr=class{constructor(t){S(this,"iframes",new WeakMap),S(this,"crossOriginIframeMap",new WeakMap),S(this,"crossOriginIframeMirror",new Dt(Io)),S(this,"crossOriginIframeStyleMirror"),S(this,"crossOriginIframeRootIdMap",new WeakMap),S(this,"mirror"),S(this,"mutationCb"),S(this,"wrappedEmit"),S(this,"loadListener"),S(this,"stylesheetManager"),S(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Dt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var o,n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((o=t.contentWindow)==null||o.addEventListener("message",this.handleMessage.bind(this))),(n=this.loadListener)==null||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let n=this.crossOriginIframeMap.get(t.source);if(!n)return;let s=this.transformCrossOriginEvent(n,r.data.event);s&&this.wrappedEmit(s,r.data.isCheckout)}transformCrossOriginEvent(t,r){var o;switch(r.type){case M.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let n=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(r.data.node,n),{timestamp:r.timestamp,type:M.IncrementalSnapshot,data:{source:N.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case M.Meta:case M.Load:case M.DomContentLoaded:return!1;case M.Plugin:return r;case M.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case M.IncrementalSnapshot:switch(r.data.source){case N.Mutation:return r.data.adds.forEach(n=>{this.replaceIds(n,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,t);let s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(n.node,s)}),r.data.removes.forEach(n=>{this.replaceIds(n,t,["parentId","id"])}),r.data.attributes.forEach(n=>{this.replaceIds(n,t,["id"])}),r.data.texts.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case N.Drag:case N.TouchMove:case N.MouseMove:return r.data.positions.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case N.ViewportResize:return!1;case N.MediaInteraction:case N.MouseInteraction:case N.Scroll:case N.CanvasMutation:case N.Input:return this.replaceIds(r.data,t,["id"]),r;case N.StyleSheetRule:case N.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case N.Font:return r;case N.Selection:return r.data.ranges.forEach(n=>{this.replaceIds(n,t,["start","end"])}),r;case N.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(o=r.data.styles)==null||o.forEach(n=>{this.replaceStyleIds(n,t,["styleId"])}),r}}return!1}replace(t,r,o,n){for(let s of n)!Array.isArray(r[s])&&typeof r[s]!="number"||(Array.isArray(r[s])?r[s]=t.getIds(o,r[s]):r[s]=t.getId(o,r[s]));return r}replaceIds(t,r,o){return this.replace(this.crossOriginIframeMirror,t,r,o)}replaceStyleIds(t,r,o){return this.replace(this.crossOriginIframeStyleMirror,t,r,o)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(o=>{this.replaceIdOnNode(o,r)})}patchRootIdOnNode(t,r){t.type!==K.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(o=>{this.patchRootIdOnNode(o,r)})}},yr=class{constructor(t){S(this,"shadowDoms",new WeakSet),S(this,"mutationCb"),S(this,"scrollCb"),S(this,"bypassOptions"),S(this,"mirror"),S(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!qe(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let o=Yo({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>o.disconnect()),this.restoreHandlers.push(Vo({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(T.host(t))),this.restoreHandlers.push(Wo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let o=this;this.restoreHandlers.push(ze(t.prototype,"attachShadow",function(n){return function(s){let a=n.call(this,s),c=T.shadowRoot(this);return c&&Uo(this)&&o.addShadowRoot(c,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ai=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Je=0;Je<We.length;Je++)Ai[We.charCodeAt(Je)]=Je;var Je,Di=function(e){var t=new Uint8Array(e),r,o=t.length,n="";for(r=0;r<o;r+=3)n+=We[t[r]>>2],n+=We[(t[r]&3)<<4|t[r+1]>>4],n+=We[(t[r+1]&15)<<2|t[r+2]>>6],n+=We[t[r+2]&63];return o%3===2?n=n.substring(0,n.length-1)+"=":o%3===1&&(n=n.substring(0,n.length-2)+"=="),n},go=new Map;function Ti(e,t){let r=go.get(e);return r||(r=new Map,go.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Bo=(e,t,r)=>{if(!e||!(Go(e,t)||typeof e=="object"))return;let o=e.constructor.name,n=Ti(r,o),s=n.indexOf(e);return s===-1&&(s=n.length,n.push(e)),s};function bt(e,t,r){if(e instanceof Array)return e.map(o=>bt(o,t,r));if(e===null)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){let o=e.constructor.name,n=Di(e);return{rr_type:o,base64:n}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let o=e.constructor.name,{src:n}=e;return{rr_type:o,src:n}}else if(e instanceof HTMLCanvasElement){let o="HTMLImageElement",n=e.toDataURL();return{rr_type:o,src:n}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[bt(e.data,t,r),e.width,e.height]};if(Go(e,t)||typeof e=="object"){let o=e.constructor.name,n=Bo(e,t,r);return{rr_type:o,index:n}}}}return e}var zo=(e,t,r)=>e.map(o=>bt(o,t,r)),Go=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function").find(n=>e instanceof t[n]);function Ni(e,t,r,o){let n=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=ze(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...u){return te(this.canvas,r,o,!0)||setTimeout(()=>{let d=zo(u,t,this);e(this.canvas,{type:Be["2D"],property:a,args:d})},0),i.apply(this,u)}});n.push(c)}catch{let c=Nt(t.CanvasRenderingContext2D.prototype,a,{set(i){e(this.canvas,{type:Be["2D"],property:a,args:[i],setter:!0})}});n.push(c)}return()=>{n.forEach(a=>a())}}function Oi(e){return e==="experimental-webgl"?"webgl":e}function mo(e,t,r,o){let n=[];try{let s=ze(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...i){if(!te(this,t,r,!0)){let u=Oi(c);if("__context"in this||(this.__context=u),o&&["webgl","webgl2"].includes(u))if(i[0]&&typeof i[0]=="object"){let d=i[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...i])}});n.push(s)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(s=>s())}}function yo(e,t,r,o,n,s){let a=[],c=Object.getOwnPropertyNames(e);for(let i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if(typeof e[i]!="function")continue;let u=ze(e,i,function(d){return function(...l){let g=d.apply(this,l);if(Bo(g,s,this),"tagName"in this.canvas&&!te(this.canvas,o,n,!0)){let f=zo(l,s,this),p={type:t,property:i,args:f};r(this.canvas,p)}return g}});a.push(u)}catch{let u=Nt(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:!0})}});a.push(u)}return a}function xi(e,t,r,o){let n=[];return n.push(...yo(t.WebGLRenderingContext.prototype,Be.WebGL,e,r,o,t)),typeof t.WebGL2RenderingContext<"u"&&n.push(...yo(t.WebGL2RenderingContext.prototype,Be.WebGL2,e,r,o,t)),()=>{n.forEach(s=>s())}}var Ko="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Mi=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),So=typeof window<"u"&&window.Blob&&new Blob([Mi(Ko)],{type:"text/javascript;charset=utf-8"});function ki(e){let t;try{if(t=So&&(window.URL||window.webkitURL).createObjectURL(So),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+Ko,{name:e?.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var Sr=class{constructor(t){S(this,"pendingCanvasMutations",new Map),S(this,"rafStamps",{latestId:0,invokeId:null}),S(this,"mirror"),S(this,"mutationCb"),S(this,"resetObservers"),S(this,"frozen",!1),S(this,"locked",!1),S(this,"processMutation",(i,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(i)||this.pendingCanvasMutations.set(i,[]),this.pendingCanvasMutations.get(i).push(u)});let{sampling:r="all",win:o,blockClass:n,blockSelector:s,recordCanvas:a,dataURLOptions:c}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(o,n,s),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,o,n,s,{dataURLOptions:c})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,o,n,s){let a=mo(r,o,n,!0),c=new Map,i=new ki;i.onmessage=p=>{let{id:h}=p.data;if(c.set(h,!1),!("base64"in p.data))return;let{base64:C,type:I,width:v,height:y}=p.data;this.mutationCb({id:h,type:Be["2D"],commands:[{property:"clearRect",args:[0,0,v,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:I}]},0,0]}]})};let u=1e3/t,d=0,l,g=()=>{let p=[];return r.document.querySelectorAll("canvas").forEach(h=>{te(h,o,n,!0)||p.push(h)}),p},f=p=>{if(d&&p-d<u){l=requestAnimationFrame(f);return}d=p,g().forEach(async h=>{var C;let I=this.mirror.getId(h);if(c.get(I)||h.width===0||h.height===0)return;if(c.set(I,!0),["webgl","webgl2"].includes(h.__context)){let y=h.getContext(h.__context);((C=y?.getContextAttributes())==null?void 0:C.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let v=await createImageBitmap(h);i.postMessage({id:I,bitmap:v,width:h.width,height:h.height,dataURLOptions:s.dataURLOptions},[v])}),l=requestAnimationFrame(f)};l=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(l)}}initCanvasMutationObserver(t,r,o){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=mo(t,r,o,!1),s=Ni(this.processMutation.bind(this),t,r,o),a=xi(this.processMutation.bind(this),t,r,o);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let o=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,o)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let o=this.pendingCanvasMutations.get(t);if(!o||r===-1)return;let n=o.map(a=>{let{type:c,...i}=a;return i}),{type:s}=o[0];this.mutationCb({id:r,type:s,commands:n}),this.pendingCanvasMutations.delete(t)}},vr=class{constructor(t){S(this,"trackedLinkElements",new WeakSet),S(this,"mutationCb"),S(this,"adoptedStyleSheetCb"),S(this,"styleMirror",new hr),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let o={id:r,styleIds:[]},n=[];for(let s of t){let a;this.styleMirror.has(s)?a=this.styleMirror.getId(s):(a=this.styleMirror.add(s),n.push({styleId:a,rules:Array.from(s.rules||CSSRule,(c,i)=>({rule:wo(c,s.href),index:i}))})),o.styleIds.push(a)}n.length>0&&(o.styles=n),this.adoptedStyleSheetCb(o)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},br=class{constructor(){S(this,"nodeMap",new WeakMap),S(this,"active",!1)}inOtherBuffer(t,r){let o=this.nodeMap.get(t);return o&&Array.from(o).some(n=>n!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},z,Ct,ar,Tt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Qr=e.contentWindow)==null?void 0:Qr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var he=Is();function me(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:o,blockClass:n="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:i="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:l,maskInputOptions:g,slimDOMOptions:f,maskInputFn:p,maskTextFn:h,maskAnchorHrefFn:C,blockImgSrcPattern:I=null,blockImgSrcFillOptions:v={backgroundColor:"#F6F7F9",strokeColor:"#E9EBEF",strokeWidth:"1px"},hooks:y,packFn:_,sampling:A={},dataURLOptions:m={},mousemoveWait:E,recordDOM:w=!0,recordCanvas:D=!1,recordCrossOriginIframes:L=!1,recordAfter:oe=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:H=!1,collectFonts:ne=!1,inlineImages:G=!1,plugins:V,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:Y=new Set([]),errorHandler:$}=e;li($);let P=L?window.parent===window:!0,Z=!1;if(!P)try{window.parent.document&&(Z=!1)}catch{Z=!0}if(P&&!t)throw new Error("emit function is required");if(!P&&!Z)return()=>{};E!==void 0&&A.mousemove===void 0&&(A.mousemove=E),he.reset();let j=l===!0?{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}:g!==void 0?g:{password:!0},J=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all",headTitleMutations:f==="all"}:f||{};ai();let Se,se=0,X=O=>{for(let le of V||[])le.eventProcessor&&(O=le.eventProcessor(O));return _&&!Z&&(O=_(O)),O};z=(O,le)=>{var W;let B=O;if(B.timestamp=Rt(),(W=Te[0])!=null&&W.isFrozen()&&B.type!==M.FullSnapshot&&!(B.type===M.IncrementalSnapshot&&B.data.source===N.Mutation)&&Te.forEach(ge=>ge.unfreeze()),P)t?.(X(B),le);else if(Z){let ge={type:"rrweb",event:X(B),origin:window.location.origin,isCheckout:le};window.parent.postMessage(ge,"*")}if(B.type===M.FullSnapshot)Se=B,se=0;else if(B.type===M.IncrementalSnapshot){if(B.data.source===N.Mutation&&B.data.isAttachIframe)return;se++;let ge=o&&se>=o,F=r&&B.timestamp-Se.timestamp>r;(ge||F)&&Ct(!0)}};let Me=O=>{z({type:M.IncrementalSnapshot,data:{source:N.Mutation,...O}})},je=O=>z({type:M.IncrementalSnapshot,data:{source:N.Scroll,...O}}),ke=O=>z({type:M.IncrementalSnapshot,data:{source:N.CanvasMutation,...O}}),Yt=O=>z({type:M.IncrementalSnapshot,data:{source:N.AdoptedStyleSheet,...O}}),fe=new vr({mutationCb:Me,adoptedStyleSheetCb:Yt}),pe=new mr({mirror:he,mutationCb:Me,stylesheetManager:fe,recordCrossOriginIframes:L,wrappedEmit:z});for(let O of V||[])O.getMirror&&O.getMirror({nodeMirror:he,crossOriginIframeMirror:pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:pe.crossOriginIframeStyleMirror});let Le=new br;ar=new Sr({recordCanvas:D,mutationCb:ke,win:window,blockClass:n,blockSelector:s,mirror:he,sampling:A.canvas,dataURLOptions:m});let ut=new yr({mutationCb:Me,scrollCb:je,bypassOptions:{blockClass:n,blockSelector:s,maskTextClass:i,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:j,dataURLOptions:m,maskTextFn:h,maskInputFn:p,maskAnchorHrefFn:C,blockImgSrcPattern:I,blockImgSrcFillOptions:v,recordCanvas:D,inlineImages:G,sampling:A,slimDOMOptions:J,iframeManager:pe,stylesheetManager:fe,canvasManager:ar,keepIframeSrcFn:R,processedNodeManager:Le},mirror:he});Ct=(O=!1)=>{if(!w)return;z({type:M.Meta,data:{href:window.location.href,width:xo(),height:Oo()}},O),fe.reset(),ut.init(),Te.forEach(W=>W.lock());let le=$s(document,{mirror:he,blockClass:n,blockSelector:s,maskTextClass:i,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:j,maskTextFn:h,maskInputFn:p,maskAnchorHrefFn:C,blockImgSrcPattern:I,blockImgSrcFillOptions:v,slimDOM:J,dataURLOptions:m,recordCanvas:D,inlineImages:G,onSerialize:W=>{Lo(W,he)&&pe.addIframe(W),Po(W,he)&&fe.trackLinkElement(W),lr(W)&&ut.addShadowRoot(T.shadowRoot(W),document)},onIframeLoad:(W,B)=>{pe.attachIframe(W,B),ut.observeAttachShadow(W)},onStylesheetLoad:(W,B)=>{fe.attachLinkElement(W,B)},keepIframeSrcFn:R});if(!le)return console.warn("Failed to snapshot the document");z({type:M.FullSnapshot,data:{node:le,initialOffset:No(window)}},O),Te.forEach(W=>W.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&fe.adoptStyleSheets(document.adoptedStyleSheets,he.getId(document))};try{let O=[],le=B=>{var ge;return x(Ri)({mutationCb:Me,mousemoveCb:(F,Vt)=>z({type:M.IncrementalSnapshot,data:{source:Vt,positions:F}}),mouseInteractionCb:F=>z({type:M.IncrementalSnapshot,data:{source:N.MouseInteraction,...F}}),scrollCb:je,viewportResizeCb:F=>z({type:M.IncrementalSnapshot,data:{source:N.ViewportResize,...F}}),inputCb:F=>z({type:M.IncrementalSnapshot,data:{source:N.Input,...F}}),mediaInteractionCb:F=>z({type:M.IncrementalSnapshot,data:{source:N.MediaInteraction,...F}}),styleSheetRuleCb:F=>z({type:M.IncrementalSnapshot,data:{source:N.StyleSheetRule,...F}}),styleDeclarationCb:F=>z({type:M.IncrementalSnapshot,data:{source:N.StyleDeclaration,...F}}),canvasMutationCb:ke,fontCb:F=>z({type:M.IncrementalSnapshot,data:{source:N.Font,...F}}),selectionCb:F=>{z({type:M.IncrementalSnapshot,data:{source:N.Selection,...F}})},customElementCb:F=>{z({type:M.IncrementalSnapshot,data:{source:N.CustomElement,...F}})},blockClass:n,ignoreClass:a,ignoreSelector:c,maskTextClass:i,maskTextSelector:u,maskInputOptions:j,inlineStylesheet:d,sampling:A,recordDOM:w,recordCanvas:D,inlineImages:G,userTriggeredOnInput:H,collectFonts:ne,doc:B,maskInputFn:p,maskTextFn:h,maskAnchorHrefFn:C,blockImgSrcPattern:I,blockImgSrcFillOptions:v,keepIframeSrcFn:R,blockSelector:s,slimDOMOptions:J,dataURLOptions:m,mirror:he,iframeManager:pe,stylesheetManager:fe,shadowDomManager:ut,processedNodeManager:Le,canvasManager:ar,ignoreCSSAttributes:Y,plugins:((ge=V?.filter(F=>F.observer))==null?void 0:ge.map(F=>({observer:F.observer,options:F.options,callback:Vt=>z({type:M.Plugin,data:{plugin:F.name,payload:Vt}})})))||[]},y)};pe.addLoadListener(B=>{try{O.push(le(B.contentDocument))}catch(ge){console.warn(ge)}});let W=()=>{Ct(),O.push(le(document)),Tt=!0};return document.readyState==="interactive"||document.readyState==="complete"?W():(O.push(ee("DOMContentLoaded",()=>{z({type:M.DomContentLoaded,data:{}}),oe==="DOMContentLoaded"&&W()})),O.push(ee("load",()=>{z({type:M.Load,data:{}}),oe==="load"&&W()},window))),()=>{O.forEach(B=>B()),Le.destroy(),Tt=!1,hi()}}catch(O){console.warn(O)}}me.addCustomEvent=(e,t)=>{if(!Tt)throw new Error("please add custom event after start recording");z({type:M.Custom,data:{tag:e,payload:t}})};me.freezePage=()=>{Te.forEach(e=>e.freeze())};me.takeFullSnapshot=e=>{if(!Tt)throw new Error("please take full snapshot after start recording");Ct(e)};me.mirror=he;var vo;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(vo||(vo={}));function Ot(e,t){if(!t)return;let r=new URL(e),o={};for(let[n,s]of r.searchParams)t.includes(n)&&(o[n]=s);return Object.keys(o).length>0?o:void 0}var jo=require("minimatch");function _r(e){throw new Error(`This code path should be unreachable: ${e}`)}function Li(e){return(e.startsWith("http://")||e.startsWith("https://"))&&(e=e.replace(/^https?:\/\//,"")),e.endsWith("/")&&(e=e.substring(0,e.length-1)),e=e.replace(/:\d+$/,""),e}function Pi(e,t){if(!t||t==="")return!1;if(t==="*")return!0;let r=Li(t);return e===r}function ce({urlStr:e,pathConfig:t}){let r=new URL(e),o=r.pathname,n=r.hostname,s=t.rules.filter(c=>Pi(n,c.domain));if(s.length>0){let c=s.find(i=>i.path==="**");if(!c)return t.defaultAction==="allow"?r:void 0;for(let i of s){if(i.path==="**")continue;let u=Pe(o,i);if(u!==void 0)switch(i.action){case"allow":return r;case"block":return;case"replace":return r.pathname=u,r;default:_r(i.action)}}return c.action==="allow"?r:void 0}let a=t.rules.filter(c=>!c.domain);for(let c of a){let i=Pe(o,c);if(i!==void 0)switch(c.action){case"allow":return r;case"block":return;case"replace":return r.pathname=i,r;default:_r(c.action)}}return t.defaultAction==="allow"?r:void 0}function ot(e,t,r){let o=ce({urlStr:e,pathConfig:r});o||(o=new URL(e));let n=Fi(o.pathname,t.rules||[]),s=[];for(let a of o.searchParams.keys()){let c=Ui(a,n?.rules||[]);switch(c){case"accept":break;case"delete":s.push(a);break;case"anonymize":o.searchParams.set(a,"*");break;default:ae(c)}}for(let a of s)o.searchParams.delete(a);if(o.pathname.includes("%3F")){let a=o.pathname.split("/");a[a.length-1]=a[a.length-1].split("%3F")[0],o.pathname=a.join("/")}return o.hash.includes("=")&&(o.hash=""),o.toString()}function Fi(e,t){for(let r of t)if(Pe(e,{path:r.path}))return r}function Ui(e,t){for(let r of t)if((0,jo.minimatch)(e,r.param))return r.anonymizeValue?"anonymize":"accept";return"delete"}var Rr=class{constructor(t,r,o){this.org=t;this.recorder=r;this.events=[];this._estimatedByteSize=0;this.events=o,this._estimatedByteSize=this.calculateTotalSize()}get estimatedByteSize(){return this._estimatedByteSize}calculateTotalSize(){try{let t=JSON.stringify(this.events,this.getCircularReplacer());return Hi(t)}catch(t){return b(`Error calculating event size: ${t}. Falling back to approximation.`),this.events.length*500}}getCircularReplacer(){let t=new WeakSet;return(r,o)=>{if(typeof o=="object"&&o!==null){if(t.has(o))return;t.add(o)}return o}}clearEvents(){this.events=[],this._estimatedByteSize=this.calculateTotalSize()}pushEvent({eventHref:t,event:r}){if(!ce({urlStr:t,pathConfig:this.org.pathConfig})){b(`URL not accepted: ${t}`);return}if(!this.recorder.isRecording){b("Dropping event - recorder is not recording");return}this.events.push(r),this._estimatedByteSize=this.calculateTotalSize()}getEvents(){return this.events}},xt=class{constructor(t,r,o,n,s){this.org=t;this.eventStorage=r;this.getHref=o;this.eventStore=new Rr(t,n,s)}get estimatedSerializedByteSize(){return this.eventStore.estimatedByteSize}clear(){this.eventStore.clearEvents(),this.eventStorage.removeEvents()}getEvents(){return this.eventStore.getEvents()}onVisibilityChange(t){t||this.eventStorage.setEvents(this.getEvents())}append(t){let r=this.getHref();if(t.type===Q.Meta)t.data.href=ot(t.data.href,this.org.allowedQueryParams,this.org.pathConfig),this.lastHref=this.getHref();else if(this.lastHref&&r!=this.lastHref){b(`URL changed from ${this.lastHref} to ${r}, adding artificial meta event for ${this.getHref()}`),this.eventStore.pushEvent({eventHref:r,event:jr({href:ot(r,this.org.allowedQueryParams,this.org.pathConfig),delay:t.delay,timestamp:t.timestamp})});let o=Ot(r,this.org.customQueryParamsCohorts);o&&this.eventStore.pushEvent({eventHref:r,event:Ze({payload:{userCohorts:o,source:"query_params"},timestamp:t.timestamp,delay:t.delay})}),this.lastHref=this.getHref()}if(t.type===Q.IncrementalSnapshot&&t.data.source===De.MouseInteraction&&t.data.type===zt.Click){let o=me.mirror.getNode(t.data.id);if(o){let n=Yi(o),s=Kr({dom0EventHandlers:n,delay:t.delay,timestamp:t.timestamp});this.eventStore.pushEvent({eventHref:r,event:s})}}this.eventStore.pushEvent({eventHref:r,event:t})}};function Hi(e){return new Blob([e]).size}function Yi(e){let t=[];for(let r=0;r<Gt.length;r++){let n=Gt[r];typeof e[n]=="function"&&t.push(n)}return t}var ue=Uint8Array,re=Uint16Array,at=Uint32Array,xr=new ue([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]),Mr=new ue([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]),$o=new ue([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qo=function(e,t){for(var r=new re(31),o=0;o<31;++o)r[o]=t+=1<<e[o-1];for(var n=new at(r[30]),o=1;o<30;++o)for(var s=r[o];s<r[o+1];++s)n[s]=s-r[o]<<5|o;return[r,n]},Qo=qo(xr,2),Vi=Qo[0],Dr=Qo[1];Vi[28]=258,Dr[258]=28;var en=qo(Mr,0),au=en[0],Zo=en[1],Tr=new re(32768);for(k=0;k<32768;++k)we=(k&43690)>>>1|(k&21845)<<1,we=(we&52428)>>>2|(we&13107)<<2,we=(we&61680)>>>4|(we&3855)<<4,Tr[k]=((we&65280)>>>8|(we&255)<<8)>>>1;var we,k,it=function(e,t,r){for(var o=e.length,n=0,s=new re(t);n<o;++n)++s[e[n]-1];var a=new re(t);for(n=0;n<t;++n)a[n]=a[n-1]+s[n-1]<<1;var c;if(r){c=new re(1<<t);var i=15-t;for(n=0;n<o;++n)if(e[n])for(var u=n<<4|e[n],d=t-e[n],l=a[e[n]-1]++<<d,g=l|(1<<d)-1;l<=g;++l)c[Tr[l]>>>i]=u}else for(c=new re(o),n=0;n<o;++n)c[n]=Tr[a[e[n]-1]++]>>>15-e[n];return c},Oe=new ue(288);for(k=0;k<144;++k)Oe[k]=8;var k;for(k=144;k<256;++k)Oe[k]=9;var k;for(k=256;k<280;++k)Oe[k]=7;var k;for(k=280;k<288;++k)Oe[k]=8;var k,Mt=new ue(32);for(k=0;k<32;++k)Mt[k]=5;var k,Wi=it(Oe,9,0);var Bi=it(Mt,5,0);var tn=function(e){return(e/8>>0)+(e&7&&1)},rn=function(e,t,r){(r==null||r>e.length)&&(r=e.length);var o=new(e instanceof re?re:e instanceof at?at:ue)(r-t);return o.set(e.subarray(t,r)),o};var Ee=function(e,t,r){r<<=t&7;var o=t/8>>0;e[o]|=r,e[o+1]|=r>>>8},nt=function(e,t,r){r<<=t&7;var o=t/8>>0;e[o]|=r,e[o+1]|=r>>>8,e[o+2]|=r>>>16},Ar=function(e,t){for(var r=[],o=0;o<e.length;++o)e[o]&&r.push({s:o,f:e[o]});var n=r.length,s=r.slice();if(!n)return[new ue(0),0];if(n==1){var a=new ue(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(A,m){return A.f-m.f}),r.push({s:-1,f:25001});var c=r[0],i=r[1],u=0,d=1,l=2;for(r[0]={s:-1,f:c.f+i.f,l:c,r:i};d!=n-1;)c=r[r[u].f<r[l].f?u++:l++],i=r[u!=d&&r[u].f<r[l].f?u++:l++],r[d++]={s:-1,f:c.f+i.f,l:c,r:i};for(var g=s[0].s,o=1;o<n;++o)s[o].s>g&&(g=s[o].s);var f=new re(g+1),p=Nr(r[d-1],f,0);if(p>t){var o=0,h=0,C=p-t,I=1<<C;for(s.sort(function(m,E){return f[E.s]-f[m.s]||m.f-E.f});o<n;++o){var v=s[o].s;if(f[v]>t)h+=I-(1<<p-f[v]),f[v]=t;else break}for(h>>>=C;h>0;){var y=s[o].s;f[y]<t?h-=1<<t-f[y]++-1:++o}for(;o>=0&&h;--o){var _=s[o].s;f[_]==t&&(--f[_],++h)}p=t}return[new ue(f),p]},Nr=function(e,t,r){return e.s==-1?Math.max(Nr(e.l,t,r+1),Nr(e.r,t,r+1)):t[e.s]=r},Jo=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new re(++t),o=0,n=e[0],s=1,a=function(i){r[o++]=i},c=1;c<=t;++c)if(e[c]==n&&c!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=e[c]}return[r.subarray(0,o),t]},st=function(e,t){for(var r=0,o=0;o<t.length;++o)r+=e[o]*t[o];return r},Or=function(e,t,r){var o=r.length,n=tn(t+2);e[n]=o&255,e[n+1]=o>>>8,e[n+2]=e[n]^255,e[n+3]=e[n+1]^255;for(var s=0;s<o;++s)e[n+s+4]=r[s];return(n+4+o)*8},Xo=function(e,t,r,o,n,s,a,c,i,u,d){Ee(t,d++,r),++n[256];for(var l=Ar(n,15),g=l[0],f=l[1],p=Ar(s,15),h=p[0],C=p[1],I=Jo(g),v=I[0],y=I[1],_=Jo(h),A=_[0],m=_[1],E=new re(19),w=0;w<v.length;++w)E[v[w]&31]++;for(var w=0;w<A.length;++w)E[A[w]&31]++;for(var D=Ar(E,7),L=D[0],oe=D[1],H=19;H>4&&!L[$o[H-1]];--H);var ne=u+5<<3,G=st(n,Oe)+st(s,Mt)+a,V=st(n,g)+st(s,h)+a+14+3*H+st(E,L)+(2*E[16]+3*E[17]+7*E[18]);if(ne<=G&&ne<=V)return Or(t,d,e.subarray(i,i+u));var R,Y,$,P;if(Ee(t,d,1+(V<G)),d+=2,V<G){R=it(g,f,0),Y=g,$=it(h,C,0),P=h;var Z=it(L,oe,0);Ee(t,d,y-257),Ee(t,d+5,m-1),Ee(t,d+10,H-4),d+=14;for(var w=0;w<H;++w)Ee(t,d+3*w,L[$o[w]]);d+=3*H;for(var j=[v,A],J=0;J<2;++J)for(var Se=j[J],w=0;w<Se.length;++w){var se=Se[w]&31;Ee(t,d,Z[se]),d+=L[se],se>15&&(Ee(t,d,Se[w]>>>5&127),d+=Se[w]>>>12)}}else R=Wi,Y=Oe,$=Bi,P=Mt;for(var w=0;w<c;++w)if(o[w]>255){var se=o[w]>>>18&31;nt(t,d,R[se+257]),d+=Y[se+257],se>7&&(Ee(t,d,o[w]>>>23&31),d+=xr[se]);var X=o[w]&31;nt(t,d,$[X]),d+=P[X],X>3&&(nt(t,d,o[w]>>>5&8191),d+=Mr[X])}else nt(t,d,R[o[w]]),d+=Y[o[w]];return nt(t,d,R[256]),d+Y[256]},zi=new at([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gi=function(e,t,r,o,n,s){var a=e.length,c=new ue(o+a+5*(1+Math.floor(a/7e3))+n),i=c.subarray(o,c.length-n),u=0;if(!t||a<8)for(var d=0;d<=a;d+=65535){var l=d+65535;l<a?u=Or(i,u,e.subarray(d,l)):(i[d]=s,u=Or(i,u,e.subarray(d,a)))}else{for(var g=zi[t-1],f=g>>>13,p=g&8191,h=(1<<r)-1,C=new re(32768),I=new re(h+1),v=Math.ceil(r/3),y=2*v,_=function(O){return(e[O]^e[O+1]<<v^e[O+2]<<y)&h},A=new at(25e3),m=new re(288),E=new re(32),w=0,D=0,d=0,L=0,oe=0,H=0;d<a;++d){var ne=_(d),G=d&32767,V=I[ne];if(C[G]=V,I[ne]=G,oe<=d){var R=a-d;if((w>7e3||L>24576)&&R>423){u=Xo(e,i,0,A,m,E,D,L,H,d-H,u),L=w=D=0,H=d;for(var Y=0;Y<286;++Y)m[Y]=0;for(var Y=0;Y<30;++Y)E[Y]=0}var $=2,P=0,Z=p,j=G-V&32767;if(R>2&&ne==_(d-j))for(var J=Math.min(f,R)-1,Se=Math.min(32767,d),se=Math.min(258,R);j<=Se&&--Z&&G!=V;){if(e[d+$]==e[d+$-j]){for(var X=0;X<se&&e[d+X]==e[d+X-j];++X);if(X>$){if($=X,P=j,X>J)break;for(var Me=Math.min(j,X-2),je=0,Y=0;Y<Me;++Y){var ke=d-j+Y+32768&32767,Yt=C[ke],fe=ke-Yt+32768&32767;fe>je&&(je=fe,V=ke)}}}G=V,V=C[G],j+=G-V+32768&32767}if(P){A[L++]=268435456|Dr[$]<<18|Zo[P];var pe=Dr[$]&31,Le=Zo[P]&31;D+=xr[pe]+Mr[Le],++m[257+pe],++E[Le],oe=d+$,++w}else A[L++]=e[d],++m[e[d]]}}u=Xo(e,i,s,A,m,E,D,L,H,d-H,u)}return rn(c,0,o+tn(u)+n)},Ki=function(){var e=1,t=0;return{p:function(r){for(var o=e,n=t,s=r.length,a=0;a!=s;){for(var c=Math.min(a+5552,s);a<c;++a)o+=r[a],n+=o;o%=65521,n%=65521}e=o,t=n},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},ji=function(e,t,r,o,n){return Gi(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,o,!n)},$i=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Zi=function(e,t){var r=t.level,o=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=o<<6|(o?32-2*o:1)};function on(e,t){t===void 0&&(t={});var r=Ki();r.p(e);var o=ji(e,t,2,4);return Zi(o,t),$i(o,o.length-4,r.d()),o}function kr(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var o=new ue(e.length+(e.length>>>1)),n=0,s=function(u){o[n++]=u},a=0;a<r;++a){if(n+5>o.length){var c=new ue(n+8+(r-a<<1));c.set(o),o=c}var i=e.charCodeAt(a);i<128||t?s(i):i<2048?(s(192|i>>>6),s(128|i&63)):i>55295&&i<57344?(i=65536+(i&1047552)|e.charCodeAt(++a)&1023,s(240|i>>>18),s(128|i>>>12&63),s(128|i>>>6&63),s(128|i&63)):(s(224|i>>>12),s(128|i>>>6&63),s(128|i&63))}return rn(o,0,n)}function Lr(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var o=0;o<e.length;){var n=e[o++];n<128||t?r+=String.fromCharCode(n):n<224?r+=String.fromCharCode((n&31)<<6|e[o++]&63):n<240?r+=String.fromCharCode((n&15)<<12|(e[o++]&63)<<6|e[o++]&63):(n=((n&15)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63)-65536,r+=String.fromCharCode(55296|n>>10,56320|n&1023))}return r}var Pr="v1";var Fr=e=>{let t={...e,v:Pr};return Lr(on(kr(JSON.stringify(t))),!0)};function nn(e){let t=new URL(e),r={};for(let[o,n]of t.searchParams)switch(o){case"utm_source":case"utm_medium":case"utm_campaign":case"utm_term":case"utm_content":r[`UTM@@${o}`]=n;break}return Object.keys(r).length>0?r:void 0}var sn=3*1024*1024,an=5e3,kt=class{constructor(t,r,o,n,s,a,c){this.window=t;this.storage=r;this.eventHolder=o;this.recorder=n;this.api=s;this.organization=a;this.windowGetters=c;this.lastSendTime=-1;this.lastAutoCohorts=void 0;this.fastpathToken=void 0;n.setOnEvent(i=>this.onEvent(i))}onEvent(t){if(t.type===Q.FullSnapshot){let s,a=gt(this.window,this.organization.cohortsBootstrapConfig),c=nn(this.windowGetters.getHref()),i=Ot(this.windowGetters.getHref(),this.organization.customQueryParamsCohorts),u=er(this.window);this.lastAutoCohorts=u,(c||a||u||i)&&(s=Ze({payload:{userCohorts:{...a||{},...u||{},...c||{},...i||{}},source:"window_getters"},delay:t.delay,timestamp:t.timestamp}));let d=s?[...this.eventHolder.getEvents(),s,t]:[...this.eventHolder.getEvents(),t];this.clearAndSaveEvents(d);return}else if(t.type===Q.IncrementalSnapshot&&t.data.source===De.Mutation){let s=er(this.window);s&&(!this.lastAutoCohorts||Object.keys(s).length!==Object.keys(this.lastAutoCohorts).length)&&(b("auto cohorts different, appending new event",s),this.eventHolder.append(Ze({payload:{userCohorts:s,source:"window_getters"},delay:t.delay,timestamp:t.timestamp}))),this.lastAutoCohorts=s}this.eventHolder.append(t);let r=this.eventHolder.estimatedSerializedByteSize,n=Date.now()-this.lastSendTime;r>sn&&n>=an&&(b(`MAX_EVENT_BYTE_SIZE and timeSinceLastSend exceeded: ${r} > ${sn} and ${n} >= ${an}`),this.clearAndSaveEvents())}async clearAndSaveEvents(t){let r=this.windowGetters.getHref();if(!ce({urlStr:r,pathConfig:this.organization.pathConfig}))return;let o=t||this.eventHolder.getEvents();if(o.length!==0){this.eventHolder.clear();try{b("saving events...");let n=await this.prepareAndSendEvents(o);switch(b("save events result",n.type),n.type){case"success":break;case"recreate-session":await this.recreateSession(n.session);break;case"no-session":case"unknown-failure":case"rate-limit-exceeded":this.storage.removeSession(),this.eventHolder.clear();break;default:ae(n)}}catch(n){throw b("error saving events",n),this.storage.removeSession(),n}}}async prepareAndSendEvents(t){this.lastSendTime=Date.now();let r=this.storage.getSession();if(!r)return{type:"no-session"};if(r.eventPostUrl&&r.eventPostToken){let s=JSON.parse(atob(r.eventPostToken.split(".")[1]));if(s&&Date.now()>s.lastEventAt-10*1e3){b("refreshing token as it is about to expire");let a=await this.refreshToken(r);if(a.type!=="success")return a;if(r=this.storage.getSession(),!r)return{type:"no-session"}}}let o=r.compressionType==="RRWEB_PACK"?t.map(s=>Fr(s)):t,n=await this.api.saveSessionEvents({sessionId:r.id,events:o,metadata:{url:ot(this.windowGetters.getHref(),this.organization.allowedQueryParams,this.organization.pathConfig)},eventPostUrl:r.eventPostUrl,eventPostToken:r.eventPostToken,fastpathToken:this.fastpathToken});if(!n)return{type:"unknown-failure"};if(n.error)switch(n.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:r};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}if(!n.data)return{type:"unknown-failure"};if(n.data&&"code"in n.data)switch(n.data.code){case"TOKEN_REFRESH":{b("refreshing token as it expired on the worker");let s=await this.refreshToken(r);return s.type!=="success"?s:this.prepareAndSendEvents(t)}default:ae(n.data.code)}if(this.fastpathToken=n.data.fastpathToken,n.response.status<200||n.response.status>201)throw new Error(`got status ${n.response.status}`);return{type:"success"}}async refreshToken(t){let r=await this.api.refreshEventToken({sessionId:t.id});if(!r)return{type:"unknown-failure"};if(r.error)switch(r.error.code){case"SessionNotFound":case"SessionAlreadySynced":return{type:"recreate-session",session:t};case"RateLimitExceeded":return{type:"rate-limit-exceeded"}}return r.data?(this.storage.setSession({...t,eventPostToken:r.data.token}),{type:"success"}):{type:"unknown-failure"}}async recreateSession(t){b("recreating sessions");let r,o=this.recorder.isRecording;this.recorder.setRecording(!1),this.storage.removeSession(),this.fastpathToken=void 0;let n,s;try{b("recreating session...");let c=await this.api.startSession({orgId:t.settings.orgId,language:t.settings.language||this.windowGetters.getLanguage(),domain:new URL(this.windowGetters.getHref()).hostname,userCohorts:t.settings.userCohorts||{},uid:t.settings.uid,devicePixelRatio:this.windowGetters.getDevicePixelRatio(),adoraUserId:t.adoraUserId,documentReferrer:t.documentReferrer,snippetVersion:pt});if(!c||c.error)return;if(c.response.status!==201){b("session not created, aborting");return}if(!c.data||!("session"in c.data)){b("malformed session, exiting");return}c?.data&&"eventPostUrl"in c.data&&c.data.eventPostUrl&&"eventPostToken"in c.data&&c.data.eventPostToken&&(n=c.data.eventPostUrl,s=c.data.eventPostToken),r=c.data}catch{}if(!r)return;let a={id:r.session.id,createdAt:r.session.createdAt,status:r.session.status,lastSyncedAt:r.session.lastSyncedAt,domain:r.session.domain,requestIp:r.session.requestIp,country:r.session.country,userAgent:r.session.userAgent,language:r.session.language,initialUserCohorts:r.session.initialUserCohorts,devicePixelRatio:r.session.devicePixelRatio,organization:r.organization,settings:t.settings,adoraUserId:t.adoraUserId,documentReferrer:t.documentReferrer,canvasRecordingEnabled:t.canvasRecordingEnabled,eventPostUrl:n,eventPostToken:s,limitedCanvasRecording:t.limitedCanvasRecording,compressionType:t.compressionType};this.storage.setSession(a),this.eventHolder.clear(),o&&this.recorder.setRecording(!0)}};var Pt=class{constructor(t){this._options=t;this._buckets={};this._refillBuckets=()=>{Object.keys(this._buckets).forEach(t=>{let r=this._getBucket(t)+this._refillRate;r>=this._bucketSize?delete this._buckets[t]:this._setBucket(t,r)})};this._getBucket=t=>this._buckets[String(t)];this._setBucket=(t,r)=>{this._buckets[String(t)]=r};this.consumeRateLimit=t=>{let r=this._getBucket(t)??this._bucketSize;if(r=Math.max(r-1,0),r===0)return!0;this._setBucket(t,r);let o=r===0;return o&&this._onBucketRateLimited?.(t),o};this._onBucketRateLimited=this._options._onBucketRateLimited,this._bucketSize=Lt(this._options.bucketSize,0,100),this._refillRate=Lt(this._options.refillRate,0,this._bucketSize),this._refillInterval=Lt(this._options.refillInterval,0,864e5),this._removeInterval=setInterval(()=>{this._refillBuckets()},this._refillInterval)}stop(){this._removeInterval&&(clearInterval(this._removeInterval),this._removeInterval=void 0)}};function Lt(e,t,r,o){return t>r&&(t=r),Ji(e)?e>r?r:e<t?t:e:Lt(o||r,t,r)}var Ji=e=>toString.call(e)=="[object Number]";var Ft=class{constructor(t,r={}){this._rrweb=t;this._options=r;this._loggedTracker={};this._onNodeRateLimited=t=>{if(!this._loggedTracker[t]){this._loggedTracker[t]=!0;let r=this._getNode(t);this._options.onBlockedNode?.(t,r)}};this._getNodeOrRelevantParent=t=>{let r=this._getNode(t);if(r?.nodeName!=="svg"&&r instanceof Element){let o=r.closest("svg");if(o)return[this._rrweb.mirror.getId(o),o]}return[t,r]};this._getNode=t=>this._rrweb.mirror.getNode(t);this._numberOfChanges=t=>(t.removes?.length??0)+(t.attributes?.length??0)+(t.texts?.length??0)+(t.adds?.length??0);this.throttleMutations=t=>{if(t.type!==Q.IncrementalSnapshot||t.data.source!==De.Mutation)return t;let r=t.data,o=this._numberOfChanges(r);r.attributes&&(r.attributes=r.attributes.filter(s=>{let[a]=this._getNodeOrRelevantParent(s.id);return this._rateLimiter.consumeRateLimit(a)?!1:s}));let n=this._numberOfChanges(r);if(!(n===0&&o!==n))return t};this._rateLimiter=new Pt({bucketSize:this._options.bucketSize??100,refillRate:this._options.refillRate??10,refillInterval:1e3,_onBucketRateLimited:this._onNodeRateLimited})}reset(){this._loggedTracker={}}stop(){this._rateLimiter.stop(),this.reset()}};var Ge,dn=()=>{if(Ge!==void 0)return Ge;try{return Ge=document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")===0,b("adora script - isWebpSupported? - ",Ge),Ge}catch{return Ge=!1,!1}};var Ut=class{constructor(t,r,o,n){this.limitedCanvasRecording=t;this.canvasRecordingEnabled=r;this.org=o;this.rrwebRecorder=n;this.startable=!0;b("new recorder")}setOnEvent(t){this.onEvent=t}get args(){let t=this.org.blockedCSSClasses.length>0?`|(${this.org.blockedCSSClasses.join(")|(")})`:"",r=this.org.maskedCSSClasses&&this.org.maskedCSSClasses?.length>0?`|(${this.org.maskedCSSClasses?.join(")|(")})`:"",o=dn()?"image/webp":this.limitedCanvasRecording?"image/jpeg":"image/png";return{emit:n=>{if(!this.onEvent)throw new Error("onEvent must be assigned before starting recording");n.type===Q.FullSnapshot&&this.mutationThrottler?.reset();let s=this.mutationThrottler?this.mutationThrottler.throttleMutations(n):n;s&&this.onEvent(s)},userTriggeredOnInput:!0,blockClass:new RegExp(`(adora-block)|(rr-block|fs-exclude|ph-no-capture)${t}`),maskTextClass:new RegExp(`(adora-mask)|(rr-mask|fs-mask)${r}`),maskAllInputs:!0,maskInputFn:(n,s)=>cn(this.org,s)?n:"*".repeat(n.length),maskTextFn:(n,s)=>s&&this.org.maskByDefault&&s.closest('button,a,div[role="button"],div[role*="menuitem"],input[type="button"],input[type="submit"],input[type="reset"]')||s&&cn(this.org,s)?n:n.replace(/[\S]/g,"*"),maskTextSelector:this.org?.maskByDefault?"*":"",recordCanvas:this.canvasRecordingEnabled,sampling:this.canvasRecordingEnabled?{canvas:this.limitedCanvasRecording?1:2}:void 0,dataURLOptions:this.canvasRecordingEnabled?{type:o,quality:.6}:{}}}recordChangeCustomCohort(t){b("sending custom cohort change",t),this.rrwebRecorder.addCustomEvent(Gr,t)}recordCLS(t){this.rrwebRecorder.addCustomEvent("CLS",t)}recordFID(t){this.rrwebRecorder.addCustomEvent("FID",t)}recordLCP(t){this.rrwebRecorder.addCustomEvent("LCP",t)}recordVisibilityChange(t){this.rrwebRecorder.addCustomEvent("Adora.VisibilityChange",{visibilityState:t})}recordFocusChange(t){this.rrwebRecorder.addCustomEvent("Adora.FocusChange",{focusState:t})}get isRecording(){return this.rrwebRecorder.isRecording}setRecording(t){if(b("setRecording",`requested status: ${t}`,`current status ${this.rrwebRecorder.isRecording}`),this.rrwebRecorder.isRecording!==t){if(t){this.startRecording();return}this.stopRecording()}}startRecording(){if(this.isRecording)throw new Error("recording already in progress!");if(!this.startable){b("recorder is not startable, returning");return}this.mutationThrottler=new Ft(this.rrwebRecorder,{bucketSize:100,refillRate:10,onBlockedNode:(t,r)=>{b("mutation throttler blocked node",{id:t,node:r})}}),this.rrwebRecorder.record(this.args)}stopRecording(){this.mutationThrottler?.stop(),this.mutationThrottler=void 0,this.rrwebRecorder.stop()}stopFutureRecordings(){this.startable=!1}};function cn(e,t){if(t.classList.contains("adora-unmask"))return!0;for(let r of e.unmaskSelectors)if(Array.from(document.querySelectorAll(r)).find(o=>o===t))return!0;return!1}var Ht=class{constructor(){this._isRecording=!1}get isRecording(){return this._isRecording}get mirror(){return me.mirror}record(t){if(b("record",{stopFn:typeof this.stopFn,isRecording:this._isRecording}),this.stopFn!==void 0&&this.stop(),this._isRecording=!0,this.stopFn=me(t),!this.stopFn)throw new Error("recorder could not successfully start")}stop(){this._isRecording=!1,this.stopFn&&(this.stopFn(),this.stopFn=void 0)}addCustomEvent(t,r){if(!this._isRecording)return b("WARNING! attempting to add custom event with recording off"),!1;try{me.addCustomEvent(t,r)}catch(o){return b("trying to record an event even though",o),!1}return!0}};var un=5e3;function ln({sessionType:e}){b("initialize recording");let t=new Ie(e,new be),r=t.getSession();if(!r)return;let o=new ve(r.settings.backendUrl),n=new ft(e,new be),s=n.getEvents();n.removeEvents();let a=()=>window.location.href,c=()=>window.navigator.language,i=()=>window.devicePixelRatio,u=new Ht,d=new Ut(r.limitedCanvasRecording??!1,r.canvasRecordingEnabled??!1,r.organization,u),l=new xt(r.organization,n,a,d,s||[]),g=new kt(window,t,l,d,o,r.organization,{getHref:a,getLanguage:c,getDevicePixelRatio:i}),f=window.location.href;ce({urlStr:f,pathConfig:r.organization.pathConfig})?(b("starting recording..."),d.setRecording(!0)):b("recording did not start as current URL is blocked");let p=gt(window,r.organization.cohortsBootstrapConfig);d.isRecording&&(d.recordChangeCustomCohort({uid:r.settings.uid,userCohorts:r.settings.userCohorts?{...p,...r.settings.userCohorts}:{}}),t.setSession(r)),Ke.onCLS(_=>{d.isRecording&&d.recordCLS(_)}),Ke.onFID(_=>{d.isRecording&&d.recordFID(_)}),Ke.onLCP(_=>{d.isRecording&&d.recordLCP(_)});let h=()=>{g.clearAndSaveEvents(l.getEvents())},C=window.setInterval(h,un);window.addEventListener("blur",()=>{d.recordFocusChange("blur")}),window.addEventListener("focus",()=>{d.recordFocusChange("focus")}),document.addEventListener("visibilitychange",()=>{if(b(`detected a visibility change to ${document.visibilityState}`),d.isRecording&&d.recordVisibilityChange(document.visibilityState),document.visibilityState==="hidden"){C&&(b("clearing the saveInterval"),clearInterval(C),C=void 0),l.onVisibilityChange(!1);return}C||(b("resuming the saveInterval"),C=window.setInterval(h,un))});let I=f,v=new MutationObserver(function(){if(l&&window.location.href!==I){let _=ce({urlStr:window.location.href,pathConfig:r.organization.pathConfig});b(`url changed detected, status: ${!!_}`),d.setRecording(!!_),I=window.location.href}});return v.observe(document,{subtree:!0,childList:!0}),{recorder:d,eventSync:g,urlChangeObserverDispose:()=>{v.disconnect()}}}var hn=e=>ln(e);var xe=!1,fn="_adora_user_id",pn="_adora_rate_limited",ye,ct,Ur="stopped",gn=()=>{b("startRecording",`adoraIsRunning: ${xe}`),Ur==="started"&&(ye=hn({sessionType:"adoraSessionScript"}))},mn=1e3*60*30,Xi=async({userCohorts:e,...t})=>{let r=t;if(Ur="started",b("adora start",{adoraIsRunning:xe,uid:r.uid,userCohorts:e||{}}),typeof window.sessionStorage!="object"){b("SSR detected");return}if(e){r.userCohorts={};for(let[i,u]of Object.entries(e))u!==void 0?(b("setting user cohorts key",{key:i,value:u}),r.userCohorts[i]=u):b("found undefined user cohorts key",{key:i})}let o=new Ie("adoraSessionScript",new be),n=o.getSession();if(n){b("session detected; finding if changes should be written");let i=!1;if(r.uid&&n.settings.uid!==r.uid&&(b("detected uid change"),n.settings.uid=r.uid,o.setSession(n),i=!0),r.userCohorts&&Object.keys(r.userCohorts).length>0){b("detected user cohorts");let u=structuredClone(n.settings.userCohorts);(0,yn.strictDeepEqual)(u,r.userCohorts)||(b("detected user cohorts have been changed"),n.settings.userCohorts=r.userCohorts,o.setSession(n),i=!0)}i&&ye?.recorder&&ye?.recorder.isRecording&&(b("writing cohort change to recorder"),ye?.recorder.recordChangeCustomCohort({uid:n.settings.uid,userCohorts:n.settings.userCohorts?{...n.settings.userCohorts}:{}}))}if(xe===!0)return;xe=!0;let s=o.lastRateLimitedTimestamp;if(s!==void 0){if(Date.now()-s<mn){b("exiting as the session has been rate limited recently");return}o.clearLastRateLimitedTimestamp()}if(dt.default.get(pn)){b("exiting as the domain has been rate limited recently");return}if(n){b("start recording for existing session"),gn();return}let a=!1,c=async(i,u)=>{if(b("start status",{started:a}),a)return;a=!0;let d=await Jr("adoraSessionScript",u,r);if(d.type==="error"){d.code==="RateLimitExceeded"&&(b("setting expiration on local storage"),o.setLastRateLimitedTimestamp(Date.now()),i&&(b("setting expiration cookie"),dt.default.set(pn,i,{expires:new Date(Date.now()+mn),domain:i})));return}gn()};b("launching session preload");try{let i=await new ve(r.backendUrl).sessionPreload({orgId:r.orgId});b("session preload resolved");let u=window.location.href;if(i){if(i.error){b("error preloading",i.error);return}if("scheduledDowntime"in i.data){b("scheduled downtime; exiting");return}let{organization:d}=i.data;b("session preload success");let l=dt.default.get(fn),g;b("existing adora user id cookie:",l);for(let f of d.cookieDomains)(window.location.hostname.toLowerCase()===f||window.location.hostname.toLowerCase().endsWith("."+f))&&(g=f,l||(l=(0,Sn.uuidv7)(),dt.default.set(fn,l,{domain:f,expires:new Date(Date.now()+365*24*60*60*1e3)}),b("setting adoraUserId cookie on domain",l)));b("using adora user id:",l),ce({urlStr:u,pathConfig:d.pathConfig})?(b("at an unblocked URL, starting adora"),await c(g,l)):(b("at an blocked URL, waiting for unblocked URL to start adora"),ct&&ct.disconnect(),ct=new MutationObserver(function(f,p){if(u!=window.location.href){let h=window.location.href,C=ce({urlStr:h,pathConfig:d.pathConfig});if(b(`url changed detected during blocked state, status: ${!!C}`),C){b("disconnecting observer"),p.disconnect(),b("scheduling adora to start"),c(g,l);return}u=h}}),ct.observe(document,{subtree:!0,childList:!0}))}}catch(i){b("Error in adoraStart:",i)}},qi=async()=>{Ur="stopped",b("adora stop",{adoraIsRunning:xe}),ye&&(ye.recorder.setRecording(!1),ye.recorder.stopFutureRecordings(),ye.urlChangeObserverDispose(),await ye.eventSync.clearAndSaveEvents()),ct?.disconnect(),xe=!1,ye=void 0};
|
|
54
4
|
//# sourceMappingURL=index.cjs.map
|