@lucida-analytics/browser 0.1.4 → 0.1.6
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 +52 -1
- package/dist/autocapture.d.ts +1 -1
- package/dist/autocapture.js +1 -1
- package/dist/{banner-2TSKJ4WK.js → banner-7LEREYUH.js} +1 -1
- package/dist/{static/v0.1.4/chunk-32K5P5GN.js → chunk-536QABLP.js} +1 -1
- package/dist/{static/v0.1.4/chunk-O4W7SZ2X.js → chunk-EFNCQJI3.js} +1 -1
- package/dist/{static/v0.1.4/chunk-3FSDKRIG.js → chunk-UPPUYIIH.js} +1 -1
- package/dist/{client--prXZN9c.d.ts → client-pxkkaWtR.d.ts} +2 -2
- package/dist/consent.d.ts +9 -3
- package/dist/consent.js +1 -1
- package/dist/core.d.ts +3 -3
- package/dist/core.js +3 -3
- package/dist/correlate.d.ts +8 -2
- package/dist/correlate.js +1 -1
- package/dist/early-access.d.ts +1 -1
- package/dist/experiments.d.ts +1 -1
- package/dist/flags.d.ts +1 -1
- package/dist/forms.d.ts +1 -1
- package/dist/guides.d.ts +1 -1
- package/dist/heatmaps.d.ts +1 -1
- package/dist/host-headers.d.ts +1 -1
- package/dist/index.d.ts +15 -5
- package/dist/index.js +2 -2
- package/dist/inspector.d.ts +1 -1
- package/dist/lucida.js +3 -3
- package/dist/recommendations.d.ts +1 -1
- package/dist/{recorder-IDVKI2RP.js → recorder-4WIMQCLR.js} +1 -1
- package/dist/replay.d.ts +2 -2
- package/dist/replay.js +1 -1
- package/dist/static/v0/autocapture.js +1 -1
- package/dist/static/v0/{banner-2TSKJ4WK.js → banner-7LEREYUH.js} +1 -1
- package/dist/static/v0/{chunk-32K5P5GN.js → chunk-536QABLP.js} +1 -1
- package/dist/{chunk-O4W7SZ2X.js → static/v0/chunk-EFNCQJI3.js} +1 -1
- package/dist/{chunk-3FSDKRIG.js → static/v0/chunk-UPPUYIIH.js} +1 -1
- package/dist/static/v0/consent.js +1 -1
- package/dist/static/v0/core.js +3 -3
- package/dist/static/v0/correlate.js +1 -1
- package/dist/static/v0/index.js +2 -2
- package/dist/static/v0/lucida.js +3 -3
- package/dist/static/v0/manifest.json +28 -0
- package/dist/static/{v0.1.4/recorder-IDVKI2RP.js → v0/recorder-4WIMQCLR.js} +1 -1
- package/dist/static/v0/replay.js +1 -1
- package/dist/static/v0.1.6/autocapture.js +1 -0
- package/dist/static/{v0.1.4/banner-2TSKJ4WK.js → v0.1.6/banner-7LEREYUH.js} +1 -1
- package/dist/{chunk-32K5P5GN.js → static/v0.1.6/chunk-536QABLP.js} +1 -1
- package/dist/static/{v0/chunk-O4W7SZ2X.js → v0.1.6/chunk-EFNCQJI3.js} +1 -1
- package/dist/static/{v0/chunk-3FSDKRIG.js → v0.1.6/chunk-UPPUYIIH.js} +1 -1
- package/dist/static/v0.1.6/consent.js +1 -0
- package/dist/static/v0.1.6/core.js +3 -0
- package/dist/static/v0.1.6/correlate.js +1 -0
- package/dist/static/v0.1.6/index.js +3 -0
- package/dist/static/v0.1.6/lucida.js +3 -0
- package/dist/static/v0.1.6/manifest.json +28 -0
- package/dist/static/{v0/recorder-IDVKI2RP.js → v0.1.6/recorder-4WIMQCLR.js} +1 -1
- package/dist/static/v0.1.6/replay.js +1 -0
- package/dist/toolbar.d.ts +1 -1
- package/dist/{types-DKM0hGl2.d.ts → types-QPJGHOv0.d.ts} +20 -3
- package/dist/webmcp.d.ts +1 -1
- package/lucida-global.d.ts +24 -0
- package/package.json +5 -3
- package/storage.json +75 -0
- package/dist/static/v0.1.4/autocapture.js +0 -1
- package/dist/static/v0.1.4/consent.js +0 -1
- package/dist/static/v0.1.4/core.js +0 -3
- package/dist/static/v0.1.4/correlate.js +0 -1
- package/dist/static/v0.1.4/index.js +0 -3
- package/dist/static/v0.1.4/integrity.json +0 -30
- package/dist/static/v0.1.4/lucida.js +0 -3
- package/dist/static/v0.1.4/replay.js +0 -1
- /package/dist/static/{v0.1.4 → v0.1.6}/chunk-AWIQCFGN.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/chunk-FUE3SDQU.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/early-access.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/experiments.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/flags.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/forms.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/guides.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/heatmaps.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/host-headers.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/inspector.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/modules-FANMZRDJ.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/persistent-SLVINN5A.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/recommendations.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/toolbar.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/validation-HGJXZ553.js +0 -0
- /package/dist/static/{v0.1.4 → v0.1.6}/webmcp.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as rr,d as nr,h as sr,i as ar,j as kt}from"./chunk-3FSDKRIG.js";import{b as or,c as ir}from"./chunk-O4W7SZ2X.js";var Bn=Object.defineProperty,Hn=(e,t,r)=>t in e?Bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t,r)=>Hn(e,typeof t!="symbol"?t+"":t,r),lr,L=(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[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(L||{}),A=(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))(A||{}),ce=(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))(ce||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),Ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ue||{}),Ae=(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))(Ae||{}),ee=(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))(ee||{}),ur={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ge={},Et={},dr=0,Wn=()=>!!globalThis.Zone;function Ht(e){if(Ge[e])return Ge[e];let t=globalThis[e],r=t.prototype,n=e in ur?ur[e]:void 0,o=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in cr?cr[e]:void 0,s=!!(i&&i.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(o&&s&&!Wn())return Ge[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let c=l[e].prototype;if(!c)return a.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Et[e]=()=>a.remove()):a.remove(),Ge[e]=c}catch{return r}}var Mt={};function he(e,t,r){var n,o;let i=(n=Mt[e])==null?void 0:n[r];if(i)return i.call(t);let s=Ht(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?((Mt[e]||(Mt[e]={}))[r]=a,a.call(t)):t[r]}var xt={};function kr(e,t,r){let n=`${e}.${String(r)}`;if(xt[n])return xt[n].bind(t);let i=Ht(e)[r];return typeof i!="function"?t[r]:(xt[n]=i,i.bind(t))}function Gn(e){return he("Node",e,"ownerDocument")}function jn(e){return he("Node",e,"childNodes")}function qn(e){return he("Node",e,"parentNode")}function Vn(e){return he("Node",e,"parentElement")}function Xn(e){return he("Node",e,"textContent")}function Zn(e){return he("Node",e,"firstChild")}function Kn(e){return he("Node",e,"lastChild")}function Yn(e){return he("Node",e,"nextSibling")}function Jn(e){return he("Node",e,"previousSibling")}function Qn(e,t){return kr("Node",e,"contains")(t)}function eo(e){return kr("Node",e,"getRootNode")()}function to(e){return!e||!("host"in e)?null:he("ShadowRoot",e,"host")}function ro(e){return e.styleSheets}function no(e){return!e||!("shadowRoot"in e)?null:he("Element",e,"shadowRoot")}function oo(e,t){return he("Element",e,"querySelector")(t)}function io(e,t){return he("Element",e,"querySelectorAll")(t)}function Mr(){let e=Ht("MutationObserver");dr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--dr!==0))return;let r=Et.MutationObserver;if(r)try{r()}finally{delete Ge.MutationObserver,delete Et.MutationObserver}}]}var Xe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Xe=()=>new Date().getTime());function Te(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}var M={ownerDocument:Gn,childNodes:jn,parentNode:qn,parentElement:Vn,textContent:Xn,firstChild:Zn,lastChild:Kn,nextSibling:Yn,previousSibling:Jn,contains:Qn,getRootNode:eo,host:to,styleSheets:ro,shadowRoot:no,querySelector:oo,querySelectorAll:io,nowTimestamp:Xe,mutationObserverCtor:Mr,patch:Te};function xr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){let t=e&&"host"in e&&"mode"in e&&M.host(e)||null;return!!(t&&"shadowRoot"in t&&M.shadowRoot(t)===e)}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function so(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 ao(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 Tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,o=>Rr(o,r)).join("");return so(n)}catch{return null}}function Rr(e,t){if(uo(e)){let r;try{r=Tt(e.styleSheet)||ao(e)}catch{r=e.cssText}return e.styleSheet.href?pt(r,e.styleSheet.href):r}else{let r=e.cssText;return co(e)&&e.selectorText.includes(":")&&(r=lo(r)),t?pt(r,t):r}}function lo(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function uo(e){return"styleSheet"in e}function co(e){return"selectorText"in e}var dt=class{constructor(){v(this,"idNodeMap",new Map),v(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));let n=M.shadowRoot(t);n&&this.removeNodeFromMap(n)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function fo(){return new dt}function ft({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"",a=n&&Ee(n);return(t[r.toLowerCase()]||a&&t[a])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function Ee(e){return e.toLowerCase()}var fr="__rrweb_original__";function ho(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){let i=t.getImageData,s=fr in i?i[fr]:i;if(new Uint32Array(s.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ht(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ee(t):null}function Ir(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(n);return o?.[1]??null}function po(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,go=/^(?:[a-z+]+:)?\/\//i,yo=/^www\..*/i,vo=/^(data:)([^,]*),(.*)/i;function pt(e,t){return(e||"").replace(mo,(r,n,o,i,s,a)=>{let l=o||s||a,c=n||i||"";if(!l)return r;if(go.test(l)||yo.test(l))return`url(${c}${l}${c})`;if(vo.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${po(t)+l}${c})`;let u=l.split("#")[0],p=l.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${c}${f.join("/")}${p}${c})`})}var Er="(?:/\\*[^*]*\\*/)|[\\s;]",bo=new RegExp(`${Er}|\\b(0)px?`,"g"),wo=new RegExp(Er,"g");function st(e,t=!1){return t?e.replace(wo,""):e.replace(bo,"$1")}function So(e,t,r=!1){let n=Array.from(t.childNodes),o=[],i=0;if(n.length>1&&e&&typeof e=="string"){let s=st(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let c=st(n[l].textContent,r),u=100,p=3;for(;p<c.length&&(c[p].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,p),1)!==-1);p++);for(;p<c.length;p++){let f=c.substring(0,p),h=s.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")m=s.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=s.split(f),h.length<=1)return o.push(e),o;p=u+1}else p===c.length-1&&(m=s.indexOf(f));if(h.length>=2&&p>u){let d=n[l-1].textContent;if(d&&typeof d=="string"){let y=st(d).length;m=s.indexOf(f,y)}m===-1&&(m=h[0].length)}if(m!==-1){let d=Math.floor(m/a);for(;d>0&&d<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;let y=st(e.substring(0,d),r);if(y.length===m){o.push(e.substring(0,d)),e=e.substring(d),s=s.substring(m);break}else y.length<m?d+=Math.max(1,Math.floor((m-y.length)/a)):d-=Math.max(1,Math.floor((y.length-m)*a))}break}}}}return o.push(e),o}function Co(e,t){return So(e,t).join("/* rr_split */")}var ko=1,Mo=new RegExp("[^a-z0-9-_:]"),mt=-2;function Tr(){return ko++}function xo(e){if(e instanceof HTMLFormElement)return"form";let t=Ee(e.tagName);return Mo.test(t)?"div":t}var Le,hr,Ro=/^[^ \t\n\r\u000c]+/,Io=/^[, \t\n\r\u000c]+/;function Eo(e,t){if(t.trim()==="")return t;let r=0;function n(i){let s,a=i.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let o=[];for(;n(Io),!(r>=t.length);){let i=n(Ro);if(i.slice(-1)===",")i=_e(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=_e(e,i);let a=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return o.join(", ")}var pr=new WeakMap;function _e(e,t){return!t||t.trim()===""?t:Wt(e,t)}function To(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Wt(e,t){let r=pr.get(e);if(r||(r=e.createElement("a"),pr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Or(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?_e(e,n):r==="srcset"?Eo(e,n):r==="style"?pt(n,Wt(e)):t==="object"&&r==="data"?_e(e,n):n)}function Nr(e,t,r){return["video","audio"].includes(e)&&Ee(t)==="autoplay"}function Oo(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function gt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?gt(M.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}return r?gt(M.parentNode(e),t,r):!1}function Lr(e,t,r,n){let o;if(xr(e)){if(o=e,!M.childNodes(o).length)return!1}else{if(M.parentElement(e)===null)return!1;o=M.parentElement(e)}try{if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(gt(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function No(e,t,r){let n=e.contentWindow;if(!n)return;let o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Lo(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;let i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function Ao(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d=!1,cssCaptured:y=!1}=t,S=Do(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ee.Document,childNodes:[],compatMode:e.compatMode}:{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d,rootId:S});case e.TEXT_NODE:return _o(e,{doc:r,needsMask:s,maskTextFn:c,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ee.Comment,textContent:M.textContent(e)||"",rootId:S};default:return!1}}function Do(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function _o(e,t){let{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,s=M.parentNode(e),a=s&&s.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":i||(l=M.textContent(e),c&&l&&(l=pt(l,Wt(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,M.parentElement(e)):l.replace(/[\S]/g,"*")),{type:ee.Text,textContent:l||"",rootId:o}}function Fo(e,t){let{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:h}=t,m=Oo(e,n,o),d=xo(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let w=e.attributes[g];Nr(d,w.name,w.value)||(y[w.name]=Or(r,d,Ee(w.name),w.value))}if(d==="link"&&i){let g=Array.from(r.styleSheets).find(k=>k.href===e.href),w=null;g&&(w=Tt(g)),w&&(delete y.rel,delete y.href,y._cssText=w)}if(d==="style"&&e.sheet){let g=Tt(e.sheet);g&&(e.childNodes.length>1&&(g=Co(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(d)){let g=e.value,w=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=ft({element:e,type:ht(e),tagName:d,value:g,maskInputOptions:s,maskInputFn:a}):w&&(y.checked=w)}if(d==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),d==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&u){if(e.__context==="2d")ho(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),w=r.createElement("canvas");w.width=e.width,w.height=e.height;let k=w.toDataURL(l.type,l.quality);g!==k&&(y.rr_dataURL=g)}}if(d==="img"&&c){Le||(Le=r.createElement("canvas"),hr=Le.getContext("2d"));let g=e,w=g.currentSrc||g.getAttribute("src")||"<unknown-src>",k=g.crossOrigin,x=()=>{g.removeEventListener("load",x);try{Le.width=g.naturalWidth,Le.height=g.naturalHeight,hr.drawImage(g,0,0),y.rr_dataURL=Le.toDataURL(l.type,l.quality)}catch(E){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${w}! Error: ${E}`)}g.crossOrigin==="anonymous"&&(k?y.crossOrigin=k:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x)}if(["audio","video"].includes(d)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:g,height:w}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${w}px`}}d==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(d)&&(b=!0)}catch{}return{type:ee.Element,tagName:d,attributes:y,childNodes:[],isSVG:To(e)||void 0,needBlock:m,rootId:h,isCustom:b}}function B(e){return e==null?"":e.toLowerCase()}function Ar(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function zo(e,t){if(t.comment&&e.type===ee.Comment)return!0;if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ir(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||B(e.attributes.name)==="application-name"||B(e.attributes.rel)==="icon"||B(e.attributes.rel)==="apple-touch-icon"||B(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||B(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(B(e.attributes.name)==="robots"||B(e.attributes.name)==="googlebot"||B(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(B(e.attributes.name)==="author"||B(e.attributes.name)==="generator"||B(e.attributes.name)==="framework"||B(e.attributes.name)==="publisher"||B(e.attributes.name)==="progid"||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(B(e.attributes.name)==="google-site-verification"||B(e.attributes.name)==="yandex-verification"||B(e.attributes.name)==="csrf-token"||B(e.attributes.name)==="p:domain_verify"||B(e.attributes.name)==="verify-v1"||B(e.attributes.name)==="verification"||B(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Fe(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:d=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:E=!1,cssCaptured:I=!1}=t,{needsMask:R}=t,{preserveWhiteSpace:P=!0}=t;R||(R=Lr(e,s,a,R===void 0));let H=Ao(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,dataURLOptions:m,inlineImages:d,recordCanvas:y,keepIframeSrcFn:x,newlyAddedElement:E,cssCaptured:I});if(!H)return console.warn(e,"not serialized"),null;let U;n.hasNode(e)?U=n.getId(e):zo(H,h)||!P&&H.type===ee.Text&&!H.textContent.replace(/^\s+|\s+$/gm,"").length?U=mt:U=Tr();let T=Object.assign(H,{id:U});if(n.add(e,T),U===mt)return null;S&&S(e);let X=!l;if(T.type===ee.Element){X=X&&!T.needBlock,delete T.needBlock;let N=M.shadowRoot(e);N&&qe(N)&&(T.isShadowHost=!0)}if((T.type===ee.Document||T.type===ee.Element)&&X){h.headWhitespace&&T.type===ee.Element&&T.tagName==="head"&&(P=!1);let N={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(!(T.type===ee.Element&&T.tagName==="textarea"&&T.attributes.value!==void 0)){T.type===ee.Element&&T.attributes._cssText!==void 0&&typeof T.attributes._cssText=="string"&&(N.cssCaptured=!0);for(let W of Array.from(M.childNodes(e))){let G=Fe(W,N);G&&T.childNodes.push(G)}}let F=null;if(xr(e)&&(F=M.shadowRoot(e)))for(let W of Array.from(M.childNodes(F))){let G=Fe(W,N);G&&(qe(F)&&(G.isShadow=!0),T.childNodes.push(G))}}let K=M.parentNode(e);return K&&je(K)&&qe(K)&&(T.isShadow=!0),T.type===ee.Element&&T.tagName==="iframe"&&No(e,()=>{let N=e.contentDocument;if(N&&b){let F=Fe(N,{doc:N,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});F&&b(e,F)}},g),T.type===ee.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&Ir(T.attributes.href)==="css")&&Lo(e,()=>{if(w){let N=Fe(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});N&&w(e,N)}},k),T}function Po(e,t){let{mirror:r=new dt,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:f,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k=()=>!1}=t,x=u===!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}:u===!1?{password:!0}:u,E=Ar(h);return Fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:x,maskTextFn:p,maskInputFn:f,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}var Ot=class e{constructor(...t){v(this,"parentElement",null),v(this,"parentNode",null),v(this,"ownerDocument"),v(this,"firstChild",null),v(this,"lastChild",null),v(this,"previousSibling",null),v(this,"nextSibling",null),v(this,"ELEMENT_NODE",1),v(this,"TEXT_NODE",3),v(this,"nodeType"),v(this,"nodeName"),v(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"}};function re(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var De=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
import{b as rr,d as nr,h as sr,i as ar,j as kt}from"./chunk-UPPUYIIH.js";import{b as or,c as ir}from"./chunk-EFNCQJI3.js";var Bn=Object.defineProperty,Hn=(e,t,r)=>t in e?Bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t,r)=>Hn(e,typeof t!="symbol"?t+"":t,r),lr,L=(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[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(L||{}),A=(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))(A||{}),ce=(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))(ce||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),Ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ue||{}),Ae=(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))(Ae||{}),ee=(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))(ee||{}),ur={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},cr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ge={},Et={},dr=0,Wn=()=>!!globalThis.Zone;function Ht(e){if(Ge[e])return Ge[e];let t=globalThis[e],r=t.prototype,n=e in ur?ur[e]:void 0,o=!!(n&&n.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),i=e in cr?cr[e]:void 0,s=!!(i&&i.every(a=>{var l;return typeof r[a]=="function"&&((l=r[a])==null?void 0:l.toString().includes("[native code]"))}));if(o&&s&&!Wn())return Ge[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let l=a.contentWindow;if(!l)return t.prototype;let c=l[e].prototype;if(!c)return a.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Et[e]=()=>a.remove()):a.remove(),Ge[e]=c}catch{return r}}var Mt={};function he(e,t,r){var n,o;let i=(n=Mt[e])==null?void 0:n[r];if(i)return i.call(t);let s=Ht(e),a=(o=Object.getOwnPropertyDescriptor(s,r))==null?void 0:o.get;return a?((Mt[e]||(Mt[e]={}))[r]=a,a.call(t)):t[r]}var xt={};function kr(e,t,r){let n=`${e}.${String(r)}`;if(xt[n])return xt[n].bind(t);let i=Ht(e)[r];return typeof i!="function"?t[r]:(xt[n]=i,i.bind(t))}function Gn(e){return he("Node",e,"ownerDocument")}function jn(e){return he("Node",e,"childNodes")}function qn(e){return he("Node",e,"parentNode")}function Vn(e){return he("Node",e,"parentElement")}function Xn(e){return he("Node",e,"textContent")}function Zn(e){return he("Node",e,"firstChild")}function Kn(e){return he("Node",e,"lastChild")}function Yn(e){return he("Node",e,"nextSibling")}function Jn(e){return he("Node",e,"previousSibling")}function Qn(e,t){return kr("Node",e,"contains")(t)}function eo(e){return kr("Node",e,"getRootNode")()}function to(e){return!e||!("host"in e)?null:he("ShadowRoot",e,"host")}function ro(e){return e.styleSheets}function no(e){return!e||!("shadowRoot"in e)?null:he("Element",e,"shadowRoot")}function oo(e,t){return he("Element",e,"querySelector")(t)}function io(e,t){return he("Element",e,"querySelectorAll")(t)}function Mr(){let e=Ht("MutationObserver");dr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--dr!==0))return;let r=Et.MutationObserver;if(r)try{r()}finally{delete Ge.MutationObserver,delete Et.MutationObserver}}]}var Xe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Xe=()=>new Date().getTime());function Te(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}var M={ownerDocument:Gn,childNodes:jn,parentNode:qn,parentElement:Vn,textContent:Xn,firstChild:Zn,lastChild:Kn,nextSibling:Yn,previousSibling:Jn,contains:Qn,getRootNode:eo,host:to,styleSheets:ro,shadowRoot:no,querySelector:oo,querySelectorAll:io,nowTimestamp:Xe,mutationObserverCtor:Mr,patch:Te};function xr(e){return e.nodeType===e.ELEMENT_NODE}function je(e){let t=e&&"host"in e&&"mode"in e&&M.host(e)||null;return!!(t&&"shadowRoot"in t&&M.shadowRoot(t)===e)}function qe(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function so(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 ao(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 Tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,o=>Rr(o,r)).join("");return so(n)}catch{return null}}function Rr(e,t){if(uo(e)){let r;try{r=Tt(e.styleSheet)||ao(e)}catch{r=e.cssText}return e.styleSheet.href?pt(r,e.styleSheet.href):r}else{let r=e.cssText;return co(e)&&e.selectorText.includes(":")&&(r=lo(r)),t?pt(r,t):r}}function lo(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function uo(e){return"styleSheet"in e}function co(e){return"selectorText"in e}var dt=class{constructor(){v(this,"idNodeMap",new Map),v(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));let n=M.shadowRoot(t);n&&this.removeNodeFromMap(n)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function fo(){return new dt}function ft({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:i}){let s=o||"",a=n&&Ee(n);return(t[r.toLowerCase()]||a&&t[a])&&(i?s=i(s,e):s="*".repeat(s.length)),s}function Ee(e){return e.toLowerCase()}var fr="__rrweb_original__";function ho(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){let i=t.getImageData,s=fr in i?i[fr]:i;if(new Uint32Array(s.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(l=>l!==0))return!1}return!0}function ht(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ee(t):null}function Ir(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\.([0-9a-z]+)(?:$)/i,o=r.pathname.match(n);return o?.[1]??null}function po(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var mo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,go=/^(?:[a-z+]+:)?\/\//i,yo=/^www\..*/i,vo=/^(data:)([^,]*),(.*)/i;function pt(e,t){return(e||"").replace(mo,(r,n,o,i,s,a)=>{let l=o||s||a,c=n||i||"";if(!l)return r;if(go.test(l)||yo.test(l))return`url(${c}${l}${c})`;if(vo.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${po(t)+l}${c})`;let u=l.split("#")[0],p=l.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return`url(${c}${f.join("/")}${p}${c})`})}var Er="(?:/\\*[^*]*\\*/)|[\\s;]",bo=new RegExp(`${Er}|\\b(0)px?`,"g"),wo=new RegExp(Er,"g");function st(e,t=!1){return t?e.replace(wo,""):e.replace(bo,"$1")}function So(e,t,r=!1){let n=Array.from(t.childNodes),o=[],i=0;if(n.length>1&&e&&typeof e=="string"){let s=st(e,r),a=s.length/e.length;for(let l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){let c=st(n[l].textContent,r),u=100,p=3;for(;p<c.length&&(c[p].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,p),1)!==-1);p++);for(;p<c.length;p++){let f=c.substring(0,p),h=s.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[l-1].textContent!=="")m=s.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=s.split(f),h.length<=1)return o.push(e),o;p=u+1}else p===c.length-1&&(m=s.indexOf(f));if(h.length>=2&&p>u){let d=n[l-1].textContent;if(d&&typeof d=="string"){let y=st(d).length;m=s.indexOf(f,y)}m===-1&&(m=h[0].length)}if(m!==-1){let d=Math.floor(m/a);for(;d>0&&d<e.length;){if(i+=1,i>50*n.length)return o.push(e),o;let y=st(e.substring(0,d),r);if(y.length===m){o.push(e.substring(0,d)),e=e.substring(d),s=s.substring(m);break}else y.length<m?d+=Math.max(1,Math.floor((m-y.length)/a)):d-=Math.max(1,Math.floor((y.length-m)*a))}break}}}}return o.push(e),o}function Co(e,t){return So(e,t).join("/* rr_split */")}var ko=1,Mo=new RegExp("[^a-z0-9-_:]"),mt=-2;function Tr(){return ko++}function xo(e){if(e instanceof HTMLFormElement)return"form";let t=Ee(e.tagName);return Mo.test(t)?"div":t}var Le,hr,Ro=/^[^ \t\n\r\u000c]+/,Io=/^[, \t\n\r\u000c]+/;function Eo(e,t){if(t.trim()==="")return t;let r=0;function n(i){let s,a=i.exec(t.substring(r));return a?(s=a[0],r+=s.length,s):""}let o=[];for(;n(Io),!(r>=t.length);){let i=n(Ro);if(i.slice(-1)===",")i=_e(e,i.substring(0,i.length-1)),o.push(i);else{let s="";i=_e(e,i);let a=!1;for(;;){let l=t.charAt(r);if(l===""){o.push((i+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,o.push((i+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return o.join(", ")}var pr=new WeakMap;function _e(e,t){return!t||t.trim()===""?t:Wt(e,t)}function To(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Wt(e,t){let r=pr.get(e);if(r||(r=e.createElement("a"),pr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Or(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?_e(e,n):r==="srcset"?Eo(e,n):r==="style"?pt(n,Wt(e)):t==="object"&&r==="data"?_e(e,n):n)}function Nr(e,t,r){return["video","audio"].includes(e)&&Ee(t)==="autoplay"}function Oo(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function gt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?gt(M.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let o=e.classList[n];if(t.test(o))return!0}return r?gt(M.parentNode(e),t,r):!1}function Lr(e,t,r,n){let o;if(xr(e)){if(o=e,!M.childNodes(o).length)return!1}else{if(M.parentElement(e)===null)return!1;o=M.parentElement(e)}try{if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(gt(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function No(e,t,r){let n=e.contentWindow;if(!n)return;let o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){let a=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),o=!0,t()});return}let s="about:blank";if(n.location.href!==s||e.src===s||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Lo(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;let i=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),n=!0,t()})}function Ao(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:p={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d=!1,cssCaptured:y=!1}=t,S=Do(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ee.Document,childNodes:[],compatMode:e.compatMode}:{type:ee.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ee.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Fo(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:p,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:d,rootId:S});case e.TEXT_NODE:return _o(e,{doc:r,needsMask:s,maskTextFn:c,rootId:S,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:ee.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:ee.Comment,textContent:M.textContent(e)||"",rootId:S};default:return!1}}function Do(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function _o(e,t){let{needsMask:r,maskTextFn:n,rootId:o,cssCaptured:i}=t,s=M.parentNode(e),a=s&&s.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":i||(l=M.textContent(e),c&&l&&(l=pt(l,Wt(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,M.parentElement(e)):l.replace(/[\S]/g,"*")),{type:ee.Text,textContent:l||"",rootId:o}}function Fo(e,t){let{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:h}=t,m=Oo(e,n,o),d=xo(e),y={},S=e.attributes.length;for(let g=0;g<S;g++){let w=e.attributes[g];Nr(d,w.name,w.value)||(y[w.name]=Or(r,d,Ee(w.name),w.value))}if(d==="link"&&i){let g=Array.from(r.styleSheets).find(k=>k.href===e.href),w=null;g&&(w=Tt(g)),w&&(delete y.rel,delete y.href,y._cssText=w)}if(d==="style"&&e.sheet){let g=Tt(e.sheet);g&&(e.childNodes.length>1&&(g=Co(g,e)),y._cssText=g)}if(["input","textarea","select"].includes(d)){let g=e.value,w=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=ft({element:e,type:ht(e),tagName:d,value:g,maskInputOptions:s,maskInputFn:a}):w&&(y.checked=w)}if(d==="option"&&(e.selected&&!s.select?y.selected=!0:delete y.selected),d==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&u){if(e.__context==="2d")ho(e)||(y.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let g=e.toDataURL(l.type,l.quality),w=r.createElement("canvas");w.width=e.width,w.height=e.height;let k=w.toDataURL(l.type,l.quality);g!==k&&(y.rr_dataURL=g)}}if(d==="img"&&c){Le||(Le=r.createElement("canvas"),hr=Le.getContext("2d"));let g=e,w=g.currentSrc||g.getAttribute("src")||"<unknown-src>",k=g.crossOrigin,x=()=>{g.removeEventListener("load",x);try{Le.width=g.naturalWidth,Le.height=g.naturalHeight,hr.drawImage(g,0,0),y.rr_dataURL=Le.toDataURL(l.type,l.quality)}catch(E){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${w}! Error: ${E}`)}g.crossOrigin==="anonymous"&&(k?y.crossOrigin=k:g.removeAttribute("crossorigin"))};g.complete&&g.naturalWidth!==0?x():g.addEventListener("load",x)}if(["audio","video"].includes(d)){let g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:g,height:w}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${w}px`}}d==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(d)&&(b=!0)}catch{}return{type:ee.Element,tagName:d,attributes:y,childNodes:[],isSVG:To(e)||void 0,needBlock:m,rootId:h,isCustom:b}}function B(e){return e==null?"":e.toLowerCase()}function Ar(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function zo(e,t){if(t.comment&&e.type===ee.Comment)return!0;if(e.type===ee.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Ir(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(B(e.attributes.name).match(/^msapplication-tile(image|color)$/)||B(e.attributes.name)==="application-name"||B(e.attributes.rel)==="icon"||B(e.attributes.rel)==="apple-touch-icon"||B(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&B(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(B(e.attributes.property).match(/^(og|twitter|fb):/)||B(e.attributes.name).match(/^(og|twitter):/)||B(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(B(e.attributes.name)==="robots"||B(e.attributes.name)==="googlebot"||B(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(B(e.attributes.name)==="author"||B(e.attributes.name)==="generator"||B(e.attributes.name)==="framework"||B(e.attributes.name)==="publisher"||B(e.attributes.name)==="progid"||B(e.attributes.property).match(/^article:/)||B(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(B(e.attributes.name)==="google-site-verification"||B(e.attributes.name)==="yandex-verification"||B(e.attributes.name)==="csrf-token"||B(e.attributes.name)==="p:domain_verify"||B(e.attributes.name)==="verify-v1"||B(e.attributes.name)==="verification"||B(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Fe(e,t){let{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:d=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:E=!1,cssCaptured:I=!1}=t,{needsMask:R}=t,{preserveWhiteSpace:P=!0}=t;R||(R=Lr(e,s,a,R===void 0));let H=Ao(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,dataURLOptions:m,inlineImages:d,recordCanvas:y,keepIframeSrcFn:x,newlyAddedElement:E,cssCaptured:I});if(!H)return console.warn(e,"not serialized"),null;let U;n.hasNode(e)?U=n.getId(e):zo(H,h)||!P&&H.type===ee.Text&&!H.textContent.replace(/^\s+|\s+$/gm,"").length?U=mt:U=Tr();let T=Object.assign(H,{id:U});if(n.add(e,T),U===mt)return null;S&&S(e);let X=!l;if(T.type===ee.Element){X=X&&!T.needBlock,delete T.needBlock;let N=M.shadowRoot(e);N&&qe(N)&&(T.isShadowHost=!0)}if((T.type===ee.Document||T.type===ee.Element)&&X){h.headWhitespace&&T.type===ee.Element&&T.tagName==="head"&&(P=!1);let N={doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x,cssCaptured:!1};if(!(T.type===ee.Element&&T.tagName==="textarea"&&T.attributes.value!==void 0)){T.type===ee.Element&&T.attributes._cssText!==void 0&&typeof T.attributes._cssText=="string"&&(N.cssCaptured=!0);for(let W of Array.from(M.childNodes(e))){let G=Fe(W,N);G&&T.childNodes.push(G)}}let F=null;if(xr(e)&&(F=M.shadowRoot(e)))for(let W of Array.from(M.childNodes(F))){let G=Fe(W,N);G&&(qe(F)&&(G.isShadow=!0),T.childNodes.push(G))}}let K=M.parentNode(e);return K&&je(K)&&qe(K)&&(T.isShadow=!0),T.type===ee.Element&&T.tagName==="iframe"&&No(e,()=>{let N=e.contentDocument;if(N&&b){let F=Fe(N,{doc:N,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});F&&b(e,F)}},g),T.type===ee.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&Ir(T.attributes.href)==="css")&&Lo(e,()=>{if(w){let N=Fe(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,needsMask:R,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:p,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:d,recordCanvas:y,preserveWhiteSpace:P,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:w,stylesheetLoadTimeout:k,keepIframeSrcFn:x});N&&w(e,N)}},k),T}function Po(e,t){let{mirror:r=new dt,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:p,maskInputFn:f,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k=()=>!1}=t,x=u===!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}:u===!1?{password:!0}:u,E=Ar(h);return Fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:x,maskTextFn:p,maskInputFn:f,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:d,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1})}var Ot=class e{constructor(...t){v(this,"parentElement",null),v(this,"parentNode",null),v(this,"ownerDocument"),v(this,"firstChild",null),v(this,"lastChild",null),v(this,"previousSibling",null),v(this,"nextSibling",null),v(this,"ELEMENT_NODE",1),v(this,"TEXT_NODE",3),v(this,"nodeType"),v(this,"nodeName"),v(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"}};function re(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var De=`Please stop import mirror directly. Instead of that,\r
|
|
2
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
3
|
or you can use record.mirror to access the mirror instance during recording.`,mr={map:{},getId(){return console.error(De),-1},getNode(){return console.error(De),null},removeNodeFromMap(){console.error(De)},has(){return console.error(De),!1},reset(){console.error(De)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mr=new Proxy(mr,{get(e,t,r){return t==="map"&&console.error(De),Reflect.get(e,t,r)}}));function Ze(e,t,r={}){let n=null,o=0;return function(...i){let s=Date.now();!o&&r.leading===!1&&(o=s);let a=t-(s-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=s,e.apply(l,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(l,i)},a))}}function bt(e,t,r,n,o=window){let i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),i&&i.set&&i.set.call(this,s)}}),()=>bt(e,t,i||{},!0)}function Dr(e){var t,r,n,o;let i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||i?.body&&((t=M.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i?.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||i?.body&&((n=M.parentElement(i.body))==null?void 0:n.scrollTop)||((o=i?.body)==null?void 0:o.scrollTop)||0}}function _r(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function zr(e){return e?e.nodeType===e.ELEMENT_NODE?e:M.parentElement(e):null}function le(e,t,r,n){if(!e)return!1;let o=zr(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(gt(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function Uo(e,t){return t.getId(e)!==-1}function Rt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===mt}function Pr(e,t){if(je(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=M.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?Pr(n,t):!0}function Nt(e){return!!e.changedTouches}function $o(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 Ur(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function $r(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Lt(e){return e?e instanceof Ot&&"shadowRoot"in e?!!e.shadowRoot:!!M.shadowRoot(e):!1}var At=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(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 n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Br(e){var t;let r=null;return"getRootNode"in e&&((t=M.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(e))&&(r=M.host(M.getRootNode(e))),r}function Bo(e){let t=e,r;for(;r=Br(t);)t=r;return t}function Ho(e){let t=M.ownerDocument(e);if(!t)return!1;let r=Bo(e);return M.contains(t,r)}function Dt(e){let t=M.ownerDocument(e);return t?M.contains(t,e)||Ho(e):!1}var gr=(e,t)=>`${e}@${t}`,_t=class{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet){let h=M.parentNode(f);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(f)}let n=null,o=null,i=-1,s=null,a=!1,l=new Set,c=this.addedSet.values(),u=c.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(M.previousSibling(n)))s=n,n=M.previousSibling(n);else{for(this.addedSet.has(u.value)||(u=c.next()),n=u.value;;){if(o=M.parentNode(n),this.addedSet.has(o)){n=o;continue}break}if(l.has(o))o=null;else if(o){if(Dt(o)?(a=yr(this.droppedSet,o)||this.removesSubTreeCache.has(o),a&&yr(this.movedSet,n)&&(a=!1)):a=!0,this.addedSet.has(M.lastChild(o)))n=M.lastChild(o),s=null;else for(;;){if(s=M.nextSibling(n),this.addedSet.has(s)){n=s;continue}break}if(i=je(o)?this.mirror.getId(Br(n)):this.mirror.getId(o),i===-1&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=M.host(o);i=this.mirror.getId(d)}}}if(this.addedSet.delete(n),!o||i===-1){l.add(n);continue}else if(a){this.droppedSet.add(n);continue}let f=!1;if(n.nodeType===Node.TEXT_NODE){let d=o.tagName;if(d==="TEXTAREA")continue;d==="STYLE"&&r.has(i)&&(f=!0)}let h=s?this.mirror.getId(s):null;for(;h===mt;)s=s&&M.nextSibling(s),h=s&&this.mirror.getId(s);if(h===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",s),n=null;continue}let m=Fe(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:d=>{Ur(d,this.mirror)&&this.iframeManager.addIframe(d),$r(d,this.mirror)&&this.stylesheetManager.trackLinkElement(d),Lt(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(d,y)=>{this.iframeManager.attachIframe(d,y),this.shadowDomManager.observeAttachShadow(d)},onStylesheetLoad:(d,y)=>{this.stylesheetManager.attachLinkElement(d,y)},cssCaptured:f});m&&(t.push({parentId:i,nextId:h,node:m}),r.add(m.id))}let p={texts:this.texts.map(f=>{let h=f.node,m=M.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:f.value}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:h}=f;if(typeof h.style=="string"){let m=JSON.stringify(f.styleDiff),d=JSON.stringify(f._unchangedStyles);m.length<h.style.length&&(m+d).split("var(").length===h.style.split("var(").length&&(h.style=f.styleDiff)}return{id:this.mirror.getId(f.node),attributes:h}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:t};!p.texts.length&&!p.attributes.length&&!p.removes.length&&!p.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.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(p))}),v(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 n=Array.from(M.childNodes(t),o=>M.textContent(o)||"").join("");r.attributes.value=ft({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:ht(t),value:n,maskInputFn:this.maskInputFn})}),v(this,"processMutation",t=>{if(!Rt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=M.textContent(t.target);!le(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Lr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,zr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=Ee(r.tagName),o=t.attributeName,i=t.target.getAttribute(o);if(o==="value"){let a=ht(r);i=ft({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(le(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n==="iframe"&&o==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)o="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),o==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Nr(n,o))if(s.attributes[o]=Or(this.doc,n,Ee(o),i),o==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(let l of Array.from(r.style)){let c=r.style.getPropertyValue(l),u=r.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?u===""?s.styleDiff[l]=c:s.styleDiff[l]=[c,u]:s._unchangedStyles[l]=[c,u]}for(let l of Array.from(a.style))r.style.getPropertyValue(l)===""&&(s.styleDiff[l]=!1)}else o==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break}case"childList":{if(le(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=>{Dt(r)||this.shadowDomManager.removeShadowRootsIn(r);let n=this.mirror.getId(r),o=je(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);le(t.target,this.blockClass,this.blockSelector,!1)||Rt(r,this.mirror,this.slimDOMOptions)||!Uo(r,this.mirror)||(this.addedSet.has(r)?(Ft(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Pr(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[gr(n,o)]?Ft(this.movedSet,r):(this.removes.push({parentId:o,id:n,isShadow:je(t.target)&&qe(t.target)?!0:void 0}),Wo(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),v(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Rt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[gr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);le(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach(n=>this.genAdds(n)),Lt(t)&&M.childNodes(M.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function Ft(e,t){e.delete(t),M.childNodes(t).forEach(r=>Ft(e,r))}function Wo(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),M.childNodes(n).forEach(o=>r.push(o)))}}function yr(e,t){return e.size===0?!1:Hr(e,t)}function Hr(e,t){if(e.has(t))return!0;let r=M.parentNode(t);return r?Hr(e,r):!1}var Ve;function Go(e){Ve=e}function jo(){Ve=void 0}var _=e=>Ve?(...r)=>{try{return e(...r)}catch(n){if(Ve&&Ve(n)===!0)return;throw n}}:e,Pe=new Set;function Ye(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 Wr(e,t){let r=new _t;Pe.add(r),r.init(e);let[n,o]=Mr(),i=new n(_(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{i.disconnect(),Pe.delete(r),o()}}function qo({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=Ze(_(p=>{let f=Date.now()-a;e(s.map(h=>(h.timeOffset-=f,h)),p),s=[],a=null}),i),c=_(Ze(_(p=>{let f=Ye(p),{clientX:h,clientY:m}=Nt(p)?p.changedTouches[0]:p;a||(a=Xe()),s.push({x:h,y:m,id:n.getId(f),timeOffset:Xe()-a}),l(typeof DragEvent<"u"&&p instanceof DragEvent?A.Drag:p instanceof MouseEvent?A.MouseMove:A.TouchMove)}),o,{trailing:!1})),u=[re("mousemove",c,r),re("touchmove",c,r),re("drag",c,r)];return _(()=>{u.forEach(p=>p())})}function Vo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let s=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,a=[],l=null,c=u=>p=>{let f=Ye(p);if(le(f,n,o,!0))return;let h=null,m=u;if("pointerType"in p){switch(p.pointerType){case"mouse":h=Ce.Mouse;break;case"touch":h=Ce.Touch;break;case"pen":h=Ce.Pen;break}h===Ce.Touch?ce[u]===ce.MouseDown?m="TouchStart":ce[u]===ce.MouseUp&&(m="TouchEnd"):Ce.Pen}else Nt(p)&&(h=Ce.Touch);h!==null?(l=h,(m.startsWith("Touch")&&h===Ce.Touch||m.startsWith("Mouse")&&h===Ce.Mouse)&&(h=null)):ce[u]===ce.Click&&(h=l,l=null);let d=Nt(p)?p.changedTouches[0]:p;if(!d)return;let y=r.getId(f),{clientX:S,clientY:b}=d;_(e)({type:ce[m],id:y,x:S,y:b,...h!==null&&{pointerType:h}})};return Object.keys(ce).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&s[u]!==!1).forEach(u=>{let p=Ee(u),f=c(u);if(window.PointerEvent)switch(ce[u]){case ce.MouseDown:case ce.MouseUp:p=p.replace("mouse","pointer");break;case ce.TouchStart:case ce.TouchEnd:return}a.push(re(p,f,t))}),_(()=>{a.forEach(u=>u())})}function Gr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:i}){let s=_(Ze(_(a=>{let l=Ye(a);if(!l||le(l,n,o,!0))return;let c=r.getId(l);if(l===t&&t.defaultView){let u=Dr(t.defaultView);e({id:c,x:u.left,y:u.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),i.scroll||100));return re("scroll",s,t)}function Xo({viewportResizeCb:e},{win:t}){let r=-1,n=-1,o=_(Ze(_(()=>{let i=_r(),s=Fr();(r!==i||n!==s)&&(e({width:Number(s),height:Number(i)}),r=i,n=s)}),200));return re("resize",o,t)}var Zo=["INPUT","TEXTAREA","SELECT"],vr=new WeakMap;function Ko({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function p(b){let g=Ye(b),w=b.isTrusted,k=g&&g.tagName;if(g&&k==="OPTION"&&(g=M.parentElement(g)),!g||!k||Zo.indexOf(k)<0||le(g,n,o,!0)||g.classList.contains(i)||s&&g.matches(s))return;let x=g.value,E=!1,I=ht(g)||"";I==="radio"||I==="checkbox"?E=g.checked:(a[k.toLowerCase()]||a[I])&&(x=ft({element:g,maskInputOptions:a,tagName:k,type:I,value:x,maskInputFn:l})),f(g,u?{text:x,isChecked:E,userTriggered:w}:{text:x,isChecked:E});let R=g.name;I==="radio"&&R&&E&&t.querySelectorAll(`input[type="radio"][name="${R}"]`).forEach(P=>{if(P!==g){let H=P.value;f(P,u?{text:H,isChecked:!E,userTriggered:!1}:{text:H,isChecked:!E})}})}function f(b,g){let w=vr.get(b);if(!w||w.text!==g.text||w.isChecked!==g.isChecked){vr.set(b,g);let k=r.getId(b);_(e)({...g,id:k})}}let m=(c.input==="last"?["change"]:["input","change"]).map(b=>re(b,_(p),t)),d=t.defaultView;if(!d)return()=>{m.forEach(b=>b())};let y=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),S=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&m.push(...S.map(b=>bt(b[0],b[1],{set(){_(p)({target:this,isTrusted:!1})}},!1,d))),_(()=>{m.forEach(b=>b())})}function yt(e){let t=[];function r(n,o){if(at("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||at("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||at("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||at("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);return o.unshift(s),r(n.parentRule,o)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function Ie(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Yo({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:_((u,p,f)=>{let[h,m]=f,{id:d,styleId:y}=Ie(p,t,r.styleMirror);return(d&&d!==-1||y&&y!==-1)&&e({id:d,styleId:y,adds:[{rule:h,index:m}]}),u.apply(p,f)})}),n.CSSStyleSheet.prototype.addRule=function(u,p,f=this.cssRules.length){let h=`${u} { ${p} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,f])};let i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,removes:[{index:h}]}),u.apply(p,f)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,replace:h}),u.apply(p,f)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:_((u,p,f)=>{let[h]=f,{id:m,styleId:d}=Ie(p,t,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,replaceSync:h}),u.apply(p,f)})}));let l={};lt("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(lt("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),lt("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),lt("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,p])=>{c[u]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[u].insertRule,{apply:_((f,h,m)=>{let[d,y]=m,{id:S,styleId:b}=Ie(h.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||b&&b!==-1)&&e({id:S,styleId:b,adds:[{rule:d,index:[...yt(h),y||0]}]}),f.apply(h,m)})}),p.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:_((f,h,m)=>{let[d]=m,{id:y,styleId:S}=Ie(h.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...yt(h),d]}]}),f.apply(h,m)})})}),_(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=i,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,p])=>{p.prototype.insertRule=c[u].insertRule,p.prototype.deleteRule=c[u].deleteRule})})}function jr({mirror:e,stylesheetManager:t},r){var n,o,i;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(M.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(i=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:i.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;let p=(u=l.set)==null?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return p}}),_(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Jo({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){let i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:_((a,l,c)=>{var u;let[p,f,h]=c;if(r.has(p))return i.apply(l,[p,f,h]);let{id:m,styleId:d}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||d&&d!==-1)&&e({id:m,styleId:d,set:{property:p,value:f,priority:h},index:yt(l.parentRule)}),a.apply(l,c)})});let s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:_((a,l,c)=>{var u;let[p]=c;if(r.has(p))return s.apply(l,[p]);let{id:f,styleId:h}=Ie((u=l.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,remove:{property:p},index:yt(l.parentRule)}),a.apply(l,c)})}),_(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}function Qo({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:i}){let s=_(l=>Ze(_(c=>{let u=Ye(c);if(!u||le(u,t,r,!0))return;let{currentTime:p,volume:f,muted:h,playbackRate:m,loop:d}=u;e({type:l,id:n.getId(u),currentTime:p,volume:f,muted:h,playbackRate:m,loop:d})}),o.media||500)),a=[re("play",s(Ae.Play),i),re("pause",s(Ae.Pause),i),re("seeked",s(Ae.Seeked),i),re("volumechange",s(Ae.VolumeChange),i),re("ratechange",s(Ae.RateChange),i)];return _(()=>{a.forEach(l=>l())})}function ei({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(l,c,u){let p=new i(l,c,u);return o.set(p,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),p};let s=Te(t.fonts,"add",function(a){return function(l){return setTimeout(_(()=>{let c=o.get(l);c&&(e(c),o.delete(l))}),0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=i}),n.push(s),_(()=>{n.forEach(a=>a())})}function ti(e){let{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:i}=e,s=!0,a=_(()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let p=0;p<u;p++){let f=l.getRangeAt(p),{startContainer:h,startOffset:m,endContainer:d,endOffset:y}=f;le(h,n,o,!0)||le(d,n,o,!0)||c.push({start:r.getId(h),startOffset:m,end:r.getId(d),endOffset:y})}i({ranges:c})});return a(),re("selectionchange",a)}function ri({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Te(r.customElements,"define",function(o){return function(i,s,a){try{t({define:{name:i}})}catch{console.warn(`Custom element callback failed for ${i}`)}return o.apply(this,[i,s,a])}})}function ni(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:p,fontCb:f,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...d)=>{t.mutation&&t.mutation(...d),r(...d)},e.mousemoveCb=(...d)=>{t.mousemove&&t.mousemove(...d),n(...d)},e.mouseInteractionCb=(...d)=>{t.mouseInteraction&&t.mouseInteraction(...d),o(...d)},e.scrollCb=(...d)=>{t.scroll&&t.scroll(...d),i(...d)},e.viewportResizeCb=(...d)=>{t.viewportResize&&t.viewportResize(...d),s(...d)},e.inputCb=(...d)=>{t.input&&t.input(...d),a(...d)},e.mediaInteractionCb=(...d)=>{t.mediaInteaction&&t.mediaInteaction(...d),l(...d)},e.styleSheetRuleCb=(...d)=>{t.styleSheetRule&&t.styleSheetRule(...d),c(...d)},e.styleDeclarationCb=(...d)=>{t.styleDeclaration&&t.styleDeclaration(...d),u(...d)},e.canvasMutationCb=(...d)=>{t.canvasMutation&&t.canvasMutation(...d),p(...d)},e.fontCb=(...d)=>{t.font&&t.font(...d),f(...d)},e.selectionCb=(...d)=>{t.selection&&t.selection(...d),h(...d)},e.customElementCb=(...d)=>{t.customElement&&t.customElement(...d),m(...d)}}function oi(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};ni(e,t);let n;e.recordDOM&&(n=Wr(e,e.doc));let o=qo(e),i=Vo(e),s=Gr(e),a=Xo(e,{win:r}),l=Ko(e),c=Qo(e),u=()=>{},p=()=>{},f=()=>{},h=()=>{};e.recordDOM&&(u=Yo(e,{win:r}),p=jr(e,e.doc),f=Jo(e,{win:r}),e.collectFonts&&(h=ei(e)));let m=ti(e),d=ri(e),y=[];for(let S of e.plugins)y.push(S.observer(S.callback,r,S.options));return _(()=>{n?.(),o(),i(),s(),a(),l(),c(),u(),p(),f(),h(),m(),d(),y.forEach(S=>S())})}function at(e){return typeof window[e]<"u"}function lt(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var vt=class{constructor(t){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,o){let i=n||this.getIdToRemoteIdMap(t),s=o||this.getRemoteIdToIdMap(t),a=i.get(r);return a||(a=this.generateIdFn(),i.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,o))}getRemoteId(t,r,n){let o=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let i=o.get(r);return i||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,n))}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}},zt=class{constructor(t){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new vt(Tr)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"unloadListener"),v(this,"attachedWindows",new Map),v(this,"messageHandler",r=>this.handleMessage(r)),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new vt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(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))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let r=t.contentWindow;if(!r||this.attachedWindows.has(r))return;let n=[],o=()=>{this.attachedWindows.delete(r),n.forEach(i=>{try{i()}catch{}})};this.attachedWindows.set(r,o),this.recordCrossOriginIframes&&n.push(re("message",this.messageHandler,r)),n.push(re("pagehide",i=>{var s;if(i.persisted)return;let a=r.document;o(),(s=this.unloadListener)==null||s.call(this,a)},r))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let o=this.crossOriginIframeMap.get(t.source);if(!o)return;let i=this.transformCrossOriginEvent(o,r.data.event);i&&this.wrappedEmit(i,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let o=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(r.data.node,o),{timestamp:r.timestamp,type:L.IncrementalSnapshot,data:{source:A.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Annotation:case L.Plugin:return r;case L.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case L.IncrementalSnapshot:switch(r.data.source){case A.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);let i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(o.node,i)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.Drag:case A.TouchMove:case A.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(r.data,t,["id"]),r;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case A.Font:return r;case A.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case A.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}return!1}replace(t,r,n,o){for(let i of o)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==ee.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Pt=class{constructor(t){v(this,"shadowDoms",new Map),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(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;let n=[];this.shadowDoms.set(t,n);let o=Wr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);n.push(o),n.push(Gr({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===n&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),n.push(jr({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let r=M.shadowRoot(t);r&&(this.shadowDoms.has(r)&&this.removeShadowRoot(r),this.removeShadowRootsIn(r)),M.childNodes(t).forEach(n=>this.removeShadowRootsIn(n))}removeShadowRoot(t){let r=this.shadowDoms.get(t);this.shadowDoms.delete(t),r?.forEach(It)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(Te(t.prototype,"attachShadow",function(o){return function(i){let s=o.call(this,i),a=M.shadowRoot(this);return a&&Dt(this)&&n.addShadowRoot(a,r),s}}))}reset(){this.restoreHandlers.forEach(It),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(r=>r.forEach(It))}};function It(e){try{e()}catch{}}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ii=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(We=0;We<ze.length;We++)ii[ze.charCodeAt(We)]=We;var We,si=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=ze[t[r]>>2],o+=ze[(t[r]&3)<<4|t[r+1]>>4],o+=ze[(t[r+1]&15)<<2|t[r+2]>>6],o+=ze[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},br=new Map;function ai(e,t){let r=br.get(e);return r||(r=new Map,br.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var qr=(e,t,r)=>{if(!e||!(Xr(e,t)||typeof e=="object"))return;let n=e.constructor.name,o=ai(r,n),i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function ut(e,t,r){if(e instanceof Array)return e.map(n=>ut(n,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 n=e.constructor.name,o=si(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ut(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ut(e.data,t,r),e.width,e.height]};if(Xr(e,t)||typeof e=="object"){let n=e.constructor.name,o=qr(e,t,r);return{rr_type:n,index:o}}}}return e}var Vr=(e,t,r)=>e.map(n=>ut(n,t,r)),Xr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function li(e,t,r,n){let o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of i)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=Te(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return le(this.canvas,r,n,!0)||setTimeout(()=>{let u=Vr(c,t,this);e(this.canvas,{type:Ue["2D"],property:s,args:u})},0),l.apply(this,c)}});o.push(a)}catch{let a=bt(t.CanvasRenderingContext2D.prototype,s,{set(l){e(this.canvas,{type:Ue["2D"],property:s,args:[l],setter:!0})}});o.push(a)}return()=>{o.forEach(s=>s())}}function ui(e){return e==="experimental-webgl"?"webgl":e}function wr(e,t,r,n){let o=[];try{let i=Te(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(a,...l){if(!le(this,t,r,!0)){let c=ui(a);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){let u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[a,...l])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(i=>i())}}function Sr(e,t,r,n,o,i){let s=[],a=Object.getOwnPropertyNames(e);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let c=Te(e,l,function(u){return function(...p){let f=u.apply(this,p);if(qr(f,i,this),"tagName"in this.canvas&&!le(this.canvas,n,o,!0)){let h=Vr(p,i,this),m={type:t,property:l,args:h};r(this.canvas,m)}return f}});s.push(c)}catch{let c=bt(e,l,{set(u){r(this.canvas,{type:t,property:l,args:[u],setter:!0})}});s.push(c)}return s}function ci(e,t,r,n){let o=[];return typeof t.WebGLRenderingContext<"u"&&o.push(...Sr(t.WebGLRenderingContext.prototype,Ue.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Sr(t.WebGL2RenderingContext.prototype,Ue.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}var Zr=`(function() {
|
|
4
4
|
"use strict";
|
package/dist/static/v0/replay.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,c as v,d as O,e as b,f as P,g as R,i as W,j as D}from"./chunk-
|
|
1
|
+
import{a as g,c as v,d as O,e as b,f as P,g as R,i as W,j as D}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var x="lc_replay_ack",U=()=>{try{let e=sessionStorage.getItem(x);return e?[e]:[]}catch{return[]}};function $(){let e={status:"awaiting_config",disabledReason:void 0,startReason:void 0,sampleRate:void 0,minDurationMs:void 0,triggers:void 0,matchedGroups:void 0,bufferLength:void 0,flushedBytes:0,confirmed:new Set(U()),rrwebError:void 0,rrwebErrors:0,bufferBytes:void 0,throttled:void 0};return Object.assign(e,{ack(t){if(!e.confirmed.has(t)){e.confirmed.add(t);try{sessionStorage.setItem(x,t)}catch{}}},props(t){let i=e.triggers?.(),r={$recording_status:e.status,$has_recording:e.confirmed.has(t)};e.disabledReason&&(r.$replay_disabled_reason=e.disabledReason),e.startReason&&(r.$session_recording_start_reason=e.startReason),e.sampleRate!==void 0&&(r.$replay_sample_rate=e.sampleRate),e.minDurationMs!==void 0&&(r.$replay_minimum_duration=e.minDurationMs),i&&(r.$replay_url_trigger_status=i.url,r.$replay_event_trigger_status=i.event,r.$replay_linked_flag_trigger_status=i.flag);let d=e.matchedGroups?.();d?.length&&(r.$replay_trigger_groups_matched=d),e.bufferLength&&(r.$replay_buffer_length=e.bufferLength()),e.flushedBytes&&(r.$replay_flushed_size=e.flushedBytes),e.rrwebError&&(r.$replay_rrweb_error=e.rrwebError),e.rrwebErrors&&(r.$replay_rrweb_error_count=e.rrwebErrors);let p=e.bufferBytes?.();p&&(r.$replay_buffer_size=p);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var k="lucida_replay_url";function j(e,t,i,r=2e3){let d={},p=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[k]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[k,s]]]]),d.crisp=s)}catch{}};p();let a=setInterval(p,r);return()=>clearInterval(a)}var N=e=>{let t=$();e.eventExtras.push(n=>t.props(n));let i=e.config.replay??{},r=n=>{t.status="disabled",t.disabledReason=n};if(i.enabled===!1)return r("disabled_locally");let d=e.config.replayOwner??i.owner;if(!b(d))return d||console.warn("[lucida] replay is off: Watchtower is already recording this page. Set replayOwner: 'lucida' (or 'both') to record with Lucida too."),e.loadConfig(),r("owner_watchtower");if(navigator.connection?.saveData)return r("data_saver");let a="idle",o,s=0,m=!1,C=location.href,h=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),y=async n=>{if(a!=="idle")return;if(!h())return r("no_consent");a="starting",t.status="awaiting_config";let u=++s,l=await e.loadConfig(),f=g(l?.replay_never_record,C)||!!n&&g(l?.replay_never_record,location.href),c=f?null:v(i,l);if(u!==s)return void(a="idle");if(!c)return r(f?"never_record_page":"remote_disabled"),void(a="idle");let M=e.core.sessionId,S=c.trigger_groups.length>0,T=!!n?.sampling||S||R(M,"",c.sample_rate);if(t.sampleRate=S?void 0:c.sample_rate,t.minDurationMs=c.min_duration_ms,!T)return t.status="sampled",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:I}=await import("./recorder-4WIMQCLR.js");if(u!==s)return void(a="idle");o=I(e,c,t,n),a="on"},w=()=>{s++,o?.stop(),o=void 0,a="idle"};e.replay={start:async n=>{m=!1;let u=n===!0,l=f=>u||typeof n=="object"&&!!n[f];await y({sampling:n===void 0||l("sampling"),url_trigger:l("url_trigger"),event_trigger:l("event_trigger"),linked_flag:l("linked_flag")})},stop:()=>{m=!0,w(),r("stopped_manually")},pause:()=>o?.pause(),resume:()=>o?.resume(),tag:n=>e.client.capture("$replay_tag",{name:n,session_id:e.core.sessionId}),isRecording:()=>a==="on"&&!o?.paused()},e.core.onChange(n=>{n==="consent"&&(h()?m||y():(w(),r("no_consent")))}),y();let _=i.supportWidgets,E=_?.intercom||_?.crisp?j(_,()=>e.client.getReplayUrl(),()=>a==="on"&&!o?.paused()):void 0;return()=>{s++,o?.stop(),E?.()}};export{P as fnv1a32,b as lucidaRecords,D as pagePrivacy,g as policyMatches,N as replay,v as resolveReplay,R as sampled,O as urlAllowed,W as urlRules};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ve=(e,t)=>()=>(e&&(t=e(e=0)),t);function Ke(e){return e.startsWith("re:")?e.slice(3):e.split("*").map(t=>t.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function j(e,t){return!!e?.some(n=>{try{return new RegExp(Ke(n),"i").test(t)}catch{return!1}})}var pe=ve(()=>{"use strict"});var be='[data-lc-region="article"]';function K(e,t,n){if(t.articles===!1)return()=>{};let o;e.loadConfig().then(m=>{typeof m?.article_selector=="string"&&(o=m.article_selector)});let i=()=>{for(let m of[t.articleSelector,o,be])if(m)try{let g=document.querySelector(m);if(g)return g}catch{}return null},s=location.href,u=location.pathname,c=null,a=0,l=!1,r=()=>{if(c??=i(),!c)return;let m=c.getBoundingClientRect();if(m.height<=0)return;let g=Math.round(Math.min(100,Math.max(0,(window.innerHeight-m.top)/m.height*100)));a=Math.max(a,g);let v=c.querySelector("h1,h2");v&&v.getBoundingClientRect().bottom<0&&(l=!0)},p=()=>{!c||!n()||(r(),e.client.capture("$article_read",{$article_id:(c.getAttribute("data-lc-article-id")??"").trim().slice(0,200)||u,$article_depth:a,$article_finished:a>=90,$article_headline_exit:!l&&a<25}),c=null)},d=()=>{p(),c=null,a=0,l=!1,s=location.href,u=location.pathname},f=()=>location.href!==s?d():r(),h=new MutationObserver(f);return h.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("scroll",f,{passive:!0}),e.onUnload(p),r(),()=>{h.disconnect(),window.removeEventListener("scroll",f)}}var T="data-lc-content",Ee="data-lc-content-piece",we="data-lc-content-target";var O=(e,t)=>(e.getAttribute(t)??"").trim().slice(0,200);function G(e,t,n){if(t.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let o=new WeakSet,i=r=>{let p={$content_name:O(r,T)},d=O(r,Ee),f=O(r,we);return d&&(p.$content_piece=d),f&&(p.$content_target=f),p},s=location.href,u=new IntersectionObserver(r=>{for(let p of r)!p.isIntersecting||o.has(p.target)||!n()||(o.add(p.target),e.client.capture("$content_impression",i(p.target)))},{threshold:.5}),c=r=>r.querySelectorAll(`[${T}]`).forEach(p=>u.observe(p));c(document);let a=new MutationObserver(()=>{location.href!==s&&(s=location.href,u.disconnect(),document.querySelectorAll(`[${T}]`).forEach(r=>o.delete(r))),c(document)});a.observe(document.documentElement,{childList:!0,subtree:!0});let l=r=>{let p=r.target?.closest?.(`[${T}]`);p&&n()&&e.client.capture("$content_interaction",{...i(p),$content_interaction_type:"click"})};return document.addEventListener("click",l,!0),()=>{u.disconnect(),a.disconnect(),document.removeEventListener("click",l,!0)}}var ke=new Set(["input","textarea","select","option"]),xe=["name","type","role","aria-label","title","alt","placeholder"],Ce=/(?:\d[ -]?){9,}/;function Re(e){if(ke.has(e.tagName.toLowerCase())||e.isContentEditable)return;let t="";for(let n of Array.from(e.childNodes))n.nodeType===3&&(t+=n.textContent??"");if(t=t.replace(/\s+/g," ").trim(),!(!t||Ce.test(t)))return t.slice(0,255)}function Y(e){if(!e?.length)return()=>!1;let t=e.map(n=>n.toLowerCase());return n=>t.some(o=>o.endsWith("*")?n.startsWith(o.slice(0,-1)):n===o)}var B="***";function w(e){let t={};for(let n=e,o=0;n&&o<10;n=n.parentElement,o++)for(let i of Array.from(n.attributes)){let s=i.name.startsWith("data-lc-attr-")?i.name.slice(13):"";s&&!(s in t)&&!s.startsWith("$")&&(t[s]=i.value.slice(0,255))}return t}function Se(e,t,n,o){let i=e.parentElement,s=i?Array.from(i.children):[e],u={tag_name:e.tagName.toLowerCase(),nth_child:s.indexOf(e)+1,nth_of_type:s.filter(r=>r.tagName===e.tagName).indexOf(e)+1},c=(e.getAttribute("class")??"").split(/\s+/).filter(Boolean);c.length&&!n("class")&&(u.classes=c),e.id&&!n("id")&&(u.attr__id=o("id",e.id));let a=e.getAttribute("href");a&&!n("href")&&(u.href=o("href",a.slice(0,1024)));let l={};for(let r of Array.from(e.attributes))(r.name.startsWith("data-lc-")||xe.includes(r.name))&&!n(r.name)&&(l[r.name]=o(r.name,r.value.slice(0,255)));if(Object.keys(l).length&&(u.attrs=l),t){let r=Re(e);r&&(u.text=r)}return u}function k(e,t,n,o,i={}){let s=[],u=Y(o),c=Y(i.allow),a=i.maskAll?(r,p)=>c(r)?p:B:(r,p)=>p,l=t;for(let r=e;r&&s.length<10;r=r.parentElement)s.push(Se(r,l,u,a)),(r===n||!n)&&(l=!1);return s}var $=e=>e.replace(/(["\\])/g,"\\$1");function x(e){return e.map(t=>{let n=t.tag_name+(t.classes?"."+t.classes.join("."):"")+":";t.attr__id&&(n+=`attr__id="${$(t.attr__id)}"`),t.href&&(n+=`href="${$(t.href)}"`),t.text&&(n+=`text="${$(t.text)}"`);for(let[o,i]of Object.entries(t.attrs??{}))n+=`attr__${o}="${$(i)}"`;return n+`nth-child="${t.nth_child}"nth-of-type="${t.nth_of_type}"`}).join(";")}var b=[],Ae=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,Me=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,Te=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,$e="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function z(e,t=[]){if(t.length&&e.closest(t.join(","))||e.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=e.closest($e)??e,o=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(Ae.test((n.textContent??"").trim())||Me.test(o))return!0;for(let i=n,s=0;i&&s<3;i=i.parentElement,s++)if(Te.test(i.getAttribute("class")??""))return!0;return!1}var Le=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function V(e,t=Date.now(),n={},o){if(o&&n.ignoreSelectors?.length&&o.closest(n.ignoreSelectors.join(",")))return{};if(o&&n.suppressSteppers!==!1&&z(o,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&Le())return{};let i=n.windowMs??1e3,s=n.radiusPx??30;for(b.length&&t<b[b.length-1].t&&(b.length=0),b.push({t,x:e.clientX,y:e.clientY});b.length&&t-b[0].t>i;)b.shift();let u=b.filter(c=>Math.hypot(c.x-e.clientX,c.y-e.clientY)<=s).length;return u>=(n.count??3)?{$rageclick:!0,$rageclick_count:u}:{}}function Q(e,t,n=700){if(typeof MutationObserver>"u")return;let o=!1,i=new MutationObserver(()=>o=!0);i.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let s=()=>{o=!0};window.addEventListener("scroll",s,{capture:!0,passive:!0}),document.addEventListener("selectionchange",s);let u=()=>{i.disconnect(),window.removeEventListener("scroll",s,{capture:!0}),document.removeEventListener("selectionchange",s)},c=setTimeout(()=>{u(),!o&&document.visibilityState!=="hidden"&&e.client.capture("$deadclick_hint",{$selector:t,$no_mutation_ms:n})},n);e.onUnload(()=>{clearTimeout(c),u()})}var Z=/^[A-Za-z_][\w-]*$/,Oe=5;function J(e){let t=[];for(let n=e;n&&t.length<Oe;n=n.parentElement){let o=n.tagName.toLowerCase();if(n.id&&Z.test(n.id)){t.unshift(`${o}#${n.id}`);break}let i=(n.getAttribute("class")??"").split(/\s+/).filter(s=>Z.test(s)).slice(0,2);t.unshift(o+i.map(s=>`.${s}`).join(""))}return t.join(" ")}function ee(e,t,n,o,i={}){let s={$selector:J(n),$el_interactive:o};(t.clientX||t.clientY||t.detail)&&(s.$click_x=Math.round(t.clientX+(window.scrollX||0)),s.$click_y=Math.round(t.clientY+(window.scrollY||0))),i.rageClicks!==!1&&!n.closest(".lc-no-rageclick,[data-lc-no-rageclick]")&&Object.assign(s,V(t,Date.now(),i.rageClicks||{},n));let u=i.deadClicks;!o&&t.isTrusted&&u!==!1&&!(u?.ignoreSelectors?.length&&n.closest(u.ignoreSelectors.join(",")))&&Q(e,s.$selector,u?.waitMs);for(let c of e.clickExtras)Object.assign(s,c(t,n));return s}var He="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",Ie="[data-lc-ignore]",H=e=>e.some(t=>typeof t=="string"?location.href.includes(t):t.test(location.href)),Pe=e=>!e?.length||H(e),I=e=>({maskAll:e.maskAllAttributes,allow:e.attributeAllowlist}),C=(e,t)=>!!e.closest(Ie)||!!(t.denySelectors?.length&&e.closest(t.denySelectors.join(",")));function te(e,t,n,o=()=>!0){let i=t.events??["click","change","submit"],s=0,u=l=>{let r=l.target;!n()||!o()||l.isComposing||!(r instanceof Element)||C(r,t)||r instanceof HTMLInputElement&&r.type==="password"||(s+=1)},c=l=>r=>{if(!n()||l!=="click"&&!o())return;let p=r.target;if(!(p instanceof Element)||C(p,t)||t.allowSelectors?.length&&!p.closest(t.allowSelectors.join(","))||t.elementAllowlist?.length&&!p.closest(t.elementAllowlist.join(","))||!Pe(t.urlAllowlist)||l==="change"&&!/^(input|select|textarea)$/i.test(p.tagName)||p instanceof HTMLInputElement&&p.type==="password")return;let d=p.closest(He);if(l==="click"&&!d&&!t.allowSelectors?.length)return;let f=k(p,t.captureText??!0,d??void 0,t.attributeIgnore,I(t)),h=f.find(g=>g.text)?.text,m=s;s=0,e.client.capture("$autocapture",{...w(p),$event_type:l,...m>0?{$keystroke_count:m}:{},$elements:f,$elements_chain:x(f),...h?{$el_text:h}:{},...l==="click"?ee(e,r,p,!!d,t):{}})};e.autocaptureClicks=i.includes("click");let a=i.map(l=>[l,c(l)]);for(let[l,r]of a)document.addEventListener(l,r,!0);return document.addEventListener("keydown",u,!0),()=>{for(let[l,r]of a)document.removeEventListener(l,r,!0);document.removeEventListener("keydown",u,!0)}}var je='[contenteditable]:not([contenteditable="false"])',ne="input,textarea,select",Ne=255;function re(e){return e.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,Ne)}var We=e=>e?e instanceof Element?e:e.parentElement:null;function oe(e,t,n,o=()=>!0){let i=t.events??["click","change","submit"],s=t.contentEditable!==!1&&i.includes("change"),u=new WeakSet,c=d=>{let f=k(d,!1,d,t.attributeIgnore,I(t));return{...w(d),$elements:f,$elements_chain:x(f)}},a=d=>{let f=d instanceof Element?d.closest(je):null;return f&&!C(f,t)?f:null},l=d=>{let f=n()&&o()?a(d.target):null;f&&u.add(f)},r=d=>{let f=a(d.target);!f||!u.has(f)||d.relatedTarget instanceof Node&&f.contains(d.relatedTarget)||(u.delete(f),n()&&o()&&e.client.capture("$autocapture",{$event_type:"change",$el_contenteditable:!0,...c(f)}))},p=d=>{if(!n()||!t.copyCut)return;let f=typeof getSelection=="function"?getSelection():null,h=d.target instanceof Element?d.target:null,m=We(f?.anchorNode)??h;if(!m||C(m,t)||m.closest(ne)||h?.closest(ne))return;let g=t.captureCopiedText?re(f?.toString()??""):"";e.client.capture("$copy_autocapture",{$copy_type:d.type,...c(m),...g?{$selected_content:g}:{}})};return s&&(document.addEventListener("input",l,!0),document.addEventListener("focusout",r,!0)),document.addEventListener("copy",p,!0),document.addEventListener("cut",p,!0),()=>{document.removeEventListener("input",l,!0),document.removeEventListener("focusout",r,!0),document.removeEventListener("copy",p,!0),document.removeEventListener("cut",p,!0)}}var De="[data-lc-ignore]",ie=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],ae=["q","s","search","query"],se=e=>e.origin+e.pathname;function le(e,t,n){let o=Array.isArray(t.fileDownloads)?t.fileDownloads.map(s=>s.toLowerCase()):ie,i=[];if(t.outboundLinks!==!1||t.fileDownloads!==!1){let s=u=>{let c=u.target instanceof Element?u.target.closest("a[href]"):null;if(!c||!n()||c.closest(De))return;let a;try{a=new URL(c.href,location.href)}catch{return}if(a.protocol!=="http:"&&a.protocol!=="https:")return;let l=decodeURIComponent(a.pathname.split("/").pop()??""),r=l.includes(".")?l.split(".").pop().toLowerCase():"";t.fileDownloads!==!1&&(c.hasAttribute("download")||o.includes(r))?e.client.capture("$file_download",{$url:se(a),$file_name:l,$file_extension:r}):t.outboundLinks!==!1&&a.host!==location.host&&e.client.capture("$outbound_click",{$url:se(a),$outbound_host:a.host})};document.addEventListener("click",s,!0),i.push(()=>document.removeEventListener("click",s,!0))}if(t.siteSearch!==!1){let s=typeof t.siteSearch=="object"&&t.siteSearch.params?t.siteSearch.params:ae,u=!0;i.push(()=>{u=!1}),e.onCapture(c=>{if(!u||c.event!=="$pageview"||!n())return;let a=new URLSearchParams(location.search);for(let l of s){let r=a.get(l)?.trim();if(r)return void e.client.capture("$site_search",{$search_term:r.slice(0,200),$search_param:l})}})}return()=>i.forEach(s=>s())}function Ue(e,t={}){e.capture("$page_not_found",{$status:404,...t})}var Xe=[25,50,75],Fe="data-lc-media-title";function P(e){let t=e.currentSrc||e.src;if(!t||t.startsWith("blob:")||t.startsWith("data:"))return"";try{let n=new URL(t,location.href);return`${n.origin}${n.pathname}`}catch{return""}}var qe=e=>(e.getAttribute(Fe)??e.getAttribute("title")??e.getAttribute("aria-label")??"").trim().slice(0,200);function ce(e,t,n){if(t.media===!1)return()=>{};let o=new WeakMap,i=a=>{let l={$media_type:a instanceof HTMLVideoElement?"video":"audio",$media_src:P(a)},r=qe(a);return r&&(l.$media_title=r),Number.isFinite(a.duration)&&(l.$media_duration=Math.round(a.duration)),l},s=a=>{let l=P(a);if(!l)return null;let r=o.get(a);return(!r||r.src!==l)&&o.set(a,r={src:l,played:!1,reached:new Set,done:!1}),r},u=a=>{let l=a.target;if(!(l instanceof HTMLMediaElement)||!n())return;let r=s(l);if(r)if(a.type==="play"){if(r.done&&Object.assign(r,{played:!1,reached:new Set,done:!1}),r.played)return;r.played=!0,e.client.capture("$media_play",i(l))}else if(a.type==="timeupdate"){if(!r.played||r.done||!Number.isFinite(l.duration)||l.duration<=0)return;let p=l.currentTime/l.duration*100;for(let d of Xe)p>=d&&!r.reached.has(d)&&(r.reached.add(d),e.client.capture("$media_progress",{...i(l),$media_progress:d}))}else a.type==="ended"&&r.played&&!r.done&&(r.done=!0,e.client.capture("$media_complete",i(l)))},c=["play","timeupdate","ended"];return c.forEach(a=>document.addEventListener(a,u,!0)),()=>c.forEach(a=>document.removeEventListener(a,u,!0))}function ue(e=()=>performance.now()){let t=()=>document.visibilityState!=="hidden",n=0,o=t()?e():null,i=()=>{t()?o===null&&(o=e()):(o!==null&&(n+=e()-o),o=null)};return document.addEventListener("visibilitychange",i),{read:()=>Math.round(n+(o===null?0:e()-o)),reset:()=>{n=0,o=t()?e():null},stop:()=>document.removeEventListener("visibilitychange",i)}}pe();var de=255,Ge=new Set(["input","textarea","select","option"]),Ye="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",Be=new Set(["value","password","autocomplete"]),ze=/(?:\d[ -]?){9,}/,R=new WeakMap,N=new WeakMap;function fe(e,t){let n=N.get(e);if(n)return new Promise(o=>{let i=setTimeout(o,t);n.then(()=>(clearTimeout(i),o()))})}function me(e){return Array.isArray(e)?e.filter(t=>{if(!t||typeof t!="object")return!1;let n=t;return typeof n.name=="string"&&n.name!==""&&!n.name.startsWith("$")&&typeof n.selector=="string"&&(n.source==="text"||n.source==="attribute"&&typeof n.attribute=="string")&&Array.isArray(n.events)}):[]}function Ve(e){if(!e||Ge.has(e.tagName.toLowerCase())||e.isContentEditable)return!1;try{return!e.closest(Ye)}catch{return!1}}function Qe(e,t){if(e.source==="attribute"){let o=(e.attribute??"").toLowerCase();if(!o||Be.has(o)||o.startsWith("on"))return;let i=t.getAttribute(o);return i===null?void 0:i.slice(0,de)}let n=(t.textContent??"").replace(/\s+/g," ").trim();if(!(!n||ze.test(n)))return n.slice(0,de)}function W(e,t,n,o=location.href){let i={};for(let s of e){if(!s.events.includes(t)||s.url&&!j([s.url],o))continue;let u=null;try{u=s.scope==="target"?t==="click"&&n?n.closest(s.selector):null:document.querySelector(s.selector)}catch{continue}if(!Ve(u))continue;let c=Qe(s,u);c!==void 0&&(i[s.name]=c)}return i}function ge(e){let t=!0,n=e.loadConfig().then(o=>{t&&R.set(e,me(o?.snapshot_properties)),N.delete(e)});return N.set(e,n),e.clickExtras.push((o,i)=>t?W(R.get(e)??[],"click",i):{}),()=>{t=!1,R.delete(e)}}function he(e){let t=R.get(e);return t?.length?W(t,"pageview"):{}}function ye(e){return!!R.get(e)?.some(t=>t.events.includes("pageview"))}var Ze=e=>{try{return new URL(e).pathname}catch{return e}};function Je(e){for(let t of e===void 0?[]:Array.isArray(e)?e:[e])try{let n=document.querySelector(t);if(n)return n}catch{}}function _e(e){let t=0,n=0,o=()=>{let i=Je(e),s=document.documentElement,u=i?i.scrollHeight:Math.max(s.scrollHeight,document.body?.scrollHeight??0),c=i?i.scrollTop:window.scrollY||window.pageYOffset||0,a=Math.min(u,c+(i?i.clientHeight:window.innerHeight));a>t&&(t=a,n=u>0?Math.min(100,Math.round(a/u*100)):0)};return o(),window.addEventListener("scroll",o,{passive:!0,capture:!0}),window.addEventListener("resize",o,{passive:!0}),{read:()=>({pct:n,px:t}),stop:()=>{window.removeEventListener("scroll",o,{capture:!0}),window.removeEventListener("resize",o)}}}var et=800,tt=e=>e.core.hasConsent("analytics")||e.core.consent.resolving;function nt(e){return e==="history"?{path:!0,search:!0}:e==="hash"?{path:!0,search:!0,hash:!0}:typeof e=="object"?e:void 0}function rt(e,t,n){try{let o=new URL(e),i=new URL(t);return!!(n.path&&o.pathname!==i.pathname||n.search&&o.search!==i.search||n.hash&&o.hash!==i.hash)}catch{return e!==t}}function L(e,t,n={}){let o=n.views??!0,i=n.leave??!0,s=nt(t),u=e.config.scrollRoot,c=location.href,a=c,l=Date.now(),r=_e(u),p=ue(),d,f=()=>{if(!i||d===c)return;d=c;let{pct:y,px:E}=r.read();e.client.capture("$pageleave",{$current_url:c,$scroll_depth:y,$scroll_depth_px:E,$engagement_time_ms:p.read()})},h=!1,m=(y,E={})=>{if(!o)return;let{core:_}=e;if(!_.hasConsent("analytics")&&!_.anonymousOnReject&&!(_.consent.pending&&_.consent.queueBeforeConsent)){if(!h){h=!0;let A=()=>{h&&(h=!1,m())};e.whenConsented(A),_.onChange(M=>{M==="consent"&&_.anonymousOnReject&&A()})}return}e.client.capture("$pageview",{...he(e),...y===void 0?{}:{$referrer:y},...E})},g,v=()=>{let y=g;g=void 0,y?.()},S=y=>{if(location.href===a)return;let E=a;if(a=location.href,!s||!rt(E,a,s))return;let _=c;f(),r.stop();let A=new Date(l);c=location.href,l=Date.now(),r=_e(u),p.reset();let M={$navigation_type:y,$prev_pageview_pathname:Ze(_),$prev_pageview_duration:Math.round((l-A.getTime())/100)/10};ye(e)?setTimeout(()=>m(_,M),0):(v(),g=()=>m(_,M),queueMicrotask(v))};e.onUnload(f);let D=tt(e)?fe(e,et):void 0;if(D?(g=()=>m(),e.onUnload(v),D.then(v)):m(),!s)return()=>(r.stop(),p.stop());let{pushState:U,replaceState:X}=history;history.pushState=function(...y){v(),U.apply(this,y),S("pushState")},history.replaceState=function(...y){v(),X.apply(this,y),S("replaceState")};let F=()=>S("popstate"),q=()=>S("hashchange");return window.addEventListener("popstate",F),s.hash&&window.addEventListener("hashchange",q),()=>{window.removeEventListener("hashchange",q),history.pushState=U,history.replaceState=X,window.removeEventListener("popstate",F),r.stop(),p.stop()}}var Wt=e=>{let t=[],n=e.config.autocapture,o=!1,i=!1;if(n!==!1){let c=typeof n=="object"?n:{},a=()=>!o&&!(c.urlIgnorelist?.length&&H(c.urlIgnorelist)),l=()=>!i;t.push(te(e,c,a,l),oe(e,c,a,l),le(e,c,a),G(e,c,a),K(e,c,a),ce(e,c,a),ge(e)),n===void 0&&e.loadConfig().then(r=>o=r?.autocapture===!1),e.loadConfig().then(r=>i=r?.autocapture_inputs===!1)}let s=e.config.capturePageview??"history",u=e.config.capturePageleave??"if_capture_pageview";return s!==!1&&u!==!1?t.push(L(e,s)):s!==!1?t.push(L(e,s,{leave:!1})):u===!0&&t.push(L(e,"history",{views:!1})),()=>t.forEach(c=>c())};export{ie as DOWNLOAD_EXTENSIONS,B as MASKED,ae as SEARCH_PARAMS,w as attrProps,Wt as autocapture,k as buildChain,x as chainToString,J as cssSelector,z as isStepper,re as maskCopied,P as mediaSrc,W as readSnapshot,me as snapshotRules,Ue as tag404};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A}from"./chunk-
|
|
1
|
+
import{b as A}from"./chunk-536QABLP.js";import"./chunk-EFNCQJI3.js";var C={title:"Your privacy",body:"We use cookies and similar technologies to measure and improve this site. Choose what you allow.",acceptAll:"Accept all",rejectAll:"Reject all",save:"Save choices",categories:{analytics:"Analytics",replay:"Session replay",marketing:"Marketing"}},j=["analytics","replay","marketing"],O="button, input, [href], [tabindex]:not([tabindex='-1'])",w={bottom:{left:"0",right:"0",bottom:"0"},top:{left:"0",right:"0",top:"0"},center:{top:"50%",left:"50%",transform:"translate(-50%,-50%)","max-width":"28rem"},"bottom-left":{left:"1rem",bottom:"1rem","max-width":"24rem"},"bottom-right":{right:"1rem",bottom:"1rem","max-width":"24rem"}},l=(e,t={},...s)=>{let c=Object.assign(document.createElement(e),t);return c.append(...s),c},h;function P(){h?.close()}function S(e){if(!e)return{};let t=(e.categories??[]).filter(a=>!a.required&&j.includes(a.id)),s=Object.fromEntries(t.map(a=>[a.id,a.label])),c={title:e.title,body:e.body,acceptAll:e.accept_label,rejectAll:e.decline_label,save:e.customize_label,categories:s},d=e.position?.replace("_","-");return{texts:Object.fromEntries(Object.entries(c).filter(([,a])=>a!==void 0)),...t.length?{categories:t.map(a=>a.id)}:{},...d&&d in w?{position:d}:{}}}async function H(e){try{let t=await e.fetch(`${e.config.apiHost}/v1/config?api_key=${encodeURIComponent(e.apiKey)}`,{credentials:"omit"});return t.ok?S((await t.json()).consent_banner):{}}catch{return{}}}async function _(e,t={}){if(!t.remote)return B(e,t);let s=await H(e);return B(e,{...s,...t,texts:{...s.texts,...t.texts,categories:{...s.texts?.categories,...t.texts?.categories}}})}function B(e,t){P();let s={...C,...t.texts,categories:{...C.categories,...t.texts?.categories}},c=t.categories??j,d=e.core.getConsent(),a=t.position??"bottom",m=`lc-consent-${Math.random().toString(36).slice(2,8)}`,L=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,M=document.activeElement,v=c.map(o=>{let i=l("input",{type:"checkbox",id:`${m}-${o}`,checked:d[o]});return{c:o,input:i,row:l("label",{htmlFor:i.id},i,document.createTextNode(` ${s.categories[o]}`))}}),p=(o,i)=>{let u=l("button",{type:"button",textContent:o});return u.style.cssText=`padding:.5rem 1rem;margin:.25rem .5rem .25rem 0;border:1px solid #1f2937;border-radius:.375rem;cursor:pointer;font:inherit;background:${i?"#1f2937":"#fff"};color:${i?"#fff":"#1f2937"}`,u},g=p(s.acceptAll,!0),k=p(s.rejectAll,!0),T=p(s.save,!1),n=l("div",{role:"dialog",id:m},l("h2",{id:`${m}-t`,textContent:s.title}),l("p",{id:`${m}-d`,textContent:s.body}),...c.length>1?v.map(o=>o.row):[],l("div",{},g,k,...c.length>1?[T]:[]));n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby",`${m}-t`),n.setAttribute("aria-describedby",`${m}-d`),n.setAttribute("data-lc-ignore",""),n.style.cssText="position:fixed;z-index:2147483000;box-sizing:border-box;padding:1rem 1.25rem;background:#fff;color:#111827;font:14px/1.4 system-ui,sans-serif;box-shadow:0 0 .75rem rgba(0,0,0,.3);display:block";for(let[o,i]of Object.entries(w[a]))n.style.setProperty(o,i);for(let o of n.querySelectorAll("h2"))o.style.cssText="margin:0 0 .5rem;font-size:1.1rem";for(let o of n.querySelectorAll("label"))o.style.cssText="display:block;margin:.25rem 0";return L||(n.style.opacity="0",n.style.transition="opacity .2s",requestAnimationFrame(()=>n.style.opacity="1")),new Promise(o=>{let i=r=>{document.removeEventListener("keydown",E,!0),n.remove(),h=void 0,M?.focus?.(),r&&A(e,r,"banner",t.version?{version:t.version}:{}),o(r?e.core.getConsent():null)},u=r=>Object.fromEntries(c.map(f=>[f,r])),E=r=>{if(r.key==="Escape")return void i(null);if(r.key!=="Tab")return;let f=[...n.querySelectorAll(O)],y=f[0],b=f[f.length-1],x=document.activeElement;if(!n.contains(x))(r.shiftKey?b:y).focus();else if(r.shiftKey&&x===y)b.focus();else if(!r.shiftKey&&x===b)y.focus();else return;r.preventDefault()};g.onclick=()=>i(u(!0)),k.onclick=()=>i(u(!1)),T.onclick=()=>i(Object.fromEntries(v.map(r=>[r.c,r.input.checked]))),document.addEventListener("keydown",E,!0),document.body.append(n),h={root:n,close:()=>i(null)},g.focus()})}export{S as fromRemote,P as hideBanner,_ as showBanner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-EFNCQJI3.js";var r="$consent_updated";function l(e,s,a,n={}){let c=JSON.stringify(e.core.getConsent());e.client.setConsent(s);let t=e.core.getConsent();if(n.onlyIfChanged&&JSON.stringify(t)===c)return;let o={categories:t,source:a,version:n.version??e.config.consent?.policyVersion??"1"};if(e.core.hasConsent("analytics"))e.client.capture(r,o);else if(e.config.consent?.logBeacon&&!e.config.disabled){let p=JSON.stringify({api_key:e.apiKey,batch:[{uuid:i(Date.now()),event:r,timestamp:new Date().toISOString(),properties:{...o,$lib:"lucida-browser"}}],sent_at:new Date().toISOString()});e.fetch(`${e.config.apiHost}/v1/batch`,{method:"POST",body:p,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain"}}).catch(()=>{})}}export{r as a,l as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=0,m=0;function x(e){let n=new Uint8Array(e),t=globalThis.crypto;if(t?.getRandomValues)t.getRandomValues(n);else for(let r=0;r<e;r++)n[r]=Math.floor(Math.random()*256);return n}function O(e=Date.now()){if(e>d){d=e;let s=x(2);m=((s[0]??0)<<8|(s[1]??0))&1023}else m++,m>4095&&(d++,m=0);let n=x(8),t=new Uint8Array(16),r=d;t[0]=Math.floor(r/2**40)&255,t[1]=Math.floor(r/2**32)&255,t[2]=Math.floor(r/2**24)&255,t[3]=Math.floor(r/2**16)&255,t[4]=Math.floor(r/2**8)&255,t[5]=r&255,t[6]=112|m>>8,t[7]=m&255,t[8]=128|(n[0]??0)&63;for(let s=1;s<8;s++)t[8+s]=n[s]??0;let o=Array.from(t,s=>s.toString(16).padStart(2,"0")).join("");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}function R(e,n={}){let t=Math.min(n.maxMs??3e4,(n.baseMs??1e3)*2**e);return Math.round(t*(.5+.5*(n.random??Math.random)()))}function w(e){return e===0||e===408||e===429||e>=500}var M=/^(0|[1-9]\d{0,2})$/,T=/^[0-9a-fA-F]{1,4}$/,V=/^(0|[1-9]\d*)$/;function h(e){let n=e.split(".");if(n.length!==4)return;let t=[];for(let r of n){if(!M.test(r)||Number(r)>255)return;t.push(Number(r))}return t}function N(e){if(e.includes("%"))return;let n=e,t=e.lastIndexOf(":"),r=e.slice(t+1);if(r.includes(".")){let f=h(r);if(!f)return;n=`${e.slice(0,t+1)}${(f[0]<<8|f[1]).toString(16)}:${(f[2]<<8|f[3]).toString(16)}`}let o=n.split("::");if(o.length>2)return;let s=f=>{if(f==="")return[];let c=[];for(let _ of f.split(":")){if(!T.test(_))return;c.push(parseInt(_,16))}return c},i=s(o[0]),a=o.length===2?s(o[1]):[];if(!i||!a)return;let u=i.length+a.length;return(o.length===2?u>7:u!==8)?void 0:[...i,...Array(8-u).fill(0),...a].flatMap(f=>[f>>8,f&255])}function S(e){return e.includes(":")?N(e):h(e)}var j=e=>e.length===16&&e.slice(0,10).every(n=>n===0)&&e[10]===255&&e[11]===255;function k(e){if(typeof e!="string")return;let n=S(e.trim());return n&&j(n)?n.slice(12):n}function q(e){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],t=[];for(let r of n){if(typeof r!="string")continue;let o=r.trim(),s=o.indexOf("/");if(s<0){let u=k(o);u&&t.push({bytes:u,bits:u.length*8});continue}let i=S(o.slice(0,s)),a=o.slice(s+1);!i||!V.test(a)||Number(a)>i.length*8||t.push({bytes:i,bits:Number(a)})}return t}function I(e,n){if(e.bytes.length!==n.length)return!1;for(let t=0;t<e.bits;t+=8){let o=255<<8-Math.min(8,e.bits-t)&255,s=t/8;if((e.bytes[s]&o)!==(n[s]&o))return!1}return!0}function v(e,n,t,r){switch(e){case"array_contains_any":case"array_contains_all":case"array_contains_none":{if(!Array.isArray(n)||!Array.isArray(t))return!1;let o=t.filter(s=>n.some(i=>r(i,s))).length;return e==="array_contains_any"?o>0:e==="array_contains_all"?o===t.length:o===0}case"ip_in_cidr":case"ip_not_in_cidr":{let o=k(n),s=q(t);return!o||!s.length?!1:s.some(i=>I(i,o))===(e==="ip_in_cidr")}}return!1}var P=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,A=/^\d{4}-\d{2}-\d{2}$/,$=/^-?(\d{1,6})([hdwmy])$/,
|
|
1
|
+
var d=0,m=0;function x(e){let n=new Uint8Array(e),t=globalThis.crypto;if(t?.getRandomValues)t.getRandomValues(n);else for(let r=0;r<e;r++)n[r]=Math.floor(Math.random()*256);return n}function O(e=Date.now()){if(e>d){d=e;let s=x(2);m=((s[0]??0)<<8|(s[1]??0))&1023}else m++,m>4095&&(d++,m=0);let n=x(8),t=new Uint8Array(16),r=d;t[0]=Math.floor(r/2**40)&255,t[1]=Math.floor(r/2**32)&255,t[2]=Math.floor(r/2**24)&255,t[3]=Math.floor(r/2**16)&255,t[4]=Math.floor(r/2**8)&255,t[5]=r&255,t[6]=112|m>>8,t[7]=m&255,t[8]=128|(n[0]??0)&63;for(let s=1;s<8;s++)t[8+s]=n[s]??0;let o=Array.from(t,s=>s.toString(16).padStart(2,"0")).join("");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}function R(e,n={}){let t=Math.min(n.maxMs??3e4,(n.baseMs??1e3)*2**e);return Math.round(t*(.5+.5*(n.random??Math.random)()))}function w(e){return e===0||e===408||e===429||e>=500}var M=/^(0|[1-9]\d{0,2})$/,T=/^[0-9a-fA-F]{1,4}$/,V=/^(0|[1-9]\d*)$/;function h(e){let n=e.split(".");if(n.length!==4)return;let t=[];for(let r of n){if(!M.test(r)||Number(r)>255)return;t.push(Number(r))}return t}function N(e){if(e.includes("%"))return;let n=e,t=e.lastIndexOf(":"),r=e.slice(t+1);if(r.includes(".")){let f=h(r);if(!f)return;n=`${e.slice(0,t+1)}${(f[0]<<8|f[1]).toString(16)}:${(f[2]<<8|f[3]).toString(16)}`}let o=n.split("::");if(o.length>2)return;let s=f=>{if(f==="")return[];let c=[];for(let _ of f.split(":")){if(!T.test(_))return;c.push(parseInt(_,16))}return c},i=s(o[0]),a=o.length===2?s(o[1]):[];if(!i||!a)return;let u=i.length+a.length;return(o.length===2?u>7:u!==8)?void 0:[...i,...Array(8-u).fill(0),...a].flatMap(f=>[f>>8,f&255])}function S(e){return e.includes(":")?N(e):h(e)}var j=e=>e.length===16&&e.slice(0,10).every(n=>n===0)&&e[10]===255&&e[11]===255;function k(e){if(typeof e!="string")return;let n=S(e.trim());return n&&j(n)?n.slice(12):n}function q(e){let n=typeof e=="string"?[e]:Array.isArray(e)?e:[],t=[];for(let r of n){if(typeof r!="string")continue;let o=r.trim(),s=o.indexOf("/");if(s<0){let u=k(o);u&&t.push({bytes:u,bits:u.length*8});continue}let i=S(o.slice(0,s)),a=o.slice(s+1);!i||!V.test(a)||Number(a)>i.length*8||t.push({bytes:i,bits:Number(a)})}return t}function I(e,n){if(e.bytes.length!==n.length)return!1;for(let t=0;t<e.bits;t+=8){let o=255<<8-Math.min(8,e.bits-t)&255,s=t/8;if((e.bytes[s]&o)!==(n[s]&o))return!1}return!0}function v(e,n,t,r){switch(e){case"array_contains_any":case"array_contains_all":case"array_contains_none":{if(!Array.isArray(n)||!Array.isArray(t))return!1;let o=t.filter(s=>n.some(i=>r(i,s))).length;return e==="array_contains_any"?o>0:e==="array_contains_all"?o===t.length:o===0}case"ip_in_cidr":case"ip_not_in_cidr":{let o=k(n),s=q(t);return!o||!s.length?!1:s.some(i=>I(i,o))===(e==="ip_in_cidr")}}return!1}var P=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,A=/^\d{4}-\d{2}-\d{2}$/,$=/^-?(\d{1,6})([hdwmy])$/,D={h:3600,d:86400,w:604800,m:2592e3,y:31536e3};function H(e){let n=$.exec(e.trim());return n?Number(n[1])*D[n[2]]:void 0}function E(e,n,t){if(typeof e=="number")return e*1e3;if(typeof e!="string")return;let r=e.trim();if(t){let s=H(r);if(s!==void 0)return n-s*1e3}if(!P.test(r)&&!A.test(r))return;let o=Date.parse(A.test(r)?`${r}T00:00:00Z`:r);return Number.isNaN(o)?void 0:o}function C(e,n){for(let t=0;t<Math.max(e.length,n.length);t++){let r=e[t]??0,o=n[t]??0;if(r!==o)return r<o?-1:1}return 0}function L(e,n,t){if(typeof n!="string")return;let r=n.trim().replace(/^v/,"").split(".");if(e==="semver_wildcard"){let l=r[r.length-1];if(l!=="*"&&l!=="x"&&l!=="X")return;if(r.length===1)return[[0],[2**30]];let f=t.parseVersion(r.slice(0,-1).join("."));if(!f)return;let c=[...f];return c[c.length-1]=c[c.length-1]+1,[f,c]}let o=t.parseVersion(n);if(!o)return;for(;o.length<3;)o.push(0);let[s,i,a]=o,u;return e==="semver_tilde"&&r.length===1?u=[s+1,0,0]:e==="semver_tilde"||s===0&&i>0?u=[s,i+1,0]:s>0?u=[s+1,0,0]:u=[0,0,a+1],[o,u]}function F(e,n,t,r,o){switch(e){case"icontains":case"not_icontains":case"starts_with":case"not_starts_with":case"ends_with":case"not_ends_with":return typeof n!="string"||typeof t!="string"?!1:e.endsWith("icontains")?n.toLowerCase().includes(t.toLowerCase())===(e==="icontains"):e.endsWith("starts_with")?n.startsWith(t)===(e==="starts_with"):n.endsWith(t)===(e==="ends_with");case"between":case"not_between":{let s=o.toFloat(n);if(!Array.isArray(t)||t.length!==2||s===void 0)return!1;let[i,a]=t;return typeof i!="number"||typeof a!="number"?!1:(s>=i&&s<=a)==(e==="between")}case"is_date_before":case"is_date_after":{let s=E(n,r,!1),i=E(t,r,!0);return s===void 0||i===void 0?!1:e==="is_date_before"?s<i:s>i}case"semver_eq":case"semver_neq":case"semver_gt":case"semver_gte":case"semver_lt":case"semver_lte":{let s=o.cmpVersion(n,t);if(s===void 0)return!1;let i=e.slice(7);return i==="eq"?s===0:i==="neq"?s!==0:i==="gt"?s>0:i==="gte"?s>=0:i==="lt"?s<0:s<=0}case"semver_tilde":case"semver_caret":case"semver_wildcard":{let s=o.parseVersion(n),i=L(e,t,o);return!!s&&!!i&&C(s,i[0])>=0&&C(s,i[1])<0}}return!1}var B=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;function g(e){if(typeof e=="number")return e;if(typeof e=="string"&&B.test(e.trim()))return Number(e.trim())}function p(e,n){let t=typeof e=="number",r=typeof n=="number";return t||r?t&&r&&e===n:e===n}function y(e){if(typeof e!="string")return;let n=e.trim().replace(/^v/,""),t=n.search(/[-+]/);t>=0&&(n=n.slice(0,t));let r=[];for(let o of n.split(".")){if(!/^[+-]?\d+$/.test(o))return;let s=parseInt(o,10);if(s<0)return;r.push(s)}return r}function b(e,n){let t=y(e),r=y(n);if(!(!t||!r)){for(let o=0;o<Math.max(t.length,r.length);o++){let s=t[o]??0,i=r[o]??0;if(s!==i)return s<i?-1:1}return 0}}var G=(e,n)=>e<n?-1:e>n?1:0;function W(e,n,t,r,o,s=Date.now()){let i=t&&n!==null&&n!==void 0;if(e==="is_set")return i;if(e==="is_not_set")return!i;if(!i)return!1;switch(e){case"eq":case"neq":{let a;if(o){let u=b(n,r);if(u===void 0)return!1;a=u===0}else a=p(n,r);return a===(e==="eq")}case"contains":case"ncontains":case"regex":case"nregex":{if(typeof n!="string"||typeof r!="string")return!1;if(e==="contains"||e==="ncontains")return n.includes(r)===(e==="contains");let a;try{a=new RegExp(r)}catch{return!1}return a.test(n)===(e==="regex")}case"gt":case"gte":case"lt":case"lte":{let a;if(o)a=b(n,r);else{let u=g(n),l=g(r);a=u===void 0||l===void 0?void 0:G(u,l)}return a===void 0?!1:e==="gt"?a>0:e==="gte"?a>=0:e==="lt"?a<0:a<=0}case"in":case"not_in":return Array.isArray(r)?r.some(a=>p(n,a))===(e==="in"):!1}return e.startsWith("array_")||e.startsWith("ip_")?v(e,n,r,p):F(e,n,r,s,{toFloat:g,parseVersion:y,cmpVersion:b})}export{O as a,R as b,w as c,W as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as m}from"./chunk-
|
|
1
|
+
import{d as m}from"./chunk-EFNCQJI3.js";function d(e){return e.startsWith("re:")?e.slice(3):e.split("*").map(t=>t.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function k(e,t){return!!e?.some(r=>{try{return new RegExp(d(r),"i").test(t)}catch{return!1}})}function w(e,t){return e===!1||!e&&!t?null:{fps:f(e?e.fps??2:2,1,15),quality:f(e?e.quality??.4:.4,.05,1)}}var f=(e,t,r)=>Math.min(r,Math.max(t,e)),T=1e7;function G(e,t){if(t?.session_recording===!1)return null;let r=t?.replay??{},s=(o,i)=>e[o]??r[o]??i,a=[...r.mask_selectors??[],...t?.replay_mask_selectors??[],...e.mask_selectors??[]];return{sample_rate:e.sample_rate??r.sample_rate??t?.replay_sample_rate??1,min_duration_ms:e.min_duration_ms??r.min_duration_ms??t?.replay_min_duration_ms??0,min_duration_mode:e.min_duration_mode??r.min_duration_mode??t?.replay_min_duration_mode??"buffer",trigger:s("trigger",{mode:"always"}),trigger_groups:e.trigger_groups??r.trigger_groups??t?.replay_trigger_groups??[],include_urls:s("include_urls",[]),exclude_urls:[...s("exclude_urls",[]),...(t?.replay_url_blocklist??[]).map(d)],block_selectors:[...r.block_selectors??[],...t?.replay_block_selectors??[],...e.block_selectors??[]],mask_selectors:a,mask_all_inputs:e.mask_all_inputs??(t?.mask_all_inputs===!0||r.mask_all_inputs!==!1),mask_all_text:e.mask_all_text===!0||t?.replay_mask_all_text===!0||r.mask_all_text===!0||a.includes("*"),unmask_selectors:[...e.unmask_selectors??[]],url_privacy_rules:[...Array.isArray(t?.replay_url_privacy_rules)?t?.replay_url_privacy_rules:[],...e.url_privacy_rules??[]],buffer_ms:s("buffer_ms",6e4),flush_interval_ms:s("flush_interval_ms",5e3),idle_threshold_ms:Math.max(0,s("idle_threshold_ms",5*6e4)),chunk_bytes:Math.min(s("chunk_bytes",256*1024),T-16384),canvas:w(e.captureCanvas,t?.replay_capture_canvas===!0),maskInputOptions:e.maskInputOptions,maskInputFn:e.maskInputFn,maskTextFn:e.maskTextFn,maskUrlFn:e.maskUrlFn,crossOriginIframes:e.crossOriginIframes?.allowedOrigins.length?[...e.crossOriginIframes.allowedOrigins]:null,canvasMaskRegions:e.canvasMaskRegions,canvasMask:(Array.isArray(t?.replay_canvas_mask)?t.replay_canvas_mask:[]).filter(o=>typeof o?.selector=="string"),mutationThrottle:e.mutationThrottle===!1?null:{...e.mutationThrottle},assets:e.assets,console:e.console===!0,network:e.network?e.network:null}}var _=(e,t)=>{let r=t;try{let s=new URL(t,"http://x");r=s.pathname+s.search}catch{}return e.some(s=>{try{let a=new RegExp(s);return a.test(t)||a.test(r)}catch{return!1}})};function I(e,t,r){return!_(r,e)&&(!t.length||_(t,e))}function E(e){return e==="watchtower"?!1:e?!0:globalThis.__WATCHTOWER__?.replayActive!==!0}function C(e){let t=2166136261;for(let r of new TextEncoder().encode(e))t^=r,t=Math.imul(t,16777619)>>>0;return t>>>0}function O(e,t,r){return C(`${e}:${t}`)/4294967296<r}var M=(e,t)=>{let r=t[e.key];return e.variant===void 0?r!==void 0&&r!==!1&&r!=="false":r===e.variant},v=e=>!!e.events?.length||!!e.event_filters?.length;function A(e,t,r){return e.events?.includes(t)?!0:!!e.event_filters?.some(s=>s.event===t&&(s.properties??[]).every(a=>m(a.op,r?.[a.key],!!r&&Object.hasOwn(r,a.key),a.value,!1)))}var F=(e,t)=>e.flatMap(r=>{try{return[new RegExp(r)]}catch{return t("bad url pattern",r),[]}});function y(e){let t=[];return e.urls.length&&t.push(e.url),v(e.g)&&t.push(e.event),e.g.flag&&t.push(e.flag),t.length?e.g.match==="all"?t.every(Boolean):t.some(Boolean):!0}function U(e,t,r,s,a={}){let o=t.map(n=>({g:n,urls:F(n.url_patterns??[],e.log),url:!!a.url,event:!!a.event,flag:!!a.flag})),i=!1,c=!1,p=()=>{if(!(i||c)){for(let n of o)if(y(n)&&(a.sampling||O(r(),n.g.id,n.g.sample_rate??1))){i=!0,s(n.g);return}}};e.onCapture(n=>{let u=!1;for(let l of o)!l.event&&A(l.g,n.event,n.properties)&&(u=l.event=!0);u&&p()});let h=n=>{let u=!1;for(let l of o)l.g.flag&&!l.flag&&M(l.g.flag,n)&&(u=l.flag=!0);u&&p()},x=e.flags?.onChange(h),g=(n,u)=>o.some(n)?o.some(l=>n(l)&&u(l))?"activated":"pending":"disabled";return{checkUrl(n){let u=!1;for(let l of o)!l.url&&l.urls.some(R=>R.test(n))&&(u=l.url=!0);u&&p()},check:p,stop(){c=!0,x?.()},matched:()=>o.filter(y).map(n=>n.g.id),states:()=>({url:g(n=>n.urls.length>0,n=>n.url),event:g(n=>v(n.g),n=>n.event),flag:g(n=>!!n.g.flag,n=>n.flag)})}}var b=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim()!==""):[];function H(e){return Array.isArray(e)?e.filter(t=>!!t&&typeof t=="object"&&typeof t.url=="string").map(t=>({url:t.url,mask_all_text:t.mask_all_text===!0,mask_selectors:b(t.mask_selectors),block_selectors:b(t.block_selectors)})):[]}function K(e,t){let r=e.filter(i=>k([i.url],t)),s=r.some(i=>i.mask_all_text===!0),a=[...new Set(r.flatMap(i=>i.mask_selectors??[]))],o=[...new Set(r.flatMap(i=>i.block_selectors??[]))];return{maskAllText:s,mask:a,block:o,key:JSON.stringify([s,a,o])}}export{k as a,T as b,G as c,I as d,E as e,C as f,O as g,U as h,H as i,K as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T,b as a}from"./chunk-536QABLP.js";import"./chunk-EFNCQJI3.js";function C(e){if(e.gdprApplies===!1)return;let n=e.purpose?.consents??{},t=!!n[1]&&!!n[7];return{analytics:t,replay:t&&!!n[8],marketing:!!n[1]&&!!n[4]}}function m(e){let n=i=>i in e?e[i]==="granted":void 0,t={},r=n("analytics_storage");r!==void 0&&(t.analytics=t.replay=r);let o=n("ad_storage"),s=n("ad_user_data");return o!==void 0&&(t.marketing=o&&s!==!1),t}function g(e){let n=typeof e=="string"?e.split(","):e,t=n.includes("C0002");return{analytics:t,replay:t,marketing:n.includes("C0004")}}function y(e){return{analytics:!!e.statistics,replay:!!e.statistics,marketing:!!e.marketing}}function v(e){return{analytics:!!e.statistics,replay:!!e.statistics,marketing:!!e.marketing}}var E=e=>{let n,r=u(()=>{let o=window.__tcfapi;return typeof o!="function"?!1:(o("addEventListener",2,(s,i)=>{if(!i||s.eventStatus!=="tcloaded"&&s.eventStatus!=="useractioncomplete")return;n=s.listenerId;let c=C(s);c&&a(e,c,"tcf",{onlyIfChanged:!0})}),!0)});return()=>{r();let o=window.__tcfapi;n!==void 0&&typeof o=="function"&&o("removeEventListener",2,()=>{},n)}},O=e=>{let n=window,t=n.dataLayer??=[],r=s=>{let i=s;i&&typeof i=="object"&&i[0]==="consent"&&(i[1]==="default"||i[1]==="update")&&i[2]&&typeof i[2]=="object"&&a(e,m(i[2]),"gcm",{onlyIfChanged:!0})};t.forEach(r);let o=t.push;return t.push=function(...s){return s.forEach(r),o.apply(this,s)},()=>{t.push=o}},M=e=>{let n=o=>{(typeof o=="string"||Array.isArray(o))&&a(e,g(o),"onetrust",{onlyIfChanged:!0})},t=window,r=o=>n(o.detail??t.OnetrustActiveGroups);return window.addEventListener("OneTrustGroupsUpdated",r),n(t.OnetrustActiveGroups),()=>window.removeEventListener("OneTrustGroupsUpdated",r)},U=e=>{let n=window,t=()=>{let o=n.Cookiebot;o?.consent&&o.hasResponse!==!1&&a(e,y(o.consent),"cookiebot",{onlyIfChanged:!0})},r=["CookiebotOnConsentReady","CookiebotOnAccept","CookiebotOnDecline"];for(let o of r)window.addEventListener(o,t);return t(),()=>r.forEach(o=>window.removeEventListener(o,t))};function w(e){let n=e.ANALYTICS==="ACCEPT";return{analytics:n,replay:n,marketing:e.MARKETING==="ACCEPT"}}function u(e){if(e())return()=>{};let n=0,t=setInterval(()=>(e()||++n>40)&&clearInterval(t),250);return()=>clearInterval(t)}var p=["osano-cm-initialized","osano-cm-consent-saved","osano-cm-consent-changed"],I=e=>{let n,t=o=>{let s=o&&typeof o=="object"&&Object.keys(o).length?o:n?.getConsent?.();s&&Object.keys(s).length&&a(e,w(s),"osano",{onlyIfChanged:!0})},r=u(()=>{if(n=window.Osano?.cm,!n)return!1;for(let o of p)n.addEventListener?.(o,t);return t(n.getConsent?.()),!0});return()=>{r();for(let o of p)n?.removeEventListener?.(o,t)}};function k(e,n="Lucida"){let t=e.find(s=>s.name.toLowerCase()===n.toLowerCase());if(!t)return;let r=t.consent?.status===!0,o=e.filter(s=>s.categorySlug==="marketing");return{analytics:r,replay:r,marketing:o.length>0&&o.every(s=>s.consent?.status===!0)}}var f=["UC_UI_INITIALIZED","UC_UI_CMP_EVENT","ucEvent","UC_CONSENT"];function b(e="Lucida"){return n=>{let t=()=>{let i=window.UC_UI?.getServicesBaseInfo?.();if(!i)return!1;let c=k(i,e);return c?a(n,c,"usercentrics",{onlyIfChanged:!0}):n.log(`usercentrics: no service named "${e}"; consent left unchanged`),!0},r=()=>{t()};for(let s of f)window.addEventListener(s,r);let o=u(t);return()=>{o();for(let s of f)window.removeEventListener(s,r)}}}var x=b(),l=["CookieMunchOnConsentReady","CookieMunchOnChange"],d=e=>{let n=()=>{let t=window.CookieMunch;t?.consent&&t.hasResponse===!0&&a(e,v(t.consent),"cookiemunch",{onlyIfChanged:!0})};for(let t of l)window.addEventListener(t,n);return n(),()=>l.forEach(t=>window.removeEventListener(t,n))};var h=e=>{e.consentUi={showBanner:async n=>(await import("./banner-7LEREYUH.js")).showBanner(e,n),hideBanner:()=>{import("./banner-7LEREYUH.js").then(n=>n.hideBanner())}}};var N=e=>(h(e),d(e));export{T as CONSENT_EVENT,a as applyConsent,h as consentBanner,N as consentModule,d as cookieMunchConsent,v as cookieMunchToConsent,U as cookiebotConsent,y as cookiebotToConsent,O as gcmConsent,m as gcmToConsent,M as oneTrustConsent,g as oneTrustToConsent,I as osanoConsent,w as osanoToConsent,E as tcfConsent,C as tcfToConsent,b as usercentricsBridge,x as usercentricsConsent,k as usercentricsToConsent};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var Y="lc_consent";function he(n,e,t){return e==="opt_in"?"opt_in":t==="opt_in"||t==="opt_out"||t==="cookieless"?t:e==="opt_out"?n:void 0}var ge=["analytics","replay","marketing"],L=class{constructor(e){this.o=e;this.modeNow=e.mode??"opt_out",this.queueBeforeConsent=e.queueBeforeConsent??!1;let t=this.opens();this.state={analytics:t,replay:t,marketing:t},this.key=e.storageKey||Y;let s=e.storage.get(this.key);if(s)try{let o=JSON.parse(s);for(let i of ge)typeof o[i]=="boolean"&&(this.state[i]=o[i]);this.decided=ge.some(i=>typeof o[i]=="boolean")}catch{}this.waiting=!!e.awaitRemote&&!this.decided,this.waiting&&(this.state={analytics:!1,replay:!1,marketing:!1})}o;modeNow;queueBeforeConsent;state;decided=!1;waiting;geoCookieless=!1;key;listeners=[];opens(){return this.modeNow==="opt_out"&&!(this.o.respectDnt&&this.o.dnt)}get mode(){return this.modeNow}get resolving(){return this.waiting}get anonymous(){return this.geoCookieless&&!this.decided}resolve(e){if(!this.waiting)return this.state.analytics;this.waiting=!1,(e==="opt_in"||e==="opt_out")&&(this.modeNow=e),this.geoCookieless=e==="cookieless";let t=!this.geoCookieless&&this.opens();return this.state={analytics:t,replay:t,marketing:t},t}get(){return{...this.state}}has(e){return this.state[e]}status(e="analytics"){return this.decided?this.state[e]?"granted":"denied":"pending"}get pending(){return this.waiting||this.modeNow==="opt_in"&&!this.state.analytics}set(e){let t=this.get();for(let s of ge)e[s]!==void 0&&(this.state[s]=e[s]);this.decided=!0,this.waiting=!1,this.o.storage.set(this.key,JSON.stringify(this.state));for(let s of this.listeners)s(this.get(),t)}onChange(e){this.listeners.push(e)}},$=class{constructor(e,t){this.inner=e;this.allowed=t}inner;allowed;mem=new Map;get(e){return this.mem.has(e)?this.mem.get(e)??null:this.inner.get(e)}set(e,t){this.allowed()?this.inner.set(e,t):this.mem.set(e,t)}remove(e){this.allowed()?this.inner.remove(e):this.mem.set(e,null)}flushBuffered(){for(let[e,t]of this.mem)t===null?this.inner.remove(e):this.inner.set(e,t);this.mem.clear()}discardBuffered(){this.mem.clear()}};var J=0,R=0;function He(n){let e=new Uint8Array(n),t=globalThis.crypto;if(t?.getRandomValues)t.getRandomValues(e);else for(let s=0;s<n;s++)e[s]=Math.floor(Math.random()*256);return e}function C(n=Date.now()){if(n>J){J=n;let i=He(2);R=((i[0]??0)<<8|(i[1]??0))&1023}else R++,R>4095&&(J++,R=0);let e=He(8),t=new Uint8Array(16),s=J;t[0]=Math.floor(s/2**40)&255,t[1]=Math.floor(s/2**32)&255,t[2]=Math.floor(s/2**24)&255,t[3]=Math.floor(s/2**16)&255,t[4]=Math.floor(s/2**8)&255,t[5]=s&255,t[6]=112|R>>8,t[7]=R&255,t[8]=128|(e[0]??0)&63;for(let i=1;i<8;i++)t[8+i]=e[i]??0;let o=Array.from(t,i=>i.toString(16).padStart(2,"0")).join("");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}var We="lc_identity",Q=class{constructor(e,t,s=!1,o=!1){this.storage=e;this.cookieless=s;let i=e.get(We),a;try{a=i?JSON.parse(i):void 0}catch{a=void 0}if(a?.distinct_id)this.s=a;else if(s)this.s={distinct_id:"",anon_id:"",identified:!1};else{let d=t??C();this.s={distinct_id:d,anon_id:d,identified:o&&!!t},this.save()}}storage;cookieless;s;save(){this.storage.set(We,JSON.stringify(this.s))}get distinctId(){return this.s.distinct_id}get priorAnonId(){return this.s.identified&&this.s.anon_id&&this.s.anon_id!==this.s.distinct_id?this.s.anon_id:void 0}get isIdentified(){return this.s.identified}identify(e){if(!e||e===this.s.distinct_id)return e&&!this.s.identified&&(this.s.identified=!0,this.save()),{event:null};let t=this.s.distinct_id,s=!this.s.identified;return this.s={...this.s,distinct_id:e,identified:!0},this.save(),s&&t?{event:"$identify",anonDistinctId:t}:{event:"$identify"}}aliasProps(e,t){return{alias:e,distinct_id:t??this.s.distinct_id}}reset(e=!1){if(this.cookieless){this.s={distinct_id:"",anon_id:"",identified:!1};return}let t=e&&this.s.anon_id||C();this.s={distinct_id:t,anon_id:t,identified:!1},this.save()}};function F(n,e={}){let t=Math.min(e.maxMs??3e4,(e.baseMs??1e3)*2**n);return Math.round(t*(.5+.5*(e.random??Math.random)()))}function Ve(n){return n===0||n===408||n===429||n>=500}var X=class{constructor(e){this.o=e;this.flushAt=e.flushAt??20,this.intervalMs=e.flushIntervalMs??5e3,this.maxSize=e.maxQueueSize??1e3,this.maxRetries=e.maxRetries??5,this.batchMax=Math.max(1,Math.min(e.maxBatchSize??1e3,1e3))}o;items=[];timer;attempt=0;inflight;closed=!1;warned404=!1;flushAt;intervalMs;maxSize;maxRetries;batchMax;get size(){return this.items.length}enqueue(e){this.closed||(this.items.push(e),this.items.length>this.maxSize&&this.o.onDrop?.(this.items.splice(0,this.items.length-this.maxSize),"queue_full"),this.items.length>=this.flushAt?this.flush():this.arm(this.intervalMs))}arm(e){this.timer===void 0&&(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},e))}disarm(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}flush(e={}){if(this.disarm(),this.inflight)return this.inflight.then(()=>this.items.length?this.flush(e):void 0);if(!this.items.length)return Promise.resolve();let t=this.items.splice(0,this.batchMax),s=(this.o.clock??Date).now(),o=JSON.stringify({api_key:this.o.apiKey,batch:t,sent_at:new Date(s).toISOString()});this.o.log?.("send batch",t.length);let i=this.o.transport.send(this.o.url,o,e.beacon?{beacon:!0}:{}).then(a=>a,()=>({status:0,retryAfterMs:void 0})).then(a=>this.settle(t,a.status,!!e.beacon,a.retryAfterMs)).finally(()=>{this.inflight=void 0});return this.inflight=i,i}settle(e,t,s,o){if(t>=200&&t<300){this.attempt=0,this.items.length>=this.flushAt?this.flush():this.items.length&&this.arm(this.intervalMs);return}if(!Ve(t)||s||this.attempt>=this.maxRetries){t===404&&!this.warned404&&(this.warned404=!0,console.warn(`[lucida] ${this.o.url} returned 404, so events are being dropped. apiHost is probably wrong: use https://capture.lucidace.com (or your own capture host), not the app host.`)),this.o.onDrop?.(e,`status_${t}`),this.attempt=0;return}this.items.unshift(...e);let i=Math.max(F(this.attempt++,this.o.backoff),Math.min(o??0,6e4));this.o.log?.("retry in",i,"ms"),this.arm(i)}clear(){this.items=[],this.disarm()}async shutdown(){await this.flush(),this.closed=!0,this.disarm()}};var me="lc_session";function ze(n,e,t){return typeof n=="number"&&Number.isInteger(n)&&n>=e&&n<=t?n*6e4:void 0}var Tt=6e4,Mt=10*36e5,jt=24*36e5,Dt=/^([0-9a-f]{8})-?([0-9a-f]{4})-7[0-9a-f]{3}-/i;function Lt(n,e){let t=Dt.exec(n);if(!t)return!0;let s=parseInt(t[1]+t[2],16);return s-e<=6e4&&e-s<=jt}var Z=class{constructor(e,t={}){this.storage=e;this.o=t;this.idleMs=Math.min(Mt,Math.max(Tt,t.idleMs??30*6e4)),this.maxMs=t.maxMs??24*36e5,this.newOn=t.newOnEvents??[],this.clock=t.clock??{now:()=>Date.now()},this.bootstrapId=t.bootstrapId}storage;o;windowId=C();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=ze(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=ze(e.session_max_minutes,5,10080)??this.maxMs),this.o.newOnEvents===void 0&&Array.isArray(e.session_new_on_events)&&(this.newOn=e.session_new_on_events.filter(t=>typeof t=="string"&&t!==""))}read(){try{let e=this.storage.get(me);return e?JSON.parse(e):void 0}catch{return}}touch(e,t){let s=this.clock.now(),o=this.read(),i=!!(o?.campaign&&e&&o.campaign!==e),a=t!==void 0&&this.newOn.includes(t),d=!o||Math.abs(s-o.last)>this.idleMs||Math.abs(s-o.start)>this.maxMs||i||a;return(d||!o)&&(o={id:!o&&this.bootstrapId&&Lt(this.bootstrapId,s)?this.bootstrapId:C(s),start:s,last:s}),this.bootstrapId=void 0,o.last=s,e&&(o.campaign=e),this.storage.set(me,JSON.stringify(o)),{sessionId:o.id,windowId:this.windowId,isNew:d}}startedAt(){return this.read()?.start}reset(){this.storage.remove(me)}};function Ke(n,e){let t=n.get(e);if(t)try{return JSON.parse(t)}catch{return}}var ee=class{constructor(e,t="lc_props",s){this.storage=e;this.key=t;this.persist=s;this.p=Ke(e,t)??{}}storage;key;persist;p;save(){let e=this.persist;this.storage.set(this.key,JSON.stringify(e?Object.fromEntries(Object.entries(this.p).filter(([t])=>e(t))):this.p))}register(e){Object.assign(this.p,e),this.save()}registerOnce(e){for(let[t,s]of Object.entries(e))t in this.p||(this.p[t]=s);this.save()}unregister(e){delete this.p[e],this.save()}all(){return{...this.p}}clear(){this.p={},this.storage.remove(this.key)}},te=class{constructor(e){this.storage=e;this.g=Ke(e,"lc_groups")??{}}storage;g;set(e,t){this.g[e]=t,this.storage.set("lc_groups",JSON.stringify(this.g))}all(){return Object.keys(this.g).length?{...this.g}:void 0}clear(){this.g={},this.storage.remove("lc_groups")}};function Ft(n,e){let t=new Date(n??e);return(Number.isNaN(t.getTime())?new Date(e):t).toISOString()}var N=class{constructor(e){this.c=e;this.clock=e.clock??{now:()=>Date.now()},this.consent=new L({...e.consent,storage:e.consentStorage??e.storage}),this.gated=new $(e.storage,()=>this.consent.has("analytics")),this.storage=this.gated,this.identity=new Q(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new Z(this.gated,{clock:this.clock,...e.session}),this.props=new ee(this.gated,void 0,e.persistProperty),this.groupState=new te(this.gated),this.queue=new X({transport:e.transport,url:`${e.apiHost.replace(/\/+$/,"")}/v1/batch`,apiKey:e.apiKey,clock:this.clock,...e.log?{log:e.log}:{},...e.onDrop?{onDrop:e.onDrop}:{},...e.queue})}c;consent;identity;session;queue;storage;gated;props;groupState;clock;device;pre=[];listeners=[];captureListeners=[];sessionListeners=[];lastSession="";filter;get anonDistinctId(){return this.identity.priorAnonId}get distinctId(){return this.identity.distinctId}get deviceId(){return this.c.cookieless?"":(this.device||(this.device=this.gated.get("lc_device_id")||C(),this.gated.set("lc_device_id",this.device)),this.device)}get groups(){return this.groupState.all()}get sessionId(){return this.touchSession().sessionId}touchSession(e){let t=this.session.touch(this.c.campaignKey?.(),e);if(t.sessionId!==this.lastSession){this.lastSession=t.sessionId;for(let s of this.sessionListeners)s(t.sessionId,t.windowId)}return t}onSessionId(e){return this.sessionListeners.push(e),()=>{this.sessionListeners.splice(this.sessionListeners.indexOf(e),1)}}get sessionStart(){return this.session.startedAt()}getProperty(e){return this.props.all()[e]}setFilter(e){this.filter=e}onChange(e){this.listeners.push(e)}onCaptured(e){this.captureListeners.push(e)}emit(e){for(let t of this.listeners)t(e)}consentStatus(){return this.consent.status()}get anonymousOnReject(){return!!this.c.consent?.cookielessOnReject&&this.consent.status()==="denied"}capture(e,t={},s={}){let o=this.consent.has("analytics"),i=!o&&(this.anonymousOnReject||this.consent.anonymous),a=this.consent.pending&&(this.consent.queueBeforeConsent||this.consent.resolving);if(!o&&!i&&!a){this.c.log?.("dropped (no consent)",e);return}if(i&&(e==="$identify"||e==="$create_alias")){this.c.log?.("withheld (declined, anonymous mode)",e);return}let d=this.touchSession(e),p=this.c.enrich?.(e,t),h=this.consent.status()!=="pending",m=i?{}:{...p?.$set,...s.$set,...e==="$consent_updated"&&h?{$consent:this.consent.get()}:{}},_=i?{}:{...p?.$set_once,...s.$set_once},P=this.groupState.all(),g=i?"":this.identity.distinctId,v={uuid:C(this.clock.now()),event:e,...g?{distinct_id:g}:{},timestamp:Ft(s.timestamp,this.clock.now()),properties:{...this.props.all(),...p?.properties,...t,$session_id:d.sessionId,$window_id:d.windowId,$lib:this.c.library.name,$lib_version:this.c.library.version,...h?{$consent:this.consent.get()}:{}},...Object.keys(m).length?{$set:m}:{},...Object.keys(_).length?{$set_once:_}:{},...!i&&s.$unset?.length?{$unset:s.$unset}:{},...P?{$groups:P}:{}},b=this.filter?this.filter(v):v;if(!b){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,b),this.c.onCapture?.(b);for(let S of this.captureListeners)S(b);return o||i?this.queue.enqueue(b):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(b),b}identify(e,t,s){let o=this.identity.identify(e);(o.event||t||s)&&this.capture("$identify",o.anonDistinctId?{$anon_distinct_id:o.anonDistinctId}:{},{...t?{$set:t}:{},...s?{$set_once:s}:{}}),this.emit("identify")}alias(e,t){this.capture("$create_alias",this.identity.aliasProps(e,t))}reset(e={}){this.identity.reset(e.reuseAnonymousId),e.resetDeviceId&&(this.device=void 0,this.gated.remove("lc_device_id")),this.props.clear(),this.groupState.clear(),this.session.reset(),this.lastSession="",this.emit("reset")}register(e){this.props.register(e)}registerOnce(e){this.props.registerOnce(e)}unregister(e){this.props.unregister(e)}group(e,t,s){this.groupState.set(e,t),this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:s??{}}),this.emit("group")}getConsent(){return this.consent.get()}getConsentStatus(e="analytics"){return this.consent.status(e)}hasConsent(e){return this.consent.has(e)}setConsent(e){let t=this.consent.has("analytics"),s=e.analytics??t;if(t&&!s&&(this.capture("$opt_out"),this.queue.flush()),!t&&s&&(this.anonymousOnReject||this.consent.anonymous)&&this.queue.flush(),this.consent.set(e),!t&&s){this.gated.flushBuffered();for(let o of this.pre.splice(0))this.queue.enqueue(o);this.capture("$opt_in")}else t&&!s&&this.queue.clear();s||(this.pre.length=0),this.emit("consent")}applyRemote(e){this.session.configure(e),this.resolveConsent(he(this.consent.mode,e.consent_mode,e.consent_default))}resolveConsent(e){if(!this.consent.resolving)return;let t=this.consent.resolve(e),s=this.pre.splice(0);if(t){this.gated.flushBuffered();for(let o of s)this.queue.enqueue(o)}else if(this.consent.anonymous){this.gated.discardBuffered();for(let o of s){if(o.event==="$identify"||o.event==="$create_alias")continue;let i={...o};delete i.distinct_id,delete i.$set,delete i.$set_once,delete i.$unset,this.queue.enqueue(i)}}else this.consent.queueBeforeConsent&&this.pre.push(...s);this.emit("consent")}optIn(){this.setConsent({analytics:!0,replay:!0,marketing:!0})}optOut(){this.setConsent({analytics:!1,replay:!1,marketing:!1})}flush(e){return this.queue.flush(e)}shutdown(){return this.queue.shutdown()}};function Ge(n){let e="";return t=>{for(e+=t;;){let s=/\r?\n\r?\n/.exec(e);if(!s)return;let o=e.slice(0,s.index);e=e.slice(s.index+s[0].length);let i="message",a,d=[];for(let p of o.split(/\r?\n/)){if(p.startsWith(":"))continue;let h=p.indexOf(":"),[m,_]=h<0?[p,""]:[p.slice(0,h),p.slice(h+1).replace(/^ /,"")];m==="event"?i=_??"":m==="data"?d.push(_??""):m==="id"&&(a=_)}d.length&&n(a===void 0?{event:i,data:d.join(`
|
|
2
|
+
`)}:{event:i,data:d.join(`
|
|
3
|
+
`),id:a})}}}var ne=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;cursor=0;gen=0;polling=!1;start(){this.stopped&&(this.stopped=!1,this.loop(++this.gen))}stop(){this.stopped=!0,this.gen++,this.ctl?.abort(),this.timer&&clearTimeout(this.timer)}restart(){let e=!this.stopped;this.stop(),this.cursor=0,e&&this.start()}live(e){return!this.stopped&&e===this.gen}deliver(e){if(e.seq>this.cursor){this.cursor=e.seq;try{this.o.onIntervention(e)}catch(t){this.o.log?.("onIntervention threw",t)}}}url(e){let t=`distinct_id=${encodeURIComponent(this.o.distinctId())}${this.cursor?`&cursor=${this.cursor}`:""}`;return`${this.o.apiHost}${e}?${t}`}sleep(e){return new Promise(t=>{this.timer=setTimeout(t,e),this.timer.unref?.()})}async loop(e){let t=0;for(;this.live(e);){let s;try{let o=await this.connectOnce(e);if(o==="gone")return this.stop();o==="poll"?(t=0,s=this.o.pollMs??15e3):(o==="streamed"&&(t=0),s=F(t++,this.o.backoff))}catch(o){this.live(e)&&this.o.log?.("intervention stream error",o),s=F(t++,this.o.backoff)}if(!this.live(e))return;await this.sleep(s)}}async connectOnce(e){if(this.polling)return this.pollOnce(e);this.ctl=new AbortController;let t={Authorization:`Bearer ${this.o.apiKey}`,Accept:"text/event-stream"},s=await this.o.fetch(this.url("/v1/interventions/stream"),{headers:t,signal:this.ctl.signal});if(s.status===404)return"gone";if(!s.ok)return"failed";let o=s.body;if(!o||typeof TextDecoderStream>"u")return this.ctl.abort(),this.polling=!0,this.pollOnce(e);let i=Ge(d=>{if(!(d.event!=="intervention"||!this.live(e)))try{this.deliver(JSON.parse(d.data))}catch{this.o.log?.("bad intervention payload")}}),a=o.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:d,value:p}=await a.read();if(d)return"streamed";i(p)}}async pollOnce(e){this.ctl=new AbortController;let t=await this.o.fetch(this.url("/v1/interventions"),{headers:{Authorization:`Bearer ${this.o.apiKey}`},signal:this.ctl.signal});if(t.status===404)return"gone";if(!t.ok)return"failed";let s=await t.json();if(this.live(e))for(let o of s.data??[])this.deliver(o);return"poll"}};function ye(n,e){let t=new Set,{whenConsented:s,disabled:o,...i}=e,a=new ne({...i,distinctId:()=>n.distinctId,onIntervention:p=>{for(let h of[...t])h(p)}}),d=!1;return n.onChange(p=>{d&&((p==="identify"||p==="reset")&&a.restart(),p==="consent"&&(n.hasConsent("analytics")?a.start():a.stop()))}),{on(p){return t.add(p),!d&&!o&&(d=!0,s(()=>a.start())),()=>{t.delete(p)}},stop:()=>a.stop()}}function ve(n,e,t={}){let s=t.key??"lc_offline",o=t.maxBatches??50,i=t.maxBytes??1e6,a=t.isOnline??(()=>!0),d,p,h=()=>{try{let g=JSON.parse(e.get(s)??"[]");return Array.isArray(g)?g:[]}catch{return[]}},m=g=>{let v=g.reduce((b,S)=>b+S.body.length,0);for(;g.length>o||v>i&&g.length>1;)v-=g.shift().body.length;g.length?e.set(s,JSON.stringify(g)):e.remove(s)},_=g=>{m([...h(),...g]),d??=setTimeout(()=>{d=void 0,P.drain()},t.retryMs??3e4)},P={async send(g,v,b){if(!a())return _([{url:g,body:v}]),{status:200};let S=await n.send(g,v,b);return S.status!==0?S:(_([{url:g,body:v}]),{status:200})},drain(){return p??=(async()=>{let g=h();if(!g.length||!a())return;e.remove(s);let v=[];for(let[b,S]of g.entries())if((await n.send(S.url,S.body)).status===0){v.push(...g.slice(b));break}v.length&&_(v)})().finally(()=>{p=void 0}),p}};return P}function be(n){let e=Object.keys(n);if(e.length===0)return{};let t={};for(let s of e)t[`$feature/${s}`]=n[s];return t.$active_feature_flags=e.filter(s=>n[s]!==!1).sort(),t}function B(n,e,t,s){return{key:n,value:e,enabled:e!==void 0&&e!==!1,...typeof e=="string"?{variant:e}:{},...t!==void 0?{payload:t}:{},reason:e===void 0?"not_found":s}}var A={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},Nt=["resolved","unresolved","escalated","abandoned","error"],Bt=4e3,Ut=2e3,Je=["wrong","useless","not helpful","unhelpful","doesn't work","does not work","didn't help","did not help","not what i asked","that's not it","stupid","terrible","awful","frustrating","frustrated","annoying","worst","hate","incorrect","nonsense","confusing","makes no sense","real person","human agent","talk to a human","speak to a human","wtf","ugh"],Qe=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],H=n=>Array.from(n),Se=(n,e)=>H(n).slice(0,e).join(""),qt=0xcbf29ce484222325n,Ht=0x100000001b3n,Wt=0xffffffffffffffffn,Vt=new TextEncoder;function zt(n){let e=qt;for(let t of Vt.encode(n))e=(e^BigInt(t))*Ht&Wt;return e}function Xe(n){let e=(n.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(o=>H(o).length>=2);if(!e.length)return;let t=new Array(64).fill(0);for(let o of e){let i=zt(o);for(let a=0;a<64;a++)t[a]=(t[a]??0)+((i>>BigInt(a)&1n)===1n?1:-1)}let s=0n;for(let o=0;o<64;o++)(t[o]??0)>0&&(s|=1n<<BigInt(o));return s.toString(16).padStart(16,"0")}function Ze(n){let t=` ${n.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,s=0;for(let i of Je)t.includes(` ${i} `)&&(s++,t=t.split(` ${i} `).join(" "));let o=Qe.filter(i=>t.includes(` ${i} `)).length;return s>o?-1:o>s?1:0}var et=n=>H(n).filter(e=>e>="0"&&e<="9").map(Number);function Kt(n){let e=et(n);if(e.length<13||e.length>19)return!1;let t=0;return e.reverse().forEach((s,o)=>t+=o%2===1?s>4?s*2-9:s*2:s),t%10===0}var Ye=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,Gt=[[new RegExp(String.raw`(?<!${Ye})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${Ye})`,"gu"),Kt],[/[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/g,()=>!0],[/\+?\p{Nd}[\p{Nd}\s().-]{7,}\p{Nd}/gu,Yt]];function Yt(n){let e=et(n).length;return e>=10&&e<=15}var Jt=n=>H(n).map(e=>/\s/u.test(e)?e:"*").join("");function we(n){let e=n;for(let[t,s]of Gt)e=e.replace(t,o=>s(o)?Jt(o):o);return e===n?void 0:e}function tt(n){if(typeof n!="string")return;let e=n.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}var nt=n=>typeof n=="string"&&Nt.includes(n)?n:void 0,U=(n,e)=>typeof n=="string"&&n?Se(n,e):void 0;function Qt(n,e,t){let s=Se(e,t),o=we(s);return o===void 0?{[n]:s}:{[n]:o,$ai_text_redacted:!0}}function st(n,e,t,s){if(n!=="user"&&n!=="assistant")return;let o={$ai_role:n,$ai_message_index:t,$ai_text_length:H(e).length};if(n==="user"){let i=Xe(e);i!==void 0&&(o.$ai_text_hash=i),o.$ai_sentiment=Ze(e)}return s?{...o,...Qt("$ai_text",e,Bt)}:o}function ot(n,e){let t=n.value;if(n.kind==="thumbs"&&t!==1&&t!==-1||n.kind==="rating"&&!(Number.isInteger(t)&&t>=1&&t<=5)||n.kind!=="thumbs"&&n.kind!=="rating"&&n.kind!=="comment")return;let s={$ai_feedback_kind:n.kind};if(n.kind!=="comment"&&(s.$ai_feedback_value=t),n.comment&&e){let o=Se(n.comment,Ut);s.$ai_feedback_comment=we(o)??o}return n.messageIndex!==void 0&&(s.$ai_message_index=n.messageIndex),s}function _e(n,e){let t=nt(n),s=U(e,64);return{...t?{$ai_outcome:t}:{},...s?{$ai_resolution:s}:{}}}function Xt(){let n=globalThis.crypto,e=new Uint8Array(16);if(n?.getRandomValues)n.getRandomValues(e);else for(let s=0;s<16;s++)e[s]=Math.floor(Math.random()*256);e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function rt(n={}){let e={$ai_conversation_id:n.conversationId||Xt()},t=(s,o)=>{o!==void 0&&(e[s]=o)};return t("$ai_agent_name",U(n.agentName,128)),t("$ai_agent_version",U(n.agentVersion,64)),t("$ai_topic",U(n.topic,128)),t("$ai_use_case",U(n.useCase,128)),t("$ai_trace_id",tt(n.traceId)),e}var q=class{next=0;common;emit;captureText;constructor(e,t={},s=!1){this.emit=e,this.captureText=s,this.common=rt(t)}get id(){return this.common.$ai_conversation_id}send(e,t){this.emit(e,{...this.common,...t})}start(){return this.send(A.started,{}),this}message(e,t,s={}){let o=s.index??this.next,i=st(e,t,o,this.captureText);return i?(this.next=o+1,this.send(A.message,i),!0):!1}feedback(e){let t=ot(e,this.captureText);return t?(this.send(A.feedback,t),!0):!1}end(e,t){this.send(A.ended,_e(e,t))}outcome(e,t){let s=_e(e,t);return s.$ai_outcome?(this.send(A.outcome,s),!0):!1}};var Zt=["bot","crawl","spider","slurp","headlesschrome","phantomjs","puppeteer","playwright","lighthouse","pingdom","uptimerobot","facebookexternalhit","preview","scrapy","python-requests","go-http-client","cypress","lightpanda","hubspot","nessus","prerender","deepscan","screaming frog","sitebulb","turnitin","ia_archiver","chatgpt-user","app.hypefactors.com","google favicon","google web preview","-google","googleother","googleweblight","google-read-aloud","google-inspectiontool","google-hoteladsverifier","google-cloudvertexbot"];function it(n,e=[]){let t=n.toLowerCase();return e.some(s=>s&&t.includes(s.toLowerCase()))?!0:Zt.some(s=>t.includes(s))&&!/\bcubot\b/.test(t)}var O=["gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","igshid","msclkid","ttclid","li_fat_id","twclid","mc_cid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],at="lc_click_ids";function ct(n,e=90,t=Date.now){let s,o=()=>{try{return JSON.parse(n.get(at)??"{}")}catch{return{}}};return()=>{let i=o();if(location.search!==s){s=location.search;let d=new URLSearchParams(s),p=!1;for(let h of O){let m=d.get(h);m&&(i[h]={v:m.slice(0,512),t:t()},p=!0)}p&&n.set(at,JSON.stringify(i))}let a={};for(let d of O){let p=i[d];p&&t()-p.t<e*864e5&&(a[d]=p.v)}return a}}function en(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(n=>n.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(n=>n.getAttribute("content")??"")}function tn(n){let e=new Map;for(let s of n.split(";")){let[o,...i]=s.trim().toLowerCase().split(/\s+/);o&&!e.has(o)&&e.set(o,i)}let t=e.get("style-src-elem")??e.get("style-src")??e.get("default-src");return!!t&&!(t.includes("'unsafe-inline'")&&!t.some(s=>s.startsWith("'nonce-")||s.startsWith("'sha")))}function dt(n,e){if(typeof document>"u")return()=>{};!e&&en().some(tn)&&n("CSP hint: this page's Content-Security-Policy blocks inline <style>; set the `nonce` option so guides and the experiment veil render (docs/guides/csp.md)");let t=s=>{let o=s;/^style-src/.test(o.effectiveDirective??"")&&o.blockedURI==="inline"&&n(`CSP hint: an inline style was blocked by ${o.effectiveDirective}${e?" (check that `nonce` matches the page's nonce)":"; set the `nonce` option"}`)};return document.addEventListener("securitypolicyviolation",t),()=>document.removeEventListener("securitypolicyviolation",t)}var nn=(n,e)=>n.slice(0,e);function lt(n){try{let e=new URL(n);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return nn(n,64)}}function ut(n,e={}){if(typeof document>"u")return()=>{};let t=e.maxPerPage??20,s=new Set,o=i=>{let a=i,d={$csp_directive:a.effectiveDirective??a.violatedDirective,$csp_blocked_uri:lt(a.blockedURI??""),$csp_source_file:a.sourceFile?lt(a.sourceFile):void 0,$csp_line:a.lineNumber||void 0,$csp_column:a.columnNumber||void 0,$csp_disposition:a.disposition},p=[d.$csp_directive,d.$csp_blocked_uri,d.$csp_source_file,d.$csp_line].join("|");s.has(p)||s.size>=t||(s.add(p),n("$csp_violation",Object.fromEntries(Object.entries(d).filter(([,h])=>h!==void 0))))};return document.addEventListener("securitypolicyviolation",o),()=>document.removeEventListener("securitypolicyviolation",o)}var sn=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],pt=()=>typeof location<"u"&&sn.includes(location.protocol);function on(n,e,t){let s=e.find(a=>n.startsWith(`${a}/`));if(!s)return n;let o=n.slice(s.length),i=o.search(/[?#]/);return s+t(i<0?o:o.slice(0,i))+(i<0?"":o.slice(i))}function ft(n,e,t,s){if(!s)return{transport:n,fetch:e};let o=i=>on(i,t,s);return{transport:{send:(i,a,d)=>n.send(o(i),a,d)},fetch:((i,a)=>e(typeof i=="string"?o(i):i instanceof URL?o(i.href):i,a))}}var rn="__LUCIDA_DEVTOOLS_HOOK__";function gt(n,e,t){let s=globalThis[rn];if(!(!s||typeof s.emit!="function"||typeof s.attach!="function")){n.onCapture(o=>{try{s.emit(o)}catch{}});try{s.attach({projectKeyPrefix:n.apiKey.slice(0,8),apiHost:t,distinctId:()=>e.distinctId,loadToolbar:o=>e.loadToolbar(o),startReplay:async()=>n.replay?(await n.replay.start(!0),n.replay.isRecording()):!1,replayUrl:()=>e.getReplayUrl()})}catch{}}}var W=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function an(n){let e={},t=new URLSearchParams(location.search);for(let s of[...W,...O,...n]){let o=t.get(s);o&&(e[`$${s}`]=o)}return e}function ht(){let n=new URLSearchParams(location.search),e=W.map(t=>n.get(t)??"");return e.some(Boolean)?e.join("|"):void 0}function cn(n){try{return n?new URL(n).hostname:""}catch{return""}}var ln=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"");function dn(){let n=location.hash;return n.length>1?location.pathname+n.split("?")[0]:location.pathname}function mt(n,e,t=[],s=!1){let o={$current_url:ln(),$host:location.host,$pathname:s?dn():location.pathname,$referrer:document.referrer,$title:document.title,$screen_width:screen.width,$screen_height:screen.height,$viewport_width:window.innerWidth,$viewport_height:window.innerHeight,$browser_language:navigator.language,$timezone:Intl.DateTimeFormat().resolvedOptions().timeZone};if(navigator.maxTouchPoints>1&&(o.$touch_points=navigator.maxTouchPoints),n!=="$pageview")return{properties:o};let i=an(t);Object.assign(o,i);let a=e.$current_url??location.href,d=e.$referrer??document.referrer,p={$initial_referrer:d||"$direct",$initial_referring_domain:cn(d)||"$direct",$initial_current_url:a};for(let[h,m]of Object.entries(i))p[`$initial_${h.slice(1)}`]=m;return{properties:o,$set_once:p}}function yt(n,e,t=globalThis){e&&(t[typeof e=="string"?e:"lucida"]=n,typeof CustomEvent=="function"&&t.dispatchEvent?.(new CustomEvent("lucida:ready",{detail:n})))}var T=()=>{},ke=()=>Promise.resolve(),vt={isInternal:!1,hasOptedOut:()=>!1,hasOptedIn:()=>!1,consentStatus:()=>"pending",getConsentStatus:()=>"pending",getConsent:()=>({analytics:!1,replay:!1,marketing:!1}),getAllFlags:()=>({}),isFeatureEnabled:()=>!1,getFlagResult:n=>B(n,void 0,void 0,"not_found"),getReplayUrl:()=>"",onSessionId:()=>T,onFlags:()=>T,onIntervention:()=>T,onConsent:()=>T,flush:ke,shutdown:ke,reloadFlags:ke,loadToolbar:()=>Promise.resolve(!1),recommendations:n=>Promise.resolve({placement:n,strategy:"",items:[],shown:T,clicked:T})};function bt(n){return new Proxy(()=>{},{get:(e,t)=>{if(!(typeof t!="string"||t==="then"))return n&&Object.hasOwn(vt,t)?vt[t]:bt(!1)}})}var _t=()=>bt(!0);var St="_lcid";var un=(n,e)=>e.some(t=>{let s=t.replace(/^\./,"").toLowerCase();return n.toLowerCase()===s||n.toLowerCase().endsWith(`.${s}`)});function pn(n,e=Date.now()){let t=n.lastIndexOf("."),[s="",o]=n.slice(t+1).split("_",2),i=/^[0-9a-z]+$/.test(s)?parseInt(s,36):NaN,a=n.slice(0,t);if(t>0&&a.length<=200&&i<=e+5e3&&e-i<=12e4)return o&&/^[\w-]{1,64}$/.test(o)?{distinctId:a,sessionId:o}:{distinctId:a}}function wt(n){if(!n?.length)return;let e=new URL(location.href),t=e.searchParams.get(St);if(t!==null){e.searchParams.delete(St),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!un(new URL(document.referrer).hostname,n))return}catch{return}return pn(t)}}function kt(n,e=Date.now){let t=n.eventsPerSecond??10,s=n.burst??100,o=s,i=e();return()=>{let a=e();return o=Math.min(s,o+(a-i)/1e3*t),i=a,o<1?!1:(o-=1,!0)}}var xe="<masked>",fn=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],gn=["$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],xt=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function hn(n,e){let t=n,s=[...fn,...e.maskParams??[],...e.maskCampaignParams?[...W,...O]:[]];if(s.length){let o=t.indexOf("#"),i=o<0?t:t.slice(0,o),a=o<0?"":t.slice(o);t=i.replace(new RegExp(`([?&])(${s.map(xt).join("|")})=[^&]*`,"gi"),`$1$2=${xe}`)+a}return e.stripHash&&(t=t.replace(/#.*$/,"")),t}function Ct(n){let e=new RegExp(`^\\$(initial_|last_)?(${[...W,...O].map(xt).join("|")})$`),t=s=>{let o;if(n.maskCampaignParams)for(let[i,a]of Object.entries(s))typeof a=="string"&&e.test(i)?(o??={...s})[i]=xe:i==="$click_ids"&&a&&typeof a=="object"&&((o??={...s})[i]=Object.fromEntries(Object.keys(a).map(d=>[d,xe])));for(let i of gn){let a=(o??s)[i];if(typeof a!="string")continue;let d=hn(a,n);d!==a&&((o??={...s})[i]=d)}return o??s};return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}function mn(n,e,t){let s=e;for(let o of n)try{let i=o(s);if(i==null)return null;if(typeof i!="object"||typeof i.event!="string")return t("beforeSend hook returned a non-event, dropping:",typeof i),null;s=i}catch(i){return t("beforeSend hook threw, dropping event:",i),null}return s}function yn(n,e=Math.random){return t=>n>=1?t:n<=0||e()>=n?null:{...t,properties:{...t.properties,$sample_rate:n}}}function vn(n){let e=new Set(n),t=s=>Object.fromEntries(Object.entries(s).filter(([o])=>!e.has(o)));return s=>({...s,properties:t(s.properties),...s.$set?{$set:t(s.$set)}:{},...s.$set_once?{$set_once:t(s.$set_once)}:{}})}var Ce="lc_person_identified",se="lc_pending_set_once",Pt=new Set(["$identify","$create_alias","$groupidentify"]),$t="$$client_ingestion_warning",bn=6e4,Pe=class{constructor(e,t){this.mode=e;this.storage=t;this.identified=t.get(Ce)==="1";try{this.pending=JSON.parse(t.get(se)??"{}")}catch{this.pending={}}}mode;storage;identified;pending;get blocksPersonWrites(){return this.mode==="never"}get isProfile(){return this.mode==="always"||this.mode==="identified_only"&&this.identified}markIdentified(){this.mode!=="identified_only"||this.identified||(this.identified=!0,this.storage.set(Ce,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!Pt.has(e)}stash(e){if(this.mode!=="identified_only"||!e)return;let t=Object.entries(e).filter(([s])=>!(s in this.pending));t.length&&(this.pending={...this.pending,...Object.fromEntries(t)},this.storage.set(se,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(se),e}reset(){this.identified=!1,this.pending={},this.storage.remove(Ce),this.storage.remove(se)}};function _n(n,e){let t=e,s;if(n.person.personless(e.event)){n.person.stash(e.$set_once);let{$set:i,$set_once:a,$unset:d,...p}=e;t={...p,properties:{...e.properties,$process_person_profile:!1}}}else(s=n.person.take())&&(t={...e,$set_once:{...e.$set_once,...s}});let o=n.hooks.length?mn(n.hooks,t,n.log):t;return o&&n.limit&&!n.limit()&&(n.log("rate limited, dropped",o.event),n.onLimited?.(),o=null),!o&&s&&n.person.stash(s),o}function Sn(n){let e=n.beforeSend?Array.isArray(n.beforeSend)?n.beforeSend:[n.beforeSend]:[];return[Ct(n.urlPrivacy??{}),...n.propertyDenylist?.length?[vn(n.propertyDenylist)]:[],...n.sampleRate!==void 0?[yn(n.sampleRate)]:[],...e]}function It(n,e,t,s=Date.now){let o=new Pe(e.personProfiles??"always",n.storage),i,a,d=0,p=-1/0,h=()=>{d+=1,!(s()-p<bn)&&(p=s(),queueMicrotask(()=>{let m=d;d=0,n.capture($t,{$$client_ingestion_warning_message:`client rate limit dropped ${m} event(s)`,$dropped_count:m})}))};return n.setFilter(m=>(e.rateLimit!==i&&(i=e.rateLimit,a=i?kt(i):void 0),_n({hooks:Sn(e),person:o,limit:m.event===$t?void 0:a,log:t,onLimited:h},m))),o}var $e=class{m=new Map;get(e){return this.m.get(e)??null}set(e,t){this.m.set(e,t)}remove(e){this.m.delete(e)}},wn=365,kn=new Set("co.uk org.uk ac.uk gov.uk me.uk ltd.uk plc.uk net.uk com.au net.au org.au edu.au gov.au co.nz org.nz net.nz co.jp ne.jp or.jp ac.jp go.jp co.kr or.kr com.cn net.cn org.cn com.hk com.tw com.sg com.my co.in net.in org.in co.id co.th com.ph com.vn com.br net.br org.br com.ar com.mx com.co com.pe com.tr com.ua com.pl co.za co.il com.eg com.sa com.ng co.ke github.io gitlab.io vercel.app netlify.app herokuapp.com pages.dev workers.dev web.app firebaseapp.com azurewebsites.net cloudfront.net appspot.com onrender.com fly.dev glitch.me repl.co blogspot.com wordpress.com myshopify.com vercel.dev netlify.com surge.sh render.com railway.app koyeb.app deno.dev ngrok.io ngrok-free.app trycloudflare.com cloudfunctions.net run.app s3.amazonaws.com elasticbeanstalk.com azurestaticapps.net wixsite.com webflow.io framer.app bubbleapps.io".split(" ")),xn=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function Cn(n){let e=n.toLowerCase().split(".");for(let t=1;t<e.length-1;t++)if(kn.has(e.slice(t).join("."))||t===e.length-2&&e[t+1].length===2&&xn.has(e[t]))return e.slice(t-1).join(".")}function Pn(n=location.hostname){if(/^[\d.]+$/.test(n)||n.includes(":"))return;let e=n.split(".");for(let t=e.length-2;t>=0;t--){let s=e.slice(t).join(".");if(document.cookie=`__lc_probe=1; Domain=${s}; Path=/; Max-Age=10; SameSite=Lax`,document.cookie.includes("__lc_probe=1"))return document.cookie=`__lc_probe=; Domain=${s}; Path=/; Max-Age=0`,s}return Cn(n)}var oe=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?Pn():void 0)}catch{this.domain=void 0}return this.domain?`; Domain=${this.domain}`:""}held=new Map;read(e){try{for(let t of document.cookie.split("; ")){let s=t.indexOf("=");if(t.slice(0,s)===e)return decodeURIComponent(t.slice(s+1))}}catch{}return null}get(e){return this.read(e)??this.held.get(e)??null}set(e,t){let s=this.o.secure??location.protocol==="https:"?"; Secure":"",o=Math.round((this.o.expiryDays??wn)*86400);try{document.cookie=`${e}=${encodeURIComponent(t)}; Max-Age=${o}; Path=/${this.attr()}; SameSite=Lax${s}`}catch{}this.read(e)===t?this.held.delete(e):this.held.set(e,t)}remove(e){this.held.delete(e);try{document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}catch{}}},M=class{constructor(e="localStorage"){this.kind=e}kind;store(){try{return globalThis[this.kind]}catch{return}}get(e){try{return this.store()?.getItem(e)??null}catch{return null}}set(e,t){try{this.store()?.setItem(e,t)}catch{}}remove(e){try{this.store()?.removeItem(e)}catch{}}},Ie=class extends M{constructor(){super("localStorage")}},$n=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Oe=class{constructor(e,t,s){this.cookie=e;this.local=t;this.cookieKeys=s}cookie;local;cookieKeys;get(e){let[t,s]=this.cookieKeys(e)?[this.cookie,this.local]:[this.local,this.cookie];return t.get(e)??s.get(e)}set(e,t){this.local.set(e,t),this.cookieKeys(e)?this.cookie.set(e,t):this.cookie.remove(e)}remove(e){this.local.remove(e),this.cookie.remove(e)}},re=class{constructor(e,t){this.inner=e;this.delayMs=t}inner;delayMs;pending=new Map;timer;get(e){return this.pending.has(e)?this.pending.get(e)??null:this.inner.get(e)}set(e,t){this.queue(e,t)}remove(e){this.queue(e,null)}queue(e,t){this.pending.set(e,t),this.timer??=setTimeout(()=>this.flush(),this.delayMs)}flush(){clearTimeout(this.timer),this.timer=void 0;for(let[e,t]of this.pending)t===null?this.inner.remove(e):this.inner.set(e,t);this.pending.clear()}},Ee=class{constructor(e,t){this.inner=e;this.suffix=t}inner;suffix;get(e){return this.inner.get(e+this.suffix)}set(e,t){this.inner.set(e+this.suffix,t)}remove(e){this.inner.remove(e+this.suffix)}},ie=n=>`_${n.replace(/\W/g,"").slice(-8)}`;function ae(n,e,t){if(n==="memory"||n==="none")return new $e;let s=ie(e),o=n==="cookie"?new oe(t):n==="localStorage+cookie"?new Oe(new oe(t),new Ie,i=>$n.some(a=>i===a+s)):new M(n);return new Ee(o,s)}function Ot(n,e,t){let s=ie(e),o=new Set;try{for(let i of document.cookie.split("; "))o.add(i.split("=")[0]);for(let i of[globalThis.localStorage,globalThis.sessionStorage])for(let a=0;a<i.length;a++)o.add(i.key(a))}catch{}for(let i of o)if(!(!i.startsWith("lc_")||!i.endsWith(s)||i===t+s)){n.remove(i.slice(0,-s.length));try{localStorage.removeItem(i),sessionStorage.removeItem(i)}catch{}}}async function In(n){if(!(typeof CompressionStream>"u"||typeof Response>"u"))try{let e=new Response(n).body?.pipeThrough(new CompressionStream("gzip"));return e?new Uint8Array(await new Response(e).arrayBuffer()):void 0}catch{return}}function Et(n,e={}){let t=e.compress??!0,s=(o,i)=>(e.onError?.({url:o,status:i}),{status:i});return{async send(o,i,a){if(a?.beacon&&!e.disableBeacon&&typeof navigator<"u"&&navigator.sendBeacon)return navigator.sendBeacon(o,new Blob([i],{type:"text/plain"}))?{status:200}:s(o,0);try{let d=t&&i.length>=1024?await In(i):void 0,p=await n(d?`${o}${o.includes("?")?"&":"?"}compression=gzip`:o,{method:"POST",body:d??i,headers:{...e.headers,"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:(d?.length??i.length)<6e4});return p.status>=400?s(o,p.status):{status:p.status}}catch{return s(o,0)}}}}var Re={send:async()=>({status:200})};var On="lucida-browser",En="0.1.6",Ae="lc_internal",Rn=3e3,Rt="https://capture.lucidace.com",Te=n=>!!n&&typeof n=="object"&&Object.getPrototypeOf(n)===Object.prototype;function Me(n,e={},t=[]){if(typeof window>"u"||typeof navigator>"u")return _t();let s=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),o=(...r)=>{s&&console.debug("[lucida]",...r)},i=(e.apiHost??Rt).replace(/\/+$/,""),a=Object.fromEntries(Object.entries(e).map(([r,c])=>[r,Te(c)?{...c}:c]));a.apiHost=i;let d=e.extension??pt(),p=r=>d&&(r==="cookie"||r==="localStorage+cookie")?e.extensionPersistence??"localStorage":r,h=p(e.cookieless==="always"?"none":e.persistence??"cookie"),m=[i,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],_=e.fetch??((...r)=>fetch(...r)),P=r=>ft(r,_,m,e.rewritePath),g=P(Re).fetch,v=e.consent?.respectDnt,b=navigator.globalPrivacyControl===!0,S=(e.respectDnt??v)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??v)===!0&&b,je=e.blockBots!==!1&&typeof navigator<"u"&&it(navigator.userAgent??"",e.blockedUserAgents),k=!!e.disabled||je;je&&o("bot user agent: capture disabled");let ce,le=P(e.transport??Et(_,{headers:a.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&h!=="memory"&&h!=="none"){let r=new $(new M(h==="sessionStorage"?"sessionStorage":"localStorage"),()=>l.hasConsent("analytics"));le=ce=ve(le,r,{key:`lc_offline${ie(n)}`,isOnline:()=>navigator.onLine!==!1})}let V=k?void 0:wt(e.crossDomains),de=ae(k?"memory":h,n,e.cookie),z=(e.storageWriteDelayMs??0)>0?new re(de,e.storageWriteDelayMs):void 0,De=V?.sessionId??e.bootstrap?.sessionId,ue,K=!1,Le,pe=[],l=new N({apiKey:n,apiHost:i,transport:k?Re:le,storage:z??de,...e.consentPersistence&&!k?{consentStorage:ae(p(e.consentPersistence),n,e.cookie)}:{},persistProperty:r=>!a.persistedProperties||a.persistedProperties.includes(r),...h==="none"?{cookieless:!0}:{},library:{name:On,version:En},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...!k&&(e.consent?.geo||e.consent?.mode!=="opt_in")?{awaitRemote:!0}:{},respectDnt:!0,dnt:S},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...V||e.bootstrap?.distinctId?{bootstrapDistinctId:V?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!V?{bootstrapIdentified:!0}:{},session:{...e.session,...De?{bootstrapId:De}:{}},enrich:(r,c)=>{let u=mt(r,c,a.customCampaignParams,e.capturePageview==="hash");if(i!==Rt&&(u.properties={...u.properties,$lib_custom_api_host:i}),pe.length){let I=l.sessionId;for(let At of pe)u.properties={...u.properties,...At(I)}}let y=Le?.()??{},w=Object.keys(y);return w.length&&(u.properties={...u.properties,$click_ids:y},r==="$pageview"&&(u.$set_once={...Object.fromEntries(w.map(I=>[`$initial_${I}`,y[I]])),...u.$set_once},u.$set=Object.fromEntries(w.map(I=>[`$last_${I}`,y[I]])))),a.sendFeatureFlags!==!1&&r!=="$snapshot"&&ue&&(u.properties={...be(ue.all()),...u.properties}),K?{...u,properties:{...u.properties,$internal:!0}}:u},campaignKey:ht,log:o});K=l.storage.get(Ae)==="1",e.clickIds!==!1&&(Le=ct(l.storage,e.clickIds?.expiryDays));let x=It(l,a,o);e.bootstrap?.isIdentified&&x.markIdentified();let j=r=>x.blocksPersonWrites?(o(`personProfiles=never: ${r} ignored`),!0):!1;k||l.onChange(r=>{r!=="consent"||l.hasConsent("analytics")||l.consentStatus()!=="denied"||(z?.flush(),Ot(de,n,e.consent?.storageKey||Y))});let fe=new Set;l.onChange(r=>{r==="consent"&&[...fe].forEach(c=>c())});let Fe=[],E=[dt(o,e.nonce)],Ne=l.storage;if(e.flagPersistence&&!k){let r=new $(ae(p(e.flagPersistence),n,e.cookie),()=>l.hasConsent("analytics"));l.onChange(c=>{c==="consent"&&(l.hasConsent("analytics")?r.flushBuffered():r.discardBuffered())}),Ne=r}let G=r=>{if(k)return;if(l.hasConsent("analytics"))return r();let c=!1;l.onChange(u=>{!c&&u==="consent"&&l.hasConsent("analytics")&&(c=!0,r())})},Be,f={core:l,client:void 0,config:a,flagStorage:Ne,apiKey:n,log:o,fetch:g,onUnload:r=>{Fe.push(r)},whenConsented:G,onCapture:r=>l.onCaptured(r),eventExtras:pe,clickExtras:[],flagPersonProps:[],loadConfig:()=>Be??=new Promise(r=>G(()=>{g(`${i}/v1/config?api_key=${encodeURIComponent(n)}`).then(c=>c.ok?c.json():null).then(c=>(c&&l.applyRemote(c),c)).then(r,()=>r(null))}))},Ue=Promise.resolve();if(l.consent.resolving){let r=!1,c=g(`${i}/v1/config?api_key=${encodeURIComponent(n)}`,{credentials:"omit"}).then(u=>(r=u.status>=500,u.ok?u.json():null)).catch(()=>(r=!0,null));Be=c,Ue=new Promise(u=>{let y=setTimeout(()=>(l.resolveConsent("opt_in"),u()),Rn);c.then(w=>{clearTimeout(y),w?l.applyRemote(w):r?l.resolveConsent("opt_in"):l.applyRemote({}),u()})})}let qe=ye(l,{apiHost:i,apiKey:n,fetch:g,whenConsented:G,log:o,disabled:k});E.push(()=>qe.stop());let D={get distinctId(){return l.distinctId},capture:(r,c,u)=>{l.capture(r,c,u?.timestamp!==void 0?{timestamp:u.timestamp}:{})&&(u?.sendInstantly||u?.transport)&&l.flush(u.transport==="beacon"?{beacon:!0}:{})},identify:(r,c,u)=>{j("identify")||(x.markIdentified(),l.identify(r,c,u))},alias:(r,c)=>{j("alias")||(x.markIdentified(),l.alias(r,c))},reset:r=>{l.reset({resetDeviceId:!!r,reuseAnonymousId:!!e.reuseAnonymousId}),x.reset()},createPersonProfile:()=>{j("createPersonProfile")||x.isProfile||(x.markIdentified(),l.capture("$set",{}))},setConfig:r=>{let c=a;for(let[u,y]of Object.entries(r)){let w=c[u];Te(w)&&Te(y)?Object.assign(w,y):c[u]=y}"debug"in r&&(s=!!r.debug)},setPersonProperties:(r,c)=>{!r&&!c||j("setPersonProperties")||(x.markIdentified(),l.capture("$set",{},{...r?{$set:r}:{},...c?{$set_once:c}:{}}))},unsetPersonProperties:r=>{!r.length||j("unsetPersonProperties")||(x.markIdentified(),l.capture("$set",{},{$unset:r}))},getDistinctId:()=>l.distinctId,getSessionId:()=>l.sessionId,onSessionId:r=>l.onSessionId(c=>r(c)),getProperty:r=>l.getProperty(r),hasOptedOut:()=>l.consentStatus()==="denied",hasOptedIn:()=>l.consentStatus()==="granted",onConsent:r=>(fe.add(r),()=>{fe.delete(r)}),getReplayUrl:r=>{let u=`${(e.uiHost??i).replace(/\/+$/,"")}/replays/${encodeURIComponent(l.sessionId)}`,y=l.sessionStart;return!r?.withTimestamp||y===void 0?u:`${u}?t=${Math.max(0,Math.round((Date.now()-y)/1e3-(r.timestampLookBackSeconds??10)))}`},debug:(r=!0)=>{s=r},featureView:(r,c)=>{l.capture("$feature_view",{...c,$feature_flag:r},{$set:{[`$feature_view/${r}`]:!0}})},featureInteraction:(r,c)=>{l.capture("$feature_interaction",{...c,$feature_flag:r},{$set:{[`$feature_interaction/${r}`]:!0}})},updateFlags:(r,c,u)=>f.flags?.update(r,c,u?.merge??!0),register:r=>l.register(r),registerOnce:r=>l.registerOnce(r),unregister:r=>l.unregister(r),group:(r,c,u)=>{x.markIdentified(),l.group(r,c,u)},optIn:(r=["analytics","replay"])=>l.setConsent({analytics:r.includes("analytics"),replay:r.includes("replay"),marketing:r.includes("marketing")}),optOut:()=>l.optOut(),optOutInternal:(r=!0)=>{K=r,r?l.storage.set(Ae,"1"):l.storage.remove(Ae)},get isInternal(){return K},setConsent:r=>l.setConsent(r),getConsent:()=>l.getConsent(),getConsentStatus:r=>l.getConsentStatus(r),consentStatus:()=>l.consentStatus(),getFlag:r=>f.flags?.get(r),getFlagPayload:r=>f.flags?.payload(r),getFlagResult:(r,c)=>f.flags?.result(r,c)??B(r,void 0,void 0,"not_found"),getLayerParam:(r,c,u)=>f.flags?.layerParam(r,c)??u,isFeatureEnabled:r=>{let c=f.flags?.get(r);return c!==void 0&&c!==!1},onFlags:r=>f.flags?.onChange(r)??(()=>{}),onIntervention:r=>qe.on(r),reloadFlags:()=>f.flags?.reload()??Promise.resolve(),getAllFlags:()=>f.flags?.all()??{},overrideFlags:(r,c)=>f.flags?.override(r,c),setPersonPropertiesForFlags:(r,c)=>f.flags?.setPersonProperties(r,c),resetPersonPropertiesForFlags:()=>f.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(r,c)=>f.flags?.setGroupProperties(r,c),resetGroupPropertiesForFlags:()=>f.flags?.resetGroupProperties(),setContext:(r,c,u)=>f.flags?.setContext(r,c,u),clearContext:r=>f.flags?.clearContext(r),guides:{showChangelog:()=>f.guides?.showChangelog()??0,show:r=>f.guides?.show(r)??!1,reset:r=>f.guides?.reset(r)},ai:{startConversation:r=>new q((c,u)=>D.capture(c,u),r,a.ai?.captureText===!0).start()},earlyAccess:{list:()=>f.earlyAccess?.list()??Promise.resolve([]),optIn:r=>f.earlyAccess?.optIn(r),optOut:r=>f.earlyAccess?.optOut(r)},replay:{start:r=>f.replay?.start(r)??Promise.resolve(),stop:()=>f.replay?.stop(),pause:()=>f.replay?.pause(),resume:()=>f.replay?.resume(),tag:r=>f.replay?.tag(r),isRecording:()=>f.replay?.isRecording()??!1},consent:{showBanner:r=>f.consentUi?.showBanner(r)??Promise.resolve(null),hideBanner:()=>f.consentUi?.hideBanner()},loadToolbar:r=>f.toolbar?.load(typeof r=="string"?r:r.token)??Promise.resolve(!1),activateExperiment:r=>f.experiments?.activate(r),recommendations:(r,c)=>f.recs?.get(r,c)??Promise.resolve({placement:r,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>Ue.then(()=>l.flush()),shutdown:async()=>{for(let r of E)r();z?.flush(),await l.shutdown()}};if(f.client=D,!k){let r=()=>{for(let u of Fe)u();z?.flush(),l.flush({beacon:!0})};window.addEventListener("pagehide",r);let c=()=>{document.visibilityState==="hidden"&&l.flush({beacon:!0})};if(document.addEventListener("visibilitychange",c),E.push(()=>{window.removeEventListener("pagehide",r),document.removeEventListener("visibilitychange",c)}),ce){let u=()=>{ce.drain()};window.addEventListener("online",u),E.push(()=>window.removeEventListener("online",u)),G(u)}if(e.captureCspViolations){let u=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};E.push(ut((y,w)=>{l.capture(y,w)},u))}for(let u of t){let y=u(f);y&&E.push(y)}ue=f.flags,t.length||f.loadConfig(),gt(f,D,i)}return yt(D,e.exposeGlobal),o("initialised",{apiHost:i,consent:l.getConsent()}),D}function Qs(n,e={}){return Me(n,e)}export{Me as createClient,Qs as init};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function d(n){let o=window.fetch;window.fetch=function(r,s){let i=r instanceof Request?r.url:String(r),a=new Headers(s?.headers??(r instanceof Request?r.headers:void 0)),f=[...a.entries()].join("|");return n(i,a),[...a.entries()].join("|")===f?o.call(this,r,s):o.call(this,r,{...s,headers:a})};let t=XMLHttpRequest.prototype,{open:e,send:c}=t,u=new WeakMap;return t.open=function(r,s,...i){return u.set(this,String(s)),e.call(this,r,s,...i)},t.send=function(r){let s=u.get(this);if(s){let i=new Headers;n(s,i),i.forEach((a,f)=>this.setRequestHeader(f,a))}return c.call(this,r)},()=>{window.fetch=o,t.open=e,t.send=c}}var l="lucida.session_id";function p(n,o){return[...(n??"").split(",").map(e=>e.trim()).filter(e=>e&&!e.startsWith(`${l}=`)),`${l}=${encodeURIComponent(o)}`].join(",")}function g(n,o=[]){let t;try{t=new URL(n,location.href)}catch{return!1}return t.origin===location.origin||o.some(e=>typeof e=="string"?t.origin===e:e.test(t.href))}var q=n=>{let o=n.config.watchtower,{core:t}=n,e=h(n);if(!o?.correlate)return e;let c=t.sessionId;n.onCapture(s=>c=String(s.properties.$session_id??c));let u=s=>t.hasConsent("analytics")&&!s.startsWith(n.config.apiHost)&&g(s,o.origins),r=d((s,i)=>{u(s)&&i.set("baggage",p(i.get("baggage"),c))});return()=>(r(),e?.())};function h(n){let o=n.config.watchtower?.client??globalThis.watchtower;if(typeof o?.setAttribute!="function")return;let{core:t}=n,e=c=>{t.hasConsent("analytics")&&o.setAttribute(l,c)};return n.whenConsented(()=>e(t.sessionId)),t.onSessionId(e)}export{g as correlatable,q as correlate,h as stampSession,p as withBaggage};
|