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 t(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(l||{}),u=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(u||{}),h=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),c=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(c||{}),v=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(v||{}),f=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(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(t){if(m[t])return m[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in g?g[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return m[t]=e.prototype,e.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 e.prototype;var d=h[t].prototype;return d?((l=navigator.userAgent).includes("Safari")&&!l.includes("Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),u=!0),m[t]=d):r}catch(t){return r}finally{!u&&a.parentNode&&document.body.removeChild(a)}}var _={};function b(t,e,r){var i,n=t+"."+String(r);if(_[n])return _[n].call(e);var s=y(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(_[n]=o,o.call(e)):e[r]}var w={};function x(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"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 t[e]=n.next}}catch(t){return()=>{}}}var C={childNodes:t=>b("Node",t,"childNodes"),parentNode:t=>b("Node",t,"parentNode"),parentElement:t=>b("Node",t,"parentElement"),textContent:t=>b("Node",t,"textContent"),contains:(t,e)=>x("Node",t,"contains")(e),getRootNode:t=>x("Node",t,"getRootNode")(),host:t=>t&&"host"in t?b("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?b("Element",t,"shadowRoot"):null,querySelector:(t,e)=>x("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>x("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:k};function T(t){return t.nodeType===t.ELEMENT_NODE}function E(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function I(t){return"[object ShadowRoot]"==={}.toString.call(t)}function M(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>R(t,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(t){return null}var i}function R(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=M(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return j(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?j(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),T(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function P(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&L(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function L(t){return t.toLowerCase()}var A="__rrweb_original__";function F(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}catch(t){return null}}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,U=/^(data:)([^,]*),(.*)/i;function j(t,e){return(t||"").replace(N,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(D.test(l)||q.test(l))return"url("+u+l+u+")";if(U.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.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,H,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,V=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return V++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=Y.get(t);if(r||(r=t.createElement("a"),Y.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?z:t}(t,e.maxBase64ImageLength):t}function rt(t,e,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=X(t,i);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>W||t.naturalHeight>W)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,l,s.type,s.quality)),et(u,s)}if("image"===e)return et(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=X(t,i);return"image"===e&&h.startsWith("data:")?et(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),e.length>r;){var s=i(J);if(","===s.slice(-1))s=X(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(t,s);for(var a=!1;;){var l=e.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(", ")}(t,i):"style"===r?j(i,tt(t)):"object"===e&&"data"===r?X(t,i):i:X(t,i)}function it(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function nt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&nt(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&nt(C.parentNode(t),e,r)}function st(t,e,r,i){var n;if(T(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(nt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function ot(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var at=new Map;function lt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function ut(t){return null==t?"":t.toLowerCase()}var ht=50,dt=!1,ct=!1;function vt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,_=void 0===y?{}:y,b=e.inlineImages,w=void 0!==b&&b,x=e.recordCanvas,S=void 0!==x&&x,k=e.onSerialize,R=e.onIframeLoad,O=e.iframeLoadTimeout,N=void 0===O?5e3:O,D=e.onIframeListenerRegistered,q=e.onStylesheetLoad,U=e.stylesheetLoadTimeout,z=void 0===U?5e3:U,W=e.keepIframeSrcFn,V=void 0===W?()=>!1:W,J=e.newlyAddedElement,K=void 0!==J&&J,Y=e.depth,X=void 0===Y?0:Y,et=e.maxDepth,nt=void 0===et?ht:et,ft=e.needsMask,pt=e.preserveWhiteSpace,gt=void 0===pt||pt;if(X>=nt)return ct=!0,dt||(dt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+nt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;ft||(ft=st(t,o,a,void 0===ft));var mt,yt=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.keepIframeSrcFn,m=e.newlyAddedElement,y=void 0!==m&&m,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,o=e.doc,a=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.keepIframeSrcFn,m=e.newlyAddedElement,y=void 0!==m&&m,_=e.rootId,b=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),w=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return Z.test(e)?"div":e}(t),x={},S=t.attributes.length,k=0;S>k;k++){var T=t.attributes[k];it(w,T.name)||(x[T.name]=rt(o,w,L(T.name),T.value,t,c))}if("link"===w&&a){var E=t.sheet;if(!E){var I=function(t){return t.href}(t);I&&!(E=lt(o,I))&&I.includes(".css")&&(E=lt(o,window.location.origin+"/"+I.replace(window.location.href,"")))}var R=null;E&&(R=M(E)),R&&(delete x.rel,delete x.href,x._cssText=R)}if("style"===w&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var O=M(t.sheet);O&&(x._cssText=O)}if("input"===w||"textarea"===w||"select"===w){var N=t.value,D=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&N?x.value=P({element:t,type:F(t),tagName:w,value:N,maskInputOptions:u,maskInputFn:h}):D&&(x.checked=D)}if("option"===w&&(t.selected&&!u.select?x.selected=!0:delete x.selected),"dialog"===w&&t.open)try{x.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}if("canvas"===w&&p)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((A in n?n[A]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var q=t.toDataURL(c.type,c.quality),U=o.createElement("canvas");U.width=t.width,U.height=t.height,q!==U.toDataURL(c.type,c.quality)&&(x.rr_dataURL=q)}if("img"===w&&v){B||(B=o.createElement("canvas"),H=B.getContext("2d"));var j=t,z=j.currentSrc||j.getAttribute("src")||"<unknown-src>",W=j.crossOrigin,V=()=>{ot(j,"load",V);try{B.width=j.naturalWidth,B.height=j.naturalHeight,H.drawImage(j,0,0),x.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+z+"! Error: "+t)}"anonymous"===j.crossOrigin&&(W?x.crossOrigin=W:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===w||"video"===w){var G=x;G.rr_mediaState=t.paused?"paused":"played",G.rr_mediaCurrentTime=t.currentTime,G.rr_mediaPlaybackRate=t.playbackRate,G.rr_mediaMuted=t.muted,G.rr_mediaLoop=t.loop,G.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop)),b){var Q=t.getBoundingClientRect(),J=Q.width,K=Q.height,Y=Q.left,X=Q.top,tt=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);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"},tt&&(x.rr_position=tt.position||"static",tt.transform&&"none"!==tt.transform&&(x.rr_transform=tt.transform),tt.display&&tt.display.startsWith("inline")&&(x.rr_display=tt.display))}"iframe"!==w||g(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);try{customElements.get(w)&&(s=!0)}catch(t){}return{type:f.Element,tagName:w,attributes:x,childNodes:[],isSVG:(et=t,Boolean("svg"===et.tagName||et.ownerSVGElement)||void 0),needBlock:b,rootId:_,isCustom:s};var et}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:y,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,o=C.parentNode(t),a=o&&o.tagName,l=C.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=M(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=j(l,tt(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:_,inlineImages:w,recordCanvas:S,keepIframeSrcFn:V,newlyAddedElement:K});if(!yt)return console.warn(t,"not serialized"),null;mt=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){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}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ut(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ut(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ut(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ut(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ut(t.attributes.property).match(/^(og|twitter|fb):/)||ut(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ut(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(ut(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ut(t.attributes.name))||ut(t.attributes.property).match(/^article:/)||ut(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ut(t.attributes.name)))return!0}}return!1}(yt,m)||!gt&&yt.type===f.Text&&!yt.isStyle&&!yt.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var _t=Object.assign(yt,{id:mt});if(i.add(t,_t),mt===G)return null;k&&k(t);var bt=!u;if(_t.type===f.Element){bt=bt&&!_t.needBlock,delete _t.needBlock;var wt=C.shadowRoot(t);wt&&I(wt)&&(_t.isShadowHost=!0)}if((_t.type===f.Document||_t.type===f.Element)&&bt){m.headWhitespace&&_t.type===f.Element&&"head"===_t.tagName&&(gt=!1);var xt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:_,inlineImages:w,recordCanvas:S,preserveWhiteSpace:gt,onSerialize:k,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:V,depth:X+1,maxDepth:nt};if(_t.type===f.Element&&"textarea"===_t.tagName&&void 0!==_t.attributes.value);else for(var St of Array.from(C.childNodes(t))){var kt=vt(St,xt);kt&&_t.childNodes.push(kt)}var Ct=null;if(T(t)&&(Ct=C.shadowRoot(t)))for(var Tt of Array.from(C.childNodes(Ct))){var Et=vt(Tt,xt);Et&&(I(Ct)&&(Et.isShadow=!0),_t.childNodes.push(Et))}}var It=C.parentNode(t);if(It&&E(It)&&I(It)&&(_t.isShadow=!0),_t.type===f.Element&&"iframe"===_t.tagName){var Mt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),ot(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,r),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?ot(t,"load",o):(a=!0,ot(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),ot(t,"load",o)}}return t.addEventListener("load",o),()=>{ot(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&R){var r=vt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:_,inlineImages:w,recordCanvas:S,preserveWhiteSpace:gt,onSerialize:k,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:V,depth:X+1,maxDepth:nt});r&&R(t,r)}}),N);null==D||D(t,Mt)}return _t.type===f.Element&&"link"===_t.tagName&&"stylesheet"===_t.attributes.rel&&function(e,l,u){if(!at.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(q){var e=vt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:_,inlineImages:w,recordCanvas:S,preserveWhiteSpace:gt,onSerialize:k,onIframeLoad:R,iframeLoadTimeout:N,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:V,depth:X,maxDepth:nt});e&&q(t,e)}})()}finally{at.delete(e),c.abort()}}},b=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(b)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),at.set(e,c)}}}(t,0,z),_t}function ft(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class pt{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof pt))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function gt(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>mt(r,t,e,i)}function mt(t,e,r,i){yt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function yt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var _t="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.",bt={map:{},getId(){return console.error(_t),-1},getNode(){return console.error(_t),null},removeNodeFromMap(){console.error(_t)},has(){return console.error(_t),!1},reset(){console.error(_t)}};function wt(t,e,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=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function xt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>xt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(bt=new Proxy(bt,{get(t,e,r){return"map"===e&&console.error(_t),Reflect.get(t,e,r)}}));var St=Date.now;function kt(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=C.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.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 Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Tt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Et(t){return t?t.nodeType===t.ELEMENT_NODE?t:C.parentElement(t):null}function It(t,e,r,i){if(!t)return!1;var n=Et(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(nt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Mt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===G}function Rt(t,e){if(E(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Rt(i,e))}function Ot(t){return Boolean(t.changedTouches)}function Pt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function $t(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Lt(t){return!!t&&(t instanceof pt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(St=()=>(new Date).getTime());class At{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function Nt(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function Dt(t){return"__ln"in t}class qt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Dt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Dt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Ut,jt=(t,e)=>t+"@"+e;class Bt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new qt,i=t=>{for(var e=t,r=G;r===G;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&Nt(n)&&"TEXTAREA"!==s.tagName){var o=E(s)?this.mirror.getId(Ft(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=vt(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:t=>{Pt(t,this.mirror)&&this.iframeManager.addIframe(t),$t(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Lt(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)zt(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Wt(this.droppedSet,o)||zt(this.removesSubTreeCache,o)?Wt(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((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(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",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:F(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Mt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);It(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:st(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Et(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=F(r);n=P({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(It(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!it(r.tagName,i))if(o.attributes[i]=rt(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(a.style.cssText=t.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(It(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=E(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);It(t.target,this.blockClass,this.blockSelector,!1)||Mt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Ht(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Rt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[jt(r,i)]?Ht(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!E(t.target)||!I(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Mt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[jt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);It(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Lt(t)&&C.childNodes(C.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),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 Ht(t,e){t.delete(e),C.childNodes(e).forEach((e=>Ht(t,e)))}function zt(t,e,r){return 0!==t.size&&function(t,e,r){var i=C.parentNode(e);return!!i&&t.has(i)}(t,e)}function Wt(t,e){return 0!==t.size&&Vt(t,e)}function Vt(t,e){var r=C.parentNode(e);return!!r&&(!!t.has(r)||Vt(t,r))}var Zt=t=>Ut?function(){try{return t(...arguments)}catch(t){if(Ut&&!0===Ut(t))return;throw t}}:t,Gt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Jt(t,e){var r=new Bt;Gt.push(r),r.init(t);var i=new(S())(Zt(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function Kt(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Qt(t);if(o&&!It(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=kt(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),e({id:h,x:l,y:u}))}},u=[gt("scroll",Zt(wt(Zt((t=>l(t))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(gt("scrollend",Zt(l),r)),()=>u.forEach((t=>t()))}function Yt(t,e){for(var r=Gt.length-1;r>=0;r--){var i=Gt[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Gt.splice(r,1))}}}var Xt=["INPUT","TEXTAREA","SELECT"],te=new WeakMap;function ee(t){return function t(e,r){if(se("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||se("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||se("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||se("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function re(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ie(t,e){var r,i,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:C.host(e));var a="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.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(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),Zt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ne(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var o=Jt(t,t.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,_,b=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.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=wt(Zt((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),d=Zt(wt(Zt((t=>{var e=Qt(t),r=Ot(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;s||(s=St()),l.push({x:i,y:o,id:n.getId(e),timeOffset:St()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[gt("mousemove",d,i),gt("touchmove",d,i),gt("drag",d,i)];return Zt((()=>{c.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.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((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=L(t),l=(t=>i=>{var a=Qt(i);if(!It(a,s,o,!0)){var l=null,u=t;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[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Ot(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=c,c=null);var v=Ot(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;Zt(e)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(gt(a,l,i))})),Zt((()=>{u.forEach((t=>t()))}))}(t),x=Kt(t),S=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return gt("resize",Zt(wt(Zt((()=>{var t=Ct(),e=Tt();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),T=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Qt(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=C.parentElement(e)),e&&c&&Xt.indexOf(c)>=0&&!It(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=F(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[c.toLowerCase()]||u[g])&&(f=P({element:e,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=te.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){te.set(t,i);var o=n.getId(t);Zt(e)(r({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>gt(t,Zt(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};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((t=>xt(t[0],t[1],{set(){Zt(c)({target:this,isTrusted:!1})}},!1,p)))),Zt((()=>{f.forEach((t=>t()))}))}(t),E=(l=(a=t).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=Zt((t=>wt(Zt((e=>{var r=Qt(e);if(r&&!It(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),_=[gt("play",y(v.Play),m),gt("pause",y(v.Pause),m),gt("seeked",y(v.Seeked),m),gt("volumechange",y(v.VolumeChange),m),gt("ratechange",y(v.RateChange),m)],Zt((()=>{_.forEach((t=>t()))}))),I=()=>{},M=()=>{},R=()=>{},O=()=>{};t.recordDOM&&(I=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Zt(((t,e,s)=>{var o=s[0],a=s[1],l=re(e,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}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};oe("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(oe("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),oe("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),oe("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Zt(((t,e,s)=>{var o=s[0],a=s[1],l=re(e.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:[...ee(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...ee(e),o]}]}),t.apply(e,s)}))})})),Zt((()=>{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((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),M=ie(t,t.doc),R=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Zt(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(e,[u,h,d]);var c=re(null==(l=e.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:ee(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Zt(((t,e,o)=>{var a,u=o[0];if(n.has(u))return l.apply(e,[u]);var h=re(null==(a=e.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:ee(e.parentRule)}),t.apply(e,o)}))}),Zt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(O=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=k(r.fonts,"add",(function(t){return function(r){return setTimeout(Zt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Zt((()=>{n.forEach((t=>t()))}))}(t)));var A=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Zt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;It(d,i,n,!0)||It(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),gt("selectionchange",a)}(t),N=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?k(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),D=[];for(var q of t.plugins)D.push(q.observer(q.callback,s,q.options));return Zt((()=>{if(n){n.destroy(),n.reset();var e=Gt.indexOf(n);-1!==e&&Gt.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),b(),w(),x(),S(),T(),E(),I(),M(),R(),O(),A(),N(),D.forEach((t=>t()))}))}function se(t){return void 0!==window[t]}function oe(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ae{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class le{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ae(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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ae(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>yt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{mt(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);yt((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}yt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(mt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(mt(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((t=>{yt((()=>this.mirror.removeNodeFromMap(t)))})),yt((()=>Yt(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&mt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{mt(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),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 ue{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,n;if(I(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=C.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,o=Jt(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=Gt.indexOf(l);-1!==t&&Gt.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Kt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(C.host(t))),this.restoreHandlers.push({doc:s,handler:ie({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:k(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=C.shadowRoot(this);return s&&Nt(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}for(var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",de="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ce=0;64>ce;ce++)de[he.charCodeAt(ce)]=ce;var ve=new Map,fe=(t,e,r)=>{if(t&&(me(t,e)||"object"==typeof t)){var i=function(t,e){var r=ve.get(t);return r||ve.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function pe(t,e,r,i){if(t instanceof Array)return t.map((t=>pe(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=he[r[e]>>2],n+=he[(3&r[e])<<4|r[e+1]>>4],n+=he[(15&r[e+1])<<2|r[e+2]>>6],n+=he[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[pe(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[pe(t.data,e,r,i),t.width,t.height]}:me(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:fe(t,e,r)}:t}var ge=(t,e,r,i)=>t.map((t=>pe(t,e,r,i))),me=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},ye=["webgl","webgl2"];function _e(t){return"nodeType"in t}function be(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return k(n.prototype,"configure",(function(n){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||_e(o)&&It(o,e,i,!0))return n.call(this,s);_e(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=k(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!It(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&ye.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 t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function we(t,e,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=k(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(fe(d,s,this),"tagName"in this.canvas&&!It(this.canvas,i,n,!0)){var c=ge(u,s,this,o);r(this.canvas,{type:e,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=xt(t,l,{set(t){r(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var xe,Se,ke,Ce='(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',Te="undefined"!=typeof self&&self.Blob&&new Blob([Ce],{type:"text/javascript;charset=utf-8"});function Ee(t){var e;try{if(!(e=Te&&(self.URL||self.webkitURL).createObjectURL(Te)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ce),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ie{constructor(t){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",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale;this.mutationCb=t.mutationCb,this.mirror=t.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(t,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=be(r,i,n,!0),h=new Map;try{a=new Ee}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a)},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,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/t,p=0,g=t=>{var u,c;d||(p&&f>t-p||(p=t,(u=[],c=t=>{try{t.querySelectorAll("canvas").forEach((t=>{It(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&c(t.shadowRoot)}))}catch(t){}},c(r.document),u).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.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=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=yield createImageBitmap(t,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(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a)}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=be(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=k(e.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 It(this.canvas,r,i,!0)||setTimeout((()=>{var r=ge(l,e,this,n);t(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=xt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:c["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...we(e.WebGLRenderingContext.prototype,c.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...we(e.WebGL2RenderingContext.prototype,c.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Me{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:R(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,at.forEach((t=>t.abort())),at.clear()}trackStylesheetInLinkElement(t){}}class Re{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var $e=new O,Le=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function Ae(t){void 0===t&&(t={});var e=t,i=e.emit,n=e.checkoutEveryNms,s=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,h=e.blockSelector,d=void 0===h?null:h,c=e.ignoreClass,v=void 0===c?"rr-ignore":c,f=e.ignoreSelector,p=void 0===f?null:f,g=e.maskTextClass,m=void 0===g?"rr-mask":g,y=e.maskTextSelector,_=void 0===y?null:y,b=e.inlineStylesheet,w=void 0===b||b,x=e.maskAllInputs,S=e.maskInputOptions,k=e.slimDOMOptions,T=e.maskInputFn,E=e.maskTextFn,I=e.hooks,M=e.packFn,R=e.sampling,P=void 0===R?{}:R,L=e.dataURLOptions,A=void 0===L?{}:L,F=e.canvasResolutionScale,N=e.mousemoveWait,D=e.recordDOM,q=void 0===D||D,U=e.recordCanvas,j=void 0!==U&&U,B=e.recordCrossOriginIframes,H=void 0!==B&&B,z=e.recordAfter,W=void 0===z?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":z,V=e.userTriggeredOnInput,Z=void 0!==V&&V,G=e.collectFonts,Q=void 0!==G&&G,J=e.inlineImages,K=void 0!==J&&J,Y=e.plugins,X=e.keepIframeSrcFn,tt=void 0===X?()=>!1:X,et=e.ignoreCSSAttributes,rt=void 0===et?new Set([]):et,it=e.attributeFilter;Ut=e.errorHandler;var nt=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},A),st=!H||window.parent===window,ot=!1;if(!st)try{window.parent.document&&(ot=!1)}catch(t){ot=!0}if(st&&!i)throw new Error("emit function is required");if(!st&&!ot)return()=>{};void 0!==N&&void 0===P.mousemove&&(P.mousemove=N),$e.reset();var at,lt=!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!==S?S:{password:!0},ut=ft(void 0!==k&&k);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var ht,dt,ct=0,pt=new Map,mt=t=>{for(var e of Y||[])e.eventProcessor&&(t=e.eventProcessor(t));return M&&!ot&&(t=M(t)),t};xe=(t,e)=>{var r,o=t;if(o.timestamp=St(),!(null==(r=Gt[0])?void 0:r.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&Le.has(o.data.source)||Gt.forEach((t=>t.unfreeze())),st)null==i||i(mt(o),e);else if(ot){var a={type:"rrweb",event:mt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)at=o,ct=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;ct++,(s&&ct>=s||n&&o.timestamp-at.timestamp>n)&&Se(!0)}};var _t=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=$e.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Et.getIframeElementById(r);n&&i.has(n)?Et.forgetIframeId(r):(null==ht||ht(r),Et.removeIframeById(r))}})),null==dt||dt(),Et.cleanupDetachedIframes()}xe({type:l.IncrementalSnapshot,data:r({source:u.Mutation},t)})},bt=t=>xe({type:l.IncrementalSnapshot,data:r({source:u.Scroll},t)}),wt=t=>xe({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),xt=new Me({mutationCb:_t,adoptedStyleSheetCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Et=new le({mirror:$e,mutationCb:_t,stylesheetManager:xt,recordCrossOriginIframes:H,wrappedEmit:xe});for(var It of Y||[])It.getMirror&&It.getMirror({nodeMirror:$e,crossOriginIframeMirror:Et.crossOriginIframeMirror,crossOriginIframeStyleMirror:Et.crossOriginIframeStyleMirror});var Mt=new Re;ke=new Ie({recordCanvas:j,mutationCb:wt,win:window,blockClass:a,blockSelector:d,mirror:$e,sampling:P.canvas,dataURLOptions:nt,resolutionScale:F});var Rt=new ue({mutationCb:_t,scrollCb:bt,bypassOptions:{blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:_,inlineStylesheet:w,maskInputOptions:lt,dataURLOptions:nt,maskTextFn:E,maskInputFn:T,recordCanvas:j,inlineImages:K,sampling:P,slimDOMOptions:ut,iframeManager:Et,stylesheetManager:xt,canvasManager:ke,keepIframeSrcFn:tt,processedNodeManager:Mt,attributeFilter:it},mirror:$e});Se=function(t){if(void 0===t&&(t=!1),q){xe({type:l.Meta,data:{href:window.location.href,width:Tt(),height:Ct()}},t),xt.reset(),Rt.init(),Gt.forEach((t=>t.lock()));var e=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new O: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,_=r.onSerialize,b=r.onIframeLoad,w=r.iframeLoadTimeout,x=r.onIframeListenerRegistered,S=r.onStylesheetLoad,k=r.stylesheetLoadTimeout,C=r.keepIframeSrcFn,T=void 0===C?()=>!1:C,E=r.maxDepth;return vt(t,{doc:t,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:ft(void 0!==g&&g),dataURLOptions:m,inlineImages:d,recordCanvas:v,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:b,iframeLoadTimeout:w,onIframeListenerRegistered:x,onStylesheetLoad:S,stylesheetLoadTimeout:k,keepIframeSrcFn:T,newlyAddedElement:!1,maxDepth:E})}(document,{mirror:$e,blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:_,inlineStylesheet:w,maskAllInputs:lt,maskTextFn:E,maskInputFn:T,slimDOM:ut,dataURLOptions:nt,recordCanvas:j,inlineImages:K,onSerialize(t){Pt(t,$e)&&Et.addIframe(t),$t(t,$e)&&xt.trackLinkElement(t),Lt(t)&&Rt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){Et.attachIframe(t,e),Rt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Et.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){xt.attachLinkElement(t,e)},keepIframeSrcFn:tt});if(!e)return console.warn("Failed to snapshot the document");xe({type:l.FullSnapshot,data:{node:e,initialOffset:kt(window)}},t),Gt.forEach((t=>t.unlock())),H&&Et.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&xt.adoptStyleSheets(document.adoptedStyleSheets,$e.getId(document))}};try{var Ot=[];ht=t=>{var e=pt.get(t);e&&(e.forEach((t=>{yt(t);var e=Ot.indexOf(t);-1!==e&&Ot.splice(e,1)})),pt.delete(t))},dt=()=>{for(var t of pt){var e=t[0],r=$e.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==ht||ht(e)}catch(t){null==ht||ht(e)}else null==ht||ht(e)}};var At=t=>{var e;return Zt(ne)({mutationCb:_t,mousemoveCb:(t,e)=>xe({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:bt,viewportResizeCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:wt,fontCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){xe({type:l.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){xe({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:a,ignoreClass:v,ignoreSelector:p,maskTextClass:m,maskTextSelector:_,maskInputOptions:lt,inlineStylesheet:w,sampling:P,recordDOM:q,recordCanvas:j,inlineImages:K,userTriggeredOnInput:Z,collectFonts:Q,doc:t,maskInputFn:T,maskTextFn:E,keepIframeSrcFn:tt,blockSelector:d,slimDOMOptions:ut,dataURLOptions:nt,mirror:$e,iframeManager:Et,stylesheetManager:xt,shadowDomManager:Rt,processedNodeManager:Mt,canvasManager:ke,ignoreCSSAttributes:rt,attributeFilter:it,plugins:(null==(e=null==Y?void 0:Y.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>xe({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},I)};Et.addLoadListener((t=>{try{var e=$e.getId(t),r=At(t.contentDocument);if(Ot.push(r),-1!==e){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Et.addPageHideListener((t=>{var e=$e.getId(t);null==ht||ht(e),Yt(t)}));var Ft=-1,Nt=t=>xe({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Dt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?$e.getId(s):-1;o!==Ft&&(-1!==Ft&&Nt({id:Ft,enter:!1}),Ft=o,-1!==o&&Nt({id:o,enter:!0}))},qt=()=>{Se(),Ot.push(At(document)),Ot.push(gt("fullscreenchange",Dt)),Ot.push(gt("webkitfullscreenchange",Dt)),Ot.push(gt("mozfullscreenchange",Dt)),Ot.push(gt("MSFullscreenChange",Dt)),Oe=!0};return["interactive","complete"].includes(document.readyState)?qt():(Ot.push(gt("DOMContentLoaded",(()=>{xe({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===W&&qt()}))),Ot.push(gt("load",(()=>{xe({type:l.Load,data:{}}),"load"===W&&qt()}),window))),()=>{Ot.forEach((t=>yt(t))),Mt.destroy(),Et.removeLoadListener(),Et.destroy(),pt.clear(),Rt.reset(),$e.reset(),Oe=!1,Ut=void 0}}catch(t){console.warn(t)}}Ae.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");xe({type:l.Custom,data:{tag:t,payload:e}})},Ae.freezePage=()=>{Gt.forEach((t=>t.freeze()))},Ae.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");Se(t)},Ae.mirror=$e;var Fe=Object.defineProperty,Ne=(t,e,r)=>((t,e,r)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class De{constructor(t){Ne(this,"fileName"),Ne(this,"functionName"),Ne(this,"lineNumber"),Ne(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var qe=/(^|@)\S+:\d+/,Ue=/^\s*at .*(\S+:\d+|\(native\))/m,je=/^(eval@)?(\[native code])?$/,Be={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ue)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ue)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).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 De({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(je)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new De({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new De({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new De({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new De({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(qe)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new De({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function He(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.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(t)+")"),e=r+(e?">"+e:""),t=i}return e}function ze(t){return Array.isArray(t)}function We(t){return"object"==typeof t&&null!==t&&!ze(t)}function Ve(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(We(t[i])&&Ve(t[i],e-1))return!0;return!1}function Ze(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(We(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||We(o)&&Ve(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=ze(u)?He(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Ge={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 Qe(t,e,r){var i,n=r?Object.assign({},Ge,r):Ge,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=Be.parse(e.error).map((t=>t.toString())),s=[Ze(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Ze("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Ze("Uncaught (in promise)",n.stringifyOptions),Ze(e.reason,n.stringifyOptions)]);var s=Be.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Be.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>Ze(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Ze("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Je=t=>({name:"rrweb/console@1",observer:Qe,options:t}),Ke=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Ye(t){return"string"==typeof t||t}function Xe(t){return"string"==typeof t?t:void 0}var tr,er=["$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(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),ir=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),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=t=>t.length>=2&&31===t[0]&&139===t[1],hr=(t,e)=>t===ir.GZipJS||e===ir.GZipJS||"gzip"===e,dr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),cr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=lr,e},vr=function(){var t=e((function*(t,e){18>t.size&&cr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());ur(r)&&8===r[2]||cr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(tr)return tr;tr=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;tr[t]=e>>>0}return tr})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&cr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&cr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function fr(){return fr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield vr(u,n),u}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),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(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return pr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function mr(t,e){return-1!==t.indexOf(e)}var yr=function(t){return t.trim()},_r=function(t){return t.replace(/^\$/,"")};function br(t){var e,r=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(e))return"[Circular]";r.push(e)}return e}})))&&void 0!==e?e:"null"}var wr=Object.prototype,xr=wr.hasOwnProperty,Sr=wr.toString,kr=Array.isArray||function(t){return"[object Array]"===Sr.call(t)},Cr=t=>"function"==typeof t,Tr=t=>t===Object(t)&&!kr(t),Er=t=>{if(Tr(t)){for(var e in t)if(xr.call(t,e))return!1;return!0}return!1},Ir=t=>void 0===t,Mr=t=>"[object String]"==Sr.call(t),Rr=t=>Mr(t)&&0===t.trim().length,Or=t=>null===t,Pr=t=>Ir(t)||Or(t),$r=t=>"[object Number]"==Sr.call(t)&&t==t,Lr=t=>$r(t)&&t>0,Ar=t=>"[object Boolean]"===Sr.call(t),Fr=t=>t instanceof FormData,Nr=t=>mr(or,t),Dr=t=>mr(ar,t);function qr(t){return null===t||"object"!=typeof t}function Ur(t,e){return{}.toString.call(t)==="[object "+e+"]"}function jr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Br=[!0,"true",1,"1","yes"],Hr=t=>mr(Br,t),zr=[!1,"false",0,"0","no"];function Wr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),$r(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Wr(n||r,e,r,i))}class Vr{constructor(t){this.$e={},this.ze=t.ze,this.Ze=Wr(t.bucketSize,0,100,t.Ge),this.Qe=Wr(t.refillRate,0,this.Ze,t.Ge),this.Je=Wr(t.refillInterval,0,864e5,t.Ge)}Ke(t,e){var r=Math.floor((e-t.lastAccess)/this.Je);r>0&&(t.tokens=Math.min(t.tokens+r*this.Qe,this.Ze),t.lastAccess=t.lastAccess+r*this.Je)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),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==(e=this.ze)||e.call(this,t)),0===n.tokens)}stop(){this.$e={}}}var Zr="Mobile",Gr="iOS",Qr="Android",Jr="Tablet",Kr=Qr+" "+Jr,Yr="iPad",Xr="Apple",ti=Xr+" Watch",ei="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",_i="Xbox",bi=Qr+" "+Zr,wi=Zr+" "+ei,xi="Windows",Si=xi+" Phone",ki="Nokia",Ci="Ouya",Ti="Generic",Ei=Ti+" "+Zr.toLowerCase(),Ii=Ti+" "+Jr.toLowerCase(),Mi="Konqueror",Ri="Oculus Browser",Oi="Vivaldi",Pi="Yandex",$i="Whale",Li="DuckDuckGo",Ai="Pale Moon",Fi="Waterfox",Ni="Brave",Di="Google Search App",qi="(\\d+(\\.\\d+)?)",Ui=new RegExp("Version/"+qi),ji=new RegExp(_i,"i"),Bi=new RegExp(yi+" \\w+","i"),Hi=new RegExp(mi+" \\w+","i"),zi=new RegExp(ri+"|PlayBook|BB10","i"),Wi={"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"},Vi=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?Ni:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&mr(t,"GSA/")?Di:mr(t," OPR/")&&mr(t,"Mini")?ci:mr(t," OPR/")?di:zi.test(t)?ri:mr(t,"IE"+Zr)||mr(t,"WPDesktop")?hi:mr(t,"OculusBrowser")?Ri:mr(t,ni)?si:mr(t,vi)||mr(t,"Edg/")?fi:mr(t,Oi+"/")?Oi:mr(t,"YaBrowser/")?Pi:mr(t,$i+"/")?$i:mr(t,Li+"/")||mr(t,"Ddg/")?Li:mr(t,"FBIOS")?"Facebook "+Zr:mr(t,"UCWEB")||mr(t,"UCBrowser")?"UC Browser":mr(t,"CriOS")?li:mr(t,"CrMo")||mr(t,oi)?oi:mr(t,Qr)&&mr(t,ei)?bi:mr(t,"FxiOS")?gi:mr(t.toLowerCase(),Mi.toLowerCase())?Mi:mr(t,Ni+"/")?Ni:((t,e)=>e&&mr(e,Xr)||function(t){return mr(t,ei)&&!mr(t,oi)&&!mr(t,Qr)}(t))(t,e)?mr(t,Zr)?wi:ei:mr(t,"PaleMoon/")?Ai:mr(t,Fi+"/")?Fi:mr(t,pi)?pi:mr(t,"MSIE")||mr(t,"Trident/")?ui:mr(t,"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)],[ei]:[Ui],[wi]:[Ui],[di]:[new RegExp("(Opera|OPR)\\/"+qi)],[pi]:[new RegExp(pi+"\\/"+qi)],[gi]:[new RegExp("FxiOS\\/"+qi)],[Mi]:[new RegExp("Konqueror[:/]?"+qi,"i")],[ri]:[new RegExp(ri+" "+qi),Ui],[bi]:[new RegExp("android\\s"+qi,"i")],[si]:[new RegExp(ni+"\\/"+qi)],[Ri]:[new RegExp("OculusBrowser\\/"+qi)],[Oi]:[new RegExp(Oi+"\\/"+qi)],[Pi]:[new RegExp("YaBrowser\\/"+qi)],[$i]:[new RegExp($i+"\\/"+qi)],[Ni]:[new RegExp(Ni+"\\/"+qi)],[Li]:[new RegExp("(DuckDuckGo|Ddg)\\/"+qi)],[Ai]:[new RegExp("PaleMoon\\/"+qi)],[Fi]:[new RegExp(Fi+"\\/"+qi)],[Di]:[new RegExp("GSA\\/"+qi)],[ui]:[new RegExp("(rv:|MSIE )"+qi)],Mozilla:[new RegExp("rv:"+qi)]},Gi=function(t,e,r,i){var n=Vi(t,e,r,i),s=Zi[n];if(Ir(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Qi=[[new RegExp(_i+"; "+_i+" (.*?)[);]","i"),t=>[_i,t&&t[1]||""]],[new RegExp(mi,"i"),[mi,""]],[new RegExp(yi,"i"),[yi,""]],[zi,[ri,""]],[new RegExp(xi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Si,""];if(new RegExp(Zr).test(e)&&!/IEMobile\b/.test(e))return[xi+" "+Zr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=Wi[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[xi,i]}return[xi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Gr,[t[3],t[4],t[5]||"0"].join(".")]:[Gr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Ir(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Qr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qr+")","i"),t=>t&&t[2]?[Qr,[t[2],t[3],t[4]||"0"].join(".")]:[Qr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ai,""]],[/Linux|debian/i,["Linux",""]]],Ji=function(t){return Hi.test(t)?mi:Bi.test(t)?yi:ji.test(t)?_i:new RegExp(Ci,"i").test(t)?Ci:new RegExp("("+Si+"|WPDesktop)","i").test(t)?Si:/iPad/.test(t)?Yr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ti:zi.test(t)?ri:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(ki,"i").test(t)?ki:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Zr).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Qr:Kr:new RegExp("(pda|"+Zr+")","i").test(t)?Ei:new RegExp(Jr,"i").test(t)&&!new RegExp(Jr+" pc","i").test(t)?Ii:""},Ki=function(t,e){var r,i,n,s,o=Ji(t);return o===Yr||o===Kr||"Kobo"===o||"Kindle Fire"===o||o===Ii?Jr:o===mi||o===_i||o===yi||o===Ci?"Console":o===ti?"Wearable":o?Zr:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.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(t,e){return"string"==typeof(r=t)&&Yi.test(r)?t:e();var r}function tn(t){return t?t.split("#")[0]:t}function en(t,e){var r=setTimeout(t,e);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var rn=t=>t 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(t){if(Ar(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(kr(t))return{arrayValue:{values:t.map((t=>on(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function an(t){var e=[];for(var r in t){var i=t[r];Or(i)||Ir(i)||e.push({key:r,value:on(i)})}return e}function ln(t,e){var i=nn[t.level||"info"]||sn,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Pr(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Pr(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=r({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:an(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Ir(t.trace_flags)||(u.flags=t.trace_flags),u}function un(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function hn(t,e,r,i){return{resourceLogs:[{resource:{attributes:an(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}let dn=class{constructor(t,e,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Te=e,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=e.maxBufferSize,this.dt=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.ct=e.flushIntervalMs,this.vt=e.maxBatchRecordsPerPost,this.ft=e.rateCapWindowMs,this.yt=e.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(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.wt(t);if(null!==e)if(e.body){if(this.xt()){var r={record:ln(e,this.Ye())};this.Xe((()=>this.kt(r)))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var r=kr(e)?e:[e],i=t;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(t){return this.Ge.error("Error in beforeSend function for log:",t),null}return i}xt(){if(void 0===this.yt)return!0;var t=Date.now(),e=t-this.st;return this.ft>e&&e>=0||(this.st=t,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 t=this;return e((function*(){if(!t._instance.isDisabled)return t.rt||(t.rt=t.St().finally((()=>{t.rt=null}))),t.rt}))()}St(){var t=this;return e((function*(){var e;t.bt();var r=null!==(e=t._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==e?e:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;t.it=0;var a=Math.min(r.length,t.vt),l=r.slice(0,a),u=l.map((t=>t.record)),h=hn(u,t.Ct(),null!==(s=t.tt)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.Tt(h);if("too-large"===d.kind&&l.length>1)t.vt=Math.max(1,Math.floor(l.length/2)),t.Ge.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.vt);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.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&&t.Te.maxBatchRecordsPerPost>t.vt&&(t.vt=Math.min(t.Te.maxBatchRecordsPerPost,t.vt+1)),yield t.It(l.length),r=null!==(o=t._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}It(t){var r=this;return e((function*(){var e,i=Math.max(0,t-r.it),n=null!==(e=r._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==e?e:[];r._instance.setPersistedProperty(rr.LogsQueue,n.slice(i)),yield r.et()}))()}Ct(){return un(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(t){var e;if(!this._instance.optedOut){var r=null!==(e=this._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==e?e:[];this.dt>r.length||(r.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(rr.LogsQueue,r),this.ht>r.length?this.Mt():this._t()}}Mt(t){void 0===t&&(t=this.ct),this.Et||(this.Et=en((()=>{this.Et=void 0,this._t()}),t))}Rt(){var t=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,t)}Pt(){var t=this._instance.getPersistedProperty(rr.LogsQueue);return!!t&&t.length>0}shutdown(t){var r=this;return e((function*(){r.bt();var e=r.flush().catch((()=>{}));void 0!==t?yield Promise.race([e,new Promise((e=>en(e,t)))]):yield e}))()}flushWithTimeout(t){var r=this;return e((function*(){var e=!1,i=r.flush(),n=new Promise((r=>en((()=>{e=!0,r()}),t)));try{yield Promise.race([i,n])}finally{e&&i.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(t=>{this.nt++,this.Ge.error("PostHog logs flush failed:",t)})).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(t){return String(t)+"000000"}function fn(t,e,r,i){var n="";return i&&(n=Object.keys(i).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(i[t]))).join(",")),t+"\0"+e+"\0"+(null!=r?r:"")+"\0"+n}let pn=class{constructor(t,e,r){this._instance=t,this.Te=e,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(t,e,r){void 0===e&&(e=1),this.Nt({name:t,type:"count",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(t,e,r){this.Nt({name:t,type:"gauge",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(t,e,r){this.Nt({name:t,type:"histogram",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var t=this,r=this.rt,i=function(){var i=e((function*(){r&&(yield r.catch((()=>{}))),yield t.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 t=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(t)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.wt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.Ge.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=e.attributes?r({},e.attributes):void 0,n=fn(e.type,e.name,e.unit,i)}catch(t){return void this.Ge.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ot.get(n);if(!s){if(!this.jt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ot.set(n,s)}var o=this.Lt.get(e.name);void 0===o?this.Lt.set(e.name,e.type):o===e.type||this.$t.has(e.name)||(this.$t.add(e.name),this.Ge.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,e.value),this.Mt()}else this.Ge.warn("Dropping metric '"+e.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(t,e){var r;switch(t.type){case"count":t.total=(null!==(r=t.total)&&void 0!==r?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(cn.length+1).fill(0)});var i=t.hist;i.count+=1,i.sum+=e,i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.bucketCounts[function(t,e){for(var r=0;e.length>r;r++)if(e[r]>=t)return r;return e.length}(e,cn)]+=1}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var r=kr(e)?e:[e],i=t;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(t){return this.Ge.error("Error in beforeSend function for metric:",t),null}return i}Mt(){this.Et||(this.Et=en((()=>{this.Et=void 0,this.flush().catch((t=>{this.Ge.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var t=this;return e((function*(){if(0!==t.Ot.size){var e=t.Ot;t.Ot=new Map,t.Ft=!1,t.Lt=new Map,t.$t=new Set;var r=t.At,i=yield t._instance.Bt(t.qt(e));if(r===t.At)switch(i.kind){case"ok":return;case"retry-later":return t.Ut(e),void t.Mt();case"too-large":return void t.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ge.error("Failed to send metrics batch:",i.error)}}}))()}qt(t){return e=this.zt(t),i=function(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"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:e}]}]};var e,i,n,s}zt(t){var e=vn(Date.now()),i=new Map;for(var n of t.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:e,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:e,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:e,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(t){var e,r;for(var i of t){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!==(e=o.total)&&void 0!==e?e: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(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var mn,yn,_n;function bn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return _n&&r.length===yn||(yn=r.length,_n=r.reduce(((r,i)=>{mn||(mn={});var n=mn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,mn[i]=[l,u];break}}return r}),{})),_n}}class wn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&kr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:bn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var xn="?";function Sn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?xn:r,in_app:!0};return Ir(i)||(s.lineno=i),Ir(n)||(s.colno=n),s}var kn=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:xn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Cn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,In=(t,e)=>{var r=Cn.exec(t);if(r)return Sn(e,r[1],xn,+r[2],+r[3]);var i=Tn.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=En.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=kn(i[1]||xn,i[2]);return Sn(e,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Mn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,On=(t,e)=>{var r=Mn.exec(t);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=kn(s,n);return Sn(e,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Pn=/\(error: (.*)\)/,$n=50;class Ln{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Mr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return Ur(t,"DOMException")}isDOMError(t){return Ur(t,"DOMError")}}class An{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Fn{constructor(){}match(t){return Ur(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Nn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Dn{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Nn);return i&&(e=i[1],r=i[2]),[e,r]}}var qn=["fatal","error","warning","log","info","debug"];function Un(t,e){void 0===e&&(e=40);var r=Object.keys(t);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(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class jn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return jr(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Un(t)}isSeverityLevel(t){return Mr(t)&&!Rr(t)&&qn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(rn(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Bn{match(t){return jr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Un(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Hn{match(t){return qr(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class zn{match(t){return Ur(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!jr(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return qr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Wn="$message",Vn="$timestamp",Zn=new Set([Wn,Vn]),Gn={enabled:!0,max_bytes:32768};function Qn(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Gn.enabled,max_bytes:Kn(t.max_bytes,Gn.max_bytes)}:r({},Gn)}class Jn{constructor(t){this.Vt=[],this.Wt=0,this.Te=Qn(t)}setConfig(t){this.Te=Qn(t),this.Zt()}add(t){var e=function(t){var e;try{e=br(t)}catch(t){return}try{var r=JSON.parse(e);if(!Tr(r))return;var i=r,n=i[Wn],s=i[Vn];if(!Mr(n)||0===n.trim().length)return;if(!Mr(s)&&!$r(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.Te.max_bytes||(this.Vt.push({step:e.step,bytes:r}),this.Wt+=r,this.Zt())}}getAttachable(){return this.Vt.map((t=>t.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 t=this.Vt.shift();t&&(this.Wt-=t.bytes)}}}function Kn(t,e){if(!$r(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var Yn="undefined"!=typeof window?window:void 0,Xn="undefined"!=typeof globalThis?globalThis:Yn,ts=null==Xn?void 0:Xn.navigator,es=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==ts?void 0:ts.userAgent;function ls(){return!(!Yn||!1===Yn.navigator.onLine)}var us=t=>"undefined"!=typeof Document&&t instanceof Document,hs={DEBUG:!1,LIB_VERSION:"0.2.4",LIB_NAME:"browser-common"},ds=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(Yn&&(hs.DEBUG||Yn.POSTHOG_DEBUG||r)&&!Ir(Yn.console)&&Yn.console){for(var i=("__rrweb_original__"in Yn.console[e]?Yn.console[e].__rrweb_original__:Yn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>ds(t+" "+e,r)};return i},cs=ds("[PostHog.js]"),vs=cs.createLogger;function fs(t,e){kr(t)&&t.forEach(e)}function ps(t,e){if(!Pr(t))if(kr(t))t.forEach(e);else if(Fr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)xr.call(t,r)&&e(t[r],r)}var gs=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function ms(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var ys=function(t){try{return t()}catch(t){return}},_s=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){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(t)}}},bs=function(t){var e={};return ps(t,(function(t,r){(Mr(t)&&t.length>0||$r(t))&&(e[r]=t)})),e};var ws=["herokuapp.com","vercel.app","netlify.app"];function xs(t){var e=null==t?void 0:t.hostname;if(!Mr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of ws)if(r===i)return!1;return!0}function Ss(t,e,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function ks(t){return"ph_toolbar_internal"===t.name}var Cs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return br(t)}},Ts=t=>{var e=null==es?void 0:es.createElement("a");return Ir(e)?null:(e.href=t,e)},Es=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return ps(t,(function(t,e){Ir(t)||Ir(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Is=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!kr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){cs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ms=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.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("=");kr(d)&&(e.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(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},Os=(t,e)=>t>=e&&ls(),Ps=(t,e,r,i)=>{if(0===t){if(ls()){var n=e+1;return n===r&&i(),n}return e}return 0},$s=()=>{};function Ls(t,e,r){try{if(!(e in t))return $s;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Cr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Cr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return $s}}function As(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function Fs(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Cr(i))return e;try{var n=i(e);return Mr(n)&&n?n:e}catch(t){return cs.error("Error in get_current_url, falling back to window.location.href",t),e}}function Ns(t){var e,r=null==Yn||null==(e=Yn.location)?void 0:e.href;return Ir(r)?void 0:Fs(t,r)}var Ds="__POSTHOG_TOOLBAR__",qs=1,Us=3,js=11;function Bs(t){return t instanceof Element&&(t.id===Ds||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Hs(t){return!!t&&t.nodeType===qs}function zs(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Ws(t){return!!t&&t.nodeType===Us}function Vs(t){return!!t&&t.nodeType===js&&Hs(t.host)}var Zs=1e3;function Gs(t){return t?yr(t).split(/\s+/):[]}function Qs(t,e){var r=Ns(e);return!!(r&&t&&t.some((t=>r.match(t))))}function Js(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Gs(e)}function Ks(t){return Pr(t)?null:yr(t).split(/(\s+)/).filter((t=>xo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ys(t){var e="";return fo(t)&&!po(t)&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;Ws(t)&&t.textContent&&(e+=null!==(r=Ks(t.textContent))&&void 0!==r?r:"")})),yr(e)}function Xs(t){var e;return Ir(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var to=["a","button","form","input","select","textarea","label"];function eo(t,e){if(Ir(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function ro(t){var e=t.parentNode;return!(!e||!Hs(e))&&e}var io=[".ph-no-autocapture","[data-ph-no-autocapture]"],no=["next","previous","prev",">","<"],so=[...no,"+","-","−","–"],oo=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ao=[".ph-no-deadclick",".ph-no-capture"],lo=[".ph-no-rageclick",".ph-no-capture"],uo=["","text","search","email","password","url","tel","number"];function ho(t,e){if(!Yn||co(t))return!1;var r,i,n,s,o;if(Ar(e)?(r=!!e&&lo,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:lo,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!Hs(t))&&(!!zs(t,"textarea")||(zs(t,"input")?mr(uo,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var a=vo(t,!1).targetElementList;return!function(t,e){if(!1===t||Ir(t))return!1;var r;if(!0===t)r=no;else{if(!kr(t))return!1;if(t.length>10)return cs.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,i=t.ariaLabel;return r.some((t=>oo(e,t)||oo(i,t)))}))}(i,a.map((t=>{var e;return{safeText:Ys(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!eo(a,r)}var co=t=>!t||zs(t,"html")||!Hs(t),vo=(t,e)=>{if(!Yn||co(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!zs(n,"body");)if(Vs(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ro(n);if(!s)break;if(e||to.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=Yn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function fo(t){for(var e=new Set,r=0,i=t;i.parentNode&&!zs(i,"body");i=i.parentNode){if(r++>=Zs||e.has(i))return!1;e.add(i);var n=Js(i);if(mr(n,"ph-sensitive")||mr(n,"ph-no-capture"))return!1}if(mr(Js(t),"ph-include"))return!0;var s=t.type||"";if(Mr(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Mr(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(t){return!!(zs(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||zs(t,"select")||zs(t,"textarea")||"true"===t.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),_o="\\d{3}-?\\d{2}-?\\d{4}",bo=new RegExp("^("+_o+")$"),wo=new RegExp("("+_o+")");function xo(t,e){if(void 0===e&&(e=!0),Pr(t))return!1;if(Mr(t)){if(t=yr(t),(e?mo:yo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?bo:wo).test(t))return!1}return!0}function So(t){var e=Ys(t);return xo(e=(e+" "+ko(t)).trim())?e:""}function ko(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Ys(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+ko(t)).trim())}catch(t){cs.error("[AutoCapture]",t)}})),e}function Co(t){return t.replace(/"|\\"/g,'\\"')}function To(t){var e=t.attr__class;if(e)return kr(e)?e:Gs(e)}var Eo=1e6,Io={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Eo,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},Mo=vs("[Recorder]"),Ro=t=>"navigation"===t.entryType,Oo=t=>"resource"===t.entryType;function Po(t,e){return!!e&&(Ar(e)||e[t])}function $o(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Lo=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ao(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!$o(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Lo))return!1;if(Ar(r))return!0;if(kr(r))return n(r);var s=r[e];return Ar(s)?s:n(s)}function Fo(t,e,r,i,n,s){return No.apply(this,arguments)}function No(){return No=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Mo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Oo(o=t[s])&&o.initiatorType===e&&(Ir(i)||o.startTime>=i)&&(Ir(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Fo(t,e,r,i,n,s+1))})),No.apply(this,arguments)}function Do(t){var e=t.body,r=t.options,i=t.url;if(Pr(e))return null;var n=As(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Mr(e))return e;if(us(e))return e.textContent;if(Fr(e))return Es(e);if(Tr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var qo=t=>!Or(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Uo(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Ir(a)?void 0:Math.round(a),endTime:Ir(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(qo(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var jo=["video/","audio/"];function Bo(t){return Tr(t)&&Cr(t.getReader)&&Cr(t.tee)}var Ho=500,zo="[SessionReplay] Timeout while trying to read body",Wo="[SessionReplay] Failed to read body";function Vo(t){return Wo+": "+t}function Zo(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Go(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(zo)),Ho);try{t.clone().text().then((t=>e(t)),(t=>e(Vo(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(Wo)}}))}(t);var r=function(t){var e;return Math.min(Eo,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Eo)}(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Zo(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),r(t))}var a,l=setTimeout((()=>o(zo)),Ho);try{a=t.clone()}catch(t){return void o(Wo)}var u=a.body;if(Bo(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(t){return void o(Wo)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(Zo(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(Vo(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(Vo(t))))}catch(t){o(Wo)}}))}(t,r)}function Qo(){return Qo=e((function*(t){var e=t.r,r=t.options,i=As(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Go(e,r)})),Qo.apply(this,arguments)}function Jo(){return Jo=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=jo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=As(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Or(i)?Go(e,r):Promise.resolve(i)})),Jo.apply(this,arguments)}var Ko=null;function Yo(t,i,n){if(!("performance"in i))return()=>{};if(Ko)return Mo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Io,n):Io,o=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Ro(t)||Oo(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Uo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Ro(t)||Oo(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Uo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Po("request",r.recordHeaders),n=Po("response",r.recordHeaders),s=Ls(e.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=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Ao({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Do({body:t,options:r,url:a})),c=e.performance.now(),y(t));var _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Ao({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Do({body:d.response,options:r,url:a})),Fo(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Uo({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){Mo.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Po("request",i.recordHeaders),s=Po("response",i.recordHeaders),o=Ls(r,"fetch",(o=>function(){var a=e((function*(e,a){var l,u;try{l=new Request(e,a)}catch(t){return Mo.error("Failed to instrument fetch for network capture",t),o(e,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!Bo(null==a?void 0:a.body)&&Ao({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return Qo.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){Mo.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),u=$o(e)?yield o(l):yield o(e,a),d=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),Ao({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return Jo.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Fo(r,"fetch",l.url,h,d).then((e=>{var r,i=Uo({entry:e,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),Ko=()=>{a(),l(),u(),Ko=null}}var Xo=t=>({name:"rrweb/network@1",observer:Yo,options:t}),ta="undefined"!=typeof globalThis?globalThis:Yn;ta&&"undefined"==typeof self&&(ta.self=ta),ta&&"undefined"==typeof File&&(ta.File=function(){});var ea=null!=Yn?Yn:{};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Je,getRecordNetworkPlugin:Xo},ea.__PosthogExtensions__.rrweb={record:Ae,version:"v2",wasMaxDepthReached:()=>ct,resetMaxDepthState(){ct=!1,dt=!1}},ea.rrweb={record:Ae,version:"v2"},ea.rrwebConsoleRecord={getRecordConsolePlugin:Je},ea.getRecordNetworkPlugin=Xo;var ra,ia,na,sa,oa,aa,la,ua,ha,da,ca,va,fa,pa,ga,ma={},ya=[],_a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ba=Array.isArray;function wa(t,e){for(var r in e)t[r]=e[r];return t}function xa(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Sa(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ra.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return ka(t,o,i,n,null)}function ka(t,e,r,i,n){var s={type:t,props:e,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(t){return t.children}function Ta(t,e){this.props=t,this.context=e}function $(t,e){if(null==e)return t.__?$(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?$(t):null}function Ea(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],s=wa({},e);s.__v=e.__v+1,ia.vnode&&ia.vnode(s),Na(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?$(e):r,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,qa(i,s,n),e.__e=e.__=null,s.__e!=r&&Ia(s)}}function Ia(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),Ia(t)}function Ma(t){(!t.__d&&(t.__d=!0)&&sa.push(t)&&!Ra.__r++||oa!=ia.debounceRendering)&&((oa=ia.debounceRendering)||aa)(Ra)}function Ra(){try{for(var t,e=1;sa.length;)sa.length>e&&sa.sort(la),t=sa.shift(),e=sa.length,Ea(t)}finally{sa.length=Ra.__r=0}}function Oa(t,e,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||ya,_=e.length;for(l=function(t,e,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=ka(null,o,null,null,null):ba(o)?o=t.__k[s]=ka(Ca,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=ka(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+c,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=$a(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))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Ha(a,a));return i}(r,e,y,l,_),d=0;_>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ma,v.__i=d,g=Na(t,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=Pa(v,l,t,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 Pa(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Pa(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=$(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function $a(t,e,r,i){var n,s,o,a=t.key,l=t.type,u=e[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||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function La(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||_a.test(e)?r:r+"px"}function Aa(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||La(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||La(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(ca,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r[da]=i[da]:(r[da]=va,t.addEventListener(e,s?pa:fa,s)):t.removeEventListener(e,s?pa:fa,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function Fa(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[ha])e[ha]=va++;else if(r[da]>e[ha])return;return r(ia.event?ia.event(e):e)}}}function Na(t,e,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,_,$,b,w,x,S,k,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ia.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],b=h?$?$.props.value:h.__:i,r.__c?m=(c=e.__c=r.__c).__=c.__E:(_?e.__c=c=new C(y,b):(e.__c=c=new Ta(y,b),c.constructor=C,c.render=za),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),_&&null==c.__s&&(c.__s=c.state),_&&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=e,v)_&&null==C.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),_&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,b),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,b)){e.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),ya.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,b),_&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=b,c.props=y,c.__P=t,c.__e=!1,w=ia.__r,x=0,_)c.state=c.__s,c.__d=!1,w&&w(e),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(e),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())),_&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ca&&null==h.key?Ua(h.props.children):h,a=Oa(t,ba(S)?S:[S],e,r,i,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(k=s.length;k--;)xa(s[k]);Da(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||Da(e);ia.__e(t,e,r)}}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=ja(r.__e,e,r,i,n,s,o,l,u);return(h=ia.diffed)&&h(e),128&e.__u?void 0:a}function Da(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Da))}function qa(t,e,r){for(var i=0;r.length>i;i++)Ba(r[i],r[++i],r[++i]);ia.__c&&ia.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ia.__e(t,e.__v)}}))}function Ua(t){return"object"!=typeof t||null==t||t.__b>0?t:ba(t)?t.map(Ua):void 0!==t.constructor?null:wa({},t)}function ja(t,e,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ma,m=e.props,y=e.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)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ia.__m&&ia.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&ra.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.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||Aa(t,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||Aa(t,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Oa("template"==e.type?t.content:t,ba(c)?c:[c],e,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?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Aa(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Aa(t,u,p,g[u],n))}return t}function Ba(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ia.__e(t,r)}}function Ha(t,e,r){var i,n;if(ia.unmount&&ia.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ba(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ia.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&Ha(i[n],e,r||"function"!=typeof t.type);r||xa(t.__e),t.__c=t.__=t.__e=void 0}function za(t,e,r){return this.constructor(t,r)}function Wa(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ia.__&&ia.__(t,e),i=e.__k,n=[],s=[],Na(e,t=e.__k=Sa(Ca,null,[t]),i||ma,ma,e.namespaceURI,i?null:e.firstChild?ra.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),qa(n,t,s),t.props.children=null}ra=ya.slice,ia={__e(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},na=0,Ta.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=wa({},this.state),"function"==typeof t&&(t=t(wa({},r),this.props)),t&&wa(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ma(this))},Ta.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ma(this))},Ta.prototype.render=Ca,sa=[],aa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,la=function(t,e){return t.__v.__b-e.__v.__b},Ra.__r=0,ua=Math.random().toString(8),ha="__d"+ua,da="__a"+ua,ca=/(PointerCapture)$|Capture$/i,va=0,fa=Fa(!1),pa=Fa(!0),ga=0;var Va,Za,Ga,Qa,Ja=0,Ka=[],Ya=ia,Xa=Ya.__b,tl=Ya.__r,el=Ya.diffed,rl=Ya.__c,il=Ya.unmount,nl=Ya.__;function sl(t,e){Ya.__h&&Ya.__h(Za,t,Ja||e),Ja=0;var r=Za.__H||(Za.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ol(t){return Ja=1,function(t,e,r){var i=sl(Va++,2);if(i.t=t,!i.__c&&(i.__=[ml(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Za,!Za.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,r);return n?a||o:a}return!n||o};Za.__f=!0;var s=Za.shouldComponentUpdate,o=Za.componentWillUpdate;Za.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},Za.shouldComponentUpdate=n}return i.__N||i.__}(ml,t)}function al(t,e){var r=sl(Va++,3);!Ya.__s&&gl(r.__H,e)&&(r.__=t,r.u=e,Za.__H.__h.push(r))}function ll(t){return Ja=5,ul((function(){return{current:t}}),[])}function ul(t,e){var r=sl(Va++,7);return gl(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function hl(t){var e=Za.context[t.__c],r=sl(Va++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Za)),e.props.value):t.__}function dl(){for(var t;t=Ka.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(fl),e.__h.some(pl),e.__h=[]}catch(r){e.__h=[],Ya.__e(r,t.__v)}}}Ya.__b=function(t){Za=null,Xa&&Xa(t)},Ya.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),nl&&nl(t,e)},Ya.__r=function(t){tl&&tl(t),Va=0;var e=(Za=t.__c).__H;e&&(Ga===Za?(e.__h=[],Za.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&dl(),Va=0)),Ga=Za},Ya.diffed=function(t){el&&el(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Qa===Ya.requestAnimationFrame||((Qa=Ya.requestAnimationFrame)||vl)(dl)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),Ga=Za=null},Ya.__c=function(t,e){e.some((function(t){try{t.__h.some(fl),t.__h=t.__h.filter((function(t){return!t.__||pl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Ya.__e(r,t.__v)}})),rl&&rl(t,e)},Ya.unmount=function(t){il&&il(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{fl(t)}catch(t){e=t}})),r.__H=void 0,e&&Ya.__e(e,r.__v))};var cl="function"==typeof requestAnimationFrame;function vl(t){var e,r=function(){clearTimeout(i),cl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);cl&&(e=requestAnimationFrame(r))}function fl(t){var e=Za,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Za=e}function pl(t){var e=Za;t.__c=t.__(),Za=e}function gl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function ml(t,e){return"function"==typeof e?e(t):e}var yl={GZipJS:"gzip-js",Base64:"base64"},_l={Activation:"events",Cancellation:"cancelEvents"},bl={Button:"button",Tab:"tab",Selector:"selector"},wl={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"},xl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Sl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},kl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Cl={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Tl={Once:"once",Recurring:"recurring",Always:"always"},El={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Il={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",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_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Ml={Popover:"popover",Inline:"inline"};function Rl(t){return"$survey_response_"+t}function Ol(t,e){if(!e)return null;var r=t[Rl(e)];return kr(r)?[...r]:r}function Pl(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!Ir(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Ol(t,e.id);Ir(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:Ol(t,e.id)})))},t,i)}function $l(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function Ll(t){return"string"==typeof t&&t.trim()?t.trim():null}function Al(t){return t.toLowerCase()}function Fl(t,e,r){if(!t||!e)return null;var i=Al(e),n=Object.keys(t).find((t=>Al(t)===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(t).find((t=>Al(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Nl(t,e,i){var n,s=Fl(t.translations,e,i),o=r({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Ir(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Ir(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Ir(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Ir(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Ir(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Ir(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(t){return!(Ir(t.thankYouMessageHeader)&&Ir(t.thankYouMessageDescription)&&Ir(t.thankYouMessageCloseButtonText)&&Ir(t.submitButtonText)&&Ir(t.backButtonText))}(u)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Fl(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),l=!1;return Ir(o.question)||(a.question=o.question,l=!0),Ir(o.description)||(a.description=o.description,l=!0),Ir(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ir(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ir(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ir(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return kr(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i))),d=h.map((t=>t.question)),c=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}function Dl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function ql(t){var e;return Dl(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ul=vs("[Surveys]");function jl(t){return!(!t.start_date||t.end_date)}function Bl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Hl="seenSurvey_",zl="inProgressSurvey_",Wl=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Vl=t=>Wl(Hl,t),Zl=t=>{try{var e=Vl(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Ul.error("Failed to persist survey seen state",t)}},Gl=[Sl.Popover,Sl.Widget,Sl.API],Ql={ignoreConditions:!1,ignoreDelay:!1,displayType:Ml.Popover},Jl="$people_distinct_id",Kl="$device_id",Yl="$device_model",Xl="__alias",tu="__timers",eu="$autocapture_disabled_server_side",ru="$heatmaps_enabled_server_side",iu="$exception_capture_enabled_server_side",nu="$error_tracking_suppression_rules",su="$error_tracking_capture_extension_exceptions",ou="$web_vitals_enabled_server_side",au="$dead_clicks_enabled_server_side",lu="$product_tours_enabled_server_side",uu="$web_vitals_allowed_metrics",hu="$session_recording_remote_config",du="$replay_sample_rate",cu="$replay_override_sampling",vu="$replay_override_linked_flag",fu="$replay_override_url_trigger",pu="$replay_override_event_trigger",gu="$sesid",mu="$session_is_sampled",yu="$enabled_feature_flags",_u="$active_feature_flags",bu="$early_access_features",wu="$feature_flag_details",xu="$feature_flag_payloads",Su="$feature_flag_request_id",ku="$minimal_flag_called_events",Cu="$override_feature_flags",Tu="$override_feature_flag_payloads",Eu="$stored_person_properties",Iu="$stored_group_properties",Mu="$surveys",Ru="$surveys_loaded_at",Ou="$surveys_activated",Pu="$surveys_activated_session",$u="ph_product_tours",Lu="$flag_call_reported",Au="$flag_call_reported_session_id",Fu="$feature_flag_errors",Nu="$feature_flag_evaluated_at",Du="$user_state",qu="$client_session_props",Uu="$capture_rate_limit",ju="$initial_campaign_params",Bu="$initial_referrer_info",Hu="$initial_person_info",zu="$epp",Wu="$posthog_cookieless",Vu="$cookieless_mode",Zu="$sdk_debug_extensions_init_method",Gu="$sdk_debug_extensions_init_time_ms",Qu="$sdk_debug_recording_script_not_loaded",Ju="PostHog loadExternalDependency extension not found.",Ku="on_reject",Yu="always",Xu="anonymous",th="identified",eh="identified_only",rh="visibilitychange",ih="beforeunload",nh="$pageview",sh="$pageleave",oh="$identify",ah="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return $r(t)&&isFinite(t)&&Math.floor(t)===t});class lh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,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 lh(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new lh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class uh{generate(){var t=this.generateOrAbort();if(!Ir(t))return t;this.S=0;var e=this.generateOrAbort();if(Ir(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return lh.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 ch}}var hh,dh=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yn&&!Ir(Yn.crypto)&&crypto.getRandomValues&&(dh=t=>crypto.getRandomValues(t));class ch{nextUint32(){return this.R.length>this.O||(dh(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var vh=()=>fh().toString(),fh=()=>(hh||(hh=new uh)).generate(),ph=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function gh(t,e,r){return Cs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var mh={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>ph(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ph(e,t))))),icontains:(t,e)=>e.map(yh).some((e=>t.map(yh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(yh).every((e=>t.map(yh).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},yh=t=>t.toLowerCase();function _h(t,e){return!t||Object.entries(t).every((t=>{var r=t[1],i=null==e?void 0:e[t[0]];if(Ir(i)||Or(i))return!1;var n=[String(i)],s=mh[r.operator];return!!s&&s(r.values,n)}))}var bh=t=>{if(es){try{for(var e=t+"=",r=es.cookie.split(";").filter((t=>t.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(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},wh="",xh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Sh={N:()=>!!es,D(t){cs.error("cookieStore error: "+t)},A:bh,F(t){var e;try{e=JSON.parse(Sh.A(t))||{}}catch(t){}return e},q(t,e,r,i,n){if(!es)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=es),wh)return wh;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+vh();!wh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",wh=s)}return wh}(t);if(!r){var i=(t=>{var e=t.match(xh);return e?e[0]:""})(t);i!==r&&cs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(es.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&cs.warn("cookieStore warning: large cookie, len="+u.length),es.cookie=u,!0}catch(t){return!1}},P(t,e){if(null!=es&&es.cookie)try{Sh.q(t,"",-1,e)}catch(t){return}}},kh=null,Ch={N(){if(!Or(kh))return kh;var t=!0;if(Ir(Yn))t=!1;else try{var e="__mplssupport__";Ch.q(e,"xyz"),'"xyz"'!==Ch.A(e)&&(t=!1),Ch.P(e)}catch(e){t=!1}return t||cs.error("localStorage unsupported; falling back to cookie store"),kh=t,t},D(t){cs.error("localStorage error: "+t)},A(t){try{return null==Yn?void 0:Yn.localStorage.getItem(t)}catch(t){Ch.D(t)}return null},F(t){try{return JSON.parse(Ch.A(t))||{}}catch(t){}return null},q(t,e){try{return null==Yn||Yn.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Ch.D(t)}return!1},P(t){try{null==Yn||Yn.localStorage.removeItem(t)}catch(t){Ch.D(t)}}},Th=[Kl,"distinct_id",gu,mu,zu,Hu,Du],Eh={},Ih={N:()=>!0,D(t){cs.error("memoryStorage error: "+t)},A:t=>Eh[t]||null,F:t=>Eh[t]||null,q:(t,e)=>(Eh[t]=e,!0),P(t){delete Eh[t]}},Mh=null,Rh={N(){if(!Or(Mh))return Mh;if(Mh=!0,Ir(Yn))Mh=!1;else try{var t="__support__";Rh.q(t,"xyz"),'"xyz"'!==Rh.A(t)&&(Mh=!1),Rh.P(t)}catch(t){Mh=!1}return Mh},D(t){cs.error("sessionStorage error: ",t)},A(t){try{return null==Yn?void 0:Yn.sessionStorage.getItem(t)}catch(t){Rh.D(t)}return null},F(t){try{return JSON.parse(Rh.A(t))||null}catch(t){}return null},q(t,e){try{return null==Yn||Yn.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Rh.D(t)}return!1},P(t){try{null==Yn||Yn.sessionStorage.removeItem(t)}catch(t){Rh.D(t)}}},Oh=vs("[Stylesheet Loader]"),Ph=Yn,$h=es,Lh="#020617",Ah={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:wl.Right,widgetType:bl.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:Lh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Fh=[wl.Center,wl.Left,wl.Right];function Nh(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Dh(t){var e;void 0===t&&(t=Ah.backgroundColor),"#"===t[0]&&(e=Nh(t)),t.startsWith("rgb")&&(e=t);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"}[t.toLowerCase()];if(r&&(e=Nh(r)),!e)return Lh;var i=e.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?Lh:"white"}return Lh}var qh=(t,e,i)=>{var n=id(t),s=$h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=$h.createElement("div");((t,e,i)=>{var n=r({},Ah,i),s=t.style,o=!Fh.includes(n.position)||e===Sl.Widget&&(null==i?void 0:i.widgetType)===bl.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(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)||Dh(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",Dh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Dh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Dh(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)||Dh(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,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Cr(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Oh.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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return $h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Uh=t=>{var e=t.responses,i=t.survey,n=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage;s?(Zl(i),s.capture(El.SENT,r({[Il.SURVEY_NAME]:i.name,[Il.SURVEY_ID]:i.id,[Il.SURVEY_ITERATION]:i.current_iteration,[Il.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Il.SURVEY_SUBMISSION_ID]:n,[Il.SURVEY_COMPLETED]:o},l&&{[Il.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Pl(e,i),a,{$set:{[$l(i,"responded")]:!0}})),o&&(Ph.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),rd(i),s.reloadFeatureFlags())):Ul.error("[survey sent] event not captured, PostHog instance not found.")},jh=(t,e,i)=>{return r({[Il.SURVEY_NAME]:t.name,[Il.SURVEY_ID]:t.id,[Il.SURVEY_ITERATION]:t.current_iteration,[Il.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Il.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!Pr(t))))},(null==e?void 0:e.surveyLanguage)&&{[Il.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Il.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Pl(null==e?void 0:e.responses,t));var n},Bh=(t,e,i,n)=>{if(e){if(!i){var s=td(t);e.capture(El.DISMISSED,r({},jh(t,s,e),n&&{[Il.SURVEY_LANGUAGE]:n},{$set:{[$l(t,"dismissed")]:!0}})),rd(t),Zl(t),Ph.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Ul.error("[survey dismissed] event not captured, PostHog instance not found.")},Hh=(t,e)=>{if(e){var r=(t=>Wl("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=td(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(El.ABANDONED,jh(t,i,e),{transport:"sendBeacon"})}}else Ul.error("[survey abandoned] event not captured, PostHog instance not found.")},zh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Wh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Vh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Wh(t.questions,zh(t.questions)):t.questions,Zh=t=>ql(t)||ed(t),Gh=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,Ma(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+ga++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Qh=()=>hl(Gh),Jh=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,s,o,a=wa({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?ra.call(arguments,2):r),ka(t.type,a,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Kh(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=Ns(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return mh[o](s,[n])}var Yh=t=>Wl(zl,t),Xh=(t,e)=>{try{localStorage.setItem(Yh(t),JSON.stringify(e))}catch(t){Ul.error("Error setting in-progress survey state in localStorage",t)}},td=t=>{try{var e=localStorage.getItem(Yh(t));if(e)return JSON.parse(e)}catch(t){Ul.error("Error getting in-progress survey state from localStorage",t)}return null},ed=t=>{var e=td(t);return!Pr(null==e?void 0:e.surveySubmissionId)},rd=t=>{try{localStorage.removeItem(Yh(t))}catch(t){Ul.error("Error clearing in-progress survey state from localStorage",t)}};function id(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function nd(t,e,r){if(void 0===e&&(e=wl.Right),t===Sl.ExternalSurvey)return{};switch(e){case wl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case wl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case wl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case wl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case wl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case wl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case wl.Left:return{left:"30px"};case wl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Sl.Widget&&r===bl.Tab?"60px":"30px"}}}var sd=0;function od(t,e,r,i,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--sd,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ia.vnode&&ia.vnode(u),u}var ad=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),ld=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),ud=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),hd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),dd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),cd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:od("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"})}),vd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:od("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"})}),fd=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return od("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:[od("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),od("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})]})},pd=od("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[od("g",{"clip-path":"url(#clip0_2415_6911)",children:[od("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:od("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),od("g",{mask:"url(#mask0_2415_6911)",children:[od("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"}),od("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"}),od("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"}),od("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"}),od("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"}),od("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"})]})]}),od("defs",{children:od("clipPath",{id:"clip0_2415_6911",children:od("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function gd(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return od("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",pd]})}function md(t){var e=t.text,r=t.submitDisabled,i=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=hl(Gh).isPreviewMode,d=!!l&&!!u,c=!a&&od("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:e});return od("div",{className:"bottom-section",children:[d?od("div",{className:"form-buttons form-buttons-with-back",children:[od("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&od(gd,{urlParams:{utm_source:"survey-footer"}})]})}function yd(t){var e=t.question,r=t.forceDisableHtml;return od("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[od(e.type===kl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Jh({component:Sa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function _d(t){return od("button",{className:"form-cancel",onClick:t.onClick,disabled:hl(Gh).isPreviewMode,"aria-label":"Close survey",type:"button",children:fd({fill:"black"})})}od("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:od("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 bd=Yn;function wd(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=hl(Gh).isPopup;return al((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ss(bd,"keydown",t),()=>{bd.removeEventListener("keydown",t)}}),[o]),od("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&od(_d,{onClick:()=>o()}),od("h3",{className:"thank-you-message-header",children:e}),r&&Jh({component:Sa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&od(md,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var xd=t=>kr(t)&&t.every((t=>Mr(t)));function Sd(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Qh().isPreviewMode,d=ll(null),c=ol((()=>Mr(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;al((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=ul((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)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,e.validation,e.optional)),[v,e.validation,e.optional]),y=gn(e.validation,nr),_=gn(e.validation,sr),b=ul((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,_)),[y,_]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return od(Ca,{children:[od("div",{className:"question-container",children:[od(yd,{question:e,forceDisableHtml:r,htmlFor:g}),od("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:_,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:v}),b&&od("div",{className:"validation-hint",children:b})]}),od(md,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function kd(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return od(Ca,{children:[od("div",{className:"question-container",children:od(yd,{question:e,forceDisableHtml:t.forceDisableHtml})}),od(md,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Cd(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=r.scale,c=10===r.scale?0:1,v=ol((()=>$r(l)?l:kr(l)&&l.length>0&&$r(parseInt(l[0]))?parseInt(l[0]):Mr(l)&&$r(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Qh().isPreviewMode,y=t=>m?a(t):o(t);return od(Ca,{children:[od("div",{className:"question-container",children:[od(yd,{question:r,forceDisableHtml:i}),od("div",{className:"rating-section",children:[od("div",{className:"rating-options",children:["emoji"===r.display&&od("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Od[r.scale])?void 0:e.map(((t,e)=>od("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&od("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:Pd(r.scale).map(((t,e)=>od(Td,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&od("div",{className:"rating-text",children:[od("div",{children:r.lowerBoundLabel}),od("div",{children:r.upperBoundLabel})]})]})]}),od(md,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Or(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Td(t){var e=t.num,r=t.setActiveNumber;return od("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function Ed(t){var e=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=ll(null),c=ul((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=Wh(e,zh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=ol((()=>((t,e)=>Mr(t)||xd(t)?t:e===kl.SingleChoice?null:[])(l,e.type))),f=v[0],p=v[1],g=ol((()=>((t,e)=>{if(Mr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(xd(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],_=Qh().isPreviewMode,b=e.type===kl.SingleChoice,w=e.type===kl.MultipleChoice,x=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),b&&p(""),void(i&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(b)return p(t),y((t=>r({},t,{isSelected:!1,inputValue:""}))),void(x&&(o(t),_&&a(t)));w&&kr(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},k=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>r({},t,{inputValue:e}))),b&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y((t=>r({},t,{isSelected:!1,inputValue:""}))),b&&p(null))},T=()=>!(e.optional||!Or(f)&&(!kr(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?kr(f)&&(_?a([...f,m.inputValue]):o([...f,m.inputValue])):_?a(f):o(f)};return od(Ca,{children:[od("div",{className:"question-container",children:[od(yd,{question:e,forceDisableHtml:i}),od("fieldset",{className:"multiple-choice-options limit-height",children:[od("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:b?f===t:kr(f)&&f.includes(t);return od("label",{className:i?"choice-option-open":"",children:[od("div",{className:"response-choice",children:[od("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,i),id:s,"aria-controls":o}),od("span",{children:i?t+":":t})]}),i&&od("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:k,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),od(md,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var Id=[1,2,3,4,5],Md=[1,2,3,4,5,6,7],Rd=[0,1,2,3,4,5,6,7,8,9,10],Od={2:[cd,vd],3:[ud,ld,ad],5:[hd,ud,ld,ad,dd]};function Pd(t){switch(t){case 5:default:return Id;case 7:return Md;case 10:return Rd}}var $d=vs("[Surveys]");function Ld(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Cl.End:s;if(n.branching.type===Cl.End)return Cl.End;if(n.branching.type===Cl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Cl.ResponseBased){if(n.type===kl.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===Cl.End?Cl.End:s}}else if(n.type===kl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>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===Cl.End?Cl.End:s}}return s}return $d.warn("Falling back to next question index due to unexpected branching type"),s}var Ad="https?://(.*)",Fd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Nd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Fd],Dd="<masked>",qd=["li_fat_id"];function Ud(t,e,r){if(!es)return{};var i,n=e?[...Fd,...r||[]]:[],s=jd(Ms(es.URL,n,Dd),t),o=(i={},ps(qd,(function(t){var e=bh(t);i[t]=e||null})),i);return gs(o,s)}function jd(t,e){var r=Nd.concat(e||[]),i={};return ps(r,(function(e){var r=Is(t,e);i[e]=r||null})),i}function Bd(t){var e=function(t){return t?0===t.search(Ad+"google.([^/?]*)")?"google":0===t.search(Ad+"bing.com")?"bing":0===t.search(Ad+"yahoo.com")?"yahoo":0===t.search(Ad+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!Or(e)){i.$search_engine=e;var n=es?Is(es.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Hd(){return navigator.language||navigator.userLanguage}var zd="$direct";function Wd(){return(null==es?void 0:es.referrer)||zd}function Vd(t,e,r){void 0===r&&(r=!1);var i=t?[...Fd,...e||[]]:[],n=r?tn(null==rs?void 0:rs.href):null==rs?void 0:rs.href,s=null==n?void 0:n.substring(0,1e3);return{r:Wd().substring(0,1e3),u:s?Ms(s,i,Dd):void 0}}function Zd(t,e){var r;void 0===e&&(e=!1);var i=t.r,n=t.u,s=e?tn(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==zd?zd: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=jd(s);gs(o,l)}if(i){var u=Bd(i);gs(o,u)}return o}function Gd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Qd(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Jd=vs("[SurveyTranslations]");function Kd(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=Ll(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?Ll(t.language):null}(r);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Ll(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Cr(t.get_property)?t.get_property(Eu):void 0,locale:Hd()},Jd)}(e);if(!r)return Jd.info("No user language detected"),{survey:t,language:null};var i=Nl(t,r,Jd);return{survey:i.survey,language:i.matchedKey}}var Yd=Yn,Xd=es,tc="ph:show_survey_widget",ec="PHWidgetSurveyClickListener";function rc(t,e){try{var r=t.getBoundingClientRect(),i=Yd.innerHeight,n=Yd.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-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:Ah.zIndex}}catch(t){return Ul.warn("Failed to calculate trigger position:",t),null}}class ic{constructor(t){var e=this;this.j=new Map,this.H=new Map,this.B=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Mu);if(t)for(var e of t)ed(e)&&Hh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=this.U(t),l=a.survey,u=a.language,h=null!=e&&e.position||null!=e&&e.selector?r({},l,{appearance:r({},l.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):l;this.W(h.id);var d=null!=e?e:{},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)===wl.NextToTrigger&&null!=(s=h.appearance)&&s.widgetSelector){var g,m=Xd.querySelector(h.appearance.widgetSelector);m&&(p=rc(m,parseInt((null==(g=h.appearance)?void 0:g.maxWidth)||Ah.maxWidth))||{})}var y=(null==(o=h.appearance)?void 0:o.surveyPopupDelaySeconds)||0,_=qh(h,this._posthog).shadow,b={posthog:this._posthog,survey:h,removeSurveyFromFocus:this.$,properties:c,style:p,isSurveyCompleted:f,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:u};if(0>=y)return Wa(od(ac,r({},b)),_);var w=setTimeout((()=>{if(this.j.delete(h.id),!this.G(h))return Ul.info("Survey "+h.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(h);Wa(od(ac,r({},b,{survey:r({},h,{appearance:r({},h.appearance,{surveyPopupDelaySeconds:0})})})),_)}),1e3*y);this.j.set(h.id,w)}},this.Y=t=>{var e=this.U(t),r=e.survey,i=e.language,n=qh(r,this._posthog),s=n.shadow;n.isNewlyCreated&&Wa(od(uc,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),s)},this.J=t=>{this.K(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(ec),this.H.delete(t.id),Ul.info("Removed click listener for survey "+t.id))},this.X=(t,e)=>{var r=Xd.querySelector(e),i=this.H.get(t.id);if(r){if(this.Y(t),i){if(r===i.element)return;Ul.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.J(t)}if(!r.hasAttribute(ec)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===wl.NextToTrigger?rc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Ah.maxWidth)):{};Yd.dispatchEvent(new CustomEvent(tc,{detail:{surveyId:t.id,position:n}}))};Ss(r,"click",n),r.setAttribute(ec,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Ul.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.J(t)},this.renderPopover=t=>{var e=this.U(t),r=e.survey,i=e.language,n=qh(r,this._posthog).shadow;Wa(od(ac,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.$,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.U(t),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ee(s,o)),Wa(od(ac,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.G(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Sl.Popover||t.type===Sl.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.j.keys()))i.has(n)||e.cancelSurvey(n);var s=e.te(r),o=new Set;s.forEach((t=>{if(t.type===Sl.Widget){var r,i,n,s;if((null==(r=t.appearance)?void 0:r.widgetType)===bl.Tab)return void e.Y(t);(null==(i=t.appearance)?void 0:i.widgetType)===bl.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.X(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Or(e.re)&&t.type===Sl.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var r=t.survey;o.has(r.id)||e.J(r)}))}),t)},this.Z=t=>{Or(this.re)||Ul.error("Survey "+this.re+" already in focus. Cannot add survey "+t.id+"."),this.re=t.id},this.$=t=>{this.re!==t.id&&Ul.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.W(t.id),this.re=null,this.K(t)},this._posthog=t,this.re=null}W(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Ul.info("Cancelled pending survey "+t),this.W(t),this.re===t&&(this.re=null))}te(t){return t.sort(((t,e)=>{var r,i,n=ed(t),s=ed(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Tl.Always,a=e.schedule===Tl.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(t){return Kd(t,this._posthog)}ee(t,e){if(this.B.has(t.id))return!1;var r=function(t){var e={},r=!1,i=Yd.location.search.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Ir(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);e[c]||(e[c]=[]),e[c].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(),i=r.params;if(0===Object.keys(i).length)return!1;Ul.info("[Survey Prefill] Detected URL prefill parameters");var n=this.ne(t,i,e);if(!n)return!1;var s=n.responses,o=n.submissionId,a=n.isSurveyCompleted,l=n.skippedResponses;return(Object.keys(l).length>0&&t.enable_partial_responses||a)&&Uh({responses:a?s:l,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,surveyLanguage:e}),this.B.add(t.id),a}V(t,e,r,i){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=kr(o)?o.map(String):[String(o)]}Ul.info("[Survey] Processing initial responses");var a=this.ne(t,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return Uh({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}ne(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=Rl(t.id);try{switch(t.type){case kl.SingleChoice:if(!t.choices||0===t.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>=t.choices.length)return void cs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case kl.MultipleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void cs.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&cs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case kl.Rating:var u=parseInt(n[0],10),h=t.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 "+t.type+" does not support prefill")}}catch(t){cs.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Ul.warn("[Survey Prefill] No valid responses after conversion"),null;var n=vh(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;t.questions.length>i&&s>0&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=Rl(o.id);Ir(r[a])||(n[a]=r[a])}var l=Ld(t,i,o.id?r[Rl(o.id)]:null);if(l===Cl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return Xh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,surveyLanguage:r}),Ul.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return Ul.error("[Survey Prefill] Error handling prefill:",t),null}}ie(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}ae(t){return!t.conditions||Kh(t,this._posthog)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!as)return!1;var s=Ki(as,{userAgentDataPlatform:null==ts||null==(r=ts.userAgentData)?void 0:r.platform,maxTouchPoints:null==ts?void 0:ts.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 mh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==$h||!$h.querySelector(t.conditions.selector))}(t)}oe(t){var e;return Zh(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ie(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!jl(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Gl.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ie(t.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(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.oe(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Ch.A("lastSeenSurveyDate"))?(t=>!!Ch.A(Vl(t))&&!Zh(t))(t)?(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(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.se(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}se(t){var e;if(!Dl(t)&&!Bl(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}ue(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ie(e)}))}G(t){return this.checkSurveyEligibility(t).eligible&&this.ae(t)&&this.se(t)&&this.ue(t)}K(t){try{var e=Xd.querySelector(id(t,!0));null!=e&&e.shadowRoot&&Wa(null,e.shadowRoot),null==e||e.remove()}catch(e){Ul.warn("Failed to remove survey "+t.id+" from DOM:",e)}}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 nc(t,e){if(Xd&&Yd){var r,i=new ic(t);if(t.config.disable_surveys_automatic_display)return Ul.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Ul.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ir(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Ss(Xd,"visibilitychange",(()=>{Xd.hidden?Ir(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function sc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;al((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Sl.Widget,s=Kh(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===bl.Tab&&r;if(!s)return Ul.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(Ul.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ss(Yd,"popstate",r),Ss(Yd,"hashchange",r);var s=Yd.history.pushState,l=Yd.history.replaceState;return Yd.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.apply(this,e),r()},Yd.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];l.apply(this,e),r()},()=>{Yd.removeEventListener("popstate",r),Yd.removeEventListener("hashchange",r),Yd.history.pushState=s,Yd.history.replaceState=l}}}),[o,e,i,n,a])}function oc(t){switch(void 0===t&&(t=xl.Right),t){case xl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case xl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case xl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function ac(t){var e,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,c=void 0===d?{}:d,v=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,_=void 0===y?()=>{}:y,b=t.onPreviewBack,w=void 0===b?()=>{}:b,x=t.onPopupSurveyDismissed,S=void 0===x?()=>{}:x,k=t.onCloseConfirmationMessage,C=void 0===k?()=>{}:k,T=t.properties,E=t.isSurveyCompleted,I=t.skipShownEvent,M=t.surveyLanguage,R=ll(null),O=Number.isInteger(v),P=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,L=function(t,e,i,n,s,o,a,l,u){var h=ol(n||0===i||t.type===Sl.ExternalSurvey),d=h[0],c=h[1],v=ol(!1),f=v[0],p=v[1],g=()=>{var e=()=>{o&&s(t),c(!1)};Xd.startViewTransition?Xd.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return al((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(Kh(t,e)){c(!0),Yd.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(El.SHOWN,r({[Il.SURVEY_NAME]:t.name,[Il.SURVEY_ID]:t.id,[Il.SURVEY_ITERATION]:t.current_iteration,[Il.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[Il.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Ss(Yd,"PHSurveyClosed",m),Ss(Yd,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),Yd.removeEventListener("PHSurveyClosed",m),Yd.removeEventListener("PHSurveySent",s)}}return o(),()=>{Yd.removeEventListener("PHSurveyClosed",m),Yd.removeEventListener("PHSurveySent",s)}}}else Ul.error("usePopupVisibility hook called without a PostHog instance.")}),[]),sc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,P,O,p,m,R,I,M),A=L.isPopupVisible,F=L.hidePopupWithViewTransition,N=L.isSurveySent||v===l.questions.length||!0===E,D=ul((()=>{var t=td(l),e=(null==t?void 0:t.surveySubmissionId)||vh();return{isPreviewMode:O,previewPageIndex:v,onPopupSurveyDismissed(){M?Bh(l,h,O,M):Bh(l,h,O),S()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:_,onPreviewBack:w,posthog:h,properties:T,surveyLanguage:M}}),[O,v,m,h,l,S,_,w,T,M]);return A?od(Gh.Provider,{value:D,children:od("div",{className:"ph-survey",style:r({},nd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:N?od(wd,{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||Ah,onClose(){F(),C()}}):od(lc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function lc(t){var e,i,n=t.survey,s=t.forceDisableHtml,o=t.posthog,a=ol((()=>{var t=td(n);return null!=t&&t.responses&&Ul.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),l=a[0],u=a[1],h=hl(Gh),d=h.previewPageIndex,c=h.onPopupSurveyDismissed,v=h.isPopup,f=h.onPreviewSubmit,p=h.onPreviewBack,g=h.surveySubmissionId,m=h.isPreviewMode,y=h.properties,_=h.surveyLanguage,b=ol((()=>{var t=td(n);return d||(null==t?void 0:t.lastQuestionIndex)||0})),w=b[0],x=b[1],S=ol((()=>{var t,e=td(n);return null!==(t=null==e?void 0:e.visitedIndices)&&void 0!==t?t:[]})),k=S[0],C=S[1],T=ul((()=>Vh(n)),[n]);al((()=>{m&&!Ir(d)&&x(d)}),[d,m]);var E=!(null==(e=n.appearance)||!e.allowGoBack)&&(m?(null!=d?d:0)>0:k.length>0),I=T.at(w);return I?od("form",{className:"survey-form",name:"surveyForm",children:[v&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&od(_d,{onClick(){c()}}),od("div",{className:"survey-box","data-question-index":w,children:hc({question:I,forceDisableHtml:s,displayQuestionIndex:w,appearance:n.appearance||Ah,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=Rl(s),h=r({},l,{[a]:e});u(h);var d=Ld(n,i,e),c=d===Cl.End,v=[...k,i];if(c||(C(v),x(d),Xh(n,{surveySubmissionId:g,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:_})),n.enable_partial_responses||c){var f=new Set(v.map((t=>{var e;return null==(e=T[t])?void 0:e.id})).filter((t=>!!t)).map((t=>Rl(t)))),p=Object.fromEntries(Object.entries(h).filter((t=>f.has(t[0]))));Uh({responses:p,survey:n,surveySubmissionId:g,isSurveyCompleted:c,posthog:o,properties:y,surveyLanguage:_})}}else Ul.error("onNextButtonClick called without a questionId.");else Ul.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:w,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?l[Rl(I.id)]:void 0,canGoBack:E,onBack(){if(m)p();else if(0!==k.length){var t=k[k.length-1],e=k.slice(0,-1);C(e),x(t),Xh(n,{surveySubmissionId:g,responses:l,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:_})}}})})]}):null}function uc(t){var e,r,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,c=t.surveyLanguage,v=ol(!0),f=v[0],p=v[1],g=ol(!1),m=g[0],y=g[1],_=ol({}),b=_[0],w=_[1],x=()=>{y(!m)};if(al((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(Ul.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return Ss(Yd,tc,e),()=>{Yd.removeEventListener(tc,e)}}}else Ul.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),sc({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var S=()=>{l.schedule!==Tl.Always&&p(!1),setTimeout((()=>{y(!1)}),200)};return od(Ca,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&od("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===xl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:oc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&od(ac,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:S,onCloseConfirmationMessage:S,surveyLanguage:c})]})}var hc=t=>{var e=t.question,i=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case kl.Open:return Sa(Sd,r({},s,{question:e,key:e.id}));case kl.Link:return Sa(kd,r({},s,{question:e,key:e.id}));case kl.Rating:return Sa(Cd,r({},s,{question:e,key:e.id}));case kl.SingleChoice:case kl.MultipleChoice:return Sa(Ed,r({},s,{question:e,key:e.id}));default:return Ul.error("Unsupported question type: "+e.type),null}};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.generateSurveys=nc,ea.extendPostHogWithSurveys=nc;var dc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),cc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return dc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return dc(e,JSON.stringify(t.slice(0,n)),r)},vc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,fc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},pc=(t,e,r)=>{if(!r.truncated)if(Tr(t)){if(r.seen.has(t))return void fc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(pc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else fc(e,t,r)},gc=function(t,e,r,i,n,s){if(void 0===n&&(n=!1),!vc(t))return!n||dc(e,"null",r);if(Or(t)||(t=>{try{return $r(t)||Ar(t)}catch(t){return!1}})(t))return dc(e,JSON.stringify(t),r);if("string"==typeof t)return cc(t,e,r);if(!Tr(t)&&!kr(t))return dc(e,JSON.stringify(t),r);if(i.has(t))return cc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(Cr(o))return gc(o.call(t),e,r,i,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return cc(String(t.valueOf()),e,r);if("[object Number]"===a||"[object Boolean]"===a)return dc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return gc(l,e,r,i,n,s)}if(kr(t)){if(!dc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!dc(e,",",r))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!gc(d,e,r,i,!0))return!1}return dc(e,"]",r)}if(!dc(e,"{",r))return!1;var c=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(s)try{pc(f,v,s)}catch(t){}if(vc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!dc(e,p,r))return!1;var _=e.length,b=gc(f,e,r,i,!1),w=r.truncated;if(e.length!==_){if(c=!1,!b)return!1}else if(e.length=g,r.remaining=m,r.truncated=b?y:w,!b)return!1}}}catch(t){}return dc(e,"}",r)},mc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.logs={initializeLogs(t){var e={host:ea.location.host},i=!1,n=function(n){var s=ea.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&&t.is_capturing()){var h;i=!0,o=!0;var d=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Tr(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||dc(r," ",i))&&gc(t[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({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.le({level:mc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(t){}finally{o&&(i=!1),s.apply(ea.console,l)}})(s);o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),ea.console[n]=o};for(var s of Object.keys(mc))n(s)}};var yc=vs("[Error tracking]");function _c(){return new wn([new Ln,new zn,new Fn,new An,new Bn,new jn,new Dn,new Hn],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Pn.test(l)?l.replace(Pn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=$n)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,$n).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||xn});var i}))}(s)}}("web:javascript",In,On))}var bc=vs("[ExceptionAutocapture]"),wc=_c(),xc={wrapOnError(t){var e=Yn;e||bc.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){var e,i=wc.buildFromUnknown((arguments.length>4?arguments[4]:void 0)||(arguments.length>0?arguments[0]:void 0),{mechanism:{handled:!1}});return t(i),!!Cr(r)&&null!==(e=r(...arguments))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection(t){var e=Yn;e||bc.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=wc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Cr(r)&&null!==(i=r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||bc.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=wc.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),Cr(r)&&r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.errorWrappingFunctions=xc,ea.posthogErrorWrappingFunctions=xc;var Sc="X-POSTHOG-SESSION-ID",kc="X-POSTHOG-WINDOW-ID",Cc="X-POSTHOG-DISTINCT-ID",Tc=[Sc,kc,Cc],Ec=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Ic=(t,e)=>({}.hasOwnProperty.call(t,e)),Mc=t=>"object"==typeof t&&!Or(t)||Cr(t),Rc=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Oc=t=>{try{var e;return Rc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==Yn||null==(e=Yn.location)?void 0:e.href).toString()}catch(t){return}},Pc=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(kr(t)&&!t.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Sc,a.sessionId),n.set(kc,l),o=!0}var u=(t=>Cr(t)?t():t)(e);return u&&u!==Wu&&(n.set(Cc,u),o=!0),o};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{};var $c={_patchFetch:(t,e,i)=>Ls(Yn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=Oc(s);if(u)if(Rc(s)){var h=new Request(s,o);Pc(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Mc(o)?o.headers:void 0);if(Pc(t,e,i,u,d)){var c=((t,e)=>{if(Ir(t)||Or(t))return{headers:e};if(Mc(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>Ic(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Ic(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Ec.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&Ec.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(t){l=a}return n.apply(this,l)})),_patchXHR:(t,e,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=Oc(s);d&&Pc(t,e,r,d,h);var c=i.call(u,n,s,o,a,l);return Tc.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),c}))};ea.__PosthogExtensions__.tracingHeadersPatchFns=$c,ea.postHogTracingHeadersPatchFns=$c,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var Lc=-1,Ac=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Lc=e.timeStamp,t(e))}),!0)},Fc=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Nc=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Dc=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},qc=()=>{var t,e;return null!==(t=null==(e=Dc())?void 0:e.activationStart)&&void 0!==t?t:0},Uc=function(t,e){void 0===e&&(e=-1);var r=Dc(),i="navigate";return 0>Lc?r&&(document.prerendering||qc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},jc=new WeakMap;function Bc(t,e){var r=jc.get(e);return r||(r=new WeakMap,jc.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Hc{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var zc,Wc=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Vc=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Zc=-1,Gc=new Set,Qc=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Jc=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Gc)e();isFinite(Zc)||(Zc="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Jc,!0))}},Kc=()=>{if(0>Zc){var t,e=qc(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Zc=null!=r?r:Qc(),addEventListener("visibilitychange",Jc,!0),addEventListener("prerenderingchange",Jc,!0),Ac((()=>{setTimeout((()=>{Zc=Qc()}))}))}return{get firstHiddenTime(){return Zc},onHidden(t){Gc.add(t)}}},Yc=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xc=[1800,3e3],tv=function(t,e){void 0===e&&(e={}),Yc((()=>{var r,i=Kc(),n=Uc("FCP"),s=Wc("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-qc(),0),n.entries.push(e),r(!0)))}));s&&(r=Fc(t,n,Xc,e.reportAllChanges),Ac((i=>{n=Uc("FCP"),r=Fc(t,n,Xc,e.reportAllChanges),Nc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},ev=[.1,.25],rv=0,iv=1/0,nv=0,sv=t=>{for(var e of t)e.interactionId&&(iv=Math.min(iv,e.interactionId),nv=Math.max(nv,e.interactionId),rv=nv?(nv-iv)/7+1:0)},ov=()=>{var t;return zc?rv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},av=0;class lv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){av=ov(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((ov()-av)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.u.get(t.interactionId);if(i||10>this.l.length||t.duration>r.L){var n;if(i?t.duration>i.L?(i.entries=[t],i.L=t.duration):t.duration===i.L&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.u.set((i={id:t.interactionId,entries:[t],L:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.L-t.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 uv=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=Vc(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},hv=[200,500];class dv{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var cv=[2500,4e3],vv={onLCP(t,e){void 0===e&&(e={}),Yc((()=>{var r,i=Kc(),n=Uc("LCP"),s=Bc(e,dv),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-qc(),0),n.entries=[o],r())},a=Wc("largest-contentful-paint",o);if(a){r=Fc(t,n,cv,e.reportAllChanges);var l=Vc((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(uv(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Ac((i=>{n=Uc("LCP"),r=Fc(t,n,cv,e.reportAllChanges),Nc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Kc();tv(Vc((()=>{var i,n=Uc("CLS",0),s=Bc(e,Hc),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Wc("layout-shift",o);a&&(i=Fc(t,n,ev,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Ac((()=>{s.i=0,n=Uc("CLS",0),i=Fc(t,n,ev,e.reportAllChanges),Nc(i)})),setTimeout(i))})))},onFCP:tv,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Kc();Yc((()=>{var i;"interactionCount"in performance||zc||(zc=Wc("event",sv,{durationThreshold:0}));var n,s=Uc("INP"),o=Bc(e,lv),a=t=>{uv((()=>{for(var e of t)o.h(e);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=Wc("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Fc(t,s,hv,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Ac((()=>{o.v(),s=Uc("INP"),n=Fc(t,s,hv,e.reportAllChanges)})))}))}}};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.postHogWebVitalsCallbacks=vv,ea.postHogWebVitalsCallbacks=vv,ea.__PosthogExtensions__.loadWebVitalsCallbacks=()=>vv;class fv{constructor(t){this.disabled=!1===t;var e=Tr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var pv="$copy_autocapture",gv=vs("[AutoCapture]");function mv(t,e){return e.length>t?e.slice(0,t)+"...":e}function yv(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Hs(e));return e}function _v(t,e){var i,n,s=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!Hs(t))return{props:{}};for(var d=[t],c=new Set([t]),v=t;v.parentNode&&!zs(v,"body")&&Zs>d.length;)if(Vs(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!Hs(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={},_=!1,b=!1;if(ps(d,(t=>{var e=fo(t);if(zs(t,"a")){var r=t.getAttribute("href");_=!!(e&&r&&xo(r))&&(h?tn(r):r)}mr(Js(t),"ph-no-capture")&&(b=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};to.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?mv(1024,So(t)):mv(1024,Ys(t)));var a=Js(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),ps(t.attributes,(function(r){var s;if((!po(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&xo(r.value)&&(!Mr(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]=mv(1024,"href"===r.name&&n?tn(a):a)}}));for(var l=1,u=1,h=t;h=yv(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var i=function(t){if(!fo(t))return{};var e={};return ps(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&xo(i)&&(e[r]=i)}})),e}(t);gs(y,i)})),b)return{props:{},explicitNoCapture:b};if(a||(m[0].$el_text=zs(t,"a")||zs(t,"button")?So(t):Ys(t)),_){var w,x;m[0].attr__href=_;var S=null==(w=Ts(_))?void 0:w.host,k=null==Yn||null==(x=Yn.location)?void 0:x.host;S&&k&&S!==k&&(p=_)}return{props:gs({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return ms(o).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Co(t[0].toString())]=Co(e.toString())})),(n+=":")+ms(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:To(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ms(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[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 bv={};function wv(t){return function(t,e){var r=bv[t];if(r)return r;var i=e[t];if((t=>Cr(t)&&-1!==t.toString().indexOf("[native code]"))(i)&&(null==Yn||!Yn.Zone))return bv[t]=i.bind(e);var n=e.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[t]&&(i=o[t]),n.head.removeChild(s)}catch(e){cs.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Cr(i)?bv[t]=i.bind(e):i}("MutationObserver",t)}function xv(t,e){var i=Xs(t);return i?r({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Sv(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function kv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Cv="canvas,video,audio,embed,object";function Tv(t,e){return $r(t)&&t>=e}class Ev{ce(t){var e,r,i,n,s,o,a,l,u=this.de((null==t?void 0:t.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.ve=[],this.fe=0,this.de=t=>({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:t}),this.pe=t=>{var e=xv(t,{type:"click"});Or(e)||this.me(e)||this.ve.push(e),this.ye()},this.ge=()=>{var t=Date.now();this.be=t,t%50==0&&this.ve.forEach((e=>{Ir(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.we=()=>{this.xe=Date.now()},this.ke=()=>{"visible"===(null==es?void 0:es.visibilityState)&&(this.Se=Date.now())},this.Ce=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[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=t=>{var e,r=this._e;if(this._e=void 0,!Ir(r)&&this.Te.max_dead_swipes_per_page_load>this.fe){var i=t,n=null==(e=i.changedTouches)?void 0:e[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((t=>$r(t)&&t>=r.timestamp))){var u;if(this.Ee()&&(null!==(u=null==es||null==es.elementsFromPoint?void 0:es.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(Cv))))return;var h=xv(i,{type:"swipe",swipeDirection:Sv(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Or(h)||this.me(h)||this.ve.push(h),this.ye()}}}},this.instance=t,this.Te=this.ce(e),this._onCapture=this.Te.__onCapture}start(t){this.Le(),this.Oe(),this.Ne(),this.qe(),this.Ae(t),this.Te.capture_dead_swipes&&this.Pe()}Ae(t){if(!this.De){var e=wv(ea);this.De=new e((t=>{this.Fe(t)})),this.De.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.De)||t.disconnect(),this.De=void 0,ea.removeEventListener("click",this.pe),ea.removeEventListener("scroll",this.ge,{capture:!0}),ea.removeEventListener("selectionchange",this.we),ea.removeEventListener("touchstart",this.Ce,{capture:!0}),ea.removeEventListener("touchend",this.Me,{capture:!0}),ea.removeEventListener("touchcancel",this.Ie,{capture:!0}),null==es||es.removeEventListener("visibilitychange",this.ke),this._e=void 0}Fe(t){this.Re=Date.now()}Le(){Ss(ea,"click",this.pe)}ye(){this.ve.length&&Ir(this.je)&&(this.je=ea.setTimeout((()=>{this.He()}),1e3))}Oe(){Ss(ea,"scroll",this.ge,{capture:!0})}Ne(){Ss(ea,"selectionchange",this.we)}qe(){Ss(es,"visibilitychange",this.ke)}Pe(){Ss(ea,"touchstart",this.Ce,{capture:!0,passive:!0}),Ss(ea,"touchend",this.Me,{capture:!0,passive:!0}),Ss(ea,"touchcancel",this.Ie,{capture:!0,passive:!0})}Ee(){var t=Ir(this.Be)||$r(this.Re)&&this.Re>this.Be;return(Ir(this.Ue)||t)&&(this.Be=Date.now(),this.Ue=!(null==es||!es.querySelector(Cv))),!!this.Ue}me(t){return!t||("swipe"===t.type?this.We(t):this.Ve(t))}We(t){if(Bs(t.node))return!0;var e=this.ve.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!zs(t.node,"html")&&Hs(t.node)&&function(t,e){var r;if(!Yn||co(t))return!1;var i=Ar(e)?ao:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:ao;return!eo(vo(t,!1).targetElementList,i)}(t.node,{css_selector_ignorelist:this.Te.css_selector_ignorelist}))}Ve(t){return!(this.Te.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.We(t)||(r=t.node,!(!Yn||co(r))&&vo(r,!1).targetElementList.some((t=>zs(t,"a"))));var e,r}He(){if(this.ve.length){clearTimeout(this.je),this.je=void 0;var t=this.ve;for(var e of(this.ve=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Re&&this.Re>=e.timestamp?this.Re-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.xe&&this.xe>=e.timestamp?this.xe-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Se?Math.abs(e.timestamp-this.Se):void 0;var i=Tv(e.scrollDelayMs,this.Te.scroll_threshold_ms),n=Tv(e.selectionChangedDelayMs,this.Te.selection_change_threshold_ms),s=Tv(e.mutationDelayMs,this.Te.mutation_threshold_ms),o=Tv(e.absoluteDelayMs,1.1*this.Te.mutation_threshold_ms),a=$r(e.scrollDelayMs)&&this.Te.scroll_threshold_ms>e.scrollDelayMs,l=$r(e.mutationDelayMs)&&this.Te.mutation_threshold_ms>e.mutationDelayMs,u=$r(e.selectionChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.selectionChangedDelayMs,h=$r(e.visibilityChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=Tv(e.visibilityChangedDelayMs,this.Te.selection_change_threshold_ms);if(i||s||o||n||d){var c=kv(e);if("$dead_swipe"===c){if(this.fe>=this.Te.max_dead_swipes_per_page_load)continue;this.fe++}this._onCapture(e,{[c+"_last_mutation_timestamp"]:this.Re,[c+"_event_timestamp"]:e.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>e.absoluteDelayMs&&this.ve.push(e)}}this.ye()}}he(t,e){var i=kv(t);this.instance.capture(i,r({},e,_v(t.node,{e:t.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"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Ev(t,e);var Iv=vs("[ExternalScriptsLoader]"),Mv=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Iv.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==es?void 0:es.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!es)return r("document not found");var i=es.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)es.head.appendChild(i);else{var n,s=es.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):es.body.appendChild(i)}};null!=es&&es.body?a():null==es||es.addEventListener("DOMContentLoaded",a)};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.strict_script_versioning)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}Mv(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Mv(t,o,r)}},ea.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Mv(t,i,r)};hs.DEBUG=!1,hs.LIB_VERSION="1.407.7",hs.LIB_NAME="web";class Rv{constructor(t){this._instance=t}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===Yu||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===Ku}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(t){this.Jt.q(this.Kt,t?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 t=this._instance.config,e=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+e:"__ph_opt_in_out_"+e)}get Qt(){var t=this.Jt.A(this.Kt);return Hr(t)?1:mr(zr,t)?0:-1}get Jt(){var t=this.Te.opt_out_capturing_persistence_type,e="localStorage"===t?Ch:Sh;if(!this.Yt||this.Yt!==e){this.Yt=e;var r="localStorage"===t?Sh:Ch;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(Hr(r.A(this.Kt))),r.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[null==ts?void 0:ts.doNotTrack,null==ts?void 0:ts.msDoNotTrack,ea.doNotTrack].some((t=>Hr(t)))}}var Ov=vs("[Dead Clicks]"),Pv=()=>!0,$v=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(au)),i=t.instance.config.capture_dead_clicks;return Ar(i)?i:!!Tr(i)||r};class Lv{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[au]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Ov.error("failed to load script",e):t()}))}tr(){var t;if(es){if(!this.Xt&&null!=(t=ea.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Tr(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Xt=ea.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xt.start(es),Ov.info("starting...")}}else Ov.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Ov.info("stopping..."))}}var Av=vs("[SegmentIntegration]");var Fv="posthog-js";function Nv(t,e){var i=void 0===e?{}:e,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 e=>{var i,a,u,d,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Dv{constructor(t,e,r,i,n,s){this.name=Fv,this.setupOnce=function(o){o(Nv(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class qv{constructor(t){this.rr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(cs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.nr()}nr(){var t;this.sr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.rr)}destroy(){var t;null==(t=this.sr)||t.call(this),this.sr=void 0}doPageView(t,e){var r,i=this.ar(t,e);return this.ir={pathname:null!==(r=null==Yn?void 0:Yn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ar(t,null==(e=this.ir)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ir)?void 0:t.pageViewId}}ar(t,e){var r=this.ir;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$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(!(Ir(s)||Ir(o)||Ir(a)||Ir(l)||Ir(u)||Ir(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?Wr(o/s,0,1,cs):1,c=s>1?Wr(a/s,0,1,cs):1,v=l>1?Wr(u/l,0,1,cs):1,f=l>1?Wr(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=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Uv=["flags","surveys"],jv={[Jl]:{exposure:"hidden"},[Xl]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tu]:{exposure:"hidden"},[eu]:{exposure:"event"},[ru]:{exposure:"hidden"},[iu]:{exposure:"event"},[nu]:{exposure:"hidden"},[su]:{exposure:"event"},[ou]:{exposure:"event"},[au]:{exposure:"event"},[lu]:{exposure:"hidden"},[uu]:{exposure:"event"},[hu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[gu]:{exposure:"hidden"},[mu]:{exposure:"event"},[du]:{exposure:"event",shouldSkipFromEventProperties:t=>Or(t)},$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"},[yu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Tr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[_u]:{exposure:"event",storageGroup:"flags"},[bu]:{exposure:"hidden"},[wu]:{exposure:"hidden",storageGroup:"flags"},[xu]:{exposure:"event",storageGroup:"flags"},[Su]:{exposure:"event",storageGroup:"flags",volatile:!0},[ku]:{exposure:"hidden",storageGroup:"flags"},[Cu]:{exposure:"event"},[Tu]:{exposure:"hidden"},[Eu]:{exposure:"hidden"},[Iu]:{exposure:"hidden"},[Mu]:{exposure:"hidden",storageGroup:"surveys"},[Ru]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Ou]:{exposure:"event"},[Pu]:{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"},[Lu]:{exposure:"hidden"},[Au]:{exposure:"hidden"},[Fu]:{exposure:"hidden"},[Nu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Du]:{exposure:"hidden"},[qu]:{exposure:"hidden"},[Uu]:{exposure:"hidden"},[ju]:{exposure:"hidden"},[Bu]:{exposure:"hidden"},[Hu]:{exposure:"hidden"},[zu]:{exposure:"hidden"},[cu]:{exposure:"event"},[vu]:{exposure:"event"},[fu]:{exposure:"event"},[pu]:{exposure:"event"},[Zu]:{exposure:"event"},[Gu]:{exposure:"event"},[Qu]:{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"}},Bv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Hv=t=>{var e=jv[t];if(e)return e;for(var r of Bv){var i=r[1];if(0===t.indexOf(r[0]))return i}},zv={flags:Nu,surveys:Ru},Wv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Vv="main";class Zv{constructor(t,e,i){if(void 0===i&&(i=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=t,this.dr=i,this.props={},this.cr=!1,this.vr=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.Jt=this.pr(t),this.hr=this.gr(t),this.load(),t.debug&&cs.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),Yn){var n=()=>this.flush();Ss(Yn,"beforeunload",n,{capture:!1}),Ss(Yn,"pagehide",n,{capture:!1})}}mr(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return $r(e)&&e>0?e:0}isDisabled(){return!!this.yr}pr(t){-1===Wv.indexOf(t.persistence.toLowerCase())&&(cs.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...Th,...t];return r({},Ch,{F(t){try{var r={};try{r=Sh.F(t)||{}}catch(t){}var i,n=JSON.parse(Ch.A(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];Or(a)||""===a||(s[o]=a)}i=gs(n,s)}else i=gs(r,n);return Ch.q(t,i),i}catch(t){}return null},q(t,e,r,n,s,o){var a=Ch.q(t,e,void 0,void 0,o);try{var l={};i.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Sh.q(t,l,r,n,s,o)}catch(t){Ch.D(t)}return a},P(t,e){try{null==Yn||Yn.localStorage.removeItem(t),Sh.P(t,e)}catch(t){Ch.D(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&Ch.N()?(e=Ch,n=!0):"localstorage+cookie"===s&&i.N()?(e=i,n=!0):"sessionstorage"===s&&Rh.N()?e=Rh:"memory"===s?e=Ih:"cookie"===s?e=Sh:i.N()?(e=i,n=!0):e=Sh,this.ur=n,e}br(t){return this.vr+"__"+t}gr(t){return this.ur&&!!t.split_storage}_r(t){var e=null!=t?t:this.Te.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Nu];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return ps(this.props,((e,r)=>{var i=Hv(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===yu?()=>this._r():()=>!1))return;i.transformToEventProperties&&gs(t,i.transformToEventProperties(e))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,(()=>!1)))return;t[r]=e}})),t}load(){if(!this.yr){var t=this.Jt.F(this.vr);t&&(this.props=gs({},t)),this.hr&&this.wr()}}wr(){for(var t of Uv){var e=Ch.F(this.br(t));if(e&&!Er(e)){var r=this.kr(t);r.persisted=!0,this.Sr(t)||(r.fingerprint=this.Cr(e,t)),this.Tr(t,e)||gs(this.props,e)}}}Sr(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=Hv(e))?void 0:r.storageGroup)===t}))}Tr(t,e){var r=zv[t];if(!r)return!1;var i=e[r],n=this.props[r];return $r(i)&&$r(n)&&n>i}refreshKey(t){var e;if(!this.yr){var r=this.hr?null==(e=Hv(t))?void 0:e.storageGroup:void 0,i=r?Ch.F(this.br(r)):this.Jt.F(this.vr);if(i&&t in i)this.Ir(t,i[t]);else{if(r){var n=this.Jt.F(this.vr);if(n&&t in n)return void this.Ir(t,n[t])}this.Mr(t)}}}save(){if(!this.yr){var t=this.mr();t>0?Ir(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),t)):this.Rr()}}flush(){Ir(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,Vv))}Pr(){var t=this.Fr(),e=t.main,r=t.groups;for(var i of(this.Or(this.Jt,this.vr,e,Vv),Uv)){var n,s=r[i];(!Er(s)||null!=(n=this.lr[i])&&n.persisted)&&this.Or(Ch,this.br(i),s,i)}}Fr(){var t={},e={flags:{},surveys:{}};return ps(this.props,((r,i)=>{var n,s=null==(n=Hv(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Cr(t,e){if(e===Vv)return JSON.stringify(t)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return ps(t,((t,e)=>{var i;r[e]=null!=(i=Hv(e))&&i.volatile?"__volatile__":t})),JSON.stringify(r)}Or(t,e,r,i){var n=this.kr(i);if(i===Vv||n.dirty||Ir(n.fingerprint)){var s;try{if((s=this.Cr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.q(e,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(n.dirty=!1,i!==Vv&&(n.persisted=!0),Ir(s)||(n.fingerprint=s)):this.Te.debug&&cs.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,r=void 0!==e&&e;if(Ir(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 Uv)Ch.P(this.br(i));r?delete this.lr[Vv]:this.lr={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Tr(t)){Ir(e)&&(e="None"),this.Lr=Ir(r)?this.Nr:r;var i=!1;if(ps(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Ir(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Tr(t)){this.Lr=Ir(e)?this.Nr:e;var r=!1;if(ps(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Ir(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Mr(t),this.save())}update_campaign_params(){if(!this.cr){var t=Ud(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Er(bs(t))||this.register(t),this.cr=!0}}update_search_keyword(){var t;this.register((t=null==es?void 0:es.referrer)?Bd(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Wd(),$referring_domain:null!=es&&es.referrer&&(null==(t=Ts(es.referrer))?void 0:t.host)||zd},void 0)}set_initial_person_info(){this.props[ju]||this.props[Bu]||this.register_once({[Hu]:Vd(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};ps([Bu,ju],(e=>{var r=this.props[e];r&&ps(r,(function(e,r){t["$initial_"+_r(r)]=e}))}));var e=this.props[Hu];if(e){var r=function(t,e){void 0===e&&(e=!1);var r=Zd(t,e),i={};return ps(r,(function(t,e){i["$initial_"+_r(e)]=t})),i}(e,this.Te.disable_capture_url_hashes);gs(t,r)}return t}safe_merge(t){return ps(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Nr=this.Lr=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),n=i?this.pr(t):this.Jt,s=this.gr(t);if(i||s!==this.hr){var o=this.props;this.clear(),this.Jt=n,this.hr=s,this.props=o,this.save()}}set_disabled(t){this.yr=t,this.yr?this.remove():this.save()}set_cross_subdomain(t){t!==this.$r&&(this.$r=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ar&&(this.Ar=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[tu]||{};r[t]=e,this.Ir(tu,r),this.save()}remove_event_timer(t){var e=this.props[tu]||{},r=e[t];return Ir(r)||(delete e[t],this.Ir(tu,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Ir(t,e),this.save()}Ir(t,e){var r;this.props[t]=e,null!=(r=Hv(t))&&r.volatile||this.Dr(t)}Mr(t){delete this.props[t],this.Dr(t)}Dr(t){var e,r=null==(e=Hv(t))?void 0:e.storageGroup;r&&(this.kr(r).dirty=!0)}kr(t){return this.lr[t]||(this.lr[t]={})}}var Gv={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Qv={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Jv={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Kv=vs("[RateLimiter]");class Yv{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{Kv.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Kv.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(Uu))&&void 0!==e?e:{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||t||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||t||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(Uu,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Xv=vs("[RemoteConfig]");class tf{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=ea._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}qr(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}jr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return Xv.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Xv.warn("Remote config is disabled. Falling back to local config.");this.qr((t=>{if(!t)return Xv.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((t=>{this.Hr(t),this.Br()}));this.Hr(t),this.Br()}))}catch(t){Xv.error("Error loading remote config",t)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&es&&"hidden"!==es.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var t;if(!this.zr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.zr=setInterval((()=>{this.refresh()}),e))}}Hr(t){var e;t||Xv.error("Failed to fetch remote config from PostHog."),this._instance.Hr(t?{ok:!0,config:t}:{ok:!1}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var ef=["fatal","error","warning","log","info","debug"],rf=Uint8Array,nf=Uint16Array,sf=Uint32Array,of=new rf([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]),af=new rf([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]),lf=new rf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uf=function(t,e){for(var r=new nf(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new sf(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]},hf=uf(of,2),df=hf[1];hf[0][28]=258,df[258]=28;for(var cf=uf(af,0)[1],vf=new nf(32768),ff=0;32768>ff;++ff){var pf=(43690&ff)>>>1|(21845&ff)<<1;vf[ff]=((65280&(pf=(61680&(pf=(52428&pf)>>>2|(13107&pf)<<2))>>>4|(3855&pf)<<4))>>>8|(255&pf)<<8)>>>1}var gf=function(t,e,r){for(var i=t.length,n=0,s=new nf(e);i>n;++n)++s[t[n]-1];var o,a=new nf(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new nf(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[vf[d]>>>l]=u}else for(o=new nf(i),n=0;i>n;++n)o[n]=vf[a[t[n]-1]++]>>>15-t[n];return o},mf=new rf(288);for(ff=0;144>ff;++ff)mf[ff]=8;for(ff=144;256>ff;++ff)mf[ff]=9;for(ff=256;280>ff;++ff)mf[ff]=7;for(ff=280;288>ff;++ff)mf[ff]=8;var yf=new rf(32);for(ff=0;32>ff;++ff)yf[ff]=5;var _f=gf(mf,9,0),bf=gf(yf,5,0),wf=function(t){return(t/8>>0)+(7&t&&1)},xf=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof nf?nf:t instanceof sf?sf:rf)(r-e);return i.set(t.subarray(e,r)),i},Sf=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},kf=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Cf=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new rf(0),0];if(1==n){var o=new rf(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.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 nf(c+1),f=Tf(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var _=s[i].s;e>v[_]?p-=1<<e-v[_]++-1:++i}for(;i>=0&&p;--i){var b=s[i].s;v[b]==e&&(--v[b],++p)}f=e}return[new rf(v),f]},Tf=function(t,e,r){return-1==t.s?Math.max(Tf(t.l,e,r+1),Tf(t.r,e,r+1)):e[t.s]=r},Ef=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new nf(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++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=t[a]}return[r.subarray(0,i),e]},If=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Mf=function(t,e,r){var i=r.length,n=wf(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Rf=function(t,e,r,i,n,s,o,a,l,u,h){Sf(e,h++,r),++n[256];for(var d=Cf(n,15),c=d[0],v=d[1],f=Cf(s,15),p=f[0],g=f[1],m=Ef(c),y=m[0],_=m[1],b=Ef(p),w=b[0],x=b[1],S=new nf(19),k=0;y.length>k;++k)S[31&y[k]]++;for(k=0;w.length>k;++k)S[31&w[k]]++;for(var C=Cf(S,7),T=C[0],E=C[1],I=19;I>4&&!T[lf[I-1]];--I);var M,R,O,P,L=u+5<<3,A=If(n,mf)+If(s,yf)+o,F=If(n,c)+If(s,p)+o+14+3*I+If(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&F>=L)return Mf(e,h,t.subarray(l,l+u));if(Sf(e,h,1+(A>F)),h+=2,A>F){M=gf(c,v,0),R=c,O=gf(p,g,0),P=p;var N=gf(T,E,0);for(Sf(e,h,_-257),Sf(e,h+5,x-1),Sf(e,h+10,I-4),h+=14,k=0;I>k;++k)Sf(e,h+3*k,T[lf[k]]);h+=3*I;for(var D=[y,w],q=0;2>q;++q){var U=D[q];for(k=0;U.length>k;++k)Sf(e,h,N[j=31&U[k]]),h+=T[j],j>15&&(Sf(e,h,U[k]>>>5&127),h+=U[k]>>>12)}}else M=_f,R=mf,O=bf,P=yf;for(k=0;a>k;++k)if(i[k]>255){var j;kf(e,h,M[257+(j=i[k]>>>18&31)]),h+=R[j+257],j>7&&(Sf(e,h,i[k]>>>23&31),h+=of[j]);var B=31&i[k];kf(e,h,O[B]),h+=P[B],B>3&&(kf(e,h,i[k]>>>5&8191),h+=af[B])}else kf(e,h,M[i[k]]),h+=R[i[k]];return kf(e,h,M[256]),h+R[256]},Of=new sf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pf=function(){for(var t=new sf(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),$f=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Lf(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Pf[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new rf(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Mf(l,u,t.subarray(h,d)):(l[h]=!0,u=Mf(l,u,t.subarray(h,o)))}else{for(var c=Of[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new nf(32768),m=new nf(p+1),y=Math.ceil(r/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new sf(25e3),x=new nf(288),S=new nf(32),k=0,C=0,T=(h=0,0),E=0,I=0;o>h;++h){var M=b(h),R=32767&h,O=m[M];if(g[R]=O,m[M]=R,h>=E){var P=o-h;if((k>7e3||T>24576)&&P>423){u=Rf(t,l,0,w,x,S,C,T,I,h-I,u),T=k=C=0,I=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)S[L]=0}var A=2,F=0,N=f,D=R-O&32767;if(P>2&&M==b(h-D))for(var q=Math.min(v,P)-1,U=Math.min(32767,h),j=Math.min(258,P);U>=D&&--N&&R!=O;){if(t[h+A]==t[h+A-D]){for(var B=0;j>B&&t[h+B]==t[h+B-D];++B);if(B>A){if(A=B,F=D,B>q)break;var H=Math.min(D,B-2),z=0;for(L=0;H>L;++L){var W=h-D+L+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,O=W)}}}D+=(R=O)-(O=g[R])+32768&32767}if(F){w[T++]=268435456|df[A]<<18|cf[F];var Z=31&df[A],G=31&cf[F];C+=of[Z]+af[G],++x[257+Z],++S[G],E=h+A,++k}else w[T++]=t[h],++x[t[h]]}}u=Rf(t,l,!0,w,x,S,C,T,I,h-I,u)}return xf(a,0,i+wf(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(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&$f(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),$f(l,u-8,r.d()),$f(l,u-4,i),l}var Af=!!ns||!!is,Ff="text/plain",Nf=!1,Df=(t,e)=>{var r=t.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},qf=function(t,e,i){var n;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=r({},e),u=null!==(n=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Es(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Uf=t=>{if(t.Vr)return t.Vr;var e=t.data,r=t.compression;if(e){if(r===yl.GZipJS){var i=Lf(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new rf(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new rf(n+8+(r-o<<1));a.set(i),i=a}var l=t.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&t.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 xf(i,0,n)}(Cs(e)),{mtime:0});return{contentType:Ff,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===yl.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Cs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Cs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Cs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},jf=t=>{var e,i,n=()=>"sendBeacon"===t.transport?{url:qf(t.url,{compression:yl.Base64}),encodedBody:Uf(r({},t,{compression:yl.Base64,Vr:void 0}))}:{url:Df(t.url,"compression"),encodedBody:Uf(r({},t,{compression:void 0,Vr:void 0}))};try{e=Uf(t)}catch(e){if(hr(t.compression,Is(t.url,"compression")))return cs.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&hr(t.compression,Is(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?ur(new Uint8Array(i)):ArrayBuffer.isView(i)&&ur(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Nf=!0,n()):{url:t.url,encodedBody:e}},Bf=t=>{try{return jf(t)}catch(e){return cs.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Hf=function(){var t=e((function*(t){var e=Cs(t.data),i=yield function(t,e,r){return fr.apply(this,arguments)}(e,hs.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{Vr:{contentType:Ff,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),zf=/Failed to fetch|NetworkError|Load failed/i,Wf=t=>{var e=Bf(t);if(e){var i=e.url,n=e.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;ps(t.headers,(function(t,e){u.append(e,t)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(ss){var c=new ss;h={signal:c.signal,timeout:setTimeout((()=>{var e,r;d=!0,c.abort((e=t.timeout,(r=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",r))}),t.timeout)}}var v=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&zf.test((null==t?void 0:t.message)||""))(e)?cs.warn(e):cs.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;is(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Wr&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){cs.error(t)}null==t.callback||t.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),v(t)}}},Vf=t=>{try{var e,i=jf(t),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(ts.sendBeacon(n,u))return;var h=kr(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(kr(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=e=>kr(t.data)?e:r({},t.data,{batch:e});return Vf(r({},t,{data:c(h.slice(0,d))})),void Vf(r({},t,{data:c(h.slice(d))}))}cs.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Wf(r({},t,{Wr:!0}))}catch(t){cs.warn("Beacon send failed",t)}},Zf=(t,e,i,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return qf(i===yl.GZipJS?Df(t,"compression"):t,r({},s?{[s]:Date.now().toString()}:{},i===yl.GZipJS?{}:{compression:i}))},Gf=[];is&&Gf.push({transport:"fetch",method:Wf}),ns&&Gf.push({transport:"XHR",method(t){var e=Bf(t);if(e){var r=new ns,i=e.encodedBody;r.open(t.method||"GET",e.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;ps(t.headers,(function(t,e){r.setRequestHeader(e,t)})),s&&r.setRequestHeader("Content-Type",s),t.timeout&&(r.timeout=t.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(o)}}}),null!=ts&&ts.sendBeacon&&Gf.push({transport:"sendBeacon",method:Vf});var Qf=3e3;class Jf{constructor(t,e){this.Zr=!0,this.Gr=[],this.Qr=Wr((null==e?void 0:e.flush_interval_ms)||Qf,250,5e3,cs.createLogger("flush interval"),Qf),this.Jr=t}enqueue(t){this.Gr.push(t),this.Kr||this.Yr()}unload(){this.Xr();var t=this.Gr.length>0?this.ei():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.ti(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var t=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var e=this.ei(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&kr(r.data)&&ps(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ti(r)};for(var i in e)r()}}),this.Qr))}ti(t){try{this.Jr(t)}catch(t){cs.error(t)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var t={};return ps(this.Gr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;Ir(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Gr=[],t}}var Kf=["retriesPerformedSoFar"];class Yf{constructor(t){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=t,this.Gr=[],this.ni=!0,!Ir(Yn)&&"onLine"in Yn.navigator&&(this.ni=Yn.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ss(Yn,"online",this.si),Ss(Yn,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=i(t,Kf);Lr(e)&&(n.url=qf(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.kt(r({retriesPerformedSoFar:e},n));0===t.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!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}kt(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.Gr.push({retryAt:i,requestOptions:t});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 t=Date.now(),e=[],r=this.Gr.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.Gr=e,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Ir(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 e=t.requestOptions;try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(t){cs.error(t)}}this.Gr=[]}}class Xf{constructor(t){this.hi=()=>{var t,e,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!==(t=this.di.maxScrollY)&&void 0!==t?t:0),this.di.maxScrollHeight=Math.max(o,null!==(e=this.di.maxScrollHeight)&&void 0!==e?e: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=t}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var t=this.di;return setTimeout(this.hi,0),t}startMeasuringScrollPosition(){Ss(Yn,"scroll",this.hi,{capture:!0}),Ss(Yn,"scrollend",this.hi,{capture:!0}),Ss(Yn,"resize",this.hi)}scrollElement(){if(!this.ci)return null==Yn?void 0:Yn.document.documentElement;var t=kr(this.ci)?this.ci:[this.ci];for(var e of t){var r=null==Yn?void 0:Yn.document.querySelector(e);if(r)return r}}vi(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[e]||0}return Yn?"y"===t?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 tp=t=>Vd(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class ep{constructor(t,e,r,i){this.fi=t=>{var e=this.pi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.gi(this._instance)};this.mi.register({[qu]:r})}},this._instance=t,this.yi=e,this.mi=r,this.gi=i||tp,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[qu]}getSetOnceProps(){var t,e=null==(t=this.pi())?void 0:t.props;return e?"r"in e?Zd(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return ps(bs(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+_r(r)]=e})),t}}class rp{on(t,e){return this.bi[t]||(this.bi[t]=[]),this.bi[t].push(e),()=>{this.bi[t]=this.bi[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.bi[t]||[])r(e);for(var i of this.bi["*"]||[])i(t,e)}constructor(){this.bi={}}}var ip=vs("[SessionId]");class np{on(t,e){return this.wi.on(t,e)}constructor(t,e,r){var i;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new rp,this.Ti=(t,e)=>!(!Lr(t)||!Lr(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Yu)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=t.config,this.mi=t.persistence,this.Ii=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=e||vh,this.Ri=r||vh;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Wr(this.Te.session_idle_timeout_seconds||1800,60,36e3,ip.createLogger("session_idle_timeout_seconds"),1800),t.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=Rh.F(this.Oi),o=Rh.F(this.Fi);s&&!o?this.Ii=s:Rh.P(this.Oi),Rh.q(this.Fi,!0)}if(null!=(i=this.Te.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){ip.error("Invalid sessionID in bootstrap",t)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ir(this.ki)&&(this.ki=[]),this.ki.push(t),this.Mi&&t(this.Mi,this.Ii),()=>{this.ki=this.ki.filter((e=>e!==t))}}Li(){return"memory"!==this.Te.persistence&&!this.mi.yr&&Rh.N()}Ni(t){t!==this.Ii&&(this.Ii=t,this.Li()&&Rh.q(this.Oi,t))}Di(){return this.Ii?this.Ii:this.Li()?Rh.F(this.Oi):null}qi(t){var e=this.xi;return!Or(e)&&!Or(t)&&5e3>Math.abs(t-e)}$i(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Mi=t,n&&!i||n&&this.qi(e)||(this.xi=e,this.mi.register({[gu]:[e,t,r]}))}ji(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return Lr(e)&&e>0}Hi(){this.ji()?this.mi.refreshKey(gu):(this.mi.flush(),this.mi.load())}Bi(){var t;if(!Or(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var e=this.Ui();e[1]===this.Mi&&e[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[gu]:[this._sessionActivityTimestamp,null!==(t=this.Mi)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var t=this.Ui()[0],e=Lr(t)?t:0,r=Lr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}Vi(t){return this.Hi(),this.Ti(t,this.zi())}Ui(){var t=this.mi.props[gu];return kr(t)&&2===t.length&&t.push(t[0]),t||[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(ih,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Rh.P(this.Fi)},Ss(Yn,ih,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Te.cookieless_mode===Yu)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(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&&!t&&this.Ti(r,o);if(v){(v=this.Vi(r))||ip.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(),ip.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)&&(ip.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=Lr(o)&&t&&!l?o:r,g=Lr(s)?s:(new Date).getTime();this.Ni(a),this.$i(n,p,g),t||this.Pi();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.ki.forEach((t=>t(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 t=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:t})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var sp=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&gr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>gr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function op(){return op=e((function*(){var t=null==ts?void 0:ts.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Mr(r)&&r.length>0?r:void 0}catch(t){return void cs.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),op.apply(this,arguments)}var ap="custom",lp="i.posthog.com",up=/^\/static\//;class hp{constructor(t){this.Zi={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+lp,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}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":ap),this.Zi[this.apiHost]}Gi(t){if(up.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var r=this.Gi(e);if(r)return""+r+e}if(this.region===ap)return this.apiHost+e;var i=lp+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var dp=vs("[PostHog ExternalIntegrations]"),cp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class vp{constructor(t){this._instance=t}er(t,e){var r;null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return dp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,i,n,s=r[0],o=r[1];!o||null!=(e=ea.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.er(cp[s],(()=>{var e;null==(e=ea.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(i=ea.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=ea.__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;e()}}}var fp={},pp=0,gp=()=>{},mp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',yp="Surveys module not available",_p="sanitize_properties is deprecated. Use before_send instead",bp="Invalid value for property_denylist config: ",wp=["token","distinct_id",Vu],xp="posthog",Sp=!Af&&-1===(null==as?void 0:as.indexOf("MSIE"))&&-1===(null==as?void 0:as.indexOf("Mozilla")),kp=t=>{var e;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==es?void 0:es.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:gp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:rs&&Mr(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==(e=Yn.location)?void 0:e.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(t){cs.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:eh,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Qf},error_tracking:{},_onCapture:gp},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:so,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},Cp=[["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"]],Tp=t=>{var e={};for(var r of Cp){var i=r[0],n=r[1];Ir(t[i])||(e[n]=t[i])}var s=gs({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ir(o)||(Ir(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Mr(o)&&Ir(t.asset_host)&&(s.asset_host=o)),kr(t.property_blacklist)&&(Ir(t.property_denylist)?s.property_denylist=t.property_blacklist:kr(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:cs.error(bp+t.property_denylist)),s};class Ep{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(t){cs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Ip{Ji(t,e){if(t){var r=this.Ki.indexOf(t);-1!==r&&this.Ki.splice(r,1)}return this.Ki.push(e),null==e.initialize||e.initialize(),e}Yi(){return this.config.cookieless_mode===Yu||this.config.cookieless_mode===Ku&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new Ep,this.Xi=!1,this.version=hs.LIB_VERSION,this.en=new rp,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=kp(),this.SentryIntegration=Dv,this.sentryIntegration=t=>function(t,e){var r=Nv(t,e);return{name:Fv,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new Xf(this),this.pageViewManager=new qv(this),this.rateLimiter=new Yv(this),this.requestRouter=new hp(this),this.consent=new Rv(this),this.externalIntegrations=new vp(this);var e=null!==(t=Ip.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=Mr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Mr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>cs.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==xp){var i,n=null!==(i=fp[r])&&void 0!==i?i:new Ip;return n._init(t,e,r),fp[r]=n,fp[xp][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o=Mr(t)?t.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=kp(e.defaults),e.debug=this.an(e.debug),this.ln=e,this.un=[],e.person_profiles?this.nn=e.person_profiles:e.process_person&&(this.nn=e.process_person);var a=kp(e.defaults),l=Tp(e),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=e.disable_compression?void 0:yl.GZipJS;var h=this.hn();this.persistence=new Zv(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Zv(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 Jf((t=>this.cn(t)),this.config.request_queue_config),this.vn=new Yf(this),this.__request_queue=[];var v=this.Yi();if(v||(this.sessionManager=new np(this),this.sessionPropsManager=new ep(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:e,thisC:r({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var f=e.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(Du);if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===Xu)this.identify(f);else if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===th)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(vh()),y=e.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(Du,e.bootstrap.isIdentifiedID?th:Xu),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:Wu,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(vh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(Du,Xu)}return Ss(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||vh();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Du,th)),e()},n=r.user();"then"in n&&Cr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||Av.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Av.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Av.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,nh),identify:t=>e(t,oh),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.pn())):this.pn(),Cr(this.config._onCapture)&&this.config._onCapture!==gp&&(cs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),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 op.apply(this,arguments)}().then((t=>{t&&this.register({[Yl]:t})})).catch(gp),this}fn(t){var e,i,n,s,o,a,l,u,h=performance.now(),d=r({},Ip.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.Ki.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e: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&&!t&&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((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.gn){var t=this.gn;this.gn=void 0,this.Hr(t)}})),this.mn(c,h)}mn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.mn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){cs.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[Zu]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Gu]:i}),this.config.__preview_deferred_init_extensions&&cs.info("PostHog extensions initialized ("+i+"ms)")}Hr(t){if(!es||!es.body)return cs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=t),this.yn=t,this.compression=void 0,t.ok){var e,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=mr(r.supportedCompression,yl.GZipJS)?yl.GZipJS:mr(r.supportedCompression,yl.Base64)?yl.Base64:void 0),null!=(e=r.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:eh}),this.Ki.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}pn(){try{this.config.loaded(this)}catch(t){cs.critical("`loaded` function failed",t)}if(this.bn(),this.config.internal_or_test_user_hostname&&null!=rs&&rs.hostname){var t=rs.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new tf(this),this.wn.load()}bn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.dn)||t.enable())}_dom_loaded(){this.is_capturing()&&fs(this.__request_queue,(t=>this.cn(t))),this.__request_queue=[],this.bn()}_handle_unload(){var t,e,r,i,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(sh),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.dn)||i.unload(),null==(n=this.vn)||n.unload()):this.xn()&&this.capture(sh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Sp?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Ir(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ir(s.compression)&&s.data&&(s.compression=yl.Base64),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=kr(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(t,e){return void 0===e&&(e=(new Date).toISOString()),kr(t)?t.map((t=>r({},t,{sent_at:e}))):r({},t,{sent_at:e})}(s.data))),s.url=Zf(s.url,s.method,s.compression,s.timestampMode);var c=Gf.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),v=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(c,(t=>t.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.GZipJS&&os&&"undefined"!=typeof Promise&&!Nf?Hf(s).then((t=>{v(t)})).catch((e=>{if(dr(e))return Nf=!0,void v(r({},s,{compression:void 0,url:Zf(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return dr(t)||e===lr})(e)&&(Nf=!0),v(s)})):v(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}cn(t){this.vn?this.vn.retriableRequest(t):this._send_request(t)}_execute_array(t){pp++;try{var e,r=[],i=[],n=[];fs(t,(t=>{if(t)if(kr(e=t[0]))n.push(t);else if(Cr(t))try{t.call(this)}catch(e){cs.error("Error executing queued PostHog call",t,e)}else kr(t)&&"alias"===e?r.push(t):kr(t)&&-1!==e.indexOf("capture")&&Cr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){fs(t,(function(t){try{if(kr(t[0])){var r=e;ps(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){cs.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{pp--}}push(t){if(pp>0&&kr(t)&&Mr(t[0])){var e=Ip.prototype[t[0]];Cr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!Ir(t)&&Mr(t)){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!=e&&e.$current_url&&!Mr(null==e?void 0:e.$current_url)&&(cs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||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,vh),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},c,v)};t===nh&&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"===t&&!1===f.properties.$feature_flag_has_experiment&&!0===this.get_property(ku);(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,t!==ah,t===oh);if(m&&(f.$set_once=m),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>Mr(t)?t.slice(0,s):t,l=new Set,f=function t(e,r){if(e!==Object(e))return a?a(e):e;if(!l.has(e)){var i;if(l.add(e),kr(e))i=[],fs(e,(e=>{i.push(t(e))}));else{var n={};ps(e,((e,r)=>{l.has(e)||(n[r]=t(e,r))})),i=n}return i}}(o)),f.timestamp=c,Ir(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(t,e){void 0===e&&(e=[]);var r={},i=e=>{void 0!==t[e]&&(r[e]=t[e])};return er.forEach(i),e.forEach(i),r}(f.properties,wp)),t===El.DISMISSED||t===El.SENT){var y=null==e?void 0:e[Il.SURVEY_ID],_=null==e?void 0:e[Il.SURVEY_ITERATION];Zl({id:y,current_iteration:_}),f.$set=r({},f.$set,{[$l({id:y,current_iteration:_},t===El.SENT?"responded":"dismissed")]:!0})}else t===El.SHOWN&&(f.$set=r({},f.$set,{[Il.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Qv.SHOWN){var b=null==e?void 0:e[Jv.TOUR_TYPE];b&&(f.$set=r({},f.$set,{[Jv.TOUR_LAST_SEEN_DATE+"/"+b]:(new Date).toISOString()}))}var w=r({},f.properties.$set,f.$set);if(Er(w)||this.setPersonPropertiesForFlags(w),!Pr(this.config.before_send)){var x=this.wt(f);if(!x)return;(f=x).uuid=Xi(f.uuid,vh)}this.en.emit("eventCaptured",f);var S=null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),k={method:"POST",url:S,data:f,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(S)?"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(k):this.dn.enqueue(k),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(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Yi()&&(a[Vu]=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Mr(a.distinct_id)&&!$r(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(t,e,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!as)return{};var l,u=t?[...Fd,...e||[]]:[],h=function(t){for(var e=0;Qi.length>e;e++){var r=Qi[e],i=r[1],n=r[0].exec(t),s=n&&(Cr(i)?i(n,t):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={};Ir(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,_=null==Yn||null==(a=Yn.screen)?void 0:a.height,b=null==Yn?void 0:Yn.devicePixelRatio;Ir(g)||(p.userAgentDataPlatform=g),Ir(m)||(p.maxTouchPoints=m),Ir(y)||(p.screenWidth=y),Ir(_)||(p.screenHeight=_),Ir(b)||(p.devicePixelRatio=b);var w,x=gs(bs({$os:d,$os_version:c,$browser:Vi(as,navigator.vendor,v,f),$device:Ji(as),$device_type:Ki(as,p),$timezone:Gd(),$timezone_offset:Qd()}),{$current_url:Ms(i?tn(null==rs?void 0:rs.href):null==rs?void 0:rs.href,u,Dd),$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:Hd(),$browser_language_prefix:(w=Hd(),"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(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ap&&(a.$lib_custom_api_host=this.config.api_host),u=t!==nh||s?t!==sh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gs(a,u),t===nh&&es&&(a.title=es.title),!Ir(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"],(t=>{t in p&&delete g[t]})),(a=gs({},h,p,g,a)).$is_identified=this._isIdentified(),kr(this.config.property_denylist)?ps(this.config.property_denylist,(function(t){delete a[t]})):cs.error(bp+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(cs.error(_p),a=m(a,t));var y=this.Cn();return a.$process_person_profile=y,y&&!s&&this.Tn("_calculate_event_properties"),a}Sn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.Cn())return t;if(this.Xi&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=gs({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(cs.error(_p),o=a(o,"$set_once")),e&&(this.Xi=!0),Er(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}In(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e))&&void 0!==r?r:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.en.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:yp}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:yp})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:yp})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=Ql),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:yp}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:yp})}Mn(t){return!t||Rr(t)?(cs.critical("Unique user id has not been set in posthog.identify"),!1):t===Wu?(cs.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(cs.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return cs.uninitializedWarning("posthog.identify");if($r(t)&&(t=t.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(t)&&this.Tn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Kl)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Xl)&&(this.unregister(Xl),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Du)||Xu)===Xu;t!==i&&s?(this.persistence.set_property(Du,th),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(oh,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.sn=gh(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Lu))}}setPersonProperties(t,e){if((t||e)&&this.Tn("posthog.setPersonProperties")){var r=gh(this.get_distinct_id(),t,e);this.sn!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.sn=r):cs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,r=(kr(t)?t:[t]).filter((t=>Mr(t)&&t.length>0));0!==r.length&&this.Tn("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(ah,o)}i&&this.setGroupPropertiesForFlags({[t]: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(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.Tn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,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(Kl),v=this.get_property(Yl),f=this.get_property(hu);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),Ir(f)||null==(d=this.persistence)||d.register({[hu]: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(Du,Xu),null==(h=this.sessionManager)||h.resetSessionId(),this.sn=null,this.config.cookieless_mode===Yu)this.register_once({distinct_id:Wu,$device_id:null},"");else{var p=this.config.get_device_id(vh());this.register_once({distinct_id:p,$device_id:t?p:c},""),t||Ir(v)||this.register({[Yl]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var r=this;return e((function*(){var t,e,i,n,s;r.__loaded?(null==(t=r.logs)||t.flushLogs("sendBeacon"),null==(e=r.metrics)||e.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(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.En()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=e.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.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(t,e){return t===this.get_property(Jl)?(cs.critical("Attempting to create alias for existing People user - aborting."),-2):this.Tn("posthog.alias")?(Ir(e)&&(e=this.get_distinct_id()),t!==e?(this.In(Xl,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(cs.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Tr(t)){var i,n,s,o,a,l,u,h,d,c,v;gs(this.config,Tp(t));var f=this.hn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Zv(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.an(this.config.debug);Ar(p)&&(this.config.debug=p),Ar(this.config.debug)&&(this.config.debug?(hs.DEBUG=!0,Ch.N()&&Ch.q("ph_debug",!0),cs.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(hs.DEBUG=!1,Ch.N()&&Ch.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(t,e){hs.LIB_NAME=t,hs.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.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 t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Ip.On}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:xp;return e!==xp&&(e=xp+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Du))===th||(null==(e=this.sessionPersistence)?void 0:e.get_property(Du))===th}Cn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===eh&&!this._isIdentified()&&Er(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Xl])&&(null==(e=this.persistence)||null==(e=e.props)||!e[zu]))}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(t){return"never"===this.config.person_profiles?(cs.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(zu,!0),!0)}hn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ku)}Pn(){var t,e,r,i,n=this.hn();return(null==(t=this.persistence)?void 0:t.yr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.yr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Yu){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 np(this),this.pageViewManager=new qv(this),this.persistence&&(this.sessionPropsManager=new ep(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=Ip.__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==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ku&&(null==(u=this.surveys)||u.loadIfEnabled()),(Ir(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else cs.warn(mp)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==Yu?(this.config.cookieless_mode===Ku&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Ku&&(this.register({distinct_id:Wu,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.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(mp)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Yu||(this.config.cookieless_mode===Ku?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return ts?sp(ts,this.config.custom_blocked_useragents):void 0}_n(){es&&("visible"===es.visibilityState?this.tn||(this.tn=!0,this.capture(nh,{title:es.title},{send_instantly:!0}),this.rn&&(es.removeEventListener(rh,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),Ss(es,rh,this.rn)))}debug(t){!1===t?(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 t=this.ln||{};return"advanced_disable_flags"in t?!!t.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(t,e,r,i,n){var s=e in t&&!Pr(t[e]),o=r in t&&!Pr(t[r]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r])}(t,"advanced_disable_flags","advanced_disable_decide",0,cs)}wt(t){var e;if(Pr(this.config.before_send))return t;var r=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Dr),i=kr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of i){if(n=s(n),Pr(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Nr(t.event)?cs.warn(o+". This can cause unexpected behavior."):cs.info(o),null}n.properties&&!Er(n.properties)||cs.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Pr(n.properties[a]))return cs.warn("Event '"+t.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 t;return null==(t=this.pageViewManager.ir)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}an(t){var e=Ar(t)&&!t,r=Ch.N()&&"true"===Ch.A("ph_debug");return!e&&(!!r||t)}}Ip.__defaultExtensionClasses={},Ip.On=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=_s(t.prototype[e[r]])}(Ip,["identify"]);var Mp=vs("[ExceptionAutocapture]"),Rp=vs("[TracingHeaders]"),Op=vs("[Web Vitals]"),Pp=9e5,$p="disabled",Lp="lazy_loading",Ap="awaiting_config",Fp="missing_config";vs("[SessionRecording]"),vs("[SessionRecording]");var Np="[SessionRecording]",Dp=vs(Np),qp=vs("[Heatmaps]");function Up(t){return Tr(t)&&"clientX"in t&&"clientY"in t&&$r(t.clientX)&&$r(t.clientY)}var jp=vs("[Product Tours]"),Bp=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(lu))},Hp=["$set_once","$set"],zp=vs("[SiteApps]"),Wp="Error while initializing PostHog app with config id ";function Vp(t,e,r){if(Pr(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Zp{constructor(t){this.Fn=new rp,this.Ln=(t,e)=>this.$n(t,e)&&this.An(t,e)&&this.Nn(t,e)&&this.Dn(t,e),this.$n=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.qn=new Set,this.jn=new Set}init(){var t,e;Ir(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!Ir(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.jn)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.qn)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.qn.has(t)||this.qn.has(e.event))&&this.jn&&(null==(r=this.jn)?void 0:r.size)>0&&this.jn.forEach((t=>{this.Hn(e,t)&&this.Fn.emit("actionCaptured",t.name)}))}Bn(t){this.onAction("actionCaptured",(e=>t(e)))}Hn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Ln(t,r))return!0;return!1}onAction(t,e){return this.Fn.on(t,e)}An(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Vp(i,e.url,e.url_matching||"contains"))return!1}return!0}Nn(t,e){return!!this.Un(t,e)&&!!this.zn(t,e)&&!!this.Vn(t,e)}Un(t,e){var r;if(null==e||!e.href)return!0;var i=this.Wn(t);if(i.length>0)return i.some((t=>Vp(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Vp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}zn(t,e){var r;if(null==e||!e.text)return!0;var i=this.Wn(t);if(i.length>0)return i.some((t=>Vp(t.text,e.text,e.text_matching||"exact")||Vp(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!Pr(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Vp(t,s,o))))}Vn(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}Wn(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Dn(t,e){return null==e||!e.properties||0===e.properties.length||_h(e.properties.reduce(((t,e)=>{var r=kr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Gp{constructor(t){var e;this.Zn=[],this._instance=t,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.Kn(t)))}Yn(t,e){return!!t&&_h(t.propertyFilters,null==e?void 0:e.properties)}Xn(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}es(t,e,r){var i=(r===_l.Activation?this.Gn:this.Qn).get(t),n=[];return this.ts((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Yn(s,e)}))}register(t){var e;Ir(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.rs(t),this.ns(t))}ns(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.ss&&(this.ss=new Zp(this._instance),this.ss.init(),this.ss.Bn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ss)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.Jn.get(e.name);r&&r.push(t.id),this.Jn.set(e.name,r||[t.id])}})))})))}rs(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Gn=this.Xn(t,_l.Activation),this.Qn=this.Xn(t,_l.Cancellation))}onEvent(t,e){var r,i,n=this.os(),s=(null==e||null==(r=e.properties)?void 0:r.$survey_id)||(null==e||null==(i=e.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.ls(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.us([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),void this.hs(s)}if(this.Qn.has(t)){var a=this.es(t,e,_l.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.us(a.map((t=>t.id))),a.forEach((t=>this.ds(t.id))))}if(this.Gn.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Gn.get(t)});var l=this.es(t,e,_l.Activation);this.cs(l.map((t=>t.id)))}}onAction(t){this.Jn.has(t)&&this.cs(this.Jn.get(t)||[])}cs(t){0!==t.length&&(this.Zn=[...new Set([...this.Zn,...t])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(t){this.Zn=this.Zn.filter((e=>e!==t));var e=this.vs();e.includes(t)||(this.fs([...e,t]),this.ps())}us(t){var e=new Set(t);this.Zn=this.Zn.filter((t=>!e.has(t)));var r=this.gs(),i=r.filter((t=>!e.has(t)));i.length!==r.length&&(this.fs(i),0===i.length&&this.ys())}gs(){var t,e=this.bs();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}vs(){var t,e,r=this.gs();if(0===r.length)return[];var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._s()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&i===n?r:[]}ps(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.ws(e)}ys(){this.xs()}Kn(t){var e,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._s()];r&&r!==t&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((t=>!this.ks(t)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class Qp extends Gp{constructor(t){super(t)}bs(){return Ou}_s(){return Pu}Cs(){return El.SHOWN}ts(t){var e;null==(e=this._instance)||e.getSurveys(t)}ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}os(){return Ul}fs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Ou]:t})}ws(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Pu]:t})}xs(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(Pu)}ks(){return!1}ls(t,e){var r;return this.ts((t=>{r=t.find((t=>t.id===e))})),!r||ql(r)?t===El.SHOWN?"consume":"ignore":t===El.SHOWN?"persist":t===El.DISMISSED||t===El.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Jp="SDK is not enabled or survey functionality is not yet loaded",Kp="Disabled. Not loading surveys.",Yp=null!=Yn&&Yn.location?Rs(Yn.location.hash,"__posthog")||Rs(location.hash,"state"):null,Xp="_postHogToolbarParams",tg=vs("[Toolbar]"),eg=vs("[FeatureFlags]"),rg=vs("[FeatureFlags]",{debugEnabled:!0}),ig="\" failed. Feature flags didn't load in time.",ng=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},sg=t=>{var e={};for(var r of ms(t||{})){var i=r[1];i&&(e[r[0]]=i)}return e},og="Refusing to render web experiment since the viewer is a likely bot",ag={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ph(e,t),not_regex:(t,e)=>!ph(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class lg{get Te(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{lg.Ts("retrieved web experiments from the server"),e.Is=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Is&&(lg.Ts("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Is)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);Mr(i)&&t.variants[i]&&e.Ms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];lg.Es(s,e._instance)&&e.Ms(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())lg.Ts(og);else if(!this.Te.disable_web_experiments){if(Pr(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();lg.Ts("applying feature flags",t),t.forEach((t=>{var e;if(this.Is&&null!=(e=this.Is)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Is)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=lg.getWindowLocation();if(null!=t&&t.search){var e=Is(null==t?void 0:t.search,"__experiment_id"),r=Is(null==t?void 0:t.search,"__experiment_variant");e&&r&&(lg.Ts("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Rs(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.Te.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Rs(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(lg.Ts("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ms(i[0].name,e,i[0].variants[e].transforms))}static Es(t,e){return!Pr(t.conditions)&&lg.Ps(t,e)&&lg.Os(t)}static Ps(t,e){var r;if(Pr(t.conditions)||Pr(null==(r=t.conditions)?void 0:r.url))return!0;var i=lg.getWindowLocation();if(i){var n,s,o,a=Fs(e,i.href);return null==(n=t.conditions)||!n.url||ag[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==Yn?void 0:Yn.location}static Os(t){var e;if(Pr(t.conditions)||Pr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Ud();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Ts(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];cs.info("[WebExperiments] "+t,r)}Ms(t,e,r){this._is_bot()?lg.Ts(og):"control"!==e?r.forEach((r=>{if(r.selector){var i;lg.Ts("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):lg.Ts("Control variants leave the page unmodified.")}_is_bot(){return ts&&this._instance?sp(ts,this.Te.custom_blocked_useragents):void 0}}var ug=vs("[Conversations]"),hg="Conversations not available yet.",dg="console",cg={featureFlags:class{constructor(t){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 t=this.Us();this.Hs=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],Yn&&Ss(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(t){return this._instance.get_property(t)}Vs(){var t,e;return null!==(t=null==(e=this.mi)?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==t&&t}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,eg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var t,e=null!==(t=this.Te.evaluation_contexts)&&void 0!==t?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(eg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||eg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Gs(){return this.Zs().length>0}Qs(){var t=this.Te.flag_keys;if(!Ir(t)){if(kr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||eg.error("Invalid flag key found:",t,"Expected non-empty string"),e}));eg.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};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((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.zs(yu))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.zs(xu))&&void 0!==s?s:{},l=r({},o,t),u=r({},a,e),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:Ye(v),variant:Xe(v),reason:void 0,metadata:Ir(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 t=this.zs(wu),e=this.zs(Cu),i=this.zs(Tu);if(!i&&!e)return t||{};var n=gs({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],d=Ir(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Ir(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||(eg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Fs=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((r=>{var i=t[r];return{key:r,enabled:Ye(i),variant:Xe(i),payload:Ke(e[r])}}))}getFlagVariants(){var t=this.zs(yu),e=this.zs(Cu);if(!e)return t||{};for(var r=gs({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Fs||(eg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Fs=!0),r}getFlagPayloads(){var t=this.zs(xu),e=this.zs(Tu);if(!e)return t||{};for(var r=gs({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Fs||(eg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,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(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.As=t}Ks(t){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var i=this.Te.token,n=this.zs(Kl),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==(e=this.mi)?void 0:e.get_initial_props())||{},this.zs(Eu)||{},{$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION}),group_properties:this.zs(Iu),timezone:Gd()};Or(n)||Ir(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var o=this.Qs();Ir(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:yl.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(this.Xs(t.statusCode),200===t.statusCode&&(this.Ns||(this.$anon_distinct_id=void 0),n=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.mi)||i.register({[Fu]:o}),u)eg.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=t.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks())}}})}}Us(){return Os(this.Hs,3)}Xs(t){this.Hs=Ps(t,this.Hs,3,(()=>eg.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(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else eg.warn('getFeatureFlag for key "'+t+ig)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.zs(Su)||void 0,l=this.zs(Nu)||void 0,u=this.zs(Lu)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.zs(Au);d&&d!==c&&(u={},null==(h=this.mi)||h.register({[Lu]:u,[Au]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,_,b,w,x,S;kr(u[t])?u[t].push(o):u[t]=[o],null==(v=this.mi)||v.register({[Lu]:u});var k=this.getFeatureFlagDetails(t),C=[...null!==(f=this.zs(Fu))&&void 0!==f?f:[]];Ir(n)&&C.push("flag_missing");var T={$feature_flag:t,$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[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Te.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.Ds};Ir(null==k||null==(m=k.metadata)?void 0:m.has_experiment)||(T.$feature_flag_has_experiment=k.metadata.has_experiment),Ir(null==k||null==(y=k.metadata)?void 0:y.version)||(T.$feature_flag_version=k.metadata.version);var E,I=null!==(_=null==k||null==(b=k.reason)?void 0:b.description)&&void 0!==_?_:null==k||null==(w=k.reason)?void 0:w.code;I&&(T.$feature_flag_reason=I),null!=k&&null!=(x=k.metadata)&&x.id&&(T.$feature_flag_id=k.metadata.id),Ir(null==k?void 0:k.original_variant)&&Ir(null==k?void 0:k.original_enabled)||(T.$feature_flag_original_response=Ir(k.original_variant)?k.original_enabled:k.original_variant),null!=k&&null!=(S=k.metadata)&&S.original_payload&&(T.$feature_flag_original_payload=null==k||null==(E=k.metadata)?void 0:E.original_payload),C.length&&(T.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",T)}if(i)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:Ke(s)}}}else eg.warn('getFeatureFlagResult for key "'+t+ig)}getRemoteConfigPayload(t,e){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();Ir(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:yl.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.Ds)return e.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return eg.warn('isFeatureEnabled for key "'+t+ig),e.defaultValue;var r=this.getFeatureFlag(t,e);return Ir(r)?e.defaultValue:!!r}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.mi){this.Ls=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):t.featureFlags&&eg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,c=t.evaluatedAt;if(kr(u)){eg.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;e&&e.register({[_u]:u,[yu]:v,[ku]:!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(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[_u]:Object.keys(sg(p)),[yu]:p||{},[xu]:g||{},[wu]:m||{},[ku]:!0===t.minimalFlagCalledEvents},d?{[Su]:d}:{},c?{[Nu]:c}:{}))}}}(t,this.mi,n,s,o,i),e||(this.js=!1),this.eo(e)}}override(t,e){void 0===e&&(e=!1),eg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return eg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.mi.unregister(Cu),this.mi.unregister(Tu),this.eo(),rg.info("All overrides cleared");if(kr(t)){var e=ng(t);return this.mi.register({[Cu]:e}),this.eo(),rg.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.Fs=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.mi.unregister(Cu),rg.info("Flag overrides cleared");else if(i.flags){if(kr(i.flags)){var n=ng(i.flags);this.mi.register({[Cu]:n})}else this.mi.register({[Cu]:i.flags});rg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.mi.unregister(Tu),rg.info("Payload overrides cleared")):i.payloads&&(this.mi.register({[Tu]:i.payloads}),rg.info("Payload overrides set",{payloads:i.payloads}))),void this.eo()}if(t&&"object"==typeof t)return this.mi.register({[Cu]:t}),this.eo(),rg.info("Flag overrides set",{flags:t});eg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ls){var e=this.ro(),r=e.flags,i=e.flagVariants;try{t(r,i)}catch(t){eg.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.zs(bu)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$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(),{[t]:e});null==(n=this.mi)||n.register({[_u]:Object.keys(sg(l)),[yu]:l}),this.eo()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.zs(bu),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(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:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.mi)||r.unregister(bu),null==(i=this.mi)||i.register({[bu]:n}),t(n)}}})}ro(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}eo(t){var e=this.ro(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(r,i,{errorsLoading:t})}catch(t){eg.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.zs(Eu)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$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)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=r({},this.zs(Eu)||{});t.forEach((t=>{delete i[t]})),this._instance.register({[Eu]:i}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(Eu),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.zs(Iu)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Iu]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.zs(Iu)||{};this._instance.register({[Iu]:r({},e,{[t]:{}})})}else this._instance.unregister(Iu)}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}}},vg={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!(null==(t=this.io)||!t.isStarted)}get status(){var t,e;return this.no===Ap||this.no===Fp?this.no:null!==(t=null==(e=this.io)?void 0:e.status)&&void 0!==t?t:this.no}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=$p,this.so=void 0,this._instance=t,!this._instance.sessionManager)throw Dp.error("started without valid sessionManager"),new Error(Np+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Yu)throw new Error(Np+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var t,e=!(null==(t=this._instance.get_property(hu))||!t.enabled),r=!this.Te.disable_session_recording,i=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.oo||null==(e=this.io)||!e.isStarted){var r=!Ir(Object.assign)&&!Ir(Array.from);this.oo&&r?(this.ao(t),Dp.info("starting")):(this.no=$p,this.stopRecording())}}ao(t){var e,r,i;this.oo&&(this.no!==Ap&&this.no!==Fp&&(this.no=Lp),null!=ea&&null!=(e=ea.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=ea.__PosthogExtensions__)&&r.initSessionRecording?this.lo(t):null==(i=ea.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.uo,(e=>{if(e)return Dp.error("could not load recorder",e);this.lo(t)})))}stopRecording(){var t,e;null==(t=this.so)||t.call(this),this.so=void 0,null==(e=this.io)||e.stop()}ho(){var t,e;null==(t=this.so)||t.call(this),this.so=void 0,null==(e=this.io)||e.discard()}do(){var t,e;null==(t=this.mi)||t.unregister(mu),null==(e=this.mi)||e.unregister(du)}co(t,e){if(Pr(t))return null;var r,i=$r(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Dp.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}vo(t){if(this.mi){var e,i,n=this.mi,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.co(null==(e=this.Te.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.co(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Pr(a)&&this.do();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[hu]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.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:Ir(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==(e=this.so)||e.call(this),this.so=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===Ap&&(this.no=Fp,Dp.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.io)&&r.log?this.io.log(t,e):Dp.warn("log called before recorder was ready")}get uo(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(hu);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}fo(){var t,e,r=this._instance.get_property(hu);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Dp.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}lo(t){var e,r;if(null==(e=ea.__PosthogExtensions__)||!e.initSessionRecording)return Dp.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Qu]:!0});if(this.io||(this.io=null==(r=ea.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo()){if(this.no===Fp||this.no===Ap)return;return this.no=Ap,Dp.info("persisted remote config is stale, requesting fresh config before starting"),void new tf(this._instance).load()}this.no=Lp,this.io.start(t)}onRRwebEmit(t){var e;null==(e=this.io)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.io||null==(e=this.mi)||e.register({[vu]:!0}),null==(t=this.io)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.io||null==(e=this.mi)||e.register({[cu]:!0}),null==(t=this.io)||t.overrideSampling()}overrideTrigger(t){var e,r;this.io||null==(r=this.mi)||r.register({["url"===t?fu:pu]:!0}),null==(e=this.io)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.io)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.io)||!r.tryAddCustomEvent(t,e))}}},fg={autocapture:class{constructor(t){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=t,this.rageclicks=new fv(t.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var t,e,r=Tr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}wo(){if(this.isBrowserSupported()){if(Yn&&es){var t=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.xo(t)}catch(t){gv.error("Failed to capture event",t)}};if(Ss(es,"submit",t,{capture:!0}),Ss(es,"change",t,{capture:!0}),Ss(es,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.xo(t,pv)}catch(t){gv.error("Failed to capture copy/cut event",t)}};Ss(es,"copy",e,{capture:!0}),Ss(es,"cut",e,{capture:!0})}}}else gv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(t){if(this.yo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var r=e.autocapture_opt_out;Ar(r)&&(this.instance.persistence&&this.instance.persistence.register({[eu]:r}),this.mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this._o=t}getElementSelectors(t){var e,r=[];return null==(e=this._o)||e.forEach((e=>{var i=null==es?void 0:es.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[eu],i=this.mo,n=this.instance.Ur()&&!this.yo;if(Or(i)&&!Ar(r)&&!n)return!1;var s=null!==(e=this.mo)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!s}xo(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=Xs(t);Ws(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&ho(i,this.instance.config.rageclick)&&this.xo(t,"$rageclick");var n=e===pv;if(i&&function(t,e,r,i,n,s){var o;if(!Yn||co(t))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((t=>e.type===t)))return!1}var l=vo(t,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Ir(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!eo(h,null==r?void 0:r.css_selector_allowlist))return!1;if(eo(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:io))return!1;try{var d=Yn.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(to.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.Te,n,n?["copy","cut"]:void 0,this.instance)){var s=_v(i,{e:t,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),e===pv){var l,u=Ks(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Cr(null==es?void 0:es.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ko=(null==Yn||null==(e=Yn.location)?void 0:e.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(t){var e;if(Yn&&(null==(e=Yn.history[t])||!e.__posthog_wrapped__)){var r=this;Ls(Yn.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.Io(t)}))}}Io(t){try{var e,r=null==Yn||null==(e=Yn.location)?void 0:e.pathname;if(!r)return;r!==this.ko&&this.isEnabled&&this._instance.capture(nh,{navigation_type:t}),this.ko=r}catch(e){cs.error("Error capturing "+t+" pageview",e)}}To(){if(!this.So){var t=()=>{this.Io("popstate")};Ss(Yn,"popstate",t),this.So=()=>{Yn&&Yn.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=t,this.Mo=!(null==(e=this.instance.persistence)||!e.props[ru]),this.rageclicks=new fv(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Tr(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Pr(this.Te.capture_heatmaps)?Pr(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.po)return;qp.info("starting..."),this.Ro(),this.ke()}else{var t;clearInterval(null!==(t=this.Eo)&&void 0!==t?t:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ru]:r}),this.Mo=r,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Oo(t){Up(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo="visible"===(null==es?void 0:es.visibilityState)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){Yn&&es&&(this.Fo=this.oi.bind(this),Ss(Yn,ih,this.Fo),this.Lo=t=>this.pe(t||(null==Yn?void 0:Yn.event)),Ss(es,"click",this.Lo,{capture:!0}),this.$o=t=>this.Ao(t||(null==Yn?void 0:Yn.event)),Ss(es,"mousemove",this.$o,{capture:!0}),this.No=new Lv(this.instance,Pv,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),Ss(es,rh,this.Do),this.po=!0)}Po(){var t;Yn&&es&&(this.Fo&&Yn.removeEventListener(ih,this.Fo),this.Lo&&es.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&es.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&es.removeEventListener(rh,this.Do),clearTimeout(this.qo),null==(t=this.No)||t.stop(),this.po=!1)}jo(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&Hs(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(t){return!1}if(mr(e,n))return!0;i=ro(i)}return!1}(Xs(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}pe(t,e){var i;if(void 0===e&&(e="click"),!Bs(t.target)&&Up(t)){var n=this.jo(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&ho(Xs(t),this.instance.config.rageclick)&&this.Nt(r({},n,{type:"rageclick"})),this.Nt(n)}}Ao(t){!Bs(t.target)&&Up(t)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Nt(this.jo(t,"mousemove"))}),500))}Nt(t){if(Yn){var e=this.Te.disable_capture_url_hashes?tn(Yn.location.href):Yn.location.href,r=this.Te.custom_personal_data_properties,i=this.Te.mask_personal_data_properties?[...Fd,...r||[]]:[],n=Ms(e,i,Dd);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(t)}}oi(){this.R&&!Er(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Lv,webVitalsAutocapture:class{constructor(t){var e;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(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=t=>{var e;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.zo();if(!Ir(i))if(Pr(null==t?void 0:t.name)||Pr(null==t?void 0:t.value))Op.error("Invalid metric received",t);else if(!this.Vo||this.Vo>t.value){this.R.url!==i&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Ir(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Ir(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});Ir(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 Op.error("Ignoring metric with value >= "+this.Vo,t)},this.Wo=()=>{if(!this.po){var t,e,r,i,n=ea.__PosthogExtensions__;if(!Ir(n)&&!Ir(n.postHogWebVitalsCallbacks)){var s=n.postHogWebVitalsCallbacks;t=s.onLCP,e=s.onCLS,r=s.onFCP,i=s.onINP}t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(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):Op.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Mo=!(null==(e=this._instance.persistence)||!e.props[ou]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Tr(this.Zo)?null==(t=this.Zo)?void 0:t.web_vitals_allowed_metrics:void 0;return Pr(r)?(null==(e=this._instance.persistence)?void 0:e.props[uu])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Tr(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Tr(this.Zo)?this.Zo.web_vitals_attribution:void 0;return null!=t&&t}get Vo(){var t=Tr(this.Zo)&&$r(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:Pp;return t>0&&6e4>=t?Pp:t}get isEnabled(){var t=null==rs?void 0:rs.protocol;if("http:"!==t&&"https:"!==t)return Op.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Tr(this.Zo)?this.Zo.web_vitals:Ar(this.Zo)?this.Zo:void 0;return Ar(e)?e:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Op.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var r=Tr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Tr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ou]:r}),this._instance.persistence.register({[uu]:i})),this.Mo=r,this.startIfEnabled()}}}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?Op.error("failed to load script",e):t()}))}zo(){var t=Yn?this._instance.config.disable_capture_url_hashes?tn(Yn.location.href):Yn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Fd,...e||[]]:[];return Ms(t,r,Dd)}Op.error("Could not determine current URL")}}},pg={exceptionObserver:class{constructor(t){var e;this.Wo=()=>{var t;if(Yn&&this.isEnabled&&null!=(t=ea.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=ea.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ea.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ea.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=e(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(t){Mp.error("failed to start",t),this.Ko()}}},this._instance=t,this.Yo=!(null==(e=this._instance.persistence)||!e.props[iu]),this.Xo=new Vr(r({},function(t){var e,r,i,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(r=t.exceptionRateLimiterRefillRate)&&void 0!==r?r:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(i=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,Ge:Mp})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Tr(t)?e=r({},e,t):(Ir(t)?this.Yo:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Mp.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Mp.error("failed to load script",e);t()}))}Ko(){var t,e,r;null==(t=this.Go)||t.call(this),this.Go=void 0,null==(e=this.Qo)||e.call(this),this.Qo=void 0,null==(r=this.Jo)||r.call(this),this.Jo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[iu]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.Xo.consumeRateLimit(n)?Mp.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.ta=[],this.ra=_c(),this._instance=t,this.ta=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(nu))&&void 0!==e?e:[],this.ia=Qn(this.na()),this.sa=new Jn(this.ia)}onConfigChange(){this.ia=Qn(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(t){var e,r,i;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.ta=s,this._instance.persistence&&this._instance.persistence.register({[nu]:this.ta,[su]:o})}}}get oa(){var t,e=!!this._instance.get_property(su),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.ra.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.ia.enabled)try{if(!Mr(t)||0===t.trim().length)return void yc.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>Zn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(this.aa(e)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&yc.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(r({[Wn]:t,[Vn]:(new Date).toISOString()},n))}catch(t){yc.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void yc.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void yc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void yc.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ia.enabled&&Pr(t.$exception_steps)?this.va(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return i&&this.sa.clear(),i}catch(t){return yc.error("Failed to capture exception event. Dropping this exception.",t),void this.sa.clear()}}catch(t){return void yc.error("Failed to process exception event. Ignoring this exception.",t)}}va(t){try{var e=this.sa.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return yc.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ha(t){this.ia.enabled&&this.sa.add({[Wn]:t,[Vn]:(new Date).toISOString()})}aa(t){return Tr(t)?r({},t):{}}na(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}ua(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var r=e.type,i=e.value;return Mr(r)&&r.length>0&&t.$exception_types.push(r),Mr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.ta.some((t=>{var r=t.values.map((t=>{var r,i=mh[t.operator],n=kr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}da(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ca(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],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(t){return!Pr(t)&&kr(t)}}},gg=r({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.fa=null,this.pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var r,i;if(this.mi&&this.mi.register({[lu]:!!e.productTours}),!Bp(this._instance))return!this.fa&&Pr(null==(r=this.mi)?void 0:r.props[$u])||jp.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&&Bp(this._instance)&&this.er((()=>this.ga()))}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?jp.error("Could not load product tours script",e):t()}))}ga(){var t;!this.fa&&null!=(t=ea.__PosthogExtensions__)&&t.generateProductTours&&(this.fa=ea.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!kr(this.pa)||e){var r=this.mi;if(r){var i=r.props[$u];if(kr(i)&&!e)return this.pa=i,void t(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:e=>{if(Bp(this._instance)){var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return jp.error(n),void t([],{isLoaded:!1,error:n})}var s=kr(e.json.product_tours)?e.json.product_tours:[];this.pa=s,r&&r.register({[$u]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pa,{isLoaded:!0})}getActiveProductTours(t){Pr(this.fa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.fa)||e.showTourById(t)}previewTour(t){this.fa?this.fa.previewTour(t):this.er((()=>{var e;this.ga(),null==(e=this.fa)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.fa)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.fa)||t.nextStep()}previousStep(){var t;null==(t=this.fa)||t.previousStep()}clearCache(){var t;this.pa=null,null==(t=this.mi)||t.unregister($u)}resetTour(t){var e;null==(e=this.fa)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.fa)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.fa)||e.cancelPendingTour(t)}}},cg),mg={siteApps:class{constructor(t){this.ma=0,this._instance=t,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(t,e){if(e){var r=this.globalsForEvent(e);this.ya.push(r),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var t;return null==(t=ea._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{t(),this.ya=[],this._a=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)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=t.$set_once,g=t.$set;return{event:r({},i(t,Hp),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}wa(t){var e,r=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(zp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(zp.error("prepare_external_dependency_script returned null"),null):t}xa(){var t,e,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==es?void 0:es.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],d=this,c=new WeakSet,v=(t,e,r)=>{if(null!=t&&t[e]){var i=t[e];t[e]=r(i),h.push((()=>{t[e]=i}))}},f=t=>{if(c.has(t))return t;var e=d.wa(t);return e&&c.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Or(t)));return v(u,"appendChild",(t=>function(e){var r=f(e);return r?t.call(this,r):e})),v(u,"insertBefore",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):e})),v(u,"replaceChild",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):r})),[null==(e=l.Element)?void 0:e.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((t=>{v(t,"append",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"prepend",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.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((t=>{v(t,"before",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"after",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"replaceWith",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:t.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(t=>function(e,r){var i=f(r);return i?t.call(this,e,i):null})),this.ka=()=>{h.forEach((t=>t())),this.ka=void 0},this.Sa()}Sa(){var t=!1;return()=>{var e;t||(t=!0,this.ma--,0===this.ma&&(null==(e=this.ka)||e.call(this)))}}Ca(t,e){void 0===e&&(e=!0);var r=this.xa();try{var i=t(r);return e&&r(),i}catch(t){throw r(),t}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.ya.length&&(zp.info("Processing "+this.ya.length+" events for site app with id "+t.id),this.ya.forEach((t=>this.Ca((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this._a)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,zp.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Ca((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),i=!0}catch(e){zp.error(Wp+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){zp.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}Ta(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}Ia(t){var e=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(t),i=function(i){try{e.Ca((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(e){zp.error("Error while processing event "+t.event+" for site app "+i.id,e)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.Ta(),void this._instance.on("eventCaptured",(t=>this.Ia(t)))):void zp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._a)||r.call(this),t.ok){var s=t.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var t,e=a.id,r=a.url;ea["__$$ph_site_app_"+e]=n._instance,null==(t=ea.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,r,(t=>{if(t)return zp.error(Wp+e,t)}))};for(var a of s.siteApps)o()}else zp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},yg={tracingHeaders:class{constructor(t){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var t,e,r=this.Pa();r?(Ir(this.Ma)&&(this.Ma=null==(t=ea.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Ir(this.Ea)&&(this.Ea=null==(e=ea.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=t}initialize(){this.startIfEnabledOrStop()}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Rp.error("failed to load script",e);t()}))}Oa(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}Pa(){var t=this.Oa();return kr(t)?(kr(this.Ra)?this.Ra.splice(0,this.Ra.length,...t):this.Ra=[...t],t.length>0?this.Ra:void 0):(kr(this.Ra)&&this.Ra.splice(0),this.Ra=t||void 0,this.Ra)}Ko(){var t,e;null==(t=this.Ma)||t.call(this),null==(e=this.Ea)||e.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},_g=r({surveys:class{get Te(){return this._instance.config}constructor(t){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return Ul.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Pr(e))return Ul.warn("Flags not loaded yet. Not loading surveys.");var r=kr(e);this.Fa=r?e.length>0:e,Ul.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Hl)||null!=i&&i.startsWith(zl))&&e.push(i)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.La)Ul.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Ul.info(Kp);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Ul.info("Not loading surveys in cookieless mode without consent.");else{var t=null==ea?void 0:ea.__PosthogExtensions__;if(t){if(!Ir(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var r=t.generateSurveys;if(r)return void this.Da(r,e);var i=t.loadExternalDependency;if(!i)return void this.qa(Ju);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.qa("Could not load surveys script",r):this.Da(t.generateSurveys,e)}))}catch(t){throw this.qa("Error initializing surveys",t),t}finally{this.La=!1}}}else Ul.error("PostHog Extensions not found.")}}Da(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Qp(this._instance),Ul.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(t,e){Ul.error(t,e),this.ja({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.$a.push(t),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Te.disable_surveys)return Ul.info(Kp),t([]);var r,i=this._instance.get_property(Mu);if(i&&!e)return t(i,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.Aa?this.Aa.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.Aa=new Promise((t=>{r=t}))),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:e=>{var i;this.Aa=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Ul.error(s),this.Na=Date.now();var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}this.Na=null;var a,l=e.json.surveys||[],u=l.filter((t=>jl(t)&&(Dl(t)||Bl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[Mu]:l,[Ru]:Date.now()});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var t=this._instance.get_property(Ru);return $r(t)&&Date.now()-t>3e5}Ua(){return $r(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(t,e){var r,i={id:t,current_iteration:null!==(r=null==e?void 0:e.iteration)&&void 0!==r?r:null};Zl(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}ja(t){for(var e of this.$a)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Ul.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Pr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ul.warn("init was not called")}za(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Va(t){if(Pr(this._surveyManager))return{eligible:!1,reason:Jp};var e="string"==typeof t?this.za(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wa(t){if(Pr(this._surveyManager))return{eligible:!1,reason:Jp};var e="string"==typeof t?this.za(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Pr(this._surveyManager))return Ul.warn("init was not called"),{visible:!1,disabledReason:Jp};var e=this.Wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Pr(this._surveyManager)?(Ul.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Jp})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&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"})}),e)}))}renderSurvey(t,e,r){var i;if(Pr(this._surveyManager))Ul.warn("init was not called");else{var n="string"==typeof t?this.za(t):t;if(null!=n&&n.id)if(Gl.includes(n.type)){var s=null==es?void 0:es.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Ul.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Ul.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Ul.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Ul.warn("Survey element not found")}else Ul.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ul.warn("Survey not found")}}displaySurvey(t,e){var i;if(Pr(this._surveyManager))Ul.warn("init was not called");else{var n=this.za(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Ml.Popover&&e.initialResponses&&Ul.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.Va(n);if(!o.eligible)return void Ul.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==Ml.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Ul.warn("Survey not found")}}cancelPendingSurvey(t){Pr(this._surveyManager)?Ul.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},cg),bg={toolbar:class{constructor(t){this.instance=t}Za(t){ea.ph_toolbar_state=t}Ga(){var t;return null!==(t=ea.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),ks(this.instance.config))return!1;if(!Yn||!es)return!1;t=null!=t?t:Yn.location,r=null!=r?r:Yn.history;try{if(!e){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(t){return!1}e=null==Yn?void 0:Yn.localStorage}var i,n=Yp||Rs(t.hash,"__posthog")||Rs(t.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?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Xp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}Qa(t){var e=ea.ph_load_toolbar||ea.ph_load_editor;!Pr(e)&&Cr(e)?e(t,this.instance):tg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==es||!es.getElementById(Ds));if(!Yn||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yn.localStorage.setItem(Xp,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=ea.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return tg.error("[Toolbar] Failed to load",t),void this.Za(0);this.Za(2),this.Qa(n)})),Ss(Yn,"turbolinks:load",(()=>{this.Za(0),this.loadToolbar(n)}))}return!0}Ja(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},wg=r({experiments:lg},cg),xg={conversations:class{constructor(t){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Pr(e)||(Ar(e)?this.Ka=e:(this.Ka=e.enabled,this.Xa=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||ks(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==ea?void 0:ea.__PosthogExtensions__;if(t&&!Ir(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var e=t.initConversations;if(e)return this.el(e),void(this.Ya=!1);var r=t.loadExternalDependency;if(!r)return void this.tl(Ju);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.tl("Could not load conversations script",e):this.el(t.initConversations),this.Ya=!1}))}catch(t){this.tl("Error initializing conversations",t),this.Ya=!1}}else ug.error("Conversations enabled but missing token in remote config.")}}el(t){if(this.Xa)try{this._conversationsManager=t(this.Xa,this._instance),ug.info("Conversations loaded successfully")}catch(t){this.tl("Error completing conversations initialization",t)}else ug.error("Cannot complete initialization: remote config is null")}tl(t,e){ug.error(t,e),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():ug.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ka&&!Or(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(ug.warn(hg),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(ug.warn(hg),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(ug.warn(hg),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(ug.warn(hg),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(ug.warn(hg),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(ug.warn(hg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ug.warn(hg),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}En(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Rn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Sg={logs:class{constructor(t){var e;this.rl=!1,this.il=!1,this.Ge=vs("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var t,e;this.Hs=0,null==(t=this.ol)||t.onReconnect(),null==(e=this.al)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.rl=!0),Yn&&Ss(Yn,"online",this.sl)}ll(t,e,r,i){var n,s=function(t,e){var r,i,n,s,o,a,l,u=null!==(r=null==t?void 0:t.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==t?void 0:t.maxBufferSize)&&void 0!==i?i:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Ir(d)?Math.max(h,2048):Math.max(h,d),v=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:v,beforeSend:null==t?void 0:t.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(t,e),s,this.Ge,(()=>this.hl()),(t=>t()),void 0,i),s]}dl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.ol||this.cl!==e){var r;null==(r=this.ol)||r.reset(),this.cl=e;var i=this.ll((()=>this.Gr),(t=>{this.Gr=t}));this.ol=i[0],this.vl=i[1]}return this.ol}fl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.al||this.pl!==e){var r;null==(r=this.al)||r.reset(),this.pl=e;var i=this.ll((()=>this.nl),(t=>{this.nl=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},dg);this.al=i[0],this.gl=i[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var r=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!Pr(r)&&r&&(this.rl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],null==(t=this.ol)||t.reset(),this.nl=[],null==(e=this.al)||e.reset(),this.Hs=0}captureLog(t){this.dl().captureLog(t)}le(t){this.fl().captureLog(t)}get logger(){return this.ml||(this.ml={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.ml}flushLogs(t){t?this.yl(t):(this.ol&&this.ol.flush().catch((t=>this.Ge.error("PostHog logs flush failed:",t))),this.al&&this.al.flush().catch((t=>this.Ge.error("PostHog logs flush failed:",t))))}loadIfEnabled(){if(this.rl&&!this.il){var t=null==ea?void 0:ea.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.Ge.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.il=!0)})):this.Ge.error(Ju)}else this.Ge.error("PostHog Extensions not found.")}}ul(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:e=>e===rr.LogsQueue?t():void 0,setPersistedProperty(t,r){var i;t===rr.LogsQueue&&e(null!==(i=r)&&void 0!==i?i:[])},Tt:t=>this.Tt(t),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Tt(t){return new Promise((e=>{if(Os(this.Hs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,i=t=>{r||(r=!0,clearTimeout(n),e(t))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.bl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this._l(e),e>=200&&300>e)i({kind:"ok"});else if(413===e)i({kind:"too-large"});else if(0!==e&&429!==e&&500>e)i({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var r;i({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("logs request failed with status "+e)})}}})}}))}_l(t){(0!==t||this._instance.__loaded)&&(this.Hs=Ps(t,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(t){this.Gr.length>0&&this.wl(t,this.Gr,this.vl,hs.LIB_NAME,(t=>{this.Gr=t})),this.nl.length>0&&this.wl(t,this.nl,this.gl,dg,(t=>{this.nl=t}))}wl(t,e,r,i,n){if(0!==e.length){var s=e.map((t=>t.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:t})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){var t,e={};if(e.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;e.sessionId=r.sessionId,e.windowId=i,Pr(n)||(e.sessionStartTimestamp=n),Pr(s)||(e.lastActivityTimestamp=s)}if(null!=ea&&null!=(t=ea.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?tn(ea.location.href):ea.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},kg={metrics:class{constructor(t){this.Ge=vs("[metrics]"),this._instance=t}initialize(){}dl(){var t,e,r=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.ol&&this.cl===r||(null==(e=this.ol)||e.reset(),this.cl=r,this.ol=new pn(this.ul(),function(t){var e,r,i,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==t?void 0:t.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.Ge)),this.ol}count(t,e,r){void 0===e&&(e=1),this.dl().count(t,e,r)}gauge(t,e,r){this.dl().gauge(t,e,r)}histogram(t,e,r){this.dl().histogram(t,e,r)}flush(t){if(!this.ol)return Promise.resolve();if(t){var e=this.ol.drainWindow();return e&&this.Bt(e,t),Promise.resolve()}return this.ol.flush().catch((t=>this.Ge.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.ol)||t.reset()}ul(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Bt:t=>e.Bt(t),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Bt(t,e){return new Promise((i=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(o),i(t))},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:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var r;s({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("metrics request failed with status "+e)})}}}))}))}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Cg=r({},cg,vg,fg,pg,gg,mg,_g,yg,bg,wg,xg,Sg,kg);Ip.__defaultExtensionClasses=r({},Cg);var Tg=function(){hs.SDK_DIST_CHANNEL="npm";var t=fp[xp]=new Ip;return function(){function t(){t.done||(t.done=!0,Sp=!1,ps(fp,(function(t){t._dom_loaded()})))}null!=es&&es.addEventListener?"complete"===es.readyState?t():Ss(es,"DOMContentLoaded",t,{capture:!1}):Yn&&cs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{yl as Compression,Gv as DEFAULT_PRODUCT_TOUR_APPEARANCE,Ml as DisplaySurveyType,Ip as PostHog,Qv as ProductTourEventName,Jv as ProductTourEventProperties,El as SurveyEventName,Il as SurveyEventProperties,_l as SurveyEventType,wl as SurveyPosition,Cl as SurveyQuestionBranchingType,kl as SurveyQuestionType,Tl as SurveySchedule,xl as SurveyTabPosition,Sl as SurveyType,bl as SurveyWidgetType,Tg as default,Tg as posthog,ef as severityLevels};
1
+ function t(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(l||{}),u=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(u||{}),h=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),c=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(c||{}),v=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(v||{}),f=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(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(t){if(m[t])return m[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in g?g[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return m[t]=e.prototype,e.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 e.prototype;var d=h[t].prototype;return d?((l=navigator.userAgent).includes("Safari")&&!l.includes("Chrome")&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),u=!0),m[t]=d):r}catch(t){return r}finally{!u&&a.parentNode&&document.body.removeChild(a)}}var _={};function b(t,e,r){var i,n=t+"."+String(r);if(_[n])return _[n].call(e);var s=y(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(_[n]=o,o.call(e)):e[r]}var w={};function x(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"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 t[e]=n.next}}catch(t){return()=>{}}}var C={childNodes:t=>b("Node",t,"childNodes"),parentNode:t=>b("Node",t,"parentNode"),parentElement:t=>b("Node",t,"parentElement"),textContent:t=>b("Node",t,"textContent"),contains:(t,e)=>x("Node",t,"contains")(e),getRootNode:t=>x("Node",t,"getRootNode")(),host:t=>t&&"host"in t?b("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?b("Element",t,"shadowRoot"):null,querySelector:(t,e)=>x("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>x("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:k};function T(t){return t.nodeType===t.ELEMENT_NODE}function E(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function I(t){return"[object ShadowRoot]"==={}.toString.call(t)}function M(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>R(t,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(t){return null}var i}function R(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=M(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return j(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?j(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),T(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function P(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&L(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function L(t){return t.toLowerCase()}var A="__rrweb_original__";function F(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}catch(t){return null}}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,U=/^(data:)([^,]*),(.*)/i;function j(t,e){return(t||"").replace(N,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(D.test(l)||q.test(l))return"url("+u+l+u+")";if(U.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.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,H,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,V=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return V++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=Y.get(t);if(r||(r=t.createElement("a"),Y.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?z:t}(t,e.maxBase64ImageLength):t}function rt(t,e,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=X(t,i);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>W||t.naturalHeight>W)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,l,s.type,s.quality)),et(u,s)}if("image"===e)return et(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=X(t,i);return"image"===e&&h.startsWith("data:")?et(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),e.length>r;){var s=i(J);if(","===s.slice(-1))s=X(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(t,s);for(var a=!1;;){var l=e.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(", ")}(t,i):"style"===r?j(i,tt(t)):"object"===e&&"data"===r?X(t,i):i:X(t,i)}function it(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function nt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&nt(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&nt(C.parentNode(t),e,r)}function st(t,e,r,i){var n;if(T(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(nt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function ot(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var at=new Map;function lt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function ut(t){return null==t?"":t.toLowerCase()}var ht=50,dt=!1,ct=!1;function vt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,_=void 0===y?{}:y,b=e.inlineImages,w=void 0!==b&&b,x=e.recordCanvas,S=void 0!==x&&x,k=e.onSerialize,R=e.onIframeLoad,O=e.iframeLoadTimeout,N=void 0===O?5e3:O,D=e.onIframeListenerRegistered,q=e.onStylesheetLoad,U=e.stylesheetLoadTimeout,z=void 0===U?5e3:U,W=e.keepIframeSrcFn,V=void 0===W?()=>!1:W,J=e.newlyAddedElement,K=void 0!==J&&J,Y=e.depth,X=void 0===Y?0:Y,et=e.maxDepth,nt=void 0===et?ht:et,ft=e.needsMask,pt=e.preserveWhiteSpace,gt=void 0===pt||pt;if(X>=nt)return ct=!0,dt||(dt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+nt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;ft||(ft=st(t,o,a,void 0===ft));var mt,yt=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.keepIframeSrcFn,m=e.newlyAddedElement,y=void 0!==m&&m,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,o=e.doc,a=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.keepIframeSrcFn,m=e.newlyAddedElement,y=void 0!==m&&m,_=e.rootId,b=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),w=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return Z.test(e)?"div":e}(t),x={},S=t.attributes.length,k=0;S>k;k++){var T=t.attributes[k];it(w,T.name)||(x[T.name]=rt(o,w,L(T.name),T.value,t,c))}if("link"===w&&a){var E=t.sheet;if(!E){var I=function(t){return t.href}(t);I&&!(E=lt(o,I))&&I.includes(".css")&&(E=lt(o,window.location.origin+"/"+I.replace(window.location.href,"")))}var R=null;E&&(R=M(E)),R&&(delete x.rel,delete x.href,x._cssText=R)}if("style"===w&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var O=M(t.sheet);O&&(x._cssText=O)}if("input"===w||"textarea"===w||"select"===w){var N=t.value,D=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&N?x.value=P({element:t,type:F(t),tagName:w,value:N,maskInputOptions:u,maskInputFn:h}):D&&(x.checked=D)}if("option"===w&&(t.selected&&!u.select?x.selected=!0:delete x.selected),"dialog"===w&&t.open)try{x.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){x.rr_open_mode="modal",x.ph_rr_could_not_detect_modal=!0}if("canvas"===w&&p)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((A in n?n[A]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var q=t.toDataURL(c.type,c.quality),U=o.createElement("canvas");U.width=t.width,U.height=t.height,q!==U.toDataURL(c.type,c.quality)&&(x.rr_dataURL=q)}if("img"===w&&v){B||(B=o.createElement("canvas"),H=B.getContext("2d"));var j=t,z=j.currentSrc||j.getAttribute("src")||"<unknown-src>",W=j.crossOrigin,V=()=>{ot(j,"load",V);try{B.width=j.naturalWidth,B.height=j.naturalHeight,H.drawImage(j,0,0),x.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+z+"! Error: "+t)}"anonymous"===j.crossOrigin&&(W?x.crossOrigin=W:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===w||"video"===w){var G=x;G.rr_mediaState=t.paused?"paused":"played",G.rr_mediaCurrentTime=t.currentTime,G.rr_mediaPlaybackRate=t.playbackRate,G.rr_mediaMuted=t.muted,G.rr_mediaLoop=t.loop,G.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop)),b){var Q=t.getBoundingClientRect(),J=Q.width,K=Q.height,Y=Q.left,X=Q.top,tt=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);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"},tt&&(x.rr_position=tt.position||"static",tt.transform&&"none"!==tt.transform&&(x.rr_transform=tt.transform),tt.display&&tt.display.startsWith("inline")&&(x.rr_display=tt.display))}"iframe"!==w||g(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);try{customElements.get(w)&&(s=!0)}catch(t){}return{type:f.Element,tagName:w,attributes:x,childNodes:[],isSVG:(et=t,Boolean("svg"===et.tagName||et.ownerSVGElement)||void 0),needBlock:b,rootId:_,isCustom:s};var et}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:y,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,o=C.parentNode(t),a=o&&o.tagName,l=C.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=M(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=j(l,tt(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:_,inlineImages:w,recordCanvas:S,keepIframeSrcFn:V,newlyAddedElement:K});if(!yt)return console.warn(t,"not serialized"),null;mt=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){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}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(ut(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ut(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(ut(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&ut(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ut(t.attributes.property).match(/^(og|twitter|fb):/)||ut(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===ut(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(ut(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(ut(t.attributes.name))||ut(t.attributes.property).match(/^article:/)||ut(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(ut(t.attributes.name)))return!0}}return!1}(yt,m)||!gt&&yt.type===f.Text&&!yt.isStyle&&!yt.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var _t=Object.assign(yt,{id:mt});if(i.add(t,_t),mt===G)return null;k&&k(t);var bt=!u;if(_t.type===f.Element){bt=bt&&!_t.needBlock,delete _t.needBlock;var wt=C.shadowRoot(t);wt&&I(wt)&&(_t.isShadowHost=!0)}if((_t.type===f.Document||_t.type===f.Element)&&bt){m.headWhitespace&&_t.type===f.Element&&"head"===_t.tagName&&(gt=!1);var xt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:_,inlineImages:w,recordCanvas:S,preserveWhiteSpace:gt,onSerialize:k,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:V,depth:X+1,maxDepth:nt};if(_t.type===f.Element&&"textarea"===_t.tagName&&void 0!==_t.attributes.value);else for(var St of Array.from(C.childNodes(t))){var kt=vt(St,xt);kt&&_t.childNodes.push(kt)}var Ct=null;if(T(t)&&(Ct=C.shadowRoot(t)))for(var Tt of Array.from(C.childNodes(Ct))){var Et=vt(Tt,xt);Et&&(I(Ct)&&(Et.isShadow=!0),_t.childNodes.push(Et))}}var It=C.parentNode(t);if(It&&E(It)&&I(It)&&(_t.isShadow=!0),_t.type===f.Element&&"iframe"===_t.tagName){var Mt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),ot(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,r),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?ot(t,"load",o):(a=!0,ot(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),ot(t,"load",o)}}return t.addEventListener("load",o),()=>{ot(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&R){var r=vt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:_,inlineImages:w,recordCanvas:S,preserveWhiteSpace:gt,onSerialize:k,onIframeLoad:R,iframeLoadTimeout:N,onIframeListenerRegistered:D,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:V,depth:X+1,maxDepth:nt});r&&R(t,r)}}),N);null==D||D(t,Mt)}return _t.type===f.Element&&"link"===_t.tagName&&"stylesheet"===_t.attributes.rel&&function(e,l,u){if(!at.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(q){var e=vt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:ft,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:_,inlineImages:w,recordCanvas:S,preserveWhiteSpace:gt,onSerialize:k,onIframeLoad:R,iframeLoadTimeout:N,onStylesheetLoad:q,stylesheetLoadTimeout:z,keepIframeSrcFn:V,depth:X,maxDepth:nt});e&&q(t,e)}})()}finally{at.delete(e),c.abort()}}},b=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(b)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),at.set(e,c)}}}(t,0,z),_t}function ft(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class pt{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof pt))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function gt(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>mt(r,t,e,i)}function mt(t,e,r,i){yt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function yt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var _t="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.",bt={map:{},getId(){return console.error(_t),-1},getNode(){return console.error(_t),null},removeNodeFromMap(){console.error(_t)},has(){return console.error(_t),!1},reset(){console.error(_t)}};function wt(t,e,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=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function xt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>xt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(bt=new Proxy(bt,{get(t,e,r){return"map"===e&&console.error(_t),Reflect.get(t,e,r)}}));var St=Date.now;function kt(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=C.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.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 Ct(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Tt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Et(t){return t?t.nodeType===t.ELEMENT_NODE?t:C.parentElement(t):null}function It(t,e,r,i){if(!t)return!1;var n=Et(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(nt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Mt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===G}function Rt(t,e){if(E(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Rt(i,e))}function Ot(t){return Boolean(t.changedTouches)}function Pt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function $t(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Lt(t){return!!t&&(t instanceof pt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(St=()=>(new Date).getTime());class At{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ft(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function Nt(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ft(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function Dt(t){return"__ln"in t}class qt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Dt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Dt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var Ut,jt=(t,e)=>t+"@"+e;class Bt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new qt,i=t=>{for(var e=t,r=G;r===G;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&Nt(n)&&"TEXTAREA"!==s.tagName){var o=E(s)?this.mirror.getId(Ft(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=vt(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:t=>{Pt(t,this.mirror)&&this.iframeManager.addIframe(t),$t(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Lt(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)zt(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Wt(this.droppedSet,o)||zt(this.removesSubTreeCache,o)?Wt(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((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(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",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:F(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Mt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);It(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:st(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Et(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=F(r);n=P({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(It(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!it(r.tagName,i))if(o.attributes[i]=rt(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(a.style.cssText=t.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(It(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=E(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);It(t.target,this.blockClass,this.blockSelector,!1)||Mt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Ht(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Rt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[jt(r,i)]?Ht(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!E(t.target)||!I(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Mt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[jt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);It(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Lt(t)&&C.childNodes(C.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),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 Ht(t,e){t.delete(e),C.childNodes(e).forEach((e=>Ht(t,e)))}function zt(t,e,r){return 0!==t.size&&function(t,e,r){var i=C.parentNode(e);return!!i&&t.has(i)}(t,e)}function Wt(t,e){return 0!==t.size&&Vt(t,e)}function Vt(t,e){var r=C.parentNode(e);return!!r&&(!!t.has(r)||Vt(t,r))}var Zt=t=>Ut?function(){try{return t(...arguments)}catch(t){if(Ut&&!0===Ut(t))return;throw t}}:t,Gt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Jt(t,e){var r=new Bt;Gt.push(r),r.init(t);var i=new(S())(Zt(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function Kt(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Qt(t);if(o&&!It(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=kt(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),e({id:h,x:l,y:u}))}},u=[gt("scroll",Zt(wt(Zt((t=>l(t))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(gt("scrollend",Zt(l),r)),()=>u.forEach((t=>t()))}function Yt(t,e){for(var r=Gt.length-1;r>=0;r--){var i=Gt[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Gt.splice(r,1))}}}var Xt=["INPUT","TEXTAREA","SELECT"],te=new WeakMap;function ee(t){return function t(e,r){if(se("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||se("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||se("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||se("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function re(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function ie(t,e){var r,i,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:C.host(e));var a="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.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(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),Zt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function ne(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var o=Jt(t,t.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,_,b=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.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=wt(Zt((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),d=Zt(wt(Zt((t=>{var e=Qt(t),r=Ot(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;s||(s=St()),l.push({x:i,y:o,id:n.getId(e),timeOffset:St()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[gt("mousemove",d,i),gt("touchmove",d,i),gt("drag",d,i)];return Zt((()=>{c.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.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((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=L(t),l=(t=>i=>{var a=Qt(i);if(!It(a,s,o,!0)){var l=null,u=t;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[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Ot(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=c,c=null);var v=Ot(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;Zt(e)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(gt(a,l,i))})),Zt((()=>{u.forEach((t=>t()))}))}(t),x=Kt(t),S=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return gt("resize",Zt(wt(Zt((()=>{var t=Ct(),e=Tt();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),T=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Qt(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=C.parentElement(e)),e&&c&&Xt.indexOf(c)>=0&&!It(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=F(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[c.toLowerCase()]||u[g])&&(f=P({element:e,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=te.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){te.set(t,i);var o=n.getId(t);Zt(e)(r({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>gt(t,Zt(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};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((t=>xt(t[0],t[1],{set(){Zt(c)({target:this,isTrusted:!1})}},!1,p)))),Zt((()=>{f.forEach((t=>t()))}))}(t),E=(l=(a=t).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=Zt((t=>wt(Zt((e=>{var r=Qt(e);if(r&&!It(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),_=[gt("play",y(v.Play),m),gt("pause",y(v.Pause),m),gt("seeked",y(v.Seeked),m),gt("volumechange",y(v.VolumeChange),m),gt("ratechange",y(v.RateChange),m)],Zt((()=>{_.forEach((t=>t()))}))),I=()=>{},M=()=>{},R=()=>{},O=()=>{};t.recordDOM&&(I=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Zt(((t,e,s)=>{var o=s[0],a=s[1],l=re(e,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}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};oe("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(oe("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),oe("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),oe("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Zt(((t,e,s)=>{var o=s[0],a=s[1],l=re(e.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:[...ee(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Zt(((t,e,s)=>{var o=s[0],a=re(e.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...ee(e),o]}]}),t.apply(e,s)}))})})),Zt((()=>{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((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),M=ie(t,t.doc),R=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Zt(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(e,[u,h,d]);var c=re(null==(l=e.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:ee(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Zt(((t,e,o)=>{var a,u=o[0];if(n.has(u))return l.apply(e,[u]);var h=re(null==(a=e.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:ee(e.parentRule)}),t.apply(e,o)}))}),Zt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(O=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=k(r.fonts,"add",(function(t){return function(r){return setTimeout(Zt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Zt((()=>{n.forEach((t=>t()))}))}(t)));var A=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Zt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;It(d,i,n,!0)||It(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),gt("selectionchange",a)}(t),N=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?k(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),D=[];for(var q of t.plugins)D.push(q.observer(q.callback,s,q.options));return Zt((()=>{if(n){n.destroy(),n.reset();var e=Gt.indexOf(n);-1!==e&&Gt.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),b(),w(),x(),S(),T(),E(),I(),M(),R(),O(),A(),N(),D.forEach((t=>t()))}))}function se(t){return void 0!==window[t]}function oe(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ae{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class le{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ae(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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ae(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>yt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{mt(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);yt((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}yt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(mt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(mt(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((t=>{yt((()=>this.mirror.removeNodeFromMap(t)))})),yt((()=>Yt(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&mt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{mt(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),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 ue{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,n;if(I(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=C.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,o=Jt(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=Gt.indexOf(l);-1!==t&&Gt.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Kt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(C.host(t))),this.restoreHandlers.push({doc:s,handler:ie({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:k(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=C.shadowRoot(this);return s&&Nt(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}for(var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",de="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ce=0;64>ce;ce++)de[he.charCodeAt(ce)]=ce;var ve=new Map,fe=(t,e,r)=>{if(t&&(me(t,e)||"object"==typeof t)){var i=function(t,e){var r=ve.get(t);return r||ve.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function pe(t,e,r,i){if(t instanceof Array)return t.map((t=>pe(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=he[r[e]>>2],n+=he[(3&r[e])<<4|r[e+1]>>4],n+=he[(15&r[e+1])<<2|r[e+2]>>6],n+=he[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[pe(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[pe(t.data,e,r,i),t.width,t.height]}:me(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:fe(t,e,r)}:t}var ge=(t,e,r,i)=>t.map((t=>pe(t,e,r,i))),me=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},ye=["webgl","webgl2"];function _e(t){return"nodeType"in t}function be(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return k(n.prototype,"configure",(function(n){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||_e(o)&&It(o,e,i,!0))return n.call(this,s);_e(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=k(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!It(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&ye.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 t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function we(t,e,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=k(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(fe(d,s,this),"tagName"in this.canvas&&!It(this.canvas,i,n,!0)){var c=ge(u,s,this,o);r(this.canvas,{type:e,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=xt(t,l,{set(t){r(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var xe,Se,ke,Ce='(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',Te="undefined"!=typeof self&&self.Blob&&new Blob([Ce],{type:"text/javascript;charset=utf-8"});function Ee(t){var e;try{if(!(e=Te&&(self.URL||self.webkitURL).createObjectURL(Te)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ce),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ie{constructor(t){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",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale;this.mutationCb=t.mutationCb,this.mirror=t.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(t,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=be(r,i,n,!0),h=new Map;try{a=new Ee}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a)},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,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/t,p=0,g=t=>{var u,c;d||(p&&f>t-p||(p=t,(u=[],c=t=>{try{t.querySelectorAll("canvas").forEach((t=>{It(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&c(t.shadowRoot)}))}catch(t){}},c(r.document),u).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.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=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=yield createImageBitmap(t,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(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a)}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=be(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=k(e.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 It(this.canvas,r,i,!0)||setTimeout((()=>{var r=ge(l,e,this,n);t(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=xt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:c["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...we(e.WebGLRenderingContext.prototype,c.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...we(e.WebGL2RenderingContext.prototype,c.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Me{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new At),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:R(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,at.forEach((t=>t.abort())),at.clear()}trackStylesheetInLinkElement(t){}}class Re{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var $e=new O,Le=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function Ae(t){void 0===t&&(t={});var e=t,i=e.emit,n=e.checkoutEveryNms,s=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,h=e.blockSelector,d=void 0===h?null:h,c=e.ignoreClass,v=void 0===c?"rr-ignore":c,f=e.ignoreSelector,p=void 0===f?null:f,g=e.maskTextClass,m=void 0===g?"rr-mask":g,y=e.maskTextSelector,_=void 0===y?null:y,b=e.inlineStylesheet,w=void 0===b||b,x=e.maskAllInputs,S=e.maskInputOptions,k=e.slimDOMOptions,T=e.maskInputFn,E=e.maskTextFn,I=e.hooks,M=e.packFn,R=e.sampling,P=void 0===R?{}:R,L=e.dataURLOptions,A=void 0===L?{}:L,F=e.canvasResolutionScale,N=e.mousemoveWait,D=e.recordDOM,q=void 0===D||D,U=e.recordCanvas,j=void 0!==U&&U,B=e.recordCrossOriginIframes,H=void 0!==B&&B,z=e.recordAfter,W=void 0===z?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":z,V=e.userTriggeredOnInput,Z=void 0!==V&&V,G=e.collectFonts,Q=void 0!==G&&G,J=e.inlineImages,K=void 0!==J&&J,Y=e.plugins,X=e.keepIframeSrcFn,tt=void 0===X?()=>!1:X,et=e.ignoreCSSAttributes,rt=void 0===et?new Set([]):et,it=e.attributeFilter;Ut=e.errorHandler;var nt=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},A),st=!H||window.parent===window,ot=!1;if(!st)try{window.parent.document&&(ot=!1)}catch(t){ot=!0}if(st&&!i)throw new Error("emit function is required");if(!st&&!ot)return()=>{};void 0!==N&&void 0===P.mousemove&&(P.mousemove=N),$e.reset();var at,lt=!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!==S?S:{password:!0},ut=ft(void 0!==k&&k);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var ht,dt,ct=0,pt=new Map,mt=t=>{for(var e of Y||[])e.eventProcessor&&(t=e.eventProcessor(t));return M&&!ot&&(t=M(t)),t};xe=(t,e)=>{var r,o=t;if(o.timestamp=St(),!(null==(r=Gt[0])?void 0:r.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&Le.has(o.data.source)||Gt.forEach((t=>t.unfreeze())),st)null==i||i(mt(o),e);else if(ot){var a={type:"rrweb",event:mt(o),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)at=o,ct=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;ct++,(s&&ct>=s||n&&o.timestamp-at.timestamp>n)&&Se(!0)}};var _t=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=$e.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Et.getIframeElementById(r);n&&i.has(n)?Et.forgetIframeId(r):(null==ht||ht(r),Et.removeIframeById(r))}})),null==dt||dt(),Et.cleanupDetachedIframes()}xe({type:l.IncrementalSnapshot,data:r({source:u.Mutation},t)})},bt=t=>xe({type:l.IncrementalSnapshot,data:r({source:u.Scroll},t)}),wt=t=>xe({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),xt=new Me({mutationCb:_t,adoptedStyleSheetCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Et=new le({mirror:$e,mutationCb:_t,stylesheetManager:xt,recordCrossOriginIframes:H,wrappedEmit:xe});for(var It of Y||[])It.getMirror&&It.getMirror({nodeMirror:$e,crossOriginIframeMirror:Et.crossOriginIframeMirror,crossOriginIframeStyleMirror:Et.crossOriginIframeStyleMirror});var Mt=new Re;ke=new Ie({recordCanvas:j,mutationCb:wt,win:window,blockClass:a,blockSelector:d,mirror:$e,sampling:P.canvas,dataURLOptions:nt,resolutionScale:F});var Rt=new ue({mutationCb:_t,scrollCb:bt,bypassOptions:{blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:_,inlineStylesheet:w,maskInputOptions:lt,dataURLOptions:nt,maskTextFn:E,maskInputFn:T,recordCanvas:j,inlineImages:K,sampling:P,slimDOMOptions:ut,iframeManager:Et,stylesheetManager:xt,canvasManager:ke,keepIframeSrcFn:tt,processedNodeManager:Mt,attributeFilter:it},mirror:$e});Se=function(t){if(void 0===t&&(t=!1),q){xe({type:l.Meta,data:{href:window.location.href,width:Tt(),height:Ct()}},t),xt.reset(),Rt.init(),Gt.forEach((t=>t.lock()));var e=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new O: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,_=r.onSerialize,b=r.onIframeLoad,w=r.iframeLoadTimeout,x=r.onIframeListenerRegistered,S=r.onStylesheetLoad,k=r.stylesheetLoadTimeout,C=r.keepIframeSrcFn,T=void 0===C?()=>!1:C,E=r.maxDepth;return vt(t,{doc:t,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:ft(void 0!==g&&g),dataURLOptions:m,inlineImages:d,recordCanvas:v,preserveWhiteSpace:y,onSerialize:_,onIframeLoad:b,iframeLoadTimeout:w,onIframeListenerRegistered:x,onStylesheetLoad:S,stylesheetLoadTimeout:k,keepIframeSrcFn:T,newlyAddedElement:!1,maxDepth:E})}(document,{mirror:$e,blockClass:a,blockSelector:d,maskTextClass:m,maskTextSelector:_,inlineStylesheet:w,maskAllInputs:lt,maskTextFn:E,maskInputFn:T,slimDOM:ut,dataURLOptions:nt,recordCanvas:j,inlineImages:K,onSerialize(t){Pt(t,$e)&&Et.addIframe(t),$t(t,$e)&&xt.trackLinkElement(t),Lt(t)&&Rt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){Et.attachIframe(t,e),Rt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Et.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){xt.attachLinkElement(t,e)},keepIframeSrcFn:tt});if(!e)return console.warn("Failed to snapshot the document");xe({type:l.FullSnapshot,data:{node:e,initialOffset:kt(window)}},t),Gt.forEach((t=>t.unlock())),H&&Et.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&xt.adoptStyleSheets(document.adoptedStyleSheets,$e.getId(document))}};try{var Ot=[];ht=t=>{var e=pt.get(t);e&&(e.forEach((t=>{yt(t);var e=Ot.indexOf(t);-1!==e&&Ot.splice(e,1)})),pt.delete(t))},dt=()=>{for(var t of pt){var e=t[0],r=$e.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==ht||ht(e)}catch(t){null==ht||ht(e)}else null==ht||ht(e)}};var At=t=>{var e;return Zt(ne)({mutationCb:_t,mousemoveCb:(t,e)=>xe({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:bt,viewportResizeCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:wt,fontCb:t=>xe({type:l.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){xe({type:l.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){xe({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:a,ignoreClass:v,ignoreSelector:p,maskTextClass:m,maskTextSelector:_,maskInputOptions:lt,inlineStylesheet:w,sampling:P,recordDOM:q,recordCanvas:j,inlineImages:K,userTriggeredOnInput:Z,collectFonts:Q,doc:t,maskInputFn:T,maskTextFn:E,keepIframeSrcFn:tt,blockSelector:d,slimDOMOptions:ut,dataURLOptions:nt,mirror:$e,iframeManager:Et,stylesheetManager:xt,shadowDomManager:Rt,processedNodeManager:Mt,canvasManager:ke,ignoreCSSAttributes:rt,attributeFilter:it,plugins:(null==(e=null==Y?void 0:Y.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>xe({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},I)};Et.addLoadListener((t=>{try{var e=$e.getId(t),r=At(t.contentDocument);if(Ot.push(r),-1!==e){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Et.addPageHideListener((t=>{var e=$e.getId(t);null==ht||ht(e),Yt(t)}));var Ft=-1,Nt=t=>xe({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Dt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?$e.getId(s):-1;o!==Ft&&(-1!==Ft&&Nt({id:Ft,enter:!1}),Ft=o,-1!==o&&Nt({id:o,enter:!0}))},qt=()=>{Se(),Ot.push(At(document)),Ot.push(gt("fullscreenchange",Dt)),Ot.push(gt("webkitfullscreenchange",Dt)),Ot.push(gt("mozfullscreenchange",Dt)),Ot.push(gt("MSFullscreenChange",Dt)),Oe=!0};return["interactive","complete"].includes(document.readyState)?qt():(Ot.push(gt("DOMContentLoaded",(()=>{xe({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===W&&qt()}))),Ot.push(gt("load",(()=>{xe({type:l.Load,data:{}}),"load"===W&&qt()}),window))),()=>{Ot.forEach((t=>yt(t))),Mt.destroy(),Et.removeLoadListener(),Et.destroy(),pt.clear(),Rt.reset(),$e.reset(),Oe=!1,Ut=void 0}}catch(t){console.warn(t)}}Ae.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");xe({type:l.Custom,data:{tag:t,payload:e}})},Ae.freezePage=()=>{Gt.forEach((t=>t.freeze()))},Ae.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");Se(t)},Ae.mirror=$e;var Fe=Object.defineProperty,Ne=(t,e,r)=>((t,e,r)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class De{constructor(t){Ne(this,"fileName"),Ne(this,"functionName"),Ne(this,"lineNumber"),Ne(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var qe=/(^|@)\S+:\d+/,Ue=/^\s*at .*(\S+:\d+|\(native\))/m,je=/^(eval@)?(\[native code])?$/,Be={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ue)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ue)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).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 De({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(je)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new De({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new De({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new De({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new De({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(qe)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new De({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function He(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.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(t)+")"),e=r+(e?">"+e:""),t=i}return e}function ze(t){return Array.isArray(t)}function We(t){return"object"==typeof t&&null!==t&&!ze(t)}function Ve(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(We(t[i])&&Ve(t[i],e-1))return!0;return!1}function Ze(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(We(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||We(o)&&Ve(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=ze(u)?He(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Ge={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 Qe(t,e,r){var i,n=r?Object.assign({},Ge,r):Ge,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=Be.parse(e.error).map((t=>t.toString())),s=[Ze(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[Ze("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Ze("Uncaught (in promise)",n.stringifyOptions),Ze(e.reason,n.stringifyOptions)]);var s=Be.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=Be.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>Ze(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Ze("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Je=t=>({name:"rrweb/console@1",observer:Qe,options:t}),Ke=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Ye(t){return"string"==typeof t||t}function Xe(t){return"string"==typeof t?t:void 0}var tr,er=["$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(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),ir=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),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=t=>t.length>=2&&31===t[0]&&139===t[1],hr=(t,e)=>t===ir.GZipJS||e===ir.GZipJS||"gzip"===e,dr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),cr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=lr,e},vr=function(){var t=e((function*(t,e){18>t.size&&cr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());ur(r)&&8===r[2]||cr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(tr)return tr;tr=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;tr[t]=e>>>0}return tr})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&cr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&cr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function fr(){return fr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield vr(u,n),u}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),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(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return pr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function mr(t,e){return-1!==t.indexOf(e)}var yr=function(t){return t.trim()},_r=function(t){return t.replace(/^\$/,"")};function br(t){var e,r=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(e))return"[Circular]";r.push(e)}return e}})))&&void 0!==e?e:"null"}var wr=Object.prototype,xr=wr.hasOwnProperty,Sr=wr.toString,kr=Array.isArray||function(t){return"[object Array]"===Sr.call(t)},Cr=t=>"function"==typeof t,Tr=t=>t===Object(t)&&!kr(t),Er=t=>{if(Tr(t)){for(var e in t)if(xr.call(t,e))return!1;return!0}return!1},Ir=t=>void 0===t,Mr=t=>"[object String]"==Sr.call(t),Rr=t=>Mr(t)&&0===t.trim().length,Or=t=>null===t,Pr=t=>Ir(t)||Or(t),$r=t=>"[object Number]"==Sr.call(t)&&t==t,Lr=t=>$r(t)&&t>0,Ar=t=>"[object Boolean]"===Sr.call(t),Fr=t=>t instanceof FormData,Nr=t=>mr(or,t),Dr=t=>mr(ar,t);function qr(t){return null===t||"object"!=typeof t}function Ur(t,e){return{}.toString.call(t)==="[object "+e+"]"}function jr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Br=[!0,"true",1,"1","yes"],Hr=t=>mr(Br,t),zr=[!1,"false",0,"0","no"];function Wr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),$r(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Wr(n||r,e,r,i))}class Vr{constructor(t){this.$e={},this.ze=t.ze,this.Ze=Wr(t.bucketSize,0,100,t.Ge),this.Qe=Wr(t.refillRate,0,this.Ze,t.Ge),this.Je=Wr(t.refillInterval,0,864e5,t.Ge)}Ke(t,e){var r=Math.floor((e-t.lastAccess)/this.Je);r>0&&(t.tokens=Math.min(t.tokens+r*this.Qe,this.Ze),t.lastAccess=t.lastAccess+r*this.Je)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),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==(e=this.ze)||e.call(this,t)),0===n.tokens)}stop(){this.$e={}}}var Zr="Mobile",Gr="iOS",Qr="Android",Jr="Tablet",Kr=Qr+" "+Jr,Yr="iPad",Xr="Apple",ti=Xr+" Watch",ei="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",_i="Xbox",bi=Qr+" "+Zr,wi=Zr+" "+ei,xi="Windows",Si=xi+" Phone",ki="Nokia",Ci="Ouya",Ti="Generic",Ei=Ti+" "+Zr.toLowerCase(),Ii=Ti+" "+Jr.toLowerCase(),Mi="Konqueror",Ri="Oculus Browser",Oi="Vivaldi",Pi="Yandex",$i="Whale",Li="DuckDuckGo",Ai="Pale Moon",Fi="Waterfox",Ni="Brave",Di="Google Search App",qi="(\\d+(\\.\\d+)?)",Ui=new RegExp("Version/"+qi),ji=new RegExp(_i,"i"),Bi=new RegExp(yi+" \\w+","i"),Hi=new RegExp(mi+" \\w+","i"),zi=new RegExp(ri+"|PlayBook|BB10","i"),Wi={"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"},Vi=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?Ni:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&mr(t,"GSA/")?Di:mr(t," OPR/")&&mr(t,"Mini")?ci:mr(t," OPR/")?di:zi.test(t)?ri:mr(t,"IE"+Zr)||mr(t,"WPDesktop")?hi:mr(t,"OculusBrowser")?Ri:mr(t,ni)?si:mr(t,vi)||mr(t,"Edg/")?fi:mr(t,Oi+"/")?Oi:mr(t,"YaBrowser/")?Pi:mr(t,$i+"/")?$i:mr(t,Li+"/")||mr(t,"Ddg/")?Li:mr(t,"FBIOS")?"Facebook "+Zr:mr(t,"UCWEB")||mr(t,"UCBrowser")?"UC Browser":mr(t,"CriOS")?li:mr(t,"CrMo")||mr(t,oi)?oi:mr(t,Qr)&&mr(t,ei)?bi:mr(t,"FxiOS")?gi:mr(t.toLowerCase(),Mi.toLowerCase())?Mi:mr(t,Ni+"/")?Ni:((t,e)=>e&&mr(e,Xr)||function(t){return mr(t,ei)&&!mr(t,oi)&&!mr(t,Qr)}(t))(t,e)?mr(t,Zr)?wi:ei:mr(t,"PaleMoon/")?Ai:mr(t,Fi+"/")?Fi:mr(t,pi)?pi:mr(t,"MSIE")||mr(t,"Trident/")?ui:mr(t,"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)],[ei]:[Ui],[wi]:[Ui],[di]:[new RegExp("(Opera|OPR)\\/"+qi)],[pi]:[new RegExp(pi+"\\/"+qi)],[gi]:[new RegExp("FxiOS\\/"+qi)],[Mi]:[new RegExp("Konqueror[:/]?"+qi,"i")],[ri]:[new RegExp(ri+" "+qi),Ui],[bi]:[new RegExp("android\\s"+qi,"i")],[si]:[new RegExp(ni+"\\/"+qi)],[Ri]:[new RegExp("OculusBrowser\\/"+qi)],[Oi]:[new RegExp(Oi+"\\/"+qi)],[Pi]:[new RegExp("YaBrowser\\/"+qi)],[$i]:[new RegExp($i+"\\/"+qi)],[Ni]:[new RegExp(Ni+"\\/"+qi)],[Li]:[new RegExp("(DuckDuckGo|Ddg)\\/"+qi)],[Ai]:[new RegExp("PaleMoon\\/"+qi)],[Fi]:[new RegExp(Fi+"\\/"+qi)],[Di]:[new RegExp("GSA\\/"+qi)],[ui]:[new RegExp("(rv:|MSIE )"+qi)],Mozilla:[new RegExp("rv:"+qi)]},Gi=function(t,e,r,i){var n=Vi(t,e,r,i),s=Zi[n];if(Ir(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Qi=[[new RegExp(_i+"; "+_i+" (.*?)[);]","i"),t=>[_i,t&&t[1]||""]],[new RegExp(mi,"i"),[mi,""]],[new RegExp(yi,"i"),[yi,""]],[zi,[ri,""]],[new RegExp(xi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Si,""];if(new RegExp(Zr).test(e)&&!/IEMobile\b/.test(e))return[xi+" "+Zr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=Wi[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[xi,i]}return[xi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Gr,[t[3],t[4],t[5]||"0"].join(".")]:[Gr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Ir(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Qr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qr+")","i"),t=>t&&t[2]?[Qr,[t[2],t[3],t[4]||"0"].join(".")]:[Qr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ai,""]],[/Linux|debian/i,["Linux",""]]],Ji=function(t){return Hi.test(t)?mi:Bi.test(t)?yi:ji.test(t)?_i:new RegExp(Ci,"i").test(t)?Ci:new RegExp("("+Si+"|WPDesktop)","i").test(t)?Si:/iPad/.test(t)?Yr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ti:zi.test(t)?ri:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(ki,"i").test(t)?ki:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Zr).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Qr:Kr:new RegExp("(pda|"+Zr+")","i").test(t)?Ei:new RegExp(Jr,"i").test(t)&&!new RegExp(Jr+" pc","i").test(t)?Ii:""},Ki=function(t,e){var r,i,n,s,o=Ji(t);return o===Yr||o===Kr||"Kobo"===o||"Kindle Fire"===o||o===Ii?Jr:o===mi||o===_i||o===yi||o===Ci?"Console":o===ti?"Wearable":o?Zr:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.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(t,e){return"string"==typeof(r=t)&&Yi.test(r)?t:e();var r}function tn(t){return t?t.split("#")[0]:t}function en(t,e){var r=setTimeout(t,e);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var rn=t=>t 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(t){if(Ar(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(kr(t))return{arrayValue:{values:t.map((t=>on(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function an(t){var e=[];for(var r in t){var i=t[r];Or(i)||Ir(i)||e.push({key:r,value:on(i)})}return e}function ln(t,e){var i=nn[t.level||"info"]||sn,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Pr(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Pr(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=r({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:an(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Ir(t.trace_flags)||(u.flags=t.trace_flags),u}function un(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function hn(t,e,r,i){return{resourceLogs:[{resource:{attributes:an(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}let dn=class{constructor(t,e,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Te=e,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=e.maxBufferSize,this.dt=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.ct=e.flushIntervalMs,this.vt=e.maxBatchRecordsPerPost,this.ft=e.rateCapWindowMs,this.yt=e.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(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.wt(t);if(null!==e)if(e.body){if(this.xt()){var r={record:ln(e,this.Ye())};this.Xe((()=>this.kt(r)))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var r=kr(e)?e:[e],i=t;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(t){return this.Ge.error("Error in beforeSend function for log:",t),null}return i}xt(){if(void 0===this.yt)return!0;var t=Date.now(),e=t-this.st;return this.ft>e&&e>=0||(this.st=t,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 t=this;return e((function*(){if(!t._instance.isDisabled)return t.rt||(t.rt=t.St().finally((()=>{t.rt=null}))),t.rt}))()}St(){var t=this;return e((function*(){var e;t.bt();var r=null!==(e=t._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==e?e:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;t.it=0;var a=Math.min(r.length,t.vt),l=r.slice(0,a),u=l.map((t=>t.record)),h=hn(u,t.Ct(),null!==(s=t.tt)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.Tt(h);if("too-large"===d.kind&&l.length>1)t.vt=Math.max(1,Math.floor(l.length/2)),t.Ge.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.vt);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.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&&t.Te.maxBatchRecordsPerPost>t.vt&&(t.vt=Math.min(t.Te.maxBatchRecordsPerPost,t.vt+1)),yield t.It(l.length),r=null!==(o=t._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}It(t){var r=this;return e((function*(){var e,i=Math.max(0,t-r.it),n=null!==(e=r._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==e?e:[];r._instance.setPersistedProperty(rr.LogsQueue,n.slice(i)),yield r.et()}))()}Ct(){return un(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(t){var e;if(!this._instance.optedOut){var r=null!==(e=this._instance.getPersistedProperty(rr.LogsQueue))&&void 0!==e?e:[];this.dt>r.length||(r.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(rr.LogsQueue,r),this.ht>r.length?this.Mt():this._t()}}Mt(t){void 0===t&&(t=this.ct),this.Et||(this.Et=en((()=>{this.Et=void 0,this._t()}),t))}Rt(){var t=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,t)}Pt(){var t=this._instance.getPersistedProperty(rr.LogsQueue);return!!t&&t.length>0}shutdown(t){var r=this;return e((function*(){r.bt();var e=r.flush().catch((()=>{}));void 0!==t?yield Promise.race([e,new Promise((e=>en(e,t)))]):yield e}))()}flushWithTimeout(t){var r=this;return e((function*(){var e=!1,i=r.flush(),n=new Promise((r=>en((()=>{e=!0,r()}),t)));try{yield Promise.race([i,n])}finally{e&&i.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(t=>{this.nt++,this.Ge.error("PostHog logs flush failed:",t)})).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(t){return String(t)+"000000"}function fn(t,e,r,i){var n="";return i&&(n=Object.keys(i).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(i[t]))).join(",")),t+"\0"+e+"\0"+(null!=r?r:"")+"\0"+n}let pn=class{constructor(t,e,r){this._instance=t,this.Te=e,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(t,e,r){void 0===e&&(e=1),this.Nt({name:t,type:"count",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(t,e,r){this.Nt({name:t,type:"gauge",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(t,e,r){this.Nt({name:t,type:"histogram",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var t=this,r=this.rt,i=function(){var i=e((function*(){r&&(yield r.catch((()=>{}))),yield t.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 t=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(t)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.wt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.Ge.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=e.attributes?r({},e.attributes):void 0,n=fn(e.type,e.name,e.unit,i)}catch(t){return void this.Ge.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Ot.get(n);if(!s){if(!this.jt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ot.set(n,s)}var o=this.Lt.get(e.name);void 0===o?this.Lt.set(e.name,e.type):o===e.type||this.$t.has(e.name)||(this.$t.add(e.name),this.Ge.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,e.value),this.Mt()}else this.Ge.warn("Dropping metric '"+e.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(t,e){var r;switch(t.type){case"count":t.total=(null!==(r=t.total)&&void 0!==r?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(cn.length+1).fill(0)});var i=t.hist;i.count+=1,i.sum+=e,i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.bucketCounts[function(t,e){for(var r=0;e.length>r;r++)if(e[r]>=t)return r;return e.length}(e,cn)]+=1}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var r=kr(e)?e:[e],i=t;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(t){return this.Ge.error("Error in beforeSend function for metric:",t),null}return i}Mt(){this.Et||(this.Et=en((()=>{this.Et=void 0,this.flush().catch((t=>{this.Ge.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var t=this;return e((function*(){if(0!==t.Ot.size){var e=t.Ot;t.Ot=new Map,t.Ft=!1,t.Lt=new Map,t.$t=new Set;var r=t.At,i=yield t._instance.Bt(t.qt(e));if(r===t.At)switch(i.kind){case"ok":return;case"retry-later":return t.Ut(e),void t.Mt();case"too-large":return void t.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ge.error("Failed to send metrics batch:",i.error)}}}))()}qt(t){return e=this.zt(t),i=function(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"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:e}]}]};var e,i,n,s}zt(t){var e=vn(Date.now()),i=new Map;for(var n of t.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:e,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:e,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:e,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(t){var e,r;for(var i of t){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!==(e=o.total)&&void 0!==e?e: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(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var mn,yn,_n;function bn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return _n&&r.length===yn||(yn=r.length,_n=r.reduce(((r,i)=>{mn||(mn={});var n=mn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,mn[i]=[l,u];break}}return r}),{})),_n}}class wn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&kr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:bn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var xn="?";function Sn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?xn:r,in_app:!0};return Ir(i)||(s.lineno=i),Ir(n)||(s.colno=n),s}var kn=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:xn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Cn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,En=/\((\S*)(?::(\d+))(?::(\d+))\)/,In=(t,e)=>{var r=Cn.exec(t);if(r)return Sn(e,r[1],xn,+r[2],+r[3]);var i=Tn.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=En.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=kn(i[1]||xn,i[2]);return Sn(e,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Mn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Rn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,On=(t,e)=>{var r=Mn.exec(t);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=kn(s,n);return Sn(e,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Pn=/\(error: (.*)\)/,$n=50;class Ln{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Mr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return Ur(t,"DOMException")}isDOMError(t){return Ur(t,"DOMError")}}class An{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Fn{constructor(){}match(t){return Ur(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Nn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Dn{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Nn);return i&&(e=i[1],r=i[2]),[e,r]}}var qn=["fatal","error","warning","log","info","debug"];function Un(t,e){void 0===e&&(e=40);var r=Object.keys(t);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(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class jn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return jr(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Un(t)}isSeverityLevel(t){return Mr(t)&&!Rr(t)&&qn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(rn(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Bn{match(t){return jr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Un(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class Hn{match(t){return qr(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class zn{match(t){return Ur(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!jr(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return qr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Wn="$message",Vn="$timestamp",Zn=new Set([Wn,Vn]),Gn={enabled:!0,max_bytes:32768};function Qn(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Gn.enabled,max_bytes:Kn(t.max_bytes,Gn.max_bytes)}:r({},Gn)}class Jn{constructor(t){this.Vt=[],this.Wt=0,this.Te=Qn(t)}setConfig(t){this.Te=Qn(t),this.Zt()}add(t){var e=function(t){var e;try{e=br(t)}catch(t){return}try{var r=JSON.parse(e);if(!Tr(r))return;var i=r,n=i[Wn],s=i[Vn];if(!Mr(n)||0===n.trim().length)return;if(!Mr(s)&&!$r(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.Te.max_bytes||(this.Vt.push({step:e.step,bytes:r}),this.Wt+=r,this.Zt())}}getAttachable(){return this.Vt.map((t=>t.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 t=this.Vt.shift();t&&(this.Wt-=t.bytes)}}}function Kn(t,e){if(!$r(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var Yn="undefined"!=typeof window?window:void 0,Xn="undefined"!=typeof globalThis?globalThis:Yn,ts=null==Xn?void 0:Xn.navigator,es=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==ts?void 0:ts.userAgent;function ls(){return!(!Yn||!1===Yn.navigator.onLine)}var us=t=>"undefined"!=typeof Document&&t instanceof Document,hs={DEBUG:!1,LIB_VERSION:"0.2.4",LIB_NAME:"browser-common"},ds=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(Yn&&(hs.DEBUG||Yn.POSTHOG_DEBUG||r)&&!Ir(Yn.console)&&Yn.console){for(var i=("__rrweb_original__"in Yn.console[e]?Yn.console[e].__rrweb_original__:Yn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>ds(t+" "+e,r)};return i},cs=ds("[PostHog.js]"),vs=cs.createLogger;function fs(t,e){kr(t)&&t.forEach(e)}function ps(t,e){if(!Pr(t))if(kr(t))t.forEach(e);else if(Fr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)xr.call(t,r)&&e(t[r],r)}var gs=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function ms(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var ys=function(t){try{return t()}catch(t){return}},_s=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){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(t)}}},bs=function(t){var e={};return ps(t,(function(t,r){(Mr(t)&&t.length>0||$r(t))&&(e[r]=t)})),e};var ws=["herokuapp.com","vercel.app","netlify.app"];function xs(t){var e=null==t?void 0:t.hostname;if(!Mr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of ws)if(r===i)return!1;return!0}function Ss(t,e,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function ks(t){return"ph_toolbar_internal"===t.name}var Cs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return br(t)}},Ts=t=>{var e=null==es?void 0:es.createElement("a");return Ir(e)?null:(e.href=t,e)},Es=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return ps(t,(function(t,e){Ir(t)||Ir(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Is=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!kr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){cs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ms=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.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("=");kr(d)&&(e.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(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},Os=(t,e)=>t>=e&&ls(),Ps=(t,e,r,i)=>{if(0===t){if(ls()){var n=e+1;return n===r&&i(),n}return e}return 0},$s=()=>{};function Ls(t,e,r){try{if(!(e in t))return $s;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Cr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Cr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return $s}}function As(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function Fs(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Cr(i))return e;try{var n=i(e);return Mr(n)&&n?n:e}catch(t){return cs.error("Error in get_current_url, falling back to window.location.href",t),e}}function Ns(t){var e,r=null==Yn||null==(e=Yn.location)?void 0:e.href;return Ir(r)?void 0:Fs(t,r)}var Ds="__POSTHOG_TOOLBAR__",qs=1,Us=3,js=11;function Bs(t){return t instanceof Element&&(t.id===Ds||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Hs(t){return!!t&&t.nodeType===qs}function zs(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Ws(t){return!!t&&t.nodeType===Us}function Vs(t){return!!t&&t.nodeType===js&&Hs(t.host)}var Zs=1e3;function Gs(t){return t?yr(t).split(/\s+/):[]}function Qs(t,e){var r=Ns(e);return!!(r&&t&&t.some((t=>r.match(t))))}function Js(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Gs(e)}function Ks(t){return Pr(t)?null:yr(t).split(/(\s+)/).filter((t=>xo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ys(t){var e="";return fo(t)&&!po(t)&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;Ws(t)&&t.textContent&&(e+=null!==(r=Ks(t.textContent))&&void 0!==r?r:"")})),yr(e)}function Xs(t){var e;return Ir(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var to=["a","button","form","input","select","textarea","label"];function eo(t,e){if(Ir(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function ro(t){var e=t.parentNode;return!(!e||!Hs(e))&&e}var io=[".ph-no-autocapture","[data-ph-no-autocapture]"],no=["next","previous","prev",">","<"],so=[...no,"+","-","−","–"],oo=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ao=[".ph-no-deadclick",".ph-no-capture"],lo=[".ph-no-rageclick",".ph-no-capture"],uo=["","text","search","email","password","url","tel","number"];function ho(t,e){if(!Yn||co(t))return!1;var r,i,n,s,o;if(Ar(e)?(r=!!e&&lo,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:lo,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!Hs(t))&&(!!zs(t,"textarea")||(zs(t,"input")?mr(uo,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var a=vo(t,!1).targetElementList;return!function(t,e){if(!1===t||Ir(t))return!1;var r;if(!0===t)r=no;else{if(!kr(t))return!1;if(t.length>10)return cs.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,i=t.ariaLabel;return r.some((t=>oo(e,t)||oo(i,t)))}))}(i,a.map((t=>{var e;return{safeText:Ys(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!eo(a,r)}var co=t=>!t||zs(t,"html")||!Hs(t),vo=(t,e)=>{if(!Yn||co(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!zs(n,"body");)if(Vs(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ro(n);if(!s)break;if(e||to.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=Yn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function fo(t){for(var e=new Set,r=0,i=t;i.parentNode&&!zs(i,"body");i=i.parentNode){if(r++>=Zs||e.has(i))return!1;e.add(i);var n=Js(i);if(mr(n,"ph-sensitive")||mr(n,"ph-no-capture"))return!1}if(mr(Js(t),"ph-include"))return!0;var s=t.type||"";if(Mr(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Mr(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(t){return!!(zs(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||zs(t,"select")||zs(t,"textarea")||"true"===t.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),_o="\\d{3}-?\\d{2}-?\\d{4}",bo=new RegExp("^("+_o+")$"),wo=new RegExp("("+_o+")");function xo(t,e){if(void 0===e&&(e=!0),Pr(t))return!1;if(Mr(t)){if(t=yr(t),(e?mo:yo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?bo:wo).test(t))return!1}return!0}function So(t){var e=Ys(t);return xo(e=(e+" "+ko(t)).trim())?e:""}function ko(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ps(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=Ys(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+ko(t)).trim())}catch(t){cs.error("[AutoCapture]",t)}})),e}function Co(t){return t.replace(/"|\\"/g,'\\"')}function To(t){var e=t.attr__class;if(e)return kr(e)?e:Gs(e)}var Eo=1e6,Io={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Eo,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},Mo=vs("[Recorder]"),Ro=t=>"navigation"===t.entryType,Oo=t=>"resource"===t.entryType;function Po(t,e){return!!e&&(Ar(e)||e[t])}function $o(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Lo=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ao(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!$o(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Lo))return!1;if(Ar(r))return!0;if(kr(r))return n(r);var s=r[e];return Ar(s)?s:n(s)}function Fo(t,e,r,i,n,s){return No.apply(this,arguments)}function No(){return No=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Mo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Oo(o=t[s])&&o.initiatorType===e&&(Ir(i)||o.startTime>=i)&&(Ir(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Fo(t,e,r,i,n,s+1))})),No.apply(this,arguments)}function Do(t){var e=t.body,r=t.options,i=t.url;if(Pr(e))return null;var n=As(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Mr(e))return e;if(us(e))return e.textContent;if(Fr(e))return Es(e);if(Tr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var qo=t=>!Or(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Uo(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Ir(a)?void 0:Math.round(a),endTime:Ir(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(qo(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var jo=["video/","audio/"];function Bo(t){return Tr(t)&&Cr(t.getReader)&&Cr(t.tee)}var Ho=500,zo="[SessionReplay] Timeout while trying to read body",Wo="[SessionReplay] Failed to read body";function Vo(t){return Wo+": "+t}function Zo(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Go(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(zo)),Ho);try{t.clone().text().then((t=>e(t)),(t=>e(Vo(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(Wo)}}))}(t);var r=function(t){var e;return Math.min(Eo,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Eo)}(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Zo(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),r(t))}var a,l=setTimeout((()=>o(zo)),Ho);try{a=t.clone()}catch(t){return void o(Wo)}var u=a.body;if(Bo(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(t){return void o(Wo)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(Zo(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(Vo(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(Vo(t))))}catch(t){o(Wo)}}))}(t,r)}function Qo(){return Qo=e((function*(t){var e=t.r,r=t.options,i=As(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):Go(e,r)})),Qo.apply(this,arguments)}function Jo(){return Jo=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=jo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=As(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Or(i)?Go(e,r):Promise.resolve(i)})),Jo.apply(this,arguments)}var Ko=null;function Yo(t,i,n){if(!("performance"in i))return()=>{};if(Ko)return Mo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Io,n):Io,o=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Ro(t)||Oo(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Uo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Ro(t)||Oo(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Uo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Po("request",r.recordHeaders),n=Po("response",r.recordHeaders),s=Ls(e.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=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Ao({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Do({body:t,options:r,url:a})),c=e.performance.now(),y(t));var _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Ao({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Do({body:d.response,options:r,url:a})),Fo(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Uo({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){Mo.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Po("request",i.recordHeaders),s=Po("response",i.recordHeaders),o=Ls(r,"fetch",(o=>function(){var a=e((function*(e,a){var l,u;try{l=new Request(e,a)}catch(t){return Mo.error("Failed to instrument fetch for network capture",t),o(e,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!Bo(null==a?void 0:a.body)&&Ao({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return Qo.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){Mo.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),u=$o(e)?yield o(l):yield o(e,a),d=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),Ao({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return Jo.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Fo(r,"fetch",l.url,h,d).then((e=>{var r,i=Uo({entry:e,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),Ko=()=>{a(),l(),u(),Ko=null}}var Xo=t=>({name:"rrweb/network@1",observer:Yo,options:t}),ta="undefined"!=typeof globalThis?globalThis:Yn;ta&&"undefined"==typeof self&&(ta.self=ta),ta&&"undefined"==typeof File&&(ta.File=function(){});var ea=null!=Yn?Yn:{};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Je,getRecordNetworkPlugin:Xo},ea.__PosthogExtensions__.rrweb={record:Ae,version:"v2",wasMaxDepthReached:()=>ct,resetMaxDepthState(){ct=!1,dt=!1}},ea.rrweb={record:Ae,version:"v2"},ea.rrwebConsoleRecord={getRecordConsolePlugin:Je},ea.getRecordNetworkPlugin=Xo;var ra,ia,na,sa,oa,aa,la,ua,ha,da,ca,va,fa,pa,ga,ma={},ya=[],_a=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ba=Array.isArray;function wa(t,e){for(var r in e)t[r]=e[r];return t}function xa(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Sa(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ra.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return ka(t,o,i,n,null)}function ka(t,e,r,i,n){var s={type:t,props:e,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(t){return t.children}function Ta(t,e){this.props=t,this.context=e}function $(t,e){if(null==e)return t.__?$(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?$(t):null}function Ea(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],s=wa({},e);s.__v=e.__v+1,ia.vnode&&ia.vnode(s),Na(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?$(e):r,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,qa(i,s,n),e.__e=e.__=null,s.__e!=r&&Ia(s)}}function Ia(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),Ia(t)}function Ma(t){(!t.__d&&(t.__d=!0)&&sa.push(t)&&!Ra.__r++||oa!=ia.debounceRendering)&&((oa=ia.debounceRendering)||aa)(Ra)}function Ra(){try{for(var t,e=1;sa.length;)sa.length>e&&sa.sort(la),t=sa.shift(),e=sa.length,Ea(t)}finally{sa.length=Ra.__r=0}}function Oa(t,e,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||ya,_=e.length;for(l=function(t,e,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=ka(null,o,null,null,null):ba(o)?o=t.__k[s]=ka(Ca,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=ka(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+c,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=$a(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))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Ha(a,a));return i}(r,e,y,l,_),d=0;_>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ma,v.__i=d,g=Na(t,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=Pa(v,l,t,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 Pa(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Pa(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=$(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function $a(t,e,r,i){var n,s,o,a=t.key,l=t.type,u=e[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||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function La(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||_a.test(e)?r:r+"px"}function Aa(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||La(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||La(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(ca,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r[da]=i[da]:(r[da]=va,t.addEventListener(e,s?pa:fa,s)):t.removeEventListener(e,s?pa:fa,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function Fa(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[ha])e[ha]=va++;else if(r[da]>e[ha])return;return r(ia.event?ia.event(e):e)}}}function Na(t,e,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,_,$,b,w,x,S,k,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=ia.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],b=h?$?$.props.value:h.__:i,r.__c?m=(c=e.__c=r.__c).__=c.__E:(_?e.__c=c=new C(y,b):(e.__c=c=new Ta(y,b),c.constructor=C,c.render=za),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),_&&null==c.__s&&(c.__s=c.state),_&&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=e,v)_&&null==C.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),_&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,b),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,b)){e.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),ya.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,b),_&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=b,c.props=y,c.__P=t,c.__e=!1,w=ia.__r,x=0,_)c.state=c.__s,c.__d=!1,w&&w(e),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(e),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())),_&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ca&&null==h.key?Ua(h.props.children):h,a=Oa(t,ba(S)?S:[S],e,r,i,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(k=s.length;k--;)xa(s[k]);Da(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||Da(e);ia.__e(t,e,r)}}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=ja(r.__e,e,r,i,n,s,o,l,u);return(h=ia.diffed)&&h(e),128&e.__u?void 0:a}function Da(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Da))}function qa(t,e,r){for(var i=0;r.length>i;i++)Ba(r[i],r[++i],r[++i]);ia.__c&&ia.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ia.__e(t,e.__v)}}))}function Ua(t){return"object"!=typeof t||null==t||t.__b>0?t:ba(t)?t.map(Ua):void 0!==t.constructor?null:wa({},t)}function ja(t,e,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ma,m=e.props,y=e.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)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(ia.__m&&ia.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&ra.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.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||Aa(t,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||Aa(t,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Oa("template"==e.type?t.content:t,ba(c)?c:[c],e,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?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Aa(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Aa(t,u,p,g[u],n))}return t}function Ba(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){ia.__e(t,r)}}function Ha(t,e,r){var i,n;if(ia.unmount&&ia.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Ba(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ia.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&Ha(i[n],e,r||"function"!=typeof t.type);r||xa(t.__e),t.__c=t.__=t.__e=void 0}function za(t,e,r){return this.constructor(t,r)}function Wa(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ia.__&&ia.__(t,e),i=e.__k,n=[],s=[],Na(e,t=e.__k=Sa(Ca,null,[t]),i||ma,ma,e.namespaceURI,i?null:e.firstChild?ra.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),qa(n,t,s),t.props.children=null}ra=ya.slice,ia={__e(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},na=0,Ta.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=wa({},this.state),"function"==typeof t&&(t=t(wa({},r),this.props)),t&&wa(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ma(this))},Ta.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ma(this))},Ta.prototype.render=Ca,sa=[],aa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,la=function(t,e){return t.__v.__b-e.__v.__b},Ra.__r=0,ua=Math.random().toString(8),ha="__d"+ua,da="__a"+ua,ca=/(PointerCapture)$|Capture$/i,va=0,fa=Fa(!1),pa=Fa(!0),ga=0;var Va,Za,Ga,Qa,Ja=0,Ka=[],Ya=ia,Xa=Ya.__b,tl=Ya.__r,el=Ya.diffed,rl=Ya.__c,il=Ya.unmount,nl=Ya.__;function sl(t,e){Ya.__h&&Ya.__h(Za,t,Ja||e),Ja=0;var r=Za.__H||(Za.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ol(t){return Ja=1,function(t,e,r){var i=sl(Va++,2);if(i.t=t,!i.__c&&(i.__=[ml(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Za,!Za.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,r);return n?a||o:a}return!n||o};Za.__f=!0;var s=Za.shouldComponentUpdate,o=Za.componentWillUpdate;Za.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},Za.shouldComponentUpdate=n}return i.__N||i.__}(ml,t)}function al(t,e){var r=sl(Va++,3);!Ya.__s&&gl(r.__H,e)&&(r.__=t,r.u=e,Za.__H.__h.push(r))}function ll(t){return Ja=5,ul((function(){return{current:t}}),[])}function ul(t,e){var r=sl(Va++,7);return gl(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function hl(t){var e=Za.context[t.__c],r=sl(Va++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Za)),e.props.value):t.__}function dl(){for(var t;t=Ka.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(fl),e.__h.some(pl),e.__h=[]}catch(r){e.__h=[],Ya.__e(r,t.__v)}}}Ya.__b=function(t){Za=null,Xa&&Xa(t)},Ya.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),nl&&nl(t,e)},Ya.__r=function(t){tl&&tl(t),Va=0;var e=(Za=t.__c).__H;e&&(Ga===Za?(e.__h=[],Za.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&dl(),Va=0)),Ga=Za},Ya.diffed=function(t){el&&el(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Qa===Ya.requestAnimationFrame||((Qa=Ya.requestAnimationFrame)||vl)(dl)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),Ga=Za=null},Ya.__c=function(t,e){e.some((function(t){try{t.__h.some(fl),t.__h=t.__h.filter((function(t){return!t.__||pl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Ya.__e(r,t.__v)}})),rl&&rl(t,e)},Ya.unmount=function(t){il&&il(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{fl(t)}catch(t){e=t}})),r.__H=void 0,e&&Ya.__e(e,r.__v))};var cl="function"==typeof requestAnimationFrame;function vl(t){var e,r=function(){clearTimeout(i),cl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);cl&&(e=requestAnimationFrame(r))}function fl(t){var e=Za,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Za=e}function pl(t){var e=Za;t.__c=t.__(),Za=e}function gl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function ml(t,e){return"function"==typeof e?e(t):e}var yl={GZipJS:"gzip-js",Base64:"base64"},_l={Activation:"events",Cancellation:"cancelEvents"},bl={Button:"button",Tab:"tab",Selector:"selector"},wl={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"},xl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Sl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},kl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Cl={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Tl={Once:"once",Recurring:"recurring",Always:"always"},El={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Il={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",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_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Ml={Popover:"popover",Inline:"inline"};function Rl(t){return"$survey_response_"+t}function Ol(t,e){if(!e)return null;var r=t[Rl(e)];return kr(r)?[...r]:r}function Pl(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!Ir(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Ol(t,e.id);Ir(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:Ol(t,e.id)})))},t,i)}function $l(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function Ll(t){return"string"==typeof t&&t.trim()?t.trim():null}function Al(t){return t.toLowerCase()}function Fl(t,e,r){if(!t||!e)return null;var i=Al(e),n=Object.keys(t).find((t=>Al(t)===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(t).find((t=>Al(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Nl(t,e,i){var n,s=Fl(t.translations,e,i),o=r({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Ir(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Ir(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Ir(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Ir(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Ir(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Ir(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(t){return!(Ir(t.thankYouMessageHeader)&&Ir(t.thankYouMessageDescription)&&Ir(t.thankYouMessageCloseButtonText)&&Ir(t.submitButtonText)&&Ir(t.backButtonText))}(u)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Fl(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),l=!1;return Ir(o.question)||(a.question=o.question,l=!0),Ir(o.description)||(a.description=o.description,l=!0),Ir(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ir(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ir(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ir(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return kr(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i))),d=h.map((t=>t.question)),c=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}function Dl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function ql(t){var e;return Dl(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ul=vs("[Surveys]");function jl(t){return!(!t.start_date||t.end_date)}function Bl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Hl="seenSurvey_",zl="inProgressSurvey_",Wl=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Vl=t=>Wl(Hl,t),Zl=t=>{try{var e=Vl(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Ul.error("Failed to persist survey seen state",t)}},Gl=[Sl.Popover,Sl.Widget,Sl.API],Ql={ignoreConditions:!1,ignoreDelay:!1,displayType:Ml.Popover},Jl="$people_distinct_id",Kl="$device_id",Yl="$device_model",Xl="__alias",tu="__timers",eu="$autocapture_disabled_server_side",ru="$heatmaps_enabled_server_side",iu="$exception_capture_enabled_server_side",nu="$error_tracking_suppression_rules",su="$error_tracking_capture_extension_exceptions",ou="$web_vitals_enabled_server_side",au="$dead_clicks_enabled_server_side",lu="$product_tours_enabled_server_side",uu="$web_vitals_allowed_metrics",hu="$session_recording_remote_config",du="$replay_sample_rate",cu="$replay_override_sampling",vu="$replay_override_linked_flag",fu="$replay_override_url_trigger",pu="$replay_override_event_trigger",gu="$sesid",mu="$session_is_sampled",yu="$enabled_feature_flags",_u="$active_feature_flags",bu="$early_access_features",wu="$feature_flag_details",xu="$feature_flag_payloads",Su="$feature_flag_request_id",ku="$minimal_flag_called_events",Cu="$override_feature_flags",Tu="$override_feature_flag_payloads",Eu="$stored_person_properties",Iu="$stored_group_properties",Mu="$surveys",Ru="$surveys_loaded_at",Ou="$surveys_activated",Pu="$surveys_activated_session",$u="ph_product_tours",Lu="$flag_call_reported",Au="$flag_call_reported_session_id",Fu="$feature_flag_errors",Nu="$feature_flag_evaluated_at",Du="$user_state",qu="$client_session_props",Uu="$capture_rate_limit",ju="$initial_campaign_params",Bu="$initial_referrer_info",Hu="$initial_person_info",zu="$epp",Wu="$posthog_cookieless",Vu="$cookieless_mode",Zu="$sdk_debug_extensions_init_method",Gu="$sdk_debug_extensions_init_time_ms",Qu="$sdk_debug_recording_script_not_loaded",Ju="PostHog loadExternalDependency extension not found.",Ku="on_reject",Yu="always",Xu="anonymous",th="identified",eh="identified_only",rh="visibilitychange",ih="beforeunload",nh="$pageview",sh="$pageleave",oh="$identify",ah="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return $r(t)&&isFinite(t)&&Math.floor(t)===t});class lh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,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 lh(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new lh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class uh{generate(){var t=this.generateOrAbort();if(!Ir(t))return t;this.S=0;var e=this.generateOrAbort();if(Ir(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return lh.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 ch}}var hh,dh=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yn&&!Ir(Yn.crypto)&&crypto.getRandomValues&&(dh=t=>crypto.getRandomValues(t));class ch{nextUint32(){return this.R.length>this.O||(dh(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var vh=()=>fh().toString(),fh=()=>(hh||(hh=new uh)).generate(),ph=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function gh(t,e,r){return Cs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var mh={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>ph(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ph(e,t))))),icontains:(t,e)=>e.map(yh).some((e=>t.map(yh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(yh).every((e=>t.map(yh).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},yh=t=>t.toLowerCase();function _h(t,e){return!t||Object.entries(t).every((t=>{var r=t[1],i=null==e?void 0:e[t[0]];if(Ir(i)||Or(i))return!1;var n=[String(i)],s=mh[r.operator];return!!s&&s(r.values,n)}))}var bh=t=>{if(es){try{for(var e=t+"=",r=es.cookie.split(";").filter((t=>t.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(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},wh="",xh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Sh={N:()=>!!es,D(t){cs.error("cookieStore error: "+t)},A:bh,F(t){var e;try{e=JSON.parse(Sh.A(t))||{}}catch(t){}return e},q(t,e,r,i,n){if(!es)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=es),wh)return wh;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+vh();!wh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",wh=s)}return wh}(t);if(!r){var i=(t=>{var e=t.match(xh);return e?e[0]:""})(t);i!==r&&cs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(es.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&cs.warn("cookieStore warning: large cookie, len="+u.length),es.cookie=u,!0}catch(t){return!1}},P(t,e){if(null!=es&&es.cookie)try{Sh.q(t,"",-1,e)}catch(t){return}}},kh=null,Ch={N(){if(!Or(kh))return kh;var t=!0;if(Ir(Yn))t=!1;else try{var e="__mplssupport__";Ch.q(e,"xyz"),'"xyz"'!==Ch.A(e)&&(t=!1),Ch.P(e)}catch(e){t=!1}return t||cs.error("localStorage unsupported; falling back to cookie store"),kh=t,t},D(t){cs.error("localStorage error: "+t)},A(t){try{return null==Yn?void 0:Yn.localStorage.getItem(t)}catch(t){Ch.D(t)}return null},F(t){try{return JSON.parse(Ch.A(t))||{}}catch(t){}return null},q(t,e){try{return null==Yn||Yn.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Ch.D(t)}return!1},P(t){try{null==Yn||Yn.localStorage.removeItem(t)}catch(t){Ch.D(t)}}},Th=[Kl,"distinct_id",gu,mu,zu,Hu,Du],Eh={},Ih={N:()=>!0,D(t){cs.error("memoryStorage error: "+t)},A:t=>Eh[t]||null,F:t=>Eh[t]||null,q:(t,e)=>(Eh[t]=e,!0),P(t){delete Eh[t]}},Mh=null,Rh={N(){if(!Or(Mh))return Mh;if(Mh=!0,Ir(Yn))Mh=!1;else try{var t="__support__";Rh.q(t,"xyz"),'"xyz"'!==Rh.A(t)&&(Mh=!1),Rh.P(t)}catch(t){Mh=!1}return Mh},D(t){cs.error("sessionStorage error: ",t)},A(t){try{return null==Yn?void 0:Yn.sessionStorage.getItem(t)}catch(t){Rh.D(t)}return null},F(t){try{return JSON.parse(Rh.A(t))||null}catch(t){}return null},q(t,e){try{return null==Yn||Yn.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Rh.D(t)}return!1},P(t){try{null==Yn||Yn.sessionStorage.removeItem(t)}catch(t){Rh.D(t)}}},Oh=vs("[Stylesheet Loader]"),Ph=Yn,$h=es,Lh="#020617",Ah={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:wl.Right,widgetType:bl.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:Lh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Fh=[wl.Center,wl.Left,wl.Right];function Nh(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Dh(t){var e;void 0===t&&(t=Ah.backgroundColor),"#"===t[0]&&(e=Nh(t)),t.startsWith("rgb")&&(e=t);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"}[t.toLowerCase()];if(r&&(e=Nh(r)),!e)return Lh;var i=e.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?Lh:"white"}return Lh}var qh=(t,e,i)=>{var n=id(t),s=$h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=$h.createElement("div");((t,e,i)=>{var n=r({},Ah,i),s=t.style,o=!Fh.includes(n.position)||e===Sl.Widget&&(null==i?void 0:i.widgetType)===bl.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(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)||Dh(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",Dh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Dh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Dh(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)||Dh(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,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Cr(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(Oh.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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return $h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Uh=t=>{var e=t.responses,i=t.survey,n=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage;s?(Zl(i),s.capture(El.SENT,r({[Il.SURVEY_NAME]:i.name,[Il.SURVEY_ID]:i.id,[Il.SURVEY_ITERATION]:i.current_iteration,[Il.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Il.SURVEY_SUBMISSION_ID]:n,[Il.SURVEY_COMPLETED]:o},l&&{[Il.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Pl(e,i),a,{$set:{[$l(i,"responded")]:!0}})),o&&(Ph.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),rd(i),s.reloadFeatureFlags())):Ul.error("[survey sent] event not captured, PostHog instance not found.")},jh=(t,e,i)=>{return r({[Il.SURVEY_NAME]:t.name,[Il.SURVEY_ID]:t.id,[Il.SURVEY_ITERATION]:t.current_iteration,[Il.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Il.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!Pr(t))))},(null==e?void 0:e.surveyLanguage)&&{[Il.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Il.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Pl(null==e?void 0:e.responses,t));var n},Bh=(t,e,i,n)=>{if(e){if(!i){var s=td(t);e.capture(El.DISMISSED,r({},jh(t,s,e),n&&{[Il.SURVEY_LANGUAGE]:n},{$set:{[$l(t,"dismissed")]:!0}})),rd(t),Zl(t),Ph.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Ul.error("[survey dismissed] event not captured, PostHog instance not found.")},Hh=(t,e)=>{if(e){var r=(t=>Wl("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=td(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(El.ABANDONED,jh(t,i,e),{transport:"sendBeacon"})}}else Ul.error("[survey abandoned] event not captured, PostHog instance not found.")},zh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Wh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Vh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Wh(t.questions,zh(t.questions)):t.questions,Zh=t=>ql(t)||ed(t),Gh=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,Ma(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+ga++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Qh=()=>hl(Gh),Jh=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,s,o,a=wa({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?ra.call(arguments,2):r),ka(t.type,a,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Kh(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=Ns(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return mh[o](s,[n])}var Yh=t=>Wl(zl,t),Xh=(t,e)=>{try{localStorage.setItem(Yh(t),JSON.stringify(e))}catch(t){Ul.error("Error setting in-progress survey state in localStorage",t)}},td=t=>{try{var e=localStorage.getItem(Yh(t));if(e)return JSON.parse(e)}catch(t){Ul.error("Error getting in-progress survey state from localStorage",t)}return null},ed=t=>{var e=td(t);return!Pr(null==e?void 0:e.surveySubmissionId)},rd=t=>{try{localStorage.removeItem(Yh(t))}catch(t){Ul.error("Error clearing in-progress survey state from localStorage",t)}};function id(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function nd(t,e,r){if(void 0===e&&(e=wl.Right),t===Sl.ExternalSurvey)return{};switch(e){case wl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case wl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case wl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case wl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case wl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case wl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case wl.Left:return{left:"30px"};case wl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Sl.Widget&&r===bl.Tab?"60px":"30px"}}}var sd=0;function od(t,e,r,i,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--sd,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return ia.vnode&&ia.vnode(u),u}var ad=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),ld=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),ud=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),hd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),dd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:od("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"})}),cd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:od("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"})}),vd=od("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:od("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"})}),fd=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return od("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:[od("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),od("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})]})},pd=od("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[od("g",{"clip-path":"url(#clip0_2415_6911)",children:[od("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:od("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),od("g",{mask:"url(#mask0_2415_6911)",children:[od("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"}),od("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"}),od("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"}),od("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"}),od("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"}),od("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"})]})]}),od("defs",{children:od("clipPath",{id:"clip0_2415_6911",children:od("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function gd(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return od("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",pd]})}function md(t){var e=t.text,r=t.submitDisabled,i=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=hl(Gh).isPreviewMode,d=!!l&&!!u,c=!a&&od("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:e});return od("div",{className:"bottom-section",children:[d?od("div",{className:"form-buttons form-buttons-with-back",children:[od("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&od(gd,{urlParams:{utm_source:"survey-footer"}})]})}function yd(t){var e=t.question,r=t.forceDisableHtml;return od("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[od(e.type===kl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Jh({component:Sa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function _d(t){return od("button",{className:"form-cancel",onClick:t.onClick,disabled:hl(Gh).isPreviewMode,"aria-label":"Close survey",type:"button",children:fd({fill:"black"})})}od("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:od("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 bd=Yn;function wd(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=hl(Gh).isPopup;return al((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ss(bd,"keydown",t),()=>{bd.removeEventListener("keydown",t)}}),[o]),od("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&od(_d,{onClick:()=>o()}),od("h3",{className:"thank-you-message-header",children:e}),r&&Jh({component:Sa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&od(md,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var xd=t=>kr(t)&&t.every((t=>Mr(t)));function Sd(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Qh().isPreviewMode,d=ll(null),c=ol((()=>Mr(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;al((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=ul((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)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,e.validation,e.optional)),[v,e.validation,e.optional]),y=gn(e.validation,nr),_=gn(e.validation,sr),b=ul((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,_)),[y,_]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return od(Ca,{children:[od("div",{className:"question-container",children:[od(yd,{question:e,forceDisableHtml:r,htmlFor:g}),od("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:_,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:v}),b&&od("div",{className:"validation-hint",children:b})]}),od(md,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function kd(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return od(Ca,{children:[od("div",{className:"question-container",children:od(yd,{question:e,forceDisableHtml:t.forceDisableHtml})}),od(md,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Cd(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=r.scale,c=10===r.scale?0:1,v=ol((()=>$r(l)?l:kr(l)&&l.length>0&&$r(parseInt(l[0]))?parseInt(l[0]):Mr(l)&&$r(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Qh().isPreviewMode,y=t=>m?a(t):o(t);return od(Ca,{children:[od("div",{className:"question-container",children:[od(yd,{question:r,forceDisableHtml:i}),od("div",{className:"rating-section",children:[od("div",{className:"rating-options",children:["emoji"===r.display&&od("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Od[r.scale])?void 0:e.map(((t,e)=>od("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&od("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:Pd(r.scale).map(((t,e)=>od(Td,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&od("div",{className:"rating-text",children:[od("div",{children:r.lowerBoundLabel}),od("div",{children:r.upperBoundLabel})]})]})]}),od(md,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Or(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Td(t){var e=t.num,r=t.setActiveNumber;return od("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function Ed(t){var e=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=ll(null),c=ul((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=Wh(e,zh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=ol((()=>((t,e)=>Mr(t)||xd(t)?t:e===kl.SingleChoice?null:[])(l,e.type))),f=v[0],p=v[1],g=ol((()=>((t,e)=>{if(Mr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(xd(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],_=Qh().isPreviewMode,b=e.type===kl.SingleChoice,w=e.type===kl.MultipleChoice,x=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),b&&p(""),void(i&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(b)return p(t),y((t=>r({},t,{isSelected:!1,inputValue:""}))),void(x&&(o(t),_&&a(t)));w&&kr(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},k=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>r({},t,{inputValue:e}))),b&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y((t=>r({},t,{isSelected:!1,inputValue:""}))),b&&p(null))},T=()=>!(e.optional||!Or(f)&&(!kr(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?kr(f)&&(_?a([...f,m.inputValue]):o([...f,m.inputValue])):_?a(f):o(f)};return od(Ca,{children:[od("div",{className:"question-container",children:[od(yd,{question:e,forceDisableHtml:i}),od("fieldset",{className:"multiple-choice-options limit-height",children:[od("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:b?f===t:kr(f)&&f.includes(t);return od("label",{className:i?"choice-option-open":"",children:[od("div",{className:"response-choice",children:[od("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,i),id:s,"aria-controls":o}),od("span",{children:i?t+":":t})]}),i&&od("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:k,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),od(md,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:s,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var Id=[1,2,3,4,5],Md=[1,2,3,4,5,6,7],Rd=[0,1,2,3,4,5,6,7,8,9,10],Od={2:[cd,vd],3:[ud,ld,ad],5:[hd,ud,ld,ad,dd]};function Pd(t){switch(t){case 5:default:return Id;case 7:return Md;case 10:return Rd}}var $d=vs("[Surveys]");function Ld(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Cl.End:s;if(n.branching.type===Cl.End)return Cl.End;if(n.branching.type===Cl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Cl.ResponseBased){if(n.type===kl.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===Cl.End?Cl.End:s}}else if(n.type===kl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>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===Cl.End?Cl.End:s}}return s}return $d.warn("Falling back to next question index due to unexpected branching type"),s}var Ad="https?://(.*)",Fd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Nd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Fd],Dd="<masked>",qd=["li_fat_id"];function Ud(t,e,r){if(!es)return{};var i,n=e?[...Fd,...r||[]]:[],s=jd(Ms(es.URL,n,Dd),t),o=(i={},ps(qd,(function(t){var e=bh(t);i[t]=e||null})),i);return gs(o,s)}function jd(t,e){var r=Nd.concat(e||[]),i={};return ps(r,(function(e){var r=Is(t,e);i[e]=r||null})),i}function Bd(t){var e=function(t){return t?0===t.search(Ad+"google.([^/?]*)")?"google":0===t.search(Ad+"bing.com")?"bing":0===t.search(Ad+"yahoo.com")?"yahoo":0===t.search(Ad+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!Or(e)){i.$search_engine=e;var n=es?Is(es.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Hd(){return navigator.language||navigator.userLanguage}var zd="$direct";function Wd(){return(null==es?void 0:es.referrer)||zd}function Vd(t,e,r){void 0===r&&(r=!1);var i=t?[...Fd,...e||[]]:[],n=r?tn(null==rs?void 0:rs.href):null==rs?void 0:rs.href,s=null==n?void 0:n.substring(0,1e3);return{r:Wd().substring(0,1e3),u:s?Ms(s,i,Dd):void 0}}function Zd(t,e){var r;void 0===e&&(e=!1);var i=t.r,n=t.u,s=e?tn(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==zd?zd: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=jd(s);gs(o,l)}if(i){var u=Bd(i);gs(o,u)}return o}function Gd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Qd(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Jd=vs("[SurveyTranslations]");function Kd(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=Ll(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?Ll(t.language):null}(r);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Ll(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Cr(t.get_property)?t.get_property(Eu):void 0,locale:Hd()},Jd)}(e);if(!r)return Jd.info("No user language detected"),{survey:t,language:null};var i=Nl(t,r,Jd);return{survey:i.survey,language:i.matchedKey}}var Yd=Yn,Xd=es,tc="ph:show_survey_widget",ec="PHWidgetSurveyClickListener";function rc(t,e){try{var r=t.getBoundingClientRect(),i=Yd.innerHeight,n=Yd.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-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:Ah.zIndex}}catch(t){return Ul.warn("Failed to calculate trigger position:",t),null}}class ic{constructor(t){var e=this;this.j=new Map,this.H=new Map,this.B=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Mu);if(t)for(var e of t)ed(e)&&Hh(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,a=this.U(t),l=a.survey,u=a.language,h=null!=e&&e.position||null!=e&&e.selector?r({},l,{appearance:r({},l.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):l;this.W(h.id);var d=null!=e?e:{},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)===wl.NextToTrigger&&null!=(s=h.appearance)&&s.widgetSelector){var g,m=Xd.querySelector(h.appearance.widgetSelector);m&&(p=rc(m,parseInt((null==(g=h.appearance)?void 0:g.maxWidth)||Ah.maxWidth))||{})}var y=(null==(o=h.appearance)?void 0:o.surveyPopupDelaySeconds)||0,_=qh(h,this._posthog).shadow,b={posthog:this._posthog,survey:h,removeSurveyFromFocus:this.$,properties:c,style:p,isSurveyCompleted:f,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:u};if(0>=y)return Wa(od(ac,r({},b)),_);var w=setTimeout((()=>{if(this.j.delete(h.id),!this.G(h))return Ul.info("Survey "+h.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(h);Wa(od(ac,r({},b,{survey:r({},h,{appearance:r({},h.appearance,{surveyPopupDelaySeconds:0})})})),_)}),1e3*y);this.j.set(h.id,w)}},this.Y=t=>{var e=this.U(t),r=e.survey,i=e.language,n=qh(r,this._posthog),s=n.shadow;n.isNewlyCreated&&Wa(od(uc,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),s)},this.J=t=>{this.K(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(ec),this.H.delete(t.id),Ul.info("Removed click listener for survey "+t.id))},this.X=(t,e)=>{var r=Xd.querySelector(e),i=this.H.get(t.id);if(r){if(this.Y(t),i){if(r===i.element)return;Ul.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.J(t)}if(!r.hasAttribute(ec)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===wl.NextToTrigger?rc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Ah.maxWidth)):{};Yd.dispatchEvent(new CustomEvent(tc,{detail:{surveyId:t.id,position:n}}))};Ss(r,"click",n),r.setAttribute(ec,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Ul.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.J(t)},this.renderPopover=t=>{var e=this.U(t),r=e.survey,i=e.language,n=qh(r,this._posthog).shadow;Wa(od(ac,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.$,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.U(t),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ee(s,o)),Wa(od(ac,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.G(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Sl.Popover||t.type===Sl.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.j.keys()))i.has(n)||e.cancelSurvey(n);var s=e.te(r),o=new Set;s.forEach((t=>{if(t.type===Sl.Widget){var r,i,n,s;if((null==(r=t.appearance)?void 0:r.widgetType)===bl.Tab)return void e.Y(t);(null==(i=t.appearance)?void 0:i.widgetType)===bl.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.X(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Or(e.re)&&t.type===Sl.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var r=t.survey;o.has(r.id)||e.J(r)}))}),t)},this.Z=t=>{Or(this.re)||Ul.error("Survey "+this.re+" already in focus. Cannot add survey "+t.id+"."),this.re=t.id},this.$=t=>{this.re!==t.id&&Ul.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.W(t.id),this.re=null,this.K(t)},this._posthog=t,this.re=null}W(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Ul.info("Cancelled pending survey "+t),this.W(t),this.re===t&&(this.re=null))}te(t){return t.sort(((t,e)=>{var r,i,n=ed(t),s=ed(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Tl.Always,a=e.schedule===Tl.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(t){return Kd(t,this._posthog)}ee(t,e){if(this.B.has(t.id))return!1;var r=function(t){var e={},r=!1,i=Yd.location.search.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Ir(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);e[c]||(e[c]=[]),e[c].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(),i=r.params;if(0===Object.keys(i).length)return!1;Ul.info("[Survey Prefill] Detected URL prefill parameters");var n=this.ne(t,i,e);if(!n)return!1;var s=n.responses,o=n.submissionId,a=n.isSurveyCompleted,l=n.skippedResponses;return(Object.keys(l).length>0&&t.enable_partial_responses||a)&&Uh({responses:a?s:l,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,surveyLanguage:e}),this.B.add(t.id),a}V(t,e,r,i){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=kr(o)?o.map(String):[String(o)]}Ul.info("[Survey] Processing initial responses");var a=this.ne(t,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return Uh({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}ne(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=Rl(t.id);try{switch(t.type){case kl.SingleChoice:if(!t.choices||0===t.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>=t.choices.length)return void cs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case kl.MultipleChoice:if(!t.choices||0===t.choices.length)return void cs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void cs.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&cs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case kl.Rating:var u=parseInt(n[0],10),h=t.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 "+t.type+" does not support prefill")}}catch(t){cs.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Ul.warn("[Survey Prefill] No valid responses after conversion"),null;var n=vh(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;t.questions.length>i&&s>0&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=Rl(o.id);Ir(r[a])||(n[a]=r[a])}var l=Ld(t,i,o.id?r[Rl(o.id)]:null);if(l===Cl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return Xh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,surveyLanguage:r}),Ul.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return Ul.error("[Survey Prefill] Error handling prefill:",t),null}}ie(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}ae(t){return!t.conditions||Kh(t,this._posthog)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!as)return!1;var s=Ki(as,{userAgentDataPlatform:null==ts||null==(r=ts.userAgentData)?void 0:r.platform,maxTouchPoints:null==ts?void 0:ts.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 mh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==$h||!$h.querySelector(t.conditions.selector))}(t)}oe(t){var e;return Zh(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ie(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!jl(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Gl.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ie(t.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(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.oe(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Ch.A("lastSeenSurveyDate"))?(t=>!!Ch.A(Vl(t))&&!Zh(t))(t)?(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(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.se(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}se(t){var e;if(!Dl(t)&&!Bl(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}ue(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ie(e)}))}G(t){return this.checkSurveyEligibility(t).eligible&&this.ae(t)&&this.se(t)&&this.ue(t)}K(t){try{var e=Xd.querySelector(id(t,!0));null!=e&&e.shadowRoot&&Wa(null,e.shadowRoot),null==e||e.remove()}catch(e){Ul.warn("Failed to remove survey "+t.id+" from DOM:",e)}}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 nc(t,e){if(Xd&&Yd){var r,i=new ic(t);if(t.config.disable_surveys_automatic_display)return Ul.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Ul.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ir(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Ss(Xd,"visibilitychange",(()=>{Xd.hidden?Ir(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function sc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;al((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Sl.Widget,s=Kh(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===bl.Tab&&r;if(!s)return Ul.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(Ul.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ss(Yd,"popstate",r),Ss(Yd,"hashchange",r);var s=Yd.history.pushState,l=Yd.history.replaceState;return Yd.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.apply(this,e),r()},Yd.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];l.apply(this,e),r()},()=>{Yd.removeEventListener("popstate",r),Yd.removeEventListener("hashchange",r),Yd.history.pushState=s,Yd.history.replaceState=l}}}),[o,e,i,n,a])}function oc(t){switch(void 0===t&&(t=xl.Right),t){case xl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case xl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case xl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function ac(t){var e,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,c=void 0===d?{}:d,v=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,_=void 0===y?()=>{}:y,b=t.onPreviewBack,w=void 0===b?()=>{}:b,x=t.onPopupSurveyDismissed,S=void 0===x?()=>{}:x,k=t.onCloseConfirmationMessage,C=void 0===k?()=>{}:k,T=t.properties,E=t.isSurveyCompleted,I=t.skipShownEvent,M=t.surveyLanguage,R=ll(null),O=Number.isInteger(v),P=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,L=function(t,e,i,n,s,o,a,l,u){var h=ol(n||0===i||t.type===Sl.ExternalSurvey),d=h[0],c=h[1],v=ol(!1),f=v[0],p=v[1],g=()=>{var e=()=>{o&&s(t),c(!1)};Xd.startViewTransition?Xd.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return al((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(Kh(t,e)){c(!0),Yd.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(El.SHOWN,r({[Il.SURVEY_NAME]:t.name,[Il.SURVEY_ID]:t.id,[Il.SURVEY_ITERATION]:t.current_iteration,[Il.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[Il.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Ss(Yd,"PHSurveyClosed",m),Ss(Yd,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),Yd.removeEventListener("PHSurveyClosed",m),Yd.removeEventListener("PHSurveySent",s)}}return o(),()=>{Yd.removeEventListener("PHSurveyClosed",m),Yd.removeEventListener("PHSurveySent",s)}}}else Ul.error("usePopupVisibility hook called without a PostHog instance.")}),[]),sc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,P,O,p,m,R,I,M),A=L.isPopupVisible,F=L.hidePopupWithViewTransition,N=L.isSurveySent||v===l.questions.length||!0===E,D=ul((()=>{var t=td(l),e=(null==t?void 0:t.surveySubmissionId)||vh();return{isPreviewMode:O,previewPageIndex:v,onPopupSurveyDismissed(){M?Bh(l,h,O,M):Bh(l,h,O),S()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:_,onPreviewBack:w,posthog:h,properties:T,surveyLanguage:M}}),[O,v,m,h,l,S,_,w,T,M]);return A?od(Gh.Provider,{value:D,children:od("div",{className:"ph-survey",style:r({},nd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:N?od(wd,{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||Ah,onClose(){F(),C()}}):od(lc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function lc(t){var e,i,n=t.survey,s=t.forceDisableHtml,o=t.posthog,a=ol((()=>{var t=td(n);return null!=t&&t.responses&&Ul.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),l=a[0],u=a[1],h=hl(Gh),d=h.previewPageIndex,c=h.onPopupSurveyDismissed,v=h.isPopup,f=h.onPreviewSubmit,p=h.onPreviewBack,g=h.surveySubmissionId,m=h.isPreviewMode,y=h.properties,_=h.surveyLanguage,b=ol((()=>{var t=td(n);return d||(null==t?void 0:t.lastQuestionIndex)||0})),w=b[0],x=b[1],S=ol((()=>{var t,e=td(n);return null!==(t=null==e?void 0:e.visitedIndices)&&void 0!==t?t:[]})),k=S[0],C=S[1],T=ul((()=>Vh(n)),[n]);al((()=>{m&&!Ir(d)&&x(d)}),[d,m]);var E=!(null==(e=n.appearance)||!e.allowGoBack)&&(m?(null!=d?d:0)>0:k.length>0),I=T.at(w);return I?od("form",{className:"survey-form",name:"surveyForm",children:[v&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&od(_d,{onClick(){c()}}),od("div",{className:"survey-box","data-question-index":w,children:hc({question:I,forceDisableHtml:s,displayQuestionIndex:w,appearance:n.appearance||Ah,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=Rl(s),h=r({},l,{[a]:e});u(h);var d=Ld(n,i,e),c=d===Cl.End,v=[...k,i];if(c||(C(v),x(d),Xh(n,{surveySubmissionId:g,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:_})),n.enable_partial_responses||c){var f=new Set(v.map((t=>{var e;return null==(e=T[t])?void 0:e.id})).filter((t=>!!t)).map((t=>Rl(t)))),p=Object.fromEntries(Object.entries(h).filter((t=>f.has(t[0]))));Uh({responses:p,survey:n,surveySubmissionId:g,isSurveyCompleted:c,posthog:o,properties:y,surveyLanguage:_})}}else Ul.error("onNextButtonClick called without a questionId.");else Ul.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:w,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?l[Rl(I.id)]:void 0,canGoBack:E,onBack(){if(m)p();else if(0!==k.length){var t=k[k.length-1],e=k.slice(0,-1);C(e),x(t),Xh(n,{surveySubmissionId:g,responses:l,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:_})}}})})]}):null}function uc(t){var e,r,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,c=t.surveyLanguage,v=ol(!0),f=v[0],p=v[1],g=ol(!1),m=g[0],y=g[1],_=ol({}),b=_[0],w=_[1],x=()=>{y(!m)};if(al((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(Ul.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return Ss(Yd,tc,e),()=>{Yd.removeEventListener(tc,e)}}}else Ul.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),sc({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var S=()=>{l.schedule!==Tl.Always&&p(!1),setTimeout((()=>{y(!1)}),200)};return od(Ca,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&od("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===xl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:oc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&od(ac,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:S,onCloseConfirmationMessage:S,surveyLanguage:c})]})}var hc=t=>{var e=t.question,i=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case kl.Open:return Sa(Sd,r({},s,{question:e,key:e.id}));case kl.Link:return Sa(kd,r({},s,{question:e,key:e.id}));case kl.Rating:return Sa(Cd,r({},s,{question:e,key:e.id}));case kl.SingleChoice:case kl.MultipleChoice:return Sa(Ed,r({},s,{question:e,key:e.id}));default:return Ul.error("Unsupported question type: "+e.type),null}};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.generateSurveys=nc,ea.extendPostHogWithSurveys=nc;var dc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),cc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return dc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return dc(e,JSON.stringify(t.slice(0,n)),r)},vc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,fc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},pc=(t,e,r)=>{if(!r.truncated)if(Tr(t)){if(r.seen.has(t))return void fc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(pc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else fc(e,t,r)},gc=function(t,e,r,i,n,s){if(void 0===n&&(n=!1),!vc(t))return!n||dc(e,"null",r);if(Or(t)||(t=>{try{return $r(t)||Ar(t)}catch(t){return!1}})(t))return dc(e,JSON.stringify(t),r);if("string"==typeof t)return cc(t,e,r);if(!Tr(t)&&!kr(t))return dc(e,JSON.stringify(t),r);if(i.has(t))return cc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(Cr(o))return gc(o.call(t),e,r,i,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return cc(String(t.valueOf()),e,r);if("[object Number]"===a||"[object Boolean]"===a)return dc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return gc(l,e,r,i,n,s)}if(kr(t)){if(!dc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!dc(e,",",r))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!gc(d,e,r,i,!0))return!1}return dc(e,"]",r)}if(!dc(e,"{",r))return!1;var c=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(s)try{pc(f,v,s)}catch(t){}if(vc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!dc(e,p,r))return!1;var _=e.length,b=gc(f,e,r,i,!1),w=r.truncated;if(e.length!==_){if(c=!1,!b)return!1}else if(e.length=g,r.remaining=m,r.truncated=b?y:w,!b)return!1}}}catch(t){}return dc(e,"}",r)},mc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.logs={initializeLogs(t){var e={host:ea.location.host},i=!1,n=function(n){var s=ea.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&&t.is_capturing()){var h;i=!0,o=!0;var d=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Tr(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||dc(r," ",i))&&gc(t[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({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.le({level:mc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(t){}finally{o&&(i=!1),s.apply(ea.console,l)}})(s);o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),ea.console[n]=o};for(var s of Object.keys(mc))n(s)}};var yc=vs("[Error tracking]");function _c(){return new wn([new Ln,new zn,new Fn,new An,new Bn,new jn,new Dn,new Hn],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Pn.test(l)?l.replace(Pn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=$n)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,$n).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||xn});var i}))}(s)}}("web:javascript",In,On))}var bc=vs("[ExceptionAutocapture]"),wc=_c(),xc={wrapOnError(t){var e=Yn;e||bc.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){var e,i=wc.buildFromUnknown((arguments.length>4?arguments[4]:void 0)||(arguments.length>0?arguments[0]:void 0),{mechanism:{handled:!1}});return t(i),!!Cr(r)&&null!==(e=r(...arguments))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection(t){var e=Yn;e||bc.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=wc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Cr(r)&&null!==(i=r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||bc.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=wc.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),Cr(r)&&r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.errorWrappingFunctions=xc,ea.posthogErrorWrappingFunctions=xc;var Sc="X-POSTHOG-SESSION-ID",kc="X-POSTHOG-WINDOW-ID",Cc="X-POSTHOG-DISTINCT-ID",Tc=[Sc,kc,Cc],Ec=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Ic=(t,e)=>({}.hasOwnProperty.call(t,e)),Mc=t=>"object"==typeof t&&!Or(t)||Cr(t),Rc=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Oc=t=>{try{var e;return Rc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==Yn||null==(e=Yn.location)?void 0:e.href).toString()}catch(t){return}},Pc=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(kr(t)&&!t.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Sc,a.sessionId),n.set(kc,l),o=!0}var u=(t=>Cr(t)?t():t)(e);return u&&u!==Wu&&(n.set(Cc,u),o=!0),o};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{};var $c={_patchFetch:(t,e,i)=>Ls(Yn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=Oc(s);if(u)if(Rc(s)){var h=new Request(s,o);Pc(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(Mc(o)?o.headers:void 0);if(Pc(t,e,i,u,d)){var c=((t,e)=>{if(Ir(t)||Or(t))return{headers:e};if(Mc(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>Ic(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Ic(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Ec.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&Ec.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(t){l=a}return n.apply(this,l)})),_patchXHR:(t,e,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=Oc(s);d&&Pc(t,e,r,d,h);var c=i.call(u,n,s,o,a,l);return Tc.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),c}))};ea.__PosthogExtensions__.tracingHeadersPatchFns=$c,ea.postHogTracingHeadersPatchFns=$c,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var Lc=-1,Ac=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Lc=e.timeStamp,t(e))}),!0)},Fc=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Nc=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Dc=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},qc=()=>{var t,e;return null!==(t=null==(e=Dc())?void 0:e.activationStart)&&void 0!==t?t:0},Uc=function(t,e){void 0===e&&(e=-1);var r=Dc(),i="navigate";return 0>Lc?r&&(document.prerendering||qc()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},jc=new WeakMap;function Bc(t,e){var r=jc.get(e);return r||(r=new WeakMap,jc.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Hc{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var zc,Wc=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Vc=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Zc=-1,Gc=new Set,Qc=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Jc=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Gc)e();isFinite(Zc)||(Zc="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Jc,!0))}},Kc=()=>{if(0>Zc){var t,e=qc(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Zc=null!=r?r:Qc(),addEventListener("visibilitychange",Jc,!0),addEventListener("prerenderingchange",Jc,!0),Ac((()=>{setTimeout((()=>{Zc=Qc()}))}))}return{get firstHiddenTime(){return Zc},onHidden(t){Gc.add(t)}}},Yc=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xc=[1800,3e3],tv=function(t,e){void 0===e&&(e={}),Yc((()=>{var r,i=Kc(),n=Uc("FCP"),s=Wc("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-qc(),0),n.entries.push(e),r(!0)))}));s&&(r=Fc(t,n,Xc,e.reportAllChanges),Ac((i=>{n=Uc("FCP"),r=Fc(t,n,Xc,e.reportAllChanges),Nc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},ev=[.1,.25],rv=0,iv=1/0,nv=0,sv=t=>{for(var e of t)e.interactionId&&(iv=Math.min(iv,e.interactionId),nv=Math.max(nv,e.interactionId),rv=nv?(nv-iv)/7+1:0)},ov=()=>{var t;return zc?rv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},av=0;class lv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){av=ov(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((ov()-av)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.u.get(t.interactionId);if(i||10>this.l.length||t.duration>r.L){var n;if(i?t.duration>i.L?(i.entries=[t],i.L=t.duration):t.duration===i.L&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.u.set((i={id:t.interactionId,entries:[t],L:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.L-t.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 uv=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=Vc(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},hv=[200,500];class dv{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var cv=[2500,4e3],vv={onLCP(t,e){void 0===e&&(e={}),Yc((()=>{var r,i=Kc(),n=Uc("LCP"),s=Bc(e,dv),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-qc(),0),n.entries=[o],r())},a=Wc("largest-contentful-paint",o);if(a){r=Fc(t,n,cv,e.reportAllChanges);var l=Vc((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(uv(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Ac((i=>{n=Uc("LCP"),r=Fc(t,n,cv,e.reportAllChanges),Nc((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Kc();tv(Vc((()=>{var i,n=Uc("CLS",0),s=Bc(e,Hc),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Wc("layout-shift",o);a&&(i=Fc(t,n,ev,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Ac((()=>{s.i=0,n=Uc("CLS",0),i=Fc(t,n,ev,e.reportAllChanges),Nc(i)})),setTimeout(i))})))},onFCP:tv,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Kc();Yc((()=>{var i;"interactionCount"in performance||zc||(zc=Wc("event",sv,{durationThreshold:0}));var n,s=Uc("INP"),o=Bc(e,lv),a=t=>{uv((()=>{for(var e of t)o.h(e);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=Wc("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Fc(t,s,hv,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Ac((()=>{o.v(),s=Uc("INP"),n=Fc(t,s,hv,e.reportAllChanges)})))}))}}};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.postHogWebVitalsCallbacks=vv,ea.postHogWebVitalsCallbacks=vv,ea.__PosthogExtensions__.loadWebVitalsCallbacks=()=>vv;class fv{constructor(t){this.disabled=!1===t;var e=Tr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var pv="$copy_autocapture",gv=vs("[AutoCapture]");function mv(t,e){return e.length>t?e.slice(0,t)+"...":e}function yv(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Hs(e));return e}function _v(t,e){var i,n,s=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!Hs(t))return{props:{}};for(var d=[t],c=new Set([t]),v=t;v.parentNode&&!zs(v,"body")&&Zs>d.length;)if(Vs(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!Hs(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={},_=!1,b=!1;if(ps(d,(t=>{var e=fo(t);if(zs(t,"a")){var r=t.getAttribute("href");_=!!(e&&r&&xo(r))&&(h?tn(r):r)}mr(Js(t),"ph-no-capture")&&(b=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};to.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?mv(1024,So(t)):mv(1024,Ys(t)));var a=Js(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),ps(t.attributes,(function(r){var s;if((!po(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&xo(r.value)&&(!Mr(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]=mv(1024,"href"===r.name&&n?tn(a):a)}}));for(var l=1,u=1,h=t;h=yv(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var i=function(t){if(!fo(t))return{};var e={};return ps(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&xo(i)&&(e[r]=i)}})),e}(t);gs(y,i)})),b)return{props:{},explicitNoCapture:b};if(a||(m[0].$el_text=zs(t,"a")||zs(t,"button")?So(t):Ys(t)),_){var w,x;m[0].attr__href=_;var S=null==(w=Ts(_))?void 0:w.host,k=null==Yn||null==(x=Yn.location)?void 0:x.host;S&&k&&S!==k&&(p=_)}return{props:gs({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return ms(o).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Co(t[0].toString())]=Co(e.toString())})),(n+=":")+ms(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:To(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ms(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[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 bv={};function wv(t){return function(t,e){var r=bv[t];if(r)return r;var i=e[t];if((t=>Cr(t)&&-1!==t.toString().indexOf("[native code]"))(i)&&(null==Yn||!Yn.Zone))return bv[t]=i.bind(e);var n=e.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[t]&&(i=o[t]),n.head.removeChild(s)}catch(e){cs.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return i&&Cr(i)?bv[t]=i.bind(e):i}("MutationObserver",t)}function xv(t,e){var i=Xs(t);return i?r({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Sv(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function kv(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var Cv="canvas,video,audio,embed,object";function Tv(t,e){return $r(t)&&t>=e}class Ev{ce(t){var e,r,i,n,s,o,a,l,u=this.de((null==t?void 0:t.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.ve=[],this.fe=0,this.de=t=>({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:t}),this.pe=t=>{var e=xv(t,{type:"click"});Or(e)||this.me(e)||this.ve.push(e),this.ye()},this.ge=()=>{var t=Date.now();this.be=t,t%50==0&&this.ve.forEach((e=>{Ir(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.we=()=>{this.xe=Date.now()},this.ke=()=>{"visible"===(null==es?void 0:es.visibilityState)&&(this.Se=Date.now())},this.Ce=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[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=t=>{var e,r=this._e;if(this._e=void 0,!Ir(r)&&this.Te.max_dead_swipes_per_page_load>this.fe){var i=t,n=null==(e=i.changedTouches)?void 0:e[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((t=>$r(t)&&t>=r.timestamp))){var u;if(this.Ee()&&(null!==(u=null==es||null==es.elementsFromPoint?void 0:es.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(Cv))))return;var h=xv(i,{type:"swipe",swipeDirection:Sv(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Or(h)||this.me(h)||this.ve.push(h),this.ye()}}}},this.instance=t,this.Te=this.ce(e),this._onCapture=this.Te.__onCapture}start(t){this.Le(),this.Oe(),this.Ne(),this.qe(),this.Ae(t),this.Te.capture_dead_swipes&&this.Pe()}Ae(t){if(!this.De){var e=wv(ea);this.De=new e((t=>{this.Fe(t)})),this.De.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.De)||t.disconnect(),this.De=void 0,ea.removeEventListener("click",this.pe),ea.removeEventListener("scroll",this.ge,{capture:!0}),ea.removeEventListener("selectionchange",this.we),ea.removeEventListener("touchstart",this.Ce,{capture:!0}),ea.removeEventListener("touchend",this.Me,{capture:!0}),ea.removeEventListener("touchcancel",this.Ie,{capture:!0}),null==es||es.removeEventListener("visibilitychange",this.ke),this._e=void 0}Fe(t){this.Re=Date.now()}Le(){Ss(ea,"click",this.pe)}ye(){this.ve.length&&Ir(this.je)&&(this.je=ea.setTimeout((()=>{this.He()}),1e3))}Oe(){Ss(ea,"scroll",this.ge,{capture:!0})}Ne(){Ss(ea,"selectionchange",this.we)}qe(){Ss(es,"visibilitychange",this.ke)}Pe(){Ss(ea,"touchstart",this.Ce,{capture:!0,passive:!0}),Ss(ea,"touchend",this.Me,{capture:!0,passive:!0}),Ss(ea,"touchcancel",this.Ie,{capture:!0,passive:!0})}Ee(){var t=Ir(this.Be)||$r(this.Re)&&this.Re>this.Be;return(Ir(this.Ue)||t)&&(this.Be=Date.now(),this.Ue=!(null==es||!es.querySelector(Cv))),!!this.Ue}me(t){return!t||("swipe"===t.type?this.We(t):this.Ve(t))}We(t){if(Bs(t.node))return!0;var e=this.ve.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!zs(t.node,"html")&&Hs(t.node)&&function(t,e){var r;if(!Yn||co(t))return!1;var i=Ar(e)?ao:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:ao;return!eo(vo(t,!1).targetElementList,i)}(t.node,{css_selector_ignorelist:this.Te.css_selector_ignorelist}))}Ve(t){return!(this.Te.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.We(t)||(r=t.node,!(!Yn||co(r))&&vo(r,!1).targetElementList.some((t=>zs(t,"a"))));var e,r}He(){if(this.ve.length){clearTimeout(this.je),this.je=void 0;var t=this.ve;for(var e of(this.ve=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Re&&this.Re>=e.timestamp?this.Re-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.xe&&this.xe>=e.timestamp?this.xe-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Se?Math.abs(e.timestamp-this.Se):void 0;var i=Tv(e.scrollDelayMs,this.Te.scroll_threshold_ms),n=Tv(e.selectionChangedDelayMs,this.Te.selection_change_threshold_ms),s=Tv(e.mutationDelayMs,this.Te.mutation_threshold_ms),o=Tv(e.absoluteDelayMs,1.1*this.Te.mutation_threshold_ms),a=$r(e.scrollDelayMs)&&this.Te.scroll_threshold_ms>e.scrollDelayMs,l=$r(e.mutationDelayMs)&&this.Te.mutation_threshold_ms>e.mutationDelayMs,u=$r(e.selectionChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.selectionChangedDelayMs,h=$r(e.visibilityChangedDelayMs)&&this.Te.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=Tv(e.visibilityChangedDelayMs,this.Te.selection_change_threshold_ms);if(i||s||o||n||d){var c=kv(e);if("$dead_swipe"===c){if(this.fe>=this.Te.max_dead_swipes_per_page_load)continue;this.fe++}this._onCapture(e,{[c+"_last_mutation_timestamp"]:this.Re,[c+"_event_timestamp"]:e.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>e.absoluteDelayMs&&this.ve.push(e)}}this.ye()}}he(t,e){var i=kv(t);this.instance.capture(i,r({},e,_v(t.node,{e:t.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"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Ev(t,e);var Iv=vs("[ExternalScriptsLoader]"),Mv=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Iv.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==es?void 0:es.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!es)return r("document not found");var i=es.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)es.head.appendChild(i);else{var n,s=es.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):es.body.appendChild(i)}};null!=es&&es.body?a():null==es||es.addEventListener("DOMContentLoaded",a)};ea.__PosthogExtensions__=ea.__PosthogExtensions__||{},ea.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.strict_script_versioning)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}Mv(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Mv(t,o,r)}},ea.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);Mv(t,i,r)};hs.DEBUG=!1,hs.LIB_VERSION="1.407.8",hs.LIB_NAME="web";class Rv{constructor(t){this._instance=t}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===Yu||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===Ku}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(t){this.Jt.q(this.Kt,t?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 t=this._instance.config,e=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+e:"__ph_opt_in_out_"+e)}get Qt(){var t=this.Jt.A(this.Kt);return Hr(t)?1:mr(zr,t)?0:-1}get Jt(){var t=this.Te.opt_out_capturing_persistence_type,e="localStorage"===t?Ch:Sh;if(!this.Yt||this.Yt!==e){this.Yt=e;var r="localStorage"===t?Sh:Ch;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(Hr(r.A(this.Kt))),r.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[null==ts?void 0:ts.doNotTrack,null==ts?void 0:ts.msDoNotTrack,ea.doNotTrack].some((t=>Hr(t)))}}var Ov=vs("[Dead Clicks]"),Pv=()=>!0,$v=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(au)),i=t.instance.config.capture_dead_clicks;return Ar(i)?i:!!Tr(i)||r};class Lv{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[au]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Ov.error("failed to load script",e):t()}))}tr(){var t;if(es){if(!this.Xt&&null!=(t=ea.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Tr(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Xt=ea.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xt.start(es),Ov.info("starting...")}}else Ov.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Ov.info("stopping..."))}}var Av=vs("[SegmentIntegration]");var Fv="posthog-js";function Nv(t,e){var i=void 0===e?{}:e,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 e=>{var i,a,u,d,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Dv{constructor(t,e,r,i,n,s){this.name=Fv,this.setupOnce=function(o){o(Nv(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class qv{constructor(t){this.rr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(cs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.nr()}nr(){var t;this.sr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.rr)}destroy(){var t;null==(t=this.sr)||t.call(this),this.sr=void 0}doPageView(t,e){var r,i=this.ar(t,e);return this.ir={pathname:null!==(r=null==Yn?void 0:Yn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.ar(t,null==(e=this.ir)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ir)?void 0:t.pageViewId}}ar(t,e){var r=this.ir;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$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(!(Ir(s)||Ir(o)||Ir(a)||Ir(l)||Ir(u)||Ir(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?Wr(o/s,0,1,cs):1,c=s>1?Wr(a/s,0,1,cs):1,v=l>1?Wr(u/l,0,1,cs):1,f=l>1?Wr(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=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Uv=["flags","surveys"],jv={[Jl]:{exposure:"hidden"},[Xl]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tu]:{exposure:"hidden"},[eu]:{exposure:"event"},[ru]:{exposure:"hidden"},[iu]:{exposure:"event"},[nu]:{exposure:"hidden"},[su]:{exposure:"event"},[ou]:{exposure:"event"},[au]:{exposure:"event"},[lu]:{exposure:"hidden"},[uu]:{exposure:"event"},[hu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[gu]:{exposure:"hidden"},[mu]:{exposure:"event"},[du]:{exposure:"event",shouldSkipFromEventProperties:t=>Or(t)},$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"},[yu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Tr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[_u]:{exposure:"event",storageGroup:"flags"},[bu]:{exposure:"hidden"},[wu]:{exposure:"hidden",storageGroup:"flags"},[xu]:{exposure:"event",storageGroup:"flags"},[Su]:{exposure:"event",storageGroup:"flags",volatile:!0},[ku]:{exposure:"hidden",storageGroup:"flags"},[Cu]:{exposure:"event"},[Tu]:{exposure:"hidden"},[Eu]:{exposure:"hidden"},[Iu]:{exposure:"hidden"},[Mu]:{exposure:"hidden",storageGroup:"surveys"},[Ru]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Ou]:{exposure:"event"},[Pu]:{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"},[Lu]:{exposure:"hidden"},[Au]:{exposure:"hidden"},[Fu]:{exposure:"hidden"},[Nu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Du]:{exposure:"hidden"},[qu]:{exposure:"hidden"},[Uu]:{exposure:"hidden"},[ju]:{exposure:"hidden"},[Bu]:{exposure:"hidden"},[Hu]:{exposure:"hidden"},[zu]:{exposure:"hidden"},[cu]:{exposure:"event"},[vu]:{exposure:"event"},[fu]:{exposure:"event"},[pu]:{exposure:"event"},[Zu]:{exposure:"event"},[Gu]:{exposure:"event"},[Qu]:{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"}},Bv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Hv=t=>{var e=jv[t];if(e)return e;for(var r of Bv){var i=r[1];if(0===t.indexOf(r[0]))return i}},zv={flags:Nu,surveys:Ru},Wv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Vv="main";class Zv{constructor(t,e,i){if(void 0===i&&(i=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=t,this.dr=i,this.props={},this.cr=!1,this.vr=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.Jt=this.pr(t),this.hr=this.gr(t),this.load(),t.debug&&cs.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),Yn){var n=()=>this.flush();Ss(Yn,"beforeunload",n,{capture:!1}),Ss(Yn,"pagehide",n,{capture:!1})}}mr(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return $r(e)&&e>0?e:0}isDisabled(){return!!this.yr}pr(t){-1===Wv.indexOf(t.persistence.toLowerCase())&&(cs.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...Th,...t];return r({},Ch,{F(t){try{var r={};try{r=Sh.F(t)||{}}catch(t){}var i,n=JSON.parse(Ch.A(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];Or(a)||""===a||(s[o]=a)}i=gs(n,s)}else i=gs(r,n);return Ch.q(t,i),i}catch(t){}return null},q(t,e,r,n,s,o){var a=Ch.q(t,e,void 0,void 0,o);try{var l={};i.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Sh.q(t,l,r,n,s,o)}catch(t){Ch.D(t)}return a},P(t,e){try{null==Yn||Yn.localStorage.removeItem(t),Sh.P(t,e)}catch(t){Ch.D(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&Ch.N()?(e=Ch,n=!0):"localstorage+cookie"===s&&i.N()?(e=i,n=!0):"sessionstorage"===s&&Rh.N()?e=Rh:"memory"===s?e=Ih:"cookie"===s?e=Sh:i.N()?(e=i,n=!0):e=Sh,this.ur=n,e}br(t){return this.vr+"__"+t}gr(t){return this.ur&&!!t.split_storage}_r(t){var e=null!=t?t:this.Te.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Nu];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return ps(this.props,((e,r)=>{var i=Hv(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===yu?()=>this._r():()=>!1))return;i.transformToEventProperties&&gs(t,i.transformToEventProperties(e))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,(()=>!1)))return;t[r]=e}})),t}load(){if(!this.yr){var t=this.Jt.F(this.vr);t&&(this.props=gs({},t)),this.hr&&this.wr()}}wr(){for(var t of Uv){var e=Ch.F(this.br(t));if(e&&!Er(e)){var r=this.kr(t);r.persisted=!0,this.Sr(t)||(r.fingerprint=this.Cr(e,t)),this.Tr(t,e)||gs(this.props,e)}}}Sr(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=Hv(e))?void 0:r.storageGroup)===t}))}Tr(t,e){var r=zv[t];if(!r)return!1;var i=e[r],n=this.props[r];return $r(i)&&$r(n)&&n>i}refreshKey(t){var e;if(!this.yr){var r=this.hr?null==(e=Hv(t))?void 0:e.storageGroup:void 0,i=r?Ch.F(this.br(r)):this.Jt.F(this.vr);if(i&&t in i)this.Ir(t,i[t]);else{if(r){var n=this.Jt.F(this.vr);if(n&&t in n)return void this.Ir(t,n[t])}this.Mr(t)}}}save(){if(!this.yr){var t=this.mr();t>0?Ir(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),t)):this.Rr()}}flush(){Ir(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,Vv))}Pr(){var t=this.Fr(),e=t.main,r=t.groups;for(var i of(this.Or(this.Jt,this.vr,e,Vv),Uv)){var n,s=r[i];(!Er(s)||null!=(n=this.lr[i])&&n.persisted)&&this.Or(Ch,this.br(i),s,i)}}Fr(){var t={},e={flags:{},surveys:{}};return ps(this.props,((r,i)=>{var n,s=null==(n=Hv(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Cr(t,e){if(e===Vv)return JSON.stringify(t)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return ps(t,((t,e)=>{var i;r[e]=null!=(i=Hv(e))&&i.volatile?"__volatile__":t})),JSON.stringify(r)}Or(t,e,r,i){var n=this.kr(i);if(i===Vv||n.dirty||Ir(n.fingerprint)){var s;try{if((s=this.Cr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.q(e,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(n.dirty=!1,i!==Vv&&(n.persisted=!0),Ir(s)||(n.fingerprint=s)):this.Te.debug&&cs.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,r=void 0!==e&&e;if(Ir(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 Uv)Ch.P(this.br(i));r?delete this.lr[Vv]:this.lr={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Tr(t)){Ir(e)&&(e="None"),this.Lr=Ir(r)?this.Nr:r;var i=!1;if(ps(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Ir(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Tr(t)){this.Lr=Ir(e)?this.Nr:e;var r=!1;if(ps(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Ir(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Mr(t),this.save())}update_campaign_params(){if(!this.cr){var t=Ud(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Er(bs(t))||this.register(t),this.cr=!0}}update_search_keyword(){var t;this.register((t=null==es?void 0:es.referrer)?Bd(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Wd(),$referring_domain:null!=es&&es.referrer&&(null==(t=Ts(es.referrer))?void 0:t.host)||zd},void 0)}set_initial_person_info(){this.props[ju]||this.props[Bu]||this.register_once({[Hu]:Vd(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};ps([Bu,ju],(e=>{var r=this.props[e];r&&ps(r,(function(e,r){t["$initial_"+_r(r)]=e}))}));var e=this.props[Hu];if(e){var r=function(t,e){void 0===e&&(e=!1);var r=Zd(t,e),i={};return ps(r,(function(t,e){i["$initial_"+_r(e)]=t})),i}(e,this.Te.disable_capture_url_hashes);gs(t,r)}return t}safe_merge(t){return ps(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Nr=this.Lr=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),n=i?this.pr(t):this.Jt,s=this.gr(t);if(i||s!==this.hr){var o=this.props;this.clear(),this.Jt=n,this.hr=s,this.props=o,this.save()}}set_disabled(t){this.yr=t,this.yr?this.remove():this.save()}set_cross_subdomain(t){t!==this.$r&&(this.$r=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ar&&(this.Ar=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[tu]||{};r[t]=e,this.Ir(tu,r),this.save()}remove_event_timer(t){var e=this.props[tu]||{},r=e[t];return Ir(r)||(delete e[t],this.Ir(tu,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Ir(t,e),this.save()}Ir(t,e){var r;this.props[t]=e,null!=(r=Hv(t))&&r.volatile||this.Dr(t)}Mr(t){delete this.props[t],this.Dr(t)}Dr(t){var e,r=null==(e=Hv(t))?void 0:e.storageGroup;r&&(this.kr(r).dirty=!0)}kr(t){return this.lr[t]||(this.lr[t]={})}}var Gv={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Qv={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Jv={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Kv=vs("[RateLimiter]");class Yv{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{Kv.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Kv.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(Uu))&&void 0!==e?e:{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||t||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||t||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(Uu,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Xv=vs("[RemoteConfig]");class tf{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=ea._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}qr(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}jr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return Xv.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Xv.warn("Remote config is disabled. Falling back to local config.");this.qr((t=>{if(!t)return Xv.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((t=>{this.Hr(t),this.Br()}));this.Hr(t),this.Br()}))}catch(t){Xv.error("Error loading remote config",t)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&es&&"hidden"!==es.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var t;if(!this.zr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.zr=setInterval((()=>{this.refresh()}),e))}}Hr(t){var e;t||Xv.error("Failed to fetch remote config from PostHog."),this._instance.Hr(t?{ok:!0,config:t}:{ok:!1}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var ef=["fatal","error","warning","log","info","debug"],rf=Uint8Array,nf=Uint16Array,sf=Uint32Array,of=new rf([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]),af=new rf([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]),lf=new rf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uf=function(t,e){for(var r=new nf(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new sf(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]},hf=uf(of,2),df=hf[1];hf[0][28]=258,df[258]=28;for(var cf=uf(af,0)[1],vf=new nf(32768),ff=0;32768>ff;++ff){var pf=(43690&ff)>>>1|(21845&ff)<<1;vf[ff]=((65280&(pf=(61680&(pf=(52428&pf)>>>2|(13107&pf)<<2))>>>4|(3855&pf)<<4))>>>8|(255&pf)<<8)>>>1}var gf=function(t,e,r){for(var i=t.length,n=0,s=new nf(e);i>n;++n)++s[t[n]-1];var o,a=new nf(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new nf(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[vf[d]>>>l]=u}else for(o=new nf(i),n=0;i>n;++n)o[n]=vf[a[t[n]-1]++]>>>15-t[n];return o},mf=new rf(288);for(ff=0;144>ff;++ff)mf[ff]=8;for(ff=144;256>ff;++ff)mf[ff]=9;for(ff=256;280>ff;++ff)mf[ff]=7;for(ff=280;288>ff;++ff)mf[ff]=8;var yf=new rf(32);for(ff=0;32>ff;++ff)yf[ff]=5;var _f=gf(mf,9,0),bf=gf(yf,5,0),wf=function(t){return(t/8>>0)+(7&t&&1)},xf=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof nf?nf:t instanceof sf?sf:rf)(r-e);return i.set(t.subarray(e,r)),i},Sf=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},kf=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Cf=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new rf(0),0];if(1==n){var o=new rf(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.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 nf(c+1),f=Tf(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var _=s[i].s;e>v[_]?p-=1<<e-v[_]++-1:++i}for(;i>=0&&p;--i){var b=s[i].s;v[b]==e&&(--v[b],++p)}f=e}return[new rf(v),f]},Tf=function(t,e,r){return-1==t.s?Math.max(Tf(t.l,e,r+1),Tf(t.r,e,r+1)):e[t.s]=r},Ef=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new nf(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++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=t[a]}return[r.subarray(0,i),e]},If=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Mf=function(t,e,r){var i=r.length,n=wf(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Rf=function(t,e,r,i,n,s,o,a,l,u,h){Sf(e,h++,r),++n[256];for(var d=Cf(n,15),c=d[0],v=d[1],f=Cf(s,15),p=f[0],g=f[1],m=Ef(c),y=m[0],_=m[1],b=Ef(p),w=b[0],x=b[1],S=new nf(19),k=0;y.length>k;++k)S[31&y[k]]++;for(k=0;w.length>k;++k)S[31&w[k]]++;for(var C=Cf(S,7),T=C[0],E=C[1],I=19;I>4&&!T[lf[I-1]];--I);var M,R,O,P,L=u+5<<3,A=If(n,mf)+If(s,yf)+o,F=If(n,c)+If(s,p)+o+14+3*I+If(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&F>=L)return Mf(e,h,t.subarray(l,l+u));if(Sf(e,h,1+(A>F)),h+=2,A>F){M=gf(c,v,0),R=c,O=gf(p,g,0),P=p;var N=gf(T,E,0);for(Sf(e,h,_-257),Sf(e,h+5,x-1),Sf(e,h+10,I-4),h+=14,k=0;I>k;++k)Sf(e,h+3*k,T[lf[k]]);h+=3*I;for(var D=[y,w],q=0;2>q;++q){var U=D[q];for(k=0;U.length>k;++k)Sf(e,h,N[j=31&U[k]]),h+=T[j],j>15&&(Sf(e,h,U[k]>>>5&127),h+=U[k]>>>12)}}else M=_f,R=mf,O=bf,P=yf;for(k=0;a>k;++k)if(i[k]>255){var j;kf(e,h,M[257+(j=i[k]>>>18&31)]),h+=R[j+257],j>7&&(Sf(e,h,i[k]>>>23&31),h+=of[j]);var B=31&i[k];kf(e,h,O[B]),h+=P[B],B>3&&(kf(e,h,i[k]>>>5&8191),h+=af[B])}else kf(e,h,M[i[k]]),h+=R[i[k]];return kf(e,h,M[256]),h+R[256]},Of=new sf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pf=function(){for(var t=new sf(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),$f=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Lf(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Pf[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new rf(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Mf(l,u,t.subarray(h,d)):(l[h]=!0,u=Mf(l,u,t.subarray(h,o)))}else{for(var c=Of[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new nf(32768),m=new nf(p+1),y=Math.ceil(r/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new sf(25e3),x=new nf(288),S=new nf(32),k=0,C=0,T=(h=0,0),E=0,I=0;o>h;++h){var M=b(h),R=32767&h,O=m[M];if(g[R]=O,m[M]=R,h>=E){var P=o-h;if((k>7e3||T>24576)&&P>423){u=Rf(t,l,0,w,x,S,C,T,I,h-I,u),T=k=C=0,I=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)S[L]=0}var A=2,F=0,N=f,D=R-O&32767;if(P>2&&M==b(h-D))for(var q=Math.min(v,P)-1,U=Math.min(32767,h),j=Math.min(258,P);U>=D&&--N&&R!=O;){if(t[h+A]==t[h+A-D]){for(var B=0;j>B&&t[h+B]==t[h+B-D];++B);if(B>A){if(A=B,F=D,B>q)break;var H=Math.min(D,B-2),z=0;for(L=0;H>L;++L){var W=h-D+L+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,O=W)}}}D+=(R=O)-(O=g[R])+32768&32767}if(F){w[T++]=268435456|df[A]<<18|cf[F];var Z=31&df[A],G=31&cf[F];C+=of[Z]+af[G],++x[257+Z],++S[G],E=h+A,++k}else w[T++]=t[h],++x[t[h]]}}u=Rf(t,l,!0,w,x,S,C,T,I,h-I,u)}return xf(a,0,i+wf(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(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&$f(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),$f(l,u-8,r.d()),$f(l,u-4,i),l}var Af=!!ns||!!is,Ff="text/plain",Nf=!1,Df=(t,e)=>{var r=t.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},qf=function(t,e,i){var n;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=r({},e),u=null!==(n=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Es(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Uf=t=>{if(t.Vr)return t.Vr;var e=t.data,r=t.compression;if(e){if(r===yl.GZipJS){var i=Lf(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new rf(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new rf(n+8+(r-o<<1));a.set(i),i=a}var l=t.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&t.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 xf(i,0,n)}(Cs(e)),{mtime:0});return{contentType:Ff,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===yl.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Cs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Cs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Cs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},jf=t=>{var e,i,n=()=>"sendBeacon"===t.transport?{url:qf(t.url,{compression:yl.Base64}),encodedBody:Uf(r({},t,{compression:yl.Base64,Vr:void 0}))}:{url:Df(t.url,"compression"),encodedBody:Uf(r({},t,{compression:void 0,Vr:void 0}))};try{e=Uf(t)}catch(e){if(hr(t.compression,Is(t.url,"compression")))return cs.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&hr(t.compression,Is(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?ur(new Uint8Array(i)):ArrayBuffer.isView(i)&&ur(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Nf=!0,n()):{url:t.url,encodedBody:e}},Bf=t=>{try{return jf(t)}catch(e){return cs.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Hf=function(){var t=e((function*(t){var e=Cs(t.data),i=yield function(t,e,r){return fr.apply(this,arguments)}(e,hs.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{Vr:{contentType:Ff,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),zf=/Failed to fetch|NetworkError|Load failed/i,Wf=t=>{var e=Bf(t);if(e){var i=e.url,n=e.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;ps(t.headers,(function(t,e){u.append(e,t)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(ss){var c=new ss;h={signal:c.signal,timeout:setTimeout((()=>{var e,r;d=!0,c.abort((e=t.timeout,(r=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",r))}),t.timeout)}}var v=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&zf.test((null==t?void 0:t.message)||""))(e)?cs.warn(e):cs.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;is(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Wr&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){cs.error(t)}null==t.callback||t.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),v(t)}}},Vf=t=>{try{var e,i=jf(t),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(ts.sendBeacon(n,u))return;var h=kr(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(kr(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=e=>kr(t.data)?e:r({},t.data,{batch:e});return Vf(r({},t,{data:c(h.slice(0,d))})),void Vf(r({},t,{data:c(h.slice(d))}))}cs.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Wf(r({},t,{Wr:!0}))}catch(t){cs.warn("Beacon send failed",t)}},Zf=(t,e,i,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return qf(i===yl.GZipJS?Df(t,"compression"):t,r({},s?{[s]:Date.now().toString()}:{},i===yl.GZipJS?{}:{compression:i}))},Gf=[];is&&Gf.push({transport:"fetch",method:Wf}),ns&&Gf.push({transport:"XHR",method(t){var e=Bf(t);if(e){var r=new ns,i=e.encodedBody;r.open(t.method||"GET",e.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;ps(t.headers,(function(t,e){r.setRequestHeader(e,t)})),s&&r.setRequestHeader("Content-Type",s),t.timeout&&(r.timeout=t.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(o)}}}),null!=ts&&ts.sendBeacon&&Gf.push({transport:"sendBeacon",method:Vf});var Qf=3e3;class Jf{constructor(t,e){this.Zr=!0,this.Gr=[],this.Qr=Wr((null==e?void 0:e.flush_interval_ms)||Qf,250,5e3,cs.createLogger("flush interval"),Qf),this.Jr=t}enqueue(t){this.Gr.push(t),this.Kr||this.Yr()}unload(){this.Xr();var t=this.Gr.length>0?this.ei():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.ti(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var t=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var e=this.ei(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&kr(r.data)&&ps(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ti(r)};for(var i in e)r()}}),this.Qr))}ti(t){try{this.Jr(t)}catch(t){cs.error(t)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var t={};return ps(this.Gr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;Ir(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Gr=[],t}}var Kf=["retriesPerformedSoFar"];class Yf{constructor(t){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=t,this.Gr=[],this.ni=!0,!Ir(Yn)&&"onLine"in Yn.navigator&&(this.ni=Yn.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ss(Yn,"online",this.si),Ss(Yn,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=i(t,Kf);Lr(e)&&(n.url=qf(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.kt(r({retriesPerformedSoFar:e},n));0===t.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!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}kt(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.Gr.push({retryAt:i,requestOptions:t});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 t=Date.now(),e=[],r=this.Gr.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.Gr=e,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Ir(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 e=t.requestOptions;try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(t){cs.error(t)}}this.Gr=[]}}class Xf{constructor(t){this.hi=()=>{var t,e,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!==(t=this.di.maxScrollY)&&void 0!==t?t:0),this.di.maxScrollHeight=Math.max(o,null!==(e=this.di.maxScrollHeight)&&void 0!==e?e: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=t}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var t=this.di;return setTimeout(this.hi,0),t}startMeasuringScrollPosition(){Ss(Yn,"scroll",this.hi,{capture:!0}),Ss(Yn,"scrollend",this.hi,{capture:!0}),Ss(Yn,"resize",this.hi)}scrollElement(){if(!this.ci)return null==Yn?void 0:Yn.document.documentElement;var t=kr(this.ci)?this.ci:[this.ci];for(var e of t){var r=null==Yn?void 0:Yn.document.querySelector(e);if(r)return r}}vi(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[e]||0}return Yn?"y"===t?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 tp=t=>Vd(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class ep{constructor(t,e,r,i){this.fi=t=>{var e=this.pi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.gi(this._instance)};this.mi.register({[qu]:r})}},this._instance=t,this.yi=e,this.mi=r,this.gi=i||tp,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[qu]}getSetOnceProps(){var t,e=null==(t=this.pi())?void 0:t.props;return e?"r"in e?Zd(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return ps(bs(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+_r(r)]=e})),t}}class rp{on(t,e){return this.bi[t]||(this.bi[t]=[]),this.bi[t].push(e),()=>{this.bi[t]=this.bi[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.bi[t]||[])r(e);for(var i of this.bi["*"]||[])i(t,e)}constructor(){this.bi={}}}var ip=vs("[SessionId]");class np{on(t,e){return this.wi.on(t,e)}constructor(t,e,r){var i;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new rp,this.Ti=(t,e)=>!(!Lr(t)||!Lr(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Yu)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=t.config,this.mi=t.persistence,this.Ii=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=e||vh,this.Ri=r||vh;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Wr(this.Te.session_idle_timeout_seconds||1800,60,36e3,ip.createLogger("session_idle_timeout_seconds"),1800),t.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=Rh.F(this.Oi),o=Rh.F(this.Fi);s&&!o?this.Ii=s:Rh.P(this.Oi),Rh.q(this.Fi,!0)}if(null!=(i=this.Te.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){ip.error("Invalid sessionID in bootstrap",t)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ir(this.ki)&&(this.ki=[]),this.ki.push(t),this.Mi&&t(this.Mi,this.Ii),()=>{this.ki=this.ki.filter((e=>e!==t))}}Li(){return"memory"!==this.Te.persistence&&!this.mi.yr&&Rh.N()}Ni(t){t!==this.Ii&&(this.Ii=t,this.Li()&&Rh.q(this.Oi,t))}Di(){return this.Ii?this.Ii:this.Li()?Rh.F(this.Oi):null}qi(t){var e=this.xi;return!Or(e)&&!Or(t)&&5e3>Math.abs(t-e)}$i(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Mi=t,n&&!i||n&&this.qi(e)||(this.xi=e,this.mi.register({[gu]:[e,t,r]}))}ji(){var t,e=null==(t=this.Te)?void 0:t.persistence_save_debounce_ms;return Lr(e)&&e>0}Hi(){this.ji()?this.mi.refreshKey(gu):(this.mi.flush(),this.mi.load())}Bi(){var t;if(!Or(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var e=this.Ui();e[1]===this.Mi&&e[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[gu]:[this._sessionActivityTimestamp,null!==(t=this.Mi)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var t=this.Ui()[0],e=Lr(t)?t:0,r=Lr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}Vi(t){return this.Hi(),this.Ti(t,this.zi())}Ui(){var t=this.mi.props[gu];return kr(t)&&2===t.length&&t.push(t[0]),t||[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(ih,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Rh.P(this.Fi)},Ss(Yn,ih,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Te.cookieless_mode===Yu)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(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&&!t&&this.Ti(r,o);if(v){(v=this.Vi(r))||ip.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(),ip.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)&&(ip.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=Lr(o)&&t&&!l?o:r,g=Lr(s)?s:(new Date).getTime();this.Ni(a),this.$i(n,p,g),t||this.Pi();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.ki.forEach((t=>t(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 t=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:t})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var sp=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&gr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>gr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function op(){return op=e((function*(){var t=null==ts?void 0:ts.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Mr(r)&&r.length>0?r:void 0}catch(t){return void cs.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),op.apply(this,arguments)}var ap="custom",lp="i.posthog.com",up=/^\/static\//;class hp{constructor(t){this.Zi={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+lp,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}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":ap),this.Zi[this.apiHost]}Gi(t){if(up.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var r=this.Gi(e);if(r)return""+r+e}if(this.region===ap)return this.apiHost+e;var i=lp+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var dp=vs("[PostHog ExternalIntegrations]"),cp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class vp{constructor(t){this._instance=t}er(t,e){var r;null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return dp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,i,n,s=r[0],o=r[1];!o||null!=(e=ea.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.er(cp[s],(()=>{var e;null==(e=ea.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(i=ea.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=ea.__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;e()}}}var fp={},pp=0,gp=()=>{},mp='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',yp="Surveys module not available",_p="sanitize_properties is deprecated. Use before_send instead",bp="Invalid value for property_denylist config: ",wp=["token","distinct_id",Vu],xp="posthog",Sp=!Af&&-1===(null==as?void 0:as.indexOf("MSIE"))&&-1===(null==as?void 0:as.indexOf("Mozilla")),kp=t=>{var e;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==es?void 0:es.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:gp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:rs&&Mr(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==(e=Yn.location)?void 0:e.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(t){cs.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:eh,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Qf},error_tracking:{},_onCapture:gp},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:so,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},Cp=[["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"]],Tp=t=>{var e={};for(var r of Cp){var i=r[0],n=r[1];Ir(t[i])||(e[n]=t[i])}var s=gs({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ir(o)||(Ir(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Mr(o)&&Ir(t.asset_host)&&(s.asset_host=o)),kr(t.property_blacklist)&&(Ir(t.property_denylist)?s.property_denylist=t.property_blacklist:kr(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:cs.error(bp+t.property_denylist)),s};class Ep{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(t){cs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Ip{Ji(t,e){if(t){var r=this.Ki.indexOf(t);-1!==r&&this.Ki.splice(r,1)}return this.Ki.push(e),null==e.initialize||e.initialize(),e}Yi(){return this.config.cookieless_mode===Yu||this.config.cookieless_mode===Ku&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new Ep,this.Xi=!1,this.version=hs.LIB_VERSION,this.en=new rp,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=kp(),this.SentryIntegration=Dv,this.sentryIntegration=t=>function(t,e){var r=Nv(t,e);return{name:Fv,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new Xf(this),this.pageViewManager=new qv(this),this.rateLimiter=new Yv(this),this.requestRouter=new hp(this),this.consent=new Rv(this),this.externalIntegrations=new vp(this);var e=null!==(t=Ip.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=Mr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Mr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>cs.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==xp){var i,n=null!==(i=fp[r])&&void 0!==i?i:new Ip;return n._init(t,e,r),fp[r]=n,fp[xp][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o=Mr(t)?t.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=kp(e.defaults),e.debug=this.an(e.debug),this.ln=e,this.un=[],e.person_profiles?this.nn=e.person_profiles:e.process_person&&(this.nn=e.process_person);var a=kp(e.defaults),l=Tp(e),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=e.disable_compression?void 0:yl.GZipJS;var h=this.hn();this.persistence=new Zv(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Zv(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 Jf((t=>this.cn(t)),this.config.request_queue_config),this.vn=new Yf(this),this.__request_queue=[];var v=this.Yi();if(v||(this.sessionManager=new np(this),this.sessionPropsManager=new ep(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:e,thisC:r({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var f=e.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(Du);if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===Xu)this.identify(f);else if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===th)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(vh()),y=e.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(Du,e.bootstrap.isIdentifiedID?th:Xu),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:Wu,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(vh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(Du,Xu)}return Ss(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||vh();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Du,th)),e()},n=r.user();"then"in n&&Cr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||Av.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Av.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Av.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,nh),identify:t=>e(t,oh),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.pn())):this.pn(),Cr(this.config._onCapture)&&this.config._onCapture!==gp&&(cs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),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 op.apply(this,arguments)}().then((t=>{t&&this.register({[Yl]:t})})).catch(gp),this}fn(t){var e,i,n,s,o,a,l,u,h=performance.now(),d=r({},Ip.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.Ki.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e: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&&!t&&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((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.gn){var t=this.gn;this.gn=void 0,this.Hr(t)}})),this.mn(c,h)}mn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.mn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){cs.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[Zu]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Gu]:i}),this.config.__preview_deferred_init_extensions&&cs.info("PostHog extensions initialized ("+i+"ms)")}Hr(t){if(!es||!es.body)return cs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=t),this.yn=t,this.compression=void 0,t.ok){var e,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=mr(r.supportedCompression,yl.GZipJS)?yl.GZipJS:mr(r.supportedCompression,yl.Base64)?yl.Base64:void 0),null!=(e=r.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:eh}),this.Ki.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}pn(){try{this.config.loaded(this)}catch(t){cs.critical("`loaded` function failed",t)}if(this.bn(),this.config.internal_or_test_user_hostname&&null!=rs&&rs.hostname){var t=rs.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new tf(this),this.wn.load()}bn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.dn)||t.enable())}_dom_loaded(){this.is_capturing()&&fs(this.__request_queue,(t=>this.cn(t))),this.__request_queue=[],this.bn()}_handle_unload(){var t,e,r,i,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(sh),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.dn)||i.unload(),null==(n=this.vn)||n.unload()):this.xn()&&this.capture(sh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Sp?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Ir(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ir(s.compression)&&s.data&&(s.compression=yl.Base64),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=kr(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(t,e){return void 0===e&&(e=(new Date).toISOString()),kr(t)?t.map((t=>r({},t,{sent_at:e}))):r({},t,{sent_at:e})}(s.data))),s.url=Zf(s.url,s.method,s.compression,s.timestampMode);var c=Gf.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),v=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(c,(t=>t.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.GZipJS&&os&&"undefined"!=typeof Promise&&!Nf?Hf(s).then((t=>{v(t)})).catch((e=>{if(dr(e))return Nf=!0,void v(r({},s,{compression:void 0,url:Zf(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return dr(t)||e===lr})(e)&&(Nf=!0),v(s)})):v(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}cn(t){this.vn?this.vn.retriableRequest(t):this._send_request(t)}_execute_array(t){pp++;try{var e,r=[],i=[],n=[];fs(t,(t=>{if(t)if(kr(e=t[0]))n.push(t);else if(Cr(t))try{t.call(this)}catch(e){cs.error("Error executing queued PostHog call",t,e)}else kr(t)&&"alias"===e?r.push(t):kr(t)&&-1!==e.indexOf("capture")&&Cr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){fs(t,(function(t){try{if(kr(t[0])){var r=e;ps(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){cs.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{pp--}}push(t){if(pp>0&&kr(t)&&Mr(t[0])){var e=Ip.prototype[t[0]];Cr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!Ir(t)&&Mr(t)){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!=e&&e.$current_url&&!Mr(null==e?void 0:e.$current_url)&&(cs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||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,vh),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},c,v)};t===nh&&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"===t&&!1===f.properties.$feature_flag_has_experiment&&!0===this.get_property(ku);(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,t!==ah,t===oh);if(m&&(f.$set_once=m),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>Mr(t)?t.slice(0,s):t,l=new Set,f=function t(e,r){if(e!==Object(e))return a?a(e):e;if(!l.has(e)){var i;if(l.add(e),kr(e))i=[],fs(e,(e=>{i.push(t(e))}));else{var n={};ps(e,((e,r)=>{l.has(e)||(n[r]=t(e,r))})),i=n}return i}}(o)),f.timestamp=c,Ir(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(t,e){void 0===e&&(e=[]);var r={},i=e=>{void 0!==t[e]&&(r[e]=t[e])};return er.forEach(i),e.forEach(i),r}(f.properties,wp)),t===El.DISMISSED||t===El.SENT){var y=null==e?void 0:e[Il.SURVEY_ID],_=null==e?void 0:e[Il.SURVEY_ITERATION];Zl({id:y,current_iteration:_}),f.$set=r({},f.$set,{[$l({id:y,current_iteration:_},t===El.SENT?"responded":"dismissed")]:!0})}else t===El.SHOWN&&(f.$set=r({},f.$set,{[Il.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Qv.SHOWN){var b=null==e?void 0:e[Jv.TOUR_TYPE];b&&(f.$set=r({},f.$set,{[Jv.TOUR_LAST_SEEN_DATE+"/"+b]:(new Date).toISOString()}))}var w=r({},f.properties.$set,f.$set);if(Er(w)||this.setPersonPropertiesForFlags(w),!Pr(this.config.before_send)){var x=this.wt(f);if(!x)return;(f=x).uuid=Xi(f.uuid,vh)}this.en.emit("eventCaptured",f);var S=null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),k={method:"POST",url:S,data:f,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(S)?"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(k):this.dn.enqueue(k),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(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Yi()&&(a[Vu]=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Mr(a.distinct_id)&&!$r(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(t,e,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!as)return{};var l,u=t?[...Fd,...e||[]]:[],h=function(t){for(var e=0;Qi.length>e;e++){var r=Qi[e],i=r[1],n=r[0].exec(t),s=n&&(Cr(i)?i(n,t):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={};Ir(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,_=null==Yn||null==(a=Yn.screen)?void 0:a.height,b=null==Yn?void 0:Yn.devicePixelRatio;Ir(g)||(p.userAgentDataPlatform=g),Ir(m)||(p.maxTouchPoints=m),Ir(y)||(p.screenWidth=y),Ir(_)||(p.screenHeight=_),Ir(b)||(p.devicePixelRatio=b);var w,x=gs(bs({$os:d,$os_version:c,$browser:Vi(as,navigator.vendor,v,f),$device:Ji(as),$device_type:Ki(as,p),$timezone:Gd(),$timezone_offset:Qd()}),{$current_url:Ms(i?tn(null==rs?void 0:rs.href):null==rs?void 0:rs.href,u,Dd),$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:Hd(),$browser_language_prefix:(w=Hd(),"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(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ap&&(a.$lib_custom_api_host=this.config.api_host),u=t!==nh||s?t!==sh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=gs(a,u),t===nh&&es&&(a.title=es.title),!Ir(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"],(t=>{t in p&&delete g[t]})),(a=gs({},h,p,g,a)).$is_identified=this._isIdentified(),kr(this.config.property_denylist)?ps(this.config.property_denylist,(function(t){delete a[t]})):cs.error(bp+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(cs.error(_p),a=m(a,t));var y=this.Cn();return a.$process_person_profile=y,y&&!s&&this.Tn("_calculate_event_properties"),a}Sn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.Cn())return t;if(this.Xi&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=gs({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(cs.error(_p),o=a(o,"$set_once")),e&&(this.Xi=!0),Er(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}In(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e))&&void 0!==r?r:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.en.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:yp}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:yp})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:yp})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=Ql),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:yp}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:yp})}Mn(t){return!t||Rr(t)?(cs.critical("Unique user id has not been set in posthog.identify"),!1):t===Wu?(cs.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(cs.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return cs.uninitializedWarning("posthog.identify");if($r(t)&&(t=t.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(t)&&this.Tn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Kl)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Xl)&&(this.unregister(Xl),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Du)||Xu)===Xu;t!==i&&s?(this.persistence.set_property(Du,th),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(oh,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.sn=gh(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Lu))}}setPersonProperties(t,e){if((t||e)&&this.Tn("posthog.setPersonProperties")){var r=gh(this.get_distinct_id(),t,e);this.sn!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.sn=r):cs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,r=(kr(t)?t:[t]).filter((t=>Mr(t)&&t.length>0));0!==r.length&&this.Tn("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(ah,o)}i&&this.setGroupPropertiesForFlags({[t]: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(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.Tn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,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(Kl),v=this.get_property(Yl),f=this.get_property(hu);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),Ir(f)||null==(d=this.persistence)||d.register({[hu]: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(Du,Xu),null==(h=this.sessionManager)||h.resetSessionId(),this.sn=null,this.config.cookieless_mode===Yu)this.register_once({distinct_id:Wu,$device_id:null},"");else{var p=this.config.get_device_id(vh());this.register_once({distinct_id:p,$device_id:t?p:c},""),t||Ir(v)||this.register({[Yl]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var r=this;return e((function*(){var t,e,i,n,s;r.__loaded?(null==(t=r.logs)||t.flushLogs("sendBeacon"),null==(e=r.metrics)||e.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(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.En()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=e.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.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(t,e){return t===this.get_property(Jl)?(cs.critical("Attempting to create alias for existing People user - aborting."),-2):this.Tn("posthog.alias")?(Ir(e)&&(e=this.get_distinct_id()),t!==e?(this.In(Xl,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(cs.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Tr(t)){var i,n,s,o,a,l,u,h,d,c,v;gs(this.config,Tp(t));var f=this.hn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Zv(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.an(this.config.debug);Ar(p)&&(this.config.debug=p),Ar(this.config.debug)&&(this.config.debug?(hs.DEBUG=!0,Ch.N()&&Ch.q("ph_debug",!0),cs.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(hs.DEBUG=!1,Ch.N()&&Ch.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(t,e){hs.LIB_NAME=t,hs.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.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 t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Ip.On}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:xp;return e!==xp&&(e=xp+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Du))===th||(null==(e=this.sessionPersistence)?void 0:e.get_property(Du))===th}Cn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===eh&&!this._isIdentified()&&Er(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Xl])&&(null==(e=this.persistence)||null==(e=e.props)||!e[zu]))}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(t){return"never"===this.config.person_profiles?(cs.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(zu,!0),!0)}hn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ku)}Pn(){var t,e,r,i,n=this.hn();return(null==(t=this.persistence)?void 0:t.yr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.yr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Yu){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 np(this),this.pageViewManager=new qv(this),this.persistence&&(this.sessionPropsManager=new ep(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=Ip.__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==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ku&&(null==(u=this.surveys)||u.loadIfEnabled()),(Ir(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else cs.warn(mp)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==Yu?(this.config.cookieless_mode===Ku&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Ku&&(this.register({distinct_id:Wu,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.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(mp)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Yu||(this.config.cookieless_mode===Ku?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return ts?sp(ts,this.config.custom_blocked_useragents):void 0}_n(){es&&("visible"===es.visibilityState?this.tn||(this.tn=!0,this.capture(nh,{title:es.title},{send_instantly:!0}),this.rn&&(es.removeEventListener(rh,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),Ss(es,rh,this.rn)))}debug(t){!1===t?(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 t=this.ln||{};return"advanced_disable_flags"in t?!!t.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(t,e,r,i,n){var s=e in t&&!Pr(t[e]),o=r in t&&!Pr(t[r]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r])}(t,"advanced_disable_flags","advanced_disable_decide",0,cs)}wt(t){var e;if(Pr(this.config.before_send))return t;var r=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(Dr),i=kr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of i){if(n=s(n),Pr(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Nr(t.event)?cs.warn(o+". This can cause unexpected behavior."):cs.info(o),null}n.properties&&!Er(n.properties)||cs.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Pr(n.properties[a]))return cs.warn("Event '"+t.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 t;return null==(t=this.pageViewManager.ir)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}an(t){var e=Ar(t)&&!t,r=Ch.N()&&"true"===Ch.A("ph_debug");return!e&&(!!r||t)}}Ip.__defaultExtensionClasses={},Ip.On=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=_s(t.prototype[e[r]])}(Ip,["identify"]);var Mp=vs("[ExceptionAutocapture]"),Rp=vs("[TracingHeaders]"),Op=vs("[Web Vitals]"),Pp=9e5,$p="disabled",Lp="lazy_loading",Ap="awaiting_config",Fp="missing_config";vs("[SessionRecording]"),vs("[SessionRecording]");var Np="[SessionRecording]",Dp=vs(Np),qp=vs("[Heatmaps]");function Up(t){return Tr(t)&&"clientX"in t&&"clientY"in t&&$r(t.clientX)&&$r(t.clientY)}var jp=vs("[Product Tours]"),Bp=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(lu))},Hp=["$set_once","$set"],zp=vs("[SiteApps]"),Wp="Error while initializing PostHog app with config id ";function Vp(t,e,r){if(Pr(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Zp{constructor(t){this.Fn=new rp,this.Ln=(t,e)=>this.$n(t,e)&&this.An(t,e)&&this.Nn(t,e)&&this.Dn(t,e),this.$n=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.qn=new Set,this.jn=new Set}init(){var t,e;Ir(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!Ir(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.jn)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.qn)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.qn.has(t)||this.qn.has(e.event))&&this.jn&&(null==(r=this.jn)?void 0:r.size)>0&&this.jn.forEach((t=>{this.Hn(e,t)&&this.Fn.emit("actionCaptured",t.name)}))}Bn(t){this.onAction("actionCaptured",(e=>t(e)))}Hn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Ln(t,r))return!0;return!1}onAction(t,e){return this.Fn.on(t,e)}An(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Vp(i,e.url,e.url_matching||"contains"))return!1}return!0}Nn(t,e){return!!this.Un(t,e)&&!!this.zn(t,e)&&!!this.Vn(t,e)}Un(t,e){var r;if(null==e||!e.href)return!0;var i=this.Wn(t);if(i.length>0)return i.some((t=>Vp(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Vp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}zn(t,e){var r;if(null==e||!e.text)return!0;var i=this.Wn(t);if(i.length>0)return i.some((t=>Vp(t.text,e.text,e.text_matching||"exact")||Vp(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!Pr(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Vp(t,s,o))))}Vn(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}Wn(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Dn(t,e){return null==e||!e.properties||0===e.properties.length||_h(e.properties.reduce(((t,e)=>{var r=kr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Gp{constructor(t){var e;this.Zn=[],this._instance=t,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.Kn(t)))}Yn(t,e){return!!t&&_h(t.propertyFilters,null==e?void 0:e.properties)}Xn(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}es(t,e,r){var i=(r===_l.Activation?this.Gn:this.Qn).get(t),n=[];return this.ts((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Yn(s,e)}))}register(t){var e;Ir(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.rs(t),this.ns(t))}ns(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.ss&&(this.ss=new Zp(this._instance),this.ss.init(),this.ss.Bn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.ss)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.Jn.get(e.name);r&&r.push(t.id),this.Jn.set(e.name,r||[t.id])}})))})))}rs(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Gn=this.Xn(t,_l.Activation),this.Qn=this.Xn(t,_l.Cancellation))}onEvent(t,e){var r,i,n=this.os(),s=(null==e||null==(r=e.properties)?void 0:r.$survey_id)||(null==e||null==(i=e.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.ls(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.us([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),void this.hs(s)}if(this.Qn.has(t)){var a=this.es(t,e,_l.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.us(a.map((t=>t.id))),a.forEach((t=>this.ds(t.id))))}if(this.Gn.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Gn.get(t)});var l=this.es(t,e,_l.Activation);this.cs(l.map((t=>t.id)))}}onAction(t){this.Jn.has(t)&&this.cs(this.Jn.get(t)||[])}cs(t){0!==t.length&&(this.Zn=[...new Set([...this.Zn,...t])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(t){this.Zn=this.Zn.filter((e=>e!==t));var e=this.vs();e.includes(t)||(this.fs([...e,t]),this.ps())}us(t){var e=new Set(t);this.Zn=this.Zn.filter((t=>!e.has(t)));var r=this.gs(),i=r.filter((t=>!e.has(t)));i.length!==r.length&&(this.fs(i),0===i.length&&this.ys())}gs(){var t,e=this.bs();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}vs(){var t,e,r=this.gs();if(0===r.length)return[];var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._s()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&i===n?r:[]}ps(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.ws(e)}ys(){this.xs()}Kn(t){var e,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._s()];r&&r!==t&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((t=>!this.ks(t)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class Qp extends Gp{constructor(t){super(t)}bs(){return Ou}_s(){return Pu}Cs(){return El.SHOWN}ts(t){var e;null==(e=this._instance)||e.getSurveys(t)}ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}os(){return Ul}fs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Ou]:t})}ws(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Pu]:t})}xs(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(Pu)}ks(){return!1}ls(t,e){var r;return this.ts((t=>{r=t.find((t=>t.id===e))})),!r||ql(r)?t===El.SHOWN?"consume":"ignore":t===El.SHOWN?"persist":t===El.DISMISSED||t===El.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Jp="SDK is not enabled or survey functionality is not yet loaded",Kp="Disabled. Not loading surveys.",Yp=null!=Yn&&Yn.location?Rs(Yn.location.hash,"__posthog")||Rs(location.hash,"state"):null,Xp="_postHogToolbarParams",tg=vs("[Toolbar]"),eg=vs("[FeatureFlags]"),rg=vs("[FeatureFlags]",{debugEnabled:!0}),ig="\" failed. Feature flags didn't load in time.",ng=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},sg=t=>{var e={};for(var r of ms(t||{})){var i=r[1];i&&(e[r[0]]=i)}return e},og="Refusing to render web experiment since the viewer is a likely bot",ag={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ph(e,t),not_regex:(t,e)=>!ph(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class lg{get Te(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{lg.Ts("retrieved web experiments from the server"),e.Is=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Is&&(lg.Ts("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Is)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);Mr(i)&&t.variants[i]&&e.Ms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];lg.Es(s,e._instance)&&e.Ms(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())lg.Ts(og);else if(!this.Te.disable_web_experiments){if(Pr(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();lg.Ts("applying feature flags",t),t.forEach((t=>{var e;if(this.Is&&null!=(e=this.Is)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Is)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Ms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=lg.getWindowLocation();if(null!=t&&t.search){var e=Is(null==t?void 0:t.search,"__experiment_id"),r=Is(null==t?void 0:t.search,"__experiment_variant");e&&r&&(lg.Ts("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Rs(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.Te.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Rs(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(lg.Ts("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Ms(i[0].name,e,i[0].variants[e].transforms))}static Es(t,e){return!Pr(t.conditions)&&lg.Ps(t,e)&&lg.Os(t)}static Ps(t,e){var r;if(Pr(t.conditions)||Pr(null==(r=t.conditions)?void 0:r.url))return!0;var i=lg.getWindowLocation();if(i){var n,s,o,a=Fs(e,i.href);return null==(n=t.conditions)||!n.url||ag[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==Yn?void 0:Yn.location}static Os(t){var e;if(Pr(t.conditions)||Pr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Ud();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Ts(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];cs.info("[WebExperiments] "+t,r)}Ms(t,e,r){this._is_bot()?lg.Ts(og):"control"!==e?r.forEach((r=>{if(r.selector){var i;lg.Ts("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):lg.Ts("Control variants leave the page unmodified.")}_is_bot(){return ts&&this._instance?sp(ts,this.Te.custom_blocked_useragents):void 0}}var ug=vs("[Conversations]"),hg="Conversations not available yet.",dg="console",cg={featureFlags:class{constructor(t){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 t=this.Us();this.Hs=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],Yn&&Ss(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(t){return this._instance.get_property(t)}Vs(){var t,e;return null!==(t=null==(e=this.mi)?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==t&&t}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,eg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var t,e=null!==(t=this.Te.evaluation_contexts)&&void 0!==t?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(eg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||eg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Gs(){return this.Zs().length>0}Qs(){var t=this.Te.flag_keys;if(!Ir(t)){if(kr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||eg.error("Invalid flag key found:",t,"Expected non-empty string"),e}));eg.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};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((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.zs(yu))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.zs(xu))&&void 0!==s?s:{},l=r({},o,t),u=r({},a,e),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:Ye(v),variant:Xe(v),reason:void 0,metadata:Ir(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 t=this.zs(wu),e=this.zs(Cu),i=this.zs(Tu);if(!i&&!e)return t||{};var n=gs({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],d=Ir(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Ir(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||(eg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Fs=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((r=>{var i=t[r];return{key:r,enabled:Ye(i),variant:Xe(i),payload:Ke(e[r])}}))}getFlagVariants(){var t=this.zs(yu),e=this.zs(Cu);if(!e)return t||{};for(var r=gs({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Fs||(eg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Fs=!0),r}getFlagPayloads(){var t=this.zs(xu),e=this.zs(Tu);if(!e)return t||{};for(var r=gs({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Fs||(eg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,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(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.As=t}Ks(t){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var i=this.Te.token,n=this.zs(Kl),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==(e=this.mi)?void 0:e.get_initial_props())||{},this.zs(Eu)||{},{$lib:hs.LIB_NAME,$lib_version:hs.LIB_VERSION}),group_properties:this.zs(Iu),timezone:Gd()};Or(n)||Ir(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var o=this.Qs();Ir(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:yl.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(this.Xs(t.statusCode),200===t.statusCode&&(this.Ns||(this.$anon_distinct_id=void 0),n=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.mi)||i.register({[Fu]:o}),u)eg.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=t.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks())}}})}}Us(){return Os(this.Hs,3)}Xs(t){this.Hs=Ps(t,this.Hs,3,(()=>eg.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(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else eg.warn('getFeatureFlag for key "'+t+ig)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.zs(Su)||void 0,l=this.zs(Nu)||void 0,u=this.zs(Lu)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.zs(Au);d&&d!==c&&(u={},null==(h=this.mi)||h.register({[Lu]:u,[Au]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,_,b,w,x,S;kr(u[t])?u[t].push(o):u[t]=[o],null==(v=this.mi)||v.register({[Lu]:u});var k=this.getFeatureFlagDetails(t),C=[...null!==(f=this.zs(Fu))&&void 0!==f?f:[]];Ir(n)&&C.push("flag_missing");var T={$feature_flag:t,$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[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Te.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.Ds};Ir(null==k||null==(m=k.metadata)?void 0:m.has_experiment)||(T.$feature_flag_has_experiment=k.metadata.has_experiment),Ir(null==k||null==(y=k.metadata)?void 0:y.version)||(T.$feature_flag_version=k.metadata.version);var E,I=null!==(_=null==k||null==(b=k.reason)?void 0:b.description)&&void 0!==_?_:null==k||null==(w=k.reason)?void 0:w.code;I&&(T.$feature_flag_reason=I),null!=k&&null!=(x=k.metadata)&&x.id&&(T.$feature_flag_id=k.metadata.id),Ir(null==k?void 0:k.original_variant)&&Ir(null==k?void 0:k.original_enabled)||(T.$feature_flag_original_response=Ir(k.original_variant)?k.original_enabled:k.original_variant),null!=k&&null!=(S=k.metadata)&&S.original_payload&&(T.$feature_flag_original_payload=null==k||null==(E=k.metadata)?void 0:E.original_payload),C.length&&(T.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",T)}if(i)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:Ke(s)}}}else eg.warn('getFeatureFlagResult for key "'+t+ig)}getRemoteConfigPayload(t,e){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();Ir(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:yl.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.Ds)return e.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return eg.warn('isFeatureEnabled for key "'+t+ig),e.defaultValue;var r=this.getFeatureFlag(t,e);return Ir(r)?e.defaultValue:!!r}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.mi){this.Ls=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):t.featureFlags&&eg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,c=t.evaluatedAt;if(kr(u)){eg.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;e&&e.register({[_u]:u,[yu]:v,[ku]:!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(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[_u]:Object.keys(sg(p)),[yu]:p||{},[xu]:g||{},[wu]:m||{},[ku]:!0===t.minimalFlagCalledEvents},d?{[Su]:d}:{},c?{[Nu]:c}:{}))}}}(t,this.mi,n,s,o,i),e||(this.js=!1),this.eo(e)}}override(t,e){void 0===e&&(e=!1),eg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return eg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.mi.unregister(Cu),this.mi.unregister(Tu),this.eo(),rg.info("All overrides cleared");if(kr(t)){var e=ng(t);return this.mi.register({[Cu]:e}),this.eo(),rg.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.Fs=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.mi.unregister(Cu),rg.info("Flag overrides cleared");else if(i.flags){if(kr(i.flags)){var n=ng(i.flags);this.mi.register({[Cu]:n})}else this.mi.register({[Cu]:i.flags});rg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.mi.unregister(Tu),rg.info("Payload overrides cleared")):i.payloads&&(this.mi.register({[Tu]:i.payloads}),rg.info("Payload overrides set",{payloads:i.payloads}))),void this.eo()}if(t&&"object"==typeof t)return this.mi.register({[Cu]:t}),this.eo(),rg.info("Flag overrides set",{flags:t});eg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ls){var e=this.ro(),r=e.flags,i=e.flagVariants;try{t(r,i)}catch(t){eg.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.zs(bu)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$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(),{[t]:e});null==(n=this.mi)||n.register({[_u]:Object.keys(sg(l)),[yu]:l}),this.eo()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.zs(bu),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(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:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.mi)||r.unregister(bu),null==(i=this.mi)||i.register({[bu]:n}),t(n)}}})}ro(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}eo(t){var e=this.ro(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(r,i,{errorsLoading:t})}catch(t){eg.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.zs(Eu)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$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)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=r({},this.zs(Eu)||{});t.forEach((t=>{delete i[t]})),this._instance.register({[Eu]:i}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(Eu),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.zs(Iu)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Iu]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.zs(Iu)||{};this._instance.register({[Iu]:r({},e,{[t]:{}})})}else this._instance.unregister(Iu)}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}}},vg={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!(null==(t=this.io)||!t.isStarted)}get status(){var t,e;return this.no===Ap||this.no===Fp?this.no:null!==(t=null==(e=this.io)?void 0:e.status)&&void 0!==t?t:this.no}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=$p,this.so=void 0,this._instance=t,!this._instance.sessionManager)throw Dp.error("started without valid sessionManager"),new Error(Np+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Yu)throw new Error(Np+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var t,e=!(null==(t=this._instance.get_property(hu))||!t.enabled),r=!this.Te.disable_session_recording,i=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.oo||null==(e=this.io)||!e.isStarted){var r=!Ir(Object.assign)&&!Ir(Array.from);this.oo&&r?(this.ao(t),Dp.info("starting")):(this.no=$p,this.stopRecording())}}ao(t){var e,r,i;this.oo&&(this.no!==Ap&&this.no!==Fp&&(this.no=Lp),null!=ea&&null!=(e=ea.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=ea.__PosthogExtensions__)&&r.initSessionRecording?this.lo(t):null==(i=ea.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.uo,(e=>{if(e)return Dp.error("could not load recorder",e);this.lo(t)})))}stopRecording(){var t,e;null==(t=this.so)||t.call(this),this.so=void 0,null==(e=this.io)||e.stop()}ho(){var t,e;null==(t=this.so)||t.call(this),this.so=void 0,null==(e=this.io)||e.discard()}do(){var t,e;null==(t=this.mi)||t.unregister(mu),null==(e=this.mi)||e.unregister(du)}co(t,e){if(Pr(t))return null;var r,i=$r(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Dp.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}vo(t){if(this.mi){var e,i,n=this.mi,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.co(null==(e=this.Te.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.co(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Pr(a)&&this.do();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[hu]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.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:Ir(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==(e=this.so)||e.call(this),this.so=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===Ap&&(this.no=Fp,Dp.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.io)&&r.log?this.io.log(t,e):Dp.warn("log called before recorder was ready")}get uo(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(hu);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}fo(){var t,e,r=this._instance.get_property(hu);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Dp.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}lo(t){var e,r;if(null==(e=ea.__PosthogExtensions__)||!e.initSessionRecording)return Dp.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Qu]:!0});if(this.io||(this.io=null==(r=ea.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo()){if(this.no===Fp||this.no===Ap)return;return this.no=Ap,Dp.info("persisted remote config is stale, requesting fresh config before starting"),void new tf(this._instance).load()}this.no=Lp,this.io.start(t)}onRRwebEmit(t){var e;null==(e=this.io)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.io||null==(e=this.mi)||e.register({[vu]:!0}),null==(t=this.io)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.io||null==(e=this.mi)||e.register({[cu]:!0}),null==(t=this.io)||t.overrideSampling()}overrideTrigger(t){var e,r;this.io||null==(r=this.mi)||r.register({["url"===t?fu:pu]:!0}),null==(e=this.io)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.io)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.io)||!r.tryAddCustomEvent(t,e))}}},fg={autocapture:class{constructor(t){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=t,this.rageclicks=new fv(t.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var t,e,r=Tr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}wo(){if(this.isBrowserSupported()){if(Yn&&es){var t=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.xo(t)}catch(t){gv.error("Failed to capture event",t)}};if(Ss(es,"submit",t,{capture:!0}),Ss(es,"change",t,{capture:!0}),Ss(es,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.xo(t,pv)}catch(t){gv.error("Failed to capture copy/cut event",t)}};Ss(es,"copy",e,{capture:!0}),Ss(es,"cut",e,{capture:!0})}}}else gv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(t){if(this.yo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var r=e.autocapture_opt_out;Ar(r)&&(this.instance.persistence&&this.instance.persistence.register({[eu]:r}),this.mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this._o=t}getElementSelectors(t){var e,r=[];return null==(e=this._o)||e.forEach((e=>{var i=null==es?void 0:es.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[eu],i=this.mo,n=this.instance.Ur()&&!this.yo;if(Or(i)&&!Ar(r)&&!n)return!1;var s=null!==(e=this.mo)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!s}xo(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=Xs(t);Ws(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&ho(i,this.instance.config.rageclick)&&this.xo(t,"$rageclick");var n=e===pv;if(i&&function(t,e,r,i,n,s){var o;if(!Yn||co(t))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((t=>e.type===t)))return!1}var l=vo(t,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Ir(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!eo(h,null==r?void 0:r.css_selector_allowlist))return!1;if(eo(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:io))return!1;try{var d=Yn.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(to.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.Te,n,n?["copy","cut"]:void 0,this.instance)){var s=_v(i,{e:t,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),e===pv){var l,u=Ks(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Cr(null==es?void 0:es.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ko=(null==Yn||null==(e=Yn.location)?void 0:e.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(t){var e;if(Yn&&(null==(e=Yn.history[t])||!e.__posthog_wrapped__)){var r=this;Ls(Yn.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.Io(t)}))}}Io(t){try{var e,r=null==Yn||null==(e=Yn.location)?void 0:e.pathname;if(!r)return;r!==this.ko&&this.isEnabled&&this._instance.capture(nh,{navigation_type:t}),this.ko=r}catch(e){cs.error("Error capturing "+t+" pageview",e)}}To(){if(!this.So){var t=()=>{this.Io("popstate")};Ss(Yn,"popstate",t),this.So=()=>{Yn&&Yn.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=t,this.Mo=!(null==(e=this.instance.persistence)||!e.props[ru]),this.rageclicks=new fv(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Tr(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Pr(this.Te.capture_heatmaps)?Pr(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.po)return;qp.info("starting..."),this.Ro(),this.ke()}else{var t;clearInterval(null!==(t=this.Eo)&&void 0!==t?t:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ru]:r}),this.Mo=r,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Oo(t){Up(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo="visible"===(null==es?void 0:es.visibilityState)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){Yn&&es&&(this.Fo=this.oi.bind(this),Ss(Yn,ih,this.Fo),this.Lo=t=>this.pe(t||(null==Yn?void 0:Yn.event)),Ss(es,"click",this.Lo,{capture:!0}),this.$o=t=>this.Ao(t||(null==Yn?void 0:Yn.event)),Ss(es,"mousemove",this.$o,{capture:!0}),this.No=new Lv(this.instance,Pv,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),Ss(es,rh,this.Do),this.po=!0)}Po(){var t;Yn&&es&&(this.Fo&&Yn.removeEventListener(ih,this.Fo),this.Lo&&es.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&es.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&es.removeEventListener(rh,this.Do),clearTimeout(this.qo),null==(t=this.No)||t.stop(),this.po=!1)}jo(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&Hs(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(t){return!1}if(mr(e,n))return!0;i=ro(i)}return!1}(Xs(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}pe(t,e){var i;if(void 0===e&&(e="click"),!Bs(t.target)&&Up(t)){var n=this.jo(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&ho(Xs(t),this.instance.config.rageclick)&&this.Nt(r({},n,{type:"rageclick"})),this.Nt(n)}}Ao(t){!Bs(t.target)&&Up(t)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Nt(this.jo(t,"mousemove"))}),500))}Nt(t){if(Yn){var e=this.Te.disable_capture_url_hashes?tn(Yn.location.href):Yn.location.href,r=this.Te.custom_personal_data_properties,i=this.Te.mask_personal_data_properties?[...Fd,...r||[]]:[],n=Ms(e,i,Dd);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(t)}}oi(){this.R&&!Er(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Lv,webVitalsAutocapture:class{constructor(t){var e;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(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=t=>{var e;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.zo();if(!Ir(i))if(Pr(null==t?void 0:t.name)||Pr(null==t?void 0:t.value))Op.error("Invalid metric received",t);else if(!this.Vo||this.Vo>t.value){this.R.url!==i&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Ir(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Ir(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});Ir(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 Op.error("Ignoring metric with value >= "+this.Vo,t)},this.Wo=()=>{if(!this.po){var t,e,r,i,n=ea.__PosthogExtensions__;if(!Ir(n)&&!Ir(n.postHogWebVitalsCallbacks)){var s=n.postHogWebVitalsCallbacks;t=s.onLCP,e=s.onCLS,r=s.onFCP,i=s.onINP}t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(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):Op.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Mo=!(null==(e=this._instance.persistence)||!e.props[ou]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Tr(this.Zo)?null==(t=this.Zo)?void 0:t.web_vitals_allowed_metrics:void 0;return Pr(r)?(null==(e=this._instance.persistence)?void 0:e.props[uu])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Tr(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Tr(this.Zo)?this.Zo.web_vitals_attribution:void 0;return null!=t&&t}get Vo(){var t=Tr(this.Zo)&&$r(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:Pp;return t>0&&6e4>=t?Pp:t}get isEnabled(){var t=null==rs?void 0:rs.protocol;if("http:"!==t&&"https:"!==t)return Op.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Tr(this.Zo)?this.Zo.web_vitals:Ar(this.Zo)?this.Zo:void 0;return Ar(e)?e:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Op.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var r=Tr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Tr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ou]:r}),this._instance.persistence.register({[uu]:i})),this.Mo=r,this.startIfEnabled()}}}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?Op.error("failed to load script",e):t()}))}zo(){var t=Yn?this._instance.config.disable_capture_url_hashes?tn(Yn.location.href):Yn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Fd,...e||[]]:[];return Ms(t,r,Dd)}Op.error("Could not determine current URL")}}},pg={exceptionObserver:class{constructor(t){var e;this.Wo=()=>{var t;if(Yn&&this.isEnabled&&null!=(t=ea.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=ea.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ea.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ea.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=e(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(t){Mp.error("failed to start",t),this.Ko()}}},this._instance=t,this.Yo=!(null==(e=this._instance.persistence)||!e.props[iu]),this.Xo=new Vr(r({},function(t){var e,r,i,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(r=t.exceptionRateLimiterRefillRate)&&void 0!==r?r:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(i=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,Ge:Mp})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Tr(t)?e=r({},e,t):(Ir(t)?this.Yo:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Mp.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Mp.error("failed to load script",e);t()}))}Ko(){var t,e,r;null==(t=this.Go)||t.call(this),this.Go=void 0,null==(e=this.Qo)||e.call(this),this.Qo=void 0,null==(r=this.Jo)||r.call(this),this.Jo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[iu]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.Xo.consumeRateLimit(n)?Mp.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.ta=[],this.ra=_c(),this._instance=t,this.ta=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(nu))&&void 0!==e?e:[],this.ia=Qn(this.na()),this.sa=new Jn(this.ia)}onConfigChange(){this.ia=Qn(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(t){var e,r,i;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.ta=s,this._instance.persistence&&this._instance.persistence.register({[nu]:this.ta,[su]:o})}}}get oa(){var t,e=!!this._instance.get_property(su),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.ra.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.ia.enabled)try{if(!Mr(t)||0===t.trim().length)return void yc.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>Zn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(this.aa(e)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&yc.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(r({[Wn]:t,[Vn]:(new Date).toISOString()},n))}catch(t){yc.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void yc.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void yc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void yc.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ia.enabled&&Pr(t.$exception_steps)?this.va(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return i&&this.sa.clear(),i}catch(t){return yc.error("Failed to capture exception event. Dropping this exception.",t),void this.sa.clear()}}catch(t){return void yc.error("Failed to process exception event. Ignoring this exception.",t)}}va(t){try{var e=this.sa.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return yc.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ha(t){this.ia.enabled&&this.sa.add({[Wn]:t,[Vn]:(new Date).toISOString()})}aa(t){return Tr(t)?r({},t):{}}na(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}ua(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var r=e.type,i=e.value;return Mr(r)&&r.length>0&&t.$exception_types.push(r),Mr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.ta.some((t=>{var r=t.values.map((t=>{var r,i=mh[t.operator],n=kr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}da(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ca(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],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(t){return!Pr(t)&&kr(t)}}},gg=r({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.fa=null,this.pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var r,i;if(this.mi&&this.mi.register({[lu]:!!e.productTours}),!Bp(this._instance))return!this.fa&&Pr(null==(r=this.mi)?void 0:r.props[$u])||jp.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&&Bp(this._instance)&&this.er((()=>this.ga()))}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?jp.error("Could not load product tours script",e):t()}))}ga(){var t;!this.fa&&null!=(t=ea.__PosthogExtensions__)&&t.generateProductTours&&(this.fa=ea.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!kr(this.pa)||e){var r=this.mi;if(r){var i=r.props[$u];if(kr(i)&&!e)return this.pa=i,void t(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:e=>{if(Bp(this._instance)){var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return jp.error(n),void t([],{isLoaded:!1,error:n})}var s=kr(e.json.product_tours)?e.json.product_tours:[];this.pa=s,r&&r.register({[$u]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pa,{isLoaded:!0})}getActiveProductTours(t){Pr(this.fa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.fa)||e.showTourById(t)}previewTour(t){this.fa?this.fa.previewTour(t):this.er((()=>{var e;this.ga(),null==(e=this.fa)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.fa)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.fa)||t.nextStep()}previousStep(){var t;null==(t=this.fa)||t.previousStep()}clearCache(){var t;this.pa=null,null==(t=this.mi)||t.unregister($u)}resetTour(t){var e;null==(e=this.fa)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.fa)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.fa)||e.cancelPendingTour(t)}}},cg),mg={siteApps:class{constructor(t){this.ma=0,this._instance=t,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(t,e){if(e){var r=this.globalsForEvent(e);this.ya.push(r),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var t;return null==(t=ea._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{t(),this.ya=[],this._a=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)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=t.$set_once,g=t.$set;return{event:r({},i(t,Hp),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}wa(t){var e,r=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(zp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(zp.error("prepare_external_dependency_script returned null"),null):t}xa(){var t,e,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==es?void 0:es.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],d=this,c=new WeakSet,v=(t,e,r)=>{if(null!=t&&t[e]){var i=t[e];t[e]=r(i),h.push((()=>{t[e]=i}))}},f=t=>{if(c.has(t))return t;var e=d.wa(t);return e&&c.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Or(t)));return v(u,"appendChild",(t=>function(e){var r=f(e);return r?t.call(this,r):e})),v(u,"insertBefore",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):e})),v(u,"replaceChild",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):r})),[null==(e=l.Element)?void 0:e.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((t=>{v(t,"append",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"prepend",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.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((t=>{v(t,"before",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"after",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"replaceWith",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:t.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(t=>function(e,r){var i=f(r);return i?t.call(this,e,i):null})),this.ka=()=>{h.forEach((t=>t())),this.ka=void 0},this.Sa()}Sa(){var t=!1;return()=>{var e;t||(t=!0,this.ma--,0===this.ma&&(null==(e=this.ka)||e.call(this)))}}Ca(t,e){void 0===e&&(e=!0);var r=this.xa();try{var i=t(r);return e&&r(),i}catch(t){throw r(),t}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.ya.length&&(zp.info("Processing "+this.ya.length+" events for site app with id "+t.id),this.ya.forEach((t=>this.Ca((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this._a)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,zp.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Ca((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),i=!0}catch(e){zp.error(Wp+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){zp.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}Ta(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}Ia(t){var e=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(t),i=function(i){try{e.Ca((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(e){zp.error("Error while processing event "+t.event+" for site app "+i.id,e)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.Ta(),void this._instance.on("eventCaptured",(t=>this.Ia(t)))):void zp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._a)||r.call(this),t.ok){var s=t.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var t,e=a.id,r=a.url;ea["__$$ph_site_app_"+e]=n._instance,null==(t=ea.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,r,(t=>{if(t)return zp.error(Wp+e,t)}))};for(var a of s.siteApps)o()}else zp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},yg={tracingHeaders:class{constructor(t){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var t,e,r=this.Pa();r?(Ir(this.Ma)&&(this.Ma=null==(t=ea.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Ir(this.Ea)&&(this.Ea=null==(e=ea.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=t}initialize(){this.startIfEnabledOrStop()}er(t){var e,r;null!=(e=ea.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=ea.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Rp.error("failed to load script",e);t()}))}Oa(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}Pa(){var t=this.Oa();return kr(t)?(kr(this.Ra)?this.Ra.splice(0,this.Ra.length,...t):this.Ra=[...t],t.length>0?this.Ra:void 0):(kr(this.Ra)&&this.Ra.splice(0),this.Ra=t||void 0,this.Ra)}Ko(){var t,e;null==(t=this.Ma)||t.call(this),null==(e=this.Ea)||e.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},_g=r({surveys:class{get Te(){return this._instance.config}constructor(t){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return Ul.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Pr(e))return Ul.warn("Flags not loaded yet. Not loading surveys.");var r=kr(e);this.Fa=r?e.length>0:e,Ul.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Hl)||null!=i&&i.startsWith(zl))&&e.push(i)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.La)Ul.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Ul.info(Kp);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Ul.info("Not loading surveys in cookieless mode without consent.");else{var t=null==ea?void 0:ea.__PosthogExtensions__;if(t){if(!Ir(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var r=t.generateSurveys;if(r)return void this.Da(r,e);var i=t.loadExternalDependency;if(!i)return void this.qa(Ju);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.qa("Could not load surveys script",r):this.Da(t.generateSurveys,e)}))}catch(t){throw this.qa("Error initializing surveys",t),t}finally{this.La=!1}}}else Ul.error("PostHog Extensions not found.")}}Da(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Qp(this._instance),Ul.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(t,e){Ul.error(t,e),this.ja({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.$a.push(t),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Te.disable_surveys)return Ul.info(Kp),t([]);var r,i=this._instance.get_property(Mu);if(i&&!e)return t(i,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.Aa?this.Aa.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.Aa=new Promise((t=>{r=t}))),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:e=>{var i;this.Aa=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Ul.error(s),this.Na=Date.now();var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}this.Na=null;var a,l=e.json.surveys||[],u=l.filter((t=>jl(t)&&(Dl(t)||Bl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[Mu]:l,[Ru]:Date.now()});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var t=this._instance.get_property(Ru);return $r(t)&&Date.now()-t>3e5}Ua(){return $r(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(t,e){var r,i={id:t,current_iteration:null!==(r=null==e?void 0:e.iteration)&&void 0!==r?r:null};Zl(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}ja(t){for(var e of this.$a)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Ul.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Pr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ul.warn("init was not called")}za(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Va(t){if(Pr(this._surveyManager))return{eligible:!1,reason:Jp};var e="string"==typeof t?this.za(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wa(t){if(Pr(this._surveyManager))return{eligible:!1,reason:Jp};var e="string"==typeof t?this.za(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Pr(this._surveyManager))return Ul.warn("init was not called"),{visible:!1,disabledReason:Jp};var e=this.Wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Pr(this._surveyManager)?(Ul.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Jp})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&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"})}),e)}))}renderSurvey(t,e,r){var i;if(Pr(this._surveyManager))Ul.warn("init was not called");else{var n="string"==typeof t?this.za(t):t;if(null!=n&&n.id)if(Gl.includes(n.type)){var s=null==es?void 0:es.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Ul.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Ul.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Ul.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Ul.warn("Survey element not found")}else Ul.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ul.warn("Survey not found")}}displaySurvey(t,e){var i;if(Pr(this._surveyManager))Ul.warn("init was not called");else{var n=this.za(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Ml.Popover&&e.initialResponses&&Ul.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.Va(n);if(!o.eligible)return void Ul.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==Ml.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Ul.warn("Survey not found")}}cancelPendingSurvey(t){Pr(this._surveyManager)?Ul.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},cg),bg={toolbar:class{constructor(t){this.instance=t}Za(t){ea.ph_toolbar_state=t}Ga(){var t;return null!==(t=ea.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),ks(this.instance.config))return!1;if(!Yn||!es)return!1;t=null!=t?t:Yn.location,r=null!=r?r:Yn.history;try{if(!e){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(t){return!1}e=null==Yn?void 0:Yn.localStorage}var i,n=Yp||Rs(t.hash,"__posthog")||Rs(t.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?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Xp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}Qa(t){var e=ea.ph_load_toolbar||ea.ph_load_editor;!Pr(e)&&Cr(e)?e(t,this.instance):tg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==es||!es.getElementById(Ds));if(!Yn||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Yn.localStorage.setItem(Xp,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=ea.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return tg.error("[Toolbar] Failed to load",t),void this.Za(0);this.Za(2),this.Qa(n)})),Ss(Yn,"turbolinks:load",(()=>{this.Za(0),this.loadToolbar(n)}))}return!0}Ja(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},wg=r({experiments:lg},cg),xg={conversations:class{constructor(t){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Pr(e)||(Ar(e)?this.Ka=e:(this.Ka=e.enabled,this.Xa=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||ks(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==ea?void 0:ea.__PosthogExtensions__;if(t&&!Ir(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var e=t.initConversations;if(e)return this.el(e),void(this.Ya=!1);var r=t.loadExternalDependency;if(!r)return void this.tl(Ju);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.tl("Could not load conversations script",e):this.el(t.initConversations),this.Ya=!1}))}catch(t){this.tl("Error initializing conversations",t),this.Ya=!1}}else ug.error("Conversations enabled but missing token in remote config.")}}el(t){if(this.Xa)try{this._conversationsManager=t(this.Xa,this._instance),ug.info("Conversations loaded successfully")}catch(t){this.tl("Error completing conversations initialization",t)}else ug.error("Cannot complete initialization: remote config is null")}tl(t,e){ug.error(t,e),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():ug.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ka&&!Or(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(ug.warn(hg),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(ug.warn(hg),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(ug.warn(hg),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(ug.warn(hg),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(ug.warn(hg),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(ug.warn(hg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ug.warn(hg),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}En(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Rn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Sg={logs:class{constructor(t){var e;this.rl=!1,this.il=!1,this.Ge=vs("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var t,e;this.Hs=0,null==(t=this.ol)||t.onReconnect(),null==(e=this.al)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.rl=!0),Yn&&Ss(Yn,"online",this.sl)}ll(t,e,r,i){var n,s=function(t,e){var r,i,n,s,o,a,l,u=null!==(r=null==t?void 0:t.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==t?void 0:t.maxBufferSize)&&void 0!==i?i:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Ir(d)?Math.max(h,2048):Math.max(h,d),v=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:v,beforeSend:null==t?void 0:t.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(t,e),s,this.Ge,(()=>this.hl()),(t=>t()),void 0,i),s]}dl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.ol||this.cl!==e){var r;null==(r=this.ol)||r.reset(),this.cl=e;var i=this.ll((()=>this.Gr),(t=>{this.Gr=t}));this.ol=i[0],this.vl=i[1]}return this.ol}fl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.al||this.pl!==e){var r;null==(r=this.al)||r.reset(),this.pl=e;var i=this.ll((()=>this.nl),(t=>{this.nl=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},dg);this.al=i[0],this.gl=i[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var r=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!Pr(r)&&r&&(this.rl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],null==(t=this.ol)||t.reset(),this.nl=[],null==(e=this.al)||e.reset(),this.Hs=0}captureLog(t){this.dl().captureLog(t)}le(t){this.fl().captureLog(t)}get logger(){return this.ml||(this.ml={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.ml}flushLogs(t){t?this.yl(t):(this.ol&&this.ol.flush().catch((t=>this.Ge.error("PostHog logs flush failed:",t))),this.al&&this.al.flush().catch((t=>this.Ge.error("PostHog logs flush failed:",t))))}loadIfEnabled(){if(this.rl&&!this.il){var t=null==ea?void 0:ea.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.Ge.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.il=!0)})):this.Ge.error(Ju)}else this.Ge.error("PostHog Extensions not found.")}}ul(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:e=>e===rr.LogsQueue?t():void 0,setPersistedProperty(t,r){var i;t===rr.LogsQueue&&e(null!==(i=r)&&void 0!==i?i:[])},Tt:t=>this.Tt(t),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Tt(t){return new Promise((e=>{if(Os(this.Hs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,i=t=>{r||(r=!0,clearTimeout(n),e(t))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.bl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this._l(e),e>=200&&300>e)i({kind:"ok"});else if(413===e)i({kind:"too-large"});else if(0!==e&&429!==e&&500>e)i({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var r;i({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("logs request failed with status "+e)})}}})}}))}_l(t){(0!==t||this._instance.__loaded)&&(this.Hs=Ps(t,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(t){this.Gr.length>0&&this.wl(t,this.Gr,this.vl,hs.LIB_NAME,(t=>{this.Gr=t})),this.nl.length>0&&this.wl(t,this.nl,this.gl,dg,(t=>{this.nl=t}))}wl(t,e,r,i,n){if(0!==e.length){var s=e.map((t=>t.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:t})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){var t,e={};if(e.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;e.sessionId=r.sessionId,e.windowId=i,Pr(n)||(e.sessionStartTimestamp=n),Pr(s)||(e.lastActivityTimestamp=s)}if(null!=ea&&null!=(t=ea.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?tn(ea.location.href):ea.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},kg={metrics:class{constructor(t){this.Ge=vs("[metrics]"),this._instance=t}initialize(){}dl(){var t,e,r=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.ol&&this.cl===r||(null==(e=this.ol)||e.reset(),this.cl=r,this.ol=new pn(this.ul(),function(t){var e,r,i,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==t?void 0:t.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.Ge)),this.ol}count(t,e,r){void 0===e&&(e=1),this.dl().count(t,e,r)}gauge(t,e,r){this.dl().gauge(t,e,r)}histogram(t,e,r){this.dl().histogram(t,e,r)}flush(t){if(!this.ol)return Promise.resolve();if(t){var e=this.ol.drainWindow();return e&&this.Bt(e,t),Promise.resolve()}return this.ol.flush().catch((t=>this.Ge.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.ol)||t.reset()}ul(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Bt:t=>e.Bt(t),getLibraryId:()=>hs.LIB_NAME,getLibraryVersion:()=>hs.LIB_VERSION}}Bt(t,e){return new Promise((i=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(o),i(t))},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:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var r;s({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("metrics request failed with status "+e)})}}}))}))}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Cg=r({},cg,vg,fg,pg,gg,mg,_g,yg,bg,wg,xg,Sg,kg);Ip.__defaultExtensionClasses=r({},Cg);var Tg=function(){hs.SDK_DIST_CHANNEL="npm";var t=fp[xp]=new Ip;return function(){function t(){t.done||(t.done=!0,Sp=!1,ps(fp,(function(t){t._dom_loaded()})))}null!=es&&es.addEventListener?"complete"===es.readyState?t():Ss(es,"DOMContentLoaded",t,{capture:!1}):Yn&&cs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{yl as Compression,Gv as DEFAULT_PRODUCT_TOUR_APPEARANCE,Ml as DisplaySurveyType,Ip as PostHog,Qv as ProductTourEventName,Jv as ProductTourEventProperties,El as SurveyEventName,Il as SurveyEventProperties,_l as SurveyEventType,wl as SurveyPosition,Cl as SurveyQuestionBranchingType,kl as SurveyQuestionType,Tl as SurveySchedule,xl as SurveyTabPosition,Sl as SurveyType,bl as SurveyWidgetType,Tg as default,Tg as posthog,ef as severityLevels};
2
2
  //# sourceMappingURL=module.full.js.map