posthog-js 1.396.2 → 1.396.3

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.
Files changed (43) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.js +1 -1
  5. package/dist/array.full.js.map +1 -1
  6. package/dist/array.full.no-external.js +1 -1
  7. package/dist/array.full.no-external.js.map +1 -1
  8. package/dist/array.js +1 -1
  9. package/dist/array.no-external.js +1 -1
  10. package/dist/customizations.full.js +1 -1
  11. package/dist/default-extensions.js +1 -1
  12. package/dist/extension-bundles.js +1 -1
  13. package/dist/lazy-recorder.js +1 -1
  14. package/dist/main.js +1 -1
  15. package/dist/module.full.js +1 -1
  16. package/dist/module.full.js.map +1 -1
  17. package/dist/module.full.no-external.js +1 -1
  18. package/dist/module.full.no-external.js.map +1 -1
  19. package/dist/module.js +1 -1
  20. package/dist/module.no-external.js +1 -1
  21. package/dist/module.slim.js +1 -1
  22. package/dist/module.slim.no-external.js +1 -1
  23. package/dist/posthog-recorder.js +1 -1
  24. package/dist/product-tours.js +1 -1
  25. package/dist/src/entrypoints/web-vitals-with-attribution.d.ts +19 -0
  26. package/dist/src/entrypoints/web-vitals.d.ts +18 -0
  27. package/dist/surveys.js +1 -1
  28. package/dist/web-vitals-with-attribution.js +1 -1
  29. package/dist/web-vitals-with-attribution.js.map +1 -1
  30. package/dist/web-vitals.js +1 -1
  31. package/dist/web-vitals.js.map +1 -1
  32. package/lib/package.json +1 -1
  33. package/lib/src/entrypoints/web-vitals-with-attribution.d.ts +19 -0
  34. package/lib/src/entrypoints/web-vitals-with-attribution.js +3 -0
  35. package/lib/src/entrypoints/web-vitals-with-attribution.js.map +1 -1
  36. package/lib/src/entrypoints/web-vitals.d.ts +18 -0
  37. package/lib/src/entrypoints/web-vitals.js +3 -0
  38. package/lib/src/entrypoints/web-vitals.js.map +1 -1
  39. package/lib/src/utils/array-at-polyfill.d.ts +0 -0
  40. package/lib/src/utils/array-at-polyfill.js +33 -0
  41. package/lib/src/utils/array-at-polyfill.js.map +1 -0
  42. package/lib/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +3 -3
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(l||{}),u=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(u||{}),h=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(h||{}),d=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(d||{}),c=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(c||{}),v=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(v||{}),f=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(e){if(m[e])return m[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in p?p[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in g?g[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return m[e]=t.prototype,t.prototype;var a=document.createElement("iframe");try{document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return u?m[e]=u:r}catch(e){return r}finally{a.parentNode&&document.body.removeChild(a)}}var b={};function _(e,t,r){var i,n=e+"."+String(r);if(b[n])return b[n].call(t);var s=y(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(t)):t[r]}var w={};function x(e,t,r){var i=e+"."+String(r);if(w[i])return w[i].bind(t);var n=y(e)[r];return"function"!=typeof n?t[r]:(w[i]=n,n.bind(t))}function k(){return y("MutationObserver").constructor}function S(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}var C={childNodes:e=>_("Node",e,"childNodes"),parentNode:e=>_("Node",e,"parentNode"),parentElement:e=>_("Node",e,"parentElement"),textContent:e=>_("Node",e,"textContent"),contains:(e,t)=>x("Node",e,"contains")(t),getRootNode:e=>x("Node",e,"getRootNode")(),host:e=>e&&"host"in e?_("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null,querySelector:(e,t)=>x("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>x("Element",e,"querySelectorAll")(t),mutationObserver:k,patch:S};function I(e){return e.nodeType===e.ELEMENT_NODE}function T(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function E(e){return"[object ShadowRoot]"==={}.toString.call(e)}function M(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(i=Array.from(t,(e=>P(e,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function P(e,t){var r;if(function(e){return"styleSheet"in e}(e)){var i;try{i=M(e.styleSheet)||function(e){var{cssText:t}=e;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return B(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?B(n,t):n}class R{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),I(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function O(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&L(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function L(e){return e.toLowerCase()}var F="__rrweb_original__";function A(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?L(t):null}var D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(D,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(N.test(l)||q.test(l))return"url("+u+l+u+")";if(j.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var H,U,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,G=new RegExp("[^a-z0-9-_:]"),Z=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,K=new WeakMap;function X(e,t){return t&&""!==t.trim()?ee(e,t):t}function ee(e,t){var r=K.get(e);if(r||(r=e.createElement("a"),K.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function te(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?z:e}(e,t.maxBase64ImageLength):e}function re(e,t,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=X(e,i);if(l.startsWith("data:")){if("img"===t&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(e,t,r,i){if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>V||e.naturalHeight>V)return t;try{var n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(e,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):t}catch(e){return t}}(n,l,s.type,s.quality)),te(u,s)}if("image"===t)return te(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=X(e,i);return"image"===t&&h.startsWith("data:")?te(h,s):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Y),t.length>r;){var s=i(J);if(","===s.slice(-1))s=X(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?B(i,ee(e)):"object"===t&&"data"===r?X(e,i):i:X(e,i)}function ie(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ne(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ne(C.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&ne(C.parentNode(e),t,r)}function se(e,t,r,i){var n;if(I(e)){if(!C.childNodes(n=e).length)return!1}else{if(null===C.parentElement(e))return!1;n=C.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(ne(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}var oe=new Map;function ae(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function le(e){return null==e?"":e.toLowerCase()}var ue=50,he=!1,de=!1;function ce(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_=5e3,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:S=(()=>!1),newlyAddedElement:P=!1,depth:R=0,maxDepth:D=ue}=t,{needsMask:N}=t,{preserveWhiteSpace:q=!0}=t;if(R>=D)return de=!0,he||(he=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+D+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;N||(N=se(e,o,a,void 0===N));var j,z=function(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g=!1}=t,m=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:f.Document,childNodes:[],compatMode:e.compatMode}:{type:f.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,s,{doc:o,blockClass:a,blockSelector:l,inlineStylesheet:u,maskInputOptions:h={},maskInputFn:d,dataURLOptions:c={},inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:m=!1,rootId:y}=t,b=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,a,l),_=function(e){if(e instanceof HTMLFormElement)return"form";var t=L(e.tagName);return G.test(t)?"div":t}(e),w={},x=e.attributes.length,k=0;x>k;k++){var S=e.attributes[k];ie(_,S.name)||(w[S.name]=re(o,_,L(S.name),S.value,e,c))}if("link"===_&&u){var I=e.sheet;if(!I){var T=function(e){return e.href}(e);T&&!(I=ae(o,T))&&T.includes(".css")&&(I=ae(o,window.location.origin+"/"+T.replace(window.location.href,"")))}var E=null;I&&(E=M(I)),E&&(delete w.rel,delete w.href,w._cssText=E)}if("style"===_&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var P=M(e.sheet);P&&(w._cssText=P)}if("input"===_||"textarea"===_||"select"===_){var R=e.value,D=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&R?w.value=O({element:e,type:A(e),tagName:_,value:R,maskInputOptions:h,maskInputFn:d}):D&&(w.checked=D)}if("option"===_&&(e.selected&&!h.select?w.selected=!0:delete w.selected),"dialog"===_&&e.open)try{w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}if("canvas"===_&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((F in n?n[F]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var N=e.toDataURL(c.type,c.quality),q=o.createElement("canvas");q.width=e.width,q.height=e.height,N!==q.toDataURL(c.type,c.quality)&&(w.rr_dataURL=N)}if("img"===_&&v){H||(H=o.createElement("canvas"),U=H.getContext("2d"));var j=e,B=j.currentSrc||j.getAttribute("src")||"<unknown-src>",z=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{H.width=j.naturalWidth,H.height=j.naturalHeight,U.drawImage(j,0,0),w.rr_dataURL=H.toDataURL(c.type,c.quality)}catch(e){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="+B+"! Error: "+e)}"anonymous"===j.crossOrigin&&(z?w.crossOrigin=z:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===_||"video"===_){var W=w;W.rr_mediaState=e.paused?"paused":"played",W.rr_mediaCurrentTime=e.currentTime,W.rr_mediaPlaybackRate=e.playbackRate,W.rr_mediaMuted=e.muted,W.rr_mediaLoop=e.loop,W.rr_mediaVolume=e.volume}if(m||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),b){var{width:Z,height:Q,left:J,top:Y}=e.getBoundingClientRect(),K=null==(r=o.defaultView)?void 0:r.getComputedStyle(e);w={class:w.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(Y+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},K&&(w.rr_position=K.position||"static",K.transform&&"none"!==K.transform&&(w.rr_transform=K.transform),K.display&&K.display.startsWith("inline")&&(w.rr_display=K.display))}"iframe"!==_||g(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(_)&&(s=!0)}catch(e){}return{type:f.Element,tagName:_,attributes:w,childNodes:[],isSVG:(X=e,Boolean("svg"===X.tagName||X.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:s};var X}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:d,inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=C.parentNode(e),a=o&&o.tagName,l=C.textContent(e),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(e.nextSibling||e.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=M(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=B(l,ee(t.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(e)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:m});case e.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(e)||"",rootId:m};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:S,newlyAddedElement:P});if(!z)return console.warn(e,"not serialized"),null;j=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===f.Comment)return!0;if(e.type===f.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(le(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===le(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(le(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&le(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(le(e.attributes.property).match(/^(og|twitter|fb):/)||le(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===le(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(le(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(le(e.attributes.name))||le(e.attributes.property).match(/^article:/)||le(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(le(e.attributes.name)))return!0}}return!1}(z,v)||!q&&z.type===f.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?Z:Q();var V=Object.assign(z,{id:j});if(i.add(e,V),j===Z)return null;y&&y(e);var W=!l;if(V.type===f.Element){W=W&&!V.needBlock,delete V.needBlock;var J=C.shadowRoot(e);J&&E(J)&&(V.isShadowHost=!0)}if((V.type===f.Document||V.type===f.Element)&&W){v.headWhitespace&&V.type===f.Element&&"head"===V.tagName&&(q=!1);var Y={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:S,depth:R+1,maxDepth:D};if(V.type===f.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var K of Array.from(C.childNodes(e))){var X=ce(K,Y);X&&V.childNodes.push(X)}var te=null;if(I(e)&&(te=C.shadowRoot(e)))for(var ne of Array.from(C.childNodes(te))){var ve=ce(ne,Y);ve&&(E(te)&&(ve.isShadow=!0),V.childNodes.push(ve))}}var fe=C.parentNode(e);if(fe&&T(fe)&&E(fe)&&(V.isShadow=!0),V.type===f.Element&&"iframe"===V.tagName){var pe=function(e,t,r){var i,n=()=>{},s=e.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),e.removeEventListener("load",h),e.addEventListener("load",o),t())},h=()=>u();return l=setTimeout(u,r),e.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?e.removeEventListener("load",o):(a=!0,e.removeEventListener("load",h))}}var d,c="about:blank";try{d=s.location.href}catch(e){return n}if(d!==c||e.src===c||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),e.removeEventListener("load",o)}}return e.addEventListener("load",o),()=>{e.removeEventListener("load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&b){var r=ce(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:S,depth:R+1,maxDepth:D});r&&b(e,r)}}),_);null==w||w(e,pe)}return V.type===f.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(t,l,f){if(!oe.has(t)){var w;try{w=t.sheet}catch(e){return}if(!w){var C=new AbortController,I=!1,T=()=>{if(!I){I=!0;try{(()=>{if(x){var t=ce(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:S,depth:R,maxDepth:D});t&&x(e,t)}})()}finally{oe.delete(t),C.abort()}}},E=setTimeout(T,f);C.signal.addEventListener("abort",(()=>clearTimeout(E)),{once:!0}),t.addEventListener("load",T,{signal:C.signal,once:!0}),oe.set(t,C)}}}(e,0,k),V}function ve(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class fe{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof fe))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function pe(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}function ge(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var me="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.",ye={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};function be(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}}function _e(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>_e(e,t,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ye=new Proxy(ye,{get(e,t,r){return"map"===t&&console.error(me),Reflect.get(e,t,r)}}));var we=Date.now;function xe(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=C.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function ke(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Se(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ce(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function Ie(e,t,r,i){if(!e)return!1;var n=Ce(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ne(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Te(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Z}function Ee(e,t){if(T(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=C.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||Ee(i,t))}function Me(e){return Boolean(e.changedTouches)}function Pe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Re(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Oe(e){return!!e&&(e instanceof fe&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());class Le{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Fe(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function Ae(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Fe(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function $e(e){return"__ln"in e}class De{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&$e(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&$e(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Ne,qe=(e,t)=>e+"@"+t;class je{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new De,i=e=>{for(var t=e,r=Z;r===Z;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=C.parentNode(n);if(s&&Ae(n)&&"TEXTAREA"!==s.tagName){var o=T(s)?this.mirror.getId(Fe(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ce(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Pe(e,this.mirror)&&this.iframeManager.addIframe(e),Re(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Oe(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)He(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ue(this.droppedSet,o)||He(this.removesSubTreeCache,o)?Ue(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(C.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=C.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=O({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:A(e),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(e=>{if(!Te(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=C.textContent(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:se(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ce(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=A(r);n=O({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ie(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!ie(r.tagName,i))if(o.attributes[i]=re(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&(a.style.cssText=e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ie(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=T(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||Te(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Be(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Ee(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[qe(r,i)]?Be(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!T(e.target)||!E(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),C.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Te(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[qe(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ie(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Oe(e)&&C.childNodes(C.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.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 Be(e,t){e.delete(t),C.childNodes(t).forEach((t=>Be(e,t)))}function He(e,t,r){return 0!==e.size&&function(e,t,r){var i=C.parentNode(t);return!!i&&e.has(i)}(e,t)}function Ue(e,t){return 0!==e.size&&ze(e,t)}function ze(e,t){var r=C.parentNode(t);return!!r&&(!!e.has(r)||ze(e,r))}var Ve=e=>Ne?function(){try{return e(...arguments)}catch(e){if(Ne&&!0===Ne(e))return;throw e}}:e,We=[];function Ge(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ze(e,t){var r=new je;We.push(r),r.init(e);var i=new(k())(Ve(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:i,buffer:r}}function Qe(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e,a=new Map,l=e=>{var o=Ge(e);if(o&&!Ie(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=xe(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),t({id:h,x:l,y:u}))}},u=[pe("scroll",Ve(be(Ve((e=>l(e))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(pe("scrollend",Ve(l),r)),()=>u.forEach((e=>e()))}function Je(e,t){for(var r=We.length-1;r>=0;r--){var i=We[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),We.splice(r,1))}}}var Ye=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function Xe(e){return function e(t,r){if(it("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||it("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||it("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||it("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function et(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function tt(e,t){var r,i,n,s,{mirror:o,stylesheetManager:a}=e;s=o.getId("#document"===t.nodeName?t:C.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ve((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function rt(e,t){void 0===t&&(t={});var i,n,s=e.doc.defaultView;if(!s)return()=>{};if(function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:c,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),c(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM){var o=Ze(e,e.doc);i=o.observer,n=o.buffer}var a=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;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=be(Ve((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),d=Ve(be(Ve((e=>{var t=Ge(e),{clientX:r,clientY:i}=Me(e)?e.changedTouches[0]:e;s||(s=we()),l.push({x:r,y:i,id:n.getId(t),timeOffset:we()-s}),h("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[pe("mousemove",d,i),pe("touchmove",d,i),pe("drag",d,i)];return Ve((()=>{c.forEach((e=>e()))}))}(e),l=function(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=L(e),l=(e=>i=>{var a=Ge(i);if(!Ie(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[e]===h.MouseDown?u="TouchStart":h[e]===h.MouseUp&&(u="TouchEnd"))}else Me(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[e]===h.Click&&(l=c,c=null);var v=Me(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),{clientX:p,clientY:g}=v;Ve(t)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(h[e]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(pe(a,l,i))})),Ve((()=>{u.forEach((e=>e()))}))}(e),c=Qe(e),f=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return pe("resize",Ve(be(Ve((()=>{var e=ke(),t=Se();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:s}),p=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:d,userTriggeredOnInput:c}=e;function v(e){var t=Ge(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=C.parentElement(t)),t&&n&&Ye.indexOf(n)>=0&&!Ie(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,v=!1,p=A(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(u[n.toLowerCase()]||u[p])&&(d=O({element:t,maskInputOptions:u,tagName:n,type:p,value:d,maskInputFn:h})),f(t,c?{text:d,isChecked:v,userTriggered:r}:{text:d,isChecked:v});var g=t.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,c?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,i){var s=Ke.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Ke.set(e,i);var o=n.getId(e);Ve(t)(r({},i,{id:o}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>pe(e,Ve(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((e=>e()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((e=>_e(e[0],e[1],{set(){Ve(v)({target:this,isTrusted:!1})}},!1,g)))),Ve((()=>{p.forEach((e=>e()))}))}(e),g=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ve((e=>be(Ve((s=>{var o=Ge(s);if(o&&!Ie(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:d}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[pe("play",a(v.Play),o),pe("pause",a(v.Pause),o),pe("seeked",a(v.Seeked),o),pe("volumechange",a(v.VolumeChange),o),pe("ratechange",a(v.RateChange),o)];return Ve((()=>{l.forEach((e=>e()))}))}(e),m=()=>{},y=()=>{},b=()=>{},_=()=>{};e.recordDOM&&(m=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ve(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=et(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var h={};nt("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(nt("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),nt("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),nt("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((e=>{var[t,s]=e;d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ve(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=et(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...Xe(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...Xe(t),o]}]}),e.apply(t,s)}))})})),Ve((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:s}),y=tt(e,e.doc),b=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=e,{win:o}=t,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ve(((e,t,o)=>{var l,[u,h,d]=o;if(n.has(u))return a.apply(t,[u,h,d]);var{id:c,styleId:v}=et(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||v&&-1!==v)&&r({id:c,styleId:v,set:{property:u,value:h,priority:d},index:Xe(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ve(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:h,styleId:d}=et(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||d&&-1!==d)&&r({id:h,styleId:d,remove:{property:u},index:Xe(t.parentRule)}),e.apply(t,o)}))}),Ve((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:s}),e.collectFonts&&(_=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=S(r.fonts,"add",(function(e){return function(r){return setTimeout(Ve((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ve((()=>{n.forEach((e=>e()))}))}(e)));var w=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ve((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var h=e.getRangeAt(u),{startContainer:d,startOffset:c,endContainer:v,endOffset:f}=h;Ie(d,i,n,!0)||Ie(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),pe("selectionchange",a)}(e),x=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?S(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),k=[];for(var I of e.plugins)k.push(I.observer(I.callback,s,I.options));return Ve((()=>{if(n){n.destroy(),n.reset();var e=We.indexOf(n);-1!==e&&We.splice(e,1)}null==i||i.disconnect(),a(),l(),c(),f(),p(),g(),m(),y(),b(),_(),w(),x(),k.forEach((e=>e()))}))}function it(e){return void 0!==window[e]}function nt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class st{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class ot{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new st(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new st(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>ge(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{var{win:t,handler:r}=e;ge((()=>t.removeEventListener("pagehide",r)))})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=e.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);ge((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(s)}))}ge((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return t;case l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case l.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===f.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);if(n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(ge((()=>e.removeEventListener("message",t))),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)){var s=this.nestedIframeListeners.get(i);ge((()=>i.removeEventListener("message",s))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var o=this.attachedDocuments.get(r);o&&(o.forEach((e=>{ge((()=>this.mirror.removeNodeFromMap(e)))})),ge((()=>Je(r,o))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var{content:r}=e;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{ge((()=>t.removeEventListener("message",e)))})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>{var{element:r}=t;return e.add(r)})),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class at{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(E(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var{observer:i,buffer:n}=Ze(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>{i.disconnect(),n.destroy(),n.releaseCanvasManager();var e=We.indexOf(n);-1!==e&&We.splice(e,1)})),this.restoreHandlers.push(Qe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(tt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(S(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=C.shadowRoot(this);return s&&Ae(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ut="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ht=0;64>ht;ht++)ut[lt.charCodeAt(ht)]=ht;var dt=new Map,ct=(e,t,r)=>{if(e&&(pt(e,t)||"object"==typeof e)){var i=function(e,t){var r=dt.get(e);return r||dt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function vt(e,t,r,i){if(e instanceof Array)return e.map((e=>vt(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,s=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=lt[r[t]>>2],n+=lt[(3&r[t])<<4|r[t+1]>>4],n+=lt[(15&r[t+1])<<2|r[t+2]>>6],n+=lt[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:s}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[vt(e.buffer,t,r,i),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var o=e.constructor.name,{src:a}=e;return{rr_type:o,src:a}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[vt(e.data,t,r,i),e.width,e.height]}:pt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ct(e,t,r)}:e}var ft=(e,t,r,i)=>e.map((e=>vt(e,t,r,i))),pt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},gt=["webgl","webgl2"];function mt(e){return"nodeType"in e}function yt(e,t,i,n){var s=[];try{if(n){var o=function(e,t,i){var n=e.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return S(n.prototype,"configure",(function(n){return function(s){var o=function(e){var{canvas:t}=e;return t&&"object"==typeof t?t:null}(this);if(!o||mt(o)&&Ie(o,t,i,!0))return n.call(this,s);mt(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(e,t,i);o&&s.push(o)}var a=S(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var s=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Ie(this,t,i,!0)&&("__context"in this||(this.__context=s),n&&gt.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...a])}}));s.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((e=>e()))}}function bt(e,t,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(e),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof e[l])return 0;var u=S(e,l,(function(e){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=e.apply(this,u);if(ct(d,s,this),"tagName"in this.canvas&&!Ie(this.canvas,i,n,!0)){var c=ft(u,s,this,o);r(this.canvas,{type:t,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=_e(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var _t,wt,xt,kt='(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 transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\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 { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, displayWidth, displayHeight });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, displayWidth, displayHeight });\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-CSpkoNCs.js.map\n',St="undefined"!=typeof self&&self.Blob&&new Blob([kt],{type:"text/javascript;charset=utf-8"});function Ct(e){var t;try{if(!(t=St&&(self.URL||self.webkitURL).createObjectURL(St)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(kt),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class It{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o,resolutionScale:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o,resolutionScale:l})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,l=yt(r,i,n,!0),u=new Map,h=new Ct;h.onmessage=e=>{var{id:t}=e.data;if(u.set(t,!1),"base64"in e.data){var{base64:r,type:i,displayWidth:n,displayHeight:s}=e.data;this.mutationCb({id:t,type:c["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0,n,s]}],displayWidth:n,displayHeight:s})}};var d,v=1e3/e,f=0,p=e=>{var l,c;f&&v>e-f||(f=e,(l=[],c=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Ie(e,i,n,!0)||l.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&c(e.shadowRoot)}))}catch(e){}},c(r.document),l).forEach(function(){var e=t((function*(e){var t,r,i=o.mirror.getId(e);if(!u.get(i)&&0!==e.width&&0!==e.height){u.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);if(null==(t=null==n?void 0:n.isContextLost)?void 0:t.call(n))return void u.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,d=e.clientHeight||e.height,c=Math.max(1,Math.round(l*a)),v=Math.max(1,Math.round(d*a)),f=yield createImageBitmap(e,1>a?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});h.postMessage({id:i,bitmap:f,width:c,height:v,displayWidth:l,displayHeight:d,dataURLOptions:s.dataURLOptions},[f])}catch(e){u.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),d=requestAnimationFrame(p)};d=requestAnimationFrame(p),this.resetObservers=()=>{l(),cancelAnimationFrame(d)}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=yt(e,t,r,!1),s=function(e,t,r,i,n){var s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var a=S(t.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Ie(this.canvas,r,i,!0)||setTimeout((()=>{var r=ft(l,t,this,n);e(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=_e(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:c["2D"],property:o,args:[t],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var s=[];return void 0!==t.WebGLRenderingContext&&s.push(...bt(t.WebGLRenderingContext.prototype,c.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&s.push(...bt(t.WebGL2RenderingContext.prototype,c.WebGL2,e,r,i,t,n)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,s))),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Tt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Le),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:P(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,oe.forEach((e=>e.abort())),oe.clear()}trackStylesheetInLinkElement(e){}}class Et{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Mt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Pt=document.createElement("iframe");document.body.appendChild(Pt),Array.from=(null==(n=Pt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pt)}}catch(e){console.debug("Unable to override Array.from",e)}var Rt=new R;function Ot(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:h=null,maskTextClass:d="rr-mask",maskTextSelector:c=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:y,hooks:b,packFn:_,sampling:w={},dataURLOptions:x={},canvasResolutionScale:k,mousemoveWait:S,recordDOM:I=!0,recordCanvas:T=!1,recordCrossOriginIframes:E=!1,recordAfter:M=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:P=!1,collectFonts:O=!1,inlineImages:L=!1,plugins:F,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:D=new Set([]),errorHandler:N}=e;Ne=N;var q=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),j=!E||window.parent===window,B=!1;if(!j)try{window.parent.document&&(B=!1)}catch(e){B=!0}if(j&&!t)throw new Error("emit function is required");if(!j&&!B)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Rt.reset();var H,U=!0===f?{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!==p?p:{password:!0},z=ve(void 0!==g&&g);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var V,W,G=0,Z=new Map,Q=e=>{for(var t of F||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!B&&(e=_(e)),e};_t=(e,r)=>{var s,o=e;if(o.timestamp=we(),!(null==(s=We[0])?void 0:s.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&o.data.source===u.Mutation||We.forEach((e=>e.unfreeze())),j)null==t||t(Q(o),r);else if(B){var a={type:"rrweb",event:Q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)H=o,G=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;G++,(n&&G>=n||i&&o.timestamp-H.timestamp>i)&&wt(!0)}};var J=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,i=new Set;if(e.adds.length>0)for(var n of e.adds){var s=Rt.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}e.removes.forEach((e=>{var{id:r}=e;if(!t||!t.has(r)){var n=ee.getIframeElementById(r);n&&i.has(n)?ee.forgetIframeId(r):(null==V||V(r),ee.removeIframeById(r))}})),null==W||W(),ee.cleanupDetachedIframes()}_t({type:l.IncrementalSnapshot,data:r({source:u.Mutation},e)})},Y=e=>_t({type:l.IncrementalSnapshot,data:r({source:u.Scroll},e)}),K=e=>_t({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),X=new Tt({mutationCb:J,adoptedStyleSheetCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)})}),ee=new ot({mirror:Rt,mutationCb:J,stylesheetManager:X,recordCrossOriginIframes:E,wrappedEmit:_t});for(var te of F||[])te.getMirror&&te.getMirror({nodeMirror:Rt,crossOriginIframeMirror:ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:ee.crossOriginIframeStyleMirror});var re=new Et;xt=new It({recordCanvas:T,mutationCb:K,win:window,blockClass:s,blockSelector:o,mirror:Rt,sampling:w.canvas,dataURLOptions:q,resolutionScale:k});var ie=new at({mutationCb:J,scrollCb:Y,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:d,maskTextSelector:c,inlineStylesheet:v,maskInputOptions:U,dataURLOptions:q,maskTextFn:y,maskInputFn:m,recordCanvas:T,inlineImages:L,sampling:w,slimDOMOptions:z,iframeManager:ee,stylesheetManager:X,canvasManager:xt,keepIframeSrcFn:A,processedNodeManager:re},mirror:Rt});wt=function(e){if(void 0===e&&(e=!1),I){_t({type:l.Meta,data:{href:window.location.href,width:Se(),height:ke()}},e),X.reset(),ie.init(),We.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new R,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:c,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x=(()=>!1),maxDepth:k}=t||{};return ce(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{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===h?{password:!0}:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:ve(v),dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x,newlyAddedElement:!1,maxDepth:k})}(document,{mirror:Rt,blockClass:s,blockSelector:o,maskTextClass:d,maskTextSelector:c,inlineStylesheet:v,maskAllInputs:U,maskTextFn:y,maskInputFn:m,slimDOM:z,dataURLOptions:q,recordCanvas:T,inlineImages:L,onSerialize(e){Pe(e,Rt)&&ee.addIframe(e),Re(e,Rt)&&X.trackLinkElement(e),Oe(e)&&ie.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){ee.attachIframe(e,t),ie.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ee.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){X.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");_t({type:l.FullSnapshot,data:{node:t,initialOffset:xe(window)}},e),We.forEach((e=>e.unlock())),E&&ee.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,Rt.getId(document))}};try{var ne=[];V=e=>{var t=Z.get(e);t&&(t.forEach((e=>{ge(e);var t=ne.indexOf(e);-1!==t&&ne.splice(t,1)})),Z.delete(e))},W=()=>{for(var[e]of Z){var t=Rt.getNode(e);if(t)try{t.contentDocument&&t.contentDocument.defaultView||null==V||V(e)}catch(t){null==V||V(e)}else null==V||V(e)}};var se=e=>{var t;return Ve(rt)({mutationCb:J,mousemoveCb:(e,t)=>_t({type:l.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:Y,viewportResizeCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:K,fontCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){_t({type:l.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){_t({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:h,maskTextClass:d,maskTextSelector:c,maskInputOptions:U,inlineStylesheet:v,sampling:w,recordDOM:I,recordCanvas:T,inlineImages:L,userTriggeredOnInput:P,collectFonts:O,doc:e,maskInputFn:m,maskTextFn:y,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:z,dataURLOptions:q,mirror:Rt,iframeManager:ee,stylesheetManager:X,shadowDomManager:ie,processedNodeManager:re,canvasManager:xt,ignoreCSSAttributes:D,plugins:(null==(t=null==F?void 0:F.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>_t({type:l.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},b)};ee.addLoadListener((e=>{try{var t=Rt.getId(e),r=se(e.contentDocument);if(ne.push(r),-1!==t){var i=Z.get(t);i||Z.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),ee.addPageHideListener((e=>{var t=Rt.getId(e);null==V||V(t),Je(e)}));var oe=-1,ae=e=>_t({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),le=()=>{var e,t,r,i,n=document,s=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=s?Rt.getId(s):-1;o!==oe&&(-1!==oe&&ae({id:oe,enter:!1}),oe=o,-1!==o&&ae({id:o,enter:!0}))},ue=()=>{wt(),ne.push(se(document)),ne.push(pe("fullscreenchange",le)),ne.push(pe("webkitfullscreenchange",le)),ne.push(pe("mozfullscreenchange",le)),ne.push(pe("MSFullscreenChange",le)),Mt=!0};return["interactive","complete"].includes(document.readyState)?ue():(ne.push(pe("DOMContentLoaded",(()=>{_t({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===M&&ue()}))),ne.push(pe("load",(()=>{_t({type:l.Load,data:{}}),"load"===M&&ue()}),window))),()=>{ne.forEach((e=>ge(e))),re.destroy(),ee.removeLoadListener(),ee.destroy(),Z.clear(),Rt.reset(),Mt=!1,Ne=void 0}}catch(e){console.warn(e)}}Ot.addCustomEvent=(e,t)=>{if(!Mt)throw new Error("please add custom event after start recording");_t({type:l.Custom,data:{tag:e,payload:t}})},Ot.freezePage=()=>{We.forEach((e=>e.freeze()))},Ot.takeFullSnapshot=e=>{if(!Mt)throw new Error("please take full snapshot after start recording");wt(e)},Ot.mirror=Rt;var Lt=Object.defineProperty,Ft=(e,t,r)=>((e,t,r)=>t in e?Lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class At{constructor(e){Ft(this,"fileName"),Ft(this,"functionName"),Ft(this,"lineNumber"),Ft(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var $t=/(^|@)\S+:\d+/,Dt=/^\s*at .*(\S+:\d+|\(native\))/m,Nt=/^(eval@)?(\[native code])?$/,qt={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Dt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Dt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new At({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Nt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new At({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new At({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new At({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new At({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match($t)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new At({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function jt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Bt(e){return Array.isArray(e)}function Ht(e){return"object"==typeof e&&null!==e&&!Bt(e)}function Ut(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Ht(e[i])&&Ut(e[i],t-1))return!0;return!1}function zt(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Ht(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Ht(o)&&Ut(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=Bt(u)?jt(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Vt={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 Wt(e,t,r){var i,n=r?Object.assign({},Vt,r):Vt,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=qt.parse(t.error).map((e=>e.toString())),s=[zt(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[zt("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[zt("Uncaught (in promise)",n.stringifyOptions),zt(t.reason,n.stringifyOptions)]);var s=qt.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((e=>e()))};function c(t,r){var i=this;return t[r]?function(t,s,l){try{if(!(s in t))return()=>{};var u=t[s],h=(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=qt.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>zt(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[zt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})(u);return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u}})),t[s]=h,()=>{t[s]=u}}catch(e){return()=>{}}}(t,r):()=>{}}}var Gt=e=>({name:"rrweb/console@1",observer:Wt,options:e}),Zt=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Qt(e){return"string"==typeof e||e}function Jt(e){return"string"==typeof e?e:void 0}var Yt,Kt=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),Xt=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),er=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),tr=["$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"],rr=["token"],ir="NativeGzipValidationError",nr=e=>e.length>=2&&31===e[0]&&139===e[1],sr=(e,t)=>e===Xt.GZipJS||t===Xt.GZipJS||"gzip"===t,or=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),ar=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=ir,t},lr=function(){var e=t((function*(e,t){18>e.size&&ar("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());nr(r)&&8===r[2]||ar("invalid-header");var i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(Yt)return Yt;Yt=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;Yt[e]=t>>>0}return Yt})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&ar("invalid-crc");var n=t.length>>>0;i.getUint32(4,!0)!==n&&ar("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function ur(){return ur=t((function*(e,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(e),s=new CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var e=t((function*(e){try{yield o.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),l=new Response(s.readable).blob(),[u]=yield Promise.all([l,a]);return yield lr(u,n),u}catch(e){if(null!=i&&i.rethrow)throw e;return r&&console.error("Failed to gzip compress data",e),null}})),ur.apply(this,arguments)}var hr=["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"],dr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return hr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};function cr(e,t){return-1!==e.indexOf(t)}var vr=function(e){return e.trim()},fr=function(e){return e.replace(/^\$/,"")},pr=Object.prototype,gr=pr.hasOwnProperty,mr=pr.toString,yr=Array.isArray||function(e){return"[object Array]"===mr.call(e)},br=e=>"function"==typeof e,_r=e=>e===Object(e)&&!yr(e),wr=e=>{if(_r(e)){for(var t in e)if(gr.call(e,t))return!1;return!0}return!1},xr=e=>void 0===e,kr=e=>"[object String]"==mr.call(e),Sr=e=>kr(e)&&0===e.trim().length,Cr=e=>null===e,Ir=e=>xr(e)||Cr(e),Tr=e=>"[object Number]"==mr.call(e)&&e==e,Er=e=>Tr(e)&&e>0,Mr=e=>"[object Boolean]"===mr.call(e),Pr=e=>e instanceof FormData,Rr=e=>cr(rr,e);function Or(e){return null===e||"object"!=typeof e}function Lr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Fr(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var Ar=[!0,"true",1,"1","yes"],$r=e=>cr(Ar,e),Dr=[!1,"false",0,"0","no"];function Nr(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Tr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Nr(n||r,t,r,i))}class qr{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=Nr(e.bucketSize,0,100,e.Ae),this.$e=Nr(e.refillRate,0,this.Fe,e.Ae),this.De=Nr(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var r=Math.floor((t-e.lastAccess)/this.De);r>0&&(e.tokens=Math.min(e.tokens+r*this.$e,this.Fe),e.lastAccess=e.lastAccess+r*this.De)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.Ee[i];return n?this.Ne(n,r):this.Ee[i]=n={tokens:this.Fe,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.Pe)||t.call(this,e)),0===n.tokens)}stop(){this.Ee={}}}var jr="Mobile",Br="iOS",Hr="Android",Ur="Tablet",zr=Hr+" "+Ur,Vr="iPad",Wr="Apple",Gr=Wr+" Watch",Zr="Safari",Qr="BlackBerry",Jr="Samsung",Yr=Jr+"Browser",Kr=Jr+" Internet",Xr="Chrome",ei=Xr+" OS",ti=Xr+" "+Br,ri="Internet Explorer",ii=ri+" "+jr,ni="Opera",si=ni+" Mini",oi="Edge",ai="Microsoft "+oi,li="Firefox",ui=li+" "+Br,hi="Nintendo",di="PlayStation",ci="Xbox",vi=Hr+" "+jr,fi=jr+" "+Zr,pi="Windows",gi=pi+" Phone",mi="Nokia",yi="Ouya",bi="Generic",_i=bi+" "+jr.toLowerCase(),wi=bi+" "+Ur.toLowerCase(),xi="Konqueror",ki="Oculus Browser",Si="Vivaldi",Ci="Yandex",Ii="Whale",Ti="DuckDuckGo",Ei="Pale Moon",Mi="Waterfox",Pi="Brave",Ri="Google Search App",Oi="(\\d+(\\.\\d+)?)",Li=new RegExp("Version/"+Oi),Fi=new RegExp(ci,"i"),Ai=new RegExp(di+" \\w+","i"),$i=new RegExp(hi+" \\w+","i"),Di=new RegExp(Qr+"|PlayBook|BB10","i"),Ni={"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"},qi=function(e,t,r,i){t=t||"";var n=function(e){return null!=e&&e.brave?Pi:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&cr(e,"GSA/")?Ri:cr(e," OPR/")&&cr(e,"Mini")?si:cr(e," OPR/")?ni:Di.test(e)?Qr:cr(e,"IE"+jr)||cr(e,"WPDesktop")?ii:cr(e,"OculusBrowser")?ki:cr(e,Yr)?Kr:cr(e,oi)||cr(e,"Edg/")?ai:cr(e,Si+"/")?Si:cr(e,"YaBrowser/")?Ci:cr(e,Ii+"/")?Ii:cr(e,Ti+"/")||cr(e,"Ddg/")?Ti:cr(e,"FBIOS")?"Facebook "+jr:cr(e,"UCWEB")||cr(e,"UCBrowser")?"UC Browser":cr(e,"CriOS")?ti:cr(e,"CrMo")||cr(e,Xr)?Xr:cr(e,Hr)&&cr(e,Zr)?vi:cr(e,"FxiOS")?ui:cr(e.toLowerCase(),xi.toLowerCase())?xi:cr(e,Pi+"/")?Pi:((e,t)=>t&&cr(t,Wr)||function(e){return cr(e,Zr)&&!cr(e,Xr)&&!cr(e,Hr)}(e))(e,t)?cr(e,jr)?fi:Zr:cr(e,"PaleMoon/")?Ei:cr(e,Mi+"/")?Mi:cr(e,li)?li:cr(e,"MSIE")||cr(e,"Trident/")?ri:cr(e,"Gecko")?li:"")},ji={[ii]:[new RegExp("rv:"+Oi)],[ai]:[new RegExp(oi+"?\\/"+Oi)],[Xr]:[new RegExp("("+Xr+"|CrMo)\\/"+Oi)],[ti]:[new RegExp("CriOS\\/"+Oi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Oi)],[Zr]:[Li],[fi]:[Li],[ni]:[new RegExp("(Opera|OPR)\\/"+Oi)],[li]:[new RegExp(li+"\\/"+Oi)],[ui]:[new RegExp("FxiOS\\/"+Oi)],[xi]:[new RegExp("Konqueror[:/]?"+Oi,"i")],[Qr]:[new RegExp(Qr+" "+Oi),Li],[vi]:[new RegExp("android\\s"+Oi,"i")],[Kr]:[new RegExp(Yr+"\\/"+Oi)],[ki]:[new RegExp("OculusBrowser\\/"+Oi)],[Si]:[new RegExp(Si+"\\/"+Oi)],[Ci]:[new RegExp("YaBrowser\\/"+Oi)],[Ii]:[new RegExp(Ii+"\\/"+Oi)],[Pi]:[new RegExp(Pi+"\\/"+Oi)],[Ti]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Oi)],[Ei]:[new RegExp("PaleMoon\\/"+Oi)],[Mi]:[new RegExp(Mi+"\\/"+Oi)],[Ri]:[new RegExp("GSA\\/"+Oi)],[ri]:[new RegExp("(rv:|MSIE )"+Oi)],Mozilla:[new RegExp("rv:"+Oi)]},Bi=function(e,t,r,i){var n=qi(e,t,r,i),s=ji[n];if(xr(s))return null;for(var o=0;s.length>o;o++){var a=e.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Hi=[[new RegExp(ci+"; "+ci+" (.*?)[);]","i"),e=>[ci,e&&e[1]||""]],[new RegExp(hi,"i"),[hi,""]],[new RegExp(di,"i"),[di,""]],[Di,[Qr,""]],[new RegExp(pi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[gi,""];if(new RegExp(jr).test(t)&&!/IEMobile\b/.test(t))return[pi+" "+jr,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=Ni[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[pi,i]}return[pi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Br,[e[3],e[4],e[5]||"0"].join(".")]:[Br,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=xr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Hr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Hr+")","i"),e=>e&&e[2]?[Hr,[e[2],e[3],e[4]||"0"].join(".")]:[Hr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ei,""]],[/Linux|debian/i,["Linux",""]]],Ui=function(e){return $i.test(e)?hi:Ai.test(e)?di:Fi.test(e)?ci:new RegExp(yi,"i").test(e)?yi:new RegExp("("+gi+"|WPDesktop)","i").test(e)?gi:/iPad/.test(e)?Vr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Gr:Di.test(e)?Qr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(mi,"i").test(e)?mi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(jr).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Hr:zr:new RegExp("(pda|"+jr+")","i").test(e)?_i:new RegExp(Ur,"i").test(e)&&!new RegExp(Ur+" pc","i").test(e)?wi:""},zi=function(e,t){var r,i,n,s,o=Ui(e);return o===Vr||o===zr||"Kobo"===o||"Kindle Fire"===o||o===wi?Ur:o===hi||o===ci||o===di||o===yi?"Console":o===Gr?"Wearable":o?jr:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?jr:Ur:"Desktop"},Vi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Wi(e,t){return"string"==typeof(r=e)&&Vi.test(r)?e:t();var r}function Gi(e){return e?e.split("#")[0]:e}function Zi(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var Qi={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}},Ji=Qi.info;function Yi(e){if(Mr(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(yr(e))return{arrayValue:{values:e.map((e=>Yi(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function Ki(e){var t=[];for(var r in e){var i=e[r];Cr(i)||xr(i)||t.push({key:r,value:Yi(i)})}return t}function Xi(e,t){var i=e.level||"info",{text:n,number:s}=Qi[i]||Ji,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),Ir(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),Ir(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:Ki(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),xr(e.trace_flags)||(u.flags=e.trace_flags),u}function en(e,t,i){return r({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}function tn(e,t,r,i){return{resourceLogs:[{resource:{attributes:Ki(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}let rn=class{constructor(e,t,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=r,this.qe=i,this.je=n,this.Be=s,this.He=o,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.it(e);if(null!==t)if(t.body){if(this.nt()){var r={record:Xi(t,this.qe())};this.je((()=>this.st(r)))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(e){var t=this.Se.beforeSend;if(!t)return e;var r=yr(t)?t:[t],i=e;for(var n of r)try{var s=n(i);if(!s)return this.Ae.info("Log was rejected in beforeSend function"),null;i=s}catch(e){return this.Ae.error("Error in beforeSend function for log:",e),null}return i}nt(){if(void 0===this.et)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var e=this;return t((function*(){if(!e._instance.isDisabled)return e.Ue||(e.Ue=e.ot().finally((()=>{e.Ue=null}))),e.Ue}))()}ot(){var e=this;return t((function*(){var t;e.tt();var r=null!==(t=e._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==t?t:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;e.ze=0;var a=Math.min(r.length,e.Ke),l=r.slice(0,a),u=l.map((e=>e.record)),h=tn(u,e.ut(),null!==(s=e.He)&&void 0!==s?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.ht(h);if("too-large"===d.kind&&l.length>1)e.Ke=Math.max(1,Math.floor(l.length/2)),e.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ke);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?e.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(l.length),r=null!==(o=e._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}dt(e){var r=this;return t((function*(){var t,i=Math.max(0,e-r.ze),n=null!==(t=r._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==t?t:[];r._instance.setPersistedProperty(Kt.LogsQueue,n.slice(i)),yield r.Be()}))()}ut(){return en(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){var t;if(!this._instance.optedOut){var r=null!==(t=this._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==t?t:[];this.Je>r.length||(r.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(Kt.LogsQueue,r),this.Qe>r.length?this.ct():this.rt()}}ct(e){void 0===e&&(e=this.Ye),this.vt||(this.vt=Zi((()=>{this.vt=void 0,this.rt()}),e))}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*Math.pow(2,e)}yt(){var e=this._instance.getPersistedProperty(Kt.LogsQueue);return!!e&&e.length>0}shutdown(e){var r=this;return t((function*(){r.tt();var t=r.flush().catch((()=>{}));void 0!==e?yield Promise.race([t,new Promise((t=>Zi(t,e)))]):yield t}))()}flushWithTimeout(e){var r=this;return t((function*(){var t=!1,i=r.flush(),n=new Promise((r=>Zi((()=>{t=!0,r()}),e)));try{yield Promise.race([i,n])}finally{t&&i.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.Ve=0}),(e=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",e)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};function nn(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}var sn,on,an;function ln(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return an&&r.length===on||(on=r.length,an=r.reduce(((r,i)=>{sn||(sn={});var n=sn[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,sn[i]=[l,u];break}}return r}),{})),an}}class un{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&yr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:ln(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var hn="?";function dn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?hn:r,in_app:!0};return xr(i)||(s.lineno=i),xr(n)||(s.colno=n),s}var cn=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:hn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},vn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,fn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pn=/\((\S*)(?::(\d+))(?::(\d+))\)/,gn=(e,t)=>{var r=vn.exec(e);if(r){var[,i,n,s]=r;return dn(t,i,hn,+n,+s)}var o=fn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=pn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=cn(o[1]||hn,o[2]);return dn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},mn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bn=(e,t)=>{var r=mn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=yn.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]||hn;return[s,n]=cn(s,n),dn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},_n=/\(error: (.*)\)/,wn=50;class xn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=kr(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return Lr(e,"DOMException")}isDOMError(e){return Lr(e,"DOMError")}}class kn{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Sn{constructor(){}match(e){return Lr(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Cn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class In{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Cn);return i&&(t=i[1],r=i[2]),[t,r]}}var Tn=["fatal","error","warning","log","info","debug"];function En(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Mn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Fr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+En(e)}isSeverityLevel(e){return kr(e)&&!Sr(e)&&Tn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Pn{match(e){return Fr(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+En(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Rn{match(e){return Or(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class On{match(e){return Lr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Fr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return Or(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Ln="$message",Fn="$timestamp",An=new Set([Ln,Fn]),$n={enabled:!0,max_bytes:32768};function Dn(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:$n.enabled,max_bytes:qn(e.max_bytes,$n.max_bytes)}:r({},$n)}class Nn{constructor(e){this.bt=[],this._t=0,this.Se=Dn(e)}setConfig(e){this.Se=Dn(e),this.wt()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}}))}catch(e){return}}(e);if(t)try{var r=JSON.parse(t);if(!_r(r))return;var i=r,n=i[Ln],s=i[Fn];if(!kr(n)||0===n.trim().length)return;if(!kr(s)&&!Tr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this.Se.max_bytes||(this.bt.push({step:t.step,bytes:r}),this._t+=r,this.wt())}}getAttachable(){return this.bt.map((e=>e.step))}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}}function qn(e,t){if(!Tr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var jn="undefined"!=typeof window?window:void 0,Bn="undefined"!=typeof globalThis?globalThis:jn;"undefined"==typeof self&&(Bn.self=Bn),"undefined"==typeof File&&(Bn.File=function(){});var Hn=null==Bn?void 0:Bn.navigator,Un=null==Bn?void 0:Bn.document,zn=null==Bn?void 0:Bn.location,Vn=null==Bn?void 0:Bn.fetch,Wn=null!=Bn&&Bn.XMLHttpRequest&&"withCredentials"in new Bn.XMLHttpRequest?Bn.XMLHttpRequest:void 0,Gn=null==Bn?void 0:Bn.AbortController,Zn=null==Bn?void 0:Bn.CompressionStream,Qn=null==Hn?void 0:Hn.userAgent,Jn=null!=jn?jn:{},Yn=e=>e instanceof Document,Kn="1.396.2",Xn={DEBUG:!1,LIB_VERSION:Kn,LIB_NAME:"web",JS_SDK_VERSION:Kn},es=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={k(t){if(jn&&(Xn.DEBUG||Jn.POSTHOG_DEBUG||r)&&!xr(jn.console)&&jn.console){for(var i=("__rrweb_original__"in jn.console[t]?jn.console[t].__rrweb_original__:jn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>es(e+" "+t,r)};return i},ts=es("[PostHog.js]"),rs=ts.createLogger;function is(e,t){yr(e)&&e.forEach(t)}function ns(e,t){if(!Ir(e))if(yr(e))e.forEach(t);else if(Pr(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)gr.call(e,r)&&t(e[r],r)}var ss=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function os(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var as=function(e){try{return e()}catch(e){return}},ls=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){ts.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ts.critical(e)}}},us=function(e){var t={};return ns(e,(function(e,r){(kr(e)&&e.length>0||Tr(e))&&(t[r]=e)})),t};var hs=["herokuapp.com","vercel.app","netlify.app"];function ds(e){var t=null==e?void 0:e.hostname;if(!kr(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of hs)if(r===i)return!1;return!0}function cs(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}function vs(e){return"ph_toolbar_internal"===e.name}var fs=e=>{var t=null==Un?void 0:Un.createElement("a");return xr(t)?null:(t.href=e,t)},ps=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return ns(e,(function(e,t){xr(e)||xr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},gs=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!yr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){ts.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},ms=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");yr(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},ys=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function bs(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return br(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]===n&&(e[t]=i)}}catch(e){return()=>{}}}function _s(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function ws(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!br(i))return t;try{var n=i(t);return kr(n)&&n?n:t}catch(e){return ts.error("Error in get_current_url, falling back to window.location.href",e),t}}function xs(e){var t,r=null==jn||null==(t=jn.location)?void 0:t.href;return xr(r)?void 0:ws(e,r)}var ks="$people_distinct_id",Ss="$device_id",Cs="$device_model",Is="__alias",Ts="__timers",Es="$autocapture_disabled_server_side",Ms="$heatmaps_enabled_server_side",Ps="$exception_capture_enabled_server_side",Rs="$error_tracking_suppression_rules",Os="$error_tracking_capture_extension_exceptions",Ls="$web_vitals_enabled_server_side",Fs="$dead_clicks_enabled_server_side",As="$product_tours_enabled_server_side",$s="$web_vitals_allowed_metrics",Ds="$session_recording_remote_config",Ns="$replay_sample_rate",qs="$replay_override_sampling",js="$replay_override_linked_flag",Bs="$replay_override_url_trigger",Hs="$replay_override_event_trigger",Us="$sesid",zs="$session_is_sampled",Vs="$enabled_feature_flags",Ws="$active_feature_flags",Gs="$early_access_features",Zs="$feature_flag_details",Qs="$feature_flag_payloads",Js="$feature_flag_request_id",Ys="$override_feature_flags",Ks="$override_feature_flag_payloads",Xs="$stored_person_properties",eo="$stored_group_properties",to="$surveys",ro="$surveys_loaded_at",io="$surveys_activated",no="ph_product_tours",so="$flag_call_reported",oo="$flag_call_reported_session_id",ao="$feature_flag_errors",lo="$feature_flag_evaluated_at",uo="$user_state",ho="$client_session_props",co="$capture_rate_limit",vo="$initial_campaign_params",fo="$initial_referrer_info",po="$initial_person_info",go="$epp",mo="__POSTHOG_TOOLBAR__",yo="$posthog_cookieless",bo="$sdk_debug_extensions_init_method",_o="$sdk_debug_extensions_init_time_ms",wo="$sdk_debug_recording_script_not_loaded",xo="PostHog loadExternalDependency extension not found.",ko="on_reject",So="always",Co="anonymous",Io="identified",To="identified_only",Eo="visibilitychange",Mo="beforeunload",Po="$pageview",Ro="$pageleave",Oo="$identify",Lo="$groupidentify",Fo=1,Ao=3,$o=11;function Do(e){return e instanceof Element&&(e.id===mo||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function No(e){return!!e&&e.nodeType===Fo}function qo(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function jo(e){return!!e&&e.nodeType===Ao}function Bo(e){return!!e&&e.nodeType===$o&&No(e.host)}function Ho(e){return e?vr(e).split(/\s+/):[]}function Uo(e,t){var r=xs(t);return!!(r&&e&&e.some((e=>r.match(e))))}function zo(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Ho(t)}function Vo(e){return Ir(e)?null:vr(e).split(/(\s+)/).filter((e=>pa(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wo(e){var t="";return aa(e)&&!la(e)&&e.childNodes&&e.childNodes.length&&ns(e.childNodes,(function(e){var r;jo(e)&&e.textContent&&(t+=null!==(r=Vo(e.textContent))&&void 0!==r?r:"")})),vr(t)}function Go(e){return xr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Zo=["a","button","form","input","select","textarea","label"];function Qo(e,t){if(xr(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function Jo(e){var t=e.parentNode;return!(!t||!No(t))&&t}var Yo=[".ph-no-autocapture","[data-ph-no-autocapture]"],Ko=["next","previous","prev",">","<"],Xo=[...Ko,"+","-","−","–"],ea=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,ta=[".ph-no-deadclick",".ph-no-capture"],ra=[".ph-no-rageclick",".ph-no-capture"],ia=["","text","search","email","password","url","tel","number"];function na(e,t){if(!jn||sa(e))return!1;var r,i,n,s,o;if(Mr(t)?(r=!!t&&ra,i=void 0,n=!1):(r=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:ra,i=null==t?void 0:t.content_ignorelist,n=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(e){return!(!e||!No(e))&&(!!qo(e,"textarea")||(qo(e,"input")?cr(ia,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var{targetElementList:a}=oa(e,!1);return!function(e,t){if(!1===e||xr(e))return!1;var r;if(!0===e)r=Ko;else{if(!yr(e))return!1;if(e.length>10)return ts.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>ea(t,e)||ea(i,e)))}))}(i,a.map((e=>{var t;return{safeText:Wo(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!Qo(a,r)}var sa=e=>!e||qo(e,"html")||!No(e),oa=(e,t)=>{if(!jn||sa(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!qo(n,"body");)if(Bo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Jo(n);if(!s)break;if(t||Zo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=jn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function aa(e){for(var t=e;t.parentNode&&!qo(t,"body");t=t.parentNode){var r=zo(t);if(cr(r,"ph-sensitive")||cr(r,"ph-no-capture"))return!1}if(cr(zo(e),"ph-include"))return!0;var i=e.type||"";if(kr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!kr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function la(e){return!!(qo(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qo(e,"select")||qo(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ua="(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})",ha=new RegExp("^(?:"+ua+")$"),da=new RegExp(ua),ca="\\d{3}-?\\d{2}-?\\d{4}",va=new RegExp("^("+ca+")$"),fa=new RegExp("("+ca+")");function pa(e,t){if(void 0===t&&(t=!0),Ir(e))return!1;if(kr(e)){if(e=vr(e),(t?ha:da).test((e||"").replace(/[- ]/g,"")))return!1;if((t?va:fa).test(e))return!1}return!0}function ga(e){var t=Wo(e);return pa(t=(t+" "+ma(e)).trim())?t:""}function ma(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ns(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Wo(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ma(e)).trim())}catch(e){ts.error("[AutoCapture]",e)}})),t}function ya(e){return e.replace(/"|\\"/g,'\\"')}function ba(e){var t=e.attr__class;return t?yr(t)?t:Ho(t):void 0}var _a=1e6,wa={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:_a,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},xa=rs("[Recorder]"),ka=e=>"navigation"===e.entryType,Sa=e=>"resource"===e.entryType;function Ca(e,t){return!!t&&(Mr(t)||t[e])}function Ia(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var Ta=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ea(e){var{type:t,recordBody:r,headers:i,url:n}=e;function s(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!Ia(t)&&e(t.url)}catch(e){return!1}}(n))return!1;if(s(Ta))return!1;if(Mr(r))return!0;if(yr(r))return s(r);var o=r[t];return Mr(o)?o:s(o)}function Ma(e,t,r,i,n,s){return Pa.apply(this,arguments)}function Pa(){return Pa=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return xa.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(Sa(o=e[s])&&o.initiatorType===t&&(xr(i)||o.startTime>=i)&&(xr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),Ma(e,t,r,i,n,s+1))})),Pa.apply(this,arguments)}function Ra(e){var{body:t,options:r,url:i}=e;if(Ir(t))return null;var{hostname:n,isHostDenied:s}=_s(i,r);if(s)return n+" is in deny list";if(kr(t))return t;if(Yn(t))return t.textContent;if(Pr(t))return ps(t);if(_r(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Oa=e=>!Cr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function La(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:h}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:xr(a)?void 0:Math.round(a),endTime:xr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Oa(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Fa=["video/","audio/"];function Aa(e){return _r(e)&&br(e.getReader)&&br(e.tee)}var $a=500,Da="[SessionReplay] Timeout while trying to read body",Na="[SessionReplay] Failed to read body";function qa(e){return Na+": "+e}function ja(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Ba(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(Da)),$a);try{e.clone().text().then((e=>t(e)),(e=>t(qa(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Na)}}))}(e);var r=function(e){var t;return Math.min(_a,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:_a)}(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(ja(r)):function(e,t){return new Promise((r=>{var i,n=!1;function s(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(l),s(),r(e))}var a,l=setTimeout((()=>o(Da)),$a);try{a=e.clone()}catch(e){return void o(Na)}var u=a.body;if(Aa(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(e){return void o(Na)}var h=[],d=0;!function e(){i.read().then((r=>{var{done:i,value:a}=r;if(n)s();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>t)return void o(ja(t));d+=a.byteLength,h.push(a)}e()}}),(e=>o(qa(e))))}()}else try{a.text().then((e=>o(e)),(e=>o(qa(e))))}catch(e){o(Na)}}))}(e,r)}function Ha(){return Ha=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=_s(i,r);return s?Promise.resolve(n+" is in deny list"):Ba(t,r)})),Ha.apply(this,arguments)}function Ua(){return Ua=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Fa.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=_s(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return Cr(n)?Ba(t,r):Promise.resolve(n)})),Ua.apply(this,arguments)}var za=null;function Va(e,i,n){if(!("performance"in i))return()=>{};if(za)return xa.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},wa,n):wa,o=t=>{var i=[];t.requests.forEach((e=>{var t=s.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>ka(e)||Sa(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>La({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>ka(e)||Sa(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>La({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ca("request",r.recordHeaders),n=Ca("response",r.recordHeaders),s=bs(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d,c,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=e=>(Ea({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Ra({body:e,options:r,url:a})),d=t.performance.now(),y(e));var b=()=>{v.removeEventListener("readystatechange",_),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},_=()=>{if(v.readyState===v.DONE){b(),c=t.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Ea({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Ra({body:v.response,options:r,url:a})),Ma(t,"xmlhttprequest",f.url,d,c).then((t=>{var r=La({entry:t,method:o,status:null==v?void 0:v.status,networkRequest:p,start:d,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ca("request",i.recordHeaders),s=Ca("response",i.recordHeaders),o=bs(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,h,d=new Request(t,a),c={};try{var v={};d.headers.forEach(((e,t)=>{v[t]=e})),n&&(c.requestHeaders=v),!Aa(null==a?void 0:a.body)&&Ea({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(c.requestBody=yield function(e){return Ha.apply(this,arguments)}({r:d,options:i,url:t})),u=r.performance.now(),l=Ia(t)?yield o(d):yield o(t,a),h=r.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),s&&(c.responseHeaders=f),Ea({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(c.responseBody=yield function(e){return Ua.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{Ma(r,"fetch",d.url,u,h).then((t=>{var r,i=La({entry:t,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:u,end:h,url:d.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),za=()=>{a(),l(),u(),za=null}}var Wa=e=>({name:"rrweb/network@1",observer:Va,options:e});Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Gt,getRecordNetworkPlugin:Wa},Jn.__PosthogExtensions__.rrweb={record:Ot,version:"v2",wasMaxDepthReached:()=>de,resetMaxDepthState(){de=!1,he=!1}},Jn.rrweb={record:Ot,version:"v2"},Jn.rrwebConsoleRecord={getRecordConsolePlugin:Gt},Jn.getRecordNetworkPlugin=Wa;var Ga,Za,Qa,Ja,Ya,Ka,Xa,el,tl,rl,il,nl,sl,ol,al,ll={},ul=[],hl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dl=Array.isArray;function cl(e,t){for(var r in t)e[r]=t[r];return e}function vl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function fl(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Ga.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return pl(e,o,i,n,null)}function pl(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Qa:n,__i:-1,__u:0};return null==n&&null!=Za.vnode&&Za.vnode(s),s}function gl(e){return e.children}function ml(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function yl(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],s=cl({},t);s.__v=t.__v+1,Za.vnode&&Za.vnode(s),El(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?$(t):r,!!(32&t.__u),n),s.__v=t.__v,s.__.__k[s.__i]=s,Pl(i,s,n),t.__e=t.__=null,s.__e!=r&&bl(s)}}function bl(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),bl(e)}function _l(e){(!e.__d&&(e.__d=!0)&&Ja.push(e)&&!wl.__r++||Ya!=Za.debounceRendering)&&((Ya=Za.debounceRendering)||Ka)(wl)}function wl(){try{for(var e,t=1;Ja.length;)Ja.length>t&&Ja.sort(Xa),e=Ja.shift(),t=Ja.length,yl(e)}finally{Ja.length=wl.__r=0}}function xl(e,t,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||ul,b=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=pl(null,o,null,null,null):dl(o)?o=e.__k[s]=pl(gl,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=pl(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+c,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=Sl(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Fl(a,a));return i}(r,t,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ll,v.__i=d,g=El(e,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&Ll(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=kl(v,l,e,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function kl(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=kl(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Sl(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function Cl(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||hl.test(t)?r:r+"px"}function Il(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Cl(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||Cl(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(il,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r[rl]=i[rl]:(r[rl]=nl,e.addEventListener(t,s?ol:sl,s)):e.removeEventListener(t,s?ol:sl,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Tl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[tl])t[tl]=nl++;else if(r[rl]>t[tl])return;return r(Za.event?Za.event(t):t)}}}function El(e,t,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(h=Za.__b)&&h(t);e:if("function"==typeof S)try{if(m=t.props,y=S.prototype&&S.prototype.render,b=(h=S.contextType)&&i[h.__c],$=h?b?b.props.value:h.__:i,r.__c?g=(d=t.__c=r.__c).__=d.__E:(y?t.__c=d=new S(m,$):(t.__c=d=new ml(m,$),d.constructor=S,d.render=Al),b&&b.sub(d),d.state||(d.state={}),d.__n=i,c=d.__d=!0,d.__h=[],d._sb=[]),y&&null==d.__s&&(d.__s=d.state),y&&null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=cl({},d.__s)),cl(d.__s,S.getDerivedStateFromProps(m,d.__s))),v=d.props,f=d.state,d.__v=t,c)y&&null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),y&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(y&&null==S.getDerivedStateFromProps&&m!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,$),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,$)){t.__v!=r.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),ul.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,$),y&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,f,p)}))}if(d.context=$,d.props=m,d.__P=e,d.__e=!1,_=Za.__r,w=0,y)d.state=d.__s,d.__d=!1,_&&_(t),h=d.render(d.props,d.state,d.context),ul.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,_&&_(t),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++w);d.state=d.__s,null!=d.getChildContext&&(i=cl(cl({},i),d.getChildContext())),y&&!c&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(v,f)),x=null!=h&&h.type===gl&&null==h.key?Rl(h.props.children):h,a=xl(e,dl(x)?x:[x],t,r,i,n,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(k=s.length;k--;)vl(s[k]);Ml(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Ml(t);Za.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=Ol(r.__e,t,r,i,n,s,o,l,u);return(h=Za.diffed)&&h(t),128&t.__u?void 0:a}function Ml(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ml))}function Pl(e,t,r){for(var i=0;r.length>i;i++)Ll(r[i],r[++i],r[++i]);Za.__c&&Za.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Za.__e(e,t.__v)}}))}function Rl(e){return"object"!=typeof e||null==e||e.__b>0?e:dl(e)?e.map(Rl):void 0!==e.constructor?null:cl({},e)}function Ol(e,t,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ll,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,s[u]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),a&&(Za.__m&&Za.__m(t,s),a=!1),s=null}if(null==y)g===m||a&&e.data==m||(e.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Ga.call(e.childNodes),!a&&null!=s)for(g={},u=0;e.attributes.length>u;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||Il(e,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||Il(e,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),xl("template"==t.type?e.content:e,dl(c)?c:[c],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&$(r,0),a,l),null!=s)for(u=s.length;u--;)vl(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Il(e,u,f,g[u],n),u="checked",null!=p&&p!=e[u]&&Il(e,u,p,g[u],n))}return e}function Ll(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Za.__e(e,r)}}function Fl(e,t,r){var i,n;if(Za.unmount&&Za.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Ll(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Za.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&Fl(i[n],t,r||"function"!=typeof e.type);r||vl(e.__e),e.__c=e.__=e.__e=void 0}function Al(e,t,r){return this.constructor(e,r)}function $l(e,t,r){var i,n,s;t==document&&(t=document.documentElement),Za.__&&Za.__(e,t),i=t.__k,n=[],s=[],El(t,e=t.__k=fl(gl,null,[e]),i||ll,ll,t.namespaceURI,i?null:t.firstChild?Ga.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),Pl(n,e,s)}Ga=ul.slice,Za={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Qa=0,ml.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=cl({},this.state),"function"==typeof e&&(e=e(cl({},r),this.props)),e&&cl(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),_l(this))},ml.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_l(this))},ml.prototype.render=gl,Ja=[],Ka="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Xa=function(e,t){return e.__v.__b-t.__v.__b},wl.__r=0,el=Math.random().toString(8),tl="__d"+el,rl="__a"+el,il=/(PointerCapture)$|Capture$/i,nl=0,sl=Tl(!1),ol=Tl(!0),al=0;var Dl,Nl,ql,jl,Bl=0,Hl=[],Ul=Za,zl=Ul.__b,Vl=Ul.__r,Wl=Ul.diffed,Gl=Ul.__c,Zl=Ul.unmount,Ql=Ul.__;function Jl(e,t){Ul.__h&&Ul.__h(Nl,e,Bl||t),Bl=0;var r=Nl.__H||(Nl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Yl(e){return Bl=1,function(e,t,r){var i=Jl(Dl++,2);if(i.t=e,!i.__c&&(i.__=[lu(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Nl,!Nl.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.some((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};Nl.__f=!0;var s=Nl.shouldComponentUpdate,o=Nl.componentWillUpdate;Nl.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},Nl.shouldComponentUpdate=n}return i.__N||i.__}(lu,e)}function Kl(e,t){var r=Jl(Dl++,3);!Ul.__s&&au(r.__H,t)&&(r.__=e,r.u=t,Nl.__H.__h.push(r))}function Xl(e){return Bl=5,eu((function(){return{current:e}}),[])}function eu(e,t){var r=Jl(Dl++,7);return au(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function tu(e){var t=Nl.context[e.__c],r=Jl(Dl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Nl)),t.props.value):e.__}function ru(){for(var e;e=Hl.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(su),t.__h.some(ou),t.__h=[]}catch(r){t.__h=[],Ul.__e(r,e.__v)}}}Ul.__b=function(e){Nl=null,zl&&zl(e)},Ul.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ql&&Ql(e,t)},Ul.__r=function(e){Vl&&Vl(e),Dl=0;var t=(Nl=e.__c).__H;t&&(ql===Nl?(t.__h=[],Nl.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.some(su),t.__h.some(ou),t.__h=[],Dl=0)),ql=Nl},Ul.diffed=function(e){Wl&&Wl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Hl.push(t)&&jl===Ul.requestAnimationFrame||((jl=Ul.requestAnimationFrame)||nu)(ru)),t.__H.__.some((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),ql=Nl=null},Ul.__c=function(e,t){t.some((function(e){try{e.__h.some(su),e.__h=e.__h.filter((function(e){return!e.__||ou(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ul.__e(r,e.__v)}})),Gl&&Gl(e,t)},Ul.unmount=function(e){Zl&&Zl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{su(e)}catch(e){t=e}})),r.__H=void 0,t&&Ul.__e(t,r.__v))};var iu="function"==typeof requestAnimationFrame;function nu(e){var t,r=function(){clearTimeout(i),iu&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);iu&&(t=requestAnimationFrame(r))}function su(e){var t=Nl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Nl=t}function ou(e){var t=Nl;e.__c=e.__(),Nl=t}function au(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function lu(e,t){return"function"==typeof t?t(e):t}var uu="events",hu="cancelEvents",du={Tab:"tab",Selector:"selector"},cu={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"},vu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},fu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},pu={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},gu={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},mu="always",yu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},bu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},_u="popover";function wu(e){return"$survey_response_"+e}function xu(e,t){if(!t)return null;var r=e[wu(t)];return yr(r)?[...r]:r}function ku(e,t){void 0===e&&(e={});var i={};return t.questions.forEach((t=>{if(!xr(t.originalQuestionIndex)){var r,n=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=xu(e,t.id);xr(s)||(i[n]=s)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:xu(e,t.id)})))},e,i)}function Su(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function Cu(e){return"string"==typeof e&&e.trim()?e.trim():null}function Iu(e){return e.toLowerCase()}function Tu(e,t,r){if(!e||!t)return null;var i=Iu(t),n=Object.keys(e).find((e=>Iu(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(e).find((e=>Iu(e)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}function Eu(e,t,i){var n,s=Tu(e.translations,t,i),o=r({},e),a=!1;if(s){var l,u=null==(l=e.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),xr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),xr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),xr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),xr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),xr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),xr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(e){return!(xr(e.thankYouMessageHeader)&&xr(e.thankYouMessageDescription)&&xr(e.thankYouMessageCloseButtonText)&&xr(e.submitButtonText)&&xr(e.backButtonText))}(u)&&(a=!0))}var h=e.questions.map((e=>function(e,t,i){var n,s=Tu(e.translations,t,i);if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(n=e.translations)?void 0:n[s];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var a=r({},e),l=!1;return xr(o.question)||(a.question=o.question,l=!0),xr(o.description)||(a.description=o.description,l=!0),xr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!xr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!xr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!xr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(e){return yr(e.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:e,matchedKey:l?s:null,hasChanges:l}}(e,t,i))),d=h.map((e=>e.question)),c=h.some((e=>e.hasChanges)),v=null;return s||(v=(null==(n=h.find((e=>e.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:a?s||v:null}}var Mu=rs("[Surveys]");function Pu(e){return!(!e.start_date||e.end_date)}function Ru(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Ou(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Lu="seenSurvey_",Fu="inProgressSurvey_",Au=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},$u=e=>Au(Lu,e),Du=e=>{try{var t=$u(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Mu.error("Failed to persist survey seen state",e)}},Nu=[fu.Popover,fu.Widget,fu.API],qu={ignoreConditions:!1,ignoreDelay:!1,displayType:_u};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Tr(e)&&isFinite(e)&&Math.floor(e)===e});class ju{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new ju(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new ju(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Bu{constructor(){this.S=0,this.C=0,this.I=new zu}generate(){var e=this.generateOrAbort();if(xr(e)){this.S=0;var t=this.generateOrAbort();if(xr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return ju.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Hu,Uu=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};jn&&!xr(jn.crypto)&&crypto.getRandomValues&&(Uu=e=>crypto.getRandomValues(e));class zu{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Uu(this.R),this.O=0),this.R[this.O++]}}var Vu=()=>Wu().toString(),Wu=()=>(Hu||(Hu=new Bu)).generate(),Gu="gzip-js",Zu="base64",Qu=Uint8Array,Ju=Uint16Array,Yu=Uint32Array,Ku=new Qu([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]),Xu=new Qu([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]),eh=new Qu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),th=function(e,t){for(var r=new Ju(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new Yu(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]},rh=th(Ku,2),ih=rh[1];rh[0][28]=258,ih[258]=28;for(var nh=th(Xu,0)[1],sh=new Ju(32768),oh=0;32768>oh;++oh){var ah=(43690&oh)>>>1|(21845&oh)<<1;sh[oh]=((65280&(ah=(61680&(ah=(52428&ah)>>>2|(13107&ah)<<2))>>>4|(3855&ah)<<4))>>>8|(255&ah)<<8)>>>1}var lh=function(e,t,r){for(var i=e.length,n=0,s=new Ju(t);i>n;++n)++s[e[n]-1];var o,a=new Ju(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ju(1<<t);var l=15-t;for(n=0;i>n;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],d=a[e[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[sh[d]>>>l]=u}else for(o=new Ju(i),n=0;i>n;++n)o[n]=sh[a[e[n]-1]++]>>>15-e[n];return o},uh=new Qu(288);for(oh=0;144>oh;++oh)uh[oh]=8;for(oh=144;256>oh;++oh)uh[oh]=9;for(oh=256;280>oh;++oh)uh[oh]=7;for(oh=280;288>oh;++oh)uh[oh]=8;var hh=new Qu(32);for(oh=0;32>oh;++oh)hh[oh]=5;var dh=lh(uh,9,0),ch=lh(hh,5,0),vh=function(e){return(e/8>>0)+(7&e&&1)},fh=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Ju?Ju:e instanceof Yu?Yu:Qu)(r-t);return i.set(e.subarray(t,r)),i},ph=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},gh=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},mh=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Qu(0),0];if(1==n){var o=new Qu(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Ju(c+1),f=yh(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(s.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=s[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=s[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==t&&(--v[_],++p)}f=t}return[new Qu(v),f]},yh=function(e,t,r){return-1==e.s?Math.max(yh(e.l,t,r+1),yh(e.r,t,r+1)):t[e.s]=r},bh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ju(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},_h=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},wh=function(e,t,r){var i=r.length,n=vh(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},xh=function(e,t,r,i,n,s,o,a,l,u,h){ph(t,h++,r),++n[256];for(var d=mh(n,15),c=d[0],v=d[1],f=mh(s,15),p=f[0],g=f[1],m=bh(c),y=m[0],b=m[1],_=bh(p),w=_[0],x=_[1],k=new Ju(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=mh(k,7),I=C[0],T=C[1],E=19;E>4&&!I[eh[E-1]];--E);var M,P,R,O,L=u+5<<3,F=_h(n,uh)+_h(s,hh)+o,A=_h(n,c)+_h(s,p)+o+14+3*E+_h(k,I)+(2*k[16]+3*k[17]+7*k[18]);if(F>=L&&A>=L)return wh(t,h,e.subarray(l,l+u));if(ph(t,h,1+(F>A)),h+=2,F>A){M=lh(c,v,0),P=c,R=lh(p,g,0),O=p;var D=lh(I,T,0);for(ph(t,h,b-257),ph(t,h+5,x-1),ph(t,h+10,E-4),h+=14,S=0;E>S;++S)ph(t,h+3*S,I[eh[S]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)ph(t,h,D[B=31&j[S]]),h+=I[B],B>15&&(ph(t,h,j[S]>>>5&127),h+=j[S]>>>12)}}else M=dh,P=uh,R=ch,O=hh;for(S=0;a>S;++S)if(i[S]>255){var B;gh(t,h,M[257+(B=i[S]>>>18&31)]),h+=P[B+257],B>7&&(ph(t,h,i[S]>>>23&31),h+=Ku[B]);var H=31&i[S];gh(t,h,R[H]),h+=O[H],H>3&&(gh(t,h,i[S]>>>5&8191),h+=Xu[H])}else gh(t,h,M[i[S]]),h+=P[i[S]];return gh(t,h,M[256]),h+P[256]},kh=new Yu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Sh=function(){for(var e=new Yu(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Ch=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Ih(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Sh[255&r^t[i]]^r>>>8;e=r},d(){return 4294967295^e}}}(),i=e.length;r.p(e);var n,s,o,a,l=(n=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,r,i,n,s){var o=e.length,a=new Qu(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=wh(l,u,e.subarray(h,d)):(l[h]=!0,u=wh(l,u,e.subarray(h,o)))}else{for(var c=kh[t-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new Ju(32768),m=new Ju(p+1),y=Math.ceil(r/3),b=2*y,_=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},w=new Yu(25e3),x=new Ju(288),k=new Ju(32),S=0,C=0,I=(h=0,0),T=0,E=0;o>h;++h){var M=_(h),P=32767&h,R=m[M];if(g[P]=R,m[M]=P,h>=T){var O=o-h;if((S>7e3||I>24576)&&O>423){u=xh(e,l,0,w,x,k,C,I,E,h-E,u),I=S=C=0,E=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)k[L]=0}var F=2,A=0,D=f,N=P-R&32767;if(O>2&&M==_(h-N))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),B=Math.min(258,O);j>=N&&--D&&P!=R;){if(e[h+F]==e[h+F-N]){for(var H=0;B>H&&e[h+H]==e[h+H-N];++H);if(H>F){if(F=H,A=N,H>q)break;var U=Math.min(N,H-2),z=0;for(L=0;U>L;++L){var V=h-N+L+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,R=V)}}}N+=(P=R)-(R=g[P])+32768&32767}if(A){w[I++]=268435456|ih[F]<<18|nh[A];var G=31&ih[F],Z=31&nh[A];C+=Ku[G]+Xu[Z],++x[257+G],++k[Z],T=h+F,++S}else w[I++]=e[h],++x[e[h]]}}u=xh(e,l,!0,w,x,k,C,I,E,h-E,u)}return fh(a,0,i+vh(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ch(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}}(l,t),Ch(l,u-8,r.d()),Ch(l,u-4,i),l}var Th=!!Wn||!!Vn,Eh="text/plain",Mh=!1,Ph=(e,t)=>{var[r,i]=e.split("#"),[n,s]=r.split("?");if(!s)return e;var o=s.split("&").filter((e=>e.split("=")[0]!==t)).join("&");return n+(o?"?"+o:"")+(i?"#"+i:"")},Rh=function(e,t,i){var n;void 0===i&&(i=!0);var[s,o]=e.split("?"),a=r({},t),l=null!==(n=null==o?void 0:o.split("&").map((e=>{var t,[r,n]=e.split("="),s=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],u=ps(a);return u&&l.push(u),s+"?"+l.join("&")},Oh=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Lh=e=>{if(e.xt)return e.xt;var{data:t,compression:r}=e;if(t){if(r===Gu){var i=Ih(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Qu(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new Qu(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return fh(i,0,n)}(Oh(t)),{mtime:0});return{contentType:Eh,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Zu){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(Oh(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Oh(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Oh(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Fh=e=>{var t,i,n=()=>({url:Ph(e.url,"compression"),encodedBody:Lh(r({},e,{compression:void 0,xt:void 0}))});try{t=Lh(e)}catch(t){if(sr(e.compression,gs(e.url,"compression")))return ts.error("Failed to gzip request body, sending uncompressed payload",t),n();throw t}return t&&sr(e.compression,gs(e.url,"compression"))&&!((i=t.body)instanceof ArrayBuffer?nr(new Uint8Array(i)):ArrayBuffer.isView(i)&&nr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Mh=!0,n()):{url:e.url,encodedBody:t}},Ah=e=>{try{return Fh(e)}catch(t){return ts.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},$h=function(){var e=t((function*(e){var t=Oh(e.data),i=yield function(e,t,r){return ur.apply(this,arguments)}(t,Xn.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{xt:{contentType:Eh,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Dh=(e,t)=>Rh(e,{_:(new Date).getTime().toString(),ver:Xn.JS_SDK_VERSION,compression:t}),Nh=[];Vn&&Nh.push({transport:"fetch",method(e){var t,i=Ah(e);if(i){var{url:n,encodedBody:s}=i,{contentType:o,body:a,estimatedSize:l}=null!=s?s:{},u=new Headers;ns(e.headers,(function(e,t){u.append(t,e)})),o&&u.append("Content-Type",o);var h=null,d=null;if(Gn){var c=new Gn;h={signal:c.signal,timeout:setTimeout((()=>{var t,r;t=e.timeout,(r=new Error("PostHog request timed out"+(t?" after "+t+"ms":""))).name="AbortError",c.abort(d=r)}),e.timeout)}}Vn(n,r({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&52428.8>(l||0),body:a,signal:null==(t=h)?void 0:t.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){ts.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{t===d?ts.warn(t):ts.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>h?clearTimeout(h.timeout):null))}}}),Wn&&Nh.push({transport:"XHR",method(e){var t=Ah(e);if(t){var r=new Wn,{url:i,encodedBody:n}=t;r.open(e.method||"GET",i,!0);var{contentType:s,body:o}=null!=n?n:{};ns(e.headers,(function(e,t){r.setRequestHeader(t,e)})),s&&r.setRequestHeader("Content-Type",s),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(o)}}}),null!=Hn&&Hn.sendBeacon&&Nh.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:r}=Fh(e),{contentType:i,body:n}=null!=r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});Hn.sendBeacon(t,s)}catch(e){}}});var qh=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function jh(e,t,r){return Oh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Bh={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>qh(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!qh(t,e))))),icontains:(e,t)=>t.map(Hh).some((t=>e.map(Hh).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Hh).every((t=>e.map(Hh).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},Hh=e=>e.toLowerCase();function Uh(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(xr(n)||Cr(n))return!1;var s=[String(n)],o=Bh[i.operator];return!!o&&o(i.values,s)}))}var zh="",Vh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Wh={N:()=>!!Un,D(e){ts.error("cookieStore error: "+e)},P(e){if(Un){try{for(var t=e+"=",r=Un.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},F(e){var t;try{t=JSON.parse(Wh.P(e))||{}}catch(e){}return t},q(e,t,r,i,n){if(!Un)return!1;try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Un),zh)return zh;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Vu();!zh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",zh=s)}return zh}(e);if(!r){var i=(e=>{var t=e.match(Vh);return t?t[0]:""})(e);i!==r&&ts.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Un.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ts.warn("cookieStore warning: large cookie, len="+u.length),Un.cookie=u,!0}catch(e){return!1}},A(e,t){if(null!=Un&&Un.cookie)try{Wh.q(e,"",-1,t)}catch(e){return}}},Gh=null,Zh={N(){if(!Cr(Gh))return Gh;var e=!0;if(xr(jn))e=!1;else try{var t="__mplssupport__";Zh.q(t,"xyz"),'"xyz"'!==Zh.P(t)&&(e=!1),Zh.A(t)}catch(t){e=!1}return e||ts.error("localStorage unsupported; falling back to cookie store"),Gh=e,e},D(e){ts.error("localStorage error: "+e)},P(e){try{return null==jn?void 0:jn.localStorage.getItem(e)}catch(e){Zh.D(e)}return null},F(e){try{return JSON.parse(Zh.P(e))||{}}catch(e){}return null},q(e,t){try{return null==jn||jn.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Zh.D(e)}return!1},A(e){try{null==jn||jn.localStorage.removeItem(e)}catch(e){Zh.D(e)}}},Qh=[Ss,"distinct_id",Us,zs,go,po,uo],Jh={},Yh={N:()=>!0,D(e){ts.error("memoryStorage error: "+e)},P:e=>Jh[e]||null,F:e=>Jh[e]||null,q:(e,t)=>(Jh[e]=t,!0),A(e){delete Jh[e]}},Kh=null,Xh={N(){if(!Cr(Kh))return Kh;if(Kh=!0,xr(jn))Kh=!1;else try{var e="__support__";Xh.q(e,"xyz"),'"xyz"'!==Xh.P(e)&&(Kh=!1),Xh.A(e)}catch(e){Kh=!1}return Kh},D(e){ts.error("sessionStorage error: ",e)},P(e){try{return null==jn?void 0:jn.sessionStorage.getItem(e)}catch(e){Xh.D(e)}return null},F(e){try{return JSON.parse(Xh.P(e))||null}catch(e){}return null},q(e,t){try{return null==jn||jn.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Xh.D(e)}return!1},A(e){try{null==jn||jn.sessionStorage.removeItem(e)}catch(e){Xh.D(e)}}},ed=rs("[Stylesheet Loader]"),td=jn,rd=Un,id="#020617",nd={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:cu.Right,widgetType:du.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:id,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},sd=[cu.Center,cu.Left,cu.Right];function od(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function ad(e){var t;void 0===e&&(e=nd.backgroundColor),"#"===e[0]&&(t=od(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=od(r)),!t)return id;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?id:"white"}return id}var ld=(e,t,i)=>{var n=Id(e),s=rd.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=rd.createElement("div");((e,t,i)=>{var n=r({},nd,i),s=e.style,o=!sd.includes(n.position)||t===fu.Widget&&(null==i?void 0:i.widgetType)===du.Tab;s.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||ad(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",ad(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||ad(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",ad(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)||ad(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=':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)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(ed.error("prepare_external_dependency_stylesheet returned null"),null)})(rd,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return rd.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},ud=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:l}=e;s?(Du(i),s.capture(yu.SENT,r({[bu.SURVEY_NAME]:i.name,[bu.SURVEY_ID]:i.id,[bu.SURVEY_ITERATION]:i.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[bu.SURVEY_SUBMISSION_ID]:n,[bu.SURVEY_COMPLETED]:o},l&&{[bu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},ku(t,i),a,{$set:{[Su(i,"responded")]:!0}})),o&&(td.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Cd(i))):Mu.error("[survey sent] event not captured, PostHog instance not found.")},hd=(e,t,i)=>{return r({[bu.SURVEY_NAME]:e.name,[bu.SURVEY_ID]:e.id,[bu.SURVEY_ITERATION]:e.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[bu.SURVEY_PARTIALLY_COMPLETED]:(n=null==t?void 0:t.responses,void 0===n&&(n={}),Object.values(n).some((e=>!Ir(e))))},(null==t?void 0:t.surveyLanguage)&&{[bu.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[bu.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},ku(null==t?void 0:t.responses,e));var n},dd=(e,t,i,n)=>{if(t){if(!i){var s=kd(e);t.capture(yu.DISMISSED,r({},hd(e,s,t),n&&{[bu.SURVEY_LANGUAGE]:n},{$set:{[Su(e,"dismissed")]:!0}})),Cd(e),Du(e),td.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Mu.error("[survey dismissed] event not captured, PostHog instance not found.")},cd=(e,t)=>{if(t){var r=(e=>Au("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=kd(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(yu.ABANDONED,hd(e,i,t),{transport:"sendBeacon"})}}else Mu.error("[survey abandoned] event not captured, PostHog instance not found.")},vd=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),fd=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,pd=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?fd(e.questions,vd(e.questions)):e.questions,gd=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===mu||Sd(e)},md=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,_l(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+al++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),yd=()=>tu(md),bd=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return function(e,t,r){var i,n,s,o,a=cl({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Ga.call(arguments,2):r),pl(e.type,a,i||e.key,n||e.ref,null)}(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function _d(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=xs(t);if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return Bh[o](s,[n])}var wd=e=>{var t=""+Fu+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Fu+e.id+"_"+e.current_iteration),t},xd=(e,t)=>{try{localStorage.setItem(wd(e),JSON.stringify(t))}catch(e){Mu.error("Error setting in-progress survey state in localStorage",e)}},kd=e=>{try{var t=localStorage.getItem(wd(e));if(t)return JSON.parse(t)}catch(e){Mu.error("Error getting in-progress survey state from localStorage",e)}return null},Sd=e=>{var t=kd(e);return!Ir(null==t?void 0:t.surveySubmissionId)},Cd=e=>{try{localStorage.removeItem(wd(e))}catch(e){Mu.error("Error clearing in-progress survey state from localStorage",e)}};function Id(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Td(e,t,r){if(void 0===t&&(t=cu.Right),e===fu.ExternalSurvey)return{};switch(t){case cu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case cu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case cu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case cu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case cu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case cu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case cu.Left:return{left:"30px"};case cu.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===fu.Widget&&r===du.Tab?"60px":"30px"}}}var Ed=0;function Md(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ed,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Za.vnode&&Za.vnode(u),u}var Pd=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Rd=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Od=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Ld=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Fd=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Ad=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Md("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"})}),$d=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Md("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"})}),Dd=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return Md("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Md("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Md("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:t})]})},Nd=Md("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Md("g",{"clip-path":"url(#clip0_2415_6911)",children:[Md("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Md("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Md("g",{mask:"url(#mask0_2415_6911)",children:[Md("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"}),Md("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"}),Md("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"}),Md("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"}),Md("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"}),Md("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"})]})]}),Md("defs",{children:Md("clipPath",{id:"clip0_2415_6911",children:Md("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function qd(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Md("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Nd]})}function jd(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a,canGoBack:l,onBack:u}=e,{isPreviewMode:h}=tu(md),d=!!l&&!!u,c=!a&&Md("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==jn||jn.open(s)),h?null==o||o():n()},children:t});return Md("div",{className:"bottom-section",children:[d?Md("div",{className:"form-buttons form-buttons-with-back",children:[Md("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&Md(qd,{urlParams:{utm_source:"survey-footer"}})]})}function Bd(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return Md("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Md(t.type===pu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&bd({component:fl("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Hd(e){var{onClick:t}=e,{isPreviewMode:r}=tu(md);return Md("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Dd({fill:"black"})})}Md("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Md("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 Ud=jn;function zd(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=tu(md);return Kl((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return cs(Ud,"keydown",e),()=>{Ud.removeEventListener("keydown",e)}}),[o]),Md("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Md(Hd,{onClick:()=>o()}),Md("h3",{className:"thank-you-message-header",children:t}),r&&bd({component:fl("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Md(jd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Vd=e=>yr(e)&&e.every((e=>kr(e)));function Wd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a,canGoBack:l,onBack:u}=e,{isPreviewMode:h}=yd(),d=Xl(null),[c,v]=Yl((()=>kr(a)?a:""));Kl((()=>{setTimeout((()=>{var e;h||null==(e=d.current)||e.focus()}),100)}),[h]);var f="surveyQuestion"+o,p=eu((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case er.MinLength: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 er.MaxLength: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}(c,t.validation,t.optional)),[c,t.validation,t.optional]),g=nn(t.validation,er.MinLength),m=nn(t.validation,er.MaxLength),y=eu((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(g,m)),[g,m]),b=()=>{p||n(c.trim())},_=()=>{p||s(c.trim())};return Md(gl,{children:[Md("div",{className:"question-container",children:[Md(Bd,{question:t,forceDisableHtml:r,htmlFor:f}),Md("textarea",{ref:d,id:f,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:g,maxLength:m,onInput(e){v(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||p||(e.preventDefault(),h?_():b())},value:c}),y&&Md("div",{className:"validation-hint",children:y})]}),Md(jd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:i,onSubmit:b,onPreviewSubmit:_,canGoBack:l,onBack:u})]})}function Gd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,canGoBack:o,onBack:a}=e;return Md(gl,{children:[Md("div",{className:"question-container",children:Md(Bd,{question:t,forceDisableHtml:r})}),Md(jd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked"),canGoBack:o,onBack:a})]})}function Zd(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l,canGoBack:u,onBack:h}=e,d=r.scale,c=10===r.scale?0:1,[v,f]=Yl((()=>Tr(l)?l:yr(l)&&l.length>0&&Tr(parseInt(l[0]))?parseInt(l[0]):kr(l)&&Tr(parseInt(l))?parseInt(l):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:g}=yd(),m=e=>g?a(e):o(e);return Md(gl,{children:[Md("div",{className:"question-container",children:[Md(Bd,{question:r,forceDisableHtml:i}),Md("div",{className:"rating-section",children:[Md("div",{className:"rating-options",children:["emoji"===r.display&&Md("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=ec[r.scale])?void 0:t.map(((e,t)=>Md("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===v?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;f(e),r.skipSubmitButton&&m(e)},children:e},t)))}),"number"===r.display&&Md("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:tc(r.scale).map(((e,t)=>Md(Qd,{displayQuestionIndex:n,active:v===e,appearance:s,num:e,setActiveNumber(e){f(e),r.skipSubmitButton&&m(e)}},t)))})]}),!p&&Md("div",{className:"rating-text",children:[Md("div",{children:r.lowerBoundLabel}),Md("div",{children:r.upperBoundLabel})]})]})]}),Md(jd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Cr(v)&&!r.optional,appearance:s,onSubmit:()=>o(v),onPreviewSubmit:()=>a(v),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Qd(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return Md("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){n(t)},children:t})}function Jd(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l,canGoBack:u,onBack:h}=e,d=Xl(null),c=eu((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=fd(t,vd(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[v,f]=Yl((()=>((e,t)=>kr(e)||Vd(e)?e:t===pu.SingleChoice?null:[])(l,t.type))),[p,g]=Yl((()=>((e,t)=>{if(kr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Vd(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:m}=yd(),y=t.type===pu.SingleChoice,b=t.type===pu.MultipleChoice,_=t.skipSubmitButton&&y&&!t.hasOpenChoice,w=(e,t)=>{if(t){var i=!p.isSelected;return g((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),y&&f(""),void(i&&setTimeout((()=>{var e;return null==(e=d.current)?void 0:e.focus()}),75))}if(y)return f(e),g((e=>r({},e,{isSelected:!1,inputValue:""}))),void(_&&(o(e),m&&a(e)));b&&yr(v)&&(v.includes(e)?f(v.filter((t=>t!==e))):f([...v,e]))},x=e=>{e.stopPropagation();var t=e.currentTarget.value;g((e=>r({},e,{inputValue:t}))),y&&f(t)},k=e=>{e.stopPropagation(),"Enter"!==e.key||S()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),g((e=>r({},e,{isSelected:!1,inputValue:""}))),y&&f(null))},S=()=>!(t.optional||!Cr(v)&&(!yr(v)||p.isSelected||0!==v.length)&&(!p.isSelected||""!==p.inputValue.trim())),C=()=>{p.isSelected&&b?yr(v)&&(m?a([...v,p.inputValue]):o([...v,p.inputValue])):m?a(v):o(v)};return Md(gl,{children:[Md("div",{className:"question-container",children:[Md(Bd,{question:t,forceDisableHtml:i}),Md("fieldset",{className:"multiple-choice-options limit-height",children:[Md("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),c.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?p.isSelected:y?v===e:yr(v)&&v.includes(e);return Md("label",{className:i?"choice-option-open":"",children:[Md("div",{className:"response-choice",children:[Md("input",{type:y?"radio":"checkbox",name:s,checked:a,onChange:()=>w(e,i),id:s,"aria-controls":o}),Md("span",{children:i?e+":":e})]}),i&&Md("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:k,onInput:x,onClick(t){p.isSelected||w(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Md(jd,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:_,canGoBack:u,onBack:h})]})}var Yd=[1,2,3,4,5],Kd=[1,2,3,4,5,6,7],Xd=[0,1,2,3,4,5,6,7,8,9,10],ec={2:[Ad,$d],3:[Od,Rd,Pd],5:[Ld,Od,Rd,Pd,Fd]};function tc(e){switch(e){case 5:default:return Yd;case 7:return Kd;case 10:return Xd}}var rc=rs("[Surveys]");function ic(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?gu.End:s;if(n.branching.type===gu.End)return gu.End;if(n.branching.type===gu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===gu.ResponseBased){if(n.type===pu.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===gu.End?gu.End:s}}else if(n.type===pu.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===gu.End?gu.End:s}}return s}return rc.warn("Falling back to next question index due to unexpected branching type"),s}var nc="https?://(.*)",sc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],oc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...sc],ac="<masked>",lc=["li_fat_id"];function uc(e,t,r){if(!Un)return{};var i,n=t?[...sc,...r||[]]:[],s=hc(ms(Un.URL,n,ac),e),o=(i={},ns(lc,(function(e){var t=Wh.P(e);i[e]=t||null})),i);return ss(o,s)}function hc(e,t){var r=oc.concat(t||[]),i={};return ns(r,(function(t){var r=gs(e,t);i[t]=r||null})),i}function dc(e){var t=function(e){return e?0===e.search(nc+"google.([^/?]*)")?"google":0===e.search(nc+"bing.com")?"bing":0===e.search(nc+"yahoo.com")?"yahoo":0===e.search(nc+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Cr(t)){i.$search_engine=t;var n=Un?gs(Un.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function cc(){return navigator.language||navigator.userLanguage}var vc="$direct";function fc(){return(null==Un?void 0:Un.referrer)||vc}function pc(e,t,r){void 0===r&&(r=!1);var i=e?[...sc,...t||[]]:[],n=r?Gi(null==zn?void 0:zn.href):null==zn?void 0:zn.href,s=null==n?void 0:n.substring(0,1e3);return{r:fc().substring(0,1e3),u:s?ms(s,i,ac):void 0}}function gc(e,t){var r;void 0===t&&(t=!1);var{r:i,u:n}=e,s=t?Gi(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==vc?vc:null==(r=fs(i))?void 0:r.host};if(s){o.$current_url=s;var a=fs(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=hc(s);ss(o,l)}if(i){var u=dc(i);ss(o,u)}return o}function mc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function yc(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var bc=rs("[SurveyTranslations]");function _c(e,t){var r=function(e){return function(e,t){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=e,s=Cu(r);if(s)return null==t||t.info("Using override display language: "+s),s;var o=function(e){return e&&"object"==typeof e&&"language"in e?Cu(e.language):null}(i);if(o)return null==t||t.info("Using person property language: "+o),o;var a=Cu(n);return a?(null==t||t.info("Using detected locale: "+a),a):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:br(e.get_property)?e.get_property(Xs):void 0,locale:cc()},bc)}(t);if(!r)return bc.info("No user language detected"),{survey:e,language:null};var i=Eu(e,r,bc);return{survey:i.survey,language:i.matchedKey}}var wc=jn,xc=Un,kc="ph:show_survey_widget",Sc="PHWidgetSurveyClickListener";function Cc(e,t){try{var r=e.getBoundingClientRect(),i=wc.innerHeight,n=wc.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:nd.zIndex}}catch(e){return Mu.warn("Failed to calculate trigger position:",e),null}}class Ic{constructor(e){var t=this;this.B=new Map,this.H=new Map,this.j=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(to);if(e)for(var t of e)Sd(t)&&cd(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,{survey:a,language:l}=this.U(e),u=null!=t&&t.position||null!=t&&t.selector?r({},a,{appearance:r({},a.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):a;this.W(u.id);var{properties:h,initialResponses:d}=null!=t?t:{},c=!(!d||0>=Object.keys(d).length)&&this.V(u,d,h,l);if(!c||null!=(i=u.appearance)&&i.displayThankYouMessage){this.Z(u);var v={};if((null==(n=u.appearance)?void 0:n.position)===cu.NextToTrigger&&null!=(s=u.appearance)&&s.widgetSelector){var f,p=xc.querySelector(u.appearance.widgetSelector);p&&(v=Cc(p,parseInt((null==(f=u.appearance)?void 0:f.maxWidth)||nd.maxWidth))||{})}var g=(null==(o=u.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=ld(u,this._posthog),y={posthog:this._posthog,survey:u,removeSurveyFromFocus:this.$,properties:h,style:v,isSurveyCompleted:c,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:l};if(0>=g)return $l(Md(Pc,r({},y)),m);var b=setTimeout((()=>{if(this.B.delete(u.id),!this.G(u))return Mu.info("Survey "+u.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(u);$l(Md(Pc,r({},y,{survey:r({},u,{appearance:r({},u.appearance,{surveyPopupDelaySeconds:0})})})),m)}),1e3*g);this.B.set(u.id,b)}},this.Y=e=>{var{survey:t,language:r}=this.U(e),{shadow:i,isNewlyCreated:n}=ld(t,this._posthog);n&&$l(Md(Oc,{posthog:this._posthog,survey:t,surveyLanguage:r},e.id),i)},this.J=e=>{this.K(e);var t=this.H.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Sc),this.H.delete(e.id),Mu.info("Removed click listener for survey "+e.id))},this.X=(e,t)=>{var r=xc.querySelector(t),i=this.H.get(e.id);if(r){if(this.Y(e),i){if(r===i.element)return;Mu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.J(e)}if(!r.hasAttribute(Sc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===cu.NextToTrigger?Cc(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||nd.maxWidth)):{};wc.dispatchEvent(new CustomEvent(kc,{detail:{surveyId:e.id,position:n}}))};cs(r,"click",n),r.setAttribute(Sc,"true"),this.H.set(e.id,{element:r,listener:n,survey:e}),Mu.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.J(e)},this.renderPopover=e=>{var{survey:t,language:r}=this.U(e),{shadow:i}=ld(t,this._posthog);$l(Md(Pc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,surveyLanguage:r}),i)},this.renderSurvey=(e,t,r)=>{var i,{survey:n,language:s}=this.U(e),o=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(o=this.ee(n,s)),$l(Md(Pc,{posthog:this._posthog,survey:n,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:s}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.G(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===fu.Popover||e.type===fu.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.B.keys()))i.has(n)||t.cancelSurvey(n);var s=t.te(r),o=new Set;s.forEach((e=>{if(e.type===fu.Widget){var r,i,n,s;if((null==(r=e.appearance)?void 0:r.widgetType)===du.Tab)return void t.Y(e);(null==(i=e.appearance)?void 0:i.widgetType)===du.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.X(e,null==(s=e.appearance)?void 0:s.widgetSelector))}Cr(t.re)&&e.type===fu.Popover&&t.handlePopoverSurvey(e)})),t.H.forEach((e=>{var{survey:r}=e;o.has(r.id)||t.J(r)}))}),e)},this.Z=e=>{Cr(this.re)||Mu.error("Survey "+this.re+" already in focus. Cannot add survey "+e.id+"."),this.re=e.id},this.$=e=>{this.re!==e.id&&Mu.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.W(e.id),this.re=null,this.K(e)},this._posthog=e,this.re=null}W(e){var t=this.B.get(e);t&&(clearTimeout(t),this.B.delete(e))}cancelSurvey(e){this.B.has(e)&&(Mu.info("Cancelled pending survey "+e),this.W(e),this.re===e&&(this.re=null))}te(e){return e.sort(((e,t)=>{var r,i,n=Sd(e),s=Sd(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===mu,a=t.schedule===mu;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(e){return _c(e,this._posthog)}ee(e,t){if(this.j.has(e.id))return!1;var{params:r}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!xr(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var d=parseInt(h[1],10);t[d]||(t[d]=[]),t[d].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(wc.location.search);if(0===Object.keys(r).length)return!1;Mu.info("[Survey Prefill] Detected URL prefill parameters");var i=this.ne(e,r,t);if(!i)return!1;var{responses:n,submissionId:s,isSurveyCompleted:o,skippedResponses:a}=i;return(Object.keys(a).length>0&&e.enable_partial_responses||o)&&ud({responses:o?n:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:t}),this.j.add(e.id),o}V(e,t,r,i){var n={};for(var[s,o]of Object.entries(t))n[parseInt(s)]=yr(o)?o.map(String):[String(o)];Mu.info("[Survey] Processing initial responses");var a=this.ne(e,n,i);if(!a)return!1;var{responses:l,submissionId:u,isSurveyCompleted:h}=a;return ud({responses:l,survey:e,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:h,properties:r,surveyLanguage:i}),h}ne(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=wu(e.id);try{switch(e.type){case pu.SingleChoice:if(!e.choices||0===e.choices.length)return void ts.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void ts.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case pu.MultipleChoice:if(!e.choices||0===e.choices.length)return void ts.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void ts.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&ts.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case pu.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||0>u||u>h)return void ts.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:ts.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){ts.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return Mu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Vu(),s=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:a}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=wu(o.id);xr(r[a])||(n[a]=r[a])}var l=ic(e,i,o.id?r[wu(o.id)]:null);if(l===gu.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,s,i),l=o>=e.questions.length;return xd(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Mu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return Mu.error("[Survey Prefill] Error handling prefill:",e),null}}ie(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}ae(e){return!e.conditions||_d(e,this._posthog)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!Qn)return!1;var s=zi(Qn,{userAgentDataPlatform:null==Hn||null==(r=Hn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Hn?void 0:Hn.maxTouchPoints,screenWidth:null==jn||null==(i=jn.screen)?void 0:i.width,screenHeight:null==jn||null==(n=jn.screen)?void 0:n.height,devicePixelRatio:null==jn?void 0:jn.devicePixelRatio});return Bh[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==rd||!rd.querySelector(e.conditions.selector))}(e)}oe(e){return gd(e)||this.ie(e.internal_targeting_flag_key)||Sd(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Pu(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Nu.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.ie(e.linked_flag_key,n)?this.ie(e.targeting_flag_key)?this.oe(e)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Zh.P("lastSeenSurveyDate"))?(e=>!!Zh.P($u(e))&&!gd(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}se(e){var t;if(!Ru(e)&&!Ou(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}ue(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.ie(r)}))}G(e){return this.checkSurveyEligibility(e).eligible&&this.ae(e)&&this.se(e)&&this.ue(e)}K(e){try{var t=xc.querySelector(Id(e,!0));null!=t&&t.shadowRoot&&$l(null,t.shadowRoot),null==t||t.remove()}catch(t){Mu.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.B,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function Tc(e,t){if(xc&&wc){var r,i=new Ic(e);if(e.config.disable_surveys_automatic_display)return Mu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Mu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{xr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),cs(xc,"visibilitychange",(()=>{xc.hidden?xr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Ec(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1,posthog:s}=e;Kl((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,n=t.type===fu.Widget,o=_d(t,s),a=(null==(e=t.appearance)?void 0:e.widgetType)===du.Tab&&n;if(!o)return Mu.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);a&&(Mu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};cs(wc,"popstate",o),cs(wc,"hashchange",o);var a=wc.history.pushState,l=wc.history.replaceState;return wc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];a.apply(this,t),o()},wc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];l.apply(this,t),o()},()=>{wc.removeEventListener("popstate",o),wc.removeEventListener("hashchange",o),wc.history.pushState=a,wc.history.replaceState=l}}}),[n,t,r,i,s])}function Mc(e){switch(void 0===e&&(e=vu.Right),e){case vu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case vu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case vu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Pc(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,style:d={},previewPageIndex:c,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPreviewBack:g=(()=>{}),onPopupSurveyDismissed:m=(()=>{}),onCloseConfirmationMessage:y=(()=>{}),properties:b,isSurveyCompleted:_,skipShownEvent:w,surveyLanguage:x}=e,k=Xl(null),S=Number.isInteger(c),C=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:I,isSurveySent:T,hidePopupWithViewTransition:E}=function(e,t,i,n,s,o,a,l,u){var[h,d]=Yl(n||0===i||e.type===fu.ExternalSurvey),[c,v]=Yl(!1),f=()=>{var t=()=>{o&&s(e),d(!1)};xc.startViewTransition?xc.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&f()};return Kl((()=>{if(t){if(!n){var s=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{if(_d(e,t)){d(!0),wc.dispatchEvent(new Event("PHSurveyShown")),l||t.capture(yu.SHOWN,r({[bu.SURVEY_NAME]:e.name,[bu.SURVEY_ID]:e.id,[bu.SURVEY_ITERATION]:e.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[bu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};if(cs(wc,"PHSurveyClosed",p),cs(wc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),wc.removeEventListener("PHSurveyClosed",p),wc.removeEventListener("PHSurveySent",s)}}return o(),()=>{wc.removeEventListener("PHSurveyClosed",p),wc.removeEventListener("PHSurveySent",s)}}}else Mu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Ec({survey:e,removeSurveyFromFocus:s,setSurveyVisible:d,isPreviewMode:n,posthog:t}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithViewTransition:f}}(l,h,C,S,v,f,k,w,x),M=T||c===l.questions.length||!0===_,P=eu((()=>{var e=kd(l),t=(null==e?void 0:e.surveySubmissionId)||Vu();return{isPreviewMode:S,previewPageIndex:c,onPopupSurveyDismissed(){x?dd(l,h,S,x):dd(l,h,S),m()},isPopup:f||!1,surveySubmissionId:t,onPreviewSubmit:p,onPreviewBack:g,posthog:h,properties:b,surveyLanguage:x}}),[S,c,f,h,l,m,p,g,b,x]);return I?Md(md.Provider,{value:P,children:Md("div",{className:"ph-survey",style:r({},Td(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:k,children:M?Md(zd,{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||nd,onClose(){E(),y()}}):Md(Rc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function Rc(e){var t,i,{survey:n,forceDisableHtml:s,posthog:o}=e,[a,l]=Yl((()=>{var e=kd(n);return null!=e&&e.responses&&Mu.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:h,isPopup:d,onPreviewSubmit:c,onPreviewBack:v,surveySubmissionId:f,isPreviewMode:p,properties:g,surveyLanguage:m}=tu(md),[y,b]=Yl((()=>{var e=kd(n);return u||(null==e?void 0:e.lastQuestionIndex)||0})),[_,w]=Yl((()=>{var e,t=kd(n);return null!==(e=null==t?void 0:t.visitedIndices)&&void 0!==e?e:[]})),x=eu((()=>pd(n)),[n]);Kl((()=>{p&&!xr(u)&&b(u)}),[u,p]);var k=!(null==(t=n.appearance)||!t.allowGoBack)&&(p?(null!=u?u:0)>0:_.length>0),S=x.at(y);return S?Md("form",{className:"survey-form",name:"surveyForm",children:[d&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&Md(Hd,{onClick(){h()}}),Md("div",{className:"survey-box","data-question-index":y,children:Lc({question:S,forceDisableHtml:s,displayQuestionIndex:y,appearance:n.appearance||nd,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:i,questionId:s}=e;if(o)if(s){var u=wu(s),h=r({},a,{[u]:t});l(h);var d=ic(n,i,t),c=d===gu.End,v=[..._,i];if(c||(w(v),b(d),xd(n,{surveySubmissionId:f,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:m})),n.enable_partial_responses||c){var p=new Set(v.map((e=>{var t;return null==(t=x[e])?void 0:t.id})).filter((e=>!!e)).map((e=>wu(e)))),y=Object.fromEntries(Object.entries(h).filter((e=>{var[t]=e;return p.has(t)})));ud({responses:y,survey:n,surveySubmissionId:f,isSurveyCompleted:c,posthog:o,properties:g,surveyLanguage:m})}}else Mu.error("onNextButtonClick called without a questionId.");else Mu.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:y,questionId:S.id}),onPreviewSubmit:c,initialValue:S.id?a[wu(S.id)]:void 0,canGoBack:k,onBack(){if(p)v();else if(0!==_.length){var e=_[_.length-1],t=_.slice(0,-1);w(t),b(e),xd(n,{surveySubmissionId:f,responses:a,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:m})}}})})]}):null}function Oc(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:d,surveyLanguage:c}=e,[v,f]=Yl(!0),[p,g]=Yl(!1),[m,y]=Yl({}),b=()=>{g(!p)};if(Kl((()=>{var e;if(h){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&y({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Mu.info("Received show event for feedback button survey "+l.id),y(r.detail.position||{}),b())};return cs(wc,kc,t),()=>{wc.removeEventListener(kc,t)}}}else Mu.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),Ec({survey:l,setSurveyVisible:f,posthog:h}),!v)return null;var _=()=>{l.schedule!==mu&&f(!1),setTimeout((()=>{g(!1)}),200)};return Md(gl,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Md("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===vu.Top?"widget-tab-top":""),onClick:b,disabled:d,style:Mc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),p&&Md(Pc,{posthog:h,survey:l,forceDisableHtml:u,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:c})]})}var Lc=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l,canGoBack:u,onBack:h}=e,d={forceDisableHtml:i,appearance:s,onPreviewSubmit(e){a(e)},onSubmit(e){o(e)},initialValue:l,displayQuestionIndex:n,canGoBack:u,onBack:h};switch(t.type){case pu.Open:return fl(Wd,r({},d,{question:t,key:t.id}));case pu.Link:return fl(Gd,r({},d,{question:t,key:t.id}));case pu.Rating:return fl(Zd,r({},d,{question:t,key:t.id}));case pu.SingleChoice:case pu.MultipleChoice:return fl(Jd,r({},d,{question:t,key:t.id}));default:return Mu.error("Unsupported question type: "+t.type),null}};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.generateSurveys=Tc,Jn.extendPostHogWithSurveys=Tc;var Fc=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),Ac=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return Fc(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(e.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?s=o-1:n=o}return Fc(t,JSON.stringify(e.slice(0,n)),r)},$c=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,Dc=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},Nc=(e,t,r)=>{if(!r.truncated)if(_r(e)){if(r.seen.has(e))return void Dc(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(Nc(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else Dc(t,e,r)},qc=function(e,t,r,i,n,s){if(void 0===n&&(n=!1),!$c(e))return!n||Fc(t,"null",r);if(Cr(e)||(e=>{try{return Tr(e)||Mr(e)}catch(e){return!1}})(e))return Fc(t,JSON.stringify(e),r);if("string"==typeof e)return Ac(e,t,r);if(!_r(e)&&!yr(e))return Fc(t,JSON.stringify(e),r);if(i.has(e))return Ac("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(br(o))return qc(o.call(e),t,r,i,n)}catch(e){}try{var a={}.toString.call(e);if("[object String]"===a)return Ac(String(e.valueOf()),t,r);if("[object Number]"===a||"[object Boolean]"===a)return Fc(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var l={};try{for(var u in e)({}).hasOwnProperty.call(e,u)&&(l[u]=e[u])}catch(e){}try{l.name=e.name}catch(e){}try{l.message=e.message}catch(e){}try{l.stack=e.stack}catch(e){}return qc(l,t,r,i,n,s)}if(yr(e)){if(!Fc(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!Fc(t,",",r))return!1;var d=void 0;try{d=e[h]}catch(e){d=void 0}if(!qc(d,t,r,i,!0))return!1}return Fc(t,"]",r)}if(!Fc(t,"{",r))return!1;var c=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(s)try{Nc(f,v,s)}catch(e){}if($c(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=t.length,m=r.remaining,y=r.truncated;if(!Fc(t,p,r))return!1;var b=t.length,_=qc(f,t,r,i,!1),w=r.truncated;if(t.length!==b){if(c=!1,!_)return!1}else if(t.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(e){}return Fc(t,"}",r)},jc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.logs={initializeLogs(e){var t={host:Jn.location.host},i=function(i){var n;Jn.console[i]=(n=Jn.console[i],function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];try{if(o.length>0&&e.is_capturing()){var l,{body:u,truncated:h,attributes:d}=((e,t)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=_r(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,s=0;e.length>s&&(0>=s||Fc(r," ",i))&&qc(e[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(o),c=r({},t,h?{body_truncated:"true"}:{});null==(l=e.logs)||l.le({level:jc[i],body:u,attributes:r({"log.source":"console."+i},c,d)})}}catch(e){}finally{n.apply(Jn.console,o)}})};for(var n of Object.keys(jc))i(n)}};var Bc=rs("[Error tracking]");function Hc(){return new un([new xn,new On,new Sn,new kn,new Pn,new Mn,new In,new Rn],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=_n.test(l)?l.replace(_n,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,e);if(d){s.push(d);break}}if(s.length>=wn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,wn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||hn});var i}))}(s)}}("web:javascript",gn,bn))}var Uc=rs("[ExceptionAutocapture]"),zc=Hc(),Vc={wrapOnError(e){var t=jn;t||Uc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=zc.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=jn;t||Uc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var i,n=zc.buildFromUnknown(t,{mechanism:{handled:!1}});return e(n),null!==(i=null==r?void 0:r(t))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||Uc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=zc.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.errorWrappingFunctions=Vc,Jn.posthogErrorWrappingFunctions=Vc;var Wc="X-POSTHOG-SESSION-ID",Gc="X-POSTHOG-WINDOW-ID",Zc="X-POSTHOG-DISTINCT-ID",Qc=[Wc,Gc,Zc],Jc=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Yc=(e,t)=>({}.hasOwnProperty.call(e,t)),Kc=e=>"object"==typeof e&&!Cr(e)||br(e),Xc=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),ev=e=>{try{var t;return Xc(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==jn||null==(t=jn.location)?void 0:t.href).toString()}catch(e){return}},tv=(e,t,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(yr(e)&&!e.includes(s))return!1;var o=!1;if(r){var{sessionId:a,windowId:l}=r.checkAndGetSessionAndWindowId(!0);n.set(Wc,a),n.set(Gc,l),o=!0}var u=(e=>br(e)?e():e)(t);return u&&u!==yo&&(n.set(Zc,u),o=!0),o};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{};var rv={_patchFetch:(e,t,i)=>bs(jn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=ev(s);if(u)if(Xc(s)){var h=new Request(s,o);tv(e,t,i,h.url,h.headers),l=[h]}else{var d=new Headers(Kc(o)?o.headers:void 0);if(tv(e,t,i,u,d)){var c=((e,t)=>{if(xr(e)||Cr(e))return{headers:t};if(Kc(e)){var i=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),n}return new Proxy({headers:t},{get:(e,t)=>Yc(e,t)?Reflect.get(e,t):Reflect.get(i,t,i),has:(e,t)=>Yc(e,t)||t in i,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(i).forEach((e=>t.add(e))),Jc.forEach((e=>{e in i&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n)return n;if("string"==typeof t&&Jc.includes(t)&&t in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,t,i)}};var s=Reflect.getOwnPropertyDescriptor(i,t);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(e){l=a}return n.apply(this,l)})),_patchXHR:(e,t,r)=>bs(jn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=ev(s);d&&tv(e,t,r,d,h);var c=i.call(u,n,s,o,a,l);return Qc.forEach((e=>{var t=h.get(e);if(t)try{u.setRequestHeader(e,t)}catch(e){}})),c}))};Jn.__PosthogExtensions__.tracingHeadersPatchFns=rv,Jn.postHogTracingHeadersPatchFns=rv;var iv=-1,nv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(iv=t.timeStamp,e(t))}),!0)},sv=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},ov=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},av=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},lv=()=>{var e,t;return null!==(e=null==(t=av())?void 0:t.activationStart)&&void 0!==e?e:0},uv=function(e,t){void 0===t&&(t=-1);var r=av(),i="navigate";return 0>iv?r&&(document.prerendering||lv()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},hv=new WeakMap;function dv(e,t){var r=hv.get(t);return r||(r=new WeakMap,hv.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class cv{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var vv,fv=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},pv=e=>{var t=!1;return()=>{t||(e(),t=!0)}},gv=-1,mv=new Set,yv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,bv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of mv)t();isFinite(gv)||(gv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",bv,!0))}},_v=()=>{if(0>gv){var e,t=lv(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;gv=null!=r?r:yv(),addEventListener("visibilitychange",bv,!0),addEventListener("prerenderingchange",bv,!0),nv((()=>{setTimeout((()=>{gv=yv()}))}))}return{get firstHiddenTime(){return gv},onHidden(e){mv.add(e)}}},wv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},xv=[1800,3e3],kv=function(e,t){void 0===t&&(t={}),wv((()=>{var r,i=_v(),n=uv("FCP"),s=fv("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-lv(),0),n.entries.push(t),r(!0)))}));s&&(r=sv(e,n,xv,t.reportAllChanges),nv((i=>{n=uv("FCP"),r=sv(e,n,xv,t.reportAllChanges),ov((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Sv=[.1,.25],Cv=0,Iv=1/0,Tv=0,Ev=e=>{for(var t of e)t.interactionId&&(Iv=Math.min(Iv,t.interactionId),Tv=Math.max(Tv,t.interactionId),Cv=Tv?(Tv-Iv)/7+1:0)},Mv=()=>{var e;return vv?Cv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Pv=0;class Rv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Pv=Mv(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((Mv()-Pv)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var Ov=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=pv(e),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},Lv=[200,500];class Fv{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var Av=[2500,4e3],$v={onLCP(e,t){void 0===t&&(t={}),wv((()=>{var r,i=_v(),n=uv("LCP"),s=dv(t,Fv),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-lv(),0),n.entries=[o],r())},a=fv("largest-contentful-paint",o);if(a){r=sv(e,n,Av,t.reportAllChanges);var l=pv((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(Ov(l),removeEventListener(e.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});nv((i=>{n=uv("LCP"),r=sv(e,n,Av,t.reportAllChanges),ov((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=_v();kv(pv((()=>{var i,n=uv("CLS",0),s=dv(t,cv),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=fv("layout-shift",o);a&&(i=sv(e,n,Sv,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),nv((()=>{s.i=0,n=uv("CLS",0),i=sv(e,n,Sv,t.reportAllChanges),ov(i)})),setTimeout(i))})))},onFCP:kv,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=_v();wv((()=>{var i;"interactionCount"in performance||vv||(vv=fv("event",Ev,{durationThreshold:0}));var n,s=uv("INP"),o=dv(t,Rv),a=e=>{Ov((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=fv("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=sv(e,s,Lv,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),nv((()=>{o.v(),s=uv("INP"),n=sv(e,s,Lv,t.reportAllChanges)})))}))}}};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.postHogWebVitalsCallbacks=$v,Jn.postHogWebVitalsCallbacks=$v,Jn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>$v;class Dv{constructor(e){this.disabled=!1===e;var t=_r(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var Nv="$copy_autocapture",qv=rs("[AutoCapture]");function jv(e,t){return t.length>e?t.slice(0,e)+"...":t}function Bv(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!No(t));return t}function Hv(e,t){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u,disableCaptureUrlHashes:h}=t;if(!No(e))return{props:{}};for(var d=[e],c=e;c.parentNode&&!qo(c,"body");)if(Bo(c.parentNode))d.push(c.parentNode.host),c=c.parentNode.host;else{if(!No(c.parentNode))break;d.push(c.parentNode),c=c.parentNode}var v,f,p=[],g={},m=!1,y=!1;if(ns(d,(e=>{var t=aa(e);if(qo(e,"a")){var r=e.getAttribute("href");m=!!(t&&r&&pa(r))&&(h?Gi(r):r)}cr(zo(e),"ph-no-capture")&&(y=!0),p.push(function(e,t,r,i,n){void 0===n&&(n=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};Zo.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?jv(1024,ga(e)):jv(1024,Wo(e)));var a=zo(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),ns(e.attributes,(function(r){var s;if((!la(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&pa(r.value)&&(!kr(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=Ho(a).join(" ")),o["attr__"+r.name]=jv(1024,"href"===r.name&&n?Gi(a):a)}}));for(var l=1,u=1,h=e;h=Bv(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,h));var i=function(e){if(!aa(e))return{};var t={};return ns(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&pa(i)&&(t[r]=i)}})),t}(e);ss(g,i)})),y)return{props:{},explicitNoCapture:y};if(a||(p[0].$el_text=qo(e,"a")||qo(e,"button")?ga(e):Wo(e)),m){var b,_;p[0].attr__href=m;var w=null==(b=fs(m))?void 0:b.host,x=null==jn||null==(_=jn.location)?void 0:_.host;w&&x&&w!==x&&(v=m)}return{props:ss({$event_type:s.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:(f=p,function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return os(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[ya(t.toString())]=ya(r.toString())})),(n+=":")+os(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:ba(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return os(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(f)))},null!=(i=p[0])&&i.$el_text?{$el_text:null==(n=p[0])?void 0:n.$el_text}:{},v&&"click"===s.type?{$external_click_url:v}:{},g)}}var Uv={};function zv(e){return function(e,t){var r=Uv[e];if(r)return r;var i,n=t[e];if(br(i=n)&&-1!==i.toString().indexOf("[native code]")&&!jn.Zone)return Uv[e]=n.bind(t);var s=t.document;if(s&&br(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),s.head.removeChild(o)}catch(t){ts.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&br(n)?Uv[e]=n.bind(t):n}("MutationObserver",e)}function Vv(e,t){return Tr(e)&&e>=t}class Wv{ce(e){var t,r,i,n,s,o=this.de((null==e?void 0:e.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(e,t){this.ve=[],this.de=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.fe=e=>{var t=function(e){var t=Go(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Cr(t)||this.pe(t)||this.ve.push(t),this.ve.length&&xr(this.me)&&(this.me=Jn.setTimeout((()=>{this.ye()}),1e3))},this.ge=()=>{var e=Date.now();e%50==0&&this.ve.forEach((t=>{xr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.be=()=>{this.we=Date.now()},this.ke=()=>{"visible"===(null==Un?void 0:Un.visibilityState)&&(this.xe=Date.now())},this.instance=e,this.Se=this.ce(t),this._onCapture=this.Se.__onCapture}start(e){this.Ce(),this.Ie(),this.Me(),this.Te(),this._e(e)}_e(e){if(!this.Re){var t=zv(Jn);this.Re=new t((e=>{this.Le(e)})),this.Re.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Re)||e.disconnect(),this.Re=void 0,Jn.removeEventListener("click",this.fe),Jn.removeEventListener("scroll",this.ge,{capture:!0}),Jn.removeEventListener("selectionchange",this.be),null==Un||Un.removeEventListener("visibilitychange",this.ke)}Le(e){this.Oe=Date.now()}Ce(){cs(Jn,"click",this.fe)}Ie(){cs(Jn,"scroll",this.ge,{capture:!0})}Me(){cs(Jn,"selectionchange",this.be)}Te(){cs(Un,"visibilitychange",this.ke)}pe(e){if(!e)return!0;if(!this.Se.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(Do(e.node))return!0;var r=this.ve.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!r&&!qo(e.node,"html")&&No(e.node)&&!function(e){if(!jn||sa(e))return!1;var{targetElementList:t}=oa(e,!1);return t.some((e=>qo(e,"a")))}(e.node)&&function(e,t){var r;if(!jn||sa(e))return!1;var i=Mr(t)?ta:null!==(r=null==t?void 0:t.css_selector_ignorelist)&&void 0!==r?r:ta,{targetElementList:n}=oa(e,!1);return!Qo(n,i)}(e.node,{css_selector_ignorelist:this.Se.css_selector_ignorelist}))}ye(){if(this.ve.length){clearTimeout(this.me),this.me=void 0;var e=this.ve;for(var t of(this.ve=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Oe&&this.Oe>=t.timestamp?this.Oe-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.we&&this.we>=t.timestamp?this.we-t.timestamp:void 0,t.visibilityChangedDelayMs=this.xe?Math.abs(t.timestamp-this.xe):void 0;var i=Vv(t.scrollDelayMs,this.Se.scroll_threshold_ms),n=Vv(t.selectionChangedDelayMs,this.Se.selection_change_threshold_ms),s=Vv(t.mutationDelayMs,this.Se.mutation_threshold_ms),o=Vv(t.absoluteDelayMs,1.1*this.Se.mutation_threshold_ms),a=Tr(t.scrollDelayMs)&&this.Se.scroll_threshold_ms>t.scrollDelayMs,l=Tr(t.mutationDelayMs)&&this.Se.mutation_threshold_ms>t.mutationDelayMs,u=Tr(t.selectionChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.selectionChangedDelayMs,h=Tr(t.visibilityChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=Vv(t.visibilityChangedDelayMs,this.Se.selection_change_threshold_ms);i||s||o||n||d?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Oe,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:d}):this.Se.mutation_threshold_ms>t.absoluteDelayMs&&this.ve.push(t)}}this.ve.length&&xr(this.me)&&(this.me=Jn.setTimeout((()=>{this.ye()}),1e3))}}he(e,t){this.instance.capture("$dead_click",r({},t,Hv(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Wv(e,t);var Gv=rs("[ExternalScriptsLoader]"),Zv=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Gv.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Un?void 0:Un.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===t){var e=i[o];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!Un)return r("document not found");var i=Un.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)Un.head.appendChild(i);else{var n,s=Un.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):Un.body.appendChild(i)}};null!=Un&&Un.body?a():null==Un||Un.addEventListener("DOMContentLoaded",a)};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var i;if(e.config.strict_script_versioning)i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var n="/static/"+t+".js?v="+e.version;if("toolbar"===t){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=e.requestRouter.endpointFor("assets",n)}Zv(e,i,r)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Zv(e,o,r)}},Jn.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);Zv(e,i,r)};class Qv{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}isOptedOut(){return this.Se.cookieless_mode===So||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===ko}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.A(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get St(){var e=this.Ct.P(this.It);return $r(e)?1:cr(Dr,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t="localStorage"===e?Zh:Wh;if(!this.Tt||this.Tt!==t){this.Tt=t;var r="localStorage"===e?Wh:Zh;r.P(this.It)&&(this.Tt.P(this.It)||this.optInOut($r(r.P(this.It))),r.A(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==Hn?void 0:Hn.doNotTrack,null==Hn?void 0:Hn.msDoNotTrack,Jn.doNotTrack].some((e=>$r(e)))}}var Jv=rs("[Dead Clicks]"),Yv=()=>!0,Kv=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Fs)),i=e.instance.config.capture_dead_clicks;return Mr(i)?i:!!_r(i)||r};class Xv{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Fs]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt((()=>{this.Pt()})):this.stop()}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Jv.error("failed to load script",t):e()}))}Pt(){var e;if(Un){if(!this.Et&&null!=(e=Jn.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=_r(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=Jn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(Un),Jv.info("starting...")}}else Jv.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,Jv.info("stopping..."))}}var ef=rs("[SegmentIntegration]");var tf="posthog-js";function rf(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,h,d,c;if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(l=t.exception)?void 0:l.values)||[],g=p.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:t.tags};return i&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&(null==(f=e.exceptions)||f.sendExceptionEvent(m)),t}}class nf{constructor(e,t,r,i,n,s){this.name=tf,this.setupOnce=function(o){o(rf(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class sf{constructor(e){this.Rt=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ts.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){var e;this.Ft=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Rt)}destroy(){var e;null==(e=this.Ft)||e.call(this),this.Ft=void 0}doPageView(e,t){var r,i=this.At(e,t);return this.Ot={pathname:null!==(r=null==jn?void 0:jn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.At(e,null==(t=this.Ot)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ot)?void 0:e.pageViewId}}At(e,t){var r=this.Ot;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(xr(s)||xr(o)||xr(a)||xr(l)||xr(u)||xr(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?Nr(o/s,0,1,ts):1,c=s>1?Nr(a/s,0,1,ts):1,v=l>1?Nr(u/l,0,1,ts):1,f=l>1?Nr(h/l,0,1,ts):1;i=ss(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var of=["flags","surveys"],af={[ks]:{exposure:"hidden"},[Is]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Es]:{exposure:"event"},[Ms]:{exposure:"hidden"},[Ps]:{exposure:"event"},[Rs]:{exposure:"hidden"},[Os]:{exposure:"event"},[Ls]:{exposure:"event"},[Fs]:{exposure:"event"},[As]:{exposure:"hidden"},[$s]:{exposure:"event"},[Ds]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Us]:{exposure:"hidden"},[zs]:{exposure:"event"},[Ns]:{exposure:"event",shouldSkipFromEventProperties:e=>Cr(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Vs]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!_r(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[Ws]:{exposure:"event",storageGroup:"flags"},[Gs]:{exposure:"hidden"},[Zs]:{exposure:"hidden",storageGroup:"flags"},[Qs]:{exposure:"event",storageGroup:"flags"},[Js]:{exposure:"event",storageGroup:"flags",volatile:!0},[Ys]:{exposure:"event"},[Ks]:{exposure:"hidden"},[Xs]:{exposure:"hidden"},[eo]:{exposure:"hidden"},[to]:{exposure:"hidden",storageGroup:"surveys"},[ro]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[io]:{exposure:"event"},[no]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[so]:{exposure:"hidden"},[oo]:{exposure:"hidden"},[ao]:{exposure:"hidden"},[lo]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[uo]:{exposure:"hidden"},[ho]:{exposure:"hidden"},[co]:{exposure:"hidden"},[vo]:{exposure:"hidden"},[fo]:{exposure:"hidden"},[po]:{exposure:"hidden"},[go]:{exposure:"hidden"},[qs]:{exposure:"event"},[js]:{exposure:"event"},[Bs]:{exposure:"event"},[Hs]:{exposure:"event"},[bo]:{exposure:"event"},[_o]:{exposure:"event"},[wo]:{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"}},lf=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],uf=e=>{var t=af[e];if(t)return t;for(var[r,i]of lf)if(0===e.indexOf(r))return i},hf={flags:lo,surveys:ro},df=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],cf="main";class vf{constructor(e,t,i){if(void 0===i&&(i=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=i,this.props={},this.jt=!1,this.Bt=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&ts.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save(),jn){var n=()=>this.flush();cs(jn,"beforeunload",n,{capture:!1}),cs(jn,"pagehide",n,{capture:!1})}}zt(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return Tr(t)&&t>0?t:0}isDisabled(){return!!this.Vt}Ht(e){-1===df.indexOf(e.persistence.toLowerCase())&&(ts.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var i=[...Qh,...e];return r({},Zh,{F(e){try{var r={};try{r=Wh.F(e)||{}}catch(e){}var i,n=JSON.parse(Zh.P(e)||"{}");if(t){var s={};for(var o in r){var a=r[o];Cr(a)||""===a||(s[o]=a)}i=ss(n,s)}else i=ss(r,n);return Zh.q(e,i),i}catch(e){}return null},q(e,t,r,n,s,o){var a=Zh.q(e,t,void 0,void 0,o);try{var l={};i.forEach((e=>{t[e]&&(l[e]=t[e])})),Object.keys(l).length&&Wh.q(e,l,r,n,s,o)}catch(e){Zh.D(e)}return a},A(e,t){try{null==jn||jn.localStorage.removeItem(e),Wh.A(e,t)}catch(e){Zh.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Zh.N()?(t=Zh,n=!0):"localstorage+cookie"===s&&i.N()?(t=i,n=!0):"sessionstorage"===s&&Xh.N()?t=Xh:"memory"===s?t=Yh:"cookie"===s?t=Wh:i.N()?(t=i,n=!0):t=Wh,this.Dt=n,t}Wt(e){return this.Bt+"__"+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=null!=e?e:this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[lo];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return ns(this.props,((t,r)=>{var i=uf(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===Vs?()=>this.Gt():()=>!1))return;i.transformToEventProperties&&ss(e,i.transformToEventProperties(t))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,(()=>!1)))return;e[r]=t}})),e}load(){if(!this.Vt){var e=this.Ct.F(this.Bt);e&&(this.props=ss({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of of){var t=Zh.F(this.Wt(e));if(t&&!wr(t)){var r=this.Qt(e);r.persisted=!0,this.Jt(e)||(r.fingerprint=this.Yt(t,e)),this.Kt(e,t)||ss(this.props,t)}}}Jt(e){return Object.keys(this.props).some((t=>{var r;return(null==(r=uf(t))?void 0:r.storageGroup)===e}))}Kt(e,t){var r=hf[e];if(!r)return!1;var i=t[r],n=this.props[r];return Tr(i)&&Tr(n)&&n>i}refreshKey(e){var t;if(!this.Vt){var r=this.Nt?null==(t=uf(e))?void 0:t.storageGroup:void 0,i=r?Zh.F(this.Wt(r)):this.Ct.F(this.Bt);if(i&&e in i)this.Xt(e,i[e]);else{if(r){var n=this.Ct.F(this.Bt);if(n&&e in n)return void this.Xt(e,n[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?xr(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),e)):this.rr()}}flush(){xr(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.Bt,this.props,cf))}ir(){var{main:e,groups:t}=this.sr();for(var r of(this.nr(this.Ct,this.Bt,e,cf),of)){var i,n=t[r];(!wr(n)||null!=(i=this.$t[r])&&i.persisted)&&this.nr(Zh,this.Wt(r),n,r)}}sr(){var e={},t={};for(var r of of)t[r]={};return ns(this.props,((r,i)=>{var n,s=null==(n=uf(i))?void 0:n.storageGroup;s?t[s][i]=r:e[i]=r})),{main:e,groups:t}}Yt(e,t){if(t===cf)return JSON.stringify(e)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var r={};return ns(e,((e,t)=>{var i;r[t]=null!=(i=uf(t))&&i.volatile?"__volatile__":e})),JSON.stringify(r)}nr(e,t,r,i){var n=this.Qt(i);if(i===cf||n.dirty||xr(n.fingerprint)){var s;try{if((s=this.Yt(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.q(t,r,this.ar,this.lr,this.ur,this.Se.debug)?(n.dirty=!1,i!==cf&&(n.persisted=!0),xr(s)||(n.fingerprint=s)):this.Se.debug&&ts.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(xr(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.A(this.Bt,!1),this.Ct.A(this.Bt,!0),!t&&this.qt)for(var r of of)Zh.A(this.Wt(r));t?delete this.$t[cf]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(_r(e)){xr(t)&&(t="None"),this.ar=xr(r)?this.hr:r;var i=!1;if(ns(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Xt(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(_r(e)){this.ar=xr(t)?this.hr:t;var r=!1;if(ns(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.Xt(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.jt){var e=uc(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);wr(us(e))||this.register(e),this.jt=!0}}update_search_keyword(){var e;this.register((e=null==Un?void 0:Un.referrer)?dc(e):{})}update_referrer_info(){var e;this.register_once({$referrer:fc(),$referring_domain:null!=Un&&Un.referrer&&(null==(e=fs(Un.referrer))?void 0:e.host)||vc},void 0)}set_initial_person_info(){this.props[vo]||this.props[fo]||this.register_once({[po]:pc(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};ns([fo,vo],(t=>{var r=this.props[t];r&&ns(r,(function(t,r){e["$initial_"+fr(r)]=t}))}));var t=this.props[po];if(t){var r=function(e,t){void 0===t&&(t=!1);var r=gc(e,t),i={};return ns(r,(function(e,t){i["$initial_"+fr(t)]=e})),i}(t,this.Se.disable_capture_url_hashes);ss(e,r)}return e}safe_merge(e){return ns(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=i?this.Ht(e):this.Ct,s=this.Ut(e);if(i||s!==this.Nt){var o=this.props;this.clear(),this.Ct=n,this.Nt=s,this.props=o,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[Ts]||{};r[e]=t,this.Xt(Ts,r),this.save()}remove_event_timer(e){var t=this.props[Ts]||{},r=t[e];return xr(r)||(delete t[e],this.Xt(Ts,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var r;this.props[e]=t,null!=(r=uf(e))&&r.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t,r=null==(t=uf(e))?void 0:t.storageGroup;r&&(this.Qt(r).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}}var ff=rs("[RateLimiter]");class pf{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ff.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void ff.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(co))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(co,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var gf=rs("[RemoteConfig]");class mf{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=Jn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}cr(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}vr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return gf.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void gf.warn("Remote config is disabled. Falling back to local config.");this.cr((e=>{if(!e)return gf.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr((e=>{this.pr(e),this.gr()}));this.pr(e),this.gr()}))}catch(e){gf.error("Error loading remote config",e)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}refresh(){!this._instance.mr()&&Un&&"hidden"!==Un.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var e;if(!this.yr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.yr=setInterval((()=>{this.refresh()}),t))}}pr(e){var t;e||gf.error("Failed to fetch remote config from PostHog."),this._instance.pr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var yf=3e3;class bf{constructor(e,t){this.br=!0,this._r=[],this.wr=Nr((null==t?void 0:t.flush_interval_ms)||yf,250,5e3,ts.createLogger("flush interval"),yf),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=this._r.length>0?this.Tr():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.Er(r({},e,{transport:"sendBeacon"}))}))}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout((()=>{if(this.Ir(),this._r.length>0){var t=this.Tr(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&yr(r.data)&&ns(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.Er(r)};for(var i in t)r()}}),this.wr))}Er(e){try{this.kr(e)}catch(e){ts.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return ns(this._r,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;xr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._r=[],e}}var _f=["retriesPerformedSoFar"];class wf{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!xr(jn)&&"onLine"in jn.navigator&&(this.Rr=jn.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},cs(jn,"online",this.Or),cs(jn,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,_f);Er(t)&&(n.url=Rh(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.st(r({retriesPerformedSoFar:t},n));0===e.statusCode&&ts.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==n.callback||n.callback(e)}}))}st(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(t),i=Date.now()+r;this._r.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ts.warn(n),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),0===this._r.length)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout((()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()}),this.Pr)}Lr(){var e=Date.now(),t=[],r=this._r.filter((r=>e>r.retryAt||(t.push(r),!1)));if(this._r=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,xr(jn)||(this.Or&&(jn.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(jn.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){ts.error(e)}this._r=[]}}class xf{constructor(e){this.Dr=()=>{var e,t,r,i;this.Nr||(this.Nr={});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.Nr.lastScrollY=Math.ceil(s),this.Nr.maxScrollY=Math.max(s,null!==(e=this.Nr.maxScrollY)&&void 0!==e?e:0),this.Nr.maxScrollHeight=Math.max(o,null!==(t=this.Nr.maxScrollHeight)&&void 0!==t?t:0),this.Nr.lastContentY=a,this.Nr.maxContentY=Math.max(a,null!==(r=this.Nr.maxContentY)&&void 0!==r?r:0),this.Nr.maxContentHeight=Math.max(l,null!==(i=this.Nr.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){cs(jn,"scroll",this.Dr,{capture:!0}),cs(jn,"scrollend",this.Dr,{capture:!0}),cs(jn,"resize",this.Dr)}scrollElement(){if(!this.qr)return null==jn?void 0:jn.document.documentElement;var e=yr(this.qr)?this.qr:[this.qr];for(var t of e){var r=null==jn?void 0:jn.document.querySelector(t);if(r)return r}}jr(e){var t="y"===e?"scrollTop":"scrollLeft";if(this.qr){var r=this.scrollElement();return r&&r[t]||0}return jn?"y"===e?jn.scrollY||jn.pageYOffset||jn.document.documentElement.scrollTop||0:jn.scrollX||jn.pageXOffset||jn.document.documentElement.scrollLeft||0:0}scrollY(){return this.jr("y")}scrollX(){return this.jr("x")}}var kf=e=>pc(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class Sf{constructor(e,t,r,i){this.Br=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[ho]:r})}},this._instance=e,this.Vr=t,this.zr=r,this.Ur=i||kf,this.Vr.onSessionId(this.Br)}Hr(){return this.zr.props[ho]}getSetOnceProps(){var e,t=null==(e=this.Hr())?void 0:e.props;return t?"r"in t?gc(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return ns(us(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+fr(r)]=t})),e}}class Cf{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.Wr[e]||[])r(t);for(var i of this.Wr["*"]||[])i(e,t)}}var If=rs("[SessionId]");class Tf{on(e,t){return this.Gr.on(e,t)}constructor(e,t,r){var i;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new Cf,this.Kr=(e,t)=>!(!Er(e)||!Er(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===So)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||Vu,this.ri=r||Vu;var n=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Nr(this.Se.session_idle_timeout_seconds||1800,60,36e3,If.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+n+"_window_id",this.si="ph_"+n+"_primary_window_exists",this.oi()){var s=Xh.F(this.ni),o=Xh.F(this.si);s&&!o?this.Xr=s:Xh.A(this.ni),Xh.q(this.si,!0)}if(null!=(i=this.Se.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this.Se.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){If.error("Invalid sessionID in bootstrap",e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return xr(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter((t=>t!==e))}}oi(){return"memory"!==this.Se.persistence&&!this.zr.Vt&&Xh.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&Xh.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?Xh.F(this.ni):null}di(e){var t=this.Zr;return!Cr(t)&&!Cr(e)&&5e3>Math.abs(e-t)}ai(e,t,r){var i=t!==this._sessionActivityTimestamp,n=!(e!==this.ei||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.ei=e,n&&!i||n&&this.di(t)||(this.Zr=t,this.zr.register({[Us]:[t,e,r]}))}ci(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return Er(t)&&t>0}vi(){this.ci()?this.zr.refreshKey(Us):(this.zr.flush(),this.zr.load())}fi(){var e;if(!Cr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,t,r]=this.pi();t===this.ei&&r===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[Us]:[this._sessionActivityTimestamp,null!==(e=this.ei)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi(),t=Er(e)?e:0,r=Er(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,r)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[Us];return yr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&jn&&(jn.removeEventListener(Mo,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&Xh.A(this.si)},cs(jn,Mo,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Se.cookieless_mode===So)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[,i,n]=this.pi(),s=this.gi(),o=this.hi(),a=Er(n)&&Math.abs(r-n)>864e5,l=!1,u=!1,h=!i,d=i,c=!h&&!e&&this.Kr(r,s);c&&((c=this.mi(r))||If.info("cross-tab refresh kept the session alive",{sessionId:i}),[,i,n]=this.pi()),h||c||a?(i=this.ti(),o=this.ri(),If.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:h,activityTimeout:c,sessionPastMaximumLength:a}}),n=r,l=!0):(o||(o=this.ri(),l=!0),(u=i!==d)&&(If.info("adopted cross-tab session id",{sessionId:i,windowId:o}),l=!0));var v=Er(s)&&e&&!a?s:r,f=Er(n)?n:(new Date).getTime();this.ui(o),this.ai(i,v,f),e||this.ii();var p={noSessionId:h,activityTimeout:c,sessionPastMaximumLength:a,crossTabAdoption:u};return l&&this.Qr.forEach((e=>e(i,o,p))),{sessionId:i,windowId:o,sessionStartTimestamp:f,changeReason:l?p:void 0,lastActivityTimestamp:s}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout((()=>{if(!this.Yr)if(this.mi((new Date).getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:e})}else this.ii()}),1.1*this.sessionTimeoutMs))}}var Ef=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&dr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>dr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver};function Mf(){return Mf=t((function*(){var e=null==Hn?void 0:Hn.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return kr(r)&&r.length>0?r:void 0}catch(e){return void ts.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})),Mf.apply(this,arguments)}var Pf="custom",Rf="i.posthog.com",Of=/^\/static\//;class Lf{constructor(e){this.bi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Rf,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.bi[this.apiHost]||(this.bi[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":Pf),this.bi[this.apiHost]}wi(e){if(Of.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this.wi(t);if(r)return""+r+t}if(this.region===Pf)return this.apiHost+t;var i=Rf+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Ff=rs("[PostHog ExternalIntegrations]"),Af={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class $f{constructor(e){this._instance=e}Mt(e,t){var r;null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return Ff.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;!i||null!=(r=Jn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e.Mt(Af[t],(()=>{var r;null==(r=Jn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=Jn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]&&(null==(s=Jn.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[t])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}var Df,Nf={},qf=0,jf=()=>{},Bf='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Hf="Surveys module not available",Uf="sanitize_properties is deprecated. Use before_send instead",zf="Invalid value for property_denylist config: ",Vf="posthog",Wf=!Th&&-1===(null==Qn?void 0:Qn.indexOf("MSIE"))&&-1===(null==Qn?void 0:Qn.indexOf("Mozilla")),Gf=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ds(null==Un?void 0:Un.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:jf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:zn&&kr(null==zn?void 0:zn.search)&&-1!==zn.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==jn||null==(t=jn.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){ts.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:To,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:yf},error_tracking:{},_onCapture:jf},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:Xo,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)}))(e))},Zf=[["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"]],Qf=e=>{var t={};for(var[r,i]of Zf)xr(e[r])||(t[i]=e[r]);var n=ss({},t,e),s=e.__preview_external_dependency_versioned_paths;return xr(s)||(xr(e.strict_script_versioning)&&(n.strict_script_versioning=!!s),kr(s)&&xr(e.asset_host)&&(n.asset_host=s)),yr(e.property_blacklist)&&(xr(e.property_denylist)?n.property_denylist=e.property_blacklist:yr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ts.error(zf+e.property_denylist)),n};class Jf{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){ts.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Yf{ki(e,t){if(e){var r=this.Si.indexOf(e);-1!==r&&this.Si.splice(r,1)}return this.Si.push(t),null==t.initialize||t.initialize(),t}Ci(){return this.config.cookieless_mode===So||this.config.cookieless_mode===ko&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new Jf,this.Ii=!1,this.version=Xn.LIB_VERSION,this.Ti=new Cf,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Gf(),this.SentryIntegration=nf,this.sentryIntegration=e=>function(e,t){var r=rf(e,t);return{name:tf,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new xf(this),this.pageViewManager=new sf(this),this.rateLimiter=new pf(this),this.requestRouter=new Lf(this),this.consent=new Qv(this),this.externalIntegrations=new $f(this);var t=null!==(e=Yf.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=kr(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=kr(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>ts.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Vf){var i,n=null!==(i=Nf[r])&&void 0!==i?i:new Yf;return n._init(e,t,r),Nf[r]=n,Nf[Vf][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;void 0===t&&(t={});var o=kr(e)?e.trim():"";if(!o)return ts.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={},t.debug=this.Oi(t.debug),this.Li=t,this.Fi=[],t.person_profiles?this.Pi=t.person_profiles:t.process_person&&(this.Pi=t.process_person);var a=Gf(t.defaults),l=Qf(t),u=ss({},a,l,{name:i,token:o});_r(a.rageclick)&&_r(l.rageclick)&&(u.rageclick=ss({},a.rageclick,l.rageclick)),_r(a.session_recording)&&_r(l.session_recording)&&(u.session_recording=ss({},a.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&ts.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Gu;var h=this.Ai();this.persistence=new vf(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new vf(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.$i=new bf((e=>this.Di(e)),this.config.request_queue_config),this.Ni=new wf(this),this.__request_queue=[];var v=this.Ci();if(v||(this.sessionManager=new Tf(this),this.sessionPropsManager=new Sf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ts.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.qi(v)}),0)):(ts.info("Initializing extensions synchronously"),this.qi(v)),Xn.DEBUG=Xn.DEBUG||this.config.debug,Xn.DEBUG&&ts.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var f=t.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(uo);if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===Co)this.identify(f);else if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===Io)ts.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(Vu()),y=t.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(uo,t.bootstrap.isIdentifiedID?Io:Co),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:yo,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(Vu());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(uo,Co)}return cs(jn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||Vu();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(uo,Io)),t()},n=r.user();"then"in n&&br(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||ef.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ef.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ef.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Po),identify:e=>t(e,Oo),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this.ji())):this.ji(),br(this.config._onCapture)&&this.config._onCapture!==jf&&(ts.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ts.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 Mf.apply(this,arguments)}().then((e=>{e&&this.register({[Cs]:e})})).catch(jf),this}qi(e){var t,i,n,s,o,a,l,u=performance.now(),h=r({},Yf.__defaultExtensionClasses,this.config.__extensionClasses),d=[];h.featureFlags&&this.Si.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new h.featureFlags(this)),h.exceptions&&this.Si.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Si.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Si.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Si.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Si.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Si.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Si.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Si.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Si.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Si.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Si.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Si.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Kv)),h.toolbar&&this.Si.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Si.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this.Si.forEach((e=>{e.initialize&&d.push((()=>{null==e.initialize||e.initialize()}))})),d.push((()=>{if(this.Bi){var e=this.Bi;this.Bi=void 0,this.pr(e)}})),this.Hi(d,u)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Hi(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){ts.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[bo]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[_o]:i}),this.config.__preview_deferred_init_extensions&&ts.info("PostHog extensions initialized ("+i+"ms)")}pr(e){var t;if(!Un||!Un.body)return ts.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Bi=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=cr(e.supportedCompression,Gu)?Gu:cr(e.supportedCompression,Zu)?Zu:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:To}),this.Si.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}ji(){try{this.config.loaded(this)}catch(e){ts.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&null!=zn&&zn.hostname){var e=zn.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()}),1),this.Wi=new mf(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.$i)||e.enable())}_dom_loaded(){this.is_capturing()&&is(this.__request_queue,(e=>this.Di(e))),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,r,i;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(Ro),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(r=this.$i)||r.unload(),null==(i=this.Ni)||i.unload()):this.Gi()&&this.capture(Ro,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?Wf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(xr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4,s.url=Dh(s.url,s.compression);var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=Nh.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Gu&&Zn&&"undefined"!=typeof Promise&&!Mh?$h(s).then((e=>{l(e)})).catch((t=>{if(or(t))return Mh=!0,void l(r({},s,{compression:void 0,url:Dh(e.url,void 0)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return or(e)||t===ir})(t)&&(Mh=!0),l(s)})):l(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){qf++;try{var t,r=[],i=[],n=[];is(e,(e=>{if(e)if(yr(t=e[0]))n.push(e);else if(br(e))try{e.call(this)}catch(t){ts.error("Error executing queued PostHog call",e,t)}else yr(e)&&"alias"===t?r.push(e):yr(e)&&-1!==t.indexOf("capture")&&br(this[t])?n.push(e):i.push(e)}));var s=function(e,t){is(e,(function(e){try{if(yr(e[0])){var r=t;ns(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){ts.error("Error executing queued PostHog call",e,t)}}))};s(r,this),s(i,this),s(n,this)}finally{qf--}}push(e){if(qf>0&&yr(e)&&kr(e[0])){var t=Yf.prototype[e[0]];br(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!xr(e)&&kr(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=t&&t.$current_url&&!kr(null==t?void 0:t.$current_url)&&(ts.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.Zi||ts.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=Wi(null==i?void 0:i.uuid,Vu),f={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},c,v)};e===Po&&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),(null==i?void 0:i.$set)&&(f.$set=null==i?void 0:i.$set);var p=null==i?void 0:i.$unset;p&&(f.$unset=p);var g=this.Qi(null==i?void 0:i.$set_once,e!==Lo,e===Oo);if(g&&(f.$set_once=g),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=e=>kr(e)?e.slice(0,s):e,l=new Set,f=function e(t,r){return t!==Object(t)?a?a(t):t:l.has(t)?void 0:(l.add(t),yr(t)?(i=[],is(t,(t=>{i.push(e(t))}))):(i={},ns(t,((t,r)=>{l.has(t)||(i[r]=e(t,r))}))),i);var i}(o)),f.timestamp=c,xr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=d),e===yu.DISMISSED||e===yu.SENT){var m=null==t?void 0:t[bu.SURVEY_ID],y=null==t?void 0:t[bu.SURVEY_ITERATION];Du({id:m,current_iteration:y}),f.$set=r({},f.$set,{[Su({id:m,current_iteration:y},e===yu.SENT?"responded":"dismissed")]:!0})}else e===yu.SHOWN&&(f.$set=r({},f.$set,{[bu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var b=null==t?void 0:t.$product_tour_type;b&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+b]:(new Date).toISOString()}))}var _=r({},f.properties.$set,f.$set);if(wr(_)||this.setPersonPropertiesForFlags(_),!Ir(this.config.before_send)){var w=this.it(f);if(!w)return;(f=w).uuid=Wi(f.uuid,Vu)}this.Ti.emit("eventCaptured",f);var x={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",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.Di(x):this.$i.enqueue(x),f}ts.critical("This capture call is ignored due to client rate limiting.")}}else ts.error("No event name provided to posthog.capture")}else ts.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Ci()&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!kr(a.distinct_id)&&!Tr(a.distinct_id)||Sr(a.distinct_id))&&ts.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(e,t,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!Qn)return{};var l,u,h=e?[...sc,...t||[]]:[],[d,c]=function(e){for(var t=0;Hi.length>t;t++){var[r,i]=Hi[t],n=r.exec(e),s=n&&(br(i)?i(n,e):i);if(s)return s}return["",""]}(Qn),v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={detectGoogleSearchApp:r},p=ss(us({$os:d,$os_version:c,$browser:qi(Qn,navigator.vendor,v,f),$device:Ui(Qn),$device_type:zi(Qn,{userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(s=navigator)?void 0:s.maxTouchPoints,screenWidth:null==jn||null==(o=jn.screen)?void 0:o.width,screenHeight:null==jn||null==(a=jn.screen)?void 0:a.height,devicePixelRatio:null==jn?void 0:jn.devicePixelRatio}),$timezone:mc(),$timezone_offset:yc()}),{$current_url:ms(i?Gi(null==zn?void 0:zn.href):null==zn?void 0:zn.href,h,ac),$host:null==zn?void 0:zn.host,$pathname:null==zn?void 0:zn.pathname,$raw_user_agent:Qn.length>1e3?Qn.substring(0,997)+"...":Qn,$browser_version:Bi(Qn,navigator.vendor,v,f),$browser_language:cc(),$browser_language_prefix:(u=cc(),"string"==typeof u?u.split("-")[0]:void 0),$screen_height:null==jn?void 0:jn.screen.height,$screen_width:null==jn?void 0:jn.screen.width,$viewport_height:null==jn?void 0:jn.innerHeight,$viewport_width:null==jn?void 0:jn.innerWidth,$lib:Xn.LIB_NAME,$lib_version:Xn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Xn.SDK_DIST_CHANNEL&&(p.$sdk_dist_channel=Xn.SDK_DIST_CHANNEL),p}(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{sessionId:d,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=d,a.$window_id=c}this.sessionPropsManager&&ss(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&ss(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Ni)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Pf&&(a.$lib_custom_api_host=this.config.api_host),u=e!==Po||s?e!==Ro||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ss(a,u),e===Po&&Un&&(a.title=Un.title),!xr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Qn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ss({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),yr(this.config.property_denylist)?ns(this.config.property_denylist,(function(e){delete a[e]})):ts.error(zf+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(ts.error(Uf),a=p(a,e));var g=this.Ji();return a.$process_person_profile=g,g&&!s&&this.Yi("_calculate_event_properties"),a}Qi(e,t,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.Ji())return e;if(this.Ii&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=ss({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(ts.error(Uf),o=a(o,"$set_once")),t&&(this.Ii=!0),wr(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Ki(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.Ti.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Hf}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Hf})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Hf})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=qu),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:Hf}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:Hf})}Xi(e){return!e||Sr(e)?(ts.critical("Unique user id has not been set in posthog.identify"),!1):e===yo?(ts.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ts.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return ts.uninitializedWarning("posthog.identify");if(Tr(e)&&(e=e.toString(),ts.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Xi(e)&&this.Yi("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ss)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(Is)&&(this.unregister(Is),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(uo)||Co)===Co;e!==i&&s?(this.persistence.set_property(uo,Io),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(Oo,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this.Ri=jh(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(so))}}setPersonProperties(e,t){if((e||t)&&this.Yi("posthog.setPersonProperties")){var r=jh(this.get_distinct_id(),e,t);this.Ri!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ri=r):ts.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(yr(e)?e:[e]).filter((e=>kr(e)&&e.length>0));0!==r.length&&this.Yi("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ri=null)}group(e,t,i){if(e&&t){var n=this.getGroups(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(Lo,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else ts.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.Yi("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l,u;if(ts.info("reset"),!this.__loaded)return ts.uninitializedWarning("posthog.reset");var h,d=this.get_property(Ss),c=this.get_property(Cs),v=this.get_property(Ds);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),xr(v)||null==(h=this.persistence)||h.register({[Ds]:v}),null==(i=this.surveys)||i.reset(),null==(n=this.Wi)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.persistence)||l.set_property(uo,Co),null==(u=this.sessionManager)||u.resetSessionId(),this.Ri=null,this.config.cookieless_mode===So)this.register_once({distinct_id:yo,$device_id:null},"");else{var f=this.config.get_device_id(Vu());this.register_once({distinct_id:f,$device_id:e?f:d},""),e||xr(c)||this.register({[Cs]:c})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.tn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(e,t){return e===this.get_property(ks)?(ts.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(xr(t)&&(t=this.get_distinct_id()),e!==t?(this.Ki(Is,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ts.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(_r(e)){var i,n,s,o,a,l,u,h,d,c,v;ss(this.config,Qf(e));var f=this.Ai();null==(i=this.persistence)||i.update_config(this.config,t,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new vf(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.Oi(this.config.debug);Mr(p)&&(this.config.debug=p),Mr(this.config.debug)&&(this.config.debug?(Xn.DEBUG=!0,Zh.N()&&Zh.q("ph_debug",!0),ts.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(Xn.DEBUG=!1,Zh.N()&&Zh.A("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.rn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){Xn.LIB_NAME=e,Xn.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Yf.nn}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Vf;return t!==Vf&&(t=Vf+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(uo))===Io||(null==(t=this.sessionPersistence)?void 0:t.get_property(uo))===Io}Ji(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===To&&!this._isIdentified()&&wr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Is])&&(null==(t=this.persistence)||null==(t=t.props)||!t[go]))}Gi(){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.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return"never"===this.config.person_profiles?(ts.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ki(go,!0),!0)}Ai(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ko)}rn(){var e,t,r,i,n=this.Ai();return(null==(e=this.persistence)?void 0:e.Vt)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.Vt)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==So){if(this.Ci()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Tf(this),this.pageViewManager=new sf(this),this.persistence&&(this.sessionPropsManager=new Sf(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=Yf.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.ki(this.sessionRecording,new l(this)),this.Ui&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Ui)))}var u,h;this.consent.optInOut(!0),this.rn(),this.zi(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==ko&&(null==(u=this.surveys)||u.loadIfEnabled()),(xr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else ts.warn(Bf)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==So?(this.config.cookieless_mode===ko&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===ko&&(this.register({distinct_id:yo,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi())):ts.warn(Bf)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===So||(this.config.cookieless_mode===ko?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return Hn?Ef(Hn,this.config.custom_blocked_useragents):void 0}Vi(){Un&&("visible"===Un.visibilityState?this.Ei||(this.Ei=!0,this.capture(Po,{title:Un.title},{send_instantly:!0}),this.Mi&&(Un.removeEventListener(Eo,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),cs(Un,Eo,this.Mi)))}debug(e){!1===e?(null==jn||jn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==jn||jn.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}))}mr(){var e,t,r,i,n,s,o=this.Li||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ts.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):(r="advanced_disable_decide",!1,i=ts,n=(t="advanced_disable_flags")in(e=o)&&!Ir(e[t]),s=r in e&&!Ir(e[r]),n?e[t]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]))}it(e){var t;if(Ir(this.config.before_send))return e;var r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Rr),i=yr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var s of i){if(n=s(n),Ir(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return cr(tr,e.event)?ts.warn(o+". This can cause unexpected behavior."):ts.info(o),null}n.properties&&!wr(n.properties)||ts.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Ir(n.properties[a]))return ts.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var e;return null==(e=this.pageViewManager.Ot)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}Oi(e){var t=Mr(e)&&!e,r=Zh.N()&&"true"===Zh.P("ph_debug");return!t&&(!!r||e)}}Yf.__defaultExtensionClasses={},Yf.nn={trace:Df=()=>{},debug:Df,info:Df,warn:Df,error:Df,fatal:Df},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=ls(e.prototype[t[r]])}(Yf,["identify"]);var Kf=rs("[ExceptionAutocapture]"),Xf=rs("[TracingHeaders]"),ep=rs("[Web Vitals]"),tp=9e5,rp="disabled",ip="lazy_loading",np="awaiting_config",sp="missing_config";rs("[SessionRecording]"),rs("[SessionRecording]");var op="[SessionRecording]",ap=rs(op),lp=rs("[Heatmaps]");function up(e){return _r(e)&&"clientX"in e&&"clientY"in e&&Tr(e.clientX)&&Tr(e.clientY)}var hp=rs("[Product Tours]"),dp=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(As))},cp=["$set_once","$set"],vp=rs("[SiteApps]"),fp="Error while initializing PostHog app with config id ";function pp(e,t,r){if(Ir(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class gp{constructor(e){this.sn=new Cf,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e,t;xr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!xr(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this.vn)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.cn)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.cn.has(e)||this.cn.has(null==t?void 0:t.event))&&this.vn&&(null==(r=this.vn)?void 0:r.size)>0&&this.vn.forEach((e=>{this.fn(t,e)&&this.sn.emit("actionCaptured",e.name)}))}pn(e){this.onAction("actionCaptured",(t=>e(t)))}fn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.an(e,r))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!pp(i,t.url,t.url_matching||"contains"))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){var r;if(null==t||!t.href)return!0;var i=this.bn(e);if(i.length>0)return i.some((e=>pp(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&pp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}mn(e,t){var r;if(null==t||!t.text)return!0;var i=this.bn(e);if(i.length>0)return i.some((e=>pp(e.text,t.text,t.text_matching||"exact")||pp(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!Ir(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>pp(e,s,o))))}yn(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}bn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}dn(e,t){return null==t||!t.properties||0===t.properties.length||Uh(t.properties.reduce(((e,t)=>{var r=yr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class mp{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&Uh(e.propertyFilters,null==t?void 0:t.properties)}Cn(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}In(e,t,r){var i=(r===uu?this.wn:this.xn).get(e),n=[];return this.Tn((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Sn(s,t)}))}register(e){var t;xr(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==t.length&&(null==this.Pn&&(this.Pn=new gp(this._instance),this.Pn.init(),this.Pn.pn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Pn)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this.kn.get(t.name);r&&r.push(e.id),this.kn.set(t.name,r||[e.id])}})))})))}En(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.wn=this.Cn(e,uu),this.xn=this.Cn(e,hu))}onEvent(e,t){var r,i,n=this.Rn(),s=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(i=t.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.On(e,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.Ln([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:e,itemId:s}),void this.Fn(s)}if(this.xn.has(e)){var a=this.In(e,t,hu);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map((e=>e.id))}),this.Ln(a.map((e=>e.id))),a.forEach((e=>this.An(e.id))))}if(this.wn.has(e)){n.info("event name matched",{event:e,eventPayload:t,items:this.wn.get(e)});var l=this.In(e,t,uu);this.$n(l.map((e=>e.id)))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){0!==e.length&&(this._n=[...new Set([...this._n,...e])],this.Rn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter((t=>t!==e));var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter((e=>!t.has(e)));var r=this.Dn(),i=r.filter((e=>!t.has(e)));i.length!==r.length&&this.Nn(i)}Dn(){var e,t=this.qn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter((e=>!this.jn(e)))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}Bn(){return this.Pn}}class yp extends mp{constructor(e){super(e)}qn(){return io}Hn(){return yu.SHOWN}Tn(e){var t;null==(t=this._instance)||t.getSurveys(e)}An(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Rn(){return Mu}Nn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[io]:e})}jn(){return!1}On(e,t){var r;this.Tn((e=>{r=e.find((e=>e.id===t))}));var i=!r||function(e){var t,r,i,n=(null!==(t=null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)&&void 0!==t?t:0)>0;return e.schedule===mu||!(null==(i=e.conditions)||null==(i=i.events)||!i.repeatedActivation||!n)}(r);return i?e===yu.SHOWN?"consume":"ignore":e===yu.SHOWN?"persist":e===yu.DISMISSED||e===yu.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var bp="SDK is not enabled or survey functionality is not yet loaded",_p="Disabled. Not loading surveys.",wp=null!=jn&&jn.location?ys(jn.location.hash,"__posthog")||ys(location.hash,"state"):null,xp="_postHogToolbarParams",kp=rs("[Toolbar]"),Sp=rs("[FeatureFlags]"),Cp=rs("[FeatureFlags]",{debugEnabled:!0}),Ip="\" failed. Feature flags didn't load in time.",Tp=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},Ep=e=>{var t={};for(var[r,i]of os(e||{}))i&&(t[r]=i);return t},Mp="Refusing to render web experiment since the viewer is a likely bot",Pp={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>qh(t,e),not_regex:(e,t)=>!qh(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class Rp{get Se(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{Rp.Un("retrieved web experiments from the server"),t.zn=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t.zn&&(Rp.Un("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.zn)||r.set(e.feature_flag_key,e));var i=t._instance.getFeatureFlag(e.feature_flag_key);kr(i)&&e.variants[i]&&t.Vn(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];Rp.Wn(s,t._instance)&&t.Vn(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Rp.Un(Mp);else if(!this.Se.disable_web_experiments){if(Ir(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rp.Un("applying feature flags",e),e.forEach((e=>{var t;if(this.zn&&null!=(t=this.zn)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.zn)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Vn(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=Rp.getWindowLocation();if(null!=e&&e.search){var t=gs(null==e?void 0:e.search,"__experiment_id"),r=gs(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Rp.Un("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Gn(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Se.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Se.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Gn(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(Rp.Un("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Vn(i[0].name,t,i[0].variants[t].transforms))}static Wn(e,t){return!Ir(e.conditions)&&Rp.Zn(e,t)&&Rp.Qn(e)}static Zn(e,t){var r;if(Ir(e.conditions)||Ir(null==(r=e.conditions)?void 0:r.url))return!0;var i=Rp.getWindowLocation();if(i){var n,s,o,a=ws(t,i.href);return null==(n=e.conditions)||!n.url||Pp[null!==(s=null==(o=e.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](e.conditions.url,a)}return!1}static getWindowLocation(){return null==jn?void 0:jn.location}static Qn(e){var t;if(Ir(e.conditions)||Ir(null==(t=e.conditions)?void 0:t.utm))return!0;var r=uc();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Un(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];ts.info("[WebExperiments] "+e,r)}Vn(e,t,r){this._is_bot()?Rp.Un(Mp):"control"!==t?r.forEach((r=>{if(r.selector){var i;Rp.Un("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):Rp.Un("Control variants leave the page unmodified.")}_is_bot(){return Hn&&this._instance?Ef(Hn,this.Se.custom_blocked_useragents):void 0}}var Op=rs("[Conversations]"),Lp="Conversations not available yet.",Fp="console",Ap={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Se(){return this._instance.config}get zr(){return this._instance.persistence}ss(e){return this._instance.get_property(e)}os(){var e,t;return null!==(e=null==(t=this.zr)?void 0:t.Gt(this.Se.feature_flag_cache_ttl_ms))&&void 0!==e&&e}ls(){return!!this.os()&&(this.ns||this.Kn||(this.ns=!0,Sp.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}us(){var e,t=null!==(e=this.Se.evaluation_contexts)&&void 0!==e?e:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(Sp.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.rs=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Sp.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}hs(){return this.us().length>0}ds(){var e=this.Se.flag_keys;if(!xr(e)){if(yr(e))return e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Sp.error("Invalid flag key found:",e,"Expected non-empty string"),t}));Sp.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:r}=this._instance,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.ss(Vs))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.ss(Qs))&&void 0!==s?s:{},l=r({},o,e),u=r({},a,t),h={};for(var[d,c]of Object.entries(l))h[d]={key:d,enabled:Qt(c),variant:Jt(c),reason:void 0,metadata:xr(null==u?void 0:u[d])?void 0:{id:0,version:void 0,description:void 0,payload:u[d]}};this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ss(Zs),t=this.ss(Ys),i=this.ss(Ks);if(!i&&!t)return e||{};var n=ss({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],h=null==t?void 0:t[o],d=xr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=xr(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.Jn||(Sp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.Jn=!0),n}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((r=>{var i=e[r];return{key:r,enabled:Qt(i),variant:Jt(i),payload:Zt(t[r])}}))}getFlagVariants(){var e=this.ss(Vs),t=this.ss(Ys);if(!t)return e||{};for(var r=ss({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(Sp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Jn=!0),r}getFlagPayloads(){var e=this.ss(Qs),t=this.ss(Ks);if(!t)return e||{};for(var r=ss({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(Sp.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Jn=!0),r}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.cs||(this._instance.Ti.emit("featureFlagsReloading",!0),this.cs=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.cs),this.cs=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.cs||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}vs(e){var t;if(this.fs(),!this._instance.mr())if(this.Kn)this.es=!0;else{var i=this.Se.token,n=this.ss(Ss),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this.zr)?void 0:t.get_initial_props())||{},this.ss(Xs)||{}),group_properties:this.ss(eo),timezone:mc()};Cr(n)||xr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.hs()&&(s.evaluation_contexts=this.us());var o=this.ds();xr(o)||(s.flag_keys=o);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Kn=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Se.disable_compression?void 0:Zu,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(200===e.statusCode&&(this.es||(this.$anon_distinct_id=void 0),n=!1),this.Kn=!1,!s.disable_flags||this.es){this.ts=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.zr)||i.register({[ao]:o}),u)Sp.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.es&&(this.es=!1,this.vs())}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Sp.warn('getFeatureFlag for key "'+e+Ip)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this.ss(Js)||void 0,l=this.ss(lo)||void 0,u=this.ss(so)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.ss(oo);d&&d!==c&&(u={},null==(h=this.zr)||h.register({[so]:u,[oo]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var v,f,p,g,m,y,b,_,w,x;yr(u[e])?u[e].push(o):u[e]=[o],null==(v=this.zr)||v.register({[so]:u});var k=this.getFeatureFlagDetails(e),S=[...null!==(f=this.ss(ao))&&void 0!==f?f:[]];xr(n)&&S.push("flag_missing");var C={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Se.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Se.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[e])||null,$used_bootstrap_value:!this.ts};xr(null==k||null==(m=k.metadata)?void 0:m.version)||(C.$feature_flag_version=k.metadata.version);var I,T=null!==(y=null==k||null==(b=k.reason)?void 0:b.description)&&void 0!==y?y:null==k||null==(_=k.reason)?void 0:_.code;T&&(C.$feature_flag_reason=T),null!=k&&null!=(w=k.metadata)&&w.id&&(C.$feature_flag_id=k.metadata.id),xr(null==k?void 0:k.original_variant)&&xr(null==k?void 0:k.original_enabled)||(C.$feature_flag_original_response=xr(k.original_variant)?k.original_enabled:k.original_variant),null!=k&&null!=(x=k.metadata)&&x.original_payload&&(C.$feature_flag_original_payload=null==k||null==(I=k.metadata)?void 0:I.original_payload),S.length&&(C.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",C)}if(i)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:Zt(s)}}}else Sp.warn('getFeatureFlagResult for key "'+e+Ip)}getRemoteConfigPayload(e,t){var r=this.Se.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.hs()&&(i.evaluation_contexts=this.us());var n=this.ds();xr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Se.disable_compression?void 0:Zu,timeout:this.Se.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return xr(r)?void 0:!!r}Sp.warn('isFeatureEnabled for key "'+e+Ip)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this.zr){this.Yn=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):e.featureFlags&&Sp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=e.requestId,c=e.evaluatedAt;if(yr(u)){Sp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;t&&t.register({[Ws]:u,[Vs]:v})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((e=>{var[t]=e;return y.has(t)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return y.has(t)})))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((e=>{var[t]=e;return y.has(t)}))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);t&&t.register(r({[Ws]:Object.keys(Ep(p)),[Vs]:p||{},[Qs]:g||{},[Zs]:m||{}},d?{[Js]:d}:{},c?{[lo]:c}:{}))}}}(e,this.zr,n,s,o,i),t||(this.ns=!1),this.ps(t)}}override(e,t){void 0===t&&(t=!1),Sp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return Sp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.zr.unregister(Ys),this.zr.unregister(Ks),this.ps(),Cp.info("All overrides cleared");if(yr(e)){var t=Tp(e);return this.zr.register({[Ys]:t}),this.ps(),Cp.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this.Jn=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.zr.unregister(Ys),Cp.info("Flag overrides cleared");else if(i.flags){if(yr(i.flags)){var n=Tp(i.flags);this.zr.register({[Ys]:n})}else this.zr.register({[Ys]:i.flags});Cp.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.zr.unregister(Ks),Cp.info("Payload overrides cleared")):i.payloads&&(this.zr.register({[Ks]:i.payloads}),Cp.info("Payload overrides set",{payloads:i.payloads}))),void this.ps()}if(e&&"object"==typeof e)return this.zr.register({[Ys]:e}),this.ps(),Cp.info("Flag overrides set",{flags:e});Sp.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:r}=this.gs();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this.ss(Gs)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this.zr)||n.register({[Ws]:Object.keys(Ep(l)),[Vs]:l}),this.ps()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this.ss(Gs),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this.zr)||r.unregister(Gs),null==(i=this.zr)||i.register({[Gs]:n}),e(n)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}ps(e){var{flags:t,flagVariants:r}=this.gs();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ss(Xs)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Xs]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=r({},this.ss(Xs)||{});e.forEach((e=>{delete i[e]})),this._instance.register({[Xs]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(Xs),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ss(eo)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[eo]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ss(eo)||{};this._instance.register({[eo]:r({},t,{[e]:{}})})}else this._instance.unregister(eo)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},$p={sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.ys)||!e.isStarted)}get status(){var e,t;return this.bs===np||this.bs===sp?this.bs:null!==(e=null==(t=this.ys)?void 0:t.status)&&void 0!==e?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=rp,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw ap.error("started without valid sessionManager"),new Error(op+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===So)throw new Error(op+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!(null==(e=this._instance.get_property(Ds))||!e.enabled),r=!this.Se.disable_session_recording,i=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return jn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.ws||null==(t=this.ys)||!t.isStarted){var r=!xr(Object.assign)&&!xr(Array.from);this.ws&&r?(this.xs(e),ap.info("starting")):(this.bs=rp,this.stopRecording())}}xs(e){var t,r,i;this.ws&&(this.bs!==np&&this.bs!==sp&&(this.bs=ip),null!=Jn&&null!=(t=Jn.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=Jn.__PosthogExtensions__)&&r.initSessionRecording?this.ks(e):null==(i=Jn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return ap.error("could not load recorder",t);this.ks(e)})))}stopRecording(){var e,t;null==(e=this._s)||e.call(this),this._s=void 0,null==(t=this.ys)||t.stop()}Cs(){var e,t;null==(e=this._s)||e.call(this),this._s=void 0,null==(t=this.ys)||t.discard()}Is(){var e,t;null==(e=this.zr)||e.unregister(zs),null==(t=this.zr)||t.unregister(Ns)}Ts(e,t){if(Ir(e))return null;var r,i=Tr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(ap.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Es(e){if(this.zr){var t,i,n=this.zr,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.Ts(null==(t=this.Se.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this.Ts(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Ir(a)&&this.Is();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[Ds]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:xr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this._s)||t.call(this),this._s=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Es(e),void this.Cs()):(this.Es(e),void this.startIfEnabledOrStop()):(this.bs===np&&(this.bs=sp,ap.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.ys)&&r.log?this.ys.log(e,t):ap.warn("log called before recorder was ready")}get Ss(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Ds);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ms(){var e,t,r=this._instance.get_property(Ds);if(!r)return!1;try{t="object"==typeof r?r:JSON.parse(r)}catch(e){return ap.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var i=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-i}ks(e){var t,r;if(null==(t=Jn.__PosthogExtensions__)||!t.initSessionRecording)return ap.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[wo]:!0});if(this.ys||(this.ys=null==(r=Jn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===sp||this.bs===np)return;return this.bs=np,ap.info("persisted remote config is stale, requesting fresh config before starting"),void new mf(this._instance).load()}this.bs=ip,this.ys.start(e)}onRRwebEmit(e){var t;null==(t=this.ys)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||null==(t=this.zr)||t.register({[js]:!0}),null==(e=this.ys)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||null==(t=this.zr)||t.register({[qs]:!0}),null==(e=this.ys)||e.overrideSampling()}overrideTrigger(e){var t,r;this.ys||null==(r=this.zr)||r.register({["url"===e?Bs:Hs]:!0}),null==(t=this.ys)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.ys)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.ys)||!r.tryAddCustomEvent(e,t))}}},Dp={autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new Dv(e.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get Se(){var e,t,r=_r(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}Fs(){if(this.isBrowserSupported()){if(jn&&Un){var e=e=>{e=e||(null==jn?void 0:jn.event);try{this.As(e)}catch(e){qv.error("Failed to capture event",e)}};if(cs(Un,"submit",e,{capture:!0}),cs(Un,"change",e,{capture:!0}),cs(Un,"click",e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e=e||(null==jn?void 0:jn.event);try{this.As(e,Nv)}catch(e){qv.error("Failed to capture copy/cut event",e)}};cs(Un,"copy",t,{capture:!0}),cs(Un,"cut",t,{capture:!0})}}}else qv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Os=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Es]:!!e.autocapture_opt_out}),this.Rs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,r=[];return null==(t=this.Ls)||t.forEach((t=>{var i=null==Un?void 0:Un.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Es];if(Cr(this.Rs)&&!Mr(r)&&!this.instance.mr())return!1;var i=null!==(t=this.Rs)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}As(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Go(e);jo(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&na(i,this.instance.config.rageclick)&&this.As(e,"$rageclick");var n=t===Nv;if(i&&function(e,t,r,i,n,s){var o,a,l,u,h,d;if(void 0===r&&(r=void 0),!jn||sa(e))return!1;if(null!=(o=r)&&o.url_allowlist&&!Uo(r.url_allowlist,s))return!1;if(null!=(a=r)&&a.url_ignorelist&&Uo(r.url_ignorelist,s))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var c=r.dom_event_allowlist;if(c&&!c.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:v,targetElementList:f}=oa(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(xr(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(f,r))return!1;if(!Qo(f,null==(u=r)?void 0:u.css_selector_allowlist))return!1;if(Qo(f,null!==(h=null==(d=r)?void 0:d.css_selector_ignorelist)&&void 0!==h?h:Yo))return!1;var p=jn.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return v?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Zo.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.Se,n,n?["copy","cut"]:void 0,this.instance)){var{props:s,explicitNoCapture:o}=Hv(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Os,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Nv){var l,u=Vo(null==jn||null==(l=jn.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return br(null==Un?void 0:Un.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.$s=(null==jn||null==(t=jn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ts.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,ts.info("History API monitoring stopped")}monitorHistoryChanges(){jn&&jn.history&&(this.Ns("pushState"),this.Ns("replaceState"),this.qs())}Ns(e){var t;if(jn&&(null==(t=jn.history[e])||!t.__posthog_wrapped__)){var r=this;bs(jn.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.js(e)}))}}js(e){try{var t,r=null==jn||null==(t=jn.location)?void 0:t.pathname;if(!r)return;r!==this.$s&&this.isEnabled&&this._instance.capture(Po,{navigation_type:e}),this.$s=r}catch(t){ts.error("Error capturing "+e+" pageview",t)}}qs(){if(!this.Ds){var e=()=>{this.js("popstate")};cs(jn,"popstate",e),this.Ds=()=>{jn&&jn.removeEventListener("popstate",e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.Bs=!1,this.Ps=!1,this.Hs=null,this.instance=e,this.Bs=!(null==(t=this.instance.persistence)||!t.props[Ms]),this.rageclicks=new Dv(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return _r(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Ir(this.Se.capture_heatmaps)?Ir(this.Se.enable_heatmaps)?this.Bs:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;lp.info("starting..."),this.Us(),this.ke()}else{var e;clearInterval(null!==(e=this.Hs)&&void 0!==e?e:void 0),this.zs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ms]:t}),this.Bs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Vs(e){this.fe(e.originalEvent,"deadclick")}ke(){this.Hs&&clearInterval(this.Hs),this.Hs=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Un)?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Us(){jn&&Un&&(this.Ws=this.Lr.bind(this),cs(jn,Mo,this.Ws),this.Gs=e=>this.fe(e||(null==jn?void 0:jn.event)),cs(Un,"click",this.Gs,{capture:!0}),this.Zs=e=>this.Qs(e||(null==jn?void 0:jn.event)),cs(Un,"mousemove",this.Zs,{capture:!0}),this.Js=new Xv(this.instance,Yv,this.Vs.bind(this)),this.Js.startIfEnabledOrStop(),this.Ys=this.ke.bind(this),cs(Un,Eo,this.Ys),this.Ps=!0)}zs(){var e;jn&&Un&&(this.Ws&&jn.removeEventListener(Mo,this.Ws),this.Gs&&Un.removeEventListener("click",this.Gs,{capture:!0}),this.Zs&&Un.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Ys&&Un.removeEventListener(Eo,this.Ys),clearTimeout(this.Ks),null==(e=this.Js)||e.stop(),this.Ps=!1)}Xs(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&No(i)&&!qo(i,"body");){if(i===r)return!1;if(cr(t,null==jn?void 0:jn.getComputedStyle(i).position))return!0;i=Jo(i)}return!1}(Go(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}fe(e,t){var i;if(void 0===t&&(t="click"),!Do(e.target)&&up(e)){var n=this.Xs(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&na(Go(e),this.instance.config.rageclick)&&this.eo(r({},n,{type:"rageclick"})),this.eo(n)}}Qs(e){!Do(e.target)&&up(e)&&(clearTimeout(this.Ks),this.Ks=setTimeout((()=>{this.eo(this.Xs(e,"mousemove"))}),500))}eo(e){if(jn){var t=this.Se.disable_capture_url_hashes?Gi(jn.location.href):jn.location.href,r=this.Se.custom_personal_data_properties,i=this.Se.mask_personal_data_properties?[...sc,...r||[]]:[],n=ms(t,i,ac);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(e)}}Lr(){this.R&&!wr(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Xv,webVitalsAutocapture:class{constructor(e){var t;this.Bs=!1,this.Ps=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ro=()=>{clearTimeout(this.io),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.no=e=>{var t;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.so();if(!xr(i))if(Ir(null==e?void 0:e.name)||Ir(null==e?void 0:e.value))ep.error("Invalid metric received",e);else if(!this.oo||this.oo>e.value){this.R.url!==i&&(this.ro(),this.io=setTimeout(this.ro,this.flushToCaptureTimeoutMs)),xr(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=xr(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=r({},e,{$current_url:i,timestamp:Date.now()});xr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.ro()}else ep.error("Ignoring metric with value >= "+this.oo,e)},this.ao=()=>{if(!this.Ps){var e,t,r,i,n=Jn.__PosthogExtensions__;xr(n)||xr(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.no.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.no.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.no.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.no.bind(this)),this.Ps=!0):ep.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Bs=!(null==(t=this._instance.persistence)||!t.props[Ls]),this.startIfEnabled()}get lo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=_r(this.lo)?null==(e=this.lo)?void 0:e.web_vitals_allowed_metrics:void 0;return Ir(r)?(null==(t=this._instance.persistence)?void 0:t.props[$s])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(_r(this.lo)?this.lo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=_r(this.lo)?this.lo.web_vitals_attribution:void 0;return null!=e&&e}get oo(){var e=_r(this.lo)&&Tr(this.lo.__web_vitals_max_value)?this.lo.__web_vitals_max_value:tp;return e>0&&6e4>=e?tp:e}get isEnabled(){var e=null==zn?void 0:zn.protocol;if("http:"!==e&&"https:"!==e)return ep.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=_r(this.lo)?this.lo.web_vitals:Mr(this.lo)?this.lo:void 0;return Mr(t)?t:this.Bs}startIfEnabled(){this.isEnabled&&!this.Ps&&(ep.info("enabled, starting..."),this.Mt(this.ao))}onRemoteConfig(e){if("capturePerformance"in e){var t=_r(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=_r(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ls]:t}),this._instance.persistence.register({[$s]:r})),this.Bs=t,this.startIfEnabled()}}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?ep.error("failed to load script",t):e()}))}so(){var e=jn?this._instance.config.disable_capture_url_hashes?Gi(jn.location.href):jn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...sc,...t||[]]:[];return ms(e,r,ac)}ep.error("Could not determine current URL")}}},Np={exceptionObserver:class{constructor(e){var t,r,i;this.ao=()=>{var e;if(jn&&this.isEnabled&&null!=(e=Jn.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=Jn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Jn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Jn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uo&&this.Se.capture_unhandled_errors&&(this.uo=t(this.captureException.bind(this))),!this.ho&&this.Se.capture_unhandled_rejections&&(this.ho=r(this.captureException.bind(this))),!this.do&&this.Se.capture_console_errors&&(this.do=i(this.captureException.bind(this)))}catch(e){Kf.error("failed to start",e),this.co()}}},this._instance=e,this.vo=!(null==(t=this._instance.persistence)||!t.props[Ps]),this.fo=new qr({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,Ae:Kf}),this.Se=this.po(),this.startIfEnabledOrStop()}po(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return _r(e)?t=r({},t,e):(xr(e)?this.vo:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Kf.info("enabled"),this.co(),this.Mt(this.ao)):this.co()}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Kf.error("failed to load script",t);e()}))}co(){var e,t,r;null==(e=this.uo)||e.call(this),this.uo=void 0,null==(t=this.ho)||t.call(this),this.ho=void 0,null==(r=this.do)||r.call(this),this.do=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.vo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ps]:this.vo}),this.Se=this.po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.po()}captureException(e){var t,r,i,n=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.fo.consumeRateLimit(n)?Kf.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.mo=[],this.yo=Hc(),this._instance=e,this.mo=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Rs))&&void 0!==t?t:[],this.bo=Dn(this._o()),this.wo=new Nn(this.bo)}onConfigChange(){this.bo=Dn(this._o()),this.wo.setConfig(this.bo)}onRemoteConfig(e){var t,r,i;if("errorTracking"in e){var n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this.mo=n,this._instance.persistence&&this._instance.persistence.register({[Rs]:this.mo,[Os]:s})}}get xo(){var e,t=!!this._instance.get_property(Os),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.yo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.bo.enabled)try{if(!kr(e)||0===e.trim().length)return void Bc.warn("Ignoring exception step because message must be a non-empty string");var i=this.ko(t),{sanitizedProperties:n,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>An.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(i);s.length>0&&Bc.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.wo.add(r({[Ln]:e,[Fn]:(new Date).toISOString()},n))}catch(e){Bc.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.So(t)){if(this.Co(t))return this.Io("Exception dropped: matched a suppression rule"),void Bc.info("Skipping exception capture because a suppression rule matched");if(!this.xo&&this.To(t))return this.Io("Exception dropped: thrown by a browser extension"),void Bc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Eo(t))return this.Io("Exception dropped: thrown by the PostHog SDK"),void Bc.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.bo.enabled&&Ir(e.$exception_steps)?this.Mo(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Zi:!0});return i&&this.wo.clear(),i}catch(e){return Bc.error("Failed to capture exception event. Dropping this exception.",e),void this.wo.clear()}}catch(e){return void Bc.error("Failed to process exception event. Ignoring this exception.",e)}}Mo(e){try{var t=this.wo.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return Bc.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Io(e){this.bo.enabled&&this.wo.add({[Ln]:e,[Fn]:(new Date).toISOString()})}ko(e){return _r(e)?r({},e):{}}_o(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Co(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return kr(r)&&r.length>0&&e.$exception_types.push(r),kr(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.mo.some((e=>{var r=e.values.map((e=>{var r,i=Bh[e.operator],n=yr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}To(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Eo(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}So(e){return!Ir(e)&&yr(e)}}},qp=r({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Po=null,this.Ro=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,r;if(this.zr&&this.zr.register({[As]:!!e.productTours}),!dp(this._instance))return!this.Po&&Ir(null==(t=this.zr)?void 0:t.props[no])||hp.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Po)||r.stop(),this.Po=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Po&&dp(this._instance)&&this.Mt((()=>this.Oo()))}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?hp.error("Could not load product tours script",t):e()}))}Oo(){var e;!this.Po&&null!=(e=Jn.__PosthogExtensions__)&&e.generateProductTours&&(this.Po=Jn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!yr(this.Ro)||t){var r=this.zr;if(r){var i=r.props[no];if(yr(i)&&!t)return this.Ro=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{if(dp(this._instance)){var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return hp.error(n),void e([],{isLoaded:!1,error:n})}var s=yr(t.json.product_tours)?t.json.product_tours:[];this.Ro=s,r&&r.register({[no]:s}),e(s,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ro,{isLoaded:!0})}getActiveProductTours(e){Ir(this.Po)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Po.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Po)||t.showTourById(e)}previewTour(e){this.Po?this.Po.previewTour(e):this.Mt((()=>{var t;this.Oo(),null==(t=this.Po)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this.Po)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Po)||e.nextStep()}previousStep(){var e;null==(e=this.Po)||e.previousStep()}clearCache(){var e;this.Ro=null,null==(e=this.zr)||e.unregister(no)}resetTour(e){var t;null==(t=this.Po)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Po)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Po)||t.cancelPendingTour(e)}}},Ap),jp={siteApps:class{constructor(e){this.Lo=0,this._instance=e,this.Fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ao(e,t){if(t){var r=this.globalsForEvent(t);this.Fo.push(r),this.Fo.length>1e3&&(this.Fo=this.Fo.slice(10))}}get siteAppLoaders(){var e;return null==(e=Jn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Ao.bind(this));this.$o=()=>{e(),this.Fo=[],this.$o=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(c))h[v]={id:d[v],type:v,properties:f};var{$set_once:p,$set:g}=e;return{event:r({},i(e,cp),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Do(e){var t,r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(vp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(vp.error("prepare_external_dependency_script returned null"),null):e}No(){var e,t,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==Un?void 0:Un.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.Lo++,this.qo)return this.jo();var h=[],d=this,c=new WeakSet,v=(e,t,r)=>{if(null!=e&&e[t]){var i=e[t];e[t]=r(i),h.push((()=>{e[t]=i}))}},f=e=>{if(c.has(e))return e;var t=d.Do(e);return t&&c.add(t),t},p=e=>e.map((e=>"string"==typeof e?e:f(e))).filter((e=>!Cr(e)));return v(u,"appendChild",(e=>function(t){var r=f(t);return r?e.call(this,r):t})),v(u,"insertBefore",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):t})),v(u,"replaceChild",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):r})),[null==(t=l.Element)?void 0:t.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((e=>{v(e,"append",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"prepend",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((e=>{v(e,"before",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"after",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"replaceWith",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:e.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(e=>function(t,r){var i=f(r);return i?e.call(this,t,i):null})),this.qo=()=>{h.forEach((e=>e())),this.qo=void 0},this.jo()}jo(){var e=!1;return()=>{var t;e||(e=!0,this.Lo--,0===this.Lo&&(null==(t=this.qo)||t.call(this)))}}Bo(e,t){void 0===t&&(t=!0);var r=this.No();try{var i=e(r);return t&&r(),i}catch(e){throw r(),e}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.Fo.length&&(vp.info("Processing "+this.Fo.length+" events for site app with id "+e.id),this.Fo.forEach((e=>this.Bo((()=>null==t.processEvent?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&(null==(r=this.$o)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,vp.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=this.Bo((t=>e.init({posthog:this._instance,callback(e){t(),n(e)}})),!1);s&&(t.processEvent=s),i=!0}catch(t){vp.error(fp+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){vp.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Ho(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Uo(e){var t=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(e),i=function(i){try{t.Bo((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(t){vp.error("Error while processing event "+e.event+" for site app "+i.id,t)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Ho(),void this._instance.on("eventCaptured",(e=>this.Uo(e)))):void vp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.$o)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;Jn["__$$ph_site_app_"+e]=n._instance,null==(t=Jn.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return vp.error(fp+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else vp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Bp={tracingHeaders:class{constructor(e){this.zo=void 0,this.Vo=void 0,this.Wo=void 0,this.ao=()=>{var e,t,r=this.Go();r?(xr(this.zo)&&(this.zo=null==(e=Jn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),xr(this.Vo)&&(this.Vo=null==(t=Jn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.co()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Xf.error("failed to load script",t);e()}))}Zo(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Go(){var e=this.Zo();return yr(e)?(yr(this.Wo)?this.Wo.splice(0,this.Wo.length,...e):this.Wo=[...e],e.length>0?this.Wo:void 0):(yr(this.Wo)&&this.Wo.splice(0),this.Wo=e||void 0,this.Wo)}co(){var e,t;null==(e=this.zo)||e.call(this),null==(t=this.Vo)||t.call(this),this.zo=void 0,this.Vo=void 0}startIfEnabledOrStop(){this.Go()?this.Mt(this.ao):this.co()}}},Hp=r({surveys:class{get Se(){return this._instance.config}constructor(e){this.Qo=void 0,this._surveyManager=null,this.Jo=!1,this.Yo=[],this.Ko=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(Ir(t))return Mu.warn("Flags not loaded yet. Not loading surveys.");var r=yr(t);this.Qo=r?t.length>0:t,Mu.info("flags response received, isSurveysEnabled: "+this.Qo),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Lu)||null!=i&&i.startsWith(Fu))&&t.push(i)}t.forEach((e=>localStorage.removeItem(e)))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.Jo)Mu.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)Mu.info(_p);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())Mu.info("Not loading surveys in cookieless mode without consent.");else{var e=null==Jn?void 0:Jn.__PosthogExtensions__;if(e){if(!xr(this.Qo)||this.Se.advanced_enable_surveys){var t=this.Qo||this.Se.advanced_enable_surveys;this.Jo=!0;try{var r=e.generateSurveys;if(r)return void this.Xo(r,t);var i=e.loadExternalDependency;if(!i)return void this.ea(xo);i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.ea("Could not load surveys script",r):this.Xo(e.generateSurveys,t)}))}catch(e){throw this.ea("Error initializing surveys",e),e}finally{this.Jo=!1}}}else Mu.error("PostHog Extensions not found.")}}Xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new yp(this._instance),Mu.info("Surveys loaded successfully"),this.ta({isLoaded:!0})}ea(e,t){Mu.error(e,t),this.ta({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yo.push(e),this._surveyManager&&this.ta({isLoaded:!0}),()=>{this.Yo=this.Yo.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Se.disable_surveys)return Mu.info(_p),e([]);var r,i=this._instance.get_property(to);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Ko?this.Ko.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this.Ko=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:t=>{var i;this.Ko=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Mu.error(s);var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}var a,l=t.json.surveys||[],u=l.filter((e=>Pu(e)&&(Ru(e)||Ou(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[to]:l,[ro]:Date.now()});var h={isLoaded:!0};e(l,h),null==r||r({surveys:l,context:h})}}))}ta(e){for(var t of this.Yo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Mu.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Ir(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Mu.warn("init was not called")}ra(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}ia(e){if(Ir(this._surveyManager))return{eligible:!1,reason:bp};var t="string"==typeof e?this.ra(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ir(this._surveyManager))return Mu.warn("init was not called"),{visible:!1,disabledReason:bp};var t=this.ia(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Ir(this._surveyManager)?(Mu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:bp})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this.ia(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(Ir(this._surveyManager))Mu.warn("init was not called");else{var n="string"==typeof e?this.ra(e):e;if(null!=n&&n.id)if(Nu.includes(n.type)){var s=null==Un?void 0:Un.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Mu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Mu.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),Mu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Mu.warn("Survey element not found")}else Mu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Mu.warn("Survey not found")}}displaySurvey(e,t){var i;if(Ir(this._surveyManager))Mu.warn("init was not called");else{var n=this.ra(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==_u&&t.initialResponses&&Mu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Mu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Mu.warn("Survey not found")}}cancelPendingSurvey(e){Ir(this._surveyManager)?Mu.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},Ap),Up={toolbar:class{constructor(e){this.instance=e}na(e){Jn.ph_toolbar_state=e}sa(){var e;return null!==(e=Jn.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),vs(this.instance.config))return!1;if(!jn||!Un)return!1;e=null!=e?e:jn.location,r=null!=r?r:jn.history;try{if(!t){try{jn.localStorage.setItem("test","test"),jn.localStorage.removeItem("test")}catch(e){return!1}t=null==jn?void 0:jn.localStorage}var i,n=wp||ys(e.hash,"__posthog")||ys(e.hash,"state"),s=n?as((()=>JSON.parse(atob(decodeURIComponent(n)))))||as((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(xp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}oa(e){var t=Jn.ph_load_toolbar||Jn.ph_load_editor;!Ir(t)&&br(t)?t(e,this.instance):kp.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Un||!Un.getElementById(mo));if(!jn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(jn.localStorage.setItem(xp,JSON.stringify(r({},n,{source:void 0}))),2===this.sa())this.oa(n);else if(0===this.sa()){var s;this.na(1),null==(s=Jn.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return kp.error("[Toolbar] Failed to load",e),void this.na(0);this.na(2),this.oa(n)})),cs(jn,"turbolinks:load",(()=>{this.na(0),this.loadToolbar(n)}))}return!0}aa(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},zp=r({experiments:Rp},Ap),Vp={conversations:class{constructor(e){this.la=void 0,this._conversationsManager=null,this.ua=!1,this.ha=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Ir(t)||(Mr(t)?this.la=t:(this.la=t.enabled,this.ha=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.la=void 0,this.ha=null}loadIfEnabled(){if(!(this._conversationsManager||this.ua||this._instance.config.disable_conversations||vs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==Jn?void 0:Jn.__PosthogExtensions__;if(e&&!xr(this.la)&&this.la)if(this.ha&&this.ha.token){this.ua=!0;try{var t=e.initConversations;if(t)return this.da(t),void(this.ua=!1);var r=e.loadExternalDependency;if(!r)return void this.ca(xo);r(this._instance,"conversations",(t=>{t||!e.initConversations?this.ca("Could not load conversations script",t):this.da(e.initConversations),this.ua=!1}))}catch(e){this.ca("Error initializing conversations",e),this.ua=!1}}else Op.error("Conversations enabled but missing token in remote config.")}}da(e){if(this.ha)try{this._conversationsManager=e(this.ha,this._instance),Op.info("Conversations loaded successfully")}catch(e){this.ca("Error completing conversations initialization",e)}else Op.error("Cannot complete initialization: remote config is null")}ca(e,t){Op.error(e,t),this._conversationsManager=null,this.ua=!1}show(){this._conversationsManager?this._conversationsManager.show():Op.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.la&&!Cr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(Op.warn(Lp),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(Op.warn(Lp),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(Op.warn(Lp),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(Op.warn(Lp),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(Op.warn(Lp),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(Op.warn(Lp),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Op.warn(Lp),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}en(){var e;null==(e=this._conversationsManager)||e.setIdentity()}tn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},Wp={logs:class{constructor(e){var t;this.va=!1,this.fa=!1,this.Ae=rs("[logs]"),this._r=[],this.pa=[],this.ga=()=>{var e,t;null==(e=this.ma)||e.onReconnect(),null==(t=this.ya)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.va=!0),jn&&cs(jn,"online",this.ga)}ba(e,t,r,i){var n,s=function(e,t){var r,i,n,s,o,a,l,u=null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==e?void 0:e.maxBufferSize)&&void 0!==i?i:100,d=null!=t&&t.consoleCapture?void 0:null!==(n=null==e?void 0:e.maxLogsPerInterval)&&void 0!==n?n:1e3,c=xr(d)?Math.max(h,2048):Math.max(h,d),v=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==s?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new rn(this._a(e,t),s,this.Ae,(()=>this.wa()),(e=>e()),void 0,i),s]}xa(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.ma&&this.ka===r||(null==(t=this.ma)||t.reset(),this.ka=r,[this.ma,this.Sa]=this.ba((()=>this._r),(e=>{this._r=e}))),this.ma}Ca(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.ya&&this.Ia===r||(null==(t=this.ya)||t.reset(),this.Ia=r,[this.ya,this.Ta]=this.ba((()=>this.pa),(e=>{this.pa=e}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Fp)),this.ya}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Ir(r)&&r&&(this.va=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],null==(e=this.ma)||e.reset(),this.pa=[],null==(t=this.ya)||t.reset()}captureLog(e){this.xa().captureLog(e)}le(e){this.Ca().captureLog(e)}get logger(){return this.Ea||(this.Ea={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Ea}flushLogs(e){e?this.Ma(e):(this.ma&&this.ma.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))),this.ya&&this.ya.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.va&&!this.fa){var e=null==Jn?void 0:Jn.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.Ae.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.fa=!0)})):this.Ae.error(xo)}else this.Ae.error("PostHog Extensions not found.")}}_a(e,t){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===Kt.LogsQueue?e():void 0,setPersistedProperty(e,r){var i;e===Kt.LogsQueue&&t(null!==(i=r)&&void 0!==i?i:[])},ht:e=>this.ht(e),getLibraryId:()=>Xn.LIB_NAME,getLibraryVersion:()=>Xn.LIB_VERSION}}ht(e){return new Promise((t=>{var r=!1,i=e=>{r||(r=!0,clearTimeout(n),t(e))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Pa(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;if(t>=200&&300>t)i({kind:"ok"});else if(413===t)i({kind:"too-large"});else if(0!==t&&429!==t&&500>t)i({kind:"fatal",error:new Error("logs request failed with status "+t)});else{var r;i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+t)})}}})}))}Ma(e){this._r.length>0&&this.Ra(e,this._r,this.Sa,Xn.LIB_NAME,(e=>{this._r=e})),this.pa.length>0&&this.Ra(e,this.pa,this.Ta,Fp,(e=>{this.pa=e}))}Ra(e,t,r,i,n){if(0!==t.length){var s=t.map((e=>e.record));n([]);var o=tn(s,en(r,Xn.LIB_NAME,Xn.LIB_VERSION),i,Xn.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Pa(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}Pa(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}wa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r,windowId:i,sessionStartTimestamp:n,lastActivityTimestamp:s}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r,t.windowId=i,Ir(n)||(t.sessionStartTimestamp=n),Ir(s)||(t.lastActivityTimestamp=s)}if(null!=Jn&&null!=(e=Jn.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?Gi(Jn.location.href):Jn.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},Gp=r({},Ap,$p,Dp,Np,qp,jp,Hp,Bp,Up,zp,Vp,Wp);Yf.__defaultExtensionClasses=r({},Gp),function(){Xn.SDK_DIST_CHANNEL="cdn";var e=Nf[Vf]=new Yf,t=Jn.posthog;t&&ns(t._i,(function(r){if(r&&yr(r)){var i=e.init(r[0],r[1],r[2]),n=t[r[2]]||t;i&&(i._execute_array.call(i.people,n.people),i._execute_array(n))}})),Jn.posthog=e,function(){function e(){e.done||(e.done=!0,Wf=!1,ns(Nf,(function(e){e._dom_loaded()})))}null!=Un&&Un.addEventListener?"complete"===Un.readyState?e():cs(Un,"DOMContentLoaded",e,{capture:!1}):jn&&ts.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}()}();
1
+ !function(){"use strict";function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(l||{}),u=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(u||{}),h=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(h||{}),d=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(d||{}),c=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(c||{}),v=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(v||{}),f=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(e){if(m[e])return m[e];var t=function(e){var t,r,i=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);return i&&globalThis[i]?globalThis[i]:void 0}(e)||globalThis[e],r=t.prototype,i=e in p?p[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in g?g[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return m[e]=t.prototype,t.prototype;var a=document.createElement("iframe");try{document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return u?m[e]=u:r}catch(e){return r}finally{a.parentNode&&document.body.removeChild(a)}}var b={};function _(e,t,r){var i,n=e+"."+String(r);if(b[n])return b[n].call(t);var s=y(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(t)):t[r]}var w={};function x(e,t,r){var i=e+"."+String(r);if(w[i])return w[i].bind(t);var n=y(e)[r];return"function"!=typeof n?t[r]:(w[i]=n,n.bind(t))}function k(){return y("MutationObserver").constructor}function S(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}var C={childNodes:e=>_("Node",e,"childNodes"),parentNode:e=>_("Node",e,"parentNode"),parentElement:e=>_("Node",e,"parentElement"),textContent:e=>_("Node",e,"textContent"),contains:(e,t)=>x("Node",e,"contains")(t),getRootNode:e=>x("Node",e,"getRootNode")(),host:e=>e&&"host"in e?_("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null,querySelector:(e,t)=>x("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>x("Element",e,"querySelectorAll")(t),mutationObserver:k,patch:S};function I(e){return e.nodeType===e.ELEMENT_NODE}function T(e){var t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return Boolean(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function E(e){return"[object ShadowRoot]"==={}.toString.call(e)}function M(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(i=Array.from(t,(e=>P(e,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function P(e,t){var r;if(function(e){return"styleSheet"in e}(e)){var i;try{i=M(e.styleSheet)||function(e){var{cssText:t}=e;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){i=e.cssText}try{if(i&&(null==(r=e.styleSheet)?void 0:r.href))return B(i,e.styleSheet.href)}catch(e){}return i}var n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?B(n,t):n}class R{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);if(this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e))),I(e)){var r=C.shadowRoot(e);r&&this.removeNodeFromMap(r),"IFRAME"===e.nodeName&&e.contentDocument&&this.removeNodeFromMap(e.contentDocument)}}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function O(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&L(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function L(e){return e.toLowerCase()}var F="__rrweb_original__";function A(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?L(t):null}var D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(D,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(N.test(l)||q.test(l))return"url("+u+l+u+")";if(j.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var H,U,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,G=new RegExp("[^a-z0-9-_:]"),Z=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,K=new WeakMap;function X(e,t){return t&&""!==t.trim()?ee(e,t):t}function ee(e,t){var r=K.get(e);if(r||(r=e.createElement("a"),K.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function te(e,t){return(null==t?void 0:t.maxBase64ImageLength)?function(e,t){return t&&e.length>t?z:e}(e,t.maxBase64ImageLength):e}function re(e,t,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==t||"#"!==i[0])){if("link"===t&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=X(e,i);if(l.startsWith("data:")){if("img"===t&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(e,t,r,i){if(!e.complete||0===e.naturalWidth)return t;if(e.naturalWidth>V||e.naturalHeight>V)return t;try{var n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(e,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):t}catch(e){return t}}(n,l,s.type,s.quality)),te(u,s)}if("image"===t)return te(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=X(e,i);return"image"===t&&h.startsWith("data:")?te(h,s):h}return"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Y),t.length>r;){var s=i(J);if(","===s.slice(-1))s=X(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?B(i,ee(e)):"object"===t&&"data"===r?X(e,i):i:X(e,i)}function ie(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ne(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ne(C.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&ne(C.parentNode(e),t,r)}function se(e,t,r,i){var n;if(I(e)){if(!C.childNodes(n=e).length)return!1}else{if(null===C.parentElement(e))return!1;n=C.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(ne(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}var oe=new Map;function ae(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}function le(e){return null==e?"":e.toLowerCase()}var ue=50,he=!1,de=!1;function ce(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_=5e3,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:S=(()=>!1),newlyAddedElement:P=!1,depth:R=0,maxDepth:D=ue}=t,{needsMask:N}=t,{preserveWhiteSpace:q=!0}=t;if(R>=D)return de=!0,he||(he=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+D+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;N||(N=se(e,o,a,void 0===N));var j,z=function(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g=!1}=t,m=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:f.Document,childNodes:[],compatMode:e.compatMode}:{type:f.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return function(e,t){for(var r,i,n,s,{doc:o,blockClass:a,blockSelector:l,inlineStylesheet:u,maskInputOptions:h={},maskInputFn:d,dataURLOptions:c={},inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:m=!1,rootId:y}=t,b=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,a,l),_=function(e){if(e instanceof HTMLFormElement)return"form";var t=L(e.tagName);return G.test(t)?"div":t}(e),w={},x=e.attributes.length,k=0;x>k;k++){var S=e.attributes[k];ie(_,S.name)||(w[S.name]=re(o,_,L(S.name),S.value,e,c))}if("link"===_&&u){var I=e.sheet;if(!I){var T=function(e){return e.href}(e);T&&!(I=ae(o,T))&&T.includes(".css")&&(I=ae(o,window.location.origin+"/"+T.replace(window.location.href,"")))}var E=null;I&&(E=M(I)),E&&(delete w.rel,delete w.href,w._cssText=E)}if("style"===_&&e.sheet&&!(e.innerText||C.textContent(e)||"").trim().length){var P=M(e.sheet);P&&(w._cssText=P)}if("input"===_||"textarea"===_||"select"===_){var R=e.value,D=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&R?w.value=O({element:e,type:A(e),tagName:_,value:R,maskInputOptions:h,maskInputFn:d}):D&&(w.checked=D)}if("option"===_&&(e.selected&&!h.select?w.selected=!0:delete w.selected),"dialog"===_&&e.open)try{w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}if("canvas"===_&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((F in n?n[F]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var N=e.toDataURL(c.type,c.quality),q=o.createElement("canvas");q.width=e.width,q.height=e.height,N!==q.toDataURL(c.type,c.quality)&&(w.rr_dataURL=N)}if("img"===_&&v){H||(H=o.createElement("canvas"),U=H.getContext("2d"));var j=e,B=j.currentSrc||j.getAttribute("src")||"<unknown-src>",z=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{H.width=j.naturalWidth,H.height=j.naturalHeight,U.drawImage(j,0,0),w.rr_dataURL=H.toDataURL(c.type,c.quality)}catch(e){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="+B+"! Error: "+e)}"anonymous"===j.crossOrigin&&(z?w.crossOrigin=z:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===_||"video"===_){var W=w;W.rr_mediaState=e.paused?"paused":"played",W.rr_mediaCurrentTime=e.currentTime,W.rr_mediaPlaybackRate=e.playbackRate,W.rr_mediaMuted=e.muted,W.rr_mediaLoop=e.loop,W.rr_mediaVolume=e.volume}if(m||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),b){var{width:Z,height:Q,left:J,top:Y}=e.getBoundingClientRect(),K=null==(r=o.defaultView)?void 0:r.getComputedStyle(e);w={class:w.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(Y+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},K&&(w.rr_position=K.position||"static",K.transform&&"none"!==K.transform&&(w.rr_transform=K.transform),K.display&&K.display.startsWith("inline")&&(w.rr_display=K.display))}"iframe"!==_||g(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(_)&&(s=!0)}catch(e){}return{type:f.Element,tagName:_,attributes:w,childNodes:[],isSVG:(X=e,Boolean("svg"===X.tagName||X.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:s};var X}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:d,inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=C.parentNode(e),a=o&&o.tagName,l=C.textContent(e),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(e.nextSibling||e.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var d=M(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=B(l,ee(t.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(e)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:m});case e.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(e)||"",rootId:m};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:S,newlyAddedElement:P});if(!z)return console.warn(e,"not serialized"),null;j=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===f.Comment)return!0;if(e.type===f.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===function(e,t){var r,i;try{i=new URL(e,window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(le(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===le(e.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(le(e.attributes.rel)))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&le(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(le(e.attributes.property).match(/^(og|twitter|fb):/)||le(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===le(e.attributes.name)))return!0;if(t.headMetaRobots&&["robots","googlebot","bingbot"].includes(le(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(le(e.attributes.name))||le(e.attributes.property).match(/^article:/)||le(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(le(e.attributes.name)))return!0}}return!1}(z,v)||!q&&z.type===f.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?Z:Q();var V=Object.assign(z,{id:j});if(i.add(e,V),j===Z)return null;y&&y(e);var W=!l;if(V.type===f.Element){W=W&&!V.needBlock,delete V.needBlock;var J=C.shadowRoot(e);J&&E(J)&&(V.isShadowHost=!0)}if((V.type===f.Document||V.type===f.Element)&&W){v.headWhitespace&&V.type===f.Element&&"head"===V.tagName&&(q=!1);var Y={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:S,depth:R+1,maxDepth:D};if(V.type===f.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var K of Array.from(C.childNodes(e))){var X=ce(K,Y);X&&V.childNodes.push(X)}var te=null;if(I(e)&&(te=C.shadowRoot(e)))for(var ne of Array.from(C.childNodes(te))){var ve=ce(ne,Y);ve&&(E(te)&&(ve.isShadow=!0),V.childNodes.push(ve))}}var fe=C.parentNode(e);if(fe&&T(fe)&&E(fe)&&(V.isShadow=!0),V.type===f.Element&&"iframe"===V.tagName){var pe=function(e,t,r){var i,n=()=>{},s=e.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(e){return n}var o=()=>t();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),e.removeEventListener("load",h),e.addEventListener("load",o),t())},h=()=>u();return l=setTimeout(u,r),e.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?e.removeEventListener("load",o):(a=!0,e.removeEventListener("load",h))}}var d,c="about:blank";try{d=s.location.href}catch(e){return n}if(d!==c||e.src===c||""===e.src){var v=setTimeout(t,0);return e.addEventListener("load",o),()=>{clearTimeout(v),e.removeEventListener("load",o)}}return e.addEventListener("load",o),()=>{e.removeEventListener("load",o)}}(e,(()=>{var t=e.contentDocument;if(t&&b){var r=ce(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:S,depth:R+1,maxDepth:D});r&&b(e,r)}}),_);null==w||w(e,pe)}return V.type===f.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(t,l,f){if(!oe.has(t)){var w;try{w=t.sheet}catch(e){return}if(!w){var C=new AbortController,I=!1,T=()=>{if(!I){I=!0;try{(()=>{if(x){var t=ce(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:x,stylesheetLoadTimeout:k,keepIframeSrcFn:S,depth:R,maxDepth:D});t&&x(e,t)}})()}finally{oe.delete(t),C.abort()}}},E=setTimeout(T,f);C.signal.addEventListener("abort",(()=>clearTimeout(E)),{once:!0}),t.addEventListener("load",T,{signal:C.signal,once:!0}),oe.set(t,C)}}}(e,0,k),V}function ve(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:!1===e?{}:e}class fe{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof fe))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function pe(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}function ge(e){try{e()}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}var me="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.",ye={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};function be(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}}function _e(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>_e(e,t,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ye=new Proxy(ye,{get(e,t,r){return"map"===t&&console.error(me),Reflect.get(e,t,r)}}));var we=Date.now;function xe(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=C.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function ke(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Se(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ce(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function Ie(e,t,r,i){if(!e)return!1;var n=Ce(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ne(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Te(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Z}function Ee(e,t){if(T(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=C.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||Ee(i,t))}function Me(e){return Boolean(e.changedTouches)}function Pe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Re(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Oe(e){return!!e&&(e instanceof fe&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(C.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());class Le{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Fe(e){var t,r=null;return"getRootNode"in e&&(null==(t=C.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function Ae(e){var t=e.ownerDocument;return!!t&&(C.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Fe(r);)r=t;return r}(e);return C.contains(t,r)}(e))}function $e(e){return"__ln"in e}class De{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&$e(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&$e(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var Ne,qe=(e,t)=>e+"@"+t;class je{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new De,i=e=>{for(var t=e,r=Z;r===Z;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=C.parentNode(n);if(s&&Ae(n)&&"TEXTAREA"!==s.tagName){var o=T(s)?this.mirror.getId(Fe(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ce(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Pe(e,this.mirror)&&this.iframeManager.addIframe(e),Re(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Oe(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onIframeListenerRegistered:(e,t)=>{this.iframeManager.registerLoadListenerDisposer(e,t)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)He(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ue(this.droppedSet,o)||He(this.removesSubTreeCache,o)?Ue(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(C.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=C.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=C.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(e=>this.doc===e.contentDocument)),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t));var r=Array.from(C.childNodes(e),(e=>C.textContent(e)||"")).join("");t.attributes.value=O({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:A(e),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(e=>{if(!Te(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=C.textContent(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:se(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ce(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=A(r);n=O({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ie(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!ie(r.tagName,i))if(o.attributes[i]=re(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&(a.style.cssText=e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ie(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=T(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);Ie(e.target,this.blockClass,this.blockSelector,!1)||Te(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Be(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Ee(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[qe(r,i)]?Be(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:!(!T(e.target)||!E(e.target))||void 0}),function(e,t){for(var r=[e];r.length;){var i=r.pop();t.has(i)||(t.add(i),C.childNodes(i).forEach((e=>r.push(e))))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Te(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[qe(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ie(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach((e=>this.genAdds(e))),Oe(e)&&C.childNodes(C.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.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 Be(e,t){e.delete(t),C.childNodes(t).forEach((t=>Be(e,t)))}function He(e,t,r){return 0!==e.size&&function(e,t,r){var i=C.parentNode(t);return!!i&&e.has(i)}(e,t)}function Ue(e,t){return 0!==e.size&&ze(e,t)}function ze(e,t){var r=C.parentNode(t);return!!r&&(!!e.has(r)||ze(e,r))}var Ve=e=>Ne?function(){try{return e(...arguments)}catch(e){if(Ne&&!0===Ne(e))return;throw e}}:e,We=[];function Ge(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Ze(e,t){var r=new je;We.push(r),r.init(e);var i=new(k())(Ve(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:i,buffer:r}}function Qe(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e,a=new Map,l=e=>{var o=Ge(e);if(o&&!Ie(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=xe(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),t({id:h,x:l,y:u}))}},u=[pe("scroll",Ve(be(Ve((e=>l(e))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(pe("scrollend",Ve(l),r)),()=>u.forEach((e=>e()))}function Je(e,t){for(var r=We.length-1;r>=0;r--){var i=We[r];if(i){var n=i.bufferBelongsToIframe(e);!n&&t&&t.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),We.splice(r,1))}}}var Ye=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function Xe(e){return function e(t,r){if(it("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||it("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||it("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||it("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(i),e(t.parentRule,r)}if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(n)}return r}(e,[])}function et(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function tt(e,t){var r,i,n,s,{mirror:o,stylesheetManager:a}=e;s=o.getId("#document"===t.nodeName?t:C.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ve((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function rt(e,t){void 0===t&&(t={});var i,n,s=e.doc.defaultView;if(!s)return()=>{};if(function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:c,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),c(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM){var o=Ze(e,e.doc);i=o.observer,n=o.buffer}var a=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;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=be(Ve((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),d=Ve(be(Ve((e=>{var t=Ge(e),{clientX:r,clientY:i}=Me(e)?e.changedTouches[0]:e;s||(s=we()),l.push({x:r,y:i,id:n.getId(t),timeOffset:we()-s}),h("undefined"!=typeof DragEvent&&e instanceof DragEvent?u.Drag:e instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[pe("mousemove",d,i),pe("touchmove",d,i),pe("drag",d,i)];return Ve((()=>{c.forEach((e=>e()))}))}(e),l=function(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=L(e),l=(e=>i=>{var a=Ge(i);if(!Ie(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[e]===h.MouseDown?u="TouchStart":h[e]===h.MouseUp&&(u="TouchEnd"))}else Me(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[e]===h.Click&&(l=c,c=null);var v=Me(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),{clientX:p,clientY:g}=v;Ve(t)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(h[e]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(pe(a,l,i))})),Ve((()=>{u.forEach((e=>e()))}))}(e),c=Qe(e),f=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return pe("resize",Ve(be(Ve((()=>{var e=ke(),t=Se();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:s}),p=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:d,userTriggeredOnInput:c}=e;function v(e){var t=Ge(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=C.parentElement(t)),t&&n&&Ye.indexOf(n)>=0&&!Ie(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,v=!1,p=A(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(u[n.toLowerCase()]||u[p])&&(d=O({element:t,maskInputOptions:u,tagName:n,type:p,value:d,maskInputFn:h})),f(t,c?{text:d,isChecked:v,userTriggered:r}:{text:d,isChecked:v});var g=t.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,c?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,i){var s=Ke.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Ke.set(e,i);var o=n.getId(e);Ve(t)(r({},i,{id:o}))}}var p=("last"===d.input?["change"]:["input","change"]).map((e=>pe(e,Ve(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((e=>e()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((e=>_e(e[0],e[1],{set(){Ve(v)({target:this,isTrusted:!1})}},!1,g)))),Ve((()=>{p.forEach((e=>e()))}))}(e),g=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ve((e=>be(Ve((s=>{var o=Ge(s);if(o&&!Ie(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:d}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[pe("play",a(v.Play),o),pe("pause",a(v.Pause),o),pe("seeked",a(v.Seeked),o),pe("volumechange",a(v.VolumeChange),o),pe("ratechange",a(v.RateChange),o)];return Ve((()=>{l.forEach((e=>e()))}))}(e),m=()=>{},y=()=>{},b=()=>{},_=()=>{};e.recordDOM&&(m=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ve(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=et(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var h={};nt("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(nt("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),nt("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),nt("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((e=>{var[t,s]=e;d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ve(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=et(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...Xe(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ve(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=et(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...Xe(t),o]}]}),e.apply(t,s)}))})})),Ve((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:s}),y=tt(e,e.doc),b=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=e,{win:o}=t,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ve(((e,t,o)=>{var l,[u,h,d]=o;if(n.has(u))return a.apply(t,[u,h,d]);var{id:c,styleId:v}=et(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||v&&-1!==v)&&r({id:c,styleId:v,set:{property:u,value:h,priority:d},index:Xe(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ve(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:h,styleId:d}=et(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||d&&-1!==d)&&r({id:h,styleId:d,remove:{property:u},index:Xe(t.parentRule)}),e.apply(t,o)}))}),Ve((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:s}),e.collectFonts&&(_=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=S(r.fonts,"add",(function(e){return function(r){return setTimeout(Ve((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ve((()=>{n.forEach((e=>e()))}))}(e)));var w=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ve((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var h=e.getRangeAt(u),{startContainer:d,startOffset:c,endContainer:v,endOffset:f}=h;Ie(d,i,n,!0)||Ie(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),pe("selectionchange",a)}(e),x=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?S(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),k=[];for(var I of e.plugins)k.push(I.observer(I.callback,s,I.options));return Ve((()=>{if(n){n.destroy(),n.reset();var e=We.indexOf(n);-1!==e&&We.splice(e,1)}null==i||i.disconnect(),a(),l(),c(),f(),p(),g(),m(),y(),b(),_(),w(),x(),k.forEach((e=>e()))}))}function it(e){return void 0!==window[e]}function nt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class st{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class ot{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new st(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new st(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}registerLoadListenerDisposer(e,t){var r=this.loadListenerDisposers.get(e);r||this.loadListenerDisposers.set(e,r=new Set),r.add(t);var i=this.mirror.getId(e);-1!==i&&this.iframeElementsById.set(i,e)}getIframeElementById(e){var t,r,i;return null!==(t=null!==(r=null==(i=this.attachedIframes.get(e))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(e))&&void 0!==t?t:null}forgetIframeId(e){this.attachedIframes.delete(e),this.iframeElementsById.delete(e)}disposeLoadListeners(e){var t=this.loadListenerDisposers.get(e);t&&(t.forEach((e=>ge(e))),this.loadListenerDisposers.delete(e))}removePageHideListener(e){var t=this.pageHideHandlers.get(e);t&&(t.forEach((e=>{var{win:t,handler:r}=e;ge((()=>t.removeEventListener("pagehide",r)))})),this.pageHideHandlers.delete(e))}addLoadListener(e){this.loadListener=e}addPageHideListener(e){this.pageHideListener=e}removeLoadListener(){this.loadListener=void 0}trackIframeContent(e,t){var r=this.mirror.getId(e);return this.attachedIframes.set(r,{element:e,content:t}),r}attachIframe(e,t){var r,i=this.trackIframeContent(e,t);if(e.contentDocument){var n=this.attachedDocuments.get(e);n||this.attachedDocuments.set(e,n=new Set),n.add(e.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=e.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);ge((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var t=this.attachedWindows.get(e);t||this.attachedWindows.set(e,t=new Set),t.add(s)}))}ge((()=>{var t=e.contentWindow;if(t){var r=this.pageHideHandlers.get(e);if(r)for(var i of r)if(i.win===t)return;var n=()=>{var t;null==(t=this.pageHideListener)||t.call(this,e),e.contentDocument&&this.mirror.removeNodeFromMap(e.contentDocument),e.contentWindow&&this.crossOriginIframeMap.delete(e.contentWindow)};t.addEventListener("pagehide",n),r||this.pageHideHandlers.set(e,r=new Set),r.add({win:t,handler:n})}})),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),this.trackIframeContent(e,t.data.node),{timestamp:t.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return t;case l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case l.IncrementalSnapshot:switch(t.data.source){case u.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.Drag:case u.TouchMove:case u.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(t.data,e,["id"]),t;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case u.Font:return t;case u.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case u.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===f.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}removeIframeById(e){var t=this.attachedIframes.get(e),r=(null==t?void 0:t.element)||this.iframeElementsById.get(e)||this.mirror.getNode(e);if(this.iframeElementsById.delete(e),r){var i=r.contentWindow,n=this.attachedWindows.get(r);if(n&&(n.forEach((e=>{var t=this.nestedIframeListeners.get(e);t&&(ge((()=>e.removeEventListener("message",t))),this.nestedIframeListeners.delete(e)),this.crossOriginIframeMap.delete(e)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)){var s=this.nestedIframeListeners.get(i);ge((()=>i.removeEventListener("message",s))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var o=this.attachedDocuments.get(r);o&&(o.forEach((e=>{ge((()=>this.mirror.removeNodeFromMap(e)))})),ge((()=>Je(r,o))),this.attachedDocuments.delete(r))}t&&this.attachedIframes.delete(e)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var e=[];this.attachedIframes.forEach(((t,r)=>{this.mirror.has(r)||e.push(r)})),e.forEach((e=>this.removeIframeById(e)))}}reattachIframes(){this.attachedIframes.forEach(((e,t)=>{var{content:r}=e;this.mirror.has(t)?this.mutationCb({adds:[{parentId:t,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(t)}))}destroy(){this.recordCrossOriginIframes&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((e,t)=>{ge((()=>t.removeEventListener("message",e)))})),this.nestedIframeListeners.clear();var e=new Set;this.iframeElementsById.forEach((t=>e.add(t))),this.attachedIframes.forEach((t=>{var{element:r}=t;return e.add(r)})),e.forEach((e=>{this.disposeLoadListeners(e),this.removePageHideListener(e)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class at{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(E(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var{observer:i,buffer:n}=Ze(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>{i.disconnect(),n.destroy(),n.releaseCanvasManager();var e=We.indexOf(n);-1!==e&&We.splice(e,1)})),this.restoreHandlers.push(Qe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(tt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(S(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=C.shadowRoot(this);return s&&Ae(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ut="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ht=0;64>ht;ht++)ut[lt.charCodeAt(ht)]=ht;var dt=new Map,ct=(e,t,r)=>{if(e&&(pt(e,t)||"object"==typeof e)){var i=function(e,t){var r=dt.get(e);return r||dt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function vt(e,t,r,i){if(e instanceof Array)return e.map((e=>vt(e,t,r,i)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var n=e.constructor.name,s=function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;i>t;t+=3)n+=lt[r[t]>>2],n+=lt[(3&r[t])<<4|r[t+1]>>4],n+=lt[(15&r[t+1])<<2|r[t+2]>>6],n+=lt[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e);return{rr_type:n,base64:s}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[vt(e.buffer,t,r,i),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var o=e.constructor.name,{src:a}=e;return{rr_type:o,src:a}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL(i.type,i.quality)}:e instanceof ImageData?{rr_type:e.constructor.name,args:[vt(e.data,t,r,i),e.width,e.height]}:pt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ct(e,t,r)}:e}var ft=(e,t,r,i)=>e.map((e=>vt(e,t,r,i))),pt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))},gt=["webgl","webgl2"];function mt(e){return"nodeType"in e}function yt(e,t,i,n){var s=[];try{if(n){var o=function(e,t,i){var n=e.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return S(n.prototype,"configure",(function(n){return function(s){var o=function(e){var{canvas:t}=e;return t&&"object"==typeof t?t:null}(this);if(!o||mt(o)&&Ie(o,t,i,!0))return n.call(this,s);mt(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(e){var t=e.GPUTextureUsage;return t?t.COPY_SRC|t.RENDER_ATTACHMENT:null}(e);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(e,t,i);o&&s.push(o)}var a=S(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var s=function(e){return"experimental-webgl"===e?"webgl":e}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Ie(this,t,i,!0)&&("__context"in this||(this.__context=s),n&&gt.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return e.apply(this,[r,...a])}}));s.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((e=>e()))}}function bt(e,t,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(e),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof e[l])return 0;var u=S(e,l,(function(e){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=e.apply(this,u);if(ct(d,s,this),"tagName"in this.canvas&&!Ie(this.canvas,i,n,!0)){var c=ft(u,s,this,o);r(this.canvas,{type:t,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=_e(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var _t,wt,xt,kt='(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 transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\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 { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, displayWidth, displayHeight });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, displayWidth, displayHeight });\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-CSpkoNCs.js.map\n',St="undefined"!=typeof self&&self.Blob&&new Blob([kt],{type:"text/javascript;charset=utf-8"});function Ct(e){var t;try{if(!(t=St&&(self.URL||self.webkitURL).createObjectURL(St)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(kt),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class It{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o,resolutionScale:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o,resolutionScale:l})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,l=yt(r,i,n,!0),u=new Map,h=new Ct;h.onmessage=e=>{var{id:t}=e.data;if(u.set(t,!1),"base64"in e.data){var{base64:r,type:i,displayWidth:n,displayHeight:s}=e.data;this.mutationCb({id:t,type:c["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0,n,s]}],displayWidth:n,displayHeight:s})}};var d,v=1e3/e,f=0,p=e=>{var l,c;f&&v>e-f||(f=e,(l=[],c=e=>{try{e.querySelectorAll("canvas").forEach((e=>{Ie(e,i,n,!0)||l.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&c(e.shadowRoot)}))}catch(e){}},c(r.document),l).forEach(function(){var e=t((function*(e){var t,r,i=o.mirror.getId(e);if(!u.get(i)&&0!==e.width&&0!==e.height){u.set(i,!0);try{if(["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);if(null==(t=null==n?void 0:n.isContextLost)?void 0:t.call(n))return void u.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var l=e.clientWidth||e.width,d=e.clientHeight||e.height,c=Math.max(1,Math.round(l*a)),v=Math.max(1,Math.round(d*a)),f=yield createImageBitmap(e,1>a?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});h.postMessage({id:i,bitmap:f,width:c,height:v,displayWidth:l,displayHeight:d,dataURLOptions:s.dataURLOptions},[f])}catch(e){u.set(i,!1)}}}));return function(t){return e.apply(this,arguments)}}())),d=requestAnimationFrame(p)};d=requestAnimationFrame(p),this.resetObservers=()=>{l(),cancelAnimationFrame(d)}}}initCanvasMutationObserver(e,t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=yt(e,t,r,!1),s=function(e,t,r,i,n){var s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return 1;var a=S(t.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Ie(this.canvas,r,i,!0)||setTimeout((()=>{var r=ft(l,t,this,n);e(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=_e(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:c["2D"],property:o,args:[t],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i),o=function(e,t,r,i,n){var s=[];return void 0!==t.WebGLRenderingContext&&s.push(...bt(t.WebGLRenderingContext.prototype,c.WebGL,e,r,i,t,n)),void 0!==t.WebGL2RenderingContext&&s.push(...bt(t.WebGL2RenderingContext.prototype,c.WebGL2,e,r,i,t,n)),()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,this.rafIdTimestamp=requestAnimationFrame(e)};this.rafIdTimestamp=requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,s))),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Tt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Le),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:P(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,oe.forEach((e=>e.abort())),oe.clear()}trackStylesheetInLinkElement(e){}}class Et{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Mt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Pt=document.createElement("iframe");document.body.appendChild(Pt),Array.from=(null==(n=Pt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pt)}}catch(e){console.debug("Unable to override Array.from",e)}var Rt=new R;function Ot(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:h=null,maskTextClass:d="rr-mask",maskTextSelector:c=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:y,hooks:b,packFn:_,sampling:w={},dataURLOptions:x={},canvasResolutionScale:k,mousemoveWait:S,recordDOM:I=!0,recordCanvas:T=!1,recordCrossOriginIframes:E=!1,recordAfter:M=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:P=!1,collectFonts:O=!1,inlineImages:L=!1,plugins:F,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:D=new Set([]),errorHandler:N}=e;Ne=N;var q=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),j=!E||window.parent===window,B=!1;if(!j)try{window.parent.document&&(B=!1)}catch(e){B=!0}if(j&&!t)throw new Error("emit function is required");if(!j&&!B)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Rt.reset();var H,U=!0===f?{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!==p?p:{password:!0},z=ve(void 0!==g&&g);!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var V,W,G=0,Z=new Map,Q=e=>{for(var t of F||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!B&&(e=_(e)),e};_t=(e,r)=>{var s,o=e;if(o.timestamp=we(),!(null==(s=We[0])?void 0:s.isFrozen())||o.type===l.FullSnapshot||o.type===l.IncrementalSnapshot&&o.data.source===u.Mutation||We.forEach((e=>e.unfreeze())),j)null==t||t(Q(o),r);else if(B){var a={type:"rrweb",event:Q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===l.FullSnapshot)H=o,G=0;else if(o.type===l.IncrementalSnapshot){if(o.data.source===u.Mutation&&o.data.isAttachIframe)return;G++,(n&&G>=n||i&&o.timestamp-H.timestamp>i)&&wt(!0)}};var J=e=>{if(e.removes&&e.removes.length>0){var t=e.adds.length>0?new Set(e.adds.map((e=>e.node.id))):null,i=new Set;if(e.adds.length>0)for(var n of e.adds){var s=Rt.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}e.removes.forEach((e=>{var{id:r}=e;if(!t||!t.has(r)){var n=ee.getIframeElementById(r);n&&i.has(n)?ee.forgetIframeId(r):(null==V||V(r),ee.removeIframeById(r))}})),null==W||W(),ee.cleanupDetachedIframes()}_t({type:l.IncrementalSnapshot,data:r({source:u.Mutation},e)})},Y=e=>_t({type:l.IncrementalSnapshot,data:r({source:u.Scroll},e)}),K=e=>_t({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},e)}),X=new Tt({mutationCb:J,adoptedStyleSheetCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},e)})}),ee=new ot({mirror:Rt,mutationCb:J,stylesheetManager:X,recordCrossOriginIframes:E,wrappedEmit:_t});for(var te of F||[])te.getMirror&&te.getMirror({nodeMirror:Rt,crossOriginIframeMirror:ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:ee.crossOriginIframeStyleMirror});var re=new Et;xt=new It({recordCanvas:T,mutationCb:K,win:window,blockClass:s,blockSelector:o,mirror:Rt,sampling:w.canvas,dataURLOptions:q,resolutionScale:k});var ie=new at({mutationCb:J,scrollCb:Y,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:d,maskTextSelector:c,inlineStylesheet:v,maskInputOptions:U,dataURLOptions:q,maskTextFn:y,maskInputFn:m,recordCanvas:T,inlineImages:L,sampling:w,slimDOMOptions:z,iframeManager:ee,stylesheetManager:X,canvasManager:xt,keepIframeSrcFn:A,processedNodeManager:re},mirror:Rt});wt=function(e){if(void 0===e&&(e=!1),I){_t({type:l.Meta,data:{href:window.location.href,width:Se(),height:ke()}},e),X.reset(),ie.init(),We.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new R,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:c,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x=(()=>!1),maxDepth:k}=t||{};return ce(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{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===h?{password:!0}:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:ve(v),dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x,newlyAddedElement:!1,maxDepth:k})}(document,{mirror:Rt,blockClass:s,blockSelector:o,maskTextClass:d,maskTextSelector:c,inlineStylesheet:v,maskAllInputs:U,maskTextFn:y,maskInputFn:m,slimDOM:z,dataURLOptions:q,recordCanvas:T,inlineImages:L,onSerialize(e){Pe(e,Rt)&&ee.addIframe(e),Re(e,Rt)&&X.trackLinkElement(e),Oe(e)&&ie.addShadowRoot(C.shadowRoot(e),document)},onIframeLoad(e,t){ee.attachIframe(e,t),ie.observeAttachShadow(e)},onIframeListenerRegistered(e,t){ee.registerLoadListenerDisposer(e,t)},onStylesheetLoad(e,t){X.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");_t({type:l.FullSnapshot,data:{node:t,initialOffset:xe(window)}},e),We.forEach((e=>e.unlock())),E&&ee.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,Rt.getId(document))}};try{var ne=[];V=e=>{var t=Z.get(e);t&&(t.forEach((e=>{ge(e);var t=ne.indexOf(e);-1!==t&&ne.splice(t,1)})),Z.delete(e))},W=()=>{for(var[e]of Z){var t=Rt.getNode(e);if(t)try{t.contentDocument&&t.contentDocument.defaultView||null==V||V(e)}catch(t){null==V||V(e)}else null==V||V(e)}};var se=e=>{var t;return Ve(rt)({mutationCb:J,mousemoveCb:(e,t)=>_t({type:l.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},e)}),scrollCb:Y,viewportResizeCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},e)}),inputCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.Input},e)}),mediaInteractionCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},e)}),styleSheetRuleCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},e)}),styleDeclarationCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},e)}),canvasMutationCb:K,fontCb:e=>_t({type:l.IncrementalSnapshot,data:r({source:u.Font},e)}),selectionCb(e){_t({type:l.IncrementalSnapshot,data:r({source:u.Selection},e)})},customElementCb(e){_t({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:h,maskTextClass:d,maskTextSelector:c,maskInputOptions:U,inlineStylesheet:v,sampling:w,recordDOM:I,recordCanvas:T,inlineImages:L,userTriggeredOnInput:P,collectFonts:O,doc:e,maskInputFn:m,maskTextFn:y,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:z,dataURLOptions:q,mirror:Rt,iframeManager:ee,stylesheetManager:X,shadowDomManager:ie,processedNodeManager:re,canvasManager:xt,ignoreCSSAttributes:D,plugins:(null==(t=null==F?void 0:F.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>_t({type:l.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},b)};ee.addLoadListener((e=>{try{var t=Rt.getId(e),r=se(e.contentDocument);if(ne.push(r),-1!==t){var i=Z.get(t);i||Z.set(t,i=new Set),i.add(r)}}catch(e){console.warn(e)}})),ee.addPageHideListener((e=>{var t=Rt.getId(e);null==V||V(t),Je(e)}));var oe=-1,ae=e=>_t({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:e}}),le=()=>{var e,t,r,i,n=document,s=null!==(e=null!==(t=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==t?t:n.msFullscreenElement)&&void 0!==e?e:null,o=s?Rt.getId(s):-1;o!==oe&&(-1!==oe&&ae({id:oe,enter:!1}),oe=o,-1!==o&&ae({id:o,enter:!0}))},ue=()=>{wt(),ne.push(se(document)),ne.push(pe("fullscreenchange",le)),ne.push(pe("webkitfullscreenchange",le)),ne.push(pe("mozfullscreenchange",le)),ne.push(pe("MSFullscreenChange",le)),Mt=!0};return["interactive","complete"].includes(document.readyState)?ue():(ne.push(pe("DOMContentLoaded",(()=>{_t({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===M&&ue()}))),ne.push(pe("load",(()=>{_t({type:l.Load,data:{}}),"load"===M&&ue()}),window))),()=>{ne.forEach((e=>ge(e))),re.destroy(),ee.removeLoadListener(),ee.destroy(),Z.clear(),Rt.reset(),Mt=!1,Ne=void 0}}catch(e){console.warn(e)}}Ot.addCustomEvent=(e,t)=>{if(!Mt)throw new Error("please add custom event after start recording");_t({type:l.Custom,data:{tag:e,payload:t}})},Ot.freezePage=()=>{We.forEach((e=>e.freeze()))},Ot.takeFullSnapshot=e=>{if(!Mt)throw new Error("please take full snapshot after start recording");wt(e)},Ot.mirror=Rt;var Lt=Object.defineProperty,Ft=(e,t,r)=>((e,t,r)=>t in e?Lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class At{constructor(e){Ft(this,"fileName"),Ft(this,"functionName"),Ft(this,"lineNumber"),Ft(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var $t=/(^|@)\S+:\d+/,Dt=/^\s*at .*(\S+:\d+|\(native\))/m,Nt=/^(eval@)?(\[native code])?$/,qt={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Dt)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):[]:[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Dt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new At({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Nt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new At({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new At({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new At({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new At({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match($t)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new At({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function jt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Bt(e){return Array.isArray(e)}function Ht(e){return"object"==typeof e&&null!==e&&!Bt(e)}function Ut(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Ht(e[i])&&Ut(e[i],t-1))return!0;return!1}function zt(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Ht(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Ht(o)&&Ut(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=Bt(u)?jt(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Vt={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 Wt(e,t,r){var i,n=r?Object.assign({},Vt,r):Vt,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=qt.parse(t.error).map((e=>e.toString())),s=[zt(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[zt("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[zt("Uncaught (in promise)",n.stringifyOptions),zt(t.reason,n.stringifyOptions)]);var s=qt.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((e=>e()))};function c(t,r){var i=this;return t[r]?function(t,s,l){try{if(!(s in t))return()=>{};var u=t[s],h=(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=qt.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>zt(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[zt("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})(u);return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u}})),t[s]=h,()=>{t[s]=u}}catch(e){return()=>{}}}(t,r):()=>{}}}var Gt=e=>({name:"rrweb/console@1",observer:Wt,options:e}),Zt=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Qt(e){return"string"==typeof e||e}function Jt(e){return"string"==typeof e?e:void 0}var Yt,Kt=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),Xt=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),er=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),tr=["$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"],rr=["token"],ir="NativeGzipValidationError",nr=e=>e.length>=2&&31===e[0]&&139===e[1],sr=(e,t)=>e===Xt.GZipJS||t===Xt.GZipJS||"gzip"===t,or=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),ar=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=ir,t},lr=function(){var e=t((function*(e,t){18>e.size&&ar("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());nr(r)&&8===r[2]||ar("invalid-header");var i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(Yt)return Yt;Yt=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;Yt[e]=t>>>0}return Yt})(),r=4294967295,i=0;e.length>i;i++)r=t[255&(r^e[i])]^r>>>8;return(4294967295^r)>>>0})(t)&&ar("invalid-crc");var n=t.length>>>0;i.getUint32(4,!0)!==n&&ar("invalid-size")}));return function(t,r){return e.apply(this,arguments)}}();function ur(){return ur=t((function*(e,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(e),s=new CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var e=t((function*(e){try{yield o.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),l=new Response(s.readable).blob(),[u]=yield Promise.all([l,a]);return yield lr(u,n),u}catch(e){if(null!=i&&i.rethrow)throw e;return r&&console.error("Failed to gzip compress data",e),null}})),ur.apply(this,arguments)}var hr=["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"],dr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return hr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};function cr(e,t){return-1!==e.indexOf(t)}var vr=function(e){return e.trim()},fr=function(e){return e.replace(/^\$/,"")},pr=Object.prototype,gr=pr.hasOwnProperty,mr=pr.toString,yr=Array.isArray||function(e){return"[object Array]"===mr.call(e)},br=e=>"function"==typeof e,_r=e=>e===Object(e)&&!yr(e),wr=e=>{if(_r(e)){for(var t in e)if(gr.call(e,t))return!1;return!0}return!1},xr=e=>void 0===e,kr=e=>"[object String]"==mr.call(e),Sr=e=>kr(e)&&0===e.trim().length,Cr=e=>null===e,Ir=e=>xr(e)||Cr(e),Tr=e=>"[object Number]"==mr.call(e)&&e==e,Er=e=>Tr(e)&&e>0,Mr=e=>"[object Boolean]"===mr.call(e),Pr=e=>e instanceof FormData,Rr=e=>cr(rr,e);function Or(e){return null===e||"object"!=typeof e}function Lr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Fr(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var Ar=[!0,"true",1,"1","yes"],$r=e=>cr(Ar,e),Dr=[!1,"false",0,"0","no"];function Nr(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Tr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Nr(n||r,t,r,i))}class qr{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=Nr(e.bucketSize,0,100,e.Ae),this.$e=Nr(e.refillRate,0,this.Fe,e.Ae),this.De=Nr(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var r=Math.floor((t-e.lastAccess)/this.De);r>0&&(e.tokens=Math.min(e.tokens+r*this.$e,this.Fe),e.lastAccess=e.lastAccess+r*this.De)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.Ee[i];return n?this.Ne(n,r):this.Ee[i]=n={tokens:this.Fe,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.Pe)||t.call(this,e)),0===n.tokens)}stop(){this.Ee={}}}var jr="Mobile",Br="iOS",Hr="Android",Ur="Tablet",zr=Hr+" "+Ur,Vr="iPad",Wr="Apple",Gr=Wr+" Watch",Zr="Safari",Qr="BlackBerry",Jr="Samsung",Yr=Jr+"Browser",Kr=Jr+" Internet",Xr="Chrome",ei=Xr+" OS",ti=Xr+" "+Br,ri="Internet Explorer",ii=ri+" "+jr,ni="Opera",si=ni+" Mini",oi="Edge",ai="Microsoft "+oi,li="Firefox",ui=li+" "+Br,hi="Nintendo",di="PlayStation",ci="Xbox",vi=Hr+" "+jr,fi=jr+" "+Zr,pi="Windows",gi=pi+" Phone",mi="Nokia",yi="Ouya",bi="Generic",_i=bi+" "+jr.toLowerCase(),wi=bi+" "+Ur.toLowerCase(),xi="Konqueror",ki="Oculus Browser",Si="Vivaldi",Ci="Yandex",Ii="Whale",Ti="DuckDuckGo",Ei="Pale Moon",Mi="Waterfox",Pi="Brave",Ri="Google Search App",Oi="(\\d+(\\.\\d+)?)",Li=new RegExp("Version/"+Oi),Fi=new RegExp(ci,"i"),Ai=new RegExp(di+" \\w+","i"),$i=new RegExp(hi+" \\w+","i"),Di=new RegExp(Qr+"|PlayBook|BB10","i"),Ni={"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"},qi=function(e,t,r,i){t=t||"";var n=function(e){return null!=e&&e.brave?Pi:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&cr(e,"GSA/")?Ri:cr(e," OPR/")&&cr(e,"Mini")?si:cr(e," OPR/")?ni:Di.test(e)?Qr:cr(e,"IE"+jr)||cr(e,"WPDesktop")?ii:cr(e,"OculusBrowser")?ki:cr(e,Yr)?Kr:cr(e,oi)||cr(e,"Edg/")?ai:cr(e,Si+"/")?Si:cr(e,"YaBrowser/")?Ci:cr(e,Ii+"/")?Ii:cr(e,Ti+"/")||cr(e,"Ddg/")?Ti:cr(e,"FBIOS")?"Facebook "+jr:cr(e,"UCWEB")||cr(e,"UCBrowser")?"UC Browser":cr(e,"CriOS")?ti:cr(e,"CrMo")||cr(e,Xr)?Xr:cr(e,Hr)&&cr(e,Zr)?vi:cr(e,"FxiOS")?ui:cr(e.toLowerCase(),xi.toLowerCase())?xi:cr(e,Pi+"/")?Pi:((e,t)=>t&&cr(t,Wr)||function(e){return cr(e,Zr)&&!cr(e,Xr)&&!cr(e,Hr)}(e))(e,t)?cr(e,jr)?fi:Zr:cr(e,"PaleMoon/")?Ei:cr(e,Mi+"/")?Mi:cr(e,li)?li:cr(e,"MSIE")||cr(e,"Trident/")?ri:cr(e,"Gecko")?li:"")},ji={[ii]:[new RegExp("rv:"+Oi)],[ai]:[new RegExp(oi+"?\\/"+Oi)],[Xr]:[new RegExp("("+Xr+"|CrMo)\\/"+Oi)],[ti]:[new RegExp("CriOS\\/"+Oi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Oi)],[Zr]:[Li],[fi]:[Li],[ni]:[new RegExp("(Opera|OPR)\\/"+Oi)],[li]:[new RegExp(li+"\\/"+Oi)],[ui]:[new RegExp("FxiOS\\/"+Oi)],[xi]:[new RegExp("Konqueror[:/]?"+Oi,"i")],[Qr]:[new RegExp(Qr+" "+Oi),Li],[vi]:[new RegExp("android\\s"+Oi,"i")],[Kr]:[new RegExp(Yr+"\\/"+Oi)],[ki]:[new RegExp("OculusBrowser\\/"+Oi)],[Si]:[new RegExp(Si+"\\/"+Oi)],[Ci]:[new RegExp("YaBrowser\\/"+Oi)],[Ii]:[new RegExp(Ii+"\\/"+Oi)],[Pi]:[new RegExp(Pi+"\\/"+Oi)],[Ti]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Oi)],[Ei]:[new RegExp("PaleMoon\\/"+Oi)],[Mi]:[new RegExp(Mi+"\\/"+Oi)],[Ri]:[new RegExp("GSA\\/"+Oi)],[ri]:[new RegExp("(rv:|MSIE )"+Oi)],Mozilla:[new RegExp("rv:"+Oi)]},Bi=function(e,t,r,i){var n=qi(e,t,r,i),s=ji[n];if(xr(s))return null;for(var o=0;s.length>o;o++){var a=e.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},Hi=[[new RegExp(ci+"; "+ci+" (.*?)[);]","i"),e=>[ci,e&&e[1]||""]],[new RegExp(hi,"i"),[hi,""]],[new RegExp(di,"i"),[di,""]],[Di,[Qr,""]],[new RegExp(pi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[gi,""];if(new RegExp(jr).test(t)&&!/IEMobile\b/.test(t))return[pi+" "+jr,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=Ni[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[pi,i]}return[pi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Br,[e[3],e[4],e[5]||"0"].join(".")]:[Br,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=xr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Hr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Hr+")","i"),e=>e&&e[2]?[Hr,[e[2],e[3],e[4]||"0"].join(".")]:[Hr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ei,""]],[/Linux|debian/i,["Linux",""]]],Ui=function(e){return $i.test(e)?hi:Ai.test(e)?di:Fi.test(e)?ci:new RegExp(yi,"i").test(e)?yi:new RegExp("("+gi+"|WPDesktop)","i").test(e)?gi:/iPad/.test(e)?Vr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Gr:Di.test(e)?Qr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(mi,"i").test(e)?mi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(jr).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Hr:zr:new RegExp("(pda|"+jr+")","i").test(e)?_i:new RegExp(Ur,"i").test(e)&&!new RegExp(Ur+" pc","i").test(e)?wi:""},zi=function(e,t){var r,i,n,s,o=Ui(e);return o===Vr||o===zr||"Kobo"===o||"Kindle Fire"===o||o===wi?Ur:o===hi||o===ci||o===di||o===yi?"Console":o===Gr?"Wearable":o?jr:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?jr:Ur:"Desktop"},Vi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Wi(e,t){return"string"==typeof(r=e)&&Vi.test(r)?e:t();var r}function Gi(e){return e?e.split("#")[0]:e}function Zi(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var Qi={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}},Ji=Qi.info;function Yi(e){if(Mr(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(yr(e))return{arrayValue:{values:e.map((e=>Yi(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function Ki(e){var t=[];for(var r in e){var i=e[r];Cr(i)||xr(i)||t.push({key:r,value:Yi(i)})}return t}function Xi(e,t){var i=e.level||"info",{text:n,number:s}=Qi[i]||Ji,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),Ir(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),Ir(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:Ki(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),xr(e.trace_flags)||(u.flags=e.trace_flags),u}function en(e,t,i){return r({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}function tn(e,t,r,i){return{resourceLogs:[{resource:{attributes:Ki(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}let rn=class{constructor(e,t,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=r,this.qe=i,this.je=n,this.Be=s,this.He=o,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.it(e);if(null!==t)if(t.body){if(this.nt()){var r={record:Xi(t,this.qe())};this.je((()=>this.st(r)))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(e){var t=this.Se.beforeSend;if(!t)return e;var r=yr(t)?t:[t],i=e;for(var n of r)try{var s=n(i);if(!s)return this.Ae.info("Log was rejected in beforeSend function"),null;i=s}catch(e){return this.Ae.error("Error in beforeSend function for log:",e),null}return i}nt(){if(void 0===this.et)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var e=this;return t((function*(){if(!e._instance.isDisabled)return e.Ue||(e.Ue=e.ot().finally((()=>{e.Ue=null}))),e.Ue}))()}ot(){var e=this;return t((function*(){var t;e.tt();var r=null!==(t=e._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==t?t:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;e.ze=0;var a=Math.min(r.length,e.Ke),l=r.slice(0,a),u=l.map((e=>e.record)),h=tn(u,e.ut(),null!==(s=e.He)&&void 0!==s?s:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.ht(h);if("too-large"===d.kind&&l.length>1)e.Ke=Math.max(1,Math.floor(l.length/2)),e.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ke);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?e.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(l.length),r=null!==(o=e._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}dt(e){var r=this;return t((function*(){var t,i=Math.max(0,e-r.ze),n=null!==(t=r._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==t?t:[];r._instance.setPersistedProperty(Kt.LogsQueue,n.slice(i)),yield r.Be()}))()}ut(){return en(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){var t;if(!this._instance.optedOut){var r=null!==(t=this._instance.getPersistedProperty(Kt.LogsQueue))&&void 0!==t?t:[];this.Je>r.length||(r.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(Kt.LogsQueue,r),this.Qe>r.length?this.ct():this.rt()}}ct(e){void 0===e&&(e=this.Ye),this.vt||(this.vt=Zi((()=>{this.vt=void 0,this.rt()}),e))}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*Math.pow(2,e)}yt(){var e=this._instance.getPersistedProperty(Kt.LogsQueue);return!!e&&e.length>0}shutdown(e){var r=this;return t((function*(){r.tt();var t=r.flush().catch((()=>{}));void 0!==e?yield Promise.race([t,new Promise((t=>Zi(t,e)))]):yield t}))()}flushWithTimeout(e){var r=this;return t((function*(){var t=!1,i=r.flush(),n=new Promise((r=>Zi((()=>{t=!0,r()}),e)));try{yield Promise.race([i,n])}finally{t&&i.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.Ve=0}),(e=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",e)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};function nn(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}var sn,on,an;function ln(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return an&&r.length===on||(on=r.length,an=r.reduce(((r,i)=>{sn||(sn={});var n=sn[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,sn[i]=[l,u];break}}return r}),{})),an}}class un{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&yr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:ln(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var hn="?";function dn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?hn:r,in_app:!0};return xr(i)||(s.lineno=i),xr(n)||(s.colno=n),s}var cn=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:hn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},vn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,fn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pn=/\((\S*)(?::(\d+))(?::(\d+))\)/,gn=(e,t)=>{var r=vn.exec(e);if(r){var[,i,n,s]=r;return dn(t,i,hn,+n,+s)}var o=fn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=pn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=cn(o[1]||hn,o[2]);return dn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},mn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bn=(e,t)=>{var r=mn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=yn.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]||hn;return[s,n]=cn(s,n),dn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},_n=/\(error: (.*)\)/,wn=50;class xn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=kr(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return Lr(e,"DOMException")}isDOMError(e){return Lr(e,"DOMError")}}class kn{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Sn{constructor(){}match(e){return Lr(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var Cn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class In{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(Cn);return i&&(t=i[1],r=i[2]),[t,r]}}var Tn=["fatal","error","warning","log","info","debug"];function En(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Mn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Fr(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+En(e)}isSeverityLevel(e){return kr(e)&&!Sr(e)&&Tn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Pn{match(e){return Fr(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+En(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Rn{match(e){return Or(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class On{match(e){return Lr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Fr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return Or(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Ln="$message",Fn="$timestamp",An=new Set([Ln,Fn]),$n={enabled:!0,max_bytes:32768};function Dn(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:$n.enabled,max_bytes:qn(e.max_bytes,$n.max_bytes)}:r({},$n)}class Nn{constructor(e){this.bt=[],this._t=0,this.Se=Dn(e)}setConfig(e){this.Se=Dn(e),this.wt()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}}))}catch(e){return}}(e);if(t)try{var r=JSON.parse(t);if(!_r(r))return;var i=r,n=i[Ln],s=i[Fn];if(!kr(n)||0===n.trim().length)return;if(!kr(s)&&!Tr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this.Se.max_bytes||(this.bt.push({step:t.step,bytes:r}),this._t+=r,this.wt())}}getAttachable(){return this.bt.map((e=>e.step))}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}}function qn(e,t){if(!Tr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var jn="undefined"!=typeof window?window:void 0,Bn="undefined"!=typeof globalThis?globalThis:jn;"undefined"==typeof self&&(Bn.self=Bn),"undefined"==typeof File&&(Bn.File=function(){});var Hn=null==Bn?void 0:Bn.navigator,Un=null==Bn?void 0:Bn.document,zn=null==Bn?void 0:Bn.location,Vn=null==Bn?void 0:Bn.fetch,Wn=null!=Bn&&Bn.XMLHttpRequest&&"withCredentials"in new Bn.XMLHttpRequest?Bn.XMLHttpRequest:void 0,Gn=null==Bn?void 0:Bn.AbortController,Zn=null==Bn?void 0:Bn.CompressionStream,Qn=null==Hn?void 0:Hn.userAgent,Jn=null!=jn?jn:{},Yn=e=>e instanceof Document,Kn="1.396.3",Xn={DEBUG:!1,LIB_VERSION:Kn,LIB_NAME:"web",JS_SDK_VERSION:Kn},es=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={k(t){if(jn&&(Xn.DEBUG||Jn.POSTHOG_DEBUG||r)&&!xr(jn.console)&&jn.console){for(var i=("__rrweb_original__"in jn.console[t]?jn.console[t].__rrweb_original__:jn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.k("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>es(e+" "+t,r)};return i},ts=es("[PostHog.js]"),rs=ts.createLogger;function is(e,t){yr(e)&&e.forEach(t)}function ns(e,t){if(!Ir(e))if(yr(e))e.forEach(t);else if(Pr(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)gr.call(e,r)&&t(e[r],r)}var ss=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function os(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var as=function(e){try{return e()}catch(e){return}},ls=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){ts.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ts.critical(e)}}},us=function(e){var t={};return ns(e,(function(e,r){(kr(e)&&e.length>0||Tr(e))&&(t[r]=e)})),t};var hs=["herokuapp.com","vercel.app","netlify.app"];function ds(e){var t=null==e?void 0:e.hostname;if(!kr(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of hs)if(r===i)return!1;return!0}function cs(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}function vs(e){return"ph_toolbar_internal"===e.name}var fs=e=>{var t=null==Un?void 0:Un.createElement("a");return xr(t)?null:(t.href=e,t)},ps=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return ns(e,(function(e,t){xr(e)||xr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},gs=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!yr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){ts.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},ms=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");yr(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},ys=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function bs(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return br(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]===n&&(e[t]=i)}}catch(e){return()=>{}}}function _s(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function ws(e,t){var r,i=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!br(i))return t;try{var n=i(t);return kr(n)&&n?n:t}catch(e){return ts.error("Error in get_current_url, falling back to window.location.href",e),t}}function xs(e){var t,r=null==jn||null==(t=jn.location)?void 0:t.href;return xr(r)?void 0:ws(e,r)}var ks="$people_distinct_id",Ss="$device_id",Cs="$device_model",Is="__alias",Ts="__timers",Es="$autocapture_disabled_server_side",Ms="$heatmaps_enabled_server_side",Ps="$exception_capture_enabled_server_side",Rs="$error_tracking_suppression_rules",Os="$error_tracking_capture_extension_exceptions",Ls="$web_vitals_enabled_server_side",Fs="$dead_clicks_enabled_server_side",As="$product_tours_enabled_server_side",$s="$web_vitals_allowed_metrics",Ds="$session_recording_remote_config",Ns="$replay_sample_rate",qs="$replay_override_sampling",js="$replay_override_linked_flag",Bs="$replay_override_url_trigger",Hs="$replay_override_event_trigger",Us="$sesid",zs="$session_is_sampled",Vs="$enabled_feature_flags",Ws="$active_feature_flags",Gs="$early_access_features",Zs="$feature_flag_details",Qs="$feature_flag_payloads",Js="$feature_flag_request_id",Ys="$override_feature_flags",Ks="$override_feature_flag_payloads",Xs="$stored_person_properties",eo="$stored_group_properties",to="$surveys",ro="$surveys_loaded_at",io="$surveys_activated",no="ph_product_tours",so="$flag_call_reported",oo="$flag_call_reported_session_id",ao="$feature_flag_errors",lo="$feature_flag_evaluated_at",uo="$user_state",ho="$client_session_props",co="$capture_rate_limit",vo="$initial_campaign_params",fo="$initial_referrer_info",po="$initial_person_info",go="$epp",mo="__POSTHOG_TOOLBAR__",yo="$posthog_cookieless",bo="$sdk_debug_extensions_init_method",_o="$sdk_debug_extensions_init_time_ms",wo="$sdk_debug_recording_script_not_loaded",xo="PostHog loadExternalDependency extension not found.",ko="on_reject",So="always",Co="anonymous",Io="identified",To="identified_only",Eo="visibilitychange",Mo="beforeunload",Po="$pageview",Ro="$pageleave",Oo="$identify",Lo="$groupidentify",Fo=1,Ao=3,$o=11;function Do(e){return e instanceof Element&&(e.id===mo||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function No(e){return!!e&&e.nodeType===Fo}function qo(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function jo(e){return!!e&&e.nodeType===Ao}function Bo(e){return!!e&&e.nodeType===$o&&No(e.host)}function Ho(e){return e?vr(e).split(/\s+/):[]}function Uo(e,t){var r=xs(t);return!!(r&&e&&e.some((e=>r.match(e))))}function zo(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Ho(t)}function Vo(e){return Ir(e)?null:vr(e).split(/(\s+)/).filter((e=>pa(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wo(e){var t="";return aa(e)&&!la(e)&&e.childNodes&&e.childNodes.length&&ns(e.childNodes,(function(e){var r;jo(e)&&e.textContent&&(t+=null!==(r=Vo(e.textContent))&&void 0!==r?r:"")})),vr(t)}function Go(e){return xr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Zo=["a","button","form","input","select","textarea","label"];function Qo(e,t){if(xr(t))return!0;var r,i=function(e){if(t.some((t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function Jo(e){var t=e.parentNode;return!(!t||!No(t))&&t}var Yo=[".ph-no-autocapture","[data-ph-no-autocapture]"],Ko=["next","previous","prev",">","<"],Xo=[...Ko,"+","-","−","–"],ea=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,ta=[".ph-no-deadclick",".ph-no-capture"],ra=[".ph-no-rageclick",".ph-no-capture"],ia=["","text","search","email","password","url","tel","number"];function na(e,t){if(!jn||sa(e))return!1;var r,i,n,s,o;if(Mr(t)?(r=!!t&&ra,i=void 0,n=!1):(r=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:ra,i=null==t?void 0:t.content_ignorelist,n=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(e){return!(!e||!No(e))&&(!!qo(e,"textarea")||(qo(e,"input")?cr(ia,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var{targetElementList:a}=oa(e,!1);return!function(e,t){if(!1===e||xr(e))return!1;var r;if(!0===e)r=Ko;else{if(!yr(e))return!1;if(e.length>10)return ts.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>ea(t,e)||ea(i,e)))}))}(i,a.map((e=>{var t;return{safeText:Wo(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!Qo(a,r)}var sa=e=>!e||qo(e,"html")||!No(e),oa=(e,t)=>{if(!jn||sa(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!qo(n,"body");)if(Bo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Jo(n);if(!s)break;if(t||Zo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=jn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function aa(e){for(var t=e;t.parentNode&&!qo(t,"body");t=t.parentNode){var r=zo(t);if(cr(r,"ph-sensitive")||cr(r,"ph-no-capture"))return!1}if(cr(zo(e),"ph-include"))return!0;var i=e.type||"";if(kr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!kr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function la(e){return!!(qo(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qo(e,"select")||qo(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ua="(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})",ha=new RegExp("^(?:"+ua+")$"),da=new RegExp(ua),ca="\\d{3}-?\\d{2}-?\\d{4}",va=new RegExp("^("+ca+")$"),fa=new RegExp("("+ca+")");function pa(e,t){if(void 0===t&&(t=!0),Ir(e))return!1;if(kr(e)){if(e=vr(e),(t?ha:da).test((e||"").replace(/[- ]/g,"")))return!1;if((t?va:fa).test(e))return!1}return!0}function ga(e){var t=Wo(e);return pa(t=(t+" "+ma(e)).trim())?t:""}function ma(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ns(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Wo(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+ma(e)).trim())}catch(e){ts.error("[AutoCapture]",e)}})),t}function ya(e){return e.replace(/"|\\"/g,'\\"')}function ba(e){var t=e.attr__class;return t?yr(t)?t:Ho(t):void 0}var _a=1e6,wa={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:_a,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},xa=rs("[Recorder]"),ka=e=>"navigation"===e.entryType,Sa=e=>"resource"===e.entryType;function Ca(e,t){return!!t&&(Mr(t)||t[e])}function Ia(e){if("undefined"==typeof Request)return!1;if(e instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(e)}catch(e){return!1}}var Ta=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Ea(e){var{type:t,recordBody:r,headers:i,url:n}=e;function s(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.toLowerCase().includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:!!Ia(t)&&e(t.url)}catch(e){return!1}}(n))return!1;if(s(Ta))return!1;if(Mr(r))return!0;if(yr(r))return s(r);var o=r[t];return Mr(o)?o:s(o)}function Ma(e,t,r,i,n,s){return Pa.apply(this,arguments)}function Pa(){return Pa=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return xa.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(Sa(o=e[s])&&o.initiatorType===t&&(xr(i)||o.startTime>=i)&&(xr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),Ma(e,t,r,i,n,s+1))})),Pa.apply(this,arguments)}function Ra(e){var{body:t,options:r,url:i}=e;if(Ir(t))return null;var{hostname:n,isHostDenied:s}=_s(i,r);if(s)return n+" is in deny list";if(kr(t))return t;if(Yn(t))return t.textContent;if(Pr(t))return ps(t);if(_r(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Oa=e=>!Cr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function La(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:h}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:xr(a)?void 0:Math.round(a),endTime:xr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Oa(t))for(var f of t.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Fa=["video/","audio/"];function Aa(e){return _r(e)&&br(e.getReader)&&br(e.tee)}var $a=500,Da="[SessionReplay] Timeout while trying to read body",Na="[SessionReplay] Failed to read body";function qa(e){return Na+": "+e}function ja(e){return"[SessionReplay] Body too large to record (> "+e+" bytes)"}function Ba(e,t){if(!t.streamNetworkBody)return function(e){return new Promise((t=>{var r=setTimeout((()=>t(Da)),$a);try{e.clone().text().then((e=>t(e)),(e=>t(qa(e)))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t(Na)}}))}(e);var r=function(e){var t;return Math.min(_a,null!==(t=e.payloadSizeLimitBytes)&&void 0!==t?t:_a)}(t);return function(e,t){try{var r,i=null==(r=e.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>t}catch(e){return!1}}(e,r)?Promise.resolve(ja(r)):function(e,t){return new Promise((r=>{var i,n=!1;function s(){try{var e;null==(e=i)||e.cancel()}catch(e){}}function o(e){n||(n=!0,clearTimeout(l),s(),r(e))}var a,l=setTimeout((()=>o(Da)),$a);try{a=e.clone()}catch(e){return void o(Na)}var u=a.body;if(Aa(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(e){return void o(Na)}var h=[],d=0;!function e(){i.read().then((r=>{var{done:i,value:a}=r;if(n)s();else if(i)o((new TextDecoder).decode(function(e,t){var r=new Uint8Array(t),i=0;for(var n of e)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>t)return void o(ja(t));d+=a.byteLength,h.push(a)}e()}}),(e=>o(qa(e))))}()}else try{a.text().then((e=>o(e)),(e=>o(qa(e))))}catch(e){o(Na)}}))}(e,r)}function Ha(){return Ha=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=_s(i,r);return s?Promise.resolve(n+" is in deny list"):Ba(t,r)})),Ha.apply(this,arguments)}function Ua(){return Ua=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Fa.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=_s(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return Cr(n)?Ba(t,r):Promise.resolve(n)})),Ua.apply(this,arguments)}var za=null;function Va(e,i,n){if(!("performance"in i))return()=>{};if(za)return xa.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},wa,n):wa,o=t=>{var i=[];t.requests.forEach((e=>{var t=s.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>ka(e)||Sa(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>La({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>ka(e)||Sa(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>La({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ca("request",r.recordHeaders),n=Ca("response",r.recordHeaders),s=bs(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d,c,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=e=>(Ea({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Ra({body:e,options:r,url:a})),d=t.performance.now(),y(e));var b=()=>{v.removeEventListener("readystatechange",_),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},_=()=>{if(v.readyState===v.DONE){b(),c=t.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Ea({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Ra({body:v.response,options:r,url:a})),Ma(t,"xmlhttprequest",f.url,d,c).then((t=>{var r=La({entry:t,method:o,status:null==v?void 0:v.status,networkRequest:p,start:d,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ca("request",i.recordHeaders),s=Ca("response",i.recordHeaders),o=bs(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,h,d=new Request(t,a),c={};try{var v={};d.headers.forEach(((e,t)=>{v[t]=e})),n&&(c.requestHeaders=v),!Aa(null==a?void 0:a.body)&&Ea({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(c.requestBody=yield function(e){return Ha.apply(this,arguments)}({r:d,options:i,url:t})),u=r.performance.now(),l=Ia(t)?yield o(d):yield o(t,a),h=r.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),s&&(c.responseHeaders=f),Ea({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(c.responseBody=yield function(e){return Ua.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{Ma(r,"fetch",d.url,u,h).then((t=>{var r,i=La({entry:t,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:u,end:h,url:d.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),za=()=>{a(),l(),u(),za=null}}var Wa=e=>({name:"rrweb/network@1",observer:Va,options:e});Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Gt,getRecordNetworkPlugin:Wa},Jn.__PosthogExtensions__.rrweb={record:Ot,version:"v2",wasMaxDepthReached:()=>de,resetMaxDepthState(){de=!1,he=!1}},Jn.rrweb={record:Ot,version:"v2"},Jn.rrwebConsoleRecord={getRecordConsolePlugin:Gt},Jn.getRecordNetworkPlugin=Wa;var Ga,Za,Qa,Ja,Ya,Ka,Xa,el,tl,rl,il,nl,sl,ol,al,ll={},ul=[],hl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,dl=Array.isArray;function cl(e,t){for(var r in t)e[r]=t[r];return e}function vl(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function fl(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Ga.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return pl(e,o,i,n,null)}function pl(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Qa:n,__i:-1,__u:0};return null==n&&null!=Za.vnode&&Za.vnode(s),s}function gl(e){return e.children}function ml(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?$(e):null}function yl(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],n=[],s=cl({},t);s.__v=t.__v+1,Za.vnode&&Za.vnode(s),El(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,null==r?$(t):r,!!(32&t.__u),n),s.__v=t.__v,s.__.__k[s.__i]=s,Pl(i,s,n),t.__e=t.__=null,s.__e!=r&&bl(s)}}function bl(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some((function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e})),bl(e)}function _l(e){(!e.__d&&(e.__d=!0)&&Ja.push(e)&&!wl.__r++||Ya!=Za.debounceRendering)&&((Ya=Za.debounceRendering)||Ka)(wl)}function wl(){try{for(var e,t=1;Ja.length;)Ja.length>t&&Ja.sort(Xa),e=Ja.shift(),t=Ja.length,yl(e)}finally{Ja.length=wl.__r=0}}function xl(e,t,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||ul,b=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=pl(null,o,null,null,null):dl(o)?o=e.__k[s]=pl(gl,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=pl(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+c,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=Sl(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=$(a)),Fl(a,a));return i}(r,t,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||ll,v.__i=d,g=El(e,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&Ll(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=kl(v,l,e,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function kl(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=kl(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=$(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Sl(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function Cl(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||hl.test(t)?r:r+"px"}function Il(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Cl(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||Cl(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(il,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r[rl]=i[rl]:(r[rl]=nl,e.addEventListener(t,s?ol:sl,s)):e.removeEventListener(t,s?ol:sl,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Tl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[tl])t[tl]=nl++;else if(r[rl]>t[tl])return;return r(Za.event?Za.event(t):t)}}}function El(e,t,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(h=Za.__b)&&h(t);e:if("function"==typeof S)try{if(m=t.props,y=S.prototype&&S.prototype.render,b=(h=S.contextType)&&i[h.__c],$=h?b?b.props.value:h.__:i,r.__c?g=(d=t.__c=r.__c).__=d.__E:(y?t.__c=d=new S(m,$):(t.__c=d=new ml(m,$),d.constructor=S,d.render=Al),b&&b.sub(d),d.state||(d.state={}),d.__n=i,c=d.__d=!0,d.__h=[],d._sb=[]),y&&null==d.__s&&(d.__s=d.state),y&&null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=cl({},d.__s)),cl(d.__s,S.getDerivedStateFromProps(m,d.__s))),v=d.props,f=d.state,d.__v=t,c)y&&null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),y&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(y&&null==S.getDerivedStateFromProps&&m!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,$),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,$)){t.__v!=r.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),ul.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,$),y&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,f,p)}))}if(d.context=$,d.props=m,d.__P=e,d.__e=!1,_=Za.__r,w=0,y)d.state=d.__s,d.__d=!1,_&&_(t),h=d.render(d.props,d.state,d.context),ul.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,_&&_(t),h=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&25>++w);d.state=d.__s,null!=d.getChildContext&&(i=cl(cl({},i),d.getChildContext())),y&&!c&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(v,f)),x=null!=h&&h.type===gl&&null==h.key?Rl(h.props.children):h,a=xl(e,dl(x)?x:[x],t,r,i,n,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(k=s.length;k--;)vl(s[k]);Ml(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Ml(t);Za.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=Ol(r.__e,t,r,i,n,s,o,l,u);return(h=Za.diffed)&&h(t),128&t.__u?void 0:a}function Ml(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ml))}function Pl(e,t,r){for(var i=0;r.length>i;i++)Ll(r[i],r[++i],r[++i]);Za.__c&&Za.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Za.__e(e,t.__v)}}))}function Rl(e){return"object"!=typeof e||null==e||e.__b>0?e:dl(e)?e.map(Rl):void 0!==e.constructor?null:cl({},e)}function Ol(e,t,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||ll,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,s[u]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),a&&(Za.__m&&Za.__m(t,s),a=!1),s=null}if(null==y)g===m||a&&e.data==m||(e.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Ga.call(e.childNodes),!a&&null!=s)for(g={},u=0;e.attributes.length>u;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||Il(e,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||Il(e,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),xl("template"==t.type?e.content:e,dl(c)?c:[c],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&$(r,0),a,l),null!=s)for(u=s.length;u--;)vl(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Il(e,u,f,g[u],n),u="checked",null!=p&&p!=e[u]&&Il(e,u,p,g[u],n))}return e}function Ll(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Za.__e(e,r)}}function Fl(e,t,r){var i,n;if(Za.unmount&&Za.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Ll(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Za.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&Fl(i[n],t,r||"function"!=typeof e.type);r||vl(e.__e),e.__c=e.__=e.__e=void 0}function Al(e,t,r){return this.constructor(e,r)}function $l(e,t,r){var i,n,s;t==document&&(t=document.documentElement),Za.__&&Za.__(e,t),i=t.__k,n=[],s=[],El(t,e=t.__k=fl(gl,null,[e]),i||ll,ll,t.namespaceURI,i?null:t.firstChild?Ga.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),Pl(n,e,s)}Ga=ul.slice,Za={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Qa=0,ml.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=cl({},this.state),"function"==typeof e&&(e=e(cl({},r),this.props)),e&&cl(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),_l(this))},ml.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_l(this))},ml.prototype.render=gl,Ja=[],Ka="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Xa=function(e,t){return e.__v.__b-t.__v.__b},wl.__r=0,el=Math.random().toString(8),tl="__d"+el,rl="__a"+el,il=/(PointerCapture)$|Capture$/i,nl=0,sl=Tl(!1),ol=Tl(!0),al=0;var Dl,Nl,ql,jl,Bl=0,Hl=[],Ul=Za,zl=Ul.__b,Vl=Ul.__r,Wl=Ul.diffed,Gl=Ul.__c,Zl=Ul.unmount,Ql=Ul.__;function Jl(e,t){Ul.__h&&Ul.__h(Nl,e,Bl||t),Bl=0;var r=Nl.__H||(Nl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Yl(e){return Bl=1,function(e,t,r){var i=Jl(Dl++,2);if(i.t=e,!i.__c&&(i.__=[lu(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Nl,!Nl.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.some((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};Nl.__f=!0;var s=Nl.shouldComponentUpdate,o=Nl.componentWillUpdate;Nl.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},Nl.shouldComponentUpdate=n}return i.__N||i.__}(lu,e)}function Kl(e,t){var r=Jl(Dl++,3);!Ul.__s&&au(r.__H,t)&&(r.__=e,r.u=t,Nl.__H.__h.push(r))}function Xl(e){return Bl=5,eu((function(){return{current:e}}),[])}function eu(e,t){var r=Jl(Dl++,7);return au(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function tu(e){var t=Nl.context[e.__c],r=Jl(Dl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Nl)),t.props.value):e.__}function ru(){for(var e;e=Hl.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(su),t.__h.some(ou),t.__h=[]}catch(r){t.__h=[],Ul.__e(r,e.__v)}}}Ul.__b=function(e){Nl=null,zl&&zl(e)},Ul.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ql&&Ql(e,t)},Ul.__r=function(e){Vl&&Vl(e),Dl=0;var t=(Nl=e.__c).__H;t&&(ql===Nl?(t.__h=[],Nl.__h=[],t.__.some((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.some(su),t.__h.some(ou),t.__h=[],Dl=0)),ql=Nl},Ul.diffed=function(e){Wl&&Wl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Hl.push(t)&&jl===Ul.requestAnimationFrame||((jl=Ul.requestAnimationFrame)||nu)(ru)),t.__H.__.some((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),ql=Nl=null},Ul.__c=function(e,t){t.some((function(e){try{e.__h.some(su),e.__h=e.__h.filter((function(e){return!e.__||ou(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ul.__e(r,e.__v)}})),Gl&&Gl(e,t)},Ul.unmount=function(e){Zl&&Zl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some((function(e){try{su(e)}catch(e){t=e}})),r.__H=void 0,t&&Ul.__e(t,r.__v))};var iu="function"==typeof requestAnimationFrame;function nu(e){var t,r=function(){clearTimeout(i),iu&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);iu&&(t=requestAnimationFrame(r))}function su(e){var t=Nl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Nl=t}function ou(e){var t=Nl;e.__c=e.__(),Nl=t}function au(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function lu(e,t){return"function"==typeof t?t(e):t}var uu="events",hu="cancelEvents",du={Tab:"tab",Selector:"selector"},cu={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"},vu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},fu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},pu={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},gu={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},mu="always",yu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},bu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},_u="popover";function wu(e){return"$survey_response_"+e}function xu(e,t){if(!t)return null;var r=e[wu(t)];return yr(r)?[...r]:r}function ku(e,t){void 0===e&&(e={});var i={};return t.questions.forEach((t=>{if(!xr(t.originalQuestionIndex)){var r,n=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=xu(e,t.id);xr(s)||(i[n]=s)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:xu(e,t.id)})))},e,i)}function Su(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}function Cu(e){return"string"==typeof e&&e.trim()?e.trim():null}function Iu(e){return e.toLowerCase()}function Tu(e,t,r){if(!e||!t)return null;var i=Iu(t),n=Object.keys(e).find((e=>Iu(e)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(e).find((e=>Iu(e)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}function Eu(e,t,i){var n,s=Tu(e.translations,t,i),o=r({},e),a=!1;if(s){var l,u=null==(l=e.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),xr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),xr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),xr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),xr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),xr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),xr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(e){return!(xr(e.thankYouMessageHeader)&&xr(e.thankYouMessageDescription)&&xr(e.thankYouMessageCloseButtonText)&&xr(e.submitButtonText)&&xr(e.backButtonText))}(u)&&(a=!0))}var h=e.questions.map((e=>function(e,t,i){var n,s=Tu(e.translations,t,i);if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=null==(n=e.translations)?void 0:n[s];if(!o)return{question:e,matchedKey:null,hasChanges:!1};var a=r({},e),l=!1;return xr(o.question)||(a.question=o.question,l=!0),xr(o.description)||(a.description=o.description,l=!0),xr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!xr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!xr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!xr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(e){return yr(e.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:e,matchedKey:l?s:null,hasChanges:l}}(e,t,i))),d=h.map((e=>e.question)),c=h.some((e=>e.hasChanges)),v=null;return s||(v=(null==(n=h.find((e=>e.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+t)),{survey:o,matchedKey:a?s||v:null}}var Mu=rs("[Surveys]");function Pu(e){return!(!e.start_date||e.end_date)}function Ru(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Ou(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Lu="seenSurvey_",Fu="inProgressSurvey_",Au=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},$u=e=>Au(Lu,e),Du=e=>{try{var t=$u(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Mu.error("Failed to persist survey seen state",e)}},Nu=[fu.Popover,fu.Widget,fu.API],qu={ignoreConditions:!1,ignoreDelay:!1,displayType:_u};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Tr(e)&&isFinite(e)&&Math.floor(e)===e});class ju{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new ju(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new ju(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Bu{constructor(){this.S=0,this.C=0,this.I=new zu}generate(){var e=this.generateOrAbort();if(xr(e)){this.S=0;var t=this.generateOrAbort();if(xr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return ju.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Hu,Uu=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};jn&&!xr(jn.crypto)&&crypto.getRandomValues&&(Uu=e=>crypto.getRandomValues(e));class zu{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(Uu(this.R),this.O=0),this.R[this.O++]}}var Vu=()=>Wu().toString(),Wu=()=>(Hu||(Hu=new Bu)).generate(),Gu="gzip-js",Zu="base64",Qu=Uint8Array,Ju=Uint16Array,Yu=Uint32Array,Ku=new Qu([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]),Xu=new Qu([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]),eh=new Qu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),th=function(e,t){for(var r=new Ju(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new Yu(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]},rh=th(Ku,2),ih=rh[1];rh[0][28]=258,ih[258]=28;for(var nh=th(Xu,0)[1],sh=new Ju(32768),oh=0;32768>oh;++oh){var ah=(43690&oh)>>>1|(21845&oh)<<1;sh[oh]=((65280&(ah=(61680&(ah=(52428&ah)>>>2|(13107&ah)<<2))>>>4|(3855&ah)<<4))>>>8|(255&ah)<<8)>>>1}var lh=function(e,t,r){for(var i=e.length,n=0,s=new Ju(t);i>n;++n)++s[e[n]-1];var o,a=new Ju(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ju(1<<t);var l=15-t;for(n=0;i>n;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],d=a[e[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[sh[d]>>>l]=u}else for(o=new Ju(i),n=0;i>n;++n)o[n]=sh[a[e[n]-1]++]>>>15-e[n];return o},uh=new Qu(288);for(oh=0;144>oh;++oh)uh[oh]=8;for(oh=144;256>oh;++oh)uh[oh]=9;for(oh=256;280>oh;++oh)uh[oh]=7;for(oh=280;288>oh;++oh)uh[oh]=8;var hh=new Qu(32);for(oh=0;32>oh;++oh)hh[oh]=5;var dh=lh(uh,9,0),ch=lh(hh,5,0),vh=function(e){return(e/8>>0)+(7&e&&1)},fh=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Ju?Ju:e instanceof Yu?Yu:Qu)(r-t);return i.set(e.subarray(t,r)),i},ph=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},gh=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},mh=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Qu(0),0];if(1==n){var o=new Qu(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Ju(c+1),f=yh(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(s.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=s[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=s[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==t&&(--v[_],++p)}f=t}return[new Qu(v),f]},yh=function(e,t,r){return-1==e.s?Math.max(yh(e.l,t,r+1),yh(e.r,t,r+1)):t[e.s]=r},bh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ju(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},_h=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},wh=function(e,t,r){var i=r.length,n=vh(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},xh=function(e,t,r,i,n,s,o,a,l,u,h){ph(t,h++,r),++n[256];for(var d=mh(n,15),c=d[0],v=d[1],f=mh(s,15),p=f[0],g=f[1],m=bh(c),y=m[0],b=m[1],_=bh(p),w=_[0],x=_[1],k=new Ju(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=mh(k,7),I=C[0],T=C[1],E=19;E>4&&!I[eh[E-1]];--E);var M,P,R,O,L=u+5<<3,F=_h(n,uh)+_h(s,hh)+o,A=_h(n,c)+_h(s,p)+o+14+3*E+_h(k,I)+(2*k[16]+3*k[17]+7*k[18]);if(F>=L&&A>=L)return wh(t,h,e.subarray(l,l+u));if(ph(t,h,1+(F>A)),h+=2,F>A){M=lh(c,v,0),P=c,R=lh(p,g,0),O=p;var D=lh(I,T,0);for(ph(t,h,b-257),ph(t,h+5,x-1),ph(t,h+10,E-4),h+=14,S=0;E>S;++S)ph(t,h+3*S,I[eh[S]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)ph(t,h,D[B=31&j[S]]),h+=I[B],B>15&&(ph(t,h,j[S]>>>5&127),h+=j[S]>>>12)}}else M=dh,P=uh,R=ch,O=hh;for(S=0;a>S;++S)if(i[S]>255){var B;gh(t,h,M[257+(B=i[S]>>>18&31)]),h+=P[B+257],B>7&&(ph(t,h,i[S]>>>23&31),h+=Ku[B]);var H=31&i[S];gh(t,h,R[H]),h+=O[H],H>3&&(gh(t,h,i[S]>>>5&8191),h+=Xu[H])}else gh(t,h,M[i[S]]),h+=P[i[S]];return gh(t,h,M[256]),h+P[256]},kh=new Yu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Sh=function(){for(var e=new Yu(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Ch=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Ih(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=Sh[255&r^t[i]]^r>>>8;e=r},d(){return 4294967295^e}}}(),i=e.length;r.p(e);var n,s,o,a,l=(n=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,r,i,n,s){var o=e.length,a=new Qu(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=wh(l,u,e.subarray(h,d)):(l[h]=!0,u=wh(l,u,e.subarray(h,o)))}else{for(var c=kh[t-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new Ju(32768),m=new Ju(p+1),y=Math.ceil(r/3),b=2*y,_=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},w=new Yu(25e3),x=new Ju(288),k=new Ju(32),S=0,C=0,I=(h=0,0),T=0,E=0;o>h;++h){var M=_(h),P=32767&h,R=m[M];if(g[P]=R,m[M]=P,h>=T){var O=o-h;if((S>7e3||I>24576)&&O>423){u=xh(e,l,0,w,x,k,C,I,E,h-E,u),I=S=C=0,E=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)k[L]=0}var F=2,A=0,D=f,N=P-R&32767;if(O>2&&M==_(h-N))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),B=Math.min(258,O);j>=N&&--D&&P!=R;){if(e[h+F]==e[h+F-N]){for(var H=0;B>H&&e[h+H]==e[h+H-N];++H);if(H>F){if(F=H,A=N,H>q)break;var U=Math.min(N,H-2),z=0;for(L=0;U>L;++L){var V=h-N+L+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,R=V)}}}N+=(P=R)-(R=g[P])+32768&32767}if(A){w[I++]=268435456|ih[F]<<18|nh[A];var G=31&ih[F],Z=31&nh[A];C+=Ku[G]+Xu[Z],++x[257+G],++k[Z],T=h+F,++S}else w[I++]=e[h],++x[e[h]]}}u=xh(e,l,!0,w,x,k,C,I,E,h-E,u)}return fh(a,0,i+vh(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Ch(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}}(l,t),Ch(l,u-8,r.d()),Ch(l,u-4,i),l}var Th=!!Wn||!!Vn,Eh="text/plain",Mh=!1,Ph=(e,t)=>{var[r,i]=e.split("#"),[n,s]=r.split("?");if(!s)return e;var o=s.split("&").filter((e=>e.split("=")[0]!==t)).join("&");return n+(o?"?"+o:"")+(i?"#"+i:"")},Rh=function(e,t,i){var n;void 0===i&&(i=!0);var[s,o]=e.split("?"),a=r({},t),l=null!==(n=null==o?void 0:o.split("&").map((e=>{var t,[r,n]=e.split("="),s=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],u=ps(a);return u&&l.push(u),s+"?"+l.join("&")},Oh=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Lh=e=>{if(e.xt)return e.xt;var{data:t,compression:r}=e;if(t){if(r===Gu){var i=Ih(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Qu(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new Qu(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return fh(i,0,n)}(Oh(t)),{mtime:0});return{contentType:Eh,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Zu){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(Oh(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Oh(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Oh(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Fh=e=>{var t,i,n=()=>({url:Ph(e.url,"compression"),encodedBody:Lh(r({},e,{compression:void 0,xt:void 0}))});try{t=Lh(e)}catch(t){if(sr(e.compression,gs(e.url,"compression")))return ts.error("Failed to gzip request body, sending uncompressed payload",t),n();throw t}return t&&sr(e.compression,gs(e.url,"compression"))&&!((i=t.body)instanceof ArrayBuffer?nr(new Uint8Array(i)):ArrayBuffer.isView(i)&&nr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Mh=!0,n()):{url:e.url,encodedBody:t}},Ah=e=>{try{return Fh(e)}catch(t){return ts.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},$h=function(){var e=t((function*(e){var t=Oh(e.data),i=yield function(e,t,r){return ur.apply(this,arguments)}(t,Xn.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{xt:{contentType:Eh,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Dh=(e,t)=>Rh(e,{_:(new Date).getTime().toString(),ver:Xn.JS_SDK_VERSION,compression:t}),Nh=[];Vn&&Nh.push({transport:"fetch",method(e){var t,i=Ah(e);if(i){var{url:n,encodedBody:s}=i,{contentType:o,body:a,estimatedSize:l}=null!=s?s:{},u=new Headers;ns(e.headers,(function(e,t){u.append(t,e)})),o&&u.append("Content-Type",o);var h=null,d=null;if(Gn){var c=new Gn;h={signal:c.signal,timeout:setTimeout((()=>{var t,r;t=e.timeout,(r=new Error("PostHog request timed out"+(t?" after "+t+"ms":""))).name="AbortError",c.abort(d=r)}),e.timeout)}}Vn(n,r({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&52428.8>(l||0),body:a,signal:null==(t=h)?void 0:t.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){ts.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{t===d?ts.warn(t):ts.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>h?clearTimeout(h.timeout):null))}}}),Wn&&Nh.push({transport:"XHR",method(e){var t=Ah(e);if(t){var r=new Wn,{url:i,encodedBody:n}=t;r.open(e.method||"GET",i,!0);var{contentType:s,body:o}=null!=n?n:{};ns(e.headers,(function(e,t){r.setRequestHeader(t,e)})),s&&r.setRequestHeader("Content-Type",s),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(o)}}}),null!=Hn&&Hn.sendBeacon&&Nh.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:r}=Fh(e),{contentType:i,body:n}=null!=r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});Hn.sendBeacon(t,s)}catch(e){}}});var qh=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function jh(e,t,r){return Oh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Bh={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>qh(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!qh(t,e))))),icontains:(e,t)=>t.map(Hh).some((t=>e.map(Hh).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Hh).every((t=>e.map(Hh).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},Hh=e=>e.toLowerCase();function Uh(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(xr(n)||Cr(n))return!1;var s=[String(n)],o=Bh[i.operator];return!!o&&o(i.values,s)}))}var zh="",Vh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Wh={N:()=>!!Un,D(e){ts.error("cookieStore error: "+e)},A(e){if(Un){try{for(var t=e+"=",r=Un.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},F(e){var t;try{t=JSON.parse(Wh.A(e))||{}}catch(e){}return t},q(e,t,r,i,n){if(!Un)return!1;try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Un),zh)return zh;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Vu();!zh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",zh=s)}return zh}(e);if(!r){var i=(e=>{var t=e.match(Vh);return t?t[0]:""})(e);i!==r&&ts.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Un.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ts.warn("cookieStore warning: large cookie, len="+u.length),Un.cookie=u,!0}catch(e){return!1}},P(e,t){if(null!=Un&&Un.cookie)try{Wh.q(e,"",-1,t)}catch(e){return}}},Gh=null,Zh={N(){if(!Cr(Gh))return Gh;var e=!0;if(xr(jn))e=!1;else try{var t="__mplssupport__";Zh.q(t,"xyz"),'"xyz"'!==Zh.A(t)&&(e=!1),Zh.P(t)}catch(t){e=!1}return e||ts.error("localStorage unsupported; falling back to cookie store"),Gh=e,e},D(e){ts.error("localStorage error: "+e)},A(e){try{return null==jn?void 0:jn.localStorage.getItem(e)}catch(e){Zh.D(e)}return null},F(e){try{return JSON.parse(Zh.A(e))||{}}catch(e){}return null},q(e,t){try{return null==jn||jn.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Zh.D(e)}return!1},P(e){try{null==jn||jn.localStorage.removeItem(e)}catch(e){Zh.D(e)}}},Qh=[Ss,"distinct_id",Us,zs,go,po,uo],Jh={},Yh={N:()=>!0,D(e){ts.error("memoryStorage error: "+e)},A:e=>Jh[e]||null,F:e=>Jh[e]||null,q:(e,t)=>(Jh[e]=t,!0),P(e){delete Jh[e]}},Kh=null,Xh={N(){if(!Cr(Kh))return Kh;if(Kh=!0,xr(jn))Kh=!1;else try{var e="__support__";Xh.q(e,"xyz"),'"xyz"'!==Xh.A(e)&&(Kh=!1),Xh.P(e)}catch(e){Kh=!1}return Kh},D(e){ts.error("sessionStorage error: ",e)},A(e){try{return null==jn?void 0:jn.sessionStorage.getItem(e)}catch(e){Xh.D(e)}return null},F(e){try{return JSON.parse(Xh.A(e))||null}catch(e){}return null},q(e,t){try{return null==jn||jn.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Xh.D(e)}return!1},P(e){try{null==jn||jn.sessionStorage.removeItem(e)}catch(e){Xh.D(e)}}},ed=rs("[Stylesheet Loader]"),td=jn,rd=Un,id="#020617",nd={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:cu.Right,widgetType:du.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:id,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},sd=[cu.Center,cu.Left,cu.Right];function od(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function ad(e){var t;void 0===e&&(e=nd.backgroundColor),"#"===e[0]&&(t=od(e)),e.startsWith("rgb")&&(t=e);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()];if(r&&(t=od(r)),!t)return id;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?id:"white"}return id}var ld=(e,t,i)=>{var n=Id(e),s=rd.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=rd.createElement("div");((e,t,i)=>{var n=r({},nd,i),s=e.style,o=!sd.includes(n.position)||t===fu.Widget&&(null==i?void 0:i.widgetType)===du.Tab;s.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||ad(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",ad(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||ad(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",ad(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)||ad(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=':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)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(ed.error("prepare_external_dependency_stylesheet returned null"),null)})(rd,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return rd.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},ud=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:l}=e;s?(Du(i),s.capture(yu.SENT,r({[bu.SURVEY_NAME]:i.name,[bu.SURVEY_ID]:i.id,[bu.SURVEY_ITERATION]:i.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[bu.SURVEY_SUBMISSION_ID]:n,[bu.SURVEY_COMPLETED]:o},l&&{[bu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},ku(t,i),a,{$set:{[Su(i,"responded")]:!0}})),o&&(td.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Cd(i))):Mu.error("[survey sent] event not captured, PostHog instance not found.")},hd=(e,t,i)=>{return r({[bu.SURVEY_NAME]:e.name,[bu.SURVEY_ID]:e.id,[bu.SURVEY_ITERATION]:e.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[bu.SURVEY_PARTIALLY_COMPLETED]:(n=null==t?void 0:t.responses,void 0===n&&(n={}),Object.values(n).some((e=>!Ir(e))))},(null==t?void 0:t.surveyLanguage)&&{[bu.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[bu.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},ku(null==t?void 0:t.responses,e));var n},dd=(e,t,i,n)=>{if(t){if(!i){var s=kd(e);t.capture(yu.DISMISSED,r({},hd(e,s,t),n&&{[bu.SURVEY_LANGUAGE]:n},{$set:{[Su(e,"dismissed")]:!0}})),Cd(e),Du(e),td.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Mu.error("[survey dismissed] event not captured, PostHog instance not found.")},cd=(e,t)=>{if(t){var r=(e=>Au("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=kd(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(yu.ABANDONED,hd(e,i,t),{transport:"sendBeacon"})}}else Mu.error("[survey abandoned] event not captured, PostHog instance not found.")},vd=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),fd=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,pd=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?fd(e.questions,vd(e.questions)):e.questions,gd=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===mu||Sd(e)},md=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,_l(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+al++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),yd=()=>tu(md),bd=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return function(e,t,r){var i,n,s,o,a=cl({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?Ga.call(arguments,2):r),pl(e.type,a,i||e.key,n||e.ref,null)}(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function _d(e,t){var r,i;if(null==(r=e.conditions)||!r.url)return!0;var n=xs(t);if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return Bh[o](s,[n])}var wd=e=>{var t=""+Fu+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Fu+e.id+"_"+e.current_iteration),t},xd=(e,t)=>{try{localStorage.setItem(wd(e),JSON.stringify(t))}catch(e){Mu.error("Error setting in-progress survey state in localStorage",e)}},kd=e=>{try{var t=localStorage.getItem(wd(e));if(t)return JSON.parse(t)}catch(e){Mu.error("Error getting in-progress survey state from localStorage",e)}return null},Sd=e=>{var t=kd(e);return!Ir(null==t?void 0:t.surveySubmissionId)},Cd=e=>{try{localStorage.removeItem(wd(e))}catch(e){Mu.error("Error clearing in-progress survey state from localStorage",e)}};function Id(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Td(e,t,r){if(void 0===t&&(t=cu.Right),e===fu.ExternalSurvey)return{};switch(t){case cu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case cu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case cu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case cu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case cu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case cu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case cu.Left:return{left:"30px"};case cu.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===fu.Widget&&r===du.Tab?"60px":"30px"}}}var Ed=0;function Md(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ed,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Za.vnode&&Za.vnode(u),u}var Pd=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Rd=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Od=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Ld=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Fd=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Md("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"})}),Ad=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Md("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"})}),$d=Md("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Md("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"})}),Dd=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return Md("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Md("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Md("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:t})]})},Nd=Md("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Md("g",{"clip-path":"url(#clip0_2415_6911)",children:[Md("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Md("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Md("g",{mask:"url(#mask0_2415_6911)",children:[Md("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"}),Md("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"}),Md("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"}),Md("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"}),Md("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"}),Md("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"})]})]}),Md("defs",{children:Md("clipPath",{id:"clip0_2415_6911",children:Md("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function qd(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Md("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Nd]})}function jd(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a,canGoBack:l,onBack:u}=e,{isPreviewMode:h}=tu(md),d=!!l&&!!u,c=!a&&Md("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==jn||jn.open(s)),h?null==o||o():n()},children:t});return Md("div",{className:"bottom-section",children:[d?Md("div",{className:"form-buttons form-buttons-with-back",children:[Md("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&Md(qd,{urlParams:{utm_source:"survey-footer"}})]})}function Bd(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return Md("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Md(t.type===pu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&bd({component:fl("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function Hd(e){var{onClick:t}=e,{isPreviewMode:r}=tu(md);return Md("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Dd({fill:"black"})})}Md("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Md("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 Ud=jn;function zd(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=tu(md);return Kl((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return cs(Ud,"keydown",e),()=>{Ud.removeEventListener("keydown",e)}}),[o]),Md("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Md(Hd,{onClick:()=>o()}),Md("h3",{className:"thank-you-message-header",children:t}),r&&bd({component:fl("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Md(jd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Vd=e=>yr(e)&&e.every((e=>kr(e)));function Wd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a,canGoBack:l,onBack:u}=e,{isPreviewMode:h}=yd(),d=Xl(null),[c,v]=Yl((()=>kr(a)?a:""));Kl((()=>{setTimeout((()=>{var e;h||null==(e=d.current)||e.focus()}),100)}),[h]);var f="surveyQuestion"+o,p=eu((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case er.MinLength: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 er.MaxLength: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}(c,t.validation,t.optional)),[c,t.validation,t.optional]),g=nn(t.validation,er.MinLength),m=nn(t.validation,er.MaxLength),y=eu((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(g,m)),[g,m]),b=()=>{p||n(c.trim())},_=()=>{p||s(c.trim())};return Md(gl,{children:[Md("div",{className:"question-container",children:[Md(Bd,{question:t,forceDisableHtml:r,htmlFor:f}),Md("textarea",{ref:d,id:f,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:g,maxLength:m,onInput(e){v(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||p||(e.preventDefault(),h?_():b())},value:c}),y&&Md("div",{className:"validation-hint",children:y})]}),Md(jd,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:i,onSubmit:b,onPreviewSubmit:_,canGoBack:l,onBack:u})]})}function Gd(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,canGoBack:o,onBack:a}=e;return Md(gl,{children:[Md("div",{className:"question-container",children:Md(Bd,{question:t,forceDisableHtml:r})}),Md(jd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked"),canGoBack:o,onBack:a})]})}function Zd(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l,canGoBack:u,onBack:h}=e,d=r.scale,c=10===r.scale?0:1,[v,f]=Yl((()=>Tr(l)?l:yr(l)&&l.length>0&&Tr(parseInt(l[0]))?parseInt(l[0]):kr(l)&&Tr(parseInt(l))?parseInt(l):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:g}=yd(),m=e=>g?a(e):o(e);return Md(gl,{children:[Md("div",{className:"question-container",children:[Md(Bd,{question:r,forceDisableHtml:i}),Md("div",{className:"rating-section",children:[Md("div",{className:"rating-options",children:["emoji"===r.display&&Md("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=ec[r.scale])?void 0:t.map(((e,t)=>Md("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===v?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;f(e),r.skipSubmitButton&&m(e)},children:e},t)))}),"number"===r.display&&Md("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:tc(r.scale).map(((e,t)=>Md(Qd,{displayQuestionIndex:n,active:v===e,appearance:s,num:e,setActiveNumber(e){f(e),r.skipSubmitButton&&m(e)}},t)))})]}),!p&&Md("div",{className:"rating-text",children:[Md("div",{children:r.lowerBoundLabel}),Md("div",{children:r.upperBoundLabel})]})]})]}),Md(jd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Cr(v)&&!r.optional,appearance:s,onSubmit:()=>o(v),onPreviewSubmit:()=>a(v),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Qd(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return Md("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){n(t)},children:t})}function Jd(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l,canGoBack:u,onBack:h}=e,d=Xl(null),c=eu((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=fd(t,vd(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[v,f]=Yl((()=>((e,t)=>kr(e)||Vd(e)?e:t===pu.SingleChoice?null:[])(l,t.type))),[p,g]=Yl((()=>((e,t)=>{if(kr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Vd(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:m}=yd(),y=t.type===pu.SingleChoice,b=t.type===pu.MultipleChoice,_=t.skipSubmitButton&&y&&!t.hasOpenChoice,w=(e,t)=>{if(t){var i=!p.isSelected;return g((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),y&&f(""),void(i&&setTimeout((()=>{var e;return null==(e=d.current)?void 0:e.focus()}),75))}if(y)return f(e),g((e=>r({},e,{isSelected:!1,inputValue:""}))),void(_&&(o(e),m&&a(e)));b&&yr(v)&&(v.includes(e)?f(v.filter((t=>t!==e))):f([...v,e]))},x=e=>{e.stopPropagation();var t=e.currentTarget.value;g((e=>r({},e,{inputValue:t}))),y&&f(t)},k=e=>{e.stopPropagation(),"Enter"!==e.key||S()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),g((e=>r({},e,{isSelected:!1,inputValue:""}))),y&&f(null))},S=()=>!(t.optional||!Cr(v)&&(!yr(v)||p.isSelected||0!==v.length)&&(!p.isSelected||""!==p.inputValue.trim())),C=()=>{p.isSelected&&b?yr(v)&&(m?a([...v,p.inputValue]):o([...v,p.inputValue])):m?a(v):o(v)};return Md(gl,{children:[Md("div",{className:"question-container",children:[Md(Bd,{question:t,forceDisableHtml:i}),Md("fieldset",{className:"multiple-choice-options limit-height",children:[Md("legend",{className:"sr-only",children:b?" Select all that apply":" Select one"}),c.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?p.isSelected:y?v===e:yr(v)&&v.includes(e);return Md("label",{className:i?"choice-option-open":"",children:[Md("div",{className:"response-choice",children:[Md("input",{type:y?"radio":"checkbox",name:s,checked:a,onChange:()=>w(e,i),id:s,"aria-controls":o}),Md("span",{children:i?e+":":e})]}),i&&Md("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:k,onInput:x,onClick(t){p.isSelected||w(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Md(jd,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:_,canGoBack:u,onBack:h})]})}var Yd=[1,2,3,4,5],Kd=[1,2,3,4,5,6,7],Xd=[0,1,2,3,4,5,6,7,8,9,10],ec={2:[Ad,$d],3:[Od,Rd,Pd],5:[Ld,Od,Rd,Pd,Fd]};function tc(e){switch(e){case 5:default:return Yd;case 7:return Kd;case 10:return Xd}}var rc=rs("[Surveys]");function ic(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?gu.End:s;if(n.branching.type===gu.End)return gu.End;if(n.branching.type===gu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===gu.ResponseBased){if(n.type===pu.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===gu.End?gu.End:s}}else if(n.type===pu.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===gu.End?gu.End:s}}return s}return rc.warn("Falling back to next question index due to unexpected branching type"),s}var nc="https?://(.*)",sc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],oc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...sc],ac="<masked>",lc=["li_fat_id"];function uc(e,t,r){if(!Un)return{};var i,n=t?[...sc,...r||[]]:[],s=hc(ms(Un.URL,n,ac),e),o=(i={},ns(lc,(function(e){var t=Wh.A(e);i[e]=t||null})),i);return ss(o,s)}function hc(e,t){var r=oc.concat(t||[]),i={};return ns(r,(function(t){var r=gs(e,t);i[t]=r||null})),i}function dc(e){var t=function(e){return e?0===e.search(nc+"google.([^/?]*)")?"google":0===e.search(nc+"bing.com")?"bing":0===e.search(nc+"yahoo.com")?"yahoo":0===e.search(nc+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Cr(t)){i.$search_engine=t;var n=Un?gs(Un.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function cc(){return navigator.language||navigator.userLanguage}var vc="$direct";function fc(){return(null==Un?void 0:Un.referrer)||vc}function pc(e,t,r){void 0===r&&(r=!1);var i=e?[...sc,...t||[]]:[],n=r?Gi(null==zn?void 0:zn.href):null==zn?void 0:zn.href,s=null==n?void 0:n.substring(0,1e3);return{r:fc().substring(0,1e3),u:s?ms(s,i,ac):void 0}}function gc(e,t){var r;void 0===t&&(t=!1);var{r:i,u:n}=e,s=t?Gi(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==vc?vc:null==(r=fs(i))?void 0:r.host};if(s){o.$current_url=s;var a=fs(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=hc(s);ss(o,l)}if(i){var u=dc(i);ss(o,u)}return o}function mc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function yc(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var bc=rs("[SurveyTranslations]");function _c(e,t){var r=function(e){return function(e,t){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=e,s=Cu(r);if(s)return null==t||t.info("Using override display language: "+s),s;var o=function(e){return e&&"object"==typeof e&&"language"in e?Cu(e.language):null}(i);if(o)return null==t||t.info("Using person property language: "+o),o;var a=Cu(n);return a?(null==t||t.info("Using detected locale: "+a),a):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:br(e.get_property)?e.get_property(Xs):void 0,locale:cc()},bc)}(t);if(!r)return bc.info("No user language detected"),{survey:e,language:null};var i=Eu(e,r,bc);return{survey:i.survey,language:i.matchedKey}}var wc=jn,xc=Un,kc="ph:show_survey_widget",Sc="PHWidgetSurveyClickListener";function Cc(e,t){try{var r=e.getBoundingClientRect(),i=wc.innerHeight,n=wc.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:nd.zIndex}}catch(e){return Mu.warn("Failed to calculate trigger position:",e),null}}class Ic{constructor(e){var t=this;this.B=new Map,this.H=new Map,this.j=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(to);if(e)for(var t of e)Sd(t)&&cd(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,{survey:a,language:l}=this.U(e),u=null!=t&&t.position||null!=t&&t.selector?r({},a,{appearance:r({},a.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):a;this.W(u.id);var{properties:h,initialResponses:d}=null!=t?t:{},c=!(!d||0>=Object.keys(d).length)&&this.V(u,d,h,l);if(!c||null!=(i=u.appearance)&&i.displayThankYouMessage){this.Z(u);var v={};if((null==(n=u.appearance)?void 0:n.position)===cu.NextToTrigger&&null!=(s=u.appearance)&&s.widgetSelector){var f,p=xc.querySelector(u.appearance.widgetSelector);p&&(v=Cc(p,parseInt((null==(f=u.appearance)?void 0:f.maxWidth)||nd.maxWidth))||{})}var g=(null==(o=u.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=ld(u,this._posthog),y={posthog:this._posthog,survey:u,removeSurveyFromFocus:this.$,properties:h,style:v,isSurveyCompleted:c,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:l};if(0>=g)return $l(Md(Pc,r({},y)),m);var b=setTimeout((()=>{if(this.B.delete(u.id),!this.G(u))return Mu.info("Survey "+u.id+" no longer eligible when its display delay elapsed; not displaying"),this.$(u);$l(Md(Pc,r({},y,{survey:r({},u,{appearance:r({},u.appearance,{surveyPopupDelaySeconds:0})})})),m)}),1e3*g);this.B.set(u.id,b)}},this.Y=e=>{var{survey:t,language:r}=this.U(e),{shadow:i,isNewlyCreated:n}=ld(t,this._posthog);n&&$l(Md(Oc,{posthog:this._posthog,survey:t,surveyLanguage:r},e.id),i)},this.J=e=>{this.K(e);var t=this.H.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(Sc),this.H.delete(e.id),Mu.info("Removed click listener for survey "+e.id))},this.X=(e,t)=>{var r=xc.querySelector(t),i=this.H.get(e.id);if(r){if(this.Y(e),i){if(r===i.element)return;Mu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.J(e)}if(!r.hasAttribute(Sc)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===cu.NextToTrigger?Cc(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||nd.maxWidth)):{};wc.dispatchEvent(new CustomEvent(kc,{detail:{surveyId:e.id,position:n}}))};cs(r,"click",n),r.setAttribute(Sc,"true"),this.H.set(e.id,{element:r,listener:n,survey:e}),Mu.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.J(e)},this.renderPopover=e=>{var{survey:t,language:r}=this.U(e),{shadow:i}=ld(t,this._posthog);$l(Md(Pc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,surveyLanguage:r}),i)},this.renderSurvey=(e,t,r)=>{var i,{survey:n,language:s}=this.U(e),o=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(o=this.ee(n,s)),$l(Md(Pc,{posthog:this._posthog,survey:n,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:s}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.G(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===fu.Popover||e.type===fu.Widget)),i=new Set(r.map((e=>e.id)));for(var n of Array.from(t.B.keys()))i.has(n)||t.cancelSurvey(n);var s=t.te(r),o=new Set;s.forEach((e=>{if(e.type===fu.Widget){var r,i,n,s;if((null==(r=e.appearance)?void 0:r.widgetType)===du.Tab)return void t.Y(e);(null==(i=e.appearance)?void 0:i.widgetType)===du.Selector&&null!=(n=e.appearance)&&n.widgetSelector&&(o.add(e.id),t.X(e,null==(s=e.appearance)?void 0:s.widgetSelector))}Cr(t.re)&&e.type===fu.Popover&&t.handlePopoverSurvey(e)})),t.H.forEach((e=>{var{survey:r}=e;o.has(r.id)||t.J(r)}))}),e)},this.Z=e=>{Cr(this.re)||Mu.error("Survey "+this.re+" already in focus. Cannot add survey "+e.id+"."),this.re=e.id},this.$=e=>{this.re!==e.id&&Mu.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.W(e.id),this.re=null,this.K(e)},this._posthog=e,this.re=null}W(e){var t=this.B.get(e);t&&(clearTimeout(t),this.B.delete(e))}cancelSurvey(e){this.B.has(e)&&(Mu.info("Cancelled pending survey "+e),this.W(e),this.re===e&&(this.re=null))}te(e){return e.sort(((e,t)=>{var r,i,n=Sd(e),s=Sd(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===mu,a=t.schedule===mu;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}U(e){return _c(e,this._posthog)}ee(e,t){if(this.j.has(e.id))return!1;var{params:r}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!xr(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var d=parseInt(h[1],10);t[d]||(t[d]=[]),t[d].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(wc.location.search);if(0===Object.keys(r).length)return!1;Mu.info("[Survey Prefill] Detected URL prefill parameters");var i=this.ne(e,r,t);if(!i)return!1;var{responses:n,submissionId:s,isSurveyCompleted:o,skippedResponses:a}=i;return(Object.keys(a).length>0&&e.enable_partial_responses||o)&&ud({responses:o?n:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:t}),this.j.add(e.id),o}V(e,t,r,i){var n={};for(var[s,o]of Object.entries(t))n[parseInt(s)]=yr(o)?o.map(String):[String(o)];Mu.info("[Survey] Processing initial responses");var a=this.ne(e,n,i);if(!a)return!1;var{responses:l,submissionId:u,isSurveyCompleted:h}=a;return ud({responses:l,survey:e,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:h,properties:r,surveyLanguage:i}),h}ne(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=wu(e.id);try{switch(e.type){case pu.SingleChoice:if(!e.choices||0===e.choices.length)return void ts.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void ts.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case pu.MultipleChoice:if(!e.choices||0===e.choices.length)return void ts.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void ts.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&ts.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case pu.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||0>u||u>h)return void ts.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:ts.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){ts.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return Mu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Vu(),s=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:a}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=wu(o.id);xr(r[a])||(n[a]=r[a])}var l=ic(e,i,o.id?r[wu(o.id)]:null);if(l===gu.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,s,i),l=o>=e.questions.length;return xd(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Mu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return Mu.error("[Survey Prefill] Error handling prefill:",e),null}}ie(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}ae(e){return!e.conditions||_d(e,this._posthog)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!Qn)return!1;var s=zi(Qn,{userAgentDataPlatform:null==Hn||null==(r=Hn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Hn?void 0:Hn.maxTouchPoints,screenWidth:null==jn||null==(i=jn.screen)?void 0:i.width,screenHeight:null==jn||null==(n=jn.screen)?void 0:n.height,devicePixelRatio:null==jn?void 0:jn.devicePixelRatio});return Bh[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==rd||!rd.querySelector(e.conditions.selector))}(e)}oe(e){return gd(e)||this.ie(e.internal_targeting_flag_key)||Sd(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Pu(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Nu.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.ie(e.linked_flag_key,n)?this.ie(e.targeting_flag_key)?this.oe(e)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Zh.A("lastSeenSurveyDate"))?(e=>!!Zh.A($u(e))&&!gd(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}se(e){var t;if(!Ru(e)&&!Ou(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}ue(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.ie(r)}))}G(e){return this.checkSurveyEligibility(e).eligible&&this.ae(e)&&this.se(e)&&this.ue(e)}K(e){try{var t=xc.querySelector(Id(e,!0));null!=t&&t.shadowRoot&&$l(null,t.shadowRoot),null==t||t.remove()}catch(t){Mu.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.re,surveyTimeouts:this.B,handleWidget:this.Y,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.X,sortSurveysByAppearanceDelay:this.te,checkFlags:this.ue.bind(this),isSurveyFeatureFlagEnabled:this.ie.bind(this)}}}function Tc(e,t){if(xc&&wc){var r,i=new Ic(e);if(e.config.disable_surveys_automatic_display)return Mu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Mu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{xr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),cs(xc,"visibilitychange",(()=>{xc.hidden?xr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Ec(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1,posthog:s}=e;Kl((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var o=()=>{var e,n=t.type===fu.Widget,o=_d(t,s),a=(null==(e=t.appearance)?void 0:e.widgetType)===du.Tab&&n;if(!o)return Mu.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);a&&(Mu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};cs(wc,"popstate",o),cs(wc,"hashchange",o);var a=wc.history.pushState,l=wc.history.replaceState;return wc.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];a.apply(this,t),o()},wc.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];l.apply(this,t),o()},()=>{wc.removeEventListener("popstate",o),wc.removeEventListener("hashchange",o),wc.history.pushState=a,wc.history.replaceState=l}}}),[n,t,r,i,s])}function Mc(e){switch(void 0===e&&(e=vu.Right),e){case vu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case vu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case vu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Pc(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,style:d={},previewPageIndex:c,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPreviewBack:g=(()=>{}),onPopupSurveyDismissed:m=(()=>{}),onCloseConfirmationMessage:y=(()=>{}),properties:b,isSurveyCompleted:_,skipShownEvent:w,surveyLanguage:x}=e,k=Xl(null),S=Number.isInteger(c),C=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:I,isSurveySent:T,hidePopupWithViewTransition:E}=function(e,t,i,n,s,o,a,l,u){var[h,d]=Yl(n||0===i||e.type===fu.ExternalSurvey),[c,v]=Yl(!1),f=()=>{var t=()=>{o&&s(e),d(!1)};xc.startViewTransition?xc.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&f()};return Kl((()=>{if(t){if(!n){var s=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{if(_d(e,t)){d(!0),wc.dispatchEvent(new Event("PHSurveyShown")),l||t.capture(yu.SHOWN,r({[bu.SURVEY_NAME]:e.name,[bu.SURVEY_ID]:e.id,[bu.SURVEY_ITERATION]:e.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[bu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};if(cs(wc,"PHSurveyClosed",p),cs(wc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),wc.removeEventListener("PHSurveyClosed",p),wc.removeEventListener("PHSurveySent",s)}}return o(),()=>{wc.removeEventListener("PHSurveyClosed",p),wc.removeEventListener("PHSurveySent",s)}}}else Mu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Ec({survey:e,removeSurveyFromFocus:s,setSurveyVisible:d,isPreviewMode:n,posthog:t}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithViewTransition:f}}(l,h,C,S,v,f,k,w,x),M=T||c===l.questions.length||!0===_,P=eu((()=>{var e=kd(l),t=(null==e?void 0:e.surveySubmissionId)||Vu();return{isPreviewMode:S,previewPageIndex:c,onPopupSurveyDismissed(){x?dd(l,h,S,x):dd(l,h,S),m()},isPopup:f||!1,surveySubmissionId:t,onPreviewSubmit:p,onPreviewBack:g,posthog:h,properties:b,surveyLanguage:x}}),[S,c,f,h,l,m,p,g,b,x]);return I?Md(md.Provider,{value:P,children:Md("div",{className:"ph-survey",style:r({},Td(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:k,children:M?Md(zd,{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||nd,onClose(){E(),y()}}):Md(Rc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function Rc(e){var t,i,{survey:n,forceDisableHtml:s,posthog:o}=e,[a,l]=Yl((()=>{var e=kd(n);return null!=e&&e.responses&&Mu.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:h,isPopup:d,onPreviewSubmit:c,onPreviewBack:v,surveySubmissionId:f,isPreviewMode:p,properties:g,surveyLanguage:m}=tu(md),[y,b]=Yl((()=>{var e=kd(n);return u||(null==e?void 0:e.lastQuestionIndex)||0})),[_,w]=Yl((()=>{var e,t=kd(n);return null!==(e=null==t?void 0:t.visitedIndices)&&void 0!==e?e:[]})),x=eu((()=>pd(n)),[n]);Kl((()=>{p&&!xr(u)&&b(u)}),[u,p]);var k=!(null==(t=n.appearance)||!t.allowGoBack)&&(p?(null!=u?u:0)>0:_.length>0),S=x.at(y);return S?Md("form",{className:"survey-form",name:"surveyForm",children:[d&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&Md(Hd,{onClick(){h()}}),Md("div",{className:"survey-box","data-question-index":y,children:Lc({question:S,forceDisableHtml:s,displayQuestionIndex:y,appearance:n.appearance||nd,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:i,questionId:s}=e;if(o)if(s){var u=wu(s),h=r({},a,{[u]:t});l(h);var d=ic(n,i,t),c=d===gu.End,v=[..._,i];if(c||(w(v),b(d),xd(n,{surveySubmissionId:f,responses:h,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:m})),n.enable_partial_responses||c){var p=new Set(v.map((e=>{var t;return null==(t=x[e])?void 0:t.id})).filter((e=>!!e)).map((e=>wu(e)))),y=Object.fromEntries(Object.entries(h).filter((e=>{var[t]=e;return p.has(t)})));ud({responses:y,survey:n,surveySubmissionId:f,isSurveyCompleted:c,posthog:o,properties:g,surveyLanguage:m})}}else Mu.error("onNextButtonClick called without a questionId.");else Mu.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:y,questionId:S.id}),onPreviewSubmit:c,initialValue:S.id?a[wu(S.id)]:void 0,canGoBack:k,onBack(){if(p)v();else if(0!==_.length){var e=_[_.length-1],t=_.slice(0,-1);w(t),b(e),xd(n,{surveySubmissionId:f,responses:a,lastQuestionIndex:e,visitedIndices:t,surveyLanguage:m})}}})})]}):null}function Oc(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:d,surveyLanguage:c}=e,[v,f]=Yl(!0),[p,g]=Yl(!1),[m,y]=Yl({}),b=()=>{g(!p)};if(Kl((()=>{var e;if(h){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&y({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Mu.info("Received show event for feedback button survey "+l.id),y(r.detail.position||{}),b())};return cs(wc,kc,t),()=>{wc.removeEventListener(kc,t)}}}else Mu.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),Ec({survey:l,setSurveyVisible:f,posthog:h}),!v)return null;var _=()=>{l.schedule!==mu&&f(!1),setTimeout((()=>{g(!1)}),200)};return Md(gl,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Md("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===vu.Top?"widget-tab-top":""),onClick:b,disabled:d,style:Mc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),p&&Md(Pc,{posthog:h,survey:l,forceDisableHtml:u,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:c})]})}var Lc=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l,canGoBack:u,onBack:h}=e,d={forceDisableHtml:i,appearance:s,onPreviewSubmit(e){a(e)},onSubmit(e){o(e)},initialValue:l,displayQuestionIndex:n,canGoBack:u,onBack:h};switch(t.type){case pu.Open:return fl(Wd,r({},d,{question:t,key:t.id}));case pu.Link:return fl(Gd,r({},d,{question:t,key:t.id}));case pu.Rating:return fl(Zd,r({},d,{question:t,key:t.id}));case pu.SingleChoice:case pu.MultipleChoice:return fl(Jd,r({},d,{question:t,key:t.id}));default:return Mu.error("Unsupported question type: "+t.type),null}};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.generateSurveys=Tc,Jn.extendPostHogWithSurveys=Tc;var Fc=(e,t,r)=>r.remaining>0?t.length>r.remaining?(e.push(t.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(e.push(t),r.remaining-=t.length,!0):(r.truncated=!0,!1),Ac=(e,t,r)=>{var i=JSON.stringify(e);if(r.remaining>=i.length)return Fc(t,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(e.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(e.slice(0,o)).length>r.remaining?s=o-1:n=o}return Fc(t,JSON.stringify(e.slice(0,n)),r)},$c=e=>void 0!==e&&"function"!=typeof e&&"symbol"!=typeof e&&"bigint"!=typeof e,Dc=(e,t,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(t).length+e.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[e]=t}},Nc=(e,t,r)=>{if(!r.truncated)if(_r(e)){if(r.seen.has(e))return void Dc(t||"circular","[Circular]",r);r.seen.add(e);try{for(var i in e)try{if(!{}.hasOwnProperty.call(e,i))continue;if(Nc(e[i],t?t+"."+i:i,r),r.truncated)return}catch(e){continue}}catch(e){}}else Dc(t,e,r)},qc=function(e,t,r,i,n,s){if(void 0===n&&(n=!1),!$c(e))return!n||Fc(t,"null",r);if(Cr(e)||(e=>{try{return Tr(e)||Mr(e)}catch(e){return!1}})(e))return Fc(t,JSON.stringify(e),r);if("string"==typeof e)return Ac(e,t,r);if(!_r(e)&&!yr(e))return Fc(t,JSON.stringify(e),r);if(i.has(e))return Ac("[Circular]",t,r);i.add(e);try{var o=e.toJSON;if(br(o))return qc(o.call(e),t,r,i,n)}catch(e){}try{var a={}.toString.call(e);if("[object String]"===a)return Ac(String(e.valueOf()),t,r);if("[object Number]"===a||"[object Boolean]"===a)return Fc(t,JSON.stringify(e.valueOf()),r)}catch(e){}if(e instanceof Error){var l={};try{for(var u in e)({}).hasOwnProperty.call(e,u)&&(l[u]=e[u])}catch(e){}try{l.name=e.name}catch(e){}try{l.message=e.message}catch(e){}try{l.stack=e.stack}catch(e){}return qc(l,t,r,i,n,s)}if(yr(e)){if(!Fc(t,"[",r))return!1;for(var h=0;e.length>h;h++){if(h>0&&!Fc(t,",",r))return!1;var d=void 0;try{d=e[h]}catch(e){d=void 0}if(!qc(d,t,r,i,!0))return!1}return Fc(t,"]",r)}if(!Fc(t,"{",r))return!1;var c=!0;try{for(var v in e)if({}.hasOwnProperty.call(e,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=e[v]}catch(e){continue}if(s)try{Nc(f,v,s)}catch(e){}if($c(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=t.length,m=r.remaining,y=r.truncated;if(!Fc(t,p,r))return!1;var b=t.length,_=qc(f,t,r,i,!1),w=r.truncated;if(t.length!==b){if(c=!1,!_)return!1}else if(t.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(e){}return Fc(t,"}",r)},jc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.logs={initializeLogs(e){var t={host:Jn.location.host},i=function(i){var n;Jn.console[i]=(n=Jn.console[i],function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];try{if(o.length>0&&e.is_capturing()){var l,{body:u,truncated:h,attributes:d}=((e,t)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=_r(e[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([e[0]])}:void 0,s=0;e.length>s&&(0>=s||Fc(r," ",i))&&qc(e[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(o),c=r({},t,h?{body_truncated:"true"}:{});null==(l=e.logs)||l.le({level:jc[i],body:u,attributes:r({"log.source":"console."+i},c,d)})}}catch(e){}finally{n.apply(Jn.console,o)}})};for(var n of Object.keys(jc))i(n)}};var Bc=rs("[Error tracking]");function Hc(){return new un([new xn,new On,new Sn,new kn,new Pn,new Mn,new In,new Rn],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=_n.test(l)?l.replace(_n,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,e);if(d){s.push(d);break}}if(s.length>=wn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,wn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||hn});var i}))}(s)}}("web:javascript",gn,bn))}var Uc=rs("[ExceptionAutocapture]"),zc=Hc(),Vc={wrapOnError(e){var t=jn;t||Uc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=zc.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=jn;t||Uc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var i,n=zc.buildFromUnknown(t,{mechanism:{handled:!1}});return e(n),null!==(i=null==r?void 0:r(t))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||Uc.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=zc.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.errorWrappingFunctions=Vc,Jn.posthogErrorWrappingFunctions=Vc;var Wc="X-POSTHOG-SESSION-ID",Gc="X-POSTHOG-WINDOW-ID",Zc="X-POSTHOG-DISTINCT-ID",Qc=[Wc,Gc,Zc],Jc=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Yc=(e,t)=>({}.hasOwnProperty.call(e,t)),Kc=e=>"object"==typeof e&&!Cr(e)||br(e),Xc=e=>"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e)),ev=e=>{try{var t;return Xc(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==jn||null==(t=jn.location)?void 0:t.href).toString()}catch(e){return}},tv=(e,t,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(yr(e)&&!e.includes(s))return!1;var o=!1;if(r){var{sessionId:a,windowId:l}=r.checkAndGetSessionAndWindowId(!0);n.set(Wc,a),n.set(Gc,l),o=!0}var u=(e=>br(e)?e():e)(t);return u&&u!==yo&&(n.set(Zc,u),o=!0),o};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{};var rv={_patchFetch:(e,t,i)=>bs(jn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=ev(s);if(u)if(Xc(s)){var h=new Request(s,o);tv(e,t,i,h.url,h.headers),l=[h]}else{var d=new Headers(Kc(o)?o.headers:void 0);if(tv(e,t,i,u,d)){var c=((e,t)=>{if(xr(e)||Cr(e))return{headers:t};if(Kc(e)){var i=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),n}return new Proxy({headers:t},{get:(e,t)=>Yc(e,t)?Reflect.get(e,t):Reflect.get(i,t,i),has:(e,t)=>Yc(e,t)||t in i,ownKeys(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(i).forEach((e=>t.add(e))),Jc.forEach((e=>{e in i&&t.add(e)})),Array.from(t)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n)return n;if("string"==typeof t&&Jc.includes(t)&&t in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,t,i)}};var s=Reflect.getOwnPropertyDescriptor(i,t);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(e){l=a}return n.apply(this,l)})),_patchXHR:(e,t,r)=>bs(jn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=ev(s);d&&tv(e,t,r,d,h);var c=i.call(u,n,s,o,a,l);return Qc.forEach((e=>{var t=h.get(e);if(t)try{u.setRequestHeader(e,t)}catch(e){}})),c}))};Jn.__PosthogExtensions__.tracingHeadersPatchFns=rv,Jn.postHogTracingHeadersPatchFns=rv,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(e){var t=this.length,r=Math.trunc(e)||0;return 0>r&&(r+=t),0>r||r>=t?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});var iv=-1,nv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(iv=t.timeStamp,e(t))}),!0)},sv=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},ov=e=>{requestAnimationFrame((()=>requestAnimationFrame(e)))},av=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},lv=()=>{var e,t;return null!==(e=null==(t=av())?void 0:t.activationStart)&&void 0!==e?e:0},uv=function(e,t){void 0===t&&(t=-1);var r=av(),i="navigate";return 0>iv?r&&(document.prerendering||lv()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},hv=new WeakMap;function dv(e,t){var r=hv.get(t);return r||(r=new WeakMap,hv.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class cv{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var vv,fv=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{queueMicrotask((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},pv=e=>{var t=!1;return()=>{t||(e(),t=!0)}},gv=-1,mv=new Set,yv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,bv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of mv)t();isFinite(gv)||(gv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",bv,!0))}},_v=()=>{if(0>gv){var e,t=lv(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((e=>"hidden"===e.name&&e.startTime>=t)))?void 0:e.startTime;gv=null!=r?r:yv(),addEventListener("visibilitychange",bv,!0),addEventListener("prerenderingchange",bv,!0),nv((()=>{setTimeout((()=>{gv=yv()}))}))}return{get firstHiddenTime(){return gv},onHidden(e){mv.add(e)}}},wv=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},xv=[1800,3e3],kv=function(e,t){void 0===t&&(t={}),wv((()=>{var r,i=_v(),n=uv("FCP"),s=fv("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-lv(),0),n.entries.push(t),r(!0)))}));s&&(r=sv(e,n,xv,t.reportAllChanges),nv((i=>{n=uv("FCP"),r=sv(e,n,xv,t.reportAllChanges),ov((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Sv=[.1,.25],Cv=0,Iv=1/0,Tv=0,Ev=e=>{for(var t of e)t.interactionId&&(Iv=Math.min(Iv,t.interactionId),Tv=Math.max(Tv,t.interactionId),Cv=Tv?(Tv-Iv)/7+1:0)},Mv=()=>{var e;return vv?Cv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Pv=0;class Rv{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Pv=Mv(),this.l.length=0,this.u.clear()}T(){var e=Math.min(this.l.length-1,Math.floor((Mv()-Pv)/50));return this.l[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.l.at(-1),i=this.u.get(e.interactionId);if(i||10>this.l.length||e.duration>r.L){var n;if(i?e.duration>i.L?(i.entries=[e],i.L=e.duration):e.duration===i.L&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.u.set((i={id:e.interactionId,entries:[e],L:e.duration}).id,i),this.l.push(i)),this.l.sort(((e,t)=>t.L-e.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var Ov=e=>{var t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{var i=pv(e),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=t((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},Lv=[200,500];class Fv{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var Av=[2500,4e3],$v={onLCP(e,t){void 0===t&&(t={}),wv((()=>{var r,i=_v(),n=uv("LCP"),s=dv(t,Fv),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-lv(),0),n.entries=[o],r())},a=fv("largest-contentful-paint",o);if(a){r=sv(e,n,Av,t.reportAllChanges);var l=pv((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(Ov(l),removeEventListener(e.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});nv((i=>{n=uv("LCP"),r=sv(e,n,Av,t.reportAllChanges),ov((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=_v();kv(pv((()=>{var i,n=uv("CLS",0),s=dv(t,cv),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=fv("layout-shift",o);a&&(i=sv(e,n,Sv,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),nv((()=>{s.i=0,n=uv("CLS",0),i=sv(e,n,Sv,t.reportAllChanges),ov(i)})),setTimeout(i))})))},onFCP:kv,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=_v();wv((()=>{var i;"interactionCount"in performance||vv||(vv=fv("event",Ev,{durationThreshold:0}));var n,s=uv("INP"),o=dv(t,Rv),a=e=>{Ov((()=>{for(var t of e)o.h(t);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=fv("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=sv(e,s,Lv,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),nv((()=>{o.v(),s=uv("INP"),n=sv(e,s,Lv,t.reportAllChanges)})))}))}}};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.postHogWebVitalsCallbacks=$v,Jn.postHogWebVitalsCallbacks=$v,Jn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>$v;class Dv{constructor(e){this.disabled=!1===e;var t=_r(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var Nv="$copy_autocapture",qv=rs("[AutoCapture]");function jv(e,t){return t.length>e?t.slice(0,e)+"...":t}function Bv(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!No(t));return t}function Hv(e,t){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u,disableCaptureUrlHashes:h}=t;if(!No(e))return{props:{}};for(var d=[e],c=e;c.parentNode&&!qo(c,"body");)if(Bo(c.parentNode))d.push(c.parentNode.host),c=c.parentNode.host;else{if(!No(c.parentNode))break;d.push(c.parentNode),c=c.parentNode}var v,f,p=[],g={},m=!1,y=!1;if(ns(d,(e=>{var t=aa(e);if(qo(e,"a")){var r=e.getAttribute("href");m=!!(t&&r&&pa(r))&&(h?Gi(r):r)}cr(zo(e),"ph-no-capture")&&(y=!0),p.push(function(e,t,r,i,n){void 0===n&&(n=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};Zo.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?jv(1024,ga(e)):jv(1024,Wo(e)));var a=zo(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e}))),ns(e.attributes,(function(r){var s;if((!la(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&pa(r.value)&&(!kr(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=Ho(a).join(" ")),o["attr__"+r.name]=jv(1024,"href"===r.name&&n?Gi(a):a)}}));for(var l=1,u=1,h=e;h=Bv(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,o,a,l,h));var i=function(e){if(!aa(e))return{};var t={};return ns(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&pa(i)&&(t[r]=i)}})),t}(e);ss(g,i)})),y)return{props:{},explicitNoCapture:y};if(a||(p[0].$el_text=qo(e,"a")||qo(e,"button")?ga(e):Wo(e)),m){var b,_;p[0].attr__href=m;var w=null==(b=fs(m))?void 0:b.host,x=null==jn||null==(_=jn.location)?void 0:_.host;w&&x&&w!==x&&(v=m)}return{props:ss({$event_type:s.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:(f=p,function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return os(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[ya(t.toString())]=ya(r.toString())})),(n+=":")+os(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:ba(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return os(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(f)))},null!=(i=p[0])&&i.$el_text?{$el_text:null==(n=p[0])?void 0:n.$el_text}:{},v&&"click"===s.type?{$external_click_url:v}:{},g)}}var Uv={};function zv(e){return function(e,t){var r=Uv[e];if(r)return r;var i,n=t[e];if(br(i=n)&&-1!==i.toString().indexOf("[native code]")&&!jn.Zone)return Uv[e]=n.bind(t);var s=t.document;if(s&&br(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),s.head.removeChild(o)}catch(t){ts.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&br(n)?Uv[e]=n.bind(t):n}("MutationObserver",e)}function Vv(e,t){return Tr(e)&&e>=t}class Wv{ce(e){var t,r,i,n,s,o=this.de((null==e?void 0:e.__onCapture)||this.he.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,css_selector_ignorelist:null==e?void 0:e.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(e,t){this.ve=[],this.de=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.fe=e=>{var t=function(e){var t=Go(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Cr(t)||this.pe(t)||this.ve.push(t),this.ve.length&&xr(this.me)&&(this.me=Jn.setTimeout((()=>{this.ye()}),1e3))},this.ge=()=>{var e=Date.now();e%50==0&&this.ve.forEach((t=>{xr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.be=()=>{this.we=Date.now()},this.ke=()=>{"visible"===(null==Un?void 0:Un.visibilityState)&&(this.xe=Date.now())},this.instance=e,this.Se=this.ce(t),this._onCapture=this.Se.__onCapture}start(e){this.Ce(),this.Ie(),this.Me(),this.Te(),this._e(e)}_e(e){if(!this.Re){var t=zv(Jn);this.Re=new t((e=>{this.Le(e)})),this.Re.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.Re)||e.disconnect(),this.Re=void 0,Jn.removeEventListener("click",this.fe),Jn.removeEventListener("scroll",this.ge,{capture:!0}),Jn.removeEventListener("selectionchange",this.be),null==Un||Un.removeEventListener("visibilitychange",this.ke)}Le(e){this.Oe=Date.now()}Ce(){cs(Jn,"click",this.fe)}Ie(){cs(Jn,"scroll",this.ge,{capture:!0})}Me(){cs(Jn,"selectionchange",this.be)}Te(){cs(Un,"visibilitychange",this.ke)}pe(e){if(!e)return!0;if(!this.Se.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(Do(e.node))return!0;var r=this.ve.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!r&&!qo(e.node,"html")&&No(e.node)&&!function(e){if(!jn||sa(e))return!1;var{targetElementList:t}=oa(e,!1);return t.some((e=>qo(e,"a")))}(e.node)&&function(e,t){var r;if(!jn||sa(e))return!1;var i=Mr(t)?ta:null!==(r=null==t?void 0:t.css_selector_ignorelist)&&void 0!==r?r:ta,{targetElementList:n}=oa(e,!1);return!Qo(n,i)}(e.node,{css_selector_ignorelist:this.Se.css_selector_ignorelist}))}ye(){if(this.ve.length){clearTimeout(this.me),this.me=void 0;var e=this.ve;for(var t of(this.ve=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Oe&&this.Oe>=t.timestamp?this.Oe-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.we&&this.we>=t.timestamp?this.we-t.timestamp:void 0,t.visibilityChangedDelayMs=this.xe?Math.abs(t.timestamp-this.xe):void 0;var i=Vv(t.scrollDelayMs,this.Se.scroll_threshold_ms),n=Vv(t.selectionChangedDelayMs,this.Se.selection_change_threshold_ms),s=Vv(t.mutationDelayMs,this.Se.mutation_threshold_ms),o=Vv(t.absoluteDelayMs,1.1*this.Se.mutation_threshold_ms),a=Tr(t.scrollDelayMs)&&this.Se.scroll_threshold_ms>t.scrollDelayMs,l=Tr(t.mutationDelayMs)&&this.Se.mutation_threshold_ms>t.mutationDelayMs,u=Tr(t.selectionChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.selectionChangedDelayMs,h=Tr(t.visibilityChangedDelayMs)&&this.Se.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=Vv(t.visibilityChangedDelayMs,this.Se.selection_change_threshold_ms);i||s||o||n||d?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Oe,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:d}):this.Se.mutation_threshold_ms>t.absoluteDelayMs&&this.ve.push(t)}}this.ve.length&&xr(this.me)&&(this.me=Jn.setTimeout((()=>{this.ye()}),1e3))}}he(e,t){this.instance.capture("$dead_click",r({},t,Hv(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Wv(e,t);var Gv=rs("[ExternalScriptsLoader]"),Zv=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Gv.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Un?void 0:Un.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===t){var e=i[o];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!Un)return r("document not found");var i=Un.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)Un.head.appendChild(i);else{var n,s=Un.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):Un.body.appendChild(i)}};null!=Un&&Un.body?a():null==Un||Un.addEventListener("DOMContentLoaded",a)};Jn.__PosthogExtensions__=Jn.__PosthogExtensions__||{},Jn.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var i;if(e.config.strict_script_versioning)i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var n="/static/"+t+".js?v="+e.version;if("toolbar"===t){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=e.requestRouter.endpointFor("assets",n)}Zv(e,i,r)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Zv(e,o,r)}},Jn.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);Zv(e,i,r)};class Qv{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}isOptedOut(){return this.Se.cookieless_mode===So||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===ko}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get St(){var e=this.Ct.A(this.It);return $r(e)?1:cr(Dr,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t="localStorage"===e?Zh:Wh;if(!this.Tt||this.Tt!==t){this.Tt=t;var r="localStorage"===e?Wh:Zh;r.A(this.It)&&(this.Tt.A(this.It)||this.optInOut($r(r.A(this.It))),r.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==Hn?void 0:Hn.doNotTrack,null==Hn?void 0:Hn.msDoNotTrack,Jn.doNotTrack].some((e=>$r(e)))}}var Jv=rs("[Dead Clicks]"),Yv=()=>!0,Kv=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Fs)),i=e.instance.config.capture_dead_clicks;return Mr(i)?i:!!_r(i)||r};class Xv{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Fs]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt((()=>{this.Pt()})):this.stop()}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Jv.error("failed to load script",t):e()}))}Pt(){var e;if(Un){if(!this.Et&&null!=(e=Jn.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=_r(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=Jn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(Un),Jv.info("starting...")}}else Jv.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,Jv.info("stopping..."))}}var ef=rs("[SegmentIntegration]");var tf="posthog-js";function rf(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,h,d,c;if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(l=t.exception)?void 0:l.values)||[],g=p.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:t.tags};return i&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&(null==(f=e.exceptions)||f.sendExceptionEvent(m)),t}}class nf{constructor(e,t,r,i,n,s){this.name=tf,this.setupOnce=function(o){o(rf(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class sf{constructor(e){this.Rt=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ts.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){var e;this.Ft=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Rt)}destroy(){var e;null==(e=this.Ft)||e.call(this),this.Ft=void 0}doPageView(e,t){var r,i=this.At(e,t);return this.Ot={pathname:null!==(r=null==jn?void 0:jn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.At(e,null==(t=this.Ot)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ot)?void 0:e.pageViewId}}At(e,t){var r=this.Ot;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(xr(s)||xr(o)||xr(a)||xr(l)||xr(u)||xr(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?Nr(o/s,0,1,ts):1,c=s>1?Nr(a/s,0,1,ts):1,v=l>1?Nr(u/l,0,1,ts):1,f=l>1?Nr(h/l,0,1,ts):1;i=ss(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var of=["flags","surveys"],af={[ks]:{exposure:"hidden"},[Is]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Es]:{exposure:"event"},[Ms]:{exposure:"hidden"},[Ps]:{exposure:"event"},[Rs]:{exposure:"hidden"},[Os]:{exposure:"event"},[Ls]:{exposure:"event"},[Fs]:{exposure:"event"},[As]:{exposure:"hidden"},[$s]:{exposure:"event"},[Ds]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Us]:{exposure:"hidden"},[zs]:{exposure:"event"},[Ns]:{exposure:"event",shouldSkipFromEventProperties:e=>Cr(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Vs]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!_r(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[Ws]:{exposure:"event",storageGroup:"flags"},[Gs]:{exposure:"hidden"},[Zs]:{exposure:"hidden",storageGroup:"flags"},[Qs]:{exposure:"event",storageGroup:"flags"},[Js]:{exposure:"event",storageGroup:"flags",volatile:!0},[Ys]:{exposure:"event"},[Ks]:{exposure:"hidden"},[Xs]:{exposure:"hidden"},[eo]:{exposure:"hidden"},[to]:{exposure:"hidden",storageGroup:"surveys"},[ro]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[io]:{exposure:"event"},[no]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[so]:{exposure:"hidden"},[oo]:{exposure:"hidden"},[ao]:{exposure:"hidden"},[lo]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[uo]:{exposure:"hidden"},[ho]:{exposure:"hidden"},[co]:{exposure:"hidden"},[vo]:{exposure:"hidden"},[fo]:{exposure:"hidden"},[po]:{exposure:"hidden"},[go]:{exposure:"hidden"},[qs]:{exposure:"event"},[js]:{exposure:"event"},[Bs]:{exposure:"event"},[Hs]:{exposure:"event"},[bo]:{exposure:"event"},[_o]:{exposure:"event"},[wo]:{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"}},lf=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],uf=e=>{var t=af[e];if(t)return t;for(var[r,i]of lf)if(0===e.indexOf(r))return i},hf={flags:lo,surveys:ro},df=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],cf="main";class vf{constructor(e,t,i){if(void 0===i&&(i=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=i,this.props={},this.jt=!1,this.Bt=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&ts.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save(),jn){var n=()=>this.flush();cs(jn,"beforeunload",n,{capture:!1}),cs(jn,"pagehide",n,{capture:!1})}}zt(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return Tr(t)&&t>0?t:0}isDisabled(){return!!this.Vt}Ht(e){-1===df.indexOf(e.persistence.toLowerCase())&&(ts.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var i=[...Qh,...e];return r({},Zh,{F(e){try{var r={};try{r=Wh.F(e)||{}}catch(e){}var i,n=JSON.parse(Zh.A(e)||"{}");if(t){var s={};for(var o in r){var a=r[o];Cr(a)||""===a||(s[o]=a)}i=ss(n,s)}else i=ss(r,n);return Zh.q(e,i),i}catch(e){}return null},q(e,t,r,n,s,o){var a=Zh.q(e,t,void 0,void 0,o);try{var l={};i.forEach((e=>{t[e]&&(l[e]=t[e])})),Object.keys(l).length&&Wh.q(e,l,r,n,s,o)}catch(e){Zh.D(e)}return a},P(e,t){try{null==jn||jn.localStorage.removeItem(e),Wh.P(e,t)}catch(e){Zh.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Zh.N()?(t=Zh,n=!0):"localstorage+cookie"===s&&i.N()?(t=i,n=!0):"sessionstorage"===s&&Xh.N()?t=Xh:"memory"===s?t=Yh:"cookie"===s?t=Wh:i.N()?(t=i,n=!0):t=Wh,this.Dt=n,t}Wt(e){return this.Bt+"__"+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=null!=e?e:this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[lo];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return ns(this.props,((t,r)=>{var i=uf(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===Vs?()=>this.Gt():()=>!1))return;i.transformToEventProperties&&ss(e,i.transformToEventProperties(t))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,(()=>!1)))return;e[r]=t}})),e}load(){if(!this.Vt){var e=this.Ct.F(this.Bt);e&&(this.props=ss({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of of){var t=Zh.F(this.Wt(e));if(t&&!wr(t)){var r=this.Qt(e);r.persisted=!0,this.Jt(e)||(r.fingerprint=this.Yt(t,e)),this.Kt(e,t)||ss(this.props,t)}}}Jt(e){return Object.keys(this.props).some((t=>{var r;return(null==(r=uf(t))?void 0:r.storageGroup)===e}))}Kt(e,t){var r=hf[e];if(!r)return!1;var i=t[r],n=this.props[r];return Tr(i)&&Tr(n)&&n>i}refreshKey(e){var t;if(!this.Vt){var r=this.Nt?null==(t=uf(e))?void 0:t.storageGroup:void 0,i=r?Zh.F(this.Wt(r)):this.Ct.F(this.Bt);if(i&&e in i)this.Xt(e,i[e]);else{if(r){var n=this.Ct.F(this.Bt);if(n&&e in n)return void this.Xt(e,n[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?xr(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),e)):this.rr()}}flush(){xr(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.Bt,this.props,cf))}ir(){var{main:e,groups:t}=this.sr();for(var r of(this.nr(this.Ct,this.Bt,e,cf),of)){var i,n=t[r];(!wr(n)||null!=(i=this.$t[r])&&i.persisted)&&this.nr(Zh,this.Wt(r),n,r)}}sr(){var e={},t={};for(var r of of)t[r]={};return ns(this.props,((r,i)=>{var n,s=null==(n=uf(i))?void 0:n.storageGroup;s?t[s][i]=r:e[i]=r})),{main:e,groups:t}}Yt(e,t){if(t===cf)return JSON.stringify(e)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var r={};return ns(e,((e,t)=>{var i;r[t]=null!=(i=uf(t))&&i.volatile?"__volatile__":e})),JSON.stringify(r)}nr(e,t,r,i){var n=this.Qt(i);if(i===cf||n.dirty||xr(n.fingerprint)){var s;try{if((s=this.Yt(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.q(t,r,this.ar,this.lr,this.ur,this.Se.debug)?(n.dirty=!1,i!==cf&&(n.persisted=!0),xr(s)||(n.fingerprint=s)):this.Se.debug&&ts.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(xr(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.Bt,!1),this.Ct.P(this.Bt,!0),!t&&this.qt)for(var r of of)Zh.P(this.Wt(r));t?delete this.$t[cf]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(_r(e)){xr(t)&&(t="None"),this.ar=xr(r)?this.hr:r;var i=!1;if(ns(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Xt(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(_r(e)){this.ar=xr(t)?this.hr:t;var r=!1;if(ns(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.Xt(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.jt){var e=uc(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);wr(us(e))||this.register(e),this.jt=!0}}update_search_keyword(){var e;this.register((e=null==Un?void 0:Un.referrer)?dc(e):{})}update_referrer_info(){var e;this.register_once({$referrer:fc(),$referring_domain:null!=Un&&Un.referrer&&(null==(e=fs(Un.referrer))?void 0:e.host)||vc},void 0)}set_initial_person_info(){this.props[vo]||this.props[fo]||this.register_once({[po]:pc(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};ns([fo,vo],(t=>{var r=this.props[t];r&&ns(r,(function(t,r){e["$initial_"+fr(r)]=t}))}));var t=this.props[po];if(t){var r=function(e,t){void 0===t&&(t=!1);var r=gc(e,t),i={};return ns(r,(function(e,t){i["$initial_"+fr(t)]=e})),i}(t,this.Se.disable_capture_url_hashes);ss(e,r)}return e}safe_merge(e){return ns(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=i?this.Ht(e):this.Ct,s=this.Ut(e);if(i||s!==this.Nt){var o=this.props;this.clear(),this.Ct=n,this.Nt=s,this.props=o,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[Ts]||{};r[e]=t,this.Xt(Ts,r),this.save()}remove_event_timer(e){var t=this.props[Ts]||{},r=t[e];return xr(r)||(delete t[e],this.Xt(Ts,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var r;this.props[e]=t,null!=(r=uf(e))&&r.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t,r=null==(t=uf(e))?void 0:t.storageGroup;r&&(this.Qt(r).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}}var ff=rs("[RateLimiter]");class pf{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ff.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void ff.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(co))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(co,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var gf=rs("[RemoteConfig]");class mf{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=Jn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}cr(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}vr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return gf.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void gf.warn("Remote config is disabled. Falling back to local config.");this.cr((e=>{if(!e)return gf.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr((e=>{this.pr(e),this.gr()}));this.pr(e),this.gr()}))}catch(e){gf.error("Error loading remote config",e)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}refresh(){!this._instance.mr()&&Un&&"hidden"!==Un.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var e;if(!this.yr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.yr=setInterval((()=>{this.refresh()}),t))}}pr(e){var t;e||gf.error("Failed to fetch remote config from PostHog."),this._instance.pr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var yf=3e3;class bf{constructor(e,t){this.br=!0,this._r=[],this.wr=Nr((null==t?void 0:t.flush_interval_ms)||yf,250,5e3,ts.createLogger("flush interval"),yf),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=this._r.length>0?this.Tr():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.Er(r({},e,{transport:"sendBeacon"}))}))}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout((()=>{if(this.Ir(),this._r.length>0){var t=this.Tr(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&yr(r.data)&&ns(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.Er(r)};for(var i in t)r()}}),this.wr))}Er(e){try{this.kr(e)}catch(e){ts.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return ns(this._r,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;xr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._r=[],e}}var _f=["retriesPerformedSoFar"];class wf{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!xr(jn)&&"onLine"in jn.navigator&&(this.Rr=jn.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},cs(jn,"online",this.Or),cs(jn,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,_f);Er(t)&&(n.url=Rh(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.st(r({retriesPerformedSoFar:t},n));0===e.statusCode&&ts.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==n.callback||n.callback(e)}}))}st(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(t),i=Date.now()+r;this._r.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ts.warn(n),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),0===this._r.length)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout((()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()}),this.Pr)}Lr(){var e=Date.now(),t=[],r=this._r.filter((r=>e>r.retryAt||(t.push(r),!1)));if(this._r=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,xr(jn)||(this.Or&&(jn.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(jn.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){ts.error(e)}this._r=[]}}class xf{constructor(e){this.Dr=()=>{var e,t,r,i;this.Nr||(this.Nr={});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.Nr.lastScrollY=Math.ceil(s),this.Nr.maxScrollY=Math.max(s,null!==(e=this.Nr.maxScrollY)&&void 0!==e?e:0),this.Nr.maxScrollHeight=Math.max(o,null!==(t=this.Nr.maxScrollHeight)&&void 0!==t?t:0),this.Nr.lastContentY=a,this.Nr.maxContentY=Math.max(a,null!==(r=this.Nr.maxContentY)&&void 0!==r?r:0),this.Nr.maxContentHeight=Math.max(l,null!==(i=this.Nr.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){cs(jn,"scroll",this.Dr,{capture:!0}),cs(jn,"scrollend",this.Dr,{capture:!0}),cs(jn,"resize",this.Dr)}scrollElement(){if(!this.qr)return null==jn?void 0:jn.document.documentElement;var e=yr(this.qr)?this.qr:[this.qr];for(var t of e){var r=null==jn?void 0:jn.document.querySelector(t);if(r)return r}}jr(e){var t="y"===e?"scrollTop":"scrollLeft";if(this.qr){var r=this.scrollElement();return r&&r[t]||0}return jn?"y"===e?jn.scrollY||jn.pageYOffset||jn.document.documentElement.scrollTop||0:jn.scrollX||jn.pageXOffset||jn.document.documentElement.scrollLeft||0:0}scrollY(){return this.jr("y")}scrollX(){return this.jr("x")}}var kf=e=>pc(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class Sf{constructor(e,t,r,i){this.Br=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[ho]:r})}},this._instance=e,this.Vr=t,this.zr=r,this.Ur=i||kf,this.Vr.onSessionId(this.Br)}Hr(){return this.zr.props[ho]}getSetOnceProps(){var e,t=null==(e=this.Hr())?void 0:e.props;return t?"r"in t?gc(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return ns(us(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+fr(r)]=t})),e}}class Cf{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.Wr[e]||[])r(t);for(var i of this.Wr["*"]||[])i(e,t)}}var If=rs("[SessionId]");class Tf{on(e,t){return this.Gr.on(e,t)}constructor(e,t,r){var i;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new Cf,this.Kr=(e,t)=>!(!Er(e)||!Er(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===So)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||Vu,this.ri=r||Vu;var n=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Nr(this.Se.session_idle_timeout_seconds||1800,60,36e3,If.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+n+"_window_id",this.si="ph_"+n+"_primary_window_exists",this.oi()){var s=Xh.F(this.ni),o=Xh.F(this.si);s&&!o?this.Xr=s:Xh.P(this.ni),Xh.q(this.si,!0)}if(null!=(i=this.Se.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this.Se.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){If.error("Invalid sessionID in bootstrap",e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return xr(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter((t=>t!==e))}}oi(){return"memory"!==this.Se.persistence&&!this.zr.Vt&&Xh.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&Xh.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?Xh.F(this.ni):null}di(e){var t=this.Zr;return!Cr(t)&&!Cr(e)&&5e3>Math.abs(e-t)}ai(e,t,r){var i=t!==this._sessionActivityTimestamp,n=!(e!==this.ei||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.ei=e,n&&!i||n&&this.di(t)||(this.Zr=t,this.zr.register({[Us]:[t,e,r]}))}ci(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return Er(t)&&t>0}vi(){this.ci()?this.zr.refreshKey(Us):(this.zr.flush(),this.zr.load())}fi(){var e;if(!Cr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,t,r]=this.pi();t===this.ei&&r===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[Us]:[this._sessionActivityTimestamp,null!==(e=this.ei)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi(),t=Er(e)?e:0,r=Er(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,r)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[Us];return yr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&jn&&(jn.removeEventListener(Mo,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&Xh.P(this.si)},cs(jn,Mo,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Se.cookieless_mode===So)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[,i,n]=this.pi(),s=this.gi(),o=this.hi(),a=Er(n)&&Math.abs(r-n)>864e5,l=!1,u=!1,h=!i,d=i,c=!h&&!e&&this.Kr(r,s);c&&((c=this.mi(r))||If.info("cross-tab refresh kept the session alive",{sessionId:i}),[,i,n]=this.pi()),h||c||a?(i=this.ti(),o=this.ri(),If.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:h,activityTimeout:c,sessionPastMaximumLength:a}}),n=r,l=!0):(o||(o=this.ri(),l=!0),(u=i!==d)&&(If.info("adopted cross-tab session id",{sessionId:i,windowId:o}),l=!0));var v=Er(s)&&e&&!a?s:r,f=Er(n)?n:(new Date).getTime();this.ui(o),this.ai(i,v,f),e||this.ii();var p={noSessionId:h,activityTimeout:c,sessionPastMaximumLength:a,crossTabAdoption:u};return l&&this.Qr.forEach((e=>e(i,o,p))),{sessionId:i,windowId:o,sessionStartTimestamp:f,changeReason:l?p:void 0,lastActivityTimestamp:s}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout((()=>{if(!this.Yr)if(this.mi((new Date).getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:e})}else this.ii()}),1.1*this.sessionTimeoutMs))}}var Ef=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&dr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>dr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver};function Mf(){return Mf=t((function*(){var e=null==Hn?void 0:Hn.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return kr(r)&&r.length>0?r:void 0}catch(e){return void ts.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})),Mf.apply(this,arguments)}var Pf="custom",Rf="i.posthog.com",Of=/^\/static\//;class Lf{constructor(e){this.bi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Rf,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.bi[this.apiHost]||(this.bi[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":Pf),this.bi[this.apiHost]}wi(e){if(Of.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this.wi(t);if(r)return""+r+t}if(this.region===Pf)return this.apiHost+t;var i=Rf+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Ff=rs("[PostHog ExternalIntegrations]"),Af={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class $f{constructor(e){this._instance=e}Mt(e,t){var r;null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return Ff.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;!i||null!=(r=Jn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e.Mt(Af[t],(()=>{var r;null==(r=Jn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=Jn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]&&(null==(s=Jn.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[t])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}var Df,Nf={},qf=0,jf=()=>{},Bf='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Hf="Surveys module not available",Uf="sanitize_properties is deprecated. Use before_send instead",zf="Invalid value for property_denylist config: ",Vf="posthog",Wf=!Th&&-1===(null==Qn?void 0:Qn.indexOf("MSIE"))&&-1===(null==Qn?void 0:Qn.indexOf("Mozilla")),Gf=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ds(null==Un?void 0:Un.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:jf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:zn&&kr(null==zn?void 0:zn.search)&&-1!==zn.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==jn||null==(t=jn.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){ts.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:To,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:yf},error_tracking:{},_onCapture:jf},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:Xo,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)}))(e))},Zf=[["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"]],Qf=e=>{var t={};for(var[r,i]of Zf)xr(e[r])||(t[i]=e[r]);var n=ss({},t,e),s=e.__preview_external_dependency_versioned_paths;return xr(s)||(xr(e.strict_script_versioning)&&(n.strict_script_versioning=!!s),kr(s)&&xr(e.asset_host)&&(n.asset_host=s)),yr(e.property_blacklist)&&(xr(e.property_denylist)?n.property_denylist=e.property_blacklist:yr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ts.error(zf+e.property_denylist)),n};class Jf{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){ts.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Yf{ki(e,t){if(e){var r=this.Si.indexOf(e);-1!==r&&this.Si.splice(r,1)}return this.Si.push(t),null==t.initialize||t.initialize(),t}Ci(){return this.config.cookieless_mode===So||this.config.cookieless_mode===ko&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new Jf,this.Ii=!1,this.version=Xn.LIB_VERSION,this.Ti=new Cf,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Gf(),this.SentryIntegration=nf,this.sentryIntegration=e=>function(e,t){var r=rf(e,t);return{name:tf,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new xf(this),this.pageViewManager=new sf(this),this.rateLimiter=new pf(this),this.requestRouter=new Lf(this),this.consent=new Qv(this),this.externalIntegrations=new $f(this);var t=null!==(e=Yf.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=kr(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=kr(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>ts.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Vf){var i,n=null!==(i=Nf[r])&&void 0!==i?i:new Yf;return n._init(e,t,r),Nf[r]=n,Nf[Vf][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;void 0===t&&(t={});var o=kr(e)?e.trim():"";if(!o)return ts.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={},t.debug=this.Oi(t.debug),this.Li=t,this.Fi=[],t.person_profiles?this.Pi=t.person_profiles:t.process_person&&(this.Pi=t.process_person);var a=Gf(t.defaults),l=Qf(t),u=ss({},a,l,{name:i,token:o});_r(a.rageclick)&&_r(l.rageclick)&&(u.rageclick=ss({},a.rageclick,l.rageclick)),_r(a.session_recording)&&_r(l.session_recording)&&(u.session_recording=ss({},a.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&ts.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Gu;var h=this.Ai();this.persistence=new vf(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new vf(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.$i=new bf((e=>this.Di(e)),this.config.request_queue_config),this.Ni=new wf(this),this.__request_queue=[];var v=this.Ci();if(v||(this.sessionManager=new Tf(this),this.sessionPropsManager=new Sf(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ts.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.qi(v)}),0)):(ts.info("Initializing extensions synchronously"),this.qi(v)),Xn.DEBUG=Xn.DEBUG||this.config.debug,Xn.DEBUG&&ts.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var f=t.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(uo);if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===Co)this.identify(f);else if(t.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===Io)ts.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(Vu()),y=t.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(uo,t.bootstrap.isIdentifiedID?Io:Co),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:yo,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(Vu());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(uo,Co)}return cs(jn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||Vu();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(uo,Io)),t()},n=r.user();"then"in n&&br(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||ef.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ef.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ef.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Po),identify:e=>t(e,Oo),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this.ji())):this.ji(),br(this.config._onCapture)&&this.config._onCapture!==jf&&(ts.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ts.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 Mf.apply(this,arguments)}().then((e=>{e&&this.register({[Cs]:e})})).catch(jf),this}qi(e){var t,i,n,s,o,a,l,u=performance.now(),h=r({},Yf.__defaultExtensionClasses,this.config.__extensionClasses),d=[];h.featureFlags&&this.Si.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new h.featureFlags(this)),h.exceptions&&this.Si.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Si.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Si.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Si.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Si.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Si.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Si.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Si.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Si.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Si.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Si.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Si.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Kv)),h.toolbar&&this.Si.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Si.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this.Si.forEach((e=>{e.initialize&&d.push((()=>{null==e.initialize||e.initialize()}))})),d.push((()=>{if(this.Bi){var e=this.Bi;this.Bi=void 0,this.pr(e)}})),this.Hi(d,u)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Hi(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){ts.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[bo]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[_o]:i}),this.config.__preview_deferred_init_extensions&&ts.info("PostHog extensions initialized ("+i+"ms)")}pr(e){var t;if(!Un||!Un.body)return ts.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Bi=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=cr(e.supportedCompression,Gu)?Gu:cr(e.supportedCompression,Zu)?Zu:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:To}),this.Si.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}ji(){try{this.config.loaded(this)}catch(e){ts.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&null!=zn&&zn.hostname){var e=zn.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()}),1),this.Wi=new mf(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.$i)||e.enable())}_dom_loaded(){this.is_capturing()&&is(this.__request_queue,(e=>this.Di(e))),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,r,i;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(Ro),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(r=this.$i)||r.unload(),null==(i=this.Ni)||i.unload()):this.Gi()&&this.capture(Ro,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?Wf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(xr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4,s.url=Dh(s.url,s.compression);var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=Nh.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Gu&&Zn&&"undefined"!=typeof Promise&&!Mh?$h(s).then((e=>{l(e)})).catch((t=>{if(or(t))return Mh=!0,void l(r({},s,{compression:void 0,url:Dh(e.url,void 0)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return or(e)||t===ir})(t)&&(Mh=!0),l(s)})):l(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){qf++;try{var t,r=[],i=[],n=[];is(e,(e=>{if(e)if(yr(t=e[0]))n.push(e);else if(br(e))try{e.call(this)}catch(t){ts.error("Error executing queued PostHog call",e,t)}else yr(e)&&"alias"===t?r.push(e):yr(e)&&-1!==t.indexOf("capture")&&br(this[t])?n.push(e):i.push(e)}));var s=function(e,t){is(e,(function(e){try{if(yr(e[0])){var r=t;ns(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){ts.error("Error executing queued PostHog call",e,t)}}))};s(r,this),s(i,this),s(n,this)}finally{qf--}}push(e){if(qf>0&&yr(e)&&kr(e[0])){var t=Yf.prototype[e[0]];br(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!xr(e)&&kr(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=t&&t.$current_url&&!kr(null==t?void 0:t.$current_url)&&(ts.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.Zi||ts.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=Wi(null==i?void 0:i.uuid,Vu),f={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},c,v)};e===Po&&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),(null==i?void 0:i.$set)&&(f.$set=null==i?void 0:i.$set);var p=null==i?void 0:i.$unset;p&&(f.$unset=p);var g=this.Qi(null==i?void 0:i.$set_once,e!==Lo,e===Oo);if(g&&(f.$set_once=g),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=e=>kr(e)?e.slice(0,s):e,l=new Set,f=function e(t,r){return t!==Object(t)?a?a(t):t:l.has(t)?void 0:(l.add(t),yr(t)?(i=[],is(t,(t=>{i.push(e(t))}))):(i={},ns(t,((t,r)=>{l.has(t)||(i[r]=e(t,r))}))),i);var i}(o)),f.timestamp=c,xr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=d),e===yu.DISMISSED||e===yu.SENT){var m=null==t?void 0:t[bu.SURVEY_ID],y=null==t?void 0:t[bu.SURVEY_ITERATION];Du({id:m,current_iteration:y}),f.$set=r({},f.$set,{[Su({id:m,current_iteration:y},e===yu.SENT?"responded":"dismissed")]:!0})}else e===yu.SHOWN&&(f.$set=r({},f.$set,{[bu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var b=null==t?void 0:t.$product_tour_type;b&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+b]:(new Date).toISOString()}))}var _=r({},f.properties.$set,f.$set);if(wr(_)||this.setPersonPropertiesForFlags(_),!Ir(this.config.before_send)){var w=this.it(f);if(!w)return;(f=w).uuid=Wi(f.uuid,Vu)}this.Ti.emit("eventCaptured",f);var x={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",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.Di(x):this.$i.enqueue(x),f}ts.critical("This capture call is ignored due to client rate limiting.")}}else ts.error("No event name provided to posthog.capture")}else ts.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Ci()&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!kr(a.distinct_id)&&!Tr(a.distinct_id)||Sr(a.distinct_id))&&ts.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(e,t,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!Qn)return{};var l,u,h=e?[...sc,...t||[]]:[],[d,c]=function(e){for(var t=0;Hi.length>t;t++){var[r,i]=Hi[t],n=r.exec(e),s=n&&(br(i)?i(n,e):i);if(s)return s}return["",""]}(Qn),v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={detectGoogleSearchApp:r},p=ss(us({$os:d,$os_version:c,$browser:qi(Qn,navigator.vendor,v,f),$device:Ui(Qn),$device_type:zi(Qn,{userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(s=navigator)?void 0:s.maxTouchPoints,screenWidth:null==jn||null==(o=jn.screen)?void 0:o.width,screenHeight:null==jn||null==(a=jn.screen)?void 0:a.height,devicePixelRatio:null==jn?void 0:jn.devicePixelRatio}),$timezone:mc(),$timezone_offset:yc()}),{$current_url:ms(i?Gi(null==zn?void 0:zn.href):null==zn?void 0:zn.href,h,ac),$host:null==zn?void 0:zn.host,$pathname:null==zn?void 0:zn.pathname,$raw_user_agent:Qn.length>1e3?Qn.substring(0,997)+"...":Qn,$browser_version:Bi(Qn,navigator.vendor,v,f),$browser_language:cc(),$browser_language_prefix:(u=cc(),"string"==typeof u?u.split("-")[0]:void 0),$screen_height:null==jn?void 0:jn.screen.height,$screen_width:null==jn?void 0:jn.screen.width,$viewport_height:null==jn?void 0:jn.innerHeight,$viewport_width:null==jn?void 0:jn.innerWidth,$lib:Xn.LIB_NAME,$lib_version:Xn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Xn.SDK_DIST_CHANNEL&&(p.$sdk_dist_channel=Xn.SDK_DIST_CHANNEL),p}(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{sessionId:d,windowId:c}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=d,a.$window_id=c}this.sessionPropsManager&&ss(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&ss(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Ni)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Pf&&(a.$lib_custom_api_host=this.config.api_host),u=e!==Po||s?e!==Ro||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=ss(a,u),e===Po&&Un&&(a.title=Un.title),!xr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Qn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=ss({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),yr(this.config.property_denylist)?ns(this.config.property_denylist,(function(e){delete a[e]})):ts.error(zf+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(ts.error(Uf),a=p(a,e));var g=this.Ji();return a.$process_person_profile=g,g&&!s&&this.Yi("_calculate_event_properties"),a}Qi(e,t,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.Ji())return e;if(this.Ii&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=ss({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(ts.error(Uf),o=a(o,"$set_once")),t&&(this.Ii=!0),wr(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Ki(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.Ti.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Hf}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Hf})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Hf})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=qu),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:Hf}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:Hf})}Xi(e){return!e||Sr(e)?(ts.critical("Unique user id has not been set in posthog.identify"),!1):e===yo?(ts.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ts.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return ts.uninitializedWarning("posthog.identify");if(Tr(e)&&(e=e.toString(),ts.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Xi(e)&&this.Yi("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ss)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(Is)&&(this.unregister(Is),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(uo)||Co)===Co;e!==i&&s?(this.persistence.set_property(uo,Io),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(Oo,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this.Ri=jh(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(so))}}setPersonProperties(e,t){if((e||t)&&this.Yi("posthog.setPersonProperties")){var r=jh(this.get_distinct_id(),e,t);this.Ri!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ri=r):ts.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(yr(e)?e:[e]).filter((e=>kr(e)&&e.length>0));0!==r.length&&this.Yi("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ri=null)}group(e,t,i){if(e&&t){var n=this.getGroups(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(Lo,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else ts.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.Yi("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l,u;if(ts.info("reset"),!this.__loaded)return ts.uninitializedWarning("posthog.reset");var h,d=this.get_property(Ss),c=this.get_property(Cs),v=this.get_property(Ds);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),xr(v)||null==(h=this.persistence)||h.register({[Ds]:v}),null==(i=this.surveys)||i.reset(),null==(n=this.Wi)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.persistence)||l.set_property(uo,Co),null==(u=this.sessionManager)||u.resetSessionId(),this.Ri=null,this.config.cookieless_mode===So)this.register_once({distinct_id:yo,$device_id:null},"");else{var f=this.config.get_device_id(Vu());this.register_once({distinct_id:f,$device_id:e?f:d},""),e||xr(c)||this.register({[Cs]:c})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.tn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(e,t){return e===this.get_property(ks)?(ts.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(xr(t)&&(t=this.get_distinct_id()),e!==t?(this.Ki(Is,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ts.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(_r(e)){var i,n,s,o,a,l,u,h,d,c,v;ss(this.config,Qf(e));var f=this.Ai();null==(i=this.persistence)||i.update_config(this.config,t,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new vf(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.Oi(this.config.debug);Mr(p)&&(this.config.debug=p),Mr(this.config.debug)&&(this.config.debug?(Xn.DEBUG=!0,Zh.N()&&Zh.q("ph_debug",!0),ts.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(Xn.DEBUG=!1,Zh.N()&&Zh.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.rn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){Xn.LIB_NAME=e,Xn.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Yf.nn}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Vf;return t!==Vf&&(t=Vf+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(uo))===Io||(null==(t=this.sessionPersistence)?void 0:t.get_property(uo))===Io}Ji(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===To&&!this._isIdentified()&&wr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Is])&&(null==(t=this.persistence)||null==(t=t.props)||!t[go]))}Gi(){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.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return"never"===this.config.person_profiles?(ts.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ki(go,!0),!0)}Ai(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ko)}rn(){var e,t,r,i,n=this.Ai();return(null==(e=this.persistence)?void 0:e.Vt)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.Vt)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==So){if(this.Ci()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Tf(this),this.pageViewManager=new sf(this),this.persistence&&(this.sessionPropsManager=new Sf(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=Yf.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.ki(this.sessionRecording,new l(this)),this.Ui&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Ui)))}var u,h;this.consent.optInOut(!0),this.rn(),this.zi(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==ko&&(null==(u=this.surveys)||u.loadIfEnabled()),(xr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else ts.warn(Bf)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==So?(this.config.cookieless_mode===ko&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===ko&&(this.register({distinct_id:yo,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi())):ts.warn(Bf)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===So||(this.config.cookieless_mode===ko?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return Hn?Ef(Hn,this.config.custom_blocked_useragents):void 0}Vi(){Un&&("visible"===Un.visibilityState?this.Ei||(this.Ei=!0,this.capture(Po,{title:Un.title},{send_instantly:!0}),this.Mi&&(Un.removeEventListener(Eo,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),cs(Un,Eo,this.Mi)))}debug(e){!1===e?(null==jn||jn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==jn||jn.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}))}mr(){var e,t,r,i,n,s,o=this.Li||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ts.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):(r="advanced_disable_decide",!1,i=ts,n=(t="advanced_disable_flags")in(e=o)&&!Ir(e[t]),s=r in e&&!Ir(e[r]),n?e[t]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]))}it(e){var t;if(Ir(this.config.before_send))return e;var r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Rr),i=yr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var s of i){if(n=s(n),Ir(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return cr(tr,e.event)?ts.warn(o+". This can cause unexpected behavior."):ts.info(o),null}n.properties&&!wr(n.properties)||ts.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Ir(n.properties[a]))return ts.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var e;return null==(e=this.pageViewManager.Ot)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}Oi(e){var t=Mr(e)&&!e,r=Zh.N()&&"true"===Zh.A("ph_debug");return!t&&(!!r||e)}}Yf.__defaultExtensionClasses={},Yf.nn={trace:Df=()=>{},debug:Df,info:Df,warn:Df,error:Df,fatal:Df},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=ls(e.prototype[t[r]])}(Yf,["identify"]);var Kf=rs("[ExceptionAutocapture]"),Xf=rs("[TracingHeaders]"),ep=rs("[Web Vitals]"),tp=9e5,rp="disabled",ip="lazy_loading",np="awaiting_config",sp="missing_config";rs("[SessionRecording]"),rs("[SessionRecording]");var op="[SessionRecording]",ap=rs(op),lp=rs("[Heatmaps]");function up(e){return _r(e)&&"clientX"in e&&"clientY"in e&&Tr(e.clientX)&&Tr(e.clientY)}var hp=rs("[Product Tours]"),dp=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(As))},cp=["$set_once","$set"],vp=rs("[SiteApps]"),fp="Error while initializing PostHog app with config id ";function pp(e,t,r){if(Ir(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class gp{constructor(e){this.sn=new Cf,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e,t;xr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!xr(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this.vn)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.cn)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.cn.has(e)||this.cn.has(null==t?void 0:t.event))&&this.vn&&(null==(r=this.vn)?void 0:r.size)>0&&this.vn.forEach((e=>{this.fn(t,e)&&this.sn.emit("actionCaptured",e.name)}))}pn(e){this.onAction("actionCaptured",(t=>e(t)))}fn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.an(e,r))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!pp(i,t.url,t.url_matching||"contains"))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){var r;if(null==t||!t.href)return!0;var i=this.bn(e);if(i.length>0)return i.some((e=>pp(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&pp((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}mn(e,t){var r;if(null==t||!t.text)return!0;var i=this.bn(e);if(i.length>0)return i.some((e=>pp(e.text,t.text,t.text_matching||"exact")||pp(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!Ir(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>pp(e,s,o))))}yn(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}bn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}dn(e,t){return null==t||!t.properties||0===t.properties.length||Uh(t.properties.reduce(((e,t)=>{var r=yr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class mp{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&Uh(e.propertyFilters,null==t?void 0:t.properties)}Cn(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}In(e,t,r){var i=(r===uu?this.wn:this.xn).get(e),n=[];return this.Tn((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Sn(s,t)}))}register(e){var t;xr(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==t.length&&(null==this.Pn&&(this.Pn=new gp(this._instance),this.Pn.init(),this.Pn.pn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Pn)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this.kn.get(t.name);r&&r.push(e.id),this.kn.set(t.name,r||[e.id])}})))})))}En(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.wn=this.Cn(e,uu),this.xn=this.Cn(e,hu))}onEvent(e,t){var r,i,n=this.Rn(),s=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(i=t.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.On(e,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:e,itemId:s}),void this.Ln([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:e,itemId:s}),void this.Fn(s)}if(this.xn.has(e)){var a=this.In(e,t,hu);a.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map((e=>e.id))}),this.Ln(a.map((e=>e.id))),a.forEach((e=>this.An(e.id))))}if(this.wn.has(e)){n.info("event name matched",{event:e,eventPayload:t,items:this.wn.get(e)});var l=this.In(e,t,uu);this.$n(l.map((e=>e.id)))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){0!==e.length&&(this._n=[...new Set([...this._n,...e])],this.Rn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter((t=>t!==e));var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter((e=>!t.has(e)));var r=this.Dn(),i=r.filter((e=>!t.has(e)));i.length!==r.length&&this.Nn(i)}Dn(){var e,t=this.qn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter((e=>!this.jn(e)))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}Bn(){return this.Pn}}class yp extends mp{constructor(e){super(e)}qn(){return io}Hn(){return yu.SHOWN}Tn(e){var t;null==(t=this._instance)||t.getSurveys(e)}An(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Rn(){return Mu}Nn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[io]:e})}jn(){return!1}On(e,t){var r;this.Tn((e=>{r=e.find((e=>e.id===t))}));var i=!r||function(e){var t,r,i,n=(null!==(t=null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)&&void 0!==t?t:0)>0;return e.schedule===mu||!(null==(i=e.conditions)||null==(i=i.events)||!i.repeatedActivation||!n)}(r);return i?e===yu.SHOWN?"consume":"ignore":e===yu.SHOWN?"persist":e===yu.DISMISSED||e===yu.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var bp="SDK is not enabled or survey functionality is not yet loaded",_p="Disabled. Not loading surveys.",wp=null!=jn&&jn.location?ys(jn.location.hash,"__posthog")||ys(location.hash,"state"):null,xp="_postHogToolbarParams",kp=rs("[Toolbar]"),Sp=rs("[FeatureFlags]"),Cp=rs("[FeatureFlags]",{debugEnabled:!0}),Ip="\" failed. Feature flags didn't load in time.",Tp=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},Ep=e=>{var t={};for(var[r,i]of os(e||{}))i&&(t[r]=i);return t},Mp="Refusing to render web experiment since the viewer is a likely bot",Pp={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>qh(t,e),not_regex:(e,t)=>!qh(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class Rp{get Se(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{Rp.Un("retrieved web experiments from the server"),t.zn=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t.zn&&(Rp.Un("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.zn)||r.set(e.feature_flag_key,e));var i=t._instance.getFeatureFlag(e.feature_flag_key);kr(i)&&e.variants[i]&&t.Vn(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];Rp.Wn(s,t._instance)&&t.Vn(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Rp.Un(Mp);else if(!this.Se.disable_web_experiments){if(Ir(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rp.Un("applying feature flags",e),e.forEach((e=>{var t;if(this.zn&&null!=(t=this.zn)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.zn)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Vn(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=Rp.getWindowLocation();if(null!=e&&e.search){var t=gs(null==e?void 0:e.search,"__experiment_id"),r=gs(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Rp.Un("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Gn(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Se.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Se.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Gn(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(Rp.Un("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Vn(i[0].name,t,i[0].variants[t].transforms))}static Wn(e,t){return!Ir(e.conditions)&&Rp.Zn(e,t)&&Rp.Qn(e)}static Zn(e,t){var r;if(Ir(e.conditions)||Ir(null==(r=e.conditions)?void 0:r.url))return!0;var i=Rp.getWindowLocation();if(i){var n,s,o,a=ws(t,i.href);return null==(n=e.conditions)||!n.url||Pp[null!==(s=null==(o=e.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](e.conditions.url,a)}return!1}static getWindowLocation(){return null==jn?void 0:jn.location}static Qn(e){var t;if(Ir(e.conditions)||Ir(null==(t=e.conditions)?void 0:t.utm))return!0;var r=uc();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Un(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];ts.info("[WebExperiments] "+e,r)}Vn(e,t,r){this._is_bot()?Rp.Un(Mp):"control"!==t?r.forEach((r=>{if(r.selector){var i;Rp.Un("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):Rp.Un("Control variants leave the page unmodified.")}_is_bot(){return Hn&&this._instance?Ef(Hn,this.Se.custom_blocked_useragents):void 0}}var Op=rs("[Conversations]"),Lp="Conversations not available yet.",Fp="console",Ap={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Se(){return this._instance.config}get zr(){return this._instance.persistence}ss(e){return this._instance.get_property(e)}os(){var e,t;return null!==(e=null==(t=this.zr)?void 0:t.Gt(this.Se.feature_flag_cache_ttl_ms))&&void 0!==e&&e}ls(){return!!this.os()&&(this.ns||this.Kn||(this.ns=!0,Sp.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}us(){var e,t=null!==(e=this.Se.evaluation_contexts)&&void 0!==e?e:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(Sp.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.rs=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Sp.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}hs(){return this.us().length>0}ds(){var e=this.Se.flag_keys;if(!xr(e)){if(yr(e))return e.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Sp.error("Invalid flag key found:",e,"Expected non-empty string"),t}));Sp.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:r}=this._instance,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.ss(Vs))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.ss(Qs))&&void 0!==s?s:{},l=r({},o,e),u=r({},a,t),h={};for(var[d,c]of Object.entries(l))h[d]={key:d,enabled:Qt(c),variant:Jt(c),reason:void 0,metadata:xr(null==u?void 0:u[d])?void 0:{id:0,version:void 0,description:void 0,payload:u[d]}};this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ss(Zs),t=this.ss(Ys),i=this.ss(Ks);if(!i&&!t)return e||{};var n=ss({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],h=null==t?void 0:t[o],d=xr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=xr(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.Jn||(Sp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.Jn=!0),n}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((r=>{var i=e[r];return{key:r,enabled:Qt(i),variant:Jt(i),payload:Zt(t[r])}}))}getFlagVariants(){var e=this.ss(Vs),t=this.ss(Ys);if(!t)return e||{};for(var r=ss({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(Sp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Jn=!0),r}getFlagPayloads(){var e=this.ss(Qs),t=this.ss(Ks);if(!t)return e||{};for(var r=ss({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(Sp.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Jn=!0),r}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.cs||(this._instance.Ti.emit("featureFlagsReloading",!0),this.cs=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.cs),this.cs=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.cs||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}vs(e){var t;if(this.fs(),!this._instance.mr())if(this.Kn)this.es=!0;else{var i=this.Se.token,n=this.ss(Ss),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this.zr)?void 0:t.get_initial_props())||{},this.ss(Xs)||{}),group_properties:this.ss(eo),timezone:mc()};Cr(n)||xr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.hs()&&(s.evaluation_contexts=this.us());var o=this.ds();xr(o)||(s.flag_keys=o);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Kn=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Se.disable_compression?void 0:Zu,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(200===e.statusCode&&(this.es||(this.$anon_distinct_id=void 0),n=!1),this.Kn=!1,!s.disable_flags||this.es){this.ts=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.zr)||i.register({[ao]:o}),u)Sp.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.es&&(this.es=!1,this.vs())}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Sp.warn('getFeatureFlag for key "'+e+Ip)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this.ss(Js)||void 0,l=this.ss(lo)||void 0,u=this.ss(so)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.ss(oo);d&&d!==c&&(u={},null==(h=this.zr)||h.register({[so]:u,[oo]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var v,f,p,g,m,y,b,_,w,x;yr(u[e])?u[e].push(o):u[e]=[o],null==(v=this.zr)||v.register({[so]:u});var k=this.getFeatureFlagDetails(e),S=[...null!==(f=this.ss(ao))&&void 0!==f?f:[]];xr(n)&&S.push("flag_missing");var C={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Se.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Se.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[e])||null,$used_bootstrap_value:!this.ts};xr(null==k||null==(m=k.metadata)?void 0:m.version)||(C.$feature_flag_version=k.metadata.version);var I,T=null!==(y=null==k||null==(b=k.reason)?void 0:b.description)&&void 0!==y?y:null==k||null==(_=k.reason)?void 0:_.code;T&&(C.$feature_flag_reason=T),null!=k&&null!=(w=k.metadata)&&w.id&&(C.$feature_flag_id=k.metadata.id),xr(null==k?void 0:k.original_variant)&&xr(null==k?void 0:k.original_enabled)||(C.$feature_flag_original_response=xr(k.original_variant)?k.original_enabled:k.original_variant),null!=k&&null!=(x=k.metadata)&&x.original_payload&&(C.$feature_flag_original_payload=null==k||null==(I=k.metadata)?void 0:I.original_payload),S.length&&(C.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",C)}if(i)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:Zt(s)}}}else Sp.warn('getFeatureFlagResult for key "'+e+Ip)}getRemoteConfigPayload(e,t){var r=this.Se.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.hs()&&(i.evaluation_contexts=this.us());var n=this.ds();xr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Se.disable_compression?void 0:Zu,timeout:this.Se.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return xr(r)?void 0:!!r}Sp.warn('isFeatureEnabled for key "'+e+Ip)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this.zr){this.Yn=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):e.featureFlags&&Sp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=e.requestId,c=e.evaluatedAt;if(yr(u)){Sp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;t&&t.register({[Ws]:u,[Vs]:v})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((e=>{var[t]=e;return y.has(t)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return y.has(t)})))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((e=>{var[t]=e;return y.has(t)}))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);t&&t.register(r({[Ws]:Object.keys(Ep(p)),[Vs]:p||{},[Qs]:g||{},[Zs]:m||{}},d?{[Js]:d}:{},c?{[lo]:c}:{}))}}}(e,this.zr,n,s,o,i),t||(this.ns=!1),this.ps(t)}}override(e,t){void 0===t&&(t=!1),Sp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return Sp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.zr.unregister(Ys),this.zr.unregister(Ks),this.ps(),Cp.info("All overrides cleared");if(yr(e)){var t=Tp(e);return this.zr.register({[Ys]:t}),this.ps(),Cp.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this.Jn=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.zr.unregister(Ys),Cp.info("Flag overrides cleared");else if(i.flags){if(yr(i.flags)){var n=Tp(i.flags);this.zr.register({[Ys]:n})}else this.zr.register({[Ys]:i.flags});Cp.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.zr.unregister(Ks),Cp.info("Payload overrides cleared")):i.payloads&&(this.zr.register({[Ks]:i.payloads}),Cp.info("Payload overrides set",{payloads:i.payloads}))),void this.ps()}if(e&&"object"==typeof e)return this.zr.register({[Ys]:e}),this.ps(),Cp.info("Flag overrides set",{flags:e});Sp.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:r}=this.gs();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this.ss(Gs)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this.zr)||n.register({[Ws]:Object.keys(Ep(l)),[Vs]:l}),this.ps()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this.ss(Gs),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this.zr)||r.unregister(Gs),null==(i=this.zr)||i.register({[Gs]:n}),e(n)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}ps(e){var{flags:t,flagVariants:r}=this.gs();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ss(Xs)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Xs]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=r({},this.ss(Xs)||{});e.forEach((e=>{delete i[e]})),this._instance.register({[Xs]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(Xs),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ss(eo)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[eo]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ss(eo)||{};this._instance.register({[eo]:r({},t,{[e]:{}})})}else this._instance.unregister(eo)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},$p={sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.ys)||!e.isStarted)}get status(){var e,t;return this.bs===np||this.bs===sp?this.bs:null!==(e=null==(t=this.ys)?void 0:t.status)&&void 0!==e?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=rp,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw ap.error("started without valid sessionManager"),new Error(op+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===So)throw new Error(op+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!(null==(e=this._instance.get_property(Ds))||!e.enabled),r=!this.Se.disable_session_recording,i=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return jn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.ws||null==(t=this.ys)||!t.isStarted){var r=!xr(Object.assign)&&!xr(Array.from);this.ws&&r?(this.xs(e),ap.info("starting")):(this.bs=rp,this.stopRecording())}}xs(e){var t,r,i;this.ws&&(this.bs!==np&&this.bs!==sp&&(this.bs=ip),null!=Jn&&null!=(t=Jn.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=Jn.__PosthogExtensions__)&&r.initSessionRecording?this.ks(e):null==(i=Jn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return ap.error("could not load recorder",t);this.ks(e)})))}stopRecording(){var e,t;null==(e=this._s)||e.call(this),this._s=void 0,null==(t=this.ys)||t.stop()}Cs(){var e,t;null==(e=this._s)||e.call(this),this._s=void 0,null==(t=this.ys)||t.discard()}Is(){var e,t;null==(e=this.zr)||e.unregister(zs),null==(t=this.zr)||t.unregister(Ns)}Ts(e,t){if(Ir(e))return null;var r,i=Tr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(ap.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Es(e){if(this.zr){var t,i,n=this.zr,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.Ts(null==(t=this.Se.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this.Ts(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Ir(a)&&this.Is();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[Ds]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:xr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this._s)||t.call(this),this._s=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Es(e),void this.Cs()):(this.Es(e),void this.startIfEnabledOrStop()):(this.bs===np&&(this.bs=sp,ap.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.ys)&&r.log?this.ys.log(e,t):ap.warn("log called before recorder was ready")}get Ss(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Ds);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ms(){var e,t,r=this._instance.get_property(Ds);if(!r)return!1;try{t="object"==typeof r?r:JSON.parse(r)}catch(e){return ap.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var i=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-i}ks(e){var t,r;if(null==(t=Jn.__PosthogExtensions__)||!t.initSessionRecording)return ap.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[wo]:!0});if(this.ys||(this.ys=null==(r=Jn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===sp||this.bs===np)return;return this.bs=np,ap.info("persisted remote config is stale, requesting fresh config before starting"),void new mf(this._instance).load()}this.bs=ip,this.ys.start(e)}onRRwebEmit(e){var t;null==(t=this.ys)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||null==(t=this.zr)||t.register({[js]:!0}),null==(e=this.ys)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||null==(t=this.zr)||t.register({[qs]:!0}),null==(e=this.ys)||e.overrideSampling()}overrideTrigger(e){var t,r;this.ys||null==(r=this.zr)||r.register({["url"===e?Bs:Hs]:!0}),null==(t=this.ys)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.ys)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.ys)||!r.tryAddCustomEvent(e,t))}}},Dp={autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new Dv(e.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get Se(){var e,t,r=_r(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}Fs(){if(this.isBrowserSupported()){if(jn&&Un){var e=e=>{e=e||(null==jn?void 0:jn.event);try{this.As(e)}catch(e){qv.error("Failed to capture event",e)}};if(cs(Un,"submit",e,{capture:!0}),cs(Un,"change",e,{capture:!0}),cs(Un,"click",e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e=e||(null==jn?void 0:jn.event);try{this.As(e,Nv)}catch(e){qv.error("Failed to capture copy/cut event",e)}};cs(Un,"copy",t,{capture:!0}),cs(Un,"cut",t,{capture:!0})}}}else qv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Os=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Es]:!!e.autocapture_opt_out}),this.Rs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,r=[];return null==(t=this.Ls)||t.forEach((t=>{var i=null==Un?void 0:Un.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Es];if(Cr(this.Rs)&&!Mr(r)&&!this.instance.mr())return!1;var i=null!==(t=this.Rs)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}As(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Go(e);jo(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&na(i,this.instance.config.rageclick)&&this.As(e,"$rageclick");var n=t===Nv;if(i&&function(e,t,r,i,n,s){var o,a,l,u,h,d;if(void 0===r&&(r=void 0),!jn||sa(e))return!1;if(null!=(o=r)&&o.url_allowlist&&!Uo(r.url_allowlist,s))return!1;if(null!=(a=r)&&a.url_ignorelist&&Uo(r.url_ignorelist,s))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var c=r.dom_event_allowlist;if(c&&!c.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:v,targetElementList:f}=oa(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(xr(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(f,r))return!1;if(!Qo(f,null==(u=r)?void 0:u.css_selector_allowlist))return!1;if(Qo(f,null!==(h=null==(d=r)?void 0:d.css_selector_ignorelist)&&void 0!==h?h:Yo))return!1;var p=jn.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return v?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Zo.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.Se,n,n?["copy","cut"]:void 0,this.instance)){var{props:s,explicitNoCapture:o}=Hv(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Os,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Nv){var l,u=Vo(null==jn||null==(l=jn.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return br(null==Un?void 0:Un.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.$s=(null==jn||null==(t=jn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ts.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,ts.info("History API monitoring stopped")}monitorHistoryChanges(){jn&&jn.history&&(this.Ns("pushState"),this.Ns("replaceState"),this.qs())}Ns(e){var t;if(jn&&(null==(t=jn.history[e])||!t.__posthog_wrapped__)){var r=this;bs(jn.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.js(e)}))}}js(e){try{var t,r=null==jn||null==(t=jn.location)?void 0:t.pathname;if(!r)return;r!==this.$s&&this.isEnabled&&this._instance.capture(Po,{navigation_type:e}),this.$s=r}catch(t){ts.error("Error capturing "+e+" pageview",t)}}qs(){if(!this.Ds){var e=()=>{this.js("popstate")};cs(jn,"popstate",e),this.Ds=()=>{jn&&jn.removeEventListener("popstate",e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.Bs=!1,this.Ps=!1,this.Hs=null,this.instance=e,this.Bs=!(null==(t=this.instance.persistence)||!t.props[Ms]),this.rageclicks=new Dv(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return _r(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Ir(this.Se.capture_heatmaps)?Ir(this.Se.enable_heatmaps)?this.Bs:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;lp.info("starting..."),this.Us(),this.ke()}else{var e;clearInterval(null!==(e=this.Hs)&&void 0!==e?e:void 0),this.zs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ms]:t}),this.Bs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Vs(e){this.fe(e.originalEvent,"deadclick")}ke(){this.Hs&&clearInterval(this.Hs),this.Hs=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Un)?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Us(){jn&&Un&&(this.Ws=this.Lr.bind(this),cs(jn,Mo,this.Ws),this.Gs=e=>this.fe(e||(null==jn?void 0:jn.event)),cs(Un,"click",this.Gs,{capture:!0}),this.Zs=e=>this.Qs(e||(null==jn?void 0:jn.event)),cs(Un,"mousemove",this.Zs,{capture:!0}),this.Js=new Xv(this.instance,Yv,this.Vs.bind(this)),this.Js.startIfEnabledOrStop(),this.Ys=this.ke.bind(this),cs(Un,Eo,this.Ys),this.Ps=!0)}zs(){var e;jn&&Un&&(this.Ws&&jn.removeEventListener(Mo,this.Ws),this.Gs&&Un.removeEventListener("click",this.Gs,{capture:!0}),this.Zs&&Un.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Ys&&Un.removeEventListener(Eo,this.Ys),clearTimeout(this.Ks),null==(e=this.Js)||e.stop(),this.Ps=!1)}Xs(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&No(i)&&!qo(i,"body");){if(i===r)return!1;if(cr(t,null==jn?void 0:jn.getComputedStyle(i).position))return!0;i=Jo(i)}return!1}(Go(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}fe(e,t){var i;if(void 0===t&&(t="click"),!Do(e.target)&&up(e)){var n=this.Xs(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&na(Go(e),this.instance.config.rageclick)&&this.eo(r({},n,{type:"rageclick"})),this.eo(n)}}Qs(e){!Do(e.target)&&up(e)&&(clearTimeout(this.Ks),this.Ks=setTimeout((()=>{this.eo(this.Xs(e,"mousemove"))}),500))}eo(e){if(jn){var t=this.Se.disable_capture_url_hashes?Gi(jn.location.href):jn.location.href,r=this.Se.custom_personal_data_properties,i=this.Se.mask_personal_data_properties?[...sc,...r||[]]:[],n=ms(t,i,ac);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(e)}}Lr(){this.R&&!wr(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Xv,webVitalsAutocapture:class{constructor(e){var t;this.Bs=!1,this.Ps=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ro=()=>{clearTimeout(this.io),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.no=e=>{var t;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.so();if(!xr(i))if(Ir(null==e?void 0:e.name)||Ir(null==e?void 0:e.value))ep.error("Invalid metric received",e);else if(!this.oo||this.oo>e.value){this.R.url!==i&&(this.ro(),this.io=setTimeout(this.ro,this.flushToCaptureTimeoutMs)),xr(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=xr(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=r({},e,{$current_url:i,timestamp:Date.now()});xr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.ro()}else ep.error("Ignoring metric with value >= "+this.oo,e)},this.ao=()=>{if(!this.Ps){var e,t,r,i,n=Jn.__PosthogExtensions__;xr(n)||xr(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.no.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.no.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.no.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.no.bind(this)),this.Ps=!0):ep.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Bs=!(null==(t=this._instance.persistence)||!t.props[Ls]),this.startIfEnabled()}get lo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=_r(this.lo)?null==(e=this.lo)?void 0:e.web_vitals_allowed_metrics:void 0;return Ir(r)?(null==(t=this._instance.persistence)?void 0:t.props[$s])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(_r(this.lo)?this.lo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=_r(this.lo)?this.lo.web_vitals_attribution:void 0;return null!=e&&e}get oo(){var e=_r(this.lo)&&Tr(this.lo.__web_vitals_max_value)?this.lo.__web_vitals_max_value:tp;return e>0&&6e4>=e?tp:e}get isEnabled(){var e=null==zn?void 0:zn.protocol;if("http:"!==e&&"https:"!==e)return ep.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=_r(this.lo)?this.lo.web_vitals:Mr(this.lo)?this.lo:void 0;return Mr(t)?t:this.Bs}startIfEnabled(){this.isEnabled&&!this.Ps&&(ep.info("enabled, starting..."),this.Mt(this.ao))}onRemoteConfig(e){if("capturePerformance"in e){var t=_r(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=_r(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ls]:t}),this._instance.persistence.register({[$s]:r})),this.Bs=t,this.startIfEnabled()}}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?ep.error("failed to load script",t):e()}))}so(){var e=jn?this._instance.config.disable_capture_url_hashes?Gi(jn.location.href):jn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...sc,...t||[]]:[];return ms(e,r,ac)}ep.error("Could not determine current URL")}}},Np={exceptionObserver:class{constructor(e){var t,r,i;this.ao=()=>{var e;if(jn&&this.isEnabled&&null!=(e=Jn.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=Jn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Jn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Jn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uo&&this.Se.capture_unhandled_errors&&(this.uo=t(this.captureException.bind(this))),!this.ho&&this.Se.capture_unhandled_rejections&&(this.ho=r(this.captureException.bind(this))),!this.do&&this.Se.capture_console_errors&&(this.do=i(this.captureException.bind(this)))}catch(e){Kf.error("failed to start",e),this.co()}}},this._instance=e,this.vo=!(null==(t=this._instance.persistence)||!t.props[Ps]),this.fo=new qr({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,Ae:Kf}),this.Se=this.po(),this.startIfEnabledOrStop()}po(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return _r(e)?t=r({},t,e):(xr(e)?this.vo:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Kf.info("enabled"),this.co(),this.Mt(this.ao)):this.co()}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Kf.error("failed to load script",t);e()}))}co(){var e,t,r;null==(e=this.uo)||e.call(this),this.uo=void 0,null==(t=this.ho)||t.call(this),this.ho=void 0,null==(r=this.do)||r.call(this),this.do=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.vo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ps]:this.vo}),this.Se=this.po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.po()}captureException(e){var t,r,i,n=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.fo.consumeRateLimit(n)?Kf.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.mo=[],this.yo=Hc(),this._instance=e,this.mo=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Rs))&&void 0!==t?t:[],this.bo=Dn(this._o()),this.wo=new Nn(this.bo)}onConfigChange(){this.bo=Dn(this._o()),this.wo.setConfig(this.bo)}onRemoteConfig(e){var t,r,i;if("errorTracking"in e){var n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this.mo=n,this._instance.persistence&&this._instance.persistence.register({[Rs]:this.mo,[Os]:s})}}get xo(){var e,t=!!this._instance.get_property(Os),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.yo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.bo.enabled)try{if(!kr(e)||0===e.trim().length)return void Bc.warn("Ignoring exception step because message must be a non-empty string");var i=this.ko(t),{sanitizedProperties:n,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>An.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(i);s.length>0&&Bc.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.wo.add(r({[Ln]:e,[Fn]:(new Date).toISOString()},n))}catch(e){Bc.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.So(t)){if(this.Co(t))return this.Io("Exception dropped: matched a suppression rule"),void Bc.info("Skipping exception capture because a suppression rule matched");if(!this.xo&&this.To(t))return this.Io("Exception dropped: thrown by a browser extension"),void Bc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Eo(t))return this.Io("Exception dropped: thrown by the PostHog SDK"),void Bc.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.bo.enabled&&Ir(e.$exception_steps)?this.Mo(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",Zi:!0});return i&&this.wo.clear(),i}catch(e){return Bc.error("Failed to capture exception event. Dropping this exception.",e),void this.wo.clear()}}catch(e){return void Bc.error("Failed to process exception event. Ignoring this exception.",e)}}Mo(e){try{var t=this.wo.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return Bc.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Io(e){this.bo.enabled&&this.wo.add({[Ln]:e,[Fn]:(new Date).toISOString()})}ko(e){return _r(e)?r({},e):{}}_o(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Co(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return kr(r)&&r.length>0&&e.$exception_types.push(r),kr(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.mo.some((e=>{var r=e.values.map((e=>{var r,i=Bh[e.operator],n=yr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}To(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Eo(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}So(e){return!Ir(e)&&yr(e)}}},qp=r({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Po=null,this.Ro=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,r;if(this.zr&&this.zr.register({[As]:!!e.productTours}),!dp(this._instance))return!this.Po&&Ir(null==(t=this.zr)?void 0:t.props[no])||hp.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Po)||r.stop(),this.Po=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Po&&dp(this._instance)&&this.Mt((()=>this.Oo()))}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?hp.error("Could not load product tours script",t):e()}))}Oo(){var e;!this.Po&&null!=(e=Jn.__PosthogExtensions__)&&e.generateProductTours&&(this.Po=Jn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!yr(this.Ro)||t){var r=this.zr;if(r){var i=r.props[no];if(yr(i)&&!t)return this.Ro=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{if(dp(this._instance)){var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return hp.error(n),void e([],{isLoaded:!1,error:n})}var s=yr(t.json.product_tours)?t.json.product_tours:[];this.Ro=s,r&&r.register({[no]:s}),e(s,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ro,{isLoaded:!0})}getActiveProductTours(e){Ir(this.Po)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Po.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Po)||t.showTourById(e)}previewTour(e){this.Po?this.Po.previewTour(e):this.Mt((()=>{var t;this.Oo(),null==(t=this.Po)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this.Po)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Po)||e.nextStep()}previousStep(){var e;null==(e=this.Po)||e.previousStep()}clearCache(){var e;this.Ro=null,null==(e=this.zr)||e.unregister(no)}resetTour(e){var t;null==(t=this.Po)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Po)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Po)||t.cancelPendingTour(e)}}},Ap),jp={siteApps:class{constructor(e){this.Lo=0,this._instance=e,this.Fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ao(e,t){if(t){var r=this.globalsForEvent(t);this.Fo.push(r),this.Fo.length>1e3&&(this.Fo=this.Fo.slice(10))}}get siteAppLoaders(){var e;return null==(e=Jn._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Ao.bind(this));this.$o=()=>{e(),this.Fo=[],this.$o=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(c))h[v]={id:d[v],type:v,properties:f};var{$set_once:p,$set:g}=e;return{event:r({},i(e,cp),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Do(e){var t,r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(vp.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(vp.error("prepare_external_dependency_script returned null"),null):e}No(){var e,t,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==Un?void 0:Un.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.Lo++,this.qo)return this.jo();var h=[],d=this,c=new WeakSet,v=(e,t,r)=>{if(null!=e&&e[t]){var i=e[t];e[t]=r(i),h.push((()=>{e[t]=i}))}},f=e=>{if(c.has(e))return e;var t=d.Do(e);return t&&c.add(t),t},p=e=>e.map((e=>"string"==typeof e?e:f(e))).filter((e=>!Cr(e)));return v(u,"appendChild",(e=>function(t){var r=f(t);return r?e.call(this,r):t})),v(u,"insertBefore",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):t})),v(u,"replaceChild",(e=>function(t,r){var i=f(t);return i?e.call(this,i,r):r})),[null==(t=l.Element)?void 0:t.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((e=>{v(e,"append",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"prepend",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((e=>{v(e,"before",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"after",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,p(r))})),v(e,"replaceWith",(e=>function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:e.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(e=>function(t,r){var i=f(r);return i?e.call(this,t,i):null})),this.qo=()=>{h.forEach((e=>e())),this.qo=void 0},this.jo()}jo(){var e=!1;return()=>{var t;e||(e=!0,this.Lo--,0===this.Lo&&(null==(t=this.qo)||t.call(this)))}}Bo(e,t){void 0===t&&(t=!0);var r=this.No();try{var i=e(r);return t&&r(),i}catch(e){throw r(),e}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.Fo.length&&(vp.info("Processing "+this.Fo.length+" events for site app with id "+e.id),this.Fo.forEach((e=>this.Bo((()=>null==t.processEvent?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&(null==(r=this.$o)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,vp.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=this.Bo((t=>e.init({posthog:this._instance,callback(e){t(),n(e)}})),!1);s&&(t.processEvent=s),i=!0}catch(t){vp.error(fp+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){vp.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Ho(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Uo(e){var t=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(e),i=function(i){try{t.Bo((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(t){vp.error("Error while processing event "+e.event+" for site app "+i.id,t)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Ho(),void this._instance.on("eventCaptured",(e=>this.Uo(e)))):void vp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.$o)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;Jn["__$$ph_site_app_"+e]=n._instance,null==(t=Jn.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return vp.error(fp+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else vp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Bp={tracingHeaders:class{constructor(e){this.zo=void 0,this.Vo=void 0,this.Wo=void 0,this.ao=()=>{var e,t,r=this.Go();r?(xr(this.zo)&&(this.zo=null==(e=Jn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),xr(this.Vo)&&(this.Vo=null==(t=Jn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.co()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,r;null!=(t=Jn.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(r=Jn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Xf.error("failed to load script",t);e()}))}Zo(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Go(){var e=this.Zo();return yr(e)?(yr(this.Wo)?this.Wo.splice(0,this.Wo.length,...e):this.Wo=[...e],e.length>0?this.Wo:void 0):(yr(this.Wo)&&this.Wo.splice(0),this.Wo=e||void 0,this.Wo)}co(){var e,t;null==(e=this.zo)||e.call(this),null==(t=this.Vo)||t.call(this),this.zo=void 0,this.Vo=void 0}startIfEnabledOrStop(){this.Go()?this.Mt(this.ao):this.co()}}},Hp=r({surveys:class{get Se(){return this._instance.config}constructor(e){this.Qo=void 0,this._surveyManager=null,this.Jo=!1,this.Yo=[],this.Ko=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(Ir(t))return Mu.warn("Flags not loaded yet. Not loading surveys.");var r=yr(t);this.Qo=r?t.length>0:t,Mu.info("flags response received, isSurveysEnabled: "+this.Qo),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(Lu)||null!=i&&i.startsWith(Fu))&&t.push(i)}t.forEach((e=>localStorage.removeItem(e)))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.Jo)Mu.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)Mu.info(_p);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())Mu.info("Not loading surveys in cookieless mode without consent.");else{var e=null==Jn?void 0:Jn.__PosthogExtensions__;if(e){if(!xr(this.Qo)||this.Se.advanced_enable_surveys){var t=this.Qo||this.Se.advanced_enable_surveys;this.Jo=!0;try{var r=e.generateSurveys;if(r)return void this.Xo(r,t);var i=e.loadExternalDependency;if(!i)return void this.ea(xo);i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.ea("Could not load surveys script",r):this.Xo(e.generateSurveys,t)}))}catch(e){throw this.ea("Error initializing surveys",e),e}finally{this.Jo=!1}}}else Mu.error("PostHog Extensions not found.")}}Xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new yp(this._instance),Mu.info("Surveys loaded successfully"),this.ta({isLoaded:!0})}ea(e,t){Mu.error(e,t),this.ta({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yo.push(e),this._surveyManager&&this.ta({isLoaded:!0}),()=>{this.Yo=this.Yo.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Se.disable_surveys)return Mu.info(_p),e([]);var r,i=this._instance.get_property(to);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Ko?this.Ko.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this.Ko=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:t=>{var i;this.Ko=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Mu.error(s);var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}var a,l=t.json.surveys||[],u=l.filter((e=>Pu(e)&&(Ru(e)||Ou(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[to]:l,[ro]:Date.now()});var h={isLoaded:!0};e(l,h),null==r||r({surveys:l,context:h})}}))}ta(e){for(var t of this.Yo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Mu.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Ir(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Mu.warn("init was not called")}ra(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}ia(e){if(Ir(this._surveyManager))return{eligible:!1,reason:bp};var t="string"==typeof e?this.ra(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ir(this._surveyManager))return Mu.warn("init was not called"),{visible:!1,disabledReason:bp};var t=this.ia(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Ir(this._surveyManager)?(Mu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:bp})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this.ia(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(Ir(this._surveyManager))Mu.warn("init was not called");else{var n="string"==typeof e?this.ra(e):e;if(null!=n&&n.id)if(Nu.includes(n.type)){var s=null==Un?void 0:Un.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Mu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Mu.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),Mu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Mu.warn("Survey element not found")}else Mu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Mu.warn("Survey not found")}}displaySurvey(e,t){var i;if(Ir(this._surveyManager))Mu.warn("init was not called");else{var n=this.ra(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==_u&&t.initialResponses&&Mu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Mu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Mu.warn("Survey not found")}}cancelPendingSurvey(e){Ir(this._surveyManager)?Mu.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},Ap),Up={toolbar:class{constructor(e){this.instance=e}na(e){Jn.ph_toolbar_state=e}sa(){var e;return null!==(e=Jn.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),vs(this.instance.config))return!1;if(!jn||!Un)return!1;e=null!=e?e:jn.location,r=null!=r?r:jn.history;try{if(!t){try{jn.localStorage.setItem("test","test"),jn.localStorage.removeItem("test")}catch(e){return!1}t=null==jn?void 0:jn.localStorage}var i,n=wp||ys(e.hash,"__posthog")||ys(e.hash,"state"),s=n?as((()=>JSON.parse(atob(decodeURIComponent(n)))))||as((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(xp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}oa(e){var t=Jn.ph_load_toolbar||Jn.ph_load_editor;!Ir(t)&&br(t)?t(e,this.instance):kp.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Un||!Un.getElementById(mo));if(!jn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(jn.localStorage.setItem(xp,JSON.stringify(r({},n,{source:void 0}))),2===this.sa())this.oa(n);else if(0===this.sa()){var s;this.na(1),null==(s=Jn.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return kp.error("[Toolbar] Failed to load",e),void this.na(0);this.na(2),this.oa(n)})),cs(jn,"turbolinks:load",(()=>{this.na(0),this.loadToolbar(n)}))}return!0}aa(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},zp=r({experiments:Rp},Ap),Vp={conversations:class{constructor(e){this.la=void 0,this._conversationsManager=null,this.ua=!1,this.ha=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Ir(t)||(Mr(t)?this.la=t:(this.la=t.enabled,this.ha=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.la=void 0,this.ha=null}loadIfEnabled(){if(!(this._conversationsManager||this.ua||this._instance.config.disable_conversations||vs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==Jn?void 0:Jn.__PosthogExtensions__;if(e&&!xr(this.la)&&this.la)if(this.ha&&this.ha.token){this.ua=!0;try{var t=e.initConversations;if(t)return this.da(t),void(this.ua=!1);var r=e.loadExternalDependency;if(!r)return void this.ca(xo);r(this._instance,"conversations",(t=>{t||!e.initConversations?this.ca("Could not load conversations script",t):this.da(e.initConversations),this.ua=!1}))}catch(e){this.ca("Error initializing conversations",e),this.ua=!1}}else Op.error("Conversations enabled but missing token in remote config.")}}da(e){if(this.ha)try{this._conversationsManager=e(this.ha,this._instance),Op.info("Conversations loaded successfully")}catch(e){this.ca("Error completing conversations initialization",e)}else Op.error("Cannot complete initialization: remote config is null")}ca(e,t){Op.error(e,t),this._conversationsManager=null,this.ua=!1}show(){this._conversationsManager?this._conversationsManager.show():Op.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.la&&!Cr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(Op.warn(Lp),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(Op.warn(Lp),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(Op.warn(Lp),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(Op.warn(Lp),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(Op.warn(Lp),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(Op.warn(Lp),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Op.warn(Lp),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}en(){var e;null==(e=this._conversationsManager)||e.setIdentity()}tn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},Wp={logs:class{constructor(e){var t;this.va=!1,this.fa=!1,this.Ae=rs("[logs]"),this._r=[],this.pa=[],this.ga=()=>{var e,t;null==(e=this.ma)||e.onReconnect(),null==(t=this.ya)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.va=!0),jn&&cs(jn,"online",this.ga)}ba(e,t,r,i){var n,s=function(e,t){var r,i,n,s,o,a,l,u=null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==e?void 0:e.maxBufferSize)&&void 0!==i?i:100,d=null!=t&&t.consoleCapture?void 0:null!==(n=null==e?void 0:e.maxLogsPerInterval)&&void 0!==n?n:1e3,c=xr(d)?Math.max(h,2048):Math.max(h,d),v=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==s?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:v,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new rn(this._a(e,t),s,this.Ae,(()=>this.wa()),(e=>e()),void 0,i),s]}xa(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.ma&&this.ka===r||(null==(t=this.ma)||t.reset(),this.ka=r,[this.ma,this.Sa]=this.ba((()=>this._r),(e=>{this._r=e}))),this.ma}Ca(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.ya&&this.Ia===r||(null==(t=this.ya)||t.reset(),this.Ia=r,[this.ya,this.Ta]=this.ba((()=>this.pa),(e=>{this.pa=e}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Fp)),this.ya}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Ir(r)&&r&&(this.va=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],null==(e=this.ma)||e.reset(),this.pa=[],null==(t=this.ya)||t.reset()}captureLog(e){this.xa().captureLog(e)}le(e){this.Ca().captureLog(e)}get logger(){return this.Ea||(this.Ea={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Ea}flushLogs(e){e?this.Ma(e):(this.ma&&this.ma.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))),this.ya&&this.ya.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.va&&!this.fa){var e=null==Jn?void 0:Jn.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.Ae.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.fa=!0)})):this.Ae.error(xo)}else this.Ae.error("PostHog Extensions not found.")}}_a(e,t){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===Kt.LogsQueue?e():void 0,setPersistedProperty(e,r){var i;e===Kt.LogsQueue&&t(null!==(i=r)&&void 0!==i?i:[])},ht:e=>this.ht(e),getLibraryId:()=>Xn.LIB_NAME,getLibraryVersion:()=>Xn.LIB_VERSION}}ht(e){return new Promise((t=>{var r=!1,i=e=>{r||(r=!0,clearTimeout(n),t(e))},n=setTimeout((()=>i({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Pa(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;if(t>=200&&300>t)i({kind:"ok"});else if(413===t)i({kind:"too-large"});else if(0!==t&&429!==t&&500>t)i({kind:"fatal",error:new Error("logs request failed with status "+t)});else{var r;i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+t)})}}})}))}Ma(e){this._r.length>0&&this.Ra(e,this._r,this.Sa,Xn.LIB_NAME,(e=>{this._r=e})),this.pa.length>0&&this.Ra(e,this.pa,this.Ta,Fp,(e=>{this.pa=e}))}Ra(e,t,r,i,n){if(0!==t.length){var s=t.map((e=>e.record));n([]);var o=tn(s,en(r,Xn.LIB_NAME,Xn.LIB_VERSION),i,Xn.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Pa(),data:o,compression:"best-available",batchKey:"logs",transport:e})}}Pa(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}wa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r,windowId:i,sessionStartTimestamp:n,lastActivityTimestamp:s}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r,t.windowId=i,Ir(n)||(t.sessionStartTimestamp=n),Ir(s)||(t.lastActivityTimestamp=s)}if(null!=Jn&&null!=(e=Jn.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?Gi(Jn.location.href):Jn.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},Gp=r({},Ap,$p,Dp,Np,qp,jp,Hp,Bp,Up,zp,Vp,Wp);Yf.__defaultExtensionClasses=r({},Gp),function(){Xn.SDK_DIST_CHANNEL="cdn";var e=Nf[Vf]=new Yf,t=Jn.posthog;t&&ns(t._i,(function(r){if(r&&yr(r)){var i=e.init(r[0],r[1],r[2]),n=t[r[2]]||t;i&&(i._execute_array.call(i.people,n.people),i._execute_array(n))}})),Jn.posthog=e,function(){function e(){e.done||(e.done=!0,Wf=!1,ns(Nf,(function(e){e._dom_loaded()})))}null!=Un&&Un.addEventListener?"complete"===Un.readyState?e():cs(Un,"DOMContentLoaded",e,{capture:!1}):jn&&ts.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}()}();
2
2
  //# sourceMappingURL=array.full.js.map