posthog-js 1.407.7 → 1.407.8

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.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(l||{}),u=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(u||{}),h=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(h||{}),d=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(d||{}),c=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(c||{}),v=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(v||{}),f=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(e){if(m[e])return m[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in p?p[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in g?g[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return m[e]=t.prototype,t.prototype;var a=document.createElement("iframe");a.style.display="none";var l,u=!1;try{document.body.appendChild(a);var h=a.contentWindow;if(!h)return t.prototype;var d=h[e].prototype;return d?((l=navigator.userAgent).includes("Safari")&&!l.includes("Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",e),u=!0),m[e]=d):r}catch(e){return r}finally{!u&&a.parentNode&&document.body.removeChild(a)}}var b={};function _(e,t,r){var i,n=e+"."+String(r);if(b[n])return b[n].call(t);var s=y(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(t)):t[r]}var w={};function x(e,t,r){var i=e+"."+String(r);if(w[i])return w[i].bind(t);var n=y(e)[r];return"function"!=typeof n?t[r]:(w[i]=n,n.bind(t))}function k(){return y("MutationObserver").constructor}function S(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n={next:i},s=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),e[t]=s,()=>{if(e[t]!==s)for(var r=e[t];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else e[t]=n.next}}catch(e){return()=>{}}}var C={childNodes:e=>_("Node",e,"childNodes"),parentNode:e=>_("Node",e,"parentNode"),parentElement:e=>_("Node",e,"parentElement"),textContent:e=>_("Node",e,"textContent"),contains:(e,t)=>x("Node",e,"contains")(t),getRootNode:e=>x("Node",e,"getRootNode")(),host:e=>e&&"host"in e?_("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null,querySelector:(e,t)=>x("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>x("Element",e,"querySelectorAll")(t),mutationObserver:k,patch:S};function T(e){return e.nodeType===e.ELEMENT_NODE}function I(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function M(e){return"[object ShadowRoot]"==={}.toString.call(e)}function E(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(i=Array.from(t,(e=>R(e,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function R(e,t){var r;if(function(e){return"styleSheet"in e}(e)){var i;try{i=E(e.styleSheet)||function(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return H(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?H(n,t):n}class P{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),T(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function O(e){var t=e.element,r=e.maskInputOptions,i=e.tagName,n=e.type,s=e.maskInputFn,o=e.value||"",a=n&&F(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,t):"*".repeat(o.length)),o}function F(e){return e.toLowerCase()}var L="__rrweb_original__";function A(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?F(t):null}catch(e){return null}}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function H(e,t){return(e||"").replace(N,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(D.test(l)||q.test(l))return"url("+u+l+u+")";if(j.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var B,U,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(e,t){return t&&""!==t.trim()?ee(e,t):t}function ee(e,t){var r=Y.get(e);if(r||(r=e.createElement("a"),Y.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function te(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?z:e}(e,t.maxBase64ImageLength):e}function re(e,t,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=X(e,i);if(l.startsWith("data:")){if("img"===t&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(e,t,r,i){if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>V||e.naturalHeight>V)return t;try{var n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(e,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):t}catch(e){return t}}(n,l,s.type,s.quality)),te(u,s)}if("image"===t)return te(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=X(e,i);return"image"===t&&h.startsWith("data:")?te(h,s):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),t.length>r;){var s=i(J);if(","===s.slice(-1))s=X(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?H(i,ee(e)):"object"===t&&"data"===r?X(e,i):i:X(e,i)}function ie(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ne(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ne(C.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&ne(C.parentNode(e),t,r)}function se(e,t,r,i){var n;if(T(e)){if(!C.childNodes(n=e).length)return!1}else{if(null===C.parentElement(e))return!1;n=C.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(ne(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function oe(e,t,r){var i=e.removeEventListener;"function"==typeof i&&i.call(e,t,r)}var ae=new Map;function le(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function ue(e){return null==e?"":e.toLowerCase()}var he=50,de=!1,ce=!1;function ve(e,t){var r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.maskTextClass,a=t.maskTextSelector,l=t.skipChild,u=void 0!==l&&l,h=t.inlineStylesheet,d=void 0===h||h,c=t.maskInputOptions,v=void 0===c?{}:c,p=t.maskTextFn,g=t.maskInputFn,m=t.slimDOMOptions,y=t.dataURLOptions,b=void 0===y?{}:y,_=t.inlineImages,w=void 0!==_&&_,x=t.recordCanvas,k=void 0!==x&&x,S=t.onSerialize,R=t.onIframeLoad,P=t.iframeLoadTimeout,N=void 0===P?5e3:P,D=t.onIframeListenerRegistered,q=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,z=void 0===j?5e3:j,V=t.keepIframeSrcFn,W=void 0===V?()=>!1:V,J=t.newlyAddedElement,K=void 0!==J&&J,Y=t.depth,X=void 0===Y?0:Y,te=t.maxDepth,ne=void 0===te?he:te,fe=t.needsMask,pe=t.preserveWhiteSpace,ge=void 0===pe||pe;if(X>=ne)return ce=!0,de||(de=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+ne+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;fe||(fe=se(e,o,a,void 0===fe));var me,ye=function(e,t){var r=t.doc,i=t.blockClass,n=t.blockSelector,s=t.needsMask,o=t.inlineStylesheet,a=t.maskInputOptions,l=void 0===a?{}:a,u=t.maskTextFn,h=t.maskInputFn,d=t.dataURLOptions,c=void 0===d?{}:d,v=t.inlineImages,p=t.recordCanvas,g=t.keepIframeSrcFn,m=t.newlyAddedElement,y=void 0!==m&&m,b=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:f.Document,childNodes:[],compatMode:e.compatMode}:{type:f.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,s,o=t.doc,a=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,h=t.maskInputFn,d=t.dataURLOptions,c=void 0===d?{}:d,v=t.inlineImages,p=t.recordCanvas,g=t.keepIframeSrcFn,m=t.newlyAddedElement,y=void 0!==m&&m,b=t.rootId,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=F(e.tagName);return Z.test(t)?"div":t}(e),x={},k=e.attributes.length,S=0;k>S;S++){var T=e.attributes[S];ie(w,T.name)||(x[T.name]=re(o,w,F(T.name),T.value,e,c))}if("link"===w&&a){var I=e.sheet;if(!I){var M=function(e){return e.href}(e);M&&!(I=le(o,M))&&M.includes(".css")&&(I=le(o,window.location.origin+"/"+M.replace(window.location.href,"")))}var R=null;I&&(R=E(I)),R&&(delete x.rel,delete x.href,x._cssText=R)}if("style"===w&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var P=E(e.sheet);P&&(x._cssText=P)}if("input"===w||"textarea"===w||"select"===w){var N=e.value,D=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&N?x.value=O({element:e,type:A(e),tagName:w,value:N,maskInputOptions:u,maskInputFn:h}):D&&(x.checked=D)}if("option"===w&&(e.selected&&!u.select?x.selected=!0:delete x.selected),"dialog"===w&&e.open)try{x.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}if("canvas"===w&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((L in n?n[L]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var q=e.toDataURL(c.type,c.quality),j=o.createElement("canvas");j.width=e.width,j.height=e.height,q!==j.toDataURL(c.type,c.quality)&&(x.rr_dataURL=q)}if("img"===w&&v){B||(B=o.createElement("canvas"),U=B.getContext("2d"));var H=e,z=H.currentSrc||H.getAttribute("src")||"<unknown-src>",V=H.crossOrigin,W=()=>{oe(H,"load",W);try{B.width=H.naturalWidth,B.height=H.naturalHeight,U.drawImage(H,0,0),x.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==H.crossOrigin)return H.crossOrigin="anonymous",void(H.complete&&0!==H.naturalWidth?W():H.addEventListener("load",W));console.warn("Cannot inline img src="+z+"! Error: "+e)}"anonymous"===H.crossOrigin&&(V?x.crossOrigin=V:H.removeAttribute("crossorigin"))};H.complete&&0!==H.naturalWidth?W():H.addEventListener("load",W)}if("audio"===w||"video"===w){var G=x;G.rr_mediaState=e.paused?"paused":"played",G.rr_mediaCurrentTime=e.currentTime,G.rr_mediaPlaybackRate=e.playbackRate,G.rr_mediaMuted=e.muted,G.rr_mediaLoop=e.loop,G.rr_mediaVolume=e.volume}if(y||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop)),_){var Q=e.getBoundingClientRect(),J=Q.width,K=Q.height,Y=Q.left,X=Q.top,ee=null==(r=o.defaultView)?void 0:r.getComputedStyle(e);x={class:x.class,rr_width:J+"px",rr_height:K+"px",rr_left:Math.floor(Y+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(X+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},ee&&(x.rr_position=ee.position||"static",ee.transform&&"none"!==ee.transform&&(x.rr_transform=ee.transform),ee.display&&ee.display.startsWith("inline")&&(x.rr_display=ee.display))}"iframe"!==w||g(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src);try{customElements.get(w)&&(s=!0)}catch(e){}return{type:f.Element,tagName:w,attributes:x,childNodes:[],isSVG:(te=e,Boolean("svg"===te.tagName||te.ownerSVGElement)||void 0),needBlock:_,rootId:b,isCustom:s};var te}(e,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case e.TEXT_NODE:return function(e,t){var r,i=t.needsMask,n=t.maskTextFn,s=t.rootId,o=C.parentNode(e),a=o&&o.tagName,l=C.textContent(e),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(e.nextSibling||e.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=E(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=H(l,ee(t.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(e)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:b});case e.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(e)||"",rootId:b};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,keepIframeSrcFn:W,newlyAddedElement:K});if(!ye)return console.warn(e,"not serialized"),null;me=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===f.Comment)return!0;if(e.type===f.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ue(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ue(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ue(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(ue(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ue(e.attributes.name))||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ue(e.attributes.name)))return!0}}return!1}(ye,m)||!ge&&ye.type===f.Text&&!ye.isStyle&&!ye.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var be=Object.assign(ye,{id:me});if(i.add(e,be),me===G)return null;S&&S(e);var _e=!u;if(be.type===f.Element){_e=_e&&!be.needBlock,delete be.needBlock;var we=C.shadowRoot(e);we&&M(we)&&(be.isShadowHost=!0)}if((be.type===f.Document||be.type===f.Element)&&_e){m.headWhitespace&&be.type===f.Element&&"head"===be.tagName&&(ge=!1);var xe={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:ge,onSerialize:S,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:W,depth:X+1,maxDepth:ne};if(be.type===f.Element&&"textarea"===be.tagName&&void 0!==be.attributes.value);else for(var ke of Array.from(C.childNodes(e))){var Se=ve(ke,xe);Se&&be.childNodes.push(Se)}var Ce=null;if(T(e)&&(Ce=C.shadowRoot(e)))for(var Te of Array.from(C.childNodes(Ce))){var Ie=ve(Te,xe);Ie&&(M(Ce)&&(Ie.isShadow=!0),be.childNodes.push(Ie))}}var Me=C.parentNode(e);if(Me&&I(Me)&&M(Me)&&(be.isShadow=!0),be.type===f.Element&&"iframe"===be.tagName){var Ee=function(e,t,r){var i,n=()=>{},s=e.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),oe(e,"load",h),e.addEventListener("load",o),t())},h=()=>u();return l=setTimeout(u,r),e.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?oe(e,"load",o):(a=!0,oe(e,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(e){return n}if(d!==c||e.src===c||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),oe(e,"load",o)}}return e.addEventListener("load",o),()=>{oe(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&R){var r=ve(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:ge,onSerialize:S,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:W,depth:X+1,maxDepth:ne});r&&R(e,r)}}),N);null==D||D(e,Ee)}return be.type===f.Element&&"link"===be.tagName&&"stylesheet"===be.attributes.rel&&function(t,l,u){if(!ae.has(t)){var h;try{h=t.sheet}catch(e){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(q){var t=ve(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:ge,onSerialize:S,onIframeLoad:R,iframeLoadTimeout:N,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:W,depth:X,maxDepth:ne});t&&q(e,t)}})()}finally{ae.delete(t),c.abort()}}},_=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),t.addEventListener("load",y,{signal:c.signal,once:!0}),ae.set(t,c)}}}(e,0,z),be}function fe(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class pe{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof pe))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function ge(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>me(r,e,t,i)}function me(e,t,r,i){ye((()=>{var n=e.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(e,t,r,i):n.call(e,t,r))}))}function ye(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var be="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",_e={map:{},getId(){return console.error(be),-1},getNode(){return console.error(be),null},removeNodeFromMap(){console.error(be)},has(){return console.error(be),!1},reset(){console.error(be)}};function we(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}}function xe(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(e){return}s.set.call(this,e)}}}),()=>xe(e,t,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_e=new Proxy(_e,{get(e,t,r){return"map"===t&&console.error(be),Reflect.get(e,t,r)}}));var ke=Date.now;function Se(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=C.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Te(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function Me(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ne(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Ee(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===G}function Re(e,t){if(I(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=C.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||Re(i,t))}function Pe(e){return Boolean(e.changedTouches)}function Oe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Le(e){return!!e&&(e instanceof pe&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ke=()=>(new Date).getTime());class $e{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ae(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function Ne(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ae(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function De(e){return"__ln"in e}class qe{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&De(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&De(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var je,He=(e,t)=>e+"@"+t;class Be{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new qe,i=e=>{for(var t=e,r=G;r===G;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=C.parentNode(n);if(s&&Ne(n)&&"TEXTAREA"!==s.tagName){var o=I(s)?this.mirror.getId(Ae(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ve(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Oe(e,this.mirror)&&this.iframeManager.addIframe(e),Fe(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Le(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)ze(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ve(this.droppedSet,o)||ze(this.removesSubTreeCache,o)?Ve(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(C.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=C.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t=e.attributes;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=O({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:A(e),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(e=>{if(!Ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=C.textContent(e.target);Me(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:se(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=A(r);n=O({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Me(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!ie(r.tagName,i))if(o.attributes[i]=re(this.doc,F(r.tagName),F(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&(a.style.cssText=e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Me(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=I(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);Me(e.target,this.blockClass,this.blockSelector,!1)||Ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ue(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Re(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[He(r,i)]?Ue(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!I(e.target)||!M(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),C.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[He(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Me(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Le(e)&&C.childNodes(C.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Ue(e,t){e.delete(t),C.childNodes(t).forEach((t=>Ue(e,t)))}function ze(e,t,r){return 0!==e.size&&function(e,t,r){var i=C.parentNode(t);return!!i&&e.has(i)}(e,t)}function Ve(e,t){return 0!==e.size&&We(e,t)}function We(e,t){var r=C.parentNode(t);return!!r&&(!!e.has(r)||We(e,r))}var Ze=e=>je?function(){try{return e(...arguments)}catch(e){if(je&&!0===je(e))return;throw e}}:e,Ge=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Je(e,t){var r=new Be;Ge.push(r),r.init(e);var i=new(k())(Ze(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(n.attributeFilter=e.attributeFilter),i.observe(t,n),{observer:i,buffer:r}}function Ke(e){var t=e.scrollCb,r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.sampling,a=new Map,l=e=>{var o=Qe(e);if(o&&!Me(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=Se(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),t({id:h,x:l,y:u}))}},u=[ge("scroll",Ze(we(Ze((e=>l(e))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(ge("scrollend",Ze(l),r)),()=>u.forEach((e=>e()))}function Ye(e,t){for(var r=Ge.length-1;r>=0;r--){var i=Ge[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Ge.splice(r,1))}}}var Xe=["INPUT","TEXTAREA","SELECT"],et=new WeakMap;function tt(e){return function e(t,r){if(st("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function rt(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function it(e,t){var r,i,n,s,o=e.stylesheetManager;s=e.mirror.getId("#document"===t.nodeName?t:C.host(t));var a="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=l.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==s&&-1!==s)try{o.adoptStyleSheets(e,s)}catch(e){}return r}}),Ze((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function nt(e,t){void 0===t&&(t={});var i,n,s=e.doc.defaultView;if(!s)return()=>{};if(function(e,t){var r=e.mutationCb,i=e.mousemoveCb,n=e.mouseInteractionCb,s=e.scrollCb,o=e.viewportResizeCb,a=e.inputCb,l=e.mediaInteractionCb,u=e.styleSheetRuleCb,h=e.styleDeclarationCb,d=e.canvasMutationCb,c=e.fontCb,v=e.selectionCb,f=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),c(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM){var o=Je(e,e.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,b,_=function(e){var t=e.mousemoveCb,r=e.sampling,i=e.doc,n=e.mirror;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=we(Ze((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),d=Ze(we(Ze((e=>{var t=Qe(e),r=Pe(e)?e.changedTouches[0]:e,i=r.clientX,o=r.clientY;s||(s=ke()),l.push({x:i,y:o,id:n.getId(t),timeOffset:ke()-s}),h("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[ge("mousemove",d,i),ge("touchmove",d,i),ge("drag",d,i)];return Ze((()=>{c.forEach((e=>e()))}))}(e),w=function(e){var t=e.mouseInteractionCb,i=e.doc,n=e.mirror,s=e.blockClass,o=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=F(e),l=(e=>i=>{var a=Qe(i);if(!Me(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[e]===h.MouseDown?u="TouchStart":h[e]===h.MouseUp&&(u="TouchEnd"))}else Pe(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[e]===h.Click&&(l=c,c=null);var v=Pe(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;Ze(t)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(h[e]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(ge(a,l,i))})),Ze((()=>{u.forEach((e=>e()))}))}(e),x=Ke(e),k=function(e,t){var r=e.viewportResizeCb,i=t.win,n=-1,s=-1;return ge("resize",Ze(we(Ze((()=>{var e=Ce(),t=Te();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:s}),T=function(e){var t=e.inputCb,i=e.doc,n=e.mirror,s=e.blockClass,o=e.blockSelector,a=e.ignoreClass,l=e.ignoreSelector,u=e.maskInputOptions,h=e.maskInputFn,d=e.userTriggeredOnInput;function c(e){var t=Qe(e),r=e.isTrusted,n=i.defaultView;if(!t||!n||t instanceof n.HTMLElement){var c=t&&t.tagName;if(t&&"OPTION"===c&&(t=C.parentElement(t)),t&&c&&Xe.indexOf(c)>=0&&!Me(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var f=t.value,p=!1,g=A(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[c.toLowerCase()]||u[g])&&(f=O({element:t,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(t,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=t.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(e,i){var s=et.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){et.set(e,i);var o=n.getId(e);Ze(t)(r({},i,{id:o}))}}var f=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>ge(e,Ze(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((e=>e()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>xe(e[0],e[1],{set(){Ze(c)({target:this,isTrusted:!1})}},!1,p)))),Ze((()=>{f.forEach((e=>e()))}))}(e),I=(l=(a=e).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=Ze((e=>we(Ze((t=>{var r=Qe(t);if(r&&!Me(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:e,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),b=[ge("play",y(v.Play),m),ge("pause",y(v.Pause),m),ge("seeked",y(v.Seeked),m),ge("volumechange",y(v.VolumeChange),m),ge("ratechange",y(v.RateChange),m)],Ze((()=>{b.forEach((e=>e()))}))),M=()=>{},E=()=>{},R=()=>{},P=()=>{};e.recordDOM&&(M=function(e,t){var r=e.styleSheetRuleCb,i=e.mirror,n=e.stylesheetManager,s=t.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ze(((e,t,s)=>{var o=s[0],a=s[1],l=rt(t,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),e.apply(t,s)}))}));var h={};ot("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ot("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ot("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ot("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((e=>{var t=e[0],s=e[1];d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ze(((e,t,s)=>{var o=s[0],a=s[1],l=rt(t.parentStyleSheet,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:[...tt(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...tt(t),o]}]}),e.apply(t,s)}))})})),Ze((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:s}),E=it(e,e.doc),R=function(e,t){var r=e.styleDeclarationCb,i=e.mirror,n=e.ignoreCSSAttributes,s=e.stylesheetManager,o=t.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ze(((e,t,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(t,[u,h,d]);var c=rt(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:u,value:h,priority:d},index:tt(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ze(((e,t,o)=>{var a,u=o[0];if(n.has(u))return l.apply(t,[u]);var h=rt(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:u},index:tt(t.parentRule)}),e.apply(t,o)}))}),Ze((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:s}),e.collectFonts&&(P=function(e){var t=e.fontCb,r=e.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=S(r.fonts,"add",(function(e){return function(r){return setTimeout(Ze((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ze((()=>{n.forEach((e=>e()))}))}(e)));var L=function(e){var t=e.doc,r=e.mirror,i=e.blockClass,n=e.blockSelector,s=e.selectionCb,o=!0,a=Ze((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var h=e.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Me(d,i,n,!0)||Me(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ge("selectionchange",a)}(e),N=function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?S(r.customElements,"define",(function(e){return function(r,i,n){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,i,n])}})):()=>{}}(e),D=[];for(var q of e.plugins)D.push(q.observer(q.callback,s,q.options));return Ze((()=>{if(n){n.destroy(),n.reset();var t=Ge.indexOf(n);-1!==t&&Ge.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==i||i.disconnect(),_(),w(),x(),k(),T(),I(),M(),E(),R(),P(),L(),N(),D.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ot(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class at{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class lt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new at(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new at(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>ye(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{me(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=e.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);ye((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(s)}))}ye((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return t;case l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case l.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===f.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(me(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(me(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((e=>{ye((()=>this.mirror.removeNodeFromMap(e)))})),ye((()=>Ye(r,s))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&me(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{me(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class ut{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var i,n;if(M(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var s=null!==(i=null==(n=C.host(e))?void 0:n.ownerDocument)&&void 0!==i?i:t,o=Je(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var e=Ge.indexOf(l);-1!==e&&Ge.splice(e,1)}}),this.restoreHandlers.push({doc:s,handler:Ke(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push({doc:s,handler:it({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:S(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=C.shadowRoot(this);return s&&Ne(this)&&r.addShadowRoot(s,t),n}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}for(var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ct=0;64>ct;ct++)dt[ht.charCodeAt(ct)]=ct;var vt=new Map,ft=(e,t,r)=>{if(e&&(mt(e,t)||"object"==typeof e)){var i=function(e,t){var r=vt.get(e);return r||vt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function pt(e,t,r,i){if(e instanceof Array)return e.map((e=>pt(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,s=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=ht[r[t]>>2],n+=ht[(3&r[t])<<4|r[t+1]>>4],n+=ht[(15&r[t+1])<<2|r[t+2]>>6],n+=ht[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:s}}return e instanceof DataView?{rr_type:e.constructor.name,args:[pt(e.buffer,t,r,i),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[pt(e.data,t,r,i),e.width,e.height]}:mt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ft(e,t,r)}:e}var gt=(e,t,r,i)=>e.map((e=>pt(e,t,r,i))),mt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},yt=["webgl","webgl2"];function bt(e){return"nodeType"in e}function _t(e,t,i,n){var s=[];try{if(n){var o=function(e,t,i){var n=e.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return S(n.prototype,"configure",(function(n){return function(s){var o=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!o||bt(o)&&Me(o,t,i,!0))return n.call(this,s);bt(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(e,t,i);o&&s.push(o)}var a=S(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var s=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Me(this,t,i,!0)&&("__context"in this||(this.__context=s),n&&yt.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...a])}}));s.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((e=>e()))}}function wt(e,t,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(e),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof e[l])return 0;var u=S(e,l,(function(e){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=e.apply(this,u);if(ft(d,s,this),"tagName"in this.canvas&&!Me(this.canvas,i,n,!0)){var c=gt(u,s,this,o);r(this.canvas,{type:t,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=xe(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var xt,kt,St,Ct='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n return worker.postMessage({ id });\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-CZCeNtwG.js.map\n',Tt="undefined"!=typeof self&&self.Blob&&new Blob([Ct],{type:"text/javascript;charset=utf-8"});function It(e){var t;try{if(!(t=Tt&&(self.URL||self.webkitURL).createObjectURL(Tt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ct),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Mt{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,i=e.win,n=e.blockClass,s=e.blockSelector,o=e.recordCanvas,l=e.dataURLOptions,u=e.resolutionScale;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,l),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:l,resolutionScale:u})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=_t(r,i,n,!0),h=new Map;try{a=new It}catch(e){return}var d=!1;a.onerror=()=>{var e;d=!0,cancelAnimationFrame(v),null==(e=a.terminate)||e.call(a)},a.onmessage=e=>{var t=e.data.id;if(h.set(t,!1),"base64"in e.data){var r=e.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:t,type:c["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/e,p=0,g=e=>{var u,c;d||(p&&f>e-p||(p=e,(u=[],c=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Me(e,i,n,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&c(e.shadowRoot)}))}catch(e){}},c(r.document),u).forEach(function(){var e=t((function*(e){var t,r,i=o.mirror.getId(e);if(!h.get(i)&&0!==e.width&&0!==e.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);if(null==(t=null==n?void 0:n.isContextLost)?void 0:t.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=e.clientWidth||e.width,d=e.clientHeight||e.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=yield createImageBitmap(e,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:f,width:c,height:v,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions},[f])}catch(e){h.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var e;u(),cancelAnimationFrame(v),null==(e=a.terminate)||e.call(a)}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=_t(e,t,r,!1),s=function(e,t,r,i,n){var s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var a=S(t.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Me(this.canvas,r,i,!0)||setTimeout((()=>{var r=gt(l,t,this,n);e(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=xe(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:c["2D"],property:o,args:[t],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var s=[];return void 0!==t.WebGLRenderingContext&&s.push(...wt(t.WebGLRenderingContext.prototype,c.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&s.push(...wt(t.WebGL2RenderingContext.prototype,c.WebGL2,e,r,i,t,n)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,s)));this.mutationCb({id:t,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Et{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new $e),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:R(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,ae.forEach((e=>e.abort())),ae.clear()}trackStylesheetInLinkElement(e){}}class Rt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Pt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Ot=document.createElement("iframe");document.body.appendChild(Ot),Array.from=(null==(n=Ot.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ot)}}catch(e){console.debug("Unable to override Array.from",e)}var Ft=new P,Lt=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function $t(e){void 0===e&&(e={});var t=e,i=t.emit,n=t.checkoutEveryNms,s=t.checkoutEveryNth,o=t.blockClass,a=void 0===o?"rr-block":o,h=t.blockSelector,d=void 0===h?null:h,c=t.ignoreClass,v=void 0===c?"rr-ignore":c,f=t.ignoreSelector,p=void 0===f?null:f,g=t.maskTextClass,m=void 0===g?"rr-mask":g,y=t.maskTextSelector,b=void 0===y?null:y,_=t.inlineStylesheet,w=void 0===_||_,x=t.maskAllInputs,k=t.maskInputOptions,S=t.slimDOMOptions,T=t.maskInputFn,I=t.maskTextFn,M=t.hooks,E=t.packFn,R=t.sampling,O=void 0===R?{}:R,F=t.dataURLOptions,L=void 0===F?{}:F,A=t.canvasResolutionScale,N=t.mousemoveWait,D=t.recordDOM,q=void 0===D||D,j=t.recordCanvas,H=void 0!==j&&j,B=t.recordCrossOriginIframes,U=void 0!==B&&B,z=t.recordAfter,V=void 0===z?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":z,W=t.userTriggeredOnInput,Z=void 0!==W&&W,G=t.collectFonts,Q=void 0!==G&&G,J=t.inlineImages,K=void 0!==J&&J,Y=t.plugins,X=t.keepIframeSrcFn,ee=void 0===X?()=>!1:X,te=t.ignoreCSSAttributes,re=void 0===te?new Set([]):te,ie=t.attributeFilter;je=t.errorHandler;var ne=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),se=!U||window.parent===window,oe=!1;if(!se)try{window.parent.document&&(oe=!1)}catch(e){oe=!0}if(se&&!i)throw new Error("emit function is required");if(!se&&!oe)return()=>{};void 0!==N&&void 0===O.mousemove&&(O.mousemove=N),Ft.reset();var ae,le=!0===x?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==k?k:{password:!0},ue=fe(void 0!==S&&S);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var he,de,ce=0,pe=new Map,me=e=>{for(var t of Y||[])t.eventProcessor&&(e=t.eventProcessor(e));return E&&!oe&&(e=E(e)),e};xt=(e,t)=>{var r,o=e;if(o.timestamp=ke(),!(null==(r=Ge[0])?void 0:r.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&Lt.has(o.data.source)||Ge.forEach((e=>e.unfreeze())),se)null==i||i(me(o),t);else if(oe){var a={type:"rrweb",event:me(o),origin:window.location.origin,isCheckout:t};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)ae=o,ce=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;ce++,(s&&ce>=s||n&&o.timestamp-ae.timestamp>n)&&kt(!0)}};var be=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,i=new Set;if(e.adds.length>0)for(var n of e.adds){var s=Ft.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}e.removes.forEach((e=>{var r=e.id;if(!t||!t.has(r)){var n=Ie.getIframeElementById(r);n&&i.has(n)?Ie.forgetIframeId(r):(null==he||he(r),Ie.removeIframeById(r))}})),null==de||de(),Ie.cleanupDetachedIframes()}xt({type:l.IncrementalSnapshot,data:r({source:u.Mutation},e)})},_e=e=>xt({type:l.IncrementalSnapshot,data:r({source:u.Scroll},e)}),we=e=>xt({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),xe=new Et({mutationCb:be,adoptedStyleSheetCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)})}),Ie=new lt({mirror:Ft,mutationCb:be,stylesheetManager:xe,recordCrossOriginIframes:U,wrappedEmit:xt});for(var Me of Y||[])Me.getMirror&&Me.getMirror({nodeMirror:Ft,crossOriginIframeMirror:Ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ie.crossOriginIframeStyleMirror});var Ee=new Rt;St=new Mt({recordCanvas:H,mutationCb:we,win:window,blockClass:a,blockSelector:d,mirror:Ft,sampling:O.canvas,dataURLOptions:ne,resolutionScale:A});var Re=new ut({mutationCb:be,scrollCb:_e,bypassOptions:{blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskInputOptions:le,dataURLOptions:ne,maskTextFn:I,maskInputFn:T,recordCanvas:H,inlineImages:K,sampling:O,slimDOMOptions:ue,iframeManager:Ie,stylesheetManager:xe,canvasManager:St,keepIframeSrcFn:ee,processedNodeManager:Ee,attributeFilter:ie},mirror:Ft});kt=function(e){if(void 0===e&&(e=!1),q){xt({type:l.Meta,data:{href:window.location.href,width:Te(),height:Ce()}},e),xe.reset(),Re.init(),Ge.forEach((e=>e.lock()));var t=function(e,t){var r=t||{},i=r.mirror,n=void 0===i?new P:i,s=r.blockClass,o=r.blockSelector,a=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,h=r.inlineImages,d=void 0!==h&&h,c=r.recordCanvas,v=void 0!==c&&c,f=r.maskAllInputs,p=void 0!==f&&f,g=r.slimDOM,m=r.dataURLOptions,y=r.preserveWhiteSpace,b=r.onSerialize,_=r.onIframeLoad,w=r.iframeLoadTimeout,x=r.onIframeListenerRegistered,k=r.onStylesheetLoad,S=r.stylesheetLoadTimeout,C=r.keepIframeSrcFn,T=void 0===C?()=>!1:C,I=r.maxDepth;return ve(e,{doc:e,mirror:n,blockClass:void 0===s?"rr-block":s,blockSelector:void 0===o?null:o,maskTextClass:void 0===a?"rr-mask":a,maskTextSelector:void 0===l?null:l,skipChild:!1,inlineStylesheet:void 0===u||u,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===p?{password:!0}:p,maskTextFn:r.maskTextFn,maskInputFn:r.maskInputFn,slimDOMOptions:fe(void 0!==g&&g),dataURLOptions:m,inlineImages:d,recordCanvas:v,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:_,iframeLoadTimeout:w,onIframeListenerRegistered:x,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:T,newlyAddedElement:!1,maxDepth:I})}(document,{mirror:Ft,blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskAllInputs:le,maskTextFn:I,maskInputFn:T,slimDOM:ue,dataURLOptions:ne,recordCanvas:H,inlineImages:K,onSerialize(e){Oe(e,Ft)&&Ie.addIframe(e),Fe(e,Ft)&&xe.trackLinkElement(e),Le(e)&&Re.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){Ie.attachIframe(e,t),Re.observeAttachShadow(e)},onIframeListenerRegistered(e,t){Ie.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){xe.attachLinkElement(e,t)},keepIframeSrcFn:ee});if(!t)return console.warn("Failed to snapshot the document");xt({type:l.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Ge.forEach((e=>e.unlock())),U&&Ie.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&xe.adoptStyleSheets(document.adoptedStyleSheets,Ft.getId(document))}};try{var Pe=[];he=e=>{var t=pe.get(e);t&&(t.forEach((e=>{ye(e);var t=Pe.indexOf(e);-1!==t&&Pe.splice(t,1)})),pe.delete(e))},de=()=>{for(var e of pe){var t=e[0],r=Ft.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==he||he(t)}catch(e){null==he||he(t)}else null==he||he(t)}};var $e=e=>{var t;return Ze(nt)({mutationCb:be,mousemoveCb:(e,t)=>xt({type:l.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:_e,viewportResizeCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:we,fontCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){xt({type:l.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){xt({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:a,ignoreClass:v,ignoreSelector:p,maskTextClass:m,maskTextSelector:b,maskInputOptions:le,inlineStylesheet:w,sampling:O,recordDOM:q,recordCanvas:H,inlineImages:K,userTriggeredOnInput:Z,collectFonts:Q,doc:e,maskInputFn:T,maskTextFn:I,keepIframeSrcFn:ee,blockSelector:d,slimDOMOptions:ue,dataURLOptions:ne,mirror:Ft,iframeManager:Ie,stylesheetManager:xe,shadowDomManager:Re,processedNodeManager:Ee,canvasManager:St,ignoreCSSAttributes:re,attributeFilter:ie,plugins:(null==(t=null==Y?void 0:Y.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>xt({type:l.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},M)};Ie.addLoadListener((e=>{try{var t=Ft.getId(e),r=$e(e.contentDocument);if(Pe.push(r),-1!==t){var i=pe.get(t);i||pe.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),Ie.addPageHideListener((e=>{var t=Ft.getId(e);null==he||he(t),Ye(e)}));var Ae=-1,Ne=e=>xt({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),De=()=>{var e,t,r,i,n=document,s=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=s?Ft.getId(s):-1;o!==Ae&&(-1!==Ae&&Ne({id:Ae,enter:!1}),Ae=o,-1!==o&&Ne({id:o,enter:!0}))},qe=()=>{kt(),Pe.push($e(document)),Pe.push(ge("fullscreenchange",De)),Pe.push(ge("webkitfullscreenchange",De)),Pe.push(ge("mozfullscreenchange",De)),Pe.push(ge("MSFullscreenChange",De)),Pt=!0};return["interactive","complete"].includes(document.readyState)?qe():(Pe.push(ge("DOMContentLoaded",(()=>{xt({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===V&&qe()}))),Pe.push(ge("load",(()=>{xt({type:l.Load,data:{}}),"load"===V&&qe()}),window))),()=>{Pe.forEach((e=>ye(e))),Ee.destroy(),Ie.removeLoadListener(),Ie.destroy(),pe.clear(),Re.reset(),Ft.reset(),Pt=!1,je=void 0}}catch(e){console.warn(e)}}$t.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");xt({type:l.Custom,data:{tag:e,payload:t}})},$t.freezePage=()=>{Ge.forEach((e=>e.freeze()))},$t.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");kt(e)},$t.mirror=Ft;var At=Object.defineProperty,Nt=(e,t,r)=>((e,t,r)=>t in e?At(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Dt{constructor(e){Nt(this,"fileName"),Nt(this,"functionName"),Nt(this,"lineNumber"),Nt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var qt=/(^|@)\S+:\d+/,jt=/^\s*at .*(\S+:\d+|\(native\))/m,Ht=/^(eval@)?(\[native code])?$/,Bt={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(jt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(jt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Dt({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Ht)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Dt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new Dt({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Dt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Dt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(qt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Dt({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ut(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function zt(e){return Array.isArray(e)}function Vt(e){return"object"==typeof e&&null!==e&&!zt(e)}function Wt(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Vt(e[i])&&Wt(e[i],t-1))return!0;return!1}function Zt(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Vt(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Vt(o)&&Wt(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=zt(u)?Ut(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Gt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Qt(e,t,r){var i,n=r?Object.assign({},Gt,r):Gt,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=Bt.parse(t.error).map((e=>e.toString())),s=[Zt(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[Zt("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Zt("Uncaught (in promise)",n.stringifyOptions),Zt(t.reason,n.stringifyOptions)]);var s=Bt.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((e=>e()))};function c(t,r){var i=this;return t[r]?function(t,s,l){try{if(!(s in t))return()=>{};var u=t[s],h={next:u},d=(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Bt.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Zt(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Zt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return h.next.apply(this,t)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),t[s]=d,()=>{if(t[s]!==d)for(var e=t[s];"function"==typeof e&&e.__rrweb_layer__;){var r=e.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);e=r.next}else t[s]=h.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var Jt=e=>({name:"rrweb/console@1",observer:Qt,options:e}),Kt=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Yt(e){return"string"==typeof e||e}function Xt(e){return"string"==typeof e?e:void 0}var er,tr=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],rr=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),ir=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),nr="min_length",sr="max_length",or=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],ar=["token"],lr="NativeGzipValidationError",ur=e=>e.length>=2&&31===e[0]&&139===e[1],hr=(e,t)=>e===ir.GZipJS||t===ir.GZipJS||"gzip"===t,dr=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),cr=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=lr,t},vr=function(){var e=t((function*(e,t){18>e.size&&cr("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());ur(r)&&8===r[2]||cr("invalid-header");var i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(er)return er;er=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;er[e]=t>>>0}return er})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&cr("invalid-crc");var n=t.length>>>0;i.getUint32(4,!0)!==n&&cr("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function fr(){return fr=t((function*(e,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(e),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var e=t((function*(e){try{yield o.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield vr(u,n),u}catch(e){if(null!=i&&i.rethrow)throw e;return r&&console.error("Failed to gzip compress data",e),null}})),fr.apply(this,arguments)}var pr=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],gr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return pr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};function mr(e,t){return-1!==e.indexOf(t)}var yr=function(e){return e.trim()},br=function(e){return e.replace(/^\$/,"")};function _r(e){var t,r=[];return null!==(t=JSON.stringify(e,(function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(t))return"[Circular]";r.push(t)}return t}})))&&void 0!==t?t:"null"}var wr=Object.prototype,xr=wr.hasOwnProperty,kr=wr.toString,Sr=Array.isArray||function(e){return"[object Array]"===kr.call(e)},Cr=e=>"function"==typeof e,Tr=e=>e===Object(e)&&!Sr(e),Ir=e=>{if(Tr(e)){for(var t in e)if(xr.call(e,t))return!1;return!0}return!1},Mr=e=>void 0===e,Er=e=>"[object String]"==kr.call(e),Rr=e=>Er(e)&&0===e.trim().length,Pr=e=>null===e,Or=e=>Mr(e)||Pr(e),Fr=e=>"[object Number]"==kr.call(e)&&e==e,Lr=e=>Fr(e)&&e>0,$r=e=>"[object Boolean]"===kr.call(e),Ar=e=>e instanceof FormData,Nr=e=>mr(or,e),Dr=e=>mr(ar,e);function qr(e){return null===e||"object"!=typeof e}function jr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Hr(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var Br=[!0,"true",1,"1","yes"],Ur=e=>mr(Br,e),zr=[!1,"false",0,"0","no"];function Vr(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Fr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Vr(n||r,t,r,i))}class Wr{constructor(e){this.$e={},this.ze=e.ze,this.Ze=Vr(e.bucketSize,0,100,e.Ge),this.Qe=Vr(e.refillRate,0,this.Ze,e.Ge),this.Je=Vr(e.refillInterval,0,864e5,e.Ge)}Ke(e,t){var r=Math.floor((t-e.lastAccess)/this.Je);r>0&&(e.tokens=Math.min(e.tokens+r*this.Qe,this.Ze),e.lastAccess=e.lastAccess+r*this.Je)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.$e[i];return n?this.Ke(n,r):this.$e[i]=n={tokens:this.Ze,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.ze)||t.call(this,e)),0===n.tokens)}stop(){this.$e={}}}var Zr="Mobile",Gr="iOS",Qr="Android",Jr="Tablet",Kr=Qr+" "+Jr,Yr="iPad",Xr="Apple",ei=Xr+" Watch",ti="Safari",ri="BlackBerry",ii="Samsung",ni=ii+"Browser",si=ii+" Internet",oi="Chrome",ai=oi+" OS",li=oi+" "+Gr,ui="Internet Explorer",hi=ui+" "+Zr,di="Opera",ci=di+" Mini",vi="Edge",fi="Microsoft "+vi,pi="Firefox",gi=pi+" "+Gr,mi="Nintendo",yi="PlayStation",bi="Xbox",_i=Qr+" "+Zr,wi=Zr+" "+ti,xi="Windows",ki=xi+" Phone",Si="Nokia",Ci="Ouya",Ti="Generic",Ii=Ti+" "+Zr.toLowerCase(),Mi=Ti+" "+Jr.toLowerCase(),Ei="Konqueror",Ri="Oculus Browser",Pi="Vivaldi",Oi="Yandex",Fi="Whale",Li="DuckDuckGo",$i="Pale Moon",Ai="Waterfox",Ni="Brave",Di="Google Search App",qi="(\\d+(\\.\\d+)?)",ji=new RegExp("Version/"+qi),Hi=new RegExp(bi,"i"),Bi=new RegExp(yi+" \\w+","i"),Ui=new RegExp(mi+" \\w+","i"),zi=new RegExp(ri+"|PlayBook|BB10","i"),Vi={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Wi=function(e,t,r,i){t=t||"";var n=function(e){return null!=e&&e.brave?Ni:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&mr(e,"GSA/")?Di:mr(e," OPR/")&&mr(e,"Mini")?ci:mr(e," OPR/")?di:zi.test(e)?ri:mr(e,"IE"+Zr)||mr(e,"WPDesktop")?hi:mr(e,"OculusBrowser")?Ri:mr(e,ni)?si:mr(e,vi)||mr(e,"Edg/")?fi:mr(e,Pi+"/")?Pi:mr(e,"YaBrowser/")?Oi:mr(e,Fi+"/")?Fi:mr(e,Li+"/")||mr(e,"Ddg/")?Li:mr(e,"FBIOS")?"Facebook "+Zr:mr(e,"UCWEB")||mr(e,"UCBrowser")?"UC Browser":mr(e,"CriOS")?li:mr(e,"CrMo")||mr(e,oi)?oi:mr(e,Qr)&&mr(e,ti)?_i:mr(e,"FxiOS")?gi:mr(e.toLowerCase(),Ei.toLowerCase())?Ei:mr(e,Ni+"/")?Ni:((e,t)=>t&&mr(t,Xr)||function(e){return mr(e,ti)&&!mr(e,oi)&&!mr(e,Qr)}(e))(e,t)?mr(e,Zr)?wi:ti:mr(e,"PaleMoon/")?$i:mr(e,Ai+"/")?Ai:mr(e,pi)?pi:mr(e,"MSIE")||mr(e,"Trident/")?ui:mr(e,"Gecko")?pi:"")},Zi={[hi]:[new RegExp("rv:"+qi)],[fi]:[new RegExp(vi+"?\\/"+qi)],[oi]:[new RegExp("("+oi+"|CrMo)\\/"+qi)],[li]:[new RegExp("CriOS\\/"+qi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qi)],[ti]:[ji],[wi]:[ji],[di]:[new RegExp("(Opera|OPR)\\/"+qi)],[pi]:[new RegExp(pi+"\\/"+qi)],[gi]:[new RegExp("FxiOS\\/"+qi)],[Ei]:[new RegExp("Konqueror[:/]?"+qi,"i")],[ri]:[new RegExp(ri+" "+qi),ji],[_i]:[new RegExp("android\\s"+qi,"i")],[si]:[new RegExp(ni+"\\/"+qi)],[Ri]:[new RegExp("OculusBrowser\\/"+qi)],[Pi]:[new RegExp(Pi+"\\/"+qi)],[Oi]:[new RegExp("YaBrowser\\/"+qi)],[Fi]:[new RegExp(Fi+"\\/"+qi)],[Ni]:[new RegExp(Ni+"\\/"+qi)],[Li]:[new RegExp("(DuckDuckGo|Ddg)\\/"+qi)],[$i]:[new RegExp("PaleMoon\\/"+qi)],[Ai]:[new RegExp(Ai+"\\/"+qi)],[Di]:[new RegExp("GSA\\/"+qi)],[ui]:[new RegExp("(rv:|MSIE )"+qi)],Mozilla:[new RegExp("rv:"+qi)]},Gi=function(e,t,r,i){var n=Wi(e,t,r,i),s=Zi[n];if(Mr(s))return null;for(var o=0;s.length>o;o++){var a=e.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Qi=[[new RegExp(bi+"; "+bi+" (.*?)[);]","i"),e=>[bi,e&&e[1]||""]],[new RegExp(mi,"i"),[mi,""]],[new RegExp(yi,"i"),[yi,""]],[zi,[ri,""]],[new RegExp(xi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ki,""];if(new RegExp(Zr).test(t)&&!/IEMobile\b/.test(t))return[xi+" "+Zr,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=Vi[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[xi,i]}return[xi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Gr,[e[3],e[4],e[5]||"0"].join(".")]:[Gr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Mr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Qr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qr+")","i"),e=>e&&e[2]?[Qr,[e[2],e[3],e[4]||"0"].join(".")]:[Qr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ai,""]],[/Linux|debian/i,["Linux",""]]],Ji=function(e){return Ui.test(e)?mi:Bi.test(e)?yi:Hi.test(e)?bi:new RegExp(Ci,"i").test(e)?Ci:new RegExp("("+ki+"|WPDesktop)","i").test(e)?ki:/iPad/.test(e)?Yr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ei:zi.test(e)?ri:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Si,"i").test(e)?Si:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Zr).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Qr:Kr:new RegExp("(pda|"+Zr+")","i").test(e)?Ii:new RegExp(Jr,"i").test(e)&&!new RegExp(Jr+" pc","i").test(e)?Mi:""},Ki=function(e,t){var r,i,n,s,o=Ji(e);return o===Yr||o===Kr||"Kobo"===o||"Kindle Fire"===o||o===Mi?Jr:o===mi||o===bi||o===yi||o===Ci?"Console":o===ei?"Wearable":o?Zr:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Zr:Jr:"Desktop"},Yi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xi(e,t){return"string"==typeof(r=e)&&Yi.test(r)?e:t();var r}function en(e){return e?e.split("#")[0]:e}function tn(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var rn=e=>e instanceof Error,nn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},sn=nn.info;function on(e){if($r(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(Sr(e))return{arrayValue:{values:e.map((e=>on(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function an(e){var t=[];for(var r in e){var i=e[r];Pr(i)||Mr(i)||t.push({key:r,value:on(i)})}return t}function ln(e,t){var i=nn[e.level||"info"]||sn,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),Or(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),Or(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:an(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),Mr(e.trace_flags)||(u.flags=e.trace_flags),u}function un(e,t,i){return r({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}function hn(e,t,r,i){return{resourceLogs:[{resource:{attributes:an(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}let dn=class{constructor(e,t,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=e,this.Te=t,this.Ge=r,this.Ye=i,this.Xe=n,this.et=s,this.tt=o,this.rt=null,this.it=0,this.nt=0,this.st=0,this.ot=0,this.ut=!1,this.ht=t.maxBufferSize,this.dt=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.ct=t.flushIntervalMs,this.vt=t.maxBatchRecordsPerPost,this.ft=t.rateCapWindowMs,this.yt=t.maxLogsPerInterval}reset(){this.bt(),this.rt=null,this.st=0,this.ot=0,this.ut=!1,this.it=0,this.nt=0,this.vt=this.Te.maxBatchRecordsPerPost}onReconnect(){this.nt=0,this._t()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.wt(e);if(null!==t)if(t.body){if(this.xt()){var r={record:ln(t,this.Ye())};this.Xe((()=>this.kt(r)))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(e){var t=this.Te.beforeSend;if(!t)return e;var r=Sr(t)?t:[t],i=e;for(var n of r)try{var s=n(i);if(!s)return this.Ge.info("Log was rejected in beforeSend function"),null;i=s}catch(e){return this.Ge.error("Error in beforeSend function for log:",e),null}return i}xt(){if(void 0===this.yt)return!0;var e=Date.now(),t=e-this.st;return this.ft>t&&t>=0||(this.st=e,this.ot=0,this.ut=!1),this.yt>this.ot?(this.ot++,!0):(this.ut||(this.Ge.warn("captureLog dropping logs: exceeded "+this.yt+" logs per "+this.ft+"ms"),this.ut=!0),!1)}flush(){var e=this;return t((function*(){if(!e._instance.isDisabled)return e.rt||(e.rt=e.St().finally((()=>{e.rt=null}))),e.rt}))()}St(){var e=this;return t((function*(){var t;e.bt();var r=null!==(t=e._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==t?t:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;e.it=0;var a=Math.min(r.length,e.vt),l=r.slice(0,a),u=l.map((e=>e.record)),h=hn(u,e.Ct(),null!==(s=e.tt)&&void 0!==s?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.Tt(h);if("too-large"===d.kind&&l.length>1)e.vt=Math.max(1,Math.floor(l.length/2)),e.Ge.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.vt);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?e.Ge.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&e.Te.maxBatchRecordsPerPost>e.vt&&(e.vt=Math.min(e.Te.maxBatchRecordsPerPost,e.vt+1)),yield e.It(l.length),r=null!==(o=e._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}It(e){var r=this;return t((function*(){var t,i=Math.max(0,e-r.it),n=null!==(t=r._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==t?t:[];r._instance.setPersistedProperty(rr.LogsQueue,n.slice(i)),yield r.et()}))()}Ct(){return un(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(e){var t;if(!this._instance.optedOut){var r=null!==(t=this._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==t?t:[];this.dt>r.length||(r.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(rr.LogsQueue,r),this.ht>r.length?this.Mt():this._t()}}Mt(e){void 0===e&&(e=this.ct),this.Et||(this.Et=tn((()=>{this.Et=void 0,this._t()}),e))}Rt(){var e=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,e)}Pt(){var e=this._instance.getPersistedProperty(rr.LogsQueue);return!!e&&e.length>0}shutdown(e){var r=this;return t((function*(){r.bt();var t=r.flush().catch((()=>{}));void 0!==e?yield Promise.race([t,new Promise((t=>tn(t,e)))]):yield t}))()}flushWithTimeout(e){var r=this;return t((function*(){var t=!1,i=r.flush(),n=new Promise((r=>tn((()=>{t=!0,r()}),e)));try{yield Promise.race([i,n])}finally{t&&i.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(e=>{this.nt++,this.Ge.error("PostHog logs flush failed:",e)})).finally((()=>{!this._instance.isDisabled&&this.Pt()&&this.Mt(this.Rt())}))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}};var cn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function vn(e){return String(e)+"000000"}function fn(e,t,r,i){var n="";return i&&(n=Object.keys(i).sort().map((e=>JSON.stringify(e)+":"+JSON.stringify(i[e]))).join(",")),e+"\0"+t+"\0"+(null!=r?r:"")+"\0"+n}let pn=class{constructor(e,t,r){this._instance=e,this.Te=t,this.Ge=r,this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.At=0}count(e,t,r){void 0===t&&(t=1),this.Nt({name:e,type:"count",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(e,t,r){this.Nt({name:e,type:"gauge",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(e,t,r){this.Nt({name:e,type:"histogram",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var e=this,r=this.rt,i=function(){var i=t((function*(){r&&(yield r.catch((()=>{}))),yield e.Dt()}));return function(){return i.apply(this,arguments)}}(),n=i().finally((()=>{this.rt===n&&(this.rt=null)}));return this.rt=n,n}drainWindow(){if(0===this.Ot.size)return null;var e=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(e)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.wt(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.Ge.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=t.attributes?r({},t.attributes):void 0,n=fn(t.type,t.name,t.unit,i)}catch(e){return void this.Ge.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var s=this.Ot.get(n);if(!s){if(!this.jt())return;s={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Ot.set(n,s)}var o=this.Lt.get(t.name);void 0===o?this.Lt.set(t.name,t.type):o===t.type||this.$t.has(t.name)||(this.$t.add(t.name),this.Ge.warn("Metric name '"+t.name+"' is already used as a "+o+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,t.value),this.Mt()}else this.Ge.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.Ge.warn("Dropping metric with empty name")}}jt(){return this.Te.maxSeriesPerFlush>this.Ot.size||(this.Ft||(this.Ft=!0,this.Ge.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ht(e,t){var r;switch(e.type){case"count":e.total=(null!==(r=e.total)&&void 0!==r?r:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(cn.length+1).fill(0)});var i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(var r=0;t.length>r;r++)if(t[r]>=e)return r;return t.length}(t,cn)]+=1}}wt(e){var t=this.Te.beforeSend;if(!t)return e;var r=Sr(t)?t:[t],i=e;for(var n of r)try{var s=n(i);if(!s)return this.Ge.info("Metric was rejected in beforeSend function"),null;i=s}catch(e){return this.Ge.error("Error in beforeSend function for metric:",e),null}return i}Mt(){this.Et||(this.Et=tn((()=>{this.Et=void 0,this.flush().catch((e=>{this.Ge.error("Metrics flush failed:",e)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var e=this;return t((function*(){if(0!==e.Ot.size){var t=e.Ot;e.Ot=new Map,e.Ft=!1,e.Lt=new Map,e.$t=new Set;var r=e.At,i=yield e._instance.Bt(e.qt(t));if(r===e.At)switch(i.kind){case"ok":return;case"retry-later":return e.Ut(t),void e.Mt();case"too-large":return void e.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.Ge.error("Failed to send metrics batch:",i.error)}}}))()}qt(e){return t=this.zt(e),i=function(e,t,i){return r({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:an(i)},scopeMetrics:[{scope:{name:n,version:s},metrics:t}]}]};var t,i,n,s}zt(e){var t=vn(Date.now()),i=new Map;for(var n of e.values()){var s,o=fn(n.type,n.name,n.unit,void 0),a=i.get(o);a||(a=r({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=an(null!==(s=n.attributes)&&void 0!==s?s:{}),u=vn(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:t,asDouble:null!==(h=n.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===n.type){var c,v={attributes:l,timeUnixNano:t,asDouble:null!==(c=n.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(v)}else n.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:t,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:cn})}return Array.from(i.values())}Ut(e){var t,r;for(var i of e){var n=i[0],s=i[1],o=this.Ot.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(t=o.total)&&void 0!==t?t:0)+(null!==(r=s.total)&&void 0!==r?r:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.jt()&&this.Ot.set(n,s)}}};function gn(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}var mn,yn,bn;function _n(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return bn&&r.length===yn||(yn=r.length,bn=r.reduce(((r,i)=>{mn||(mn={});var n=mn[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,mn[i]=[l,u];break}}return r}),{})),bn}}class wn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Sr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:_n(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var xn="?";function kn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?xn:r,in_app:!0};return Mr(i)||(s.lineno=i),Mr(n)||(s.colno=n),s}var Sn=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:xn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Cn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,In=/\((\S*)(?::(\d+))(?::(\d+))\)/,Mn=(e,t)=>{var r=Cn.exec(e);if(r)return kn(t,r[1],xn,+r[2],+r[3]);var i=Tn.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=In.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=Sn(i[1]||xn,i[2]);return kn(t,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},En=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pn=(e,t)=>{var r=En.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Rn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||xn,o=Sn(s,n);return kn(t,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},On=/\(error: (.*)\)/,Fn=50;class Ln{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Er(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return jr(e,"DOMException")}isDOMError(e){return jr(e,"DOMError")}}class $n{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class An{constructor(){}match(e){return jr(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Nn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Dn{match(e){return"string"==typeof e}coerce(e,t){var r,i=this.getInfos(e),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Nn);return i&&(t=i[1],r=i[2]),[t,r]}}var qn=["fatal","error","warning","log","info","debug"];function jn(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Hn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Hr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+jn(e)}isSeverityLevel(e){return Er(e)&&!Rr(e)&&qn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(rn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Bn{match(e){return Hr(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+jn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Un{match(e){return qr(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class zn{match(e){return jr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Hr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return qr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Vn="$message",Wn="$timestamp",Zn=new Set([Vn,Wn]),Gn={enabled:!0,max_bytes:32768};function Qn(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:Gn.enabled,max_bytes:Kn(e.max_bytes,Gn.max_bytes)}:r({},Gn)}class Jn{constructor(e){this.Vt=[],this.Wt=0,this.Te=Qn(e)}setConfig(e){this.Te=Qn(e),this.Zt()}add(e){var t=function(e){var t;try{t=_r(e)}catch(e){return}try{var r=JSON.parse(t);if(!Tr(r))return;var i=r,n=i[Vn],s=i[Wn];if(!Er(n)||0===n.trim().length)return;if(!Er(s)&&!Fr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this.Te.max_bytes||(this.Vt.push({step:t.step,bytes:r}),this.Wt+=r,this.Zt())}}getAttachable(){return this.Vt.map((e=>e.step))}clear(){this.Vt=[],this.Wt=0}size(){return this.Vt.length}Zt(){for(;this.Wt>this.Te.max_bytes&&this.Vt.length>0;){var e=this.Vt.shift();e&&(this.Wt-=e.bytes)}}}function Kn(e,t){if(!Fr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var Yn="undefined"!=typeof window?window:void 0,Xn="undefined"!=typeof globalThis?globalThis:Yn,es=null==Xn?void 0:Xn.navigator,ts=null==Xn?void 0:Xn.document,rs=null==Xn?void 0:Xn.location,is=null==Xn?void 0:Xn.fetch,ns=null!=Xn&&Xn.XMLHttpRequest&&"withCredentials"in new Xn.XMLHttpRequest?Xn.XMLHttpRequest:void 0,ss=null==Xn?void 0:Xn.AbortController,os=null==Xn?void 0:Xn.CompressionStream,as=null==es?void 0:es.userAgent;function ls(){return!(!Yn||!1===Yn.navigator.onLine)}var us=e=>"undefined"!=typeof Document&&e instanceof Document,hs={DEBUG:!1,LIB_VERSION:"0.2.4",LIB_NAME:"browser-common"},ds=function(e,t){var r=(void 0===t?{}:t).debugEnabled,i={k(t){if(Yn&&(hs.DEBUG||Yn.POSTHOG_DEBUG||r)&&!Mr(Yn.console)&&Yn.console){for(var i=("__rrweb_original__"in Yn.console[t]?Yn.console[t].__rrweb_original__:Yn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>ds(e+" "+t,r)};return i},cs=ds("[PostHog.js]"),vs=cs.createLogger;function fs(e,t){Sr(e)&&e.forEach(t)}function ps(e,t){if(!Or(e))if(Sr(e))e.forEach(t);else if(Ar(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)xr.call(e,r)&&t(e[r],r)}var gs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function ms(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var ys=function(e){try{return e()}catch(e){return}},bs=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){cs.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),cs.critical(e)}}},_s=function(e){var t={};return ps(e,(function(e,r){(Er(e)&&e.length>0||Fr(e))&&(t[r]=e)})),t};var ws=["herokuapp.com","vercel.app","netlify.app"];function xs(e){var t=null==e?void 0:e.hostname;if(!Er(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of ws)if(r===i)return!1;return!0}function ks(e,t,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==e||e.addEventListener(t,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function Ss(e){return"ph_toolbar_internal"===e.name}var Cs=(e,t)=>{try{return JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t)}catch(t){return _r(e)}},Ts=e=>{var t=null==ts?void 0:ts.createElement("a");return Mr(t)?null:(t.href=e,t)},Is=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return ps(e,(function(e,t){Mr(e)||Mr(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},Ms=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Sr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){cs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Es=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Sr(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},Rs=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Ps=(e,t)=>e>=t&&ls(),Os=(e,t,r,i)=>{if(0===e){if(ls()){var n=t+1;return n===r&&i(),n}return t}return 0},Fs=()=>{};function Ls(e,t,r){try{if(!(t in e))return Fs;var i={next:e[t]},n=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return Cr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=n,()=>{if(e[t]!==n)for(var r=e[t];Cr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else e[t]=i.next}}catch(e){return Fs}}function $s(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function As(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!Cr(i))return t;try{var n=i(t);return Er(n)&&n?n:t}catch(e){return cs.error("Error in get_current_url, falling back to window.location.href",e),t}}function Ns(e){var t,r=null==Yn||null==(t=Yn.location)?void 0:t.href;return Mr(r)?void 0:As(e,r)}var Ds="__POSTHOG_TOOLBAR__",qs=1,js=3,Hs=11;function Bs(e){return e instanceof Element&&(e.id===Ds||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Us(e){return!!e&&e.nodeType===qs}function zs(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Vs(e){return!!e&&e.nodeType===js}function Ws(e){return!!e&&e.nodeType===Hs&&Us(e.host)}var Zs=1e3;function Gs(e){return e?yr(e).split(/\s+/):[]}function Qs(e,t){var r=Ns(t);return!!(r&&e&&e.some((e=>r.match(e))))}function Js(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Gs(t)}function Ks(e){return Or(e)?null:yr(e).split(/(\s+)/).filter((e=>xo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ys(e){var t="";return fo(e)&&!po(e)&&e.childNodes&&e.childNodes.length&&ps(e.childNodes,(function(e){var r;Vs(e)&&e.textContent&&(t+=null!==(r=Ks(e.textContent))&&void 0!==r?r:"")})),yr(t)}function Xs(e){var t;return Mr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var eo=["a","button","form","input","select","textarea","label"];function to(e,t){if(Mr(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function ro(e){var t=e.parentNode;return!(!t||!Us(t))&&t}var io=[".ph-no-autocapture","[data-ph-no-autocapture]"],no=["next","previous","prev",">","<"],so=[...no,"+","-","−","–"],oo=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,ao=[".ph-no-deadclick",".ph-no-capture"],lo=[".ph-no-rageclick",".ph-no-capture"],uo=["","text","search","email","password","url","tel","number"];function ho(e,t){if(!Yn||co(e))return!1;var r,i,n,s,o;if($r(t)?(r=!!t&&lo,i=void 0,n=!1):(r=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:lo,i=null==t?void 0:t.content_ignorelist,n=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(e){return!(!e||!Us(e))&&(!!zs(e,"textarea")||(zs(e,"input")?mr(uo,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var a=vo(e,!1).targetElementList;return!function(e,t){if(!1===e||Mr(e))return!1;var r;if(!0===e)r=no;else{if(!Sr(e))return!1;if(e.length>10)return cs.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var t=e.safeText,i=e.ariaLabel;return r.some((e=>oo(t,e)||oo(i,e)))}))}(i,a.map((e=>{var t;return{safeText:Ys(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!to(a,r)}var co=e=>!e||zs(e,"html")||!Us(e),vo=(e,t)=>{if(!Yn||co(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!zs(n,"body");)if(Ws(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ro(n);if(!s)break;if(t||eo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=Yn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(e){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function fo(e){for(var t=new Set,r=0,i=e;i.parentNode&&!zs(i,"body");i=i.parentNode){if(r++>=Zs||t.has(i))return!1;t.add(i);var n=Js(i);if(mr(n,"ph-sensitive")||mr(n,"ph-no-capture"))return!1}if(mr(Js(e),"ph-include"))return!0;var s=e.type||"";if(Er(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!Er(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function po(e){return!!(zs(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||zs(e,"select")||zs(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var go="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",mo=new RegExp("^(?:"+go+")$"),yo=new RegExp(go),bo="\\d{3}-?\\d{2}-?\\d{4}",_o=new RegExp("^("+bo+")$"),wo=new RegExp("("+bo+")");function xo(e,t){if(void 0===t&&(t=!0),Or(e))return!1;if(Er(e)){if(e=yr(e),(t?mo:yo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?_o:wo).test(e))return!1}return!0}function ko(e){var t=Ys(e);return xo(t=(t+" "+So(e)).trim())?t:""}function So(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ps(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Ys(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+So(e)).trim())}catch(e){cs.error("[AutoCapture]",e)}})),t}function Co(e){return e.replace(/"|\\"/g,'\\"')}function To(e){var t=e.attr__class;if(t)return Sr(t)?t:Gs(t)}var Io=1e6,Mo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Io,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Eo=vs("[Recorder]"),Ro=e=>"navigation"===e.entryType,Po=e=>"resource"===e.entryType;function Oo(e,t){return!!t&&($r(t)||t[e])}function Fo(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var Lo=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function $o(e){var t=e.type,r=e.recordBody,i=e.headers;function n(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!Fo(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(n(Lo))return!1;if($r(r))return!0;if(Sr(r))return n(r);var s=r[t];return $r(s)?s:n(s)}function Ao(e,t,r,i,n,s){return No.apply(this,arguments)}function No(){return No=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return Eo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(Po(o=e[s])&&o.initiatorType===t&&(Mr(i)||o.startTime>=i)&&(Mr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),Ao(e,t,r,i,n,s+1))})),No.apply(this,arguments)}function Do(e){var t=e.body,r=e.options,i=e.url;if(Or(t))return null;var n=$s(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Er(t))return t;if(us(t))return t.textContent;if(Ar(t))return Is(t);if(Tr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var qo=e=>!Pr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function jo(e){var t=e.entry,i=e.method,n=e.status,s=e.networkRequest,o=e.isInitial,a=e.start,l=e.end,u=e.url,h=e.initiatorType;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:Mr(a)?void 0:Math.round(a),endTime:Mr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(qo(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ho=["video/","audio/"];function Bo(e){return Tr(e)&&Cr(e.getReader)&&Cr(e.tee)}var Uo=500,zo="[SessionReplay] Timeout while trying to read body",Vo="[SessionReplay] Failed to read body";function Wo(e){return Vo+": "+e}function Zo(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Go(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(zo)),Uo);try{e.clone().text().then((e=>t(e)),(e=>t(Wo(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Vo)}}))}(e);var r=function(e){var t;return Math.min(Io,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:Io)}(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(Zo(r)):function(e,t){return new Promise((r=>{var i,n=!1;function s(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(l),s(),r(e))}var a,l=setTimeout((()=>o(zo)),Uo);try{a=e.clone()}catch(e){return void o(Vo)}var u=a.body;if(Bo(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(e){return void o(Vo)}var h=[],d=0;!function e(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>t)return void o(Zo(t));d+=a.byteLength,h.push(a)}e()}}),(e=>o(Wo(e))))}()}else try{a.text().then((e=>o(e)),(e=>o(Wo(e))))}catch(e){o(Vo)}}))}(e,r)}function Qo(){return Qo=t((function*(e){var t=e.r,r=e.options,i=$s(e.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Go(t,r)})),Qo.apply(this,arguments)}function Jo(){return Jo=t((function*(e){var t=e.r,r=e.options,i=function(e){var t,r=e.r,i=e.options,n=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Ho.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var a=$s(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return Pr(i)?Go(t,r):Promise.resolve(i)})),Jo.apply(this,arguments)}var Ko=null;function Yo(e,i,n){if(!("performance"in i))return()=>{};if(Ko)return Eo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Mo,n):Mo,o=t=>{var i=[],n=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!n){var r=s.maskRequestFn(e);t||(n=!r),r&&i.push(r)}})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Ro(e)||Po(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>jo({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Ro(e)||Po(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>jo({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Oo("request",r.recordHeaders),n=Oo("response",r.recordHeaders),s=Ls(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var c,v,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=e=>($o({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Do({body:e,options:r,url:a})),c=t.performance.now(),y(e));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),v=t.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),$o({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Do({body:d.response,options:r,url:a})),Ao(t,"xmlhttprequest",f.url,c,v).then((t=>{var r=jo({entry:t,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(e){Eo.error("Failed to instrument XHR for network capture",e)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Oo("request",i.recordHeaders),s=Oo("response",i.recordHeaders),o=Ls(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u;try{l=new Request(t,a)}catch(e){return Eo.error("Failed to instrument fetch for network capture",e),o(t,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((e,t)=>{v[t]=e})),n&&(c.requestHeaders=v),!Bo(null==a?void 0:a.body)&&$o({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(c.requestBody=yield function(e){return Qo.apply(this,arguments)}({r:l,options:i,url:t}))}catch(e){Eo.error("Failed to record fetch request for network capture",e)}h=r.performance.now(),u=Fo(t)?yield o(l):yield o(t,a),d=r.performance.now();var f={};return u.headers.forEach(((e,t)=>{f[t]=e})),s&&(c.responseHeaders=f),$o({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(c.responseBody=yield function(e){return Jo.apply(this,arguments)}({r:u,options:i,url:t})),u}finally{Ao(r,"fetch",l.url,h,d).then((t=>{var r,i=jo({entry:t,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),Ko=()=>{a(),l(),u(),Ko=null}}var Xo=e=>({name:"rrweb/network@1",observer:Yo,options:e}),ea="undefined"!=typeof globalThis?globalThis:Yn;ea&&"undefined"==typeof self&&(ea.self=ea),ea&&"undefined"==typeof File&&(ea.File=function(){});var ta=null!=Yn?Yn:{};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Jt,getRecordNetworkPlugin:Xo},ta.__PosthogExtensions__.rrweb={record:$t,version:"v2",wasMaxDepthReached:()=>ce,resetMaxDepthState(){ce=!1,de=!1}},ta.rrweb={record:$t,version:"v2"},ta.rrwebConsoleRecord={getRecordConsolePlugin:Jt},ta.getRecordNetworkPlugin=Xo;var ra,ia,na,sa,oa,aa,la,ua,ha,da,ca,va,fa,pa,ga,ma={},ya=[],ba=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_a=Array.isArray;function wa(e,t){for(var r in t)e[r]=t[r];return e}function xa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ka(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?ra.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return Sa(e,o,i,n,null)}function Sa(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++na:n,__i:-1,__u:0};return null==n&&null!=ia.vnode&&ia.vnode(s),s}function Ca(e){return e.children}function Ta(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function Ia(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],s=wa({},t);s.__v=t.__v+1,ia.vnode&&ia.vnode(s),Na(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?$(t):r,!!(32&t.__u),n),s.__v=t.__v,s.__.__k[s.__i]=s,qa(i,s,n),t.__e=t.__=null,s.__e!=r&&Ma(s)}}function Ma(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),Ma(e)}function Ea(e){(!e.__d&&(e.__d=!0)&&sa.push(e)&&!Ra.__r++||oa!=ia.debounceRendering)&&((oa=ia.debounceRendering)||aa)(Ra)}function Ra(){try{for(var e,t=1;sa.length;)sa.length>t&&sa.sort(la),e=sa.shift(),t=sa.length,Ia(e)}finally{sa.length=Ra.__r=0}}function Pa(e,t,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||ya,b=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=Sa(null,o,null,null,null):_a(o)?o=e.__k[s]=Sa(Ca,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=Sa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+c,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=Fa(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Ua(a,a));return i}(r,t,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ma,v.__i=d,g=Na(e,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&Ba(c.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||c.__k===v.__k?(l=Oa(v,l,e,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function Oa(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=Oa(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Fa(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function La(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||ba.test(t)?r:r+"px"}function $a(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||La(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||La(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(ca,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r[da]=i[da]:(r[da]=va,e.addEventListener(t,s?pa:fa,s)):e.removeEventListener(t,s?pa:fa,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Aa(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[ha])t[ha]=va++;else if(r[da]>t[ha])return;return r(ia.event?ia.event(t):t)}}}function Na(e,t,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(h=ia.__b)&&h(t);e:if("function"==typeof C){d=o.length;try{if(y=t.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],_=h?$?$.props.value:h.__:i,r.__c?m=(c=t.__c=r.__c).__=c.__E:(b?t.__c=c=new C(y,_):(t.__c=c=new Ta(y,_),c.constructor=C,c.render=za),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),b&&null==c.__s&&(c.__s=c.state),b&&null!=C.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=wa({},c.__s)),wa(c.__s,C.getDerivedStateFromProps(y,c.__s))),f=c.props,p=c.state,c.__v=t,v)b&&null==C.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),b&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,_),t.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,_)){t.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),ya.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,_),b&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=_,c.props=y,c.__P=e,c.__e=!1,w=ia.__r,x=0,b)c.state=c.__s,c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),ya.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=wa(wa({},i),c.getChildContext())),b&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Ca&&null==h.key?ja(h.props.children):h,a=Pa(e,_a(k)?k:[k],t,r,i,n,s,o,a,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(e){if(o.length=d,t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),t.__e=a}else{if(null!=s)for(S=s.length;S--;)xa(s[S]);Da(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),e.then||Da(t);ia.__e(e,t,r)}}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=Ha(r.__e,t,r,i,n,s,o,l,u);return(h=ia.diffed)&&h(t),128&t.__u?void 0:a}function Da(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Da))}function qa(e,t,r){for(var i=0;r.length>i;i++)Ba(r[i],r[++i],r[++i]);ia.__c&&ia.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ia.__e(e,t.__v)}}))}function ja(e){return"object"!=typeof e||null==e||e.__b>0?e:_a(e)?e.map(ja):void 0!==e.constructor?null:wa({},e)}function Ha(e,t,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ma,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,s[u]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),a&&(ia.__m&&ia.__m(t,s),a=!1),s=null}if(null==y)g===m||a&&e.data==m||(e.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&ra.call(e.childNodes),!a&&null!=s)for(g={},u=0;e.attributes.length>u;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||$a(e,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||$a(e,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),Pa("template"==t.type?e.content:e,_a(c)?c:[c],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&$(r,0),a,l),null!=s)for(u=s.length;u--;)xa(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&$a(e,u,f,g[u],n),u="checked",null!=p&&p!=e[u]&&$a(e,u,p,g[u],n))}return e}function Ba(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){ia.__e(e,r)}}function Ua(e,t,r){var i,n;if(ia.unmount&&ia.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Ba(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ia.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&Ua(i[n],t,r||"function"!=typeof e.type);r||xa(e.__e),e.__c=e.__=e.__e=void 0}function za(e,t,r){return this.constructor(e,r)}function Va(e,t,r){var i,n,s;t==document&&(t=document.documentElement),ia.__&&ia.__(e,t),i=t.__k,n=[],s=[],Na(t,e=t.__k=ka(Ca,null,[e]),i||ma,ma,t.namespaceURI,i?null:t.firstChild?ra.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),qa(n,e,s),e.props.children=null}ra=ya.slice,ia={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},na=0,Ta.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=wa({},this.state),"function"==typeof e&&(e=e(wa({},r),this.props)),e&&wa(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ea(this))},Ta.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ea(this))},Ta.prototype.render=Ca,sa=[],aa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,la=function(e,t){return e.__v.__b-t.__v.__b},Ra.__r=0,ua=Math.random().toString(8),ha="__d"+ua,da="__a"+ua,ca=/(PointerCapture)$|Capture$/i,va=0,fa=Aa(!1),pa=Aa(!0),ga=0;var Wa,Za,Ga,Qa,Ja=0,Ka=[],Ya=ia,Xa=Ya.__b,el=Ya.__r,tl=Ya.diffed,rl=Ya.__c,il=Ya.unmount,nl=Ya.__;function sl(e,t){Ya.__h&&Ya.__h(Za,e,Ja||t),Ja=0;var r=Za.__H||(Za.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ol(e){return Ja=1,function(e,t,r){var i=sl(Wa++,2);if(i.t=e,!i.__c&&(i.__=[ml(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Za,!Za.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==e;if(i.__c.__H.__.some((function(e){if(e.__N){n=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s){var a=s.call(this,e,t,r);return n?a||o:a}return!n||o};Za.__f=!0;var s=Za.shouldComponentUpdate,o=Za.componentWillUpdate;Za.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},Za.shouldComponentUpdate=n}return i.__N||i.__}(ml,e)}function al(e,t){var r=sl(Wa++,3);!Ya.__s&&gl(r.__H,t)&&(r.__=e,r.u=t,Za.__H.__h.push(r))}function ll(e){return Ja=5,ul((function(){return{current:e}}),[])}function ul(e,t){var r=sl(Wa++,7);return gl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function hl(e){var t=Za.context[e.__c],r=sl(Wa++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Za)),t.props.value):e.__}function dl(){for(var e;e=Ka.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(fl),t.__h.some(pl),t.__h=[]}catch(r){t.__h=[],Ya.__e(r,e.__v)}}}Ya.__b=function(e){Za=null,Xa&&Xa(e)},Ya.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),nl&&nl(e,t)},Ya.__r=function(e){el&&el(e),Wa=0;var t=(Za=e.__c).__H;t&&(Ga===Za?(t.__h=[],Za.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&dl(),Wa=0)),Ga=Za},Ya.diffed=function(e){tl&&tl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ka.push(t)&&Qa===Ya.requestAnimationFrame||((Qa=Ya.requestAnimationFrame)||vl)(dl)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),Ga=Za=null},Ya.__c=function(e,t){t.some((function(e){try{e.__h.some(fl),e.__h=e.__h.filter((function(e){return!e.__||pl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ya.__e(r,e.__v)}})),rl&&rl(e,t)},Ya.unmount=function(e){il&&il(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{fl(e)}catch(e){t=e}})),r.__H=void 0,t&&Ya.__e(t,r.__v))};var cl="function"==typeof requestAnimationFrame;function vl(e){var t,r=function(){clearTimeout(i),cl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);cl&&(t=requestAnimationFrame(r))}function fl(e){var t=Za,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Za=t}function pl(e){var t=Za;e.__c=e.__(),Za=t}function gl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function ml(e,t){return"function"==typeof t?t(e):t}var yl="gzip-js",bl="base64",_l="events",wl="cancelEvents",xl={Tab:"tab",Selector:"selector"},kl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Sl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Cl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Tl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Il={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Ml="always",El={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Rl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Pl="popover";function Ol(e){return"$survey_response_"+e}function Fl(e,t){if(!t)return null;var r=e[Ol(t)];return Sr(r)?[...r]:r}function Ll(e,t){void 0===e&&(e={});var i={};return t.questions.forEach((t=>{if(!Mr(t.originalQuestionIndex)){var r,n=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Fl(e,t.id);Mr(s)||(i[n]=s)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:Fl(e,t.id)})))},e,i)}function $l(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function Al(e){return"string"==typeof e&&e.trim()?e.trim():null}function Nl(e){return e.toLowerCase()}function Dl(e,t,r){if(!e||!t)return null;var i=Nl(t),n=Object.keys(e).find((e=>Nl(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(e).find((e=>Nl(e)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}function ql(e,t,i){var n,s=Dl(e.translations,t,i),o=r({},e),a=!1;if(s){var l,u=null==(l=e.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Mr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Mr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Mr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Mr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Mr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Mr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(e){return!(Mr(e.thankYouMessageHeader)&&Mr(e.thankYouMessageDescription)&&Mr(e.thankYouMessageCloseButtonText)&&Mr(e.submitButtonText)&&Mr(e.backButtonText))}(u)&&(a=!0))}var h=e.questions.map((e=>function(e,t,i){var n,s=Dl(e.translations,t,i);if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(n=e.translations)?void 0:n[s];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var a=r({},e),l=!1;return Mr(o.question)||(a.question=o.question,l=!0),Mr(o.description)||(a.description=o.description,l=!0),Mr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Mr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Mr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Mr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(e){return Sr(e.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:e,matchedKey:l?s:null,hasChanges:l}}(e,t,i))),d=h.map((e=>e.question)),c=h.some((e=>e.hasChanges)),v=null;return s||(v=(null==(n=h.find((e=>e.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:a?s||v:null}}function jl(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Hl(e){var t;return jl(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Bl=vs("[Surveys]");function Ul(e){return!(!e.start_date||e.end_date)}function zl(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Vl="seenSurvey_",Wl="inProgressSurvey_",Zl=(e,t)=>""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t),Gl=e=>Zl(Vl,e),Ql=e=>{try{var t=Gl(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Bl.error("Failed to persist survey seen state",e)}},Jl=[Cl.Popover,Cl.Widget,Cl.API],Kl={ignoreConditions:!1,ignoreDelay:!1,displayType:Pl},Yl="$people_distinct_id",Xl="$device_id",eu="$device_model",tu="__alias",ru="__timers",iu="$autocapture_disabled_server_side",nu="$heatmaps_enabled_server_side",su="$exception_capture_enabled_server_side",ou="$error_tracking_suppression_rules",au="$error_tracking_capture_extension_exceptions",lu="$web_vitals_enabled_server_side",uu="$dead_clicks_enabled_server_side",hu="$product_tours_enabled_server_side",du="$web_vitals_allowed_metrics",cu="$session_recording_remote_config",vu="$replay_sample_rate",fu="$replay_override_sampling",pu="$replay_override_linked_flag",gu="$replay_override_url_trigger",mu="$replay_override_event_trigger",yu="$sesid",bu="$session_is_sampled",_u="$enabled_feature_flags",wu="$active_feature_flags",xu="$early_access_features",ku="$feature_flag_details",Su="$feature_flag_payloads",Cu="$feature_flag_request_id",Tu="$minimal_flag_called_events",Iu="$override_feature_flags",Mu="$override_feature_flag_payloads",Eu="$stored_person_properties",Ru="$stored_group_properties",Pu="$surveys",Ou="$surveys_loaded_at",Fu="$surveys_activated",Lu="$surveys_activated_session",$u="ph_product_tours",Au="$flag_call_reported",Nu="$flag_call_reported_session_id",Du="$feature_flag_errors",qu="$feature_flag_evaluated_at",ju="$user_state",Hu="$client_session_props",Bu="$capture_rate_limit",Uu="$initial_campaign_params",zu="$initial_referrer_info",Vu="$initial_person_info",Wu="$epp",Zu="$posthog_cookieless",Gu="$cookieless_mode",Qu="$sdk_debug_extensions_init_method",Ju="$sdk_debug_extensions_init_time_ms",Ku="$sdk_debug_recording_script_not_loaded",Yu="PostHog loadExternalDependency extension not found.",Xu="on_reject",eh="always",th="anonymous",rh="identified",ih="identified_only",nh="visibilitychange",sh="beforeunload",oh="$pageview",ah="$pageleave",lh="$identify",uh="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Fr(e)&&isFinite(e)&&Math.floor(e)===e});class hh{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new hh(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new hh(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class dh{generate(){var e=this.generateOrAbort();if(!Mr(e))return e;this.S=0;var t=this.generateOrAbort();if(Mr(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return hh.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new fh}}var ch,vh=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Yn&&!Mr(Yn.crypto)&&crypto.getRandomValues&&(vh=e=>crypto.getRandomValues(e));class fh{nextUint32(){return this.R.length>this.O||(vh(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var ph=()=>gh().toString(),gh=()=>(ch||(ch=new dh)).generate(),mh=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function yh(e,t,r){return Cs({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var bh={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>mh(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!mh(t,e))))),icontains:(e,t)=>t.map(_h).some((t=>e.map(_h).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(_h).every((t=>e.map(_h).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},_h=e=>e.toLowerCase();function wh(e,t){return!e||Object.entries(e).every((e=>{var r=e[1],i=null==t?void 0:t[e[0]];if(Mr(i)||Pr(i))return!1;var n=[String(i)],s=bh[r.operator];return!!s&&s(r.values,n)}))}var xh=e=>{if(ts){try{for(var t=e+"=",r=ts.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},kh="",Sh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Ch={N:()=>!!ts,D(e){cs.error("cookieStore error: "+e)},A:xh,F(e){var t;try{t=JSON.parse(Ch.A(e))||{}}catch(e){}return t},q(e,t,r,i,n){if(!ts)return!1;try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=ts),kh)return kh;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+ph();!kh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",kh=s)}return kh}(e);if(!r){var i=(e=>{var t=e.match(Sh);return t?t[0]:""})(e);i!==r&&cs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(ts.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&cs.warn("cookieStore warning: large cookie, len="+u.length),ts.cookie=u,!0}catch(e){return!1}},P(e,t){if(null!=ts&&ts.cookie)try{Ch.q(e,"",-1,t)}catch(e){return}}},Th=null,Ih={N(){if(!Pr(Th))return Th;var e=!0;if(Mr(Yn))e=!1;else try{var t="__mplssupport__";Ih.q(t,"xyz"),'"xyz"'!==Ih.A(t)&&(e=!1),Ih.P(t)}catch(t){e=!1}return e||cs.error("localStorage unsupported; falling back to cookie store"),Th=e,e},D(e){cs.error("localStorage error: "+e)},A(e){try{return null==Yn?void 0:Yn.localStorage.getItem(e)}catch(e){Ih.D(e)}return null},F(e){try{return JSON.parse(Ih.A(e))||{}}catch(e){}return null},q(e,t){try{return null==Yn||Yn.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Ih.D(e)}return!1},P(e){try{null==Yn||Yn.localStorage.removeItem(e)}catch(e){Ih.D(e)}}},Mh=[Xl,"distinct_id",yu,bu,Wu,Vu,ju],Eh={},Rh={N:()=>!0,D(e){cs.error("memoryStorage error: "+e)},A:e=>Eh[e]||null,F:e=>Eh[e]||null,q:(e,t)=>(Eh[e]=t,!0),P(e){delete Eh[e]}},Ph=null,Oh={N(){if(!Pr(Ph))return Ph;if(Ph=!0,Mr(Yn))Ph=!1;else try{var e="__support__";Oh.q(e,"xyz"),'"xyz"'!==Oh.A(e)&&(Ph=!1),Oh.P(e)}catch(e){Ph=!1}return Ph},D(e){cs.error("sessionStorage error: ",e)},A(e){try{return null==Yn?void 0:Yn.sessionStorage.getItem(e)}catch(e){Oh.D(e)}return null},F(e){try{return JSON.parse(Oh.A(e))||null}catch(e){}return null},q(e,t){try{return null==Yn||Yn.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Oh.D(e)}return!1},P(e){try{null==Yn||Yn.sessionStorage.removeItem(e)}catch(e){Oh.D(e)}}},Fh=vs("[Stylesheet Loader]"),Lh=Yn,$h=ts,Ah="#020617",Nh={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:kl.Right,widgetType:xl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Ah,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Dh=[kl.Center,kl.Left,kl.Right];function qh(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function jh(e){var t;void 0===e&&(e=Nh.backgroundColor),"#"===e[0]&&(t=qh(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=qh(r)),!t)return Ah;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Ah:"white"}return Ah}var Hh=(e,t,i)=>{var n=sd(e),s=$h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=$h.createElement("div");((e,t,i)=>{var n=r({},Nh,i),s=e.style,o=!Dh.includes(n.position)||t===Cl.Widget&&(null==i?void 0:i.widgetType)===xl.Tab;s.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||jh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",jh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||jh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",jh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||jh(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i=e.createElement("style");i.innerText=t;var n=(e=>{var t;return Cr(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Fh.error("prepare_external_dependency_stylesheet returned null"),null)})($h,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return $h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Bh=e=>{var t=e.responses,i=e.survey,n=e.surveySubmissionId,s=e.posthog,o=e.isSurveyCompleted,a=e.properties,l=e.surveyLanguage;s?(Ql(i),s.capture(El.SENT,r({[Rl.SURVEY_NAME]:i.name,[Rl.SURVEY_ID]:i.id,[Rl.SURVEY_ITERATION]:i.current_iteration,[Rl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Rl.SURVEY_SUBMISSION_ID]:n,[Rl.SURVEY_COMPLETED]:o},l&&{[Rl.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Ll(t,i),a,{$set:{[$l(i,"responded")]:!0}})),o&&(Lh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),nd(i),s.reloadFeatureFlags())):Bl.error("[survey sent] event not captured, PostHog instance not found.")},Uh=(e,t,i)=>{return r({[Rl.SURVEY_NAME]:e.name,[Rl.SURVEY_ID]:e.id,[Rl.SURVEY_ITERATION]:e.current_iteration,[Rl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Rl.SURVEY_PARTIALLY_COMPLETED]:(n=null==t?void 0:t.responses,void 0===n&&(n={}),Object.values(n).some((e=>!Or(e))))},(null==t?void 0:t.surveyLanguage)&&{[Rl.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Rl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},Ll(null==t?void 0:t.responses,e));var n},zh=(e,t,i,n)=>{if(t){if(!i){var s=rd(e);t.capture(El.DISMISSED,r({},Uh(e,s,t),n&&{[Rl.SURVEY_LANGUAGE]:n},{$set:{[$l(e,"dismissed")]:!0}})),nd(e),Ql(e),Lh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Bl.error("[survey dismissed] event not captured, PostHog instance not found.")},Vh=(e,t)=>{if(t){var r=(e=>Zl("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=rd(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(El.ABANDONED,Uh(e,i,t),{transport:"sendBeacon"})}}else Bl.error("[survey abandoned] event not captured, PostHog instance not found.")},Wh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Zh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Gh=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Zh(e.questions,Wh(e.questions)):e.questions,Qh=e=>Hl(e)||id(e),Jh=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Ea(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+ga++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Kh=()=>hl(Jh),Yh=e=>{var t=e.children,r=e.style;return function(e,t,r){var i,n,s,o,a=wa({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?ra.call(arguments,2):r),Sa(e.type,a,i||e.key,n||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:r}:{children:t,style:r})};function Xh(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=Ns(t);if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return bh[o](s,[n])}var ed=e=>Zl(Wl,e),td=(e,t)=>{try{localStorage.setItem(ed(e),JSON.stringify(t))}catch(e){Bl.error("Error setting in-progress survey state in localStorage",e)}},rd=e=>{try{var t=localStorage.getItem(ed(e));if(t)return JSON.parse(t)}catch(e){Bl.error("Error getting in-progress survey state from localStorage",e)}return null},id=e=>{var t=rd(e);return!Or(null==t?void 0:t.surveySubmissionId)},nd=e=>{try{localStorage.removeItem(ed(e))}catch(e){Bl.error("Error clearing in-progress survey state from localStorage",e)}};function sd(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function od(e,t,r){if(void 0===t&&(t=kl.Right),e===Cl.ExternalSurvey)return{};switch(t){case kl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case kl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case kl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case kl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case kl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case kl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case kl.Left:return{left:"30px"};case kl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Cl.Widget&&r===xl.Tab?"60px":"30px"}}}var ad=0;function ld(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ad,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ia.vnode&&ia.vnode(u),u}var ud=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),hd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),dd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),cd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),vd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),fd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:ld("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),pd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:ld("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),gd=function(e){var t=(void 0===e?{}:e).fill,r=void 0===t?"currentColor":t;return ld("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[ld("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),ld("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]})},md=ld("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ld("g",{"clip-path":"url(#clip0_2415_6911)",children:[ld("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:ld("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),ld("g",{mask:"url(#mask0_2415_6911)",children:[ld("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),ld("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),ld("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),ld("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),ld("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),ld("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),ld("defs",{children:ld("clipPath",{id:"clip0_2415_6911",children:ld("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function yd(e){var t=e.urlParams,r=t?Object.entries(t).map((e=>{var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)})).join("&"):"";return ld("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",md]})}function bd(e){var t=e.text,r=e.submitDisabled,i=e.appearance,n=e.onSubmit,s=e.link,o=e.onPreviewSubmit,a=e.skipSubmitButton,l=e.canGoBack,u=e.onBack,h=hl(Jh).isPreviewMode,d=!!l&&!!u,c=!a&&ld("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==Yn||Yn.open(s)),h?null==o||o():n()},children:t});return ld("div",{className:"bottom-section",children:[d?ld("div",{className:"form-buttons form-buttons-with-back",children:[ld("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&ld(yd,{urlParams:{utm_source:"survey-footer"}})]})}function _d(e){var t=e.question,r=e.forceDisableHtml;return ld("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[ld(t.type===Tl.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&Yh({component:ka("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function wd(e){return ld("button",{className:"form-cancel",onClick:e.onClick,disabled:hl(Jh).isPreviewMode,"aria-label":"Close survey",type:"button",children:gd({fill:"black"})})}ld("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ld("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var xd=Yn;function kd(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,s=e.appearance,o=e.onClose,a=hl(Jh).isPopup;return al((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return ks(xd,"keydown",e),()=>{xd.removeEventListener("keydown",e)}}),[o]),ld("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&ld(wd,{onClick:()=>o()}),ld("h3",{className:"thank-you-message-header",children:t}),r&&Yh({component:ka("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&ld(bd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Sd=e=>Sr(e)&&e.every((e=>Er(e)));function Cd(e){var t=e.question,r=e.forceDisableHtml,i=e.appearance,n=e.onSubmit,s=e.onPreviewSubmit,o=e.displayQuestionIndex,a=e.initialValue,l=e.canGoBack,u=e.onBack,h=Kh().isPreviewMode,d=ll(null),c=ol((()=>Er(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;al((()=>{p||setTimeout((()=>{var e;h||null==(e=d.current)||e.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=ul((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case nr:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case sr:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,t.validation,t.optional)),[v,t.validation,t.optional]),y=gn(t.validation,nr),b=gn(t.validation,sr),_=ul((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return ld(Ca,{children:[ld("div",{className:"question-container",children:[ld(_d,{question:t,forceDisableHtml:r,htmlFor:g}),ld("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(e){f(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||m||(e.preventDefault(),h?x():w())},value:v}),_&&ld("div",{className:"validation-hint",children:_})]}),ld(bd,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Td(e){var t=e.question,r=e.appearance,i=e.onSubmit,n=e.onPreviewSubmit,s=e.canGoBack,o=e.onBack;return ld(Ca,{children:[ld("div",{className:"question-container",children:ld(_d,{question:t,forceDisableHtml:e.forceDisableHtml})}),ld(bd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Id(e){var t,r=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,s=e.appearance,o=e.onSubmit,a=e.onPreviewSubmit,l=e.initialValue,u=e.canGoBack,h=e.onBack,d=r.scale,c=10===r.scale?0:1,v=ol((()=>Fr(l)?l:Sr(l)&&l.length>0&&Fr(parseInt(l[0]))?parseInt(l[0]):Er(l)&&Fr(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Kh().isPreviewMode,y=e=>m?a(e):o(e);return ld(Ca,{children:[ld("div",{className:"question-container",children:[ld(_d,{question:r,forceDisableHtml:i}),ld("div",{className:"rating-section",children:[ld("div",{className:"rating-options",children:["emoji"===r.display&&ld("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(t=Fd[r.scale])?void 0:t.map(((e,t)=>ld("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===f?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;p(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&ld("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:Ld(r.scale).map(((e,t)=>ld(Md,{displayQuestionIndex:n,active:f===e,appearance:s,num:e,setActiveNumber(e){p(e),r.skipSubmitButton&&y(e)}},t)))})]}),!g&&ld("div",{className:"rating-text",children:[ld("div",{children:r.lowerBoundLabel}),ld("div",{children:r.upperBoundLabel})]})]})]}),ld(bd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Pr(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Md(e){var t=e.num,r=e.setActiveNumber;return ld("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick(){r(t)},children:t})}function Ed(e){var t=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,s=e.appearance,o=e.onSubmit,a=e.onPreviewSubmit,l=e.initialValue,u=e.canGoBack,h=e.onBack,d=ll(null),c=ul((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=Zh(t,Wh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),v=ol((()=>((e,t)=>Er(e)||Sd(e)?e:t===Tl.SingleChoice?null:[])(l,t.type))),f=v[0],p=v[1],g=ol((()=>((e,t)=>{if(Er(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Sd(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],b=Kh().isPreviewMode,_=t.type===Tl.SingleChoice,w=t.type===Tl.MultipleChoice,x=t.skipSubmitButton&&_&&!t.hasOpenChoice,k=(e,t)=>{if(t){var i=!m.isSelected;return y((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),_&&p(""),void(i&&setTimeout((()=>{var e;return null==(e=d.current)?void 0:e.focus()}),75))}if(_)return p(e),y((e=>r({},e,{isSelected:!1,inputValue:""}))),void(x&&(o(e),b&&a(e)));w&&Sr(f)&&(f.includes(e)?p(f.filter((t=>t!==e))):p([...f,e]))},S=e=>{e.stopPropagation();var t=e.currentTarget.value;y((e=>r({},e,{inputValue:t}))),_&&p(t)},C=e=>{e.stopPropagation(),"Enter"!==e.key||T()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),y((e=>r({},e,{isSelected:!1,inputValue:""}))),_&&p(null))},T=()=>!(t.optional||!Pr(f)&&(!Sr(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),I=()=>{m.isSelected&&w?Sr(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return ld(Ca,{children:[ld("div",{className:"question-container",children:[ld(_d,{question:t,forceDisableHtml:i}),ld("fieldset",{className:"multiple-choice-options limit-height",children:[ld("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:_?f===e:Sr(f)&&f.includes(e);return ld("label",{className:i?"choice-option-open":"",children:[ld("div",{className:"response-choice",children:[ld("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>k(e,i),id:s,"aria-controls":o}),ld("span",{children:i?e+":":e})]}),i&&ld("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:S,onClick(t){m.isSelected||k(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),ld(bd,{text:t.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var Rd=[1,2,3,4,5],Pd=[1,2,3,4,5,6,7],Od=[0,1,2,3,4,5,6,7,8,9,10],Fd={2:[fd,pd],3:[dd,hd,ud],5:[cd,dd,hd,ud,vd]};function Ld(e){switch(e){case 5:default:return Rd;case 7:return Pd;case 10:return Od}}var $d=vs("[Surveys]");function Ad(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Il.End:s;if(n.branching.type===Il.End)return Il.End;if(n.branching.type===Il.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Il.ResponseBased){if(n.type===Tl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Il.End?Il.End:s}}else if(n.type===Tl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Il.End?Il.End:s}}return s}return $d.warn("Falling back to next question index due to unexpected branching type"),s}var Nd="https?://(.*)",Dd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],qd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Dd],jd="<masked>",Hd=["li_fat_id"];function Bd(e,t,r){if(!ts)return{};var i,n=t?[...Dd,...r||[]]:[],s=Ud(Es(ts.URL,n,jd),e),o=(i={},ps(Hd,(function(e){var t=xh(e);i[e]=t||null})),i);return gs(o,s)}function Ud(e,t){var r=qd.concat(t||[]),i={};return ps(r,(function(t){var r=Ms(e,t);i[t]=r||null})),i}function zd(e){var t=function(e){return e?0===e.search(Nd+"google.([^/?]*)")?"google":0===e.search(Nd+"bing.com")?"bing":0===e.search(Nd+"yahoo.com")?"yahoo":0===e.search(Nd+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Pr(t)){i.$search_engine=t;var n=ts?Ms(ts.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Vd(){return navigator.language||navigator.userLanguage}var Wd="$direct";function Zd(){return(null==ts?void 0:ts.referrer)||Wd}function Gd(e,t,r){void 0===r&&(r=!1);var i=e?[...Dd,...t||[]]:[],n=r?en(null==rs?void 0:rs.href):null==rs?void 0:rs.href,s=null==n?void 0:n.substring(0,1e3);return{r:Zd().substring(0,1e3),u:s?Es(s,i,jd):void 0}}function Qd(e,t){var r;void 0===t&&(t=!1);var i=e.r,n=e.u,s=t?en(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==Wd?Wd:null==(r=Ts(i))?void 0:r.host};if(s){o.$current_url=s;var a=Ts(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=Ud(s);gs(o,l)}if(i){var u=zd(i);gs(o,u)}return o}function Jd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Kd(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var Yd=vs("[SurveyTranslations]");function Xd(e,t){var r=function(e){return function(e,t){var r=e.storedPersonProperties,i=e.locale,n=Al(e.overrideLanguage);if(n)return null==t||t.info("Using override display language: "+n),n;var s=function(e){return e&&"object"==typeof e&&"language"in e?Al(e.language):null}(r);if(s)return null==t||t.info("Using person property language: "+s),s;var o=Al(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Cr(e.get_property)?e.get_property(Eu):void 0,locale:Vd()},Yd)}(t);if(!r)return Yd.info("No user language detected"),{survey:e,language:null};var i=ql(e,r,Yd);return{survey:i.survey,language:i.matchedKey}}var ec=Yn,tc=ts,rc="ph:show_survey_widget",ic="PHWidgetSurveyClickListener";function nc(e,t){try{var r=e.getBoundingClientRect(),i=ec.innerHeight,n=ec.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:Nh.zIndex}}catch(e){return Bl.warn("Failed to calculate trigger position:",e),null}}class sc{constructor(e){var t=this;this.j=new Map,this.H=new Map,this.B=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(Pu);if(e)for(var t of e)id(t)&&Vh(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,a=this.U(e),l=a.survey,u=a.language,h=null!=t&&t.position||null!=t&&t.selector?r({},l,{appearance:r({},l.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):l;this.W(h.id);var d=null!=t?t:{},c=d.properties,v=d.initialResponses,f=!(!v||0>=Object.keys(v).length)&&this.V(h,v,c,u);if(!f||null!=(i=h.appearance)&&i.displayThankYouMessage){this.Z(h);var p={};if((null==(n=h.appearance)?void 0:n.position)===kl.NextToTrigger&&null!=(s=h.appearance)&&s.widgetSelector){var g,m=tc.querySelector(h.appearance.widgetSelector);m&&(p=nc(m,parseInt((null==(g=h.appearance)?void 0:g.maxWidth)||Nh.maxWidth))||{})}var y=(null==(o=h.appearance)?void 0:o.surveyPopupDelaySeconds)||0,b=Hh(h,this._posthog).shadow,_={posthog:this._posthog,survey:h,removeSurveyFromFocus:this.$,properties:c,style:p,isSurveyCompleted:f,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:u};if(0>=y)return Va(ld(uc,r({},_)),b);var w=setTimeout((()=>{if(this.j.delete(h.id),!this.G(h))return Bl.info("Survey "+h.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(h);Va(ld(uc,r({},_,{survey:r({},h,{appearance:r({},h.appearance,{surveyPopupDelaySeconds:0})})})),b)}),1e3*y);this.j.set(h.id,w)}},this.Y=e=>{var t=this.U(e),r=t.survey,i=t.language,n=Hh(r,this._posthog),s=n.shadow;n.isNewlyCreated&&Va(ld(dc,{posthog:this._posthog,survey:r,surveyLanguage:i},e.id),s)},this.J=e=>{this.K(e);var t=this.H.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(ic),this.H.delete(e.id),Bl.info("Removed click listener for survey "+e.id))},this.X=(e,t)=>{var r=tc.querySelector(t),i=this.H.get(e.id);if(r){if(this.Y(e),i){if(r===i.element)return;Bl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.J(e)}if(!r.hasAttribute(ic)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===kl.NextToTrigger?nc(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Nh.maxWidth)):{};ec.dispatchEvent(new CustomEvent(rc,{detail:{surveyId:e.id,position:n}}))};ks(r,"click",n),r.setAttribute(ic,"true"),this.H.set(e.id,{element:r,listener:n,survey:e}),Bl.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.J(e)},this.renderPopover=e=>{var t=this.U(e),r=t.survey,i=t.language,n=Hh(r,this._posthog).shadow;Va(ld(uc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.$,surveyLanguage:i}),n)},this.renderSurvey=(e,t,r)=>{var i,n=this.U(e),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ee(s,o)),Va(ld(uc,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.G(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Cl.Popover||e.type===Cl.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.j.keys()))i.has(n)||t.cancelSurvey(n);var s=t.te(r),o=new Set;s.forEach((e=>{if(e.type===Cl.Widget){var r,i,n,s;if((null==(r=e.appearance)?void 0:r.widgetType)===xl.Tab)return void t.Y(e);(null==(i=e.appearance)?void 0:i.widgetType)===xl.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.X(e,null==(s=e.appearance)?void 0:s.widgetSelector))}Pr(t.re)&&e.type===Cl.Popover&&t.handlePopoverSurvey(e)})),t.H.forEach((e=>{var r=e.survey;o.has(r.id)||t.J(r)}))}),e)},this.Z=e=>{Pr(this.re)||Bl.error("Survey "+this.re+" already in focus. Cannot add survey "+e.id+"."),this.re=e.id},this.$=e=>{this.re!==e.id&&Bl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.W(e.id),this.re=null,this.K(e)},this._posthog=e,this.re=null}W(e){var t=this.j.get(e);t&&(clearTimeout(t),this.j.delete(e))}cancelSurvey(e){this.j.has(e)&&(Bl.info("Cancelled pending survey "+e),this.W(e),this.re===e&&(this.re=null))}te(e){return e.sort(((e,t)=>{var r,i,n=id(e),s=id(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===Ml,a=t.schedule===Ml;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(e){return Xd(e,this._posthog)}ee(e,t){if(this.B.has(e.id))return!1;var r=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Mr(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var c=parseInt(d[1],10);t[c]||(t[c]=[]),t[c].push(h)}}else r=!0}}return{params:t,autoSubmit:r}}(ec.location.search),i=r.params;if(0===Object.keys(i).length)return!1;Bl.info("[Survey Prefill] Detected URL prefill parameters");var n=this.ne(e,i,t);if(!n)return!1;var s=n.responses,o=n.submissionId,a=n.isSurveyCompleted,l=n.skippedResponses;return(Object.keys(l).length>0&&e.enable_partial_responses||a)&&Bh({responses:a?s:l,survey:e,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,surveyLanguage:t}),this.B.add(e.id),a}V(e,t,r,i){var n={};for(var s of Object.entries(t)){var o=s[1];n[parseInt(s[0])]=Sr(o)?o.map(String):[String(o)]}Bl.info("[Survey] Processing initial responses");var a=this.ne(e,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return Bh({responses:a.responses,survey:e,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}ne(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=Ol(e.id);try{switch(e.type){case Tl.SingleChoice:if(!e.choices||0===e.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void cs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Tl.MultipleChoice:if(!e.choices||0===e.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void cs.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&cs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Tl.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||0>u||u>h)return void cs.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:cs.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){cs.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return Bl.warn("[Survey Prefill] No valid responses after conversion"),null;var n=ph(),s=Object.keys(t).map((e=>parseInt(e,10))),o=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=Ol(o.id);Mr(r[a])||(n[a]=r[a])}var l=Ad(e,i,o.id?r[Ol(o.id)]:null);if(l===Il.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=e.questions.length;return td(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,surveyLanguage:r}),Bl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(e){return Bl.error("[Survey Prefill] Error handling prefill:",e),null}}ie(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}ae(e){return!e.conditions||Xh(e,this._posthog)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!as)return!1;var s=Ki(as,{userAgentDataPlatform:null==es||null==(r=es.userAgentData)?void 0:r.platform,maxTouchPoints:null==es?void 0:es.maxTouchPoints,screenWidth:null==Yn||null==(i=Yn.screen)?void 0:i.width,screenHeight:null==Yn||null==(n=Yn.screen)?void 0:n.height,devicePixelRatio:null==Yn?void 0:Yn.devicePixelRatio});return bh[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==$h||!$h.querySelector(e.conditions.selector))}(e)}oe(e){var t;return Qh(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._posthog.featureFlags)&&t.hasLoadedFlags?{satisfied:this.ie(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Ul(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Jl.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this.ie(e.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ie(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.oe(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Ih.A("lastSeenSurveyDate"))?(e=>!!Ih.A(Gl(e))&&!Qh(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this.se(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}se(e){var t;if(!jl(e)&&!zl(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}ue(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var t=e.value;return!e.key||!t||this.ie(t)}))}G(e){return this.checkSurveyEligibility(e).eligible&&this.ae(e)&&this.se(e)&&this.ue(e)}K(e){try{var t=tc.querySelector(sd(e,!0));null!=t&&t.shadowRoot&&Va(null,t.shadowRoot),null==t||t.remove()}catch(t){Bl.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.j,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function oc(e,t){if(tc&&ec){var r,i=new sc(e);if(e.config.disable_surveys_automatic_display)return Bl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Bl.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Mr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),ks(tc,"visibilitychange",(()=>{tc.hidden?Mr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function ac(e){var t=e.survey,r=e.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=e.setSurveyVisible,s=e.isPreviewMode,o=void 0!==s&&s,a=e.posthog;al((()=>{var e;if(!o&&null!=(e=t.conditions)&&e.url){var r=()=>{var e,r=t.type===Cl.Widget,s=Xh(t,a),o=(null==(e=t.appearance)?void 0:e.widgetType)===xl.Tab&&r;if(!s)return Bl.info("Hiding survey "+t.id+" because URL does not match"),n(!1),i(t);o&&(Bl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};ks(ec,"popstate",r),ks(ec,"hashchange",r);var s=ec.history.pushState,l=ec.history.replaceState;return ec.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.apply(this,t),r()},ec.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];l.apply(this,t),r()},()=>{ec.removeEventListener("popstate",r),ec.removeEventListener("hashchange",r),ec.history.pushState=s,ec.history.replaceState=l}}}),[o,t,i,n,a])}function lc(e){switch(void 0===e&&(e=Sl.Right),e){case Sl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Sl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Sl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function uc(e){var t,i,n,s,o,a,l=e.survey,u=e.forceDisableHtml,h=e.posthog,d=e.style,c=void 0===d?{}:d,v=e.previewPageIndex,f=e.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=e.isPopup,m=void 0===g||g,y=e.onPreviewSubmit,b=void 0===y?()=>{}:y,_=e.onPreviewBack,w=void 0===_?()=>{}:_,x=e.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=e.onCloseConfirmationMessage,C=void 0===S?()=>{}:S,T=e.properties,I=e.isSurveyCompleted,M=e.skipShownEvent,E=e.surveyLanguage,R=ll(null),P=Number.isInteger(v),O=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,F=function(e,t,i,n,s,o,a,l,u){var h=ol(n||0===i||e.type===Cl.ExternalSurvey),d=h[0],c=h[1],v=ol(!1),f=v[0],p=v[1],g=()=>{var t=()=>{o&&s(e),c(!1)};tc.startViewTransition?tc.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},m=t=>{t.detail.surveyId===e.id&&g()};return al((()=>{if(t){if(!n){var s=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(Xh(e,t)){c(!0),ec.dispatchEvent(new Event("PHSurveyShown")),l||t.capture(El.SHOWN,r({[Rl.SURVEY_NAME]:e.name,[Rl.SURVEY_ID]:e.id,[Rl.SURVEY_ITERATION]:e.current_iteration,[Rl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[Rl.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};if(ks(ec,"PHSurveyClosed",m),ks(ec,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),ec.removeEventListener("PHSurveyClosed",m),ec.removeEventListener("PHSurveySent",s)}}return o(),()=>{ec.removeEventListener("PHSurveyClosed",m),ec.removeEventListener("PHSurveySent",s)}}}else Bl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ac({survey:e,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:t}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,O,P,p,m,R,M,E),L=F.isPopupVisible,A=F.hidePopupWithViewTransition,N=F.isSurveySent||v===l.questions.length||!0===I,D=ul((()=>{var e=rd(l),t=(null==e?void 0:e.surveySubmissionId)||ph();return{isPreviewMode:P,previewPageIndex:v,onPopupSurveyDismissed(){E?zh(l,h,P,E):zh(l,h,P),k()},isPopup:m||!1,surveySubmissionId:t,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:T,surveyLanguage:E}}),[P,v,m,h,l,k,b,w,T,E]);return L?ld(Jh.Provider,{value:D,children:ld("div",{className:"ph-survey",style:r({},od(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:N?ld(kd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Nh,onClose(){A(),C()}}):ld(hc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function hc(e){var t,i,n=e.survey,s=e.forceDisableHtml,o=e.posthog,a=ol((()=>{var e=rd(n);return null!=e&&e.responses&&Bl.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),l=a[0],u=a[1],h=hl(Jh),d=h.previewPageIndex,c=h.onPopupSurveyDismissed,v=h.isPopup,f=h.onPreviewSubmit,p=h.onPreviewBack,g=h.surveySubmissionId,m=h.isPreviewMode,y=h.properties,b=h.surveyLanguage,_=ol((()=>{var e=rd(n);return d||(null==e?void 0:e.lastQuestionIndex)||0})),w=_[0],x=_[1],k=ol((()=>{var e,t=rd(n);return null!==(e=null==t?void 0:t.visitedIndices)&&void 0!==e?e:[]})),S=k[0],C=k[1],T=ul((()=>Gh(n)),[n]);al((()=>{m&&!Mr(d)&&x(d)}),[d,m]);var I=!(null==(t=n.appearance)||!t.allowGoBack)&&(m?(null!=d?d:0)>0:S.length>0),M=T.at(w);return M?ld("form",{className:"survey-form",name:"surveyForm",children:[v&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&ld(wd,{onClick(){c()}}),ld("div",{className:"survey-box","data-question-index":w,children:cc({question:M,forceDisableHtml:s,displayQuestionIndex:w,appearance:n.appearance||Nh,onSubmit:e=>(e=>{var t=e.res,i=e.displayQuestionIndex,s=e.questionId;if(o)if(s){var a=Ol(s),h=r({},l,{[a]:t});u(h);var d=Ad(n,i,t),c=d===Il.End,v=[...S,i];if(c||(C(v),x(d),td(n,{surveySubmissionId:g,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:b})),n.enable_partial_responses||c){var f=new Set(v.map((e=>{var t;return null==(t=T[e])?void 0:t.id})).filter((e=>!!e)).map((e=>Ol(e)))),p=Object.fromEntries(Object.entries(h).filter((e=>f.has(e[0]))));Bh({responses:p,survey:n,surveySubmissionId:g,isSurveyCompleted:c,posthog:o,properties:y,surveyLanguage:b})}}else Bl.error("onNextButtonClick called without a questionId.");else Bl.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:w,questionId:M.id}),onPreviewSubmit:f,initialValue:M.id?l[Ol(M.id)]:void 0,canGoBack:I,onBack(){if(m)p();else if(0!==S.length){var e=S[S.length-1],t=S.slice(0,-1);C(t),x(e),td(n,{surveySubmissionId:g,responses:l,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:b})}}})})]}):null}function dc(e){var t,r,i,n,s,o,a,l=e.survey,u=e.forceDisableHtml,h=e.posthog,d=e.readOnly,c=e.surveyLanguage,v=ol(!0),f=v[0],p=v[1],g=ol(!1),m=g[0],y=g[1],b=ol({}),_=b[0],w=b[1],x=()=>{y(!m)};if(al((()=>{var e;if(h){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&w({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Bl.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return ks(ec,rc,t),()=>{ec.removeEventListener(rc,t)}}}else Bl.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),ac({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==Ml&&p(!1),setTimeout((()=>{y(!1)}),200)};return ld(Ca,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&ld("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Sl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:lc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&ld(uc,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:c})]})}var cc=e=>{var t=e.question,i=e.onSubmit,n=e.onPreviewSubmit,s={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit(e){n(e)},onSubmit(e){i(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Tl.Open:return ka(Cd,r({},s,{question:t,key:t.id}));case Tl.Link:return ka(Td,r({},s,{question:t,key:t.id}));case Tl.Rating:return ka(Id,r({},s,{question:t,key:t.id}));case Tl.SingleChoice:case Tl.MultipleChoice:return ka(Ed,r({},s,{question:t,key:t.id}));default:return Bl.error("Unsupported question type: "+t.type),null}};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.generateSurveys=oc,ta.extendPostHogWithSurveys=oc;var vc=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),fc=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return vc(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(e.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?s=o-1:n=o}return vc(t,JSON.stringify(e.slice(0,n)),r)},pc=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,gc=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},mc=(e,t,r)=>{if(!r.truncated)if(Tr(e)){if(r.seen.has(e))return void gc(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(mc(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else gc(t,e,r)},yc=function(e,t,r,i,n,s){if(void 0===n&&(n=!1),!pc(e))return!n||vc(t,"null",r);if(Pr(e)||(e=>{try{return Fr(e)||$r(e)}catch(e){return!1}})(e))return vc(t,JSON.stringify(e),r);if("string"==typeof e)return fc(e,t,r);if(!Tr(e)&&!Sr(e))return vc(t,JSON.stringify(e),r);if(i.has(e))return fc("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(Cr(o))return yc(o.call(e),t,r,i,n)}catch(e){}try{var a={}.toString.call(e);if("[object String]"===a)return fc(String(e.valueOf()),t,r);if("[object Number]"===a||"[object Boolean]"===a)return vc(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var l={};try{for(var u in e)({}).hasOwnProperty.call(e,u)&&(l[u]=e[u])}catch(e){}try{l.name=e.name}catch(e){}try{l.message=e.message}catch(e){}try{l.stack=e.stack}catch(e){}return yc(l,t,r,i,n,s)}if(Sr(e)){if(!vc(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!vc(t,",",r))return!1;var d=void 0;try{d=e[h]}catch(e){d=void 0}if(!yc(d,t,r,i,!0))return!1}return vc(t,"]",r)}if(!vc(t,"{",r))return!1;var c=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(s)try{mc(f,v,s)}catch(e){}if(pc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=t.length,m=r.remaining,y=r.truncated;if(!vc(t,p,r))return!1;var b=t.length,_=yc(f,t,r,i,!1),w=r.truncated;if(t.length!==b){if(c=!1,!_)return!1}else if(t.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(e){}return vc(t,"}",r)},bc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.logs={initializeLogs(e){var t={host:ta.location.host},i=!1,n=function(n){var s=ta.console[n],o=(s=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{if(l.length>0&&!i&&e.is_capturing()){var h;i=!0,o=!0;var d=((e,t)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Tr(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,s=0;e.length>s&&(0>=s||vc(r," ",i))&&yc(e[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),c=d.body,v=d.attributes,f=r({},t,d.truncated?{body_truncated:"true"}:{});null==(h=e.logs)||h.le({level:bc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(e){}finally{o&&(i=!1),s.apply(ta.console,l)}})(s);o.__rrweb_original__=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(s),ta.console[n]=o};for(var s of Object.keys(bc))n(s)}};var _c=vs("[Error tracking]");function wc(){return new wn([new Ln,new zn,new An,new $n,new Bn,new Hn,new Dn,new Un],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=On.test(l)?l.replace(On,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,e);if(d){s.push(d);break}}if(s.length>=Fn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Fn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||xn});var i}))}(s)}}("web:javascript",Mn,Pn))}var xc=vs("[ExceptionAutocapture]"),kc=wc(),Sc={wrapOnError(e){var t=Yn;t||xc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){var t,i=kc.buildFromUnknown((arguments.length>4?arguments[4]:void 0)||(arguments.length>0?arguments[0]:void 0),{mechanism:{handled:!1}});return e(i),!!Cr(r)&&null!==(t=r(...arguments))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Yn;t||xc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var i,n=kc.buildFromUnknown(t,{mechanism:{handled:!1}});return e(n),!!Cr(r)&&null!==(i=r(t))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||xc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=kc.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(a),Cr(r)&&r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.errorWrappingFunctions=Sc,ta.posthogErrorWrappingFunctions=Sc;var Cc="X-POSTHOG-SESSION-ID",Tc="X-POSTHOG-WINDOW-ID",Ic="X-POSTHOG-DISTINCT-ID",Mc=[Cc,Tc,Ic],Ec=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Rc=(e,t)=>({}.hasOwnProperty.call(e,t)),Pc=e=>"object"==typeof e&&!Pr(e)||Cr(e),Oc=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),Fc=e=>{try{var t;return Oc(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Yn||null==(t=Yn.location)?void 0:t.href).toString()}catch(e){return}},Lc=(e,t,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(Sr(e)&&!e.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Cc,a.sessionId),n.set(Tc,l),o=!0}var u=(e=>Cr(e)?e():e)(t);return u&&u!==Zu&&(n.set(Ic,u),o=!0),o};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{};var $c={_patchFetch:(e,t,i)=>Ls(Yn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=Fc(s);if(u)if(Oc(s)){var h=new Request(s,o);Lc(e,t,i,h.url,h.headers),l=[h]}else{var d=new Headers(Pc(o)?o.headers:void 0);if(Lc(e,t,i,u,d)){var c=((e,t)=>{if(Mr(e)||Pr(e))return{headers:t};if(Pc(e)){var i=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),n}return new Proxy({headers:t},{get:(e,t)=>Rc(e,t)?Reflect.get(e,t):Reflect.get(i,t,i),has:(e,t)=>Rc(e,t)||t in i,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(i).forEach((e=>t.add(e))),Ec.forEach((e=>{e in i&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n)return n;if("string"==typeof t&&Ec.includes(t)&&t in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,t,i)}};var s=Reflect.getOwnPropertyDescriptor(i,t);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(e){l=a}return n.apply(this,l)})),_patchXHR:(e,t,r)=>Ls(Yn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=Fc(s);d&&Lc(e,t,r,d,h);var c=i.call(u,n,s,o,a,l);return Mc.forEach((e=>{var t=h.get(e);if(t)try{u.setRequestHeader(e,t)}catch(e){}})),c}))};ta.__PosthogExtensions__.tracingHeadersPatchFns=$c,ta.postHogTracingHeadersPatchFns=$c,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var Ac=-1,Nc=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Ac=t.timeStamp,e(t))}),!0)},Dc=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},qc=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},jc=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Hc=()=>{var e,t;return null!==(e=null==(t=jc())?void 0:t.activationStart)&&void 0!==e?e:0},Bc=function(e,t){void 0===t&&(t=-1);var r=jc(),i="navigate";return 0>Ac?r&&(document.prerendering||Hc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Uc=new WeakMap;function zc(e,t){var r=Uc.get(t);return r||(r=new WeakMap,Uc.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class Vc{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var Wc,Zc=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},Gc=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Qc=-1,Jc=new Set,Kc=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Yc=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Jc)t();isFinite(Qc)||(Qc="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Yc,!0))}},Xc=()=>{if(0>Qc){var e,t=Hc(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;Qc=null!=r?r:Kc(),addEventListener("visibilitychange",Yc,!0),addEventListener("prerenderingchange",Yc,!0),Nc((()=>{setTimeout((()=>{Qc=Kc()}))}))}return{get firstHiddenTime(){return Qc},onHidden(e){Jc.add(e)}}},ev=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},tv=[1800,3e3],rv=function(e,t){void 0===t&&(t={}),ev((()=>{var r,i=Xc(),n=Bc("FCP"),s=Zc("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-Hc(),0),n.entries.push(t),r(!0)))}));s&&(r=Dc(e,n,tv,t.reportAllChanges),Nc((i=>{n=Bc("FCP"),r=Dc(e,n,tv,t.reportAllChanges),qc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},iv=[.1,.25],nv=0,sv=1/0,ov=0,av=e=>{for(var t of e)t.interactionId&&(sv=Math.min(sv,t.interactionId),ov=Math.max(ov,t.interactionId),nv=ov?(ov-sv)/7+1:0)},lv=()=>{var e;return Wc?nv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},uv=0;class hv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){uv=lv(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((lv()-uv)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var dv=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=Gc(e),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},cv=[200,500];class vv{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var fv=[2500,4e3],pv={onLCP(e,t){void 0===t&&(t={}),ev((()=>{var r,i=Xc(),n=Bc("LCP"),s=zc(t,vv),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Hc(),0),n.entries=[o],r())},a=Zc("largest-contentful-paint",o);if(a){r=Dc(e,n,fv,t.reportAllChanges);var l=Gc((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(dv(l),removeEventListener(e.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Nc((i=>{n=Bc("LCP"),r=Dc(e,n,fv,t.reportAllChanges),qc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=Xc();rv(Gc((()=>{var i,n=Bc("CLS",0),s=zc(t,Vc),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Zc("layout-shift",o);a&&(i=Dc(e,n,iv,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Nc((()=>{s.i=0,n=Bc("CLS",0),i=Dc(e,n,iv,t.reportAllChanges),qc(i)})),setTimeout(i))})))},onFCP:rv,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Xc();ev((()=>{var i;"interactionCount"in performance||Wc||(Wc=Zc("event",av,{durationThreshold:0}));var n,s=Bc("INP"),o=zc(t,hv),a=e=>{dv((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=Zc("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=Dc(e,s,cv,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Nc((()=>{o.v(),s=Bc("INP"),n=Dc(e,s,cv,t.reportAllChanges)})))}))}}};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.postHogWebVitalsCallbacks=pv,ta.postHogWebVitalsCallbacks=pv,ta.__PosthogExtensions__.loadWebVitalsCallbacks=()=>pv;class gv{constructor(e){this.disabled=!1===e;var t=Tr(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var mv="$copy_autocapture",yv=vs("[AutoCapture]");function bv(e,t){return t.length>e?t.slice(0,e)+"...":t}function _v(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Us(t));return t}function wv(e,t){var i,n,s=t.e,o=t.maskAllElementAttributes,a=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!Us(e))return{props:{}};for(var d=[e],c=new Set([e]),v=e;v.parentNode&&!zs(v,"body")&&Zs>d.length;)if(Ws(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!Us(v.parentNode))break;if(c.has(v.parentNode))break;c.add(v.parentNode),d.push(v.parentNode),v=v.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(ps(d,(e=>{var t=fo(e);if(zs(e,"a")){var r=e.getAttribute("href");b=!!(t&&r&&xo(r))&&(h?en(r):r)}mr(Js(e),"ph-no-capture")&&(_=!0),m.push(function(e,t,r,i,n){void 0===n&&(n=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};eo.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?bv(1024,ko(e)):bv(1024,Ys(e)));var a=Js(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),ps(e.attributes,(function(r){var s;if((!po(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&xo(r.value)&&(!Er(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=Gs(a).join(" ")),o["attr__"+r.name]=bv(1024,"href"===r.name&&n?en(a):a)}}));for(var l=1,u=1,h=e;h=_v(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,h));var i=function(e){if(!fo(e))return{};var t={};return ps(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&xo(i)&&(t[r]=i)}})),t}(e);gs(y,i)})),_)return{props:{},explicitNoCapture:_};if(a||(m[0].$el_text=zs(e,"a")||zs(e,"button")?ko(e):Ys(e)),b){var w,x;m[0].attr__href=b;var k=null==(w=Ts(b))?void 0:w.host,S=null==Yn||null==(x=Yn.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:gs({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(e){return e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ms(o).sort(((e,t)=>e[0].localeCompare(t[0]))).forEach((e=>{var t=e[1];return a[Co(e[0].toString())]=Co(t.toString())})),(n+=":")+ms(a).map((e=>e[0]+'="'+e[1]+'"')).join("")})).join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:To(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ms(e).filter((e=>0===e[0].indexOf("attr__"))).forEach((e=>i.attributes[e[0]]=e[1])),i}))}(g)))},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var xv={};function kv(e){return function(e,t){var r=xv[e];if(r)return r;var i=t[e];if((e=>Cr(e)&&-1!==e.toString().indexOf("[native code]"))(i)&&(null==Yn||!Yn.Zone))return xv[e]=i.bind(t);var n=t.document;if(n&&Cr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[e]&&(i=o[e]),n.head.removeChild(s)}catch(t){cs.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Cr(i)?xv[e]=i.bind(t):i}("MutationObserver",e)}function Sv(e,t){var i=Xs(e);return i?r({node:i,originalEvent:e,timestamp:Date.now()},t):null}function Cv(e,t){return Math.abs(e)<Math.abs(t)?0>t?"up":"down":0>e?"left":"right"}function Tv(e){return"swipe"===e.type?"$dead_swipe":"$dead_click"}var Iv="canvas,video,audio,embed,object";function Mv(e,t){return Fr(e)&&e>=t}class Ev{ce(e){var t,r,i,n,s,o,a,l,u=this.de((null==e?void 0:e.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==e?void 0:e.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==e?void 0:e.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==e?void 0:e.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(e,t){this.ve=[],this.fe=0,this.de=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:e}),this.pe=e=>{var t=Sv(e,{type:"click"});Pr(t)||this.me(t)||this.ve.push(t),this.ye()},this.ge=()=>{var e=Date.now();this.be=e,e%50==0&&this.ve.forEach((t=>{Mr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.we=()=>{this.xe=Date.now()},this.ke=()=>{"visible"===(null==ts?void 0:ts.visibilityState)&&(this.Se=Date.now())},this.Ce=e=>{var t=e.touches,r=1===(null==t?void 0:t.length)?t[0]:void 0;this._e=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Ie=()=>{this._e=void 0},this.Me=e=>{var t,r=this._e;if(this._e=void 0,!Mr(r)&&this.Te.max_dead_swipes_per_page_load>this.fe){var i=e,n=null==(t=i.changedTouches)?void 0:t[0];if(n){var s=n.clientX-r.x,o=n.clientY-r.y,a=s*s+o*o,l=this.Te.swipe_threshold_px;if(a>=l*l&&![this.be,this.Re,this.xe].some((e=>Fr(e)&&e>=r.timestamp))){var u;if(this.Ee()&&(null!==(u=null==ts||null==ts.elementsFromPoint?void 0:ts.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((e=>null==e.matches?void 0:e.matches(Iv))))return;var h=Sv(i,{type:"swipe",swipeDirection:Cv(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Pr(h)||this.me(h)||this.ve.push(h),this.ye()}}}},this.instance=e,this.Te=this.ce(t),this._onCapture=this.Te.__onCapture}start(e){this.Le(),this.Oe(),this.Ne(),this.qe(),this.Ae(e),this.Te.capture_dead_swipes&&this.Pe()}Ae(e){if(!this.De){var t=kv(ta);this.De=new t((e=>{this.Fe(e)})),this.De.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.De)||e.disconnect(),this.De=void 0,ta.removeEventListener("click",this.pe),ta.removeEventListener("scroll",this.ge,{capture:!0}),ta.removeEventListener("selectionchange",this.we),ta.removeEventListener("touchstart",this.Ce,{capture:!0}),ta.removeEventListener("touchend",this.Me,{capture:!0}),ta.removeEventListener("touchcancel",this.Ie,{capture:!0}),null==ts||ts.removeEventListener("visibilitychange",this.ke),this._e=void 0}Fe(e){this.Re=Date.now()}Le(){ks(ta,"click",this.pe)}ye(){this.ve.length&&Mr(this.je)&&(this.je=ta.setTimeout((()=>{this.He()}),1e3))}Oe(){ks(ta,"scroll",this.ge,{capture:!0})}Ne(){ks(ta,"selectionchange",this.we)}qe(){ks(ts,"visibilitychange",this.ke)}Pe(){ks(ta,"touchstart",this.Ce,{capture:!0,passive:!0}),ks(ta,"touchend",this.Me,{capture:!0,passive:!0}),ks(ta,"touchcancel",this.Ie,{capture:!0,passive:!0})}Ee(){var e=Mr(this.Be)||Fr(this.Re)&&this.Re>this.Be;return(Mr(this.Ue)||e)&&(this.Be=Date.now(),this.Ue=!(null==ts||!ts.querySelector(Iv))),!!this.Ue}me(e){return!e||("swipe"===e.type?this.We(e):this.Ve(e))}We(e){if(Bs(e.node))return!0;var t=this.ve.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!t&&!zs(e.node,"html")&&Us(e.node)&&function(e,t){var r;if(!Yn||co(e))return!1;var i=$r(t)?ao:null!==(r=null==t?void 0:t.css_selector_ignorelist)&&void 0!==r?r:ao;return!to(vo(e,!1).targetElementList,i)}(e.node,{css_selector_ignorelist:this.Te.css_selector_ignorelist}))}Ve(e){return!(this.Te.capture_clicks_with_modifier_keys||(t=e.originalEvent,!(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)))||!!this.We(e)||(r=e.node,!(!Yn||co(r))&&vo(r,!1).targetElementList.some((e=>zs(e,"a"))));var t,r}He(){if(this.ve.length){clearTimeout(this.je),this.je=void 0;var e=this.ve;for(var t of(this.ve=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Re&&this.Re>=t.timestamp?this.Re-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.xe&&this.xe>=t.timestamp?this.xe-t.timestamp:void 0,t.visibilityChangedDelayMs=this.Se?Math.abs(t.timestamp-this.Se):void 0;var i=Mv(t.scrollDelayMs,this.Te.scroll_threshold_ms),n=Mv(t.selectionChangedDelayMs,this.Te.selection_change_threshold_ms),s=Mv(t.mutationDelayMs,this.Te.mutation_threshold_ms),o=Mv(t.absoluteDelayMs,1.1*this.Te.mutation_threshold_ms),a=Fr(t.scrollDelayMs)&&this.Te.scroll_threshold_ms>t.scrollDelayMs,l=Fr(t.mutationDelayMs)&&this.Te.mutation_threshold_ms>t.mutationDelayMs,u=Fr(t.selectionChangedDelayMs)&&this.Te.selection_change_threshold_ms>t.selectionChangedDelayMs,h=Fr(t.visibilityChangedDelayMs)&&this.Te.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=Mv(t.visibilityChangedDelayMs,this.Te.selection_change_threshold_ms);if(i||s||o||n||d){var c=Tv(t);if("$dead_swipe"===c){if(this.fe>=this.Te.max_dead_swipes_per_page_load)continue;this.fe++}this._onCapture(t,{[c+"_last_mutation_timestamp"]:this.Re,[c+"_event_timestamp"]:t.timestamp,[c+"_scroll_timeout"]:i,[c+"_mutation_timeout"]:s,[c+"_absolute_timeout"]:o,[c+"_selection_changed_timeout"]:n,[c+"_visibility_changed_timeout"]:d})}else this.Te.mutation_threshold_ms>t.absoluteDelayMs&&this.ve.push(t)}}this.ye()}}he(e,t){var i=Tv(e);this.instance.capture(i,r({},t,wv(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:e.scrollDelayMs,[i+"_mutation_delay_ms"]:e.mutationDelayMs,[i+"_absolute_delay_ms"]:e.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:e.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:e.visibilityChangedDelayMs,$dead_swipe_direction:e.swipeDirection,$dead_swipe_distance_px:e.swipeDistancePx}),{timestamp:new Date(e.timestamp)})}}ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Ev(e,t);var Rv=vs("[ExternalScriptsLoader]"),Pv=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Rv.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==ts?void 0:ts.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===t){var e=i[o];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!ts)return r("document not found");var i=ts.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)ts.head.appendChild(i);else{var n,s=ts.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):ts.body.appendChild(i)}};null!=ts&&ts.body?a():null==ts||ts.addEventListener("DOMContentLoaded",a)};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var i;if(e.config.strict_script_versioning)i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var n="/static/"+t+".js?v="+e.version;if("toolbar"===t){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=e.requestRouter.endpointFor("assets",n)}Pv(e,i,r)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Pv(e,o,r)}},ta.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);Pv(e,i,r)};hs.DEBUG=!1,hs.LIB_VERSION="1.407.7",hs.LIB_NAME="web";class Ov{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===eh||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===Xu}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Jt.q(this.Kt,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Jt.P(this.Kt,this.Te.cross_subdomain_cookie)}get Kt(){var e=this._instance.config,t=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+t:"__ph_opt_in_out_"+t)}get Qt(){var e=this.Jt.A(this.Kt);return Ur(e)?1:mr(zr,e)?0:-1}get Jt(){var e=this.Te.opt_out_capturing_persistence_type,t="localStorage"===e?Ih:Ch;if(!this.Yt||this.Yt!==t){this.Yt=t;var r="localStorage"===e?Ch:Ih;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(Ur(r.A(this.Kt))),r.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[null==es?void 0:es.doNotTrack,null==es?void 0:es.msDoNotTrack,ta.doNotTrack].some((e=>Ur(e)))}}var Fv=vs("[Dead Clicks]"),Lv=()=>!0,$v=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(uu)),i=e.instance.config.capture_dead_clicks;return $r(i)?i:!!Tr(i)||r};class Av{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[uu]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Fv.error("failed to load script",t):e()}))}tr(){var e;if(ts){if(!this.Xt&&null!=(e=ta.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Tr(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Xt=ta.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Xt.start(ts),Fv.info("starting...")}}else Fv.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Fv.info("stopping..."))}}var Nv=vs("[SegmentIntegration]");var Dv="posthog-js";function qv(e,t){var i=void 0===t?{}:t,n=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return t=>{var i,a,u,d,c;if("*"!==l&&!l.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=t.exception)?void 0:i.values)||[],g=p.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||t.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:t.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+t.event_id),h&&(null==(f=e.exceptions)||f.sendExceptionEvent(m)),t}}class jv{constructor(e,t,r,i,n,s){this.name=Dv,this.setupOnce=function(o){o(qv(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Hv{constructor(e){this.rr=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(cs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.rr)}destroy(){var e;null==(e=this.sr)||e.call(this),this.sr=void 0}doPageView(e,t){var r,i=this.ar(e,t);return this.ir={pathname:null!==(r=null==Yn?void 0:Yn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.ar(e,null==(t=this.ir)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ir)?void 0:e.pageViewId}}ar(e,t){var r=this.ir;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Mr(s)||Mr(o)||Mr(a)||Mr(l)||Mr(u)||Mr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Vr(o/s,0,1,cs):1,c=s>1?Vr(a/s,0,1,cs):1,v=l>1?Vr(u/l,0,1,cs):1,f=l>1?Vr(h/l,0,1,cs):1;i=gs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Bv=["flags","surveys"],Uv={[Yl]:{exposure:"hidden"},[tu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ru]:{exposure:"hidden"},[iu]:{exposure:"event"},[nu]:{exposure:"hidden"},[su]:{exposure:"event"},[ou]:{exposure:"hidden"},[au]:{exposure:"event"},[lu]:{exposure:"event"},[uu]:{exposure:"event"},[hu]:{exposure:"hidden"},[du]:{exposure:"event"},[cu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[yu]:{exposure:"hidden"},[bu]:{exposure:"event"},[vu]:{exposure:"event",shouldSkipFromEventProperties:e=>Pr(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[_u]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!Tr(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[wu]:{exposure:"event",storageGroup:"flags"},[xu]:{exposure:"hidden"},[ku]:{exposure:"hidden",storageGroup:"flags"},[Su]:{exposure:"event",storageGroup:"flags"},[Cu]:{exposure:"event",storageGroup:"flags",volatile:!0},[Tu]:{exposure:"hidden",storageGroup:"flags"},[Iu]:{exposure:"event"},[Mu]:{exposure:"hidden"},[Eu]:{exposure:"hidden"},[Ru]:{exposure:"hidden"},[Pu]:{exposure:"hidden",storageGroup:"surveys"},[Ou]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Fu]:{exposure:"event"},[Lu]:{exposure:"hidden"},[$u]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Au]:{exposure:"hidden"},[Nu]:{exposure:"hidden"},[Du]:{exposure:"hidden"},[qu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ju]:{exposure:"hidden"},[Hu]:{exposure:"hidden"},[Bu]:{exposure:"hidden"},[Uu]:{exposure:"hidden"},[zu]:{exposure:"hidden"},[Vu]:{exposure:"hidden"},[Wu]:{exposure:"hidden"},[fu]:{exposure:"event"},[pu]:{exposure:"event"},[gu]:{exposure:"event"},[mu]:{exposure:"event"},[Qu]:{exposure:"event"},[Ju]:{exposure:"event"},[Ku]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},zv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Vv=e=>{var t=Uv[e];if(t)return t;for(var r of zv){var i=r[1];if(0===e.indexOf(r[0]))return i}},Wv={flags:qu,surveys:Ou},Zv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Gv="main";class Qv{constructor(e,t,i){if(void 0===i&&(i=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=i,this.props={},this.cr=!1,this.vr=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Jt=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&cs.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save(),Yn){var n=()=>this.flush();ks(Yn,"beforeunload",n,{capture:!1}),ks(Yn,"pagehide",n,{capture:!1})}}mr(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return Fr(t)&&t>0?t:0}isDisabled(){return!!this.yr}pr(e){-1===Zv.indexOf(e.persistence.toLowerCase())&&(cs.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var i=[...Mh,...e];return r({},Ih,{F(e){try{var r={};try{r=Ch.F(e)||{}}catch(e){}var i,n=JSON.parse(Ih.A(e)||"{}");if(t){var s={};for(var o in r){var a=r[o];Pr(a)||""===a||(s[o]=a)}i=gs(n,s)}else i=gs(r,n);return Ih.q(e,i),i}catch(e){}return null},q(e,t,r,n,s,o){var a=Ih.q(e,t,void 0,void 0,o);try{var l={};i.forEach((e=>{t[e]&&(l[e]=t[e])})),Object.keys(l).length&&Ch.q(e,l,r,n,s,o)}catch(e){Ih.D(e)}return a},P(e,t){try{null==Yn||Yn.localStorage.removeItem(e),Ch.P(e,t)}catch(e){Ih.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Ih.N()?(t=Ih,n=!0):"localstorage+cookie"===s&&i.N()?(t=i,n=!0):"sessionstorage"===s&&Oh.N()?t=Oh:"memory"===s?t=Rh:"cookie"===s?t=Ch:i.N()?(t=i,n=!0):t=Ch,this.ur=n,t}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var t=null!=e?e:this.Te.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[qu];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return ps(this.props,((t,r)=>{var i=Vv(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===_u?()=>this._r():()=>!1))return;i.transformToEventProperties&&gs(e,i.transformToEventProperties(t))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,(()=>!1)))return;e[r]=t}})),e}load(){if(!this.yr){var e=this.Jt.F(this.vr);e&&(this.props=gs({},e)),this.hr&&this.wr()}}wr(){for(var e of Bv){var t=Ih.F(this.br(e));if(t&&!Ir(t)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(t,e)),this.Tr(e,t)||gs(this.props,t)}}}Sr(e){return Object.keys(this.props).some((t=>{var r;return(null==(r=Vv(t))?void 0:r.storageGroup)===e}))}Tr(e,t){var r=Wv[e];if(!r)return!1;var i=t[r],n=this.props[r];return Fr(i)&&Fr(n)&&n>i}refreshKey(e){var t;if(!this.yr){var r=this.hr?null==(t=Vv(e))?void 0:t.storageGroup:void 0,i=r?Ih.F(this.br(r)):this.Jt.F(this.vr);if(i&&e in i)this.Ir(e,i[e]);else{if(r){var n=this.Jt.F(this.vr);if(n&&e in n)return void this.Ir(e,n[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?Mr(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){Mr(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Jt,this.vr,this.props,Gv))}Pr(){var e=this.Fr(),t=e.main,r=e.groups;for(var i of(this.Or(this.Jt,this.vr,t,Gv),Bv)){var n,s=r[i];(!Ir(s)||null!=(n=this.lr[i])&&n.persisted)&&this.Or(Ih,this.br(i),s,i)}}Fr(){var e={},t={flags:{},surveys:{}};return ps(this.props,((r,i)=>{var n,s=null==(n=Vv(i))?void 0:n.storageGroup;s?t[s][i]=r:e[i]=r})),{main:e,groups:t}}Cr(e,t){if(t===Gv)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return ps(e,((e,t)=>{var i;r[t]=null!=(i=Vv(t))&&i.volatile?"__volatile__":e})),JSON.stringify(r)}Or(e,t,r,i){var n=this.kr(i);if(i===Gv||n.dirty||Mr(n.fingerprint)){var s;try{if((s=this.Cr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.q(t,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(n.dirty=!1,i!==Gv&&(n.persisted=!0),Mr(s)||(n.fingerprint=s)):this.Te.debug&&cs.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,r=void 0!==t&&t;if(Mr(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Jt.P(this.vr,!1),this.Jt.P(this.vr,!0),!r&&this.dr)for(var i of Bv)Ih.P(this.br(i));r?delete this.lr[Gv]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Tr(e)){Mr(t)&&(t="None"),this.Lr=Mr(r)?this.Nr:r;var i=!1;if(ps(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Ir(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Tr(e)){this.Lr=Mr(t)?this.Nr:t;var r=!1;if(ps(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.Ir(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=Bd(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Ir(_s(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=null==ts?void 0:ts.referrer)?zd(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Zd(),$referring_domain:null!=ts&&ts.referrer&&(null==(e=Ts(ts.referrer))?void 0:e.host)||Wd},void 0)}set_initial_person_info(){this.props[Uu]||this.props[zu]||this.register_once({[Vu]:Gd(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};ps([zu,Uu],(t=>{var r=this.props[t];r&&ps(r,(function(t,r){e["$initial_"+br(r)]=t}))}));var t=this.props[Vu];if(t){var r=function(e,t){void 0===t&&(t=!1);var r=Qd(e,t),i={};return ps(r,(function(e,t){i["$initial_"+br(t)]=e})),i}(t,this.Te.disable_capture_url_hashes);gs(e,r)}return e}safe_merge(e){return ps(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=i?this.pr(e):this.Jt,s=this.gr(e);if(i||s!==this.hr){var o=this.props;this.clear(),this.Jt=n,this.hr=s,this.props=o,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[ru]||{};r[e]=t,this.Ir(ru,r),this.save()}remove_event_timer(e){var t=this.props[ru]||{},r=t[e];return Mr(r)||(delete t[e],this.Ir(ru,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Ir(e,t),this.save()}Ir(e,t){var r;this.props[e]=t,null!=(r=Vv(e))&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var t,r=null==(t=Vv(e))?void 0:t.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var Jv=vs("[RateLimiter]");class Kv{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{Jv.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Jv.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(Bu))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(Bu,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Yv=vs("[RemoteConfig]");class Xv{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ta._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}qr(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return Yv.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Yv.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return Yv.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((e=>{this.Hr(e),this.Br()}));this.Hr(e),this.Br()}))}catch(e){Yv.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&ts&&"hidden"!==ts.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.zr=setInterval((()=>{this.refresh()}),t))}}Hr(e){var t;e||Yv.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var ef=Uint8Array,tf=Uint16Array,rf=Uint32Array,nf=new ef([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]),sf=new ef([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]),of=new ef([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),af=function(e,t){for(var r=new tf(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new rf(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},lf=af(nf,2),uf=lf[1];lf[0][28]=258,uf[258]=28;for(var hf=af(sf,0)[1],df=new tf(32768),cf=0;32768>cf;++cf){var vf=(43690&cf)>>>1|(21845&cf)<<1;df[cf]=((65280&(vf=(61680&(vf=(52428&vf)>>>2|(13107&vf)<<2))>>>4|(3855&vf)<<4))>>>8|(255&vf)<<8)>>>1}var ff=function(e,t,r){for(var i=e.length,n=0,s=new tf(t);i>n;++n)++s[e[n]-1];var o,a=new tf(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new tf(1<<t);var l=15-t;for(n=0;i>n;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],d=a[e[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[df[d]>>>l]=u}else for(o=new tf(i),n=0;i>n;++n)o[n]=df[a[e[n]-1]++]>>>15-e[n];return o},pf=new ef(288);for(cf=0;144>cf;++cf)pf[cf]=8;for(cf=144;256>cf;++cf)pf[cf]=9;for(cf=256;280>cf;++cf)pf[cf]=7;for(cf=280;288>cf;++cf)pf[cf]=8;var gf=new ef(32);for(cf=0;32>cf;++cf)gf[cf]=5;var mf=ff(pf,9,0),yf=ff(gf,5,0),bf=function(e){return(e/8>>0)+(7&e&&1)},_f=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof tf?tf:e instanceof rf?rf:ef)(r-t);return i.set(e.subarray(t,r)),i},wf=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},xf=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},kf=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new ef(0),0];if(1==n){var o=new ef(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new tf(c+1),f=Sf(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(s.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=s[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=s[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==t&&(--v[_],++p)}f=t}return[new ef(v),f]},Sf=function(e,t,r){return-1==e.s?Math.max(Sf(e.l,t,r+1),Sf(e.r,t,r+1)):t[e.s]=r},Cf=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new tf(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},Tf=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},If=function(e,t,r){var i=r.length,n=bf(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},Mf=function(e,t,r,i,n,s,o,a,l,u,h){wf(t,h++,r),++n[256];for(var d=kf(n,15),c=d[0],v=d[1],f=kf(s,15),p=f[0],g=f[1],m=Cf(c),y=m[0],b=m[1],_=Cf(p),w=_[0],x=_[1],k=new tf(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=kf(k,7),T=C[0],I=C[1],M=19;M>4&&!T[of[M-1]];--M);var E,R,P,O,F=u+5<<3,L=Tf(n,pf)+Tf(s,gf)+o,A=Tf(n,c)+Tf(s,p)+o+14+3*M+Tf(k,T)+(2*k[16]+3*k[17]+7*k[18]);if(L>=F&&A>=F)return If(t,h,e.subarray(l,l+u));if(wf(t,h,1+(L>A)),h+=2,L>A){E=ff(c,v,0),R=c,P=ff(p,g,0),O=p;var N=ff(T,I,0);for(wf(t,h,b-257),wf(t,h+5,x-1),wf(t,h+10,M-4),h+=14,S=0;M>S;++S)wf(t,h+3*S,T[of[S]]);h+=3*M;for(var D=[y,w],q=0;2>q;++q){var j=D[q];for(S=0;j.length>S;++S)wf(t,h,N[H=31&j[S]]),h+=T[H],H>15&&(wf(t,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=mf,R=pf,P=yf,O=gf;for(S=0;a>S;++S)if(i[S]>255){var H;xf(t,h,E[257+(H=i[S]>>>18&31)]),h+=R[H+257],H>7&&(wf(t,h,i[S]>>>23&31),h+=nf[H]);var B=31&i[S];xf(t,h,P[B]),h+=O[B],B>3&&(xf(t,h,i[S]>>>5&8191),h+=sf[B])}else xf(t,h,E[i[S]]),h+=R[i[S]];return xf(t,h,E[256]),h+R[256]},Ef=new rf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Rf=function(){for(var e=new rf(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Pf=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Of(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Rf[255&r^t[i]]^r>>>8;e=r},d(){return 4294967295^e}}}(),i=e.length;r.p(e);var n,s,o,a,l=(n=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,r,i,n,s){var o=e.length,a=new ef(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=If(l,u,e.subarray(h,d)):(l[h]=!0,u=If(l,u,e.subarray(h,o)))}else{for(var c=Ef[t-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new tf(32768),m=new tf(p+1),y=Math.ceil(r/3),b=2*y,_=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},w=new rf(25e3),x=new tf(288),k=new tf(32),S=0,C=0,T=(h=0,0),I=0,M=0;o>h;++h){var E=_(h),R=32767&h,P=m[E];if(g[R]=P,m[E]=R,h>=I){var O=o-h;if((S>7e3||T>24576)&&O>423){u=Mf(e,l,0,w,x,k,C,T,M,h-M,u),T=S=C=0,M=h;for(var F=0;286>F;++F)x[F]=0;for(F=0;30>F;++F)k[F]=0}var L=2,A=0,N=f,D=R-P&32767;if(O>2&&E==_(h-D))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),H=Math.min(258,O);j>=D&&--N&&R!=P;){if(e[h+L]==e[h+L-D]){for(var B=0;H>B&&e[h+B]==e[h+B-D];++B);if(B>L){if(L=B,A=D,B>q)break;var U=Math.min(D,B-2),z=0;for(F=0;U>F;++F){var V=h-D+F+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,P=V)}}}D+=(R=P)-(P=g[R])+32768&32767}if(A){w[T++]=268435456|uf[L]<<18|hf[A];var Z=31&uf[L],G=31&hf[A];C+=nf[Z]+sf[G],++x[257+Z],++k[G],I=h+L,++S}else w[T++]=e[h],++x[e[h]]}}u=Mf(e,l,!0,w,x,k,C,T,M,h-M,u)}return _f(a,0,i+bf(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Pf(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}}(l,t),Pf(l,u-8,r.d()),Pf(l,u-4,i),l}var Ff=!!ns||!!is,Lf="text/plain",$f=!1,Af=(e,t)=>{var r=e.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return e;var a=o.split("&").filter((e=>e.split("=")[0]!==t)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},Nf=function(e,t,i){var n;void 0===i&&(i=!0);var s=e.split("?"),o=s[0],a=s[1],l=r({},t),u=null!==(n=null==a?void 0:a.split("&").map((e=>{var t,r=e.split("="),n=r[0],s=i&&null!==(t=l[n])&&void 0!==t?t:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Is(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Df=e=>{if(e.Vr)return e.Vr;var t=e.data,r=e.compression;if(t){if(r===yl){var i=Of(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new ef(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new ef(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return _f(i,0,n)}(Cs(t)),{mtime:0});return{contentType:Lf,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===bl){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(Cs(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Cs(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Cs(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},qf=e=>{var t,i,n=()=>"sendBeacon"===e.transport?{url:Nf(e.url,{compression:bl}),encodedBody:Df(r({},e,{compression:bl,Vr:void 0}))}:{url:Af(e.url,"compression"),encodedBody:Df(r({},e,{compression:void 0,Vr:void 0}))};try{t=Df(e)}catch(t){if(hr(e.compression,Ms(e.url,"compression")))return cs.error("Failed to gzip request body, sending uncompressed payload",t),n();throw t}return t&&hr(e.compression,Ms(e.url,"compression"))&&!((i=t.body)instanceof ArrayBuffer?ur(new Uint8Array(i)):ArrayBuffer.isView(i)&&ur(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?($f=!0,n()):{url:e.url,encodedBody:t}},jf=e=>{try{return qf(e)}catch(t){return cs.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},Hf=function(){var e=t((function*(e){var t=Cs(e.data),i=yield function(e,t,r){return fr.apply(this,arguments)}(t,hs.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{Vr:{contentType:Lf,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Bf=/Failed to fetch|NetworkError|Load failed/i,Uf=e=>{var t=jf(e);if(t){var i=t.url,n=t.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;ps(e.headers,(function(e,t){u.append(t,e)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(ss){var c=new ss;h={signal:c.signal,timeout:setTimeout((()=>{var t,r;d=!0,c.abort((t=e.timeout,(r=new Error("PostHog request timed out"+(t?" after "+t+"ms":""))).name="AbortError",r))}),e.timeout)}}var v=t=>{d&&"AbortError"===(null==t?void 0:t.name)||(e=>"TypeError"===(null==e?void 0:e.name)&&Bf.test((null==e?void 0:e.message)||""))(t)?cs.warn(t):cs.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var f;is(i,r({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.Wr&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){cs.error(e)}null==e.callback||e.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(e){h&&clearTimeout(h.timeout),v(e)}}},zf=e=>{try{var t,i=qf(e),n=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(es.sendBeacon(n,u))return;var h=Sr(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Sr(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=t=>Sr(e.data)?t:r({},e.data,{batch:t});return zf(r({},e,{data:c(h.slice(0,d))})),void zf(r({},e,{data:c(h.slice(d))}))}cs.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Uf(r({},e,{Wr:!0}))}catch(e){cs.warn("Beacon send failed",e)}},Vf=(e,t,i,n)=>{var s="query"===n?"POST"===t?"sent_at":"_":void 0;return Nf(i===yl?Af(e,"compression"):e,r({},s?{[s]:Date.now().toString()}:{},i===yl?{}:{compression:i}))},Wf=[];is&&Wf.push({transport:"fetch",method:Uf}),ns&&Wf.push({transport:"XHR",method(e){var t=jf(e);if(t){var r=new ns,i=t.encodedBody;r.open(e.method||"GET",t.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;ps(e.headers,(function(e,t){r.setRequestHeader(t,e)})),s&&r.setRequestHeader("Content-Type",s),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(o)}}}),null!=es&&es.sendBeacon&&Wf.push({transport:"sendBeacon",method:zf});var Zf=3e3;class Gf{constructor(e,t){this.Zr=!0,this.Gr=[],this.Qr=Vr((null==t?void 0:t.flush_interval_ms)||Zf,250,5e3,cs.createLogger("flush interval"),Zf),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ei():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.ti(r({},e,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var t=this.ei(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Sr(r.data)&&ps(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.ti(r)};for(var i in t)r()}}),this.Qr))}ti(e){try{this.Jr(e)}catch(e){cs.error(e)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var e={};return ps(this.Gr,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;Mr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this.Gr=[],e}}var Qf=["retriesPerformedSoFar"];class Jf{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!Mr(Yn)&&"onLine"in Yn.navigator&&(this.ni=Yn.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},ks(Yn,"online",this.si),ks(Yn,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,n=i(e,Qf);Lr(t)&&(n.url=Nf(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.kt(r({retriesPerformedSoFar:t},n));0===e.statusCode&&cs.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==n.callback||n.callback(e)}}))}kt(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(t),i=Date.now()+r;this.Gr.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),cs.warn(n),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),0===this.Gr.length)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var e=Date.now(),t=[],r=this.Gr.filter((r=>e>r.retryAt||(t.push(r),!1)));if(this.Gr=t,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Mr(Yn)||(this.si&&(Yn.removeEventListener("online",this.si),this.si=void 0),this.ai&&(Yn.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var t=e.requestOptions;try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(e){cs.error(e)}}this.Gr=[]}}class Kf{constructor(e){this.hi=()=>{var e,t,r,i;this.di||(this.di={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.di.lastScrollY=Math.ceil(s),this.di.maxScrollY=Math.max(s,null!==(e=this.di.maxScrollY)&&void 0!==e?e:0),this.di.maxScrollHeight=Math.max(o,null!==(t=this.di.maxScrollHeight)&&void 0!==t?t:0),this.di.lastContentY=a,this.di.maxContentY=Math.max(a,null!==(r=this.di.maxContentY)&&void 0!==r?r:0),this.di.maxContentHeight=Math.max(l,null!==(i=this.di.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){ks(Yn,"scroll",this.hi,{capture:!0}),ks(Yn,"scrollend",this.hi,{capture:!0}),ks(Yn,"resize",this.hi)}scrollElement(){if(!this.ci)return null==Yn?void 0:Yn.document.documentElement;var e=Sr(this.ci)?this.ci:[this.ci];for(var t of e){var r=null==Yn?void 0:Yn.document.querySelector(t);if(r)return r}}vi(e){var t="y"===e?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[t]||0}return Yn?"y"===e?Yn.scrollY||Yn.pageYOffset||Yn.document.documentElement.scrollTop||0:Yn.scrollX||Yn.pageXOffset||Yn.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var Yf=e=>Gd(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class Xf{constructor(e,t,r,i){this.fi=e=>{var t=this.pi();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.gi(this._instance)};this.mi.register({[Hu]:r})}},this._instance=e,this.yi=t,this.mi=r,this.gi=i||Yf,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Hu]}getSetOnceProps(){var e,t=null==(e=this.pi())?void 0:e.props;return t?"r"in t?Qd(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return ps(_s(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+br(r)]=t})),e}}class ep{on(e,t){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(t),()=>{this.bi[e]=this.bi[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.bi[e]||[])r(t);for(var i of this.bi["*"]||[])i(e,t)}constructor(){this.bi={}}}var tp=vs("[SessionId]");class rp{on(e,t){return this.wi.on(e,t)}constructor(e,t,r){var i;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new ep,this.Ti=(e,t)=>!(!Lr(e)||!Lr(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===eh)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ii=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=t||ph,this.Ri=r||ph;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Vr(this.Te.session_idle_timeout_seconds||1800,60,36e3,tp.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+n+"_window_id",this.Fi="ph_"+n+"_primary_window_exists",this.Li()){var s=Oh.F(this.Oi),o=Oh.F(this.Fi);s&&!o?this.Ii=s:Oh.P(this.Oi),Oh.q(this.Fi,!0)}if(null!=(i=this.Te.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){tp.error("Invalid sessionID in bootstrap",e)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Mr(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ii),()=>{this.ki=this.ki.filter((t=>t!==e))}}Li(){return"memory"!==this.Te.persistence&&!this.mi.yr&&Oh.N()}Ni(e){e!==this.Ii&&(this.Ii=e,this.Li()&&Oh.q(this.Oi,e))}Di(){return this.Ii?this.Ii:this.Li()?Oh.F(this.Oi):null}qi(e){var t=this.xi;return!Pr(t)&&!Pr(e)&&5e3>Math.abs(e-t)}$i(e,t,r){var i=t!==this._sessionActivityTimestamp,n=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Mi=e,n&&!i||n&&this.qi(t)||(this.xi=t,this.mi.register({[yu]:[t,e,r]}))}ji(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return Lr(t)&&t>0}Hi(){this.ji()?this.mi.refreshKey(yu):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!Pr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var t=this.Ui();t[1]===this.Mi&&t[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[yu]:[this._sessionActivityTimestamp,null!==(e=this.Mi)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],t=Lr(e)?e:0,r=Lr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,r)}Vi(e){return this.Hi(),this.Ti(e,this.zi())}Ui(){var e=this.mi.props[yu];return Sr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&Yn&&(Yn.removeEventListener(sh,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Oh.P(this.Fi)},ks(Yn,sh,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Te.cookieless_mode===eh)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),i=this.Ui(),n=i[1],s=i[2],o=this.zi(),a=this.Di(),l=Lr(s)&&Math.abs(r-s)>864e5,u=!1,h=!1,d=!n,c=n,v=!d&&!e&&this.Ti(r,o);if(v){(v=this.Vi(r))||tp.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Ui();n=f[1],s=f[2]}d||v||l?(n=this.Ei(),a=this.Ri(),tp.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l}}),s=r,u=!0):(a||(a=this.Ri(),u=!0),(h=n!==c)&&(tp.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=Lr(o)&&e&&!l?o:r,g=Lr(s)?s:(new Date).getTime();this.Ni(a),this.$i(n,p,g),e||this.Pi();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.ki.forEach((e=>e(n,a,m))),{sessionId:n,windowId:a,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:o}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi((new Date).getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var ip=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&gr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>gr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver};function np(){return np=t((function*(){var e=null==es?void 0:es.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return Er(r)&&r.length>0?r:void 0}catch(e){return void cs.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})),np.apply(this,arguments)}var sp="custom",op="i.posthog.com",ap=/^\/static\//;class lp{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+op,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":sp),this.Zi[this.apiHost]}Gi(e){if(ap.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this.Gi(t);if(r)return""+r+t}if(this.region===sp)return this.apiHost+t;var i=op+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var up=vs("[PostHog ExternalIntegrations]"),hp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class dp{constructor(e){this._instance=e}er(e,t){var r;null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return up.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(){var t,i,n,s=r[0],o=r[1];!o||null!=(t=ta.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[s]||e.er(hp[s],(()=>{var t;null==(t=ta.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[s])||t.start(e._instance)})),!o&&null!=(i=ta.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=ta.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var r of Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{})){var i;t()}}}var cp={},vp=0,fp=()=>{},pp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',gp="Surveys module not available",mp="sanitize_properties is deprecated. Use before_send instead",yp="Invalid value for property_denylist config: ",bp=["token","distinct_id",Gu],_p="posthog",wp=!Ff&&-1===(null==as?void 0:as.indexOf("MSIE"))&&-1===(null==as?void 0:as.indexOf("Mozilla")),xp=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:xs(null==ts?void 0:ts.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:fp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:rs&&Er(null==rs?void 0:rs.search)&&-1!==rs.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yn||null==(t=Yn.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){cs.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ih,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Zf},error_tracking:{},_onCapture:fp},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:so,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)}))(e))},kp=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],Sp=e=>{var t={};for(var r of kp){var i=r[0],n=r[1];Mr(e[i])||(t[n]=e[i])}var s=gs({},t,e),o=e.__preview_external_dependency_versioned_paths;return Mr(o)||(Mr(e.strict_script_versioning)&&(s.strict_script_versioning=!!o),Er(o)&&Mr(e.asset_host)&&(s.asset_host=o)),Sr(e.property_blacklist)&&(Mr(e.property_denylist)?s.property_denylist=e.property_blacklist:Sr(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:cs.error(yp+e.property_denylist)),s};class Cp{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){cs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Tp{Ji(e,t){if(e){var r=this.Ki.indexOf(e);-1!==r&&this.Ki.splice(r,1)}return this.Ki.push(t),null==t.initialize||t.initialize(),t}Yi(){return this.config.cookieless_mode===eh||this.config.cookieless_mode===Xu&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new Cp,this.Xi=!1,this.version=hs.LIB_VERSION,this.en=new ep,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=xp(),this.SentryIntegration=jv,this.sentryIntegration=e=>function(e,t){var r=qv(e,t);return{name:Dv,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new Kf(this),this.pageViewManager=new Hv(this),this.rateLimiter=new Kv(this),this.requestRouter=new lp(this),this.consent=new Ov(this),this.externalIntegrations=new dp(this);var t=null!==(e=Tp.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=Er(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=Er(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>cs.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==_p){var i,n=null!==(i=cp[r])&&void 0!==i?i:new Tp;return n._init(e,t,r),cp[r]=n,cp[_p][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;void 0===t&&(t={});var o=Er(e)?e.trim():"";if(!o)return cs.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=xp(t.defaults),t.debug=this.an(t.debug),this.ln=t,this.un=[],t.person_profiles?this.nn=t.person_profiles:t.process_person&&(this.nn=t.process_person);var a=xp(t.defaults),l=Sp(t),u=gs({},a,l,{name:i,token:o});Tr(a.rageclick)&&Tr(l.rageclick)&&(u.rageclick=gs({},a.rageclick,l.rageclick)),Tr(a.session_recording)&&Tr(l.session_recording)&&(u.session_recording=gs({},a.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&cs.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:yl;var h=this.hn();this.persistence=new Qv(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Qv(r({},this.config,{persistence:"sessionStorage"}),h,!1);var d=r({},this.persistence.props),c=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.dn=new Gf((e=>this.cn(e)),this.config.request_queue_config),this.vn=new Jf(this),this.__request_queue=[];var v=this.Yi();if(v||(this.sessionManager=new rp(this),this.sessionPropsManager=new Xf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(cs.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(v)}),0)):(cs.info("Initializing extensions synchronously"),this.fn(v)),hs.DEBUG=hs.DEBUG||this.config.debug,hs.DEBUG&&cs.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var f=t.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(ju);if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===th)this.identify(f);else if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===rh)cs.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var m=this.config.get_device_id(ph()),y=t.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(ju,t.bootstrap.isIdentifiedID?rh:th),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:Zu,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(ph());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(ju,th)}return ks(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||ph();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(ju,rh)),t()},n=r.user();"then"in n&&Cr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||Nv.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Nv.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Nv.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,oh),identify:e=>t(e,lh),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this.pn())):this.pn(),Cr(this.config._onCapture)&&this.config._onCapture!==fp&&(cs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&cs.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return np.apply(this,arguments)}().then((e=>{e&&this.register({[eu]:e})})).catch(fp),this}fn(e){var t,i,n,s,o,a,l,u,h=performance.now(),d=r({},Tp.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.Ki.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new d.featureFlags(this)),d.exceptions&&this.Ki.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Ki.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ki.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ki.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.Ki.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Ki.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.Ki.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.Ki.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Ki.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Ki.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ki.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ki.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,$v)),d.toolbar&&this.Ki.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Ki.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Ki.forEach((e=>{e.initialize&&c.push((()=>{null==e.initialize||e.initialize()}))})),c.push((()=>{if(this.gn){var e=this.gn;this.gn=void 0,this.Hr(e)}})),this.mn(c,h)}mn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.mn(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){cs.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[Qu]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ju]:i}),this.config.__preview_deferred_init_extensions&&cs.info("PostHog extensions initialized ("+i+"ms)")}Hr(e){if(!ts||!ts.body)return cs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var t,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=mr(r.supportedCompression,yl)?yl:mr(r.supportedCompression,bl)?bl:void 0),null!=(t=r.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:ih}),this.Ki.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(e){cs.critical("`loaded` function failed",e)}if(this.bn(),this.config.internal_or_test_user_hostname&&null!=rs&&rs.hostname){var e=rs.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new Xv(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.dn)||e.enable())}_dom_loaded(){this.is_capturing()&&fs(this.__request_queue,(e=>this.cn(e))),this.__request_queue=[],this.bn()}_handle_unload(){var e,t,r,i,n;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(ah),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.dn)||i.unload(),null==(n=this.vn)||n.unload()):this.xn()&&this.capture(ah,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?wp?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Mr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(t=s.transport)&&void 0!==t?t:"fetch";"sendBeacon"===d&&Mr(s.compression)&&s.data&&(s.compression=bl),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=Sr(o=s.data)?o:[o])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Sr(e)?e.map((e=>r({},e,{sent_at:t}))):r({},e,{sent_at:t})}(s.data))),s.url=Vf(s.url,s.method,s.compression,s.timestampMode);var c=Wf.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),v=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(c,(e=>e.transport===d)))?void 0:n.method)&&void 0!==i?i:c[0].method;if(!v)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===yl&&os&&"undefined"!=typeof Promise&&!$f?Hf(s).then((e=>{v(e)})).catch((t=>{if(dr(t))return $f=!0,void v(r({},s,{compression:void 0,url:Vf(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return dr(e)||t===lr})(t)&&($f=!0),v(s)})):v(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){vp++;try{var t,r=[],i=[],n=[];fs(e,(e=>{if(e)if(Sr(t=e[0]))n.push(e);else if(Cr(e))try{e.call(this)}catch(t){cs.error("Error executing queued PostHog call",e,t)}else Sr(e)&&"alias"===t?r.push(e):Sr(e)&&-1!==t.indexOf("capture")&&Cr(this[t])?n.push(e):i.push(e)}));var s=function(e,t){fs(e,(function(e){try{if(Sr(e[0])){var r=t;ps(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){cs.error("Error executing queued PostHog call",e,t)}}))};s(r,this),s(i,this),s(n,this)}finally{vp--}}push(e){if(vp>0&&Sr(e)&&Er(e[0])){var t=Tp.prototype[e[0]];Cr(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!Mr(e)&&Er(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=t&&t.$current_url&&!Er(null==t?void 0:t.$current_url)&&(cs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.kn||cs.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,c=(null==i?void 0:i.timestamp)||d,v=Xi(null==i?void 0:i.uuid,ph),f={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},c,v)};e===oh&&this.config.__preview_capture_bot_pageviews&&u&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var p="$feature_flag_called"===e&&!1===f.properties.$feature_flag_has_experiment&&!0===this.get_property(Tu);(null==i?void 0:i.$set)&&!p&&(f.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(f.$unset=g);var m=p?void 0:this.Sn(null==i?void 0:i.$set_once,e!==uh,e===lh);if(m&&(f.$set_once=m),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=e=>Er(e)?e.slice(0,s):e,l=new Set,f=function e(t,r){if(t!==Object(t))return a?a(t):t;if(!l.has(t)){var i;if(l.add(t),Sr(t))i=[],fs(t,(t=>{i.push(e(t))}));else{var n={};ps(t,((t,r)=>{l.has(t)||(n[r]=e(t,r))})),i=n}return i}}(o)),f.timestamp=c,Mr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=d),p&&(f.properties=function(e,t){void 0===t&&(t=[]);var r={},i=t=>{void 0!==e[t]&&(r[t]=e[t])};return tr.forEach(i),t.forEach(i),r}(f.properties,bp)),e===El.DISMISSED||e===El.SENT){var y=null==t?void 0:t[Rl.SURVEY_ID],b=null==t?void 0:t[Rl.SURVEY_ITERATION];Ql({id:y,current_iteration:b}),f.$set=r({},f.$set,{[$l({id:y,current_iteration:b},e===El.SENT?"responded":"dismissed")]:!0})}else e===El.SHOWN&&(f.$set=r({},f.$set,{[Rl.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var _=null==t?void 0:t.$product_tour_type;_&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=r({},f.properties.$set,f.$set);if(Ir(w)||this.setPersonPropertiesForFlags(w),!Or(this.config.before_send)){var x=this.wt(f);if(!x)return;(f=x).uuid=Xi(f.uuid,ph)}this.en.emit("eventCaptured",f);var k=null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),S={method:"POST",url:k,data:f,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(k)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.cn(S):this.dn.enqueue(S),f}cs.critical("This capture call is ignored due to client rate limiting.")}}else cs.error("No event name provided to posthog.capture")}else cs.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Yi()&&(a[Gu]=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Er(a.distinct_id)&&!Fr(a.distinct_id)||Rr(a.distinct_id))&&cs.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(e,t,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!as)return{};var l,u=e?[...Dd,...t||[]]:[],h=function(e){for(var t=0;Qi.length>t;t++){var r=Qi[t],i=r[1],n=r[0].exec(e),s=n&&(Cr(i)?i(n,e):i);if(s)return s}return["",""]}(as),d=h[0],c=h[1],v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Mr(r)||(f.detectGoogleSearchApp=r);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==Yn||null==(o=Yn.screen)?void 0:o.width,b=null==Yn||null==(a=Yn.screen)?void 0:a.height,_=null==Yn?void 0:Yn.devicePixelRatio;Mr(g)||(p.userAgentDataPlatform=g),Mr(m)||(p.maxTouchPoints=m),Mr(y)||(p.screenWidth=y),Mr(b)||(p.screenHeight=b),Mr(_)||(p.devicePixelRatio=_);var w,x=gs(_s({$os:d,$os_version:c,$browser:Wi(as,navigator.vendor,v,f),$device:Ji(as),$device_type:Ki(as,p),$timezone:Jd(),$timezone_offset:Kd()}),{$current_url:Es(i?en(null==rs?void 0:rs.href):null==rs?void 0:rs.href,u,jd),$host:null==rs?void 0:rs.host,$pathname:null==rs?void 0:rs.pathname,$raw_user_agent:as.length>1e3?as.substring(0,997)+"...":as,$browser_version:Gi(as,navigator.vendor,v,f),$browser_language:Vd(),$browser_language_prefix:(w=Vd(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==Yn?void 0:Yn.screen.height,$screen_width:null==Yn?void 0:Yn.screen.width,$viewport_height:null==Yn?void 0:Yn.innerHeight,$viewport_width:null==Yn?void 0:Yn.innerWidth,$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return hs.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=hs.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime()),c=d.windowId;a.$session_id=d.sessionId,a.$window_id=c}this.sessionPropsManager&&gs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&gs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.vn)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===sp&&(a.$lib_custom_api_host=this.config.api_host),u=e!==oh||s?e!==ah||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gs(a,u),e===oh&&ts&&(a.title=ts.title),!Mr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}as&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();ps(["$referrer","$referring_domain"],(e=>{e in p&&delete g[e]})),(a=gs({},h,p,g,a)).$is_identified=this._isIdentified(),Sr(this.config.property_denylist)?ps(this.config.property_denylist,(function(e){delete a[e]})):cs.error(yp+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(cs.error(mp),a=m(a,e));var y=this.Cn();return a.$process_person_profile=y,y&&!s&&this.Tn("_calculate_event_properties"),a}Sn(e,t,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.Cn())return e;if(this.Xi&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=gs({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(cs.error(mp),o=a(o,"$set_once")),t&&(this.Xi=!0),Ir(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}In(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t))&&void 0!==r?r:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.en.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:gp}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:gp})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:gp})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=Kl),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:gp}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:gp})}Mn(e){return!e||Rr(e)?(cs.critical("Unique user id has not been set in posthog.identify"),!1):e===Zu?(cs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(cs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return cs.uninitializedWarning("posthog.identify");if(Fr(e)&&(e=e.toString(),cs.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.Tn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Xl)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(tu)&&(this.unregister(tu),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(ju)||th)===th;e!==i&&s?(this.persistence.set_property(ju,rh),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(lh,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this.sn=yh(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(Au))}}setPersonProperties(e,t){if((e||t)&&this.Tn("posthog.setPersonProperties")){var r=yh(this.get_distinct_id(),e,t);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.sn=r):cs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(Sr(e)?e:[e]).filter((e=>Er(e)&&e.length>0));0!==r.length&&this.Tn("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,t,i){if(e&&t){var n=this.getGroups(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(uh,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else cs.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.Tn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l,u,h;if(cs.info("reset"),!this.__loaded)return cs.uninitializedWarning("posthog.reset");var d,c=this.get_property(Xl),v=this.get_property(eu),f=this.get_property(cu);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),Mr(f)||null==(d=this.persistence)||d.register({[cu]:f}),null==(i=this.surveys)||i.reset(),null==(n=this.wn)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(ju,th),null==(h=this.sessionManager)||h.resetSessionId(),this.sn=null,this.config.cookieless_mode===eh)this.register_once({distinct_id:Zu,$device_id:null},"");else{var p=this.config.get_device_id(ph());this.register_once({distinct_id:p,$device_id:e?p:c},""),e||Mr(v)||this.register({[eu]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var r=this;return t((function*(){var e,t,i,n,s;r.__loaded?(null==(e=r.logs)||e.flushLogs("sendBeacon"),null==(t=r.metrics)||t.flush("sendBeacon"),null==(i=r.dn)||i.unload(),null==(n=r.vn)||n.unload(),null==(s=r.featureFlags)||s.destroy()):cs.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(e,t){return e===this.get_property(Yl)?(cs.critical("Attempting to create alias for existing People user - aborting."),-2):this.Tn("posthog.alias")?(Mr(t)&&(t=this.get_distinct_id()),e!==t?(this.In(tu,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(cs.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Tr(e)){var i,n,s,o,a,l,u,h,d,c,v;gs(this.config,Sp(e));var f=this.hn();null==(i=this.persistence)||i.update_config(this.config,t,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Qv(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.an(this.config.debug);$r(p)&&(this.config.debug=p),$r(this.config.debug)&&(this.config.debug?(hs.DEBUG=!0,Ih.N()&&Ih.q("ph_debug",!0),cs.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(hs.DEBUG=!1,Ih.N()&&Ih.P("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.Pn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){hs.LIB_NAME=e,hs.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Tp.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:_p;return t!==_p&&(t=_p+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(ju))===rh||(null==(t=this.sessionPersistence)?void 0:t.get_property(ju))===rh}Cn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===ih&&!this._isIdentified()&&Ir(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tu])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Wu]))}xn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Cn()||this.Tn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Tn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Tn(e){return"never"===this.config.person_profiles?(cs.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(Wu,!0),!0)}hn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Xu)}Pn(){var e,t,r,i,n=this.hn();return(null==(e=this.persistence)?void 0:e.yr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.yr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==eh){if(this.Yi()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new rp(this),this.pageViewManager=new Hv(this),this.persistence&&(this.sessionPropsManager=new Xf(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Tp.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.Ji(this.sessionRecording,new l(this)),this.yn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.yn)))}var u,h;this.consent.optInOut(!0),this.Pn(),this.bn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==Xu&&(null==(u=this.surveys)||u.loadIfEnabled()),(Mr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else cs.warn(pp)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==eh?(this.config.cookieless_mode===Xu&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Xu&&(this.register({distinct_id:Zu,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):cs.warn(pp)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===eh||(this.config.cookieless_mode===Xu?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return es?ip(es,this.config.custom_blocked_useragents):void 0}_n(){ts&&("visible"===ts.visibilityState?this.tn||(this.tn=!0,this.capture(oh,{title:ts.title},{send_instantly:!0}),this.rn&&(ts.removeEventListener(nh,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),ks(ts,nh,this.rn)))}debug(e){!1===e?(null==Yn||Yn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Yn||Yn.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(cs.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,r,i,n){var s=t in e&&!Or(e[t]),o=r in e&&!Or(e[r]);return s?e[t]:!!o&&(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r])}(e,"advanced_disable_flags","advanced_disable_decide",0,cs)}wt(e){var t;if(Or(this.config.before_send))return e;var r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Dr),i=Sr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var s of i){if(n=s(n),Or(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Nr(e.event)?cs.warn(o+". This can cause unexpected behavior."):cs.info(o),null}n.properties&&!Ir(n.properties)||cs.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Or(n.properties[a]))return cs.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var e;return null==(e=this.pageViewManager.ir)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}an(e){var t=$r(e)&&!e,r=Ih.N()&&"true"===Ih.A("ph_debug");return!t&&(!!r||e)}}Tp.__defaultExtensionClasses={},Tp.On=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=bs(e.prototype[t[r]])}(Tp,["identify"]);var Ip=vs("[ExceptionAutocapture]"),Mp=vs("[TracingHeaders]"),Ep=vs("[Web Vitals]"),Rp=9e5,Pp="disabled",Op="lazy_loading",Fp="awaiting_config",Lp="missing_config";vs("[SessionRecording]"),vs("[SessionRecording]");var $p="[SessionRecording]",Ap=vs($p),Np=vs("[Heatmaps]");function Dp(e){return Tr(e)&&"clientX"in e&&"clientY"in e&&Fr(e.clientX)&&Fr(e.clientY)}var qp=vs("[Product Tours]"),jp=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(hu))},Hp=["$set_once","$set"],Bp=vs("[SiteApps]"),Up="Error while initializing PostHog app with config id ";function zp(e,t,r){if(Or(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class Vp{constructor(e){this.Fn=new ep,this.Ln=(e,t)=>this.$n(e,t)&&this.An(e,t)&&this.Nn(e,t)&&this.Dn(e,t),this.$n=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,t;Mr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!Mr(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this.jn)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.qn)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.qn.has(e)||this.qn.has(t.event))&&this.jn&&(null==(r=this.jn)?void 0:r.size)>0&&this.jn.forEach((e=>{this.Hn(t,e)&&this.Fn.emit("actionCaptured",e.name)}))}Bn(e){this.onAction("actionCaptured",(t=>e(t)))}Hn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,t){return this.Fn.on(e,t)}An(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!zp(i,t.url,t.url_matching||"contains"))return!1}return!0}Nn(e,t){return!!this.Un(e,t)&&!!this.zn(e,t)&&!!this.Vn(e,t)}Un(e,t){var r;if(null==t||!t.href)return!0;var i=this.Wn(e);if(i.length>0)return i.some((e=>zp(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&zp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}zn(e,t){var r;if(null==t||!t.text)return!0;var i=this.Wn(e);if(i.length>0)return i.some((e=>zp(e.text,t.text,t.text_matching||"exact")||zp(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!Or(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>zp(e,s,o))))}Vn(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}Wn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Dn(e,t){return null==t||!t.properties||0===t.properties.length||wh(t.properties.reduce(((e,t)=>{var r=Sr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class Wp{constructor(e){var t;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId((e=>this.Kn(e)))}Yn(e,t){return!!e&&wh(e.propertyFilters,null==t?void 0:t.properties)}Xn(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}es(e,t,r){var i=(r===_l?this.Gn:this.Qn).get(e),n=[];return this.ts((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Yn(s,t)}))}register(e){var t;Mr(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==t.length&&(null==this.ss&&(this.ss=new Vp(this._instance),this.ss.init(),this.ss.Bn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ss)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this.Jn.get(t.name);r&&r.push(e.id),this.Jn.set(t.name,r||[e.id])}})))})))}rs(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Gn=this.Xn(e,_l),this.Qn=this.Xn(e,wl))}onEvent(e,t){var r,i,n=this.os(),s=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(i=t.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.ls(e,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.us([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:e,itemId:s}),void this.hs(s)}if(this.Qn.has(e)){var a=this.es(e,t,wl);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map((e=>e.id))}),this.us(a.map((e=>e.id))),a.forEach((e=>this.ds(e.id))))}if(this.Gn.has(e)){n.info("event name matched",{event:e,eventPayload:t,items:this.Gn.get(e)});var l=this.es(e,t,_l);this.cs(l.map((e=>e.id)))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){0!==e.length&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter((t=>t!==e));var t=this.vs();t.includes(e)||(this.fs([...t,e]),this.ps())}us(e){var t=new Set(e);this.Zn=this.Zn.filter((e=>!t.has(e)));var r=this.gs(),i=r.filter((e=>!t.has(e)));i.length!==r.length&&(this.fs(i),0===i.length&&this.ys())}gs(){var e,t=this.bs();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}vs(){var e,t,r=this.gs();if(0===r.length)return[];var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._s()],n=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return n&&i===n?r:[]}ps(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.ws(t)}ys(){this.xs()}Kn(e){var t,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((e=>!this.ks(e)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class Zp extends Wp{constructor(e){super(e)}bs(){return Fu}_s(){return Lu}Cs(){return El.SHOWN}ts(e){var t;null==(t=this._instance)||t.getSurveys(e)}ds(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}os(){return Bl}fs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[Fu]:e})}ws(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[Lu]:e})}xs(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Lu)}ks(){return!1}ls(e,t){var r;return this.ts((e=>{r=e.find((e=>e.id===t))})),!r||Hl(r)?e===El.SHOWN?"consume":"ignore":e===El.SHOWN?"persist":e===El.DISMISSED||e===El.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Gp="SDK is not enabled or survey functionality is not yet loaded",Qp="Disabled. Not loading surveys.",Jp=null!=Yn&&Yn.location?Rs(Yn.location.hash,"__posthog")||Rs(location.hash,"state"):null,Kp="_postHogToolbarParams",Yp=vs("[Toolbar]"),Xp=vs("[FeatureFlags]"),eg=vs("[FeatureFlags]",{debugEnabled:!0}),tg="\" failed. Feature flags didn't load in time.",rg=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},ig=e=>{var t={};for(var r of ms(e||{})){var i=r[1];i&&(t[r[0]]=i)}return t},ng="Refusing to render web experiment since the viewer is a likely bot",sg={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>mh(t,e),not_regex:(e,t)=>!mh(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class og{get Te(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{og.Ts("retrieved web experiments from the server"),t.Is=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t.Is&&(og.Ts("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.Is)||r.set(e.feature_flag_key,e));var i=t._instance.getFeatureFlag(e.feature_flag_key);Er(i)&&e.variants[i]&&t.Ms(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];og.Es(s,t._instance)&&t.Ms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())og.Ts(ng);else if(!this.Te.disable_web_experiments){if(Or(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();og.Ts("applying feature flags",e),e.forEach((e=>{var t;if(this.Is&&null!=(t=this.Is)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.Is)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Ms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=og.getWindowLocation();if(null!=e&&e.search){var t=Ms(null==e?void 0:e.search,"__experiment_id"),r=Ms(null==e?void 0:e.search,"__experiment_variant");t&&r&&(og.Ts("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Rs(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Te.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Rs(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(og.Ts("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Ms(i[0].name,t,i[0].variants[t].transforms))}static Es(e,t){return!Or(e.conditions)&&og.Ps(e,t)&&og.Os(e)}static Ps(e,t){var r;if(Or(e.conditions)||Or(null==(r=e.conditions)?void 0:r.url))return!0;var i=og.getWindowLocation();if(i){var n,s,o,a=As(t,i.href);return null==(n=e.conditions)||!n.url||sg[null!==(s=null==(o=e.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](e.conditions.url,a)}return!1}static getWindowLocation(){return null==Yn?void 0:Yn.location}static Os(e){var t;if(Or(e.conditions)||Or(null==(t=e.conditions)?void 0:t.utm))return!0;var r=Bd();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Ts(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];cs.info("[WebExperiments] "+e,r)}Ms(e,t,r){this._is_bot()?og.Ts(ng):"control"!==t?r.forEach((r=>{if(r.selector){var i;og.Ts("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):og.Ts("Control variants leave the page unmodified.")}_is_bot(){return es&&this._instance?ip(es,this.Te.custom_blocked_useragents):void 0}}var ag=vs("[Conversations]"),lg="Conversations not available yet.",ug="console",hg={featureFlags:class{constructor(e){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],Yn&&ks(Yn,"online",this.Bs)}destroy(){null==Yn||Yn.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(e){return this._instance.get_property(e)}Vs(){var e,t;return null!==(e=null==(t=this.mi)?void 0:t._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==e&&e}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,Xp.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var e,t=null!==(e=this.Te.evaluation_contexts)&&void 0!==e?e:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(Xp.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Xp.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}Gs(){return this.Zs().length>0}Qs(){var e=this.Te.flag_keys;if(!Mr(e)){if(Sr(e))return e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Xp.error("Invalid flag key found:",e,"Expected non-empty string"),t}));Xp.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,r=this._instance.config,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.zs(_u))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.zs(Su))&&void 0!==s?s:{},l=r({},o,e),u=r({},a,t),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:Yt(v),variant:Xt(v),reason:void 0,metadata:Mr(null==u?void 0:u[c])?void 0:{id:0,version:void 0,description:void 0,payload:u[c]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.zs(ku),t=this.zs(Iu),i=this.zs(Mu);if(!i&&!t)return e||{};var n=gs({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],h=null==t?void 0:t[o],d=Mr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Mr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:d,variant:d?null!=c?c:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),c!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.Fs||(Xp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.Fs=!0),n}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((r=>{var i=e[r];return{key:r,enabled:Yt(i),variant:Xt(i),payload:Kt(t[r])}}))}getFlagVariants(){var e=this.zs(_u),t=this.zs(Iu);if(!t)return e||{};for(var r=gs({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Fs||(Xp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Fs=!0),r}getFlagPayloads(){var e=this.zs(Su),t=this.zs(Mu);if(!t)return e||{};for(var r=gs({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Fs||(Xp.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Fs=!0),r}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.en.emit("featureFlagsReloading",!0),this.Js=setTimeout((()=>{this.Ks()}),5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.As=e}Ks(e){var t;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var i=this.Te.token,n=this.zs(Xl),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this.mi)?void 0:t.get_initial_props())||{},this.zs(Eu)||{},{$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION}),group_properties:this.zs(Ru),timezone:Jd()};Pr(n)||Mr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var o=this.Qs();Mr(o)||(s.flag_keys=o);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Te.disable_compression?void 0:bl,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(this.Xs(e.statusCode),200===e.statusCode&&(this.Ns||(this.$anon_distinct_id=void 0),n=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.mi)||i.register({[Du]:o}),u)Xp.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks())}}})}}Us(){return Ps(this.Hs,3)}Xs(e){this.Hs=Os(e,this.Hs,3,(()=>Xp.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Xp.warn('getFeatureFlag for key "'+e+tg)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this.zs(Cu)||void 0,l=this.zs(qu)||void 0,u=this.zs(Au)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.zs(Nu);d&&d!==c&&(u={},null==(h=this.mi)||h.register({[Au]:u,[Nu]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var v,f,p,g,m,y,b,_,w,x,k;Sr(u[e])?u[e].push(o):u[e]=[o],null==(v=this.mi)||v.register({[Au]:u});var S=this.getFeatureFlagDetails(e),C=[...null!==(f=this.zs(Du))&&void 0!==f?f:[]];Mr(n)&&C.push("flag_missing");var T={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Te.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Te.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[e])||null,$used_bootstrap_value:!this.Ds};Mr(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(T.$feature_flag_has_experiment=S.metadata.has_experiment),Mr(null==S||null==(y=S.metadata)?void 0:y.version)||(T.$feature_flag_version=S.metadata.version);var I,M=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;M&&(T.$feature_flag_reason=M),null!=S&&null!=(x=S.metadata)&&x.id&&(T.$feature_flag_id=S.metadata.id),Mr(null==S?void 0:S.original_variant)&&Mr(null==S?void 0:S.original_enabled)||(T.$feature_flag_original_response=Mr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(T.$feature_flag_original_payload=null==S||null==(I=S.metadata)?void 0:I.original_payload),C.length&&(T.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",T)}if(i)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:Kt(s)}}}else Xp.warn('getFeatureFlagResult for key "'+e+tg)}getRemoteConfigPayload(e,t){var r=this.Te.token,i={distinct_id:this._instance.get_distinct_id(),token:r,person_properties:{$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION}};this.Gs()&&(i.evaluation_contexts=this.Zs());var n=this.Qs();Mr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Te.disable_compression?void 0:bl,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.Ds)return t.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return Xp.warn('isFeatureEnabled for key "'+e+tg),t.defaultValue;var r=this.getFeatureFlag(e,t);return Mr(r)?t.defaultValue:!!r}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this.mi){this.Ls=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):e.featureFlags&&Xp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=e.requestId,c=e.evaluatedAt;if(Sr(u)){Xp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;t&&t.register({[wu]:u,[_u]:v,[Tu]:!1})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((e=>y.has(e[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>y.has(e[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((e=>y.has(e[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);t&&t.register(r({[wu]:Object.keys(ig(p)),[_u]:p||{},[Su]:g||{},[ku]:m||{},[Tu]:!0===e.minimalFlagCalledEvents},d?{[Cu]:d}:{},c?{[qu]:c}:{}))}}}(e,this.mi,n,s,o,i),t||(this.js=!1),this.eo(t)}}override(e,t){void 0===t&&(t=!1),Xp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.mi)return Xp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.mi.unregister(Iu),this.mi.unregister(Mu),this.eo(),eg.info("All overrides cleared");if(Sr(e)){var t=rg(e);return this.mi.register({[Iu]:t}),this.eo(),eg.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this.Fs=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.mi.unregister(Iu),eg.info("Flag overrides cleared");else if(i.flags){if(Sr(i.flags)){var n=rg(i.flags);this.mi.register({[Iu]:n})}else this.mi.register({[Iu]:i.flags});eg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.mi.unregister(Mu),eg.info("Payload overrides cleared")):i.payloads&&(this.mi.register({[Mu]:i.payloads}),eg.info("Payload overrides set",{payloads:i.payloads}))),void this.eo()}if(e&&"object"==typeof e)return this.mi.register({[Iu]:e}),this.eo(),eg.info("Flag overrides set",{flags:e});Xp.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Ls){var t=this.ro(),r=t.flags,i=t.flagVariants;try{e(r,i)}catch(e){Xp.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this.zs(xu)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this.mi)||n.register({[wu]:Object.keys(ig(l)),[_u]:l}),this.eo()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this.zs(xu),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+n),method:"GET",timestampMode:"query",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this.mi)||r.unregister(xu),null==(i=this.mi)||i.register({[xu]:n}),e(n)}}})}ro(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}eo(e){var t=this.ro(),r=t.flags,i=t.flagVariants;this.featureFlagEventHandlers.forEach((t=>{try{t(r,i,{errorsLoading:e})}catch(e){Xp.error("Error while running feature flags callback",e)}}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.zs(Eu)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Eu]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=r({},this.zs(Eu)||{});e.forEach((e=>{delete i[e]})),this._instance.register({[Eu]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(Eu),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.zs(Ru)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Ru]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.zs(Ru)||{};this._instance.register({[Ru]:r({},t,{[e]:{}})})}else this._instance.unregister(Ru)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},dg={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var e;return!(null==(e=this.io)||!e.isStarted)}get status(){var e,t;return this.no===Fp||this.no===Lp?this.no:null!==(e=null==(t=this.io)?void 0:t.status)&&void 0!==e?e:this.no}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=Pp,this.so=void 0,this._instance=e,!this._instance.sessionManager)throw Ap.error("started without valid sessionManager"),new Error($p+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===eh)throw new Error($p+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var e,t=!(null==(e=this._instance.get_property(cu))||!e.enabled),r=!this.Te.disable_session_recording,i=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.oo||null==(t=this.io)||!t.isStarted){var r=!Mr(Object.assign)&&!Mr(Array.from);this.oo&&r?(this.ao(e),Ap.info("starting")):(this.no=Pp,this.stopRecording())}}ao(e){var t,r,i;this.oo&&(this.no!==Fp&&this.no!==Lp&&(this.no=Op),null!=ta&&null!=(t=ta.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=ta.__PosthogExtensions__)&&r.initSessionRecording?this.lo(e):null==(i=ta.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.uo,(t=>{if(t)return Ap.error("could not load recorder",t);this.lo(e)})))}stopRecording(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.stop()}ho(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.discard()}do(){var e,t;null==(e=this.mi)||e.unregister(bu),null==(t=this.mi)||t.unregister(vu)}co(e,t){if(Or(e))return null;var r,i=Fr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Ap.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}vo(e){if(this.mi){var t,i,n=this.mi,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.co(null==(t=this.Te.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this.co(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Or(a)&&this.do();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[cu]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Mr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.so)||t.call(this),this.so=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.vo(t),void this.ho()):(this.vo(t),void this.startIfEnabledOrStop()):(this.no===Fp&&(this.no=Lp,Ap.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.io)&&r.log?this.io.log(e,t):Ap.warn("log called before recorder was ready")}get uo(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(cu);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}fo(){var e,t,r=this._instance.get_property(cu);if(!r)return!1;try{t="object"==typeof r?r:JSON.parse(r)}catch(e){return Ap.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var i=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-i}lo(e){var t,r;if(null==(t=ta.__PosthogExtensions__)||!t.initSessionRecording)return Ap.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ku]:!0});if(this.io||(this.io=null==(r=ta.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo()){if(this.no===Lp||this.no===Fp)return;return this.no=Fp,Ap.info("persisted remote config is stale, requesting fresh config before starting"),void new Xv(this._instance).load()}this.no=Op,this.io.start(e)}onRRwebEmit(e){var t;null==(t=this.io)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.io||null==(t=this.mi)||t.register({[pu]:!0}),null==(e=this.io)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.io||null==(t=this.mi)||t.register({[fu]:!0}),null==(e=this.io)||e.overrideSampling()}overrideTrigger(e){var t,r;this.io||null==(r=this.mi)||r.register({["url"===e?gu:mu]:!0}),null==(t=this.io)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.io)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.io)||!r.tryAddCustomEvent(e,t))}}},cg={autocapture:class{constructor(e){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=e,this.rageclicks=new gv(e.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var e,t,r=Tr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}wo(){if(this.isBrowserSupported()){if(Yn&&ts){var e=e=>{e=e||(null==Yn?void 0:Yn.event);try{this.xo(e)}catch(e){yv.error("Failed to capture event",e)}};if(ks(ts,"submit",e,{capture:!0}),ks(ts,"change",e,{capture:!0}),ks(ts,"click",e,{capture:!0}),this.Te.capture_copied_text){var t=e=>{e=e||(null==Yn?void 0:Yn.event);try{this.xo(e,mv)}catch(e){yv.error("Failed to capture copy/cut event",e)}};ks(ts,"copy",t,{capture:!0}),ks(ts,"cut",t,{capture:!0})}}}else yv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(e){if(this.yo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.bo=t.elementsChainAsString);var r=t.autocapture_opt_out;$r(r)&&(this.instance.persistence&&this.instance.persistence.register({[iu]:r}),this.mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this._o=e}getElementSelectors(e){var t,r=[];return null==(t=this._o)||t.forEach((t=>{var i=null==ts?void 0:ts.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[iu],i=this.mo,n=this.instance.Ur()&&!this.yo;if(Pr(i)&&!$r(r)&&!n)return!1;var s=null!==(t=this.mo)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!s}xo(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Xs(e);Vs(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&ho(i,this.instance.config.rageclick)&&this.xo(e,"$rageclick");var n=t===mv;if(i&&function(e,t,r,i,n,s){var o;if(!Yn||co(e))return!1;if(null!=r&&r.url_allowlist&&!Qs(r.url_allowlist,s))return!1;if(null!=r&&r.url_ignorelist&&Qs(r.url_ignorelist,s))return!1;if(null!=r&&r.dom_event_allowlist){var a=r.dom_event_allowlist;if(a&&!a.some((e=>t.type===e)))return!1}var l=vo(e,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Mr(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!to(h,null==r?void 0:r.css_selector_allowlist))return!1;if(to(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:io))return!1;try{var d=Yn.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return u?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(eo.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.Te,n,n?["copy","cut"]:void 0,this.instance)){var s=wv(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=s.props;if(s.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),t===mv){var l,u=Ks(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Cr(null==ts?void 0:ts.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ko=(null==Yn||null==(t=Yn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(cs.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,cs.info("History API monitoring stopped")}monitorHistoryChanges(){Yn&&Yn.history&&(this.Co("pushState"),this.Co("replaceState"),this.To())}Co(e){var t;if(Yn&&(null==(t=Yn.history[e])||!t.__posthog_wrapped__)){var r=this;Ls(Yn.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.Io(e)}))}}Io(e){try{var t,r=null==Yn||null==(t=Yn.location)?void 0:t.pathname;if(!r)return;r!==this.ko&&this.isEnabled&&this._instance.capture(oh,{navigation_type:e}),this.ko=r}catch(t){cs.error("Error capturing "+e+" pageview",t)}}To(){if(!this.So){var e=()=>{this.Io("popstate")};ks(Yn,"popstate",e),this.So=()=>{Yn&&Yn.removeEventListener("popstate",e)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(e){var t;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=e,this.Mo=!(null==(t=this.instance.persistence)||!t.props[nu]),this.rageclicks=new gv(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Tr(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(e=this.Te.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Or(this.Te.capture_heatmaps)?Or(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.po)return;Np.info("starting..."),this.Ro(),this.ke()}else{var e;clearInterval(null!==(e=this.Eo)&&void 0!==e?e:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[nu]:r}),this.Mo=r,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Oo(e){Dp(e.originalEvent)&&this.pe(e.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(ts)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){Yn&&ts&&(this.Fo=this.oi.bind(this),ks(Yn,sh,this.Fo),this.Lo=e=>this.pe(e||(null==Yn?void 0:Yn.event)),ks(ts,"click",this.Lo,{capture:!0}),this.$o=e=>this.Ao(e||(null==Yn?void 0:Yn.event)),ks(ts,"mousemove",this.$o,{capture:!0}),this.No=new Av(this.instance,Lv,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),ks(ts,nh,this.Do),this.po=!0)}Po(){var e;Yn&&ts&&(this.Fo&&Yn.removeEventListener(sh,this.Fo),this.Lo&&ts.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&ts.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&ts.removeEventListener(nh,this.Do),clearTimeout(this.qo),null==(e=this.No)||e.stop(),this.po=!1)}jo(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&Us(i)&&!zs(i,"body");){if(i===r)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:Yn)?void 0:s.getComputedStyle(i).position}catch(e){return!1}if(mr(t,n))return!0;i=ro(i)}return!1}(Xs(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}pe(e,t){var i;if(void 0===t&&(t="click"),!Bs(e.target)&&Dp(e)){var n=this.jo(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&ho(Xs(e),this.instance.config.rageclick)&&this.Nt(r({},n,{type:"rageclick"})),this.Nt(n)}}Ao(e){!Bs(e.target)&&Dp(e)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Nt(this.jo(e,"mousemove"))}),500))}Nt(e){if(Yn){var t=this.Te.disable_capture_url_hashes?en(Yn.location.href):Yn.location.href,r=this.Te.custom_personal_data_properties,i=this.Te.mask_personal_data_properties?[...Dd,...r||[]]:[],n=Es(t,i,jd);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(e)}}oi(){this.R&&!Ir(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Av,webVitalsAutocapture:class{constructor(e){var t;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=e=>{var t;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.zo();if(!Mr(i))if(Or(null==e?void 0:e.name)||Or(null==e?void 0:e.value))Ep.error("Invalid metric received",e);else if(!this.Vo||this.Vo>e.value){this.R.url!==i&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Mr(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Mr(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=r({},e,{$current_url:i,timestamp:Date.now()});Mr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else Ep.error("Ignoring metric with value >= "+this.Vo,e)},this.Wo=()=>{if(!this.po){var e,t,r,i,n=ta.__PosthogExtensions__;if(!Mr(n)&&!Mr(n.postHogWebVitalsCallbacks)){var s=n.postHogWebVitalsCallbacks;e=s.onLCP,t=s.onCLS,r=s.onFCP,i=s.onINP}e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Uo.bind(this)),this.po=!0):Ep.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Mo=!(null==(t=this._instance.persistence)||!t.props[lu]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=Tr(this.Zo)?null==(e=this.Zo)?void 0:e.web_vitals_allowed_metrics:void 0;return Or(r)?(null==(t=this._instance.persistence)?void 0:t.props[du])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Tr(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Tr(this.Zo)?this.Zo.web_vitals_attribution:void 0;return null!=e&&e}get Vo(){var e=Tr(this.Zo)&&Fr(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:Rp;return e>0&&6e4>=e?Rp:e}get isEnabled(){var e=null==rs?void 0:rs.protocol;if("http:"!==e&&"https:"!==e)return Ep.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Tr(this.Zo)?this.Zo.web_vitals:$r(this.Zo)?this.Zo:void 0;return $r(t)?t:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Ep.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var r=Tr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,i=Tr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[lu]:r}),this._instance.persistence.register({[du]:i})),this.Mo=r,this.startIfEnabled()}}}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?Ep.error("failed to load script",t):e()}))}zo(){var e=Yn?this._instance.config.disable_capture_url_hashes?en(Yn.location.href):Yn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Dd,...t||[]]:[];return Es(e,r,jd)}Ep.error("Could not determine current URL")}}},vg={exceptionObserver:class{constructor(e){var t;this.Wo=()=>{var e;if(Yn&&this.isEnabled&&null!=(e=ta.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=ta.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ta.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ta.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=t(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=r(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=i(this.captureException.bind(this)))}catch(e){Ip.error("failed to start",e),this.Ko()}}},this._instance=e,this.Yo=!(null==(t=this._instance.persistence)||!t.props[su]),this.Xo=new Wr(r({},function(e){var t,r,i,n;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(r=e.exceptionRateLimiterRefillRate)&&void 0!==r?r:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(i=null!==(n=e.exceptionRateLimiterBucketSize)&&void 0!==n?n:e.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,Ge:Ip})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Tr(e)?t=r({},t,e):(Mr(e)?this.Yo:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ip.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Ip.error("failed to load script",t);e()}))}Ko(){var e,t,r;null==(e=this.Go)||e.call(this),this.Go=void 0,null==(t=this.Qo)||t.call(this),this.Qo=void 0,null==(r=this.Jo)||r.call(this),this.Jo=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Yo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[su]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}captureException(e){var t,r,i,n=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.Xo.consumeRateLimit(n)?Ip.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.ta=[],this.ra=wc(),this._instance=e,this.ta=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(ou))&&void 0!==t?t:[],this.ia=Qn(this.na()),this.sa=new Jn(this.ia)}onConfigChange(){this.ia=Qn(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(e){var t,r,i;if(e.ok){var n=e.config;if("errorTracking"in n){var s=null!==(t=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.ta=s,this._instance.persistence&&this._instance.persistence.register({[ou]:this.ta,[au]:o})}}}get oa(){var e,t=!!this._instance.get_property(au),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.ra.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ia.enabled)try{if(!Er(e)||0===e.trim().length)return void _c.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>Zn.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(this.aa(t)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&_c.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(r({[Vn]:e,[Wn]:(new Date).toISOString()},n))}catch(e){_c.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.la(t)){if(this.ua(t))return this.ha("Exception dropped: matched a suppression rule"),void _c.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(t))return this.ha("Exception dropped: thrown by a browser extension"),void _c.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(t))return this.ha("Exception dropped: thrown by the PostHog SDK"),void _c.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ia.enabled&&Or(e.$exception_steps)?this.va(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return i&&this.sa.clear(),i}catch(e){return _c.error("Failed to capture exception event. Dropping this exception.",e),void this.sa.clear()}}catch(e){return void _c.error("Failed to process exception event. Ignoring this exception.",e)}}va(e){try{var t=this.sa.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return _c.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}ha(e){this.ia.enabled&&this.sa.add({[Vn]:e,[Wn]:(new Date).toISOString()})}aa(e){return Tr(e)?r({},e):{}}na(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}ua(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var r=t.type,i=t.value;return Er(r)&&r.length>0&&e.$exception_types.push(r),Er(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.ta.some((e=>{var r=e.values.map((e=>{var r,i=bh[e.operator],n=Sr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}da(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ca(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}la(e){return!Or(e)&&Sr(e)}}},fg=r({productTours:class{get mi(){return this._instance.persistence}constructor(e){this.fa=null,this.pa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if("productTours"in t){var r,i;if(this.mi&&this.mi.register({[hu]:!!t.productTours}),!jp(this._instance))return!this.fa&&Or(null==(r=this.mi)?void 0:r.props[$u])||qp.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.fa)||i.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&jp(this._instance)&&this.er((()=>this.ga()))}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?qp.error("Could not load product tours script",t):e()}))}ga(){var e;!this.fa&&null!=(e=ta.__PosthogExtensions__)&&e.generateProductTours&&(this.fa=ta.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Sr(this.pa)||t){var r=this.mi;if(r){var i=r.props[$u];if(Sr(i)&&!t)return this.pa=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:t=>{if(jp(this._instance)){var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return qp.error(n),void e([],{isLoaded:!1,error:n})}var s=Sr(t.json.product_tours)?t.json.product_tours:[];this.pa=s,r&&r.register({[$u]:s}),e(s,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.pa,{isLoaded:!0})}getActiveProductTours(e){Or(this.fa)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.fa)||t.showTourById(e)}previewTour(e){this.fa?this.fa.previewTour(e):this.er((()=>{var t;this.ga(),null==(t=this.fa)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this.fa)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.fa)||e.nextStep()}previousStep(){var e;null==(e=this.fa)||e.previousStep()}clearCache(){var e;this.pa=null,null==(e=this.mi)||e.unregister($u)}resetTour(e){var t;null==(t=this.fa)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.fa)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.fa)||t.cancelPendingTour(e)}}},hg),pg={siteApps:class{constructor(e){this.ma=0,this._instance=e,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(e,t){if(t){var r=this.globalsForEvent(t);this.ya.push(r),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var e;return null==(e=ta._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{e(),this.ya=[],this._a=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var v of Object.entries(c)){var f=v[0];h[f]={id:d[f],type:f,properties:v[1]}}var p=e.$set_once,g=e.$set;return{event:r({},i(e,Hp),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}wa(e){var t,r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Bp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Bp.error("prepare_external_dependency_script returned null"),null):e}xa(){var e,t,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==ts?void 0:ts.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],d=this,c=new WeakSet,v=(e,t,r)=>{if(null!=e&&e[t]){var i=e[t];e[t]=r(i),h.push((()=>{e[t]=i}))}},f=e=>{if(c.has(e))return e;var t=d.wa(e);return t&&c.add(t),t},p=e=>e.map((e=>"string"==typeof e?e:f(e))).filter((e=>!Pr(e)));return v(u,"appendChild",(e=>function(t){var r=f(t);return r?e.call(this,r):t})),v(u,"insertBefore",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):t})),v(u,"replaceChild",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):r})),[null==(t=l.Element)?void 0:t.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((e=>{v(e,"append",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"prepend",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((e=>{v(e,"before",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"after",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"replaceWith",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:e.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(e=>function(t,r){var i=f(r);return i?e.call(this,t,i):null})),this.ka=()=>{h.forEach((e=>e())),this.ka=void 0},this.Sa()}Sa(){var e=!1;return()=>{var t;e||(e=!0,this.ma--,0===this.ma&&(null==(t=this.ka)||t.call(this)))}}Ca(e,t){void 0===t&&(t=!0);var r=this.xa();try{var i=e(r);return t&&r(),i}catch(e){throw r(),e}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.ya.length&&(Bp.info("Processing "+this.ya.length+" events for site app with id "+e.id),this.ya.forEach((e=>this.Ca((()=>null==t.processEvent?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&(null==(r=this._a)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,Bp.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Ca((t=>e.init({posthog:this._instance,callback(e){t(),n(e)}})),!1).processEvent;s&&(t.processEvent=s),i=!0}catch(t){Bp.error(Up+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){Bp.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Ta(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Ia(e){var t=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(e),i=function(i){try{t.Ca((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(t){Bp.error("Error while processing event "+e.event+" for site app "+i.id,t)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Ta(),void this._instance.on("eventCaptured",(e=>this.Ia(e)))):void Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._a)||r.call(this),e.ok){var s=e.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var e,t=a.id,r=a.url;ta["__$$ph_site_app_"+t]=n._instance,null==(e=ta.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,r,(e=>{if(e)return Bp.error(Up+t,e)}))};for(var a of s.siteApps)o()}else Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},gg={tracingHeaders:class{constructor(e){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,t,r=this.Pa();r?(Mr(this.Ma)&&(this.Ma=null==(e=ta.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Mr(this.Ea)&&(this.Ea=null==(t=ta.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=e}initialize(){this.startIfEnabledOrStop()}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Mp.error("failed to load script",t);e()}))}Oa(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Pa(){var e=this.Oa();return Sr(e)?(Sr(this.Ra)?this.Ra.splice(0,this.Ra.length,...e):this.Ra=[...e],e.length>0?this.Ra:void 0):(Sr(this.Ra)&&this.Ra.splice(0),this.Ra=e||void 0,this.Ra)}Ko(){var e,t;null==(e=this.Ma)||e.call(this),null==(t=this.Ea)||t.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},mg=r({surveys:class{get Te(){return this._instance.config}constructor(e){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Te.disable_surveys){if(!e.ok)return Bl.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Or(t))return Bl.warn("Flags not loaded yet. Not loading surveys.");var r=Sr(t);this.Fa=r?t.length>0:t,Bl.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Vl)||null!=i&&i.startsWith(Wl))&&t.push(i)}t.forEach((e=>localStorage.removeItem(e)))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.La)Bl.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Bl.info(Qp);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Bl.info("Not loading surveys in cookieless mode without consent.");else{var e=null==ta?void 0:ta.__PosthogExtensions__;if(e){if(!Mr(this.Fa)||this.Te.advanced_enable_surveys){var t=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var r=e.generateSurveys;if(r)return void this.Da(r,t);var i=e.loadExternalDependency;if(!i)return void this.qa(Yu);i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.qa("Could not load surveys script",r):this.Da(e.generateSurveys,t)}))}catch(e){throw this.qa("Error initializing surveys",e),e}finally{this.La=!1}}}else Bl.error("PostHog Extensions not found.")}}Da(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Zp(this._instance),Bl.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(e,t){Bl.error(e,t),this.ja({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$a.push(e),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Te.disable_surveys)return Bl.info(Qp),e([]);var r,i=this._instance.get_property(Pu);if(i&&!t)return e(i,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.Aa?this.Aa.then((t=>e(t.surveys,t.context))):("undefined"!=typeof Promise&&(this.Aa=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:t=>{var i;this.Aa=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Bl.error(s),this.Na=Date.now();var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}this.Na=null;var a,l=t.json.surveys||[],u=l.filter((e=>Ul(e)&&(jl(e)||zl(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[Pu]:l,[Ou]:Date.now()});var h={isLoaded:!0};e(l,h),null==r||r({surveys:l,context:h})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var e=this._instance.get_property(Ou);return Fr(e)&&Date.now()-e>3e5}Ua(){return Fr(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(e,t){var r,i={id:e,current_iteration:null!==(r=null==t?void 0:t.iteration)&&void 0!==r?r:null};Ql(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}ja(e){for(var t of this.$a)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Bl.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Or(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Bl.warn("init was not called")}za(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}Va(e){if(Or(this._surveyManager))return{eligible:!1,reason:Gp};var t="string"==typeof e?this.za(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Wa(e){if(Or(this._surveyManager))return{eligible:!1,reason:Gp};var t="string"==typeof e?this.za(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Or(this._surveyManager))return Bl.warn("init was not called"),{visible:!1,disabledReason:Gp};var t=this.Wa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Or(this._surveyManager)?(Bl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Gp})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this.Wa(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(Or(this._surveyManager))Bl.warn("init was not called");else{var n="string"==typeof e?this.za(e):e;if(null!=n&&n.id)if(Jl.includes(n.type)){var s=null==ts?void 0:ts.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Bl.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Bl.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),Bl.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Bl.warn("Survey element not found")}else Bl.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Bl.warn("Survey not found")}}displaySurvey(e,t){var i;if(Or(this._surveyManager))Bl.warn("init was not called");else{var n=this.za(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Pl&&t.initialResponses&&Bl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.Va(n);if(!o.eligible)return void Bl.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Bl.warn("Survey not found")}}cancelPendingSurvey(e){Or(this._surveyManager)?Bl.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},hg),yg={toolbar:class{constructor(e){this.instance=e}Za(e){ta.ph_toolbar_state=e}Ga(){var e;return null!==(e=ta.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),Ss(this.instance.config))return!1;if(!Yn||!ts)return!1;e=null!=e?e:Yn.location,r=null!=r?r:Yn.history;try{if(!t){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(e){return!1}t=null==Yn?void 0:Yn.localStorage}var i,n=Jp||Rs(e.hash,"__posthog")||Rs(e.hash,"state"),s=n?ys((()=>JSON.parse(atob(decodeURIComponent(n)))))||ys((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(Kp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}Qa(e){var t=ta.ph_load_toolbar||ta.ph_load_editor;!Or(t)&&Cr(t)?t(e,this.instance):Yp.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==ts||!ts.getElementById(Ds));if(!Yn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yn.localStorage.setItem(Kp,JSON.stringify(r({},n,{source:void 0}))),2===this.Ga())this.Qa(n);else if(0===this.Ga()){var s;this.Za(1),null==(s=ta.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return Yp.error("[Toolbar] Failed to load",e),void this.Za(0);this.Za(2),this.Qa(n)})),ks(Yn,"turbolinks:load",(()=>{this.Za(0),this.loadToolbar(n)}))}return!0}Ja(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},bg=r({experiments:og},hg),_g={conversations:class{constructor(e){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&e.ok){var t=e.config.conversations;Or(t)||($r(t)?this.Ka=t:(this.Ka=t.enabled,this.Xa=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||Ss(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==ta?void 0:ta.__PosthogExtensions__;if(e&&!Mr(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var t=e.initConversations;if(t)return this.el(t),void(this.Ya=!1);var r=e.loadExternalDependency;if(!r)return void this.tl(Yu);r(this._instance,"conversations",(t=>{t||!e.initConversations?this.tl("Could not load conversations script",t):this.el(e.initConversations),this.Ya=!1}))}catch(e){this.tl("Error initializing conversations",e),this.Ya=!1}}else ag.error("Conversations enabled but missing token in remote config.")}}el(e){if(this.Xa)try{this._conversationsManager=e(this.Xa,this._instance),ag.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else ag.error("Cannot complete initialization: remote config is null")}tl(e,t){ag.error(e,t),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():ag.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ka&&!Pr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(ag.warn(lg),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(ag.warn(lg),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(ag.warn(lg),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(ag.warn(lg),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(ag.warn(lg),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(ag.warn(lg),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ag.warn(lg),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}En(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Rn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},wg={logs:class{constructor(e){var t;this.rl=!1,this.il=!1,this.Ge=vs("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var e,t;this.Hs=0,null==(e=this.ol)||e.onReconnect(),null==(t=this.al)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.rl=!0),Yn&&ks(Yn,"online",this.sl)}ll(e,t,r,i){var n,s=function(e,t){var r,i,n,s,o,a,l,u=null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==e?void 0:e.maxBufferSize)&&void 0!==i?i:100,d=null!=t&&t.consoleCapture?void 0:null!==(n=null==e?void 0:e.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Mr(d)?Math.max(h,2048):Math.max(h,d),v=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==s?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new dn(this.ul(e,t),s,this.Ge,(()=>this.hl()),(e=>e()),void 0,i),s]}dl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.ol||this.cl!==t){var r;null==(r=this.ol)||r.reset(),this.cl=t;var i=this.ll((()=>this.Gr),(e=>{this.Gr=e}));this.ol=i[0],this.vl=i[1]}return this.ol}fl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.al||this.pl!==t){var r;null==(r=this.al)||r.reset(),this.pl=t;var i=this.ll((()=>this.nl),(e=>{this.nl=e}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ug);this.al=i[0],this.gl=i[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var r=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!Or(r)&&r&&(this.rl=!0,this.loadIfEnabled())}}reset(){var e,t;this.Gr=[],null==(e=this.ol)||e.reset(),this.nl=[],null==(t=this.al)||t.reset(),this.Hs=0}captureLog(e){this.dl().captureLog(e)}le(e){this.fl().captureLog(e)}get logger(){return this.ml||(this.ml={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ml}flushLogs(e){e?this.yl(e):(this.ol&&this.ol.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))),this.al&&this.al.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.rl&&!this.il){var e=null==ta?void 0:ta.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.Ge.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.il=!0)})):this.Ge.error(Yu)}else this.Ge.error("PostHog Extensions not found.")}}ul(e,t){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===rr.LogsQueue?e():void 0,setPersistedProperty(e,r){var i;e===rr.LogsQueue&&t(null!==(i=r)&&void 0!==i?i:[])},Tt:e=>this.Tt(e),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Tt(e){return new Promise((t=>{if(Ps(this.Hs,3))t({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,i=e=>{r||(r=!0,clearTimeout(n),t(e))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.bl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;if(this._l(t),t>=200&&300>t)i({kind:"ok"});else if(413===t)i({kind:"too-large"});else if(0!==t&&429!==t&&500>t)i({kind:"fatal",error:new Error("logs request failed with status "+t)});else{var r;i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+t)})}}})}}))}_l(e){(0!==e||this._instance.__loaded)&&(this.Hs=Os(e,this.Hs,3,(()=>this.Ge.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}yl(e){this.Gr.length>0&&this.wl(e,this.Gr,this.vl,hs.LIB_NAME,(e=>{this.Gr=e})),this.nl.length>0&&this.wl(e,this.nl,this.gl,ug,(e=>{this.nl=e}))}wl(e,t,r,i,n){if(0!==t.length){var s=t.map((e=>e.record));n([]);var o=hn(s,un(r,hs.LIB_NAME,hs.LIB_VERSION),i,hs.LIB_VERSION);this._instance._send_request({method:"POST",url:this.bl(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,n=r.sessionStartTimestamp,s=r.lastActivityTimestamp;t.sessionId=r.sessionId,t.windowId=i,Or(n)||(t.sessionStartTimestamp=n),Or(s)||(t.lastActivityTimestamp=s)}if(null!=ta&&null!=(e=ta.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?en(ta.location.href):ta.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},xg={metrics:class{constructor(e){this.Ge=vs("[metrics]"),this._instance=e}initialize(){}dl(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.ol&&this.cl===r||(null==(t=this.ol)||t.reset(),this.cl=r,this.ol=new pn(this.ul(),function(e){var t,r,i,n,s,o=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==o?void 0:o["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==e?void 0:e.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.Ge)),this.ol}count(e,t,r){void 0===t&&(t=1),this.dl().count(e,t,r)}gauge(e,t,r){this.dl().gauge(e,t,r)}histogram(e,t,r){this.dl().histogram(e,t,r)}flush(e){if(!this.ol)return Promise.resolve();if(e){var t=this.ol.drainWindow();return t&&this.Bt(t,e),Promise.resolve()}return this.ol.flush().catch((e=>this.Ge.error("PostHog metrics flush failed:",e)))}reset(){var e;null==(e=this.ol)||e.reset()}ul(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Bt:e=>t.Bt(e),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Bt(e,t){return new Promise((i=>{var n=!1,s=e=>{n||(n=!0,clearTimeout(o),i(e))},o=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(r({method:"POST",url:this.xl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;if(t>=200&&300>t)s({kind:"ok"});else if(413===t)s({kind:"too-large"});else if(0!==t&&429!==t&&500>t)s({kind:"fatal",error:new Error("metrics request failed with status "+t)});else{var r;s({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("metrics request failed with status "+t)})}}}))}))}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},kg=r({},hg,dg,cg,vg,fg,pg,mg,gg,yg,bg,_g,wg,xg);Tp.__defaultExtensionClasses=r({},kg),function(){hs.SDK_DIST_CHANNEL="cdn";var e=cp[_p]=new Tp,t=ta.posthog;t&&ps(t._i,(function(r){if(r&&Sr(r)){var i=e.init(r[0],r[1],r[2]),n=t[r[2]]||t;i&&(i._execute_array.call(i.people,n.people),i._execute_array(n))}})),ta.posthog=e,function(){function e(){e.done||(e.done=!0,wp=!1,ps(cp,(function(e){e._dom_loaded()})))}null!=ts&&ts.addEventListener?"complete"===ts.readyState?e():ks(ts,"DOMContentLoaded",e,{capture:!1}):Yn&&cs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}()}();
1
+ !function(){"use strict";function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(l||{}),u=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(u||{}),h=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(h||{}),d=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(d||{}),c=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(c||{}),v=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(v||{}),f=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(e){if(m[e])return m[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in p?p[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in g?g[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return m[e]=t.prototype,t.prototype;var a=document.createElement("iframe");a.style.display="none";var l,u=!1;try{document.body.appendChild(a);var h=a.contentWindow;if(!h)return t.prototype;var d=h[e].prototype;return d?((l=navigator.userAgent).includes("Safari")&&!l.includes("Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",e),u=!0),m[e]=d):r}catch(e){return r}finally{!u&&a.parentNode&&document.body.removeChild(a)}}var b={};function _(e,t,r){var i,n=e+"."+String(r);if(b[n])return b[n].call(t);var s=y(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(t)):t[r]}var w={};function x(e,t,r){var i=e+"."+String(r);if(w[i])return w[i].bind(t);var n=y(e)[r];return"function"!=typeof n?t[r]:(w[i]=n,n.bind(t))}function k(){return y("MutationObserver").constructor}function S(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n={next:i},s=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),e[t]=s,()=>{if(e[t]!==s)for(var r=e[t];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else e[t]=n.next}}catch(e){return()=>{}}}var C={childNodes:e=>_("Node",e,"childNodes"),parentNode:e=>_("Node",e,"parentNode"),parentElement:e=>_("Node",e,"parentElement"),textContent:e=>_("Node",e,"textContent"),contains:(e,t)=>x("Node",e,"contains")(t),getRootNode:e=>x("Node",e,"getRootNode")(),host:e=>e&&"host"in e?_("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null,querySelector:(e,t)=>x("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>x("Element",e,"querySelectorAll")(t),mutationObserver:k,patch:S};function T(e){return e.nodeType===e.ELEMENT_NODE}function I(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function M(e){return"[object ShadowRoot]"==={}.toString.call(e)}function E(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(i=Array.from(t,(e=>R(e,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function R(e,t){var r;if(function(e){return"styleSheet"in e}(e)){var i;try{i=E(e.styleSheet)||function(e){var t=e.cssText;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return H(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?H(n,t):n}class P{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),T(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function O(e){var t=e.element,r=e.maskInputOptions,i=e.tagName,n=e.type,s=e.maskInputFn,o=e.value||"",a=n&&F(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,t):"*".repeat(o.length)),o}function F(e){return e.toLowerCase()}var L="__rrweb_original__";function A(e){try{var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?F(t):null}catch(e){return null}}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function H(e,t){return(e||"").replace(N,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(D.test(l)||q.test(l))return"url("+u+l+u+")";if(j.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var B,U,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(e,t){return t&&""!==t.trim()?ee(e,t):t}function ee(e,t){var r=Y.get(e);if(r||(r=e.createElement("a"),Y.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function te(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?z:e}(e,t.maxBase64ImageLength):e}function re(e,t,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=X(e,i);if(l.startsWith("data:")){if("img"===t&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(e,t,r,i){if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>V||e.naturalHeight>V)return t;try{var n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(e,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):t}catch(e){return t}}(n,l,s.type,s.quality)),te(u,s)}if("image"===t)return te(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=X(e,i);return"image"===t&&h.startsWith("data:")?te(h,s):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),t.length>r;){var s=i(J);if(","===s.slice(-1))s=X(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?H(i,ee(e)):"object"===t&&"data"===r?X(e,i):i:X(e,i)}function ie(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ne(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ne(C.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&ne(C.parentNode(e),t,r)}function se(e,t,r,i){var n;if(T(e)){if(!C.childNodes(n=e).length)return!1}else{if(null===C.parentElement(e))return!1;n=C.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(ne(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function oe(e,t,r){var i=e.removeEventListener;"function"==typeof i&&i.call(e,t,r)}var ae=new Map;function le(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function ue(e){return null==e?"":e.toLowerCase()}var he=50,de=!1,ce=!1;function ve(e,t){var r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.maskTextClass,a=t.maskTextSelector,l=t.skipChild,u=void 0!==l&&l,h=t.inlineStylesheet,d=void 0===h||h,c=t.maskInputOptions,v=void 0===c?{}:c,p=t.maskTextFn,g=t.maskInputFn,m=t.slimDOMOptions,y=t.dataURLOptions,b=void 0===y?{}:y,_=t.inlineImages,w=void 0!==_&&_,x=t.recordCanvas,k=void 0!==x&&x,S=t.onSerialize,R=t.onIframeLoad,P=t.iframeLoadTimeout,N=void 0===P?5e3:P,D=t.onIframeListenerRegistered,q=t.onStylesheetLoad,j=t.stylesheetLoadTimeout,z=void 0===j?5e3:j,V=t.keepIframeSrcFn,W=void 0===V?()=>!1:V,J=t.newlyAddedElement,K=void 0!==J&&J,Y=t.depth,X=void 0===Y?0:Y,te=t.maxDepth,ne=void 0===te?he:te,fe=t.needsMask,pe=t.preserveWhiteSpace,ge=void 0===pe||pe;if(X>=ne)return ce=!0,de||(de=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+ne+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;fe||(fe=se(e,o,a,void 0===fe));var me,ye=function(e,t){var r=t.doc,i=t.blockClass,n=t.blockSelector,s=t.needsMask,o=t.inlineStylesheet,a=t.maskInputOptions,l=void 0===a?{}:a,u=t.maskTextFn,h=t.maskInputFn,d=t.dataURLOptions,c=void 0===d?{}:d,v=t.inlineImages,p=t.recordCanvas,g=t.keepIframeSrcFn,m=t.newlyAddedElement,y=void 0!==m&&m,b=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:f.Document,childNodes:[],compatMode:e.compatMode}:{type:f.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,s,o=t.doc,a=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,h=t.maskInputFn,d=t.dataURLOptions,c=void 0===d?{}:d,v=t.inlineImages,p=t.recordCanvas,g=t.keepIframeSrcFn,m=t.newlyAddedElement,y=void 0!==m&&m,b=t.rootId,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,t.blockClass,t.blockSelector),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=F(e.tagName);return Z.test(t)?"div":t}(e),x={},k=e.attributes.length,S=0;k>S;S++){var T=e.attributes[S];ie(w,T.name)||(x[T.name]=re(o,w,F(T.name),T.value,e,c))}if("link"===w&&a){var I=e.sheet;if(!I){var M=function(e){return e.href}(e);M&&!(I=le(o,M))&&M.includes(".css")&&(I=le(o,window.location.origin+"/"+M.replace(window.location.href,"")))}var R=null;I&&(R=E(I)),R&&(delete x.rel,delete x.href,x._cssText=R)}if("style"===w&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var P=E(e.sheet);P&&(x._cssText=P)}if("input"===w||"textarea"===w||"select"===w){var N=e.value,D=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&N?x.value=O({element:e,type:A(e),tagName:w,value:N,maskInputOptions:u,maskInputFn:h}):D&&(x.checked=D)}if("option"===w&&(e.selected&&!u.select?x.selected=!0:delete x.selected),"dialog"===w&&e.open)try{x.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}if("canvas"===w&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((L in n?n[L]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var q=e.toDataURL(c.type,c.quality),j=o.createElement("canvas");j.width=e.width,j.height=e.height,q!==j.toDataURL(c.type,c.quality)&&(x.rr_dataURL=q)}if("img"===w&&v){B||(B=o.createElement("canvas"),U=B.getContext("2d"));var H=e,z=H.currentSrc||H.getAttribute("src")||"<unknown-src>",V=H.crossOrigin,W=()=>{oe(H,"load",W);try{B.width=H.naturalWidth,B.height=H.naturalHeight,U.drawImage(H,0,0),x.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==H.crossOrigin)return H.crossOrigin="anonymous",void(H.complete&&0!==H.naturalWidth?W():H.addEventListener("load",W));console.warn("Cannot inline img src="+z+"! Error: "+e)}"anonymous"===H.crossOrigin&&(V?x.crossOrigin=V:H.removeAttribute("crossorigin"))};H.complete&&0!==H.naturalWidth?W():H.addEventListener("load",W)}if("audio"===w||"video"===w){var G=x;G.rr_mediaState=e.paused?"paused":"played",G.rr_mediaCurrentTime=e.currentTime,G.rr_mediaPlaybackRate=e.playbackRate,G.rr_mediaMuted=e.muted,G.rr_mediaLoop=e.loop,G.rr_mediaVolume=e.volume}if(y||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop)),_){var Q=e.getBoundingClientRect(),J=Q.width,K=Q.height,Y=Q.left,X=Q.top,ee=null==(r=o.defaultView)?void 0:r.getComputedStyle(e);x={class:x.class,rr_width:J+"px",rr_height:K+"px",rr_left:Math.floor(Y+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(X+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},ee&&(x.rr_position=ee.position||"static",ee.transform&&"none"!==ee.transform&&(x.rr_transform=ee.transform),ee.display&&ee.display.startsWith("inline")&&(x.rr_display=ee.display))}"iframe"!==w||g(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src);try{customElements.get(w)&&(s=!0)}catch(e){}return{type:f.Element,tagName:w,attributes:x,childNodes:[],isSVG:(te=e,Boolean("svg"===te.tagName||te.ownerSVGElement)||void 0),needBlock:_,rootId:b,isCustom:s};var te}(e,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case e.TEXT_NODE:return function(e,t){var r,i=t.needsMask,n=t.maskTextFn,s=t.rootId,o=C.parentNode(e),a=o&&o.tagName,l=C.textContent(e),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(e.nextSibling||e.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=E(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=H(l,ee(t.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(e)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:s,maskTextFn:u,rootId:b});case e.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(e)||"",rootId:b};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,keepIframeSrcFn:W,newlyAddedElement:K});if(!ye)return console.warn(e,"not serialized"),null;me=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===f.Comment)return!0;if(e.type===f.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ue(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ue(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ue(e.attributes.property).match(/^(og|twitter|fb):/)||ue(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ue(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(ue(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ue(e.attributes.name))||ue(e.attributes.property).match(/^article:/)||ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ue(e.attributes.name)))return!0}}return!1}(ye,m)||!ge&&ye.type===f.Text&&!ye.isStyle&&!ye.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var be=Object.assign(ye,{id:me});if(i.add(e,be),me===G)return null;S&&S(e);var _e=!u;if(be.type===f.Element){_e=_e&&!be.needBlock,delete be.needBlock;var we=C.shadowRoot(e);we&&M(we)&&(be.isShadowHost=!0)}if((be.type===f.Document||be.type===f.Element)&&_e){m.headWhitespace&&be.type===f.Element&&"head"===be.tagName&&(ge=!1);var xe={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:ge,onSerialize:S,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:W,depth:X+1,maxDepth:ne};if(be.type===f.Element&&"textarea"===be.tagName&&void 0!==be.attributes.value);else for(var ke of Array.from(C.childNodes(e))){var Se=ve(ke,xe);Se&&be.childNodes.push(Se)}var Ce=null;if(T(e)&&(Ce=C.shadowRoot(e)))for(var Te of Array.from(C.childNodes(Ce))){var Ie=ve(Te,xe);Ie&&(M(Ce)&&(Ie.isShadow=!0),be.childNodes.push(Ie))}}var Me=C.parentNode(e);if(Me&&I(Me)&&M(Me)&&(be.isShadow=!0),be.type===f.Element&&"iframe"===be.tagName){var Ee=function(e,t,r){var i,n=()=>{},s=e.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),oe(e,"load",h),e.addEventListener("load",o),t())},h=()=>u();return l=setTimeout(u,r),e.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?oe(e,"load",o):(a=!0,oe(e,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(e){return n}if(d!==c||e.src===c||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),oe(e,"load",o)}}return e.addEventListener("load",o),()=>{oe(e,"load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&R){var r=ve(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:ge,onSerialize:S,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:W,depth:X+1,maxDepth:ne});r&&R(e,r)}}),N);null==D||D(e,Ee)}return be.type===f.Element&&"link"===be.tagName&&"stylesheet"===be.attributes.rel&&function(t,l,u){if(!ae.has(t)){var h;try{h=t.sheet}catch(e){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(q){var t=ve(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:fe,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,preserveWhiteSpace:ge,onSerialize:S,onIframeLoad:R,iframeLoadTimeout:N,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:W,depth:X,maxDepth:ne});t&&q(e,t)}})()}finally{ae.delete(t),c.abort()}}},_=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),t.addEventListener("load",y,{signal:c.signal,once:!0}),ae.set(t,c)}}}(e,0,z),be}function fe(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class pe{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof pe))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function ge(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>me(r,e,t,i)}function me(e,t,r,i){ye((()=>{var n=e.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(e,t,r,i):n.call(e,t,r))}))}function ye(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var be="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",_e={map:{},getId(){return console.error(be),-1},getNode(){return console.error(be),null},removeNodeFromMap(){console.error(be)},has(){return console.error(be),!1},reset(){console.error(be)}};function we(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}}function xe(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){if(setTimeout((()=>{try{r.set.call(this,e)}catch(e){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(e){return}s.set.call(this,e)}}}),()=>xe(e,t,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_e=new Proxy(_e,{get(e,t,r){return"map"===t&&console.error(be),Reflect.get(e,t,r)}}));var ke=Date.now;function Se(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=C.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ce(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Te(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function Me(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ne(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Ee(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===G}function Re(e,t){if(I(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=C.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||Re(i,t))}function Pe(e){return Boolean(e.changedTouches)}function Oe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Le(e){return!!e&&(e instanceof pe&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ke=()=>(new Date).getTime());class $e{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ae(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function Ne(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ae(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function De(e){return"__ln"in e}class qe{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&De(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&De(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var je,He=(e,t)=>e+"@"+t;class Be{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new qe,i=e=>{for(var t=e,r=G;r===G;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=C.parentNode(n);if(s&&Ne(n)&&"TEXTAREA"!==s.tagName){var o=I(s)?this.mirror.getId(Ae(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ve(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Oe(e,this.mirror)&&this.iframeManager.addIframe(e),Fe(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Le(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)ze(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ve(this.droppedSet,o)||ze(this.removesSubTreeCache,o)?Ve(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(C.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=C.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var t=e.attributes;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=O({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:A(e),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(e=>{if(!Ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=C.textContent(e.target);Me(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:se(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=A(r);n=O({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Me(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!ie(r.tagName,i))if(o.attributes[i]=re(this.doc,F(r.tagName),F(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&(a.style.cssText=e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Me(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=I(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);Me(e.target,this.blockClass,this.blockSelector,!1)||Ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ue(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Re(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[He(r,i)]?Ue(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!I(e.target)||!M(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),C.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)){if(this.addedSet.has(e))return this.addedSet.delete(e),void this.addedSet.add(e);if(!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[He(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Me(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Le(e)&&C.childNodes(C.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Ue(e,t){e.delete(t),C.childNodes(t).forEach((t=>Ue(e,t)))}function ze(e,t,r){return 0!==e.size&&function(e,t,r){var i=C.parentNode(t);return!!i&&e.has(i)}(e,t)}function Ve(e,t){return 0!==e.size&&We(e,t)}function We(e,t){var r=C.parentNode(t);return!!r&&(!!e.has(r)||We(e,r))}var Ze=e=>je?function(){try{return e(...arguments)}catch(e){if(je&&!0===je(e))return;throw e}}:e,Ge=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Je(e,t){var r=new Be;Ge.push(r),r.init(e);var i=new(k())(Ze(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return e.attributeFilter&&e.attributeFilter.length>0&&(n.attributeFilter=e.attributeFilter),i.observe(t,n),{observer:i,buffer:r}}function Ke(e){var t=e.scrollCb,r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.sampling,a=new Map,l=e=>{var o=Qe(e);if(o&&!Me(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=Se(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),t({id:h,x:l,y:u}))}},u=[ge("scroll",Ze(we(Ze((e=>l(e))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(ge("scrollend",Ze(l),r)),()=>u.forEach((e=>e()))}function Ye(e,t){for(var r=Ge.length-1;r>=0;r--){var i=Ge[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Ge.splice(r,1))}}}var Xe=["INPUT","TEXTAREA","SELECT"],et=new WeakMap;function tt(e){return function e(t,r){if(st("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function rt(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function it(e,t){var r,i,n,s,o=e.stylesheetManager;s=e.mirror.getId("#document"===t.nodeName?t:C.host(t));var a="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var t,r;try{r=null==(t=l.set)?void 0:t.call(this,e)}catch(e){if(e&&"object"==typeof e&&"NotAllowedError"===e.name)return;throw e}if(null!==s&&-1!==s)try{o.adoptStyleSheets(e,s)}catch(e){}return r}}),Ze((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function nt(e,t){void 0===t&&(t={});var i,n,s=e.doc.defaultView;if(!s)return()=>{};if(function(e,t){var r=e.mutationCb,i=e.mousemoveCb,n=e.mouseInteractionCb,s=e.scrollCb,o=e.viewportResizeCb,a=e.inputCb,l=e.mediaInteractionCb,u=e.styleSheetRuleCb,h=e.styleDeclarationCb,d=e.canvasMutationCb,c=e.fontCb,v=e.selectionCb,f=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),c(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM){var o=Je(e,e.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,b,_=function(e){var t=e.mousemoveCb,r=e.sampling,i=e.doc,n=e.mirror;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=we(Ze((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),d=Ze(we(Ze((e=>{var t=Qe(e),r=Pe(e)?e.changedTouches[0]:e,i=r.clientX,o=r.clientY;s||(s=ke()),l.push({x:i,y:o,id:n.getId(t),timeOffset:ke()-s}),h("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[ge("mousemove",d,i),ge("touchmove",d,i),ge("drag",d,i)];return Ze((()=>{c.forEach((e=>e()))}))}(e),w=function(e){var t=e.mouseInteractionCb,i=e.doc,n=e.mirror,s=e.blockClass,o=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=F(e),l=(e=>i=>{var a=Qe(i);if(!Me(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[e]===h.MouseDown?u="TouchStart":h[e]===h.MouseUp&&(u="TouchEnd"))}else Pe(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[e]===h.Click&&(l=c,c=null);var v=Pe(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;Ze(t)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(h[e]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(ge(a,l,i))})),Ze((()=>{u.forEach((e=>e()))}))}(e),x=Ke(e),k=function(e,t){var r=e.viewportResizeCb,i=t.win,n=-1,s=-1;return ge("resize",Ze(we(Ze((()=>{var e=Ce(),t=Te();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:s}),T=function(e){var t=e.inputCb,i=e.doc,n=e.mirror,s=e.blockClass,o=e.blockSelector,a=e.ignoreClass,l=e.ignoreSelector,u=e.maskInputOptions,h=e.maskInputFn,d=e.userTriggeredOnInput;function c(e){var t=Qe(e),r=e.isTrusted,n=i.defaultView;if(!t||!n||t instanceof n.HTMLElement){var c=t&&t.tagName;if(t&&"OPTION"===c&&(t=C.parentElement(t)),t&&c&&Xe.indexOf(c)>=0&&!Me(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var f=t.value,p=!1,g=A(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[c.toLowerCase()]||u[g])&&(f=O({element:t,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(t,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=t.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(e,i){var s=et.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){et.set(e,i);var o=n.getId(e);Ze(t)(r({},i,{id:o}))}}var f=("last"===e.sampling.input?["change"]:["input","change"]).map((e=>ge(e,Ze(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((e=>e()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((e=>xe(e[0],e[1],{set(){Ze(c)({target:this,isTrusted:!1})}},!1,p)))),Ze((()=>{f.forEach((e=>e()))}))}(e),I=(l=(a=e).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=Ze((e=>we(Ze((t=>{var r=Qe(t);if(r&&!Me(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:e,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),b=[ge("play",y(v.Play),m),ge("pause",y(v.Pause),m),ge("seeked",y(v.Seeked),m),ge("volumechange",y(v.VolumeChange),m),ge("ratechange",y(v.RateChange),m)],Ze((()=>{b.forEach((e=>e()))}))),M=()=>{},E=()=>{},R=()=>{},P=()=>{};e.recordDOM&&(M=function(e,t){var r=e.styleSheetRuleCb,i=e.mirror,n=e.stylesheetManager,s=t.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ze(((e,t,s)=>{var o=s[0],a=s[1],l=rt(t,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),e.apply(t,s)}))}));var h={};ot("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ot("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ot("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ot("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((e=>{var t=e[0],s=e[1];d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ze(((e,t,s)=>{var o=s[0],a=s[1],l=rt(t.parentStyleSheet,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:[...tt(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ze(((e,t,s)=>{var o=s[0],a=rt(t.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...tt(t),o]}]}),e.apply(t,s)}))})})),Ze((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var t=e[0],r=e[1];r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:s}),E=it(e,e.doc),R=function(e,t){var r=e.styleDeclarationCb,i=e.mirror,n=e.ignoreCSSAttributes,s=e.stylesheetManager,o=t.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ze(((e,t,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(t,[u,h,d]);var c=rt(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:u,value:h,priority:d},index:tt(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ze(((e,t,o)=>{var a,u=o[0];if(n.has(u))return l.apply(t,[u]);var h=rt(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:u},index:tt(t.parentRule)}),e.apply(t,o)}))}),Ze((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:s}),e.collectFonts&&(P=function(e){var t=e.fontCb,r=e.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=S(r.fonts,"add",(function(e){return function(r){return setTimeout(Ze((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ze((()=>{n.forEach((e=>e()))}))}(e)));var L=function(e){var t=e.doc,r=e.mirror,i=e.blockClass,n=e.blockSelector,s=e.selectionCb,o=!0,a=Ze((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var h=e.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Me(d,i,n,!0)||Me(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ge("selectionchange",a)}(e),N=function(e){var t=e.customElementCb,r=e.doc.defaultView;return r&&r.customElements?S(r.customElements,"define",(function(e){return function(r,i,n){try{t({define:{name:r}})}catch(e){console.warn("Custom element callback failed for "+r)}return e.apply(this,[r,i,n])}})):()=>{}}(e),D=[];for(var q of e.plugins)D.push(q.observer(q.callback,s,q.options));return Ze((()=>{if(n){n.destroy(),n.reset();var t=Ge.indexOf(n);-1!==t&&Ge.splice(t,1)}e.shadowDomManager.resetForDoc(e.doc),null==i||i.disconnect(),_(),w(),x(),k(),T(),I(),M(),E(),R(),P(),L(),N(),D.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ot(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class at{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class lt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new at(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new at(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>ye(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{me(e.win,"pagehide",e.handler)})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=e.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);ye((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(s)}))}ye((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return t;case l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case l.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===f.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(me(e,"message",t),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(me(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((e=>{ye((()=>this.mirror.removeNodeFromMap(e)))})),ye((()=>Ye(r,s))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var r=e.content;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&me(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{me(t,"message",e)})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>e.add(t.element))),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class ut{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){var i,n;if(M(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var s=null!==(i=null==(n=C.host(e))?void 0:n.ownerDocument)&&void 0!==i?i:t,o=Je(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var e=Ge.indexOf(l);-1!==e&&Ge.splice(e,1)}}),this.restoreHandlers.push({doc:s,handler:Ke(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push({doc:s,handler:it({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)})}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push({doc:t,handler:S(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=C.shadowRoot(this);return s&&Ne(this)&&r.addShadowRoot(s,t),n}}))})}reset(){this.restoreHandlers.forEach((e=>{var t=e.handler;try{t()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(e){var t=[];for(var r of this.restoreHandlers)if(r.doc===e)try{r.handler()}catch(e){}else t.push(r);this.restoreHandlers=t}}for(var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ct=0;64>ct;ct++)dt[ht.charCodeAt(ct)]=ct;var vt=new Map,ft=(e,t,r)=>{if(e&&(mt(e,t)||"object"==typeof e)){var i=function(e,t){var r=vt.get(e);return r||vt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function pt(e,t,r,i){if(e instanceof Array)return e.map((e=>pt(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,s=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=ht[r[t]>>2],n+=ht[(3&r[t])<<4|r[t+1]>>4],n+=ht[(15&r[t+1])<<2|r[t+2]>>6],n+=ht[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:s}}return e instanceof DataView?{rr_type:e.constructor.name,args:[pt(e.buffer,t,r,i),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[pt(e.data,t,r,i),e.width,e.height]}:mt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ft(e,t,r)}:e}var gt=(e,t,r,i)=>e.map((e=>pt(e,t,r,i))),mt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},yt=["webgl","webgl2"];function bt(e){return"nodeType"in e}function _t(e,t,i,n){var s=[];try{if(n){var o=function(e,t,i){var n=e.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return S(n.prototype,"configure",(function(n){return function(s){var o=function(e){var t=e.canvas;return t&&"object"==typeof t?t:null}(this);if(!o||bt(o)&&Me(o,t,i,!0))return n.call(this,s);bt(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(e,t,i);o&&s.push(o)}var a=S(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var s=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Me(this,t,i,!0)&&("__context"in this||(this.__context=s),n&&yt.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...a])}}));s.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((e=>e()))}}function wt(e,t,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(e),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof e[l])return 0;var u=S(e,l,(function(e){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=e.apply(this,u);if(ft(d,s,this),"tagName"in this.canvas&&!Me(this.canvas,i,n,!0)){var c=gt(u,s,this,o);r(this.canvas,{type:t,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=xe(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var xt,kt,St,Ct='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n return worker.postMessage({ id });\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-CZCeNtwG.js.map\n',Tt="undefined"!=typeof self&&self.Blob&&new Blob([Ct],{type:"text/javascript;charset=utf-8"});function It(e){var t;try{if(!(t=Tt&&(self.URL||self.webkitURL).createObjectURL(Tt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ct),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class Mt{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var t=e.sampling,r=void 0===t?"all":t,i=e.win,n=e.blockClass,s=e.blockSelector,o=e.recordCanvas,l=e.dataURLOptions,u=e.resolutionScale;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,l),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:l,resolutionScale:u})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=_t(r,i,n,!0),h=new Map;try{a=new It}catch(e){return}var d=!1;a.onerror=()=>{var e;d=!0,cancelAnimationFrame(v),null==(e=a.terminate)||e.call(a)},a.onmessage=e=>{var t=e.data.id;if(h.set(t,!1),"base64"in e.data){var r=e.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:t,type:c["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/e,p=0,g=e=>{var u,c;d||(p&&f>e-p||(p=e,(u=[],c=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Me(e,i,n,!0)||u.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&c(e.shadowRoot)}))}catch(e){}},c(r.document),u).forEach(function(){var e=t((function*(e){var t,r,i=o.mirror.getId(e);if(!h.get(i)&&0!==e.width&&0!==e.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);if(null==(t=null==n?void 0:n.isContextLost)?void 0:t.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=e.clientWidth||e.width,d=e.clientHeight||e.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=yield createImageBitmap(e,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:f,width:c,height:v,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions},[f])}catch(e){h.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var e;u(),cancelAnimationFrame(v),null==(e=a.terminate)||e.call(a)}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=_t(e,t,r,!1),s=function(e,t,r,i,n){var s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var a=S(t.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Me(this.canvas,r,i,!0)||setTimeout((()=>{var r=gt(l,t,this,n);e(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=xe(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:c["2D"],property:o,args:[t],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var s=[];return void 0!==t.WebGLRenderingContext&&s.push(...wt(t.WebGLRenderingContext.prototype,c.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&s.push(...wt(t.WebGL2RenderingContext.prototype,c.WebGL2,e,r,i,t,n)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,s)));this.mutationCb({id:t,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Et{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new $e),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:R(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,ae.forEach((e=>e.abort())),ae.clear()}trackStylesheetInLinkElement(e){}}class Rt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Pt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Ot=document.createElement("iframe");document.body.appendChild(Ot),Array.from=(null==(n=Ot.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ot)}}catch(e){console.debug("Unable to override Array.from",e)}var Ft=new P,Lt=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function $t(e){void 0===e&&(e={});var t=e,i=t.emit,n=t.checkoutEveryNms,s=t.checkoutEveryNth,o=t.blockClass,a=void 0===o?"rr-block":o,h=t.blockSelector,d=void 0===h?null:h,c=t.ignoreClass,v=void 0===c?"rr-ignore":c,f=t.ignoreSelector,p=void 0===f?null:f,g=t.maskTextClass,m=void 0===g?"rr-mask":g,y=t.maskTextSelector,b=void 0===y?null:y,_=t.inlineStylesheet,w=void 0===_||_,x=t.maskAllInputs,k=t.maskInputOptions,S=t.slimDOMOptions,T=t.maskInputFn,I=t.maskTextFn,M=t.hooks,E=t.packFn,R=t.sampling,O=void 0===R?{}:R,F=t.dataURLOptions,L=void 0===F?{}:F,A=t.canvasResolutionScale,N=t.mousemoveWait,D=t.recordDOM,q=void 0===D||D,j=t.recordCanvas,H=void 0!==j&&j,B=t.recordCrossOriginIframes,U=void 0!==B&&B,z=t.recordAfter,V=void 0===z?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":z,W=t.userTriggeredOnInput,Z=void 0!==W&&W,G=t.collectFonts,Q=void 0!==G&&G,J=t.inlineImages,K=void 0!==J&&J,Y=t.plugins,X=t.keepIframeSrcFn,ee=void 0===X?()=>!1:X,te=t.ignoreCSSAttributes,re=void 0===te?new Set([]):te,ie=t.attributeFilter;je=t.errorHandler;var ne=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),se=!U||window.parent===window,oe=!1;if(!se)try{window.parent.document&&(oe=!1)}catch(e){oe=!0}if(se&&!i)throw new Error("emit function is required");if(!se&&!oe)return()=>{};void 0!==N&&void 0===O.mousemove&&(O.mousemove=N),Ft.reset();var ae,le=!0===x?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==k?k:{password:!0},ue=fe(void 0!==S&&S);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var he,de,ce=0,pe=new Map,me=e=>{for(var t of Y||[])t.eventProcessor&&(e=t.eventProcessor(e));return E&&!oe&&(e=E(e)),e};xt=(e,t)=>{var r,o=e;if(o.timestamp=ke(),!(null==(r=Ge[0])?void 0:r.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&Lt.has(o.data.source)||Ge.forEach((e=>e.unfreeze())),se)null==i||i(me(o),t);else if(oe){var a={type:"rrweb",event:me(o),origin:window.location.origin,isCheckout:t};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)ae=o,ce=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;ce++,(s&&ce>=s||n&&o.timestamp-ae.timestamp>n)&&kt(!0)}};var be=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,i=new Set;if(e.adds.length>0)for(var n of e.adds){var s=Ft.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}e.removes.forEach((e=>{var r=e.id;if(!t||!t.has(r)){var n=Ie.getIframeElementById(r);n&&i.has(n)?Ie.forgetIframeId(r):(null==he||he(r),Ie.removeIframeById(r))}})),null==de||de(),Ie.cleanupDetachedIframes()}xt({type:l.IncrementalSnapshot,data:r({source:u.Mutation},e)})},_e=e=>xt({type:l.IncrementalSnapshot,data:r({source:u.Scroll},e)}),we=e=>xt({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),xe=new Et({mutationCb:be,adoptedStyleSheetCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)})}),Ie=new lt({mirror:Ft,mutationCb:be,stylesheetManager:xe,recordCrossOriginIframes:U,wrappedEmit:xt});for(var Me of Y||[])Me.getMirror&&Me.getMirror({nodeMirror:Ft,crossOriginIframeMirror:Ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ie.crossOriginIframeStyleMirror});var Ee=new Rt;St=new Mt({recordCanvas:H,mutationCb:we,win:window,blockClass:a,blockSelector:d,mirror:Ft,sampling:O.canvas,dataURLOptions:ne,resolutionScale:A});var Re=new ut({mutationCb:be,scrollCb:_e,bypassOptions:{blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskInputOptions:le,dataURLOptions:ne,maskTextFn:I,maskInputFn:T,recordCanvas:H,inlineImages:K,sampling:O,slimDOMOptions:ue,iframeManager:Ie,stylesheetManager:xe,canvasManager:St,keepIframeSrcFn:ee,processedNodeManager:Ee,attributeFilter:ie},mirror:Ft});kt=function(e){if(void 0===e&&(e=!1),q){xt({type:l.Meta,data:{href:window.location.href,width:Te(),height:Ce()}},e),xe.reset(),Re.init(),Ge.forEach((e=>e.lock()));var t=function(e,t){var r=t||{},i=r.mirror,n=void 0===i?new P:i,s=r.blockClass,o=r.blockSelector,a=r.maskTextClass,l=r.maskTextSelector,u=r.inlineStylesheet,h=r.inlineImages,d=void 0!==h&&h,c=r.recordCanvas,v=void 0!==c&&c,f=r.maskAllInputs,p=void 0!==f&&f,g=r.slimDOM,m=r.dataURLOptions,y=r.preserveWhiteSpace,b=r.onSerialize,_=r.onIframeLoad,w=r.iframeLoadTimeout,x=r.onIframeListenerRegistered,k=r.onStylesheetLoad,S=r.stylesheetLoadTimeout,C=r.keepIframeSrcFn,T=void 0===C?()=>!1:C,I=r.maxDepth;return ve(e,{doc:e,mirror:n,blockClass:void 0===s?"rr-block":s,blockSelector:void 0===o?null:o,maskTextClass:void 0===a?"rr-mask":a,maskTextSelector:void 0===l?null:l,skipChild:!1,inlineStylesheet:void 0===u||u,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===p?{password:!0}:p,maskTextFn:r.maskTextFn,maskInputFn:r.maskInputFn,slimDOMOptions:fe(void 0!==g&&g),dataURLOptions:m,inlineImages:d,recordCanvas:v,preserveWhiteSpace:y,onSerialize:b,onIframeLoad:_,iframeLoadTimeout:w,onIframeListenerRegistered:x,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:T,newlyAddedElement:!1,maxDepth:I})}(document,{mirror:Ft,blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:b,inlineStylesheet:w,maskAllInputs:le,maskTextFn:I,maskInputFn:T,slimDOM:ue,dataURLOptions:ne,recordCanvas:H,inlineImages:K,onSerialize(e){Oe(e,Ft)&&Ie.addIframe(e),Fe(e,Ft)&&xe.trackLinkElement(e),Le(e)&&Re.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){Ie.attachIframe(e,t),Re.observeAttachShadow(e)},onIframeListenerRegistered(e,t){Ie.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){xe.attachLinkElement(e,t)},keepIframeSrcFn:ee});if(!t)return console.warn("Failed to snapshot the document");xt({type:l.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Ge.forEach((e=>e.unlock())),U&&Ie.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&xe.adoptStyleSheets(document.adoptedStyleSheets,Ft.getId(document))}};try{var Pe=[];he=e=>{var t=pe.get(e);t&&(t.forEach((e=>{ye(e);var t=Pe.indexOf(e);-1!==t&&Pe.splice(t,1)})),pe.delete(e))},de=()=>{for(var e of pe){var t=e[0],r=Ft.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==he||he(t)}catch(e){null==he||he(t)}else null==he||he(t)}};var $e=e=>{var t;return Ze(nt)({mutationCb:be,mousemoveCb:(e,t)=>xt({type:l.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:_e,viewportResizeCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:we,fontCb:e=>xt({type:l.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){xt({type:l.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){xt({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:a,ignoreClass:v,ignoreSelector:p,maskTextClass:m,maskTextSelector:b,maskInputOptions:le,inlineStylesheet:w,sampling:O,recordDOM:q,recordCanvas:H,inlineImages:K,userTriggeredOnInput:Z,collectFonts:Q,doc:e,maskInputFn:T,maskTextFn:I,keepIframeSrcFn:ee,blockSelector:d,slimDOMOptions:ue,dataURLOptions:ne,mirror:Ft,iframeManager:Ie,stylesheetManager:xe,shadowDomManager:Re,processedNodeManager:Ee,canvasManager:St,ignoreCSSAttributes:re,attributeFilter:ie,plugins:(null==(t=null==Y?void 0:Y.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>xt({type:l.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},M)};Ie.addLoadListener((e=>{try{var t=Ft.getId(e),r=$e(e.contentDocument);if(Pe.push(r),-1!==t){var i=pe.get(t);i||pe.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),Ie.addPageHideListener((e=>{var t=Ft.getId(e);null==he||he(t),Ye(e)}));var Ae=-1,Ne=e=>xt({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),De=()=>{var e,t,r,i,n=document,s=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=s?Ft.getId(s):-1;o!==Ae&&(-1!==Ae&&Ne({id:Ae,enter:!1}),Ae=o,-1!==o&&Ne({id:o,enter:!0}))},qe=()=>{kt(),Pe.push($e(document)),Pe.push(ge("fullscreenchange",De)),Pe.push(ge("webkitfullscreenchange",De)),Pe.push(ge("mozfullscreenchange",De)),Pe.push(ge("MSFullscreenChange",De)),Pt=!0};return["interactive","complete"].includes(document.readyState)?qe():(Pe.push(ge("DOMContentLoaded",(()=>{xt({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===V&&qe()}))),Pe.push(ge("load",(()=>{xt({type:l.Load,data:{}}),"load"===V&&qe()}),window))),()=>{Pe.forEach((e=>ye(e))),Ee.destroy(),Ie.removeLoadListener(),Ie.destroy(),pe.clear(),Re.reset(),Ft.reset(),Pt=!1,je=void 0}}catch(e){console.warn(e)}}$t.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");xt({type:l.Custom,data:{tag:e,payload:t}})},$t.freezePage=()=>{Ge.forEach((e=>e.freeze()))},$t.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");kt(e)},$t.mirror=Ft;var At=Object.defineProperty,Nt=(e,t,r)=>((e,t,r)=>t in e?At(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class Dt{constructor(e){Nt(this,"fileName"),Nt(this,"functionName"),Nt(this,"lineNumber"),Nt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var qt=/(^|@)\S+:\d+/,jt=/^\s*at .*(\S+:\d+|\(native\))/m,Ht=/^(eval@)?(\[native code])?$/,Bt={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(jt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(jt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Dt({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Ht)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Dt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new Dt({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Dt({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new Dt({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(qt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Dt({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Ut(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function zt(e){return Array.isArray(e)}function Vt(e){return"object"==typeof e&&null!==e&&!zt(e)}function Wt(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Vt(e[i])&&Wt(e[i],t-1))return!0;return!1}function Zt(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Vt(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Vt(o)&&Wt(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=zt(u)?Ut(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Gt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Qt(e,t,r){var i,n=r?Object.assign({},Gt,r):Gt,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=Bt.parse(t.error).map((e=>e.toString())),s=[Zt(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[Zt("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Zt("Uncaught (in promise)",n.stringifyOptions),Zt(t.reason,n.stringifyOptions)]);var s=Bt.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((e=>e()))};function c(t,r){var i=this;return t[r]?function(t,s,l){try{if(!(s in t))return()=>{};var u=t[s],h={next:u},d=(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Bt.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Zt(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Zt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return h.next.apply(this,t)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),t[s]=d,()=>{if(t[s]!==d)for(var e=t[s];"function"==typeof e&&e.__rrweb_layer__;){var r=e.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);e=r.next}else t[s]=h.next}}catch(e){return()=>{}}}(t,r):()=>{}}}var Jt=e=>({name:"rrweb/console@1",observer:Qt,options:e}),Kt=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Yt(e){return"string"==typeof e||e}function Xt(e){return"string"==typeof e?e:void 0}var er,tr=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],rr=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),ir=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),nr="min_length",sr="max_length",or=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],ar=["token"],lr="NativeGzipValidationError",ur=e=>e.length>=2&&31===e[0]&&139===e[1],hr=(e,t)=>e===ir.GZipJS||t===ir.GZipJS||"gzip"===t,dr=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),cr=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=lr,t},vr=function(){var e=t((function*(e,t){18>e.size&&cr("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());ur(r)&&8===r[2]||cr("invalid-header");var i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(er)return er;er=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;er[e]=t>>>0}return er})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&cr("invalid-crc");var n=t.length>>>0;i.getUint32(4,!0)!==n&&cr("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function fr(){return fr=t((function*(e,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(e),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var e=t((function*(e){try{yield o.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield vr(u,n),u}catch(e){if(null!=i&&i.rethrow)throw e;return r&&console.error("Failed to gzip compress data",e),null}})),fr.apply(this,arguments)}var pr=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],gr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return pr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};function mr(e,t){return-1!==e.indexOf(t)}var yr=function(e){return e.trim()},br=function(e){return e.replace(/^\$/,"")};function _r(e){var t,r=[];return null!==(t=JSON.stringify(e,(function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(t))return"[Circular]";r.push(t)}return t}})))&&void 0!==t?t:"null"}var wr=Object.prototype,xr=wr.hasOwnProperty,kr=wr.toString,Sr=Array.isArray||function(e){return"[object Array]"===kr.call(e)},Cr=e=>"function"==typeof e,Tr=e=>e===Object(e)&&!Sr(e),Ir=e=>{if(Tr(e)){for(var t in e)if(xr.call(e,t))return!1;return!0}return!1},Mr=e=>void 0===e,Er=e=>"[object String]"==kr.call(e),Rr=e=>Er(e)&&0===e.trim().length,Pr=e=>null===e,Or=e=>Mr(e)||Pr(e),Fr=e=>"[object Number]"==kr.call(e)&&e==e,Lr=e=>Fr(e)&&e>0,$r=e=>"[object Boolean]"===kr.call(e),Ar=e=>e instanceof FormData,Nr=e=>mr(or,e),Dr=e=>mr(ar,e);function qr(e){return null===e||"object"!=typeof e}function jr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Hr(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var Br=[!0,"true",1,"1","yes"],Ur=e=>mr(Br,e),zr=[!1,"false",0,"0","no"];function Vr(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Fr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Vr(n||r,t,r,i))}class Wr{constructor(e){this.$e={},this.ze=e.ze,this.Ze=Vr(e.bucketSize,0,100,e.Ge),this.Qe=Vr(e.refillRate,0,this.Ze,e.Ge),this.Je=Vr(e.refillInterval,0,864e5,e.Ge)}Ke(e,t){var r=Math.floor((t-e.lastAccess)/this.Je);r>0&&(e.tokens=Math.min(e.tokens+r*this.Qe,this.Ze),e.lastAccess=e.lastAccess+r*this.Je)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.$e[i];return n?this.Ke(n,r):this.$e[i]=n={tokens:this.Ze,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.ze)||t.call(this,e)),0===n.tokens)}stop(){this.$e={}}}var Zr="Mobile",Gr="iOS",Qr="Android",Jr="Tablet",Kr=Qr+" "+Jr,Yr="iPad",Xr="Apple",ei=Xr+" Watch",ti="Safari",ri="BlackBerry",ii="Samsung",ni=ii+"Browser",si=ii+" Internet",oi="Chrome",ai=oi+" OS",li=oi+" "+Gr,ui="Internet Explorer",hi=ui+" "+Zr,di="Opera",ci=di+" Mini",vi="Edge",fi="Microsoft "+vi,pi="Firefox",gi=pi+" "+Gr,mi="Nintendo",yi="PlayStation",bi="Xbox",_i=Qr+" "+Zr,wi=Zr+" "+ti,xi="Windows",ki=xi+" Phone",Si="Nokia",Ci="Ouya",Ti="Generic",Ii=Ti+" "+Zr.toLowerCase(),Mi=Ti+" "+Jr.toLowerCase(),Ei="Konqueror",Ri="Oculus Browser",Pi="Vivaldi",Oi="Yandex",Fi="Whale",Li="DuckDuckGo",$i="Pale Moon",Ai="Waterfox",Ni="Brave",Di="Google Search App",qi="(\\d+(\\.\\d+)?)",ji=new RegExp("Version/"+qi),Hi=new RegExp(bi,"i"),Bi=new RegExp(yi+" \\w+","i"),Ui=new RegExp(mi+" \\w+","i"),zi=new RegExp(ri+"|PlayBook|BB10","i"),Vi={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Wi=function(e,t,r,i){t=t||"";var n=function(e){return null!=e&&e.brave?Ni:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&mr(e,"GSA/")?Di:mr(e," OPR/")&&mr(e,"Mini")?ci:mr(e," OPR/")?di:zi.test(e)?ri:mr(e,"IE"+Zr)||mr(e,"WPDesktop")?hi:mr(e,"OculusBrowser")?Ri:mr(e,ni)?si:mr(e,vi)||mr(e,"Edg/")?fi:mr(e,Pi+"/")?Pi:mr(e,"YaBrowser/")?Oi:mr(e,Fi+"/")?Fi:mr(e,Li+"/")||mr(e,"Ddg/")?Li:mr(e,"FBIOS")?"Facebook "+Zr:mr(e,"UCWEB")||mr(e,"UCBrowser")?"UC Browser":mr(e,"CriOS")?li:mr(e,"CrMo")||mr(e,oi)?oi:mr(e,Qr)&&mr(e,ti)?_i:mr(e,"FxiOS")?gi:mr(e.toLowerCase(),Ei.toLowerCase())?Ei:mr(e,Ni+"/")?Ni:((e,t)=>t&&mr(t,Xr)||function(e){return mr(e,ti)&&!mr(e,oi)&&!mr(e,Qr)}(e))(e,t)?mr(e,Zr)?wi:ti:mr(e,"PaleMoon/")?$i:mr(e,Ai+"/")?Ai:mr(e,pi)?pi:mr(e,"MSIE")||mr(e,"Trident/")?ui:mr(e,"Gecko")?pi:"")},Zi={[hi]:[new RegExp("rv:"+qi)],[fi]:[new RegExp(vi+"?\\/"+qi)],[oi]:[new RegExp("("+oi+"|CrMo)\\/"+qi)],[li]:[new RegExp("CriOS\\/"+qi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qi)],[ti]:[ji],[wi]:[ji],[di]:[new RegExp("(Opera|OPR)\\/"+qi)],[pi]:[new RegExp(pi+"\\/"+qi)],[gi]:[new RegExp("FxiOS\\/"+qi)],[Ei]:[new RegExp("Konqueror[:/]?"+qi,"i")],[ri]:[new RegExp(ri+" "+qi),ji],[_i]:[new RegExp("android\\s"+qi,"i")],[si]:[new RegExp(ni+"\\/"+qi)],[Ri]:[new RegExp("OculusBrowser\\/"+qi)],[Pi]:[new RegExp(Pi+"\\/"+qi)],[Oi]:[new RegExp("YaBrowser\\/"+qi)],[Fi]:[new RegExp(Fi+"\\/"+qi)],[Ni]:[new RegExp(Ni+"\\/"+qi)],[Li]:[new RegExp("(DuckDuckGo|Ddg)\\/"+qi)],[$i]:[new RegExp("PaleMoon\\/"+qi)],[Ai]:[new RegExp(Ai+"\\/"+qi)],[Di]:[new RegExp("GSA\\/"+qi)],[ui]:[new RegExp("(rv:|MSIE )"+qi)],Mozilla:[new RegExp("rv:"+qi)]},Gi=function(e,t,r,i){var n=Wi(e,t,r,i),s=Zi[n];if(Mr(s))return null;for(var o=0;s.length>o;o++){var a=e.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Qi=[[new RegExp(bi+"; "+bi+" (.*?)[);]","i"),e=>[bi,e&&e[1]||""]],[new RegExp(mi,"i"),[mi,""]],[new RegExp(yi,"i"),[yi,""]],[zi,[ri,""]],[new RegExp(xi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ki,""];if(new RegExp(Zr).test(t)&&!/IEMobile\b/.test(t))return[xi+" "+Zr,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=Vi[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[xi,i]}return[xi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Gr,[e[3],e[4],e[5]||"0"].join(".")]:[Gr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Mr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Qr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qr+")","i"),e=>e&&e[2]?[Qr,[e[2],e[3],e[4]||"0"].join(".")]:[Qr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ai,""]],[/Linux|debian/i,["Linux",""]]],Ji=function(e){return Ui.test(e)?mi:Bi.test(e)?yi:Hi.test(e)?bi:new RegExp(Ci,"i").test(e)?Ci:new RegExp("("+ki+"|WPDesktop)","i").test(e)?ki:/iPad/.test(e)?Yr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ei:zi.test(e)?ri:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Si,"i").test(e)?Si:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Zr).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Qr:Kr:new RegExp("(pda|"+Zr+")","i").test(e)?Ii:new RegExp(Jr,"i").test(e)&&!new RegExp(Jr+" pc","i").test(e)?Mi:""},Ki=function(e,t){var r,i,n,s,o=Ji(e);return o===Yr||o===Kr||"Kobo"===o||"Kindle Fire"===o||o===Mi?Jr:o===mi||o===bi||o===yi||o===Ci?"Console":o===ei?"Wearable":o?Zr:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Zr:Jr:"Desktop"},Yi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xi(e,t){return"string"==typeof(r=e)&&Yi.test(r)?e:t();var r}function en(e){return e?e.split("#")[0]:e}function tn(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var rn=e=>e instanceof Error,nn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},sn=nn.info;function on(e){if($r(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(Sr(e))return{arrayValue:{values:e.map((e=>on(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function an(e){var t=[];for(var r in e){var i=e[r];Pr(i)||Mr(i)||t.push({key:r,value:on(i)})}return t}function ln(e,t){var i=nn[e.level||"info"]||sn,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),Or(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),Or(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:an(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),Mr(e.trace_flags)||(u.flags=e.trace_flags),u}function un(e,t,i){return r({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}function hn(e,t,r,i){return{resourceLogs:[{resource:{attributes:an(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}let dn=class{constructor(e,t,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=e,this.Te=t,this.Ge=r,this.Ye=i,this.Xe=n,this.et=s,this.tt=o,this.rt=null,this.it=0,this.nt=0,this.st=0,this.ot=0,this.ut=!1,this.ht=t.maxBufferSize,this.dt=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.ct=t.flushIntervalMs,this.vt=t.maxBatchRecordsPerPost,this.ft=t.rateCapWindowMs,this.yt=t.maxLogsPerInterval}reset(){this.bt(),this.rt=null,this.st=0,this.ot=0,this.ut=!1,this.it=0,this.nt=0,this.vt=this.Te.maxBatchRecordsPerPost}onReconnect(){this.nt=0,this._t()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.wt(e);if(null!==t)if(t.body){if(this.xt()){var r={record:ln(t,this.Ye())};this.Xe((()=>this.kt(r)))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(e){var t=this.Te.beforeSend;if(!t)return e;var r=Sr(t)?t:[t],i=e;for(var n of r)try{var s=n(i);if(!s)return this.Ge.info("Log was rejected in beforeSend function"),null;i=s}catch(e){return this.Ge.error("Error in beforeSend function for log:",e),null}return i}xt(){if(void 0===this.yt)return!0;var e=Date.now(),t=e-this.st;return this.ft>t&&t>=0||(this.st=e,this.ot=0,this.ut=!1),this.yt>this.ot?(this.ot++,!0):(this.ut||(this.Ge.warn("captureLog dropping logs: exceeded "+this.yt+" logs per "+this.ft+"ms"),this.ut=!0),!1)}flush(){var e=this;return t((function*(){if(!e._instance.isDisabled)return e.rt||(e.rt=e.St().finally((()=>{e.rt=null}))),e.rt}))()}St(){var e=this;return t((function*(){var t;e.bt();var r=null!==(t=e._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==t?t:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;e.it=0;var a=Math.min(r.length,e.vt),l=r.slice(0,a),u=l.map((e=>e.record)),h=hn(u,e.Ct(),null!==(s=e.tt)&&void 0!==s?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.Tt(h);if("too-large"===d.kind&&l.length>1)e.vt=Math.max(1,Math.floor(l.length/2)),e.Ge.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.vt);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?e.Ge.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&e.Te.maxBatchRecordsPerPost>e.vt&&(e.vt=Math.min(e.Te.maxBatchRecordsPerPost,e.vt+1)),yield e.It(l.length),r=null!==(o=e._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}It(e){var r=this;return t((function*(){var t,i=Math.max(0,e-r.it),n=null!==(t=r._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==t?t:[];r._instance.setPersistedProperty(rr.LogsQueue,n.slice(i)),yield r.et()}))()}Ct(){return un(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(e){var t;if(!this._instance.optedOut){var r=null!==(t=this._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==t?t:[];this.dt>r.length||(r.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(rr.LogsQueue,r),this.ht>r.length?this.Mt():this._t()}}Mt(e){void 0===e&&(e=this.ct),this.Et||(this.Et=tn((()=>{this.Et=void 0,this._t()}),e))}Rt(){var e=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,e)}Pt(){var e=this._instance.getPersistedProperty(rr.LogsQueue);return!!e&&e.length>0}shutdown(e){var r=this;return t((function*(){r.bt();var t=r.flush().catch((()=>{}));void 0!==e?yield Promise.race([t,new Promise((t=>tn(t,e)))]):yield t}))()}flushWithTimeout(e){var r=this;return t((function*(){var t=!1,i=r.flush(),n=new Promise((r=>tn((()=>{t=!0,r()}),e)));try{yield Promise.race([i,n])}finally{t&&i.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(e=>{this.nt++,this.Ge.error("PostHog logs flush failed:",e)})).finally((()=>{!this._instance.isDisabled&&this.Pt()&&this.Mt(this.Rt())}))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}};var cn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function vn(e){return String(e)+"000000"}function fn(e,t,r,i){var n="";return i&&(n=Object.keys(i).sort().map((e=>JSON.stringify(e)+":"+JSON.stringify(i[e]))).join(",")),e+"\0"+t+"\0"+(null!=r?r:"")+"\0"+n}let pn=class{constructor(e,t,r){this._instance=e,this.Te=t,this.Ge=r,this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.At=0}count(e,t,r){void 0===t&&(t=1),this.Nt({name:e,type:"count",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(e,t,r){this.Nt({name:e,type:"gauge",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(e,t,r){this.Nt({name:e,type:"histogram",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var e=this,r=this.rt,i=function(){var i=t((function*(){r&&(yield r.catch((()=>{}))),yield e.Dt()}));return function(){return i.apply(this,arguments)}}(),n=i().finally((()=>{this.rt===n&&(this.rt=null)}));return this.rt=n,n}drainWindow(){if(0===this.Ot.size)return null;var e=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(e)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.wt(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.Ge.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=t.attributes?r({},t.attributes):void 0,n=fn(t.type,t.name,t.unit,i)}catch(e){return void this.Ge.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var s=this.Ot.get(n);if(!s){if(!this.jt())return;s={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Ot.set(n,s)}var o=this.Lt.get(t.name);void 0===o?this.Lt.set(t.name,t.type):o===t.type||this.$t.has(t.name)||(this.$t.add(t.name),this.Ge.warn("Metric name '"+t.name+"' is already used as a "+o+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,t.value),this.Mt()}else this.Ge.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.Ge.warn("Dropping metric with empty name")}}jt(){return this.Te.maxSeriesPerFlush>this.Ot.size||(this.Ft||(this.Ft=!0,this.Ge.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ht(e,t){var r;switch(e.type){case"count":e.total=(null!==(r=e.total)&&void 0!==r?r:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(cn.length+1).fill(0)});var i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(var r=0;t.length>r;r++)if(t[r]>=e)return r;return t.length}(t,cn)]+=1}}wt(e){var t=this.Te.beforeSend;if(!t)return e;var r=Sr(t)?t:[t],i=e;for(var n of r)try{var s=n(i);if(!s)return this.Ge.info("Metric was rejected in beforeSend function"),null;i=s}catch(e){return this.Ge.error("Error in beforeSend function for metric:",e),null}return i}Mt(){this.Et||(this.Et=tn((()=>{this.Et=void 0,this.flush().catch((e=>{this.Ge.error("Metrics flush failed:",e)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var e=this;return t((function*(){if(0!==e.Ot.size){var t=e.Ot;e.Ot=new Map,e.Ft=!1,e.Lt=new Map,e.$t=new Set;var r=e.At,i=yield e._instance.Bt(e.qt(t));if(r===e.At)switch(i.kind){case"ok":return;case"retry-later":return e.Ut(t),void e.Mt();case"too-large":return void e.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.Ge.error("Failed to send metrics batch:",i.error)}}}))()}qt(e){return t=this.zt(e),i=function(e,t,i){return r({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:an(i)},scopeMetrics:[{scope:{name:n,version:s},metrics:t}]}]};var t,i,n,s}zt(e){var t=vn(Date.now()),i=new Map;for(var n of e.values()){var s,o=fn(n.type,n.name,n.unit,void 0),a=i.get(o);a||(a=r({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=an(null!==(s=n.attributes)&&void 0!==s?s:{}),u=vn(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:t,asDouble:null!==(h=n.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===n.type){var c,v={attributes:l,timeUnixNano:t,asDouble:null!==(c=n.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(v)}else n.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:t,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:cn})}return Array.from(i.values())}Ut(e){var t,r;for(var i of e){var n=i[0],s=i[1],o=this.Ot.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(t=o.total)&&void 0!==t?t:0)+(null!==(r=s.total)&&void 0!==r?r:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.jt()&&this.Ot.set(n,s)}}};function gn(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}var mn,yn,bn;function _n(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return bn&&r.length===yn||(yn=r.length,bn=r.reduce(((r,i)=>{mn||(mn={});var n=mn[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,mn[i]=[l,u];break}}return r}),{})),bn}}class wn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Sr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:_n(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var xn="?";function kn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?xn:r,in_app:!0};return Mr(i)||(s.lineno=i),Mr(n)||(s.colno=n),s}var Sn=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:xn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Cn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,In=/\((\S*)(?::(\d+))(?::(\d+))\)/,Mn=(e,t)=>{var r=Cn.exec(e);if(r)return kn(t,r[1],xn,+r[2],+r[3]);var i=Tn.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=In.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=Sn(i[1]||xn,i[2]);return kn(t,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},En=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Pn=(e,t)=>{var r=En.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Rn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||xn,o=Sn(s,n);return kn(t,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},On=/\(error: (.*)\)/,Fn=50;class Ln{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Er(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return jr(e,"DOMException")}isDOMError(e){return jr(e,"DOMError")}}class $n{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class An{constructor(){}match(e){return jr(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Nn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Dn{match(e){return"string"==typeof e}coerce(e,t){var r,i=this.getInfos(e),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Nn);return i&&(t=i[1],r=i[2]),[t,r]}}var qn=["fatal","error","warning","log","info","debug"];function jn(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Hn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Hr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+jn(e)}isSeverityLevel(e){return Er(e)&&!Rr(e)&&qn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(rn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Bn{match(e){return Hr(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+jn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Un{match(e){return qr(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class zn{match(e){return jr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Hr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return qr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Vn="$message",Wn="$timestamp",Zn=new Set([Vn,Wn]),Gn={enabled:!0,max_bytes:32768};function Qn(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:Gn.enabled,max_bytes:Kn(e.max_bytes,Gn.max_bytes)}:r({},Gn)}class Jn{constructor(e){this.Vt=[],this.Wt=0,this.Te=Qn(e)}setConfig(e){this.Te=Qn(e),this.Zt()}add(e){var t=function(e){var t;try{t=_r(e)}catch(e){return}try{var r=JSON.parse(t);if(!Tr(r))return;var i=r,n=i[Vn],s=i[Wn];if(!Er(n)||0===n.trim().length)return;if(!Er(s)&&!Fr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this.Te.max_bytes||(this.Vt.push({step:t.step,bytes:r}),this.Wt+=r,this.Zt())}}getAttachable(){return this.Vt.map((e=>e.step))}clear(){this.Vt=[],this.Wt=0}size(){return this.Vt.length}Zt(){for(;this.Wt>this.Te.max_bytes&&this.Vt.length>0;){var e=this.Vt.shift();e&&(this.Wt-=e.bytes)}}}function Kn(e,t){if(!Fr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var Yn="undefined"!=typeof window?window:void 0,Xn="undefined"!=typeof globalThis?globalThis:Yn,es=null==Xn?void 0:Xn.navigator,ts=null==Xn?void 0:Xn.document,rs=null==Xn?void 0:Xn.location,is=null==Xn?void 0:Xn.fetch,ns=null!=Xn&&Xn.XMLHttpRequest&&"withCredentials"in new Xn.XMLHttpRequest?Xn.XMLHttpRequest:void 0,ss=null==Xn?void 0:Xn.AbortController,os=null==Xn?void 0:Xn.CompressionStream,as=null==es?void 0:es.userAgent;function ls(){return!(!Yn||!1===Yn.navigator.onLine)}var us=e=>"undefined"!=typeof Document&&e instanceof Document,hs={DEBUG:!1,LIB_VERSION:"0.2.4",LIB_NAME:"browser-common"},ds=function(e,t){var r=(void 0===t?{}:t).debugEnabled,i={k(t){if(Yn&&(hs.DEBUG||Yn.POSTHOG_DEBUG||r)&&!Mr(Yn.console)&&Yn.console){for(var i=("__rrweb_original__"in Yn.console[t]?Yn.console[t].__rrweb_original__:Yn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>ds(e+" "+t,r)};return i},cs=ds("[PostHog.js]"),vs=cs.createLogger;function fs(e,t){Sr(e)&&e.forEach(t)}function ps(e,t){if(!Or(e))if(Sr(e))e.forEach(t);else if(Ar(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)xr.call(e,r)&&t(e[r],r)}var gs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function ms(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var ys=function(e){try{return e()}catch(e){return}},bs=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){cs.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),cs.critical(e)}}},_s=function(e){var t={};return ps(e,(function(e,r){(Er(e)&&e.length>0||Fr(e))&&(t[r]=e)})),t};var ws=["herokuapp.com","vercel.app","netlify.app"];function xs(e){var t=null==e?void 0:e.hostname;if(!Er(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of ws)if(r===i)return!1;return!0}function ks(e,t,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==e||e.addEventListener(t,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function Ss(e){return"ph_toolbar_internal"===e.name}var Cs=(e,t)=>{try{return JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t)}catch(t){return _r(e)}},Ts=e=>{var t=null==ts?void 0:ts.createElement("a");return Mr(t)?null:(t.href=e,t)},Is=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return ps(e,(function(e,t){Mr(e)||Mr(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},Ms=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Sr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){cs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Es=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Sr(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},Rs=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Ps=(e,t)=>e>=t&&ls(),Os=(e,t,r,i)=>{if(0===e){if(ls()){var n=t+1;return n===r&&i(),n}return t}return 0},Fs=()=>{};function Ls(e,t,r){try{if(!(t in e))return Fs;var i={next:e[t]},n=r((function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.next.apply(this,t)}));return Cr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=n,()=>{if(e[t]!==n)for(var r=e[t];Cr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else e[t]=i.next}}catch(e){return Fs}}function $s(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function As(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!Cr(i))return t;try{var n=i(t);return Er(n)&&n?n:t}catch(e){return cs.error("Error in get_current_url, falling back to window.location.href",e),t}}function Ns(e){var t,r=null==Yn||null==(t=Yn.location)?void 0:t.href;return Mr(r)?void 0:As(e,r)}var Ds="__POSTHOG_TOOLBAR__",qs=1,js=3,Hs=11;function Bs(e){return e instanceof Element&&(e.id===Ds||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Us(e){return!!e&&e.nodeType===qs}function zs(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Vs(e){return!!e&&e.nodeType===js}function Ws(e){return!!e&&e.nodeType===Hs&&Us(e.host)}var Zs=1e3;function Gs(e){return e?yr(e).split(/\s+/):[]}function Qs(e,t){var r=Ns(t);return!!(r&&e&&e.some((e=>r.match(e))))}function Js(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Gs(t)}function Ks(e){return Or(e)?null:yr(e).split(/(\s+)/).filter((e=>xo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ys(e){var t="";return fo(e)&&!po(e)&&e.childNodes&&e.childNodes.length&&ps(e.childNodes,(function(e){var r;Vs(e)&&e.textContent&&(t+=null!==(r=Ks(e.textContent))&&void 0!==r?r:"")})),yr(t)}function Xs(e){var t;return Mr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var eo=["a","button","form","input","select","textarea","label"];function to(e,t){if(Mr(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function ro(e){var t=e.parentNode;return!(!t||!Us(t))&&t}var io=[".ph-no-autocapture","[data-ph-no-autocapture]"],no=["next","previous","prev",">","<"],so=[...no,"+","-","−","–"],oo=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,ao=[".ph-no-deadclick",".ph-no-capture"],lo=[".ph-no-rageclick",".ph-no-capture"],uo=["","text","search","email","password","url","tel","number"];function ho(e,t){if(!Yn||co(e))return!1;var r,i,n,s,o;if($r(t)?(r=!!t&&lo,i=void 0,n=!1):(r=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:lo,i=null==t?void 0:t.content_ignorelist,n=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(e){return!(!e||!Us(e))&&(!!zs(e,"textarea")||(zs(e,"input")?mr(uo,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var a=vo(e,!1).targetElementList;return!function(e,t){if(!1===e||Mr(e))return!1;var r;if(!0===e)r=no;else{if(!Sr(e))return!1;if(e.length>10)return cs.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var t=e.safeText,i=e.ariaLabel;return r.some((e=>oo(t,e)||oo(i,e)))}))}(i,a.map((e=>{var t;return{safeText:Ys(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!to(a,r)}var co=e=>!e||zs(e,"html")||!Us(e),vo=(e,t)=>{if(!Yn||co(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!zs(n,"body");)if(Ws(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ro(n);if(!s)break;if(t||eo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=Yn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(e){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function fo(e){for(var t=new Set,r=0,i=e;i.parentNode&&!zs(i,"body");i=i.parentNode){if(r++>=Zs||t.has(i))return!1;t.add(i);var n=Js(i);if(mr(n,"ph-sensitive")||mr(n,"ph-no-capture"))return!1}if(mr(Js(e),"ph-include"))return!0;var s=e.type||"";if(Er(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!Er(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function po(e){return!!(zs(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||zs(e,"select")||zs(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var go="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",mo=new RegExp("^(?:"+go+")$"),yo=new RegExp(go),bo="\\d{3}-?\\d{2}-?\\d{4}",_o=new RegExp("^("+bo+")$"),wo=new RegExp("("+bo+")");function xo(e,t){if(void 0===t&&(t=!0),Or(e))return!1;if(Er(e)){if(e=yr(e),(t?mo:yo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?_o:wo).test(e))return!1}return!0}function ko(e){var t=Ys(e);return xo(t=(t+" "+So(e)).trim())?t:""}function So(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ps(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Ys(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+So(e)).trim())}catch(e){cs.error("[AutoCapture]",e)}})),t}function Co(e){return e.replace(/"|\\"/g,'\\"')}function To(e){var t=e.attr__class;if(t)return Sr(t)?t:Gs(t)}var Io=1e6,Mo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Io,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Eo=vs("[Recorder]"),Ro=e=>"navigation"===e.entryType,Po=e=>"resource"===e.entryType;function Oo(e,t){return!!t&&($r(t)||t[e])}function Fo(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var Lo=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function $o(e){var t=e.type,r=e.recordBody,i=e.headers;function n(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!Fo(t)&&e(t.url)}catch(e){return!1}}(e.url))return!1;if(n(Lo))return!1;if($r(r))return!0;if(Sr(r))return n(r);var s=r[t];return $r(s)?s:n(s)}function Ao(e,t,r,i,n,s){return No.apply(this,arguments)}function No(){return No=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return Eo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(Po(o=e[s])&&o.initiatorType===t&&(Mr(i)||o.startTime>=i)&&(Mr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),Ao(e,t,r,i,n,s+1))})),No.apply(this,arguments)}function Do(e){var t=e.body,r=e.options,i=e.url;if(Or(t))return null;var n=$s(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Er(t))return t;if(us(t))return t.textContent;if(Ar(t))return Is(t);if(Tr(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var qo=e=>!Pr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function jo(e){var t=e.entry,i=e.method,n=e.status,s=e.networkRequest,o=e.isInitial,a=e.start,l=e.end,u=e.url,h=e.initiatorType;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:Mr(a)?void 0:Math.round(a),endTime:Mr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(qo(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ho=["video/","audio/"];function Bo(e){return Tr(e)&&Cr(e.getReader)&&Cr(e.tee)}var Uo=500,zo="[SessionReplay] Timeout while trying to read body",Vo="[SessionReplay] Failed to read body";function Wo(e){return Vo+": "+e}function Zo(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Go(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(zo)),Uo);try{e.clone().text().then((e=>t(e)),(e=>t(Wo(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Vo)}}))}(e);var r=function(e){var t;return Math.min(Io,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:Io)}(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(Zo(r)):function(e,t){return new Promise((r=>{var i,n=!1;function s(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(l),s(),r(e))}var a,l=setTimeout((()=>o(zo)),Uo);try{a=e.clone()}catch(e){return void o(Vo)}var u=a.body;if(Bo(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(e){return void o(Vo)}var h=[],d=0;!function e(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>t)return void o(Zo(t));d+=a.byteLength,h.push(a)}e()}}),(e=>o(Wo(e))))}()}else try{a.text().then((e=>o(e)),(e=>o(Wo(e))))}catch(e){o(Vo)}}))}(e,r)}function Qo(){return Qo=t((function*(e){var t=e.r,r=e.options,i=$s(e.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Go(t,r)})),Qo.apply(this,arguments)}function Jo(){return Jo=t((function*(e){var t=e.r,r=e.options,i=function(e){var t,r=e.r,i=e.options,n=e.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Ho.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var a=$s(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:t,options:r,url:e.url});return Pr(i)?Go(t,r):Promise.resolve(i)})),Jo.apply(this,arguments)}var Ko=null;function Yo(e,i,n){if(!("performance"in i))return()=>{};if(Ko)return Eo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Mo,n):Mo,o=t=>{var i=[],n=!1;t.requests.forEach((e=>{var t="serverTiming"===e.entryType;if(!t||!n){var r=s.maskRequestFn(e);t||(n=!r),r&&i.push(r)}})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Ro(e)||Po(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>jo({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Ro(e)||Po(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>jo({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Oo("request",r.recordHeaders),n=Oo("response",r.recordHeaders),s=Ls(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var c,v,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=e=>($o({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Do({body:e,options:r,url:a})),c=t.performance.now(),y(e));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),v=t.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),$o({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Do({body:d.response,options:r,url:a})),Ao(t,"xmlhttprequest",f.url,c,v).then((t=>{var r=jo({entry:t,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(e){Eo.error("Failed to instrument XHR for network capture",e)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Oo("request",i.recordHeaders),s=Oo("response",i.recordHeaders),o=Ls(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u;try{l=new Request(t,a)}catch(e){return Eo.error("Failed to instrument fetch for network capture",e),o(t,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((e,t)=>{v[t]=e})),n&&(c.requestHeaders=v),!Bo(null==a?void 0:a.body)&&$o({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(c.requestBody=yield function(e){return Qo.apply(this,arguments)}({r:l,options:i,url:t}))}catch(e){Eo.error("Failed to record fetch request for network capture",e)}h=r.performance.now(),u=Fo(t)?yield o(l):yield o(t,a),d=r.performance.now();var f={};return u.headers.forEach(((e,t)=>{f[t]=e})),s&&(c.responseHeaders=f),$o({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(c.responseBody=yield function(e){return Jo.apply(this,arguments)}({r:u,options:i,url:t})),u}finally{Ao(r,"fetch",l.url,h,d).then((t=>{var r,i=jo({entry:t,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),Ko=()=>{a(),l(),u(),Ko=null}}var Xo=e=>({name:"rrweb/network@1",observer:Yo,options:e}),ea="undefined"!=typeof globalThis?globalThis:Yn;ea&&"undefined"==typeof self&&(ea.self=ea),ea&&"undefined"==typeof File&&(ea.File=function(){});var ta=null!=Yn?Yn:{};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Jt,getRecordNetworkPlugin:Xo},ta.__PosthogExtensions__.rrweb={record:$t,version:"v2",wasMaxDepthReached:()=>ce,resetMaxDepthState(){ce=!1,de=!1}},ta.rrweb={record:$t,version:"v2"},ta.rrwebConsoleRecord={getRecordConsolePlugin:Jt},ta.getRecordNetworkPlugin=Xo;var ra,ia,na,sa,oa,aa,la,ua,ha,da,ca,va,fa,pa,ga,ma={},ya=[],ba=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_a=Array.isArray;function wa(e,t){for(var r in t)e[r]=t[r];return e}function xa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ka(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?ra.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return Sa(e,o,i,n,null)}function Sa(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++na:n,__i:-1,__u:0};return null==n&&null!=ia.vnode&&ia.vnode(s),s}function Ca(e){return e.children}function Ta(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function Ia(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],s=wa({},t);s.__v=t.__v+1,ia.vnode&&ia.vnode(s),Na(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?$(t):r,!!(32&t.__u),n),s.__v=t.__v,s.__.__k[s.__i]=s,qa(i,s,n),t.__e=t.__=null,s.__e!=r&&Ma(s)}}function Ma(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),Ma(e)}function Ea(e){(!e.__d&&(e.__d=!0)&&sa.push(e)&&!Ra.__r++||oa!=ia.debounceRendering)&&((oa=ia.debounceRendering)||aa)(Ra)}function Ra(){try{for(var e,t=1;sa.length;)sa.length>t&&sa.sort(la),e=sa.shift(),t=sa.length,Ia(e)}finally{sa.length=Ra.__r=0}}function Pa(e,t,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||ya,b=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=Sa(null,o,null,null,null):_a(o)?o=e.__k[s]=Sa(Ca,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=Sa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+c,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=Fa(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Ua(a,a));return i}(r,t,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ma,v.__i=d,g=Na(e,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&Ba(c.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||c.__k===v.__k?(l=Oa(v,l,e,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function Oa(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=Oa(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Fa(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function La(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||ba.test(t)?r:r+"px"}function $a(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||La(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||La(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(ca,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r[da]=i[da]:(r[da]=va,e.addEventListener(t,s?pa:fa,s)):e.removeEventListener(t,s?pa:fa,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Aa(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[ha])t[ha]=va++;else if(r[da]>t[ha])return;return r(ia.event?ia.event(t):t)}}}function Na(e,t,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S,C=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(h=ia.__b)&&h(t);e:if("function"==typeof C){d=o.length;try{if(y=t.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],_=h?$?$.props.value:h.__:i,r.__c?m=(c=t.__c=r.__c).__=c.__E:(b?t.__c=c=new C(y,_):(t.__c=c=new Ta(y,_),c.constructor=C,c.render=za),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),b&&null==c.__s&&(c.__s=c.state),b&&null!=C.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=wa({},c.__s)),wa(c.__s,C.getDerivedStateFromProps(y,c.__s))),f=c.props,p=c.state,c.__v=t,v)b&&null==C.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),b&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,_),t.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,_)){t.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),ya.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,_),b&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=_,c.props=y,c.__P=e,c.__e=!1,w=ia.__r,x=0,b)c.state=c.__s,c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),ya.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,w&&w(t),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=wa(wa({},i),c.getChildContext())),b&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Ca&&null==h.key?ja(h.props.children):h,a=Pa(e,_a(k)?k:[k],t,r,i,n,s,o,a,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(e){if(o.length=d,t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),t.__e=a}else{if(null!=s)for(S=s.length;S--;)xa(s[S]);Da(t)}else t.__e=r.__e,!t.__k&&r.__k&&(t.__k=r.__k),e.then||Da(t);ia.__e(e,t,r)}}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=Ha(r.__e,t,r,i,n,s,o,l,u);return(h=ia.diffed)&&h(t),128&t.__u?void 0:a}function Da(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Da))}function qa(e,t,r){for(var i=0;r.length>i;i++)Ba(r[i],r[++i],r[++i]);ia.__c&&ia.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){ia.__e(e,t.__v)}}))}function ja(e){return"object"!=typeof e||null==e||e.__b>0?e:_a(e)?e.map(ja):void 0!==e.constructor?null:wa({},e)}function Ha(e,t,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ma,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,s[u]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),a&&(ia.__m&&ia.__m(t,s),a=!1),s=null}if(null==y)g===m||a&&e.data==m||(e.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&ra.call(e.childNodes),!a&&null!=s)for(g={},u=0;e.attributes.length>u;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||$a(e,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||$a(e,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),Pa("template"==t.type?e.content:e,_a(c)?c:[c],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&$(r,0),a,l),null!=s)for(u=s.length;u--;)xa(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&$a(e,u,f,g[u],n),u="checked",null!=p&&p!=e[u]&&$a(e,u,p,g[u],n))}return e}function Ba(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){ia.__e(e,r)}}function Ua(e,t,r){var i,n;if(ia.unmount&&ia.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Ba(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){ia.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&Ua(i[n],t,r||"function"!=typeof e.type);r||xa(e.__e),e.__c=e.__=e.__e=void 0}function za(e,t,r){return this.constructor(e,r)}function Va(e,t,r){var i,n,s;t==document&&(t=document.documentElement),ia.__&&ia.__(e,t),i=t.__k,n=[],s=[],Na(t,e=t.__k=ka(Ca,null,[e]),i||ma,ma,t.namespaceURI,i?null:t.firstChild?ra.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),qa(n,e,s),e.props.children=null}ra=ya.slice,ia={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},na=0,Ta.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=wa({},this.state),"function"==typeof e&&(e=e(wa({},r),this.props)),e&&wa(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ea(this))},Ta.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ea(this))},Ta.prototype.render=Ca,sa=[],aa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,la=function(e,t){return e.__v.__b-t.__v.__b},Ra.__r=0,ua=Math.random().toString(8),ha="__d"+ua,da="__a"+ua,ca=/(PointerCapture)$|Capture$/i,va=0,fa=Aa(!1),pa=Aa(!0),ga=0;var Wa,Za,Ga,Qa,Ja=0,Ka=[],Ya=ia,Xa=Ya.__b,el=Ya.__r,tl=Ya.diffed,rl=Ya.__c,il=Ya.unmount,nl=Ya.__;function sl(e,t){Ya.__h&&Ya.__h(Za,e,Ja||t),Ja=0;var r=Za.__H||(Za.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ol(e){return Ja=1,function(e,t,r){var i=sl(Wa++,2);if(i.t=e,!i.__c&&(i.__=[ml(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Za,!Za.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==e;if(i.__c.__H.__.some((function(e){if(e.__N){n=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s){var a=s.call(this,e,t,r);return n?a||o:a}return!n||o};Za.__f=!0;var s=Za.shouldComponentUpdate,o=Za.componentWillUpdate;Za.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},Za.shouldComponentUpdate=n}return i.__N||i.__}(ml,e)}function al(e,t){var r=sl(Wa++,3);!Ya.__s&&gl(r.__H,t)&&(r.__=e,r.u=t,Za.__H.__h.push(r))}function ll(e){return Ja=5,ul((function(){return{current:e}}),[])}function ul(e,t){var r=sl(Wa++,7);return gl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function hl(e){var t=Za.context[e.__c],r=sl(Wa++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Za)),t.props.value):e.__}function dl(){for(var e;e=Ka.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(fl),t.__h.some(pl),t.__h=[]}catch(r){t.__h=[],Ya.__e(r,e.__v)}}}Ya.__b=function(e){Za=null,Xa&&Xa(e)},Ya.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),nl&&nl(e,t)},Ya.__r=function(e){el&&el(e),Wa=0;var t=(Za=e.__c).__H;t&&(Ga===Za?(t.__h=[],Za.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.length&&dl(),Wa=0)),Ga=Za},Ya.diffed=function(e){tl&&tl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ka.push(t)&&Qa===Ya.requestAnimationFrame||((Qa=Ya.requestAnimationFrame)||vl)(dl)),t.__H.__.some((function(e){e.u&&(e.__H=e.u,e.u=void 0)}))),Ga=Za=null},Ya.__c=function(e,t){t.some((function(e){try{e.__h.some(fl),e.__h=e.__h.filter((function(e){return!e.__||pl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ya.__e(r,e.__v)}})),rl&&rl(e,t)},Ya.unmount=function(e){il&&il(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{fl(e)}catch(e){t=e}})),r.__H=void 0,t&&Ya.__e(t,r.__v))};var cl="function"==typeof requestAnimationFrame;function vl(e){var t,r=function(){clearTimeout(i),cl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);cl&&(t=requestAnimationFrame(r))}function fl(e){var t=Za,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Za=t}function pl(e){var t=Za;e.__c=e.__(),Za=t}function gl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function ml(e,t){return"function"==typeof t?t(e):t}var yl="gzip-js",bl="base64",_l="events",wl="cancelEvents",xl={Tab:"tab",Selector:"selector"},kl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Sl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Cl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Tl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Il={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Ml="always",El={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Rl={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Pl="popover";function Ol(e){return"$survey_response_"+e}function Fl(e,t){if(!t)return null;var r=e[Ol(t)];return Sr(r)?[...r]:r}function Ll(e,t){void 0===e&&(e={});var i={};return t.questions.forEach((t=>{if(!Mr(t.originalQuestionIndex)){var r,n=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Fl(e,t.id);Mr(s)||(i[n]=s)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:Fl(e,t.id)})))},e,i)}function $l(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function Al(e){return"string"==typeof e&&e.trim()?e.trim():null}function Nl(e){return e.toLowerCase()}function Dl(e,t,r){if(!e||!t)return null;var i=Nl(t),n=Object.keys(e).find((e=>Nl(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(e).find((e=>Nl(e)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}function ql(e,t,i){var n,s=Dl(e.translations,t,i),o=r({},e),a=!1;if(s){var l,u=null==(l=e.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Mr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Mr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Mr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Mr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Mr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Mr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(e){return!(Mr(e.thankYouMessageHeader)&&Mr(e.thankYouMessageDescription)&&Mr(e.thankYouMessageCloseButtonText)&&Mr(e.submitButtonText)&&Mr(e.backButtonText))}(u)&&(a=!0))}var h=e.questions.map((e=>function(e,t,i){var n,s=Dl(e.translations,t,i);if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(n=e.translations)?void 0:n[s];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var a=r({},e),l=!1;return Mr(o.question)||(a.question=o.question,l=!0),Mr(o.description)||(a.description=o.description,l=!0),Mr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Mr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Mr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Mr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(e){return Sr(e.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:e,matchedKey:l?s:null,hasChanges:l}}(e,t,i))),d=h.map((e=>e.question)),c=h.some((e=>e.hasChanges)),v=null;return s||(v=(null==(n=h.find((e=>e.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:a?s||v:null}}function jl(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Hl(e){var t;return jl(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Bl=vs("[Surveys]");function Ul(e){return!(!e.start_date||e.end_date)}function zl(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Vl="seenSurvey_",Wl="inProgressSurvey_",Zl=(e,t)=>""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t),Gl=e=>Zl(Vl,e),Ql=e=>{try{var t=Gl(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Bl.error("Failed to persist survey seen state",e)}},Jl=[Cl.Popover,Cl.Widget,Cl.API],Kl={ignoreConditions:!1,ignoreDelay:!1,displayType:Pl},Yl="$people_distinct_id",Xl="$device_id",eu="$device_model",tu="__alias",ru="__timers",iu="$autocapture_disabled_server_side",nu="$heatmaps_enabled_server_side",su="$exception_capture_enabled_server_side",ou="$error_tracking_suppression_rules",au="$error_tracking_capture_extension_exceptions",lu="$web_vitals_enabled_server_side",uu="$dead_clicks_enabled_server_side",hu="$product_tours_enabled_server_side",du="$web_vitals_allowed_metrics",cu="$session_recording_remote_config",vu="$replay_sample_rate",fu="$replay_override_sampling",pu="$replay_override_linked_flag",gu="$replay_override_url_trigger",mu="$replay_override_event_trigger",yu="$sesid",bu="$session_is_sampled",_u="$enabled_feature_flags",wu="$active_feature_flags",xu="$early_access_features",ku="$feature_flag_details",Su="$feature_flag_payloads",Cu="$feature_flag_request_id",Tu="$minimal_flag_called_events",Iu="$override_feature_flags",Mu="$override_feature_flag_payloads",Eu="$stored_person_properties",Ru="$stored_group_properties",Pu="$surveys",Ou="$surveys_loaded_at",Fu="$surveys_activated",Lu="$surveys_activated_session",$u="ph_product_tours",Au="$flag_call_reported",Nu="$flag_call_reported_session_id",Du="$feature_flag_errors",qu="$feature_flag_evaluated_at",ju="$user_state",Hu="$client_session_props",Bu="$capture_rate_limit",Uu="$initial_campaign_params",zu="$initial_referrer_info",Vu="$initial_person_info",Wu="$epp",Zu="$posthog_cookieless",Gu="$cookieless_mode",Qu="$sdk_debug_extensions_init_method",Ju="$sdk_debug_extensions_init_time_ms",Ku="$sdk_debug_recording_script_not_loaded",Yu="PostHog loadExternalDependency extension not found.",Xu="on_reject",eh="always",th="anonymous",rh="identified",ih="identified_only",nh="visibilitychange",sh="beforeunload",oh="$pageview",ah="$pageleave",lh="$identify",uh="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Fr(e)&&isFinite(e)&&Math.floor(e)===e});class hh{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new hh(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new hh(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class dh{generate(){var e=this.generateOrAbort();if(!Mr(e))return e;this.S=0;var t=this.generateOrAbort();if(Mr(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return hh.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new fh}}var ch,vh=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Yn&&!Mr(Yn.crypto)&&crypto.getRandomValues&&(vh=e=>crypto.getRandomValues(e));class fh{nextUint32(){return this.R.length>this.O||(vh(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var ph=()=>gh().toString(),gh=()=>(ch||(ch=new dh)).generate(),mh=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function yh(e,t,r){return Cs({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var bh={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>mh(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!mh(t,e))))),icontains:(e,t)=>t.map(_h).some((t=>e.map(_h).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(_h).every((t=>e.map(_h).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},_h=e=>e.toLowerCase();function wh(e,t){return!e||Object.entries(e).every((e=>{var r=e[1],i=null==t?void 0:t[e[0]];if(Mr(i)||Pr(i))return!1;var n=[String(i)],s=bh[r.operator];return!!s&&s(r.values,n)}))}var xh=e=>{if(ts){try{for(var t=e+"=",r=ts.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},kh="",Sh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Ch={N:()=>!!ts,D(e){cs.error("cookieStore error: "+e)},A:xh,F(e){var t;try{t=JSON.parse(Ch.A(e))||{}}catch(e){}return t},q(e,t,r,i,n){if(!ts)return!1;try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=ts),kh)return kh;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+ph();!kh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",kh=s)}return kh}(e);if(!r){var i=(e=>{var t=e.match(Sh);return t?t[0]:""})(e);i!==r&&cs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(ts.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&cs.warn("cookieStore warning: large cookie, len="+u.length),ts.cookie=u,!0}catch(e){return!1}},P(e,t){if(null!=ts&&ts.cookie)try{Ch.q(e,"",-1,t)}catch(e){return}}},Th=null,Ih={N(){if(!Pr(Th))return Th;var e=!0;if(Mr(Yn))e=!1;else try{var t="__mplssupport__";Ih.q(t,"xyz"),'"xyz"'!==Ih.A(t)&&(e=!1),Ih.P(t)}catch(t){e=!1}return e||cs.error("localStorage unsupported; falling back to cookie store"),Th=e,e},D(e){cs.error("localStorage error: "+e)},A(e){try{return null==Yn?void 0:Yn.localStorage.getItem(e)}catch(e){Ih.D(e)}return null},F(e){try{return JSON.parse(Ih.A(e))||{}}catch(e){}return null},q(e,t){try{return null==Yn||Yn.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Ih.D(e)}return!1},P(e){try{null==Yn||Yn.localStorage.removeItem(e)}catch(e){Ih.D(e)}}},Mh=[Xl,"distinct_id",yu,bu,Wu,Vu,ju],Eh={},Rh={N:()=>!0,D(e){cs.error("memoryStorage error: "+e)},A:e=>Eh[e]||null,F:e=>Eh[e]||null,q:(e,t)=>(Eh[e]=t,!0),P(e){delete Eh[e]}},Ph=null,Oh={N(){if(!Pr(Ph))return Ph;if(Ph=!0,Mr(Yn))Ph=!1;else try{var e="__support__";Oh.q(e,"xyz"),'"xyz"'!==Oh.A(e)&&(Ph=!1),Oh.P(e)}catch(e){Ph=!1}return Ph},D(e){cs.error("sessionStorage error: ",e)},A(e){try{return null==Yn?void 0:Yn.sessionStorage.getItem(e)}catch(e){Oh.D(e)}return null},F(e){try{return JSON.parse(Oh.A(e))||null}catch(e){}return null},q(e,t){try{return null==Yn||Yn.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Oh.D(e)}return!1},P(e){try{null==Yn||Yn.sessionStorage.removeItem(e)}catch(e){Oh.D(e)}}},Fh=vs("[Stylesheet Loader]"),Lh=Yn,$h=ts,Ah="#020617",Nh={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:kl.Right,widgetType:xl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Ah,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Dh=[kl.Center,kl.Left,kl.Right];function qh(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function jh(e){var t;void 0===e&&(e=Nh.backgroundColor),"#"===e[0]&&(t=qh(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=qh(r)),!t)return Ah;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Ah:"white"}return Ah}var Hh=(e,t,i)=>{var n=sd(e),s=$h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=$h.createElement("div");((e,t,i)=>{var n=r({},Nh,i),s=e.style,o=!Dh.includes(n.position)||t===Cl.Widget&&(null==i?void 0:i.widgetType)===xl.Tab;s.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||jh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",jh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||jh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",jh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||jh(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i=e.createElement("style");i.innerText=t;var n=(e=>{var t;return Cr(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Fh.error("prepare_external_dependency_stylesheet returned null"),null)})($h,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return $h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Bh=e=>{var t=e.responses,i=e.survey,n=e.surveySubmissionId,s=e.posthog,o=e.isSurveyCompleted,a=e.properties,l=e.surveyLanguage;s?(Ql(i),s.capture(El.SENT,r({[Rl.SURVEY_NAME]:i.name,[Rl.SURVEY_ID]:i.id,[Rl.SURVEY_ITERATION]:i.current_iteration,[Rl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Rl.SURVEY_SUBMISSION_ID]:n,[Rl.SURVEY_COMPLETED]:o},l&&{[Rl.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Ll(t,i),a,{$set:{[$l(i,"responded")]:!0}})),o&&(Lh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),nd(i),s.reloadFeatureFlags())):Bl.error("[survey sent] event not captured, PostHog instance not found.")},Uh=(e,t,i)=>{return r({[Rl.SURVEY_NAME]:e.name,[Rl.SURVEY_ID]:e.id,[Rl.SURVEY_ITERATION]:e.current_iteration,[Rl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Rl.SURVEY_PARTIALLY_COMPLETED]:(n=null==t?void 0:t.responses,void 0===n&&(n={}),Object.values(n).some((e=>!Or(e))))},(null==t?void 0:t.surveyLanguage)&&{[Rl.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Rl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},Ll(null==t?void 0:t.responses,e));var n},zh=(e,t,i,n)=>{if(t){if(!i){var s=rd(e);t.capture(El.DISMISSED,r({},Uh(e,s,t),n&&{[Rl.SURVEY_LANGUAGE]:n},{$set:{[$l(e,"dismissed")]:!0}})),nd(e),Ql(e),Lh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Bl.error("[survey dismissed] event not captured, PostHog instance not found.")},Vh=(e,t)=>{if(t){var r=(e=>Zl("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=rd(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(El.ABANDONED,Uh(e,i,t),{transport:"sendBeacon"})}}else Bl.error("[survey abandoned] event not captured, PostHog instance not found.")},Wh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Zh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Gh=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Zh(e.questions,Wh(e.questions)):e.questions,Qh=e=>Hl(e)||id(e),Jh=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Ea(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+ga++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Kh=()=>hl(Jh),Yh=e=>{var t=e.children,r=e.style;return function(e,t,r){var i,n,s,o,a=wa({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?ra.call(arguments,2):r),Sa(e.type,a,i||e.key,n||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:r}:{children:t,style:r})};function Xh(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=Ns(t);if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return bh[o](s,[n])}var ed=e=>Zl(Wl,e),td=(e,t)=>{try{localStorage.setItem(ed(e),JSON.stringify(t))}catch(e){Bl.error("Error setting in-progress survey state in localStorage",e)}},rd=e=>{try{var t=localStorage.getItem(ed(e));if(t)return JSON.parse(t)}catch(e){Bl.error("Error getting in-progress survey state from localStorage",e)}return null},id=e=>{var t=rd(e);return!Or(null==t?void 0:t.surveySubmissionId)},nd=e=>{try{localStorage.removeItem(ed(e))}catch(e){Bl.error("Error clearing in-progress survey state from localStorage",e)}};function sd(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function od(e,t,r){if(void 0===t&&(t=kl.Right),e===Cl.ExternalSurvey)return{};switch(t){case kl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case kl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case kl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case kl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case kl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case kl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case kl.Left:return{left:"30px"};case kl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Cl.Widget&&r===xl.Tab?"60px":"30px"}}}var ad=0;function ld(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ad,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ia.vnode&&ia.vnode(u),u}var ud=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),hd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),dd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),cd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),vd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:ld("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),fd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:ld("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),pd=ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:ld("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),gd=function(e){var t=(void 0===e?{}:e).fill,r=void 0===t?"currentColor":t;return ld("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[ld("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),ld("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]})},md=ld("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ld("g",{"clip-path":"url(#clip0_2415_6911)",children:[ld("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:ld("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),ld("g",{mask:"url(#mask0_2415_6911)",children:[ld("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),ld("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),ld("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),ld("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),ld("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),ld("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),ld("defs",{children:ld("clipPath",{id:"clip0_2415_6911",children:ld("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function yd(e){var t=e.urlParams,r=t?Object.entries(t).map((e=>{var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)})).join("&"):"";return ld("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",md]})}function bd(e){var t=e.text,r=e.submitDisabled,i=e.appearance,n=e.onSubmit,s=e.link,o=e.onPreviewSubmit,a=e.skipSubmitButton,l=e.canGoBack,u=e.onBack,h=hl(Jh).isPreviewMode,d=!!l&&!!u,c=!a&&ld("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==Yn||Yn.open(s)),h?null==o||o():n()},children:t});return ld("div",{className:"bottom-section",children:[d?ld("div",{className:"form-buttons form-buttons-with-back",children:[ld("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&ld(yd,{urlParams:{utm_source:"survey-footer"}})]})}function _d(e){var t=e.question,r=e.forceDisableHtml;return ld("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[ld(t.type===Tl.Open?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&Yh({component:ka("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function wd(e){return ld("button",{className:"form-cancel",onClick:e.onClick,disabled:hl(Jh).isPreviewMode,"aria-label":"Close survey",type:"button",children:gd({fill:"black"})})}ld("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ld("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var xd=Yn;function kd(e){var t=e.header,r=e.description,i=e.contentType,n=e.forceDisableHtml,s=e.appearance,o=e.onClose,a=hl(Jh).isPopup;return al((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return ks(xd,"keydown",e),()=>{xd.removeEventListener("keydown",e)}}),[o]),ld("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&ld(wd,{onClick:()=>o()}),ld("h3",{className:"thank-you-message-header",children:t}),r&&Yh({component:ka("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&ld(bd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Sd=e=>Sr(e)&&e.every((e=>Er(e)));function Cd(e){var t=e.question,r=e.forceDisableHtml,i=e.appearance,n=e.onSubmit,s=e.onPreviewSubmit,o=e.displayQuestionIndex,a=e.initialValue,l=e.canGoBack,u=e.onBack,h=Kh().isPreviewMode,d=ll(null),c=ol((()=>Er(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;al((()=>{p||setTimeout((()=>{var e;h||null==(e=d.current)||e.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=ul((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case nr:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case sr:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,t.validation,t.optional)),[v,t.validation,t.optional]),y=gn(t.validation,nr),b=gn(t.validation,sr),_=ul((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return ld(Ca,{children:[ld("div",{className:"question-container",children:[ld(_d,{question:t,forceDisableHtml:r,htmlFor:g}),ld("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(e){f(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||m||(e.preventDefault(),h?x():w())},value:v}),_&&ld("div",{className:"validation-hint",children:_})]}),ld(bd,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Td(e){var t=e.question,r=e.appearance,i=e.onSubmit,n=e.onPreviewSubmit,s=e.canGoBack,o=e.onBack;return ld(Ca,{children:[ld("div",{className:"question-container",children:ld(_d,{question:t,forceDisableHtml:e.forceDisableHtml})}),ld(bd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Id(e){var t,r=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,s=e.appearance,o=e.onSubmit,a=e.onPreviewSubmit,l=e.initialValue,u=e.canGoBack,h=e.onBack,d=r.scale,c=10===r.scale?0:1,v=ol((()=>Fr(l)?l:Sr(l)&&l.length>0&&Fr(parseInt(l[0]))?parseInt(l[0]):Er(l)&&Fr(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Kh().isPreviewMode,y=e=>m?a(e):o(e);return ld(Ca,{children:[ld("div",{className:"question-container",children:[ld(_d,{question:r,forceDisableHtml:i}),ld("div",{className:"rating-section",children:[ld("div",{className:"rating-options",children:["emoji"===r.display&&ld("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(t=Fd[r.scale])?void 0:t.map(((e,t)=>ld("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===f?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;p(e),r.skipSubmitButton&&y(e)},children:e},t)))}),"number"===r.display&&ld("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:Ld(r.scale).map(((e,t)=>ld(Md,{displayQuestionIndex:n,active:f===e,appearance:s,num:e,setActiveNumber(e){p(e),r.skipSubmitButton&&y(e)}},t)))})]}),!g&&ld("div",{className:"rating-text",children:[ld("div",{children:r.lowerBoundLabel}),ld("div",{children:r.upperBoundLabel})]})]})]}),ld(bd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Pr(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Md(e){var t=e.num,r=e.setActiveNumber;return ld("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick(){r(t)},children:t})}function Ed(e){var t=e.question,i=e.forceDisableHtml,n=e.displayQuestionIndex,s=e.appearance,o=e.onSubmit,a=e.onPreviewSubmit,l=e.initialValue,u=e.canGoBack,h=e.onBack,d=ll(null),c=ul((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=Zh(t,Wh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),v=ol((()=>((e,t)=>Er(e)||Sd(e)?e:t===Tl.SingleChoice?null:[])(l,t.type))),f=v[0],p=v[1],g=ol((()=>((e,t)=>{if(Er(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Sd(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],b=Kh().isPreviewMode,_=t.type===Tl.SingleChoice,w=t.type===Tl.MultipleChoice,x=t.skipSubmitButton&&_&&!t.hasOpenChoice,k=(e,t)=>{if(t){var i=!m.isSelected;return y((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),_&&p(""),void(i&&setTimeout((()=>{var e;return null==(e=d.current)?void 0:e.focus()}),75))}if(_)return p(e),y((e=>r({},e,{isSelected:!1,inputValue:""}))),void(x&&(o(e),b&&a(e)));w&&Sr(f)&&(f.includes(e)?p(f.filter((t=>t!==e))):p([...f,e]))},S=e=>{e.stopPropagation();var t=e.currentTarget.value;y((e=>r({},e,{inputValue:t}))),_&&p(t)},C=e=>{e.stopPropagation(),"Enter"!==e.key||T()||(e.preventDefault(),I()),"Escape"===e.key&&(e.preventDefault(),y((e=>r({},e,{isSelected:!1,inputValue:""}))),_&&p(null))},T=()=>!(t.optional||!Pr(f)&&(!Sr(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),I=()=>{m.isSelected&&w?Sr(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return ld(Ca,{children:[ld("div",{className:"question-container",children:[ld(_d,{question:t,forceDisableHtml:i}),ld("fieldset",{className:"multiple-choice-options limit-height",children:[ld("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:_?f===e:Sr(f)&&f.includes(e);return ld("label",{className:i?"choice-option-open":"",children:[ld("div",{className:"response-choice",children:[ld("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>k(e,i),id:s,"aria-controls":o}),ld("span",{children:i?e+":":e})]}),i&&ld("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:S,onClick(t){m.isSelected||k(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),ld(bd,{text:t.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:I,onPreviewSubmit:I,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var Rd=[1,2,3,4,5],Pd=[1,2,3,4,5,6,7],Od=[0,1,2,3,4,5,6,7,8,9,10],Fd={2:[fd,pd],3:[dd,hd,ud],5:[cd,dd,hd,ud,vd]};function Ld(e){switch(e){case 5:default:return Rd;case 7:return Pd;case 10:return Od}}var $d=vs("[Surveys]");function Ad(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Il.End:s;if(n.branching.type===Il.End)return Il.End;if(n.branching.type===Il.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Il.ResponseBased){if(n.type===Tl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Il.End?Il.End:s}}else if(n.type===Tl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Il.End?Il.End:s}}return s}return $d.warn("Falling back to next question index due to unexpected branching type"),s}var Nd="https?://(.*)",Dd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],qd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Dd],jd="<masked>",Hd=["li_fat_id"];function Bd(e,t,r){if(!ts)return{};var i,n=t?[...Dd,...r||[]]:[],s=Ud(Es(ts.URL,n,jd),e),o=(i={},ps(Hd,(function(e){var t=xh(e);i[e]=t||null})),i);return gs(o,s)}function Ud(e,t){var r=qd.concat(t||[]),i={};return ps(r,(function(t){var r=Ms(e,t);i[t]=r||null})),i}function zd(e){var t=function(e){return e?0===e.search(Nd+"google.([^/?]*)")?"google":0===e.search(Nd+"bing.com")?"bing":0===e.search(Nd+"yahoo.com")?"yahoo":0===e.search(Nd+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Pr(t)){i.$search_engine=t;var n=ts?Ms(ts.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Vd(){return navigator.language||navigator.userLanguage}var Wd="$direct";function Zd(){return(null==ts?void 0:ts.referrer)||Wd}function Gd(e,t,r){void 0===r&&(r=!1);var i=e?[...Dd,...t||[]]:[],n=r?en(null==rs?void 0:rs.href):null==rs?void 0:rs.href,s=null==n?void 0:n.substring(0,1e3);return{r:Zd().substring(0,1e3),u:s?Es(s,i,jd):void 0}}function Qd(e,t){var r;void 0===t&&(t=!1);var i=e.r,n=e.u,s=t?en(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==Wd?Wd:null==(r=Ts(i))?void 0:r.host};if(s){o.$current_url=s;var a=Ts(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=Ud(s);gs(o,l)}if(i){var u=zd(i);gs(o,u)}return o}function Jd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Kd(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var Yd=vs("[SurveyTranslations]");function Xd(e,t){var r=function(e){return function(e,t){var r=e.storedPersonProperties,i=e.locale,n=Al(e.overrideLanguage);if(n)return null==t||t.info("Using override display language: "+n),n;var s=function(e){return e&&"object"==typeof e&&"language"in e?Al(e.language):null}(r);if(s)return null==t||t.info("Using person property language: "+s),s;var o=Al(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Cr(e.get_property)?e.get_property(Eu):void 0,locale:Vd()},Yd)}(t);if(!r)return Yd.info("No user language detected"),{survey:e,language:null};var i=ql(e,r,Yd);return{survey:i.survey,language:i.matchedKey}}var ec=Yn,tc=ts,rc="ph:show_survey_widget",ic="PHWidgetSurveyClickListener";function nc(e,t){try{var r=e.getBoundingClientRect(),i=ec.innerHeight,n=ec.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:Nh.zIndex}}catch(e){return Bl.warn("Failed to calculate trigger position:",e),null}}class sc{constructor(e){var t=this;this.j=new Map,this.H=new Map,this.B=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(Pu);if(e)for(var t of e)id(t)&&Vh(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,a=this.U(e),l=a.survey,u=a.language,h=null!=t&&t.position||null!=t&&t.selector?r({},l,{appearance:r({},l.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):l;this.W(h.id);var d=null!=t?t:{},c=d.properties,v=d.initialResponses,f=!(!v||0>=Object.keys(v).length)&&this.V(h,v,c,u);if(!f||null!=(i=h.appearance)&&i.displayThankYouMessage){this.Z(h);var p={};if((null==(n=h.appearance)?void 0:n.position)===kl.NextToTrigger&&null!=(s=h.appearance)&&s.widgetSelector){var g,m=tc.querySelector(h.appearance.widgetSelector);m&&(p=nc(m,parseInt((null==(g=h.appearance)?void 0:g.maxWidth)||Nh.maxWidth))||{})}var y=(null==(o=h.appearance)?void 0:o.surveyPopupDelaySeconds)||0,b=Hh(h,this._posthog).shadow,_={posthog:this._posthog,survey:h,removeSurveyFromFocus:this.$,properties:c,style:p,isSurveyCompleted:f,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:u};if(0>=y)return Va(ld(uc,r({},_)),b);var w=setTimeout((()=>{if(this.j.delete(h.id),!this.G(h))return Bl.info("Survey "+h.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(h);Va(ld(uc,r({},_,{survey:r({},h,{appearance:r({},h.appearance,{surveyPopupDelaySeconds:0})})})),b)}),1e3*y);this.j.set(h.id,w)}},this.Y=e=>{var t=this.U(e),r=t.survey,i=t.language,n=Hh(r,this._posthog),s=n.shadow;n.isNewlyCreated&&Va(ld(dc,{posthog:this._posthog,survey:r,surveyLanguage:i},e.id),s)},this.J=e=>{this.K(e);var t=this.H.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(ic),this.H.delete(e.id),Bl.info("Removed click listener for survey "+e.id))},this.X=(e,t)=>{var r=tc.querySelector(t),i=this.H.get(e.id);if(r){if(this.Y(e),i){if(r===i.element)return;Bl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.J(e)}if(!r.hasAttribute(ic)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===kl.NextToTrigger?nc(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Nh.maxWidth)):{};ec.dispatchEvent(new CustomEvent(rc,{detail:{surveyId:e.id,position:n}}))};ks(r,"click",n),r.setAttribute(ic,"true"),this.H.set(e.id,{element:r,listener:n,survey:e}),Bl.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.J(e)},this.renderPopover=e=>{var t=this.U(e),r=t.survey,i=t.language,n=Hh(r,this._posthog).shadow;Va(ld(uc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.$,surveyLanguage:i}),n)},this.renderSurvey=(e,t,r)=>{var i,n=this.U(e),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ee(s,o)),Va(ld(uc,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.G(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Cl.Popover||e.type===Cl.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.j.keys()))i.has(n)||t.cancelSurvey(n);var s=t.te(r),o=new Set;s.forEach((e=>{if(e.type===Cl.Widget){var r,i,n,s;if((null==(r=e.appearance)?void 0:r.widgetType)===xl.Tab)return void t.Y(e);(null==(i=e.appearance)?void 0:i.widgetType)===xl.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.X(e,null==(s=e.appearance)?void 0:s.widgetSelector))}Pr(t.re)&&e.type===Cl.Popover&&t.handlePopoverSurvey(e)})),t.H.forEach((e=>{var r=e.survey;o.has(r.id)||t.J(r)}))}),e)},this.Z=e=>{Pr(this.re)||Bl.error("Survey "+this.re+" already in focus. Cannot add survey "+e.id+"."),this.re=e.id},this.$=e=>{this.re!==e.id&&Bl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.W(e.id),this.re=null,this.K(e)},this._posthog=e,this.re=null}W(e){var t=this.j.get(e);t&&(clearTimeout(t),this.j.delete(e))}cancelSurvey(e){this.j.has(e)&&(Bl.info("Cancelled pending survey "+e),this.W(e),this.re===e&&(this.re=null))}te(e){return e.sort(((e,t)=>{var r,i,n=id(e),s=id(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===Ml,a=t.schedule===Ml;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(e){return Xd(e,this._posthog)}ee(e,t){if(this.B.has(e.id))return!1;var r=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Mr(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var c=parseInt(d[1],10);t[c]||(t[c]=[]),t[c].push(h)}}else r=!0}}return{params:t,autoSubmit:r}}(ec.location.search),i=r.params;if(0===Object.keys(i).length)return!1;Bl.info("[Survey Prefill] Detected URL prefill parameters");var n=this.ne(e,i,t);if(!n)return!1;var s=n.responses,o=n.submissionId,a=n.isSurveyCompleted,l=n.skippedResponses;return(Object.keys(l).length>0&&e.enable_partial_responses||a)&&Bh({responses:a?s:l,survey:e,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,surveyLanguage:t}),this.B.add(e.id),a}V(e,t,r,i){var n={};for(var s of Object.entries(t)){var o=s[1];n[parseInt(s[0])]=Sr(o)?o.map(String):[String(o)]}Bl.info("[Survey] Processing initial responses");var a=this.ne(e,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return Bh({responses:a.responses,survey:e,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}ne(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=Ol(e.id);try{switch(e.type){case Tl.SingleChoice:if(!e.choices||0===e.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void cs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Tl.MultipleChoice:if(!e.choices||0===e.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void cs.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&cs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Tl.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||0>u||u>h)return void cs.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:cs.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){cs.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return Bl.warn("[Survey Prefill] No valid responses after conversion"),null;var n=ph(),s=Object.keys(t).map((e=>parseInt(e,10))),o=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=Ol(o.id);Mr(r[a])||(n[a]=r[a])}var l=Ad(e,i,o.id?r[Ol(o.id)]:null);if(l===Il.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=e.questions.length;return td(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,surveyLanguage:r}),Bl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(e){return Bl.error("[Survey Prefill] Error handling prefill:",e),null}}ie(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}ae(e){return!e.conditions||Xh(e,this._posthog)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!as)return!1;var s=Ki(as,{userAgentDataPlatform:null==es||null==(r=es.userAgentData)?void 0:r.platform,maxTouchPoints:null==es?void 0:es.maxTouchPoints,screenWidth:null==Yn||null==(i=Yn.screen)?void 0:i.width,screenHeight:null==Yn||null==(n=Yn.screen)?void 0:n.height,devicePixelRatio:null==Yn?void 0:Yn.devicePixelRatio});return bh[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==$h||!$h.querySelector(e.conditions.selector))}(e)}oe(e){var t;return Qh(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._posthog.featureFlags)&&t.hasLoadedFlags?{satisfied:this.ie(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Ul(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Jl.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this.ie(e.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ie(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.oe(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Ih.A("lastSeenSurveyDate"))?(e=>!!Ih.A(Gl(e))&&!Qh(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this.se(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t}se(e){var t;if(!jl(e)&&!zl(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}ue(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var t=e.value;return!e.key||!t||this.ie(t)}))}G(e){return this.checkSurveyEligibility(e).eligible&&this.ae(e)&&this.se(e)&&this.ue(e)}K(e){try{var t=tc.querySelector(sd(e,!0));null!=t&&t.shadowRoot&&Va(null,t.shadowRoot),null==t||t.remove()}catch(t){Bl.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.j,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function oc(e,t){if(tc&&ec){var r,i=new sc(e);if(e.config.disable_surveys_automatic_display)return Bl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Bl.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Mr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),ks(tc,"visibilitychange",(()=>{tc.hidden?Mr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function ac(e){var t=e.survey,r=e.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=e.setSurveyVisible,s=e.isPreviewMode,o=void 0!==s&&s,a=e.posthog;al((()=>{var e;if(!o&&null!=(e=t.conditions)&&e.url){var r=()=>{var e,r=t.type===Cl.Widget,s=Xh(t,a),o=(null==(e=t.appearance)?void 0:e.widgetType)===xl.Tab&&r;if(!s)return Bl.info("Hiding survey "+t.id+" because URL does not match"),n(!1),i(t);o&&(Bl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),n(!0))};ks(ec,"popstate",r),ks(ec,"hashchange",r);var s=ec.history.pushState,l=ec.history.replaceState;return ec.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.apply(this,t),r()},ec.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];l.apply(this,t),r()},()=>{ec.removeEventListener("popstate",r),ec.removeEventListener("hashchange",r),ec.history.pushState=s,ec.history.replaceState=l}}}),[o,t,i,n,a])}function lc(e){switch(void 0===e&&(e=Sl.Right),e){case Sl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Sl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Sl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function uc(e){var t,i,n,s,o,a,l=e.survey,u=e.forceDisableHtml,h=e.posthog,d=e.style,c=void 0===d?{}:d,v=e.previewPageIndex,f=e.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=e.isPopup,m=void 0===g||g,y=e.onPreviewSubmit,b=void 0===y?()=>{}:y,_=e.onPreviewBack,w=void 0===_?()=>{}:_,x=e.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=e.onCloseConfirmationMessage,C=void 0===S?()=>{}:S,T=e.properties,I=e.isSurveyCompleted,M=e.skipShownEvent,E=e.surveyLanguage,R=ll(null),P=Number.isInteger(v),O=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,F=function(e,t,i,n,s,o,a,l,u){var h=ol(n||0===i||e.type===Cl.ExternalSurvey),d=h[0],c=h[1],v=ol(!1),f=v[0],p=v[1],g=()=>{var t=()=>{o&&s(e),c(!1)};tc.startViewTransition?tc.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},m=t=>{t.detail.surveyId===e.id&&g()};return al((()=>{if(t){if(!n){var s=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(Xh(e,t)){c(!0),ec.dispatchEvent(new Event("PHSurveyShown")),l||t.capture(El.SHOWN,r({[Rl.SURVEY_NAME]:e.name,[Rl.SURVEY_ID]:e.id,[Rl.SURVEY_ITERATION]:e.current_iteration,[Rl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[Rl.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};if(ks(ec,"PHSurveyClosed",m),ks(ec,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),ec.removeEventListener("PHSurveyClosed",m),ec.removeEventListener("PHSurveySent",s)}}return o(),()=>{ec.removeEventListener("PHSurveyClosed",m),ec.removeEventListener("PHSurveySent",s)}}}else Bl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ac({survey:e,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:t}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,O,P,p,m,R,M,E),L=F.isPopupVisible,A=F.hidePopupWithViewTransition,N=F.isSurveySent||v===l.questions.length||!0===I,D=ul((()=>{var e=rd(l),t=(null==e?void 0:e.surveySubmissionId)||ph();return{isPreviewMode:P,previewPageIndex:v,onPopupSurveyDismissed(){E?zh(l,h,P,E):zh(l,h,P),k()},isPopup:m||!1,surveySubmissionId:t,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:T,surveyLanguage:E}}),[P,v,m,h,l,k,b,w,T,E]);return L?ld(Jh.Provider,{value:D,children:ld("div",{className:"ph-survey",style:r({},od(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:N?ld(kd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Nh,onClose(){A(),C()}}):ld(hc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function hc(e){var t,i,n=e.survey,s=e.forceDisableHtml,o=e.posthog,a=ol((()=>{var e=rd(n);return null!=e&&e.responses&&Bl.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),l=a[0],u=a[1],h=hl(Jh),d=h.previewPageIndex,c=h.onPopupSurveyDismissed,v=h.isPopup,f=h.onPreviewSubmit,p=h.onPreviewBack,g=h.surveySubmissionId,m=h.isPreviewMode,y=h.properties,b=h.surveyLanguage,_=ol((()=>{var e=rd(n);return d||(null==e?void 0:e.lastQuestionIndex)||0})),w=_[0],x=_[1],k=ol((()=>{var e,t=rd(n);return null!==(e=null==t?void 0:t.visitedIndices)&&void 0!==e?e:[]})),S=k[0],C=k[1],T=ul((()=>Gh(n)),[n]);al((()=>{m&&!Mr(d)&&x(d)}),[d,m]);var I=!(null==(t=n.appearance)||!t.allowGoBack)&&(m?(null!=d?d:0)>0:S.length>0),M=T.at(w);return M?ld("form",{className:"survey-form",name:"surveyForm",children:[v&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&ld(wd,{onClick(){c()}}),ld("div",{className:"survey-box","data-question-index":w,children:cc({question:M,forceDisableHtml:s,displayQuestionIndex:w,appearance:n.appearance||Nh,onSubmit:e=>(e=>{var t=e.res,i=e.displayQuestionIndex,s=e.questionId;if(o)if(s){var a=Ol(s),h=r({},l,{[a]:t});u(h);var d=Ad(n,i,t),c=d===Il.End,v=[...S,i];if(c||(C(v),x(d),td(n,{surveySubmissionId:g,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:b})),n.enable_partial_responses||c){var f=new Set(v.map((e=>{var t;return null==(t=T[e])?void 0:t.id})).filter((e=>!!e)).map((e=>Ol(e)))),p=Object.fromEntries(Object.entries(h).filter((e=>f.has(e[0]))));Bh({responses:p,survey:n,surveySubmissionId:g,isSurveyCompleted:c,posthog:o,properties:y,surveyLanguage:b})}}else Bl.error("onNextButtonClick called without a questionId.");else Bl.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:w,questionId:M.id}),onPreviewSubmit:f,initialValue:M.id?l[Ol(M.id)]:void 0,canGoBack:I,onBack(){if(m)p();else if(0!==S.length){var e=S[S.length-1],t=S.slice(0,-1);C(t),x(e),td(n,{surveySubmissionId:g,responses:l,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:b})}}})})]}):null}function dc(e){var t,r,i,n,s,o,a,l=e.survey,u=e.forceDisableHtml,h=e.posthog,d=e.readOnly,c=e.surveyLanguage,v=ol(!0),f=v[0],p=v[1],g=ol(!1),m=g[0],y=g[1],b=ol({}),_=b[0],w=b[1],x=()=>{y(!m)};if(al((()=>{var e;if(h){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&w({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Bl.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return ks(ec,rc,t),()=>{ec.removeEventListener(rc,t)}}}else Bl.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),ac({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==Ml&&p(!1),setTimeout((()=>{y(!1)}),200)};return ld(Ca,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&ld("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Sl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:lc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&ld(uc,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:c})]})}var cc=e=>{var t=e.question,i=e.onSubmit,n=e.onPreviewSubmit,s={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit(e){n(e)},onSubmit(e){i(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Tl.Open:return ka(Cd,r({},s,{question:t,key:t.id}));case Tl.Link:return ka(Td,r({},s,{question:t,key:t.id}));case Tl.Rating:return ka(Id,r({},s,{question:t,key:t.id}));case Tl.SingleChoice:case Tl.MultipleChoice:return ka(Ed,r({},s,{question:t,key:t.id}));default:return Bl.error("Unsupported question type: "+t.type),null}};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.generateSurveys=oc,ta.extendPostHogWithSurveys=oc;var vc=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),fc=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return vc(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(e.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?s=o-1:n=o}return vc(t,JSON.stringify(e.slice(0,n)),r)},pc=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,gc=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},mc=(e,t,r)=>{if(!r.truncated)if(Tr(e)){if(r.seen.has(e))return void gc(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(mc(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else gc(t,e,r)},yc=function(e,t,r,i,n,s){if(void 0===n&&(n=!1),!pc(e))return!n||vc(t,"null",r);if(Pr(e)||(e=>{try{return Fr(e)||$r(e)}catch(e){return!1}})(e))return vc(t,JSON.stringify(e),r);if("string"==typeof e)return fc(e,t,r);if(!Tr(e)&&!Sr(e))return vc(t,JSON.stringify(e),r);if(i.has(e))return fc("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(Cr(o))return yc(o.call(e),t,r,i,n)}catch(e){}try{var a={}.toString.call(e);if("[object String]"===a)return fc(String(e.valueOf()),t,r);if("[object Number]"===a||"[object Boolean]"===a)return vc(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var l={};try{for(var u in e)({}).hasOwnProperty.call(e,u)&&(l[u]=e[u])}catch(e){}try{l.name=e.name}catch(e){}try{l.message=e.message}catch(e){}try{l.stack=e.stack}catch(e){}return yc(l,t,r,i,n,s)}if(Sr(e)){if(!vc(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!vc(t,",",r))return!1;var d=void 0;try{d=e[h]}catch(e){d=void 0}if(!yc(d,t,r,i,!0))return!1}return vc(t,"]",r)}if(!vc(t,"{",r))return!1;var c=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(s)try{mc(f,v,s)}catch(e){}if(pc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=t.length,m=r.remaining,y=r.truncated;if(!vc(t,p,r))return!1;var b=t.length,_=yc(f,t,r,i,!1),w=r.truncated;if(t.length!==b){if(c=!1,!_)return!1}else if(t.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(e){}return vc(t,"}",r)},bc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.logs={initializeLogs(e){var t={host:ta.location.host},i=!1,n=function(n){var s=ta.console[n],o=(s=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{if(l.length>0&&!i&&e.is_capturing()){var h;i=!0,o=!0;var d=((e,t)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Tr(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,s=0;e.length>s&&(0>=s||vc(r," ",i))&&yc(e[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),c=d.body,v=d.attributes,f=r({},t,d.truncated?{body_truncated:"true"}:{});null==(h=e.logs)||h.le({level:bc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(e){}finally{o&&(i=!1),s.apply(ta.console,l)}})(s);o.__rrweb_original__=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(s),ta.console[n]=o};for(var s of Object.keys(bc))n(s)}};var _c=vs("[Error tracking]");function wc(){return new wn([new Ln,new zn,new An,new $n,new Bn,new Hn,new Dn,new Un],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=On.test(l)?l.replace(On,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,e);if(d){s.push(d);break}}if(s.length>=Fn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Fn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||xn});var i}))}(s)}}("web:javascript",Mn,Pn))}var xc=vs("[ExceptionAutocapture]"),kc=wc(),Sc={wrapOnError(e){var t=Yn;t||xc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){var t,i=kc.buildFromUnknown((arguments.length>4?arguments[4]:void 0)||(arguments.length>0?arguments[0]:void 0),{mechanism:{handled:!1}});return e(i),!!Cr(r)&&null!==(t=r(...arguments))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Yn;t||xc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var i,n=kc.buildFromUnknown(t,{mechanism:{handled:!1}});return e(n),!!Cr(r)&&null!==(i=r(t))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||xc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=kc.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});e(a),Cr(r)&&r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.errorWrappingFunctions=Sc,ta.posthogErrorWrappingFunctions=Sc;var Cc="X-POSTHOG-SESSION-ID",Tc="X-POSTHOG-WINDOW-ID",Ic="X-POSTHOG-DISTINCT-ID",Mc=[Cc,Tc,Ic],Ec=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Rc=(e,t)=>({}.hasOwnProperty.call(e,t)),Pc=e=>"object"==typeof e&&!Pr(e)||Cr(e),Oc=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),Fc=e=>{try{var t;return Oc(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Yn||null==(t=Yn.location)?void 0:t.href).toString()}catch(e){return}},Lc=(e,t,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(Sr(e)&&!e.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Cc,a.sessionId),n.set(Tc,l),o=!0}var u=(e=>Cr(e)?e():e)(t);return u&&u!==Zu&&(n.set(Ic,u),o=!0),o};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{};var $c={_patchFetch:(e,t,i)=>Ls(Yn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=Fc(s);if(u)if(Oc(s)){var h=new Request(s,o);Lc(e,t,i,h.url,h.headers),l=[h]}else{var d=new Headers(Pc(o)?o.headers:void 0);if(Lc(e,t,i,u,d)){var c=((e,t)=>{if(Mr(e)||Pr(e))return{headers:t};if(Pc(e)){var i=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),n}return new Proxy({headers:t},{get:(e,t)=>Rc(e,t)?Reflect.get(e,t):Reflect.get(i,t,i),has:(e,t)=>Rc(e,t)||t in i,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(i).forEach((e=>t.add(e))),Ec.forEach((e=>{e in i&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n)return n;if("string"==typeof t&&Ec.includes(t)&&t in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,t,i)}};var s=Reflect.getOwnPropertyDescriptor(i,t);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(e){l=a}return n.apply(this,l)})),_patchXHR:(e,t,r)=>Ls(Yn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=Fc(s);d&&Lc(e,t,r,d,h);var c=i.call(u,n,s,o,a,l);return Mc.forEach((e=>{var t=h.get(e);if(t)try{u.setRequestHeader(e,t)}catch(e){}})),c}))};ta.__PosthogExtensions__.tracingHeadersPatchFns=$c,ta.postHogTracingHeadersPatchFns=$c,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var Ac=-1,Nc=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Ac=t.timeStamp,e(t))}),!0)},Dc=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},qc=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},jc=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Hc=()=>{var e,t;return null!==(e=null==(t=jc())?void 0:t.activationStart)&&void 0!==e?e:0},Bc=function(e,t){void 0===t&&(t=-1);var r=jc(),i="navigate";return 0>Ac?r&&(document.prerendering||Hc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Uc=new WeakMap;function zc(e,t){var r=Uc.get(t);return r||(r=new WeakMap,Uc.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class Vc{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var Wc,Zc=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},Gc=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Qc=-1,Jc=new Set,Kc=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Yc=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Jc)t();isFinite(Qc)||(Qc="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Yc,!0))}},Xc=()=>{if(0>Qc){var e,t=Hc(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;Qc=null!=r?r:Kc(),addEventListener("visibilitychange",Yc,!0),addEventListener("prerenderingchange",Yc,!0),Nc((()=>{setTimeout((()=>{Qc=Kc()}))}))}return{get firstHiddenTime(){return Qc},onHidden(e){Jc.add(e)}}},ev=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},tv=[1800,3e3],rv=function(e,t){void 0===t&&(t={}),ev((()=>{var r,i=Xc(),n=Bc("FCP"),s=Zc("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-Hc(),0),n.entries.push(t),r(!0)))}));s&&(r=Dc(e,n,tv,t.reportAllChanges),Nc((i=>{n=Bc("FCP"),r=Dc(e,n,tv,t.reportAllChanges),qc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},iv=[.1,.25],nv=0,sv=1/0,ov=0,av=e=>{for(var t of e)t.interactionId&&(sv=Math.min(sv,t.interactionId),ov=Math.max(ov,t.interactionId),nv=ov?(ov-sv)/7+1:0)},lv=()=>{var e;return Wc?nv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},uv=0;class hv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){uv=lv(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((lv()-uv)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var dv=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=Gc(e),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},cv=[200,500];class vv{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var fv=[2500,4e3],pv={onLCP(e,t){void 0===t&&(t={}),ev((()=>{var r,i=Xc(),n=Bc("LCP"),s=zc(t,vv),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Hc(),0),n.entries=[o],r())},a=Zc("largest-contentful-paint",o);if(a){r=Dc(e,n,fv,t.reportAllChanges);var l=Gc((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(dv(l),removeEventListener(e.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Nc((i=>{n=Bc("LCP"),r=Dc(e,n,fv,t.reportAllChanges),qc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=Xc();rv(Gc((()=>{var i,n=Bc("CLS",0),s=zc(t,Vc),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Zc("layout-shift",o);a&&(i=Dc(e,n,iv,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Nc((()=>{s.i=0,n=Bc("CLS",0),i=Dc(e,n,iv,t.reportAllChanges),qc(i)})),setTimeout(i))})))},onFCP:rv,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Xc();ev((()=>{var i;"interactionCount"in performance||Wc||(Wc=Zc("event",av,{durationThreshold:0}));var n,s=Bc("INP"),o=zc(t,hv),a=e=>{dv((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=Zc("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=Dc(e,s,cv,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Nc((()=>{o.v(),s=Bc("INP"),n=Dc(e,s,cv,t.reportAllChanges)})))}))}}};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.postHogWebVitalsCallbacks=pv,ta.postHogWebVitalsCallbacks=pv,ta.__PosthogExtensions__.loadWebVitalsCallbacks=()=>pv;class gv{constructor(e){this.disabled=!1===e;var t=Tr(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var mv="$copy_autocapture",yv=vs("[AutoCapture]");function bv(e,t){return t.length>e?t.slice(0,e)+"...":t}function _v(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Us(t));return t}function wv(e,t){var i,n,s=t.e,o=t.maskAllElementAttributes,a=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!Us(e))return{props:{}};for(var d=[e],c=new Set([e]),v=e;v.parentNode&&!zs(v,"body")&&Zs>d.length;)if(Ws(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!Us(v.parentNode))break;if(c.has(v.parentNode))break;c.add(v.parentNode),d.push(v.parentNode),v=v.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(ps(d,(e=>{var t=fo(e);if(zs(e,"a")){var r=e.getAttribute("href");b=!!(t&&r&&xo(r))&&(h?en(r):r)}mr(Js(e),"ph-no-capture")&&(_=!0),m.push(function(e,t,r,i,n){void 0===n&&(n=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};eo.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?bv(1024,ko(e)):bv(1024,Ys(e)));var a=Js(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),ps(e.attributes,(function(r){var s;if((!po(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&xo(r.value)&&(!Er(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=Gs(a).join(" ")),o["attr__"+r.name]=bv(1024,"href"===r.name&&n?en(a):a)}}));for(var l=1,u=1,h=e;h=_v(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,h));var i=function(e){if(!fo(e))return{};var t={};return ps(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&xo(i)&&(t[r]=i)}})),t}(e);gs(y,i)})),_)return{props:{},explicitNoCapture:_};if(a||(m[0].$el_text=zs(e,"a")||zs(e,"button")?ko(e):Ys(e)),b){var w,x;m[0].attr__href=b;var k=null==(w=Ts(b))?void 0:w.host,S=null==Yn||null==(x=Yn.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:gs({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(e){return e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ms(o).sort(((e,t)=>e[0].localeCompare(t[0]))).forEach((e=>{var t=e[1];return a[Co(e[0].toString())]=Co(t.toString())})),(n+=":")+ms(a).map((e=>e[0]+'="'+e[1]+'"')).join("")})).join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:To(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ms(e).filter((e=>0===e[0].indexOf("attr__"))).forEach((e=>i.attributes[e[0]]=e[1])),i}))}(g)))},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var xv={};function kv(e){return function(e,t){var r=xv[e];if(r)return r;var i=t[e];if((e=>Cr(e)&&-1!==e.toString().indexOf("[native code]"))(i)&&(null==Yn||!Yn.Zone))return xv[e]=i.bind(t);var n=t.document;if(n&&Cr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[e]&&(i=o[e]),n.head.removeChild(s)}catch(t){cs.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Cr(i)?xv[e]=i.bind(t):i}("MutationObserver",e)}function Sv(e,t){var i=Xs(e);return i?r({node:i,originalEvent:e,timestamp:Date.now()},t):null}function Cv(e,t){return Math.abs(e)<Math.abs(t)?0>t?"up":"down":0>e?"left":"right"}function Tv(e){return"swipe"===e.type?"$dead_swipe":"$dead_click"}var Iv="canvas,video,audio,embed,object";function Mv(e,t){return Fr(e)&&e>=t}class Ev{ce(e){var t,r,i,n,s,o,a,l,u=this.de((null==e?void 0:e.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==e?void 0:e.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==e?void 0:e.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==e?void 0:e.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(e,t){this.ve=[],this.fe=0,this.de=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:e}),this.pe=e=>{var t=Sv(e,{type:"click"});Pr(t)||this.me(t)||this.ve.push(t),this.ye()},this.ge=()=>{var e=Date.now();this.be=e,e%50==0&&this.ve.forEach((t=>{Mr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.we=()=>{this.xe=Date.now()},this.ke=()=>{"visible"===(null==ts?void 0:ts.visibilityState)&&(this.Se=Date.now())},this.Ce=e=>{var t=e.touches,r=1===(null==t?void 0:t.length)?t[0]:void 0;this._e=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Ie=()=>{this._e=void 0},this.Me=e=>{var t,r=this._e;if(this._e=void 0,!Mr(r)&&this.Te.max_dead_swipes_per_page_load>this.fe){var i=e,n=null==(t=i.changedTouches)?void 0:t[0];if(n){var s=n.clientX-r.x,o=n.clientY-r.y,a=s*s+o*o,l=this.Te.swipe_threshold_px;if(a>=l*l&&![this.be,this.Re,this.xe].some((e=>Fr(e)&&e>=r.timestamp))){var u;if(this.Ee()&&(null!==(u=null==ts||null==ts.elementsFromPoint?void 0:ts.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((e=>null==e.matches?void 0:e.matches(Iv))))return;var h=Sv(i,{type:"swipe",swipeDirection:Cv(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Pr(h)||this.me(h)||this.ve.push(h),this.ye()}}}},this.instance=e,this.Te=this.ce(t),this._onCapture=this.Te.__onCapture}start(e){this.Le(),this.Oe(),this.Ne(),this.qe(),this.Ae(e),this.Te.capture_dead_swipes&&this.Pe()}Ae(e){if(!this.De){var t=kv(ta);this.De=new t((e=>{this.Fe(e)})),this.De.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.De)||e.disconnect(),this.De=void 0,ta.removeEventListener("click",this.pe),ta.removeEventListener("scroll",this.ge,{capture:!0}),ta.removeEventListener("selectionchange",this.we),ta.removeEventListener("touchstart",this.Ce,{capture:!0}),ta.removeEventListener("touchend",this.Me,{capture:!0}),ta.removeEventListener("touchcancel",this.Ie,{capture:!0}),null==ts||ts.removeEventListener("visibilitychange",this.ke),this._e=void 0}Fe(e){this.Re=Date.now()}Le(){ks(ta,"click",this.pe)}ye(){this.ve.length&&Mr(this.je)&&(this.je=ta.setTimeout((()=>{this.He()}),1e3))}Oe(){ks(ta,"scroll",this.ge,{capture:!0})}Ne(){ks(ta,"selectionchange",this.we)}qe(){ks(ts,"visibilitychange",this.ke)}Pe(){ks(ta,"touchstart",this.Ce,{capture:!0,passive:!0}),ks(ta,"touchend",this.Me,{capture:!0,passive:!0}),ks(ta,"touchcancel",this.Ie,{capture:!0,passive:!0})}Ee(){var e=Mr(this.Be)||Fr(this.Re)&&this.Re>this.Be;return(Mr(this.Ue)||e)&&(this.Be=Date.now(),this.Ue=!(null==ts||!ts.querySelector(Iv))),!!this.Ue}me(e){return!e||("swipe"===e.type?this.We(e):this.Ve(e))}We(e){if(Bs(e.node))return!0;var t=this.ve.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!t&&!zs(e.node,"html")&&Us(e.node)&&function(e,t){var r;if(!Yn||co(e))return!1;var i=$r(t)?ao:null!==(r=null==t?void 0:t.css_selector_ignorelist)&&void 0!==r?r:ao;return!to(vo(e,!1).targetElementList,i)}(e.node,{css_selector_ignorelist:this.Te.css_selector_ignorelist}))}Ve(e){return!(this.Te.capture_clicks_with_modifier_keys||(t=e.originalEvent,!(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)))||!!this.We(e)||(r=e.node,!(!Yn||co(r))&&vo(r,!1).targetElementList.some((e=>zs(e,"a"))));var t,r}He(){if(this.ve.length){clearTimeout(this.je),this.je=void 0;var e=this.ve;for(var t of(this.ve=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Re&&this.Re>=t.timestamp?this.Re-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.xe&&this.xe>=t.timestamp?this.xe-t.timestamp:void 0,t.visibilityChangedDelayMs=this.Se?Math.abs(t.timestamp-this.Se):void 0;var i=Mv(t.scrollDelayMs,this.Te.scroll_threshold_ms),n=Mv(t.selectionChangedDelayMs,this.Te.selection_change_threshold_ms),s=Mv(t.mutationDelayMs,this.Te.mutation_threshold_ms),o=Mv(t.absoluteDelayMs,1.1*this.Te.mutation_threshold_ms),a=Fr(t.scrollDelayMs)&&this.Te.scroll_threshold_ms>t.scrollDelayMs,l=Fr(t.mutationDelayMs)&&this.Te.mutation_threshold_ms>t.mutationDelayMs,u=Fr(t.selectionChangedDelayMs)&&this.Te.selection_change_threshold_ms>t.selectionChangedDelayMs,h=Fr(t.visibilityChangedDelayMs)&&this.Te.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=Mv(t.visibilityChangedDelayMs,this.Te.selection_change_threshold_ms);if(i||s||o||n||d){var c=Tv(t);if("$dead_swipe"===c){if(this.fe>=this.Te.max_dead_swipes_per_page_load)continue;this.fe++}this._onCapture(t,{[c+"_last_mutation_timestamp"]:this.Re,[c+"_event_timestamp"]:t.timestamp,[c+"_scroll_timeout"]:i,[c+"_mutation_timeout"]:s,[c+"_absolute_timeout"]:o,[c+"_selection_changed_timeout"]:n,[c+"_visibility_changed_timeout"]:d})}else this.Te.mutation_threshold_ms>t.absoluteDelayMs&&this.ve.push(t)}}this.ye()}}he(e,t){var i=Tv(e);this.instance.capture(i,r({},t,wv(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:e.scrollDelayMs,[i+"_mutation_delay_ms"]:e.mutationDelayMs,[i+"_absolute_delay_ms"]:e.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:e.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:e.visibilityChangedDelayMs,$dead_swipe_direction:e.swipeDirection,$dead_swipe_distance_px:e.swipeDistancePx}),{timestamp:new Date(e.timestamp)})}}ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Ev(e,t);var Rv=vs("[ExternalScriptsLoader]"),Pv=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Rv.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==ts?void 0:ts.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===t){var e=i[o];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!ts)return r("document not found");var i=ts.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)ts.head.appendChild(i);else{var n,s=ts.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):ts.body.appendChild(i)}};null!=ts&&ts.body?a():null==ts||ts.addEventListener("DOMContentLoaded",a)};ta.__PosthogExtensions__=ta.__PosthogExtensions__||{},ta.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var i;if(e.config.strict_script_versioning)i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var n="/static/"+t+".js?v="+e.version;if("toolbar"===t){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=e.requestRouter.endpointFor("assets",n)}Pv(e,i,r)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Pv(e,o,r)}},ta.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);Pv(e,i,r)};hs.DEBUG=!1,hs.LIB_VERSION="1.407.8",hs.LIB_NAME="web";class Ov{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===eh||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===Xu}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Jt.q(this.Kt,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Jt.P(this.Kt,this.Te.cross_subdomain_cookie)}get Kt(){var e=this._instance.config,t=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+t:"__ph_opt_in_out_"+t)}get Qt(){var e=this.Jt.A(this.Kt);return Ur(e)?1:mr(zr,e)?0:-1}get Jt(){var e=this.Te.opt_out_capturing_persistence_type,t="localStorage"===e?Ih:Ch;if(!this.Yt||this.Yt!==t){this.Yt=t;var r="localStorage"===e?Ch:Ih;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(Ur(r.A(this.Kt))),r.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[null==es?void 0:es.doNotTrack,null==es?void 0:es.msDoNotTrack,ta.doNotTrack].some((e=>Ur(e)))}}var Fv=vs("[Dead Clicks]"),Lv=()=>!0,$v=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(uu)),i=e.instance.config.capture_dead_clicks;return $r(i)?i:!!Tr(i)||r};class Av{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[uu]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Fv.error("failed to load script",t):e()}))}tr(){var e;if(ts){if(!this.Xt&&null!=(e=ta.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Tr(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Xt=ta.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Xt.start(ts),Fv.info("starting...")}}else Fv.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Fv.info("stopping..."))}}var Nv=vs("[SegmentIntegration]");var Dv="posthog-js";function qv(e,t){var i=void 0===t?{}:t,n=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return t=>{var i,a,u,d,c;if("*"!==l&&!l.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=t.exception)?void 0:i.values)||[],g=p.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||t.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:t.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+t.event_id),h&&(null==(f=e.exceptions)||f.sendExceptionEvent(m)),t}}class jv{constructor(e,t,r,i,n,s){this.name=Dv,this.setupOnce=function(o){o(qv(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Hv{constructor(e){this.rr=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(cs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.rr)}destroy(){var e;null==(e=this.sr)||e.call(this),this.sr=void 0}doPageView(e,t){var r,i=this.ar(e,t);return this.ir={pathname:null!==(r=null==Yn?void 0:Yn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.ar(e,null==(t=this.ir)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ir)?void 0:e.pageViewId}}ar(e,t){var r=this.ir;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Mr(s)||Mr(o)||Mr(a)||Mr(l)||Mr(u)||Mr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Vr(o/s,0,1,cs):1,c=s>1?Vr(a/s,0,1,cs):1,v=l>1?Vr(u/l,0,1,cs):1,f=l>1?Vr(h/l,0,1,cs):1;i=gs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Bv=["flags","surveys"],Uv={[Yl]:{exposure:"hidden"},[tu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ru]:{exposure:"hidden"},[iu]:{exposure:"event"},[nu]:{exposure:"hidden"},[su]:{exposure:"event"},[ou]:{exposure:"hidden"},[au]:{exposure:"event"},[lu]:{exposure:"event"},[uu]:{exposure:"event"},[hu]:{exposure:"hidden"},[du]:{exposure:"event"},[cu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[yu]:{exposure:"hidden"},[bu]:{exposure:"event"},[vu]:{exposure:"event",shouldSkipFromEventProperties:e=>Pr(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[_u]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!Tr(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[wu]:{exposure:"event",storageGroup:"flags"},[xu]:{exposure:"hidden"},[ku]:{exposure:"hidden",storageGroup:"flags"},[Su]:{exposure:"event",storageGroup:"flags"},[Cu]:{exposure:"event",storageGroup:"flags",volatile:!0},[Tu]:{exposure:"hidden",storageGroup:"flags"},[Iu]:{exposure:"event"},[Mu]:{exposure:"hidden"},[Eu]:{exposure:"hidden"},[Ru]:{exposure:"hidden"},[Pu]:{exposure:"hidden",storageGroup:"surveys"},[Ou]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Fu]:{exposure:"event"},[Lu]:{exposure:"hidden"},[$u]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Au]:{exposure:"hidden"},[Nu]:{exposure:"hidden"},[Du]:{exposure:"hidden"},[qu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ju]:{exposure:"hidden"},[Hu]:{exposure:"hidden"},[Bu]:{exposure:"hidden"},[Uu]:{exposure:"hidden"},[zu]:{exposure:"hidden"},[Vu]:{exposure:"hidden"},[Wu]:{exposure:"hidden"},[fu]:{exposure:"event"},[pu]:{exposure:"event"},[gu]:{exposure:"event"},[mu]:{exposure:"event"},[Qu]:{exposure:"event"},[Ju]:{exposure:"event"},[Ku]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},zv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Vv=e=>{var t=Uv[e];if(t)return t;for(var r of zv){var i=r[1];if(0===e.indexOf(r[0]))return i}},Wv={flags:qu,surveys:Ou},Zv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Gv="main";class Qv{constructor(e,t,i){if(void 0===i&&(i=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=i,this.props={},this.cr=!1,this.vr=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Jt=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&cs.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save(),Yn){var n=()=>this.flush();ks(Yn,"beforeunload",n,{capture:!1}),ks(Yn,"pagehide",n,{capture:!1})}}mr(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return Fr(t)&&t>0?t:0}isDisabled(){return!!this.yr}pr(e){-1===Zv.indexOf(e.persistence.toLowerCase())&&(cs.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var i=[...Mh,...e];return r({},Ih,{F(e){try{var r={};try{r=Ch.F(e)||{}}catch(e){}var i,n=JSON.parse(Ih.A(e)||"{}");if(t){var s={};for(var o in r){var a=r[o];Pr(a)||""===a||(s[o]=a)}i=gs(n,s)}else i=gs(r,n);return Ih.q(e,i),i}catch(e){}return null},q(e,t,r,n,s,o){var a=Ih.q(e,t,void 0,void 0,o);try{var l={};i.forEach((e=>{t[e]&&(l[e]=t[e])})),Object.keys(l).length&&Ch.q(e,l,r,n,s,o)}catch(e){Ih.D(e)}return a},P(e,t){try{null==Yn||Yn.localStorage.removeItem(e),Ch.P(e,t)}catch(e){Ih.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Ih.N()?(t=Ih,n=!0):"localstorage+cookie"===s&&i.N()?(t=i,n=!0):"sessionstorage"===s&&Oh.N()?t=Oh:"memory"===s?t=Rh:"cookie"===s?t=Ch:i.N()?(t=i,n=!0):t=Ch,this.ur=n,t}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var t=null!=e?e:this.Te.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[qu];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return ps(this.props,((t,r)=>{var i=Vv(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===_u?()=>this._r():()=>!1))return;i.transformToEventProperties&&gs(e,i.transformToEventProperties(t))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,(()=>!1)))return;e[r]=t}})),e}load(){if(!this.yr){var e=this.Jt.F(this.vr);e&&(this.props=gs({},e)),this.hr&&this.wr()}}wr(){for(var e of Bv){var t=Ih.F(this.br(e));if(t&&!Ir(t)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(t,e)),this.Tr(e,t)||gs(this.props,t)}}}Sr(e){return Object.keys(this.props).some((t=>{var r;return(null==(r=Vv(t))?void 0:r.storageGroup)===e}))}Tr(e,t){var r=Wv[e];if(!r)return!1;var i=t[r],n=this.props[r];return Fr(i)&&Fr(n)&&n>i}refreshKey(e){var t;if(!this.yr){var r=this.hr?null==(t=Vv(e))?void 0:t.storageGroup:void 0,i=r?Ih.F(this.br(r)):this.Jt.F(this.vr);if(i&&e in i)this.Ir(e,i[e]);else{if(r){var n=this.Jt.F(this.vr);if(n&&e in n)return void this.Ir(e,n[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?Mr(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){Mr(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Jt,this.vr,this.props,Gv))}Pr(){var e=this.Fr(),t=e.main,r=e.groups;for(var i of(this.Or(this.Jt,this.vr,t,Gv),Bv)){var n,s=r[i];(!Ir(s)||null!=(n=this.lr[i])&&n.persisted)&&this.Or(Ih,this.br(i),s,i)}}Fr(){var e={},t={flags:{},surveys:{}};return ps(this.props,((r,i)=>{var n,s=null==(n=Vv(i))?void 0:n.storageGroup;s?t[s][i]=r:e[i]=r})),{main:e,groups:t}}Cr(e,t){if(t===Gv)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return ps(e,((e,t)=>{var i;r[t]=null!=(i=Vv(t))&&i.volatile?"__volatile__":e})),JSON.stringify(r)}Or(e,t,r,i){var n=this.kr(i);if(i===Gv||n.dirty||Mr(n.fingerprint)){var s;try{if((s=this.Cr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.q(t,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(n.dirty=!1,i!==Gv&&(n.persisted=!0),Mr(s)||(n.fingerprint=s)):this.Te.debug&&cs.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,r=void 0!==t&&t;if(Mr(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Jt.P(this.vr,!1),this.Jt.P(this.vr,!0),!r&&this.dr)for(var i of Bv)Ih.P(this.br(i));r?delete this.lr[Gv]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Tr(e)){Mr(t)&&(t="None"),this.Lr=Mr(r)?this.Nr:r;var i=!1;if(ps(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Ir(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Tr(e)){this.Lr=Mr(t)?this.Nr:t;var r=!1;if(ps(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.Ir(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=Bd(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Ir(_s(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=null==ts?void 0:ts.referrer)?zd(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Zd(),$referring_domain:null!=ts&&ts.referrer&&(null==(e=Ts(ts.referrer))?void 0:e.host)||Wd},void 0)}set_initial_person_info(){this.props[Uu]||this.props[zu]||this.register_once({[Vu]:Gd(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};ps([zu,Uu],(t=>{var r=this.props[t];r&&ps(r,(function(t,r){e["$initial_"+br(r)]=t}))}));var t=this.props[Vu];if(t){var r=function(e,t){void 0===t&&(t=!1);var r=Qd(e,t),i={};return ps(r,(function(e,t){i["$initial_"+br(t)]=e})),i}(t,this.Te.disable_capture_url_hashes);gs(e,r)}return e}safe_merge(e){return ps(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=i?this.pr(e):this.Jt,s=this.gr(e);if(i||s!==this.hr){var o=this.props;this.clear(),this.Jt=n,this.hr=s,this.props=o,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[ru]||{};r[e]=t,this.Ir(ru,r),this.save()}remove_event_timer(e){var t=this.props[ru]||{},r=t[e];return Mr(r)||(delete t[e],this.Ir(ru,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Ir(e,t),this.save()}Ir(e,t){var r;this.props[e]=t,null!=(r=Vv(e))&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var t,r=null==(t=Vv(e))?void 0:t.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var Jv=vs("[RateLimiter]");class Kv{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{Jv.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Jv.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(Bu))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(Bu,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Yv=vs("[RemoteConfig]");class Xv{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ta._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}qr(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return Yv.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Yv.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return Yv.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((e=>{this.Hr(e),this.Br()}));this.Hr(e),this.Br()}))}catch(e){Yv.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&ts&&"hidden"!==ts.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.zr=setInterval((()=>{this.refresh()}),t))}}Hr(e){var t;e||Yv.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var ef=Uint8Array,tf=Uint16Array,rf=Uint32Array,nf=new ef([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]),sf=new ef([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]),of=new ef([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),af=function(e,t){for(var r=new tf(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new rf(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},lf=af(nf,2),uf=lf[1];lf[0][28]=258,uf[258]=28;for(var hf=af(sf,0)[1],df=new tf(32768),cf=0;32768>cf;++cf){var vf=(43690&cf)>>>1|(21845&cf)<<1;df[cf]=((65280&(vf=(61680&(vf=(52428&vf)>>>2|(13107&vf)<<2))>>>4|(3855&vf)<<4))>>>8|(255&vf)<<8)>>>1}var ff=function(e,t,r){for(var i=e.length,n=0,s=new tf(t);i>n;++n)++s[e[n]-1];var o,a=new tf(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new tf(1<<t);var l=15-t;for(n=0;i>n;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],d=a[e[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[df[d]>>>l]=u}else for(o=new tf(i),n=0;i>n;++n)o[n]=df[a[e[n]-1]++]>>>15-e[n];return o},pf=new ef(288);for(cf=0;144>cf;++cf)pf[cf]=8;for(cf=144;256>cf;++cf)pf[cf]=9;for(cf=256;280>cf;++cf)pf[cf]=7;for(cf=280;288>cf;++cf)pf[cf]=8;var gf=new ef(32);for(cf=0;32>cf;++cf)gf[cf]=5;var mf=ff(pf,9,0),yf=ff(gf,5,0),bf=function(e){return(e/8>>0)+(7&e&&1)},_f=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof tf?tf:e instanceof rf?rf:ef)(r-t);return i.set(e.subarray(t,r)),i},wf=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},xf=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},kf=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new ef(0),0];if(1==n){var o=new ef(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new tf(c+1),f=Sf(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(s.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=s[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=s[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==t&&(--v[_],++p)}f=t}return[new ef(v),f]},Sf=function(e,t,r){return-1==e.s?Math.max(Sf(e.l,t,r+1),Sf(e.r,t,r+1)):t[e.s]=r},Cf=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new tf(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},Tf=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},If=function(e,t,r){var i=r.length,n=bf(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},Mf=function(e,t,r,i,n,s,o,a,l,u,h){wf(t,h++,r),++n[256];for(var d=kf(n,15),c=d[0],v=d[1],f=kf(s,15),p=f[0],g=f[1],m=Cf(c),y=m[0],b=m[1],_=Cf(p),w=_[0],x=_[1],k=new tf(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=kf(k,7),T=C[0],I=C[1],M=19;M>4&&!T[of[M-1]];--M);var E,R,P,O,F=u+5<<3,L=Tf(n,pf)+Tf(s,gf)+o,A=Tf(n,c)+Tf(s,p)+o+14+3*M+Tf(k,T)+(2*k[16]+3*k[17]+7*k[18]);if(L>=F&&A>=F)return If(t,h,e.subarray(l,l+u));if(wf(t,h,1+(L>A)),h+=2,L>A){E=ff(c,v,0),R=c,P=ff(p,g,0),O=p;var N=ff(T,I,0);for(wf(t,h,b-257),wf(t,h+5,x-1),wf(t,h+10,M-4),h+=14,S=0;M>S;++S)wf(t,h+3*S,T[of[S]]);h+=3*M;for(var D=[y,w],q=0;2>q;++q){var j=D[q];for(S=0;j.length>S;++S)wf(t,h,N[H=31&j[S]]),h+=T[H],H>15&&(wf(t,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=mf,R=pf,P=yf,O=gf;for(S=0;a>S;++S)if(i[S]>255){var H;xf(t,h,E[257+(H=i[S]>>>18&31)]),h+=R[H+257],H>7&&(wf(t,h,i[S]>>>23&31),h+=nf[H]);var B=31&i[S];xf(t,h,P[B]),h+=O[B],B>3&&(xf(t,h,i[S]>>>5&8191),h+=sf[B])}else xf(t,h,E[i[S]]),h+=R[i[S]];return xf(t,h,E[256]),h+R[256]},Ef=new rf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Rf=function(){for(var e=new rf(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Pf=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Of(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Rf[255&r^t[i]]^r>>>8;e=r},d(){return 4294967295^e}}}(),i=e.length;r.p(e);var n,s,o,a,l=(n=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,r,i,n,s){var o=e.length,a=new ef(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=If(l,u,e.subarray(h,d)):(l[h]=!0,u=If(l,u,e.subarray(h,o)))}else{for(var c=Ef[t-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new tf(32768),m=new tf(p+1),y=Math.ceil(r/3),b=2*y,_=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},w=new rf(25e3),x=new tf(288),k=new tf(32),S=0,C=0,T=(h=0,0),I=0,M=0;o>h;++h){var E=_(h),R=32767&h,P=m[E];if(g[R]=P,m[E]=R,h>=I){var O=o-h;if((S>7e3||T>24576)&&O>423){u=Mf(e,l,0,w,x,k,C,T,M,h-M,u),T=S=C=0,M=h;for(var F=0;286>F;++F)x[F]=0;for(F=0;30>F;++F)k[F]=0}var L=2,A=0,N=f,D=R-P&32767;if(O>2&&E==_(h-D))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),H=Math.min(258,O);j>=D&&--N&&R!=P;){if(e[h+L]==e[h+L-D]){for(var B=0;H>B&&e[h+B]==e[h+B-D];++B);if(B>L){if(L=B,A=D,B>q)break;var U=Math.min(D,B-2),z=0;for(F=0;U>F;++F){var V=h-D+F+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,P=V)}}}D+=(R=P)-(P=g[R])+32768&32767}if(A){w[T++]=268435456|uf[L]<<18|hf[A];var Z=31&uf[L],G=31&hf[A];C+=nf[Z]+sf[G],++x[257+Z],++k[G],I=h+L,++S}else w[T++]=e[h],++x[e[h]]}}u=Mf(e,l,!0,w,x,k,C,T,M,h-M,u)}return _f(a,0,i+bf(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Pf(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}}(l,t),Pf(l,u-8,r.d()),Pf(l,u-4,i),l}var Ff=!!ns||!!is,Lf="text/plain",$f=!1,Af=(e,t)=>{var r=e.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return e;var a=o.split("&").filter((e=>e.split("=")[0]!==t)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},Nf=function(e,t,i){var n;void 0===i&&(i=!0);var s=e.split("?"),o=s[0],a=s[1],l=r({},t),u=null!==(n=null==a?void 0:a.split("&").map((e=>{var t,r=e.split("="),n=r[0],s=i&&null!==(t=l[n])&&void 0!==t?t:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Is(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Df=e=>{if(e.Vr)return e.Vr;var t=e.data,r=e.compression;if(t){if(r===yl){var i=Of(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new ef(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new ef(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return _f(i,0,n)}(Cs(t)),{mtime:0});return{contentType:Lf,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===bl){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(Cs(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Cs(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Cs(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},qf=e=>{var t,i,n=()=>"sendBeacon"===e.transport?{url:Nf(e.url,{compression:bl}),encodedBody:Df(r({},e,{compression:bl,Vr:void 0}))}:{url:Af(e.url,"compression"),encodedBody:Df(r({},e,{compression:void 0,Vr:void 0}))};try{t=Df(e)}catch(t){if(hr(e.compression,Ms(e.url,"compression")))return cs.error("Failed to gzip request body, sending uncompressed payload",t),n();throw t}return t&&hr(e.compression,Ms(e.url,"compression"))&&!((i=t.body)instanceof ArrayBuffer?ur(new Uint8Array(i)):ArrayBuffer.isView(i)&&ur(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?($f=!0,n()):{url:e.url,encodedBody:t}},jf=e=>{try{return qf(e)}catch(t){return cs.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},Hf=function(){var e=t((function*(e){var t=Cs(e.data),i=yield function(e,t,r){return fr.apply(this,arguments)}(t,hs.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{Vr:{contentType:Lf,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Bf=/Failed to fetch|NetworkError|Load failed/i,Uf=e=>{var t=jf(e);if(t){var i=t.url,n=t.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;ps(e.headers,(function(e,t){u.append(t,e)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(ss){var c=new ss;h={signal:c.signal,timeout:setTimeout((()=>{var t,r;d=!0,c.abort((t=e.timeout,(r=new Error("PostHog request timed out"+(t?" after "+t+"ms":""))).name="AbortError",r))}),e.timeout)}}var v=t=>{d&&"AbortError"===(null==t?void 0:t.name)||(e=>"TypeError"===(null==e?void 0:e.name)&&Bf.test((null==e?void 0:e.message)||""))(t)?cs.warn(t):cs.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var f;is(i,r({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.Wr&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){cs.error(e)}null==e.callback||e.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(e){h&&clearTimeout(h.timeout),v(e)}}},zf=e=>{try{var t,i=qf(e),n=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(es.sendBeacon(n,u))return;var h=Sr(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Sr(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=t=>Sr(e.data)?t:r({},e.data,{batch:t});return zf(r({},e,{data:c(h.slice(0,d))})),void zf(r({},e,{data:c(h.slice(d))}))}cs.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Uf(r({},e,{Wr:!0}))}catch(e){cs.warn("Beacon send failed",e)}},Vf=(e,t,i,n)=>{var s="query"===n?"POST"===t?"sent_at":"_":void 0;return Nf(i===yl?Af(e,"compression"):e,r({},s?{[s]:Date.now().toString()}:{},i===yl?{}:{compression:i}))},Wf=[];is&&Wf.push({transport:"fetch",method:Uf}),ns&&Wf.push({transport:"XHR",method(e){var t=jf(e);if(t){var r=new ns,i=t.encodedBody;r.open(e.method||"GET",t.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;ps(e.headers,(function(e,t){r.setRequestHeader(t,e)})),s&&r.setRequestHeader("Content-Type",s),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(o)}}}),null!=es&&es.sendBeacon&&Wf.push({transport:"sendBeacon",method:zf});var Zf=3e3;class Gf{constructor(e,t){this.Zr=!0,this.Gr=[],this.Qr=Vr((null==t?void 0:t.flush_interval_ms)||Zf,250,5e3,cs.createLogger("flush interval"),Zf),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ei():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.ti(r({},e,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var t=this.ei(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Sr(r.data)&&ps(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.ti(r)};for(var i in t)r()}}),this.Qr))}ti(e){try{this.Jr(e)}catch(e){cs.error(e)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var e={};return ps(this.Gr,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;Mr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this.Gr=[],e}}var Qf=["retriesPerformedSoFar"];class Jf{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!Mr(Yn)&&"onLine"in Yn.navigator&&(this.ni=Yn.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},ks(Yn,"online",this.si),ks(Yn,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,n=i(e,Qf);Lr(t)&&(n.url=Nf(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.kt(r({retriesPerformedSoFar:t},n));0===e.statusCode&&cs.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==n.callback||n.callback(e)}}))}kt(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(t),i=Date.now()+r;this.Gr.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),cs.warn(n),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),0===this.Gr.length)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var e=Date.now(),t=[],r=this.Gr.filter((r=>e>r.retryAt||(t.push(r),!1)));if(this.Gr=t,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Mr(Yn)||(this.si&&(Yn.removeEventListener("online",this.si),this.si=void 0),this.ai&&(Yn.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var t=e.requestOptions;try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(e){cs.error(e)}}this.Gr=[]}}class Kf{constructor(e){this.hi=()=>{var e,t,r,i;this.di||(this.di={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.di.lastScrollY=Math.ceil(s),this.di.maxScrollY=Math.max(s,null!==(e=this.di.maxScrollY)&&void 0!==e?e:0),this.di.maxScrollHeight=Math.max(o,null!==(t=this.di.maxScrollHeight)&&void 0!==t?t:0),this.di.lastContentY=a,this.di.maxContentY=Math.max(a,null!==(r=this.di.maxContentY)&&void 0!==r?r:0),this.di.maxContentHeight=Math.max(l,null!==(i=this.di.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){ks(Yn,"scroll",this.hi,{capture:!0}),ks(Yn,"scrollend",this.hi,{capture:!0}),ks(Yn,"resize",this.hi)}scrollElement(){if(!this.ci)return null==Yn?void 0:Yn.document.documentElement;var e=Sr(this.ci)?this.ci:[this.ci];for(var t of e){var r=null==Yn?void 0:Yn.document.querySelector(t);if(r)return r}}vi(e){var t="y"===e?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[t]||0}return Yn?"y"===e?Yn.scrollY||Yn.pageYOffset||Yn.document.documentElement.scrollTop||0:Yn.scrollX||Yn.pageXOffset||Yn.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var Yf=e=>Gd(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class Xf{constructor(e,t,r,i){this.fi=e=>{var t=this.pi();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.gi(this._instance)};this.mi.register({[Hu]:r})}},this._instance=e,this.yi=t,this.mi=r,this.gi=i||Yf,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Hu]}getSetOnceProps(){var e,t=null==(e=this.pi())?void 0:e.props;return t?"r"in t?Qd(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return ps(_s(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+br(r)]=t})),e}}class ep{on(e,t){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(t),()=>{this.bi[e]=this.bi[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.bi[e]||[])r(t);for(var i of this.bi["*"]||[])i(e,t)}constructor(){this.bi={}}}var tp=vs("[SessionId]");class rp{on(e,t){return this.wi.on(e,t)}constructor(e,t,r){var i;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new ep,this.Ti=(e,t)=>!(!Lr(e)||!Lr(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===eh)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ii=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=t||ph,this.Ri=r||ph;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Vr(this.Te.session_idle_timeout_seconds||1800,60,36e3,tp.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+n+"_window_id",this.Fi="ph_"+n+"_primary_window_exists",this.Li()){var s=Oh.F(this.Oi),o=Oh.F(this.Fi);s&&!o?this.Ii=s:Oh.P(this.Oi),Oh.q(this.Fi,!0)}if(null!=(i=this.Te.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){tp.error("Invalid sessionID in bootstrap",e)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Mr(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ii),()=>{this.ki=this.ki.filter((t=>t!==e))}}Li(){return"memory"!==this.Te.persistence&&!this.mi.yr&&Oh.N()}Ni(e){e!==this.Ii&&(this.Ii=e,this.Li()&&Oh.q(this.Oi,e))}Di(){return this.Ii?this.Ii:this.Li()?Oh.F(this.Oi):null}qi(e){var t=this.xi;return!Pr(t)&&!Pr(e)&&5e3>Math.abs(e-t)}$i(e,t,r){var i=t!==this._sessionActivityTimestamp,n=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Mi=e,n&&!i||n&&this.qi(t)||(this.xi=t,this.mi.register({[yu]:[t,e,r]}))}ji(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return Lr(t)&&t>0}Hi(){this.ji()?this.mi.refreshKey(yu):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!Pr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var t=this.Ui();t[1]===this.Mi&&t[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[yu]:[this._sessionActivityTimestamp,null!==(e=this.Mi)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],t=Lr(e)?e:0,r=Lr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,r)}Vi(e){return this.Hi(),this.Ti(e,this.zi())}Ui(){var e=this.mi.props[yu];return Sr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&Yn&&(Yn.removeEventListener(sh,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Oh.P(this.Fi)},ks(Yn,sh,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Te.cookieless_mode===eh)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),i=this.Ui(),n=i[1],s=i[2],o=this.zi(),a=this.Di(),l=Lr(s)&&Math.abs(r-s)>864e5,u=!1,h=!1,d=!n,c=n,v=!d&&!e&&this.Ti(r,o);if(v){(v=this.Vi(r))||tp.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Ui();n=f[1],s=f[2]}d||v||l?(n=this.Ei(),a=this.Ri(),tp.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l}}),s=r,u=!0):(a||(a=this.Ri(),u=!0),(h=n!==c)&&(tp.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=Lr(o)&&e&&!l?o:r,g=Lr(s)?s:(new Date).getTime();this.Ni(a),this.$i(n,p,g),e||this.Pi();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.ki.forEach((e=>e(n,a,m))),{sessionId:n,windowId:a,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:o}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi((new Date).getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var ip=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&gr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>gr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver};function np(){return np=t((function*(){var e=null==es?void 0:es.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return Er(r)&&r.length>0?r:void 0}catch(e){return void cs.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})),np.apply(this,arguments)}var sp="custom",op="i.posthog.com",ap=/^\/static\//;class lp{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+op,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":sp),this.Zi[this.apiHost]}Gi(e){if(ap.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this.Gi(t);if(r)return""+r+t}if(this.region===sp)return this.apiHost+t;var i=op+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var up=vs("[PostHog ExternalIntegrations]"),hp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class dp{constructor(e){this._instance=e}er(e,t){var r;null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return up.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(){var t,i,n,s=r[0],o=r[1];!o||null!=(t=ta.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[s]||e.er(hp[s],(()=>{var t;null==(t=ta.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[s])||t.start(e._instance)})),!o&&null!=(i=ta.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=ta.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var r of Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{})){var i;t()}}}var cp={},vp=0,fp=()=>{},pp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',gp="Surveys module not available",mp="sanitize_properties is deprecated. Use before_send instead",yp="Invalid value for property_denylist config: ",bp=["token","distinct_id",Gu],_p="posthog",wp=!Ff&&-1===(null==as?void 0:as.indexOf("MSIE"))&&-1===(null==as?void 0:as.indexOf("Mozilla")),xp=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:xs(null==ts?void 0:ts.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:fp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:rs&&Er(null==rs?void 0:rs.search)&&-1!==rs.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yn||null==(t=Yn.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){cs.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ih,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Zf},error_tracking:{},_onCapture:fp},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:so,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)}))(e))},kp=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],Sp=e=>{var t={};for(var r of kp){var i=r[0],n=r[1];Mr(e[i])||(t[n]=e[i])}var s=gs({},t,e),o=e.__preview_external_dependency_versioned_paths;return Mr(o)||(Mr(e.strict_script_versioning)&&(s.strict_script_versioning=!!o),Er(o)&&Mr(e.asset_host)&&(s.asset_host=o)),Sr(e.property_blacklist)&&(Mr(e.property_denylist)?s.property_denylist=e.property_blacklist:Sr(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:cs.error(yp+e.property_denylist)),s};class Cp{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){cs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Tp{Ji(e,t){if(e){var r=this.Ki.indexOf(e);-1!==r&&this.Ki.splice(r,1)}return this.Ki.push(t),null==t.initialize||t.initialize(),t}Yi(){return this.config.cookieless_mode===eh||this.config.cookieless_mode===Xu&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new Cp,this.Xi=!1,this.version=hs.LIB_VERSION,this.en=new ep,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=xp(),this.SentryIntegration=jv,this.sentryIntegration=e=>function(e,t){var r=qv(e,t);return{name:Dv,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new Kf(this),this.pageViewManager=new Hv(this),this.rateLimiter=new Kv(this),this.requestRouter=new lp(this),this.consent=new Ov(this),this.externalIntegrations=new dp(this);var t=null!==(e=Tp.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=Er(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=Er(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>cs.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==_p){var i,n=null!==(i=cp[r])&&void 0!==i?i:new Tp;return n._init(e,t,r),cp[r]=n,cp[_p][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;void 0===t&&(t={});var o=Er(e)?e.trim():"";if(!o)return cs.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=xp(t.defaults),t.debug=this.an(t.debug),this.ln=t,this.un=[],t.person_profiles?this.nn=t.person_profiles:t.process_person&&(this.nn=t.process_person);var a=xp(t.defaults),l=Sp(t),u=gs({},a,l,{name:i,token:o});Tr(a.rageclick)&&Tr(l.rageclick)&&(u.rageclick=gs({},a.rageclick,l.rageclick)),Tr(a.session_recording)&&Tr(l.session_recording)&&(u.session_recording=gs({},a.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&cs.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:yl;var h=this.hn();this.persistence=new Qv(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Qv(r({},this.config,{persistence:"sessionStorage"}),h,!1);var d=r({},this.persistence.props),c=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.dn=new Gf((e=>this.cn(e)),this.config.request_queue_config),this.vn=new Jf(this),this.__request_queue=[];var v=this.Yi();if(v||(this.sessionManager=new rp(this),this.sessionPropsManager=new Xf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(cs.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(v)}),0)):(cs.info("Initializing extensions synchronously"),this.fn(v)),hs.DEBUG=hs.DEBUG||this.config.debug,hs.DEBUG&&cs.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var f=t.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(ju);if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===th)this.identify(f);else if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===rh)cs.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var m=this.config.get_device_id(ph()),y=t.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(ju,t.bootstrap.isIdentifiedID?rh:th),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:Zu,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(ph());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(ju,th)}return ks(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||ph();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(ju,rh)),t()},n=r.user();"then"in n&&Cr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||Nv.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Nv.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Nv.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,oh),identify:e=>t(e,lh),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this.pn())):this.pn(),Cr(this.config._onCapture)&&this.config._onCapture!==fp&&(cs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&cs.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return np.apply(this,arguments)}().then((e=>{e&&this.register({[eu]:e})})).catch(fp),this}fn(e){var t,i,n,s,o,a,l,u,h=performance.now(),d=r({},Tp.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.Ki.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new d.featureFlags(this)),d.exceptions&&this.Ki.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.Ki.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ki.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ki.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.Ki.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Ki.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.Ki.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.Ki.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.Ki.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Ki.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ki.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ki.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,$v)),d.toolbar&&this.Ki.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.Ki.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.Ki.forEach((e=>{e.initialize&&c.push((()=>{null==e.initialize||e.initialize()}))})),c.push((()=>{if(this.gn){var e=this.gn;this.gn=void 0,this.Hr(e)}})),this.mn(c,h)}mn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.mn(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){cs.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[Qu]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ju]:i}),this.config.__preview_deferred_init_extensions&&cs.info("PostHog extensions initialized ("+i+"ms)")}Hr(e){if(!ts||!ts.body)return cs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var t,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=mr(r.supportedCompression,yl)?yl:mr(r.supportedCompression,bl)?bl:void 0),null!=(t=r.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:ih}),this.Ki.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(e){cs.critical("`loaded` function failed",e)}if(this.bn(),this.config.internal_or_test_user_hostname&&null!=rs&&rs.hostname){var e=rs.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new Xv(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.dn)||e.enable())}_dom_loaded(){this.is_capturing()&&fs(this.__request_queue,(e=>this.cn(e))),this.__request_queue=[],this.bn()}_handle_unload(){var e,t,r,i,n;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(ah),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.dn)||i.unload(),null==(n=this.vn)||n.unload()):this.xn()&&this.capture(ah,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?wp?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Mr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(t=s.transport)&&void 0!==t?t:"fetch";"sendBeacon"===d&&Mr(s.compression)&&s.data&&(s.compression=bl),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=Sr(o=s.data)?o:[o])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Sr(e)?e.map((e=>r({},e,{sent_at:t}))):r({},e,{sent_at:t})}(s.data))),s.url=Vf(s.url,s.method,s.compression,s.timestampMode);var c=Wf.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),v=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(c,(e=>e.transport===d)))?void 0:n.method)&&void 0!==i?i:c[0].method;if(!v)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===yl&&os&&"undefined"!=typeof Promise&&!$f?Hf(s).then((e=>{v(e)})).catch((t=>{if(dr(t))return $f=!0,void v(r({},s,{compression:void 0,url:Vf(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return dr(e)||t===lr})(t)&&($f=!0),v(s)})):v(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){vp++;try{var t,r=[],i=[],n=[];fs(e,(e=>{if(e)if(Sr(t=e[0]))n.push(e);else if(Cr(e))try{e.call(this)}catch(t){cs.error("Error executing queued PostHog call",e,t)}else Sr(e)&&"alias"===t?r.push(e):Sr(e)&&-1!==t.indexOf("capture")&&Cr(this[t])?n.push(e):i.push(e)}));var s=function(e,t){fs(e,(function(e){try{if(Sr(e[0])){var r=t;ps(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){cs.error("Error executing queued PostHog call",e,t)}}))};s(r,this),s(i,this),s(n,this)}finally{vp--}}push(e){if(vp>0&&Sr(e)&&Er(e[0])){var t=Tp.prototype[e[0]];Cr(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!Mr(e)&&Er(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=t&&t.$current_url&&!Er(null==t?void 0:t.$current_url)&&(cs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.kn||cs.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,c=(null==i?void 0:i.timestamp)||d,v=Xi(null==i?void 0:i.uuid,ph),f={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},c,v)};e===oh&&this.config.__preview_capture_bot_pageviews&&u&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var p="$feature_flag_called"===e&&!1===f.properties.$feature_flag_has_experiment&&!0===this.get_property(Tu);(null==i?void 0:i.$set)&&!p&&(f.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(f.$unset=g);var m=p?void 0:this.Sn(null==i?void 0:i.$set_once,e!==uh,e===lh);if(m&&(f.$set_once=m),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=e=>Er(e)?e.slice(0,s):e,l=new Set,f=function e(t,r){if(t!==Object(t))return a?a(t):t;if(!l.has(t)){var i;if(l.add(t),Sr(t))i=[],fs(t,(t=>{i.push(e(t))}));else{var n={};ps(t,((t,r)=>{l.has(t)||(n[r]=e(t,r))})),i=n}return i}}(o)),f.timestamp=c,Mr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=d),p&&(f.properties=function(e,t){void 0===t&&(t=[]);var r={},i=t=>{void 0!==e[t]&&(r[t]=e[t])};return tr.forEach(i),t.forEach(i),r}(f.properties,bp)),e===El.DISMISSED||e===El.SENT){var y=null==t?void 0:t[Rl.SURVEY_ID],b=null==t?void 0:t[Rl.SURVEY_ITERATION];Ql({id:y,current_iteration:b}),f.$set=r({},f.$set,{[$l({id:y,current_iteration:b},e===El.SENT?"responded":"dismissed")]:!0})}else e===El.SHOWN&&(f.$set=r({},f.$set,{[Rl.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var _=null==t?void 0:t.$product_tour_type;_&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=r({},f.properties.$set,f.$set);if(Ir(w)||this.setPersonPropertiesForFlags(w),!Or(this.config.before_send)){var x=this.wt(f);if(!x)return;(f=x).uuid=Xi(f.uuid,ph)}this.en.emit("eventCaptured",f);var k=null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),S={method:"POST",url:k,data:f,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(k)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.cn(S):this.dn.enqueue(S),f}cs.critical("This capture call is ignored due to client rate limiting.")}}else cs.error("No event name provided to posthog.capture")}else cs.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Yi()&&(a[Gu]=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Er(a.distinct_id)&&!Fr(a.distinct_id)||Rr(a.distinct_id))&&cs.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(e,t,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!as)return{};var l,u=e?[...Dd,...t||[]]:[],h=function(e){for(var t=0;Qi.length>t;t++){var r=Qi[t],i=r[1],n=r[0].exec(e),s=n&&(Cr(i)?i(n,e):i);if(s)return s}return["",""]}(as),d=h[0],c=h[1],v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Mr(r)||(f.detectGoogleSearchApp=r);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==Yn||null==(o=Yn.screen)?void 0:o.width,b=null==Yn||null==(a=Yn.screen)?void 0:a.height,_=null==Yn?void 0:Yn.devicePixelRatio;Mr(g)||(p.userAgentDataPlatform=g),Mr(m)||(p.maxTouchPoints=m),Mr(y)||(p.screenWidth=y),Mr(b)||(p.screenHeight=b),Mr(_)||(p.devicePixelRatio=_);var w,x=gs(_s({$os:d,$os_version:c,$browser:Wi(as,navigator.vendor,v,f),$device:Ji(as),$device_type:Ki(as,p),$timezone:Jd(),$timezone_offset:Kd()}),{$current_url:Es(i?en(null==rs?void 0:rs.href):null==rs?void 0:rs.href,u,jd),$host:null==rs?void 0:rs.host,$pathname:null==rs?void 0:rs.pathname,$raw_user_agent:as.length>1e3?as.substring(0,997)+"...":as,$browser_version:Gi(as,navigator.vendor,v,f),$browser_language:Vd(),$browser_language_prefix:(w=Vd(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==Yn?void 0:Yn.screen.height,$screen_width:null==Yn?void 0:Yn.screen.width,$viewport_height:null==Yn?void 0:Yn.innerHeight,$viewport_width:null==Yn?void 0:Yn.innerWidth,$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return hs.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=hs.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime()),c=d.windowId;a.$session_id=d.sessionId,a.$window_id=c}this.sessionPropsManager&&gs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&gs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.vn)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===sp&&(a.$lib_custom_api_host=this.config.api_host),u=e!==oh||s?e!==ah||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gs(a,u),e===oh&&ts&&(a.title=ts.title),!Mr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}as&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();ps(["$referrer","$referring_domain"],(e=>{e in p&&delete g[e]})),(a=gs({},h,p,g,a)).$is_identified=this._isIdentified(),Sr(this.config.property_denylist)?ps(this.config.property_denylist,(function(e){delete a[e]})):cs.error(yp+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(cs.error(mp),a=m(a,e));var y=this.Cn();return a.$process_person_profile=y,y&&!s&&this.Tn("_calculate_event_properties"),a}Sn(e,t,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.Cn())return e;if(this.Xi&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=gs({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(cs.error(mp),o=a(o,"$set_once")),t&&(this.Xi=!0),Ir(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}In(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t))&&void 0!==r?r:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.en.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:gp}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:gp})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:gp})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=Kl),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:gp}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:gp})}Mn(e){return!e||Rr(e)?(cs.critical("Unique user id has not been set in posthog.identify"),!1):e===Zu?(cs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(cs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return cs.uninitializedWarning("posthog.identify");if(Fr(e)&&(e=e.toString(),cs.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.Tn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Xl)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(tu)&&(this.unregister(tu),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(ju)||th)===th;e!==i&&s?(this.persistence.set_property(ju,rh),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(lh,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this.sn=yh(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(Au))}}setPersonProperties(e,t){if((e||t)&&this.Tn("posthog.setPersonProperties")){var r=yh(this.get_distinct_id(),e,t);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.sn=r):cs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(Sr(e)?e:[e]).filter((e=>Er(e)&&e.length>0));0!==r.length&&this.Tn("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,t,i){if(e&&t){var n=this.getGroups(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(uh,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else cs.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.Tn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l,u,h;if(cs.info("reset"),!this.__loaded)return cs.uninitializedWarning("posthog.reset");var d,c=this.get_property(Xl),v=this.get_property(eu),f=this.get_property(cu);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),Mr(f)||null==(d=this.persistence)||d.register({[cu]:f}),null==(i=this.surveys)||i.reset(),null==(n=this.wn)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(ju,th),null==(h=this.sessionManager)||h.resetSessionId(),this.sn=null,this.config.cookieless_mode===eh)this.register_once({distinct_id:Zu,$device_id:null},"");else{var p=this.config.get_device_id(ph());this.register_once({distinct_id:p,$device_id:e?p:c},""),e||Mr(v)||this.register({[eu]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var r=this;return t((function*(){var e,t,i,n,s;r.__loaded?(null==(e=r.logs)||e.flushLogs("sendBeacon"),null==(t=r.metrics)||t.flush("sendBeacon"),null==(i=r.dn)||i.unload(),null==(n=r.vn)||n.unload(),null==(s=r.featureFlags)||s.destroy()):cs.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(e,t){return e===this.get_property(Yl)?(cs.critical("Attempting to create alias for existing People user - aborting."),-2):this.Tn("posthog.alias")?(Mr(t)&&(t=this.get_distinct_id()),e!==t?(this.In(tu,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(cs.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Tr(e)){var i,n,s,o,a,l,u,h,d,c,v;gs(this.config,Sp(e));var f=this.hn();null==(i=this.persistence)||i.update_config(this.config,t,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Qv(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.an(this.config.debug);$r(p)&&(this.config.debug=p),$r(this.config.debug)&&(this.config.debug?(hs.DEBUG=!0,Ih.N()&&Ih.q("ph_debug",!0),cs.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(hs.DEBUG=!1,Ih.N()&&Ih.P("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.Pn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){hs.LIB_NAME=e,hs.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Tp.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:_p;return t!==_p&&(t=_p+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(ju))===rh||(null==(t=this.sessionPersistence)?void 0:t.get_property(ju))===rh}Cn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===ih&&!this._isIdentified()&&Ir(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tu])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Wu]))}xn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Cn()||this.Tn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Tn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Tn(e){return"never"===this.config.person_profiles?(cs.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(Wu,!0),!0)}hn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Xu)}Pn(){var e,t,r,i,n=this.hn();return(null==(e=this.persistence)?void 0:e.yr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.yr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==eh){if(this.Yi()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new rp(this),this.pageViewManager=new Hv(this),this.persistence&&(this.sessionPropsManager=new Xf(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Tp.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.Ji(this.sessionRecording,new l(this)),this.yn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.yn)))}var u,h;this.consent.optInOut(!0),this.Pn(),this.bn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==Xu&&(null==(u=this.surveys)||u.loadIfEnabled()),(Mr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else cs.warn(pp)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==eh?(this.config.cookieless_mode===Xu&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Xu&&(this.register({distinct_id:Zu,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):cs.warn(pp)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===eh||(this.config.cookieless_mode===Xu?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return es?ip(es,this.config.custom_blocked_useragents):void 0}_n(){ts&&("visible"===ts.visibilityState?this.tn||(this.tn=!0,this.capture(oh,{title:ts.title},{send_instantly:!0}),this.rn&&(ts.removeEventListener(nh,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),ks(ts,nh,this.rn)))}debug(e){!1===e?(null==Yn||Yn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Yn||Yn.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(cs.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,r,i,n){var s=t in e&&!Or(e[t]),o=r in e&&!Or(e[r]);return s?e[t]:!!o&&(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r])}(e,"advanced_disable_flags","advanced_disable_decide",0,cs)}wt(e){var t;if(Or(this.config.before_send))return e;var r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Dr),i=Sr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var s of i){if(n=s(n),Or(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Nr(e.event)?cs.warn(o+". This can cause unexpected behavior."):cs.info(o),null}n.properties&&!Ir(n.properties)||cs.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Or(n.properties[a]))return cs.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var e;return null==(e=this.pageViewManager.ir)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}an(e){var t=$r(e)&&!e,r=Ih.N()&&"true"===Ih.A("ph_debug");return!t&&(!!r||e)}}Tp.__defaultExtensionClasses={},Tp.On=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=bs(e.prototype[t[r]])}(Tp,["identify"]);var Ip=vs("[ExceptionAutocapture]"),Mp=vs("[TracingHeaders]"),Ep=vs("[Web Vitals]"),Rp=9e5,Pp="disabled",Op="lazy_loading",Fp="awaiting_config",Lp="missing_config";vs("[SessionRecording]"),vs("[SessionRecording]");var $p="[SessionRecording]",Ap=vs($p),Np=vs("[Heatmaps]");function Dp(e){return Tr(e)&&"clientX"in e&&"clientY"in e&&Fr(e.clientX)&&Fr(e.clientY)}var qp=vs("[Product Tours]"),jp=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(hu))},Hp=["$set_once","$set"],Bp=vs("[SiteApps]"),Up="Error while initializing PostHog app with config id ";function zp(e,t,r){if(Or(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class Vp{constructor(e){this.Fn=new ep,this.Ln=(e,t)=>this.$n(e,t)&&this.An(e,t)&&this.Nn(e,t)&&this.Dn(e,t),this.$n=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,t;Mr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!Mr(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this.jn)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.qn)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.qn.has(e)||this.qn.has(t.event))&&this.jn&&(null==(r=this.jn)?void 0:r.size)>0&&this.jn.forEach((e=>{this.Hn(t,e)&&this.Fn.emit("actionCaptured",e.name)}))}Bn(e){this.onAction("actionCaptured",(t=>e(t)))}Hn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,t){return this.Fn.on(e,t)}An(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!zp(i,t.url,t.url_matching||"contains"))return!1}return!0}Nn(e,t){return!!this.Un(e,t)&&!!this.zn(e,t)&&!!this.Vn(e,t)}Un(e,t){var r;if(null==t||!t.href)return!0;var i=this.Wn(e);if(i.length>0)return i.some((e=>zp(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&zp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}zn(e,t){var r;if(null==t||!t.text)return!0;var i=this.Wn(e);if(i.length>0)return i.some((e=>zp(e.text,t.text,t.text_matching||"exact")||zp(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!Or(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>zp(e,s,o))))}Vn(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}Wn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Dn(e,t){return null==t||!t.properties||0===t.properties.length||wh(t.properties.reduce(((e,t)=>{var r=Sr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class Wp{constructor(e){var t;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId((e=>this.Kn(e)))}Yn(e,t){return!!e&&wh(e.propertyFilters,null==t?void 0:t.properties)}Xn(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}es(e,t,r){var i=(r===_l?this.Gn:this.Qn).get(e),n=[];return this.ts((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Yn(s,t)}))}register(e){var t;Mr(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==t.length&&(null==this.ss&&(this.ss=new Vp(this._instance),this.ss.init(),this.ss.Bn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ss)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this.Jn.get(t.name);r&&r.push(e.id),this.Jn.set(t.name,r||[e.id])}})))})))}rs(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Gn=this.Xn(e,_l),this.Qn=this.Xn(e,wl))}onEvent(e,t){var r,i,n=this.os(),s=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(i=t.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.ls(e,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.us([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:e,itemId:s}),void this.hs(s)}if(this.Qn.has(e)){var a=this.es(e,t,wl);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map((e=>e.id))}),this.us(a.map((e=>e.id))),a.forEach((e=>this.ds(e.id))))}if(this.Gn.has(e)){n.info("event name matched",{event:e,eventPayload:t,items:this.Gn.get(e)});var l=this.es(e,t,_l);this.cs(l.map((e=>e.id)))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){0!==e.length&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter((t=>t!==e));var t=this.vs();t.includes(e)||(this.fs([...t,e]),this.ps())}us(e){var t=new Set(e);this.Zn=this.Zn.filter((e=>!t.has(e)));var r=this.gs(),i=r.filter((e=>!t.has(e)));i.length!==r.length&&(this.fs(i),0===i.length&&this.ys())}gs(){var e,t=this.bs();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}vs(){var e,t,r=this.gs();if(0===r.length)return[];var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._s()],n=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return n&&i===n?r:[]}ps(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.ws(t)}ys(){this.xs()}Kn(e){var t,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((e=>!this.ks(e)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class Zp extends Wp{constructor(e){super(e)}bs(){return Fu}_s(){return Lu}Cs(){return El.SHOWN}ts(e){var t;null==(t=this._instance)||t.getSurveys(e)}ds(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}os(){return Bl}fs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[Fu]:e})}ws(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[Lu]:e})}xs(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Lu)}ks(){return!1}ls(e,t){var r;return this.ts((e=>{r=e.find((e=>e.id===t))})),!r||Hl(r)?e===El.SHOWN?"consume":"ignore":e===El.SHOWN?"persist":e===El.DISMISSED||e===El.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Gp="SDK is not enabled or survey functionality is not yet loaded",Qp="Disabled. Not loading surveys.",Jp=null!=Yn&&Yn.location?Rs(Yn.location.hash,"__posthog")||Rs(location.hash,"state"):null,Kp="_postHogToolbarParams",Yp=vs("[Toolbar]"),Xp=vs("[FeatureFlags]"),eg=vs("[FeatureFlags]",{debugEnabled:!0}),tg="\" failed. Feature flags didn't load in time.",rg=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},ig=e=>{var t={};for(var r of ms(e||{})){var i=r[1];i&&(t[r[0]]=i)}return t},ng="Refusing to render web experiment since the viewer is a likely bot",sg={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>mh(t,e),not_regex:(e,t)=>!mh(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class og{get Te(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{og.Ts("retrieved web experiments from the server"),t.Is=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t.Is&&(og.Ts("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.Is)||r.set(e.feature_flag_key,e));var i=t._instance.getFeatureFlag(e.feature_flag_key);Er(i)&&e.variants[i]&&t.Ms(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];og.Es(s,t._instance)&&t.Ms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())og.Ts(ng);else if(!this.Te.disable_web_experiments){if(Or(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();og.Ts("applying feature flags",e),e.forEach((e=>{var t;if(this.Is&&null!=(t=this.Is)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.Is)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Ms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=og.getWindowLocation();if(null!=e&&e.search){var t=Ms(null==e?void 0:e.search,"__experiment_id"),r=Ms(null==e?void 0:e.search,"__experiment_variant");t&&r&&(og.Ts("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Rs(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Te.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Rs(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(og.Ts("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Ms(i[0].name,t,i[0].variants[t].transforms))}static Es(e,t){return!Or(e.conditions)&&og.Ps(e,t)&&og.Os(e)}static Ps(e,t){var r;if(Or(e.conditions)||Or(null==(r=e.conditions)?void 0:r.url))return!0;var i=og.getWindowLocation();if(i){var n,s,o,a=As(t,i.href);return null==(n=e.conditions)||!n.url||sg[null!==(s=null==(o=e.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](e.conditions.url,a)}return!1}static getWindowLocation(){return null==Yn?void 0:Yn.location}static Os(e){var t;if(Or(e.conditions)||Or(null==(t=e.conditions)?void 0:t.utm))return!0;var r=Bd();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Ts(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];cs.info("[WebExperiments] "+e,r)}Ms(e,t,r){this._is_bot()?og.Ts(ng):"control"!==t?r.forEach((r=>{if(r.selector){var i;og.Ts("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):og.Ts("Control variants leave the page unmodified.")}_is_bot(){return es&&this._instance?ip(es,this.Te.custom_blocked_useragents):void 0}}var ag=vs("[Conversations]"),lg="Conversations not available yet.",ug="console",hg={featureFlags:class{constructor(e){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],Yn&&ks(Yn,"online",this.Bs)}destroy(){null==Yn||Yn.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(e){return this._instance.get_property(e)}Vs(){var e,t;return null!==(e=null==(t=this.mi)?void 0:t._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==e&&e}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,Xp.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var e,t=null!==(e=this.Te.evaluation_contexts)&&void 0!==e?e:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(Xp.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Xp.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}Gs(){return this.Zs().length>0}Qs(){var e=this.Te.flag_keys;if(!Mr(e)){if(Sr(e))return e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Xp.error("Invalid flag key found:",e,"Expected non-empty string"),t}));Xp.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,r=this._instance.config,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.zs(_u))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.zs(Su))&&void 0!==s?s:{},l=r({},o,e),u=r({},a,t),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:Yt(v),variant:Xt(v),reason:void 0,metadata:Mr(null==u?void 0:u[c])?void 0:{id:0,version:void 0,description:void 0,payload:u[c]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.zs(ku),t=this.zs(Iu),i=this.zs(Mu);if(!i&&!t)return e||{};var n=gs({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],h=null==t?void 0:t[o],d=Mr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Mr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:d,variant:d?null!=c?c:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),c!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.Fs||(Xp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.Fs=!0),n}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((r=>{var i=e[r];return{key:r,enabled:Yt(i),variant:Xt(i),payload:Kt(t[r])}}))}getFlagVariants(){var e=this.zs(_u),t=this.zs(Iu);if(!t)return e||{};for(var r=gs({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Fs||(Xp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Fs=!0),r}getFlagPayloads(){var e=this.zs(Su),t=this.zs(Mu);if(!t)return e||{};for(var r=gs({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Fs||(Xp.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Fs=!0),r}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.en.emit("featureFlagsReloading",!0),this.Js=setTimeout((()=>{this.Ks()}),5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.As=e}Ks(e){var t;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var i=this.Te.token,n=this.zs(Xl),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this.mi)?void 0:t.get_initial_props())||{},this.zs(Eu)||{},{$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION}),group_properties:this.zs(Ru),timezone:Jd()};Pr(n)||Mr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var o=this.Qs();Mr(o)||(s.flag_keys=o);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Te.disable_compression?void 0:bl,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(this.Xs(e.statusCode),200===e.statusCode&&(this.Ns||(this.$anon_distinct_id=void 0),n=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.mi)||i.register({[Du]:o}),u)Xp.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks())}}})}}Us(){return Ps(this.Hs,3)}Xs(e){this.Hs=Os(e,this.Hs,3,(()=>Xp.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Xp.warn('getFeatureFlag for key "'+e+tg)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this.zs(Cu)||void 0,l=this.zs(qu)||void 0,u=this.zs(Au)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.zs(Nu);d&&d!==c&&(u={},null==(h=this.mi)||h.register({[Au]:u,[Nu]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var v,f,p,g,m,y,b,_,w,x,k;Sr(u[e])?u[e].push(o):u[e]=[o],null==(v=this.mi)||v.register({[Au]:u});var S=this.getFeatureFlagDetails(e),C=[...null!==(f=this.zs(Du))&&void 0!==f?f:[]];Mr(n)&&C.push("flag_missing");var T={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Te.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Te.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[e])||null,$used_bootstrap_value:!this.Ds};Mr(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(T.$feature_flag_has_experiment=S.metadata.has_experiment),Mr(null==S||null==(y=S.metadata)?void 0:y.version)||(T.$feature_flag_version=S.metadata.version);var I,M=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;M&&(T.$feature_flag_reason=M),null!=S&&null!=(x=S.metadata)&&x.id&&(T.$feature_flag_id=S.metadata.id),Mr(null==S?void 0:S.original_variant)&&Mr(null==S?void 0:S.original_enabled)||(T.$feature_flag_original_response=Mr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(T.$feature_flag_original_payload=null==S||null==(I=S.metadata)?void 0:I.original_payload),C.length&&(T.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",T)}if(i)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:Kt(s)}}}else Xp.warn('getFeatureFlagResult for key "'+e+tg)}getRemoteConfigPayload(e,t){var r=this.Te.token,i={distinct_id:this._instance.get_distinct_id(),token:r,person_properties:{$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION}};this.Gs()&&(i.evaluation_contexts=this.Zs());var n=this.Qs();Mr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Te.disable_compression?void 0:bl,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.Ds)return t.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return Xp.warn('isFeatureEnabled for key "'+e+tg),t.defaultValue;var r=this.getFeatureFlag(e,t);return Mr(r)?t.defaultValue:!!r}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this.mi){this.Ls=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):e.featureFlags&&Xp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=e.requestId,c=e.evaluatedAt;if(Sr(u)){Xp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;t&&t.register({[wu]:u,[_u]:v,[Tu]:!1})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((e=>y.has(e[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>y.has(e[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((e=>y.has(e[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);t&&t.register(r({[wu]:Object.keys(ig(p)),[_u]:p||{},[Su]:g||{},[ku]:m||{},[Tu]:!0===e.minimalFlagCalledEvents},d?{[Cu]:d}:{},c?{[qu]:c}:{}))}}}(e,this.mi,n,s,o,i),t||(this.js=!1),this.eo(t)}}override(e,t){void 0===t&&(t=!1),Xp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.mi)return Xp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.mi.unregister(Iu),this.mi.unregister(Mu),this.eo(),eg.info("All overrides cleared");if(Sr(e)){var t=rg(e);return this.mi.register({[Iu]:t}),this.eo(),eg.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this.Fs=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.mi.unregister(Iu),eg.info("Flag overrides cleared");else if(i.flags){if(Sr(i.flags)){var n=rg(i.flags);this.mi.register({[Iu]:n})}else this.mi.register({[Iu]:i.flags});eg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.mi.unregister(Mu),eg.info("Payload overrides cleared")):i.payloads&&(this.mi.register({[Mu]:i.payloads}),eg.info("Payload overrides set",{payloads:i.payloads}))),void this.eo()}if(e&&"object"==typeof e)return this.mi.register({[Iu]:e}),this.eo(),eg.info("Flag overrides set",{flags:e});Xp.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Ls){var t=this.ro(),r=t.flags,i=t.flagVariants;try{e(r,i)}catch(e){Xp.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this.zs(xu)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this.mi)||n.register({[wu]:Object.keys(ig(l)),[_u]:l}),this.eo()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this.zs(xu),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+n),method:"GET",timestampMode:"query",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this.mi)||r.unregister(xu),null==(i=this.mi)||i.register({[xu]:n}),e(n)}}})}ro(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}eo(e){var t=this.ro(),r=t.flags,i=t.flagVariants;this.featureFlagEventHandlers.forEach((t=>{try{t(r,i,{errorsLoading:e})}catch(e){Xp.error("Error while running feature flags callback",e)}}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.zs(Eu)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Eu]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=r({},this.zs(Eu)||{});e.forEach((e=>{delete i[e]})),this._instance.register({[Eu]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(Eu),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.zs(Ru)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Ru]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.zs(Ru)||{};this._instance.register({[Ru]:r({},t,{[e]:{}})})}else this._instance.unregister(Ru)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},dg={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var e;return!(null==(e=this.io)||!e.isStarted)}get status(){var e,t;return this.no===Fp||this.no===Lp?this.no:null!==(e=null==(t=this.io)?void 0:t.status)&&void 0!==e?e:this.no}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=Pp,this.so=void 0,this._instance=e,!this._instance.sessionManager)throw Ap.error("started without valid sessionManager"),new Error($p+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===eh)throw new Error($p+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var e,t=!(null==(e=this._instance.get_property(cu))||!e.enabled),r=!this.Te.disable_session_recording,i=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.oo||null==(t=this.io)||!t.isStarted){var r=!Mr(Object.assign)&&!Mr(Array.from);this.oo&&r?(this.ao(e),Ap.info("starting")):(this.no=Pp,this.stopRecording())}}ao(e){var t,r,i;this.oo&&(this.no!==Fp&&this.no!==Lp&&(this.no=Op),null!=ta&&null!=(t=ta.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=ta.__PosthogExtensions__)&&r.initSessionRecording?this.lo(e):null==(i=ta.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.uo,(t=>{if(t)return Ap.error("could not load recorder",t);this.lo(e)})))}stopRecording(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.stop()}ho(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.discard()}do(){var e,t;null==(e=this.mi)||e.unregister(bu),null==(t=this.mi)||t.unregister(vu)}co(e,t){if(Or(e))return null;var r,i=Fr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Ap.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}vo(e){if(this.mi){var t,i,n=this.mi,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.co(null==(t=this.Te.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this.co(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Or(a)&&this.do();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[cu]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Mr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.so)||t.call(this),this.so=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.vo(t),void this.ho()):(this.vo(t),void this.startIfEnabledOrStop()):(this.no===Fp&&(this.no=Lp,Ap.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.io)&&r.log?this.io.log(e,t):Ap.warn("log called before recorder was ready")}get uo(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(cu);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}fo(){var e,t,r=this._instance.get_property(cu);if(!r)return!1;try{t="object"==typeof r?r:JSON.parse(r)}catch(e){return Ap.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var i=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-i}lo(e){var t,r;if(null==(t=ta.__PosthogExtensions__)||!t.initSessionRecording)return Ap.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ku]:!0});if(this.io||(this.io=null==(r=ta.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo()){if(this.no===Lp||this.no===Fp)return;return this.no=Fp,Ap.info("persisted remote config is stale, requesting fresh config before starting"),void new Xv(this._instance).load()}this.no=Op,this.io.start(e)}onRRwebEmit(e){var t;null==(t=this.io)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.io||null==(t=this.mi)||t.register({[pu]:!0}),null==(e=this.io)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.io||null==(t=this.mi)||t.register({[fu]:!0}),null==(e=this.io)||e.overrideSampling()}overrideTrigger(e){var t,r;this.io||null==(r=this.mi)||r.register({["url"===e?gu:mu]:!0}),null==(t=this.io)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.io)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.io)||!r.tryAddCustomEvent(e,t))}}},cg={autocapture:class{constructor(e){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=e,this.rageclicks=new gv(e.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var e,t,r=Tr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}wo(){if(this.isBrowserSupported()){if(Yn&&ts){var e=e=>{e=e||(null==Yn?void 0:Yn.event);try{this.xo(e)}catch(e){yv.error("Failed to capture event",e)}};if(ks(ts,"submit",e,{capture:!0}),ks(ts,"change",e,{capture:!0}),ks(ts,"click",e,{capture:!0}),this.Te.capture_copied_text){var t=e=>{e=e||(null==Yn?void 0:Yn.event);try{this.xo(e,mv)}catch(e){yv.error("Failed to capture copy/cut event",e)}};ks(ts,"copy",t,{capture:!0}),ks(ts,"cut",t,{capture:!0})}}}else yv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(e){if(this.yo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.bo=t.elementsChainAsString);var r=t.autocapture_opt_out;$r(r)&&(this.instance.persistence&&this.instance.persistence.register({[iu]:r}),this.mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this._o=e}getElementSelectors(e){var t,r=[];return null==(t=this._o)||t.forEach((t=>{var i=null==ts?void 0:ts.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[iu],i=this.mo,n=this.instance.Ur()&&!this.yo;if(Pr(i)&&!$r(r)&&!n)return!1;var s=null!==(t=this.mo)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!s}xo(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Xs(e);Vs(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&ho(i,this.instance.config.rageclick)&&this.xo(e,"$rageclick");var n=t===mv;if(i&&function(e,t,r,i,n,s){var o;if(!Yn||co(e))return!1;if(null!=r&&r.url_allowlist&&!Qs(r.url_allowlist,s))return!1;if(null!=r&&r.url_ignorelist&&Qs(r.url_ignorelist,s))return!1;if(null!=r&&r.dom_event_allowlist){var a=r.dom_event_allowlist;if(a&&!a.some((e=>t.type===e)))return!1}var l=vo(e,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Mr(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!to(h,null==r?void 0:r.css_selector_allowlist))return!1;if(to(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:io))return!1;try{var d=Yn.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return u?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(eo.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.Te,n,n?["copy","cut"]:void 0,this.instance)){var s=wv(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=s.props;if(s.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),t===mv){var l,u=Ks(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return Cr(null==ts?void 0:ts.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ko=(null==Yn||null==(t=Yn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(cs.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,cs.info("History API monitoring stopped")}monitorHistoryChanges(){Yn&&Yn.history&&(this.Co("pushState"),this.Co("replaceState"),this.To())}Co(e){var t;if(Yn&&(null==(t=Yn.history[e])||!t.__posthog_wrapped__)){var r=this;Ls(Yn.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.Io(e)}))}}Io(e){try{var t,r=null==Yn||null==(t=Yn.location)?void 0:t.pathname;if(!r)return;r!==this.ko&&this.isEnabled&&this._instance.capture(oh,{navigation_type:e}),this.ko=r}catch(t){cs.error("Error capturing "+e+" pageview",t)}}To(){if(!this.So){var e=()=>{this.Io("popstate")};ks(Yn,"popstate",e),this.So=()=>{Yn&&Yn.removeEventListener("popstate",e)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(e){var t;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=e,this.Mo=!(null==(t=this.instance.persistence)||!t.props[nu]),this.rageclicks=new gv(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Tr(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(e=this.Te.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Or(this.Te.capture_heatmaps)?Or(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.po)return;Np.info("starting..."),this.Ro(),this.ke()}else{var e;clearInterval(null!==(e=this.Eo)&&void 0!==e?e:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[nu]:r}),this.Mo=r,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Oo(e){Dp(e.originalEvent)&&this.pe(e.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(ts)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){Yn&&ts&&(this.Fo=this.oi.bind(this),ks(Yn,sh,this.Fo),this.Lo=e=>this.pe(e||(null==Yn?void 0:Yn.event)),ks(ts,"click",this.Lo,{capture:!0}),this.$o=e=>this.Ao(e||(null==Yn?void 0:Yn.event)),ks(ts,"mousemove",this.$o,{capture:!0}),this.No=new Av(this.instance,Lv,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),ks(ts,nh,this.Do),this.po=!0)}Po(){var e;Yn&&ts&&(this.Fo&&Yn.removeEventListener(sh,this.Fo),this.Lo&&ts.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&ts.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&ts.removeEventListener(nh,this.Do),clearTimeout(this.qo),null==(e=this.No)||e.stop(),this.po=!1)}jo(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&Us(i)&&!zs(i,"body");){if(i===r)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:Yn)?void 0:s.getComputedStyle(i).position}catch(e){return!1}if(mr(t,n))return!0;i=ro(i)}return!1}(Xs(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}pe(e,t){var i;if(void 0===t&&(t="click"),!Bs(e.target)&&Dp(e)){var n=this.jo(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&ho(Xs(e),this.instance.config.rageclick)&&this.Nt(r({},n,{type:"rageclick"})),this.Nt(n)}}Ao(e){!Bs(e.target)&&Dp(e)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Nt(this.jo(e,"mousemove"))}),500))}Nt(e){if(Yn){var t=this.Te.disable_capture_url_hashes?en(Yn.location.href):Yn.location.href,r=this.Te.custom_personal_data_properties,i=this.Te.mask_personal_data_properties?[...Dd,...r||[]]:[],n=Es(t,i,jd);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(e)}}oi(){this.R&&!Ir(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Av,webVitalsAutocapture:class{constructor(e){var t;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=e=>{var t;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.zo();if(!Mr(i))if(Or(null==e?void 0:e.name)||Or(null==e?void 0:e.value))Ep.error("Invalid metric received",e);else if(!this.Vo||this.Vo>e.value){this.R.url!==i&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Mr(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Mr(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=r({},e,{$current_url:i,timestamp:Date.now()});Mr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else Ep.error("Ignoring metric with value >= "+this.Vo,e)},this.Wo=()=>{if(!this.po){var e,t,r,i,n=ta.__PosthogExtensions__;if(!Mr(n)&&!Mr(n.postHogWebVitalsCallbacks)){var s=n.postHogWebVitalsCallbacks;e=s.onLCP,t=s.onCLS,r=s.onFCP,i=s.onINP}e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Uo.bind(this)),this.po=!0):Ep.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Mo=!(null==(t=this._instance.persistence)||!t.props[lu]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=Tr(this.Zo)?null==(e=this.Zo)?void 0:e.web_vitals_allowed_metrics:void 0;return Or(r)?(null==(t=this._instance.persistence)?void 0:t.props[du])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Tr(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Tr(this.Zo)?this.Zo.web_vitals_attribution:void 0;return null!=e&&e}get Vo(){var e=Tr(this.Zo)&&Fr(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:Rp;return e>0&&6e4>=e?Rp:e}get isEnabled(){var e=null==rs?void 0:rs.protocol;if("http:"!==e&&"https:"!==e)return Ep.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Tr(this.Zo)?this.Zo.web_vitals:$r(this.Zo)?this.Zo:void 0;return $r(t)?t:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Ep.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var r=Tr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,i=Tr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[lu]:r}),this._instance.persistence.register({[du]:i})),this.Mo=r,this.startIfEnabled()}}}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?Ep.error("failed to load script",t):e()}))}zo(){var e=Yn?this._instance.config.disable_capture_url_hashes?en(Yn.location.href):Yn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Dd,...t||[]]:[];return Es(e,r,jd)}Ep.error("Could not determine current URL")}}},vg={exceptionObserver:class{constructor(e){var t;this.Wo=()=>{var e;if(Yn&&this.isEnabled&&null!=(e=ta.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=ta.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ta.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ta.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=t(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=r(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=i(this.captureException.bind(this)))}catch(e){Ip.error("failed to start",e),this.Ko()}}},this._instance=e,this.Yo=!(null==(t=this._instance.persistence)||!t.props[su]),this.Xo=new Wr(r({},function(e){var t,r,i,n;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(r=e.exceptionRateLimiterRefillRate)&&void 0!==r?r:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(i=null!==(n=e.exceptionRateLimiterBucketSize)&&void 0!==n?n:e.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,Ge:Ip})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Tr(e)?t=r({},t,e):(Mr(e)?this.Yo:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ip.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Ip.error("failed to load script",t);e()}))}Ko(){var e,t,r;null==(e=this.Go)||e.call(this),this.Go=void 0,null==(t=this.Qo)||t.call(this),this.Qo=void 0,null==(r=this.Jo)||r.call(this),this.Jo=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Yo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[su]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}captureException(e){var t,r,i,n=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.Xo.consumeRateLimit(n)?Ip.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.ta=[],this.ra=wc(),this._instance=e,this.ta=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(ou))&&void 0!==t?t:[],this.ia=Qn(this.na()),this.sa=new Jn(this.ia)}onConfigChange(){this.ia=Qn(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(e){var t,r,i;if(e.ok){var n=e.config;if("errorTracking"in n){var s=null!==(t=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.ta=s,this._instance.persistence&&this._instance.persistence.register({[ou]:this.ta,[au]:o})}}}get oa(){var e,t=!!this._instance.get_property(au),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.ra.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ia.enabled)try{if(!Er(e)||0===e.trim().length)return void _c.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>Zn.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(this.aa(t)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&_c.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(r({[Vn]:e,[Wn]:(new Date).toISOString()},n))}catch(e){_c.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.la(t)){if(this.ua(t))return this.ha("Exception dropped: matched a suppression rule"),void _c.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(t))return this.ha("Exception dropped: thrown by a browser extension"),void _c.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(t))return this.ha("Exception dropped: thrown by the PostHog SDK"),void _c.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ia.enabled&&Or(e.$exception_steps)?this.va(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return i&&this.sa.clear(),i}catch(e){return _c.error("Failed to capture exception event. Dropping this exception.",e),void this.sa.clear()}}catch(e){return void _c.error("Failed to process exception event. Ignoring this exception.",e)}}va(e){try{var t=this.sa.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return _c.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}ha(e){this.ia.enabled&&this.sa.add({[Vn]:e,[Wn]:(new Date).toISOString()})}aa(e){return Tr(e)?r({},e):{}}na(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}ua(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var r=t.type,i=t.value;return Er(r)&&r.length>0&&e.$exception_types.push(r),Er(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.ta.some((e=>{var r=e.values.map((e=>{var r,i=bh[e.operator],n=Sr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}da(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ca(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}la(e){return!Or(e)&&Sr(e)}}},fg=r({productTours:class{get mi(){return this._instance.persistence}constructor(e){this.fa=null,this.pa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if("productTours"in t){var r,i;if(this.mi&&this.mi.register({[hu]:!!t.productTours}),!jp(this._instance))return!this.fa&&Or(null==(r=this.mi)?void 0:r.props[$u])||qp.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.fa)||i.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&jp(this._instance)&&this.er((()=>this.ga()))}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?qp.error("Could not load product tours script",t):e()}))}ga(){var e;!this.fa&&null!=(e=ta.__PosthogExtensions__)&&e.generateProductTours&&(this.fa=ta.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Sr(this.pa)||t){var r=this.mi;if(r){var i=r.props[$u];if(Sr(i)&&!t)return this.pa=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:t=>{if(jp(this._instance)){var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return qp.error(n),void e([],{isLoaded:!1,error:n})}var s=Sr(t.json.product_tours)?t.json.product_tours:[];this.pa=s,r&&r.register({[$u]:s}),e(s,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.pa,{isLoaded:!0})}getActiveProductTours(e){Or(this.fa)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.fa)||t.showTourById(e)}previewTour(e){this.fa?this.fa.previewTour(e):this.er((()=>{var t;this.ga(),null==(t=this.fa)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this.fa)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.fa)||e.nextStep()}previousStep(){var e;null==(e=this.fa)||e.previousStep()}clearCache(){var e;this.pa=null,null==(e=this.mi)||e.unregister($u)}resetTour(e){var t;null==(t=this.fa)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.fa)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.fa)||t.cancelPendingTour(e)}}},hg),pg={siteApps:class{constructor(e){this.ma=0,this._instance=e,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(e,t){if(t){var r=this.globalsForEvent(t);this.ya.push(r),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var e;return null==(e=ta._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{e(),this.ya=[],this._a=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var v of Object.entries(c)){var f=v[0];h[f]={id:d[f],type:f,properties:v[1]}}var p=e.$set_once,g=e.$set;return{event:r({},i(e,Hp),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}wa(e){var t,r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Bp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Bp.error("prepare_external_dependency_script returned null"),null):e}xa(){var e,t,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==ts?void 0:ts.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],d=this,c=new WeakSet,v=(e,t,r)=>{if(null!=e&&e[t]){var i=e[t];e[t]=r(i),h.push((()=>{e[t]=i}))}},f=e=>{if(c.has(e))return e;var t=d.wa(e);return t&&c.add(t),t},p=e=>e.map((e=>"string"==typeof e?e:f(e))).filter((e=>!Pr(e)));return v(u,"appendChild",(e=>function(t){var r=f(t);return r?e.call(this,r):t})),v(u,"insertBefore",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):t})),v(u,"replaceChild",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):r})),[null==(t=l.Element)?void 0:t.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((e=>{v(e,"append",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"prepend",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((e=>{v(e,"before",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"after",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"replaceWith",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:e.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(e=>function(t,r){var i=f(r);return i?e.call(this,t,i):null})),this.ka=()=>{h.forEach((e=>e())),this.ka=void 0},this.Sa()}Sa(){var e=!1;return()=>{var t;e||(e=!0,this.ma--,0===this.ma&&(null==(t=this.ka)||t.call(this)))}}Ca(e,t){void 0===t&&(t=!0);var r=this.xa();try{var i=e(r);return t&&r(),i}catch(e){throw r(),e}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.ya.length&&(Bp.info("Processing "+this.ya.length+" events for site app with id "+e.id),this.ya.forEach((e=>this.Ca((()=>null==t.processEvent?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&(null==(r=this._a)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,Bp.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Ca((t=>e.init({posthog:this._instance,callback(e){t(),n(e)}})),!1).processEvent;s&&(t.processEvent=s),i=!0}catch(t){Bp.error(Up+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){Bp.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Ta(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Ia(e){var t=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(e),i=function(i){try{t.Ca((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(t){Bp.error("Error while processing event "+e.event+" for site app "+i.id,t)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Ta(),void this._instance.on("eventCaptured",(e=>this.Ia(e)))):void Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._a)||r.call(this),e.ok){var s=e.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var e,t=a.id,r=a.url;ta["__$$ph_site_app_"+t]=n._instance,null==(e=ta.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,r,(e=>{if(e)return Bp.error(Up+t,e)}))};for(var a of s.siteApps)o()}else Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},gg={tracingHeaders:class{constructor(e){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,t,r=this.Pa();r?(Mr(this.Ma)&&(this.Ma=null==(e=ta.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Mr(this.Ea)&&(this.Ea=null==(t=ta.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=e}initialize(){this.startIfEnabledOrStop()}er(e){var t,r;null!=(t=ta.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(r=ta.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Mp.error("failed to load script",t);e()}))}Oa(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Pa(){var e=this.Oa();return Sr(e)?(Sr(this.Ra)?this.Ra.splice(0,this.Ra.length,...e):this.Ra=[...e],e.length>0?this.Ra:void 0):(Sr(this.Ra)&&this.Ra.splice(0),this.Ra=e||void 0,this.Ra)}Ko(){var e,t;null==(e=this.Ma)||e.call(this),null==(t=this.Ea)||t.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},mg=r({surveys:class{get Te(){return this._instance.config}constructor(e){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Te.disable_surveys){if(!e.ok)return Bl.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Or(t))return Bl.warn("Flags not loaded yet. Not loading surveys.");var r=Sr(t);this.Fa=r?t.length>0:t,Bl.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Vl)||null!=i&&i.startsWith(Wl))&&t.push(i)}t.forEach((e=>localStorage.removeItem(e)))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.La)Bl.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Bl.info(Qp);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Bl.info("Not loading surveys in cookieless mode without consent.");else{var e=null==ta?void 0:ta.__PosthogExtensions__;if(e){if(!Mr(this.Fa)||this.Te.advanced_enable_surveys){var t=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var r=e.generateSurveys;if(r)return void this.Da(r,t);var i=e.loadExternalDependency;if(!i)return void this.qa(Yu);i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.qa("Could not load surveys script",r):this.Da(e.generateSurveys,t)}))}catch(e){throw this.qa("Error initializing surveys",e),e}finally{this.La=!1}}}else Bl.error("PostHog Extensions not found.")}}Da(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Zp(this._instance),Bl.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(e,t){Bl.error(e,t),this.ja({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$a.push(e),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Te.disable_surveys)return Bl.info(Qp),e([]);var r,i=this._instance.get_property(Pu);if(i&&!t)return e(i,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.Aa?this.Aa.then((t=>e(t.surveys,t.context))):("undefined"!=typeof Promise&&(this.Aa=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:t=>{var i;this.Aa=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Bl.error(s),this.Na=Date.now();var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}this.Na=null;var a,l=t.json.surveys||[],u=l.filter((e=>Ul(e)&&(jl(e)||zl(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[Pu]:l,[Ou]:Date.now()});var h={isLoaded:!0};e(l,h),null==r||r({surveys:l,context:h})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var e=this._instance.get_property(Ou);return Fr(e)&&Date.now()-e>3e5}Ua(){return Fr(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(e,t){var r,i={id:e,current_iteration:null!==(r=null==t?void 0:t.iteration)&&void 0!==r?r:null};Ql(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}ja(e){for(var t of this.$a)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Bl.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Or(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Bl.warn("init was not called")}za(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}Va(e){if(Or(this._surveyManager))return{eligible:!1,reason:Gp};var t="string"==typeof e?this.za(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Wa(e){if(Or(this._surveyManager))return{eligible:!1,reason:Gp};var t="string"==typeof e?this.za(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Or(this._surveyManager))return Bl.warn("init was not called"),{visible:!1,disabledReason:Gp};var t=this.Wa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Or(this._surveyManager)?(Bl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Gp})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this.Wa(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(Or(this._surveyManager))Bl.warn("init was not called");else{var n="string"==typeof e?this.za(e):e;if(null!=n&&n.id)if(Jl.includes(n.type)){var s=null==ts?void 0:ts.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Bl.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Bl.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),Bl.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Bl.warn("Survey element not found")}else Bl.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Bl.warn("Survey not found")}}displaySurvey(e,t){var i;if(Or(this._surveyManager))Bl.warn("init was not called");else{var n=this.za(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Pl&&t.initialResponses&&Bl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.Va(n);if(!o.eligible)return void Bl.warn("Survey is not eligible to be displayed: ",o.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Bl.warn("Survey not found")}}cancelPendingSurvey(e){Or(this._surveyManager)?Bl.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},hg),yg={toolbar:class{constructor(e){this.instance=e}Za(e){ta.ph_toolbar_state=e}Ga(){var e;return null!==(e=ta.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),Ss(this.instance.config))return!1;if(!Yn||!ts)return!1;e=null!=e?e:Yn.location,r=null!=r?r:Yn.history;try{if(!t){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(e){return!1}t=null==Yn?void 0:Yn.localStorage}var i,n=Jp||Rs(e.hash,"__posthog")||Rs(e.hash,"state"),s=n?ys((()=>JSON.parse(atob(decodeURIComponent(n)))))||ys((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(Kp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}Qa(e){var t=ta.ph_load_toolbar||ta.ph_load_editor;!Or(t)&&Cr(t)?t(e,this.instance):Yp.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==ts||!ts.getElementById(Ds));if(!Yn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yn.localStorage.setItem(Kp,JSON.stringify(r({},n,{source:void 0}))),2===this.Ga())this.Qa(n);else if(0===this.Ga()){var s;this.Za(1),null==(s=ta.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return Yp.error("[Toolbar] Failed to load",e),void this.Za(0);this.Za(2),this.Qa(n)})),ks(Yn,"turbolinks:load",(()=>{this.Za(0),this.loadToolbar(n)}))}return!0}Ja(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},bg=r({experiments:og},hg),_g={conversations:class{constructor(e){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&e.ok){var t=e.config.conversations;Or(t)||($r(t)?this.Ka=t:(this.Ka=t.enabled,this.Xa=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||Ss(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==ta?void 0:ta.__PosthogExtensions__;if(e&&!Mr(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var t=e.initConversations;if(t)return this.el(t),void(this.Ya=!1);var r=e.loadExternalDependency;if(!r)return void this.tl(Yu);r(this._instance,"conversations",(t=>{t||!e.initConversations?this.tl("Could not load conversations script",t):this.el(e.initConversations),this.Ya=!1}))}catch(e){this.tl("Error initializing conversations",e),this.Ya=!1}}else ag.error("Conversations enabled but missing token in remote config.")}}el(e){if(this.Xa)try{this._conversationsManager=e(this.Xa,this._instance),ag.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else ag.error("Cannot complete initialization: remote config is null")}tl(e,t){ag.error(e,t),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():ag.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ka&&!Pr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(ag.warn(lg),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(ag.warn(lg),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(ag.warn(lg),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(ag.warn(lg),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(ag.warn(lg),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(ag.warn(lg),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ag.warn(lg),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}En(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Rn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},wg={logs:class{constructor(e){var t;this.rl=!1,this.il=!1,this.Ge=vs("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var e,t;this.Hs=0,null==(e=this.ol)||e.onReconnect(),null==(t=this.al)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.rl=!0),Yn&&ks(Yn,"online",this.sl)}ll(e,t,r,i){var n,s=function(e,t){var r,i,n,s,o,a,l,u=null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==e?void 0:e.maxBufferSize)&&void 0!==i?i:100,d=null!=t&&t.consoleCapture?void 0:null!==(n=null==e?void 0:e.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Mr(d)?Math.max(h,2048):Math.max(h,d),v=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==s?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new dn(this.ul(e,t),s,this.Ge,(()=>this.hl()),(e=>e()),void 0,i),s]}dl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.ol||this.cl!==t){var r;null==(r=this.ol)||r.reset(),this.cl=t;var i=this.ll((()=>this.Gr),(e=>{this.Gr=e}));this.ol=i[0],this.vl=i[1]}return this.ol}fl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.al||this.pl!==t){var r;null==(r=this.al)||r.reset(),this.pl=t;var i=this.ll((()=>this.nl),(e=>{this.nl=e}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ug);this.al=i[0],this.gl=i[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var r=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!Or(r)&&r&&(this.rl=!0,this.loadIfEnabled())}}reset(){var e,t;this.Gr=[],null==(e=this.ol)||e.reset(),this.nl=[],null==(t=this.al)||t.reset(),this.Hs=0}captureLog(e){this.dl().captureLog(e)}le(e){this.fl().captureLog(e)}get logger(){return this.ml||(this.ml={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ml}flushLogs(e){e?this.yl(e):(this.ol&&this.ol.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))),this.al&&this.al.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.rl&&!this.il){var e=null==ta?void 0:ta.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.Ge.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.il=!0)})):this.Ge.error(Yu)}else this.Ge.error("PostHog Extensions not found.")}}ul(e,t){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===rr.LogsQueue?e():void 0,setPersistedProperty(e,r){var i;e===rr.LogsQueue&&t(null!==(i=r)&&void 0!==i?i:[])},Tt:e=>this.Tt(e),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Tt(e){return new Promise((t=>{if(Ps(this.Hs,3))t({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,i=e=>{r||(r=!0,clearTimeout(n),t(e))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.bl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;if(this._l(t),t>=200&&300>t)i({kind:"ok"});else if(413===t)i({kind:"too-large"});else if(0!==t&&429!==t&&500>t)i({kind:"fatal",error:new Error("logs request failed with status "+t)});else{var r;i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+t)})}}})}}))}_l(e){(0!==e||this._instance.__loaded)&&(this.Hs=Os(e,this.Hs,3,(()=>this.Ge.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}yl(e){this.Gr.length>0&&this.wl(e,this.Gr,this.vl,hs.LIB_NAME,(e=>{this.Gr=e})),this.nl.length>0&&this.wl(e,this.nl,this.gl,ug,(e=>{this.nl=e}))}wl(e,t,r,i,n){if(0!==t.length){var s=t.map((e=>e.record));n([]);var o=hn(s,un(r,hs.LIB_NAME,hs.LIB_VERSION),i,hs.LIB_VERSION);this._instance._send_request({method:"POST",url:this.bl(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,n=r.sessionStartTimestamp,s=r.lastActivityTimestamp;t.sessionId=r.sessionId,t.windowId=i,Or(n)||(t.sessionStartTimestamp=n),Or(s)||(t.lastActivityTimestamp=s)}if(null!=ta&&null!=(e=ta.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?en(ta.location.href):ta.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},xg={metrics:class{constructor(e){this.Ge=vs("[metrics]"),this._instance=e}initialize(){}dl(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.ol&&this.cl===r||(null==(t=this.ol)||t.reset(),this.cl=r,this.ol=new pn(this.ul(),function(e){var t,r,i,n,s,o=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==o?void 0:o["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==e?void 0:e.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.Ge)),this.ol}count(e,t,r){void 0===t&&(t=1),this.dl().count(e,t,r)}gauge(e,t,r){this.dl().gauge(e,t,r)}histogram(e,t,r){this.dl().histogram(e,t,r)}flush(e){if(!this.ol)return Promise.resolve();if(e){var t=this.ol.drainWindow();return t&&this.Bt(t,e),Promise.resolve()}return this.ol.flush().catch((e=>this.Ge.error("PostHog metrics flush failed:",e)))}reset(){var e;null==(e=this.ol)||e.reset()}ul(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Bt:e=>t.Bt(e),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Bt(e,t){return new Promise((i=>{var n=!1,s=e=>{n||(n=!0,clearTimeout(o),i(e))},o=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(r({method:"POST",url:this.xl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;if(t>=200&&300>t)s({kind:"ok"});else if(413===t)s({kind:"too-large"});else if(0!==t&&429!==t&&500>t)s({kind:"fatal",error:new Error("metrics request failed with status "+t)});else{var r;s({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("metrics request failed with status "+t)})}}}))}))}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},kg=r({},hg,dg,cg,vg,fg,pg,mg,gg,yg,bg,_g,wg,xg);Tp.__defaultExtensionClasses=r({},kg),function(){hs.SDK_DIST_CHANNEL="cdn";var e=cp[_p]=new Tp,t=ta.posthog;t&&ps(t._i,(function(r){if(r&&Sr(r)){var i=e.init(r[0],r[1],r[2]),n=t[r[2]]||t;i&&(i._execute_array.call(i.people,n.people),i._execute_array(n))}})),ta.posthog=e,function(){function e(){e.done||(e.done=!0,wp=!1,ps(cp,(function(e){e._dom_loaded()})))}null!=ts&&ts.addEventListener?"complete"===ts.readyState?e():ks(ts,"DOMContentLoaded",e,{capture:!1}):Yn&&cs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}()}();
2
2
  //# sourceMappingURL=array.full.js.map