@lucida-analytics/browser 0.1.12 → 0.1.13
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/CHANGELOG.md +8 -0
- package/dist/{client-C9F2fWI4.d.ts → client-fHMBaIXD.d.ts} +1 -1
- package/dist/consent.d.ts +4 -0
- package/dist/consent.js +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lucida.js +1 -1
- package/dist/{recorder-AJ7XX7OZ.js → recorder-MHNUIAAP.js} +1 -1
- package/dist/replay.js +1 -1
- package/dist/static/v0/consent.js +1 -1
- package/dist/static/v0/core.js +1 -1
- package/dist/static/v0/index.js +1 -1
- package/dist/static/v0/lucida.js +1 -1
- package/dist/static/v0/manifest.json +7 -7
- package/dist/static/{v0.1.12/recorder-AJ7XX7OZ.js → v0/recorder-MHNUIAAP.js} +1 -1
- package/dist/static/v0/replay.js +1 -1
- package/dist/static/v0.1.13/consent.js +1 -0
- package/dist/static/{v0.1.12 → v0.1.13}/core.js +1 -1
- package/dist/static/v0.1.13/index.js +3 -0
- package/dist/static/v0.1.13/lucida.js +3 -0
- package/dist/static/{v0.1.12 → v0.1.13}/manifest.json +7 -7
- package/dist/static/{v0/recorder-AJ7XX7OZ.js → v0.1.13/recorder-MHNUIAAP.js} +1 -1
- package/dist/static/{v0.1.12 → v0.1.13}/replay.js +1 -1
- package/package.json +1 -1
- package/storage.json +1 -1
- package/dist/static/v0.1.12/consent.js +0 -1
- package/dist/static/v0.1.12/index.js +0 -3
- package/dist/static/v0.1.12/lucida.js +0 -3
- /package/dist/static/{v0.1.12 → v0.1.13}/autocapture.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/banner-TXLAMTQM.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/chunk-AWIQCFGN.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/chunk-B722OERZ.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/chunk-EFNCQJI3.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/chunk-IXDYCBAD.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/chunk-UPPUYIIH.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/correlate.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/early-access.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/experiments.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/flags.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/forms.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/guides.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/heatmaps.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/host-headers.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/inspector.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/modules-FANMZRDJ.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/persistent-G2OR2L2N.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/recommendations.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/toolbar.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/validation-S6TYVWAI.js +0 -0
- /package/dist/static/{v0.1.12 → v0.1.13}/webmcp.js +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.13",
|
|
3
3
|
"files": {
|
|
4
4
|
"autocapture.js": "sha384-Yeaj4auYKc2SUHup0hcU28qycDNQF23biNXJ31IpaE4jLhAO1UJM97e3wba2PPNt",
|
|
5
5
|
"banner-TXLAMTQM.js": "sha384-o/r8rh/gOYIPxFRZUpf8EVcVpOMMszbgdkHVkHs603LjCxNkA5cXiYki9GVL+KkD",
|
|
6
|
-
"consent.js": "sha384-
|
|
7
|
-
"core.js": "sha384-
|
|
6
|
+
"consent.js": "sha384-OTuFOodMIW5E/44jKwKGtvBw+DHqnuaS4dQ0eEGKbuP0kKO2cwEMgWrsEIPKpM8u",
|
|
7
|
+
"core.js": "sha384-s0Zz3Zbs5iTYjE3ehzYLoww+CY5RY5BJGeb6tsYD5cr/s6LHVTxL923Cw3ESmFR6",
|
|
8
8
|
"correlate.js": "sha384-VcfDDPARiL7tAELZDbkb0gT78Y9BLGY6iB7KHjApfDLTxfaUeo07l0o5pnY2AjRT",
|
|
9
9
|
"early-access.js": "sha384-5JZ6DWRYgfoeu7QgSPi8kvVlys4CZ6H2wWuvEEggc83iau5z0sJ8RQD1AXtLCjGQ",
|
|
10
10
|
"experiments.js": "sha384-5smoFlAcR2T1XmBgazy5HGun22PvX5Pa7IKIKtONtN/CpNy6U9SDWb7W7Di9d5fR",
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"guides.js": "sha384-L04oyaUz6CUQsRmlgACfa+LIO1X5V6IxynArZ/BbnBFNOF/KtzAcNhjSKrCUEpwX",
|
|
14
14
|
"heatmaps.js": "sha384-5+7QtGYM5CTW7R/ZL42MiCVdJUxRwglV6sHwWtyatO6SzjHuuYrZ29SoXm/NtasE",
|
|
15
15
|
"host-headers.js": "sha384-8OsSDIVDEo3Lsk3G+L5xNJ4pkAYXDEAz+ggBK7sG1cj7tOITAXDKaM2EFtQCHGiF",
|
|
16
|
-
"index.js": "sha384-
|
|
16
|
+
"index.js": "sha384-57g1s0x5nBhSFwsUkt8ssqXMyygYV6u19pLf2w5UJyhqQfBu0w1hHghm2U9tBgPx",
|
|
17
17
|
"inspector.js": "sha384-wCjcdzjbZ1mAYS3w19Io8NOJQfrnlmfDkinoan/0LUTqCw6M7OSR9QDwxDp6M5+T",
|
|
18
|
-
"lucida.js": "sha384-
|
|
18
|
+
"lucida.js": "sha384-n64nBqxhgYXbiloBADhpwgwiDCPUXeQ1g6miY3MtunYTsx23dvlr3FfXH84Xg4hy",
|
|
19
19
|
"modules-FANMZRDJ.js": "sha384-UjLSth+cPZTIxwMGFgoUEocqFSHXnM7IgYpICNSRRU7NTlFkfCg3WUNUbu8u04EP",
|
|
20
20
|
"persistent-G2OR2L2N.js": "sha384-CsRTVYxlt1E++G7NYAPkyM+1qFJWbIBLRUNukG/wFP1pPLHTvKp6XIlxlGm9+efp",
|
|
21
21
|
"recommendations.js": "sha384-6XyPo/sQd1LNvQ87+vlgOLYe/ecapP9mmDeKlkTRx15d9gTAmDRwCPrX+n6zy2lx",
|
|
22
|
-
"recorder-
|
|
23
|
-
"replay.js": "sha384-
|
|
22
|
+
"recorder-MHNUIAAP.js": "sha384-e4zEmTuDgvv1OwNBei0HkABbpgW+T5WQGeQl9gDxoelIZZ84t9EslLCdvdbUO/r/",
|
|
23
|
+
"replay.js": "sha384-35wLbPcEOHEutSWCaPqOIr1i/rNYike634HoLU0gPbjBvVJMAXfK5VQTmW6GEbQh",
|
|
24
24
|
"toolbar.js": "sha384-5RaMXlQzkpgbv3L9JX67X8YdRd9s5/Kt5usUm4uqC0afaZkXTYbBkdInD2b0ORP3",
|
|
25
25
|
"validation-S6TYVWAI.js": "sha384-FJISudb3fVX9JZKMgLnOxqdzmfOj9BetMKw7jVvI3UlkyGNaarRpTCMBqfXKupRW",
|
|
26
26
|
"webmcp.js": "sha384-Vs+fImvLlnbEZtId9H/pA4VXB1bVaxEjOYY+DcAUTN5pXXuNNFOYQfltuj2giALZ"
|
|
@@ -75,5 +75,5 @@ or you can use record.mirror to access the mirror instance during recording.`,mr
|
|
|
75
75
|
};
|
|
76
76
|
})();
|
|
77
77
|
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
78
|
-
`,Cr=typeof self<"u"&&self.Blob&&new Blob([Zr],{type:"text/javascript;charset=utf-8"});function fi(e){let t;try{if(t=Cr&&(self.URL||self.webkitURL).createObjectURL(Cr),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Zr),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ut=class{constructor(t){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o,i),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,i){let s=br(r,n,o,!0),a=new Map,l=new fi;l.onmessage=m=>{let{id:f}=m.data;if(a.set(f,!1),!("base64"in m.data))return;let{base64:y,type:S,width:w,height:g}=m.data;this.mutationCb({id:f,type:Ue["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let c=1e3/t,u=0,p,d=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(f=>{le(f,n,o,!0)||m.push(f)}),m},h=m=>{if(u&&m-u<c){p=requestAnimationFrame(h);return}u=m,d().forEach(async f=>{var y;let S=this.mirror.getId(f);if(a.get(S)||f.width===0||f.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(f.__context)){let g=f.getContext(f.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let w=await createImageBitmap(f);l.postMessage({id:S,bitmap:w,width:f.width,height:f.height,dataURLOptions:i.dataURLOptions},[w])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=br(t,r,n,!1),i=li(this.processMutation.bind(this),t,r,n),s=ci(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(s=>{let{type:a,...l}=s;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}},$t=class{constructor(t){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:xr(a,i.href),index:l}))})),n.styleIds.push(s)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Bt=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},q,ct,xe,Ke=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((lr=e.contentWindow)==null?void 0:lr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ge=fo();function ue(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:b,recordDOM:k=!0,recordCanvas:R=!1,recordCrossOriginIframes:E=!1,recordAfter:I=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:x=!1,collectFonts:P=!1,inlineImages:H=!1,plugins:U,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:X=new Set([]),errorHandler:K}=e;Go(K);let N=E?window.parent===window:!0,F=!1;if(!N)try{window.parent.document&&(F=!1)}catch{F=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!F)return()=>{};b!==void 0&&w.mousemove===void 0&&(w.mousemove=b),ge.reset();let W=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},G=Ar(h);$o();let de,ne=0,ye=D=>{for(let Y of U||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!F&&(D=S(D)),D};q=(D,Y)=>{let O=D;if(O.timestamp=Xe(),O.type!==L.FullSnapshot&&!(O.type===L.IncrementalSnapshot&&O.data.source===A.Mutation)){xe.unfreeze();for(let V of Pe)if(V.isFrozen())V.unfreeze();else break}if(N)t?.(ye(O),Y);else if(F){let V={type:"rrweb",event:ye(O),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(V,"*")}if(O.type===L.FullSnapshot)de=O,ne=0;else if(O.type===L.IncrementalSnapshot){if(O.data.source===A.Mutation&&O.data.isAttachIframe)return;ne++;let V=n&&ne>=n,ae=r&&O.timestamp-de.timestamp>r;(V||ae)&&ct(!0)}};let te=D=>{q({type:L.IncrementalSnapshot,data:{source:A.Mutation,...D}})},oe=D=>q({type:L.IncrementalSnapshot,data:{source:A.Scroll,...D}}),j=D=>q({type:L.IncrementalSnapshot,data:{source:A.CanvasMutation,...D}}),ve=D=>q({type:L.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...D}}),me=new $t({mutationCb:te,adoptedStyleSheetCb:ve}),ie=new zt({mirror:ge,mutationCb:te,stylesheetManager:me,recordCrossOriginIframes:E,wrappedEmit:q});for(let D of U||[])D.getMirror&&D.getMirror({nodeMirror:ge,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});let we=new Bt;xe=new Ut({recordCanvas:R,mutationCb:j,win:window,blockClass:o,blockSelector:i,mirror:ge,sampling:w.canvas,dataURLOptions:g});let se=new Pt({mutationCb:te,scrollCb:oe,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:W,dataURLOptions:g,maskTextFn:f,maskInputFn:m,recordCanvas:R,inlineImages:H,sampling:w,slimDOMOptions:G,iframeManager:ie,stylesheetManager:me,canvasManager:xe,keepIframeSrcFn:T,processedNodeManager:we},mirror:ge});ct=(D=!1)=>{if(!k)return;q({type:L.Meta,data:{href:window.location.href,width:Fr(),height:_r()}},D),me.reset(),se.init(),xe.lock(),Pe.forEach(O=>O.lock());let Y=Po(document,{mirror:ge,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:W,maskTextFn:f,maskInputFn:m,slimDOM:G,dataURLOptions:g,recordCanvas:R,inlineImages:H,onSerialize:O=>{Ur(O,ge)&&ie.addIframe(O),$r(O,ge)&&me.trackLinkElement(O),Lt(O)&&se.addShadowRoot(M.shadowRoot(O),document)},onIframeLoad:(O,V)=>{ie.attachIframe(O,V),se.observeAttachShadow(O)},onStylesheetLoad:(O,V)=>{me.attachLinkElement(O,V)},keepIframeSrcFn:T});if(!Y)return console.warn("Failed to snapshot the document");q({type:L.FullSnapshot,data:{node:Y,initialOffset:Dr(window)}},D),xe.unlock(),Pe.forEach(O=>O.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))};try{let D=[],Y=ae=>{var J;return _(oi)({mutationCb:te,mousemoveCb:($,be)=>q({type:L.IncrementalSnapshot,data:{source:be,positions:$}}),mouseInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MouseInteraction,...$}}),scrollCb:oe,viewportResizeCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.ViewportResize,...$}}),inputCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Input,...$}}),mediaInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MediaInteraction,...$}}),styleSheetRuleCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleSheetRule,...$}}),styleDeclarationCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleDeclaration,...$}}),canvasMutationCb:j,fontCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Font,...$}}),selectionCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.Selection,...$}})},customElementCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.CustomElement,...$}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:u,sampling:w,recordDOM:k,recordCanvas:R,inlineImages:H,userTriggeredOnInput:x,collectFonts:P,doc:ae,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:G,dataURLOptions:g,mirror:ge,iframeManager:ie,stylesheetManager:me,shadowDomManager:se,processedNodeManager:we,canvasManager:xe,ignoreCSSAttributes:X,plugins:((J=U?.filter($=>$.observer))==null?void 0:J.map($=>({observer:$.observer,options:$.options,callback:be=>q({type:L.Plugin,data:{plugin:$.name,payload:be}})})))||[]},y)},O=new Map;ie.addLoadListener(ae=>{try{let J=ae.contentDocument;if(O.has(J))return;O.set(J,Y(J))}catch(J){console.warn(J)}}),ie.addUnloadListener(ae=>{let J=O.get(ae);J&&(O.delete(ae),J(),se.removeShadowRootsIn(ae),ge.removeNodeFromMap(ae))});let V=()=>{ct(),D.push(Y(document)),Ke=!0};return["interactive","complete"].includes(document.readyState)?V():(D.push(re("DOMContentLoaded",()=>{q({type:L.DomContentLoaded,data:{}}),I==="DOMContentLoaded"&&V()})),D.push(re("load",()=>{q({type:L.Load,data:{}}),I==="load"&&V()},window))),()=>{[...D,...O.values()].forEach(ae=>{try{ae()}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J)}}),O.clear(),ie.destroy(),we.destroy(),se.reset(),xe.reset(),Ke=!1,jo()}}catch(D){console.warn(D)}}ue.addCustomEvent=(e,t)=>{if(!Ke)throw new Error("please add custom event after start recording");q({type:L.Custom,data:{tag:e,payload:t}})};ue.addAnnotation=e=>{if(!Ke)throw new Error("please add annotation after recording started");q({type:L.Annotation,data:e})};ue.freezePage=()=>{xe.freeze(),Pe.forEach(e=>e.freeze())};ue.takeFullSnapshot=e=>{if(!Ke)throw new Error("please take full snapshot after start recording");ct(e)};ue.mirror=ge;var Kr=["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"];var Yr=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];var di="<masked>",hi=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"];var pi=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],mi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function gi(e,t){let r=e;for(let n of t.pathRules??[])try{r=r.replace(typeof n.match=="string"?new RegExp(n.match):n.match,n.replace)}catch{}return t.maskPathIds?r.split("/").map(n=>pi.some(o=>o.test(n))?":id":n).join("/"):r}function Jr(e,t){let r=e;if(t.pathRules?.length||t.maskPathIds){let o=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(r);o&&(r=(o[1]??"")+gi(o[2],t)+o[3])}let n=[...hi,...t.maskParams??[],...t.maskCampaignParams?[...Yr,...Kr]:[]];if(n.length){let o=r.indexOf("#"),i=o<0?r:r.slice(0,o),s=o<0?"":r.slice(o);r=i.replace(new RegExp(`([?&])(${n.map(mi).join("|")})=[^&]*`,"gi"),`$1$2=${di}`)+s}return t.stripHash&&(r=r.replace(/#.*$/,"")),r}var fe=Uint8Array,pe=Uint16Array,Zt=Int32Array,Kt=new fe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Yt=new fe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Qr=new fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(e,t){for(var r=new pe(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Zt(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},sn=on(Kt,2),yi=sn.b,jt=sn.r;yi[28]=258,jt[258]=28;var an=on(Yt,0),ts=an.b,en=an.r,qt=new pe(32768);for(z=0;z<32768;++z)ke=(z&43690)>>1|(z&21845)<<1,ke=(ke&52428)>>2|(ke&13107)<<2,ke=(ke&61680)>>4|(ke&3855)<<4,qt[z]=((ke&65280)>>8|(ke&255)<<8)>>1;var ke,z,et=(function(e,t,r){for(var n=e.length,o=0,i=new pe(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new pe(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new pe(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],p=s[e[o]-1]++<<u,d=p|(1<<u)-1;p<=d;++p)a[qt[p]>>l]=c}else for(a=new pe(n),o=0;o<n;++o)e[o]&&(a[o]=qt[s[e[o]-1]++]>>15-e[o]);return a}),Oe=new fe(288);for(z=0;z<144;++z)Oe[z]=8;var z;for(z=144;z<256;++z)Oe[z]=9;var z;for(z=256;z<280;++z)Oe[z]=7;var z;for(z=280;z<288;++z)Oe[z]=8;var z,bt=new fe(32);for(z=0;z<32;++z)bt[z]=5;var z,vi=et(Oe,9,0);var wi=et(bt,5,0);var ln=function(e){return(e+7)/8|0},un=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new fe(e.subarray(t,r))};var Me=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Je=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Gt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:fn,l:0};if(o==1){var s=new fe(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(k,R){return k.f-R.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=o-1;)a=r[r[c].f<r[p].f?c++:p++],l=r[c!=u&&r[c].f<r[p].f?c++:p++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=i[0].s,n=1;n<o;++n)i[n].s>d&&(d=i[n].s);var h=new pe(d+1),m=Vt(r[u-1],h,0);if(m>t){var n=0,f=0,y=m-t,S=1<<y;for(i.sort(function(R,E){return h[E.s]-h[R.s]||R.f-E.f});n<o;++n){var w=i[n].s;if(h[w]>t)f+=S-(1<<m-h[w]),h[w]=t;else break}for(f>>=y;f>0;){var g=i[n].s;h[g]<t?f-=1<<t-h[g]++-1:++n}for(;n>=0&&f;--n){var b=i[n].s;h[b]==t&&(--h[b],++f)}m=t}return{t:new fe(h),l:m}},Vt=function(e,t,r){return e.s==-1?Math.max(Vt(e.l,t,r+1),Vt(e.r,t,r+1)):t[e.s]=r},tn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new pe(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},Qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},cn=function(e,t,r){var n=r.length,o=ln(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},rn=function(e,t,r,n,o,i,s,a,l,c,u){Me(t,u++,r),++o[256];for(var p=Gt(o,15),d=p.t,h=p.l,m=Gt(i,15),f=m.t,y=m.l,S=tn(d),w=S.c,g=S.n,b=tn(f),k=b.c,R=b.n,E=new pe(19),I=0;I<w.length;++I)++E[w[I]&31];for(var I=0;I<k.length;++I)++E[k[I]&31];for(var x=Gt(E,7),P=x.t,H=x.l,U=19;U>4&&!P[Qr[U-1]];--U);var T=c+5<<3,X=Qe(o,Oe)+Qe(i,bt)+s,K=Qe(o,d)+Qe(i,f)+s+14+3*U+Qe(E,P)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&T<=X&&T<=K)return cn(t,u,e.subarray(l,l+c));var N,F,W,G;if(Me(t,u,1+(K<X)),u+=2,K<X){N=et(d,h,0),F=d,W=et(f,y,0),G=f;var de=et(P,H,0);Me(t,u,g-257),Me(t,u+5,R-1),Me(t,u+10,U-4),u+=14;for(var I=0;I<U;++I)Me(t,u+3*I,P[Qr[I]]);u+=3*U;for(var ne=[w,k],ye=0;ye<2;++ye)for(var te=ne[ye],I=0;I<te.length;++I){var oe=te[I]&31;Me(t,u,de[oe]),u+=P[oe],oe>15&&(Me(t,u,te[I]>>5&127),u+=te[I]>>12)}}else N=vi,F=Oe,W=wi,G=bt;for(var I=0;I<a;++I){var j=n[I];if(j>255){var oe=j>>18&31;Je(t,u,N[oe+257]),u+=F[oe+257],oe>7&&(Me(t,u,j>>23&31),u+=Kt[oe]);var ve=j&31;Je(t,u,W[ve]),u+=G[ve],ve>3&&(Je(t,u,j>>5&8191),u+=Yt[ve])}else Je(t,u,N[j]),u+=F[j]}return Je(t,u,N[256]),u+F[256]},bi=new Zt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),fn=new fe(0),Si=function(e,t,r,n,o,i){var s=i.z||e.length,a=new fe(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var p=bi[t-1],d=p>>13,h=p&8191,m=(1<<r)-1,f=i.p||new pe(32768),y=i.h||new pe(m+1),S=Math.ceil(r/3),w=2*S,g=function(V){return(e[V]^e[V+1]<<S^e[V+2]<<w)&m},b=new Zt(25e3),k=new pe(288),R=new pe(32),E=0,I=0,x=i.i||0,P=0,H=i.w||0,U=0;x+2<s;++x){var T=g(x),X=x&32767,K=y[T];if(f[X]=K,y[T]=X,H<=x){var N=s-x;if((E>7e3||P>24576)&&(N>423||!c)){u=rn(e,l,0,b,k,R,I,P,U,x-U,u),P=E=I=0,U=x;for(var F=0;F<286;++F)k[F]=0;for(var F=0;F<30;++F)R[F]=0}var W=2,G=0,de=h,ne=X-K&32767;if(N>2&&T==g(x-ne))for(var ye=Math.min(d,N)-1,te=Math.min(32767,x),oe=Math.min(258,N);ne<=te&&--de&&X!=K;){if(e[x+W]==e[x+W-ne]){for(var j=0;j<oe&&e[x+j]==e[x+j-ne];++j);if(j>W){if(W=j,G=ne,j>ye)break;for(var ve=Math.min(ne,j-2),me=0,F=0;F<ve;++F){var ie=x-ne+F&32767,we=f[ie],se=ie-we&32767;se>me&&(me=se,K=ie)}}}X=K,K=f[X],ne+=X-K&32767}if(G){b[P++]=268435456|jt[W]<<18|en[G];var D=jt[W]&31,Y=en[G]&31;I+=Kt[D]+Yt[Y],++k[257+D],++R[Y],H=x+W,++E}else b[P++]=e[x],++k[e[x]]}}for(x=Math.max(x,H);x<s;++x)b[P++]=e[x],++k[e[x]];u=rn(e,l,c,b,k,R,I,P,U,x-U,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=y,i.p=f,i.i=x,i.w=H)}else{for(var x=i.w||0;x<s+c;x+=65535){var O=x+65535;O>=s&&(l[u/8|0]=c,O=s),u=cn(l,u+1,e.subarray(x,O))}i.i=s}return un(a,0,n+ln(u)+o)},Ci=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e})(),ki=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=Ci[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var Mi=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new fe(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return Si(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)};var Xt=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ri=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Xt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}};var xi=function(e){return 10+(e.filename?e.filename.length+1:0)};function dn(e,t){t||(t={});var r=ki(),n=e.length;r.p(e);var o=Mi(e,t,xi(t),8),i=o.length;return Ri(o,t),Xt(o,i-8,r.d()),Xt(o,i-4,n),o}var nn=typeof TextEncoder<"u"&&new TextEncoder,Ii=typeof TextDecoder<"u"&&new TextDecoder,Ei=0;try{Ii.decode(fn,{stream:!0}),Ei=1}catch{}function hn(e,t){if(t){for(var r=new fe(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(nn)return nn.encode(e);for(var o=e.length,i=new fe(e.length+(e.length>>1)),s=0,a=function(u){i[s++]=u},n=0;n<o;++n){if(s+5>i.length){var l=new fe(s+8+(o-n<<1));l.set(i),i=l}var c=e.charCodeAt(n);c<128||t?a(c):c<2048?(a(192|c>>6),a(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++n)&1023,a(240|c>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|c&63)):(a(224|c>>12),a(128|c>>6&63),a(128|c&63))}return un(i,0,s)}async function pn(e){if(typeof CompressionStream<"u"&&typeof Response<"u")try{let t=new Response(e).body?.pipeThrough(new CompressionStream("gzip"));if(t)return new Uint8Array(await new Response(t).arrayBuffer())}catch{}return Jt(e)}function Jt(e){return dn(hn(e))}var Ti=8e6,mn=6e4;function gn(e){let t=[],r=0,n=0,o,i=!!e.hold,s=!1,a,l,c=[],u=()=>c.reduce((w,g)=>w+g.json.length,0),p=()=>{if(!t.length)return;let{sessionId:w,windowId:g}=e.ids();o&&o!==w&&(n=0,e.onSessionChange?.()),o=w,c.push({json:d(w,g,n,t),parts:t,window:g,session:w,seq:n++,tries:0}),t=[],r=0},d=(w,g,b,k)=>`{"api_key":${JSON.stringify(e.apiKey)},"session_id":${JSON.stringify(w)},"window_id":${JSON.stringify(g)},"seq":${b},"events":[${k.join(",")}]}`,h=0,m=async w=>{try{let g=await pn(w.json),b=await e.fetch(`${e.url}?compression=gzip`,{method:"POST",body:g,headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:g.length<mn}),k=b.headers?.get?.("Retry-After")?.trim()??"";return h=/^\d+$/.test(k)?Math.min(Number(k),300)*1e3:0,b.status}catch{return 0}},f=()=>i||s?Promise.resolve():(l??=(async()=>{for(;c.length&&!i&&!s;){let w=c[0],g=await m(w);g>=200&&g<300?(c.shift(),e.onSent?.(w.session,w.json.length)):!ir(g)||++w.tries>(e.maxRetries??5)?(e.log?.("replay chunk dropped",w.seq,g),c.shift(),e.onGap?.()):await new Promise(b=>setTimeout(b,Math.max(h,or(w.tries-1,e.backoff))))}})().finally(()=>{l=void 0}),l),y=()=>{a??=setTimeout(()=>{a=void 0,S()},e.flushMs)},S=()=>(a!==void 0&&clearTimeout(a),a=void 0,p(),i&&u()>Ti&&(i=!1),f());return{add(w){if(s)return;let g=JSON.stringify(w);if(g.length>rr-4096)return e.log?.("replay event too large",g.length);r&&r+g.length>e.chunkBytes&&S(),t.push(g),r+=g.length+1,r>=e.chunkBytes?S():y()},flush:S,beacon(){if(i||s)return;p();let w=c[0]?.seq??0,g=c[0]?.session;for(let b of c.splice(0)){b.session!==g&&([g,w]=[b.session,b.seq]);let k=R=>{let E=Jt(d(b.session,b.window,w,R));if(E.length>mn&&R.length>1){k(R.slice(0,R.length>>1)),k(R.slice(R.length>>1));return}w++,navigator.sendBeacon?.(`${e.url}?compression=gzip`,new Blob([E],{type:"text/plain"}))};k(b.parts)}n=Math.max(n,w)},release(){i=!1,S()},discard(){s=!0,t=[],c.length=0,a!==void 0&&clearTimeout(a)},get unsent(){return r+u()},get seq(){return n},get held(){return i}}}var yn=(e,t)=>{let r=e(t);return r&&r.nodeType===1?r:null};function $e(e,t,r){let n=o=>{o&&(o.type===2&&o.attributes&&r(o.attributes,(o.tagName??"").toLowerCase(),yn(t,o.id)),o.childNodes?.forEach(n))};if(e.type===2&&n(e.data?.node),!(e.type!==3||e.data?.source!==0)){e.data.adds?.forEach(o=>n(o.node));for(let o of e.data.attributes??[]){let i=yn(t,o.id);r(o.attributes,i?.tagName.toLowerCase()??"",i)}}}var Oi=["title","alt","placeholder","aria-label","aria-description","aria-placeholder","aria-roledescription","aria-valuetext"],Ni=new Set(["input","textarea","select"]),vn=e=>e.replace(/\S/g,"*");function wn(e,t){let r=o=>{try{return!!o?.closest(t)&&!o.closest(e)}catch{return!1}},n=(o,i,s)=>{if(!r(s))for(let a of Object.keys(o)){let l=o[a];(Oi.includes(a)||a==="value"&&!Ni.has(i))&&typeof l=="string"&&(o[a]=vn(l))}};return{maskTextFn:(o,i)=>r(i)?o:vn(o),scrub:(o,i)=>$e(o,i,n)}}var bn="data-lc-fixed";function Sn(e,t){$e(e,t,(r,n,o)=>{if(!(!o||bn in r))try{let i=getComputedStyle(o).position;(i==="fixed"||i==="sticky")&&(r[bn]="")}catch{}})}var Cn=()=>window.parent!==window;function Li(){let e=location.ancestorOrigins;if(e?.length)return e[0];try{return document.referrer?new URL(document.referrer).origin:void 0}catch{return}}var kn=e=>{let t=Li();return!!t&&e.includes(t)};function Mn(e){let t=r=>{let n=r.data;n&&typeof n=="object"&&n.type==="rrweb"&&!e.includes(r.origin)&&r.stopImmediatePropagation()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}var Ai=new Set(["Shift","Control","Alt","Meta","CapsLock","AltGraph"]);function Rn(e,t,r=1e3){let n=0,o,i=()=>{o=void 0,n>0&&e(n)&&(n=0)},s=l=>{if(!(l instanceof Element))return!1;if(l instanceof HTMLInputElement&&l.type==="password")return!0;let c=t();try{return!!c&&!!l.closest(c)}catch{return!1}},a=l=>{l.repeat||Ai.has(l.key)||s(l.target)||(n++,o??=setTimeout(i,r))};return document.addEventListener("keydown",a,{capture:!0,passive:!0}),{flush:i,stop(){document.removeEventListener("keydown",a,{capture:!0}),o!==void 0&&clearTimeout(o),i()}}}function xn(e,t=1e3){let r=0,n,o=()=>{n=void 0;let s=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);s>0&&s!==r&&(r=s,e(s))},i=()=>{n??=setTimeout(o,t)};return window.addEventListener("load",i),window.addEventListener("resize",i),{schedule:i,reset(){r=0,n!==void 0&&clearTimeout(n),o()},stop(){window.removeEventListener("load",i),window.removeEventListener("resize",i),n!==void 0&&clearTimeout(n)}}}function In(){let e=[[]];return{push(t,r){r&&(e=[e[e.length-1],[]]),e[e.length-1].push(t)},drain(){let t=e.flat();return e=[[]],t},get size(){return e.reduce((t,r)=>t+r.length,0)}}}function En(e,t,r){if(!e)return null;let n=null;try{let o=e.proxy&&new URL(e.proxy.url,location.href);o&&/^https?:$/.test(o.protocol)&&r.includes(o.origin)&&e.proxy?.origins.length&&(n={url:o.toString(),origins:[...e.proxy.origins]})}catch{}return{inlineImages:!!e.inlineImages&&!t,maxInlineBytes:e.maxInlineBytes??256*1024,collectFonts:!!e.collectFonts,proxy:n}}var Di=new Set(["img","source","video","audio","track","image","input"]),_i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g;function Tn(e){let t=i=>{if(!e.proxy||i.startsWith("data:"))return i;try{let s=new URL(i,location.href);return e.proxy.origins.includes(s.origin)?`${e.proxy.url}${e.proxy.url.includes("?")?"&":"?"}url=${encodeURIComponent(s.toString())}`:i}catch{return i}},r=i=>i.replace(_i,(s,a,l)=>{let c=t(l.trim());return c===l.trim()?s:`url(${a}${c}${a})`}),n=i=>i.split(",").map(s=>{let[a,...l]=s.trim().split(/\s+/);return a?[t(a),...l].join(" "):s}).join(", "),o=(i,s)=>{if(s==="img"&&typeof i.rr_dataURL=="string"&&i.rr_dataURL.length>e.maxInlineBytes&&delete i.rr_dataURL,!!e.proxy)for(let[a,l]of Object.entries(i))typeof l=="string"&&(a==="_cssText"||a==="style"?i[a]=r(l):a==="srcset"?i[a]=n(l):(a==="poster"||a==="src"&&Di.has(s)||a==="href"&&s==="link"||a==="xlink:href"&&s==="image")&&(i[a]=t(l)))};return{scrub(i,s){if($e(i,s,o),e.proxy&&i.type===3&&i.data?.source===8)for(let a of i.data.adds??[])typeof a.rule=="string"&&(a.rule=r(a.rule))}}}function Fi(e,t,r){let n={x:0,y:0,width:e.width,height:e.height},o=[];try{o=r?.(e)??[]}catch{o=[n]}let i=t.flatMap(s=>{try{return e.matches(s.selector)?s.regions??[n]:[]}catch{return[n]}});return[...o,...i]}function On(e){let t=new Map,r=document.createElement("canvas"),n=()=>{for(let i of Array.from(document.querySelectorAll("canvas"))){let s=e.idOf(i);if(!(s<=0||!i.width||!i.height||i.closest(e.skip)))try{r.width=i.width,r.height=i.height;let a=r.getContext("2d");if(!a)return;a.drawImage(i,0,0),a.fillStyle="#000";for(let p of Fi(i,e.rules,e.regionsFn))a.fillRect(p.x,p.y,p.width,p.height);let l=r.toDataURL("image/jpeg",e.quality),c=l.slice(l.indexOf(",")+1);if(!c||t.get(s)===c)continue;t.set(s,c);let u={rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:c}],type:"image/jpeg"};e.emit({type:3,timestamp:Date.now(),data:{source:9,id:s,type:0,commands:[{property:"clearRect",args:[0,0,i.width,i.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[u]},0,0]}]}})}catch{}}},o=setInterval(n,Math.round(1e3/e.fps));return{reset:()=>t.clear(),tick:n,stop:()=>clearInterval(o)}}function Nn(e,t=Date.now){let r=e.eventsPerSecond??10,n=e.burst??100,o=n,i=t();return()=>{let s=t();return o=Math.min(n,o+(s-i)/1e3*r),i=s,o<1?!1:(o-=1,!0)}}var zi=1e4;function Ln(e,t=Date.now){let r=new Map,n=0;return{allow(o){let i=o.data;return o.type!==3||i?.source!==0||!i.attributes?.length?!0:(r.size>zi&&r.clear(),i.attributes=i.attributes.filter(s=>{let a=r.get(s.id);return a||r.set(s.id,a=Nn({burst:e.burst??100,eventsPerSecond:e.perSecond??10},t)),a()?!0:(n++,!1)}),!!(i.attributes.length||i.adds?.length||i.removes?.length||i.texts?.length))},get dropped(){return n}}}var Pi=new Set([1,2,3,4,5,6,7,12]);function An(e){let t,r=!1,n=0;return{check(o){if(e<=0)return{keep:!0,resumed:!1};let i=o.timestamp??Date.now();if(t??=i,o.type===3&&Pi.has(o.data?.source??-1)){t=i;let s=r&&n>0;return r=!1,n=0,{keep:!0,resumed:s}}return!r&&i-t>e&&(r=!0),r?(n++,{keep:!1,resumed:!1}):{keep:!0,resumed:!1}}}}function Dn(e,t,r){let n=[],o;switch(t.mode){case"on_event":e.onCapture(i=>t.events.includes(i.event)&&r());break;case"on_flag":{let i=e.flags?.onChange(s=>s[t.flag]&&r());i&&n.push(i);break}case"on_url":try{o=new RegExp(t.pattern)}catch{e.log("bad on_url pattern",t.pattern)}break;case"on_frustration":{let i=[],s=a=>{let l=Date.now();for(i.push({t:l,x:a.clientX,y:a.clientY});i.length&&l-i[0].t>1e3;)i.shift();i.filter(u=>Math.hypot(u.x-a.clientX,u.y-a.clientY)<=30).length>=3&&r()};document.addEventListener("click",s,!0),n.push(()=>document.removeEventListener("click",s,!0));break}default:}return{checkUrl:i=>o?.test(i)&&r(),stop:()=>n.forEach(i=>i())}}var St="[redacted]",Ui=/^(authorization|proxy-authorization|cookie|set-cookie|x-api-key|x-auth-token|x-csrf-token)$/i,er=/pass(word|wd|phrase)?|secret|token|api[-_]?key|card|cvv|cvc|ssn|authorization/i;var Re=(e,t=4096)=>e.length>t?`${e.slice(0,t)}...[truncated ${e.length-t}]`:e;function tt(e){let t={};for(let r of Object.keys(e))t[r]=Ui.test(r)?St:Re(e[r]??"",512);return t}function Qt(e,t){if(t>6||e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Qt(n,t+1));let r={};for(let[n,o]of Object.entries(e))r[n]=er.test(n)?St:Qt(o,t+1);return r}function Be(e){if(e==null)return;if(typeof e!="string")return typeof URLSearchParams<"u"&&e instanceof URLSearchParams?Be(e.toString()):"[binary]";let t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return Re(JSON.stringify(Qt(JSON.parse(t),0)))}catch{}if(/^[^\s=&]+=[^\s]*$/.test(t)){let r=new URLSearchParams(t);for(let n of[...r.keys()])er.test(n)&&r.set(n,St);return Re(r.toString())}return Re(e)}function _n(e,t=1e3){try{if(typeof e=="string")return Re(e,t);if(e instanceof Error)return Re(`${e.name}: ${e.message}${e.stack?`
|
|
78
|
+
`,Cr=typeof self<"u"&&self.Blob&&new Blob([Zr],{type:"text/javascript;charset=utf-8"});function fi(e){let t;try{if(t=Cr&&(self.URL||self.webkitURL).createObjectURL(Cr),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Zr),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Ut=class{constructor(t){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});let{sampling:r="all",win:n,blockClass:o,blockSelector:i,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o,i),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,i,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,i){let s=br(r,n,o,!0),a=new Map,l=new fi;l.onmessage=m=>{let{id:f}=m.data;if(a.set(f,!1),!("base64"in m.data))return;let{base64:y,type:S,width:w,height:g}=m.data;this.mutationCb({id:f,type:Ue["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};let c=1e3/t,u=0,p,d=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(f=>{le(f,n,o,!0)||m.push(f)}),m},h=m=>{if(u&&m-u<c){p=requestAnimationFrame(h);return}u=m,d().forEach(async f=>{var y;let S=this.mirror.getId(f);if(a.get(S)||f.width===0||f.height===0)return;if(a.set(S,!0),["webgl","webgl2"].includes(f.__context)){let g=f.getContext(f.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}let w=await createImageBitmap(f);l.postMessage({id:S,bitmap:w,width:f.width,height:f.height,dataURLOptions:i.dataURLOptions},[w])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=br(t,r,n,!1),i=li(this.processMutation.bind(this),t,r,n),s=ci(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{o(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let o=n.map(s=>{let{type:a,...l}=s;return l}),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}},$t=class{constructor(t){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},o=[];for(let i of t){let s;this.styleMirror.has(i)?s=this.styleMirror.getId(i):(s=this.styleMirror.add(i),o.push({styleId:s,rules:Array.from(i.rules||CSSRule,(a,l)=>({rule:xr(a,i.href),index:l}))})),n.styleIds.push(s)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Bt=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},q,ct,xe,Ke=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((lr=e.contentWindow)==null?void 0:lr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var ge=fo();function ue(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:y,packFn:S,sampling:w={},dataURLOptions:g={},mousemoveWait:b,recordDOM:k=!0,recordCanvas:R=!1,recordCrossOriginIframes:E=!1,recordAfter:I=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:x=!1,collectFonts:P=!1,inlineImages:H=!1,plugins:U,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:X=new Set([]),errorHandler:K}=e;Go(K);let N=E?window.parent===window:!0,F=!1;if(!N)try{window.parent.document&&(F=!1)}catch{F=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!F)return()=>{};b!==void 0&&w.mousemove===void 0&&(w.mousemove=b),ge.reset();let W=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},G=Ar(h);$o();let de,ne=0,ye=D=>{for(let Y of U||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!F&&(D=S(D)),D};q=(D,Y)=>{let O=D;if(O.timestamp=Xe(),O.type!==L.FullSnapshot&&!(O.type===L.IncrementalSnapshot&&O.data.source===A.Mutation)){xe.unfreeze();for(let V of Pe)if(V.isFrozen())V.unfreeze();else break}if(N)t?.(ye(O),Y);else if(F){let V={type:"rrweb",event:ye(O),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(V,"*")}if(O.type===L.FullSnapshot)de=O,ne=0;else if(O.type===L.IncrementalSnapshot){if(O.data.source===A.Mutation&&O.data.isAttachIframe)return;ne++;let V=n&&ne>=n,ae=r&&O.timestamp-de.timestamp>r;(V||ae)&&ct(!0)}};let te=D=>{q({type:L.IncrementalSnapshot,data:{source:A.Mutation,...D}})},oe=D=>q({type:L.IncrementalSnapshot,data:{source:A.Scroll,...D}}),j=D=>q({type:L.IncrementalSnapshot,data:{source:A.CanvasMutation,...D}}),ve=D=>q({type:L.IncrementalSnapshot,data:{source:A.AdoptedStyleSheet,...D}}),me=new $t({mutationCb:te,adoptedStyleSheetCb:ve}),ie=new zt({mirror:ge,mutationCb:te,stylesheetManager:me,recordCrossOriginIframes:E,wrappedEmit:q});for(let D of U||[])D.getMirror&&D.getMirror({nodeMirror:ge,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});let we=new Bt;xe=new Ut({recordCanvas:R,mutationCb:j,win:window,blockClass:o,blockSelector:i,mirror:ge,sampling:w.canvas,dataURLOptions:g});let se=new Pt({mutationCb:te,scrollCb:oe,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:W,dataURLOptions:g,maskTextFn:f,maskInputFn:m,recordCanvas:R,inlineImages:H,sampling:w,slimDOMOptions:G,iframeManager:ie,stylesheetManager:me,canvasManager:xe,keepIframeSrcFn:T,processedNodeManager:we},mirror:ge});ct=(D=!1)=>{if(!k)return;q({type:L.Meta,data:{href:window.location.href,width:Fr(),height:_r()}},D),me.reset(),se.init(),xe.lock(),Pe.forEach(O=>O.lock());let Y=Po(document,{mirror:ge,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:W,maskTextFn:f,maskInputFn:m,slimDOM:G,dataURLOptions:g,recordCanvas:R,inlineImages:H,onSerialize:O=>{Ur(O,ge)&&ie.addIframe(O),$r(O,ge)&&me.trackLinkElement(O),Lt(O)&&se.addShadowRoot(M.shadowRoot(O),document)},onIframeLoad:(O,V)=>{ie.attachIframe(O,V),se.observeAttachShadow(O)},onStylesheetLoad:(O,V)=>{me.attachLinkElement(O,V)},keepIframeSrcFn:T});if(!Y)return console.warn("Failed to snapshot the document");q({type:L.FullSnapshot,data:{node:Y,initialOffset:Dr(window)}},D),xe.unlock(),Pe.forEach(O=>O.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))};try{let D=[],Y=ae=>{var J;return _(oi)({mutationCb:te,mousemoveCb:($,be)=>q({type:L.IncrementalSnapshot,data:{source:be,positions:$}}),mouseInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MouseInteraction,...$}}),scrollCb:oe,viewportResizeCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.ViewportResize,...$}}),inputCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Input,...$}}),mediaInteractionCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.MediaInteraction,...$}}),styleSheetRuleCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleSheetRule,...$}}),styleDeclarationCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.StyleDeclaration,...$}}),canvasMutationCb:j,fontCb:$=>q({type:L.IncrementalSnapshot,data:{source:A.Font,...$}}),selectionCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.Selection,...$}})},customElementCb:$=>{q({type:L.IncrementalSnapshot,data:{source:A.CustomElement,...$}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:W,inlineStylesheet:u,sampling:w,recordDOM:k,recordCanvas:R,inlineImages:H,userTriggeredOnInput:x,collectFonts:P,doc:ae,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:T,blockSelector:i,slimDOMOptions:G,dataURLOptions:g,mirror:ge,iframeManager:ie,stylesheetManager:me,shadowDomManager:se,processedNodeManager:we,canvasManager:xe,ignoreCSSAttributes:X,plugins:((J=U?.filter($=>$.observer))==null?void 0:J.map($=>({observer:$.observer,options:$.options,callback:be=>q({type:L.Plugin,data:{plugin:$.name,payload:be}})})))||[]},y)},O=new Map;ie.addLoadListener(ae=>{try{let J=ae.contentDocument;if(O.has(J))return;O.set(J,Y(J))}catch(J){console.warn(J)}}),ie.addUnloadListener(ae=>{let J=O.get(ae);J&&(O.delete(ae),J(),se.removeShadowRootsIn(ae),ge.removeNodeFromMap(ae))});let V=()=>{ct(),D.push(Y(document)),Ke=!0};return["interactive","complete"].includes(document.readyState)?V():(D.push(re("DOMContentLoaded",()=>{q({type:L.DomContentLoaded,data:{}}),I==="DOMContentLoaded"&&V()})),D.push(re("load",()=>{q({type:L.Load,data:{}}),I==="load"&&V()},window))),()=>{[...D,...O.values()].forEach(ae=>{try{ae()}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J)}}),O.clear(),ie.destroy(),we.destroy(),se.reset(),xe.reset(),Ke=!1,jo()}}catch(D){console.warn(D)}}ue.addCustomEvent=(e,t)=>{if(!Ke)throw new Error("please add custom event after start recording");q({type:L.Custom,data:{tag:e,payload:t}})};ue.addAnnotation=e=>{if(!Ke)throw new Error("please add annotation after recording started");q({type:L.Annotation,data:e})};ue.freezePage=()=>{xe.freeze(),Pe.forEach(e=>e.freeze())};ue.takeFullSnapshot=e=>{if(!Ke)throw new Error("please take full snapshot after start recording");ct(e)};ue.mirror=ge;var Kr=["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"];var Yr=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];var di="<masked>",hi=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","state","session","api_key","apikey","key","auth","authorization","code","otp","email","ssn"];var pi=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],mi=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function gi(e,t){let r=e;for(let n of t.pathRules??[])try{r=r.replace(typeof n.match=="string"?new RegExp(n.match):n.match,n.replace)}catch{}return t.maskPathIds?r.split("/").map(n=>pi.some(o=>o.test(n))?":id":n).join("/"):r}function Jr(e,t){let r=e;if(t.pathRules?.length||t.maskPathIds){let o=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(r);o&&(r=(o[1]??"")+gi(o[2],t)+o[3])}let n=[...hi,...t.maskParams??[],...t.maskCampaignParams?[...Yr,...Kr]:[]];if(n.length){let o=r.indexOf("#"),i=o<0?r:r.slice(0,o),s=o<0?"":r.slice(o);r=i.replace(new RegExp(`([?&])(${n.map(mi).join("|")})=[^&]*`,"gi"),`$1$2=${di}`)+s}return t.stripHash&&(r=r.replace(/#.*$/,"")),r}var fe=Uint8Array,pe=Uint16Array,Zt=Int32Array,Kt=new fe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Yt=new fe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Qr=new fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(e,t){for(var r=new pe(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Zt(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},sn=on(Kt,2),yi=sn.b,jt=sn.r;yi[28]=258,jt[258]=28;var an=on(Yt,0),ts=an.b,en=an.r,qt=new pe(32768);for(z=0;z<32768;++z)ke=(z&43690)>>1|(z&21845)<<1,ke=(ke&52428)>>2|(ke&13107)<<2,ke=(ke&61680)>>4|(ke&3855)<<4,qt[z]=((ke&65280)>>8|(ke&255)<<8)>>1;var ke,z,et=(function(e,t,r){for(var n=e.length,o=0,i=new pe(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new pe(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new pe(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],p=s[e[o]-1]++<<u,d=p|(1<<u)-1;p<=d;++p)a[qt[p]>>l]=c}else for(a=new pe(n),o=0;o<n;++o)e[o]&&(a[o]=qt[s[e[o]-1]++]>>15-e[o]);return a}),Oe=new fe(288);for(z=0;z<144;++z)Oe[z]=8;var z;for(z=144;z<256;++z)Oe[z]=9;var z;for(z=256;z<280;++z)Oe[z]=7;var z;for(z=280;z<288;++z)Oe[z]=8;var z,bt=new fe(32);for(z=0;z<32;++z)bt[z]=5;var z,vi=et(Oe,9,0);var wi=et(bt,5,0);var ln=function(e){return(e+7)/8|0},un=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new fe(e.subarray(t,r))};var Me=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Je=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Gt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return{t:fn,l:0};if(o==1){var s=new fe(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(k,R){return k.f-R.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,p=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=o-1;)a=r[r[c].f<r[p].f?c++:p++],l=r[c!=u&&r[c].f<r[p].f?c++:p++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=i[0].s,n=1;n<o;++n)i[n].s>d&&(d=i[n].s);var h=new pe(d+1),m=Vt(r[u-1],h,0);if(m>t){var n=0,f=0,y=m-t,S=1<<y;for(i.sort(function(R,E){return h[E.s]-h[R.s]||R.f-E.f});n<o;++n){var w=i[n].s;if(h[w]>t)f+=S-(1<<m-h[w]),h[w]=t;else break}for(f>>=y;f>0;){var g=i[n].s;h[g]<t?f-=1<<t-h[g]++-1:++n}for(;n>=0&&f;--n){var b=i[n].s;h[b]==t&&(--h[b],++f)}m=t}return{t:new fe(h),l:m}},Vt=function(e,t,r){return e.s==-1?Math.max(Vt(e.l,t,r+1),Vt(e.r,t,r+1)):t[e.s]=r},tn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new pe(++t),n=0,o=e[0],i=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==o&&a!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=e[a]}return{c:r.subarray(0,n),n:t}},Qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},cn=function(e,t,r){var n=r.length,o=ln(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},rn=function(e,t,r,n,o,i,s,a,l,c,u){Me(t,u++,r),++o[256];for(var p=Gt(o,15),d=p.t,h=p.l,m=Gt(i,15),f=m.t,y=m.l,S=tn(d),w=S.c,g=S.n,b=tn(f),k=b.c,R=b.n,E=new pe(19),I=0;I<w.length;++I)++E[w[I]&31];for(var I=0;I<k.length;++I)++E[k[I]&31];for(var x=Gt(E,7),P=x.t,H=x.l,U=19;U>4&&!P[Qr[U-1]];--U);var T=c+5<<3,X=Qe(o,Oe)+Qe(i,bt)+s,K=Qe(o,d)+Qe(i,f)+s+14+3*U+Qe(E,P)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&T<=X&&T<=K)return cn(t,u,e.subarray(l,l+c));var N,F,W,G;if(Me(t,u,1+(K<X)),u+=2,K<X){N=et(d,h,0),F=d,W=et(f,y,0),G=f;var de=et(P,H,0);Me(t,u,g-257),Me(t,u+5,R-1),Me(t,u+10,U-4),u+=14;for(var I=0;I<U;++I)Me(t,u+3*I,P[Qr[I]]);u+=3*U;for(var ne=[w,k],ye=0;ye<2;++ye)for(var te=ne[ye],I=0;I<te.length;++I){var oe=te[I]&31;Me(t,u,de[oe]),u+=P[oe],oe>15&&(Me(t,u,te[I]>>5&127),u+=te[I]>>12)}}else N=vi,F=Oe,W=wi,G=bt;for(var I=0;I<a;++I){var j=n[I];if(j>255){var oe=j>>18&31;Je(t,u,N[oe+257]),u+=F[oe+257],oe>7&&(Me(t,u,j>>23&31),u+=Kt[oe]);var ve=j&31;Je(t,u,W[ve]),u+=G[ve],ve>3&&(Je(t,u,j>>5&8191),u+=Yt[ve])}else Je(t,u,N[j]),u+=F[j]}return Je(t,u,N[256]),u+F[256]},bi=new Zt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),fn=new fe(0),Si=function(e,t,r,n,o,i){var s=i.z||e.length,a=new fe(n+s+5*(1+Math.ceil(s/7e3))+o),l=a.subarray(n,a.length-o),c=i.l,u=(i.r||0)&7;if(t){u&&(l[0]=i.r>>3);for(var p=bi[t-1],d=p>>13,h=p&8191,m=(1<<r)-1,f=i.p||new pe(32768),y=i.h||new pe(m+1),S=Math.ceil(r/3),w=2*S,g=function(V){return(e[V]^e[V+1]<<S^e[V+2]<<w)&m},b=new Zt(25e3),k=new pe(288),R=new pe(32),E=0,I=0,x=i.i||0,P=0,H=i.w||0,U=0;x+2<s;++x){var T=g(x),X=x&32767,K=y[T];if(f[X]=K,y[T]=X,H<=x){var N=s-x;if((E>7e3||P>24576)&&(N>423||!c)){u=rn(e,l,0,b,k,R,I,P,U,x-U,u),P=E=I=0,U=x;for(var F=0;F<286;++F)k[F]=0;for(var F=0;F<30;++F)R[F]=0}var W=2,G=0,de=h,ne=X-K&32767;if(N>2&&T==g(x-ne))for(var ye=Math.min(d,N)-1,te=Math.min(32767,x),oe=Math.min(258,N);ne<=te&&--de&&X!=K;){if(e[x+W]==e[x+W-ne]){for(var j=0;j<oe&&e[x+j]==e[x+j-ne];++j);if(j>W){if(W=j,G=ne,j>ye)break;for(var ve=Math.min(ne,j-2),me=0,F=0;F<ve;++F){var ie=x-ne+F&32767,we=f[ie],se=ie-we&32767;se>me&&(me=se,K=ie)}}}X=K,K=f[X],ne+=X-K&32767}if(G){b[P++]=268435456|jt[W]<<18|en[G];var D=jt[W]&31,Y=en[G]&31;I+=Kt[D]+Yt[Y],++k[257+D],++R[Y],H=x+W,++E}else b[P++]=e[x],++k[e[x]]}}for(x=Math.max(x,H);x<s;++x)b[P++]=e[x],++k[e[x]];u=rn(e,l,c,b,k,R,I,P,U,x-U,u),c||(i.r=u&7|l[u/8|0]<<3,u-=7,i.h=y,i.p=f,i.i=x,i.w=H)}else{for(var x=i.w||0;x<s+c;x+=65535){var O=x+65535;O>=s&&(l[u/8|0]=c,O=s),u=cn(l,u+1,e.subarray(x,O))}i.i=s}return un(a,0,n+ln(u)+o)},Ci=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e})(),ki=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=Ci[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}};var Mi=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new fe(i.length+e.length);s.set(i),s.set(e,i.length),e=s,o.w=i.length}return Si(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)};var Xt=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ri=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Xt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}};var xi=function(e){return 10+(e.filename?e.filename.length+1:0)};function dn(e,t){t||(t={});var r=ki(),n=e.length;r.p(e);var o=Mi(e,t,xi(t),8),i=o.length;return Ri(o,t),Xt(o,i-8,r.d()),Xt(o,i-4,n),o}var nn=typeof TextEncoder<"u"&&new TextEncoder,Ii=typeof TextDecoder<"u"&&new TextDecoder,Ei=0;try{Ii.decode(fn,{stream:!0}),Ei=1}catch{}function hn(e,t){if(t){for(var r=new fe(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(nn)return nn.encode(e);for(var o=e.length,i=new fe(e.length+(e.length>>1)),s=0,a=function(u){i[s++]=u},n=0;n<o;++n){if(s+5>i.length){var l=new fe(s+8+(o-n<<1));l.set(i),i=l}var c=e.charCodeAt(n);c<128||t?a(c):c<2048?(a(192|c>>6),a(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|e.charCodeAt(++n)&1023,a(240|c>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|c&63)):(a(224|c>>12),a(128|c>>6&63),a(128|c&63))}return un(i,0,s)}async function pn(e){if(typeof CompressionStream<"u"&&typeof Response<"u")try{let t=new Response(e).body?.pipeThrough(new CompressionStream("gzip"));if(t)return new Uint8Array(await new Response(t).arrayBuffer())}catch{}return Jt(e)}function Jt(e){return dn(hn(e))}var Ti=8e6,mn=6e4;function gn(e){let t=[],r=0,n=0,o,i=!!e.hold,s=!1,a,l,c=[],u=()=>c.reduce((w,g)=>w+g.json.length,0),p=()=>{if(!t.length)return;let{sessionId:w,windowId:g}=e.ids();o&&o!==w&&(n=0,e.onSessionChange?.()),o=w,c.push({json:d(w,g,n,t),parts:t,window:g,session:w,seq:n++,tries:0}),t=[],r=0},d=(w,g,b,k)=>`{"api_key":${JSON.stringify(e.apiKey)},"session_id":${JSON.stringify(w)},"window_id":${JSON.stringify(g)},"seq":${b},"events":[${k.join(",")}]}`,h=0,m=async w=>{try{let g=await pn(w.json),b=await e.fetch(`${e.url}?compression=gzip`,{method:"POST",body:g,headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:g.length<mn}),k=b.headers?.get?.("Retry-After")?.trim()??"";return h=/^\d+$/.test(k)?Math.min(Number(k),300)*1e3:0,b.status}catch{return 0}},f=()=>i||s?Promise.resolve():(l??=(async()=>{for(;c.length&&!i&&!s;){let w=c[0],g=await m(w);g>=200&&g<300?(c.shift(),e.onSent?.(w.session,w.json.length)):!ir(g)||++w.tries>(e.maxRetries??5)?(e.log?.("replay chunk dropped",w.seq,g),c.shift(),e.onGap?.()):await new Promise(b=>setTimeout(b,Math.max(h,or(w.tries-1,e.backoff))))}})().finally(()=>{l=void 0}),l),y=()=>{a??=setTimeout(()=>{a=void 0,S()},e.flushMs)},S=()=>(a!==void 0&&clearTimeout(a),a=void 0,p(),i&&u()>Ti&&(i=!1),f());return{add(w){if(s)return;let g=JSON.stringify(w);if(g.length>rr-4096)return e.log?.("replay event too large",g.length);r&&r+g.length>e.chunkBytes&&S(),t.push(g),r+=g.length+1,r>=e.chunkBytes?S():y()},flush:S,beacon(){if(i||s)return;p();let w=c[0]?.seq??0,g=c[0]?.session;for(let b of c.splice(0)){b.session!==g&&([g,w]=[b.session,b.seq]);let k=R=>{let E=Jt(d(b.session,b.window,w,R));if(E.length>mn&&R.length>1){k(R.slice(0,R.length>>1)),k(R.slice(R.length>>1));return}w++,navigator.sendBeacon?.(`${e.url}?compression=gzip`,new Blob([E],{type:"text/plain"}))};k(b.parts)}n=Math.max(n,w)},release(){i=!1,S()},discard(){s=!0,t=[],c.length=0,a!==void 0&&clearTimeout(a)},get unsent(){return r+u()},get seq(){return n},get held(){return i}}}var yn=(e,t)=>{let r=e(t);return r&&r.nodeType===1?r:null};function $e(e,t,r){let n=o=>{o&&(o.type===2&&o.attributes&&r(o.attributes,(o.tagName??"").toLowerCase(),yn(t,o.id)),o.childNodes?.forEach(n))};if(e.type===2&&n(e.data?.node),!(e.type!==3||e.data?.source!==0)){e.data.adds?.forEach(o=>n(o.node));for(let o of e.data.attributes??[]){let i=yn(t,o.id);r(o.attributes,i?.tagName.toLowerCase()??"",i)}}}var Oi=["title","alt","placeholder","aria-label","aria-description","aria-placeholder","aria-roledescription","aria-valuetext"],Ni=new Set(["input","textarea","select"]),vn=e=>e.replace(/\S/g,"*");function wn(e,t){let r=o=>{try{return!!o?.closest(t)&&!o.closest(e)}catch{return!1}},n=(o,i,s)=>{if(!r(s))for(let a of Object.keys(o)){let l=o[a];(Oi.includes(a)||a==="value"&&!Ni.has(i))&&typeof l=="string"&&(o[a]=vn(l))}};return{maskTextFn:(o,i)=>r(i)?o:vn(o),scrub:(o,i)=>$e(o,i,n)}}var bn="data-lc-fixed";function Sn(e,t){$e(e,t,(r,n,o)=>{if(!(!o||bn in r))try{let i=getComputedStyle(o).position;(i==="fixed"||i==="sticky")&&(r[bn]="")}catch{}})}var Cn=()=>window.parent!==window;function Li(){let e=location.ancestorOrigins;if(e?.length)return e[0];try{return document.referrer?new URL(document.referrer).origin:void 0}catch{return}}var kn=e=>{let t=Li();return!!t&&e.includes(t)};function Mn(e){let t=r=>{let n=r.data;n&&typeof n=="object"&&n.type==="rrweb"&&!e.includes(r.origin)&&r.stopImmediatePropagation()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}var Ai=new Set(["Shift","Control","Alt","Meta","CapsLock","AltGraph"]);function Rn(e,t,r=1e3){let n=0,o,i=()=>{o=void 0,n>0&&e(n)&&(n=0)},s=l=>{if(!(l instanceof Element))return!1;if(l instanceof HTMLInputElement&&l.type==="password")return!0;let c=t();try{return!!c&&!!l.closest(c)}catch{return!1}},a=l=>{l.repeat||Ai.has(l.key)||s(l.target)||(n++,o??=setTimeout(i,r))};return document.addEventListener("keydown",a,{capture:!0,passive:!0}),{flush:i,stop(){document.removeEventListener("keydown",a,{capture:!0}),o!==void 0&&clearTimeout(o),i()}}}function xn(e,t=1e3){let r=0,n,o=()=>{n=void 0;let s=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0);s>0&&s!==r&&(r=s,e(s))},i=()=>{n??=setTimeout(o,t)};return window.addEventListener("load",i),window.addEventListener("resize",i),{schedule:i,reset(){r=0,n!==void 0&&clearTimeout(n),o()},stop(){window.removeEventListener("load",i),window.removeEventListener("resize",i),n!==void 0&&clearTimeout(n)}}}function In(){let e=[[]];return{push(t,r){r&&(e=[e[e.length-1],[]]),e[e.length-1].push(t)},drain(){let t=e.flat();return e=[[]],t},get size(){return e.reduce((t,r)=>t+r.length,0)}}}function En(e,t,r){if(!e)return null;let n=null;try{let o=e.proxy&&new URL(e.proxy.url,location.href);o&&/^https?:$/.test(o.protocol)&&r.includes(o.origin)&&e.proxy?.origins.length&&(n={url:o.toString(),origins:[...e.proxy.origins]})}catch{}return{inlineImages:!!e.inlineImages&&!t,maxInlineBytes:e.maxInlineBytes??256*1024,collectFonts:!!e.collectFonts,proxy:n}}var Di=new Set(["img","source","video","audio","track","image","input"]),_i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g;function Tn(e){let t=i=>{if(!e.proxy||i.startsWith("data:"))return i;try{let s=new URL(i,location.href);return e.proxy.origins.includes(s.origin)?`${e.proxy.url}${e.proxy.url.includes("?")?"&":"?"}url=${encodeURIComponent(s.toString())}`:i}catch{return i}},r=i=>i.replace(_i,(s,a,l)=>{let c=t(l.trim());return c===l.trim()?s:`url(${a}${c}${a})`}),n=i=>i.split(",").map(s=>{let[a,...l]=s.trim().split(/\s+/);return a?[t(a),...l].join(" "):s}).join(", "),o=(i,s)=>{if(s==="img"&&typeof i.rr_dataURL=="string"&&i.rr_dataURL.length>e.maxInlineBytes&&delete i.rr_dataURL,!!e.proxy)for(let[a,l]of Object.entries(i))typeof l=="string"&&(a==="_cssText"||a==="style"?i[a]=r(l):a==="srcset"?i[a]=n(l):(a==="poster"||a==="src"&&Di.has(s)||a==="href"&&s==="link"||a==="xlink:href"&&s==="image")&&(i[a]=t(l)))};return{scrub(i,s){if($e(i,s,o),e.proxy&&i.type===3&&i.data?.source===8)for(let a of i.data.adds??[])typeof a.rule=="string"&&(a.rule=r(a.rule))}}}function Fi(e,t,r){let n={x:0,y:0,width:e.width,height:e.height},o=[];try{o=r?.(e)??[]}catch{o=[n]}let i=t.flatMap(s=>{try{return e.matches(s.selector)?s.regions??[n]:[]}catch{return[n]}});return[...o,...i]}function On(e){let t=new Map,r=document.createElement("canvas"),n=()=>{for(let i of Array.from(document.querySelectorAll("canvas"))){let s=e.idOf(i);if(!(s<=0||!i.width||!i.height||i.closest(e.skip)))try{r.width=i.width,r.height=i.height;let a=r.getContext("2d");if(!a)return;a.drawImage(i,0,0),a.fillStyle="#000";for(let p of Fi(i,e.rules,e.regionsFn))a.fillRect(p.x,p.y,p.width,p.height);let l=r.toDataURL("image/jpeg",e.quality),c=l.slice(l.indexOf(",")+1);if(!c||t.get(s)===c)continue;t.set(s,c);let u={rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:c}],type:"image/jpeg"};e.emit({type:3,timestamp:Date.now(),data:{source:9,id:s,type:0,commands:[{property:"clearRect",args:[0,0,i.width,i.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[u]},0,0]}]}})}catch{}}},o=setInterval(n,Math.round(1e3/e.fps));return{reset:()=>t.clear(),tick:n,stop:()=>clearInterval(o)}}function Nn(e,t=Date.now){let r=e.eventsPerSecond??10,n=e.burst??100,o=n,i=t();return()=>{let s=t();return o=Math.min(n,o+(s-i)/1e3*r),i=s,o<1?!1:(o-=1,!0)}}var zi=1e4;function Ln(e,t=Date.now){let r=new Map,n=0;return{allow(o){let i=o.data;return o.type!==3||i?.source!==0||!i.attributes?.length?!0:(r.size>zi&&r.clear(),i.attributes=i.attributes.filter(s=>{let a=r.get(s.id);return a||r.set(s.id,a=Nn({burst:e.burst??100,eventsPerSecond:e.perSecond??10},t)),a()?!0:(n++,!1)}),!!(i.attributes.length||i.adds?.length||i.removes?.length||i.texts?.length))},get dropped(){return n}}}var Pi=new Set([1,2,3,4,5,6,7,12]);function An(e){let t,r=!1,n=0;return{check(o){if(e<=0)return{keep:!0,resumed:!1};let i=o.timestamp??Date.now();if(t??=i,o.type===3&&Pi.has(o.data?.source??-1)){t=i;let s=r&&n>0;return r=!1,n=0,{keep:!0,resumed:s}}return!r&&i-t>e&&(r=!0),r?(n++,{keep:!1,resumed:!1}):{keep:!0,resumed:!1}}}}function Dn(e,t,r){let n=[],o;switch(t.mode){case"on_event":e.onCapture(i=>t.events.includes(i.event)&&r());break;case"on_flag":{let i=e.flags?.onChange(s=>s[t.flag]&&r());i&&n.push(i);break}case"on_url":try{o=new RegExp(t.pattern)}catch{e.log("bad on_url pattern",t.pattern)}break;case"on_frustration":{let i=[],s=a=>{let l=Date.now();for(i.push({t:l,x:a.clientX,y:a.clientY});i.length&&l-i[0].t>1e3;)i.shift();i.filter(u=>Math.hypot(u.x-a.clientX,u.y-a.clientY)<=30).length>=3&&r()};document.addEventListener("click",s,!0),n.push(()=>document.removeEventListener("click",s,!0));break}default:}return{checkUrl:i=>o?.test(i)&&r(),stop:()=>n.forEach(i=>i())}}var St="[redacted]",Ui=/^(authorization|proxy-authorization|cookie|set-cookie|x-api-key|x-auth-token|x-csrf-token)$/i,er=/pass(word|wd|phrase)?|secret|token|api[-_]?key|card|cvv|cvc|ssn|authorization/i;var Re=(e,t=4096)=>e.length>t?`${e.slice(0,t)}...[truncated ${e.length-t}]`:e;function tt(e){let t={};for(let r of Object.keys(e))t[r]=Ui.test(r)?St:Re(e[r]??"",512);return t}function Qt(e,t){if(t>6||e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Qt(n,t+1));let r={};for(let[n,o]of Object.entries(e))r[n]=er.test(n)?St:Qt(o,t+1);return r}function Be(e){if(e==null)return;if(typeof e!="string")return typeof URLSearchParams<"u"&&e instanceof URLSearchParams?Be(e.toString()):"[binary]";let t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{return Re(JSON.stringify(Qt(JSON.parse(t),0)))}catch{}if(/^[^\s=&]+=[^\s]*$/.test(t)){let r=new URLSearchParams(t);for(let n of[...r.keys()])er.test(n)&&r.set(n,St);return Re(r.toString())}return Re(e)}function _n(e,t=1e3){try{if(typeof e=="string")return Re(e,t);if(e instanceof Error)return Re(`${e.name}: ${e.message}${e.stack?`
|
|
79
79
|
${e.stack}`:""}`,t);if(typeof Node<"u"&&e instanceof Node)return`<${e.nodeName.toLowerCase()}>`;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(e===null||typeof e!="object")return String(e);let r=new WeakSet;return Re(JSON.stringify(e,(n,o)=>{if(typeof o=="bigint")return String(o);if(typeof Node<"u"&&o instanceof Node)return`<${o.nodeName.toLowerCase()}>`;if(o!==null&&typeof o=="object"){if(r.has(o))return"[Circular]";r.add(o)}return er.test(n)?St:o}),t)}catch{return"[unserializable]"}}var rt=(e,t)=>!!e?.some(r=>typeof r=="string"?t.includes(r):(r.lastIndex=0,r.test(t)));var Fn=["log","info","warn","error","debug"],$i=1e3,Bi=10;function zn(e,t){let r=0,n=!1,o=(c,u)=>{if(!(n||r>=$i)){n=!0;try{r++,e({level:c,args:t()?["[masked]"]:u.slice(0,Bi).map(p=>_n(p))})}catch{}finally{n=!1}}},i={},s={};for(let c of Fn){let u=console[c];i[c]=u,s[c]=function(...p){u.apply(this,p),o(c,p)},console[c]=s[c]}let a=c=>o("error",[c.error??c.message]),l=c=>o("error",["Unhandled rejection:",c.reason]);return window.addEventListener("error",a),window.addEventListener("unhandledrejection",l),()=>{for(let c of Fn)console[c]===s[c]&&(console[c]=i[c]);window.removeEventListener("error",a),window.removeEventListener("unhandledrejection",l)}}var Pn=e=>{let t={};return e.forEach((r,n)=>t[n]=r),t},Hi=e=>{let t={};for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(":");n>0&&(t[r.slice(0,n).trim().toLowerCase()]=r.slice(n+1).trim())}return t},nt=e=>{try{return new URL(e,location.href).href}catch{return e}};function Un(e,t,r){let n=d=>{try{if(r(d.url)||rt(t.deny,d.url)||t.allow&&!rt(t.allow,d.url))return;t.headers||(delete d.req?.headers,delete d.res?.headers),t.body||(delete d.req?.body,delete d.res?.body),d.req&&!d.req.headers&&!d.req.body&&delete d.req,d.res&&!d.res.headers&&!d.res.body&&delete d.res;let h=t.redact?t.redact(d):d;h&&e(h)}catch{}},o=d=>r(nt(d))||rt(t.deny,nt(d))||!!t.allow&&!rt(t.allow,nt(d)),i=window.fetch;window.fetch=function(d,h){let m=i.call(this,d,h);try{let f=nt(d instanceof Request?d.url:String(d));if(o(f))return m;let y=Date.now(),S=performance.now(),w=(h?.method??(d instanceof Request?d.method:"GET")).toUpperCase(),g=t.headers||t.body?{headers:tt(Pn(new Headers(h?.headers??(d instanceof Request?d.headers:void 0)))),body:Be(h?.body)}:void 0,b=k=>n({method:w,url:f,status:0,start:y,duration:Math.round(performance.now()-S),type:"fetch",req:g,...k});m.then(k=>{let R=Number(k.headers.get("content-length"))||void 0,E={status:k.status,size:R,res:t.headers?{headers:tt(Pn(k.headers))}:void 0};if(!t.body)return b(E);k.clone().text().then(I=>b({...E,size:R??I.length,res:{...E.res,body:Be(I)}}),()=>b(E))},k=>b({error:Re(String(k?.message??k),200)}))}catch{}return m};let s=window.fetch,a=XMLHttpRequest.prototype,{open:l,send:c,setRequestHeader:u}=a,p=new WeakMap;return a.open=function(d,h,...m){return p.set(this,{method:d.toUpperCase(),url:nt(String(h)),headers:{}}),l.call(this,d,h,...m)},a.setRequestHeader=function(d,h){let m=p.get(this);return m&&(m.headers[d.toLowerCase()]=h),u.call(this,d,h)},a.send=function(d){let h=p.get(this);if(h&&!o(h.url)){let m=Date.now(),f=performance.now();this.addEventListener("loadend",()=>{try{let y=t.body&&(this.responseType===""||this.responseType==="text")?this.responseText:void 0;n({method:h.method,url:h.url,status:this.status,start:m,duration:Math.round(performance.now()-f),size:Number(this.getResponseHeader("content-length"))||y?.length||void 0,type:"xhr",...this.status===0&&{error:"network error"},req:{headers:tt(h.headers),body:Be(d)},res:{headers:tt(Hi(this.getAllResponseHeaders())),body:y===void 0?void 0:Be(y)}})}catch{}})}return c.call(this,d)},()=>{window.fetch===s&&(window.fetch=i),a.open=l,a.send=c,a.setRequestHeader=u}}var Wi={on_event:"event_trigger_matched",on_url:"url_trigger_matched",on_flag:"linked_flag_matched",on_frustration:"frustration_detected"};function Gi(e){let t=parseInt(e.replace(/-/g,"").slice(0,12),16);return Number.isFinite(t)&&t>0?t:Date.now()}var ji=5*6e4,qi={$pageview:e=>({url:e.$current_url}),$pageleave:()=>({}),$form_start:e=>({form:e.form}),$form_submit:e=>({form:e.form}),$replay_tag:e=>({name:e.name})},Vi="********";function Ks(e,t,r,n){let{core:o}=e,i=e.config.apiHost,s=t.trigger_groups,a=t.trigger.mode,l=a==="on_url"&&n?.url_trigger||a==="on_event"&&n?.event_trigger||a==="on_flag"&&n?.linked_flag,u=!(s.length>0||a!=="always"&&!l),p=t.min_duration_ms,d=!!(n?.url_trigger||n?.event_trigger||n?.linked_flag);r.startReason=u?d?"trigger_overridden":n?.sampling?"sampling_overridden":"recording_initialized":void 0;let h=!1,m=!1,f=!1,y,S=!1,w=In(),g=t.min_duration_mode==="session"?Gi(o.sessionId):Date.now();r.bufferLength=()=>w.size;let b=()=>{r.status=S?"disabled":h?m?"excluded":"paused":u?"active":"buffering"},k=()=>{try{ue.takeFullSnapshot(!0)}catch{}},R=gn({url:`${i}/v1/replay`,apiKey:e.apiKey,fetch:e.fetch,ids:()=>({sessionId:o.sessionId,windowId:o.session.touch().windowId}),chunkBytes:t.chunk_bytes,flushMs:t.flush_interval_ms,hold:p>0||s.some(C=>(C.min_duration_ms??0)>0),onSent:(C,Z)=>{r.flushedBytes+=Z,r.ack(C)},onSessionChange:()=>k(),onGap:()=>k(),log:e.log}),E=xn(C=>{try{ue.addCustomEvent("page_height",{height:C})}catch{}}),I=ar(t.url_privacy_rules),x=kt(I,location.href),P="",H="",U,T=()=>{P=["[data-lc-mask]",...t.mask_selectors,...x.mask].join(","),H=["[data-lc-block]",...t.block_selectors,...x.block].join(","),U=t.mask_all_text||x.maskAllText?wn(P,["[data-lc-unmask]",...t.unmask_selectors].join(",")):void 0};T(),r.bufferBytes=()=>R.unsent;let X=t.mutationThrottle?Ln(t.mutationThrottle):void 0;r.throttled=()=>X?.dropped??0;let K=C=>{try{return C?[new URL(C).origin]:[]}catch{return[]}},N=En(t.assets,t.mask_all_text||I.some(C=>C.mask_all_text),[location.origin,...K(i),...K(e.config.uiHost)]),F=N&&(N.proxy||N.inlineImages)?Tn(N):void 0,W=!!t.canvas&&(t.canvasMask.length>0||!!t.canvasMaskRegions),G,de=t.maskUrlFn??(C=>Jr(C,e.config.urlPrivacy??{})),ne=An(t.idle_threshold_ms),ye=(C,Z)=>{if(h||S)return;let Q=ne.check(C);if(!Q.keep||(Q.resumed&&k(),X&&!X.allow(C)))return;C.type===2&&G?.reset();let Se=it=>ue.mirror.getNode(it);if(U?.scrub(C,Se),F?.scrub(C,Se),Sn(C,Se),de&&C.type===4&&typeof C.data?.href=="string"){let it=C.data;it.href=de(it.href)}C.type===3&&C.data?.source===0&&E.schedule(),u?R.add(C):w.push(C,!!Z)},te=t.crossOriginIframes,oe=!!te&&Cn(),j=oe&&!kn(te),ve=te&&!oe?Mn(te):void 0,me=j?void 0:Rn(C=>{try{return ue.addCustomEvent("keys",{n:C}),!0}catch{return!1}},()=>[P,H,"[data-lc-ignore]"].filter(Boolean).join(",")),ie=(C,Z)=>{if(!(h||S||!y))try{ue.addCustomEvent(C,Z)}catch{}},we=[];if(!j){let C=()=>t.mask_all_text||x.maskAllText;if(t.console&&we.push(zn(Z=>ie("console",Z),C)),t.network){let Z=`${(i??"").replace(/\/+$/,"")}/v1/`;we.push(Un(Q=>ie("network",{...Q,url:de?de(Q.url):Q.url}),t.network,Q=>Q.startsWith(Z)))}}let se=()=>{if(!(y||S||j)){try{y=D()}catch(C){r.status="rrweb_error",r.rrwebError=String(C).slice(0,200);return}W&&t.canvas&&(G=On({...t.canvas,skip:`${H},[data-lc-ignore]`,rules:t.canvasMask,regionsFn:t.canvasMaskRegions,idOf:C=>ue.mirror.getId(C),emit:C=>ye(C)})),E.reset(),b()}},D=()=>ue({emit:ye,checkoutEveryNms:u?ji:t.buffer_ms/2,maskAllInputs:t.mask_all_inputs,maskInputOptions:{...t.maskInputOptions,password:!0},maskInputFn:t.maskInputFn??(()=>Vi),maskTextSelector:U?"*":P,...U?{maskTextFn:U.maskTextFn}:t.maskTextFn&&{maskTextFn:t.maskTextFn},blockSelector:H,ignoreSelector:"[data-lc-ignore]",sampling:{mousemove:50,scroll:150,input:"last",...t.canvas&&!W&&{canvas:t.canvas.fps}},...t.canvas&&!W&&{dataURLOptions:{type:"image/jpeg",quality:t.canvas.quality}},...N?.inlineImages&&{inlineImages:!0},...N?.collectFonts&&{collectFonts:!0},errorHandler:C=>(r.rrwebErrors++,r.rrwebError=String(C).slice(0,200),!0),recordCrossOriginIframes:!!te,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0},recordCanvas:!!t.canvas&&!W})??void 0,Y=()=>{y?.(),y=void 0,G?.stop(),G=void 0},O=(C,Z)=>{if(!(u||S)){u=!0,r.startReason=C??Wi[a]??"recording_initialized",Z?.min_duration_ms!==void 0&&(p=Z.min_duration_ms),r.minDurationMs=p;for(let Q of w.drain())R.add(Q);Y(),h||se(),ae(),b()}},V,ae=()=>{!R.held||V!==void 0||(V=setTimeout(()=>R.release(),Math.max(0,p-(Date.now()-g))))},J=s.length?sr(e,s,()=>o.sessionId,C=>O("trigger_group_matched",C),{url:n?.url_trigger,event:n?.event_trigger,flag:n?.linked_flag,sampling:n?.sampling}):void 0,$=J??Dn(e,t.trigger,()=>O());J&&(r.triggers=J.states,r.matchedGroups=J.matched);let be="",He=()=>{if(location.href===be)return;be=location.href;let C=kt(I,be),Z=C.key!==x.key;Z&&(x=C,T());let Q=!!y,Se=nr(be,t.include_urls,t.exclude_urls);!Se&&!m?(m=h=!0,Y(),w.drain(),R.flush(),b()):Se&&m&&(m=!1,h=f,h||se(),b()),Se&&$.checkUrl(be),Z&&Q&&y&&(Y(),se())},$n=setInterval(He,1e3),Ct=window.navigation,ot=[],Ne=()=>He();if(Ct)Ct.addEventListener("currententrychange",Ne),ot.push(()=>Ct.removeEventListener("currententrychange",Ne));else for(let C of["pushState","replaceState"]){let Z=history[C],Q=function(...Se){Z.apply(this,Se),He()};history[C]=Q,ot.push(()=>{history[C]===Q&&(history[C]=Z)})}window.addEventListener("popstate",Ne),window.addEventListener("hashchange",Ne),ot.push(()=>(window.removeEventListener("popstate",Ne),window.removeEventListener("hashchange",Ne))),e.onCapture(C=>{C.event==="$pageview"&&He();let Z=qi[C.event];if(!(!Z||h||S||!y))try{let Q=Z(C.properties);de&&typeof Q.url=="string"&&(Q.url=de(Q.url)),ue.addCustomEvent(C.event,Q)}catch{}});let tr=()=>{document.visibilityState==="visible"?u&&y&&ue.takeFullSnapshot(!0):R.beacon()};return document.addEventListener("visibilitychange",tr),e.onUnload(()=>{R.held?R.discard():R.beacon()}),He(),J?.check(),h||se(),u&&ae(),b(),{stop:()=>{S=!0,Y(),clearInterval($n);for(let C of ot)C();clearTimeout(V),document.removeEventListener("visibilitychange",tr),ve?.(),E.stop(),me?.stop();for(let C of we)C();$.stop(),w.drain(),R.discard(),b()},paused:()=>h,pause(){f||S||(f=h=!0,Y(),w.drain(),R.flush(),b())},resume(){!f||S||(f=!1,h=m,h||se(),b())}}}export{Ks as startRecorder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,c as v,d as b,e as R,f as W,g as h,i as D,j as U}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var k="lc_replay_ack",z=()=>{try{let e=sessionStorage.getItem(k);return e?[e]:[]}catch{return[]}};function j(){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(z()),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(k,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 c=e.bufferBytes?.();c&&(r.$replay_buffer_size=c);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var C="lucida_replay_url";function E(e,t,i,r=2e3){let d={},c=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[C]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[C,s]]]]),d.crisp=s)}catch{}};c();let a=setInterval(c,r);return()=>clearInterval(a)}var Y=e=>{let t=j();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(!R(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,g=!1,M=location.href,w=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),m=async(n,_=!1)=>{if(a!=="idle")return;if(!w())return r("no_consent");a="starting",t.status="awaiting_config";let p=++s,u=await e.loadConfig(),x=f(u?.replay_never_record,M)||(!!n||_)&&f(u?.replay_never_record,location.href),l=x?null:v(i,u);if(p!==s)return void(a="idle");if(!l)return r(x?"never_record_page":"remote_disabled"),void(a="idle");let I=e.core.sessionId,$=l.trigger_groups.length>0,O=!!n?.sampling||$||h(I,"",l.sample_rate);if(t.sampleRate=$?void 0:l.sample_rate,t.minDurationMs=l.min_duration_ms,!O)return t.status=b(location.href,l.include_urls,l.exclude_urls)?"sampled":"excluded",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:P}=await import("./recorder-
|
|
1
|
+
import{a as f,c as v,d as b,e as R,f as W,g as h,i as D,j as U}from"./chunk-UPPUYIIH.js";import"./chunk-EFNCQJI3.js";var k="lc_replay_ack",z=()=>{try{let e=sessionStorage.getItem(k);return e?[e]:[]}catch{return[]}};function j(){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(z()),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(k,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 c=e.bufferBytes?.();c&&(r.$replay_buffer_size=c);let a=e.throttled?.();return a&&(r.$replay_throttled_mutations=a),r}})}var C="lucida_replay_url";function E(e,t,i,r=2e3){let d={},c=()=>{if(!i())return;let o=globalThis,s=t();try{e.intercom&&typeof o.Intercom=="function"&&d.intercom!==s&&(o.Intercom("update",{[C]:s}),d.intercom=s),e.crisp&&typeof o.$crisp?.push=="function"&&d.crisp!==s&&(o.$crisp.push(["set","session:data",[[[C,s]]]]),d.crisp=s)}catch{}};c();let a=setInterval(c,r);return()=>clearInterval(a)}var Y=e=>{let t=j();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(!R(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,g=!1,M=location.href,w=()=>e.core.hasConsent("analytics")&&e.core.hasConsent("replay"),m=async(n,_=!1)=>{if(a!=="idle")return;if(!w())return r("no_consent");a="starting",t.status="awaiting_config";let p=++s,u=await e.loadConfig(),x=f(u?.replay_never_record,M)||(!!n||_)&&f(u?.replay_never_record,location.href),l=x?null:v(i,u);if(p!==s)return void(a="idle");if(!l)return r(x?"never_record_page":"remote_disabled"),void(a="idle");let I=e.core.sessionId,$=l.trigger_groups.length>0,O=!!n?.sampling||$||h(I,"",l.sample_rate);if(t.sampleRate=$?void 0:l.sample_rate,t.minDurationMs=l.min_duration_ms,!O)return t.status=b(location.href,l.include_urls,l.exclude_urls)?"sampled":"excluded",void(a="idle");t.status="lazy_loading",t.disabledReason=void 0;let{startRecorder:P}=await import("./recorder-MHNUIAAP.js");if(p!==s)return void(a="idle");o=P(e,l,t,n),a="on"},S=()=>{s++,o?.stop(),o=void 0,a="idle"};e.replay={start:async n=>{g=!1;let _=n===!0,p=u=>_||typeof n=="object"&&!!n[u];await m({sampling:n===void 0||p("sampling"),url_trigger:p("url_trigger"),event_trigger:p("event_trigger"),linked_flag:p("linked_flag")})},stop:()=>{g=!0,S(),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"&&(w()?g||m(void 0,!0):(S(),r("no_consent")))}),m();let y=i.supportWidgets,T=y?.intercom||y?.crisp?E(y,()=>e.client.getReplayUrl(),()=>a==="on"&&!o?.paused()):void 0;return()=>{s++,o?.stop(),T?.()}};export{W as fnv1a32,R as lucidaRecords,U as pagePrivacy,f as policyMatches,Y as replay,v as resolveReplay,h as sampled,b as urlAllowed,D as urlRules};
|
package/package.json
CHANGED
package/storage.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$comment": "Every cookie and storage key the Lucida browser SDK writes. Published for consent managers (Cookie Munch preset, docs/integrations/cookiemunch-preset.md). sdks/browser/test/storage-manifest.test.ts fails when the SDK source names an lc_* key that is not listed here.",
|
|
3
3
|
"sdk": "@lucida-analytics/browser",
|
|
4
4
|
"default_persistence": "cookie",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.13",
|
|
6
6
|
"updated": "2026-11-17T00:00:00Z",
|
|
7
7
|
"suffix_rule": {
|
|
8
8
|
"applies_to": "every key with suffixed: true",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as M,b as c}from"./chunk-IXDYCBAD.js";import"./chunk-EFNCQJI3.js";var a={onlyIfChanged:!0,cookie:!0};function g(n){if(n.gdprApplies===!1)return;let e=n.purpose?.consents??{},t=!!e[1]&&!!e[7];return{analytics:t,replay:t&&!!e[8],marketing:!!e[1]&&!!e[4]}}function m(n){let e=i=>i in n?n[i]==="granted":void 0,t={},s=e("analytics_storage");s!==void 0&&(t.analytics=t.replay=s);let o=e("ad_storage"),r=e("ad_user_data");return o!==void 0&&(t.marketing=o&&r!==!1),t}function v(n){let e=typeof n=="string"?n.split(","):n,t=e.includes("C0002");return{analytics:t,replay:t,marketing:e.includes("C0004")}}function y(n){return{analytics:!!n.statistics,replay:!!n.statistics,marketing:!!n.marketing}}function w(n,e){for(let[t,s]of Object.entries(e))typeof s=="boolean"&&n.categoryGrants.set(t,s)}function k(n,e){return{analytics:!!n.statistics,replay:e?!!n[e]:!!n.statistics,marketing:!!n.marketing}}var O=n=>{let e,s=u(()=>{let o=window.__tcfapi;return typeof o!="function"?!1:(o("addEventListener",2,(r,i)=>{if(!i||r.eventStatus!=="tcloaded"&&r.eventStatus!=="useractioncomplete")return;e=r.listenerId;let d=g(r);d&&c(n,d,"tcf",a)}),!0)});return()=>{s();let o=window.__tcfapi;e!==void 0&&typeof o=="function"&&o("removeEventListener",2,()=>{},e)}},U=n=>{let e=window,t=e.dataLayer??=[],s=r=>{let i=r;i&&typeof i=="object"&&i[0]==="consent"&&(i[1]==="default"||i[1]==="update")&&i[2]&&typeof i[2]=="object"&&c(n,m(i[2]),"gcm",a)};t.forEach(s);let o=t.push;return t.push=function(...r){return r.forEach(s),o.apply(this,r)},()=>{t.push=o}},x=n=>{let e=o=>{(typeof o=="string"||Array.isArray(o))&&c(n,v(o),"onetrust",a)},t=window,s=o=>e(o.detail??t.OnetrustActiveGroups);return window.addEventListener("OneTrustGroupsUpdated",s),e(t.OnetrustActiveGroups),()=>window.removeEventListener("OneTrustGroupsUpdated",s)},_=n=>{let e=window,t=()=>{let o=e.Cookiebot;!o?.consent||o.hasResponse===!1||(w(n,o.consent),c(n,y(o.consent),"cookiebot",a))},s=["CookiebotOnConsentReady","CookiebotOnAccept","CookiebotOnDecline"];for(let o of s)window.addEventListener(o,t);return t(),()=>s.forEach(o=>window.removeEventListener(o,t))};function b(n){let e=n.ANALYTICS==="ACCEPT";return{analytics:e,replay:e,marketing:n.MARKETING==="ACCEPT"}}function u(n){if(n())return()=>{};let e=0,t=setInterval(()=>(n()||++e>40)&&clearInterval(t),250);return()=>clearInterval(t)}var f=["osano-cm-initialized","osano-cm-consent-saved","osano-cm-consent-changed"],L=n=>{let e,t=o=>{let r=o&&typeof o=="object"&&Object.keys(o).length?o:e?.getConsent?.();r&&Object.keys(r).length&&c(n,b(r),"osano",a)},s=u(()=>{if(e=window.Osano?.cm,!e)return!1;for(let o of f)e.addEventListener?.(o,t);return t(e.getConsent?.()),!0});return()=>{s();for(let o of f)e?.removeEventListener?.(o,t)}};function E(n,e="Lucida"){let t=n.find(r=>r.name.toLowerCase()===e.toLowerCase());if(!t)return;let s=t.consent?.status===!0,o=n.filter(r=>r.categorySlug==="marketing");return{analytics:s,replay:s,marketing:o.length>0&&o.every(r=>r.consent?.status===!0)}}var l=["UC_UI_INITIALIZED","UC_UI_CMP_EVENT","ucEvent","UC_CONSENT"];function h(n="Lucida"){return e=>{let t=()=>{let i=window.UC_UI?.getServicesBaseInfo?.();if(!i)return!1;let d=E(i,n);return d?c(e,d,"usercentrics",a):e.log(`usercentrics: no service named "${n}"; consent left unchanged`),!0},s=()=>{t()};for(let r of l)window.addEventListener(r,s);let o=u(t);return()=>{o();for(let r of l)window.removeEventListener(r,s)}}}var S=h(),C=["CookieMunchOnConsentReady","CookieMunchOnChange"];function A(n,e){let t=e?.detail??{};for(let s of[t.receiptId,t.consentReceiptId,t.consentId,t.ledgerId,n.receiptId,n.consentReceiptId,n.consentId,n.ledgerId])if(typeof s=="string"&&s)return s.slice(0,128)}function T(n={}){return e=>{let t=s=>{let o=window.CookieMunch;if(!o?.consent||o.hasResponse!==!0)return;w(e,o.consent);let r=A(o,s);c(e,k(o.consent,n.replayCategory),"cookiemunch",{...a,...r?{receiptId:r}:{}})};for(let s of C)window.addEventListener(s,t);return t(),()=>C.forEach(s=>window.removeEventListener(s,t))}}var p=T();var I=n=>{n.consentUi={showBanner:async e=>(await import("./banner-TXLAMTQM.js")).showBanner(n,e),hideBanner:()=>{import("./banner-TXLAMTQM.js").then(e=>e.hideBanner())}}};var D=n=>(I(n),p(n));export{M as CONSENT_EVENT,c as applyConsent,I as consentBanner,D as consentModule,T as cookieMunchBridge,p as cookieMunchConsent,k as cookieMunchToConsent,_ as cookiebotConsent,y as cookiebotToConsent,U as gcmConsent,m as gcmToConsent,x as oneTrustConsent,v as oneTrustToConsent,L as osanoConsent,b as osanoToConsent,O as tcfConsent,g as tcfToConsent,h as usercentricsBridge,S as usercentricsConsent,E as usercentricsToConsent};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var R=(t,e)=>()=>(t&&(e=t(t=0)),e);function at(t,e,n){return e==="opt_in"?"opt_in":n==="opt_in"||n==="opt_out"||n==="cookieless"?n:e==="opt_out"?t:void 0}var Oe,it,ye,Q,ct=R(()=>{"use strict";Oe="lc_consent";it=["analytics","replay","marketing"],ye=class{constructor(e){this.o=e;this.modeNow=e.mode??"opt_out",this.queueBeforeConsent=e.queueBeforeConsent??!1;let n=this.opens();this.state={analytics:n,replay:n,marketing:n},this.key=e.storageKey||Oe;let r=e.storage.get(this.key);if(r)try{let o=JSON.parse(r);for(let s of it)typeof o[s]=="boolean"&&(this.state[s]=o[s]);this.decided=it.some(s=>typeof o[s]=="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 n=!this.geoCookieless&&this.opens();return this.state={analytics:n,replay:n,marketing:n},n}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 n=this.get();for(let r of it)e[r]!==void 0&&(this.state[r]=e[r]);this.decided=!0,this.waiting=!1,this.o.storage.set(this.key,JSON.stringify(this.state));for(let r of this.listeners)r(this.get(),n)}onChange(e){this.listeners.push(e)}},Q=class{constructor(e,n){this.inner=e;this.allowed=n}inner;allowed;mem=new Map;get(e){return this.mem.has(e)?this.mem.get(e)??null:this.inner.get(e)}set(e,n){this.allowed()?this.inner.set(e,n):this.mem.set(e,n)}remove(e){this.allowed()?this.inner.remove(e):this.mem.set(e,null)}flushBuffered(){for(let[e,n]of this.mem)n===null?this.inner.remove(e):this.inner.set(e,n);this.mem.clear()}discardBuffered(){this.mem.clear()}}});function wn(t){let e=new Uint8Array(t),n=globalThis.crypto;if(n?.getRandomValues)n.getRandomValues(e);else for(let r=0;r<t;r++)e[r]=Math.floor(Math.random()*256);return e}function X(t=Date.now()){if(t>Ae){Ae=t;let s=wn(2);le=((s[0]??0)<<8|(s[1]??0))&1023}else le++,le>4095&&(Ae++,le=0);let e=wn(8),n=new Uint8Array(16),r=Ae;n[0]=Math.floor(r/2**40)&255,n[1]=Math.floor(r/2**32)&255,n[2]=Math.floor(r/2**24)&255,n[3]=Math.floor(r/2**16)&255,n[4]=Math.floor(r/2**8)&255,n[5]=r&255,n[6]=112|le>>8,n[7]=le&255,n[8]=128|(e[0]??0)&63;for(let s=1;s<8;s++)n[8+s]=e[s]??0;let o=Array.from(n,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)}`}var Ae,le,Ie=R(()=>{"use strict";Ae=0,le=0});var xn,Me,kn=R(()=>{"use strict";Ie();xn="lc_identity",Me=class{constructor(e,n,r=!1,o=!1){this.storage=e;this.cookieless=r;let s=e.get(xn),i;try{i=s?JSON.parse(s):void 0}catch{i=void 0}if(i?.distinct_id)this.s=i;else if(r)this.s={distinct_id:"",anon_id:"",identified:!1};else{let a=n??X();this.s={distinct_id:a,anon_id:a,identified:o&&!!n},this.save()}}storage;cookieless;s;save(){this.storage.set(xn,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 n=this.s.distinct_id,r=!this.s.identified;return this.s={...this.s,distinct_id:e,identified:!0},this.save(),r&&n?{event:"$identify",anonDistinctId:n}:{event:"$identify"}}aliasProps(e,n){return{alias:e,distinct_id:n??this.s.distinct_id}}reset(e=!1){if(this.cookieless){this.s={distinct_id:"",anon_id:"",identified:!1};return}let n=e&&this.s.anon_id||X();this.s={distinct_id:n,anon_id:n,identified:!1},this.save()}}});function se(t,e={}){let n=Math.min(e.maxMs??3e4,(e.baseMs??1e3)*2**t);return Math.round(n*(.5+.5*(e.random??Math.random)()))}function Sn(t){return t===0||t===408||t===429||t>=500}var Te=R(()=>{"use strict"});var je,En=R(()=>{"use strict";Te();je=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 n=this.items.splice(0,this.batchMax),r=(this.o.clock??Date).now(),o=JSON.stringify({api_key:this.o.apiKey,batch:n,sent_at:new Date(r).toISOString()});this.o.log?.("send batch",n.length);let s=this.o.transport.send(this.o.url,o,e.beacon?{beacon:!0}:{}).then(i=>i,()=>({status:0,retryAfterMs:void 0})).then(i=>this.settle(n,i.status,!!e.beacon,i.retryAfterMs)).finally(()=>{this.inflight=void 0});return this.inflight=s,s}settle(e,n,r,o){if(n>=200&&n<300){this.attempt=0,this.items.length>=this.flushAt?this.flush():this.items.length&&this.arm(this.intervalMs);return}if(!Sn(n)||r||this.attempt>=this.maxRetries){n===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_${n}`),this.attempt=0;return}this.items.unshift(...e);let s=Math.max(se(this.attempt++,this.o.backoff),Math.min(o??0,6e4));this.o.log?.("retry in",s,"ms"),this.arm(s)}clear(){this.items=[],this.disarm()}async shutdown(){await this.flush(),this.closed=!0,this.disarm()}}});function Cn(t,e,n){return typeof t=="number"&&Number.isInteger(t)&&t>=e&&t<=n?t*6e4:void 0}function Wo(t,e){let n=qo.exec(t);if(!n)return!0;let r=parseInt(n[1]+n[2],16);return r-e<=6e4&&e-r<=No}var lt,Do,Ho,No,qo,Le,Rn=R(()=>{"use strict";Ie();lt="lc_session";Do=6e4,Ho=10*36e5,No=24*36e5,qo=/^([0-9a-f]{8})-?([0-9a-f]{4})-7[0-9a-f]{3}-/i;Le=class{constructor(e,n={}){this.storage=e;this.o=n;this.idleMs=Math.min(Ho,Math.max(Do,n.idleMs??30*6e4)),this.maxMs=n.maxMs??24*36e5,this.newOn=n.newOnEvents??[],this.clock=n.clock??{now:()=>Date.now()},this.bootstrapId=n.bootstrapId}storage;o;windowId=X();idleMs;maxMs;newOn;clock;bootstrapId;configure(e){this.o.idleMs===void 0&&(this.idleMs=Cn(e.session_idle_minutes,1,600)??this.idleMs),this.o.maxMs===void 0&&(this.maxMs=Cn(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(n=>typeof n=="string"&&n!==""))}read(){try{let e=this.storage.get(lt);return e?JSON.parse(e):void 0}catch{return}}touch(e,n){let r=this.clock.now(),o=this.read(),s=!!(o?.campaign&&e&&o.campaign!==e),i=n!==void 0&&this.newOn.includes(n),a=!o||Math.abs(r-o.last)>this.idleMs||Math.abs(r-o.start)>this.maxMs||s||i;return(a||!o)&&(o={id:!o&&this.bootstrapId&&Wo(this.bootstrapId,r)?this.bootstrapId:X(r),start:r,last:r}),this.bootstrapId=void 0,o.last=r,e&&(o.campaign=e),this.storage.set(lt,JSON.stringify(o)),{sessionId:o.id,windowId:this.windowId,isNew:a}}startedAt(){return this.read()?.start}reset(){this.storage.remove(lt)}}});function Pn(t,e){let n=t.get(e);if(n)try{return JSON.parse(n)}catch{return}}var Fe,De,$n=R(()=>{"use strict";Fe=class{constructor(e,n="lc_props",r){this.storage=e;this.key=n;this.persist=r;this.p=Pn(e,n)??{}}storage;key;persist;p;save(){let e=this.persist;this.storage.set(this.key,JSON.stringify(e?Object.fromEntries(Object.entries(this.p).filter(([n])=>e(n))):this.p))}register(e){Object.assign(this.p,e),this.save()}registerOnce(e){for(let[n,r]of Object.entries(e))n in this.p||(this.p[n]=r);this.save()}unregister(e){delete this.p[e],this.save()}all(){return{...this.p}}clear(){this.p={},this.storage.remove(this.key)}},De=class{constructor(e){this.storage=e;this.g=Pn(e,"lc_groups")??{}}storage;g;set(e,n){this.g[e]=n,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 Uo(t,e){let n=new Date(t??e);return(Number.isNaN(n.getTime())?new Date(e):n).toISOString()}var ve,On=R(()=>{"use strict";ct();kn();En();Rn();$n();Ie();ve=class{constructor(e){this.c=e;this.clock=e.clock??{now:()=>Date.now()},this.consent=new ye({...e.consent,storage:e.consentStorage??e.storage}),this.gated=new Q(e.storage,()=>this.consent.has("analytics")),this.storage=this.gated,this.identity=new Me(this.gated,e.bootstrapDistinctId,e.cookieless,e.bootstrapIdentified),this.session=new Le(this.gated,{clock:this.clock,...e.session}),this.props=new Fe(this.gated,void 0,e.persistProperty),this.groupState=new De(this.gated),this.queue=new je({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")||X(),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 n=this.session.touch(this.c.campaignKey?.(),e);if(n.sessionId!==this.lastSession){this.lastSession=n.sessionId;for(let r of this.sessionListeners)r(n.sessionId,n.windowId)}return n}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 n of this.listeners)n(e)}consentStatus(){return this.consent.status()}get anonymousOnReject(){return!!this.c.consent?.cookielessOnReject&&this.consent.status()==="denied"}capture(e,n={},r={}){let o=this.consent.has("analytics"),s=!o&&(this.anonymousOnReject||this.consent.anonymous),i=this.consent.pending&&(this.consent.queueBeforeConsent||this.consent.resolving);if(!o&&!s&&!i){this.c.log?.("dropped (no consent)",e);return}if(s&&(e==="$identify"||e==="$create_alias")){this.c.log?.("withheld (declined, anonymous mode)",e);return}let a=this.touchSession(e),l=this.c.enrich?.(e,n),c=this.consent.status()!=="pending",u=s?{}:{...l?.$set,...r.$set,...e==="$consent_updated"&&c?{$consent:this.consent.get()}:{}},f=s?{}:{...l?.$set_once,...r.$set_once},h=this.groupState.all(),m=s?"":this.identity.distinctId,b={uuid:X(this.clock.now()),event:e,...m?{distinct_id:m}:{},timestamp:Uo(r.timestamp,this.clock.now()),properties:{...this.props.all(),...l?.properties,...n,$session_id:a.sessionId,$window_id:a.windowId,$lib:this.c.library.name,$lib_version:this.c.library.version,...c?{$consent:this.consent.get()}:{}},...Object.keys(u).length?{$set:u}:{},...Object.keys(f).length?{$set_once:f}:{},...!s&&r.$unset?.length?{$unset:r.$unset}:{},...h?{$groups:h}:{}},y=this.filter?this.filter(b):b;if(!y){this.c.log?.("dropped (policy)",e);return}this.c.log?.("capture",e,y),this.c.onCapture?.(y);for(let w of this.captureListeners)w(y);return o||s?this.queue.enqueue(y):this.pre.length<(this.c.queue?.maxQueueSize??1e3)&&this.pre.push(y),y}identify(e,n,r){let o=this.identity.identify(e);(o.event||n||r)&&this.capture("$identify",o.anonDistinctId?{$anon_distinct_id:o.anonDistinctId}:{},{...n?{$set:n}:{},...r?{$set_once:r}:{}}),this.emit("identify")}alias(e,n){this.capture("$create_alias",this.identity.aliasProps(e,n))}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,n,r){this.groupState.set(e,n),this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r??{}}),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 n=this.consent.has("analytics"),r=e.analytics??n;if(n&&!r&&(this.capture("$opt_out"),this.queue.flush()),!n&&r&&(this.anonymousOnReject||this.consent.anonymous)&&this.queue.flush(),this.consent.set(e),!n&&r){this.gated.flushBuffered();for(let o of this.pre.splice(0))this.queue.enqueue(o);this.capture("$opt_in")}else n&&!r&&this.queue.clear();r||(this.pre.length=0),this.emit("consent")}applyRemote(e){this.session.configure(e),this.resolveConsent(at(this.consent.mode,e.consent_mode,e.consent_default))}resolveConsent(e){if(!this.consent.resolving)return;let n=this.consent.resolve(e),r=this.pre.splice(0);if(n){this.gated.flushBuffered();for(let o of r)this.queue.enqueue(o)}else if(this.consent.anonymous){this.gated.discardBuffered();for(let o of r){if(o.event==="$identify"||o.event==="$create_alias")continue;let s={...o};delete s.distinct_id,delete s.$set,delete s.$set_once,delete s.$unset,this.queue.enqueue(s)}}else this.consent.queueBeforeConsent&&this.pre.push(...r);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 ut(t,e){return{event:An,props:{$feature_flag:t,$enrolled:e},extra:{$set:{[He(t)]:e}}}}var An,He,In=R(()=>{"use strict";An="$early_access_opt_in",He=t=>`$feature_enrollment/${t}`});function dt(t){let e="";return n=>{for(e+=n;;){let r=/\r?\n\r?\n/.exec(e);if(!r)return;let o=e.slice(0,r.index);e=e.slice(r.index+r[0].length);let s="message",i,a=[];for(let l of o.split(/\r?\n/)){if(l.startsWith(":"))continue;let c=l.indexOf(":"),[u,f]=c<0?[l,""]:[l.slice(0,c),l.slice(c+1).replace(/^ /,"")];u==="event"?s=f??"":u==="data"?a.push(f??""):u==="id"&&(i=f)}a.length&&t(i===void 0?{event:s,data:a.join(`
|
|
2
|
-
`)}:{event:s,data:a.join(`
|
|
3
|
-
`),id:i})}}}var Ne,pt=R(()=>{"use strict";Te();Ne=class{constructor(e){this.o=e}o;ctl;stopped=!0;timer;start(){this.stopped&&(this.stopped=!1,this.loop())}stop(){this.stopped=!0,this.ctl?.abort(),this.timer&&clearTimeout(this.timer),this.o.onState?.(!1)}async loop(){let e=0;for(;!this.stopped;){try{await this.connectOnce()&&(e=0)}catch(r){this.stopped||this.o.log?.("flag stream error",r)}if(this.o.onState?.(!1),this.stopped)return;let n=se(e++,this.o.backoff);await new Promise(r=>{this.timer=setTimeout(r,n),this.timer.unref?.()})}}async connectOnce(){this.ctl=new AbortController;let e=await this.o.fetch(this.o.url,{headers:{Authorization:`Bearer ${this.o.secretKey}`,Accept:"text/event-stream"},signal:this.ctl.signal});if(!e.ok||!e.body)throw new Error(`stream status ${e.status}`);this.o.onState?.(!0);let n=dt(o=>{if(o.event==="definitions")try{this.o.onChange(JSON.parse(o.data).etag)}catch{this.o.onChange(void 0)}}),r=e.body.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:o,value:s}=await r.read();if(o)return!0;n(s)}}}});function ft(t){let e=!1,n,r=new Ne({url:`${t.apiHost}/v1/flags/stream`,secretKey:t.apiKey,fetch:t.fetch,...t.backoff?{backoff:t.backoff}:{},...t.log?{log:t.log}:{},onState:c=>e=c,onChange:c=>{c!==void 0&&c===n||(n=c,t.reload())}}),o=()=>t.visibility?.hidden()??!1,s=t.pollMs??6e4,i=s>0?setInterval(()=>!e&&!o()&&t.reload(),s):void 0,a=()=>{o()?r.stop():(r.start(),t.reload())};o()||r.start();let l=t.visibility?.subscribe(a);return()=>{r.stop(),l?.(),i&&clearInterval(i)}}var Mn=R(()=>{"use strict";pt()});function gt(t,e){let n=new Set,{whenConsented:r,disabled:o,...s}=e,i=new qe({...s,distinctId:()=>t.distinctId,onIntervention:l=>{for(let c of[...n])c(l)}}),a=!1;return t.onChange(l=>{a&&((l==="identify"||l==="reset")&&i.restart(),l==="consent"&&(t.hasConsent("analytics")?i.start():i.stop()))}),{on(l){return n.add(l),!a&&!o&&(a=!0,r(()=>i.start())),()=>{n.delete(l)}},stop:()=>i.stop()}}var qe,Tn=R(()=>{"use strict";pt();Te();qe=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(n){this.o.log?.("onIntervention threw",n)}}}url(e){let n=`distinct_id=${encodeURIComponent(this.o.distinctId())}${this.cursor?`&cursor=${this.cursor}`:""}`;return`${this.o.apiHost}${e}?${n}`}sleep(e){return new Promise(n=>{this.timer=setTimeout(n,e),this.timer.unref?.()})}async loop(e){let n=0;for(;this.live(e);){let r;try{let o=await this.connectOnce(e);if(o==="gone")return this.stop();o==="poll"?(n=0,r=this.o.pollMs??15e3):(o==="streamed"&&(n=0),r=se(n++,this.o.backoff))}catch(o){this.live(e)&&this.o.log?.("intervention stream error",o),r=se(n++,this.o.backoff)}if(!this.live(e))return;await this.sleep(r)}}async connectOnce(e){if(this.polling)return this.pollOnce(e);this.ctl=new AbortController;let n={Authorization:`Bearer ${this.o.apiKey}`,Accept:"text/event-stream"},r=await this.o.fetch(this.url("/v1/interventions/stream"),{headers:n,signal:this.ctl.signal});if(r.status===404)return"gone";if(!r.ok)return"failed";let o=r.body;if(!o||typeof TextDecoderStream>"u")return this.ctl.abort(),this.polling=!0,this.pollOnce(e);let s=dt(a=>{if(!(a.event!=="intervention"||!this.live(e)))try{this.deliver(JSON.parse(a.data))}catch{this.o.log?.("bad intervention payload")}}),i=o.pipeThrough(new TextDecoderStream).getReader();for(;;){let{done:a,value:l}=await i.read();if(a)return"streamed";s(l)}}async pollOnce(e){this.ctl=new AbortController;let n=await this.o.fetch(this.url("/v1/interventions"),{headers:{Authorization:`Bearer ${this.o.apiKey}`},signal:this.ctl.signal});if(n.status===404)return"gone";if(!n.ok)return"failed";let r=await n.json();if(this.live(e))for(let o of r.data??[])this.deliver(o);return"poll"}}});function mt(t,e,n={}){let r=n.key??"lc_offline",o=n.maxBatches??50,s=n.maxBytes??1e6,i=n.isOnline??(()=>!0),a,l,c=()=>{try{let m=JSON.parse(e.get(r)??"[]");return Array.isArray(m)?m:[]}catch{return[]}},u=m=>{let b=m.reduce((y,w)=>y+w.body.length,0);for(;m.length>o||b>s&&m.length>1;)b-=m.shift().body.length;m.length?e.set(r,JSON.stringify(m)):e.remove(r)},f=m=>{u([...c(),...m]),a??=setTimeout(()=>{a=void 0,h.drain()},n.retryMs??3e4)},h={async send(m,b,y){if(!i())return f([{url:m,body:b}]),{status:200};let w=await t.send(m,b,y);return w.status!==0?w:(f([{url:m,body:b}]),{status:200})},drain(){return l??=(async()=>{let m=c();if(!m.length||!i())return;e.remove(r);let b=[];for(let[y,w]of m.entries())if((await t.send(w.url,w.body)).status===0){b.push(...m.slice(y));break}b.length&&f(b)})().finally(()=>{l=void 0}),l}};return h}var jn=R(()=>{"use strict"});function Ln(t){let e=new TextEncoder().encode(t),n=e.length+9+63>>6<<6,r=new Uint8Array(n);r.set(e),r[e.length]=128;let o=new DataView(r.buffer);o.setUint32(n-8,Math.floor(e.length*8/2**32)),o.setUint32(n-4,e.length*8>>>0);let s=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i=new Uint32Array(64);for(let a=0;a<n;a+=64){for(let c=0;c<16;c++)i[c]=o.getUint32(a+c*4);for(let c=16;c<64;c++){let u=i[c-15],f=i[c-2],h=V(u,7)^V(u,18)^u>>>3,m=V(f,17)^V(f,19)^f>>>10;i[c]=i[c-16]+h+i[c-7]+m|0}let l=s.slice();for(let c=0;c<64;c++){let[u,f,h,,m,b,y,w]=l,E=w+(V(m,6)^V(m,11)^V(m,25))+(m&b^~m&y)+Bo[c]+i[c]|0,C=(V(u,2)^V(u,13)^V(u,22))+(u&f^u&h^f&h)|0;l.pop(),l.unshift(E+C|0),l[4]=l[4]+E|0}for(let c=0;c<8;c++)s[c]=s[c]+l[c]|0}return s.map(a=>(a>>>0).toString(16).padStart(8,"0")).join("")}var Bo,V,Fn=R(()=>{"use strict";Bo=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),V=(t,e)=>t>>>e|t<<32-e});function Dn(t){let e=t.split(".");if(e.length!==4)return;let n=[];for(let r of e){if(!Vo.test(r)||Number(r)>255)return;n.push(Number(r))}return n}function zo(t){if(t.includes("%"))return;let e=t,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let u=Dn(r);if(!u)return;e=`${t.slice(0,n+1)}${(u[0]<<8|u[1]).toString(16)}:${(u[2]<<8|u[3]).toString(16)}`}let o=e.split("::");if(o.length>2)return;let s=u=>{if(u==="")return[];let f=[];for(let h of u.split(":")){if(!Ko.test(h))return;f.push(parseInt(h,16))}return f},i=s(o[0]),a=o.length===2?s(o[1]):[];if(!i||!a)return;let l=i.length+a.length;return(o.length===2?l>7:l!==8)?void 0:[...i,...Array(8-l).fill(0),...a].flatMap(u=>[u>>8,u&255])}function Hn(t){return t.includes(":")?zo(t):Dn(t)}function Nn(t){if(typeof t!="string")return;let e=Hn(t.trim());return e&&Xo(e)?e.slice(12):e}function Yo(t){let e=typeof t=="string"?[t]:Array.isArray(t)?t:[],n=[];for(let r of e){if(typeof r!="string")continue;let o=r.trim(),s=o.indexOf("/");if(s<0){let l=Nn(o);l&&n.push({bytes:l,bits:l.length*8});continue}let i=Hn(o.slice(0,s)),a=o.slice(s+1);!i||!Go.test(a)||Number(a)>i.length*8||n.push({bytes:i,bits:Number(a)})}return n}function Jo(t,e){if(t.bytes.length!==e.length)return!1;for(let n=0;n<t.bits;n+=8){let o=255<<8-Math.min(8,t.bits-n)&255,s=n/8;if((t.bytes[s]&o)!==(e[s]&o))return!1}return!0}function qn(t,e,n,r){switch(t){case"array_contains_any":case"array_contains_all":case"array_contains_none":{if(!Array.isArray(e)||!Array.isArray(n))return!1;let o=n.filter(s=>e.some(i=>r(i,s))).length;return t==="array_contains_any"?o>0:t==="array_contains_all"?o===n.length:o===0}case"ip_in_cidr":case"ip_not_in_cidr":{let o=Nn(e),s=Yo(n);return!o||!s.length?!1:s.some(i=>Jo(i,o))===(t==="ip_in_cidr")}}return!1}var Vo,Ko,Go,Xo,Wn=R(()=>{"use strict";Vo=/^(0|[1-9]\d{0,2})$/,Ko=/^[0-9a-fA-F]{1,4}$/,Go=/^(0|[1-9]\d*)$/;Xo=t=>t.length===16&&t.slice(0,10).every(e=>e===0)&&t[10]===255&&t[11]===255});function ts(t){let e=Qo.exec(t.trim());return e?Number(e[1])*es[e[2]]:void 0}function Bn(t,e,n){if(typeof t=="number")return t*1e3;if(typeof t!="string")return;let r=t.trim();if(n){let s=ts(r);if(s!==void 0)return e-s*1e3}if(!Zo.test(r)&&!Un.test(r))return;let o=Date.parse(Un.test(r)?`${r}T00:00:00Z`:r);return Number.isNaN(o)?void 0:o}function Vn(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=t[n]??0,o=e[n]??0;if(r!==o)return r<o?-1:1}return 0}function ns(t,e,n){if(typeof e!="string")return;let r=e.trim().replace(/^v/,"").split(".");if(t==="semver_wildcard"){let c=r[r.length-1];if(c!=="*"&&c!=="x"&&c!=="X")return;if(r.length===1)return[[0],[2**30]];let u=n.parseVersion(r.slice(0,-1).join("."));if(!u)return;let f=[...u];return f[f.length-1]=f[f.length-1]+1,[u,f]}let o=n.parseVersion(e);if(!o)return;for(;o.length<3;)o.push(0);let[s,i,a]=o,l;return t==="semver_tilde"&&r.length===1?l=[s+1,0,0]:t==="semver_tilde"||s===0&&i>0?l=[s,i+1,0]:s>0?l=[s+1,0,0]:l=[0,0,a+1],[o,l]}function Kn(t,e,n,r,o){switch(t){case"icontains":case"not_icontains":case"starts_with":case"not_starts_with":case"ends_with":case"not_ends_with":return typeof e!="string"||typeof n!="string"?!1:t.endsWith("icontains")?e.toLowerCase().includes(n.toLowerCase())===(t==="icontains"):t.endsWith("starts_with")?e.startsWith(n)===(t==="starts_with"):e.endsWith(n)===(t==="ends_with");case"between":case"not_between":{let s=o.toFloat(e);if(!Array.isArray(n)||n.length!==2||s===void 0)return!1;let[i,a]=n;return typeof i!="number"||typeof a!="number"?!1:(s>=i&&s<=a)==(t==="between")}case"is_date_before":case"is_date_after":{let s=Bn(e,r,!1),i=Bn(n,r,!0);return s===void 0||i===void 0?!1:t==="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(e,n);if(s===void 0)return!1;let i=t.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(e),i=ns(t,n,o);return!!s&&!!i&&Vn(s,i[0])>=0&&Vn(s,i[1])<0}}return!1}var Zo,Un,Qo,es,Gn=R(()=>{"use strict";Zo=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/,Un=/^\d{4}-\d{2}-\d{2}$/,Qo=/^-?(\d{1,6})([hdwmy])$/,es={h:3600,d:86400,w:604800,m:2592e3,y:31536e3}});function ht(t){if(typeof t=="number")return t;if(typeof t=="string"&&rs.test(t.trim()))return Number(t.trim())}function yt(t,e){let n=typeof t=="number",r=typeof e=="number";return n||r?n&&r&&t===e:t===e}function _t(t){if(typeof t!="string")return;let e=t.trim().replace(/^v/,""),n=e.search(/[-+]/);n>=0&&(e=e.slice(0,n));let r=[];for(let o of e.split(".")){if(!/^[+-]?\d+$/.test(o))return;let s=parseInt(o,10);if(s<0)return;r.push(s)}return r}function vt(t,e){let n=_t(t),r=_t(e);if(!(!n||!r)){for(let o=0;o<Math.max(n.length,r.length);o++){let s=n[o]??0,i=r[o]??0;if(s!==i)return s<i?-1:1}return 0}}function ee(t,e,n,r,o,s=Date.now()){let i=n&&e!==null&&e!==void 0;if(t==="is_set")return i;if(t==="is_not_set")return!i;if(!i)return!1;switch(t){case"eq":case"neq":{let a;if(o){let l=vt(e,r);if(l===void 0)return!1;a=l===0}else a=yt(e,r);return a===(t==="eq")}case"contains":case"ncontains":case"regex":case"nregex":{if(typeof e!="string"||typeof r!="string")return!1;if(t==="contains"||t==="ncontains")return e.includes(r)===(t==="contains");let a;try{a=new RegExp(r)}catch{return!1}return a.test(e)===(t==="regex")}case"gt":case"gte":case"lt":case"lte":{let a;if(o)a=vt(e,r);else{let l=ht(e),c=ht(r);a=l===void 0||c===void 0?void 0:os(l,c)}return a===void 0?!1:t==="gt"?a>0:t==="gte"?a>=0:t==="lt"?a<0:a<=0}case"in":case"not_in":return Array.isArray(r)?r.some(a=>yt(e,a))===(t==="in"):!1}return t.startsWith("array_")||t.startsWith("ip_")?qn(t,e,r,yt):Kn(t,e,r,s,{toFloat:ht,parseVersion:_t,cmpVersion:vt})}var rs,os,bt=R(()=>{"use strict";Wn();Gn();rs=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;os=(t,e)=>t<e?-1:t>e?1:0});function xt(t){return t.properties?.length?`${t.key}|${JSON.stringify(t.properties.map(e=>[e.key,e.op,e.value??null]))}`:t.key}function zn(t,e,n=Date.now()){return(t.properties??[]).every(r=>ee(r.op,e[r.key],Object.hasOwn(e,r.key),r.value,!1,n))}function kt(t,e){let n=e[t.scope??"session"]?.[xt(t)]??0;return t.op==="is_set"?n>0:t.op==="is_not_set"?n===0:ee(t.op,n,!0,t.value,!1)}function Yn(t,e,n){for(let s of t.runtime??[])if(s.filters.every(a=>{if(a.type!=="flag")return kt(a,e);let l=n(a.key);return!!l&&ee(a.op,l.value,!0,a.value,!1)}))return Yn(s.result,e,n);if(!t.runtime)return t;let{runtime:r,...o}=t;return o}function St(t,e){let n={},r=new Map,o=s=>{if(r.get(s)===2)return n[s];let i=t[s];if(!i||r.get(s)===1)return;r.set(s,1);let a=Yn(i,e,o);return n[s]=a,r.set(s,2),a};for(let s of Object.keys(t))o(s);return n}function We(t,e){let n=[],r=s=>{s.type==="event"&&s.properties?.length&&n.push(s)};for(let s of t??[])for(let i of s.conditions)for(let a of i.filters??[])r(a);let o=s=>{for(let i of s.runtime??[])i.filters.forEach(r),o(i.result)};return Object.values(e).forEach(o),n}function Ue(t,e){if(!wt(e))return e;let n=wt(t)?{...t}:{};for(let[r,o]of Object.entries(e))o===null?delete n[r]:n[r]=Ue(n[r],o);return n}var Xn,wt,_e,Et=R(()=>{"use strict";bt();Xn=t=>(t??[]).filter(e=>e.type==="event");wt=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);_e=class{session={};page={};sid="";constructor(e){if(e&&typeof e.sid=="string"&&wt(e.session)){this.sid=e.sid;for(let[n,r]of Object.entries(e.session))typeof r=="number"&&r>0&&(this.session[n]=r)}}record(e,n,r={},o=[]){n!==this.sid&&(this.sid=n,this.session={},this.page={}),e==="$pageview"&&(this.page={});let s=new Set([e]);for(let i of o)i.type==="event"&&i.key===e&&i.properties?.length&&zn(i,r)&&s.add(xt(i));for(let i of s)this.session[i]=(this.session[i]??0)+1,this.page[i]=(this.page[i]??0)+1}counts(e){return e===this.sid?{session:{...this.session},page:{...this.page}}:{session:{},page:{}}}saved(){return{sid:this.sid,session:{...this.session}}}}});function Jn(t,e){let n=e?t.contexts?.[e]:void 0;if(n)return n;if(e==="user")return{key:t.bucketing_key||t.distinct_id,properties:t.person_properties};if(e==="device")return{key:t.device_id,properties:t.device_properties}}function be(t,e,n,r=!1){let o=r?`${t}.${e}.variant.${n}`:`${t}.${e}.${n}`;return parseInt(Ln(o).slice(0,13),16)/is}function as(t,e){return typeof e=="boolean"?typeof t=="boolean"?t===e:e:t===e}function cs(t,e,n){let r=e.now?Date.parse(e.now):NaN,o=Number.isNaN(r)?Date.now():r,s;switch(t.type){case"person":s=e.person_properties;break;case"group":s=e.group_properties?.[t.group_type??""];break;case"device":s=e.device_properties;break;case"geo":s=e.geo_properties;break;case"context":if(!ss.includes(t.context_kind??""))return!1;s=Jn(e,t.context_kind)?.properties;break;case"app_version":return ee(t.op,e.app_version,!!e.app_version,t.value,!0,o);case"flag":{let i=n[t.key];return!!i&&ee(t.op,i.value,!0,t.value,!1,o)}default:return!1}return ee(t.op,s?.[t.key],!!s&&Object.hasOwn(s,t.key),t.value,!1,o)}function ls(t,e,n){let r=t.variants;if(e.variant_override){let i=r.find(a=>a.key===e.variant_override);if(i)return i}let o=be(t.key,t.salt,n,!0)*100,s=0;for(let i of r)if(s+=i.rollout_pct,o<s)return i;return r[r.length-1]}function Zn(t,e){return Qn(t.aggregation,e)}function Qn(t,e){return t.kind==="group"?e.groups?.[t.group_type??""]:t.kind==="device"?e.device_id:t.kind==="context"?Jn(e,t.context_kind)?.key:e.bucketing_key||e.distinct_id}function us(t,e,n,r){let o=t.sticky?r.sticky_assignments?.[t.key]:void 0;if(o===void 0)return;let s={value:!0,reason:"sticky_bucket",condition_index:n};if(t.type==="multivariate"&&t.variants?.length){if(t.variants.some(a=>a.key===e.variant_override))return;let i=t.variants.find(a=>a.key===o);return i?(s.value=s.variant=i.key,Ve(s,i.payload,e)):void 0}if(o===!0)return Ve(s,t.type==="json"?t.payload:void 0,e)}function Ve(t,e,n){let r=n.payload_patch===void 0||n.payload_patch===null?e:Ue(e,n.payload_patch);return r!==void 0&&(t.payload=r),t}function ds(t,e){return!t.app_contexts?.length||!e.app_contexts?.length?!0:t.app_contexts.some(n=>e.app_contexts?.includes(n))}function er(t,e,n={}){if(!ds(t,e))return H("app_context_excluded");if(!t.active)return H("inactive");if(t.kill_switch)return H("kill_switch");let r=!1;for(let l of t.prerequisites??[]){let c=n[l.flag];if(!c)return H("prerequisite_missing");if(c.reason==="requires_server")r=!0;else if(c.reason==="prerequisite_cycle"||!as(c.value,l.value))return H("prerequisite_failed")}if(r)return H("requires_server");let o=Zn(t,e),s=t.conditions.some(l=>l.aggregation);if(!o&&(!s||t.holdout||t.namespace))return H("no_bucketing_key");if(t.holdout&&be("holdout",t.holdout.salt,o??"")*100<t.holdout.percentage)return H("holdout");if(t.namespace&&t.namespace.total>0){let l=Math.floor(be("namespace",t.namespace.salt,o??"")*t.namespace.total);if(l<t.namespace.start||l>=t.namespace.end)return H("namespace_excluded")}let i=0,a=[];for(let[l,c]of t.conditions.entries()){let u=c.aggregation?Qn(c.aggregation,e):o;if(!u){i++;continue}let f=!1,h=!0,m=!1;for(let y of c.filters??[]){if(y.type==="event"){if(e.runtime_events===void 0)m=!0;else if(!kt(y,e.runtime_events)){h=!1;break}continue}let w=y.type==="cohort"?e.cohorts?.[y.key]:void 0;if(w!==void 0){if(w===(y.op==="not_in"||y.op==="neq")){h=!1;break}}else if(y.type==="cohort"||y.type==="flag"&&n[y.key]?.reason==="requires_server")f=!0;else if(!cs(y,e,n)){h=!1;break}}if(!h)continue;if(f)return Ct(H("requires_server",l),a);let b=ps(t,c,l,e,u);if(b)if(m)a.push({filters:Xn(c.filters),result:b});else return Ct(b,a)}return Ct(H(i>0&&i===t.conditions.length?"no_bucketing_key":"no_condition_match"),a)}function ps(t,e,n,r,o){let s=e.aggregation?void 0:us(t,e,n,r);if(s)return s;if(be(t.key,t.salt,o)*100>=e.rollout_pct)return t.early_exit?H("out_of_rollout",n):void 0;let i={value:!0,reason:"condition_match",condition_index:n};if(t.type==="multivariate"&&t.variants?.length){let a=ls(t,e,o);return i.value=i.variant=a.key,Ve(i,a.payload,e)}return Ve(i,t.type==="json"?t.payload:void 0,e)}function tr(t){return[...(t.prerequisites??[]).map(e=>e.flag),...t.conditions.flatMap(e=>(e.filters??[]).filter(n=>n.type==="flag").map(n=>n.key))]}function Rt(t,e){let n=new Map(t.map(i=>[i.key,i])),r={},o=new Map,s=i=>{let a=n.get(i);if(!a||o.has(i))return;o.set(i,1);let l=!1;for(let c of tr(a))s(c),(o.get(c)===1||r[c]?.reason==="prerequisite_cycle")&&(l=!0);r[i]=l?H("prerequisite_cycle"):fs(a,e,r),o.set(i,2)};for(let i of t)s(i.key);return r}function fs(t,e,n){return Be(t,e,n,[],new Set)}function Be(t,e,n,r,o){let[s,...i]=r;if(s===void 0){let b=new Set,y=new Proxy(n,{get:(C,M)=>(b.add(String(M)),C[M])}),w=er(t,e,y),E=[];for(let C of tr(t))b.has(C)&&!o.has(C)&&!E.includes(C)&&n[C]?.runtime?.length&&E.push(C);return E.length?Be(t,e,n,E,new Set([...o,...E])):w}let a=Be(t,e,n,i,o),l=n[s],c=new Set([l.value]),u=[];for(let b of nr(l)){if(c.has(b.value))continue;c.add(b.value);let y=Be(t,e,{...n,[s]:b},i,o);rr(y,a)||u.push({filters:[{type:"flag",key:s,op:"eq",value:b.value}],result:y})}let f=[...u,...a.runtime??[]],{runtime:h,...m}=a;return f.length?{...m,runtime:f}:m}function nr(t){return(t.runtime??[]).flatMap(e=>{let{runtime:n,...r}=e.result;return[r,...nr(e.result)]})}function rr(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t===null||e===null||Array.isArray(t)!==Array.isArray(e))return!1;let n=t,r=e,o=new Set([...Object.keys(n),...Object.keys(r)]);for(let s of o)if(!rr(n[s],r[s]))return!1;return!0}var ss,is,H,Ct,Pt,$t,or=R(()=>{"use strict";bt();Et();Fn();ss=["user","device","org"],is=16**13;H=(t,e=-1)=>({value:!1,reason:t,condition_index:e});Ct=(t,e)=>e.length?{...t,runtime:e}:t;Pt=t=>t.reason==="requires_server",$t=t=>t.reason!=="app_context_excluded"});function Ot(t){let e=Object.keys(t);if(e.length===0)return{};let n={};for(let r of e)n[`$feature/${r}`]=t[r];return n.$active_feature_flags=e.filter(r=>t[r]!==!1).sort(),n}var sr=R(()=>{"use strict"});function ie(t,e,n,r){return{key:t,value:e,enabled:e!==void 0&&e!==!1,...typeof e=="string"?{variant:e}:{},...n!==void 0?{payload:n}:{},reason:e===void 0?"not_found":r}}var we,ir=R(()=>{"use strict";we=class{constructor(e,n=Date.now){this.ttlMs=e;this.now=n}ttlMs;now;stamp;mark(e){return this.stamp={at:this.now(),id:e}}restore(e){typeof e?.at=="number"&&typeof e.id=="string"&&(this.stamp={at:e.at,id:e.id})}fresh(e){return!!this.ttlMs&&this.ttlMs>0&&!!this.stamp&&this.stamp.id===e&&this.now()-this.stamp.at<this.ttlMs}clear(){this.stamp=void 0}}});function ws(t){let e=ys;for(let n of bs.encode(t))e=(e^BigInt(n))*vs&_s;return e}function ur(t){let e=(t.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).filter(o=>Se(o).length>=2);if(!e.length)return;let n=new Array(64).fill(0);for(let o of e){let s=ws(o);for(let i=0;i<64;i++)n[i]=(n[i]??0)+((s>>BigInt(i)&1n)===1n?1:-1)}let r=0n;for(let o=0;o<64;o++)(n[o]??0)>0&&(r|=1n<<BigInt(o));return r.toString(16).padStart(16,"0")}function dr(t){let n=` ${t.toLowerCase().replace(/’/g,"'").replace(/[.,!?;:]/g," ").replace(/\s+/g," ").trim()} `,r=0;for(let s of cr)n.includes(` ${s} `)&&(r++,n=n.split(` ${s} `).join(" "));let o=lr.filter(s=>n.includes(` ${s} `)).length;return r>o?-1:o>r?1:0}function xs(t){let e=pr(t);if(e.length<13||e.length>19)return!1;let n=0;return e.reverse().forEach((r,o)=>n+=o%2===1?r>4?r*2-9:r*2:r),n%10===0}function Ss(t){let e=pr(t).length;return e>=10&&e<=15}function Mt(t){let e=t;for(let[n,r]of ks)e=e.replace(n,o=>r(o)?Es(o):o);return e===t?void 0:e}function fr(t){if(typeof t!="string")return;let e=t.toLowerCase();return/^[0-9a-f]{32}$/.test(e)?e:void 0}function Cs(t,e,n){let r=It(e,n),o=Mt(r);return o===void 0?{[t]:r}:{[t]:o,$ai_text_redacted:!0}}function mr(t,e,n,r){if(t!=="user"&&t!=="assistant")return;let o={$ai_role:t,$ai_message_index:n,$ai_text_length:Se(e).length};if(t==="user"){let s=ur(e);s!==void 0&&(o.$ai_text_hash=s),o.$ai_sentiment=dr(e)}return r?{...o,...Cs("$ai_text",e,ms)}:o}function hr(t,e){let n=t.value;if(t.kind==="thumbs"&&n!==1&&n!==-1||t.kind==="rating"&&!(Number.isInteger(n)&&n>=1&&n<=5)||t.kind!=="thumbs"&&t.kind!=="rating"&&t.kind!=="comment")return;let r={$ai_feedback_kind:t.kind};if(t.kind!=="comment"&&(r.$ai_feedback_value=n),t.comment&&e){let o=It(t.comment,hs);r.$ai_feedback_comment=Mt(o)??o}return t.messageIndex!==void 0&&(r.$ai_message_index=t.messageIndex),r}function At(t,e){let n=gr(t),r=xe(e,64);return{...n?{$ai_outcome:n}:{},...r?{$ai_resolution:r}:{}}}function Rs(){let t=globalThis.crypto,e=new Uint8Array(16);if(t?.getRandomValues)t.getRandomValues(e);else for(let r=0;r<16;r++)e[r]=Math.floor(Math.random()*256);e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let n=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function yr(t={}){let e={$ai_conversation_id:t.conversationId||Rs()},n=(r,o)=>{o!==void 0&&(e[r]=o)};return n("$ai_agent_name",xe(t.agentName,128)),n("$ai_agent_version",xe(t.agentVersion,64)),n("$ai_topic",xe(t.topic,128)),n("$ai_use_case",xe(t.useCase,128)),n("$ai_trace_id",fr(t.traceId)),e}var ue,gs,ms,hs,cr,lr,Se,It,ys,vs,_s,bs,pr,ar,ks,Es,gr,xe,ke,vr=R(()=>{"use strict";ue={started:"$ai_conversation_started",message:"$ai_message",feedback:"$ai_feedback",ended:"$ai_conversation_ended",outcome:"$ai_outcome"},gs=["resolved","unresolved","escalated","abandoned","error"],ms=4e3,hs=2e3,cr=["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"],lr=["thanks","thank you","great","perfect","awesome","helpful","that worked","works now","solved","exactly"],Se=t=>Array.from(t),It=(t,e)=>Se(t).slice(0,e).join(""),ys=0xcbf29ce484222325n,vs=0x100000001b3n,_s=0xffffffffffffffffn,bs=new TextEncoder;pr=t=>Se(t).filter(e=>e>="0"&&e<="9").map(Number);ar=String.raw`[\p{Alphabetic}\p{M}\p{Nd}\p{Pc}\p{Join_Control}]`,ks=[[new RegExp(String.raw`(?<!${ar})\p{Nd}(?:[ -]?\p{Nd}){12,18}(?!${ar})`,"gu"),xs],[/[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,Ss]];Es=t=>Se(t).map(e=>/\s/u.test(e)?e:"*").join("");gr=t=>typeof t=="string"&&gs.includes(t)?t:void 0,xe=(t,e)=>typeof t=="string"&&t?It(t,e):void 0;ke=class{next=0;common;emit;captureText;constructor(e,n={},r=!1){this.emit=e,this.captureText=r,this.common=yr(n)}get id(){return this.common.$ai_conversation_id}send(e,n){this.emit(e,{...this.common,...n})}start(){return this.send(ue.started,{}),this}message(e,n,r={}){let o=r.index??this.next,s=mr(e,n,o,this.captureText);return s?(this.next=o+1,this.send(ue.message,s),!0):!1}feedback(e){let n=hr(e,this.captureText);return n?(this.send(ue.feedback,n),!0):!1}end(e,n){this.send(ue.ended,At(e,n))}outcome(e,n){let r=At(e,n);return r.$ai_outcome?(this.send(ue.outcome,r),!0):!1}}});var de=R(()=>{"use strict";On();ct();In();Mn();Tn();jn();or();Et();sr();ir();vr()});function wr(t,e=90,n=Date.now){let r,o=()=>{try{return JSON.parse(t.get(br)??"{}")}catch{return{}}};return()=>{let s=o();if(location.search!==r){r=location.search;let a=new URLSearchParams(r),l=!1;for(let c of K){let u=a.get(c);u&&(s[c]={v:u.slice(0,512),t:n()},l=!0)}l&&t.set(br,JSON.stringify(s))}let i={};for(let a of K){let l=s[a];l&&n()-l.t<e*864e5&&(i[a]=l.v)}return i}}var K,br,Ee=R(()=>{"use strict";K=["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"],br="lc_click_ids"});function Ns(t){let e={},n=new URLSearchParams(location.search);for(let r of[...te,...K,...t]){let o=n.get(r);o&&(e[`$${r}`]=o)}return e}function Pr(t){if(!t)return;let e=Array.isArray(t)?{params:t}:{params:t.params??qs,...t.category?{category:t.category}:{}};return e.params.length?e:void 0}function $r(t){let e=new URLSearchParams(location.search);for(let n of t){let r=e.get(n);if(r)return r.slice(0,256)}}function Or(){let t=new URLSearchParams(location.search),e=te.map(n=>t.get(n)??"");return e.some(Boolean)?e.join("|"):void 0}function Ws(t){try{return t?new URL(t).hostname:""}catch{return""}}function Bs(){let t=location.hash;return t.length>1?location.pathname+t.split("?")[0]:location.pathname}function Ar(t,e,n=[],r=!1){let o={$current_url:Us(),$host:location.host,$pathname:r?Bs():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),t!=="$pageview")return{properties:o};let s=Ns(n);Object.assign(o,s);let i=e.$current_url??location.href,a=e.$referrer??document.referrer,l={$initial_referrer:a||"$direct",$initial_referring_domain:Ws(a)||"$direct",$initial_current_url:i};for(let[c,u]of Object.entries(s))l[`$initial_${c.slice(1)}`]=u;return{properties:o,$set_once:l}}var te,qs,Us,Ke=R(()=>{"use strict";Ee();te=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];qs=["ref","referral","via","aff"];Us=()=>location.href.replace(/([?&])__lc_toolbar=[^&#]*&?/,"$1").replace(/[?&]$/,"")});function Lr(t,e=Date.now){let n=t.eventsPerSecond??10,r=t.burst??100,o=r,s=e();return()=>{let i=e();return o=Math.min(r,o+(i-s)/1e3*n),s=i,o<1?!1:(o-=1,!0)}}var Fr=R(()=>{"use strict"});function Ys(t,e){let n=t;for(let r of e.pathRules??[])try{n=n.replace(typeof r.match=="string"?new RegExp(r.match):r.match,r.replace)}catch{}return e.maskPathIds?n.split("/").map(r=>Xs.some(o=>o.test(r))?":id":r).join("/"):n}function Ge(t,e){let n=t;if(e.pathRules?.length||e.maskPathIds){let o=/^((?:[a-z][a-z0-9+.-]*:)?\/\/[^/?#]*)?([^?#]*)([\s\S]*)$/i.exec(n);o&&(n=(o[1]??"")+Ys(o[2],e)+o[3])}let r=[...Gs,...e.maskParams??[],...e.maskCampaignParams?[...te,...K]:[]];if(r.length){let o=n.indexOf("#"),s=o<0?n:n.slice(0,o),i=o<0?"":n.slice(o);n=s.replace(new RegExp(`([?&])(${r.map(Dr).join("|")})=[^&]*`,"gi"),`$1$2=${Wt}`)+i}return e.stripHash&&(n=n.replace(/#.*$/,"")),n}function Ut(t){let e=new RegExp(`^\\$(initial_|last_)?(${[...te,...K].map(Dr).join("|")})$`),n=r=>{let o;if(t.maskCampaignParams)for(let[s,i]of Object.entries(r))typeof i=="string"&&e.test(s)?(o??={...r})[s]=Wt:s==="$click_ids"&&i&&typeof i=="object"&&((o??={...r})[s]=Object.fromEntries(Object.keys(i).map(a=>[a,Wt])));for(let s of zs){let i=(o??r)[s];if(typeof i!="string")continue;let a=Ge(i,t);a!==i&&((o??={...r})[s]=a)}if(typeof r.$elements_chain=="string"){let s=r.$elements_chain.replace(/href="((?:[^"\\]|\\.)*)"/g,(i,a)=>`href="${Ge(a,t)}"`);s!==r.$elements_chain&&((o??={...r}).$elements_chain=s)}return Array.isArray(r.$elements)&&((o??={...r}).$elements=r.$elements.map(s=>typeof s?.href=="string"?{...s,href:Ge(s.href,t)}:s)),o??r};return r=>({...r,properties:n(r.properties),...r.$set?{$set:n(r.$set)}:{},...r.$set_once?{$set_once:n(r.$set_once)}:{}})}var Wt,Gs,zs,Xs,Dr,Bt=R(()=>{"use strict";Ee();Ke();Wt="<masked>",Gs=["password","passwd","pwd","pass","token","access_token","refresh_token","id_token","secret","client_secret","api_key","apikey","key","auth","authorization","code","otp","email","ssn"],zs=["$pathname","$current_url","$referrer","$initial_referrer","$initial_current_url","$last_current_url"],Xs=[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,/^[0-9a-hjkmnp-tv-z]{26}$/i,/^\d{4,}$/,/^[0-9a-f]{16,}$/i,/^(?=.*\d)[a-z0-9_-]{20,}$/i],Dr=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});function Hi(t){return t.startsWith("re:")?t.slice(3):t.split("*").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*")}function sn(t,e){return!!t?.some(n=>{try{return new RegExp(Hi(n),"i").test(e)}catch{return!1}})}var po=R(()=>{"use strict"});de();var Ps=["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 _r(t,e=[]){let n=t.toLowerCase();return e.some(r=>r&&n.includes(r.toLowerCase()))?!0:Ps.some(r=>n.includes(r))&&!/\bcubot\b/.test(n)}Ee();function $s(t,e){let n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.textContent=t,n}function Os(){return Array.from(document.querySelectorAll("meta[http-equiv]")).filter(t=>t.getAttribute("http-equiv")?.toLowerCase()==="content-security-policy").map(t=>t.getAttribute("content")??"")}function kr(t){let e=new Map;for(let r of t.split(";")){let[o,...s]=r.trim().toLowerCase().split(/\s+/);o&&!e.has(o)&&e.set(o,s)}let n=e.get("style-src-elem")??e.get("style-src")??e.get("default-src");return!!n&&!(n.includes("'unsafe-inline'")&&!n.some(r=>r.startsWith("'nonce-")||r.startsWith("'sha")))}function Sr(t,e){if(typeof document>"u")return()=>{};!e&&Os().some(kr)&&t("CSP hint: this page's Content-Security-Policy blocks inline <style>; set the `nonce` option so guides and the experiment veil render (see the Content Security Policy help page)");let n=r=>{let o=r;/^style-src/.test(o.effectiveDirective??"")&&o.blockedURI==="inline"&&t(`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",n),()=>document.removeEventListener("securitypolicyviolation",n)}var As=(t,e)=>t.slice(0,e);function xr(t){try{let e=new URL(t);return e.protocol==="data:"||e.protocol==="blob:"?e.protocol:e.origin+e.pathname}catch{return As(t,64)}}function Tt(t,e={}){if(typeof document>"u")return()=>{};let n=e.maxPerPage??20,r=new Set,o=s=>{let i=s,a={$csp_directive:i.effectiveDirective??i.violatedDirective,$csp_blocked_uri:xr(i.blockedURI??""),$csp_source_file:i.sourceFile?xr(i.sourceFile):void 0,$csp_line:i.lineNumber||void 0,$csp_column:i.columnNumber||void 0,$csp_disposition:i.disposition},l=[a.$csp_directive,a.$csp_blocked_uri,a.$csp_source_file,a.$csp_line].join("|");r.has(l)||r.size>=n||(r.add(l),t("$csp_violation",Object.fromEntries(Object.entries(a).filter(([,c])=>c!==void 0))))};return document.addEventListener("securitypolicyviolation",o),()=>document.removeEventListener("securitypolicyviolation",o)}var Is=["chrome-extension:","moz-extension:","safari-web-extension:","ms-browser-extension:"],jt=()=>typeof location<"u"&&Is.includes(location.protocol),Ms=t=>new URL(t,location.href).href.replace(/\/+$/,""),Lt=(t,e,n)=>`${t.replace(/\/+$/,"")}/static/v${e}/${n}`,Ts={replay:"replay",heatmaps:"heatmaps",forms:"forms",toolbar:"toolbar",guides:"guides",inspector:"inspector",experiments:"visualChanges","early-access":"earlyAccess",consent:"consentModule"},js=t=>import(t);async function Ls(t,e,n=globalThis.fetch){try{let r=await n(Lt(t,e,"manifest.json"),{credentials:"omit"});if(!r.ok)return;let o=await r.json();return o&&typeof o.files=="object"&&o.files?o:void 0}catch{return}}async function Fs(t){let e=new Uint8Array(await crypto.subtle.digest("SHA-384",t));return`sha384-${btoa(String.fromCharCode(...e))}`}async function Ds(t,e,n,r=js,o=globalThis.fetch){let s=t.length?await Ls(e.assetHost,e.version,o):void 0;return(await Promise.all(t.map(async a=>{let l=Ts[a];if(!l)return n("unknown module",a);let c=Lt(e.assetHost,e.version,`${a}.js`);try{if(s){let f=s.files[`${a}.js`],h=f?await o(c,{credentials:"omit",cache:"force-cache"}):void 0;if(!h?.ok||await Fs(await h.arrayBuffer())!==f)return n("module refused, it does not match the manifest",a)}let u=(await r(c))[l];return typeof u=="function"?u:n("module has no export",a,l)}catch(u){return n("module failed to load",a,u)}}))).filter(a=>!!a)}function Er(t,e,n){let r=e.find(i=>t.startsWith(`${i}/`));if(!r)return t;let o=t.slice(r.length),s=o.search(/[?#]/);return r+n(s<0?o:o.slice(0,s))+(s<0?"":o.slice(s))}function Cr(t,e,n,r){if(!r)return{transport:t,fetch:e};let o=s=>Er(s,n,r);return{transport:{send:(s,i,a)=>t.send(o(s),i,a)},fetch:((s,i)=>e(typeof s=="string"?o(s):s instanceof URL?o(s.href):s,i))}}var Hs="__LUCIDA_DEVTOOLS_HOOK__";function Rr(t,e,n){let r=globalThis[Hs];if(!(!r||typeof r.emit!="function"||typeof r.attach!="function")){t.onCapture(o=>{try{r.emit(o)}catch{}});try{r.attach({projectKeyPrefix:t.apiKey.slice(0,8),apiHost:n,distinctId:()=>e.distinctId,loadToolbar:o=>e.loadToolbar(o),startReplay:async()=>t.replay?(await t.replay.start(!0),t.replay.isRecording()):!1,replayUrl:()=>e.getReplayUrl()})}catch{}}}Ke();function Ft(t,e,n=globalThis){e&&(n[typeof e=="string"?e:"lucida"]=t,typeof CustomEvent=="function"&&n.dispatchEvent?.(new CustomEvent("lucida:ready",{detail:t})))}de();var pe=()=>{},Dt=()=>Promise.resolve(),Ir={isInternal:!1,hasOptedOut:()=>!1,hasOptedIn:()=>!1,consentStatus:()=>"pending",getConsentStatus:()=>"pending",getConsent:()=>({analytics:!1,replay:!1,marketing:!1}),getAllFlags:()=>({}),isFeatureEnabled:()=>!1,getFlagResult:t=>ie(t,void 0,void 0,"not_found"),getReplayUrl:()=>"",onSessionId:()=>pe,onFlags:()=>pe,onIntervention:()=>pe,onConsent:()=>pe,flush:Dt,shutdown:Dt,reloadFlags:Dt,loadToolbar:()=>Promise.resolve(!1),recommendations:t=>Promise.resolve({placement:t,strategy:"",items:[],shown:pe,clicked:pe})};function Mr(t){return new Proxy(()=>{},{get:(e,n)=>{if(!(typeof n!="string"||n==="then"))return t&&Object.hasOwn(Ir,n)?Ir[n]:Mr(!1)}})}var Ht=()=>Mr(!0);var Nt="_lcid";var Tr=(t,e)=>e.some(n=>{let r=n.replace(/^\./,"").toLowerCase();return t.toLowerCase()===r||t.toLowerCase().endsWith(`.${r}`)}),Vs=(t,e=Date.now(),n)=>`${t}.${e.toString(36)}${n?`_${n}`:""}`;function Ks(t,e=Date.now()){let n=t.lastIndexOf("."),[r="",o]=t.slice(n+1).split("_",2),s=/^[0-9a-z]+$/.test(r)?parseInt(r,36):NaN,i=t.slice(0,n);if(n>0&&i.length<=200&&s<=e+5e3&&e-s<=12e4)return o&&/^[\w-]{1,64}$/.test(o)?{distinctId:i,sessionId:o}:{distinctId:i}}function jr(t){if(!t?.length)return;let e=new URL(location.href),n=e.searchParams.get(Nt);if(n!==null){e.searchParams.delete(Nt),history.replaceState(history.state,"",e.toString());try{if(document.referrer&&!Tr(new URL(document.referrer).hostname,t))return}catch{return}return Ks(n)}}var qt=t=>{let e=t.config.crossDomains;if(!e?.length)return;let n=r=>{let o=r.target instanceof Element?r.target.closest("a[href]"):null;if(!o||!t.core.hasConsent("analytics"))return;let s=o;if(!/^https?:$/.test(s.protocol)||s.host===location.host||!Tr(s.hostname,e))return;let i=new URL(s.href);i.searchParams.set(Nt,Vs(t.client.distinctId,Date.now(),t.core.sessionId)),s.href=i.toString()};return document.addEventListener("click",n,!0),document.addEventListener("auxclick",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("auxclick",n,!0)}};Fr();Bt();function Js(t,e,n){let r=e;for(let o of t)try{let s=o(r);if(s==null)return null;if(typeof s!="object"||typeof s.event!="string")return n("beforeSend hook returned a non-event, dropping:",typeof s),null;r=s}catch(s){return n("beforeSend hook threw, dropping event:",s),null}return r}function qr(t,e=Math.random){return n=>t>=1?n:t<=0||e()>=t?null:{...n,properties:{...n.properties,$sample_rate:t}}}function Wr(t){let e=new Set(t),n=r=>Object.fromEntries(Object.entries(r).filter(([o])=>!e.has(o)));return r=>({...r,properties:n(r.properties),...r.$set?{$set:n(r.$set)}:{},...r.$set_once?{$set_once:n(r.$set_once)}:{}})}var Vt="lc_person_identified",ze="lc_pending_set_once",Hr=new Set(["$identify","$create_alias","$groupidentify"]),Nr="$$client_ingestion_warning",Zs=6e4,Kt=class{constructor(e,n){this.mode=e;this.storage=n;this.identified=n.get(Vt)==="1";try{this.pending=JSON.parse(n.get(ze)??"{}")}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(Vt,"1"))}personless(e){return this.mode==="always"?!1:(this.mode==="never"||!this.identified)&&!Hr.has(e)}stash(e){if(this.mode!=="identified_only"||!e)return;let n=Object.entries(e).filter(([r])=>!(r in this.pending));n.length&&(this.pending={...this.pending,...Object.fromEntries(n)},this.storage.set(ze,JSON.stringify(this.pending)))}take(){if(!Object.keys(this.pending).length)return;let e=this.pending;return this.pending={},this.storage.remove(ze),e}reset(){this.identified=!1,this.pending={},this.storage.remove(Vt),this.storage.remove(ze)}};function Qs(t,e){let n=e,r;if(t.person.personless(e.event)){t.person.stash(e.$set_once);let{$set:s,$set_once:i,$unset:a,...l}=e;n={...l,properties:{...e.properties,$process_person_profile:!1}}}else(r=t.person.take())&&(n={...e,$set_once:{...e.$set_once,...r}});let o=t.hooks.length?Js(t.hooks,n,t.log):n;return o&&t.limit&&!t.limit()&&(t.log("rate limited, dropped",o.event),t.onLimited?.(),o=null),!o&&r&&t.person.stash(r),o}function ei(t){let e=t.beforeSend?Array.isArray(t.beforeSend)?t.beforeSend:[t.beforeSend]:[];return[Ut(t.urlPrivacy??{}),...t.propertyDenylist?.length?[Wr(t.propertyDenylist)]:[],...t.sampleRate!==void 0?[qr(t.sampleRate)]:[],...e]}function Ur(t,e,n,r=Date.now){let o=new Kt(e.personProfiles??"always",t.storage),s,i,a=0,l=-1/0,c=()=>{a+=1,!(r()-l<Zs)&&(l=r(),queueMicrotask(()=>{let u=a;a=0,t.capture(Nr,{$$client_ingestion_warning_message:`client rate limit dropped ${u} event(s)`,$dropped_count:u})}))};return t.setFilter(u=>(e.rateLimit!==s&&(s=e.rateLimit,i=s?Lr(s):void 0),Qs({hooks:ei(e),person:o,limit:u.event===Nr?void 0:i,log:n,onLimited:c},u))),o}var Gt=class{m=new Map;get(e){return this.m.get(e)??null}set(e,n){this.m.set(e,n)}remove(e){this.m.delete(e)}},ti=365,ni=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(" ")),ri=new Set("co com net org edu gov gob go ac or ne ltd plc sch mil nom".split(" "));function oi(t){let e=t.toLowerCase().split(".");for(let n=1;n<e.length-1;n++)if(ni.has(e.slice(n).join("."))||n===e.length-2&&e[n+1].length===2&&ri.has(e[n]))return e.slice(n-1).join(".")}function si(t=location.hostname){if(/^[\d.]+$/.test(t)||t.includes(":"))return;let e=t.split(".");for(let n=e.length-2;n>=0;n--){let r=e.slice(n).join(".");if(document.cookie=`__lc_probe=1; Domain=${r}; Path=/; Max-Age=10; SameSite=Lax`,document.cookie.includes("__lc_probe=1"))return document.cookie=`__lc_probe=; Domain=${r}; Path=/; Max-Age=0`,r}return oi(t)}var Xe=class{constructor(e={}){this.o=e}o;domain=null;attr(){if(this.domain===null)try{this.domain=this.o.domain??(this.o.crossSubdomain?si():void 0)}catch{this.domain=void 0}return this.domain?`; Domain=${this.domain}`:""}held=new Map;read(e){try{for(let n of document.cookie.split("; ")){let r=n.indexOf("=");if(n.slice(0,r)===e)return decodeURIComponent(n.slice(r+1))}}catch{}return null}get(e){return this.read(e)??this.held.get(e)??null}set(e,n){let r=this.o.secure??location.protocol==="https:"?"; Secure":"",o=Math.round((this.o.expiryDays??ti)*86400);try{document.cookie=`${e}=${encodeURIComponent(n)}; Max-Age=${o}; Path=/${this.attr()}; SameSite=Lax${r}`}catch{}this.read(e)===n?this.held.delete(e):this.held.set(e,n)}remove(e){this.held.delete(e);try{document.cookie=`${e}=; Max-Age=0; Path=/${this.attr()}; SameSite=Lax`}catch{}}},fe=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,n){try{this.store()?.setItem(e,n)}catch{}}remove(e){try{this.store()?.removeItem(e)}catch{}}},zt=class extends fe{constructor(){super("localStorage")}},ii=["lc_identity","lc_session","lc_device_id","lc_consent","lc_person_identified"],Xt=class{constructor(e,n,r){this.cookie=e;this.local=n;this.cookieKeys=r}cookie;local;cookieKeys;get(e){let[n,r]=this.cookieKeys(e)?[this.cookie,this.local]:[this.local,this.cookie];return n.get(e)??r.get(e)}set(e,n){this.local.set(e,n),this.cookieKeys(e)?this.cookie.set(e,n):this.cookie.remove(e)}remove(e){this.local.remove(e),this.cookie.remove(e)}},Ye=class{constructor(e,n){this.inner=e;this.delayMs=n}inner;delayMs;pending=new Map;timer;get(e){return this.pending.has(e)?this.pending.get(e)??null:this.inner.get(e)}set(e,n){this.queue(e,n)}remove(e){this.queue(e,null)}queue(e,n){this.pending.set(e,n),this.timer??=setTimeout(()=>this.flush(),this.delayMs)}flush(){clearTimeout(this.timer),this.timer=void 0;for(let[e,n]of this.pending)n===null?this.inner.remove(e):this.inner.set(e,n);this.pending.clear()}},Yt=class{constructor(e,n){this.inner=e;this.suffix=n}inner;suffix;get(e){return this.inner.get(e+this.suffix)}set(e,n){this.inner.set(e+this.suffix,n)}remove(e){this.inner.remove(e+this.suffix)}},Je=t=>`_${t.replace(/\W/g,"").slice(-8)}`;function Ze(t,e,n){if(t==="memory"||t==="none")return new Gt;let r=Je(e),o=t==="cookie"?new Xe(n):t==="localStorage+cookie"?new Xt(new Xe(n),new zt,s=>ii.some(i=>s===i+r)):new fe(t);return new Yt(o,r)}function Br(t,e,n){let r=Je(e),o=new Set;try{for(let s of document.cookie.split("; "))o.add(s.split("=")[0]);for(let s of[globalThis.localStorage,globalThis.sessionStorage])for(let i=0;i<s.length;i++)o.add(s.key(i))}catch{}for(let s of o)if(!(!s.startsWith("lc_")||!s.endsWith(r)||s===n+r)){t.remove(s.slice(0,-r.length));try{localStorage.removeItem(s),sessionStorage.removeItem(s)}catch{}}}async function ai(t){if(!(typeof CompressionStream>"u"||typeof Response>"u"))try{let e=new Response(t).body?.pipeThrough(new CompressionStream("gzip"));return e?new Uint8Array(await new Response(e).arrayBuffer()):void 0}catch{return}}function Vr(t,e={}){let n=e.compress??!0,r=(o,s)=>(e.onError?.({url:o,status:s}),{status:s});return{async send(o,s,i){if(i?.beacon&&!e.disableBeacon&&typeof navigator<"u"&&navigator.sendBeacon)return navigator.sendBeacon(o,new Blob([s],{type:"text/plain"}))?{status:200}:r(o,0);try{let a=n&&s.length>=1024?await ai(s):void 0,l=await t(a?`${o}${o.includes("?")?"&":"?"}compression=gzip`:o,{method:"POST",body:a??s,headers:{...e.headers,"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",keepalive:(a?.length??s.length)<6e4});return l.status>=400?r(o,l.status):{status:l.status}}catch{return r(o,0)}}}}var Jt={send:async()=>({status:200})};var ci="lucida-browser",Kr="0.1.12",Zt="lc_internal",li=3e3,en="https://capture.lucidace.com",Qt=t=>!!t&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype;function tn(t,e={},n=[]){if(typeof window>"u"||typeof navigator>"u")return Ht();let r=!!e.debug||typeof location<"u"&&/[?&]__(lc|lucida)_debug=(1|true)/.test(location.search),o=(...d)=>{r&&console.debug("[lucida]",...d)},s=(e.apiHost??en).replace(/\/+$/,""),i=Object.fromEntries(Object.entries(e).map(([d,p])=>[d,Qt(p)?{...p}:p]));i.apiHost=s;let a=e.extension??jt(),l=d=>a&&(d==="cookie"||d==="localStorage+cookie")?e.extensionPersistence??"localStorage":d,c=l(e.cookieless==="always"?"none":e.persistence??"cookie"),u=[s,...e.flagsApiHost?[e.flagsApiHost.replace(/\/+$/,"")]:[]],f=e.fetch??((...d)=>fetch(...d)),h=d=>Cr(d,f,u,e.rewritePath),m=h(Jt).fetch,b=e.consent?.respectDnt,y=navigator.globalPrivacyControl===!0,w=(e.respectDnt??b)===!0&&navigator.doNotTrack==="1"||(e.respectGpc??b)===!0&&y,E=e.blockBots!==!1&&typeof navigator<"u"&&_r(navigator.userAgent??"",e.blockedUserAgents),C=!!e.disabled||E;E&&o("bot user agent: capture disabled");let M,q=h(e.transport??Vr(f,{headers:i.requestHeaders,onError:e.onRequestError,disableBeacon:e.disableBeacon})).transport;if(!e.transport&&e.offlineQueue!==!1&&c!=="memory"&&c!=="none"){let d=new Q(new fe(c==="sessionStorage"?"sessionStorage":"localStorage"),()=>v.hasConsent("analytics"));q=M=mt(q,d,{key:`lc_offline${Je(t)}`,isOnline:()=>navigator.onLine!==!1})}let A=C?void 0:jr(e.crossDomains),k=Ze(C?"memory":c,t,e.cookie),I=(e.storageWriteDelayMs??0)>0?new Ye(k,e.storageWriteDelayMs):void 0,O=A?.sessionId??e.bootstrap?.sessionId,N,T=!1,F,j=new Map,ae,G=[],v=new ve({apiKey:t,apiHost:s,transport:C?Jt:q,storage:I??k,...e.consentPersistence&&!C?{consentStorage:Ze(l(e.consentPersistence),t,e.cookie)}:{},persistProperty:d=>!i.persistedProperties||i.persistedProperties.includes(d),...c==="none"?{cookieless:!0}:{},library:{name:ci,version:Kr},consent:{...e.cookieless==="on_reject"?{cookielessOnReject:!0}:{},...e.consent,...!C&&(e.consent?.geo||e.consent?.mode!=="opt_in")?{awaitRemote:!0}:{},respectDnt:!0,dnt:w},queue:{...e.flushAt?{flushAt:e.flushAt}:{},...e.flushIntervalMs?{flushIntervalMs:e.flushIntervalMs}:{}},...A||e.bootstrap?.distinctId?{bootstrapDistinctId:A?.distinctId??e.bootstrap?.distinctId}:{},...e.bootstrap?.isIdentified&&!A?{bootstrapIdentified:!0}:{},session:{...e.session,...O?{bootstrapId:O}:{}},enrich:(d,p)=>{let g=Ar(d,p,i.customCampaignParams,e.capturePageview==="hash");if(s!==en&&(g.properties={...g.properties,$lib_custom_api_host:s}),G.length){let P=v.sessionId;for(let $ of G)g.properties={...g.properties,...$(P)}}if(d==="$pageview"){let P=v.sessionId;if(P!==F){let $=Pr(e.referralParams);if($&&(!$.category||j.get($.category)===!0)){F=P;let L=$r($.params);L&&(g.properties={...g.properties,$referral_code:L},g.$set_once={...g.$set_once,initial_referral_code:L})}}}let _=ae?.()??{},S=Object.keys(_);return S.length&&(g.properties={...g.properties,$click_ids:_},d==="$pageview"&&(g.$set_once={...Object.fromEntries(S.map(P=>[`$initial_${P}`,_[P]])),...g.$set_once},g.$set=Object.fromEntries(S.map(P=>[`$last_${P}`,_[P]])))),i.sendFeatureFlags!==!1&&d!=="$snapshot"&&N&&(g.properties={...Ot(N.all()),...g.properties}),T?{...g,properties:{...g.properties,$internal:!0}}:g},campaignKey:Or,log:o});T=v.storage.get(Zt)==="1",e.clickIds!==!1&&(ae=wr(v.storage,e.clickIds?.expiryDays));let D=Ur(v,i,o);e.bootstrap?.isIdentified&&D.markIdentified();let W=d=>D.blocksPersonWrites?(o(`personProfiles=never: ${d} ignored`),!0):!1;C||v.onChange(d=>{d!=="consent"||v.hasConsent("analytics")||v.consentStatus()!=="denied"||(I?.flush(),Br(k,t,e.consent?.storageKey||Oe))});let ce=new Set;v.onChange(d=>{d==="consent"&&[...ce].forEach(p=>p())});let ge=[],z=[Sr(o,e.nonce)],ne=v.storage;if(e.flagPersistence&&!C){let d=new Q(Ze(l(e.flagPersistence),t,e.cookie),()=>v.hasConsent("analytics"));v.onChange(p=>{p==="consent"&&(v.hasConsent("analytics")?d.flushBuffered():d.discardBuffered())}),ne=d}let re=d=>{if(C)return;if(v.hasConsent("analytics"))return d();let p=!1;v.onChange(g=>{!p&&g==="consent"&&v.hasConsent("analytics")&&(p=!0,d())})},me,x={core:v,client:void 0,config:i,flagStorage:ne,apiKey:t,log:o,fetch:m,onUnload:d=>{ge.push(d)},whenConsented:re,onCapture:d=>v.onCaptured(d),eventExtras:G,clickExtras:[],flagPersonProps:[],categoryGrants:j,loadConfig:()=>me??=new Promise(d=>re(()=>{m(`${s}/v1/config?api_key=${encodeURIComponent(t)}`).then(p=>p.ok?p.json():null).then(p=>(p&&v.applyRemote(p),p)).then(d,()=>d(null))}))},he=Promise.resolve();if(v.consent.resolving){let d=!1,p=m(`${s}/v1/config?api_key=${encodeURIComponent(t)}`,{credentials:"omit"}).then(g=>(d=g.status>=500,g.ok?g.json():null)).catch(()=>(d=!0,null));me=p,he=new Promise(g=>{let _=setTimeout(()=>(v.resolveConsent("opt_in"),g()),li);p.then(S=>{clearTimeout(_),S?v.applyRemote(S):d?v.resolveConsent("opt_in"):v.applyRemote({}),g()})})}let oe=gt(v,{apiHost:s,apiKey:t,fetch:m,whenConsented:re,log:o,disabled:C});z.push(()=>oe.stop());let J={get distinctId(){return v.distinctId},capture:(d,p,g)=>{v.capture(d,p,g?.timestamp!==void 0?{timestamp:g.timestamp}:{})&&(g?.sendInstantly||g?.transport)&&v.flush(g.transport==="beacon"?{beacon:!0}:{})},identify:(d,p,g)=>{W("identify")||(D.markIdentified(),v.identify(d,p,g))},alias:(d,p)=>{W("alias")||(D.markIdentified(),v.alias(d,p))},reset:d=>{v.reset({resetDeviceId:!!d,reuseAnonymousId:!!e.reuseAnonymousId}),D.reset()},createPersonProfile:()=>{W("createPersonProfile")||D.isProfile||(D.markIdentified(),v.capture("$set",{}))},setConfig:d=>{let p=i;for(let[g,_]of Object.entries(d)){let S=p[g];Qt(S)&&Qt(_)?Object.assign(S,_):p[g]=_}"debug"in d&&(r=!!d.debug)},setPersonProperties:(d,p)=>{!d&&!p||W("setPersonProperties")||(D.markIdentified(),v.capture("$set",{},{...d?{$set:d}:{},...p?{$set_once:p}:{}}))},unsetPersonProperties:d=>{!d.length||W("unsetPersonProperties")||(D.markIdentified(),v.capture("$set",{},{$unset:d}))},getDistinctId:()=>v.distinctId,getSessionId:()=>v.sessionId,onSessionId:d=>v.onSessionId(p=>d(p)),getProperty:d=>v.getProperty(d),hasOptedOut:()=>v.consentStatus()==="denied",hasOptedIn:()=>v.consentStatus()==="granted",onConsent:d=>(ce.add(d),()=>{ce.delete(d)}),getReplayUrl:d=>{let g=`${(e.uiHost??s).replace(/\/+$/,"")}/replays/${encodeURIComponent(v.sessionId)}`,_=v.sessionStart;return!d?.withTimestamp||_===void 0?g:`${g}?t=${Math.max(0,Math.round((Date.now()-_)/1e3-(d.timestampLookBackSeconds??10)))}`},debug:(d=!0)=>{r=d},featureView:(d,p)=>{v.capture("$feature_view",{...p,$feature_flag:d},{$set:{[`$feature_view/${d}`]:!0}})},featureInteraction:(d,p)=>{v.capture("$feature_interaction",{...p,$feature_flag:d},{$set:{[`$feature_interaction/${d}`]:!0}})},updateFlags:(d,p,g)=>x.flags?.update(d,p,g?.merge??!0),register:d=>v.register(d),registerOnce:d=>v.registerOnce(d),unregister:d=>v.unregister(d),group:(d,p,g)=>{D.markIdentified(),v.group(d,p,g)},optIn:(d=["analytics","replay"])=>v.setConsent({analytics:d.includes("analytics"),replay:d.includes("replay"),marketing:d.includes("marketing")}),optOut:()=>v.optOut(),optOutInternal:(d=!0)=>{T=d,d?v.storage.set(Zt,"1"):v.storage.remove(Zt)},get isInternal(){return T},setConsent:d=>v.setConsent(d),getConsent:()=>v.getConsent(),getConsentStatus:d=>v.getConsentStatus(d),consentStatus:()=>v.consentStatus(),getFlag:d=>x.flags?.get(d),getFlagPayload:d=>x.flags?.payload(d),getFlagResult:(d,p)=>x.flags?.result(d,p)??ie(d,void 0,void 0,"not_found"),getLayerParam:(d,p,g)=>x.flags?.layerParam(d,p)??g,isFeatureEnabled:d=>{let p=x.flags?.get(d);return p!==void 0&&p!==!1},onFlags:d=>x.flags?.onChange(d)??(()=>{}),onIntervention:d=>oe.on(d),reloadFlags:()=>x.flags?.reload()??Promise.resolve(),getAllFlags:()=>x.flags?.all()??{},overrideFlags:(d,p)=>x.flags?.override(d,p),setPersonPropertiesForFlags:(d,p)=>x.flags?.setPersonProperties(d,p),resetPersonPropertiesForFlags:()=>x.flags?.resetPersonProperties(),setGroupPropertiesForFlags:(d,p)=>x.flags?.setGroupProperties(d,p),resetGroupPropertiesForFlags:()=>x.flags?.resetGroupProperties(),setContext:(d,p,g)=>x.flags?.setContext(d,p,g),clearContext:d=>x.flags?.clearContext(d),guides:{showChangelog:()=>x.guides?.showChangelog()??0,show:d=>x.guides?.show(d)??!1,reset:d=>x.guides?.reset(d)},ai:{startConversation:d=>new ke((p,g)=>J.capture(p,g),d,i.ai?.captureText===!0).start()},earlyAccess:{list:()=>x.earlyAccess?.list()??Promise.resolve([]),optIn:d=>x.earlyAccess?.optIn(d),optOut:d=>x.earlyAccess?.optOut(d)},replay:{start:d=>x.replay?.start(d)??Promise.resolve(),stop:()=>x.replay?.stop(),pause:()=>x.replay?.pause(),resume:()=>x.replay?.resume(),tag:d=>x.replay?.tag(d),isRecording:()=>x.replay?.isRecording()??!1},consent:{showBanner:d=>x.consentUi?.showBanner(d)??Promise.resolve(null),hideBanner:()=>x.consentUi?.hideBanner()},loadToolbar:d=>x.toolbar?.load(typeof d=="string"?d:d.token)??Promise.resolve(!1),activateExperiment:d=>x.experiments?.activate(d),recommendations:(d,p)=>x.recs?.get(d,p)??Promise.resolve({placement:d,strategy:"",items:[],shown(){},clicked(){}}),flush:()=>he.then(()=>v.flush()),shutdown:async()=>{for(let d of z)d();I?.flush(),await v.shutdown()}};if(x.client=J,!C){let d=()=>{for(let g of ge)g();I?.flush(),v.flush({beacon:!0})};window.addEventListener("pagehide",d);let p=()=>{document.visibilityState==="hidden"&&v.flush({beacon:!0})};if(document.addEventListener("visibilitychange",p),z.push(()=>{window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",p)}),M){let g=()=>{M.drain()};window.addEventListener("online",g),z.push(()=>window.removeEventListener("online",g)),re(g)}if(e.captureCspViolations){let g=typeof e.captureCspViolations=="object"?e.captureCspViolations:{};z.push(Tt((_,S)=>{v.capture(_,S)},g))}for(let g of n){let _=g(x);_&&z.push(_)}N=x.flags,n.length||x.loadConfig(),Rr(x,J,s)}return Ft(J,e.exposeGlobal),o("initialised",{apiHost:s,consent:v.getConsent()}),J}var ui='[data-lc-region="article"]';function Gr(t,e,n){if(e.articles===!1)return()=>{};let r;t.loadConfig().then(y=>{typeof y?.article_selector=="string"&&(r=y.article_selector)});let o=()=>{for(let y of[e.articleSelector,r,ui])if(y)try{let w=document.querySelector(y);if(w)return w}catch{}return null},s=location.href,i=location.pathname,a=null,l=0,c=!1,u=()=>{if(a??=o(),!a)return;let y=a.getBoundingClientRect();if(y.height<=0)return;let w=Math.round(Math.min(100,Math.max(0,(window.innerHeight-y.top)/y.height*100)));l=Math.max(l,w);let E=a.querySelector("h1,h2");E&&E.getBoundingClientRect().bottom<0&&(c=!0)},f=()=>{!a||!n()||(u(),t.client.capture("$article_read",{$article_id:(a.getAttribute("data-lc-article-id")??"").trim().slice(0,200)||i,$article_depth:l,$article_finished:l>=90,$article_headline_exit:!c&&l<25}),a=null)},h=()=>{f(),a=null,l=0,c=!1,s=location.href,i=location.pathname},m=()=>location.href!==s?h():u(),b=new MutationObserver(m);return b.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("scroll",m,{passive:!0}),t.onUnload(f),u(),()=>{b.disconnect(),window.removeEventListener("scroll",m)}}var Qe="data-lc-content",di="data-lc-content-piece",pi="data-lc-content-target";var nn=(t,e)=>(t.getAttribute(e)??"").trim().slice(0,200);function zr(t,e,n){if(e.contentBlocks===!1||typeof IntersectionObserver>"u")return()=>{};let r=new WeakSet,o=u=>{let f={$content_name:nn(u,Qe)},h=nn(u,di),m=nn(u,pi);return h&&(f.$content_piece=h),m&&(f.$content_target=m),f},s=location.href,i=new IntersectionObserver(u=>{for(let f of u)!f.isIntersecting||r.has(f.target)||!n()||(r.add(f.target),t.client.capture("$content_impression",o(f.target)))},{threshold:.5}),a=u=>u.querySelectorAll(`[${Qe}]`).forEach(f=>i.observe(f));a(document);let l=new MutationObserver(()=>{location.href!==s&&(s=location.href,i.disconnect(),document.querySelectorAll(`[${Qe}]`).forEach(u=>r.delete(u))),a(document)});l.observe(document.documentElement,{childList:!0,subtree:!0});let c=u=>{let f=u.target?.closest?.(`[${Qe}]`);f&&n()&&t.client.capture("$content_interaction",{...o(f),$content_interaction_type:"click"})};return document.addEventListener("click",c,!0),()=>{i.disconnect(),l.disconnect(),document.removeEventListener("click",c,!0)}}var fi=new Set(["input","textarea","select","option"]),gi=["name","type","role","aria-label","title","alt","placeholder"],mi=new Set(["aria-label","aria-description","title","alt","placeholder","value","label"]),hi=/(?:\d[ -]?){9,}/;function yi(t){if(fi.has(t.tagName.toLowerCase())||t.isContentEditable)return;let e="";for(let n of Array.from(t.childNodes))n.nodeType===3&&(e+=n.textContent??"");if(e=e.replace(/\s+/g," ").trim(),!(!e||hi.test(e)))return e.slice(0,255)}function Xr(t){if(!t?.length)return()=>!1;let e=t.map(n=>n.toLowerCase());return n=>e.some(r=>r.endsWith("*")?n.startsWith(r.slice(0,-1)):n===r)}var vi="***";function tt(t){let e={};for(let n=t,r=0;n&&r<10;n=n.parentElement,r++)for(let o of Array.from(n.attributes)){let s=o.name.startsWith("data-lc-attr-")?o.name.slice(13):"";s&&!(s in e)&&!s.startsWith("$")&&(e[s]=o.value.slice(0,255))}return e}function _i(t,e,n,r,o){let s=t.parentElement,i=s?Array.from(s.children):[t],a={tag_name:t.tagName.toLowerCase(),nth_child:i.indexOf(t)+1,nth_of_type:i.filter(f=>f.tagName===t.tagName).indexOf(t)+1},l=(t.getAttribute("class")??"").split(/\s+/).filter(Boolean);l.length&&!r("class")&&(a.classes=l),t.id&&!r("id")&&(a.attr__id=o("id",t.id));let c=t.getAttribute("href");c&&!r("href")&&(a.href=o("href",c.slice(0,1024)));let u={};for(let f of Array.from(t.attributes))(f.name.startsWith("data-lc-")||gi.includes(f.name))&&!r(f.name)&&(n||!mi.has(f.name))&&(u[f.name]=o(f.name,f.value.slice(0,255)));if(Object.keys(u).length&&(a.attrs=u),e){let f=yi(t);f&&(a.text=f)}return a}function nt(t,e,n,r,o={}){let s=[],i=Xr(r),a=Xr(o.allow),l=o.maskAll?(u,f)=>a(u)?f:vi:(u,f)=>f,c=e;for(let u=t;u&&s.length<10;u=u.parentElement)s.push(_i(u,c,e,i,l)),(u===n||!n)&&(c=!1);return s}var et=t=>t.replace(/(["\\])/g,"\\$1");function rt(t){return t.map(e=>{let n=e.tag_name+(e.classes?"."+e.classes.join("."):"")+":";e.attr__id&&(n+=`attr__id="${et(e.attr__id)}"`),e.href&&(n+=`href="${et(e.href)}"`),e.text&&(n+=`text="${et(e.text)}"`);for(let[r,o]of Object.entries(e.attrs??{}))n+=`attr__${r}="${et(o)}"`;return n+`nth-child="${e.nth_child}"nth-of-type="${e.nth_of_type}"`}).join(";")}var Y=[],bi=/^[+\-−–‹›<>«»←→↑↓▲▼▶◀^ˇ˄˅]$/,wi=/\b(increase|decrease|increment|decrement|plus|minus|add one|remove one|next|prev|previous|scroll (left|right))\b/i,xi=/(^|[-_\s])(stepper|spinner|quantity|qty|increment|decrement|inc|dec|plus|minus|carousel|slider|swiper|slick|glide|splide|arrow|next|prev)([-_\s]|$)/i,ki="button,[role=button],a,input[type=button],input[type=submit],[role=spinbutton]";function Si(t,e=[]){if(e.length&&t.closest(e.join(","))||t.closest("input[type=number],[role=spinbutton],[role=slider]"))return!0;let n=t.closest(ki)??t,r=`${n.getAttribute("aria-label")??""} ${n.getAttribute("title")??""}`;if(bi.test((n.textContent??"").trim())||wi.test(r))return!0;for(let o=n,s=0;o&&s<3;o=o.parentElement,s++)if(xi.test(o.getAttribute("class")??""))return!0;return!1}var Ei=()=>typeof getSelection=="function"?(getSelection()?.toString()??"")!=="":!1;function Yr(t,e=Date.now(),n={},r){if(r&&n.ignoreSelectors?.length&&r.closest(n.ignoreSelectors.join(",")))return{};if(r&&n.suppressSteppers!==!1&&Si(r,n.stepperSelectors))return{};if(n.ignoreTextSelection!==!1&&Ei())return{};let o=n.windowMs??1e3,s=n.radiusPx??30;for(Y.length&&e<Y[Y.length-1].t&&(Y.length=0),Y.push({t:e,x:t.clientX,y:t.clientY});Y.length&&e-Y[0].t>o;)Y.shift();let i=Y.filter(a=>Math.hypot(a.x-t.clientX,a.y-t.clientY)<=s).length;return i>=(n.count??3)?{$rageclick:!0,$rageclick_count:i}:{}}function Jr(t,e,n=700){if(typeof MutationObserver>"u")return;let r=!1,o=new MutationObserver(()=>r=!0);o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let s=()=>{r=!0};window.addEventListener("scroll",s,{capture:!0,passive:!0}),document.addEventListener("selectionchange",s);let i=()=>{o.disconnect(),window.removeEventListener("scroll",s,{capture:!0}),document.removeEventListener("selectionchange",s)},a=setTimeout(()=>{i(),!r&&document.visibilityState!=="hidden"&&t.client.capture("$deadclick_hint",{$selector:e,$no_mutation_ms:n})},n);t.onUnload(()=>{clearTimeout(a),i()})}var Zr=/^[A-Za-z_][\w-]*$/,Ci=5;function Ri(t){let e=[];for(let n=t;n&&e.length<Ci;n=n.parentElement){let r=n.tagName.toLowerCase();if(n.id&&Zr.test(n.id)){e.unshift(`${r}#${n.id}`);break}let o=(n.getAttribute("class")??"").split(/\s+/).filter(s=>Zr.test(s)).slice(0,2);e.unshift(r+o.map(s=>`.${s}`).join(""))}return e.join(" ")}function Qr(t,e,n,r,o={}){let s={$selector:Ri(n),$el_interactive:r};(e.clientX||e.clientY||e.detail)&&(s.$click_x=Math.round(e.clientX+(window.scrollX||0)),s.$click_y=Math.round(e.clientY+(window.scrollY||0))),o.rageClicks!==!1&&!n.closest(".lc-no-rageclick,[data-lc-no-rageclick]")&&Object.assign(s,Yr(e,Date.now(),o.rageClicks||{},n));let i=o.deadClicks;!r&&e.isTrusted&&i!==!1&&!(i?.ignoreSelectors?.length&&n.closest(i.ignoreSelectors.join(",")))&&Jr(t,s.$selector,i?.waitMs);for(let a of t.clickExtras)Object.assign(s,a(e,n));return s}var Pi="a,button,input,select,textarea,label,summary,[role=button],[role=link],[data-lc-capture]",$i="[data-lc-ignore]",rn=t=>t.some(e=>typeof e=="string"?location.href.includes(e):e.test(location.href)),Oi=t=>!t?.length||rn(t),on=t=>({maskAll:t.maskAllAttributes,allow:t.attributeAllowlist}),Ce=(t,e)=>!!t.closest($i)||!!(e.denySelectors?.length&&t.closest(e.denySelectors.join(",")));function eo(t,e,n,r=()=>!0){let o=e.events??["click","change","submit"],s=0,i=c=>{let u=c.target;!n()||!r()||c.isComposing||!(u instanceof Element)||Ce(u,e)||u instanceof HTMLInputElement&&u.type==="password"||(s+=1)},a=c=>u=>{if(!n()||c!=="click"&&!r())return;let f=u.target;if(!(f instanceof Element)||Ce(f,e)||e.allowSelectors?.length&&!f.closest(e.allowSelectors.join(","))||e.elementAllowlist?.length&&!f.closest(e.elementAllowlist.join(","))||!Oi(e.urlAllowlist)||c==="change"&&!/^(input|select|textarea)$/i.test(f.tagName)||f instanceof HTMLInputElement&&f.type==="password")return;let h=f.closest(Pi);if(c==="click"&&!h&&!e.allowSelectors?.length)return;let m=nt(f,e.captureText??!0,h??void 0,e.attributeIgnore,on(e)),b=m.find(w=>w.text)?.text,y=s;s=0,t.client.capture("$autocapture",{...tt(f),$event_type:c,...y>0?{$keystroke_count:y}:{},$elements:m,$elements_chain:rt(m),...b?{$el_text:b}:{},...c==="click"?Qr(t,u,f,!!h,e):{}})};t.autocaptureClicks=o.includes("click");let l=o.map(c=>[c,a(c)]);for(let[c,u]of l)document.addEventListener(c,u,!0);return document.addEventListener("keydown",i,!0),()=>{for(let[c,u]of l)document.removeEventListener(c,u,!0);document.removeEventListener("keydown",i,!0)}}var Ai='[contenteditable]:not([contenteditable="false"])',to="input,textarea,select",Ii=255;function Mi(t){return t.replace(/\d(?:[ -]?\d){5,}/g,"***").replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,"***").replace(/\s+/g," ").trim().slice(0,Ii)}var Ti=t=>t?t instanceof Element?t:t.parentElement:null;function no(t,e,n,r=()=>!0){let o=e.events??["click","change","submit"],s=e.contentEditable!==!1&&o.includes("change"),i=new WeakSet,a=h=>{let m=nt(h,!1,h,e.attributeIgnore,on(e));return{...tt(h),$elements:m,$elements_chain:rt(m)}},l=h=>{let m=h instanceof Element?h.closest(Ai):null;return m&&!Ce(m,e)?m:null},c=h=>{let m=n()&&r()?l(h.target):null;m&&i.add(m)},u=h=>{let m=l(h.target);!m||!i.has(m)||h.relatedTarget instanceof Node&&m.contains(h.relatedTarget)||(i.delete(m),n()&&r()&&t.client.capture("$autocapture",{$event_type:"change",$el_contenteditable:!0,...a(m)}))},f=h=>{if(!n()||!e.copyCut)return;let m=typeof getSelection=="function"?getSelection():null,b=h.target instanceof Element?h.target:null,y=Ti(m?.anchorNode)??b;if(!y||Ce(y,e)||y.closest(to)||b?.closest(to))return;let w=e.captureCopiedText?Mi(m?.toString()??""):"";t.client.capture("$copy_autocapture",{$copy_type:h.type,...a(y),...w?{$selected_content:w}:{}})};return s&&(document.addEventListener("input",c,!0),document.addEventListener("focusout",u,!0)),document.addEventListener("copy",f,!0),document.addEventListener("cut",f,!0),()=>{document.removeEventListener("input",c,!0),document.removeEventListener("focusout",u,!0),document.removeEventListener("copy",f,!0),document.removeEventListener("cut",f,!0)}}var ji="[data-lc-ignore]",oo=["pdf","zip","gz","tar","rar","7z","doc","docx","xls","xlsx","ppt","pptx","csv","epub","dmg","exe","msi","pkg","apk","iso","mp3","mp4","mov"],so=["q","s","search","query"],ro=t=>t.origin+t.pathname;function io(t,e,n){let r=Array.isArray(e.fileDownloads)?e.fileDownloads.map(s=>s.toLowerCase()):oo,o=[];if(e.outboundLinks!==!1||e.fileDownloads!==!1){let s=i=>{let a=i.target instanceof Element?i.target.closest("a[href]"):null;if(!a||!n()||a.closest(ji))return;let l;try{l=new URL(a.href,location.href)}catch{return}if(l.protocol!=="http:"&&l.protocol!=="https:")return;let c=decodeURIComponent(l.pathname.split("/").pop()??""),u=c.includes(".")?c.split(".").pop().toLowerCase():"";e.fileDownloads!==!1&&(a.hasAttribute("download")||r.includes(u))?t.client.capture("$file_download",{$url:ro(l),$file_name:c,$file_extension:u}):e.outboundLinks!==!1&&l.host!==location.host&&t.client.capture("$outbound_click",{$url:ro(l),$outbound_host:l.host})};document.addEventListener("click",s,!0),o.push(()=>document.removeEventListener("click",s,!0))}if(e.siteSearch!==!1){let s=typeof e.siteSearch=="object"&&e.siteSearch.params?e.siteSearch.params:so,i=!0;o.push(()=>{i=!1}),t.onCapture(a=>{if(!i||a.event!=="$pageview"||!n())return;let l=new URLSearchParams(location.search);for(let c of s){let u=l.get(c)?.trim();if(u)return void t.client.capture("$site_search",{$search_term:u.slice(0,200),$search_param:c})}})}return()=>o.forEach(s=>s())}function ao(t,e={}){t.capture("$page_not_found",{$status:404,...e})}var Li=[25,50,75],Fi="data-lc-media-title";function co(t){let e=t.currentSrc||t.src;if(!e||e.startsWith("blob:")||e.startsWith("data:"))return"";try{let n=new URL(e,location.href);return`${n.origin}${n.pathname}`}catch{return""}}var Di=t=>(t.getAttribute(Fi)??t.getAttribute("title")??t.getAttribute("aria-label")??"").trim().slice(0,200);function lo(t,e,n){if(e.media===!1)return()=>{};let r=new WeakMap,o=l=>{let c={$media_type:l instanceof HTMLVideoElement?"video":"audio",$media_src:co(l)},u=Di(l);return u&&(c.$media_title=u),Number.isFinite(l.duration)&&(c.$media_duration=Math.round(l.duration)),c},s=l=>{let c=co(l);if(!c)return null;let u=r.get(l);return(!u||u.src!==c)&&r.set(l,u={src:c,played:!1,reached:new Set,done:!1}),u},i=l=>{let c=l.target;if(!(c instanceof HTMLMediaElement)||!n())return;let u=s(c);if(u)if(l.type==="play"){if(u.done&&Object.assign(u,{played:!1,reached:new Set,done:!1}),u.played)return;u.played=!0,t.client.capture("$media_play",o(c))}else if(l.type==="timeupdate"){if(!u.played||u.done||!Number.isFinite(c.duration)||c.duration<=0)return;let f=c.currentTime/c.duration*100;for(let h of Li)f>=h&&!u.reached.has(h)&&(u.reached.add(h),t.client.capture("$media_progress",{...o(c),$media_progress:h}))}else l.type==="ended"&&u.played&&!u.done&&(u.done=!0,t.client.capture("$media_complete",o(c)))},a=["play","timeupdate","ended"];return a.forEach(l=>document.addEventListener(l,i,!0)),()=>a.forEach(l=>document.removeEventListener(l,i,!0))}function uo(t=()=>performance.now()){let e=()=>document.visibilityState!=="hidden",n=0,r=e()?t():null,o=()=>{e()?r===null&&(r=t()):(r!==null&&(n+=t()-r),r=null)};return document.addEventListener("visibilitychange",o),{read:()=>Math.round(n+(r===null?0:t()-r)),reset:()=>{n=0,r=e()?t():null},stop:()=>document.removeEventListener("visibilitychange",o)}}po();var fo=255,Ni=new Set(["input","textarea","select","option"]),qi="[data-lc-mask],.lc-mask,[data-lc-no-capture],.lc-no-capture,[data-lc-block]",Wi=new Set(["value","password","autocomplete"]),Ui=/(?:\d[ -]?){9,}/,Re=new WeakMap,an=new WeakMap;function go(t,e){let n=an.get(t);if(n)return new Promise(r=>{let o=setTimeout(r,e);n.then(()=>(clearTimeout(o),r()))})}function Bi(t){return Array.isArray(t)?t.filter(e=>{if(!e||typeof e!="object")return!1;let n=e;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 Vi(t){if(!t||Ni.has(t.tagName.toLowerCase())||t.isContentEditable)return!1;try{return!t.closest(qi)}catch{return!1}}function Ki(t,e){if(t.source==="attribute"){let r=(t.attribute??"").toLowerCase();if(!r||Wi.has(r)||r.startsWith("on"))return;let o=e.getAttribute(r);return o===null?void 0:o.slice(0,fo)}let n=(e.textContent??"").replace(/\s+/g," ").trim();if(!(!n||Ui.test(n)))return n.slice(0,fo)}function mo(t,e,n,r=location.href){let o={};for(let s of t){if(!s.events.includes(e)||s.url&&!sn([s.url],r))continue;let i=null;try{i=s.scope==="target"?e==="click"&&n?n.closest(s.selector):null:document.querySelector(s.selector)}catch{continue}if(!Vi(i))continue;let a=Ki(s,i);a!==void 0&&(o[s.name]=a)}return o}function ho(t){let e=!0,n=t.loadConfig().then(r=>{e&&Re.set(t,Bi(r?.snapshot_properties)),an.delete(t)});return an.set(t,n),t.clickExtras.push((r,o)=>e?mo(Re.get(t)??[],"click",o):{}),()=>{e=!1,Re.delete(t)}}function yo(t){let e=Re.get(t);return e?.length?mo(e,"pageview"):{}}function vo(t){return!!Re.get(t)?.some(e=>e.events.includes("pageview"))}var Gi=t=>{try{return new URL(t).pathname}catch{return t}};function zi(t){for(let e of t===void 0?[]:Array.isArray(t)?t:[t])try{let n=document.querySelector(e);if(n)return n}catch{}}function _o(t){let e=0,n=0,r=()=>{let o=zi(t),s=document.documentElement,i=o?o.scrollHeight:Math.max(s.scrollHeight,document.body?.scrollHeight??0),a=o?o.scrollTop:window.scrollY||window.pageYOffset||0,l=Math.min(i,a+(o?o.clientHeight:window.innerHeight));l>e&&(e=l,n=i>0?Math.min(100,Math.round(l/i*100)):0)};return r(),window.addEventListener("scroll",r,{passive:!0,capture:!0}),window.addEventListener("resize",r,{passive:!0}),{read:()=>({pct:n,px:e}),stop:()=>{window.removeEventListener("scroll",r,{capture:!0}),window.removeEventListener("resize",r)}}}var Xi=800,Yi=t=>t.core.hasConsent("analytics")||t.core.consent.resolving;function Ji(t){return t==="history"?{path:!0,search:!0}:t==="hash"?{path:!0,search:!0,hash:!0}:typeof t=="object"?t:void 0}function Zi(t,e,n){try{let r=new URL(t),o=new URL(e);return!!(n.path&&r.pathname!==o.pathname||n.search&&r.search!==o.search||n.hash&&r.hash!==o.hash)}catch{return t!==e}}function ot(t,e,n={}){let r=n.views??!0,o=n.leave??!0,s=Ji(e),i=t.config.scrollRoot,a=location.href,l=a,c=Date.now(),u=_o(i),f=uo(),h,m=()=>{if(!o||h===a)return;h=a;let{pct:O,px:N}=u.read();t.client.capture("$pageleave",{$current_url:a,$scroll_depth:O,$scroll_depth_px:N,$engagement_time_ms:f.read()})},b=!1,y=(O,N={})=>{if(!r)return;let{core:T}=t;if(!T.hasConsent("analytics")&&!T.anonymousOnReject&&!(T.consent.pending&&T.consent.queueBeforeConsent)){if(!b){b=!0;let F=()=>{b&&(b=!1,y())};t.whenConsented(F),T.onChange(j=>{j==="consent"&&T.anonymousOnReject&&F()})}return}t.client.capture("$pageview",{...yo(t),...O===void 0?{}:{$referrer:O},...N})},w,E=()=>{let O=w;w=void 0,O?.()},C=O=>{if(location.href===l)return;let N=l;if(l=location.href,!s||!Zi(N,l,s))return;let T=a;m(),u.stop();let F=new Date(c);a=location.href,c=Date.now(),u=_o(i),f.reset();let j={$navigation_type:O,$prev_pageview_pathname:Gi(T),$prev_pageview_duration:Math.round((c-F.getTime())/100)/10};vo(t)?setTimeout(()=>y(T,j),0):(E(),w=()=>y(T,j),queueMicrotask(E))};t.onUnload(m);let M=Yi(t)?go(t,Xi):void 0;if(M?(w=()=>y(),t.onUnload(E),M.then(E)):y(),!s)return()=>(u.stop(),f.stop());let{pushState:q,replaceState:A}=history;history.pushState=function(...O){E(),q.apply(this,O),C("pushState")},history.replaceState=function(...O){E(),A.apply(this,O),C("replaceState")};let k=()=>C("popstate"),I=()=>C("hashchange");return window.addEventListener("popstate",k),s.hash&&window.addEventListener("hashchange",I),()=>{window.removeEventListener("hashchange",I),history.pushState=q,history.replaceState=A,window.removeEventListener("popstate",k),u.stop(),f.stop()}}var cn=t=>{let e=[],n=t.config.autocapture,r=!1,o=!1;if(n!==!1){let a=typeof n=="object"?n:{},l=()=>!r&&!(a.urlIgnorelist?.length&&rn(a.urlIgnorelist)),c=()=>!o;e.push(eo(t,a,l,c),no(t,a,l,c),io(t,a,l),zr(t,a,l),Gr(t,a,l),lo(t,a,l),ho(t)),n===void 0&&t.loadConfig().then(u=>r=u?.autocapture===!1),t.loadConfig().then(u=>o=u?.autocapture_inputs===!1)}let s=t.config.capturePageview??"history",i=t.config.capturePageleave??"if_capture_pageview";return s!==!1&&i!==!1?e.push(ot(t,s)):s!==!1?e.push(ot(t,s,{leave:!1})):i===!0&&e.push(ot(t,"history",{views:!1})),()=>e.forEach(a=>a())};de();var Qi="lc_preview",ln="lc_preview";function ea(t){let e={};for(let n of(t??"").split(",")){let r=n.indexOf(":");r>0&&r<n.length-1&&(e[n.slice(0,r)]=n.slice(r+1))}return e}function bo(t){let e=new URL(t).searchParams.get(Qi),n=null;try{n=sessionStorage.getItem(ln)}catch{}return{forced:ea(e==="off"?null:e??n),persist(){try{e==="off"?sessionStorage.removeItem(ln):e&&sessionStorage.setItem(ln,e)}catch{}}}}Ee();Ke();var un="lc_flag_initial";function ta(t){try{return t?new URL(t).hostname:""}catch{return""}}function na(){let t=new URLSearchParams(location.search),e={$initial_referrer:document.referrer||"$direct",$initial_referring_domain:ta(document.referrer)||"$direct",$initial_current_url:location.href.split("#")[0]};for(let n of[...te,...K]){let r=t.get(n);r&&(e[`$initial_${n}`]=r)}return e}function xo(t,e){if(typeof location>"u")return{};let n=t.get(un);if(n)try{return JSON.parse(n)}catch{}let r=na();return e(()=>{t.get(un)||t.set(un,JSON.stringify(r))}),r}function ra(){let t=navigator.userAgent,e=/Edg\//.test(t)?"Edge":/OPR\/|Opera/.test(t)?"Opera":/Firefox\//.test(t)?"Firefox":/Chrome\/|CriOS/.test(t)?"Chrome":/Safari\//.test(t)?"Safari":"Other",n=/Windows/.test(t)?"Windows":/Android/.test(t)?"Android":/iPhone|iPad|iPod/.test(t)?"iOS":/Mac OS X/.test(t)?"Mac OS X":/CrOS/.test(t)?"Chrome OS":/Linux/.test(t)?"Linux":"Other";return{browser:e,os:n}}function ko(){if(typeof location>"u"||typeof navigator>"u")return{};let t={},e=new URLSearchParams(location.search);for(let o of[...te,...K]){let s=e.get(o);s&&(t[`$${o}`]=s)}let{browser:n,os:r}=ra();return t.$browser=n,t.$os=r,t.$device_type=String(pn().$device_type??"Desktop"),t}function pn(){if(typeof window>"u")return{};let t=window.innerWidth;return{$viewport_width:t,$viewport_height:window.innerHeight,$screen_width:screen.width,$screen_height:screen.height,$browser_language:navigator.language,$device_type:oa(t)}}function oa(t,e=navigator){let n=e.userAgent??"";return/iPad|Tablet|PlayBook|Silk|Kindle/i.test(n)||/Macintosh/.test(n)&&(e.maxTouchPoints??0)>1?"Tablet":/Android/i.test(n)?/Mobile/i.test(n)?"Mobile":"Tablet":/iPhone|iPod|Mobile|Windows Phone|BlackBerry|Opera Mini/i.test(n)||e.userAgentData?.mobile?"Mobile":/Windows|Macintosh|X11|CrOS|Linux/i.test(n)?"Desktop":t<768?"Mobile":t<1024?"Tablet":"Desktop"}var sa=/^[A-Za-z0-9_.-]{1,100}$/,ia=/^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*){0,5}$/,aa=new Set(["__proto__","prototype","constructor"]),ca=50,So=200;function wo(t,e){if(!ia.test(e))return;let n=t;for(let r of e.split(".")){if(aa.has(r)||n===null||typeof n!="object"||typeof Node<"u"&&n instanceof Node)return;n=n[r]}if(typeof n=="string")return n.slice(0,So);if(typeof n=="number"&&Number.isFinite(n)||typeof n=="boolean")return n}function la(){let t=new Map;for(let e of(typeof document>"u"?"":document.cookie).split(";")){let n=e.indexOf("=");if(n<1)continue;let r=e.slice(0,n).trim(),o=e.slice(n+1).trim();try{o=decodeURIComponent(o)}catch{}t.has(r)||t.set(r,o.slice(0,So))}return t}function dn(t){let e={};if(!t||typeof window>"u")return e;let n=s=>Array.isArray(s)?s.filter(i=>typeof i=="string").slice(0,ca):[],r=n(t.cookies).filter(s=>sa.test(s));if(r.length){let s=la();for(let i of r){let a=s.get(i);a!==void 0&&(e[`$cookie/${i}`]=a)}}for(let s of n(t.globals)){let i=wo(window,s);i!==void 0&&(e[`$global/${s}`]=i)}let o=window.dataLayer;if(Array.isArray(o))for(let s of n(t.data_layer))for(let i=o.length-1;i>=0;i--){let a=wo(o[i],s);if(a!==void 0){e[`$datalayer/${s}`]=a;break}}return e}var fn=t=>{if(t.config.flagOptions?.disableRemote&&!t.config.localFlags?.length)return;let e;t.flagPersonProps.push(()=>e&&t.core.hasConsent("analytics")?dn(e):{}),t.loadConfig().then(n=>{let r=n?.flag_targeting_sources;!r||typeof r!="object"||(e=r,Object.keys(dn(r)).length&&t.flags?.reload())})};de();function gn(t){return typeof t=="object"?t.value??t.variant??!!t.enabled:t}function mn(t){let e={value:gn(t),reason:t.reason??"remote",condition_index:t.condition_index??-1};return t.variant&&(e.variant=t.variant),t.payload!==void 0&&(e.payload=t.payload),t.runtime?.length&&(e.runtime=t.runtime.map(n=>({filters:n.filters,result:mn(n.result)}))),e}var Eo="lc_rt_events",Co=t=>!!t?.some(e=>e.conditions.some(n=>n.filters?.some(r=>r.type==="event")));function Ro(t,e){let n;try{let i=t.flagStorage.get(Eo);i&&(n=JSON.parse(i))}catch{}let r=new _e(n),o={},s=We(e,o);return{counts:()=>r.counts(t.core.sessionId),setServer(i){o=i,s=We(e,o)},server:()=>o,drop(i){for(let a of i)delete o[a]},resolved(){return St(o,r.counts(t.core.sessionId))},record(i,a,l){r.record(i,t.core.sessionId,a,s),l&&t.whenConsented(()=>t.flagStorage.set(Eo,JSON.stringify(r.saved())))}}}var hn="lc_flags",yn="lc_flag_overrides_api";function Po(t){try{let e=localStorage.getItem("lc_flag_overrides");return e?JSON.parse(e)[t]:void 0}catch{return}}var vn=t=>{let{core:e,config:n}=t,r={},o={},s={},i,a,l=!1,c=0,u=new Set,f=new Set,h="",m={},b=()=>Object.keys(m).length>0,y={},w={},E={},C=new Set,M=typeof location>"u"?{forced:{},persist(){}}:bo(location.href),q=Object.keys(M.forced).length>0,A=()=>({...r,...E}),k=t.config.flagOptions??{},I=new we(k.cacheTtlMs),O=(t.config.flagsApiHost??t.config.apiHost).replace(/\/+$/,""),N=k.keys?.length?new Set(k.keys):void 0,T=p=>N?Object.fromEntries(Object.entries(p).filter(([g])=>N.has(g))):p,F=(p,g,_=!0)=>{if(r=T(p),o=T(g),l=!0,_)for(let S of C)S(A())},j=Ro(t,n.localFlags),ae=!1,G=()=>{ae||(ae=!0,queueMicrotask(()=>{ae=!1,x()}))},v=t.flagStorage.get(hn);if(v)try{let p=JSON.parse(v);r=p.values,o=p.payloads,s=Object.fromEntries(Object.keys(r).map(g=>[g,"cached"])),p.rt&&j.setServer(p.rt),I.restore(p),l=Object.keys(r).length>0}catch{}let D=t.flagStorage.get(yn);if(D)try{E=JSON.parse(D)}catch{}let W=n.bootstrap;if(W?.flags||W?.payloads){let p={...W.flags};for(let g of Object.keys(W.payloads??{}))p[g]??=!0;F({...r,...p},{...o,...W.payloads});for(let g of Object.keys(p))s[g]="bootstrap"}let ce={},ge=()=>({...k.autoProperties===!1?{}:ko(),...xo(e.storage,t.whenConsented),...Object.assign({},...t.flagPersonProps.map(p=>p())),...y}),z=k.evaluationContexts?.length?{app_contexts:k.evaluationContexts}:{},ne=(p=!0)=>{let g=n.localFlags;if(!g?.length)return!0;let _=n.localFlagsContext,S=Rt(g,{runtime_events:j.counts(),distinct_id:e.distinctId,...e.groups?{groups:e.groups}:{},...e.deviceId?{device_id:e.deviceId}:{},...b()?{contexts:m}:{},...z,..._,person_properties:{...ge(),..._?.person_properties},group_properties:{..._?.group_properties,...w}}),P={},$={},L=!1;for(let[Z,U]of Object.entries(S))Pt(U)?L=!0:$t(U)&&(P[Z]=U.value,s[Z]=U.reason,U.payload!==void 0&&($[Z]=U.payload));return ce=P,F({...r,...P},{...o,...$},p),L},re=p=>{let g={...r},_={...o};for(let[S,P]of Object.entries(j.resolved()))g[S]=P.value,s[S]=P.reason,P.payload!==void 0?_[S]=P.payload:delete _[S];F(g,_,p)},me=Co(n.localFlags);t.onCapture(p=>{let g=me||Object.keys(j.server()).length>0;if(j.record(p.event,p.properties,g),!g)return;let _=JSON.stringify([A(),o]);if(me&&ne(!1),re(!1),JSON.stringify([A(),o])!==_)for(let S of C)S(A())});let x=(p=!0)=>{let g=++c;return!ne()||k.disableRemote||!p&&I.fresh(e.distinctId)?Promise.resolve():new Promise(_=>{t.whenConsented(()=>{if(g!==c)return _();M.persist();let S=new AbortController,P=setTimeout(()=>S.abort(),k.timeoutMs??1e4);t.fetch(`${O}/v1/flags`,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},credentials:"omit",signal:S.signal,body:JSON.stringify({api_key:t.apiKey,...e.distinctId?{distinct_id:e.distinctId}:{},...e.anonDistinctId?{anon_distinct_id:e.anonDistinctId}:{},groups:e.groups??{},person_properties:ge(),...Object.keys(w).length?{group_properties:w}:{},device_properties:pn(),...e.deviceId?{device_id:e.deviceId}:{},...b()?{contexts:m}:{},...z,...q?{preview:M.forced}:{},...k.keys?.length?{flag_keys:k.keys}:{}})}).then($=>$.ok?$.json():Promise.reject(new Error(`status ${$.status}`))).then($=>{if(g!==c)return;if($.quota_limited)return a="quota_limited",t.log("flags quota limited; keeping cached values");a=$.errors_while_computing_flags?"errors_while_computing_flags":void 0;let L={},Z={},U={};for(let[$e,B]of Object.entries($.flags??{}))L[$e]=gn(B),typeof B=="object"&&B.payload!==void 0&&(Z[$e]=B.payload),s[$e]=typeof B=="object"&&typeof B.reason=="string"?B.reason:"remote",typeof B=="object"&&B.runtime?.length&&(U[$e]=mn(B));i=$.request_id,j.setServer(U);let Pe=$.errors_while_computing_flags;F({...ce,...Pe?r:{},...L},Pe?{...o,...Z}:Z,!1),re(!0),t.flagStorage.set(hn,JSON.stringify({values:{...Pe?r:{},...L},payloads:{...Pe?o:{},...Z},rt:U,...I.mark(e.distinctId)})),t.log("flags loaded",L)}).catch($=>{let L=/^status (\d+)/.exec(String($?.message))?.[1];g===c&&(a=S.signal.aborted?"timeout":L?`api_error_${L}`:"connection_error"),t.log("flags fetch failed",$)}).finally(()=>{clearTimeout(P),_()})})})},he=p=>E[p]??Po(p)??r[p];t.flags={get(p){let g=he(p);if(g===void 0)return;if(p in M.forced||p in E)return g;let _=e.sessionId;_!==h&&(u.clear(),f.clear(),h=_),f.has(p)||(f.add(p),e.capture("$exposure",{$feature_flag:p,$feature_flag_response:g,...typeof g=="string"?{$feature_flag_variant:g}:{},...i?{$feature_flag_request_id:i}:{}}));let S=`${p}:${String(g)}`;return u.has(S)||(u.add(S),e.capture("$feature_flag_called",{$feature_flag:p,$feature_flag_response:g,...i?{$feature_flag_request_id:i}:{},...s[p]?{$feature_flag_reason:s[p]}:{},...s[p]==="bootstrap"?{$used_bootstrap_value:!0}:{},...a?{$feature_flag_error:a}:{}})),g},all:()=>l||Object.keys(r).length||Object.keys(E).length?A():{},payload:p=>o[p],result(p,g){let _=g?.sendExposure===!1?he(p):this.get(p),S=p in E||Po(p)!==void 0?"override":p in M.forced?"preview":s[p]??"remote";return ie(p,_,o[p],S)},layerParam(p,g){for(let[_,S]of Object.entries(o)){let P=S;if(P?.lc_layer!==p||!P.lc_params||!(g in P.lc_params))continue;let $=this.get(_);if($!==void 0&&$!==!1)return P.lc_params[g]}},onChange(p){return C.add(p),l&&p(A()),()=>{C.delete(p)}},reload:x,update(p,g,_=!0){for(let S of Object.keys(p))s[S]="pushed";j.drop(Object.keys(p)),F(_?{...r,...p}:{...p},_?{...o,...g}:{...g})},override(p,g){E=p?{...p}:{},p?g?.persist&&t.whenConsented(()=>t.flagStorage.set(yn,JSON.stringify(E))):t.flagStorage.remove(yn);for(let _ of C)_(A())},setPersonProperties(p,g=!0){I.clear(),y={...y,...p},g&&G()},resetPersonProperties(){y={}},setGroupProperties(p,g=!0){I.clear();for(let[_,S]of Object.entries(p))w[_]={...w[_],...S};g&&G()},resetGroupProperties(){w={}},setContext(p,g,_){I.clear(),m={...m,[p]:{key:g,properties:_??{}}},G()},clearContext(p){I.clear();let{[p]:g,..._}=m;m=_,G()}},e.onChange(p=>{if(p==="reset"){m={},y={},w={},u.clear(),f.clear(),r={},o={},s={},i=void 0,a=void 0,j.setServer({}),I.clear(),t.flagStorage.remove(hn),ne(!1);for(let g of C)g(A())}(p==="identify"||p==="reset"||p==="group")&&G()}),n.disableFlagsOnFirstLoad?ne():x(!1);let oe=n.flagStream,J;oe&&!k.disableRemote&&t.whenConsented(()=>{J=ft({apiHost:O,apiKey:t.apiKey,fetch:t.fetch,reload:()=>{x()},visibility:{hidden:()=>document.visibilityState==="hidden",subscribe:p=>(document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p))},...typeof oe=="object"&&oe.pollMs!==void 0?{pollMs:oe.pollMs}:{},log:t.log})});let d=k.refreshMs&&k.refreshMs>0&&!k.disableRemote?setInterval(()=>document.visibilityState!=="hidden"&&void x(!1),k.refreshMs):void 0;return()=>{J?.(),d&&clearInterval(d)}};function st(t){let e=window.fetch;window.fetch=function(i,a){let l=i instanceof Request?i.url:String(i),c=new Headers(a?.headers??(i instanceof Request?i.headers:void 0)),u=[...c.entries()].join("|");return t(l,c),[...c.entries()].join("|")===u?e.call(this,i,a):e.call(this,i,{...a,headers:c})};let n=XMLHttpRequest.prototype,{open:r,send:o}=n,s=new WeakMap;return n.open=function(i,a,...l){return s.set(this,String(a)),r.call(this,i,a,...l)},n.send=function(i){let a=s.get(this);if(a){let l=new Headers;t(a,l),l.forEach((c,u)=>this.setRequestHeader(u,c))}return o.call(this,i)},()=>{window.fetch=e,n.open=r,n.send=o}}var ua={good:0,"needs-improvement":1,poor:2},da=["good","needs-improvement","poor"],pa={LCP:"lcp_ms",INP:"inp_ms",CLS:"cls",FCP:"fcp_ms",TTFB:"ttfb_ms"};function fa(t,e){let n=()=>t.config.watchtower?.client??globalThis.watchtower,r,o=()=>{let s=n();r||typeof s?.on!="function"||(r=e(s))};return o(),window.addEventListener("watchtower:ready",o),()=>(window.removeEventListener("watchtower:ready",o),r?.())}function $o(t){let e,n=!1;return t.whenConsented(()=>{n||(e=fa(t,r=>ga(t,r)))}),()=>(n=!0,e?.())}function ga(t,e){let n=new Map,r=new Set,o=c=>{let u=n.get(c);n.delete(c),!(!u||r.has(c))&&(r.add(c),t.client.capture("$web_vitals",{...u.props,rating_worst:da[u.worst]}))},s=c=>{t.client.capture("$exception_seen",{wt_event_id:c.event_id,wt_trace_id:c.trace_id,message:String(c.message??"").slice(0,300),handled:c.handled,...c.issue_id?{wt_issue_id:c.issue_id}:{}})},i=c=>{let u=pa[c.name];if(!u||r.has(c.navigation_id))return;for(let h of[...n.keys()])h!==c.navigation_id&&o(h);let f=n.get(c.navigation_id)??{props:{$current_url:c.url},worst:0,final:new Set};n.set(c.navigation_id,f),f.props[u]=c.value,f.worst=Math.max(f.worst,ua[c.rating]??0),c.final&&f.final.add(c.name),f.final.size===5&&o(c.navigation_id)},a=c=>u=>{try{c(u)}catch{}},l=[e.on?.("error",a(s)),e.on?.("vital",a(i))];return t.onUnload(()=>[...n.keys()].forEach(o)),()=>l.forEach(c=>c?.())}var Oo="__lucidaWatchtowerHint";function Ao(t){if(t.config.exposeGlobal||t.config.disabled)return()=>{};let e=globalThis,n=()=>{e[Oo]||(e[Oo]=!0,console.info("[lucida] Watchtower is on this page but Lucida's `exposeGlobal` is off, so Watchtower cannot find Lucida to link sessions. Set `exposeGlobal: true` in the Lucida init options."))};return e.watchtower?(n(),()=>{}):(window.addEventListener("watchtower:ready",n,{once:!0}),()=>window.removeEventListener("watchtower:ready",n))}var _n="lucida.session_id";function ma(t,e){return[...(t??"").split(",").map(r=>r.trim()).filter(r=>r&&!r.startsWith(`${_n}=`)),`${_n}=${encodeURIComponent(e)}`].join(",")}function ha(t,e=[]){let n;try{n=new URL(t,location.href)}catch{return!1}return n.origin===location.origin||e.some(r=>typeof r=="string"?n.origin===r:r.test(n.href))}var Io=t=>{let e=t.config.watchtower,{core:n}=t,r=ya(t),o=$o(t),s=Ao(t),i=()=>(r?.(),o(),s());if(!e?.correlate)return i;let a=n.sessionId;t.onCapture(u=>a=String(u.properties.$session_id??a));let l=u=>n.hasConsent("analytics")&&!u.startsWith(t.config.apiHost)&&ha(u,e.origins),c=st((u,f)=>{l(u)&&f.set("baggage",ma(f.get("baggage"),a))});return()=>(c(),i())};function ya(t){let e=t.config.watchtower?.client??globalThis.watchtower;if(typeof e?.setAttribute!="function")return;let{core:n}=t,r=o=>{n.hasConsent("analytics")&&e.setAttribute(_n,o)};return t.whenConsented(()=>r(n.sessionId)),n.onSessionId(r)}var va="X-Lucida-Distinct-Id",_a="X-Lucida-Session-Id";function ba(t,e){let n;try{n=new URL(t,location.href).hostname.toLowerCase()}catch{return!1}return e.some(r=>{let o=r.toLowerCase();return o.startsWith(".")?n===o.slice(1)||n.endsWith(o):n===o})}var Mo=t=>/^[\x20-\x7e]*$/.test(t)?t:encodeURIComponent(t),bn=t=>{let e=t.config.tracingHeaders;if(!e?.length)return;let{core:n}=t;return st((r,o)=>{!n.hasConsent("analytics")||r.startsWith(t.config.apiHost)||!ba(r,e)||(n.distinctId&&o.set(va,Mo(n.distinctId)),o.set(_a,Mo(n.sessionId)))})};Bt();de();var To="lc_early_access",wa=t=>{let{core:e}=t,n=()=>{try{return JSON.parse(e.storage.get(To)??"{}")}catch{return{}}},r=(o,s)=>{e.storage.set(To,JSON.stringify({...n(),[o]:s}));let i=ut(o,s);e.capture(i.event,i.props,i.extra),t.flags?.reload()};t.flagPersonProps.push(()=>Object.fromEntries(Object.entries(n()).map(([o,s])=>[He(o),s]))),t.earlyAccess={list:()=>new Promise(o=>t.whenConsented(()=>{t.fetch(`${t.config.apiHost}/v1/early-access?api_key=${encodeURIComponent(t.apiKey)}`,{credentials:"omit"}).then(s=>s.ok?s.json():Promise.reject(new Error(`status ${s.status}`))).then(s=>{let i=n();o((s.features??[]).map(a=>({...a,enrolled:i[a.flag_key]===!0})))}).catch(s=>{t.log("early access fetch failed",s),o([])})})),optIn:o=>r(o,!0),optOut:o=>r(o,!1)}};var Lo="lc_recs",jo="lc_recs_recent";function Fo(t,e,n,r){for(let o of r?[r]:n){let s=e(o)?.[Lo];if(s&&typeof s=="object"&&(s.placement===t||r!==void 0&&s.placement===void 0))return{flag:o,cfg:s}}}var xa=t=>{let{core:e}=t,n=t.config.recommendations??{},r=n.viewEvent??"$product_viewed",o=n.itemIdProperty??"item_id",s=[];try{let l=JSON.parse(e.storage.get(jo)??"[]");Array.isArray(l)&&(s=l.filter(c=>typeof c=="string").slice(0,20))}catch{}let i=()=>e.hasConsent("analytics"),a=l=>{l&&(s=[l,...s.filter(c=>c!==l)].slice(0,20),i()&&e.storage.set(jo,JSON.stringify(s)))};t.onCapture(l=>{let c=l.properties?.[o];l.event===r&&(typeof c=="string"||typeof c=="number")&&a(String(c))}),t.recs={viewed:a,async get(l,c={}){let u=Object.keys(t.flags?.all()??{}),f=Fo(l,k=>t.flags?.payload(k),u,c.flag),h=f?t.flags?.get(f.flag):void 0,m=new URLSearchParams({api_key:t.apiKey,placement:l});c.itemId&&m.set("item_id",c.itemId),i()&&s.length&&m.set("recent",s.filter(k=>k!==c.itemId).slice(0,10).join(","));let b=f?.cfg.strategy;typeof b=="string"&&m.set("strategy",b);let y=c.limit??f?.cfg.limit;typeof y=="number"&&y>0&&m.set("limit",String(Math.min(50,Math.floor(y)))),c.exclude?.length&&m.set("exclude",c.exclude.slice(0,50).join(","));let w={};try{let k=await t.fetch(`${t.config.apiHost}/v1/recommendations?${m}`,{credentials:"omit"});k.ok?w=await k.json():t.log("recommendations failed",k.status)}catch(k){t.log("recommendations failed",k)}let E=Array.isArray(w.items)?w.items:[],C=w.strategy??b??"",M={$recommendation_placement:l,$recommendation_strategy:C,...f?{$recommendation_flag:f.flag}:{},...h!==void 0?{$recommendation_variant:String(h)}:{}},q=!1,A={placement:l,strategy:C,items:E,...f?{flag:f.flag}:{},...h!==void 0?{variant:h}:{},shown(){q||!E.length||(q=!0,e.capture("$recommendation_shown",{...M,$recommendation_items:E.map(k=>k.item_id)}))},clicked(k){let I=E.findIndex(O=>O.item_id===k);e.capture("$recommendation_clicked",{...M,$recommendation_item:k,...I>=0?{$recommendation_position:I+1}:{}})}};return c.autoShown!==!1&&A.shown(),A}}};function bu(t,e={},n=[]){return tn(t,e,[cn,vn,fn,Io,bn,qt,...n])}export{en as DEFAULT_HOST,Kr as LIB_VERSION,Lo as RECS_PAYLOAD_KEY,Lt as assetUrl,cn as autocapture,kr as blocksInlineStyle,Tt as captureCspViolations,tn as createClient,qt as crossDomain,Wr as denylistHook,wa as earlyAccess,Ft as exposeGlobal,dn as flagSourceProps,fn as flagSources,vn as flags,bn as hostHeaders,bu as init,jt as isExtensionPage,Ds as loadModules,Ht as noopClient,Fo as placementFlag,Ge as privatizeUrl,xa as recommendations,Ms as resolveAssetHost,Er as rewriteUrl,qr as sampleHook,$s as styleTag,ao as tag404,Ut as urlPrivacyHook};
|